@oro.ad/nuxt-claude-devtools 1.0.6 → 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.
Files changed (61) hide show
  1. package/README.md +149 -13
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{Dgh4EhoJ.js → BRCY8pHC.js} +1 -1
  5. package/dist/client/_nuxt/BVHVIm9H.js +12 -0
  6. package/dist/client/_nuxt/BZrcCMrf.js +1 -0
  7. package/dist/client/_nuxt/BbEuL4Z6.js +1 -0
  8. package/dist/client/_nuxt/BmjlsnUc.js +1 -0
  9. package/dist/client/_nuxt/D2NL8Xro.js +7 -0
  10. package/dist/client/_nuxt/D9qGFoJm.js +4 -0
  11. package/dist/client/_nuxt/DImlDIT-.js +59 -0
  12. package/dist/client/_nuxt/{B6Pm7LNk.js → DV075BoS.js} +1 -1
  13. package/dist/client/_nuxt/{BngXb2T5.js → DYNukx3V.js} +1 -1
  14. package/dist/client/_nuxt/Dbw96V2H.js +7 -0
  15. package/dist/client/_nuxt/FllXIyfS.js +8 -0
  16. package/dist/client/_nuxt/MarkdownContent.WwTYmYZK.css +1 -0
  17. package/dist/client/_nuxt/TvBJGid1.js +1 -0
  18. package/dist/client/_nuxt/XJ4dJUK2.js +1 -0
  19. package/dist/client/_nuxt/builds/latest.json +1 -1
  20. package/dist/client/_nuxt/builds/meta/e8ae4dbb-462d-47a2-9aa2-50bed9498ab2.json +1 -0
  21. package/dist/client/_nuxt/e7kgpy_n.js +4 -0
  22. package/dist/client/_nuxt/entry.DwDQaFYc.css +1 -0
  23. package/dist/client/_nuxt/error-404.2GhCpCfF.css +1 -0
  24. package/dist/client/_nuxt/error-500.DqdIhFrl.css +1 -0
  25. package/dist/client/_nuxt/index.Bomb3OYy.css +1 -0
  26. package/dist/client/agents/index.html +1 -0
  27. package/dist/client/commands/index.html +1 -0
  28. package/dist/client/docs/index.html +1 -0
  29. package/dist/client/index.html +1 -1
  30. package/dist/client/mcp/index.html +1 -1
  31. package/dist/client/skills/index.html +1 -0
  32. package/dist/module.json +1 -1
  33. package/dist/module.mjs +22 -13
  34. package/dist/runtime/logger.d.ts +5 -0
  35. package/dist/runtime/logger.js +12 -0
  36. package/dist/runtime/server/agents-manager.d.ts +31 -0
  37. package/dist/runtime/server/agents-manager.js +193 -0
  38. package/dist/runtime/server/claude-session.d.ts +21 -4
  39. package/dist/runtime/server/claude-session.js +467 -25
  40. package/dist/runtime/server/commands-manager.d.ts +24 -0
  41. package/dist/runtime/server/commands-manager.js +132 -0
  42. package/dist/runtime/server/docs-manager.d.ts +48 -0
  43. package/dist/runtime/server/docs-manager.js +189 -0
  44. package/dist/runtime/server/history-manager.d.ts +24 -0
  45. package/dist/runtime/server/history-manager.js +184 -0
  46. package/dist/runtime/server/plugins/socket.io.d.ts +2 -0
  47. package/dist/runtime/server/plugins/socket.io.js +48 -0
  48. package/dist/runtime/server/skills-manager.d.ts +36 -0
  49. package/dist/runtime/server/skills-manager.js +210 -0
  50. package/dist/runtime/types.d.ts +156 -0
  51. package/dist/runtime/types.js +0 -0
  52. package/package.json +17 -1
  53. package/dist/client/_nuxt/BWmwj9se.js +0 -1
  54. package/dist/client/_nuxt/CRwOrvc3.js +0 -1
  55. package/dist/client/_nuxt/DMBGVttU.js +0 -1
  56. package/dist/client/_nuxt/DYOOVyPh.js +0 -1
  57. package/dist/client/_nuxt/JxSLzYFz.js +0 -4
  58. package/dist/client/_nuxt/builds/meta/f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59.json +0 -1
  59. package/dist/client/_nuxt/entry.Ci1n7Rlt.css +0 -1
  60. package/dist/client/_nuxt/error-404.BLrjNXsr.css +0 -1
  61. package/dist/client/_nuxt/error-500.DLkAwcfL.css +0 -1
