@oro.ad/nuxt-claude-devtools 1.1.0 → 1.2.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 (40) hide show
  1. package/README.md +31 -0
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{DV075BoS.js → 08Mb3FOO.js} +1 -1
  5. package/dist/client/_nuxt/BMi2eT6G.js +1 -0
  6. package/dist/client/_nuxt/{XJ4dJUK2.js → BiBLVxWh.js} +1 -1
  7. package/dist/client/_nuxt/BnRGpZsC.js +8 -0
  8. package/dist/client/_nuxt/C2GhPw5d.js +7 -0
  9. package/dist/client/_nuxt/{BbEuL4Z6.js → CLKqRoht.js} +1 -1
  10. package/dist/client/_nuxt/CPQSDiF7.js +12 -0
  11. package/dist/client/_nuxt/{DImlDIT-.js → CSlPuO5s.js} +1 -1
  12. package/dist/client/_nuxt/D8683igF.js +7 -0
  13. package/dist/client/_nuxt/{BZrcCMrf.js → DBIw6BGF.js} +1 -1
  14. package/dist/client/_nuxt/DCgjfr8H.js +9 -0
  15. package/dist/client/_nuxt/{DYNukx3V.js → b4Upel01.js} +1 -1
  16. package/dist/client/_nuxt/{TvBJGid1.js → bl5iU4Kz.js} +1 -1
  17. package/dist/client/_nuxt/builds/latest.json +1 -1
  18. package/dist/client/_nuxt/builds/meta/35284331-5e85-46e0-9058-988fea05336c.json +1 -0
  19. package/dist/client/_nuxt/entry.BhHeZ_Nj.css +1 -0
  20. package/dist/client/_nuxt/{e7kgpy_n.js → nKfsBgPE.js} +2 -2
  21. package/dist/client/_nuxt/{BRCY8pHC.js → o1jjB-UO.js} +1 -1
  22. package/dist/client/agents/index.html +1 -1
  23. package/dist/client/commands/index.html +1 -1
  24. package/dist/client/docs/index.html +1 -1
  25. package/dist/client/index.html +1 -1
  26. package/dist/client/mcp/index.html +1 -1
  27. package/dist/client/skills/index.html +1 -1
  28. package/dist/module.d.mts +1 -0
  29. package/dist/module.json +1 -1
  30. package/dist/module.mjs +10 -4
  31. package/dist/runtime/logger.js +18 -0
  32. package/package.json +1 -1
  33. package/dist/client/_nuxt/BVHVIm9H.js +0 -12
  34. package/dist/client/_nuxt/BmjlsnUc.js +0 -1
  35. package/dist/client/_nuxt/D2NL8Xro.js +0 -7
  36. package/dist/client/_nuxt/D9qGFoJm.js +0 -4
  37. package/dist/client/_nuxt/Dbw96V2H.js +0 -7
  38. package/dist/client/_nuxt/FllXIyfS.js +0 -8
  39. package/dist/client/_nuxt/builds/meta/e8ae4dbb-462d-47a2-9aa2-50bed9498ab2.json +0 -1
  40. package/dist/client/_nuxt/entry.DwDQaFYc.css +0 -1
