vite-devtools-svelte 0.1.2 → 0.2.1
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/README.md +17 -6
- package/dist/client/assets/client-BF-DBa_K.js +4 -0
- package/dist/client/assets/index-CnFg6eG8.js +6 -0
- package/dist/client/index.html +1 -1
- package/dist/index.mjs +725 -136
- package/dist/index.mjs.map +1 -1
- package/dist/mcp/issues.d.ts +52 -0
- package/dist/mcp/server.d.ts +18 -0
- package/dist/mcp/sessions.d.ts +114 -0
- package/dist/template-injector.d.ts +42 -0
- package/package.json +10 -7
- package/skills/vite-devtools-svelte-perf-audit/SKILL.md +31 -0
- package/skills/vite-devtools-svelte-perf-fix/SKILL.md +31 -0
- package/dist/client/assets/client-HxayJ2w5.js +0 -4
- package/dist/client/assets/index-BtpbdjQx.js +0 -6
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RenderProfile, ReactiveGraph, LoadProfile, FpsSample } from '../types.js';
|
|
2
|
+
export type IssueKind = 'slow-component-render' | 'over-rendered-component' | 'slow-load' | 'fps-drop' | 'effect-overconnected' | 'derived-orphan';
|
|
3
|
+
export interface PerformanceIssue {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: IssueKind;
|
|
6
|
+
severity: 'low' | 'medium' | 'high';
|
|
7
|
+
summary: string;
|
|
8
|
+
file?: string;
|
|
9
|
+
line?: number;
|
|
10
|
+
metric: Record<string, number>;
|
|
11
|
+
/** Tool that returns more detail for this issue. */
|
|
12
|
+
suggestedTool: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IssueThresholds {
|
|
15
|
+
/** Per-render time (ms) above which a component render is considered slow. */
|
|
16
|
+
avgRenderTimeMs?: number;
|
|
17
|
+
/** Render count above which a component is considered over-rendered. */
|
|
18
|
+
renderCount?: number;
|
|
19
|
+
/** Load duration (ms) above which a SvelteKit load is slow. */
|
|
20
|
+
loadDurationMs?: number;
|
|
21
|
+
/** FPS below which we record a drop. */
|
|
22
|
+
fpsDropThreshold?: number;
|
|
23
|
+
/** Outgoing edge count from an effect above which it is over-connected. */
|
|
24
|
+
effectMaxDeps?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface IssueInputs {
|
|
27
|
+
renderProfiles: RenderProfile[];
|
|
28
|
+
reactiveGraph: ReactiveGraph;
|
|
29
|
+
loadProfiles: LoadProfile[];
|
|
30
|
+
fpsSamples: FpsSample[];
|
|
31
|
+
}
|
|
32
|
+
export declare function listPerformanceIssues(inputs: IssueInputs, thresholds?: IssueThresholds): PerformanceIssue[];
|
|
33
|
+
export interface ReactiveProblems {
|
|
34
|
+
effects: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
file: string;
|
|
38
|
+
depCount: number;
|
|
39
|
+
}>;
|
|
40
|
+
orphanDeriveds: Array<{
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
file: string;
|
|
44
|
+
}>;
|
|
45
|
+
isolatedNodes: Array<{
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
type: string;
|
|
49
|
+
file: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export declare function summarizeReactiveProblems(graph: ReactiveGraph, t?: IssueThresholds): ReactiveProblems;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
|
+
import { RenderProfile, ReactiveGraph, LoadProfile, FpsSample, ComponentInstance, ProjectInfo, RouteInfo, ComponentRelation } from '../types.js';
|
|
4
|
+
import { SessionStore } from './sessions.js';
|
|
5
|
+
export interface McpDeps {
|
|
6
|
+
getProject: () => ProjectInfo;
|
|
7
|
+
getRoutes: () => RouteInfo[];
|
|
8
|
+
getLiveComponents: () => ComponentInstance[];
|
|
9
|
+
getComponentRelations: () => ComponentRelation[];
|
|
10
|
+
getRenderProfiles: () => RenderProfile[];
|
|
11
|
+
/** Resolves with the current reactive graph after refreshing from the browser. */
|
|
12
|
+
getReactiveGraph: () => Promise<ReactiveGraph>;
|
|
13
|
+
getLoadProfiles: () => LoadProfile[];
|
|
14
|
+
getFpsSamples: () => FpsSample[];
|
|
15
|
+
sessions: SessionStore;
|
|
16
|
+
}
|
|
17
|
+
export declare function buildMcpServer(deps: McpDeps): McpServer;
|
|
18
|
+
export { StreamableHTTPServerTransport };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { RenderProfile, LoadProfile, FpsSample } from '../types.js';
|
|
2
|
+
export interface SessionSnapshot {
|
|
3
|
+
/** componentId -> { renderCount, totalRenderTime } at snapshot moment */
|
|
4
|
+
renderProfiles: Array<{
|
|
5
|
+
componentId: number;
|
|
6
|
+
file: string;
|
|
7
|
+
name: string;
|
|
8
|
+
renderCount: number;
|
|
9
|
+
totalRenderTime: number;
|
|
10
|
+
}>;
|
|
11
|
+
loadProfilesCount: number;
|
|
12
|
+
fpsCount: number;
|
|
13
|
+
takenAt: number;
|
|
14
|
+
}
|
|
15
|
+
export interface SessionRecord {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
startedAt: number;
|
|
19
|
+
endedAt?: number;
|
|
20
|
+
persist: boolean;
|
|
21
|
+
startSnapshot: SessionSnapshot;
|
|
22
|
+
endSnapshot?: SessionSnapshot;
|
|
23
|
+
/** load profiles that arrived strictly between startedAt..endedAt */
|
|
24
|
+
loadProfiles: LoadProfile[];
|
|
25
|
+
/** fps samples that arrived strictly between startedAt..endedAt */
|
|
26
|
+
fpsSamples: FpsSample[];
|
|
27
|
+
}
|
|
28
|
+
export interface SessionDelta {
|
|
29
|
+
durationMs: number;
|
|
30
|
+
components: Array<{
|
|
31
|
+
componentId: number;
|
|
32
|
+
file: string;
|
|
33
|
+
name: string;
|
|
34
|
+
renderCountDelta: number;
|
|
35
|
+
totalRenderTimeDelta: number;
|
|
36
|
+
avgRenderTimeDelta: number;
|
|
37
|
+
}>;
|
|
38
|
+
loadProfiles: {
|
|
39
|
+
count: number;
|
|
40
|
+
avgDuration: number;
|
|
41
|
+
p95Duration: number;
|
|
42
|
+
};
|
|
43
|
+
fps: {
|
|
44
|
+
samples: number;
|
|
45
|
+
avg: number;
|
|
46
|
+
min: number;
|
|
47
|
+
drops: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface SessionDiff {
|
|
51
|
+
a: {
|
|
52
|
+
id: string;
|
|
53
|
+
label: string;
|
|
54
|
+
};
|
|
55
|
+
b: {
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
render: {
|
|
60
|
+
totalRenderTimeDeltaA: number;
|
|
61
|
+
totalRenderTimeDeltaB: number;
|
|
62
|
+
diff: number;
|
|
63
|
+
verdict: 'improved' | 'regressed' | 'unchanged';
|
|
64
|
+
};
|
|
65
|
+
load: {
|
|
66
|
+
avgA: number;
|
|
67
|
+
avgB: number;
|
|
68
|
+
diff: number;
|
|
69
|
+
verdict: 'improved' | 'regressed' | 'unchanged';
|
|
70
|
+
};
|
|
71
|
+
fps: {
|
|
72
|
+
avgA: number;
|
|
73
|
+
avgB: number;
|
|
74
|
+
diff: number;
|
|
75
|
+
verdict: 'improved' | 'regressed' | 'unchanged';
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface MetricGetters {
|
|
79
|
+
getRenderProfiles: () => RenderProfile[];
|
|
80
|
+
getLoadProfiles: () => LoadProfile[];
|
|
81
|
+
getFpsSamples: () => FpsSample[];
|
|
82
|
+
}
|
|
83
|
+
export interface SessionStoreOptions {
|
|
84
|
+
persistDir: string;
|
|
85
|
+
getters: MetricGetters;
|
|
86
|
+
}
|
|
87
|
+
export declare class SessionStore {
|
|
88
|
+
private sessions;
|
|
89
|
+
private active;
|
|
90
|
+
private readonly persistDir;
|
|
91
|
+
private readonly getters;
|
|
92
|
+
constructor(opts: SessionStoreOptions);
|
|
93
|
+
start(label: string, persist: boolean): SessionRecord;
|
|
94
|
+
/** Called by the plugin whenever a new load profile arrives. */
|
|
95
|
+
recordLoadProfile(p: LoadProfile): void;
|
|
96
|
+
/** Called by the plugin whenever a new fps sample arrives. */
|
|
97
|
+
recordFpsSample(s: FpsSample): void;
|
|
98
|
+
end(keep: 'memory' | 'disk' | 'discard'): SessionRecord;
|
|
99
|
+
get(id: string): SessionRecord | undefined;
|
|
100
|
+
list(): Array<{
|
|
101
|
+
id: string;
|
|
102
|
+
label: string;
|
|
103
|
+
startedAt: number;
|
|
104
|
+
endedAt?: number;
|
|
105
|
+
persisted: boolean;
|
|
106
|
+
active: boolean;
|
|
107
|
+
}>;
|
|
108
|
+
delete(id: string): boolean;
|
|
109
|
+
delta(id: string): SessionDelta;
|
|
110
|
+
compare(idA: string, idB: string): SessionDiff;
|
|
111
|
+
private pathFor;
|
|
112
|
+
private persistToDisk;
|
|
113
|
+
private loadFromDisk;
|
|
114
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* SvelteKit dev bypasses Vite's `transformIndexHtml`, so `@vitejs/devtools`'s
|
|
4
|
+
* `DevToolsInjection` never reaches the served HTML and the dock is invisible
|
|
5
|
+
* on every SvelteKit page. Tracked upstream at
|
|
6
|
+
* https://github.com/baseballyama/vite-devtools-repl/tree/main/sveltekit-transform-index-html-bypass
|
|
7
|
+
*
|
|
8
|
+
* As a stopgap, SvelteKit inlines `src/app.html` as a JS string literal inside
|
|
9
|
+
* `.svelte-kit/generated/server/internal.js`:
|
|
10
|
+
*
|
|
11
|
+
* templates: {
|
|
12
|
+
* app: ({ head, body, ... }) => "<!doctype html>...<body>...</body>...",
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* That file is loaded through Vite's module pipeline (`vite.ssrLoadModule`),
|
|
16
|
+
* so a regular `transform` hook can rewrite the literal to insert the dock's
|
|
17
|
+
* inject script before `</body>`. The actual `<script>` runs in the browser
|
|
18
|
+
* once the HTML is delivered, so no SSR safety guard on the inject module is
|
|
19
|
+
* needed for this path.
|
|
20
|
+
*
|
|
21
|
+
* This is intentionally narrow — SvelteKit-specific path match plus a
|
|
22
|
+
* structural assertion — and there's a test (`template-injector.test.ts`)
|
|
23
|
+
* that fails if SvelteKit's generated shape changes, so a silent break shows
|
|
24
|
+
* up in CI instead of as a missing dock in production.
|
|
25
|
+
*/
|
|
26
|
+
export declare const SVELTEKIT_INTERNAL_SUFFIX = ".svelte-kit/generated/server/internal.js";
|
|
27
|
+
/** Marker that the `templates.app` literal in SvelteKit's generated server. */
|
|
28
|
+
export declare const TEMPLATE_APP_MARKER = "templates: {";
|
|
29
|
+
/**
|
|
30
|
+
* Transform `.svelte-kit/generated/server/internal.js` to add the
|
|
31
|
+
* `@vitejs/devtools` inject script right before `</body>` inside the app
|
|
32
|
+
* template literal. Exposed for unit testing.
|
|
33
|
+
*
|
|
34
|
+
* Returns the new source if a substitution was made, or `null` to signal
|
|
35
|
+
* "nothing to do" (already injected, structural marker missing, etc.).
|
|
36
|
+
*/
|
|
37
|
+
export declare function injectIntoSvelteKitInternal(code: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Vite plugin: inject `@vitejs/devtools/client/inject` into SvelteKit's
|
|
40
|
+
* dev-only generated server template. Dev-only by construction.
|
|
41
|
+
*/
|
|
42
|
+
export declare function sveltekitTemplateInjector(): Plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-devtools-svelte",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Svelte DevTools plugin for Vite DevTools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yuichiro Yamashita",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"node": ">=22.0.0"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"dist"
|
|
28
|
+
"dist",
|
|
29
|
+
"skills"
|
|
29
30
|
],
|
|
30
31
|
"type": "module",
|
|
31
32
|
"main": "./dist/index.mjs",
|
|
@@ -41,17 +42,19 @@
|
|
|
41
42
|
"access": "public"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
46
|
+
"@vitejs/devtools-kit": "^0.2.0",
|
|
47
|
+
"zod": "^4.4.3"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
50
|
"@types/node": "^25.6.2",
|
|
48
51
|
"typescript": "^6.0.3",
|
|
49
|
-
"vite": "^8.0.
|
|
50
|
-
"vite-plugin-dts": "^
|
|
51
|
-
"vitest": "^
|
|
52
|
+
"vite": "^8.0.14",
|
|
53
|
+
"vite-plugin-dts": "^5.0.1",
|
|
54
|
+
"vitest": "^4.1.7"
|
|
52
55
|
},
|
|
53
56
|
"peerDependencies": {
|
|
54
|
-
"vite": "^8.0.
|
|
57
|
+
"vite": "^8.0.14"
|
|
55
58
|
},
|
|
56
59
|
"scripts": {
|
|
57
60
|
"build": "vite build",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vite-devtools-svelte:perf-audit
|
|
3
|
+
description: Use when the user asks to audit Svelte/SvelteKit app performance, find render hotspots, or identify what to optimize. Requires the vite-devtools-svelte MCP server to be registered (the dev server prints `claude mcp add ...` on startup). Always interactive — the user picks which issues to fix; never starts editing on its own.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Svelte performance audit
|
|
7
|
+
|
|
8
|
+
You are auditing a running Svelte/SvelteKit dev server through the `svelte` MCP server provided by `vite-devtools-svelte`.
|
|
9
|
+
|
|
10
|
+
## Preconditions
|
|
11
|
+
|
|
12
|
+
1. The dev server is running and the user has registered the MCP endpoint with `claude mcp add` (the dev server prints the exact command on startup).
|
|
13
|
+
2. The user has exercised the app at least once in a browser — render/load/fps buffers are empty until traffic flows.
|
|
14
|
+
|
|
15
|
+
If either is missing, stop and tell the user what to do; do not invent metrics.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
1. Call `start_session` with `label: "baseline-<short description>"` and `persist: false`. Tell the user that they should now use the app in the browser (golden path + any flow they care about) for ~10–30 seconds.
|
|
20
|
+
2. Wait for the user to confirm they are done exercising the app. Do not poll.
|
|
21
|
+
3. Call `end_session` with `keep: "memory"`. Note the session id from the response — you will need it later.
|
|
22
|
+
4. Call `list_performance_issues` (no thresholds first; defaults are sensible). Read the `issues` array.
|
|
23
|
+
5. Present the top 3 issues to the user as a compact table: `severity | kind | summary | file`. Add any context from the `metric` field that aids interpretation.
|
|
24
|
+
6. Ask the user which issue (if any) to investigate. **Do not implement fixes in this skill.** Hand off to `/vite-devtools-svelte:perf-fix <issue id or summary>` once they pick one.
|
|
25
|
+
|
|
26
|
+
## Guardrails
|
|
27
|
+
|
|
28
|
+
- Never claim performance improved without a `compare_sessions` result. This skill produces only the *before* baseline.
|
|
29
|
+
- If `list_performance_issues` returns an empty list, say so and ask the user whether to lower thresholds or exercise additional flows — do not fabricate issues.
|
|
30
|
+
- The reactive graph view depends on the browser being open; if `get_reactive_graph_problems` returns empty categories, ask the user to keep the page open and retry.
|
|
31
|
+
- Session disposal: at the end, ask whether to keep the baseline (`keep: "memory"` for this session, or persist with `keep: "disk"`). Do not silently retain or delete.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vite-devtools-svelte:perf-fix
|
|
3
|
+
description: Use to apply a single, scoped performance fix to a Svelte/SvelteKit app and verify the change with before/after measurements. Pairs with /vite-devtools-svelte:perf-audit (which identifies issues). One issue per invocation. Requires the vite-devtools-svelte MCP server.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Svelte performance fix
|
|
7
|
+
|
|
8
|
+
You are about to fix exactly **one** performance issue and verify it with measurement. Do not bundle multiple changes.
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
The user will name an issue. Resolve it to a target by calling the matching detail tool — `get_component_hotspots`, `get_reactive_graph_problems`, `get_load_waterfall`, `get_fps_drops`, or `get_render_profile` — based on the issue `kind` / `suggestedTool` from `/vite-devtools-svelte:perf-audit`.
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
1. **Confirm scope.** Restate the target in one sentence and list the file(s) you intend to edit. Ask the user to confirm before any further work.
|
|
17
|
+
2. **Capture baseline.** Call `start_session({ label: "before-<issue>" , persist: false })`. Ask the user to reproduce the slow flow in the browser. When they confirm, call `end_session({ keep: "memory" })` and remember the returned `id` as `baselineId`.
|
|
18
|
+
3. **Propose the change.** Read the target file(s). Propose a specific diff (mention the line numbers). Ask the user to approve. Only edit after approval.
|
|
19
|
+
4. **Apply the change.** Use Edit/Write tools. Keep the change minimal — the goal is to attribute the diff to one cause.
|
|
20
|
+
5. **Capture after.** Call `start_session({ label: "after-<issue>", persist: false })`. Ask the user to repeat the same flow. On confirmation, call `end_session({ keep: "memory" })` and remember the returned `id` as `afterId`.
|
|
21
|
+
6. **Compare.** Call `compare_sessions({ a: baselineId, b: afterId })`. Report the three `verdict` fields (render / load / fps) verbatim alongside the absolute numbers. **Do not paraphrase "improved" if any verdict is `regressed` or `unchanged`.**
|
|
22
|
+
7. **Decide.** If render verdict is `regressed`, propose `git diff` and offer to revert the edit. If all verdicts are `unchanged`, ask the user whether to keep the change anyway (it may have other benefits) or revert.
|
|
23
|
+
8. **Dispose of sessions.** Ask: keep baseline + after in memory (default), persist with `keep: "disk"` for later analysis, or `delete_session` both.
|
|
24
|
+
|
|
25
|
+
## Guardrails
|
|
26
|
+
|
|
27
|
+
- One issue per run. If new issues become visible after the fix, surface them and end — do not chain.
|
|
28
|
+
- Never call `apply` / `revert` actions implicitly through Edit without showing the user the proposed change first.
|
|
29
|
+
- Never claim improvement without quoting the `compare_sessions` output.
|
|
30
|
+
- If the user has uncommitted changes before you start, point that out — the revert path becomes ambiguous otherwise.
|
|
31
|
+
- If the dev server restarts during the session (e.g. config change), tell the user the measurement is invalid and restart from step 2.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var e=`__connection.json`,t=`__rpc-dump/index.json`;function n(e){return typeof e==`string`?`'${e}'`:new r().serialize(e)}var r=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}(),i=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],a=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,s=[],c=class{_data=new l;_hash=new l([...i]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],o=n[2],c=n[3],l=n[4],u=n[5],d=n[6],f=n[7];for(let n=0;n<64;n++){if(n<16)s[n]=e[t+n]|0;else{let e=s[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=s[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;s[n]=t+s[n-7]+i+s[n-16]}let p=l&u^~l&d,m=r&i^r&o^i&o,h=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),g=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),_=f+g+p+a[n]+s[n],v=h+m;f=d,d=u,u=l,l=c+_|0,c=o,o=i,i=r,r=_+v|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+c|0,n[4]=n[4]+l|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0}_append(e){typeof e==`string`&&(e=l.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new l(t,i)}},l=class e{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=t===void 0?e.length*4:t}static fromUtf8(t){let n=unescape(encodeURIComponent(t)),r=n.length,i=[];for(let e=0;e<r;e++)i[e>>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=this.words[t>>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6<this.sigBytes*8;n++)e.push(o.charAt(a>>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function u(e){return new c().finalize(e).toBase64()}function d(e){return u(n(e))}function f(e){return d(e)}function p(e){return`[${e.code}]`}function m(e){let t=`${p(e)} ${e.message}`,n=[];return e.why&&n.push(`why: ${e.why}`),e.fix&&n.push(`fix: ${e.fix}`),e.hint&&n.push(`hint: ${e.hint}`),e.docs&&n.push(`see: ${e.docs}`),n.length===0?t:[t,...n.map((e,t)=>`${t<n.length-1?`├▶`:`╰▶`} ${e}`)].join(`
|
|
2
|
-
`)}var h=m;function g(e,t){if(e!=null)return typeof e==`function`?e(t):e}function _(e){let{docsBase:t,codes:n}=e,r={},i=Object.keys(n);for(let e of i){let i=n[e];r[e]=(n,r)=>{let a=typeof i.message==`function`||typeof i.fix==`function`||typeof i.why==`function`||typeof i.hint==`function`,o=a?n:void 0,s=a?r:n,c=typeof t==`function`?t(e):t==null?void 0:`${t}/${e.toLowerCase()}`;return{code:e,level:i.level??`error`,message:g(i.message,o),...c!=null&&{docs:c},...g(i.fix,o)!=null&&{fix:g(i.fix,o)},...g(i.why,o)!=null&&{why:g(i.why,o)},...g(i.hint,o)!=null&&{hint:g(i.hint,o)},...s}}}return Object.defineProperties(r,{codes:{value:()=>i,enumerable:!1},has:{value:e=>e in n,enumerable:!1},get:{value:e=>n[e],enumerable:!1},extend:{value:t=>_({...e,codes:{...n,...t}}),enumerable:!1}}),r}var v=class extends Error{diagnostic;constructor(e){super(`[${e.code}] ${e.message}`),this.name=`CodedError`,this.diagnostic=e,e.cause!=null&&(this.cause=e.cause)}},y=(e,t)=>{e.level===`error`?console.error(t):console.warn(t)};function b(){let e={};if(typeof Error.captureStackTrace==`function`?Error.captureStackTrace(e,b):e.stack=Error().stack,!e.stack)return;let t=e.stack.split(`
|
|
3
|
-
`),n=0;for(;n<t.length&&!t[n].trimStart().startsWith(`at `);)n++;let r=typeof Error.captureStackTrace==`function`?1:2,i=t.slice(n+r).filter(e=>!e.includes(`/node_modules/`)&&!e.includes(`(node:`)).map(e=>e.trim());return i.length>0?i.join(`
|
|
4
|
-
`):void 0}function x(e,t,n){let r=e(n);for(let e of t)e(n,r);return r}function ee(e,t,n,r){return Object.assign({},e,{throw(){let i=r?b():void 0,a=i?{...e,stack:i}:e;throw x(t,n,a),new v(a)},warn(){let i=r?b():void 0;x(t,n,{...e,level:`warn`,...i&&{stack:i}})},error(){let i=r?b():void 0;x(t,n,{...e,level:`error`,...i&&{stack:i}})},log(){let i=r?b():void 0;x(t,n,i?{...e,stack:i}:e)},format(){return t(e)}})}function te(e){let t=e.formatter??h,n=Array.isArray(e.reporters)?e.reporters:[e.reporters??y],r=e.captureStack!==!1,i={};for(let a of e.diagnostics){let e=typeof a.codes==`function`?a.codes():Object.keys(a);for(let o of e)typeof a[o]==`function`&&(i[o]=(...e)=>ee(a[o](...e),t,n,r))}return i.throw=e=>{let i=r?b():void 0,a=i?{...e,stack:i}:e;throw x(t,n,a),new v(a)},i.warn=e=>{let i=r?b():void 0;x(t,n,{...e,level:`warn`,...i&&{stack:i}})},i.error=e=>{let i=r?b():void 0;x(t,n,{...e,level:`error`,...i&&{stack:i}})},i.log=e=>{let i=r?b():void 0;x(t,n,i?{...e,stack:i}:e)},i.format=e=>t(e),i}var S=te({diagnostics:[_({docsBase:`https://devfra.me/errors`,codes:{DF0019:{message:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\` — MCP requires JSON-serializable data.`,hint:"Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."},DF0020:{message:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,hint:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{message:e=>`RPC function "${e.name}" is already registered`,hint:"Use the `force` parameter to overwrite an existing registration."},DF0022:{message:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{message:e=>`RPC function "${e.name}" is not registered`},DF0024:{message:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{message:e=>`Function "${e.name}" not found in dump store`},DF0026:{message:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{message:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{message:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,hint:"Remove `snapshot: true`, or change the function type to `query`."}}})],formatter:h,reporters:y});function ne(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw C(t,`undefined`,r,e);return n}if(i===null)return n;if(typeof i==`bigint`)throw C(t,`BigInt`,r,e);if(typeof i==`object`){if(i instanceof Map)throw C(t,`Map`,r,e);if(i instanceof Set)throw C(t,`Set`,r,e);if(i instanceof Date)throw C(t,`Date`,r,e);if(Array.isArray(i))return n;let a=Object.getPrototypeOf(i);if(a!==null&&a!==Object.prototype)throw C(t,i.constructor?.name??`class instance`,r,e)}return n})}function C(e,t,n,r){let i=re(n,r);return S.DF0020({name:e||`<anonymous>`,type:t,path:i}).throw()}function re(e,t){return Array.isArray(e)?`[${t}]`:t===``?`<root>`:t}var ie=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>f(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}};async function ae(e,t){return e.__resolved?e.__resolved:e.setup?(e.__promise??=Promise.resolve(e.setup(t)).then(t=>(e.__resolved=t,e.__promise=void 0,t)),e.__resolved??=await e.__promise):{}}async function oe(e,t){if(e.handler)return e.handler;let n=await ae(e,t);if(!n.handler)throw S.DF0024({name:e.name}).throw();return n.handler}var se=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return oe(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw S.DF0021({name:e.name}).throw();ce(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw S.DF0022({name:e.name}).throw();ce(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await oe(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw S.DF0023({name:String(e)}).throw();return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function ce(e){if(e.agent&&e.jsonSerializable!==!0)throw S.DF0019({name:e.name}).throw()}function le(e){let t=e.cause instanceof Error?e.cause:ue(e.cause)?le(e.cause):e.cause,n=t===void 0?Error(e.message):Error(e.message,{cause:t});n.name=e.name;for(let t of Object.keys(e))t===`name`||t===`message`||t===`cause`||(n[t]=e[t]);return n}function ue(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}var de=`q`,fe=`s`;function pe(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var me=Math.random.bind(Math),he=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ge(e=21){let t=``,n=e;for(;n--;)t+=he[me()*64|0];return t}var _e=6e4,ve=e=>e,ye=ve,{clearTimeout:be,setTimeout:xe}=globalThis;function Se(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=ve,deserialize:s=ye,resolver:c,bind:l=`rpc`,timeout:u=_e,proxify:d=!0}=t,f=!1,p=new Map,m,h;async function g(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:de};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:g}=pe(),_=ge();s.i=_;let v;async function y(n=s){return u>=0&&(v=xe(()=>{try{if(t.onTimeoutError?.call(h,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){g(e)}p.delete(_)},u),typeof v==`object`&&(v=v.unref?.())),p.set(_,{resolve:d,reject:g,timeoutId:v,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(h,s,y,d):await y()}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}finally{be(v),p.delete(_)}return l}let _={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:y,get $closed(){return f},get $meta(){return t.meta},$close:v,$functions:e};h=d?new Proxy({},{get(t,n){if(Object.prototype.hasOwnProperty.call(_,n))return _[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>g(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):_;function v(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(b)}function y(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function b(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}if(a.t===de){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(h,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?h:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(h,f,r,s)===!0)return;if(!f)try{await n(o({t:fe,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(h,e,r,s)!==!0)throw e}try{await n(o({t:fe,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(h,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(be(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(b),h}function Ce(e,t){let{channel:n,rpcOptions:r={}}=t;return Se(e,{...n,timeout:-1,...r,proxify:!1})}var we=typeof self==`object`?self:globalThis;function Te(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new we[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new we[a](o),i)};return r}function Ee(e){return Te(new Map,e)(0)}var w=``,{toString:De}={},{keys:Oe}=Object;function ke(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=De.call(e).slice(8,-1);switch(n){case`Array`:return[1,w];case`Object`:return[2,w];case`Date`:return[3,w];case`RegExp`:return[4,w];case`Map`:return[5,w];case`Set`:return[6,w];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function Ae([e,t]){return e===0&&(t===`function`||t===`symbol`)}function je(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=ke(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Oe(r))(e||!Ae(ke(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Ae(ke(n))||Ae(ke(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Ae(ke(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function Me(e,t={}){let n=[];return je(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:Ne,stringify:Pe}=JSON,Fe={json:!0,lossy:!0};function Ie(e){return Ee(Ne(e))}function Le(e){return Pe(Me(e,Fe))}function Re(e){return Ee(e)}function ze(e){return Le(e)}function Be(e){return Ie(e)}function Ve(){}var He=new Map;function Ue(e){let t=e.url;e.authToken&&(t=`${t}?vite_devtools_auth_token=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=Ve,onError:i=Ve,onDisconnected:a=Ve,definitions:o=He}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{i(e instanceof Error?e:Error(e.type))}),n.addEventListener(`close`,e=>{a(e)});let s=new Map;return{on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN)n.send(e);else{function t(){n.send(e),n.removeEventListener(`open`,t)}n.addEventListener(`open`,t)}},serialize:e=>{let t;return e.t===`q`?t=e.m:(t=s.get(e.i),s.delete(e.i)),!(e.t===`s`&&`e`in e)&&t&&o.get(t)?.jsonSerializable===!0?ne(e,t??``):`s:${ze(e)}`},deserialize:e=>{let t=e.startsWith(`s:`)?Be(e.slice(2)):JSON.parse(e);return t.t===`q`&&t.i&&t.m&&s.set(t.i,t.m),t}}}function We(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e<t;e++){let t=r[e];t&&t(...n)}}function n(n,...r){t(n,...r),delete e[n]}function r(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var Ge=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Ke(e=21){let t=``,n=e;for(;n--;)t+=Ge[Math.random()*64|0];return t}var qe=Symbol.for(`immer-nothing`),Je=Symbol.for(`immer-draftable`),T=Symbol.for(`immer-state`);function E(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var D=Object,O=D.getPrototypeOf,k=`constructor`,Ye=`prototype`,Xe=`configurable`,Ze=`enumerable`,Qe=`writable`,$e=`value`,A=e=>!!e&&!!e[T];function j(e){return e?nt(e)||at(e)||!!e[Je]||!!e[k]?.[Je]||ot(e)||st(e):!1}var et=D[Ye][k].toString(),tt=new WeakMap;function nt(e){if(!e||!I(e))return!1;let t=O(e);if(t===null||t===D[Ye])return!0;let n=D.hasOwnProperty.call(t,k)&&t[k];if(n===Object)return!0;if(!L(n))return!1;let r=tt.get(n);return r===void 0&&(r=Function.toString.call(n),tt.set(n,r)),r===et}function M(e,t,n=!0){N(e)===0?(n?Reflect.ownKeys(e):D.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function N(e){let t=e[T];return t?t.type_:at(e)?1:ot(e)?2:st(e)?3:0}var P=(e,t,n=N(e))=>n===2?e.has(t):D[Ye].hasOwnProperty.call(e,t),F=(e,t,n=N(e))=>n===2?e.get(t):e[t],rt=(e,t,n,r=N(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function it(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var at=Array.isArray,ot=e=>e instanceof Map,st=e=>e instanceof Set,I=e=>typeof e==`object`,L=e=>typeof e==`function`,ct=e=>typeof e==`boolean`;function lt(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var ut=e=>I(e)?e?.[T]:null,R=e=>e.copy_||e.base_,dt=e=>e.modified_?e.copy_:e.base_;function ft(e,t){if(ot(e))return new Map(e);if(st(e))return new Set(e);if(at(e))return Array[Ye].slice.call(e);let n=nt(e);if(t===!0||t===`class_only`&&!n){let t=D.getOwnPropertyDescriptors(e);delete t[T];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Qe]===!1&&(a[Qe]=!0,a[Xe]=!0),(a.get||a.set)&&(t[i]={[Xe]:!0,[Qe]:!0,[Ze]:a[Ze],[$e]:e[i]})}return D.create(O(e),t)}else{let t=O(e);if(t!==null&&n)return{...e};let r=D.create(t);return D.assign(r,e)}}function pt(e,t=!1){return gt(e)||A(e)||!j(e)?e:(N(e)>1&&D.defineProperties(e,{set:ht,add:ht,clear:ht,delete:ht}),D.freeze(e),t&&M(e,(e,t)=>{pt(t,!0)},!1),e)}function mt(){E(2)}var ht={[$e]:mt};function gt(e){return e===null||!I(e)?!0:D.isFrozen(e)}var _t=`MapSet`,vt=`Patches`,yt=`ArrayMethods`,bt={};function z(e){let t=bt[e];return t||E(0,e),t}var xt=e=>!!bt[e];function St(e,t){bt[e]||(bt[e]=t)}var Ct,wt=()=>Ct,Tt=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:xt(_t)?z(_t):void 0,arrayMethodsPlugin_:xt(yt)?z(yt):void 0});function Et(e,t){t&&(e.patchPlugin_=z(vt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dt(e){Ot(e),e.drafts_.forEach(At),e.drafts_=null}function Ot(e){e===Ct&&(Ct=e.parent_)}var kt=e=>Ct=Tt(Ct,e);function At(e){let t=e[T];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[T].modified_&&(Dt(t),E(4)),j(e)&&(e=Mt(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[T].base_,e,t)}else e=Mt(t,n);return Nt(t,e,!0),Dt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===qe?void 0:e}function Mt(e,t){if(gt(t))return t;let n=t[T];if(!n)return Vt(t,e.handledSet_,e);if(!Ft(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);zt(n,e)}return n.copy_}function Nt(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&pt(t,n)}function Pt(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ft=(e,t)=>e.scope_===t,It=[];function Lt(e,t,n,r){let i=R(e),a=e.type_;if(r!==void 0&&F(i,r,a)===t){rt(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;M(i,(e,n)=>{if(A(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??It;for(let e of o)rt(i,e,n,a)}function Rt(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Ft(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=dt(i);Lt(e,i.draft_??i,a,n),zt(i,r)})}function zt(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Pt(e)}}function Bt(e,t,n){let{scope_:r}=e;if(A(n)){let i=n[T];Ft(i,r)&&i.callbacks_.push(function(){Yt(e),Lt(e,n,dt(i),t)})}else j(n)&&e.callbacks_.push(function(){let i=R(e);e.type_===3?i.has(n)&&Vt(n,r.handledSet_,r):F(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vt(F(e.copy_,t,e.type_),r.handledSet_,r)})}function Vt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||A(e)||t.has(e)||!j(e)||gt(e)?e:(t.add(e),M(e,(r,i)=>{if(A(i)){let t=i[T];Ft(t,n)&&(rt(e,r,dt(t),e.type_),Pt(t))}else j(i)&&Vt(i,t,n)}),e)}function Ht(e,t){let n=at(e),r={type_:n?1:0,scope_:t?t.scope_:wt(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Ut;n&&(i=[r],a=Wt);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Ut={get(e,t){if(t===T)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=R(e);if(!P(i,t,e.type_))return Kt(e,i,t);let a=i[t];if(e.finalized_||!j(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&<(t))return a;if(a===Gt(e.base_,t)){Yt(e);let n=e.type_===1?+t:t,r=Zt(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in R(e)},ownKeys(e){return Reflect.ownKeys(R(e))},set(e,t,n){let r=qt(R(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Gt(R(e),t),i=r?.[T];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(it(n,r)&&(n!==void 0||P(e.base_,t,e.type_)))return!0;Yt(e),Jt(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),Bt(e,t,n),!0)},deleteProperty(e,t){return Yt(e),Gt(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Jt(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=R(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Qe]:!0,[Xe]:e.type_!==1||t!==`length`,[Ze]:r[Ze],[$e]:n[t]}},defineProperty(){E(11)},getPrototypeOf(e){return O(e.base_)},setPrototypeOf(){E(12)}},Wt={};for(let e in Ut){let t=Ut[e];Wt[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}Wt.deleteProperty=function(e,t){return Wt.set.call(this,e,t,void 0)},Wt.set=function(e,t,n){return Ut.set.call(this,e[0],t,n,e[0])};function Gt(e,t){let n=e[T];return(n?R(n):e)[t]}function Kt(e,t,n){let r=qt(t,n);return r?$e in r?r[$e]:r.get?.call(e.draft_):void 0}function qt(e,t){if(!(t in e))return;let n=O(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=O(n)}}function Jt(e){e.modified_||(e.modified_=!0,e.parent_&&Jt(e.parent_))}function Yt(e){e.copy_||=(e.assigned_=new Map,ft(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(L(e)&&!L(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}L(t)||E(6),n!==void 0&&!L(n)&&E(7);let r;if(j(e)){let i=kt(this),a=Zt(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Dt(i):Ot(i)}return Et(i,n),jt(r,i)}else if(!e||!I(e)){if(r=t(e),r===void 0&&(r=e),r===qe&&(r=void 0),this.autoFreeze_&&pt(r,!0),n){let t=[],i=[];z(vt).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else E(1,e)},this.produceWithPatches=(e,t)=>{if(L(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},ct(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ct(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ct(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){j(e)||E(8),A(e)&&(e=Qt(e));let t=kt(this),n=Zt(t,e,void 0);return n[T].isManual_=!0,Ot(t),n}finishDraft(e,t){let n=e&&e[T];(!n||!n.isManual_)&&E(9);let{scope_:r}=n;return Et(r,t),jt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=z(vt).applyPatches_;return A(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Zt(e,t,n,r){let[i,a]=ot(t)?z(_t).proxyMap_(t,n):st(t)?z(_t).proxySet_(t,n):Ht(t,n);return(n?.scope_??wt()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Rt(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Qt(e){return A(e)||E(10,e),$t(e)}function $t(e){if(!j(e)||gt(e))return e;let t=e[T],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ft(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ft(e,!0);return M(n,(e,t)=>{rt(n,e,$t(t))},r),t&&(t.finalized_=!1),n}function en(){function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=ut(F(e,n.key_)),i=F(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||P(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(n=F(n,r),!I(n)||n===null)throw Error(`Cannot resolve path at '${t.join(`/`)}'`)}return n}let n=`replace`,r=`remove`;function i(e,t,n){if(e.scope_.processedForPatches_.has(e))return;e.scope_.processedForPatches_.add(e);let{patches_:r,inversePatches_:i}=n;switch(e.type_){case 0:case 2:return o(e,t,r,i);case 1:return a(e,t,r,i);case 3:return s(e,t,r,i)}}function a(e,t,i,a){let{base_:o,assigned_:s}=e,c=e.copy_;c.length<o.length&&([o,c]=[c,o],[i,a]=[a,i]);let l=e.allIndicesReassigned_===!0;for(let e=0;e<o.length;e++){let r=c[e],u=o[e];if((l||s?.get(e.toString()))&&r!==u){let o=r?.[T];if(o&&o.modified_)continue;let s=t.concat([e]);i.push({op:n,path:s,value:d(r)}),a.push({op:n,path:s,value:d(u)})}}for(let e=o.length;e<c.length;e++){let n=t.concat([e]);i.push({op:`add`,path:n,value:d(c[e])})}for(let e=c.length-1;o.length<=e;--e){let n=t.concat([e]);a.push({op:r,path:n})}}function o(e,t,i,a){let{base_:o,copy_:s,type_:c}=e;M(e.assigned_,(e,l)=>{let u=F(o,e,c),f=F(s,e,c),p=l?P(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===qe?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e<i.length-1;e++){let t=N(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===k)&&E(19),L(o)&&n===Ye&&E(19),o=F(o,n),I(o)||E(18,i.join(`/`))}let s=N(o),c=u(t.value),l=i[i.length-1];switch(a){case n:switch(s){case 2:return o.set(l,c);case 3:E(16);default:return o[l]=c}case`add`:switch(s){case 1:return l===`-`?o.push(c):o.splice(l,0,c);case 2:return o.set(l,c);case 3:return o.add(c);default:return o[l]=c}case r:switch(s){case 1:return o.splice(l,1);case 2:return o.delete(l);case 3:return o.delete(t.value);default:return delete o[l]}default:E(17,a)}}),e}function u(e){if(!j(e))return e;if(at(e))return e.map(u);if(ot(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(st(e))return new Set(Array.from(e).map(u));let t=Object.create(O(e));for(let n in e)t[n]=u(e[n]);return P(e,Je)&&(t[Je]=e[Je]),t}function d(e){return A(e)?u(e):e}St(vt,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}var tn=new Xt,nn=tn.produce,rn=tn.produceWithPatches.bind(tn),an=tn.applyPatches.bind(tn);function on(e){let{enablePatches:t=!1}=e,n=We(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=Ke())=>{i.has(t)||(en(),r=an(r,e),i.add(t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=Ke())=>{if(!i.has(a))if(i.add(a),t){let[t,i]=rn(r,e);r=t,n.emit(`updated`,r,i,a)}else r=nn(r,e),n.emit(`updated`,r,void 0,a)},syncIds:i}}var sn=256,cn=class extends Error{name=`StreamClosedError`};function ln(e={}){let t=e.id??Ke(),n=Math.max(0,e.replayWindow??0),r=We(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new cn(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&a.splice(0,a.length-n)),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=dn(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function un(e={}){let t=e.id??Ke(),n=Math.max(1,e.highWaterMark??sn),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function h(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function g(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){h()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return g()},cancel:h,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return h(),Promise.resolve({value:void 0,done:!0})}}}}}function dn(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var fn=`afraid.all.beige.better.big.blue.bold.brave.breezy.bright.brown.bumpy.busy.calm.chatty.chilly.chubby.clean.clear.clever.cold.common.cool.cozy.crisp.cuddly.curly.curvy.cute.cyan.dark.deep.dirty.dry.dull.eager.early.easy.eight.eighty.eleven.empty.every.fair.famous.fancy.fast.few.fiery.fifty.fine.five.flat.floppy.fluffy.forty.four.frank.free.fresh.fruity.full.funky.funny.fuzzy.gentle.giant.gold.good.goofy.great.green.grumpy.happy.heavy.hip.honest.hot.huge.humble.hungry.icy.itchy.jolly.khaki.kind.large.late.lazy.legal.lemon.light.little.long.loose.loud.lovely.lucky.major.many.metal.mighty.modern.moody.neat.new.nice.nine.ninety.odd.old.olive.open.orange.perky.petite.pink.plain.plenty.polite.pretty.proud.public.puny.purple.quick.quiet.rare.ready.real.red.rich.ripe.salty.seven.shaggy.shaky.sharp.shiny.short.shy.silent.silly.silver.six.sixty.slick.slimy.slow.small.smart.smooth.social.soft.solid.some.sour.sparkly.spicy.spotty.stale.strict.strong.sunny.sweet.swift.tall.tame.tangy.tasty.ten.tender.thick.thin.thirty.three.tidy.tiny.tired.tough.tricky.true.twelve.twenty.two.upset.vast.violet.wacky.warm.wet.whole.wicked.wide.wild.wise.witty.yellow.young.yummy`.split(`.`),pn=`actors.ads.adults.aliens.animals.ants.apes.apples.areas.baboons.badgers.bags.balloons.bananas.banks.bars.baths.bats.beans.bears.beds.beers.bees.berries.bikes.birds.boats.bobcats.books.bottles.boxes.breads.brooms.buckets.bugs.buses.bushes.buttons.camels.cameras.candies.candles.canyons.carpets.carrots.cars.cases.cats.chairs.chefs.chicken.cities.clocks.cloths.clouds.clowns.clubs.coats.cobras.coins.colts.comics.cooks.corners.cougars.cows.crabs.crews.cups.cycles.dancers.days.deer.deserts.dingos.dodos.dogs.dolls.donkeys.donuts.doodles.doors.dots.dragons.drinks.dryers.ducks.eagles.ears.eels.eggs.emus.ends.experts.eyes.facts.falcons.fans.feet.files.flies.flowers.forks.foxes.friends.frogs.games.garlics.geckos.geese.ghosts.gifts.glasses.goats.grapes.groups.guests.hairs.hands.hats.heads.hoops.hornets.horses.hotels.hounds.houses.humans.icons.ideas.impalas.insects.islands.items.jars.jeans.jobs.jokes.keys.kids.kings.kiwis.knives.lamps.lands.laws.lemons.lies.lights.lilies.lines.lions.lizards.llamas.loops.mails.mammals.mangos.maps.masks.meals.melons.memes.meteors.mice.mirrors.moles.moments.monkeys.months.moons.moose.mugs.nails.needles.news.nights.numbers.olives.onions.oranges.otters.owls.pandas.pans.pants.papayas.papers.parents.parks.parrots.parts.paths.paws.peaches.pears.peas.pens.pets.phones.pianos.pigs.pillows.places.planes.planets.plants.plums.poems.poets.points.pots.pugs.pumas.queens.rabbits.radios.rats.ravens.readers.regions.results.rice.rings.rivers.rockets.rocks.rooms.roses.rules.sails.schools.seals.seas.sheep.shirts.shoes.showers.shrimps.sides.signs.singers.sites.sloths.snails.snakes.socks.spiders.spies.spoons.squids.stamps.stars.states.steaks.streets.suits.suns.swans.symbols.tables.taxes.taxis.teams.teeth.terms.things.ties.tigers.times.tips.tires.toes.tools.towns.toys.trains.trams.trees.turkeys.turtles.vans.views.walls.wasps.waves.ways.webs.weeks.windows.wings.wolves.wombats.words.worlds.worms.yaks.years.zebras.zoos`.split(`.`),mn=`accept.act.add.admire.agree.allow.appear.argue.arrive.ask.attack.attend.bake.bathe.battle.beam.beg.begin.behave.bet.boil.bow.brake.brush.build.burn.buy.call.camp.care.carry.change.cheat.check.cheer.chew.clap.clean.cough.count.cover.crash.create.cross.cry.cut.dance.decide.deny.design.dig.divide.do.double.doubt.draw.dream.dress.drive.drop.drum.eat.end.enjoy.enter.exist.fail.fall.feel.fetch.film.find.fix.flash.float.flow.fly.fold.follow.fry.give.glow.go.grab.greet.grin.grow.guess.hammer.hang.happen.heal.hear.help.hide.hope.hug.hunt.invent.invite.itch.jam.jog.join.joke.judge.juggle.jump.kick.kiss.kneel.knock.know.laugh.lay.lead.learn.leave.lick.lie.like.listen.live.look.lose.love.make.march.marry.mate.matter.melt.mix.move.nail.notice.obey.occur.open.own.pay.peel.pick.play.poke.post.press.prove.pull.pump.punch.push.raise.read.refuse.relate.relax.remain.repair.repeat.reply.report.rescue.rest.retire.return.rhyme.ring.roll.rule.run.rush.say.scream.search.see.sell.send.serve.shake.share.shave.shine.shop.shout.show.sin.sing.sink.sip.sit.sleep.slide.smash.smell.smile.smoke.sneeze.sniff.sort.speak.spend.stand.stare.start.stay.stick.stop.strive.study.swim.switch.take.talk.tan.tap.taste.teach.tease.tell.thank.think.throw.tickle.tie.trade.train.travel.try.turn.type.unite.vanish.visit.wait.walk.warn.wash.watch.wave.wear.win.wink.wish.wonder.work.worry.write.yawn.yell`.split(`.`);function hn(e){return e[Math.random()*e.length|0]}function gn(){return`${hn(fn)}-${hn(pn)}-${hn(mn)}`}function _n(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function vn(e){let t=new Map,n=new Map,r=new Set,i=e.connectionMeta.backend===`static`;function a(e,t){let r=n.get(e);return r&&typeof r==`object`&&!Array.isArray(r)&&typeof t==`object`&&!Array.isArray(t)?{...r,...t}:t}e.client.register({name:`devframe:rpc:client-state:updated`,type:`event`,handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.mutate(()=>a(e,n),r)}}),e.client.register({name:`devframe:rpc:client-state:patch`,type:`event`,handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.patch(n,r)}});function o(t,n){let r=[];return r.push(n.on(`updated`,(n,r,a)=>{i||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,a):e.callEvent(`devframe:rpc:server-state:set`,t,n,a))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return r.add(e),()=>{r.delete(e)}},get:async(s,c)=>{if(c?.initialValue!==void 0&&n.set(s,c.initialValue),t.has(s))return t.get(s);let l=on({initialValue:c?.initialValue,enablePatches:!1});async function u(){if(i||e.callEvent(`devframe:rpc:server-state:subscribe`,s),c?.initialValue!==void 0){t.set(s,l);for(let e of r)e(s);return e.call(`devframe:rpc:server-state:get`,s).then(e=>{e!==void 0&&l.mutate(()=>a(s,e))}).catch(e=>{console.error(`Error getting server state`,e)}),o(s,l),l}else{let n=await e.call(`devframe:rpc:server-state:get`,s);l.mutate(()=>a(s,n)),t.set(s,l);for(let e of r)e(s);return o(s,l),l}}return new Promise(t=>{e.isTrusted?u().then(t):(t(l),e.events.on(`rpc:is-trusted:updated`,e=>{e&&u()}))})}}}function yn(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function bn(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function xn(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function Sn(e){if(e.error)throw le(e.error);return e.output}function Cn(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`?Re(e):e}async function a(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>i(t,e.serialization)));let r=await n.get(e.path);return xn(r)?Sn(r):r}async function o(e,n){return r.has(e)||r.set(e,t(e).then(e=>i(e,n))),await r.get(e)}async function s(t,n){if(!(t in e))throw Error(`[devtools-rpc] Function "${t}" not found in dump store`);let r=e[t];if(yn(r)){if(n.length>0)throw Error(`[devtools-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await a(r)}if(bn(r)){let e=f(n),i=r.records[e];if(i)return Sn(await o(i,r.serialization));if(r.fallback)return Sn(await o(r.fallback,r.serialization));throw Error(`[devtools-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(n.length===0)return r;throw Error(`[devtools-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await s(e,t),callOptional:async(t,n)=>{if(t in e)return await s(t,n)},callEvent:async(e,t)=>{}}}async function wn(e){let n=Cn(await e.fetchJsonFromBases(t),e.fetchJsonFromBases);return{isTrusted:!0,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,ensureTrusted:async()=>!0,call:(...e)=>n.call(e[0],e.slice(1)),callEvent:(...e)=>n.callEvent(e[0],e.slice(1)),callOptional:(...e)=>n.callOptional(e[0],e.slice(1))}}var Tn=``;function En(e,t){return`${e}${Tn}${t}`}function Dn(e){let t=new Map,n=new Map;e.client.register({name:`devframe:streaming:chunk`,type:`event`,handler(e,n,r,i){t.get(En(e,n))?._push(r,i)}}),e.client.register({name:`devframe:streaming:end`,type:`event`,handler(e,n,r){let i=En(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:`devframe:streaming:upload-cancel`,type:`event`,handler(e,t){let r=En(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(`rpc:is-trusted:updated`,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(Tn);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=En(n,r),o=t.get(a);if(o)return o;let s=un({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(`rpc:is-trusted:updated`,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=En(t,r),a=n.get(i);if(a)return a;let o=ln({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}var B=``,On=`?`,kn=`major`,V=`model`,H=`name`,U=`type`,W=`vendor`,G=`version`,K=`architecture`,An=`console`,q=`mobile`,J=`tablet`,Y=`smarttv`,X=`wearable`,jn=`embedded`,Mn=500,Nn=`Amazon`,Pn=`Apple`,Fn=`ASUS`,In=`BlackBerry`,Z=`Browser`,Ln=`Chrome`,Rn=`Edge`,zn=`Firefox`,Bn=`Google`,Vn=`Huawei`,Hn=`LG`,Un=`Microsoft`,Wn=`Motorola`,Q=`Opera`,Gn=`Samsung`,Kn=`Sharp`,qn=`Sony`,Jn=`Xiaomi`,Yn=`Zebra`,Xn=`Facebook`,Zn=`Chromium OS`,Qn=`Mac OS`;function $n(e,t={}){let n={};for(let r of Object.keys(e)){let i=t[r];i&&i.length%2==0?n[r]=[...i,...e[r]]:n[r]=e[r]}return n}function er(e){let t={};for(let n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t}function tr(e){return e.toLowerCase()}function nr(e,t){return typeof e==`string`?tr(t).includes(tr(e)):!1}function rr(e){return typeof e==`string`?e.replace(/[^\d.]/g,B).split(`.`)[0]:void 0}function ir(e,t){let n=e.replace(/^\s+/,B);return t===void 0?n:n.substring(0,t)}function ar(e,t,n){let r=n??{};for(let n=0;n<t.length;n+=2){let i=t[n],a=t[n+1];for(let t=0;t<i.length;t++){let n=i[t];if(!n)break;let o=n.exec(e);if(o){for(let e=0;e<a.length;e++){let t=o[e+1],n=a[e];if(Array.isArray(n)){let e=n[0],i=n.length;if(i===2){let i=n[1];typeof i==`function`?r[e]=i(t,void 0,r):r[e]=i}else if(i===3){let i=n[1],a=n[2];typeof i==`function`&&!(`exec`in i)&&!(`test`in i)?r[e]=t?i(t,a,r):void 0:r[e]=t?t.replace(i,a):void 0}else i===4&&(r[e]=t?n[3](t.replace(n[1],n[2]),void 0,r):void 0)}else r[n]=t||void 0}return r}}}return r}function or(e,t){for(let n in t){let r=t[n];if(Array.isArray(r)&&r.length>0){for(let t=0;t<r.length;t++)if(nr(r[t],e))return n===On?void 0:n}else if(nr(r,e))return n===On?void 0:n}return e}var sr={"1.0":`/8`,"1.2":`/1`,"1.3":`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},cr={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,"8.1":`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},lr={browser:[[/\b(?:crmo|crios)\/([\w.]+)/i],[G,[H,`Chrome`]],[/edg(?:e|ios|a)?\/([\w.]+)/i],[G,[H,`Edge`]],[/(opera mini)\/([-\w.]+)/i,/(opera [mobileta]{3,6})\b.+version\/([-\w.]+)/i,/(opera)(?:.+version\/|[/ ]+)([\w.]+)/i],[H,G],[/opios[/ ]+([\w.]+)/i],[G,[H,`${Q} Mini`]],[/\bop(?:rg)?x\/([\w.]+)/i],[G,[H,`${Q} GX`]],[/\bopr\/([\w.]+)/i],[G,[H,Q]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[/ ]?([\w.]+)/i],[G,[H,`Baidu`]],[/(kindle)\/([\w.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[/ ]?([\w.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[/ ]?([\w.]*)/i,/(?:ms|\()(ie) ([\w.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w.]+)/i,/(heytap|ovi)browser\/([\d.]+)/i,/(weibo)__([\d.]+)/i],[H,G],[/\bddg\/([\w.]+)/i],[G,[H,`DuckDuckGo`]],[/(?:\buc? ?browser|juc.+ucweb)[/ ]?([\w.]+)/i],[G,[H,`UC${Z}`]],[/microm.+\bqbcore\/([\w.]+)/i,/\bqbcore\/([\w.]+).+microm/i,/micromessenger\/([\w.]+)/i],[G,[H,`WeChat`]],[/konqueror\/([\w.]+)/i],[G,[H,`Konqueror`]],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i],[G,[H,`IE`]],[/ya(?:search)?browser\/([\w.]+)/i],[G,[H,`Yandex`]],[/slbrowser\/([\w.]+)/i],[G,[H,`Smart Lenovo ${Z}`]],[/(avast|avg)\/([\w.]+)/i],[[H,/(.+)/,`$1 Secure ${Z}`],G],[/\bfocus\/([\w.]+)/i],[G,[H,`${zn} Focus`]],[/\bopt\/([\w.]+)/i],[G,[H,`${Q} Touch`]],[/coc_coc\w+\/([\w.]+)/i],[G,[H,`Coc Coc`]],[/dolfin\/([\w.]+)/i],[G,[H,`Dolphin`]],[/coast\/([\w.]+)/i],[G,[H,`${Q} Coast`]],[/miuibrowser\/([\w.]+)/i],[G,[H,`MIUI ${Z}`]],[/fxios\/([-\w.]+)/i],[G,[H,zn]],[/\bqihu|(qi?ho{0,2}|360)browser/i],[[H,`360 ${Z}`]],[/(oculus|sailfish|huawei|vivo)browser\/([\w.]+)/i],[[H,/(.+)/,`$1 ${Z}`],G],[/samsungbrowser\/([\w.]+)/i],[G,[H,`${Gn} Internet`]],[/(comodo_dragon)\/([\w.]+)/i],[[H,/_/g,` `],G],[/metasr[/ ]?([\d.]+)/i],[G,[H,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d.]+)/i],[[H,`Sogou Mobile`],G],[/(electron)\/([\w.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w.]+))/i,/m?(qqbrowser|2345Explorer)[/ ]?([\w.]+)/i],[H,G],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[H],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w.]+);)/i],[[H,Xn],G],[/(Klarna)\/([\w.]+)/i,/(kakao(?:talk|story))[/ ]([\w.]+)/i,/(naver)\(.*?(\d+\.[\w.]+).*\)/i,/safari (line)\/([\w.]+)/i,/\b(line)\/([\w.]+)\/iab/i,/(alipay)client\/([\w.]+)/i,/(twitter)(?:and| f.+e\/([\w.]+))/i,/(chromium|instagram|snapchat)[/ ]([-\w.]+)/i],[H,G],[/\bgsa\/([\w.]+) .*safari\//i],[G,[H,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w.]+)/i],[G,[H,`TikTok`]],[/headlesschrome(?:\/([\w.]+)| )/i],[G,[H,`${Ln} Headless`]],[/ wv\).+(chrome)\/([\w.]+)/i],[[H,`${Ln} WebView`],G],[/droid.+ version\/([\w.]+)\b.+(?:mobile safari|safari)/i],[G,[H,`Android ${Z}`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w.]+)/i],[H,G],[/version\/([\w.,]+) .*mobile\/\w+ (safari)/i],[G,[H,`Mobile Safari`]],[/version\/([\w(.|,)]+) .*(mobile ?safari|safari)/i],[G,H],[/webkit.+?(mobile ?safari|safari)(\/[\w.]+)/i],[H,[G,or,sr]],[/(webkit|khtml)\/([\w.]+)/i],[H,G],[/(navigator|netscape\d?)\/([-\w.]+)/i],[[H,`Netscape`],G],[/mobile vr; rv:([\w.]+)\).+firefox/i],[G,[H,`${zn} Reality`]],[/ekiohf.+(flow)\/([\w.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[/ ]?([\w.+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w.]+)$/i,/(firefox)\/([\w.]+)/i,/(mozilla)\/([\w.]+) .+rv:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[. ]?browser)[-/ ]?v?([\w.]+)/i,/(links) \(([\w.]+)/i,/panasonic;(viera)/i],[H,G],[/(cobalt)\/([\w.]+)/i],[H,[G,/master.|lts./,``]]],cpu:[[/(amd|x(?:(?:86|64)[-_])?|wow|win)64[;)]/i],[[K,`amd64`]],[/(ia32(?=;))/i],[[K,tr]],[/((?:i[346]|x)86)[;)]/i],[[K,`ia32`]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[K,`arm64`]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[K,`armhf`]],[/windows (ce|mobile); ppc;/i],[[K,`arm`]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[K,/ower/,B,tr]],[/(sun4\w)[;)]/i],[[K,`sparc`]],[/(avr32|ia64(?=;)|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[K,tr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[V,[W,Gn],[U,J]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?\d+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[V,[W,Gn],[U,q]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[V,[W,Pn],[U,q]],[/\((ipad);[-\w),; ]+apple/i,/applecoremedia\/[\w.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[V,[W,Pn],[U,J]],[/(macintosh);/i],[V,[W,Pn]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[V,[W,Kn],[U,q]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[V,[W,Vn],[U,J]],[/(?:huawei|honor)([-\w ]+)[;)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][0-359c][adn]?)\b(?!.+d\/s)/i],[V,[W,Vn],[U,q]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?[\w ]+)(?: bui|\))/i,/oid[^)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?\d?\w?[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[V,/_/g,` `],[W,Jn],[U,q]],[/oid[^)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?pad[\w ]+)(?: bui|\))/i],[[V,/_/g,` `],[W,Jn],[U,J]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[V,[W,`OPPO`],[U,q]],[/\b(opd2\d{3}a?) bui/i],[V,[W,`OPPO`],[U,J]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[V,[W,`Vivo`],[U,q]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[V,[W,`Realme`],[U,q]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w() ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[V,[W,Wn],[U,q]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[V,[W,Wn],[U,J]],[/((?=lg)?[vl]k-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[V,[W,Hn],[U,J]],[/(lm(?:-?f100[nv]?|-[\w.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?(\w+) bui/i],[V,[W,Hn],[U,q]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab[\w ]+|yt[-\w]{6}|tb[-\w]{6})/i],[V,[W,`Lenovo`],[U,J]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w.]*)/i],[[V,/_/g,` `],[W,`Nokia`],[U,q]],[/(pixel c)\b/i],[V,[W,Bn],[U,J]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[V,[W,Bn],[U,q]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]?\d\.))/i],[V,[W,qn],[U,q]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[V,`Xperia Tablet`],[W,qn],[U,J]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[V,[W,`OnePlus`],[U,q]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[V,[W,Nn],[U,J]],[/((?:sd|kf)[0349hijor-uw]+)( bui|\)).+silk\//i],[[V,/(.+)/g,`Fire Phone $1`],[W,Nn],[U,q]],[/(playbook);[-\w),; ]+(rim)/i],[V,W,[U,J]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[V,[W,In],[U,q]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[V,[W,Fn],[U,J]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[V,[W,Fn],[U,q]],[/(nexus 9)/i],[V,[W,`HTC`],[U,J]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!;|\.)|sony(?!-bra))[-_ ]?([-\w]*)/i],[W,[V,/_/g,` `],[U,q]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[V,[W,`Acer`],[U,J]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[V,[W,`Meizu`],[U,q]],[/; ((?:power )?armor[\w ]{0,8})(?: bui|\))/i],[V,[W,`Ulefone`],[U,q]],[/(blackberry|benq|palm(?=-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[W,V,[U,q]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[W,V,[U,J]],[/(surface duo)/i],[V,[W,Un],[U,J]],[/droid [\d.]+; (fp\du?)(?: b|\))/i],[V,[W,`Fairphone`],[U,q]],[/(u304aa)/i],[V,[W,`AT&T`],[U,q]],[/\bsie-(\w*)/i],[V,[W,`Siemens`],[U,q]],[/\b(rct\w+) b/i],[V,[W,`RCA`],[U,J]],[/\b(venue[\d ]{2,7}) b/i],[V,[W,`Dell`],[U,J]],[/\b(q(?:mv|ta)\w+) b/i],[V,[W,`Verizon`],[U,J]],[/\b(?:barnes[& ]+noble |bn[rt])([\w+ ]*) b/i],[V,[W,`Barnes & Noble`],[U,J]],[/\b(tm\d{3}\w+) b/i],[V,[W,`NuVision`],[U,J]],[/\b(k88) b/i],[V,[W,`ZTE`],[U,J]],[/\b(nx\d{3}j) b/i],[V,[W,`ZTE`],[U,q]],[/\b(gen\d{3}) b.+49h/i],[V,[W,`Swiss`],[U,q]],[/\b(zur\d{3}) b/i],[V,[W,`Swiss`],[U,J]],[/\b((zeki)?tb.*\b) b/i],[V,[W,`Zeki`],[U,J]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[W,`Dragon Touch`],V,[U,J]],[/\b(ns-?\w{0,9}) b/i],[V,[W,`Insignia`],[U,J]],[/\b((nxa|next)-?\w{0,9}) b/i],[V,[W,`NextBook`],[U,J]],[/\b(xtreme_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[W,`Voice`],V,[U,q]],[/\b(lvtel-)?(v1[12]) b/i],[[W,`LvTel`],V,[U,q]],[/\b(ph-1) /i],[V,[W,`Essential`],[U,q]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[V,[W,`Envizen`],[U,J]],[/\b(trio[-\w. ]+) b/i],[V,[W,`MachSpeed`],[U,J]],[/\btu_(1491) b/i],[V,[W,`Rotor`],[U,J]],[/(shield[\w ]+) b/i],[V,[W,`Nvidia`],[U,J]],[/(sprint) (\w+)/i],[W,V,[U,q]],[/(kin\.[onetw]{3})/i],[[V,/\./g,` `],[W,Un],[U,q]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[V,[W,Yn],[U,J]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[V,[W,Yn],[U,q]],[/smart-tv.+(samsung)/i],[W,[U,Y]],[/hbbtv.+maple;(\d+)/i],[[V,/^/,`SmartTV`],[W,Gn],[U,Y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[W,Hn],[U,Y]],[/(apple) ?tv/i],[W,[V,`${Pn} TV`],[U,Y]],[/crkey/i],[[V,`${Ln}cast`],[W,Bn],[U,Y]],[/droid.+aft(\w+)( bui|\))/i],[V,[W,Nn],[U,Y]],[/\(dtv[);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[V,[W,Kn],[U,Y]],[/(bravia[\w ]+)( bui|\))/i],[V,[W,qn],[U,Y]],[/(mitv-\w{5}) bui/i],[V,[W,Jn],[U,Y]],[/Hbbtv.*(technisat) (.*);/i],[W,V,[U,Y]],[/\b(roku)[\dx]*[)/]((?:dvp-)?[\d.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w+ ]*; *(\w[^;]*);([^;]*)/i],[[W,ir],[V,ir],[U,Y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[U,Y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[W,V,[U,An]],[/droid.+; (shield) bui/i],[V,[W,`Nvidia`],[U,An]],[/(playstation [345portablevi]+)/i],[V,[W,qn],[U,An]],[/\b(xbox(?: one)?(?!; xbox))[); ]/i],[V,[W,Un],[U,An]],[/((pebble))app/i],[W,V,[U,X]],[/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i],[V,[W,Pn],[U,X]],[/droid.+; (glass) \d/i],[V,[W,Bn],[U,X]],[/droid.+; (wt63?0{2,3})\)/i],[V,[W,Yn],[U,X]],[/(quest( \d| pro)?)/i],[V,[W,Xn],[U,X]],[/(tesla)(?: qtcarbrowser|\/[-\w.]+)/i],[W,[U,jn]],[/(aeobc)\b/i],[V,[W,Nn],[U,jn]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[V,[U,q]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[V,[U,J]],[/\b((tablet|tab)[;/]|focus\/\d(?!.+mobile))/i],[[U,J]],[/(phone|mobile(?:[;/]| [ \w/.]*safari)|pda(?=.+windows ce))/i],[[U,q]],[/(android[-\w. ]{0,9});.+buil/i],[V,[W,`Generic`]]],engine:[[/windows.+ edge\/([\w.]+)/i],[G,[H,`${Rn}HTML`]],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i],[G,[H,`Blink`]],[/(presto)\/([\w.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w.]+)/i,/ekioh(flow)\/([\w.]+)/i,/(khtml|tasman|links)[/ ]\(?([\w.]+)/i,/(icab)[/ ]([23]\.[\d.]+)/i,/\b(libweb)/i],[H,G],[/rv:([\w.]{1,9})\b.+(gecko)/i],[G,H]],os:[[/microsoft (windows) (vista|xp)/i],[H,G],[/(windows (?:phone(?: os)?|mobile))[/ ]?([.\w ]*)/i],[H,[G,or,cr]],[/windows nt 6\.2; (arm)/i,/windows[/ ]?([ntce\d. ]+\w)(?!.+xbox)/i,/(?:win(?=[39n])|win 9x )([nt\d.]+)/i],[[G,or,cr],[H,`Windows`]],[/ip[honead]{2,4}\b(?:.*os (\w+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[/ ])([\d.]+)/i,/cfnetwork\/.+darwin/i],[[G,/_/g,`.`],[H,`iOS`]],[/(mac os x) ?([\w. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[H,Qn],[G,/_/g,`.`]],[/droid ([\w.]+)\b.+(android[- ]x86|harmonyos)/i],[G,H],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-/ ]?([\w.]*)/i,/(blackberry)\w*\/([\w.]*)/i,/(tizen|kaios)[/ ]([\w.]+)/i,/\((series40);/i],[H,G],[/\(bb(10);/i],[G,[H,In]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-/ ]?([\w.]*)/i],[G,[H,`Symbian`]],[/mozilla\/[\d.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w.]+)/i],[G,[H,`${zn} OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w.]+)/i],[G,[H,`webOS`]],[/watch(?: ?os[,/]|\d,\d\/)([\d.]+)/i],[G,[H,`watchOS`]],[/crkey\/([\d.]+)/i],[G,[H,`${Ln}cast`]],[/(cros) \w+(?:\)| ([\w.]+)\b)/i],[[H,Zn],G],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w.]*)/i,/(mint)[/() ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-/ ]?(?!chrom|package)([-\w.]*)/i,/(hurd|linux) ?([\w.]*)/i,/(gnu) ?([\w.]*)/i,/\b([-e-hrntopcs]{0,5}bsd|dragonfly)[/ ]?(?!amd|[ix346]{1,2}86)([\w.]*)/i,/(haiku) (\w+)/i],[H,G],[/(sunos) ?([\w.]*)/i],[[H,`Solaris`],G],[/((?:open)?solaris)[-/ ]?([\w.]*)/i,/(aix) ((\d)(?=[.) ])[\w.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w.]*)/i],[H,G]]};function ur(e){return typeof e==`object`&&!!e}Object.freeze(er([H,G,kn])),Object.freeze(er([K])),Object.freeze(er([V,W,U,An,q,Y,J,X,jn])),Object.freeze(er([H,G])),Object.freeze(er([H,G]));function dr(){if(!(typeof window>`u`||!window.navigator))return window.navigator}function fr(e){return e.length>Mn?ir(e,Mn):e}function pr(e){if(typeof e==`string`)return{ua:fr(e),isSelfNavigator:!1,navigator:void 0,userAgentData:void 0,regexMap:lr};let t=dr(),n=fr(t&&t.userAgent?t.userAgent:B);return{ua:n,isSelfNavigator:!!(t&&t.userAgent===n),navigator:t,userAgentData:t?.userAgentData,regexMap:lr}}function mr(e,t){if(!t&&!ur(e))return pr(e);let n=dr(),r=ur(e)?void 0:e,i=ur(e)?e:t,a=fr(r||(n&&n.userAgent?n.userAgent:B)),o=n?.userAgentData;return{ua:a,isSelfNavigator:!!(n&&n.userAgent===a),navigator:n,userAgentData:o,regexMap:i?$n(lr,i):lr}}function hr(e){let t={name:void 0,version:void 0,major:void 0};return ar(e.ua,e.regexMap.browser,t),t.major=rr(t.version),e.isSelfNavigator&&e.navigator?.brave&&typeof e.navigator.brave.isBrave==`function`&&(t.name=`Brave`),t}function gr(e){let t={architecture:void 0};return ar(e.ua,e.regexMap.cpu,t),t}function _r(e){let t={vendor:void 0,model:void 0,type:void 0};return ar(e.ua,e.regexMap.device,t),e.isSelfNavigator&&!t.type&&e.userAgentData?.mobile&&(t.type=q),e.isSelfNavigator&&t.model===`Macintosh`&&e.navigator&&e.navigator.standalone!==void 0&&e.navigator.maxTouchPoints&&e.navigator.maxTouchPoints>2&&(t.model=`iPad`,t.type=J),t}function vr(e){let t={name:void 0,version:void 0};return ar(e.ua,e.regexMap.engine,t),t}function yr(e){let t={name:void 0,version:void 0};return ar(e.ua,e.regexMap.os,t),e.isSelfNavigator&&!t.name&&e.userAgentData?.platform&&e.userAgentData.platform!==`Unknown`&&(t.name=e.userAgentData.platform.replace(/chrome os/i,Zn).replace(/macos/i,Qn)),t}function br(e,t){let n,r,i,a,o,s,c=()=>n||=mr(e,t);return{get ua(){return c().ua},get browser(){return r||=hr(c()),r},get engine(){return i||=vr(c()),i},get os(){return a||=yr(c()),a},get device(){return o||=_r(c()),o},get cpu(){return s||=gr(c()),s}}}function xr(e){return e==null?!1:`${+e}`==`${e}`}function Sr(e){let{authToken:t,connectionMeta:n,events:r,clientRpc:i,rpcOptions:a={},wsOptions:o={}}=e,s=!1,c=_n(),l=xr(n.websocket)?`${location.protocol.replace(`http`,`ws`)}//${location.hostname}:${n.websocket}`:n.websocket,u=new Map;for(let e of n.jsonSerializableMethods??[])u.set(e,{jsonSerializable:!0});let d=Ce(i.functions,{channel:Ue({url:l,authToken:t,definitions:u,...o}),rpcOptions:a});i.register({name:`devframe:auth:revoked`,type:`event`,handler:()=>{s=!1,r.emit(`rpc:is-trusted:updated`,!1)}});let f=t;async function p(e){f=e;let t=br(navigator.userAgent),n=[t.browser.name,t.browser.version,`|`,t.os.name,t.os.version,t.device.type].filter(e=>e).join(` `),i=await d.$call(`vite:anonymous:auth`,{authToken:e,ua:n,origin:location.origin});return s=i.isTrusted,c.resolve(s),r.emit(`rpc:is-trusted:updated`,s),i.isTrusted}async function m(){return s?!0:p(f)}async function h(e=6e4){if(s&&c.resolve(!0),e<=0)return c.promise;let t=()=>{};return await Promise.race([c.promise.then(t),new Promise((n,r)=>{let i=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e);t=()=>clearTimeout(i)})]),s}return{get isTrusted(){return s},requestTrust:m,requestTrustWithToken:p,ensureTrusted:h,call:(...e)=>d.$call(...e),callEvent:(...e)=>d.$callEvent(...e),callOptional:(...e)=>d.$callOptional(...e)}}var Cr=`__VITE_DEVTOOLS_CONNECTION_META__`,$=`__VITE_DEVTOOLS_CONNECTION_AUTH_TOKEN__`;function wr(e){let t=[()=>e,()=>localStorage.getItem($),()=>window?.[$],()=>globalThis?.[$],()=>parent.window?.[$]],n;for(let e of t)try{if(n=e(),n)break}catch{}return n||=gn(),localStorage.setItem($,n),globalThis[$]=n,n}function Tr(){let e=[()=>window?.[Cr],()=>globalThis?.[Cr],()=>parent.window?.[Cr]];for(let t of e)try{let e=t();if(e)return e}catch{}}async function Er(t={}){let{baseURL:n=`./`,rpcOptions:r={},cacheOptions:i=!1}=t,a=We(),o=Array.isArray(n)?n:[n],s=t.connectionMeta||Tr(),c=o[0]??`./`;function l(e){return e.endsWith(`/`)?e:`${e}/`}function u(e,t){return/^https?:\/\//.test(t)||t.startsWith(`/`)?t:`${l(e)}${t}`}if(!s){let t=[];for(let n of o)try{s=await fetch(u(n,e)).then(e=>e.json()),c=n,globalThis[Cr]=s;break}catch(e){t.push(e)}if(!s)throw Error(`Failed to get connection meta from ${o.join(`, `)}`,{cause:t})}let d=new ie({functions:[],...typeof t.cacheOptions==`object`?t.cacheOptions:{}}),f={rpc:void 0},p=wr(t.authToken),m=new se(f);async function h(e){let t=[c,...o.filter(e=>e!==c)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(u(r,e)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let g=s.backend===`static`?await wn({fetchJsonFromBases:h}):Sr({authToken:p,connectionMeta:s,events:a,clientRpc:m,rpcOptions:{...r,async onRequest(e,t,n){if(await r.onRequest?.call(this,e,t,n),i&&d?.validate(e.m)){let r=d.cached(e.m,e.a);if(r)return n(r);{let n=await t(e);d?.apply(e,n)}}else await t(e)}},wsOptions:t.wsOptions}),_={events:a,get isTrusted(){return g.isTrusted},connectionMeta:s,ensureTrusted:g.ensureTrusted,requestTrust:g.requestTrust,requestTrustWithToken:async e=>(localStorage.setItem($,e),globalThis[$]=e,g.requestTrustWithToken(e)),call:g.call,callEvent:g.callEvent,callOptional:g.callOptional,client:m,sharedState:void 0,streaming:void 0,cacheManager:d};_.sharedState=vn(_),_.streaming=Dn(_),f.rpc=_,g.requestTrust();try{let e=new BroadcastChannel(`vite-devtools-auth`);e.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&_.requestTrustWithToken(e.data.authToken)}}catch{}return _}export{Er as getDevToolsRpcClient};
|