@datalabrotterdam/nova-ai-cli 1.0.1-alpha.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp/agent.d.ts +2 -1
- package/dist/acp/agent.js +41 -5
- package/dist/acp/index.js +1 -0
- package/dist/acp/mcp.d.ts +11 -0
- package/dist/acp/mcp.js +90 -0
- package/package.json +3 -1
- package/src/acp/web/dist/assets/index-CSccI7lJ.css +1 -0
- package/src/acp/web/dist/assets/index-D2Z0sfLR.js +1 -0
- package/src/acp/web/dist/favicon.svg +46 -0
- package/src/acp/web/dist/index.html +21 -2
- package/src/acp/web/dist/assets/index-B3sTKEem.js +0 -1
- package/src/acp/web/dist/assets/index-DwysEXf2.css +0 -1
package/dist/acp/agent.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ export declare class NovaAgent {
|
|
|
3
3
|
private readonly sessions;
|
|
4
4
|
private clientCapabilities;
|
|
5
5
|
initialize(params: acp.InitializeRequest): acp.InitializeResponse;
|
|
6
|
-
newSession(params: acp.NewSessionRequest): acp.NewSessionResponse
|
|
6
|
+
newSession(params: acp.NewSessionRequest): Promise<acp.NewSessionResponse>;
|
|
7
7
|
loadSession(params: acp.LoadSessionRequest, client: acp.AgentContext): Promise<acp.LoadSessionResponse>;
|
|
8
8
|
listSessions(params: acp.ListSessionsRequest): acp.ListSessionsResponse;
|
|
9
9
|
authenticate(params: acp.AuthenticateRequest): Promise<acp.AuthenticateResponse>;
|
|
10
10
|
prompt(params: acp.PromptRequest, client: acp.AgentContext): Promise<acp.PromptResponse>;
|
|
11
11
|
cancel(params: acp.CancelNotification): void;
|
|
12
|
+
closeSession(params: acp.CloseSessionRequest): Promise<acp.CloseSessionResponse>;
|
|
12
13
|
}
|
package/dist/acp/agent.js
CHANGED
|
@@ -2,8 +2,9 @@ import * as acp from "@agentclientprotocol/sdk";
|
|
|
2
2
|
import { NovaAI, NovaAIError } from "@datalabrotterdam/nova-sdk";
|
|
3
3
|
import { runBrowserAuth } from "./auth-server.js";
|
|
4
4
|
import { readCredentials } from "./credentials.js";
|
|
5
|
+
import { closeMcpConnections, connectMcpServers, listMcpTools } from "./mcp.js";
|
|
5
6
|
import { appendSessionTurn, deriveTitle, listStoredSessions, loadStoredSession } from "./sessions.js";
|
|
6
|
-
import { availableTools, buildToolsSystemPrompt, extractToolCall,
|
|
7
|
+
import { availableTools, buildToolsSystemPrompt, extractToolCall, hasPendingFence, requestPermissionIfNeeded, sendToolCallPending, sendToolCallUpdate, } from "./tools/index.js";
|
|
7
8
|
const AUTH_METHOD_ID = "nova-api-key";
|
|
8
9
|
const MAX_TOOL_ROUNDS = 10;
|
|
9
10
|
export class NovaAgent {
|
|
@@ -15,8 +16,18 @@ export class NovaAgent {
|
|
|
15
16
|
protocolVersion: acp.PROTOCOL_VERSION,
|
|
16
17
|
agentCapabilities: {
|
|
17
18
|
loadSession: true,
|
|
19
|
+
promptCapabilities: {
|
|
20
|
+
// Image/audio content isn't forwarded to the model; only text and
|
|
21
|
+
// embedded text resources are supported.
|
|
22
|
+
embeddedContext: true,
|
|
23
|
+
},
|
|
24
|
+
mcpCapabilities: {
|
|
25
|
+
http: true,
|
|
26
|
+
sse: true,
|
|
27
|
+
},
|
|
18
28
|
sessionCapabilities: {
|
|
19
29
|
list: {},
|
|
30
|
+
close: {},
|
|
20
31
|
},
|
|
21
32
|
},
|
|
22
33
|
authMethods: [
|
|
@@ -28,9 +39,18 @@ export class NovaAgent {
|
|
|
28
39
|
],
|
|
29
40
|
};
|
|
30
41
|
}
|
|
31
|
-
newSession(params) {
|
|
42
|
+
async newSession(params) {
|
|
32
43
|
const sessionId = crypto.randomUUID();
|
|
33
|
-
|
|
44
|
+
const mcpConnections = await connectMcpServers(params.mcpServers);
|
|
45
|
+
const mcpTools = await listMcpTools(mcpConnections);
|
|
46
|
+
this.sessions.set(sessionId, {
|
|
47
|
+
pendingPrompt: null,
|
|
48
|
+
cwd: params.cwd,
|
|
49
|
+
history: [],
|
|
50
|
+
title: null,
|
|
51
|
+
mcpConnections,
|
|
52
|
+
mcpTools,
|
|
53
|
+
});
|
|
34
54
|
return { sessionId };
|
|
35
55
|
}
|
|
36
56
|
async loadSession(params, client) {
|
|
@@ -38,11 +58,15 @@ export class NovaAgent {
|
|
|
38
58
|
if (!stored) {
|
|
39
59
|
throw acp.RequestError.internalError(undefined, `Session ${params.sessionId} not found`);
|
|
40
60
|
}
|
|
61
|
+
const mcpConnections = await connectMcpServers(params.mcpServers);
|
|
62
|
+
const mcpTools = await listMcpTools(mcpConnections);
|
|
41
63
|
this.sessions.set(params.sessionId, {
|
|
42
64
|
pendingPrompt: null,
|
|
43
65
|
cwd: params.cwd,
|
|
44
66
|
history: stored.messages,
|
|
45
67
|
title: stored.title,
|
|
68
|
+
mcpConnections,
|
|
69
|
+
mcpTools,
|
|
46
70
|
});
|
|
47
71
|
for (const message of stored.messages) {
|
|
48
72
|
if (typeof message.content !== "string" || !message.content)
|
|
@@ -95,7 +119,8 @@ export class NovaAgent {
|
|
|
95
119
|
if (!model) {
|
|
96
120
|
throw new Error("No Nova model configured. Re-run authentication or set NOVA_MODEL.");
|
|
97
121
|
}
|
|
98
|
-
const tools = availableTools(this.clientCapabilities);
|
|
122
|
+
const tools = [...availableTools(this.clientCapabilities), ...session.mcpTools];
|
|
123
|
+
const findSessionTool = (name) => tools.find((tool) => tool.name === name);
|
|
99
124
|
const systemPrompt = buildToolsSystemPrompt(tools, session.cwd);
|
|
100
125
|
const userMessage = { role: "user", content: contentBlocksToText(params.prompt) };
|
|
101
126
|
session.history.push(userMessage);
|
|
@@ -146,7 +171,7 @@ export class NovaAgent {
|
|
|
146
171
|
pushTurn({ role: "assistant", content: buffer });
|
|
147
172
|
return { stopReason: "end_turn" };
|
|
148
173
|
}
|
|
149
|
-
const tool =
|
|
174
|
+
const tool = findSessionTool(toolCall.name);
|
|
150
175
|
const toolCallId = crypto.randomUUID();
|
|
151
176
|
const toolCtx = { client, sessionId: params.sessionId, signal: abortController.signal };
|
|
152
177
|
pushTurn({ role: "assistant", content: buffer });
|
|
@@ -191,6 +216,15 @@ export class NovaAgent {
|
|
|
191
216
|
cancel(params) {
|
|
192
217
|
this.sessions.get(params.sessionId)?.pendingPrompt?.abort();
|
|
193
218
|
}
|
|
219
|
+
async closeSession(params) {
|
|
220
|
+
const session = this.sessions.get(params.sessionId);
|
|
221
|
+
if (session) {
|
|
222
|
+
session.pendingPrompt?.abort();
|
|
223
|
+
await closeMcpConnections(session.mcpConnections);
|
|
224
|
+
this.sessions.delete(params.sessionId);
|
|
225
|
+
}
|
|
226
|
+
return {};
|
|
227
|
+
}
|
|
194
228
|
}
|
|
195
229
|
function contentBlocksToText(prompt) {
|
|
196
230
|
return prompt
|
|
@@ -199,6 +233,8 @@ function contentBlocksToText(prompt) {
|
|
|
199
233
|
return block.text;
|
|
200
234
|
if (block.type === "resource_link")
|
|
201
235
|
return block.uri;
|
|
236
|
+
if (block.type === "resource" && "text" in block.resource)
|
|
237
|
+
return block.resource.text;
|
|
202
238
|
return "";
|
|
203
239
|
})
|
|
204
240
|
.filter(Boolean)
|
package/dist/acp/index.js
CHANGED
|
@@ -12,6 +12,7 @@ async function runAcp(...args) {
|
|
|
12
12
|
.onRequest("session/new", (ctx) => agentImpl.newSession(ctx.params))
|
|
13
13
|
.onRequest("session/load", (ctx) => agentImpl.loadSession(ctx.params, ctx.client))
|
|
14
14
|
.onRequest("session/list", (ctx) => agentImpl.listSessions(ctx.params))
|
|
15
|
+
.onRequest("session/close", (ctx) => agentImpl.closeSession(ctx.params))
|
|
15
16
|
.onRequest("authenticate", (ctx) => agentImpl.authenticate(ctx.params))
|
|
16
17
|
.onRequest("session/prompt", (ctx) => agentImpl.prompt(ctx.params, ctx.client))
|
|
17
18
|
.onNotification("session/cancel", (ctx) => agentImpl.cancel(ctx.params))
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as acp from "@agentclientprotocol/sdk";
|
|
2
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
3
|
+
import type { ToolDefinition } from "./tools/types.js";
|
|
4
|
+
export type McpConnection = {
|
|
5
|
+
serverName: string;
|
|
6
|
+
client: Client;
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare function connectMcpServers(servers: acp.McpServer[]): Promise<McpConnection[]>;
|
|
10
|
+
export declare function closeMcpConnections(connections: McpConnection[]): Promise<void>;
|
|
11
|
+
export declare function listMcpTools(connections: McpConnection[]): Promise<ToolDefinition[]>;
|
package/dist/acp/mcp.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
|
+
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
3
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
4
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
5
|
+
const TOOL_NAME_PREFIX = "mcp__";
|
|
6
|
+
function sanitize(name) {
|
|
7
|
+
return name.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
8
|
+
}
|
|
9
|
+
function headersToRecord(headers) {
|
|
10
|
+
return Object.fromEntries(headers.map((h) => [h.name, h.value]));
|
|
11
|
+
}
|
|
12
|
+
function buildTransport(server) {
|
|
13
|
+
if ("type" in server && server.type === "http") {
|
|
14
|
+
return new StreamableHTTPClientTransport(new URL(server.url), {
|
|
15
|
+
requestInit: { headers: headersToRecord(server.headers) },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if ("type" in server && server.type === "sse") {
|
|
19
|
+
return new SSEClientTransport(new URL(server.url), {
|
|
20
|
+
requestInit: { headers: headersToRecord(server.headers) },
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const stdio = server;
|
|
24
|
+
return new StdioClientTransport({
|
|
25
|
+
command: stdio.command,
|
|
26
|
+
args: stdio.args,
|
|
27
|
+
env: Object.fromEntries(stdio.env.map((e) => [e.name, e.value])),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export async function connectMcpServers(servers) {
|
|
31
|
+
const connections = [];
|
|
32
|
+
for (const server of servers) {
|
|
33
|
+
if ("type" in server && server.type === "acp")
|
|
34
|
+
continue; // experimental ACP-transport MCP, not yet supported
|
|
35
|
+
const client = new Client({ name: "nova-ai-cli", version: "1.0.0" });
|
|
36
|
+
const transport = buildTransport(server);
|
|
37
|
+
try {
|
|
38
|
+
await client.connect(transport);
|
|
39
|
+
connections.push({ serverName: server.name, client, close: () => client.close() });
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
console.error(`Failed to connect MCP server "${server.name}": ${err.message}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return connections;
|
|
46
|
+
}
|
|
47
|
+
export async function closeMcpConnections(connections) {
|
|
48
|
+
await Promise.all(connections.map((c) => c.close().catch(() => { })));
|
|
49
|
+
}
|
|
50
|
+
function toToolResult(result) {
|
|
51
|
+
const text = Array.isArray(result.content)
|
|
52
|
+
? result.content
|
|
53
|
+
.map((block) => {
|
|
54
|
+
if (typeof block === "object" && block !== null && "type" in block && block.type === "text") {
|
|
55
|
+
return block.text;
|
|
56
|
+
}
|
|
57
|
+
return "";
|
|
58
|
+
})
|
|
59
|
+
.filter(Boolean)
|
|
60
|
+
.join("\n")
|
|
61
|
+
: "";
|
|
62
|
+
if (result.isError)
|
|
63
|
+
return { error: text || "MCP tool call failed." };
|
|
64
|
+
return { output: text };
|
|
65
|
+
}
|
|
66
|
+
export async function listMcpTools(connections) {
|
|
67
|
+
const tools = [];
|
|
68
|
+
for (const connection of connections) {
|
|
69
|
+
const { tools: serverTools } = await connection.client.listTools();
|
|
70
|
+
for (const tool of serverTools) {
|
|
71
|
+
const qualifiedName = `${TOOL_NAME_PREFIX}${sanitize(connection.serverName)}__${sanitize(tool.name)}`;
|
|
72
|
+
tools.push({
|
|
73
|
+
name: qualifiedName,
|
|
74
|
+
description: `${qualifiedName}: ${tool.description ?? tool.name} (from MCP server "${connection.serverName}")`,
|
|
75
|
+
requiredCapability: () => true,
|
|
76
|
+
mutating: true,
|
|
77
|
+
async execute(_ctx, args) {
|
|
78
|
+
try {
|
|
79
|
+
const result = await connection.client.callTool({ name: tool.name, arguments: args });
|
|
80
|
+
return toToolResult(result);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return { error: err.message };
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return tools;
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalabrotterdam/nova-ai-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "CLI for DataLab Rotterdam's Nova AI, with an Agent Client Protocol mode for editors/IDEs, backed by @datalabrotterdam/nova-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "DataLab Rotterdam",
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@agentclientprotocol/sdk": "^0.29.0",
|
|
41
|
+
"@datalabrotterdam/nova-ai-cli": "^1.0.1",
|
|
41
42
|
"@datalabrotterdam/nova-sdk": "^1.3.2",
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
42
44
|
"@sourceregistry/node-webserver": "^1.8.0"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-theme=dark]{--color-primary:#63e;--color-success:#4ade80;--color-danger:#ef4444;--color-text-primary:#e4e6eb;--color-text-secondary:#b0b3b8;--color-border-primary:#424242;--color-background-page:linear-gradient(150deg, #000 0%, #0b0618 100%);--color-card-bg:#121212d1;--color-card-border:#ffffff0f;--color-input-bg:#1a1a1e}[data-theme=light]{--color-primary:#63e;--color-success:#16a34a;--color-danger:#dc2626;--color-text-primary:#212529;--color-text-secondary:#5b5b5b;--color-border-primary:#e0e0df;--color-background-page:linear-gradient(150deg, #f0f0f0 0%, #ede8ff 100%);--color-card-bg:#ffffffc7;--color-card-border:#fff9;--color-input-bg:#fff}html,body{min-height:100dvh;margin:0}body{color:var(--color-text-primary);background:var(--color-background-page);font-family:Poppins,system-ui,-apple-system,sans-serif;transition:background .2s,color .2s}main.svelte-1n46o8q{justify-content:center;align-items:center;min-height:100dvh;padding:1.5rem;display:flex;position:relative}.theme-toggle.svelte-1n46o8q{border:1px solid var(--color-border-primary);background:var(--color-card-bg);width:36px;height:36px;color:var(--color-text-primary);cursor:pointer;border-radius:50%;justify-content:center;align-items:center;transition:all .15s;display:flex;position:absolute;top:1.25rem;right:1.25rem}.theme-toggle.svelte-1n46o8q:hover{opacity:.8}.theme-toggle.svelte-1n46o8q svg:where(.svelte-1n46o8q){width:16px;height:16px}.card.svelte-1n46o8q{background:var(--color-card-bg);border:1px solid var(--color-card-border);text-align:center;border-radius:1rem;width:100%;max-width:380px;padding:2.5rem 2rem;box-shadow:0 10px 20px #0003}.logo.svelte-1n46o8q{width:48px;height:48px;color:var(--color-text-primary);margin:0 auto 1.25rem}.logo.svelte-1n46o8q svg:where(.svelte-1n46o8q){width:100%;height:100%}h1.svelte-1n46o8q{margin-bottom:.5rem;font-size:1.25rem;font-weight:600}.subtitle.svelte-1n46o8q{color:var(--color-text-secondary);margin-bottom:1.5rem;font-size:.875rem}form.svelte-1n46o8q{flex-direction:column;gap:.75rem;display:flex}input.svelte-1n46o8q{box-sizing:border-box;border:1px solid var(--color-border-primary);background:var(--color-input-bg);width:100%;color:inherit;border-radius:.75rem;padding:.65rem .85rem;font-family:inherit;font-size:.925rem;transition:all .15s}input.svelte-1n46o8q:focus{border-color:var(--color-primary);outline:none}button[type=submit].svelte-1n46o8q{background:var(--color-primary);color:#fff;cursor:pointer;border:none;border-radius:.75rem;padding:.65rem 1rem;font-family:inherit;font-size:.925rem;font-weight:500;transition:all .15s}button[type=submit].svelte-1n46o8q:hover:not(:disabled){opacity:.85}button[type=submit].svelte-1n46o8q:disabled{opacity:.4;cursor:not-allowed}.success.svelte-1n46o8q{color:var(--color-success);font-size:.925rem}.error.svelte-1n46o8q{color:var(--color-danger);margin-top:.75rem;font-size:.875rem}.help-links.svelte-1n46o8q{border-top:1px solid var(--color-border-primary);flex-direction:column;gap:.5rem;margin-top:1.5rem;padding-top:1.25rem;display:flex}.help-button.svelte-1n46o8q{border:1px solid var(--color-primary);color:var(--color-primary);border-radius:.75rem;justify-content:center;align-items:center;padding:.5rem .85rem;font-size:.85rem;font-weight:500;text-decoration:none;transition:all .15s;display:inline-flex}.help-button.svelte-1n46o8q:hover{background:var(--color-primary);color:#fff}.docs-link.svelte-1n46o8q{color:var(--color-text-secondary);font-size:.8rem;text-decoration:underline}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){return e()}function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var h=1024,g=2048,_=4096,ee=8192,te=16384,ne=32768,re=1<<25,ie=65536,ae=1<<19,oe=1<<20,se=65536,ce=1<<21,le=1<<22,ue=1<<23,de=Symbol(`$state`),fe=Symbol(``),pe=Symbol(`attributes`),me=Symbol(`class`),he=Symbol(`style`),ge=Symbol(`text`),_e=Symbol(`form reset`),ve=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ye=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function be(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function xe(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Se(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ce(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function we(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Te(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function De(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Oe(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ke(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ae={},v=Symbol(`uninitialized`),je=`http://www.w3.org/1999/xhtml`;function Me(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ne(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Pe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var y=!1;function Fe(e){y=e}var b;function x(e){if(e===null)throw Ne(),Ae;return b=e}function Ie(){return x(L(b))}function S(e){if(y){if(L(b)!==null)throw Ne(),Ae;b=e}}function Le(e=1){if(y){for(var t=e,n=b;t--;)n=L(n);b=n}}function Re(e=!0){for(var t=0,n=b;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=L(n);e&&n.remove(),n=i}}function ze(e){if(!e||e.nodeType!==8)throw Ne(),Ae;return e.data}function Be(e){return e===this.v}function Ve(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function He(e){return!Ve(e,this.v)}var C=!1,Ue=!1;function We(){Ue=!0}var w=null;function Ge(e){w=e}function Ke(e,t=!1,n){w={p:w,i:!1,c:null,e:null,s:e,x:null,r:q,l:Ue&&!t?{s:null,u:null,$:[]}:null}}function qe(e){var t=w,n=t.e;if(n!==null){t.e=null;for(var r of n)pn(r)}return e!==void 0&&(t.x=e),t.i=!0,w=t.p,e??{}}function Je(){return!Ue||w!==null&&w.l===null}var T=[];function Ye(){var e=T;T=[],p(e)}function E(e){if(T.length===0&&!wt){var t=T;queueMicrotask(()=>{t===T&&Ye()})}T.push(e)}function Xe(){for(;T.length>0;)Ye()}function Ze(e){var t=q;if(t===null)return W.f|=ue,e;if(!(t.f&32768)&&!(t.f&4))throw e;D(e,t)}function D(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var Qe=~(g|_|h);function O(e,t){e.f=e.f&Qe|t}function $e(e){e.f&512||e.deps===null?O(e,h):O(e,_)}function et(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=se,et(t.deps))}function tt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),et(e.deps),O(e,h)}var nt=!1;function rt(e){let t=0,n=Vt(0),r;return()=>{un()&&($(n),_n(()=>(t===0&&(r=Yn(()=>e(()=>Gt(n)))),t+=1,()=>{E(()=>{--t,t===0&&(r?.(),r=void 0,Gt(n))})})))}}var it=ie|ae;function at(e,t,n,r){new ot(e,t,n,r)}var ot=class{parent;is_pending=!1;transform_error;#e;#t=y?b:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=rt(()=>(this.#m=Vt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=q;t.b=this,t.f|=128,n(e)},this.parent=q.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=yn(()=>{if(y){let e=this.#t;Ie();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},it),y&&(this.#e=b)}#g(){try{this.#a=V(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=V(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=V(()=>e(this.#e)),E(()=>{var e=this.#c=document.createDocumentFragment(),t=F();e.append(t),this.#a=this.#x(()=>V(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Tn(this.#o,()=>{this.#o=null}),this.#b(k))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=V(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();kn(this.#a,e);let t=this.#n.pending;this.#o=V(()=>t(this.#e))}else this.#b(k)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){tt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=q,n=W,r=w;J(this.#i),K(this.#i),Ge(this.#i.ctx);try{return At.ensure(),e()}catch(e){return Ze(e),null}finally{J(t),K(n),Ge(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Tn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,E(()=>{this.#d=!1,this.#m&&Ut(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),$(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;k?.is_fork?(this.#a&&k.skip_effect(this.#a),this.#o&&k.skip_effect(this.#o),this.#s&&k.skip_effect(this.#s),k.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(H(this.#a),null),this.#o&&=(H(this.#o),null),this.#s&&=(H(this.#s),null),y&&(x(this.#t),Le(),x(Re()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Pe();return}r=!0,i&&ke(),this.#s!==null&&Tn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){D(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return V(()=>{var t=q;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return D(e,this.#i.parent),null}}))};E(()=>{var t;try{t=this.transform_error(e)}catch(e){D(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>D(e,this.#i&&this.#i.parent)):o(t)})}};function st(e,t,n,r){let i=Je()?dt:mt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=q,c=ct(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){D(e,s)}lt()}}var d=ut();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>pt(e))).then(u).catch(e=>D(e,s)).finally(d)}l?l.then(()=>{c(),f(),lt()}):f()}function ct(){var e=q,t=W,n=w,r=k;return function(i=!0){J(e),K(t),Ge(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function lt(e=!0){J(null),K(null),Ge(null),e&&k?.deactivate()}function ut(){var e=q,t=e.b,n=k,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function dt(e){var t=2|g;return q!==null&&(q.f|=ae),{ctx:w,deps:null,effects:null,equals:Be,f:t,fn:e,reactions:null,rv:0,v,wv:0,parent:q,ac:null}}var ft=Symbol(`obsolete`);function pt(e,t,n){let r=q;r===null&&xe();var i=void 0,a=Vt(v),o=!W,s=new Set;return gn(()=>{var t=q,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==ve&&n.reject(e)}).finally(lt)}catch(e){n.reject(e),lt()}var c=k;if(o){if(t.f&32768)var l=ut();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(ft);else for(let e of s.values())e.reject(ft);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==ft&&(c.activate(),t?(a.f|=ue,Ut(a,t)):(a.f&8388608&&(a.f^=ue),Ut(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),dn(()=>{for(let e of s)e.reject(ft)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function mt(e){let t=dt(e);return t.equals=He,t}function ht(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)H(t[n])}}function gt(e){var t,n=q,r=e.parent;if(!U&&r!==null&&e.v!==v&&r.f&24576)return Me(),e.v;J(r);try{e.f&=~se,ht(e),t=Hn(e)}finally{J(n)}return t}function _t(e){var t=gt(e);if(!e.equals(t)&&(e.wv=zn(),(!k?.is_fork||e.deps===null)&&(k===null?e.v=t:(k.capture(e,t,!0),St?.capture(e,t,!0)),e.deps===null))){O(e,h);return}U||(A===null?$e(e):(un()||k?.is_fork)&&A.set(e,t))}function vt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ve),t.fn!==null&&(t.teardown=d),t.ac=null,Wn(t,0),xn(t))}function yt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Gn(t)}var bt=null,xt=null,k=null,St=null,A=null,Ct=null,wt=!1,Tt=!1,Et=null,Dt=null,Ot=0,kt=1,At=class e{id=kt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){xt===null?bt=xt=this:(xt.#n=this,this.#t=xt),xt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)O(r,g),t(r);for(r of n.m)O(r,_),t(r)}this.#p.add(e)}#g(){this.#e=!0,Ot++>1e3&&(this.#S(),Mt());for(let e of this.#u)this.#d.delete(e),O(e,g),this.schedule(e);for(let e of this.#d)O(e,_),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Et=[],r=[],i=Dt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Rt(e),this.#h()||this.discard(),t}if(k=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Et=null,Dt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Lt(e,t);i.length>0&&k.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),St=this,Nt(r),Nt(n),St=null,this.#s?.resolve();var s=k;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),C&&(this.#x(),k=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=h;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=h:i&4?t.push(r):C&&i&16777224?n.push(r):Bn(r)&&(i&16&&this.#d.add(r),Gn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),O(i,g),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),k=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)tt(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==v&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),A?.set(e,t)),this.is_fork||(e.v=t)}activate(){k=this}deactivate(){k=null,A=null}flush(){try{Tt=!0,k=this,this.#g()}finally{Ot=0,Ct=null,Et=null,Dt=null,Tt=!1,k=null,A=null,M.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(ft);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=bt;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)Pt(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&Ft(e,c,o)&&(e.f&4194320?(O(e,g),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,E(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(k===null){let t=k=new e;!Tt&&!wt&&E(()=>{t.#e||t.flush()})}return k}apply(){if(!C||!this.is_fork&&this.#t===null&&this.#n===null){A=null;return}A=new Map;for(let[e,[t]]of this.current)A.set(e,t);for(let t=bt;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)A.has(e)||A.set(e,n)}}schedule(e){if(Ct=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Et!==null&&t===q&&(C||(W===null||!(W.f&2))&&!nt))return;if(n&96){if(!(n&1024))return;t.f^=h}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?bt=t:e.#n=t,t===null?xt=e:t.#t=e,this.linked=!1}}};function jt(e){var t=wt;wt=!0;try{var n;for(e&&(k!==null&&!k.is_fork&&k.flush(),n=e());;){if(Xe(),k===null)return n;k.flush()}}finally{wt=t}}function Mt(){try{Te()}catch(e){D(e,Ct)}}var j=null;function Nt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Bn(r)&&(j=new Set,Gn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&wn(r),j?.size>0)){M.clear();for(let e of j){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)j.has(n)&&(j.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Gn(n)}}j.clear()}}j=null}}function Pt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Pt(i,t,n,r):e&4194320&&!(e&2048)&&Ft(i,t,r)&&(O(i,g),It(i))}}function Ft(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&Ft(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function It(e){k.schedule(e)}function Lt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),O(e,h);for(var n=e.first;n!==null;)Lt(n,t),n=n.next}}function Rt(e){O(e,h);for(var t=e.first;t!==null;)Rt(t),t=t.next}var zt=new Set,M=new Map,Bt=!1;function Vt(e,t){return{f:0,v:e,reactions:null,equals:Be,rv:0,wv:0}}function N(e,t){let n=Vt(e,t);return Nn(n),n}function Ht(e,t=!1,n=!0){let r=Vt(e);return t||(r.equals=He),Ue&&n&&w!==null&&w.l!==null&&(w.l.s??=[]).push(r),r}function P(e,t,n=!1){return W!==null&&(!G||W.f&131072)&&Je()&&W.f&4325394&&(Y===null||!Y.has(e))&&Oe(),Ut(e,n?qt(t):t,Dt)}function Ut(e,t,n=null){if(!e.equals(t)){M.set(e,U?t:e.v);var r=At.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&>(t),A===null&&$e(t)}e.wv=zn(),Kt(e,g,n),Je()&&q!==null&&q.f&1024&&!(q.f&96)&&(Q===null?Pn([e]):Q.push(e)),!r.is_fork&&zt.size>0&&!Bt&&Wt()}return t}function Wt(){Bt=!1;for(let e of zt){e.f&1024&&O(e,_);let t;try{t=Bn(e)}catch{t=!0}t&&Gn(e)}zt.clear()}function Gt(e){P(e,e.v+1)}function Kt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Je(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===q)){var l=(c&g)===0;if(l&&O(s,t),c&131072)zt.add(s);else if(c&2){var u=s;A?.delete(u),c&65536||(c&512&&(q===null||!(q.f&2097152))&&(s.f|=se),Kt(u,_,n))}else if(l){var d=s;c&16&&j!==null&&j.add(d),n===null?It(d):n.push(d)}}}}function qt(t){if(typeof t!=`object`||!t||de in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=N(0),u=null,d=Ln,f=e=>{if(Ln===d)return e();var t=W,n=Ln;K(null),Rn(d);var r=e();return K(t),Rn(n),r};return i&&r.set(`length`,N(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Ee();var i=r.get(t);return i===void 0?f(()=>{var e=N(n.value,u);return r.set(t,e),e}):P(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>N(v,u));r.set(t,e),Gt(o)}}else P(n,v),Gt(o);return!0},get(e,n,i){if(n===de)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>N(qt(s?e[n]:v),u)),r.set(n,o)),o!==void 0){var c=$(o);return c===v?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=$(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==v)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===de)return!0;var n=r.get(t),i=n!==void 0&&n.v!==v||Reflect.has(e,t);return(n!==void 0||q!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>N(i?qt(e[t]):v,u)),r.set(t,n)),$(n)===v)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>N(v,u)),r.set(d+``,p)):P(p,v)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>N(void 0,u)),P(c,qt(n)),r.set(t,c));else{l=c.v!==v;var m=f(()=>qt(n));P(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&P(g,_+1)}Gt(o)}return!0},ownKeys(e){$(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==v});for(var[n,i]of r)i.v!==v&&!(n in e)&&t.push(n);return t},setPrototypeOf(){De()}})}var Jt,Yt,Xt,Zt;function Qt(){if(Jt===void 0){Jt=window,Yt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Xt=a(t,`firstChild`).get,Zt=a(t,`nextSibling`).get,u(e)&&(e[me]=void 0,e[pe]=null,e[he]=void 0,e.__e=void 0),u(n)&&(n[ge]=void 0)}}function F(e=``){return document.createTextNode(e)}function I(e){return Xt.call(e)}function L(e){return Zt.call(e)}function R(e,t){if(!y)return I(e);var n=I(b);if(n===null)n=b.appendChild(F());else if(t&&n.nodeType!==3){var r=F();return n?.before(r),x(r),r}return t&&nn(n),x(n),n}function $t(e,t=!1){if(!y){var n=I(e);return n instanceof Comment&&n.data===``?L(n):n}if(t){if(b?.nodeType!==3){var r=F();return b?.before(r),x(r),r}nn(b)}return b}function z(e,t=1,n=!1){let r=y?b:e;for(var i;t--;)i=r,r=L(r);if(!y)return r;if(n){if(r?.nodeType!==3){var a=F();return r===null?i?.after(a):r.before(a),x(a),a}nn(r)}return x(r),r}function en(){return!C||j!==null?!1:(q.f&ne)!==0}function tn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function nn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}var rn=!1;function an(){rn||(rn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[_e]?.()})},{capture:!0}))}function on(e){var t=W,n=q;K(null),J(null);try{return e()}finally{K(t),J(n)}}function sn(e,t,n,r=n){e.addEventListener(t,()=>on(n));let i=e[_e];i?e[_e]=()=>{i(),r(!0)}:e[_e]=()=>r(!0),an()}function cn(e){q===null&&(W===null&&we(e),Ce()),U&&Se(e)}function ln(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function B(e,t){var n=q;n!==null&&n.f&8192&&(e|=ee);var r={ctx:w,deps:null,nodes:null,f:e|g|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};k?.register_created_effect(r);var i=r;if(e&4)Et===null?At.ensure().schedule(r):Et.push(r);else if(t!==null){try{Gn(r)}catch(e){throw H(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ie))}if(i!==null&&(i.parent=n,n!==null&&ln(i,n),W!==null&&W.f&2&&!(e&64))){var a=W;(a.effects??=[]).push(i)}return r}function un(){return W!==null&&!G}function dn(e){let t=B(8,null);return O(t,h),t.teardown=e,t}function fn(e){cn(`$effect`);var t=q.f;if(!W&&t&32&&w!==null&&!w.i){var n=w;(n.e??=[]).push(e)}else return pn(e)}function pn(e){return B(4|oe,e)}function mn(e){return cn(`$effect.pre`),B(8|oe,e)}function hn(e){At.ensure();let t=B(64|ae,e);return(e={})=>new Promise(n=>{e.outro?Tn(t,()=>{H(t),n(void 0)}):(H(t),n(void 0))})}function gn(e){return B(le|ae,e)}function _n(e,t=0){return B(8|t,e)}function vn(e,t=[],n=[],r=[]){st(r,t,n,t=>{B(8,()=>{e(...t.map($))})})}function yn(e,t=0){return B(16|t,e)}function V(e){return B(32|ae,e)}function bn(e){var t=e.teardown;if(t!==null){let e=U,n=W;Mn(!0),K(null);try{t.call(null)}finally{Mn(e),K(n)}}}function xn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&on(()=>{e.abort(ve)});var r=n.next;n.f&64?n.parent=null:H(n,t),n=r}}function Sn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||H(t),t=n}}function H(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Cn(e.nodes.start,e.nodes.end),n=!0),e.f|=re,xn(e,t&&!n),Wn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();bn(e),e.f^=re,e.f|=te;var i=e.parent;i!==null&&i.first!==null&&wn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Cn(e,t){for(;e!==null;){var n=e===t?null:L(e);e.remove(),e=n}}function wn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Tn(e,t,n=!0){var r=[];En(e,r,!0);var i=()=>{n&&H(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function En(e,t,n){if(!(e.f&8192)){e.f^=ee;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;En(i,t,o?n:!1)}i=a}}}function Dn(e){On(e,!0)}function On(e,t){if(e.f&8192){e.f^=ee,e.f&1024||(O(e,g),At.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;On(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function kn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:L(n);t.append(n),n=i}}var An=null,jn=!1,U=!1;function Mn(e){U=e}var W=null,G=!1;function K(e){W=e}var q=null;function J(e){q=e}var Y=null;function Nn(e){W!==null&&(!C||W.f&2)&&(Y??=new Set).add(e)}var X=null,Z=0,Q=null;function Pn(e){Q=e}var Fn=1,In=0,Ln=In;function Rn(e){Ln=e}function zn(){return++Fn}function Bn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~se),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Bn(a)&&_t(a),a.wv>e.wv)return!0}t&512&&A===null&&O(e,h)}return!1}function Vn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!C&&Y!==null&&Y.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Vn(a,t,!1):t===a&&(n?O(a,g):a.f&1024&&O(a,_),It(a))}}function Hn(e){var t=X,n=Z,r=Q,i=W,a=Y,o=w,s=G,c=Ln,l=e.f;X=null,Z=0,Q=null,W=l&96?null:e,Y=null,Ge(e.ctx),G=!1,Ln=++In,e.ac!==null&&(on(()=>{e.ac.abort(ve)}),e.ac=null);try{e.f|=ce;var u=e.fn,d=u();e.f|=ne;var f=e.deps,p=k?.is_fork;if(X!==null){var m;if(p||Wn(e,Z),f!==null&&Z>0)for(f.length=Z+X.length,m=0;m<X.length;m++)f[Z+m]=X[m];else e.deps=f=X;if(un()&&e.f&512)for(m=Z;m<f.length;m++)(f[m].reactions??=[]).push(e)}else!p&&f!==null&&Z<f.length&&(Wn(e,Z),f.length=Z);if(Je()&&Q!==null&&!G&&f!==null&&!(e.f&6146))for(m=0;m<Q.length;m++)Vn(Q[m],e);if(i!==null&&i!==e){if(In++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=In;if(t!==null)for(let e of t)e.rv=In;Q!==null&&(r===null?r=Q:r.push(...Q))}return e.f&8388608&&(e.f^=ue),d}catch(e){return Ze(e)}finally{e.f^=ce,X=t,Z=n,Q=r,W=i,Y=a,Ge(o),G=s,Ln=c}}function Un(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(X===null||!n.call(X,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~se),s.v!==v&&$e(s),vt(s),Wn(s,0)}}function Wn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Un(e,n[r])}function Gn(e){var t=e.f;if(!(t&16384)){O(e,h);var n=q,r=jn;q=e,jn=!0;try{t&16777232?Sn(e):xn(e),bn(e);var i=Hn(e);e.teardown=typeof i==`function`?i:null,e.wv=Fn}finally{jn=r,q=n}}}async function Kn(){if(C)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),jt()}function $(e){var t=(e.f&2)!=0;if(An?.add(e),W!==null&&!G&&!(q!==null&&q.f&16384)&&(Y===null||!Y.has(e))){var r=W.deps;if(W.f&2097152)e.rv<In&&(e.rv=In,X===null&&r!==null&&r[Z]===e?Z++:X===null?X=[e]:X.push(e));else{W.deps??=[],n.call(W.deps,e)||W.deps.push(e);var i=e.reactions;i===null?e.reactions=[W]:n.call(i,W)||i.push(W)}}if(U&&M.has(e))return M.get(e);if(t){var a=e;if(U){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||Jn(a))&&(o=gt(a)),M.set(a,o),o}var s=(a.f&512)==0&&!G&&W!==null&&(jn||(W.f&512)!=0),c=(a.f&ne)===0;Bn(a)&&(s&&(a.f|=512),_t(a)),s&&!c&&(yt(a),qn(a))}if(A?.has(e))return A.get(e);if(e.f&8388608)throw e.v;return e.v}function qn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(yt(t),qn(t))}function Jn(e){if(e.v===v)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(M.has(t)||t.f&2&&Jn(t))return!0;return!1}function Yn(e){var t=G;try{return G=!0,e()}finally{G=t}}function Xn(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(de in e)Zn(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&de in n&&Zn(n)}}}function Zn(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Zn(e[n],t)}catch{}let n=l(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=o(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Qn=[`touchstart`,`touchmove`];function $n(e){return Qn.includes(e)}var er=Symbol(`events`),tr=new Set,nr=new Set;function rr(e,t,n,r={}){function i(e){if(r.capture||or.call(t,e),!e.cancelBubble)return on(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?E(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ir(e,t,n,r,i){var a={capture:r,passive:i},o=rr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&dn(()=>{t.removeEventListener(e,o,a)})}var ar=null;function or(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;ar=e;var s=0,c=ar===e&&e[er];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[er]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=W,f=q;K(null),J(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[er]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[er]=t,delete e.currentTarget,K(d),J(f)}}}var sr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function cr(e){return sr?.createHTML(e)??e}function lr(e){var t=tn(`template`);return t.innerHTML=cr(e.replaceAll(`<!>`,`<!---->`)),t.content}function ur(e,t){var n=q;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function dr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(y)return ur(b,null),b;i===void 0&&(i=lr(a?e:`<!>`+e),n||(i=I(i)));var t=r||Yt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=I(t),s=t.lastChild;ur(o,s)}else ur(t,t);return t}}function fr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(y)return ur(b,null),b;if(!o){var e=I(lr(a));if(i)for(o=document.createDocumentFragment();I(e);)o.appendChild(I(e));else o=I(e)}var t=o.cloneNode(!0);if(i){var n=I(t),r=t.lastChild;ur(n,r)}else ur(t,t);return t}}function pr(e,t){return fr(e,t,`svg`)}function mr(e,t){if(y){var n=q;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=b),Ie();return}e!==null&&e.before(t)}function hr(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ge]??=e.nodeValue)&&(e[ge]=n,e.nodeValue=`${n}`)}function gr(e,t){return vr(e,t)}var _r=new Map;function vr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){Qt();var l=void 0,u=hn(()=>{var s=n??t.appendChild(F());at(s,{pending:()=>{}},t=>{Ke({});var n=w;if(o&&(n.c=o),a&&(i.$$events=a),y&&ur(t,null),l=e(t,i)||{},y&&(q.nodes.end=b,b===null||b.nodeType!==8||b.data!==`]`))throw Ne(),Ae;qe()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=$n(r);for(let e of[t,document]){var a=_r.get(e);a===void 0&&(a=new Map,_r.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,or,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(tr)),nr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=_r.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,or),r.delete(e),r.size===0&&_r.delete(n)):r.set(e,i)}nr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return yr.set(l,u),l}var yr=new WeakMap,br=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Dn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Dn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(H(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();kn(r,t),t.append(F()),this.#n.set(e,{effect:r,fragment:t})}else H(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Tn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(H(n.effect),this.#n.delete(e))};ensure(e,t){var n=k,r=en();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=F();i.append(a),this.#n.set(e,{effect:V(()=>t(a)),fragment:i})}else this.#t.set(e,V(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else y&&(this.anchor=b),this.#a(n)}};function xr(e,t,n=!1){var r;y&&(r=b,Ie());var i=new br(e),a=n?ie:0;function o(e,t){if(y){var n=ze(r);if(e!==parseInt(n.substring(1))){var a=Re();x(a),i.anchor=a,Fe(!1),i.ensure(e,t),Fe(!0);return}}i.ensure(e,t)}yn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Sr=Symbol(`is custom element`),Cr=Symbol(`is html`),wr=ye?`link`:`LINK`;function Tr(e){if(y){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Er(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Er(e,`checked`,null),e.checked=r}}};e[_e]=n,E(n),an()}}function Er(e,t,n,r){var i=Dr(e);y&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===wr)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[fe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&kr(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Dr(e){return e[pe]??={[Sr]:e.nodeName.includes(`-`),[Cr]:e.namespaceURI===je}}var Or=new Map;function kr(e){var t=e.getAttribute(`is`)||e.nodeName,n=Or.get(t);if(n)return n;Or.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.push(s);i=l(i)}return n}function Ar(e,t,n=t){var r=new WeakSet;sn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=jr(e)?Mr(a):a,n(a),k!==null&&r.add(k),await Kn(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(y&&e.defaultValue!==e.value||Yn(t)==null&&e.value)&&(n(jr(e)?Mr(e.value):e.value),k!==null&&r.add(k)),_n(()=>{var n=t();if(e===document.activeElement){var i=C?St:k;if(r.has(i))return}jr(e)&&n===Mr(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function jr(e){var t=e.type;return t===`number`||t===`range`}function Mr(e){return e===``?null:+e}function Nr(e){return function(...t){return t[0].preventDefault(),e?.apply(this,t)}}function Pr(e=!1){let t=w,n=t.l.u;if(!n)return;let r=()=>Xn(t.s);if(e){let e=0,n={},i=dt(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>$(i)}n.b.length&&mn(()=>{Fr(t,r),p(n.b)}),fn(()=>{let e=Yn(()=>n.m.map(f));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&fn(()=>{Fr(t,r),p(n.a)})}function Fr(e,t){if(e.l.s)for(let t of e.l.s)$(t);t()}function Ir(e){w===null&&be(`onMount`),Ue&&w.l!==null?Lr(w).m.push(e):fn(()=>{let t=Yn(e);if(typeof t==`function`)return t})}function Lr(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`),We();var Rr=pr(`<svg viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 1.5a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13.5a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2a.5.5 0 0 1 .5-.5zM2.343 2.343a.5.5 0 0 1 .707 0l1.414 1.414a.5.5 0 1 1-.707.707L2.343 3.05a.5.5 0 0 1 0-.707zm9.193 9.193a.5.5 0 0 1 .707 0l1.414 1.414a.5.5 0 0 1-.707.707l-1.414-1.414a.5.5 0 0 1 0-.707zM0 8a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2A.5.5 0 0 1 0 8zm13.5 0a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5zM2.343 13.657a.5.5 0 0 1 0-.707l1.414-1.414a.5.5 0 1 1 .707.707l-1.414 1.414a.5.5 0 0 1-.707 0zm9.193-9.193a.5.5 0 0 1 0-.707l1.414-1.414a.5.5 0 0 1 .707.707l-1.414 1.414a.5.5 0 0 1-.707 0z"></path></svg>`),zr=pr(`<svg viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M6 .278a.77.77 0 0 1 .08.858 7.2 7.2 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.79.79 0 0 1 .81.316.73.73 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"></path></svg>`),Br=pr(`<svg viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 15A7 7 0 1 0 8 1zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"></path></svg>`),Vr=dr(`<p class="success svelte-1n46o8q">Connected. You can close this tab and return to the terminal.</p>`),Hr=dr(`<p class="error svelte-1n46o8q"> </p>`),Ur=dr(`<p class="subtitle svelte-1n46o8q">Paste your DataLab Rotterdam Nova API key to connect nova-ai-cli.</p> <form class="svelte-1n46o8q"><input type="password" placeholder="Nova API key" autocomplete="off" required="" class="svelte-1n46o8q"/> <button type="submit" class="svelte-1n46o8q"> </button></form> <!> <div class="help-links svelte-1n46o8q"><a class="help-button svelte-1n46o8q" target="_blank" rel="noopener noreferrer">No API key? Create one</a> <a class="docs-link svelte-1n46o8q" target="_blank" rel="noopener noreferrer">Read the docs</a></div>`,1),Wr=dr(`<main class="svelte-1n46o8q"><button class="theme-toggle svelte-1n46o8q" type="button"><!></button> <div class="card svelte-1n46o8q"><div class="logo svelte-1n46o8q" aria-hidden="true"><svg viewBox="0 0 720 720" xmlns="http://www.w3.org/2000/svg" class="svelte-1n46o8q"><g transform="translate(0,720) scale(0.1,-0.1)" fill="currentColor" stroke="none"><path d="M3280 7109 c-36 -5 -105 -14 -155 -20 -546 -65 -1154 -314 -1615 -663 -148 -112 -213 -170 -383 -341 -200 -201 -367 -416 -500 -640 -295 -501 -455 -1022 -484 -1577 -6 -117 -5 -128 12 -134 21 -8 483 11 605 26 172 20 375 61 394 81 6 5 20 9 33 9 13 0 31 4 41 9 9 5 35 14 57 21 22 7 73 28 113 47 39 18 74 33 77 33 3 0 24 12 48 27 23 15 60 36 82 47 162 84 418 333 520 506 6 10 16 24 22 31 22 28 132 238 153 294 20 53 57 147 69 178 5 12 12 33 15 47 2 14 9 41 15 60 5 19 15 55 22 80 6 25 15 54 20 65 4 11 10 38 13 60 21 166 37 218 64 213 12 -2 19 -17 24 -53 16 -111 41 -235 56 -280 22 -65 32 -102 32 -123 0 -11 5 -24 10 -27 6 -3 10 -14 10 -23 0 -15 36 -111 87 -232 69 -163 199 -360 325 -491 50 -53 165 -148 245 -202 67 -45 245 -139 321 -168 12 -5 32 -13 45 -19 29 -12 160 -54 217 -69 25 -7 59 -17 76 -22 17 -5 39 -9 49 -9 10 0 32 -4 49 -9 50 -16 137 -33 206 -43 243 -32 331 -40 660 -57 113 -6 277 -15 365 -21 109 -8 413 -10 955 -5 718 5 795 7 804 22 10 18 0 250 -15 358 -63 445 -159 756 -352 1141 -163 325 -354 588 -625 859 -290 291 -565 491 -910 664 -329 165 -740 291 -1082 331 -52 6 -129 15 -170 21 -90 11 -529 10 -620 -2z"></path><path d="M5285 3480 c-250 -11 -596 -33 -870 -55 -44 -4 -84 -11 -90 -16 -5 -5 -28 -9 -52 -9 -24 0 -69 -6 -101 -14 -113 -28 -153 -36 -177 -36 -13 0 -27 -4 -30 -10 -3 -5 -16 -10 -27 -10 -12 0 -35 -4 -52 -10 -127 -39 -202 -65 -210 -72 -6 -4 -16 -8 -24 -8 -28 0 -269 -123 -347 -177 -103 -72 -234 -181 -265 -222 -14 -18 -38 -47 -53 -64 -64 -74 -157 -220 -211 -332 -32 -66 -62 -128 -67 -137 -5 -10 -9 -23 -9 -30 0 -7 -11 -35 -25 -63 -13 -27 -25 -60 -25 -72 0 -12 -4 -24 -9 -27 -5 -3 -11 -20 -14 -38 -2 -18 -12 -58 -21 -88 -25 -81 -49 -197 -62 -297 -6 -44 -28 -73 -43 -57 -16 17 -31 77 -31 120 0 24 -4 46 -10 49 -5 3 -10 20 -10 37 0 18 -4 45 -9 62 -5 17 -17 58 -26 91 -9 33 -21 70 -26 83 -5 13 -9 32 -9 43 0 10 -5 28 -10 39 -6 11 -15 29 -20 40 -6 11 -10 26 -10 34 0 8 -6 27 -14 43 -8 15 -19 39 -24 53 -26 66 -82 179 -92 185 -5 3 -10 13 -10 21 0 9 -15 36 -33 62 -17 26 -36 54 -42 64 -72 119 -220 284 -340 378 -89 70 -107 83 -220 151 -62 37 -219 110 -280 129 -22 7 -48 16 -57 21 -10 5 -28 9 -41 9 -13 0 -27 4 -32 9 -6 5 -32 14 -60 21 -27 6 -68 16 -90 21 -136 35 -436 63 -737 70 -98 2 -111 1 -121 -16 -17 -30 7 -334 43 -545 32 -186 103 -433 185 -645 121 -308 323 -654 535 -915 98 -120 388 -408 501 -497 169 -133 191 -149 326 -235 390 -249 852 -425 1308 -498 398 -64 886 -52 1273 31 551 118 1049 356 1479 708 135 110 392 366 493 491 455 564 730 1264 766 1952 3 75 4 147 1 160 l-6 23 -788 1 c-433 1 -873 -2 -978 -6z"></path></g></svg></div> <h1 class="svelte-1n46o8q">Connect Nova AI</h1> <!></div></main>`);function Gr(e,t){Ke(t,!1);let n=`theme`,r=[`light`,`dark`,`auto`],i=Ht(`auto`);function a(e){let t=e===`auto`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e;document.documentElement.setAttribute(`data-theme`,t)}function o(e){P(i,e),localStorage.setItem(n,e),a(e)}function s(){let e=r[(r.indexOf($(i))+1)%r.length];o(e)}Ir(()=>{P(i,localStorage.getItem(n)??`auto`),a($(i));let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{$(i)===`auto`&&a(`auto`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)});let c=Ht(``),l=Ht(`idle`),u=Ht(``);async function d(){P(l,`submitting`),P(u,``);try{let e=await fetch(`/api/authenticate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({apiKey:$(c)})});if(!e.ok){P(u,(await e.json().catch(()=>null))?.message??`Failed to validate API key.`),P(l,`error`);return}P(l,`success`)}catch{P(u,`Could not reach the local auth server.`),P(l,`error`)}}Pr();var f=Wr(),p=R(f),m=R(p),h=e=>{mr(e,Rr())},g=e=>{mr(e,zr())},_=e=>{mr(e,Br())};xr(m,e=>{$(i)===`light`?e(h):$(i)===`dark`?e(g,1):e(_,-1)}),S(p);var ee=z(p,2),te=z(R(ee),4),ne=e=>{mr(e,Vr())},re=e=>{var t=Ur(),n=z($t(t),2),r=R(n);Tr(r);var i=z(r,2),a=R(i,!0);S(i),S(n);var o=z(n,2),s=e=>{var t=Hr(),n=R(t,!0);S(t),vn(()=>hr(n,$(u))),mr(e,t)};xr(o,e=>{$(l)===`error`&&e(s)});var f=z(o,2),p=R(f);Er(p,`href`,`https://platform.nova.datalabrotterdam.nl/dashboard/api-keys?name=Nova%20AI%20VSCode%20Extensie&scopes=models:read,llm:call`),Er(z(p,2),`href`,`https://docs.datalabrotterdam.nl/services/nova-ai`),S(f),vn(()=>{r.disabled=$(l)===`submitting`,i.disabled=$(l)===`submitting`||!$(c),hr(a,$(l)===`submitting`?`Connecting…`:`Connect`)}),Ar(r,()=>$(c),e=>P(c,e)),ir(`submit`,n,Nr(d)),mr(e,t)};xr(te,e=>{$(l)===`success`?e(ne):e(re,-1)}),S(ee),S(f),vn(()=>Er(p,`title`,`Theme: ${$(i)}`)),ir(`click`,p,s),mr(e,f),qe()}gr(Gr,{target:document.getElementById(`app`)});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="720.000000pt" height="720.000000pt" viewBox="0 0 720.000000 720.000000"
|
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
|
7
|
+
|
|
8
|
+
<g transform="translate(0.000000,720.000000) scale(0.100000,-0.100000)"
|
|
9
|
+
fill="#fff" stroke="none">
|
|
10
|
+
<path d="M3280 7109 c-36 -5 -105 -14 -155 -20 -546 -65 -1154 -314 -1615
|
|
11
|
+
-663 -148 -112 -213 -170 -383 -341 -200 -201 -367 -416 -500 -640 -295 -501
|
|
12
|
+
-455 -1022 -484 -1577 -6 -117 -5 -128 12 -134 21 -8 483 11 605 26 172 20
|
|
13
|
+
375 61 394 81 6 5 20 9 33 9 13 0 31 4 41 9 9 5 35 14 57 21 22 7 73 28 113
|
|
14
|
+
47 39 18 74 33 77 33 3 0 24 12 48 27 23 15 60 36 82 47 162 84 418 333 520
|
|
15
|
+
506 6 10 16 24 22 31 22 28 132 238 153 294 20 53 57 147 69 178 5 12 12 33
|
|
16
|
+
15 47 2 14 9 41 15 60 5 19 15 55 22 80 6 25 15 54 20 65 4 11 10 38 13 60 21
|
|
17
|
+
166 37 218 64 213 12 -2 19 -17 24 -53 16 -111 41 -235 56 -280 22 -65 32
|
|
18
|
+
-102 32 -123 0 -11 5 -24 10 -27 6 -3 10 -14 10 -23 0 -15 36 -111 87 -232 69
|
|
19
|
+
-163 199 -360 325 -491 50 -53 165 -148 245 -202 67 -45 245 -139 321 -168 12
|
|
20
|
+
-5 32 -13 45 -19 29 -12 160 -54 217 -69 25 -7 59 -17 76 -22 17 -5 39 -9 49
|
|
21
|
+
-9 10 0 32 -4 49 -9 50 -16 137 -33 206 -43 243 -32 331 -40 660 -57 113 -6
|
|
22
|
+
277 -15 365 -21 109 -8 413 -10 955 -5 718 5 795 7 804 22 10 18 0 250 -15
|
|
23
|
+
358 -63 445 -159 756 -352 1141 -163 325 -354 588 -625 859 -290 291 -565 491
|
|
24
|
+
-910 664 -329 165 -740 291 -1082 331 -52 6 -129 15 -170 21 -90 11 -529 10
|
|
25
|
+
-620 -2z"/>
|
|
26
|
+
<path d="M5285 3480 c-250 -11 -596 -33 -870 -55 -44 -4 -84 -11 -90 -16 -5
|
|
27
|
+
-5 -28 -9 -52 -9 -24 0 -69 -6 -101 -14 -113 -28 -153 -36 -177 -36 -13 0 -27
|
|
28
|
+
-4 -30 -10 -3 -5 -16 -10 -27 -10 -12 0 -35 -4 -52 -10 -127 -39 -202 -65
|
|
29
|
+
-210 -72 -6 -4 -16 -8 -24 -8 -28 0 -269 -123 -347 -177 -103 -72 -234 -181
|
|
30
|
+
-265 -222 -14 -18 -38 -47 -53 -64 -64 -74 -157 -220 -211 -332 -32 -66 -62
|
|
31
|
+
-128 -67 -137 -5 -10 -9 -23 -9 -30 0 -7 -11 -35 -25 -63 -13 -27 -25 -60 -25
|
|
32
|
+
-72 0 -12 -4 -24 -9 -27 -5 -3 -11 -20 -14 -38 -2 -18 -12 -58 -21 -88 -25
|
|
33
|
+
-81 -49 -197 -62 -297 -6 -44 -28 -73 -43 -57 -16 17 -31 77 -31 120 0 24 -4
|
|
34
|
+
46 -10 49 -5 3 -10 20 -10 37 0 18 -4 45 -9 62 -5 17 -17 58 -26 91 -9 33 -21
|
|
35
|
+
70 -26 83 -5 13 -9 32 -9 43 0 10 -5 28 -10 39 -6 11 -15 29 -20 40 -6 11 -10
|
|
36
|
+
26 -10 34 0 8 -6 27 -14 43 -8 15 -19 39 -24 53 -26 66 -82 179 -92 185 -5 3
|
|
37
|
+
-10 13 -10 21 0 9 -15 36 -33 62 -17 26 -36 54 -42 64 -72 119 -220 284 -340
|
|
38
|
+
378 -89 70 -107 83 -220 151 -62 37 -219 110 -280 129 -22 7 -48 16 -57 21
|
|
39
|
+
-10 5 -28 9 -41 9 -13 0 -27 4 -32 9 -6 5 -32 14 -60 21 -27 6 -68 16 -90 21
|
|
40
|
+
-136 35 -436 63 -737 70 -98 2 -111 1 -121 -16 -17 -30 7 -334 43 -545 32
|
|
41
|
+
-186 103 -433 185 -645 121 -308 323 -654 535 -915 98 -120 388 -408 501 -497
|
|
42
|
+
169 -133 191 -149 326 -235 390 -249 852 -425 1308 -498 398 -64 886 -52 1273
|
|
43
|
+
31 551 118 1049 356 1479 708 135 110 392 366 493 491 455 564 730 1264 766
|
|
44
|
+
1952 3 75 4 147 1 160 l-6 23 -788 1 c-433 1 -873 -2 -978 -6z"/>
|
|
45
|
+
</g>
|
|
46
|
+
</svg>
|
|
@@ -4,8 +4,27 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Connect Nova AI</title>
|
|
7
|
-
<
|
|
8
|
-
<link rel="
|
|
7
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
|
+
<link
|
|
11
|
+
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap"
|
|
12
|
+
rel="stylesheet"
|
|
13
|
+
/>
|
|
14
|
+
<script>
|
|
15
|
+
(function () {
|
|
16
|
+
var stored = localStorage.getItem("theme") || "auto";
|
|
17
|
+
var resolved =
|
|
18
|
+
stored === "auto"
|
|
19
|
+
? window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
20
|
+
? "dark"
|
|
21
|
+
: "light"
|
|
22
|
+
: stored;
|
|
23
|
+
document.documentElement.setAttribute("data-theme", resolved);
|
|
24
|
+
})();
|
|
25
|
+
</script>
|
|
26
|
+
<script type="module" crossorigin src="/assets/index-D2Z0sfLR.js"></script>
|
|
27
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CSccI7lJ.css">
|
|
9
28
|
</head>
|
|
10
29
|
<body>
|
|
11
30
|
<div id="app"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Rr=Object.defineProperty;var wn=e=>{throw TypeError(e)};var Cr=(e,t,n)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var B=(e,t,n)=>Cr(e,typeof t!="symbol"?t+"":t,n),Wt=(e,t,n)=>t.has(e)||wn("Cannot "+n);var l=(e,t,n)=>(Wt(e,t,"read from private field"),n?n.call(e):t.get(e)),m=(e,t,n)=>t.has(e)?wn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),y=(e,t,n,r)=>(Wt(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),E=(e,t,n)=>(Wt(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const f of s.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&r(f)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Bn=!1;var Pr=Array.isArray,Nr=Array.prototype.indexOf,Pt=Array.prototype.includes,Mr=Array.from,Dr=Object.defineProperty,it=Object.getOwnPropertyDescriptor,Fr=Object.getOwnPropertyDescriptors,Lr=Object.prototype,jr=Array.prototype,Vn=Object.getPrototypeOf,bn=Object.isExtensible;const Ir=()=>{};function qr(e){return e()}function en(e){for(var t=0;t<e.length;t++)e[t]()}function Yn(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const D=2,ut=4,gt=8,Hn=1<<24,ne=16,oe=32,ke=64,tn=128,J=512,C=1024,N=2048,ae=4096,Z=8192,ie=16384,Ze=32768,En=1<<25,Ge=65536,Nt=1<<17,Br=1<<18,Qe=1<<19,Un=1<<20,Fe=65536,Mt=1<<21,Be=1<<22,Ee=1<<23,st=Symbol("$state"),Vr=Symbol("attributes"),Yr=Symbol("class"),Hr=Symbol("style"),Xe=Symbol("text"),At=Symbol("form reset"),Yt=new class extends Error{constructor(){super(...arguments);B(this,"name","StaleReactionError");B(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Ur(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Kr(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function zr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Wr(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Gr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $r(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Jr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Zr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Qr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Xr=1,ei=2,R=Symbol("uninitialized");function ti(){console.warn("https://svelte.dev/e/derived_inert")}function ni(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Kn(e){return e===this.v}function ri(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function zn(e){return!ri(e,this.v)}let Ht=!1,ii=!1;function si(){Ht=!0}let O=null;function $e(e){O=e}function Wn(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:b,l:Ht&&!t?{s:null,u:null,$:[]}:null}}function Gn(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)vr(r)}return t.i=!0,O=t.p,{}}function yt(){return!Ht||O!==null&&O.l===null}let Te=[];function $n(){var e=Te;Te=[],en(e)}function Ne(e){if(Te.length===0&&!ft){var t=Te;queueMicrotask(()=>{t===Te&&$n()})}Te.push(e)}function li(){for(;Te.length>0;)$n()}function Jn(e){var t=b;if(t===null)return w.f|=Ee,e;if(!(t.f&Ze)&&!(t.f&ut))throw e;be(e,t)}function be(e,t){if(!(t!==null&&t.f&ie)){for(;t!==null;){if(t.f&tn){if(!(t.f&Ze))throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}const fi=-7169;function A(e,t){e.f=e.f&fi|t}function hn(e){e.f&J||e.deps===null?A(e,C):A(e,ae)}function Zn(e){if(e!==null)for(const t of e)!(t.f&D)||!(t.f&Fe)||(t.f^=Fe,Zn(t.deps))}function Qn(e,t,n){e.f&N?t.add(e):e.f&ae&&n.add(e),Zn(e.deps),A(e,C)}function oi(e){let t=0,n=mt(0),r;return()=>{gn()&&(P(n),_r(()=>(t===0&&(r=mn(()=>e(()=>ot(n)))),t+=1,()=>{Ne(()=>{t-=1,t===0&&(r==null||r(),r=void 0,ot(n))})})))}}var ai=Ge|Qe;function ui(e,t,n,r){new ci(e,t,n,r)}var W,cn,G,xe,j,$,F,Y,de,Oe,me,Ve,ht,dt,ve,qt,T,hi,di,vi,nn,xt,Ot,rn,sn;class ci{constructor(t,n,r,i){m(this,T);B(this,"parent");B(this,"is_pending",!1);B(this,"transform_error");m(this,W);m(this,cn,null);m(this,G);m(this,xe);m(this,j);m(this,$,null);m(this,F,null);m(this,Y,null);m(this,de,null);m(this,Oe,0);m(this,me,0);m(this,Ve,!1);m(this,ht,new Set);m(this,dt,new Set);m(this,ve,null);m(this,qt,oi(()=>(y(this,ve,mt(l(this,Oe))),()=>{y(this,ve,null)})));var s;y(this,W,t),y(this,G,n),y(this,xe,f=>{var a=b;a.b=this,a.f|=tn,r(f)}),this.parent=b.b,this.transform_error=i??((s=this.parent)==null?void 0:s.transform_error)??(f=>f),y(this,j,pr(()=>{E(this,T,nn).call(this)},ai))}defer_effect(t){Qn(t,l(this,ht),l(this,dt))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!l(this,G).pending}update_pending_count(t,n){E(this,T,rn).call(this,t,n),y(this,Oe,l(this,Oe)+t),!(!l(this,ve)||l(this,Ve))&&(y(this,Ve,!0),Ne(()=>{y(this,Ve,!1),l(this,ve)&&Lt(l(this,ve),l(this,Oe))}))}get_effect_pending(){return l(this,qt).call(this),P(l(this,ve))}error(t){if(!l(this,G).onerror&&!l(this,G).failed)throw t;p!=null&&p.is_fork?(l(this,$)&&p.skip_effect(l(this,$)),l(this,F)&&p.skip_effect(l(this,F)),l(this,Y)&&p.skip_effect(l(this,Y)),p.oncommit(()=>{E(this,T,sn).call(this,t)})):E(this,T,sn).call(this,t)}}W=new WeakMap,cn=new WeakMap,G=new WeakMap,xe=new WeakMap,j=new WeakMap,$=new WeakMap,F=new WeakMap,Y=new WeakMap,de=new WeakMap,Oe=new WeakMap,me=new WeakMap,Ve=new WeakMap,ht=new WeakMap,dt=new WeakMap,ve=new WeakMap,qt=new WeakMap,T=new WeakSet,hi=function(){try{y(this,$,he(()=>l(this,xe).call(this,l(this,W))))}catch(t){this.error(t)}},di=function(t){const n=l(this,G).failed;n&&y(this,Y,he(()=>{n(l(this,W),()=>t,()=>()=>{})}))},vi=function(){const t=l(this,G).pending;t&&(this.is_pending=!0,y(this,F,he(()=>t(l(this,W)))),Ne(()=>{var n=y(this,de,document.createDocumentFragment()),r=jt();n.append(r),y(this,$,E(this,T,Ot).call(this,()=>he(()=>l(this,xe).call(this,r)))),l(this,me)===0&&(l(this,W).before(n),y(this,de,null),at(l(this,F),()=>{y(this,F,null)}),E(this,T,xt).call(this,p))}))},nn=function(){try{if(this.is_pending=this.has_pending_snippet(),y(this,me,0),y(this,Oe,0),y(this,$,he(()=>{l(this,xe).call(this,l(this,W))})),l(this,me)>0){var t=y(this,de,document.createDocumentFragment());br(l(this,$),t);const n=l(this,G).pending;y(this,F,he(()=>n(l(this,W))))}else E(this,T,xt).call(this,p)}catch(n){this.error(n)}},xt=function(t){this.is_pending=!1,t.transfer_effects(l(this,ht),l(this,dt))},Ot=function(t){var n=b,r=w,i=O;ue(l(this,j)),Q(l(this,j)),$e(l(this,j).ctx);try{return Le.ensure(),t()}catch(s){return Jn(s),null}finally{ue(n),Q(r),$e(i)}},rn=function(t,n){var r;if(!this.has_pending_snippet()){this.parent&&E(r=this.parent,T,rn).call(r,t,n);return}y(this,me,l(this,me)+t),l(this,me)===0&&(E(this,T,xt).call(this,n),l(this,F)&&at(l(this,F),()=>{y(this,F,null)}),l(this,de)&&(l(this,W).before(l(this,de)),y(this,de,null)))},sn=function(t){l(this,$)&&(U(l(this,$)),y(this,$,null)),l(this,F)&&(U(l(this,F)),y(this,F,null)),l(this,Y)&&(U(l(this,Y)),y(this,Y,null));var n=l(this,G).onerror;let r=l(this,G).failed;var i=!1,s=!1;const f=()=>{if(i){ni();return}i=!0,s&&Qr(),l(this,Y)!==null&&at(l(this,Y),()=>{y(this,Y,null)}),E(this,T,Ot).call(this,()=>{E(this,T,nn).call(this)})},a=o=>{try{s=!0,n==null||n(o,f),s=!1}catch(u){be(u,l(this,j)&&l(this,j).parent)}r&&y(this,Y,E(this,T,Ot).call(this,()=>{try{return he(()=>{var u=b;u.b=this,u.f|=tn,r(l(this,W),()=>o,()=>f)})}catch(u){return be(u,l(this,j).parent),null}}))};Ne(()=>{var o;try{o=this.transform_error(t)}catch(u){be(u,l(this,j)&&l(this,j).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(a,u=>be(u,l(this,j)&&l(this,j).parent)):a(o)})};function _i(e,t,n,r){const i=yt()?dn:yi;var s=e.filter(h=>!h.settled),f=t.map(i);if(n.length===0&&s.length===0){r(f);return}var a=b,o=pi(),u=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(h=>h.promise)):null;function d(h){if(!(a.f&ie)){o();try{r([...f,...h])}catch(_){be(_,a)}Dt()}}var v=Xn();if(n.length===0){u.then(()=>d([])).finally(v);return}function c(){Promise.all(n.map(h=>gi(h))).then(d).catch(h=>be(h,a)).finally(v)}u?u.then(()=>{o(),c(),Dt()}):c()}function pi(){var e=b,t=w,n=O,r=p;return function(s=!0){ue(e),Q(t),$e(n),s&&!(e.f&ie)&&(r==null||r.activate(),r==null||r.apply())}}function Dt(e=!0){ue(null),Q(null),$e(null),e&&(p==null||p.deactivate())}function Xn(){var e=b,t=e.b,n=p,r=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,n),n.increment(r,e),()=>{t==null||t.update_pending_count(-1,n),n.decrement(r,e)}}function dn(e){var t=D|N;return b!==null&&(b.f|=Qe),{ctx:O,deps:null,effects:null,equals:Kn,f:t,fn:e,reactions:null,rv:0,v:R,wv:0,parent:b,ac:null}}const et=Symbol("obsolete");function gi(e,t,n){let r=b;r===null&&Ur();var i=void 0,s=mt(R),f=!w,a=new Set;return Fi(()=>{var h,_;var o=b,u=Yn();i=u.promise;try{Promise.resolve(e()).then(u.resolve,g=>{g!==Yt&&u.reject(g)}).finally(Dt)}catch(g){u.reject(g),Dt()}var d=p;if(f){if(o.f&Ze)var v=Xn();if((h=r.b)!=null&&h.is_rendered())(_=d.async_deriveds.get(o))==null||_.reject(et);else for(const g of a.values())g.reject(et);a.add(u),d.async_deriveds.set(o,u)}const c=(g,S=void 0)=>{v==null||v(),a.delete(u),S!==et&&(d.activate(),S?(s.f|=Ee,Lt(s,S)):(s.f&Ee&&(s.f^=Ee),Lt(s,g)),d.deactivate())};u.promise.then(c,g=>c(null,g||"unknown"))}),dr(()=>{for(const o of a)o.reject(et)}),new Promise(o=>{function u(d){function v(){d===i?o(s):u(i)}d.then(v,v)}u(i)})}function yi(e){const t=dn(e);return t.equals=zn,t}function mi(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)U(t[n])}}function vn(e){var t,n=b,r=e.parent;if(!Se&&r!==null&&e.v!==R&&r.f&(ie|Z))return ti(),e.v;ue(r);try{e.f&=~Fe,mi(e),t=Tr(e)}finally{ue(n)}return t}function er(e){var t=vn(e);if(!e.equals(t)&&(e.wv=kr(),(!(p!=null&&p.is_fork)||e.deps===null)&&(p!==null?(p.capture(e,t,!0),lt==null||lt.capture(e,t,!0)):e.v=t,e.deps===null))){A(e,C);return}Se||(M!==null?(gn()||p!=null&&p.is_fork)&&M.set(e,t):hn(e))}function wi(e){var t,n;if(e.effects!==null)for(const r of e.effects)(r.teardown||r.ac)&&((t=r.teardown)==null||t.call(r),(n=r.ac)==null||n.abort(Yt),r.fn!==null&&(r.teardown=Ir),r.ac=null,ct(r,0),yn(r))}function tr(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&t.fn!==null&&Je(t)}let Gt=null,je=null,p=null,lt=null,M=null,ln=null,ft=!1,$t=!1,qe=null,Rt=null;var kn=0;let bi=1;var Ye,we,Re,He,Ue,Ke,_e,ze,I,vt,pe,ee,se,We,Ce,k,fn,tt,on,nr,rr,Ie,Ei,nt;const Bt=class Bt{constructor(){m(this,k);B(this,"id",bi++);m(this,Ye,!1);B(this,"linked",!0);m(this,we,null);m(this,Re,null);B(this,"async_deriveds",new Map);B(this,"current",new Map);B(this,"previous",new Map);m(this,He,new Set);m(this,Ue,new Set);m(this,Ke,0);m(this,_e,new Map);m(this,ze,null);m(this,I,[]);m(this,vt,[]);m(this,pe,new Set);m(this,ee,new Set);m(this,se,new Map);m(this,We,new Set);B(this,"is_fork",!1);m(this,Ce,!1);je===null?Gt=je=this:(y(je,Re,this),y(this,we,je)),je=this}skip_effect(t){l(this,se).has(t)||l(this,se).set(t,{d:[],m:[]}),l(this,We).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=l(this,se).get(t);if(r){l(this,se).delete(t);for(var i of r.d)A(i,N),n(i);for(i of r.m)A(i,ae),n(i)}l(this,We).add(t)}capture(t,n,r=!1){t.v!==R&&!this.previous.has(t)&&this.previous.set(t,t.v),t.f&Ee||(this.current.set(t,[n,r]),M==null||M.set(t,n)),this.is_fork||(t.v=n)}activate(){p=this}deactivate(){p=null,M=null}flush(){try{$t=!0,p=this,E(this,k,tt).call(this)}finally{kn=0,ln=null,qe=null,Rt=null,$t=!1,p=null,M=null,Me.clear()}}discard(){var t;for(const n of l(this,Ue))n(this);l(this,Ue).clear();for(const n of this.async_deriveds.values())n.reject(et);E(this,k,nt).call(this),(t=l(this,ze))==null||t.resolve()}register_created_effect(t){l(this,vt).push(t)}increment(t,n){if(y(this,Ke,l(this,Ke)+1),t){let r=l(this,_e).get(n)??0;l(this,_e).set(n,r+1)}}decrement(t,n){if(y(this,Ke,l(this,Ke)-1),t){let r=l(this,_e).get(n)??0;r===1?l(this,_e).delete(n):l(this,_e).set(n,r-1)}l(this,Ce)||(y(this,Ce,!0),Ne(()=>{y(this,Ce,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)l(this,pe).add(r);for(const r of n)l(this,ee).add(r);t.clear(),n.clear()}oncommit(t){l(this,He).add(t)}ondiscard(t){l(this,Ue).add(t)}settled(){return(l(this,ze)??y(this,ze,Yn())).promise}static ensure(){if(p===null){const t=p=new Bt;!$t&&!ft&&Ne(()=>{l(t,Ye)||t.flush()})}return p}apply(){{M=null;return}}schedule(t){var i;if(ln=t,(i=t.b)!=null&&i.is_pending&&t.f&(ut|gt|Hn)&&!(t.f&Ze)){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(qe!==null&&n===b&&(w===null||!(w.f&D)))return;if(r&(ke|oe)){if(!(r&C))return;n.f^=C}}l(this,I).push(n)}};Ye=new WeakMap,we=new WeakMap,Re=new WeakMap,He=new WeakMap,Ue=new WeakMap,Ke=new WeakMap,_e=new WeakMap,ze=new WeakMap,I=new WeakMap,vt=new WeakMap,pe=new WeakMap,ee=new WeakMap,se=new WeakMap,We=new WeakMap,Ce=new WeakMap,k=new WeakSet,fn=function(){if(this.is_fork)return!0;for(const r of l(this,_e).keys()){for(var t=r,n=!1;t.parent!==null;){if(l(this,se).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},tt=function(){var o,u,d,v;y(this,Ye,!0),kn++>1e3&&(E(this,k,nt).call(this),Si());for(const c of l(this,pe))l(this,ee).delete(c),A(c,N),this.schedule(c);for(const c of l(this,ee))A(c,ae),this.schedule(c);const t=l(this,I);y(this,I,[]),this.apply();var n=qe=[],r=[],i=Rt=[];for(const c of t)try{E(this,k,on).call(this,c,n,r)}catch(h){throw lr(c),E(this,k,fn).call(this)||this.discard(),h}if(p=null,i.length>0){var s=Bt.ensure();for(const c of i)s.schedule(c)}if(qe=null,Rt=null,E(this,k,fn).call(this)){E(this,k,Ie).call(this,r),E(this,k,Ie).call(this,n);for(const[c,h]of l(this,se))sr(c,h);i.length>0&&E(o=p,k,tt).call(o);return}const f=E(this,k,nr).call(this);if(f){E(this,k,Ie).call(this,r),E(this,k,Ie).call(this,n),E(u=f,k,rr).call(u,this);return}l(this,pe).clear(),l(this,ee).clear();for(const c of l(this,He))c(this);l(this,He).clear(),lt=this,Sn(r),Sn(n),lt=null,(d=l(this,ze))==null||d.resolve();var a=p;if(l(this,Ke)===0&&(l(this,I).length===0||a!==null)&&E(this,k,nt).call(this),l(this,I).length>0)if(a!==null){const c=a;l(c,I).push(...l(this,I).filter(h=>!l(c,I).includes(h)))}else a=this;a!==null&&E(v=a,k,tt).call(v)},on=function(t,n,r){t.f^=C;for(var i=t.first;i!==null;){var s=i.f,f=(s&(oe|ke))!==0,a=f&&(s&C)!==0,o=a||(s&Z)!==0||l(this,se).has(i);if(!o&&i.fn!==null){f?i.f^=C:s&ut?n.push(i):wt(i)&&(s&ne&&l(this,ee).add(i),Je(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var d=i.next;if(d!==null){i=d;break}i=i.parent}}},nr=function(){for(var t=l(this,we);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=l(t,we)}return null},rr=function(t){var r;for(const[i,s]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,s);for(const[i,s]of t.async_deriveds){const f=this.async_deriveds.get(i);f&&s.promise.then(f.resolve).catch(f.reject)}t.async_deriveds.clear(),this.transfer_effects(l(t,pe),l(t,ee));const n=i=>{var s=i.reactions;if(s!==null)for(const o of s){var f=o.f;if(f&D)n(o);else{var a=o;f&(Be|ne)&&!this.async_deriveds.has(a)&&(l(this,ee).delete(a),A(a,N),this.schedule(a))}}};for(const i of this.current.keys())n(i);this.oncommit(()=>t.discard()),E(r=t,k,nt).call(r),p=this,E(this,k,tt).call(this)},Ie=function(t){for(var n=0;n<t.length;n+=1)Qn(t[n],l(this,pe),l(this,ee))},Ei=function(){var v;for(let c=Gt;c!==null;c=l(c,Re)){var t=c.id<this.id,n=[];for(const[h,[_,g]]of this.current){if(c.current.has(h)){var r=c.current.get(h)[0];if(t&&_!==r)c.current.set(h,[_,g]);else continue}n.push(h)}if(t)for(const[h,_]of this.async_deriveds){const g=c.async_deriveds.get(h);g&&_.promise.then(g.resolve).catch(g.reject)}var i=[...c.current.keys()].filter(h=>!c.current.get(h)[1]);if(!(!l(c,Ye)||i.length===0)){var s=i.filter(h=>!this.current.has(h));if(s.length===0)t&&c.discard();else if(n.length>0){if(t)for(const h of l(this,We))c.unskip_effect(h,_=>{var g;_.f&(ne|Be)?c.schedule(_):E(g=c,k,Ie).call(g,[_])});c.activate();var f=new Set,a=new Map;for(var o of n)ir(o,s,f,a);a=new Map;var u=[...c.current].filter(([h,_])=>{const g=this.current.get(h);return g?g[0]!==_[0]||g[1]!==_[1]:!0}).map(([h])=>h);if(u.length>0)for(const h of l(this,vt))!(h.f&(ie|Z|Nt))&&_n(h,u,a)&&(h.f&(Be|ne)?(A(h,N),c.schedule(h)):l(c,pe).add(h));if(l(c,I).length>0&&!l(c,Ce)){c.apply();for(var d of l(c,I))E(v=c,k,on).call(v,d,[],[]);y(c,I,[])}c.deactivate()}}}},nt=function(){if(this.linked){var t=l(this,we),n=l(this,Re);t===null?Gt=n:y(t,Re,n),n===null?je=t:y(n,we,t),this.linked=!1}};let Le=Bt;function ki(e){var t=ft;ft=!0;try{for(var n;;){if(li(),p===null)return n;p.flush()}}finally{ft=t}}function Si(){try{Gr()}catch(e){be(e,ln)}}let X=null;function Sn(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&(ie|Z))&&wt(r)&&(X=new Set,Je(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&yr(r),(X==null?void 0:X.size)>0)){Me.clear();for(const i of X){if(i.f&(ie|Z))continue;const s=[i];let f=i.parent;for(;f!==null;)X.has(f)&&(X.delete(f),s.push(f)),f=f.parent;for(let a=s.length-1;a>=0;a--){const o=s[a];o.f&(ie|Z)||Je(o)}}X.clear()}}X=null}}function ir(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const s=i.f;s&D?ir(i,t,n,r):s&(Be|ne)&&!(s&N)&&_n(i,t,r)&&(A(i,N),pn(i))}}function _n(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(Pt.call(t,i))return!0;if(i.f&D&&_n(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function pn(e){p.schedule(e)}function sr(e,t){if(!(e.f&oe&&e.f&C)){e.f&N?t.d.push(e):e.f&ae&&t.m.push(e),A(e,C);for(var n=e.first;n!==null;)sr(n,t),n=n.next}}function lr(e){A(e,C);for(var t=e.first;t!==null;)lr(t),t=t.next}let Ft=new Set;const Me=new Map;let fr=!1;function mt(e,t){var n={f:0,v:e,reactions:null,equals:Kn,rv:0,wv:0};return n}function ye(e,t){const n=mt(e);return Ii(n),n}function Jt(e,t=!1,n=!0){var i;const r=mt(e);return t||(r.equals=zn),Ht&&n&&O!==null&&O.l!==null&&((i=O.l).s??(i.s=[])).push(r),r}function L(e,t,n=!1){w!==null&&(!re||w.f&Nt)&&yt()&&w.f&(D|ne|Be|Nt)&&(fe===null||!fe.has(e))&&Zr();let r=n?rt(t):t;return Lt(e,r,Rt)}function Lt(e,t,n=null){if(!e.equals(t)){Me.set(e,Se?t:e.v);var r=Le.ensure();if(r.capture(e,t),e.f&D){const i=e;e.f&N&&vn(i),M===null&&hn(i)}e.wv=kr(),or(e,N,n),yt()&&b!==null&&b.f&C&&!(b.f&(oe|ke))&&(z===null?qi([e]):z.push(e)),!r.is_fork&&Ft.size>0&&!fr&&Ti()}return t}function Ti(){fr=!1;for(const e of Ft){e.f&C&&A(e,ae);let t;try{t=wt(e)}catch{t=!0}t&&Je(e)}Ft.clear()}function ot(e){L(e,e.v+1)}function or(e,t,n){var r=e.reactions;if(r!==null)for(var i=yt(),s=r.length,f=0;f<s;f++){var a=r[f],o=a.f;if(!(!i&&a===b)){var u=(o&N)===0;if(u&&A(a,t),o&Nt)Ft.add(a);else if(o&D){var d=a;M==null||M.delete(d),o&Fe||(o&J&&(b===null||!(b.f&Mt))&&(a.f|=Fe),or(d,ae,n))}else if(u){var v=a;o&ne&&X!==null&&X.add(v),n!==null?n.push(v):pn(v)}}}}function rt(e){if(typeof e!="object"||e===null||st in e)return e;const t=Vn(e);if(t!==Lr&&t!==jr)return e;var n=new Map,r=Pr(e),i=ye(0),s=De,f=a=>{if(De===s)return a();var o=w,u=De;Q(null),Pn(s);var d=a();return Q(o),Pn(u),d};return r&&n.set("length",ye(e.length)),new Proxy(e,{defineProperty(a,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&$r();var d=n.get(o);return d===void 0?f(()=>{var v=ye(u.value);return n.set(o,v),v}):L(d,u.value,!0),!0},deleteProperty(a,o){var u=n.get(o);if(u===void 0){if(o in a){const d=f(()=>ye(R));n.set(o,d),ot(i)}}else L(u,R),ot(i);return!0},get(a,o,u){var h;if(o===st)return e;var d=n.get(o),v=o in a;if(d===void 0&&(!v||(h=it(a,o))!=null&&h.writable)&&(d=f(()=>{var _=rt(v?a[o]:R),g=ye(_);return g}),n.set(o,d)),d!==void 0){var c=P(d);return c===R?void 0:c}return Reflect.get(a,o,u)},getOwnPropertyDescriptor(a,o){var u=Reflect.getOwnPropertyDescriptor(a,o);if(u&&"value"in u){var d=n.get(o);d&&(u.value=P(d))}else if(u===void 0){var v=n.get(o),c=v==null?void 0:v.v;if(v!==void 0&&c!==R)return{enumerable:!0,configurable:!0,value:c,writable:!0}}return u},has(a,o){var c;if(o===st)return!0;var u=n.get(o),d=u!==void 0&&u.v!==R||Reflect.has(a,o);if(u!==void 0||b!==null&&(!d||(c=it(a,o))!=null&&c.writable)){u===void 0&&(u=f(()=>{var h=d?rt(a[o]):R,_=ye(h);return _}),n.set(o,u));var v=P(u);if(v===R)return!1}return d},set(a,o,u,d){var ce;var v=n.get(o),c=o in a;if(r&&o==="length")for(var h=u;h<v.v;h+=1){var _=n.get(h+"");_!==void 0?L(_,R):h in a&&(_=f(()=>ye(R)),n.set(h+"",_))}if(v===void 0)(!c||(ce=it(a,o))!=null&&ce.writable)&&(v=f(()=>ye(void 0)),L(v,rt(u)),n.set(o,v));else{c=v.v!==R;var g=f(()=>rt(u));L(v,g)}var S=Reflect.getOwnPropertyDescriptor(a,o);if(S!=null&&S.set&&S.set.call(d,u),!c){if(r&&typeof o=="string"){var x=n.get("length"),K=Number(o);Number.isInteger(K)&&K>=x.v&&L(x,K+1)}ot(i)}return!0},ownKeys(a){P(i);var o=Reflect.ownKeys(a).filter(v=>{var c=n.get(v);return c===void 0||c.v!==R});for(var[u,d]of n)d.v!==R&&!(u in a)&&o.push(u);return o},setPrototypeOf(){Jr()}})}var Tn,ar,ur,cr;function Ai(){if(Tn===void 0){Tn=window,ar=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ur=it(t,"firstChild").get,cr=it(t,"nextSibling").get,bn(e)&&(e[Yr]=void 0,e[Vr]=null,e[Hr]=void 0,e.__e=void 0),bn(n)&&(n[Xe]=void 0)}}function jt(e=""){return document.createTextNode(e)}function It(e){return ur.call(e)}function Ut(e){return cr.call(e)}function bt(e,t){return It(e)}function xi(e,t=!1){{var n=It(e);return n instanceof Comment&&n.data===""?Ut(n):n}}function Et(e,t=1,n=!1){let r=e;for(;t--;)r=Ut(r);return r}function Oi(){return!1}function Ri(e,t,n){return n?document.createElement(e,{is:n}):document.createElement(e)}let An=!1;function Ci(){An||(An=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n[At])==null||t.call(n)})},{capture:!0}))}function Kt(e){var t=w,n=b;Q(null),ue(null);try{return e()}finally{Q(t),ue(n)}}function Pi(e,t,n,r=n){e.addEventListener(t,()=>Kt(n));const i=e[At];i?e[At]=()=>{i(),r(!0)}:e[At]=()=>r(!0),Ci()}function hr(e){b===null&&(w===null&&Wr(),zr()),Se&&Kr()}function Ni(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ge(e,t){var n=b;n!==null&&n.f&Z&&(e|=Z);var r={ctx:O,deps:null,nodes:null,f:e|N|J,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};p==null||p.register_created_effect(r);var i=r;if(e&ut)qe!==null?qe.push(r):Le.ensure().schedule(r);else if(t!==null){try{Je(r)}catch(f){throw U(r),f}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&Qe)&&(i=i.first,e&ne&&e&Ge&&i!==null&&(i.f|=Ge))}if(i!==null&&(i.parent=n,n!==null&&Ni(i,n),w!==null&&w.f&D&&!(e&ke))){var s=w;(s.effects??(s.effects=[])).push(i)}return r}function gn(){return w!==null&&!re}function dr(e){const t=ge(gt,null);return A(t,C),t.teardown=e,t}function xn(e){hr();var t=b.f,n=!w&&(t&oe)!==0&&O!==null&&!O.i;if(n){var r=O;(r.e??(r.e=[])).push(e)}else return vr(e)}function vr(e){return ge(ut|Un,e)}function Mi(e){return hr(),ge(gt|Un,e)}function Di(e){Le.ensure();const t=ge(ke|Qe,e);return(n={})=>new Promise(r=>{n.outro?at(t,()=>{U(t),r(void 0)}):(U(t),r(void 0))})}function Fi(e){return ge(Be|Qe,e)}function _r(e,t=0){return ge(gt|t,e)}function On(e,t=[],n=[],r=[]){_i(r,t,n,i=>{ge(gt,()=>{e(...i.map(P))})})}function pr(e,t=0){var n=ge(ne|t,e);return n}function he(e){return ge(oe|Qe,e)}function gr(e){var t=e.teardown;if(t!==null){const n=Se,r=w;Cn(!0),Q(null);try{t.call(null)}finally{Cn(n),Q(r)}}}function yn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&Kt(()=>{i.abort(Yt)});var r=n.next;n.f&ke?n.parent=null:U(n,t),n=r}}function Li(e){for(var t=e.first;t!==null;){var n=t.next;t.f&oe||U(t),t=n}}function U(e,t=!0){var n=!1;(t||e.f&Br)&&e.nodes!==null&&e.nodes.end!==null&&(ji(e.nodes.start,e.nodes.end),n=!0),e.f|=En,yn(e,t&&!n),ct(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)s.stop();gr(e),e.f^=En,e.f|=ie;var i=e.parent;i!==null&&i.first!==null&&yr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ji(e,t){for(;e!==null;){var n=e===t?null:Ut(e);e.remove(),e=n}}function yr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function at(e,t,n=!0){var r=[];mr(e,r,!0);var i=()=>{n&&U(e),t&&t()},s=r.length;if(s>0){var f=()=>--s||i();for(var a of r)a.out(f)}else i()}function mr(e,t,n){if(!(e.f&Z)){e.f^=Z;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var i=e.first;i!==null;){var s=i.next;if(!(i.f&ke)){var f=(i.f&Ge)!==0||(i.f&oe)!==0&&(e.f&ne)!==0;mr(i,t,f?n:!1)}i=s}}}function Rn(e){wr(e,!0)}function wr(e,t){if(e.f&Z){e.f^=Z,e.f&C||(A(e,N),Le.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&Ge)!==0||(n.f&oe)!==0;wr(n,i?t:!1),n=r}var s=e.nodes&&e.nodes.t;if(s!==null)for(const f of s)(f.is_global||t)&&f.in()}}function br(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Ut(n);t.append(n),n=i}}let Ct=!1,Se=!1;function Cn(e){Se=e}let w=null,re=!1;function Q(e){w=e}let b=null;function ue(e){b=e}let fe=null;function Ii(e){w!==null&&(fe??(fe=new Set)).add(e)}let q=null,V=0,z=null;function qi(e){z=e}let Er=1,Ae=0,De=Ae;function Pn(e){De=e}function kr(){return++Er}function wt(e){var t=e.f;if(t&N)return!0;if(t&D&&(e.f&=~Fe),t&ae){for(var n=e.deps,r=n.length,i=0;i<r;i++){var s=n[i];if(wt(s)&&er(s),s.wv>e.wv)return!0}t&J&&M===null&&A(e,C)}return!1}function Sr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(fe!==null&&fe.has(e)))for(var i=0;i<r.length;i++){var s=r[i];s.f&D?Sr(s,t,!1):t===s&&(n?A(s,N):s.f&C&&A(s,ae),pn(s))}}function Tr(e){var g;var t=q,n=V,r=z,i=w,s=fe,f=O,a=re,o=De,u=e.f;q=null,V=0,z=null,w=u&(oe|ke)?null:e,fe=null,$e(e.ctx),re=!1,De=++Ae,e.ac!==null&&(Kt(()=>{e.ac.abort(Yt)}),e.ac=null);try{e.f|=Mt;var d=e.fn,v=d();e.f|=Ze;var c=e.deps,h=p==null?void 0:p.is_fork;if(q!==null){var _;if(h||ct(e,V),c!==null&&V>0)for(c.length=V+q.length,_=0;_<q.length;_++)c[V+_]=q[_];else e.deps=c=q;if(gn()&&e.f&J)for(_=V;_<c.length;_++)((g=c[_]).reactions??(g.reactions=[])).push(e)}else!h&&c!==null&&V<c.length&&(ct(e,V),c.length=V);if(yt()&&z!==null&&!re&&c!==null&&!(e.f&(D|ae|N)))for(_=0;_<z.length;_++)Sr(z[_],e);if(i!==null&&i!==e){if(Ae++,i.deps!==null)for(let S=0;S<n;S+=1)i.deps[S].rv=Ae;if(t!==null)for(const S of t)S.rv=Ae;z!==null&&(r===null?r=z:r.push(...z))}return e.f&Ee&&(e.f^=Ee),v}catch(S){return Jn(S)}finally{e.f^=Mt,q=t,V=n,z=r,w=i,fe=s,$e(f),re=a,De=o}}function Bi(e,t){let n=t.reactions;if(n!==null){var r=Nr.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&D&&(q===null||!Pt.call(q,t))){var s=t;s.f&J&&(s.f^=J,s.f&=~Fe),s.v!==R&&hn(s),wi(s),ct(s,0)}}function ct(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Bi(e,n[r])}function Je(e){var t=e.f;if(!(t&ie)){A(e,C);var n=b,r=Ct;b=e,Ct=!0;try{t&(ne|Hn)?Li(e):yn(e),gr(e);var i=Tr(e);e.teardown=typeof i=="function"?i:null,e.wv=Er;var s;Bn&&ii&&e.f&N&&e.deps}finally{Ct=r,b=n}}}async function Vi(){await Promise.resolve(),ki()}function P(e){var t=e.f,n=(t&D)!==0;if(w!==null&&!re){var r=b!==null&&(b.f&ie)!==0;if(!r&&(fe===null||!fe.has(e))){var i=w.deps;if(w.f&Mt)e.rv<Ae&&(e.rv=Ae,q===null&&i!==null&&i[V]===e?V++:q===null?q=[e]:q.push(e));else{w.deps??(w.deps=[]),Pt.call(w.deps,e)||w.deps.push(e);var s=e.reactions;s===null?e.reactions=[w]:Pt.call(s,w)||s.push(w)}}}if(Se&&Me.has(e))return Me.get(e);if(n){var f=e;if(Se){var a=f.v;return(!(f.f&C)&&f.reactions!==null||xr(f))&&(a=vn(f)),Me.set(f,a),a}var o=(f.f&J)===0&&!re&&w!==null&&(Ct||(w.f&J)!==0),u=(f.f&Ze)===0;wt(f)&&(o&&(f.f|=J),er(f)),o&&!u&&(tr(f),Ar(f))}if(M!=null&&M.has(e))return M.get(e);if(e.f&Ee)throw e.v;return e.v}function Ar(e){if(e.f|=J,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),t.f&D&&!(t.f&J)&&(tr(t),Ar(t))}function xr(e){if(e.v===R)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Me.has(t)||t.f&D&&xr(t))return!0;return!1}function mn(e){var t=re;try{return re=!0,e()}finally{re=t}}function Yi(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(st in e)an(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&st in n&&an(n)}}}function an(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{an(e[r],t)}catch{}const n=Vn(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Fr(n);for(let i in r){const s=r[i].get;if(s)try{s.call(e)}catch{}}}}}const Hi=["touchstart","touchmove"];function Ui(e){return Hi.includes(e)}const kt=Symbol("events"),Ki=new Set,Nn=new Set;function zi(e,t,n,r={}){function i(s){if(r.capture||un.call(t,s),!s.cancelBubble)return Kt(()=>n==null?void 0:n.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ne(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Wi(e,t,n,r,i){var s={capture:r,passive:i},f=zi(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&dr(()=>{t.removeEventListener(e,f,s)})}let Mn=null;function un(e){var g,S;var t=this,n=t.ownerDocument,r=e.type,i=((g=e.composedPath)==null?void 0:g.call(e))||[],s=i[0]||e.target;Mn=e;var f=0,a=Mn===e&&e[kt];if(a){var o=i.indexOf(a);if(o!==-1&&(t===document||t===window)){e[kt]=t;return}var u=i.indexOf(t);if(u===-1)return;o<=u&&(f=o)}if(s=i[f]||e.target,s!==t){Dr(e,"currentTarget",{configurable:!0,get(){return s||n}});var d=w,v=b;Q(null),ue(null);try{for(var c,h=[];s!==null&&s!==t;){try{var _=(S=s[kt])==null?void 0:S[r];_!=null&&(!s.disabled||e.target===s)&&_.call(s,e)}catch(x){c?h.push(x):c=x}if(e.cancelBubble)break;f++,s=f<i.length?i[f]:null}if(c){for(let x of h)queueMicrotask(()=>{throw x});throw c}}finally{e[kt]=t,delete e.currentTarget,Q(d),ue(v)}}}var In;const Zt=((In=globalThis==null?void 0:globalThis.window)==null?void 0:In.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Gi(e){return(Zt==null?void 0:Zt.createHTML(e))??e}function $i(e){var t=Ri("template");return t.innerHTML=Gi(e.replaceAll("<!>","<!---->")),t.content}function Dn(e,t){var n=b;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function zt(e,t){var n=(t&Xr)!==0,r=(t&ei)!==0,i,s=!e.startsWith("<!>");return()=>{i===void 0&&(i=$i(s?e:"<!>"+e),n||(i=It(i)));var f=r||ar?document.importNode(i,!0):i.cloneNode(!0);if(n){var a=It(f),o=f.lastChild;Dn(a,o)}else Dn(f,f);return f}}function St(e,t){e!==null&&e.before(t)}function Fn(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[Xe]??(e[Xe]=e.nodeValue))&&(e[Xe]=n,e.nodeValue=`${n}`)}function Ji(e,t){return Zi(e,t)}const Tt=new Map;function Zi(e,{target:t,anchor:n,props:r={},events:i,context:s,intro:f=!0,transformError:a}){Ai();var o=void 0,u=Di(()=>{var d=n??t.appendChild(jt());ui(d,{pending:()=>{}},h=>{Wn({});var _=O;s&&(_.c=s),i&&(r.$$events=i),o=e(h,r)||{},Gn()},a);var v=new Set,c=h=>{for(var _=0;_<h.length;_++){var g=h[_];if(!v.has(g)){v.add(g);var S=Ui(g);for(const ce of[t,document]){var x=Tt.get(ce);x===void 0&&(x=new Map,Tt.set(ce,x));var K=x.get(g);K===void 0?(ce.addEventListener(g,un,{passive:S}),x.set(g,1)):x.set(g,K+1)}}}};return c(Mr(Ki)),Nn.add(c),()=>{var S;for(var h of v)for(const x of[t,document]){var _=Tt.get(x),g=_.get(h);--g==0?(x.removeEventListener(h,un),_.delete(h),_.size===0&&Tt.delete(x)):_.set(h,g)}Nn.delete(c),d!==n&&((S=d.parentNode)==null||S.removeChild(d))}});return Qi.set(o,u),o}let Qi=new WeakMap;var te,le,H,Pe,_t,pt,Vt;class Xi{constructor(t,n=!0){B(this,"anchor");m(this,te,new Map);m(this,le,new Map);m(this,H,new Map);m(this,Pe,new Set);m(this,_t,!0);m(this,pt,t=>{if(l(this,te).has(t)){var n=l(this,te).get(t),r=l(this,le).get(n);if(r)Rn(r),l(this,Pe).delete(n);else{var i=l(this,H).get(n);i&&(Rn(i.effect),l(this,le).set(n,i.effect),l(this,H).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,f]of l(this,te)){if(l(this,te).delete(s),s===t)break;const a=l(this,H).get(f);a&&(U(a.effect),l(this,H).delete(f))}for(const[s,f]of l(this,le)){if(s===n||l(this,Pe).has(s))continue;const a=()=>{if(Array.from(l(this,te).values()).includes(s)){var u=document.createDocumentFragment();br(f,u),u.append(jt()),l(this,H).set(s,{effect:f,fragment:u})}else U(f);l(this,Pe).delete(s),l(this,le).delete(s)};l(this,_t)||!r?(l(this,Pe).add(s),at(f,a,!1)):a()}}});m(this,Vt,t=>{l(this,te).delete(t);const n=Array.from(l(this,te).values());for(const[r,i]of l(this,H))n.includes(r)||(U(i.effect),l(this,H).delete(r))});this.anchor=t,y(this,_t,n)}ensure(t,n){var r=p,i=Oi();if(n&&!l(this,le).has(t)&&!l(this,H).has(t))if(i){var s=document.createDocumentFragment(),f=jt();s.append(f),l(this,H).set(t,{effect:he(()=>n(f)),fragment:s})}else l(this,le).set(t,he(()=>n(this.anchor)));if(l(this,te).set(r,t),i){for(const[a,o]of l(this,le))a===t?r.unskip_effect(o):r.skip_effect(o);for(const[a,o]of l(this,H))a===t?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(l(this,pt)),r.ondiscard(l(this,Vt))}else l(this,pt).call(this,r)}}te=new WeakMap,le=new WeakMap,H=new WeakMap,Pe=new WeakMap,_t=new WeakMap,pt=new WeakMap,Vt=new WeakMap;function Ln(e,t,n=!1){var r=new Xi(e),i=n?Ge:0;function s(f,a){r.ensure(f,a)}pr(()=>{var f=!1;t((a,o=0)=>{f=!0,s(o,a)}),f||s(-1,null)},i)}function es(e,t,n=t){var r=new WeakSet;Pi(e,"input",async i=>{var s=i?e.defaultValue:e.value;if(s=Qt(e)?Xt(s):s,n(s),p!==null&&r.add(p),await Vi(),s!==(s=t())){var f=e.selectionStart,a=e.selectionEnd,o=e.value.length;if(e.value=s??"",a!==null){var u=e.value.length;f===a&&a===o&&u>o?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=f,e.selectionEnd=Math.min(a,u))}}}),mn(t)==null&&e.value&&(n(Qt(e)?Xt(e.value):e.value),p!==null&&r.add(p)),_r(()=>{var i=t();if(e===document.activeElement){var s=p;if(r.has(s))return}Qt(e)&&i===Xt(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function Qt(e){var t=e.type;return t==="number"||t==="range"}function Xt(e){return e===""?null:+e}function ts(e){return function(...t){var n=t[0];return n.preventDefault(),e==null?void 0:e.apply(this,t)}}function ns(e=!1){const t=O,n=t.l.u;if(!n)return;let r=()=>Yi(t.s);if(e){let i=0,s={};const f=dn(()=>{let a=!1;const o=t.s;for(const u in o)o[u]!==s[u]&&(s[u]=o[u],a=!0);return a&&i++,i});r=()=>P(f)}n.b.length&&Mi(()=>{jn(t,r),en(n.b)}),xn(()=>{const i=mn(()=>n.m.map(qr));return()=>{for(const s of i)typeof s=="function"&&s()}}),n.a.length&&xn(()=>{jn(t,r),en(n.a)})}function jn(e,t){if(e.l.s)for(const n of e.l.s)P(n);t()}const rs="5";var qn;typeof window<"u"&&((qn=window.__svelte??(window.__svelte={})).v??(qn.v=new Set)).add(rs);si();var is=zt('<p class="success svelte-1n46o8q">Connected. You can close this tab and return to the terminal.</p>'),ss=zt('<p class="error svelte-1n46o8q"> </p>'),ls=zt('<p>Paste your DataLab Rotterdam Nova API key to connect nova-ai-cli.</p> <form class="svelte-1n46o8q"><input type="password" placeholder="Nova API key" autocomplete="off" required="" class="svelte-1n46o8q"/> <button type="submit" class="svelte-1n46o8q"> </button></form> <!>',1),fs=zt('<main class="svelte-1n46o8q"><h1 class="svelte-1n46o8q">Connect Nova AI</h1> <!></main>');function os(e,t){Wn(t,!1);let n=Jt(""),r=Jt("idle"),i=Jt("");async function s(){L(r,"submitting"),L(i,"");try{const d=await fetch("/api/authenticate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:P(n)})});if(!d.ok){const v=await d.json().catch(()=>null);L(i,(v==null?void 0:v.message)??"Failed to validate API key."),L(r,"error");return}L(r,"success")}catch{L(i,"Could not reach the local auth server."),L(r,"error")}}ns();var f=fs(),a=Et(bt(f),2);{var o=d=>{var v=is();St(d,v)},u=d=>{var v=ls(),c=Et(xi(v),2),h=bt(c),_=Et(h,2),g=bt(_),S=Et(c,2);{var x=K=>{var ce=ss(),Or=bt(ce);On(()=>Fn(Or,P(i))),St(K,ce)};Ln(S,K=>{P(r)==="error"&&K(x)})}On(()=>{h.disabled=P(r)==="submitting",_.disabled=P(r)==="submitting"||!P(n),Fn(g,P(r)==="submitting"?"Connecting…":"Connect")}),es(h,()=>P(n),K=>L(n,K)),Wi("submit",c,ts(s)),St(d,v)};Ln(a,d=>{P(r)==="success"?d(o):d(u,-1)})}St(e,f),Gn()}Ji(os,{target:document.getElementById("app")});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
body{margin:0;background:#0f0f12;color:#e6e6e6;font-family:system-ui,-apple-system,sans-serif}main.svelte-1n46o8q{max-width:360px;margin:10vh auto;padding:2rem}h1.svelte-1n46o8q{font-size:1.25rem;margin-bottom:.5rem}form.svelte-1n46o8q{display:flex;gap:.5rem;margin-top:1rem}input.svelte-1n46o8q{flex:1;padding:.5rem .75rem;border-radius:6px;border:1px solid #333;background:#1a1a1e;color:inherit}button.svelte-1n46o8q{padding:.5rem 1rem;border-radius:6px;border:none;background:#5b5bf0;color:#fff;cursor:pointer}button.svelte-1n46o8q:disabled{opacity:.6;cursor:default}.success.svelte-1n46o8q{color:#4ade80}.error.svelte-1n46o8q{color:#f87171}
|