@@ -0,0 +1,210 @@
1
+ import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { createLogger } from "../logger.js";
4
+ const log = createLogger("skills", { timestamp: true });
5
+ export class SkillsManager {
6
+ skillsDir;
7
+ constructor(projectPath) {
8
+ this.skillsDir = join(projectPath, ".claude", "skills");
9
+ if (!existsSync(this.skillsDir)) {
10
+ mkdirSync(this.skillsDir, { recursive: true });
11
+ log("Created skills directory", { path: this.skillsDir });
12
+ }
13
+ }
14
+ // Parse YAML frontmatter from markdown content
15
+ parseFrontmatter(content) {
16
+ const frontmatterRegex = /^---\n([\s\S]*?)\n---\n([\s\S]*)$/;
17
+ const match = content.match(frontmatterRegex);
18
+ if (!match) {
19
+ return { frontmatter: {}, body: content.trim() };
20
+ }
21
+ const [, yaml, body] = match;
22
+ const frontmatter = {};
23
+ for (const line of yaml.split("\n")) {
24
+ const colonIndex = line.indexOf(":");
25
+ if (colonIndex === -1) continue;
26
+ const key = line.slice(0, colonIndex).trim();
27
+ const value = line.slice(colonIndex + 1).trim();
28
+ switch (key) {
29
+ case "name":
30
+ frontmatter.name = value;
31
+ break;
32
+ case "description":
33
+ frontmatter.description = value;
34
+ break;
35
+ case "argument-hint":
36
+ frontmatter["argument-hint"] = value;
37
+ break;
38
+ case "disable-model-invocation":
39
+ frontmatter["disable-model-invocation"] = value === "true";
40
+ break;
41
+ case "user-invocable":
42
+ frontmatter["user-invocable"] = value === "true";
43
+ break;
44
+ case "allowed-tools":
45
+ frontmatter["allowed-tools"] = value;
46
+ break;
47
+ case "model":
48
+ frontmatter.model = value;
49
+ break;
50
+ case "context":
51
+ frontmatter.context = value;
52
+ break;
53
+ case "agent":
54
+ frontmatter.agent = value;
55
+ break;
56
+ }
57
+ }
58
+ return { frontmatter, body: body.trim() };
59
+ }
60
+ // Build frontmatter string
61
+ buildFrontmatter(skill) {
62
+ const lines = ["---"];
63
+ if (skill.name) {
64
+ lines.push(`name: ${skill.name}`);
65
+ }
66
+ if (skill.description) {
67
+ lines.push(`description: ${skill.description}`);
68
+ }
69
+ if (skill.argumentHint) {
70
+ lines.push(`argument-hint: ${skill.argumentHint}`);
71
+ }
72
+ if (skill.disableModelInvocation !== void 0) {
73
+ lines.push(`disable-model-invocation: ${skill.disableModelInvocation}`);
74
+ }
75
+ if (skill.userInvocable !== void 0) {
76
+ lines.push(`user-invocable: ${skill.userInvocable}`);
77
+ }
78
+ if (skill.allowedTools && skill.allowedTools.length > 0) {
79
+ lines.push(`allowed-tools: ${skill.allowedTools.join(", ")}`);
80
+ }
81
+ if (skill.model) {
82
+ lines.push(`model: ${skill.model}`);
83
+ }
84
+ if (skill.context) {
85
+ lines.push(`context: ${skill.context}`);
86
+ }
87
+ if (skill.agent) {
88
+ lines.push(`agent: ${skill.agent}`);
89
+ }
90
+ lines.push("---");
91
+ return lines.join("\n");
92
+ }
93
+ // Get all skills
94
+ getSkills() {
95
+ const skills = [];
96
+ if (!existsSync(this.skillsDir)) return skills;
97
+ const entries = readdirSync(this.skillsDir);
98
+ for (const entry of entries) {
99
+ const skillDir = join(this.skillsDir, entry);
100
+ const stat = statSync(skillDir);
101
+ if (!stat.isDirectory()) continue;
102
+ const skillFile = join(skillDir, "SKILL.md");
103
+ if (!existsSync(skillFile)) continue;
104
+ const fileStat = statSync(skillFile);
105
+ const rawContent = readFileSync(skillFile, "utf-8");
106
+ const { frontmatter, body } = this.parseFrontmatter(rawContent);
107
+ skills.push({
108
+ name: frontmatter.name || entry,
109
+ description: frontmatter.description || "",
110
+ content: body,
111
+ rawContent,
112
+ argumentHint: frontmatter["argument-hint"],
113
+ disableModelInvocation: frontmatter["disable-model-invocation"],
114
+ userInvocable: frontmatter["user-invocable"],
115
+ allowedTools: frontmatter["allowed-tools"] ? frontmatter["allowed-tools"].split(",").map((s) => s.trim()) : void 0,
116
+ model: frontmatter.model,
117
+ context: frontmatter.context === "fork" ? "fork" : void 0,
118
+ agent: frontmatter.agent,
119
+ updatedAt: fileStat.mtime.toISOString()
120
+ });
121
+ }
122
+ return skills.sort((a, b) => a.name.localeCompare(b.name));
123
+ }
124
+ // Get single skill
125
+ getSkill(name) {
126
+ const skillDir = join(this.skillsDir, name);
127
+ const skillFile = join(skillDir, "SKILL.md");
128
+ if (!existsSync(skillFile)) return null;
129
+ const stat = statSync(skillFile);
130
+ const rawContent = readFileSync(skillFile, "utf-8");
131
+ const { frontmatter, body } = this.parseFrontmatter(rawContent);
132
+ return {
133
+ name: frontmatter.name || name,
134
+ description: frontmatter.description || "",
135
+ content: body,
136
+ rawContent,
137
+ argumentHint: frontmatter["argument-hint"],
138
+ disableModelInvocation: frontmatter["disable-model-invocation"],
139
+ userInvocable: frontmatter["user-invocable"],
140
+ allowedTools: frontmatter["allowed-tools"] ? frontmatter["allowed-tools"].split(",").map((s) => s.trim()) : void 0,
141
+ model: frontmatter.model,
142
+ context: frontmatter.context === "fork" ? "fork" : void 0,
143
+ agent: frontmatter.agent,
144
+ updatedAt: stat.mtime.toISOString()
145
+ };
146
+ }
147
+ // Get skill names only (for agent skills selector)
148
+ getSkillNames() {
149
+ if (!existsSync(this.skillsDir)) return [];
150
+ const names = [];
151
+ const entries = readdirSync(this.skillsDir);
152
+ for (const entry of entries) {
153
+ const skillDir = join(this.skillsDir, entry);
154
+ const stat = statSync(skillDir);
155
+ if (!stat.isDirectory()) continue;
156
+ const skillFile = join(skillDir, "SKILL.md");
157
+ if (existsSync(skillFile)) {
158
+ names.push(entry);
159
+ }
160
+ }
161
+ return names.sort();
162
+ }
163
+ // Create or update skill
164
+ saveSkill(skill) {
165
+ const safeName = skill.name.replace(/[^\w-]/g, "-").toLowerCase();
166
+ const skillDir = join(this.skillsDir, safeName);
167
+ const skillFile = join(skillDir, "SKILL.md");
168
+ if (!existsSync(skillDir)) {
169
+ mkdirSync(skillDir, { recursive: true });
170
+ }
171
+ const frontmatter = this.buildFrontmatter({
172
+ name: safeName,
173
+ description: skill.description,
174
+ argumentHint: skill.argumentHint,
175
+ disableModelInvocation: skill.disableModelInvocation,
176
+ userInvocable: skill.userInvocable,
177
+ allowedTools: skill.allowedTools,
178
+ model: skill.model,
179
+ context: skill.context,
180
+ agent: skill.agent
181
+ });
182
+ const rawContent = `${frontmatter}
183
+
184
+ ${skill.content}`;
185
+ writeFileSync(skillFile, rawContent, "utf-8");
186
+ log("Saved skill", { name: safeName, path: skillFile });
187
+ return {
188
+ name: safeName,
189
+ description: skill.description,
190
+ content: skill.content,
191
+ rawContent,
192
+ argumentHint: skill.argumentHint,
193
+ disableModelInvocation: skill.disableModelInvocation,
194
+ userInvocable: skill.userInvocable,
195
+ allowedTools: skill.allowedTools,
196
+ model: skill.model,
197
+ context: skill.context,
198
+ agent: skill.agent,
199
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
200
+ };
201
+ }
202
+ // Delete skill
203
+ deleteSkill(name) {
204
+ const skillDir = join(this.skillsDir, name);
205
+ if (!existsSync(skillDir)) return false;
206
+ rmSync(skillDir, { recursive: true });
207
+ log("Deleted skill", { name });
208
+ return true;
209
+ }
210
+ }
@@ -0,0 +1,156 @@
1
+ export interface TextBlock {
2
+ type: 'text';
3
+ text: string;
4
+ }
5
+ export interface ToolUseBlock {
6
+ type: 'tool_use';
7
+ id: string;
8
+ name: string;
9
+ input: Record<string, unknown>;
10
+ }
11
+ export interface ToolResultBlock {
12
+ type: 'tool_result';
13
+ tool_use_id: string;
14
+ content: string | unknown[];
15
+ is_error?: boolean;
16
+ }
17
+ export interface ThinkingBlock {
18
+ type: 'thinking';
19
+ thinking: string;
20
+ }
21
+ export type ContentBlock = TextBlock | ToolUseBlock | ToolResultBlock | ThinkingBlock;
22
+ export interface Message {
23
+ id: string;
24
+ role: 'user' | 'assistant' | 'system';
25
+ content: string;
26
+ contentBlocks?: ContentBlock[];
27
+ timestamp: Date | string;
28
+ streaming?: boolean;
29
+ model?: string;
30
+ }
31
+ export interface Conversation {
32
+ id: string;
33
+ title?: string;
34
+ messages: Message[];
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ projectPath: string;
38
+ claudeSessionId?: string;
39
+ }
40
+ export interface HistoryStore {
41
+ version: 1;
42
+ conversations: Conversation[];
43
+ activeConversationId: string | null;
44
+ }
45
+ export interface StreamEventBase {
46
+ type: string;
47
+ }
48
+ export interface MessageStartEvent extends StreamEventBase {
49
+ type: 'message_start';
50
+ message: {
51
+ id: string;
52
+ type: 'message';
53
+ role: 'assistant';
54
+ model: string;
55
+ content: unknown[];
56
+ };
57
+ }
58
+ export interface ContentBlockStartEvent extends StreamEventBase {
59
+ type: 'content_block_start';
60
+ index: number;
61
+ content_block: {
62
+ type: 'text' | 'tool_use' | 'thinking';
63
+ id?: string;
64
+ name?: string;
65
+ input?: Record<string, unknown>;
66
+ text?: string;
67
+ thinking?: string;
68
+ };
69
+ }
70
+ export interface ContentBlockDeltaEvent extends StreamEventBase {
71
+ type: 'content_block_delta';
72
+ index: number;
73
+ delta: {
74
+ type: 'text_delta' | 'input_json_delta' | 'thinking_delta';
75
+ text?: string;
76
+ partial_json?: string;
77
+ thinking?: string;
78
+ };
79
+ }
80
+ export interface ContentBlockStopEvent extends StreamEventBase {
81
+ type: 'content_block_stop';
82
+ index: number;
83
+ }
84
+ export interface MessageDeltaEvent extends StreamEventBase {
85
+ type: 'message_delta';
86
+ delta: {
87
+ stop_reason: 'end_turn' | 'tool_use' | 'max_tokens';
88
+ };
89
+ usage?: {
90
+ output_tokens: number;
91
+ };
92
+ }
93
+ export interface MessageStopEvent extends StreamEventBase {
94
+ type: 'message_stop';
95
+ }
96
+ export interface PingEvent extends StreamEventBase {
97
+ type: 'ping';
98
+ }
99
+ export interface ErrorEvent extends StreamEventBase {
100
+ type: 'error';
101
+ error: {
102
+ type: string;
103
+ message: string;
104
+ };
105
+ }
106
+ export interface ResultEvent extends StreamEventBase {
107
+ type: 'result';
108
+ subtype: 'success' | 'error';
109
+ result?: string;
110
+ error?: string;
111
+ session_id?: string;
112
+ cost_usd?: number;
113
+ duration_ms?: number;
114
+ duration_api_ms?: number;
115
+ is_error?: boolean;
116
+ num_turns?: number;
117
+ total_cost_usd?: number;
118
+ }
119
+ export interface SystemEvent extends StreamEventBase {
120
+ type: 'system';
121
+ subtype: string;
122
+ message?: string;
123
+ }
124
+ export interface AssistantEvent extends StreamEventBase {
125
+ type: 'assistant';
126
+ message: {
127
+ id: string;
128
+ type: 'message';
129
+ role: 'assistant';
130
+ content: Array<{
131
+ type: 'text' | 'tool_use';
132
+ text?: string;
133
+ id?: string;
134
+ name?: string;
135
+ input?: Record<string, unknown>;
136
+ }>;
137
+ model: string;
138
+ stop_reason: string;
139
+ stop_sequence: null | string;
140
+ };
141
+ session_id: string;
142
+ }
143
+ export interface ToolUseEvent extends StreamEventBase {
144
+ type: 'tool_use';
145
+ tool_use_id: string;
146
+ name: string;
147
+ input: Record<string, unknown>;
148
+ }
149
+ export interface ToolResultEvent extends StreamEventBase {
150
+ type: 'tool_result';
151
+ tool_use_id: string;
152
+ name?: string;
153
+ content: string | unknown[];
154
+ is_error?: boolean;
155
+ }
156
+ export type StreamEvent = MessageStartEvent | ContentBlockStartEvent | ContentBlockDeltaEvent | ContentBlockStopEvent | MessageDeltaEvent | MessageStopEvent | PingEvent | ErrorEvent | ResultEvent | SystemEvent | AssistantEvent | ToolUseEvent | ToolResultEvent;
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oro.ad/nuxt-claude-devtools",
3
- "version": "1.0.6",
3
+ "version": "1.1.0",
4
4
  "description": "Nuxt DevTools integration for Claude Code AI assistant",