package/README.md CHANGED
@@ -11,6 +11,8 @@ Nuxt DevTools integration for [Claude Code](https://claude.ai/code) AI assistant
11
11
 
12
12
  - **Chat Interface** — Interactive chat with Claude AI directly in DevTools
13
13
  - **Streaming Responses** — Real-time streaming output from Claude
14
+ - **Context Chips** — Send viewport size, browser info, and routing context with messages
15
+ - **Component Picker** — Select Vue components from the page to add as context
14
16
  - **Session Management** — Start new conversations or continue previous ones
15
17
  - **Chat History** — Browse and restore previous conversations
16
18
  - **Skills** — Markdown-based skills to extend Claude's capabilities (`.claude/skills/<name>/SKILL.md`)
@@ -67,6 +69,7 @@ export default defineNuxtConfig({
67
69
  | Option | Type | Default | Description |
68
70
  |--------|------|---------|-------------|
69
71
  | `enabled` | `boolean` | `true` | Enable/disable the module |
72
+ | `debug` | `boolean` | `false` | Enable debug logging in console |
70
73
  | `claude.command` | `string` | `'claude'` | Path to Claude CLI executable |
71
74
  | `claude.args` | `string[]` | `[]` | Additional arguments for Claude CLI |
72
75
 
@@ -81,6 +84,22 @@ export default defineNuxtConfig({
81
84
 
82
85
  The module automatically uses `--continue` for follow-up messages within a session. Click "New Chat" to start a fresh conversation.
83
86
 
87
+ ### Context Chips
88
+
89
+ Add contextual information to your messages using the chips next to the input field:
90
+
91
+ | Chip | Context Provided |
92
+ |------|------------------|
93
+ | **Viewport** | App window dimensions (width × height) |
94
+ | **User Agent** | Browser and OS information |
95
+ | **Routing** | Current route path, query params, page component file |
96
+
97
+ Click a chip to toggle it on/off. Active chips will include their context with your next message.
98
+
99
+ ### Component Picker
100
+
101
+ Click "Add Component" to select Vue components directly from your running app. The component's file path will be included as context, allowing Claude to read and understand the component code.
102
+
84
103
  ### Skills
85
104
 
86
105
  Skills extend Claude's capabilities with specialized knowledge. Create markdown files with YAML frontmatter:
@@ -283,10 +302,22 @@ npm run lint
283
302
  │ │ ├── commands.vue # Slash commands manager
284
303
  │ │ ├── docs.vue # Documentation viewer
285
304
  │ │ └── mcp.vue # MCP servers management
305
+ │ ├── composables/
306
+ │ │ ├── useClaudeChat.ts # Socket, messages, session
307
+ │ │ ├── useMessageContext.ts # Context chips logic
308
+ │ │ ├── useVoiceInput.ts # Speech recognition
309
+ │ │ ├── useAutocomplete.ts # Docs/commands autocomplete
310
+ │ │ └── useComponentPicker.ts # Component selection
286
311
  │ └── nuxt.config.ts
287
312
  └── playground/ # Development playground
288
313
  ```
289
314
 
315
+ ## Showcase
316
+
317
+ Check out real-world use cases and demos at **[nuxt-claude-devtools.oro.ad](https://nuxt-claude-devtools.oro.ad/)**
318
+
319
+ Have an interesting use case? We'd love to feature it! Send your story to [jobsbystr@gmail.com](mailto:jobsbystr@gmail.com).
320
+
290
321
  ## Security Notes
291
322
 
292
323
  - The module only runs in development mode (`nuxt.options.dev`)
@@ -1 +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.DwDQaFYc.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/e7kgpy_n.js"><script type="module" src="/__claude-devtools/_nuxt/e7kgpy_n.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"e8ae4dbb-462d-47a2-9aa2-50bed9498ab2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1768962606353,false]</script></body></html>
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.BhHeZ_Nj.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/nKfsBgPE.js"><script type="module" src="/__claude-devtools/_nuxt/nKfsBgPE.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"35284331-5e85-46e0-9058-988fea05336c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1769481734083,false]</script></body></html>
@@ -1 +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.DwDQaFYc.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/e7kgpy_n.js"><script type="module" src="/__claude-devtools/_nuxt/e7kgpy_n.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"e8ae4dbb-462d-47a2-9aa2-50bed9498ab2",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1768962606353,false]</script></body></html>
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.BhHeZ_Nj.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__claude-devtools/_nuxt/nKfsBgPE.js"><script type="module" src="/__claude-devtools/_nuxt/nKfsBgPE.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{claudeDevtoolsBc:{tunnel:""}},app:{baseURL:"/__claude-devtools",buildId:"35284331-5e85-46e0-9058-988fea05336c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1769481734084,false]</script></body></html>
@@ -1 +1 @@
1
- import{_ as s}from"./TvBJGid1.js";import{_ as a,c as i,o as u,a as t,t as n,b as c,w as l,d}from"./e7kgpy_n.js";import{u as f}from"./DYNukx3V.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"],g=["textContent"],b=["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,g),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,b),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-8c88d9ea"]]);export{N as default};
1
+ import{_ as s}from"./bl5iU4Kz.js";import{_ as a,c as i,o as u,a as t,t as n,b as c,w as l,d}from"./nKfsBgPE.js";import{u as f}from"./b4Upel01.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"],g=["textContent"],b=["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,g),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,b),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-8c88d9ea"]]);export{N as default};
@@ -0,0 +1 @@
1
+ import{_ as B}from"./bl5iU4Kz.js";import{u as R,a as E,_ as q,b as D,c as H,l as I}from"./BiBLVxWh.js";import{_ as z}from"./DBIw6BGF.js";import{_ as G}from"./CLKqRoht.js";import{g as J,r as p,j as K,k as O,c as r,o as u,a as t,b as s,w as i,d as a,n as Q,l as V,t as v,m as b,v as x,F as S,p as W}from"./nKfsBgPE.js";const X={class:"relative flex flex-col h-screen n-bg-base"},Y={class:"flex items-center justify-between p-4"},Z={class:"flex items-center gap-3"},h={class:"text-xl font-bold flex items-center gap-2"},ee={class:"flex items-center gap-2"},te={class:"flex-1 overflow-auto p-4"},le={class:"space-y-4"},oe={key:0,class:"n-bg-active rounded-lg p-4"},se={key:0,class:"mb-4"},ne={class:"space-y-4"},ae={class:"flex gap-4"},re={class:"flex items-center gap-2"},ue={class:"flex items-center gap-2"},ie={class:"flex items-center gap-2"},de={key:1},me={class:"flex gap-4"},pe={class:"flex items-center gap-2"},ve={class:"flex items-center gap-2"},ce={class:"flex gap-2 pt-2"},fe={key:1,class:"n-bg-active rounded-lg p-4 opacity-50"},ge={key:2,class:"space-y-2"},be={class:"font-bold flex items-center gap-2"},xe={class:"text-sm opacity-70 font-mono"},Ue=J({__name:"mcp",setup(_e){const w=R(),{log:_}=E("mcp"),n=p(null),k=p(!1),c=p(!1),U=p([]),f=p(!1),l=p({name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"}),m=p("");function T(){return w.isActive.value&&w.origin.value?w.origin.value:window.location.origin}function $(){const d=T();_("Connecting to socket at",d),n.value=I(d,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),n.value.on("connect",()=>{_("Connected to socket"),k.value=!0,N()}),n.value.on("disconnect",()=>{_("Disconnected from socket"),k.value=!1}),n.value.on("mcp:list",e=>{_("MCP list received",e),U.value=e,c.value=!1}),n.value.on("mcp:added",e=>{e.success?(f.value=!1,M()):m.value=e.error||"Failed to add MCP server"}),n.value.on("mcp:removed",e=>{e.success||alert(`Failed to remove: ${e.error}`)})}function N(){n.value&&(c.value=!0,n.value.emit("mcp:list"))}function M(){l.value={name:"",transport:"stdio",command:"",args:"",url:"",scope:"local"},m.value=""}function L(){if(!l.value.name){m.value="Name is required";return}if(l.value.transport==="stdio"&&!l.value.command){m.value="Command is required for stdio transport";return}if((l.value.transport==="http"||l.value.transport==="sse")&&!l.value.url){m.value="URL is required for HTTP/SSE transport";return}if(n.value){const d=l.value.args.split(" ").map(e=>e.trim()).filter(e=>e.length>0);n.value.emit("mcp:add",{name:l.value.name,transport:l.value.transport,command:l.value.command,args:d,url:l.value.url,scope:l.value.scope})}}function j(d){confirm(`Remove MCP server "${d.name}"?`)&&n.value&&n.value.emit("mcp:remove",{name:d.name})}return K(()=>{$()}),O(()=>{n.value&&n.value.disconnect()}),(d,e)=>{const F=B,y=q,g=D,P=H,C=z,A=G;return u(),r("div",X,[t("div",Y,[t("div",Z,[s(F,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:i(()=>[...e[11]||(e[11]=[a(" ← Chat ",-1)])]),_:1}),t("h1",h,[s(y,{class:"text-blue",icon:"carbon:plug"}),e[12]||(e[12]=a(" MCP Servers ",-1))])]),t("div",ee,[s(g,{disabled:!k.value,n:"blue",onClick:e[0]||(e[0]=o=>f.value=!0)},{default:i(()=>[s(y,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=a(" Add Server ",-1))]),_:1},8,["disabled"]),s(g,{disabled:!k.value||c.value,n:"gray",onClick:N},{default:i(()=>[s(y,{class:Q([{"animate-spin":c.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=a(" Refresh ",-1))]),_:1},8,["disabled"])])]),t("div",te,[t("div",le,[s(P,{class:"text-sm",icon:"carbon:information",n:"blue"},{default:i(()=>[...e[15]||(e[15]=[a(" Model Context Protocol (MCP) servers extend Claude's capabilities with custom tools and data sources. ",-1)])]),_:1}),f.value?(u(),r("div",oe,[e[29]||(e[29]=t("h3",{class:"font-bold mb-4"}," Add MCP Server ",-1)),m.value?(u(),r("div",se,[s(P,{icon:"carbon:warning",n:"red"},{default:i(()=>[a(v(m.value),1)]),_:1})])):V("",!0),t("div",ne,[t("div",null,[e[16]||(e[16]=t("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),s(C,{modelValue:l.value.name,"onUpdate:modelValue":e[1]||(e[1]=o=>l.value.name=o),class:"w-full",placeholder:"e.g. github, nuxt-ui-remote"},null,8,["modelValue"])]),t("div",null,[e[20]||(e[20]=t("label",{class:"block text-sm font-medium mb-1"},"Transport",-1)),t("div",ae,[t("label",re,[b(t("input",{"onUpdate:modelValue":e[2]||(e[2]=o=>l.value.transport=o),name:"transport",type:"radio",value:"stdio"},null,512),[[x,l.value.transport]]),e[17]||(e[17]=t("span",null,"stdio",-1))]),t("label",ue,[b(t("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>l.value.transport=o),name:"transport",type:"radio",value:"http"},null,512),[[x,l.value.transport]]),e[18]||(e[18]=t("span",null,"HTTP",-1))]),t("label",ie,[b(t("input",{"onUpdate:modelValue":e[4]||(e[4]=o=>l.value.transport=o),name:"transport",type:"radio",value:"sse"},null,512),[[x,l.value.transport]]),e[19]||(e[19]=t("span",null,"SSE",-1))])])]),l.value.transport==="stdio"?(u(),r(S,{key:0},[t("div",null,[e[21]||(e[21]=t("label",{class:"block text-sm font-medium mb-1"},"Command",-1)),s(C,{modelValue:l.value.command,"onUpdate:modelValue":e[5]||(e[5]=o=>l.value.command=o),class:"w-full font-mono",placeholder:"e.g. npx"},null,8,["modelValue"])]),t("div",null,[e[22]||(e[22]=t("label",{class:"block text-sm font-medium mb-1"},"Arguments",-1)),s(C,{modelValue:l.value.args,"onUpdate:modelValue":e[6]||(e[6]=o=>l.value.args=o),class:"w-full font-mono",placeholder:"e.g. -y @modelcontextprotocol/server-github"},null,8,["modelValue"])])],64)):V("",!0),l.value.transport==="http"||l.value.transport==="sse"?(u(),r("div",de,[e[23]||(e[23]=t("label",{class:"block text-sm font-medium mb-1"},"URL",-1)),s(C,{modelValue:l.value.url,"onUpdate:modelValue":e[7]||(e[7]=o=>l.value.url=o),class:"w-full font-mono",placeholder:"e.g. https://ui.nuxt.com/mcp"},null,8,["modelValue"])])):V("",!0),t("div",null,[e[26]||(e[26]=t("label",{class:"block text-sm font-medium mb-1"},"Scope",-1)),t("div",me,[t("label",pe,[b(t("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>l.value.scope=o),name:"scope",type:"radio",value:"local"},null,512),[[x,l.value.scope]]),e[24]||(e[24]=t("span",null,"Local (this project)",-1))]),t("label",ve,[b(t("input",{"onUpdate:modelValue":e[9]||(e[9]=o=>l.value.scope=o),name:"scope",type:"radio",value:"global"},null,512),[[x,l.value.scope]]),e[25]||(e[25]=t("span",null,"User (all projects)",-1))])])]),t("div",ce,[s(g,{n:"green",onClick:L},{default:i(()=>[...e[27]||(e[27]=[a(" Add Server ",-1)])]),_:1}),s(g,{n:"gray",onClick:e[10]||(e[10]=o=>{f.value=!1,M()})},{default:i(()=>[...e[28]||(e[28]=[a(" Cancel ",-1)])]),_:1})])])])):V("",!0),U.value.length===0&&!f.value&&!c.value?(u(),r("div",fe,' No MCP servers configured. Click "Add Server" to get started. ')):(u(),r("div",ge,[(u(!0),r(S,null,W(U.value,o=>(u(),r("div",{key:o.name,class:"n-bg-active rounded-lg p-4 flex items-center justify-between"},[t("div",null,[t("div",be,[a(v(o.name)+" ",1),s(A,{n:o.transport==="stdio"?"gray":"blue",class:"text-xs"},{default:i(()=>[a(v(o.transport),1)]),_:2},1032,["n"]),s(A,{n:o.scope==="local"?"green":"purple",class:"text-xs"},{default:i(()=>[a(v(o.scope),1)]),_:2},1032,["n"])]),t("div",xe,[o.transport==="stdio"?(u(),r(S,{key:0},[a(v(o.command)+" "+v(o.args?.join(" ")),1)],64)):(u(),r(S,{key:1},[a(v(o.url),1)],64))])]),s(g,{n:"red",onClick:ke=>j(o)},{default:i(()=>[s(y,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]))),128))]))])])])}}});export{Ue as default};
@@ -1 +1 @@
1
- import{_ as me}from"./TvBJGid1.js";import{c as ee,o as I,n as ge,g as _e,L as X,H as C,a as be,s as we,l as ve,M as Ee,q as x}from"./e7kgpy_n.js";const te={__name:"NIcon",props:{icon:{type:String,required:!1}},setup(n){return(e,t)=>(I(),ee("div",{class:ge(["n-icon",n.icon])},null,2))}},kt=_e({name:"NButton",props:{to:String,icon:String,border:{type:Boolean,default:!0},disabled:Boolean,type:{type:String,default:"button"}},setup(n,{attrs:e,slots:t}){return()=>X(n.to?me:"button",{to:n.to,...e,...!n.to&&{type:n.type},...n.disabled?{disabled:!0}:{tabindex:0},class:[n.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:()=>[C(t,"icon",{},()=>n.icon?[X(te,{icon:n.icon,class:t.default?"n-button-icon":""})]:[]),C(t,"default")]})}}),ke={class:"n-tip n-tip-base"},At={__name:"NTip",props:{icon:{type:String,required:!1}},setup(n){return(e,t)=>{const s=te;return I(),ee("div",ke,[C(e.$slots,"icon",{},()=>[n.icon?(I(),we(s,{key:0,icon:n.icon,class:"n-tip-icon"},null,8,["icon"])):ve("",!0)]),be("div",null,[C(e.$slots,"default")])])}}},y=Object.create(null);y.open="0";y.close="1";y.ping="2";y.pong="3";y.message="4";y.upgrade="5";y.noop="6";const T=Object.create(null);Object.keys(y).forEach(n=>{T[y[n]]=n});const V={type:"error",data:"parser error"},se=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ne=typeof ArrayBuffer=="function",ie=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,K=({type:n,data:e},t,s)=>se&&e instanceof Blob?t?s(e):Q(e,s):ne&&(e instanceof ArrayBuffer||ie(e))?t?s(e):Q(new Blob([e]),s):s(y[n]+(e||"")),Q=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function j(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let L;function Ae(n,e){if(se&&n.data instanceof Blob)return n.data.arrayBuffer().then(j).then(e);if(ne&&(n.data instanceof ArrayBuffer||ie(n.data)))return e(j(n.data));K(n,!1,t=>{L||(L=new TextEncoder),e(L.encode(t))})}const G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<G.length;n++)E[G.charCodeAt(n)]=n;const Te=n=>{let e=n.length*.75,t=n.length,s,i=0,r,o,c,h;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const m=new ArrayBuffer(e),f=new Uint8Array(m);for(s=0;s<t;s+=4)r=E[n.charCodeAt(s)],o=E[n.charCodeAt(s+1)],c=E[n.charCodeAt(s+2)],h=E[n.charCodeAt(s+3)],f[i++]=r<<2|o>>4,f[i++]=(o&15)<<4|c>>2,f[i++]=(c&3)<<6|h&63;return m},Re=typeof ArrayBuffer=="function",W=(n,e)=>{if(typeof n!="string")return{type:"message",data:re(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Oe(n.substring(1),e)}:T[t]?n.length>1?{type:T[t],data:n.substring(1)}:{type:T[t]}:V},Oe=(n,e)=>{if(Re){const t=Te(n);return re(t,e)}else return{base64:!0,data:n}},re=(n,e)=>e==="blob"?n instanceof Blob?n:new Blob([n]):n instanceof ArrayBuffer?n:n.buffer,oe="",Ce=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((r,o)=>{K(r,!1,c=>{s[o]=c,++i===t&&e(s.join(oe))})})},Be=(n,e)=>{const t=n.split(oe),s=[];for(let i=0;i<t.length;i++){const r=W(t[i],e);if(s.push(r),r.type==="error")break}return s};function Se(){return new TransformStream({transform(n,e){Ae(n,t=>{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,s)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let q;function k(n){return n.reduce((e,t)=>e+t.length,0)}function A(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;i<e;i++)t[i]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function Ne(n,e){q||(q=new TextDecoder);const t=[];let s=0,i=-1,r=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(k(t)<1)break;const h=A(t,1);r=(h[0]&128)===128,i=h[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(k(t)<2)break;const h=A(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(k(t)<8)break;const h=A(t,8),m=new DataView(h.buffer,h.byteOffset,h.length),f=m.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(V);break}i=f*Math.pow(2,32)+m.getUint32(4),s=3}else{if(k(t)<i)break;const h=A(t,i);c.enqueue(W(r?h:q.decode(h),e)),s=0}if(i===0||i>n){c.enqueue(V);break}}}})}const ae=4;function u(n){if(n)return xe(n)}function xe(n){for(var e in u.prototype)n[e]=u.prototype[e];return n}u.prototype.on=u.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};u.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+n],this};u.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};u.prototype.hasListeners=function(n){return!!this.listeners(n).length};const S=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Le="arraybuffer";function ce(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const qe=l.setTimeout,Pe=l.clearTimeout;function N(n,e){e.useNativeTimers?(n.setTimeoutFn=qe.bind(l),n.clearTimeoutFn=Pe.bind(l)):(n.setTimeoutFn=l.setTimeout.bind(l),n.clearTimeoutFn=l.clearTimeout.bind(l))}const De=1.33;function Ie(n){return typeof n=="string"?Ve(n):Math.ceil((n.byteLength||n.size)*De)}function Ve(n){let e=0,t=0;for(let s=0,i=n.length;s<i;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function he(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ue(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Fe(n){let e={},t=n.split("&");for(let s=0,i=t.length;s<i;s++){let r=t[s].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class Me extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class Y extends u{constructor(e){super(),this.writable=!1,N(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new Me(e,t,s)),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=W(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=Ue(e);return t.length?"?"+t:""}}class He extends Y{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 s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Be(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,Ce(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]=he()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ue=!1;try{ue=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const $e=ue;function Ke(){}class We extends He{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.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,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class d extends u{constructor(e,t,s){super(),this.createRequest=e,N(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=ce(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=d.requestsCount++,d.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=Ke,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete d.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()}}d.requestsCount=0;d.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Z);else if(typeof addEventListener=="function"){const n="onpagehide"in l?"pagehide":"unload";addEventListener(n,Z,!1)}}function Z(){for(let n in d.requests)d.requests.hasOwnProperty(n)&&d.requests[n].abort()}const Ye=(function(){const n=fe({xdomain:!1});return n&&n.responseType!==null})();class ze extends We{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Ye&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new d(fe,this.uri(),e)}}function fe(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||$e))return new XMLHttpRequest}catch{}if(!e)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const le=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Je extends Y{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=le?{}:ce(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}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 s=e[t],i=t===e.length-1;K(s,this.supportsBinary,r=>{try{this.doWrite(s,r)}catch{}i&&S(()=>{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]=he()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const P=l.WebSocket||l.MozWebSocket;class Xe extends Je{createSocket(e,t,s){return le?new P(e,t,s):t?new P(e,t):new P(e)}doWrite(e,t){this.ws.send(t)}}class Qe extends Y{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=Ne(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Se();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{s.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 s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const je={websocket:Xe,webtransport:Qe,polling:ze},Ge=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ze=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function U(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=Ge.exec(n||""),r={},o=14;for(;o--;)r[Ze[o]]=i[o]||"";return t!=-1&&s!=-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=et(r,r.path),r.queryKey=tt(r,r.query),r}function et(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function tt(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,r){i&&(t[i]=r)}),t}const F=typeof addEventListener=="function"&&typeof removeEventListener=="function",R=[];F&&addEventListener("offline",()=>{R.forEach(n=>n())},!1);class _ extends u{constructor(e,t){if(super(),this.binaryType=Le,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 s=U(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=U(t.host).host);N(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(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),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=Fe(this.opts.query)),F&&(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"})},R.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ae,t.transport=e,this.id&&(t.sid=this.id);const s=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](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&_.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",_.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 s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(t+=Ie(i)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,S(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const r={type:e,data:t,options:s};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()},s=()=>{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?s():e()}):this.upgrading?s():e()),this}_onError(e){if(_.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(),F&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=R.indexOf(this._offlineEventListener);s!==-1&&R.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}_.protocol=ae;class st extends _{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),s=!1;_.priorWebsocketSuccess=!1;const i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",g=>{if(!s)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;_.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(f(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=t.name,this.emitReserved("upgradeError",w)}}))};function r(){s||(s=!0,f(),t.close(),t=null)}const o=g=>{const w=new Error("probe error: "+g);w.transport=t.name,r(),this.emitReserved("upgradeError",w)};function c(){o("transport closed")}function h(){o("socket closed")}function m(g){t&&g.name!==t.name&&r()}const f=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let nt=class extends st{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>je[i]).filter(i=>!!i)),super(e,s)}};function it(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=U(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const r=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+r+":"+s.port+e,s.href=s.protocol+"://"+r+(t&&t.port===s.port?"":":"+s.port),s}const rt=typeof ArrayBuffer=="function",ot=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,pe=Object.prototype.toString,at=typeof Blob=="function"||typeof Blob<"u"&&pe.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&pe.call(File)==="[object FileConstructor]";function z(n){return rt&&(n instanceof ArrayBuffer||ot(n))||at&&n instanceof Blob||ct&&n instanceof File}function O(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(O(n[t]))return!0;return!1}if(z(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return O(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&O(n[t]))return!0;return!1}function ht(n){const e=[],t=n.data,s=n;return s.data=M(t,e),s.attachments=e.length,{packet:s,buffers:e}}function M(n,e){if(!n)return n;if(z(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=M(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=M(n[s],e));return t}return n}function ut(n,e){return n.data=H(n.data,e),delete n.attachments,n}function H(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=H(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=H(n[t],e));return n}const de=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ft=5;var a;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(a||(a={}));class lt{constructor(e){this.replacer=e}encode(e){return(e.type===a.EVENT||e.type===a.ACK)&&O(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=ht(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}}class J 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 s=t.type===a.BINARY_EVENT;s||t.type===a.BINARY_ACK?(t.type=s?a.EVENT:a.ACK,this.reconstructor=new pt(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(z(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 s={type:Number(e.charAt(0))};if(a[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===a.BINARY_EVENT||s.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");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(r,t)}else s.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}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(J.isPayloadValid(s.type,r))s.data=r;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return B(t);case a.DISCONNECT:return t===void 0;case a.CONNECT_ERROR:return typeof t=="string"||B(t);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&de.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 pt{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=ut(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function dt(n){return typeof n=="string"}const yt=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};function mt(n){return n===void 0||yt(n)}function B(n){return Object.prototype.toString.call(n)==="[object Object]"}function gt(n,e){switch(n){case a.CONNECT:return e===void 0||B(e);case a.DISCONNECT:return e===void 0;case a.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&de.indexOf(e[0])===-1);case a.ACK:return Array.isArray(e);case a.CONNECT_ERROR:return typeof e=="string"||B(e);default:return!1}}function _t(n){return dt(n.nsp)&&mt(n.id)&&gt(n.type,n.data)}const bt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:J,Encoder:lt,get PacketType(){return a},isPacketValid:_t,protocol:ft},Symbol.toStringTag,{value:"Module"}));function p(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const wt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ye extends u{constructor(e,t,s){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,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[p(e,"open",this.onopen.bind(this)),p(e,"packet",this.onpacket.bind(this)),p(e,"error",this.onerror.bind(this)),p(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 s,i,r;if(wt.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 f=this.ids++,g=t.pop();this._registerAckCallback(f,g),o.id=f}const c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.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 s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s: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((s,i)=>{const r=(o,c)=>o?i(o):s(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 s={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?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),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(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.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 s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);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 s of t)s.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 s=!1;return function(...i){s||(s=!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 s=0;s<t.length;s++)if(e===t[s])return t.splice(s,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 s=0;s<t.length;s++)if(e===t[s])return t.splice(s,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 s of t)s.apply(this,e.data)}}}function b(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}b.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};b.prototype.reset=function(){this.attempts=0};b.prototype.setMin=function(n){this.ms=n};b.prototype.setMax=function(n){this.max=n};b.prototype.setJitter=function(n){this.jitter=n};class $ extends u{constructor(e,t){var s;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,N(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((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new b({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||bt;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 nt(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=p(t,"open",function(){s.onopen(),e&&e()}),r=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=p(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(p(e,"ping",this.onping.bind(this)),p(e,"data",this.ondata.bind(this)),p(e,"error",this.onerror.bind(this)),p(e,"close",this.onclose.bind(this)),p(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){S(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new ye(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],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 s;this.cleanup(),(s=this.engine)===null||s===void 0||s.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 s=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&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const v={};function D(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=it(n,e.path||"/socket.io"),s=t.source,i=t.id,r=t.path,o=v[i]&&r in v[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let h;return c?h=new $(s,e):(v[i]||(v[i]=new $(s,e)),h=v[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(D,{Manager:$,Socket:ye,io:D,connect:D});function Rt(){const e=Ee().public?.claudeDevtoolsBc?.tunnel;return{isActive:x(()=>!!e),origin:x(()=>e?.origin??null),host:x(()=>e?.host??null),config:e??null}}export{te as _,kt as a,At as b,D as l,Rt as u};
1
+ import{_ as me}from"./bl5iU4Kz.js";import{c as te,o as I,n as _e,g as be,L as J,H as C,a as we,s as ve,l as Ee,M as ke,q as x}from"./nKfsBgPE.js";const se={__name:"NIcon",props:{icon:{type:String,required:!1}},setup(n){return(e,t)=>(I(),te("div",{class:_e(["n-icon",n.icon])},null,2))}},At=be({name:"NButton",props:{to:String,icon:String,border:{type:Boolean,default:!0},disabled:Boolean,type:{type:String,default:"button"}},setup(n,{attrs:e,slots:t}){return()=>J(n.to?me:"button",{to:n.to,...e,...!n.to&&{type:n.type},...n.disabled?{disabled:!0}:{tabindex:0},class:[n.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:()=>[C(t,"icon",{},()=>n.icon?[J(se,{icon:n.icon,class:t.default?"n-button-icon":""})]:[]),C(t,"default")]})}}),Ae={class:"n-tip n-tip-base"},Tt={__name:"NTip",props:{icon:{type:String,required:!1}},setup(n){return(e,t)=>{const s=se;return I(),te("div",Ae,[C(e.$slots,"icon",{},()=>[n.icon?(I(),ve(s,{key:0,icon:n.icon,class:"n-tip-icon"},null,8,["icon"])):Ee("",!0)]),we("div",null,[C(e.$slots,"default")])])}}},y=Object.create(null);y.open="0";y.close="1";y.ping="2";y.pong="3";y.message="4";y.upgrade="5";y.noop="6";const T=Object.create(null);Object.keys(y).forEach(n=>{T[y[n]]=n});const V={type:"error",data:"parser error"},ne=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ie=typeof ArrayBuffer=="function",re=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,K=({type:n,data:e},t,s)=>ne&&e instanceof Blob?t?s(e):Q(e,s):ie&&(e instanceof ArrayBuffer||re(e))?t?s(e):Q(new Blob([e]),s):s(y[n]+(e||"")),Q=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function j(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let L;function Te(n,e){if(ne&&n.data instanceof Blob)return n.data.arrayBuffer().then(j).then(e);if(ie&&(n.data instanceof ArrayBuffer||re(n.data)))return e(j(n.data));K(n,!1,t=>{L||(L=new TextEncoder),e(L.encode(t))})}const G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<G.length;n++)E[G.charCodeAt(n)]=n;const Re=n=>{let e=n.length*.75,t=n.length,s,i=0,r,o,c,h;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const g=new ArrayBuffer(e),f=new Uint8Array(g);for(s=0;s<t;s+=4)r=E[n.charCodeAt(s)],o=E[n.charCodeAt(s+1)],c=E[n.charCodeAt(s+2)],h=E[n.charCodeAt(s+3)],f[i++]=r<<2|o>>4,f[i++]=(o&15)<<4|c>>2,f[i++]=(c&3)<<6|h&63;return g},Oe=typeof ArrayBuffer=="function",W=(n,e)=>{if(typeof n!="string")return{type:"message",data:oe(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Ce(n.substring(1),e)}:T[t]?n.length>1?{type:T[t],data:n.substring(1)}:{type:T[t]}:V},Ce=(n,e)=>{if(Oe){const t=Re(n);return oe(t,e)}else return{base64:!0,data:n}},oe=(n,e)=>e==="blob"?n instanceof Blob?n:new Blob([n]):n instanceof ArrayBuffer?n:n.buffer,ae="",Be=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((r,o)=>{K(r,!1,c=>{s[o]=c,++i===t&&e(s.join(ae))})})},Se=(n,e)=>{const t=n.split(ae),s=[];for(let i=0;i<t.length;i++){const r=W(t[i],e);if(s.push(r),r.type==="error")break}return s};function Ne(){return new TransformStream({transform(n,e){Te(n,t=>{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,s)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let q;function k(n){return n.reduce((e,t)=>e+t.length,0)}function A(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;i<e;i++)t[i]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function xe(n,e){q||(q=new TextDecoder);const t=[];let s=0,i=-1,r=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(k(t)<1)break;const h=A(t,1);r=(h[0]&128)===128,i=h[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(k(t)<2)break;const h=A(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(k(t)<8)break;const h=A(t,8),g=new DataView(h.buffer,h.byteOffset,h.length),f=g.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(V);break}i=f*Math.pow(2,32)+g.getUint32(4),s=3}else{if(k(t)<i)break;const h=A(t,i);c.enqueue(W(r?h:q.decode(h),e)),s=0}if(i===0||i>n){c.enqueue(V);break}}}})}const ce=4;function u(n){if(n)return Le(n)}function Le(n){for(var e in u.prototype)n[e]=u.prototype[e];return n}u.prototype.on=u.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};u.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+n],this};u.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};u.prototype.hasListeners=function(n){return!!this.listeners(n).length};const S=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),qe="arraybuffer";function he(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const Pe=l.setTimeout,De=l.clearTimeout;function N(n,e){e.useNativeTimers?(n.setTimeoutFn=Pe.bind(l),n.clearTimeoutFn=De.bind(l)):(n.setTimeoutFn=l.setTimeout.bind(l),n.clearTimeoutFn=l.clearTimeout.bind(l))}const Ie=1.33;function Ve(n){return typeof n=="string"?Ue(n):Math.ceil((n.byteLength||n.size)*Ie)}function Ue(n){let e=0,t=0;for(let s=0,i=n.length;s<i;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function ue(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Fe(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Me(n){let e={},t=n.split("&");for(let s=0,i=t.length;s<i;s++){let r=t[s].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class $e extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class Y extends u{constructor(e){super(),this.writable=!1,N(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new $e(e,t,s)),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=W(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=Fe(e);return t.length?"?"+t:""}}class He extends Y{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 s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Se(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,Be(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]=ue()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let fe=!1;try{fe=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ke=fe;function We(){}class Ye extends He{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.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,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class d extends u{constructor(e,t,s){super(),this.createRequest=e,N(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=he(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=d.requestsCount++,d.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=We,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete d.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()}}d.requestsCount=0;d.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Z);else if(typeof addEventListener=="function"){const n="onpagehide"in l?"pagehide":"unload";addEventListener(n,Z,!1)}}function Z(){for(let n in d.requests)d.requests.hasOwnProperty(n)&&d.requests[n].abort()}const ze=(function(){const n=le({xdomain:!1});return n&&n.responseType!==null})();class Xe extends Ye{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=ze&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new d(le,this.uri(),e)}}function le(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Ke))return new XMLHttpRequest}catch{}if(!e)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const pe=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Je extends Y{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=pe?{}:he(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}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 s=e[t],i=t===e.length-1;K(s,this.supportsBinary,r=>{try{this.doWrite(s,r)}catch{}i&&S(()=>{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]=ue()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const P=l.WebSocket||l.MozWebSocket;class Qe extends Je{createSocket(e,t,s){return pe?new P(e,t,s):t?new P(e,t):new P(e)}doWrite(e,t){this.ws.send(t)}}class je extends Y{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=xe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ne();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{s.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 s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Ge={websocket:Qe,webtransport:je,polling:Xe},Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function U(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=Ze.exec(n||""),r={},o=14;for(;o--;)r[et[o]]=i[o]||"";return t!=-1&&s!=-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=st(r,r.query),r}function tt(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,r){i&&(t[i]=r)}),t}const F=typeof addEventListener=="function"&&typeof removeEventListener=="function",R=[];F&&addEventListener("offline",()=>{R.forEach(n=>n())},!1);class _ extends u{constructor(e,t){if(super(),this.binaryType=qe,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 s=U(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=U(t.host).host);N(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(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),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=Me(this.opts.query)),F&&(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"})},R.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=ce,t.transport=e,this.id&&(t.sid=this.id);const s=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](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&_.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",_.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 s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(t+=Ve(i)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,S(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const r={type:e,data:t,options:s};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()},s=()=>{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?s():e()}):this.upgrading?s():e()),this}_onError(e){if(_.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(),F&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=R.indexOf(this._offlineEventListener);s!==-1&&R.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}_.protocol=ce;class nt extends _{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),s=!1;_.priorWebsocketSuccess=!1;const i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",m=>{if(!s)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;_.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(f(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=t.name,this.emitReserved("upgradeError",w)}}))};function r(){s||(s=!0,f(),t.close(),t=null)}const o=m=>{const w=new Error("probe error: "+m);w.transport=t.name,r(),this.emitReserved("upgradeError",w)};function c(){o("transport closed")}function h(){o("socket closed")}function g(m){t&&m.name!==t.name&&r()}const f=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",g)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let it=class extends nt{constructor(e,t={}){const s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>Ge[i]).filter(i=>!!i)),super(e,s)}};function rt(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=U(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const r=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+r+":"+s.port+e,s.href=s.protocol+"://"+r+(t&&t.port===s.port?"":":"+s.port),s}const ot=typeof ArrayBuffer=="function",at=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,de=Object.prototype.toString,ct=typeof Blob=="function"||typeof Blob<"u"&&de.call(Blob)==="[object BlobConstructor]",ht=typeof File=="function"||typeof File<"u"&&de.call(File)==="[object FileConstructor]";function z(n){return ot&&(n instanceof ArrayBuffer||at(n))||ct&&n instanceof Blob||ht&&n instanceof File}function O(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(O(n[t]))return!0;return!1}if(z(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return O(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&O(n[t]))return!0;return!1}function ut(n){const e=[],t=n.data,s=n;return s.data=M(t,e),s.attachments=e.length,{packet:s,buffers:e}}function M(n,e){if(!n)return n;if(z(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let s=0;s<n.length;s++)t[s]=M(n[s],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=M(n[s],e));return t}return n}function ft(n,e){return n.data=$(n.data,e),delete n.attachments,n}function $(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=$(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=$(n[t],e));return n}const ye=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],lt=5;var a;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(a||(a={}));class pt{constructor(e){this.replacer=e}encode(e){return(e.type===a.EVENT||e.type===a.ACK)&&O(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=ut(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}}class X 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 s=t.type===a.BINARY_EVENT;s||t.type===a.BINARY_ACK?(t.type=s?a.EVENT:a.ACK,this.reconstructor=new dt(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(z(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 s={type:Number(e.charAt(0))};if(a[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===a.BINARY_EVENT||s.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");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(r,t)}else s.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}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(X.isPayloadValid(s.type,r))s.data=r;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return B(t);case a.DISCONNECT:return t===void 0;case a.CONNECT_ERROR:return typeof t=="string"||B(t);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&ye.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 dt{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=ft(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function yt(n){return typeof n=="string"}const gt=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};function mt(n){return n===void 0||gt(n)}function B(n){return Object.prototype.toString.call(n)==="[object Object]"}function _t(n,e){switch(n){case a.CONNECT:return e===void 0||B(e);case a.DISCONNECT:return e===void 0;case a.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&ye.indexOf(e[0])===-1);case a.ACK:return Array.isArray(e);case a.CONNECT_ERROR:return typeof e=="string"||B(e);default:return!1}}function bt(n){return yt(n.nsp)&&mt(n.id)&&_t(n.type,n.data)}const wt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:X,Encoder:pt,get PacketType(){return a},isPacketValid:bt,protocol:lt},Symbol.toStringTag,{value:"Module"}));function p(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const vt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ge extends u{constructor(e,t,s){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,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[p(e,"open",this.onopen.bind(this)),p(e,"packet",this.onpacket.bind(this)),p(e,"error",this.onerror.bind(this)),p(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 s,i,r;if(vt.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 f=this.ids++,m=t.pop();this._registerAckCallback(f,m),o.id=f}const c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.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 s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s: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((s,i)=>{const r=(o,c)=>o?i(o):s(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 s={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?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),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(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.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 s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);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 s of t)s.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 s=!1;return function(...i){s||(s=!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 s=0;s<t.length;s++)if(e===t[s])return t.splice(s,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 s=0;s<t.length;s++)if(e===t[s])return t.splice(s,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 s of t)s.apply(this,e.data)}}}function b(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}b.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};b.prototype.reset=function(){this.attempts=0};b.prototype.setMin=function(n){this.ms=n};b.prototype.setMax=function(n){this.max=n};b.prototype.setJitter=function(n){this.jitter=n};class H extends u{constructor(e,t){var s;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,N(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((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new b({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||wt;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 it(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=p(t,"open",function(){s.onopen(),e&&e()}),r=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=p(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(p(e,"ping",this.onping.bind(this)),p(e,"data",this.ondata.bind(this)),p(e,"error",this.onerror.bind(this)),p(e,"close",this.onclose.bind(this)),p(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){S(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new ge(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],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 s;this.cleanup(),(s=this.engine)===null||s===void 0||s.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 s=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&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const v={};function D(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=rt(n,e.path||"/socket.io"),s=t.source,i=t.id,r=t.path,o=v[i]&&r in v[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let h;return c?h=new H(s,e):(v[i]||(v[i]=new H(s,e)),h=v[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(D,{Manager:H,Socket:ge,io:D,connect:D});const ee="[claude-devtools]";function Ot(n){const e=window.location.hash.includes("debug=true"),t=n?`${ee} [${n}]`:ee;function s(i,...r){e&&(r.length>0?console.log(`${t} ${i}`,...r):console.log(`${t} ${i}`))}return{log:s}}function Ct(){const e=ke().public?.claudeDevtoolsBc?.tunnel;return{isActive:x(()=>!!e),origin:x(()=>e?.origin??null),host:x(()=>e?.host??null),config:e??null}}export{se as _,Ot as a,At as b,Tt as c,D as l,Ct as u};
@@ -0,0 +1,8 @@
1
+ import{_ as W}from"./bl5iU4Kz.js";import{u as Y,a as J,l as Q,b as X,c as Z,_ as ee}from"./BiBLVxWh.js";import{_ as te}from"./DBIw6BGF.js";import{_ as ne}from"./CLKqRoht.js";import{_ as le}from"./CSlPuO5s.js";import{g as oe,r as p,j as se,k as ae,c as r,a as t,b as o,w as d,d as a,l as x,F as _,p as ie,m as H,E as L,x as F,t as b,s as M,o as i,n as I,y as ue}from"./nKfsBgPE.js";const re={class:"relative flex flex-col h-screen n-bg-base"},de={class:"flex items-center justify-between p-4"},ce={class:"flex items-center gap-3"},me={class:"text-xl font-bold flex items-center gap-2"},ve={class:"flex items-center gap-2"},pe={class:"flex-1 overflow-auto p-4"},fe={class:"flex gap-4 h-full"},be={class:"w-64 flex-shrink-0 space-y-4"},ge={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},ke={class:"space-y-1"},xe=["onClick"],_e={class:"flex items-center justify-between"},we={class:"flex items-center gap-2 truncate"},ye={class:"font-medium"},Ce={key:0,class:"text-xs opacity-50 pl-6 truncate"},Se={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},Ve={class:"flex-1 overflow-auto"},He={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},Ne={key:0,class:"mb-4"},Ue={class:"space-y-4"},De={class:"p-4"},Me={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2 flex-shrink-0"},Ae={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},Be={class:"font-bold flex items-center gap-2"},Ee={key:0,class:"text-sm opacity-70"},$e={class:"flex gap-2"},Le={key:0,class:"px-4 pt-4"},Fe={class:"flex-1 p-4 overflow-auto"},Ie={class:"space-y-4 mb-4"},Te={class:"flex flex-wrap gap-2 mb-4"},je={class:"text-xs opacity-50 mb-4"},qe={key:2,class:"flex-1 flex items-center justify-center opacity-50"},he={class:"text-center"},Ye=oe({__name:"skills",setup(ze){const N=Y(),{log:C}=J("skills"),u=p(null),S=p(!1),w=p(!1),U=p([]),n=p(null),g=p(!1),V=p(!1),c=p({name:"",description:"",content:"",argumentHint:"",model:""}),m=p({name:"",description:"",content:"",argumentHint:"",model:""}),v=p("");function T(){return N.isActive.value&&N.origin.value?N.origin.value:window.location.origin}function j(){const s=T();C("Connecting to socket at",s),u.value=Q(s,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),u.value.on("connect",()=>{C("Connected"),S.value=!0,A()}),u.value.on("disconnect",()=>{C("Disconnected"),S.value=!1}),u.value.on("skills:list",e=>{C("Skills list received",e),U.value=e,w.value=!1}),u.value.on("skills:saved",e=>{e.success&&e.skill?(n.value=e.skill,g.value=!1,V.value=!1,B(),v.value=""):v.value=e.error||"Failed to save skill"}),u.value.on("skills:deleted",e=>{e.success&&n.value?.name===e.name&&(n.value=null)})}function A(){u.value&&(w.value=!0,u.value.emit("skills:list"))}function B(){c.value={name:"",description:"",content:"",argumentHint:"",model:""},v.value=""}function q(s){n.value=s,m.value={name:s.name,description:s.description,content:s.content,argumentHint:s.argumentHint||"",model:s.model||""},g.value=!1}function h(){n.value&&(m.value={name:n.value.name,description:n.value.description,content:n.value.content,argumentHint:n.value.argumentHint||"",model:n.value.model||""},g.value=!0)}function E(){const s=g.value?m.value:c.value;if(!s.name){v.value="Name is required";return}if(!s.description){v.value="Description is required";return}if(!s.content){v.value="Content is required";return}u.value&&u.value.emit("skills:save",{name:s.name,description:s.description,content:s.content,argumentHint:s.argumentHint||void 0,model:s.model||void 0})}function z(){n.value&&(m.value={name:n.value.name,description:n.value.description,content:n.value.content,argumentHint:n.value.argumentHint||"",model:n.value.model||""}),g.value=!1,v.value=""}function O(s){return new Date(s).toLocaleDateString()}function G(s){confirm(`Delete skill "${s}"?`)&&u.value&&u.value.emit("skills:delete",s)}return se(()=>{j()}),ae(()=>{u.value&&u.value.disconnect()}),(s,e)=>{const K=W,f=ee,k=X,D=Z,y=te,$=ne,P=le;return i(),r("div",re,[t("div",de,[t("div",ce,[o(K,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:d(()=>[...e[11]||(e[11]=[a(" ← Chat ",-1)])]),_:1}),t("h1",me,[o(f,{class:"text-orange",icon:"carbon:lightning"}),e[12]||(e[12]=a(" Skills ",-1))])]),t("div",ve,[o(k,{disabled:!S.value,n:"orange",onClick:e[0]||(e[0]=l=>{V.value=!0,n.value=null})},{default:d(()=>[o(f,{class:"mr-1",icon:"carbon:add"}),e[13]||(e[13]=a(" New Skill ",-1))]),_:1},8,["disabled"]),o(k,{disabled:!S.value||w.value,n:"gray",onClick:A},{default:d(()=>[o(f,{class:I([{"animate-spin":w.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[14]||(e[14]=a(" Refresh ",-1))]),_:1},8,["disabled"])])]),t("div",pe,[t("div",fe,[t("div",be,[o(D,{class:"text-xs",icon:"carbon:information",n:"orange"},{default:d(()=>[...e[15]||(e[15]=[a(" Skills extend Claude's capabilities with custom knowledge. ",-1),t("br",null,null,-1),a(" Stored as ",-1),t("code",{class:"font-mono"},".claude/skills/<name>/SKILL.md",-1)])]),_:1}),U.value.length===0&&!w.value?(i(),r("div",ge,[...e[16]||(e[16]=[a(" No skills configured yet. ",-1),t("br",null,null,-1),a(" Create one to get started. ",-1)])])):x("",!0),t("div",ke,[(i(!0),r(_,null,ie(U.value,l=>(i(),r("div",{key:l.name,class:I([n.value?.name===l.name?"n-bg-active ring-1 ring-orange-500":"hover:n-bg-active","rounded-lg p-2 cursor-pointer group"]),onClick:R=>q(l)},[t("div",_e,[t("div",we,[o(f,{class:"opacity-50 text-orange-500",icon:"carbon:lightning"}),t("span",ye,b(l.name),1)]),o(k,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:ue(R=>G(l.name),["stop"])},{default:d(()=>[o(f,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),l.description?(i(),r("div",Ce,b(l.description),1)):x("",!0)],10,xe))),128))])]),t("div",Se,[V.value?(i(),r(_,{key:0},[t("div",Ve,[t("div",He,[e[23]||(e[23]=t("h3",{class:"font-bold mb-4"}," Create New Skill ",-1)),v.value?(i(),r("div",Ne,[o(D,{icon:"carbon:warning",n:"red"},{default:d(()=>[a(b(v.value),1)]),_:1})])):x("",!0),t("div",Ue,[t("div",null,[e[17]||(e[17]=t("label",{class:"block text-sm font-medium mb-1"},"Name",-1)),o(y,{modelValue:c.value.name,"onUpdate:modelValue":e[1]||(e[1]=l=>c.value.name=l),class:"w-full font-mono",placeholder:"e.g. vue-expert, code-reviewer"},null,8,["modelValue"])]),t("div",null,[e[18]||(e[18]=t("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),o(y,{modelValue:c.value.description,"onUpdate:modelValue":e[2]||(e[2]=l=>c.value.description=l),class:"w-full",placeholder:"Brief description of what this skill does"},null,8,["modelValue"])]),t("div",null,[e[19]||(e[19]=t("label",{class:"block text-sm font-medium mb-1"},"Argument Hint (optional)",-1)),o(y,{modelValue:c.value.argumentHint,"onUpdate:modelValue":e[3]||(e[3]=l=>c.value.argumentHint=l),class:"w-full",placeholder:"e.g. <query>"},null,8,["modelValue"]),e[20]||(e[20]=t("div",{class:"text-xs opacity-50 mt-1"}," Hint for argument when using /skillname ",-1))]),t("div",null,[e[22]||(e[22]=t("label",{class:"block text-sm font-medium mb-1"},"Model (optional)",-1)),H(t("select",{"onUpdate:modelValue":e[4]||(e[4]=l=>c.value.model=l),class:"w-full p-2 n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800"},[...e[21]||(e[21]=[t("option",{value:""}," Inherit (default) ",-1),t("option",{value:"sonnet"}," Sonnet ",-1),t("option",{value:"opus"}," Opus ",-1),t("option",{value:"haiku"}," Haiku ",-1)])],512),[[L,c.value.model]])])])]),t("div",De,[e[24]||(e[24]=t("label",{class:"block text-sm font-medium mb-1"},"Content (Markdown)",-1)),H(t("textarea",{"onUpdate:modelValue":e[5]||(e[5]=l=>c.value.content=l),class:"w-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-y",placeholder:`Write the skill instructions in markdown...
2
+
3
+ Example:
4
+ You are an expert in Vue 3 Composition API.
5
+
6
+ ## Guidelines
7
+ - Always use <script setup>
8
+ - Follow TypeScript best practices`},null,512),[[F,c.value.content]])])]),t("div",Me,[o(k,{n:"orange",onClick:E},{default:d(()=>[...e[25]||(e[25]=[a(" Create Skill ",-1)])]),_:1}),o(k,{n:"gray",onClick:e[6]||(e[6]=l=>{V.value=!1,B()})},{default:d(()=>[...e[26]||(e[26]=[a(" Cancel ",-1)])]),_:1})])],64)):n.value?(i(),r(_,{key:1},[t("div",Ae,[t("div",null,[t("h3",Be,[o(f,{class:"text-orange-500",icon:"carbon:lightning"}),a(" "+b(n.value.name),1)]),n.value.description?(i(),r("div",Ee,b(n.value.description),1)):x("",!0)]),t("div",$e,[g.value?(i(),r(_,{key:0},[o(k,{n:"green",onClick:E},{default:d(()=>[o(f,{class:"mr-1",icon:"carbon:save"}),e[27]||(e[27]=a(" Save ",-1))]),_:1}),o(k,{n:"gray",onClick:z},{default:d(()=>[...e[28]||(e[28]=[a(" Cancel ",-1)])]),_:1})],64)):(i(),M(k,{key:1,n:"blue",onClick:h},{default:d(()=>[o(f,{class:"mr-1",icon:"carbon:edit"}),e[29]||(e[29]=a(" Edit ",-1))]),_:1}))])]),v.value&&g.value?(i(),r("div",Le,[o(D,{icon:"carbon:warning",n:"red"},{default:d(()=>[a(b(v.value),1)]),_:1})])):x("",!0),t("div",Fe,[g.value?(i(),r(_,{key:0},[t("div",Ie,[t("div",null,[e[30]||(e[30]=t("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),o(y,{modelValue:m.value.description,"onUpdate:modelValue":e[7]||(e[7]=l=>m.value.description=l),class:"w-full",placeholder:"Brief description"},null,8,["modelValue"])]),t("div",null,[e[31]||(e[31]=t("label",{class:"block text-sm font-medium mb-1"},"Argument Hint",-1)),o(y,{modelValue:m.value.argumentHint,"onUpdate:modelValue":e[8]||(e[8]=l=>m.value.argumentHint=l),class:"w-full",placeholder:"e.g. <query>"},null,8,["modelValue"])]),t("div",null,[e[33]||(e[33]=t("label",{class:"block text-sm font-medium mb-1"},"Model",-1)),H(t("select",{"onUpdate:modelValue":e[9]||(e[9]=l=>m.value.model=l),class:"w-full p-2 n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800"},[...e[32]||(e[32]=[t("option",{value:""}," Inherit (default) ",-1),t("option",{value:"sonnet"}," Sonnet ",-1),t("option",{value:"opus"}," Opus ",-1),t("option",{value:"haiku"}," Haiku ",-1)])],512),[[L,m.value.model]])])]),e[34]||(e[34]=t("label",{class:"block text-sm font-medium mb-1"},"Content (Markdown)",-1)),H(t("textarea",{"onUpdate:modelValue":e[10]||(e[10]=l=>m.value.content=l),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512),[[F,m.value.content]])],64)):(i(),r(_,{key:1},[t("div",Te,[n.value.model?(i(),M($,{key:0,n:"blue"},{default:d(()=>[a(" Model: "+b(n.value.model),1)]),_:1})):x("",!0),n.value.argumentHint?(i(),M($,{key:1,n:"gray"},{default:d(()=>[a(" Arg: "+b(n.value.argumentHint),1)]),_:1})):x("",!0)]),t("div",je," Updated: "+b(O(n.value.updatedAt)),1),o(P,{content:n.value.content,class:"max-w-none"},null,8,["content"])],64))])],64)):(i(),r("div",qe,[t("div",he,[o(f,{class:"text-4xl mb-2",icon:"carbon:lightning"}),e[35]||(e[35]=t("p",null,"Select a skill or create a new one",-1))])]))])])])])}}});export{Ye as default};
@@ -0,0 +1,7 @@
1
+ import{_ as J}from"./bl5iU4Kz.js";import{u as K,a as O,l as Q,b as X,c as Z,_ as ee}from"./BiBLVxWh.js";import{_ as oe}from"./DBIw6BGF.js";import{_ as le}from"./CLKqRoht.js";import{_ as ne}from"./CSlPuO5s.js";import{g as te,r as f,j as se,k as ae,c as i,a as o,b as t,w as u,d,l as w,F as g,p as j,t as p,m as $,x as A,s as L,o as a,n as F,y as ie}from"./nKfsBgPE.js";const de={class:"relative flex flex-col h-screen n-bg-base"},re={class:"flex items-center justify-between p-4"},ue={class:"flex items-center gap-3"},me={class:"text-xl font-bold flex items-center gap-2"},ce={class:"flex items-center gap-2"},ve={class:"flex-1 overflow-auto p-4"},fe={class:"flex gap-4 h-full"},pe={class:"w-64 flex-shrink-0 space-y-4"},be={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},xe={class:"space-y-1"},_e=["onClick"],ge={class:"flex items-center justify-between"},we={class:"flex items-center gap-2 truncate"},ke={class:"font-mono"},ye={key:0,class:"text-xs opacity-50 pl-6 truncate"},Ce={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},Te={class:"flex-1 overflow-auto"},Ve={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},he={key:0,class:"mb-4"},Ne={class:"space-y-4"},Be={class:"text-xs opacity-50 mt-1"},Se={class:"p-4"},Ue={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2 flex-shrink-0"},De={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},Ee={class:"font-bold font-mono"},je={key:0,class:"text-sm opacity-70"},$e={class:"text-xs opacity-50 mt-1"},Ae={class:"flex gap-2"},Le={key:0,class:"px-4 pt-4"},Fe={class:"flex-1 p-4 overflow-auto"},Me={class:"space-y-4 mb-4"},Pe={key:0,class:"mb-4"},Re={class:"flex flex-wrap gap-1"},qe={key:2,class:"flex-1 flex items-center justify-center opacity-50"},ze={class:"text-center"},Oe=te({__name:"commands",setup(Ie){const N=K(),{log:T}=O("commands"),r=f(null),V=f(!1),k=f(!1),B=f([]),n=f(null),b=f(!1),h=f(!1),m=f({name:"",description:"",content:"",allowedTools:""}),c=f({name:"",description:"",content:"",allowedTools:""}),v=f("");function M(){return N.isActive.value&&N.origin.value?N.origin.value:window.location.origin}function P(){const s=M();T("Connecting to socket at",s),r.value=Q(s,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),r.value.on("connect",()=>{T("Connected"),V.value=!0,U()}),r.value.on("disconnect",()=>{T("Disconnected"),V.value=!1}),r.value.on("commands:list",e=>{T("Commands list received",e),B.value=e,k.value=!1}),r.value.on("commands:saved",e=>{e.success&&e.command?(n.value=e.command,b.value=!1,h.value=!1,D(),v.value=""):v.value=e.error||"Failed to save command"}),r.value.on("commands:deleted",e=>{e.success&&n.value?.name===e.name&&(n.value=null)})}function U(){r.value&&(k.value=!0,r.value.emit("commands:list"))}function D(){m.value={name:"",description:"",content:"",allowedTools:""},v.value=""}function R(s){n.value=s,c.value={name:s.name,description:s.description||"",content:s.content,allowedTools:s.allowedTools?.join(", ")||""},b.value=!1}function q(){n.value&&(c.value={name:n.value.name,description:n.value.description||"",content:n.value.content,allowedTools:n.value.allowedTools?.join(", ")||""},b.value=!0)}function E(){const s=b.value?c.value:m.value;if(!s.name){v.value="Name is required";return}if(!s.content){v.value="Content is required";return}if(r.value){const e=s.allowedTools.split(",").map(y=>y.trim()).filter(y=>y.length>0);r.value.emit("commands:save",{name:s.name,content:s.content,description:s.description||void 0,allowedTools:e.length>0?e:void 0})}}function z(){n.value&&(c.value={name:n.value.name,description:n.value.description||"",content:n.value.content,allowedTools:n.value.allowedTools?.join(", ")||""}),b.value=!1,v.value=""}function I(s){confirm(`Delete command "/${s}"?`)&&r.value&&r.value.emit("commands:delete",s)}function W(s){return new Date(s).toLocaleDateString()}return se(()=>{P()}),ae(()=>{r.value&&r.value.disconnect()}),(s,e)=>{const y=J,x=ee,_=X,S=Z,C=oe,Y=le,G=ne;return a(),i("div",de,[o("div",re,[o("div",ue,[t(y,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:u(()=>[...e[9]||(e[9]=[d(" ← Chat ",-1)])]),_:1}),o("h1",me,[t(x,{class:"text-green",icon:"carbon:terminal"}),e[10]||(e[10]=d(" Slash Commands ",-1))])]),o("div",ce,[t(_,{disabled:!V.value,n:"green",onClick:e[0]||(e[0]=l=>{h.value=!0,n.value=null})},{default:u(()=>[t(x,{class:"mr-1",icon:"carbon:add"}),e[11]||(e[11]=d(" New Command ",-1))]),_:1},8,["disabled"]),t(_,{disabled:!V.value||k.value,n:"gray",onClick:U},{default:u(()=>[t(x,{class:F([{"animate-spin":k.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[12]||(e[12]=d(" Refresh ",-1))]),_:1},8,["disabled"])])]),o("div",ve,[o("div",fe,[o("div",pe,[t(S,{class:"text-xs",icon:"carbon:information",n:"green"},{default:u(()=>[...e[13]||(e[13]=[d(" Slash commands are markdown files with YAML frontmatter. ",-1),o("br",null,null,-1),d(" Stored as ",-1),o("code",{class:"font-mono"},".claude/commands/<name>.md",-1)])]),_:1}),B.value.length===0&&!k.value?(a(),i("div",be,[...e[14]||(e[14]=[d(" No slash commands yet. ",-1),o("br",null,null,-1),d(" Create one to get started. ",-1)])])):w("",!0),o("div",xe,[(a(!0),i(g,null,j(B.value,l=>(a(),i("div",{key:l.name,class:F([n.value?.name===l.name?"n-bg-active ring-1 ring-green-500":"hover:n-bg-active","rounded-lg p-2 cursor-pointer group"]),onClick:H=>R(l)},[o("div",ge,[o("div",we,[t(x,{class:"opacity-50 text-green-500",icon:"carbon:terminal"}),o("span",ke,"/"+p(l.name),1)]),t(_,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:ie(H=>I(l.name),["stop"])},{default:u(()=>[t(x,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),l.description?(a(),i("div",ye,p(l.description),1)):w("",!0)],10,_e))),128))])]),o("div",Ce,[h.value?(a(),i(g,{key:0},[o("div",Te,[o("div",Ve,[e[19]||(e[19]=o("h3",{class:"font-bold mb-4"}," Create New Slash Command ",-1)),v.value?(a(),i("div",he,[t(S,{icon:"carbon:warning",n:"red"},{default:u(()=>[d(p(v.value),1)]),_:1})])):w("",!0),o("div",Ne,[o("div",null,[e[15]||(e[15]=o("label",{class:"block text-sm font-medium mb-1"},"Command Name",-1)),t(C,{modelValue:m.value.name,"onUpdate:modelValue":e[1]||(e[1]=l=>m.value.name=l),class:"w-full font-mono",placeholder:"e.g. review, deploy, test"},null,8,["modelValue"]),o("div",Be," Will be invoked as /"+p(m.value.name||"command-name"),1)]),o("div",null,[e[16]||(e[16]=o("label",{class:"block text-sm font-medium mb-1"},"Description (optional)",-1)),t(C,{modelValue:m.value.description,"onUpdate:modelValue":e[2]||(e[2]=l=>m.value.description=l),class:"w-full",placeholder:"Brief description of what this command does"},null,8,["modelValue"])]),o("div",null,[e[17]||(e[17]=o("label",{class:"block text-sm font-medium mb-1"},"Allowed Tools (optional)",-1)),t(C,{modelValue:m.value.allowedTools,"onUpdate:modelValue":e[3]||(e[3]=l=>m.value.allowedTools=l),class:"w-full font-mono",placeholder:"e.g. Bash(git:*), Read, Edit"},null,8,["modelValue"]),e[18]||(e[18]=o("div",{class:"text-xs opacity-50 mt-1"}," Comma-separated list of allowed tools ",-1))])])]),o("div",Se,[e[20]||(e[20]=o("label",{class:"block text-sm font-medium mb-1"},"Command Prompt",-1)),$(o("textarea",{"onUpdate:modelValue":e[4]||(e[4]=l=>m.value.content=l),class:"w-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-y",placeholder:`Write the prompt for this command...
2
+
3
+ Example:
4
+ Review the current code changes and provide feedback on:
5
+ 1. Code quality
6
+ 2. Potential bugs
7
+ 3. Performance issues`},null,512),[[A,m.value.content]])])]),o("div",Ue,[t(_,{n:"green",onClick:E},{default:u(()=>[...e[21]||(e[21]=[d(" Create Command ",-1)])]),_:1}),t(_,{n:"gray",onClick:e[5]||(e[5]=l=>{h.value=!1,D()})},{default:u(()=>[...e[22]||(e[22]=[d(" Cancel ",-1)])]),_:1})])],64)):n.value?(a(),i(g,{key:1},[o("div",De,[o("div",null,[o("h3",Ee," /"+p(n.value.name),1),n.value.description?(a(),i("div",je,p(n.value.description),1)):w("",!0),o("div",$e," Updated: "+p(W(n.value.updatedAt)),1)]),o("div",Ae,[b.value?(a(),i(g,{key:0},[t(_,{n:"green",onClick:E},{default:u(()=>[t(x,{class:"mr-1",icon:"carbon:save"}),e[23]||(e[23]=d(" Save ",-1))]),_:1}),t(_,{n:"gray",onClick:z},{default:u(()=>[...e[24]||(e[24]=[d(" Cancel ",-1)])]),_:1})],64)):(a(),L(_,{key:1,n:"blue",onClick:q},{default:u(()=>[t(x,{class:"mr-1",icon:"carbon:edit"}),e[25]||(e[25]=d(" Edit ",-1))]),_:1}))])]),v.value&&b.value?(a(),i("div",Le,[t(S,{icon:"carbon:warning",n:"red"},{default:u(()=>[d(p(v.value),1)]),_:1})])):w("",!0),o("div",Fe,[b.value?(a(),i(g,{key:0},[o("div",Me,[o("div",null,[e[26]||(e[26]=o("label",{class:"block text-sm font-medium mb-1"},"Description",-1)),t(C,{modelValue:c.value.description,"onUpdate:modelValue":e[6]||(e[6]=l=>c.value.description=l),class:"w-full",placeholder:"Brief description"},null,8,["modelValue"])]),o("div",null,[e[27]||(e[27]=o("label",{class:"block text-sm font-medium mb-1"},"Allowed Tools",-1)),t(C,{modelValue:c.value.allowedTools,"onUpdate:modelValue":e[7]||(e[7]=l=>c.value.allowedTools=l),class:"w-full font-mono",placeholder:"e.g. Bash(git:*), Read, Edit"},null,8,["modelValue"])])]),e[28]||(e[28]=o("label",{class:"block text-sm font-medium mb-1"},"Command Prompt",-1)),$(o("textarea",{"onUpdate:modelValue":e[8]||(e[8]=l=>c.value.content=l),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512),[[A,c.value.content]])],64)):(a(),i(g,{key:1},[n.value.allowedTools&&n.value.allowedTools.length>0?(a(),i("div",Pe,[e[29]||(e[29]=o("div",{class:"text-xs font-medium opacity-50 mb-1"}," Allowed Tools ",-1)),o("div",Re,[(a(!0),i(g,null,j(n.value.allowedTools,l=>(a(),L(Y,{key:l,class:"font-mono text-xs",n:"blue"},{default:u(()=>[d(p(l),1)]),_:2},1024))),128))])])):w("",!0),t(G,{content:n.value.content,class:"max-w-none"},null,8,["content"])],64))])],64)):(a(),i("div",qe,[o("div",ze,[t(x,{class:"text-4xl mb-2",icon:"carbon:terminal"}),e[30]||(e[30]=o("p",null,"Select a command or create a new one",-1))])]))])])])])}}});export{Oe as default};
@@ -1 +1 @@
1
- import{_ as n,c as s,o,H as t}from"./e7kgpy_n.js";const _={},c={class:"n-badge"};function a(e,r){return o(),s("span",c,[t(e.$slots,"default")])}const l=Object.assign(n(_,[["render",a]]),{__name:"NBadge"});export{l as _};
1
+ import{_ as n,c as s,o,H as t}from"./nKfsBgPE.js";const _={},c={class:"n-badge"};function a(e,r){return o(),s("span",c,[t(e.$slots,"default")])}const l=Object.assign(n(_,[["render",a]]),{__name:"NBadge"});export{l as _};
@@ -0,0 +1,12 @@
1
+ import{_ as me}from"./bl5iU4Kz.js";import{u as fe,a as pe,l as be,b as xe,_ as ge,c as ye}from"./BiBLVxWh.js";import{_ as ke}from"./CSlPuO5s.js";import{_ as _e}from"./DBIw6BGF.js";import{g as Ce,r as c,q as we,j as Le,k as De,c as i,a as t,b as l,w as d,d as o,n as V,T as Ue,o as n,l as x,t as p,s as G,F as _,m as H,x as J,p as K,y as he}from"./nKfsBgPE.js";const Ae={class:"relative flex flex-col h-screen n-bg-base"},Se={class:"flex items-center justify-between p-4"},Ee={class:"flex items-center gap-3"},Ve={class:"text-xl font-bold flex items-center gap-2"},Me={class:"flex items-center gap-2"},Ne={class:"px-4 flex gap-2 border-b border-neutral-200 dark:border-neutral-800"},je={class:"flex-1 overflow-auto p-4"},$e={key:0,class:"h-full flex flex-col"},Te={class:"flex items-center justify-between mb-4"},Fe={class:"text-lg font-semibold flex items-center gap-2"},Pe={key:0,class:"text-xs opacity-40 mt-1"},Re={class:"flex gap-2"},Be={key:0,class:"mb-4"},ze={class:"flex-1 n-bg-active rounded-lg overflow-hidden"},Ie={key:1,class:"h-full p-4 overflow-auto"},We={key:2,class:"h-full flex items-center justify-center opacity-50"},qe={class:"text-center"},Ye={key:1,class:"flex gap-4 h-full"},Ge={class:"w-64 flex-shrink-0 space-y-4"},He={key:0,class:"n-bg-active rounded-lg p-4 opacity-50 text-sm"},Je={key:0,class:"text-xs opacity-50 font-medium px-2 pt-2"},Ke=["onClick"],Oe={class:"flex items-center justify-between"},Qe={class:"flex items-center gap-2 truncate"},Xe={class:"truncate"},Ze={class:"text-xs opacity-40 pl-6"},et={class:"flex-1 flex flex-col n-bg-active rounded-lg overflow-hidden"},tt={class:"p-4 border-b border-neutral-200 dark:border-neutral-800"},lt={key:0,class:"mb-4"},ot={class:"space-y-4"},nt={class:"flex-1 p-4"},st={class:"p-4 border-t border-neutral-200 dark:border-neutral-800 flex gap-2"},at={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 flex items-center justify-between"},it={class:"font-bold"},ut={class:"text-xs opacity-50"},dt={class:"flex gap-2"},rt={class:"flex-1 p-4 overflow-auto"},ct={key:2,class:"flex-1 flex items-center justify-center opacity-50"},vt={class:"text-center"},mt={key:2,class:"space-y-4"},ft={key:0,class:"n-bg-active rounded-lg p-4"},pt={key:0,class:"mb-4"},bt={class:"space-y-4"},xt={class:"flex gap-2"},gt={key:1,class:"n-bg-active rounded-lg p-4 opacity-50"},yt={key:2,class:"space-y-2"},kt={class:"flex items-start justify-between"},_t={class:"flex-1"},Ct={class:"font-bold flex items-center gap-2"},wt={class:"text-sm opacity-70 font-mono mt-1"},Lt={key:0,class:"text-sm opacity-50 mt-1"},Dt={class:"text-xs opacity-40 mt-2"},Mt=Ce({__name:"docs",setup(Ut){const W=fe(),{log:C}=pe("docs"),a=c(null),w=c(!1),M=c(!1),q=c([]),v=c(null),y=c(!1),g=c(""),N=c(!1),L=c(""),j=c(""),Y=c([]),h=c(!1),A=c(""),$=c(""),T=c(""),S=c(""),F=c(!1),P=c(null),E=c(!1),k=c(""),m=c(""),b=c("claudemd"),X=we(()=>{const u={"":[]};for(const e of q.value){const B=e.path.split("/");if(B.length>1){const r=B.slice(0,-1).join("/");u[r]||(u[r]=[]),u[r].push(e)}else u[""].push(e)}return u});function Z(){return W.isActive.value&&W.origin.value?W.origin.value:window.location.origin}function ee(){const u=Z();C("Connecting to socket at",u),a.value=be(u,{path:"/__claude_devtools_socket",transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5}),a.value.on("connect",()=>{C("Connected"),w.value=!0,O()}),a.value.on("disconnect",()=>{C("Disconnected"),w.value=!1}),a.value.on("docs:list",e=>{C("Docs list received",e.length),q.value=e,M.value=!1}),a.value.on("docs:file",e=>{e&&(v.value=e,g.value=e.content)}),a.value.on("docs:saved",e=>{e.success&&e.file?(v.value=e.file,g.value=e.file.content,y.value=!1,N.value=!1,L.value="",j.value="",m.value=""):m.value=e.error||"Failed to save"}),a.value.on("docs:deleted",e=>{e.success&&v.value?.path===e.path&&(v.value=null,y.value=!1)}),a.value.on("llms:list",e=>{C("LLMS list received",e.length),Y.value=e}),a.value.on("llms:added",e=>{e.success?(h.value=!1,A.value="",$.value="",T.value="",m.value=""):m.value=e.error||"Failed to add"}),a.value.on("claudemd:data",e=>{C("CLAUDE.md data received",e.exists),S.value=e.content,F.value=e.exists,P.value=e.updatedAt,k.value=e.content}),a.value.on("claudemd:saved",e=>{e.success?(S.value=e.content||"",F.value=!0,P.value=e.updatedAt||null,k.value=e.content||"",E.value=!1,m.value=""):m.value=e.error||"Failed to save"})}function O(){a.value&&(M.value=!0,a.value.emit("docs:list"),a.value.emit("llms:list"),a.value.emit("claudemd:get"))}function te(){k.value=S.value,E.value=!0}function le(){a.value&&a.value.emit("claudemd:save",k.value)}function oe(){k.value=S.value,E.value=!1}function ne(u){v.value=u,g.value=u.content,y.value=!1}function se(){v.value&&(g.value=v.value.content,y.value=!0)}function ae(){a.value&&v.value&&a.value.emit("docs:save",{path:v.value.path,content:g.value})}function ie(){v.value&&(g.value=v.value.content),y.value=!1}function ue(){if(!L.value.trim()){m.value="Path is required";return}a.value&&a.value.emit("docs:save",{path:L.value.trim(),content:j.value||`# ${L.value.split("/").pop()?.replace(".md","")||"New Doc"}
2
+
3
+ `})}function de(u){confirm(`Delete "${u}"?`)&&a.value&&a.value.emit("docs:delete",u)}function re(){if(!A.value.trim()){m.value="URL is required";return}let u=A.value.trim();!u.startsWith("http://")&&!u.startsWith("https://")&&(u="https://"+u),a.value&&a.value.emit("llms:add",{url:u,title:$.value.trim()||void 0,description:T.value.trim()||void 0})}function ce(u){confirm(`Remove "${u}"?`)&&a.value&&a.value.emit("llms:remove",u)}function R(u){return new Date(u).toLocaleDateString()}return Le(()=>{ee()}),De(()=>{a.value&&a.value.disconnect()}),(u,e)=>{const B=me,r=ge,f=xe,D=ye,Q=ke,z=_e;return n(),i("div",Ae,[t("div",Se,[t("div",Ee,[l(B,{class:"text-sm opacity-50 hover:opacity-100",to:"/"},{default:d(()=>[...e[14]||(e[14]=[o(" ← Chat ",-1)])]),_:1}),t("h1",Ve,[l(r,{class:"text-purple",icon:"carbon:document"}),e[15]||(e[15]=o(" Docs & LLMS ",-1))])]),t("div",Me,[l(f,{disabled:!w.value||M.value,n:"gray",onClick:O},{default:d(()=>[l(r,{class:V([{"animate-spin":M.value},"mr-1"]),icon:"carbon:restart"},null,8,["class"]),e[16]||(e[16]=o(" Refresh ",-1))]),_:1},8,["disabled"])])]),t("div",Ne,[t("button",{class:V([b.value==="claudemd"?"border-b-2 border-green-500 text-green-500":"opacity-60","px-4 py-2 font-medium"]),onClick:e[0]||(e[0]=s=>b.value="claudemd")},[l(r,{class:"mr-1",icon:"carbon:document-tasks"}),e[17]||(e[17]=o(" CLAUDE.md ",-1))],2),t("button",{class:V([b.value==="docs"?"border-b-2 border-purple-500 text-purple-500":"opacity-60","px-4 py-2 font-medium"]),onClick:e[1]||(e[1]=s=>b.value="docs")},[l(r,{class:"mr-1",icon:"carbon:folder"}),e[18]||(e[18]=o(" .claude/docs ",-1))],2),t("button",{class:V([b.value==="llms"?"border-b-2 border-blue-500 text-blue-500":"opacity-60","px-4 py-2 font-medium"]),onClick:e[2]||(e[2]=s=>b.value="llms")},[l(r,{class:"mr-1",icon:"carbon:link"}),e[19]||(e[19]=o(" LLMS Sources ",-1))],2)]),t("div",je,[l(Ue,{appear:"",mode:"out-in",name:"page"},{default:d(()=>[b.value==="claudemd"?(n(),i("div",$e,[t("div",Te,[t("div",null,[t("h2",Fe,[l(r,{icon:"carbon:document-tasks"}),e[20]||(e[20]=o(" CLAUDE.md ",-1))]),e[21]||(e[21]=t("p",{class:"text-sm opacity-50"}," Project-level instructions for Claude. Located at project root. ",-1)),P.value?(n(),i("p",Pe," Updated: "+p(R(P.value)),1)):x("",!0)]),t("div",Re,[E.value?(n(),i(_,{key:0},[l(f,{n:"green",onClick:le},{default:d(()=>[l(r,{class:"mr-1",icon:"carbon:save"}),e[22]||(e[22]=o(" Save ",-1))]),_:1}),l(f,{n:"gray",onClick:oe},{default:d(()=>[...e[23]||(e[23]=[o(" Cancel ",-1)])]),_:1})],64)):(n(),G(f,{key:1,disabled:!w.value,n:"blue",onClick:te},{default:d(()=>[l(r,{class:"mr-1",icon:"carbon:edit"}),o(" "+p(F.value?"Edit":"Create"),1)]),_:1},8,["disabled"]))])]),m.value&&b.value==="claudemd"?(n(),i("div",Be,[l(D,{icon:"carbon:warning",n:"red"},{default:d(()=>[o(p(m.value),1)]),_:1})])):x("",!0),t("div",ze,[E.value?H((n(),i("textarea",{key:0,"onUpdate:modelValue":e[3]||(e[3]=s=>k.value=s),class:"w-full h-full p-4 font-mono text-sm n-bg-base resize-none focus:outline-none",placeholder:`# CLAUDE.md
4
+
5
+ Write project-level instructions for Claude here...
6
+
7
+ Example:
8
+ - This is a Vue 3 + Nuxt project
9
+ - Use TypeScript
10
+ - Follow existing code style`},null,512)),[[J,k.value]]):F.value?(n(),i("div",Ie,[l(Q,{content:S.value,class:"max-w-none"},null,8,["content"])])):(n(),i("div",We,[t("div",qe,[l(r,{class:"text-4xl mb-2",icon:"carbon:document-add"}),e[24]||(e[24]=t("p",null,"No CLAUDE.md file yet",-1)),e[25]||(e[25]=t("p",{class:"text-sm"},' Click "Create" to add project instructions ',-1))])]))]),l(D,{class:"mt-4",icon:"carbon:information",n:"gray"},{default:d(()=>[...e[26]||(e[26]=[o(" CLAUDE.md contains project-level instructions that Claude reads automatically. Use it to define coding standards, project structure, and preferences. ",-1)])]),_:1})])):b.value==="docs"?(n(),i("div",Ye,[t("div",Ge,[l(f,{disabled:!w.value,class:"w-full",n:"purple",onClick:e[4]||(e[4]=s=>{N.value=!0,v.value=null})},{default:d(()=>[l(r,{class:"mr-1",icon:"carbon:add"}),e[27]||(e[27]=o(" New Doc ",-1))]),_:1},8,["disabled"]),l(D,{class:"text-xs",icon:"carbon:information",n:"gray"},{default:d(()=>[...e[28]||(e[28]=[o(" Files are stored in ",-1),t("code",{class:"font-mono"},".claude/docs/",-1),t("br",null,null,-1),o(" Use ",-1),t("code",{class:"font-mono text-blue-500"},"@docs/filename",-1),o(" in chat to attach. ",-1)])]),_:1}),q.value.length===0?(n(),i("div",He,[...e[29]||(e[29]=[o(" No doc files yet. ",-1),t("br",null,null,-1),o(" Create one to get started. ",-1)])])):x("",!0),(n(!0),i(_,null,K(X.value,(s,I)=>(n(),i("div",{key:I,class:"space-y-1"},[I?(n(),i("div",Je,p(I)+"/ ",1)):x("",!0),(n(!0),i(_,null,K(s,U=>(n(),i("div",{key:U.path,class:V([v.value?.path===U.path?"n-bg-active ring-1 ring-purple-500":"hover:n-bg-active","rounded-lg p-2 cursor-pointer group"]),onClick:ve=>ne(U)},[t("div",Oe,[t("div",Qe,[l(r,{class:"opacity-50",icon:"carbon:document"}),t("span",Xe,p(U.name),1)]),l(f,{class:"opacity-0 group-hover:opacity-100",n:"red xs",onClick:he(ve=>de(U.path),["stop"])},{default:d(()=>[l(r,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])]),t("div",Ze,p(R(U.updatedAt)),1)],10,Ke))),128))]))),128))]),t("div",et,[N.value?(n(),i(_,{key:0},[t("div",tt,[e[32]||(e[32]=t("h3",{class:"font-bold mb-4"}," Create New Doc ",-1)),m.value?(n(),i("div",lt,[l(D,{icon:"carbon:warning",n:"red"},{default:d(()=>[o(p(m.value),1)]),_:1})])):x("",!0),t("div",ot,[t("div",null,[e[30]||(e[30]=t("label",{class:"block text-sm font-medium mb-1"},"Path",-1)),l(z,{modelValue:L.value,"onUpdate:modelValue":e[5]||(e[5]=s=>L.value=s),class:"w-full font-mono",placeholder:"e.g. api/endpoints.md or readme.md"},null,8,["modelValue"]),e[31]||(e[31]=t("div",{class:"text-xs opacity-50 mt-1"}," Use / for subdirectories. .md extension added automatically. ",-1))])])]),t("div",nt,[e[33]||(e[33]=t("label",{class:"block text-sm font-medium mb-1"},"Content (optional)",-1)),H(t("textarea",{"onUpdate:modelValue":e[6]||(e[6]=s=>j.value=s),class:"w-full h-full min-h-[200px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none",placeholder:`# Your doc title
11
+
12
+ Write your documentation here...`},null,512),[[J,j.value]])]),t("div",st,[l(f,{n:"purple",onClick:ue},{default:d(()=>[...e[34]||(e[34]=[o(" Create ",-1)])]),_:1}),l(f,{n:"gray",onClick:e[7]||(e[7]=s=>{N.value=!1,m.value=""})},{default:d(()=>[...e[35]||(e[35]=[o(" Cancel ",-1)])]),_:1})])],64)):v.value?(n(),i(_,{key:1},[t("div",at,[t("div",null,[t("h3",it,p(v.value.path),1),t("div",ut," Updated: "+p(R(v.value.updatedAt)),1)]),t("div",dt,[y.value?(n(),i(_,{key:0},[l(f,{n:"green",onClick:ae},{default:d(()=>[l(r,{class:"mr-1",icon:"carbon:save"}),e[36]||(e[36]=o(" Save ",-1))]),_:1}),l(f,{n:"gray",onClick:ie},{default:d(()=>[...e[37]||(e[37]=[o(" Cancel ",-1)])]),_:1})],64)):(n(),G(f,{key:1,n:"blue",onClick:se},{default:d(()=>[l(r,{class:"mr-1",icon:"carbon:edit"}),e[38]||(e[38]=o(" Edit ",-1))]),_:1}))])]),t("div",rt,[y.value?H((n(),i("textarea",{key:0,"onUpdate:modelValue":e[8]||(e[8]=s=>g.value=s),class:"w-full h-full min-h-[300px] p-3 font-mono text-sm n-bg-base rounded-lg border border-neutral-200 dark:border-neutral-800 resize-none"},null,512)),[[J,g.value]]):(n(),G(Q,{key:1,content:v.value.content,class:"max-w-none"},null,8,["content"]))])],64)):(n(),i("div",ct,[t("div",vt,[l(r,{class:"text-4xl mb-2",icon:"carbon:document"}),e[39]||(e[39]=t("p",null,"Select a doc file or create a new one",-1))])]))])])):b.value==="llms"?(n(),i("div",mt,[l(f,{disabled:!w.value,n:"blue",onClick:e[9]||(e[9]=s=>h.value=!0)},{default:d(()=>[l(r,{class:"mr-1",icon:"carbon:add"}),e[40]||(e[40]=o(" Add LLMS Source ",-1))]),_:1},8,["disabled"]),h.value?(n(),i("div",ft,[e[47]||(e[47]=t("h3",{class:"font-bold mb-4"}," Add LLMS Source ",-1)),m.value?(n(),i("div",pt,[l(D,{icon:"carbon:warning",n:"red"},{default:d(()=>[o(p(m.value),1)]),_:1})])):x("",!0),t("div",bt,[t("div",null,[e[41]||(e[41]=t("label",{class:"block text-sm font-medium mb-1"},"URL",-1)),l(z,{modelValue:A.value,"onUpdate:modelValue":e[10]||(e[10]=s=>A.value=s),class:"w-full font-mono",placeholder:"e.g. https://example.com/llms.txt"},null,8,["modelValue"]),e[42]||(e[42]=t("div",{class:"text-xs opacity-50 mt-1"}," URL to the llms.txt file ",-1))]),t("div",null,[e[43]||(e[43]=t("label",{class:"block text-sm font-medium mb-1"},"Title (optional)",-1)),l(z,{modelValue:$.value,"onUpdate:modelValue":e[11]||(e[11]=s=>$.value=s),class:"w-full",placeholder:"e.g. Example Documentation"},null,8,["modelValue"])]),t("div",null,[e[44]||(e[44]=t("label",{class:"block text-sm font-medium mb-1"},"Description (optional)",-1)),l(z,{modelValue:T.value,"onUpdate:modelValue":e[12]||(e[12]=s=>T.value=s),class:"w-full",placeholder:"e.g. API documentation and guides"},null,8,["modelValue"])]),t("div",xt,[l(f,{n:"blue",onClick:re},{default:d(()=>[...e[45]||(e[45]=[o(" Add ",-1)])]),_:1}),l(f,{n:"gray",onClick:e[13]||(e[13]=s=>{h.value=!1,m.value=""})},{default:d(()=>[...e[46]||(e[46]=[o(" Cancel ",-1)])]),_:1})])])])):x("",!0),Y.value.length===0&&!h.value?(n(),i("div",gt,[...e[48]||(e[48]=[o(" No LLMS sources configured. ",-1),t("br",null,null,-1),o(" Add external llms.txt URLs to provide context to Claude. ",-1)])])):(n(),i("div",yt,[(n(!0),i(_,null,K(Y.value,s=>(n(),i("div",{key:s.url,class:"n-bg-active rounded-lg p-4"},[t("div",kt,[t("div",_t,[t("div",Ct,[l(r,{class:"text-blue",icon:"carbon:link"}),o(" "+p(s.title||s.domain),1)]),t("div",wt,p(s.url),1),s.description?(n(),i("div",Lt,p(s.description),1)):x("",!0),t("div",Dt," Added: "+p(R(s.addedAt)),1)]),l(f,{n:"red",onClick:I=>ce(s.url)},{default:d(()=>[l(r,{icon:"carbon:trash-can"})]),_:1},8,["onClick"])])]))),128))])),l(D,{icon:"carbon:information",n:"blue"},{default:d(()=>[...e[49]||(e[49]=[o(" LLMS sources are external llms.txt files that provide documentation context. Claude can use these to better understand APIs and libraries you're working with. ",-1)])]),_:1})])):x("",!0)]),_:1})])])}}});export{Mt as default};
@@ -1,4 +1,4 @@
1
- import{g as de,q as xe,c as be,o as we}from"./e7kgpy_n.js";function D(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=D();function se(n){R=n}var _={exec:()=>null};function p(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(x.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var me=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),x={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},ye=/^(?:[ \t]*(?:\n|$))+/,$e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Se=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,O=/(?:[*+-]|\d{1,9}[.)])/,le=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ie=p(le).replace(/bull/g,O).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Te=p(le).replace(/bull/g,O).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),H=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ze=/^[^\n]+/,j=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ae=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",j).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_e=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,O).getRegex(),B="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",N=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pe=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",N).replace("tag",B).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=p(H).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),Ie=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),G={blockquote:Ie,code:$e,def:Ae,fences:Re,heading:Se,hr:P,html:Pe,lheading:ie,list:_e,newline:ye,paragraph:ae,table:_,text:ze},V=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),Ce={...G,lheading:Te,table:V,paragraph:p(H).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",V).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex()},Le={...G,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",N).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(H).replace("hr",P).replace("heading",` *#{1,6} *[^
1
+ import{g as de,q as xe,c as be,o as we}from"./nKfsBgPE.js";function D(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=D();function se(n){R=n}var _={exec:()=>null};function p(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(x.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var me=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),x={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},ye=/^(?:[ \t]*(?:\n|$))+/,$e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,P=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Se=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,O=/(?:[*+-]|\d{1,9}[.)])/,le=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ie=p(le).replace(/bull/g,O).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Te=p(le).replace(/bull/g,O).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),H=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ze=/^[^\n]+/,j=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ae=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",j).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_e=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,O).getRegex(),B="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",N=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pe=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",N).replace("tag",B).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=p(H).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),Ie=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),G={blockquote:Ie,code:$e,def:Ae,fences:Re,heading:Se,hr:P,html:Pe,lheading:ie,list:_e,newline:ye,paragraph:ae,table:_,text:ze},V=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),Ce={...G,lheading:Te,table:V,paragraph:p(H).replace("hr",P).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",V).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex()},Le={...G,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",N).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(H).replace("hr",P).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",ie).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Be=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,oe=/^( {2,}|\\)\n(?!\s*$)/,Ee=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,E=/[\p{P}\p{S}]/u,X=/[\s\p{P}\p{S}]/u,ce=/[^\s\p{P}\p{S}]/u,qe=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,X).getRegex(),he=/(?!~)[\p{P}\p{S}]/u,Ze=/(?!~)[\s\p{P}\p{S}]/u,Me=/(?:[^\s\p{P}\p{S}]|~)/u,Qe=p(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",me?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,De=p(pe,"u").replace(/punct/g,E).getRegex(),Oe=p(pe,"u").replace(/punct/g,he).getRegex(),ue="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",He=p(ue,"gu").replace(/notPunctSpace/g,ce).replace(/punctSpace/g,X).replace(/punct/g,E).getRegex(),je=p(ue,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,Ze).replace(/punct/g,he).getRegex(),Ne=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ce).replace(/punctSpace/g,X).replace(/punct/g,E).getRegex(),Ge=p(/\\(punct)/,"gu").replace(/punct/g,E).getRegex(),Xe=p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Fe=p(N).replace("(?:-->|$)","-->").getRegex(),We=p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Fe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),C=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ue=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",C).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ge=p(/^!?\[(label)\]\[(ref)\]/).replace("label",C).replace("ref",j).getRegex(),ke=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",j).getRegex(),Je=p("reflink|nolink(?!\\()","g").replace("reflink",ge).replace("nolink",ke).getRegex(),Y=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,F={_backpedal:_,anyPunctuation:Ge,autolink:Xe,blockSkip:Qe,br:oe,code:Be,del:_,emStrongLDelim:De,emStrongRDelimAst:He,emStrongRDelimUnd:Ne,escape:ve,link:Ue,nolink:ke,punctuation:qe,reflink:ge,reflinkSearch:Je,tag:We,text:Ee,url:_},Ke={...F,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",C).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",C).getRegex()},Z={...F,emStrongRDelimAst:je,emStrongLDelim:Oe,url:p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Y).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Y).getRegex()},Ve={...Z,br:p(oe).replace("{2,}","*").getRegex(),text:p(Z.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I={normal:G,gfm:Ce,pedantic:Le},T={normal:F,gfm:Z,breaks:Ve,pedantic:Ke},Ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ee=n=>Ye[n];function y(n,e){if(e){if(x.escapeTest.test(n))return n.replace(x.escapeReplace,ee)}else if(x.escapeTestNoEncode.test(n))return n.replace(x.escapeReplaceNoEncode,ee);return n}function te(n){try{n=encodeURI(n).replace(x.percentDecode,"%")}catch{return null}return n}function re(n,e){let r=n.replace(x.findPipe,(i,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),s=r.split(x.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(x.slashPipe,"|");return s}function z(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s&&n.charAt(s-t-1)===e;)t++;return n.slice(0,s-t)}function et(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function ne(n,e,r,s,t){let i=e.href,l=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}function tt(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
3
3
  `).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[o]=l;return o.length>=t.length?i.slice(t.length):i}).join(`
4
4
  `)}var L=class{options;rules;lexer;constructor(n){this.options=n||R}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:z(r,`