@oro.ad/nuxt-claude-devtools 1.0.6

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 ADDED
@@ -0,0 +1,176 @@
1
+ # @oro.ad/nuxt-claude-devtools
2
+
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![License][license-src]][license-href]
6
+ [![Nuxt][nuxt-src]][nuxt-href]
7
+
8
+ Nuxt DevTools integration for [Claude Code](https://claude.com/claude-code) AI assistant. Chat with Claude directly from your Nuxt DevTools panel.
9
+
10
+ ## Features
11
+
12
+ - **Chat Interface** — Interactive chat with Claude AI directly in DevTools
13
+ - **Streaming Responses** — Real-time streaming output from Claude
14
+ - **Session Management** — Start new conversations or continue previous ones
15
+ - **MCP Servers** — Manage Model Context Protocol servers (add, remove, list)
16
+ - **Multiple Transports** — Support for stdio, HTTP, and SSE MCP transports
17
+
18
+ ## Prerequisites
19
+
20
+ - [Claude Code CLI](https://claude.com/claude-code) must be installed and authenticated
21
+ - Nuxt 3.x or 4.x with DevTools enabled
22
+
23
+ ## Quick Setup
24
+
25
+ 1. Install the module:
26
+
27
+ ```bash
28
+ # Using pnpm
29
+ pnpm add -D @oro.ad/nuxt-claude-devtools
30
+
31
+ # Using yarn
32
+ yarn add --dev @oro.ad/nuxt-claude-devtools
33
+
34
+ # Using npm
35
+ npm install --save-dev @oro.ad/nuxt-claude-devtools
36
+ ```
37
+
38
+ 2. Add to your `nuxt.config.ts`:
39
+
40
+ ```ts
41
+ export default defineNuxtConfig({
42
+ modules: ['@oro.ad/nuxt-claude-devtools'],
43
+
44
+ devtools: {
45
+ enabled: true,
46
+ },
47
+
48
+ claudeDevtools: {
49
+ enabled: true,
50
+ claude: {
51
+ command: 'claude', // Path to Claude CLI
52
+ args: [], // Additional CLI arguments
53
+ },
54
+ },
55
+ })
56
+ ```
57
+
58
+ 3. Start your Nuxt dev server and open DevTools — you'll see a new "AI" tab.
59
+
60
+ ## Configuration
61
+
62
+ | Option | Type | Default | Description |
63
+ |--------|------|---------|-------------|
64
+ | `enabled` | `boolean` | `true` | Enable/disable the module |
65
+ | `claude.command` | `string` | `'claude'` | Path to Claude CLI executable |
66
+ | `claude.args` | `string[]` | `[]` | Additional arguments for Claude CLI |
67
+
68
+ ## Usage
69
+
70
+ ### Chat Interface
71
+
72
+ 1. Open Nuxt DevTools (press `Shift + Option + D` or click the Nuxt icon)
73
+ 2. Navigate to the "AI" tab
74
+ 3. Type your message and press Enter
75
+ 4. Claude will respond with streaming output
76
+
77
+ The module automatically uses `--continue` for follow-up messages within a session. Click "New Chat" to start a fresh conversation.
78
+
79
+ ### MCP Servers
80
+
81
+ Manage Model Context Protocol servers directly from DevTools:
82
+
83
+ 1. Click the "MCP" button in the chat header
84
+ 2. View configured servers
85
+ 3. Add new servers (stdio, HTTP, or SSE transport)
86
+ 4. Remove existing servers
87
+
88
+ Example MCP servers:
89
+ - **GitHub**: `npx -y @modelcontextprotocol/server-github`
90
+ - **Nuxt UI**: `https://ui.nuxt.com/mcp` (HTTP)
91
+
92
+ ## Architecture
93
+
94
+ ```
95
+ ┌─────────────────────────────────────────────────────────┐
96
+ │ Nuxt DevTools │
97
+ │ ┌───────────────────────────────────────────────────┐ │
98
+ │ │ Claude DevTools Panel │ │
99
+ │ │ (iframe at /__claude-devtools) │ │
100
+ │ └───────────────────────────────────────────────────┘ │
101
+ └─────────────────────────────────────────────────────────┘
102
+
103
+ │ Socket.IO (port 3355)
104
+
105
+ ┌─────────────────────────────────────────────────────────┐
106
+ │ Claude Session Server │
107
+ │ ┌─────────────────┐ ┌─────────────────────────────┐│
108
+ │ │ Socket.IO Hub │───▶│ Claude CLI Process ││
109
+ │ │ │ │ (spawn with --continue) ││
110
+ │ └─────────────────┘ └─────────────────────────────┘│
111
+ └─────────────────────────────────────────────────────────┘
112
+ ```
113
+
114
+ ## Development
115
+
116
+ ```bash
117
+ # Install dependencies
118
+ npm install
119
+
120
+ # Install dependencies for client
121
+ cd ./client
122
+ npm install
123
+ cd ../
124
+
125
+ # Generate type stubs
126
+ npm run dev:prepare
127
+
128
+ # Start playground with hot reload
129
+ npm run dev
130
+
131
+ # Build for production
132
+ npm run prepack
133
+
134
+ # Run linter
135
+ npm run lint
136
+ ```
137
+
138
+ ### Project Structure
139
+
140
+ ```
141
+ ├── src/
142
+ │ ├── module.ts # Nuxt module definition
143
+ │ ├── devtools.ts # DevTools UI setup
144
+ │ └── runtime/
145
+ │ └── server/
146
+ │ └── claude-session.ts # Socket.IO server & Claude process management
147
+ ├── client/ # DevTools panel UI (Nuxt app)
148
+ │ ├── pages/
149
+ │ │ ├── index.vue # Chat interface
150
+ │ │ └── mcp.vue # MCP servers management
151
+ │ └── nuxt.config.ts
152
+ └── playground/ # Development playground
153
+ ```
154
+
155
+ ## Security Notes
156
+
157
+ - The module only runs in development mode (`nuxt.options.dev`)
158
+ - Uses `--dangerously-skip-permissions` flag for Claude CLI (development only)
159
+ - Socket.IO server runs on a separate port (3355)
160
+
161
+ ## License
162
+
163
+ [This project is licensed under the GNU General Public License v3.0 (GPL-3.0).](./LICENSE.md)
164
+
165
+ <!-- Badges -->
166
+ [npm-version-src]: https://img.shields.io/npm/v/@oro.ad/nuxt-claude-devtools/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
167
+ [npm-version-href]: https://npmjs.com/package/@oro.ad/nuxt-claude-devtools
168
+
169
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@oro.ad/nuxt-claude-devtools.svg?style=flat&colorA=18181B&colorB=28CF8D
170
+ [npm-downloads-href]: https://npmjs.com/package/@oro.ad/nuxt-claude-devtools
171
+
172
+ [license-src]: https://img.shields.io/badge/license-GPL--3.0-green.svg?style=flat&colorA=18181B&colorB=28CF8D
173
+ [license-href]: ./LICENSE.md
174
+
175
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt
176
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.Ci1n7Rlt.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/JxSLzYFz.js"><script type="module" src="/__claude-devtools/_nuxt/JxSLzYFz.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__claude-devtools",buildId:"f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767989031178,false]</script></body></html>
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__claude-devtools/_nuxt/entry.Ci1n7Rlt.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/JxSLzYFz.js"><script type="module" src="/__claude-devtools/_nuxt/JxSLzYFz.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__claude-devtools",buildId:"f2b44466-6d7e-4b5c-bf6b-f6c7cf9e0d59",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767989031179,false]</script></body></html>
@@ -0,0 +1 @@
1
+ import{_ as s}from"./BWmwj9se.js";import{_ as a,c as i,o as u,a as t,t as n,b as c,w as l,d}from"./JxSLzYFz.js";import{u as f}from"./BngXb2T5.js";const p={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},m={class:"max-w-520px text-center"},h=["textContent"],b=["textContent"],g=["textContent"],x={class:"flex items-center justify-center w-full"},y={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Page not found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(e){const r=e;return f({title:`${r.statusCode} - ${r.statusMessage} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(k,_)=>{const o=s;return u(),i("div",p,[t("div",m,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:n(e.statusCode)},null,8,h),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:n(e.statusMessage)},null,8,b),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,g),t("div",x,[c(o,{to:"/",class:"font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"},{default:l(()=>[d(n(e.backHome),1)]),_:1})])])])}}},N=a(y,[["__scopeId","data-v-cd31e6b7"]]);export{N as default};
@@ -0,0 +1 @@
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 _};
@@ -0,0 +1 @@
1
+ import{u as a,e as s,h as u,i as r,f as h}from"./JxSLzYFz.js";function i(t){const e=t||s();return e.ssrContext?.head||e.runWithContext(()=>{if(u()){const n=r(h);if(!n)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return n}})}function d(t,e={}){const n=e.head||i(e.nuxt);return a(t,{head:n,...e})}export{d as u};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import{_ as o,c as s,o as a,a as t,t as r}from"./JxSLzYFz.js";import{u as i}from"./BngXb2T5.js";const u={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},l={class:"max-w-520px text-center"},c=["textContent"],d=["textContent"],p=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Internal server error"},description:{type:String,default:"This page is temporarily unavailable."},refresh:{type:String,default:"Refresh this page"}},setup(e){const n=e;return i({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(g,h)=>(a(),s("div",u,[t("div",l,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:r(e.statusCode)},null,8,c),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:r(e.statusMessage)},null,8,d),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:r(e.description)},null,8,p)])]))}},x=o(f,[["__scopeId","data-v-8851f357"]]);export{x as default};