5
5
  "license": "GPL-3.0-only",
6
6
  "type": "module",
@@ -10,6 +10,20 @@
10
10
  "import": "./dist/module.mjs"
11
11
  }
12
12
  },
13
+ "keywords": [
14
+ "vue",
15
+ "nuxt",
16
+ "claude",
17
+ "ai",
18
+ "agent",
19
+ "typescript",
20
+ "guides",
21
+ "vibecoding",
22
+ "hmr",
23
+ "dev-server",
24
+ "devtools",
25
+ "business-console"
26
+ ],
13
27
  "repository": {
14
28
  "url": "https://github.com/oro-ad/nuxt-claude-devtools"
15
29
  },
@@ -39,6 +53,8 @@
39
53
  "dependencies": {
40
54
  "@nuxt/devtools-kit": "^3.1.1",
41
55
  "@nuxt/kit": "^4.2.2",
56
+ "@oro.ad/nuxt-claude-devtools-bc": "^1.0.5",
57
+ "marked": "^17.0.1",
42
58
  "sirv": "^3.0.2",
43
59
  "socket.io": "^4.8.1"
44
60
  },
@@ -1 +0,0 @@
1
- import{g as O,K as q,s as T,r as j,e as k,j as B,L as N,M as U,N as E,O as I,C as L,P as A,Q as V,R as w,S as D,x as b,T as P,U as F,V as H,W as M,X as W,Y as z,Z as Q}from"./JxSLzYFz.js";const $=(...t)=>t.find(o=>o!==void 0);function G(t){const o=t.componentName||"NuxtLink";function v(e){return typeof e=="string"&&e.startsWith("#")}function S(e,u,f){const r=f??t.trailingSlash;if(!e||r!=="append"&&r!=="remove")return e;if(typeof e=="string")return C(e,r);const l="path"in e&&e.path!==void 0?e.path:u(e).path;return{...e,name:void 0,path:C(l,r)}}function R(e){const u=q(),f=H(),r=b(()=>!!e.target&&e.target!=="_self"),l=b(()=>{const i=e.to||e.href||"";return typeof i=="string"&&P(i,{acceptRelative:!0})}),y=A("RouterLink"),h=y&&typeof y!="string"?y.useLink:void 0,c=b(()=>{if(e.external)return!0;const i=e.to||e.href||"";return typeof i=="object"?!1:i===""||l.value}),n=b(()=>{const i=e.to||e.href||"";return c.value?i:S(i,u.resolve,e.trailingSlash)}),g=c.value?void 0:h?.({...e,to:n}),m=b(()=>{const i=e.trailingSlash??t.trailingSlash;if(!n.value||l.value||v(n.value))return n.value;if(c.value){const p=typeof n.value=="object"&&"path"in n.value?w(n.value):n.value,x=typeof p=="object"?u.resolve(p).href:p;return C(x,i)}return typeof n.value=="object"?u.resolve(n.value)?.href??null:C(F(f.app.baseURL,n.value),i)});return{to:n,hasTarget:r,isAbsoluteUrl:l,isExternal:c,href:m,isActive:g?.isActive??b(()=>n.value===u.currentRoute.value.path),isExactActive:g?.isExactActive??b(()=>n.value===u.currentRoute.value.path),route:g?.route??b(()=>u.resolve(n.value)),async navigate(i){await M(m.value,{replace:e.replace,external:c.value||r.value})}}}return O({name:o,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:R,setup(e,{slots:u}){const f=q(),{to:r,href:l,navigate:y,isExternal:h,hasTarget:c,isAbsoluteUrl:n}=R(e),g=T(!1),m=j(null),i=s=>{m.value=e.custom?s?.$el?.nextElementSibling:s?.$el};function p(s){return!g.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===s:e.prefetchOn?.[s]??t.prefetchOn?.[s])&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!Y()}async function x(s=k()){if(g.value)return;g.value=!0;const d=typeof r.value=="string"?r.value:h.value?w(r.value):f.resolve(r.value).fullPath,a=h.value?new URL(d,window.location.href).href:d;await Promise.all([s.hooks.callHook("link:prefetch",a).catch(()=>{}),!h.value&&!c.value&&D(r.value,f).catch(()=>{})])}if(p("visibility")){const s=k();let d,a=null;B(()=>{const _=K();N(()=>{d=U(()=>{m?.value?.tagName&&(a=_.observe(m.value,async()=>{a?.(),a=null,await x(s)}))})})}),E(()=>{d&&I(d),a?.(),a=null})}return()=>{if(!h.value&&!c.value&&!v(r.value)){const a={ref:i,to:r.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(p("interaction")&&(a.onPointerenter=x.bind(null,void 0),a.onFocus=x.bind(null,void 0)),g.value&&(a.class=e.prefetchedClass||t.prefetchedClass),a.rel=e.rel||void 0),L(A("RouterLink"),a,u.default)}const s=e.target||null,d=$(e.noRel?"":e.rel,t.externalRelAttribute,n.value||c.value?"noopener noreferrer":"")||null;return e.custom?u.default?u.default({href:l.value,navigate:y,prefetch:x,get route(){if(!l.value)return;const a=new URL(l.value,window.location.href);return{path:a.pathname,fullPath:a.pathname,get query(){return V(a.search)},hash:a.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:l.value}},rel:d,target:s,isExternal:h.value||c.value,isActive:!1,isExactActive:!1}):null:L("a",{ref:m,href:l.value||null,rel:d,target:s,onClick:a=>{if(!(h.value||c.value))return a.preventDefault(),e.replace?f.replace(l.value):f.push(l.value)}},u.default?.())}}})}const J=G(Q);function C(t,o){const v=o==="append"?W:z;return P(t)&&!t.startsWith("http")?t:v(t,!0)}function K(){const t=k();if(t._observer)return t._observer;let o=null;const v=new Map,S=(e,u)=>(o||=new IntersectionObserver(f=>{for(const r of f){const l=v.get(r.target);(r.isIntersecting||r.intersectionRatio>0)&&l&&l()}}),v.set(e,u),o.observe(e),()=>{v.delete(e),o?.unobserve(e),v.size===0&&(o?.disconnect(),o=null)});return t._observer={observe:S}}const X=/2g/;function Y(){const t=navigator.connection;return!!(t&&(t.saveData||X.test(t.effectiveType)))}export{J as _};
@@ -1 +0,0 @@
1
- import{l as A,d as X,a as z,b as F,c as q,_ as H}from"./DYOOVyPh.js";import{_ as G}from"./BWmwj9se.js";import{s as J,q as Q,g as W,r as m,x as O,j as Y,k as Z,c as p,a as o,l as C,b as n,d as v,w as _,y as ee,F as te,p as se,z as ne,A as oe,o as u,t as T,n as V,B as E}from"./JxSLzYFz.js";let g;const w=[];function le(b){if(w.push(b),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&w.forEach(d=>d(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(d){d&&w.forEach(t=>t(d))},get(){return g.value},configurable:!0}),()=>{w.splice(w.indexOf(b),1)}}function ae(){g||(g=J(),le(d));function b(){g&&Q(g)}function d(t){g.value=t,t.host&&t.host.hooks.hook("host:update:reactivity",b)}return g}const ie={class:"relative flex flex-col h-screen n-bg-base"},ce={class:"flex items-center justify-between p-4"},re={class:"flex items-center gap-3"},ue={class:"text-xl font-bold flex items-center gap-2"},de={class:"flex items-center gap-2"},fe={key:0,class:"px-4 pt-4"},me={key:0,class:"text-xs opacity-50 mb-1"},pe={key:0,class:"ml-2"},ve={class:"whitespace-pre-wrap font-mono text-sm"},_e={class:"text-xs opacity-30 mt-1"},ge={key:0,class:"flex items-center justify-center h-full opacity-50"},xe={class:"text-center"},ye={class:"p-4"},ke=W({__name:"index",setup(b){const d=ae(),t=m(null),f=m([]),x=m(""),i=m(!1),N=m(!1),c=m(!1),h=m(null),B=O(()=>i.value?c.value?"Processing...":"Ready":"Disconnected"),L=O(()=>i.value?c.value?"blue":"green":"red");function S(){oe(()=>{h.value&&(h.value.scrollTop=h.value.scrollHeight)})}function M(){return Math.random().toString(36).substring(2,9)}function r(l,e,s=!1){const y={id:M(),role:l,content:e,timestamp:new Date,streaming:s};return f.value.push(y),S(),y}function $(){const l=window.location.origin.replace(/:3300$/,":3355").replace(/:3000$/,":3355");t.value=A(l,{transports:["websocket","polling"]}),t.value.on("connect",()=>{console.log("[claude-client] Connected to socket"),i.value=!0,r("system","Connected to Claude DevTools")}),t.value.on("disconnect",()=>{console.log("[claude-client] Disconnected from socket"),i.value=!1,N.value=!1,c.value=!1,r("system","Disconnected from server")}),t.value.on("session:status",e=>{console.log("[claude-client] Session status:",e),N.value=e.active,c.value=e.processing}),t.value.on("output:chunk",e=>{console.log("[claude-client] Output chunk:",e.length);const s=f.value.findLast(y=>y.role==="assistant");s&&s.streaming?(s.content+=e,S()):r("assistant",e,!0)}),t.value.on("output:complete",()=>{console.log("[claude-client] Output complete");const e=f.value.findLast(s=>s.role==="assistant");e&&(e.streaming=!1)}),t.value.on("output:error",e=>{console.log("[claude-client] Output error:",e),r("system",`Error: ${e}`)}),t.value.on("session:error",e=>{console.log("[claude-client] Session error:",e),r("system",`Session error: ${e}`)}),t.value.on("session:closed",e=>{console.log("[claude-client] Session closed:",e),r("system",`Session ended (exit code: ${e.exitCode})`)})}function j(){t.value&&(t.value.emit("session:reset"),f.value=[],r("system","New conversation started"))}function D(){if(!x.value.trim()||c.value||!i.value)return;const l=x.value.trim();x.value="",r("user",l),t.value&&t.value.emit("message:send",l)}function U(){f.value=[],i.value&&r("system","Chat cleared")}function P(l){console.log(l),l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),D())}return Y(()=>{$()}),Z(()=>{t.value&&t.value.disconnect()}),(l,e)=>{const s=H,y=X,k=z,R=G,I=F,K=q;return u(),p("div",ie,[o("div",ce,[o("div",re,[o("h1",ue,[n(s,{class:"text-green",icon:"carbon:machine-learning-model"}),e[1]||(e[1]=v(" Claude AI ",-1))]),n(y,{n:L.value},{default:_(()=>[v(T(B.value),1)]),_:1},8,["n"])]),o("div",de,[n(k,{disabled:!i.value||c.value,n:"blue",onClick:j},{default:_(()=>[n(s,{class:"mr-1",icon:"carbon:add"}),e[2]||(e[2]=v(" New Chat ",-1))]),_:1},8,["disabled"]),n(k,{n:"gray",onClick:U},{default:_(()=>[n(s,{class:"mr-1",icon:"carbon:trash-can"}),e[3]||(e[3]=v(" Clear ",-1))]),_:1}),n(R,{to:"/mcp"},{default:_(()=>[n(k,{n:"gray"},{default:_(()=>[n(s,{class:"mr-1",icon:"carbon:plug"}),e[4]||(e[4]=v(" MCP ",-1))]),_:1})]),_:1})])]),ee(d)?C("",!0):(u(),p("div",fe,[n(I,{n:"yellow"},{default:_(()=>[...e[5]||(e[5]=[v(" Open this page inside Nuxt DevTools for best experience. ",-1)])]),_:1})])),o("div",{ref_key:"messagesContainer",ref:h,class:"flex-1 overflow-auto p-4 space-y-4"},[(u(!0),p(te,null,se(f.value,a=>(u(),p("div",{key:a.id,class:V([a.role==="user"?"justify-end":"justify-start","flex"])},[o("div",{class:V([{"bg-green-500/20 text-green-800 dark:text-green-100":a.role==="user","n-bg-active":a.role==="assistant","bg-yellow-500/20 text-yellow-800 dark:text-yellow-200 text-sm":a.role==="system"},"max-w-[80%] rounded-lg px-4 py-2"])},[a.role==="assistant"?(u(),p("div",me,[e[6]||(e[6]=v(" Claude ",-1)),a.streaming?(u(),p("span",pe,[n(s,{class:"animate-pulse",icon:"carbon:circle-filled"})])):C("",!0)])):C("",!0),o("div",ve,T(a.content),1),o("div",_e,T(a.timestamp.toLocaleTimeString()),1)],2)],2))),128)),f.value.length===0?(u(),p("div",ge,[o("div",xe,[n(s,{class:"text-4xl mb-2",icon:"carbon:chat"}),e[7]||(e[7]=o("p",null,"Send a message to start chatting with Claude",-1))])])):C("",!0)],512),o("div",ye,[o("div",{class:"flex gap-2",onKeydown:ne(P,["enter"])},[n(K,{modelValue:x.value,"onUpdate:modelValue":e[0]||(e[0]=a=>x.value=a),disabled:!i.value||c.value,class:"flex-1 font-mono",placeholder:"Type your message..."},null,8,["modelValue","disabled"]),n(k,{disabled:!x.value.trim()||!i.value||c.value,n:"green",onClick:D},{default:_(()=>[c.value?(u(),E(s,{key:0,class:"animate-spin",icon:"carbon:loading"})):(u(),E(s,{key:1,icon:"carbon:send"}))]),_:1},8,["disabled"])],32),e[8]||(e[8]=o("div",{class:"text-xs opacity-50 mt-2"}," Press Enter to send | --continue will be used for follow-up messages ",-1))])])}}});export{ke as default};
@@ -1 +0,0 @@
1
- import{_ as A}from"./BWmwj9se.js";import{_ as F,a as L,b as B,c as R,d as E,l as q}from"./DYOOVyPh.js";import{g as D,r as p,j as H,k as I,c as r,o as u,a as l,b as s,w as i,d as a,n as z,l as C,t as c,m as g,v as b,F as V,p as G}from"./JxSLzYFz.js";const J={class:"relative flex flex-col h-screen n-bg-base"},K={class:"flex items-center justify-between p-4"},O={class:"flex items-center gap-3"},Q={class:"text-xl font-bold flex items-center gap-2"},W={class:"flex items-center gap-2"},X={class:"flex-1 overflow-auto p-4 space-y-6"},Y={key:0,class:"n-bg-active rounded-lg p-4 mb-4"},Z={key:0,class:"mb-4"},h={class:"space-y-4"},ee={class:"flex gap-4"},le={class:"flex items-center gap-2"},te={class:"flex items-center gap-2"},oe={class:"flex items-center gap-2"},se={key:1},ne={class:"flex gap-4"},ae={class:"flex items-center gap-2"},re={class:"flex items-center gap-2"},ue={class:"flex gap-2 pt-2"},ie={class:"text-lg font-semibold mb-3 flex items-center gap-2"},de={key:0,class:"n-bg-active rounded-lg p-4 opacity-50"},me={key:1,class:"space-y-2"},pe={class:"font-bold flex items-center gap-2"},ce={class:"text-sm opacity-70 font-mono"},_e=D({__name:"mcp",setup(ve){const n=p(null),x=p(!1),w=p([]),_=p(!1),k=p(!1),t=p({name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"}),d=p("");function U(){const m=window.location.origin.replace(/:3300$/,":3355").replace(/:3000$/,":3355");n.value=q(m,{transports:["websocket","polling"]}),n.value.on("connect",()=>{console.log("[mcp-client] Connected to socket"),x.value=!0,S()}),n.value.on("disconnect",()=>{console.log("[mcp-client] Disconnected from socket"),x.value=!1}),n.value.on("mcp:list",e=>{console.log("[mcp-client] MCP list received",e),w.value=e,_.value=!1}),n.value.on("mcp:added",e=>{console.log("[mcp-client] MCP added result",e),e.success?(k.value=!1,N()):d.value=e.error||"Failed to add MCP server"}),n.value.on("mcp:removed",e=>{console.log("[mcp-client] MCP removed result",e),e.success||alert(`Failed to remove: ${e.error}`)})}function S(){n.value&&(_.value=!0,n.value.emit("mcp:list"))}function N(){t.value={name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"},d.value=""}function M(){if(!t.value.name){d.value="Name is required";return}if(t.value.transport==="stdio"&&!t.value.command){d.value="Command is required for stdio transport";return}if((t.value.transport==="http"||t.value.transport==="sse")&&!t.value.url){d.value="URL is required for HTTP/SSE transport";return}if(n.value){const m=t.value.args.split(" ").map(e=>e.trim()).filter(e=>e.length>0);n.value.emit("mcp:add",{name:t.value.name,transport:t.value.transport,command:t.value.command,args:m,url:t.value.url,scope:t.value.scope})}}function P(m){confirm(`Remove MCP server "${m.name}"?`)&&n.value&&n.value.emit("mcp:remove",{name:m.name})}return H(()=>{U()}),I(()=>{n.value&&n.value.disconnect()}),(m,e)=>{const $=A,v=F,f=L,T=B,y=R,j=E;return u(),r("div",J,[l("div",K,[l("div",O,[s($,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:i(()=>[...e[11]||(e[11]=[a(" ← Chat ",-1)])]),_:1}),l("h1",Q,[s(v,{class:"text-blue",icon:"carbon:plug"}),e[12]||(e[12]=a(" MCP Servers ",-1))])]),l("div",W,[s(f,{disabled:!x.value,n:"blue",onClick:e[0]||(e[0]=o=>k.value=!0)},{default:i(()=>[s(v,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=a(" Add Server ",-1))]),_:1},8,["disabled"]),s(f,{disabled:!x.value||_.value,n:"gray",onClick:S},{default:i(()=>[s(v,{class:z([{"animate-spin":_.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=a(" Refresh ",-1))]),_:1},8,["disabled"])])]),l("div",X,[k.value?(u(),r("div",Y,[e[28]||(e[28]=l("h3",{class:"font-bold mb-4"}," Add MCP Server ",-1)),d.value?(u(),r("div",Z,[s(T,{icon:"carbon:warning",n:"red"},{default:i(()=>[a(c(d.value),1)]),_:1})])):C("",!0),l("div",h,[l("div",null,[e[15]||(e[15]=l("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),s(y,{modelValue:t.value.name,"onUpdate:modelValue":e[1]||(e[1]=o=>t.value.name=o),class:"w-full",placeholder:"e.g. github, nuxt-ui-remote"},null,8,["modelValue"])]),l("div",null,[e[19]||(e[19]=l("label",{class:"block text-sm font-medium mb-1"},"Transport",-1)),l("div",ee,[l("label",le,[g(l("input",{"onUpdate:modelValue":e[2]||(e[2]=o=>t.value.transport=o),name:"transport",type:"radio",value:"stdio"},null,512),[[b,t.value.transport]]),e[16]||(e[16]=l("span",null,"stdio (local command)",-1))]),l("label",te,[g(l("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>t.value.transport=o),name:"transport",type:"radio",value:"http"},null,512),[[b,t.value.transport]]),e[17]||(e[17]=l("span",null,"HTTP (remote)",-1))]),l("label",oe,[g(l("input",{"onUpdate:modelValue":e[4]||(e[4]=o=>t.value.transport=o),name:"transport",type:"radio",value:"sse"},null,512),[[b,t.value.transport]]),e[18]||(e[18]=l("span",null,"SSE (remote)",-1))])])]),t.value.transport==="stdio"?(u(),r(V,{key:0},[l("div",null,[e[20]||(e[20]=l("label",{class:"block text-sm font-medium mb-1"},"Command",-1)),s(y,{modelValue:t.value.command,"onUpdate:modelValue":e[5]||(e[5]=o=>t.value.command=o),class:"w-full font-mono",placeholder:"e.g. npx"},null,8,["modelValue"])]),l("div",null,[e[21]||(e[21]=l("label",{class:"block text-sm font-medium mb-1"},"Arguments (space separated)",-1)),s(y,{modelValue:t.value.args,"onUpdate:modelValue":e[6]||(e[6]=o=>t.value.args=o),class:"w-full font-mono",placeholder:"e.g. -y @modelcontextprotocol/server-github"},null,8,["modelValue"])])],64)):C("",!0),t.value.transport==="http"||t.value.transport==="sse"?(u(),r("div",se,[e[22]||(e[22]=l("label",{class:"block text-sm font-medium mb-1"},"URL",-1)),s(y,{modelValue:t.value.url,"onUpdate:modelValue":e[7]||(e[7]=o=>t.value.url=o),class:"w-full font-mono",placeholder:"e.g. https://ui.nuxt.com/mcp"},null,8,["modelValue"])])):C("",!0),l("div",null,[e[25]||(e[25]=l("label",{class:"block text-sm font-medium mb-1"},"Scope",-1)),l("div",ne,[l("label",ae,[g(l("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>t.value.scope=o),name:"scope",type:"radio",value:"local"},null,512),[[b,t.value.scope]]),e[23]||(e[23]=l("span",null,"Local (this project, private)",-1))]),l("label",re,[g(l("input",{"onUpdate:modelValue":e[9]||(e[9]=o=>t.value.scope=o),name:"scope",type:"radio",value:"global"},null,512),[[b,t.value.scope]]),e[24]||(e[24]=l("span",null,"User (all projects)",-1))])])]),l("div",ue,[s(f,{n:"green",onClick:M},{default:i(()=>[...e[26]||(e[26]=[a(" Add Server ",-1)])]),_:1}),s(f,{n:"gray",onClick:e[10]||(e[10]=o=>{k.value=!1,N()})},{default:i(()=>[...e[27]||(e[27]=[a(" Cancel ",-1)])]),_:1})])])])):C("",!0),l("div",null,[l("h2",ie,[s(v,{icon:"carbon:plug"}),e[29]||(e[29]=a(" Configured Servers ",-1))]),w.value.length===0?(u(),r("div",de," No MCP servers configured ")):(u(),r("div",me,[(u(!0),r(V,null,G(w.value,o=>(u(),r("div",{key:o.name,class:"n-bg-active rounded-lg p-4 flex items-center justify-between"},[l("div",null,[l("div",pe,[a(c(o.name)+" ",1),s(j,{n:o.transport==="stdio"?"gray":"blue",class:"text-xs"},{default:i(()=>[a(c(o.transport),1)]),_:2},1032,["n"])]),l("div",ce,[o.transport==="stdio"?(u(),r(V,{key:0},[a(c(o.command)+" "+c(o.args?.join(" ")),1)],64)):(u(),r(V,{key:1},[a(c(o.url),1)],64))])]),s(f,{n:"red",onClick:fe=>P(o)},{default:i(()=>[s(v,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]))),128))]))])])])}}});export{_e as default};
@@ -1 +0,0 @@
1
- import{_ as Re}from"./BWmwj9se.js";import{c as P,o as v,n as Se,g as Ce,C as ie,D as E,a as ue,B as fe,l as le,E as Be,r as Ne,G as re,A as xe,x as Le,m as qe,H as Pe,y as De,I as Ie,J as Ve,_ as Ue}from"./JxSLzYFz.js";const J={__name:"NIcon",props:{icon:{type:String,required:!1}},setup(s){return(e,t)=>(v(),P("div",{class:Se(["n-icon",s.icon])},null,2))}},zt=Ce({name:"NButton",props:{to:String,icon:String,border:{type:Boolean,default:!0},disabled:Boolean,type:{type:String,default:"button"}},setup(s,{attrs:e,slots:t}){return()=>ie(s.to?Re:"button",{to:s.to,...e,...!s.to&&{type:s.type},...s.disabled?{disabled:!0}:{tabindex:0},class:[s.border?"n-button-base active:n-button-active focus-visible:n-focus-base hover:n-button-hover":"",t.default?"":"n-icon-button","n-button n-transition n-disabled:n-disabled"].join(" ")},{default:()=>[E(t,"icon",{},()=>s.icon?[ie(J,{icon:s.icon,class:t.default?"n-button-icon":""})]:[]),E(t,"default")]})}}),Fe={class:"n-tip n-tip-base"},Jt={__name:"NTip",props:{icon:{type:String,required:!1}},setup(s){return(e,t)=>{const n=J;return v(),P("div",Fe,[E(e.$slots,"icon",{},()=>[s.icon?(v(),fe(n,{key:0,icon:s.icon,class:"n-tip-icon"},null,8,["icon"])):le("",!0)]),ue("div",null,[E(e.$slots,"default")])])}}};typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $e=s=>typeof s<"u";function Me(s){return JSON.parse(JSON.stringify(s))}function He(s,e,t,n={}){var i,r;const{clone:o=!1,passive:c=!1,eventName:h,deep:p=!1,defaultValue:l,shouldEmit:m}=n,f=Be(),ee=t||f?.emit||(f==null||(i=f.$emit)===null||i===void 0?void 0:i.bind(f))||(f==null||(r=f.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(f?.proxy));let O=h;O=O||`update:${e.toString()}`;const te=d=>o?typeof o=="function"?o(d):Me(d):d,se=()=>$e(s[e])?te(s[e]):l,ne=d=>{m?m(d)&&ee(O,d):ee(O,d)};if(c){const d=Ne(se());let R=!1;return re(()=>s[e],S=>{R||(R=!0,d.value=te(S),xe(()=>R=!1))}),re(d,S=>{!R&&(S!==s[e]||p)&&ne(S)},{deep:p}),d}else return Le({get(){return se()},set(d){ne(d)}})}const Ke={class:"n-text-input flex flex items-center border n-border-base rounded n-bg-base py-1 pl-1 pr-2 focus-within:border-context focus-within:n-focus-base"},Xt={__name:"NTextInput",props:{modelValue:{type:[String,Number],required:!1,default:""},icon:{type:String,required:!1},placeholder:{type:String,required:!1},disabled:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},readonly:{type:Boolean,required:!1},type:{type:String,required:!1,default:"text"}},emits:["keydown","keyup","change"],setup(s,{emit:e}){const i=He(s,"modelValue",e,{passive:!0});return(r,o)=>{const c=J;return v(),P("div",Ke,[E(r.$slots,"icon",{},()=>[s.icon?(v(),fe(c,{key:0,icon:s.icon,class:"ml-0.3em mr-0.1em text-1.1em op50"},null,8,["icon"])):le("",!0)]),qe(ue("input",Ie({"onUpdate:modelValue":o[0]||(o[0]=h=>Ve(i)?i.value=h:null)},r.$props,{class:"ml-0.4em w-full flex-auto n-bg-base !outline-none"}),null,16),[[Pe,De(i)]])])}}},We={},Ye={class:"n-badge"};function ze(s,e){return v(),P("span",Ye,[E(s.$slots,"default")])}const Qt=Object.assign(Ue(We,[["render",ze]]),{__name:"NBadge"}),b=Object.create(null);b.open="0";b.close="1";b.ping="2";b.pong="3";b.message="4";b.upgrade="5";b.noop="6";const N=Object.create(null);Object.keys(b).forEach(s=>{N[b[s]]=s});const M={type:"error",data:"parser error"},de=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",pe=typeof ArrayBuffer=="function",ye=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,X=({type:s,data:e},t,n)=>de&&e instanceof Blob?t?n(e):oe(e,n):pe&&(e instanceof ArrayBuffer||ye(e))?t?n(e):oe(new Blob([e]),n):n(b[s]+(e||"")),oe=(s,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(s)};function ae(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let V;function Je(s,e){if(de&&s.data instanceof Blob)return s.data.arrayBuffer().then(ae).then(e);if(pe&&(s.data instanceof ArrayBuffer||ye(s.data)))return e(ae(s.data));X(s,!1,t=>{V||(V=new TextEncoder),e(V.encode(t))})}const ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<ce.length;s++)A[ce.charCodeAt(s)]=s;const Xe=s=>{let e=s.length*.75,t=s.length,n,i=0,r,o,c,h;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);const p=new ArrayBuffer(e),l=new Uint8Array(p);for(n=0;n<t;n+=4)r=A[s.charCodeAt(n)],o=A[s.charCodeAt(n+1)],c=A[s.charCodeAt(n+2)],h=A[s.charCodeAt(n+3)],l[i++]=r<<2|o>>4,l[i++]=(o&15)<<4|c>>2,l[i++]=(c&3)<<6|h&63;return p},Qe=typeof ArrayBuffer=="function",Q=(s,e)=>{if(typeof s!="string")return{type:"message",data:me(s,e)};const t=s.charAt(0);return t==="b"?{type:"message",data:Ge(s.substring(1),e)}:N[t]?s.length>1?{type:N[t],data:s.substring(1)}:{type:N[t]}:M},Ge=(s,e)=>{if(Qe){const t=Xe(s);return me(t,e)}else return{base64:!0,data:s}},me=(s,e)=>e==="blob"?s instanceof Blob?s:new Blob([s]):s instanceof ArrayBuffer?s:s.buffer,ge="",je=(s,e)=>{const t=s.length,n=new Array(t);let i=0;s.forEach((r,o)=>{X(r,!1,c=>{n[o]=c,++i===t&&e(n.join(ge))})})},Ze=(s,e)=>{const t=s.split(ge),n=[];for(let i=0;i<t.length;i++){const r=Q(t[i],e);if(n.push(r),r.type==="error")break}return n};function et(){return new TransformStream({transform(s,e){Je(s,t=>{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let U;function C(s){return s.reduce((e,t)=>e+t.length,0)}function B(s,e){if(s[0].length===e)return s.shift();const t=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)t[i]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),t}function tt(s,e){U||(U=new TextDecoder);const t=[];let n=0,i=-1,r=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(n===0){if(C(t)<1)break;const h=B(t,1);r=(h[0]&128)===128,i=h[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(C(t)<2)break;const h=B(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),n=3}else if(n===2){if(C(t)<8)break;const h=B(t,8),p=new DataView(h.buffer,h.byteOffset,h.length),l=p.getUint32(0);if(l>Math.pow(2,21)-1){c.enqueue(M);break}i=l*Math.pow(2,32)+p.getUint32(4),n=3}else{if(C(t)<i)break;const h=B(t,i);c.enqueue(Q(r?h:U.decode(h),e)),n=0}if(i===0||i>s){c.enqueue(M);break}}}})}const _e=4;function u(s){if(s)return st(s)}function st(s){for(var e in u.prototype)s[e]=u.prototype[e];return s}u.prototype.on=u.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};u.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};const D=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),y=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nt="arraybuffer";function be(s,...e){return e.reduce((t,n)=>(s.hasOwnProperty(n)&&(t[n]=s[n]),t),{})}const it=y.setTimeout,rt=y.clearTimeout;function I(s,e){e.useNativeTimers?(s.setTimeoutFn=it.bind(y),s.clearTimeoutFn=rt.bind(y)):(s.setTimeoutFn=y.setTimeout.bind(y),s.clearTimeoutFn=y.clearTimeout.bind(y))}const ot=1.33;function at(s){return typeof s=="string"?ct(s):Math.ceil((s.byteLength||s.size)*ot)}function ct(s){let e=0,t=0;for(let n=0,i=s.length;n<i;n++)e=s.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function we(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ht(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function ut(s){let e={},t=s.split("&");for(let n=0,i=t.length;n<i;n++){let r=t[n].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class ft extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class G extends u{constructor(e){super(),this.writable=!1,I(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new ft(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Q(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=ht(e);return t.length?"?"+t:""}}class lt extends G{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};Ze(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,je(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=we()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ve=!1;try{ve=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const dt=ve;function pt(){}class yt extends lt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(i,r)=>{this.onError("xhr post error",i,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class _ extends u{constructor(e,t,n){super(),this.createRequest=e,I(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=be(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=_.requestsCount++,_.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=pt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete _.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}_.requestsCount=0;_.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",he);else if(typeof addEventListener=="function"){const s="onpagehide"in y?"pagehide":"unload";addEventListener(s,he,!1)}}function he(){for(let s in _.requests)_.requests.hasOwnProperty(s)&&_.requests[s].abort()}const mt=(function(){const s=Ee({xdomain:!1});return s&&s.responseType!==null})();class gt extends yt{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=mt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new _(Ee,this.uri(),e)}}function Ee(s){const e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||dt))return new XMLHttpRequest}catch{}if(!e)try{return new y[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class _t extends G{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=ke?{}:be(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;X(n,this.supportsBinary,r=>{try{this.doWrite(n,r)}catch{}i&&D(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=we()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const F=y.WebSocket||y.MozWebSocket;class bt extends _t{createSocket(e,t,n){return ke?new F(e,t,n):t?new F(e,t):new F(e)}doWrite(e,t){this.ws.send(t)}}class wt extends G{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=tt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=et();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{n.read().then(({done:c,value:h})=>{c||(this.onPacket(h),r())}).catch(c=>{})};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;this._writer.write(n).then(()=>{i&&D(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const vt={websocket:bt,webtransport:wt,polling:gt},Et=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function H(s){if(s.length>8e3)throw"URI too long";const e=s,t=s.indexOf("["),n=s.indexOf("]");t!=-1&&n!=-1&&(s=s.substring(0,t)+s.substring(t,n).replace(/:/g,";")+s.substring(n,s.length));let i=Et.exec(s||""),r={},o=14;for(;o--;)r[kt[o]]=i[o]||"";return t!=-1&&n!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=Tt(r,r.path),r.queryKey=At(r,r.query),r}function Tt(s,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function At(s,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,r){i&&(t[i]=r)}),t}const K=typeof addEventListener=="function"&&typeof removeEventListener=="function",x=[];K&&addEventListener("offline",()=>{x.forEach(s=>s())},!1);class w extends u{constructor(e,t){if(super(),this.binaryType=nt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=H(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=H(t.host).host);I(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ut(this.opts.query)),K&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},x.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=_e,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&w.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",w.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(t+=at(i)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,D(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const r={type:e,data:t,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(w.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),K&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=x.indexOf(this._offlineEventListener);n!==-1&&x.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}w.protocol=_e;class Ot extends w{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;w.priorWebsocketSuccess=!1;const i=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",m=>{if(!n)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;w.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=t.name,this.emitReserved("upgradeError",f)}}))};function r(){n||(n=!0,l(),t.close(),t=null)}const o=m=>{const f=new Error("probe error: "+m);f.transport=t.name,r(),this.emitReserved("upgradeError",f)};function c(){o("transport closed")}function h(){o("socket closed")}function p(m){t&&m.name!==t.name&&r()}const l=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",p)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let Rt=class extends Ot{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>vt[i]).filter(i=>!!i)),super(e,n)}};function St(s,e="",t){let n=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),n=H(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const r=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+e,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n}const Ct=typeof ArrayBuffer=="function",Bt=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Te=Object.prototype.toString,Nt=typeof Blob=="function"||typeof Blob<"u"&&Te.call(Blob)==="[object BlobConstructor]",xt=typeof File=="function"||typeof File<"u"&&Te.call(File)==="[object FileConstructor]";function j(s){return Ct&&(s instanceof ArrayBuffer||Bt(s))||Nt&&s instanceof Blob||xt&&s instanceof File}function L(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,n=s.length;t<n;t++)if(L(s[t]))return!0;return!1}if(j(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return L(s.toJSON(),!0);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&L(s[t]))return!0;return!1}function Lt(s){const e=[],t=s.data,n=s;return n.data=W(t,e),n.attachments=e.length,{packet:n,buffers:e}}function W(s,e){if(!s)return s;if(j(s)){const t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){const t=new Array(s.length);for(let n=0;n<s.length;n++)t[n]=W(s[n],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){const t={};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=W(s[n],e));return t}return s}function qt(s,e){return s.data=Y(s.data,e),delete s.attachments,s}function Y(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=Y(s[t],e);else if(typeof s=="object")for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=Y(s[t],e));return s}const Ae=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Pt=5;var a;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(a||(a={}));class Dt{constructor(e){this.replacer=e}encode(e){return(e.type===a.EVENT||e.type===a.ACK)&&L(e)?this.encodeAsBinary({type:e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===a.BINARY_EVENT||e.type===a.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Lt(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}}class Z extends u{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===a.BINARY_EVENT;n||t.type===a.BINARY_ACK?(t.type=n?a.EVENT:a.ACK,this.reconstructor=new It(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(j(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(a[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const r=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(Z.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return q(t);case a.DISCONNECT:return t===void 0;case a.CONNECT_ERROR:return typeof t=="string"||q(t);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Ae.indexOf(t[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class It{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=qt(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Vt(s){return typeof s=="string"}const Ut=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function Ft(s){return s===void 0||Ut(s)}function q(s){return Object.prototype.toString.call(s)==="[object Object]"}function $t(s,e){switch(s){case a.CONNECT:return e===void 0||q(e);case a.DISCONNECT:return e===void 0;case a.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Ae.indexOf(e[0])===-1);case a.ACK:return Array.isArray(e);case a.CONNECT_ERROR:return typeof e=="string"||q(e);default:return!1}}function Mt(s){return Vt(s.nsp)&&Ft(s.id)&&$t(s.type,s.data)}const Ht=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Z,Encoder:Dt,get PacketType(){return a},isPacketValid:Mt,protocol:Pt},Symbol.toStringTag,{value:"Module"}));function g(s,e,t){return s.on(e,t),function(){s.off(e,t)}}const Kt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Oe extends u{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[g(e,"open",this.onopen.bind(this)),g(e,"packet",this.onpacket.bind(this)),g(e,"error",this.onerror.bind(this)),g(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,i,r;if(Kt.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:a.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const l=this.ids++,m=t.pop();this._registerAckCallback(l,m),o.id=l}const c=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,h=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!c||(h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(r),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,i)=>{const r=(o,c)=>o?i(o):n(c);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...r)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:a.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case a.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case a.EVENT:case a.BINARY_EVENT:this.onevent(e);break;case a.ACK:case a.BINARY_ACK:this.onack(e);break;case a.DISCONNECT:this.ondisconnect();break;case a.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...i){n||(n=!0,t.packet({type:a.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:a.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function k(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}k.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=(Math.floor(e*10)&1)==0?s-t:s+t}return Math.min(s,this.max)|0};k.prototype.reset=function(){this.attempts=0};k.prototype.setMin=function(s){this.ms=s};k.prototype.setMax=function(s){this.max=s};k.prototype.setJitter=function(s){this.jitter=s};class z extends u{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,I(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new k({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Ht;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Rt(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=g(t,"open",function(){n.onopen(),e&&e()}),r=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=g(t,"error",r);if(this._timeout!==!1){const c=this._timeout,h=this.setTimeoutFn(()=>{i(),r(new Error("timeout")),t.close()},c);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(g(e,"ping",this.onping.bind(this)),g(e,"data",this.ondata.bind(this)),g(e,"error",this.onerror.bind(this)),g(e,"close",this.onclose.bind(this)),g(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){D(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Oe(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const T={};function $(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};const t=St(s,e.path||"/socket.io"),n=t.source,i=t.id,r=t.path,o=T[i]&&r in T[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let h;return c?h=new z(n,e):(T[i]||(T[i]=new z(n,e)),h=T[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign($,{Manager:z,Socket:Oe,io:$,connect:$});export{J as _,zt as a,Jt as b,Xt as c,Qt as d,$ as l};