@websublime/vite-plugin-open-api-devtools 0.9.0-next.0 → 0.9.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ModelsPage-OOYQ3USo.js +798 -0
- package/dist/ModelsPage-OOYQ3USo.js.map +1 -0
- package/dist/{RoutesPage-DmXBJ4J5.js → RoutesPage-BgsspZkr.js} +191 -191
- package/dist/RoutesPage-BgsspZkr.js.map +1 -0
- package/dist/SimulatorPage-g9fGUP4F.js +436 -0
- package/dist/SimulatorPage-g9fGUP4F.js.map +1 -0
- package/dist/TimelinePage-D_GD3OjL.js +861 -0
- package/dist/TimelinePage-D_GD3OjL.js.map +1 -0
- package/dist/{check-BdvaZxRt.js → check-B4mNtdMg.js} +2 -2
- package/dist/{check-BdvaZxRt.js.map → check-B4mNtdMg.js.map} +1 -1
- package/dist/devtools.css +1 -1
- package/dist/devtools.js +1 -1
- package/dist/devtools.umd.cjs +3 -3
- package/dist/devtools.umd.cjs.map +1 -1
- package/dist/{format-Cj8p3HJO.js → format-Dj37a-xS.js} +2 -2
- package/dist/{format-Cj8p3HJO.js.map → format-Dj37a-xS.js.map} +1 -1
- package/dist/{main-HjHdsAps.js → main-CWgkFc8w.js} +8 -7
- package/dist/{main-HjHdsAps.js.map → main-CWgkFc8w.js.map} +1 -1
- package/dist/registry-SW4SCwV5.js +216 -0
- package/dist/registry-SW4SCwV5.js.map +1 -0
- package/dist/spa/assets/{ModelsPage-8zCKSqIw.css → ModelsPage-CrseRvBH.css} +1 -1
- package/dist/spa/assets/ModelsPage-CxzHlUKB.js +4 -0
- package/dist/spa/assets/ModelsPage-CxzHlUKB.js.map +1 -0
- package/dist/spa/assets/RoutesPage-BchriFi3.js +2 -0
- package/dist/spa/assets/RoutesPage-BchriFi3.js.map +1 -0
- package/dist/spa/assets/{RoutesPage-BVXzvJ2S.css → RoutesPage-Wp_sf4Io.css} +1 -1
- package/dist/spa/assets/SimulatorPage-CHGPhn5Y.js +2 -0
- package/dist/spa/assets/SimulatorPage-CHGPhn5Y.js.map +1 -0
- package/dist/spa/assets/SimulatorPage-p6R5JJTE.css +1 -0
- package/dist/spa/assets/{TimelinePage-BDyp8kvu.css → TimelinePage-ED20f46Y.css} +1 -1
- package/dist/spa/assets/TimelinePage-zBBJCjLX.js +2 -0
- package/dist/spa/assets/TimelinePage-zBBJCjLX.js.map +1 -0
- package/dist/spa/assets/check-CDp1nxJT.js +2 -0
- package/dist/spa/assets/{check-9axZ93X-.js.map → check-CDp1nxJT.js.map} +1 -1
- package/dist/spa/assets/{format-CB-GiJ6N.js → format-DA0n5kox.js} +2 -2
- package/dist/spa/assets/{format-CB-GiJ6N.js.map → format-DA0n5kox.js.map} +1 -1
- package/dist/spa/assets/{index-BQr16DJ3.js → index-Ddu0x8qb.js} +3 -3
- package/dist/spa/assets/{index-BQr16DJ3.js.map → index-Ddu0x8qb.js.map} +1 -1
- package/dist/spa/assets/registry-CKvK0Ln5.js +2 -0
- package/dist/spa/assets/registry-CKvK0Ln5.js.map +1 -0
- package/dist/spa/assets/{trash-2-Cj6nHRK8.js → trash-2-B1UuFJDm.js} +2 -2
- package/dist/spa/assets/{trash-2-Cj6nHRK8.js.map → trash-2-B1UuFJDm.js.map} +1 -1
- package/dist/spa/assets/{triangle-alert-BXnev_tx.js → triangle-alert-ITT7135L.js} +2 -2
- package/dist/spa/assets/{triangle-alert-BXnev_tx.js.map → triangle-alert-ITT7135L.js.map} +1 -1
- package/dist/spa/assets/x-YOimnrsL.js +2 -0
- package/dist/spa/assets/{x-9zeMJ8Mo.js.map → x-YOimnrsL.js.map} +1 -1
- package/dist/spa/index.html +1 -1
- package/dist/{trash-2-unSVE8Jc.js → trash-2-CDLzu4_Y.js} +2 -2
- package/dist/{trash-2-unSVE8Jc.js.map → trash-2-CDLzu4_Y.js.map} +1 -1
- package/dist/{triangle-alert-B1V6ucAg.js → triangle-alert-BP3-t-po.js} +2 -2
- package/dist/{triangle-alert-B1V6ucAg.js.map → triangle-alert-BP3-t-po.js.map} +1 -1
- package/dist/{x-DWlhu3h-.js → x-BZzigrBR.js} +2 -2
- package/dist/{x-DWlhu3h-.js.map → x-BZzigrBR.js.map} +1 -1
- package/package.json +13 -13
- package/dist/ModelsPage-DoqfBilK.js +0 -757
- package/dist/ModelsPage-DoqfBilK.js.map +0 -1
- package/dist/RoutesPage-DmXBJ4J5.js.map +0 -1
- package/dist/SimulatorPage-BmM-ExQg.js +0 -430
- package/dist/SimulatorPage-BmM-ExQg.js.map +0 -1
- package/dist/TimelinePage-Dnh_47wz.js +0 -849
- package/dist/TimelinePage-Dnh_47wz.js.map +0 -1
- package/dist/registry-BQhccWMq.js +0 -153
- package/dist/registry-BQhccWMq.js.map +0 -1
- package/dist/spa/assets/ModelsPage-_etl-kz9.js +0 -4
- package/dist/spa/assets/ModelsPage-_etl-kz9.js.map +0 -1
- package/dist/spa/assets/RoutesPage-BN_Lo8uo.js +0 -2
- package/dist/spa/assets/RoutesPage-BN_Lo8uo.js.map +0 -1
- package/dist/spa/assets/SimulatorPage-BF4VLn5k.js +0 -2
- package/dist/spa/assets/SimulatorPage-BF4VLn5k.js.map +0 -1
- package/dist/spa/assets/SimulatorPage-DGEq_rzM.css +0 -1
- package/dist/spa/assets/TimelinePage-7OqKgItP.js +0 -2
- package/dist/spa/assets/TimelinePage-7OqKgItP.js.map +0 -1
- package/dist/spa/assets/check-9axZ93X-.js +0 -2
- package/dist/spa/assets/registry-DAv66ZPp.js +0 -2
- package/dist/spa/assets/registry-DAv66ZPp.js.map +0 -1
- package/dist/spa/assets/x-9zeMJ8Mo.js +0 -2
package/dist/devtools.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(U,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("pinia"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","pinia","vue","vue-router"],W):(U=typeof globalThis<"u"?globalThis:U||self,W(U.ViteOpenApiDevtools={},U.Pinia,U.Vue,U.VueRouter))})(this,(function(U,W,e,de){"use strict";const Re=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ve=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,l)=>l?l.toUpperCase():o.toLowerCase()),et=n=>{const t=ve(n);return t.charAt(0).toUpperCase()+t.slice(1)},tt=(...n)=>n.filter((t,o,l)=>!!t&&t.trim()!==""&&l.indexOf(t)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const nt=({size:n,strokeWidth:t=2,absoluteStrokeWidth:o,color:l,iconNode:r,name:s,class:f,...N},{slots:_})=>e.h("svg",{...me,width:n||me.width,height:n||me.height,stroke:l||me.stroke,"stroke-width":o?Number(t)*24/Number(n):t,class:tt("lucide",...s?[`lucide-${Re(et(s))}-icon`,`lucide-${Re(s)}`]:["lucide-icon"]),...N},[...r.map(a=>e.h(...a)),..._.default?[_.default()]:[]]);const I=(n,t)=>(o,{slots:l})=>e.h(nt,{...o,iconNode:t,name:n},l);const pe=I("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const v=I("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ne=I("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Ae=I("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const ot=I("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const st=I("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const K=I("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ve=I("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const Se=I("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ue=I("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Ce=I("file-json",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);const Oe=I("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);const lt=I("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const at=I("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const rt=I("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Be=I("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const it=I("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const fe=I("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const ct=I("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const $e=I("sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);const dt=I("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const ye=I("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const xe=I("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const mt=I("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const pt=I("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const re=I("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const oe=I("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ut="#94a3b8",ft=W.defineStore("specs",()=>{const n=e.ref([]),t=e.ref(null),o=e.computed(()=>new Map(n.value.map(h=>[h.id,h]))),l=e.computed(()=>n.value.map(h=>h.id)),r=e.computed(()=>t.value?o.value.get(t.value)??null:null),s=e.computed(()=>t.value!==null);function f(h){n.value=h,t.value&&!h.some(S=>S.id===t.value)&&(t.value=null)}function N(h){t.value=h!==null&&!n.value.some(S=>S.id===h)?null:h}function _(h){t.value===h?t.value=null:N(h)}function a(h){return o.value.get(h)?.color??ut}return{specs:n,activeSpecFilter:t,specMap:o,specIds:l,activeSpec:r,isFiltered:s,setSpecs:f,setFilter:N,toggleFilter:_,getColor:a}}),we={path:"/_ws",reconnectDelay:2e3,maxReconnectAttempts:Number.POSITIVE_INFINITY,autoConnect:!0},O=e.ref("disconnected"),De=e.ref(null),ie=e.ref(0);let L=null,he=null,se={...we},Te=!1;const G=new Map;function Pe(){return typeof window<"u"&&typeof WebSocket<"u"}function yt(){return e.getCurrentInstance()!==null}function ht(n){return Pe()?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${n}`:`ws://localhost${n}`}function He(){he!==null&&(clearTimeout(he),he=null)}function _t(n,t){const o=G.get(n);if(o)for(const r of o)try{r(t)}catch(s){console.error(`[DevTools WebSocket] Error in event handler for '${n}':`,s)}const l=G.get("*");if(l)for(const r of l)try{r({type:n,data:t})}catch(s){console.error("[DevTools WebSocket] Error in wildcard event handler:",s)}}function gt(){O.value="connected",ie.value=0,He()}function kt(n){for(const t of n)P({type:"get:registry",data:{specId:t.id}}),P({type:"get:timeline",data:{specId:t.id}})}function Et(n){try{const t=JSON.parse(n.data);if(t.type==="connected"){const o=t.data;De.value=o.serverVersion,o.specs&&Array.isArray(o.specs)&&(ft().setSpecs(o.specs),kt(o.specs))}_t(t.type,t.data)}catch(t){console.error("[DevTools WebSocket] Failed to parse message:",t)}}function Nt(){O.value,O.value="disconnected",L=null,ie.value<se.maxReconnectAttempts&&(O.value="reconnecting",ie.value++,he=setTimeout(()=>{Ie()},se.reconnectDelay))}function bt(n){console.error("[DevTools WebSocket] Error:",n)}function Ie(){if(!Pe()||O.value==="connecting"||O.value==="connected"||L&&(L.readyState===WebSocket.CONNECTING||L.readyState===WebSocket.OPEN))return;je(),O.value="connecting";const n=ht(se.path);try{L=new WebSocket(n),L.onopen=gt,L.onmessage=Et,L.onclose=Nt,L.onerror=bt}catch(t){console.error("[DevTools WebSocket] Failed to create WebSocket:",t),O.value="disconnected"}}function je(){L&&(L.onopen=null,L.onmessage=null,L.onclose=null,L.onerror=null,(L.readyState===WebSocket.OPEN||L.readyState===WebSocket.CONNECTING)&&L.close(),L=null)}function Ue(){He(),je(),O.value="disconnected",ie.value=0}function P(n){if(!L||L.readyState!==WebSocket.OPEN)return!1;try{return L.send(JSON.stringify(n)),!0}catch(t){return console.error("[DevTools WebSocket] Failed to send command:",t),!1}}function Vt(){return P({type:"get:specs"})}function St(n){return P({type:"get:registry",data:n?{specId:n}:void 0})}function Ct(n,t){const o={};return n&&(o.specId=n),t!==void 0&&(o.limit=t),P({type:"get:timeline",data:Object.keys(o).length>0?o:void 0})}function Bt(n){return P({type:"clear:timeline",data:n?{specId:n}:void 0})}function $t(n,t){return P({type:"get:store",data:{specId:n,schema:t}})}function xt(n,t,o){return P({type:"set:store",data:{specId:n,schema:t,items:o}})}function wt(n,t){return P({type:"clear:store",data:{specId:n,schema:t}})}function Dt(n,t){return P({type:"set:simulation",data:{specId:n,...t}})}function Tt(n,t){return P({type:"clear:simulation",data:{specId:n,path:t}})}function It(n){return P({type:"reseed",data:{specId:n}})}function ze(n,t){G.has(n)||G.set(n,new Set);const o=G.get(n);return o&&o.add(t),()=>{const l=G.get(n);l&&(l.delete(t),l.size===0&&G.delete(n))}}function Me(n,t){const o=G.get(n);o&&(o.delete(t),o.size===0&&G.delete(n))}function zt(n,t){const o=l=>{Me(n,o),t(l)};return ze(n,o)}function Mt(n,t){const o=l=>{t(l)===!0&&Me(n,o)};return ze(n,o)}function qt(){Ue(),De.value=null,G.clear(),se={...we},Te=!1}function le(n={}){(!Te||O.value==="disconnected")&&(se={...we,...n},Te=!0);const t=e.computed(()=>O.value==="connected"),o=e.computed(()=>O.value==="reconnecting");return yt()&&e.onMounted(()=>{se.autoConnect&&Ie()}),{connectionState:e.computed(()=>O.value),connected:t,isReconnecting:o,serverVersion:e.computed(()=>De.value),reconnectAttempts:e.computed(()=>ie.value),connect:Ie,disconnect:Ue,send:P,on:ze,off:Me,once:zt,onUntil:Mt,resetState:qt,getSpecs:Vt,getRegistry:St,getTimeline:Ct,clearTimeline:Bt,getStore:$t,setStore:xt,clearStore:wt,setSimulation:Dt,clearSimulation:Tt,reseed:It}}const Je=[{path:"/",redirect:"/routes"},{path:"/routes",name:"routes",component:()=>Promise.resolve().then(()=>yo),meta:{title:"Routes",icon:"route"}},{path:"/timeline",name:"timeline",component:()=>Promise.resolve().then(()=>Xs),meta:{title:"Timeline",icon:"clock"}},{path:"/models",name:"models",component:()=>Promise.resolve().then(()=>ta),meta:{title:"Models",icon:"database"}},{path:"/simulator",name:"simulator",component:()=>Promise.resolve().then(()=>Ca),meta:{title:"Simulator",icon:"zap"}},{path:"/:pathMatch(.*)*",name:"not-found",redirect:"/routes"}],Ft=de.createRouter({history:de.createWebHashHistory(),routes:Je}),Lt={class:"app"},Rt={class:"app-header"},At={class:"app-header__brand"},Ot={class:"app-nav",role:"tablist","aria-label":"DevTools navigation"},Pt=["aria-selected","aria-current","aria-controls","onClick"],Ht={class:"app-nav__label"},jt={class:"app-header__status"},Ut={class:"connection-status"},Jt={class:"connection-status__text"},Qt={class:"app-main"},Wt=e.defineComponent({__name:"App",setup(n){const t=de.useRoute(),o=de.useRouter(),l=e.computed(()=>Je.filter(a=>a.name&&a.meta?.title).map(a=>({name:a.name,path:a.path,title:a.meta?.title,icon:a.meta?.icon}))),r=e.computed(()=>t.name);function s(a){o.push(a)}const f={route:Be,clock:K,database:ue,zap:oe};function N(a){return f[a]??Be}const{connected:_}=le();return(a,h)=>{const S=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("header",Rt,[e.createElementVNode("div",At,[e.createVNode(e.unref(oe),{class:"app-header__logo",size:20}),h[0]||(h[0]=e.createElementVNode("span",{class:"app-header__title"},"OpenAPI DevTools",-1))]),e.createElementVNode("nav",Ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,C=>(e.openBlock(),e.createElementBlock("button",{key:C.name,role:"tab","aria-selected":r.value===C.name,"aria-current":r.value===C.name?"true":void 0,"aria-controls":`panel-${C.name}`,tabindex:0,class:e.normalizeClass(["app-nav__tab",{"app-nav__tab--active":r.value===C.name}]),onClick:x=>s(C.path)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(C.icon)),{size:16,class:"app-nav__icon"})),e.createElementVNode("span",Ht,e.toDisplayString(C.title),1)],10,Pt))),128))]),e.createElementVNode("div",jt,[e.createElementVNode("div",Ut,[e.createElementVNode("span",{class:e.normalizeClass(["connection-status__dot",e.unref(_)?"connection-status__dot--connected":"connection-status__dot--disconnected"])},null,2),e.createElementVNode("span",Jt,e.toDisplayString(e.unref(_)?"Connected":"Disconnected"),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_)?e.unref(pt):e.unref(mt)),{size:14,class:"connection-status__icon"}))])])]),e.createElementVNode("main",Qt,[e.createVNode(S,null,{default:e.withCtx(({Component:C})=>[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C)))]),_:2},1024)]),_:1})])])}}}),J=(n,t)=>{const o=n.__vccOpts||n;for(const[l,r]of t)o[l]=r;return o},Gt=J(Wt,[["__scopeId","data-v-0a83e2b9"]]);function _e(n){try{return structuredClone(e.toRaw(n))}catch{return JSON.parse(JSON.stringify(n))}}const Kt=W.defineStore("models",()=>{const n=e.ref([]),t=e.ref(null),o=e.ref([]),l=e.ref([]),r=e.ref(!1),s=e.ref(null),f=e.computed(()=>t.value?n.value.find(k=>k.name===t.value)??null:null),N=e.ref(!1),_=e.computed(()=>N.value),a=e.computed(()=>n.value.length),h=e.computed(()=>n.value.reduce((k,y)=>k+y.count,0));async function S(){r.value=!0,s.value=null;try{const k=await fetch("/_api/store");if(!k.ok)throw new Error(`Failed to fetch schemas: ${k.statusText}`);const y=await k.json();n.value=y.schemas??[]}catch(k){s.value=k instanceof Error?k.message:"Failed to fetch schemas",console.error("[ModelsStore] Error fetching schemas:",k)}finally{r.value=!1}}async function C(k){t.value!==k&&(t.value=k,await x(k))}async function x(k){r.value=!0,s.value=null;try{const y=await fetch(`/_api/store/${encodeURIComponent(k)}`);if(!y.ok)throw new Error(`Failed to fetch schema data: ${y.statusText}`);const g=await y.json(),u=g.items??[];o.value=_e(u),l.value=_e(u),N.value=!1;const z=n.value.findIndex(E=>E.name===k);z!==-1&&(n.value[z].count=g.count)}catch(y){s.value=y instanceof Error?y.message:"Failed to fetch schema data",console.error("[ModelsStore] Error fetching schema data:",y)}finally{r.value=!1}}function F(k){if(!Array.isArray(k)){s.value="Invalid data: Expected an array of items",console.error("[ModelsStore] updateItems received non-array value:",typeof k);return}o.value=k,s.value=null,N.value=!0}async function R(){if(!t.value)return s.value="No schema selected",!1;r.value=!0,s.value=null;try{const k=await fetch(`/_api/store/${encodeURIComponent(t.value)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(!k.ok){const u=await k.json().catch(()=>({}));throw new Error(u.error||`Failed to save items: ${k.statusText}`)}const y=await k.json();l.value=_e(o.value),N.value=!1;const g=n.value.findIndex(u=>u.name===t.value);return g!==-1&&(n.value[g].count=y.created??o.value.length),!0}catch(k){return s.value=k instanceof Error?k.message:"Failed to save items",console.error("[ModelsStore] Error saving items:",k),!1}finally{r.value=!1}}async function $(){if(!t.value)return s.value="No schema selected",!1;r.value=!0,s.value=null;try{const k=await fetch(`/_api/store/${encodeURIComponent(t.value)}`,{method:"DELETE"});if(!k.ok)throw new Error(`Failed to clear schema: ${k.statusText}`);o.value=[],l.value=[],N.value=!1;const y=n.value.findIndex(g=>g.name===t.value);return y!==-1&&(n.value[y].count=0),!0}catch(k){return s.value=k instanceof Error?k.message:"Failed to clear schema",console.error("[ModelsStore] Error clearing schema:",k),!1}finally{r.value=!1}}function i(){o.value=_e(l.value),N.value=!1}async function c(){t.value?await x(t.value):await S()}function d(){n.value=[],t.value=null,o.value=[],l.value=[],r.value=!1,s.value=null,N.value=!1}function B(k){const y=n.value.findIndex(g=>g.name===k.schema);y!==-1&&(n.value[y].count=k.count),t.value===k.schema&&(_.value?console.warn(`[ModelsStore] Skipping auto-refresh for schema "${k.schema}" - unsaved changes exist`):x(k.schema))}function q(k){k.success&&(S(),t.value&&(_.value?console.warn(`[ModelsStore] Skipping auto-refresh after reseed for schema "${t.value}" - unsaved changes exist`):x(t.value)))}return{schemas:n,selectedSchema:t,currentItems:o,loading:r,error:s,currentSchema:f,isDirty:_,schemaCount:a,totalItems:h,fetchSchemas:S,selectSchemaByName:C,fetchSchemaData:x,updateItems:F,saveItems:R,clearSchema:$,discardChanges:i,refresh:c,reset:d,handleStoreUpdate:B,handleReseedComplete:q}}),Qe=W.defineStore("registry",()=>{const n=e.ref([]),t=e.ref({totalEndpoints:0,withCustomHandler:0,totalSchemas:0,withCustomSeed:0,autoGenerated:0}),o=e.ref(!1),l=e.ref(null),r=e.ref(""),s=e.ref({methods:[],hasHandler:null,hasSeed:null,tags:[]}),f=e.ref(null),N=e.ref(new Set),_=e.computed(()=>{const m=new Set;for(const b of n.value)for(const w of b.tags)m.add(w);return Array.from(m).sort()}),a=e.computed(()=>{const m=new Set;for(const b of n.value)b.responseSchema&&m.add(b.responseSchema);return Array.from(m).sort()}),h=e.computed(()=>{let m=n.value;if(r.value.trim()){const b=r.value.toLowerCase().trim();m=m.filter(w=>w.path.toLowerCase().includes(b)||w.operationId.toLowerCase().includes(b)||w.summary?.toLowerCase().includes(b)||w.tags.some(p=>p.toLowerCase().includes(b)))}return s.value.methods.length>0&&(m=m.filter(b=>s.value.methods.includes(b.method))),s.value.hasHandler!==null&&(m=m.filter(b=>b.hasHandler===s.value.hasHandler)),s.value.hasSeed!==null&&(m=m.filter(b=>b.hasSeed===s.value.hasSeed)),s.value.tags.length>0&&(m=m.filter(b=>b.tags.some(w=>s.value.tags.includes(w)))),m}),S=e.computed(()=>{const m=new Map;for(const b of h.value){let w;b.tags.length>0?w=b.tags[0]:b.responseSchema?w=b.responseSchema:w=b.path.split("/").filter(Boolean)[0]||"Other",m.has(w)||m.set(w,[]),m.get(w)?.push(b)}return Array.from(m.entries()).map(([b,w])=>({tag:b,endpoints:w.sort((p,V)=>p.path.localeCompare(V.path)),isExpanded:N.value.has(b)})).sort((b,w)=>b.tag.localeCompare(w.tag))}),C=e.computed(()=>f.value?n.value.find(m=>m.key===f.value)??null:null),x=e.computed(()=>n.value.filter(m=>m.hasHandler).length),F=e.computed(()=>n.value.filter(m=>m.hasSeed).length);function R(m){n.value=m.endpoints,t.value=m.stats,l.value=null;for(const b of m.endpoints)b.tags.length>0&&N.value.add(b.tags[0])}function $(m){o.value=m}function i(m){l.value=m,o.value=!1}function c(){l.value=null}function d(m){r.value=m}function B(m){const b=s.value.methods.indexOf(m);b===-1?s.value.methods.push(m):s.value.methods.splice(b,1)}function q(m){s.value.hasHandler=m}function k(m){s.value.hasSeed=m}function y(m){const b=s.value.tags.indexOf(m);b===-1?s.value.tags.push(m):s.value.tags.splice(b,1)}function g(){s.value={methods:[],hasHandler:null,hasSeed:null,tags:[]},r.value=""}function u(){return r.value.trim()!==""||s.value.methods.length>0||s.value.hasHandler!==null||s.value.hasSeed!==null||s.value.tags.length>0}function z(m){f.value=m}function E(m){N.value.has(m)?N.value.delete(m):N.value.add(m)}function D(){for(const m of S.value)N.value.add(m.tag)}function A(){N.value.clear()}function j(m){const b=new Set(m);for(const w of n.value)w.hasHandler=b.has(w.operationId)}function M(m){const b=new Set(m);for(const w of n.value)w.hasSeed=w.responseSchema?b.has(w.responseSchema):!1}return{endpoints:n,stats:t,isLoading:o,error:l,searchQuery:r,filter:s,selectedEndpointKey:f,expandedTags:N,allTags:_,allSchemas:a,filteredEndpoints:h,groupedEndpoints:S,selectedEndpoint:C,handlerCount:x,seedCount:F,setRegistryData:R,setLoading:$,setError:i,clearError:c,setSearchQuery:d,toggleMethodFilter:B,setHandlerFilter:q,setSeedFilter:k,toggleTagFilter:y,clearFilters:g,hasActiveFilters:u,selectEndpoint:z,toggleGroup:E,expandAllGroups:D,collapseAllGroups:A,updateHandlerStatus:j,updateSeedStatus:M}}),qe=[{id:"slow-network",label:"Slow Network",description:"3000ms delay (3G simulation)",type:"delay",status:200,delay:3e3},{id:"server-error",label:"Server Error",description:"Returns HTTP 500",type:"error",status:500,body:{error:"Internal Server Error",message:"Simulated server error"}},{id:"rate-limit",label:"Rate Limited",description:"Returns HTTP 429",type:"error",status:429,body:{error:"Too Many Requests",message:"Rate limit exceeded"}},{id:"not-found",label:"Not Found",description:"Returns HTTP 404",type:"error",status:404,body:{error:"Not Found",message:"Resource not found"}},{id:"request-timeout",label:"Request Timeout",description:"30000ms delay (simulates timeout)",type:"delay",status:200,delay:3e4},{id:"empty-response",label:"Empty Response",description:"Returns HTTP 200 with empty body",type:"empty",status:200,body:null},{id:"unauthorized",label:"Unauthorized",description:"Returns HTTP 401",type:"error",status:401,body:{error:"Unauthorized",message:"Authentication required"}}],Zt=W.defineStore("simulation",()=>{const n=e.ref(new Map),t=e.ref(new Map),o=e.ref(!1),l=e.ref(null),r=e.computed(()=>Array.from(n.value.values())),s=e.computed(()=>n.value.size),f=e.computed(()=>qe),N=e.computed(()=>n.value.size>0),_=e.computed(()=>{const E={delay:[],error:[],empty:[]};for(const D of n.value.values()){const A=a(D);E[A].push(D)}return E});function a(E){const D=E.presetId?qe.find(A=>A.id===E.presetId):null;return D?D.type:E.delay&&E.delay>0?"delay":E.body===null?"empty":"error"}function h(E){n.value.clear();for(const D of E)n.value.set(D.path,D);l.value=null}function S(E,D=!1){if(D){const A=n.value.get(E.path)||null;t.value.set(E.path,A)}n.value.set(E.path,E)}function C(E,D=!1){if(D){const A=n.value.get(E)||null;t.value.set(E,A)}return n.value.delete(E)}function x(){n.value.clear()}function F(E){return n.value.get(E)}function R(E){return n.value.has(E)}function $(E){return qe.find(D=>D.id===E)}function i(E,D,A){const j=$(D);return j?{path:E,operationId:A,status:j.status,delay:j.delay,body:j.body,presetId:j.id}:(l.value=`Preset not found: ${D}`,null)}function c(E){o.value=E}function d(E){l.value=E,o.value=!1}function B(){l.value=null}function q(E){if(!t.value.has(E))return;const D=t.value.get(E);D==null?n.value.delete(E):n.value.set(E,D),t.value.delete(E)}function k(E){console.log("[Simulation] Added:",E.path)}function y(E){C(E.path),console.log("[Simulation] Removed:",E.path)}function g(E){x(),console.log("[Simulation] Cleared all:",E.count)}function u(E){E.success?(t.value.delete(E.path),console.log("[Simulation] Set successfully:",E.path)):(q(E.path),d(`Failed to set simulation for ${E.path}`)),c(!1)}function z(E){E.success?(t.value.delete(E.path),console.log("[Simulation] Cleared successfully:",E.path)):(q(E.path),d(`Failed to clear simulation for ${E.path}`)),c(!1)}return{simulations:n,isLoading:o,error:l,activeSimulations:r,count:s,presets:f,hasActiveSimulations:N,simulationsByType:_,setSimulations:h,addSimulationLocal:S,removeSimulationLocal:C,clearSimulationsLocal:x,getSimulation:F,hasSimulation:R,getPreset:$,createSimulationFromPreset:i,setLoading:c,setError:d,clearError:B,rollbackSimulation:q,handleSimulationAdded:k,handleSimulationRemoved:y,handleSimulationsCleared:g,handleSimulationSet:u,handleSimulationCleared:z}}),Yt=W.defineStore("timeline",()=>{const n=e.ref([]),t=e.ref(!1),o=e.ref(null),l=e.ref({methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}),r=e.ref(null),s=e.ref(500),f=new Map;function N(p){return p<200?"1xx":p<300?"2xx":p<400?"3xx":p<500?"4xx":"5xx"}const _=e.computed(()=>{let p=n.value;if(l.value.searchQuery.trim()){const V=l.value.searchQuery.toLowerCase().trim();p=p.filter(T=>T.request.path.toLowerCase().includes(V)||T.request.operationId.toLowerCase().includes(V))}return l.value.methods.length>0&&(p=p.filter(V=>l.value.methods.includes(V.request.method.toUpperCase()))),l.value.statusCodes.length>0&&(p=p.filter(V=>{if(V.status===null)return!1;const T=N(V.status);return l.value.statusCodes.includes(T)})),l.value.simulatedOnly!==null&&(p=p.filter(V=>V.simulated===l.value.simulatedOnly)),p}),a=e.computed(()=>r.value?n.value.find(p=>p.id===r.value)??null:null),h=e.computed(()=>n.value.length),S=e.computed(()=>n.value.filter(p=>p.response!==null).length),C=e.computed(()=>n.value.filter(p=>p.response===null).length),x=e.computed(()=>{const p={"1xx":0,"2xx":0,"3xx":0,"4xx":0,"5xx":0};for(const V of n.value)if(V.status!==null){const T=N(V.status);p[T]++}return p}),F=e.computed(()=>{const p=n.value.filter(T=>T.duration!==null);if(p.length===0)return 0;const V=p.reduce((T,Y)=>T+(Y.duration??0),0);return Math.round(V/p.length)});function R(p){const V={id:p.id,request:p,response:null,status:null,duration:null,simulated:!1},T=f.get(p.id);T&&(i(V,T),f.delete(p.id)),n.value.unshift(V),n.value.length>s.value&&(n.value=n.value.slice(0,s.value))}function $(p){const V=n.value.find(T=>T.id===p.requestId);if(V)i(V,p),f.delete(p.requestId);else if(f.set(p.requestId,p),f.size>100){const T=c(p);n.value.unshift(T),f.delete(p.requestId),n.value.length>s.value&&(n.value=n.value.slice(0,s.value))}}function i(p,V){p.response=V,p.status=V.status,p.duration=V.duration,p.simulated=V.simulated}function c(p){const V={id:p.requestId,method:"UNKNOWN",path:"/unknown",operationId:"unknown",timestamp:Date.now(),headers:{},query:{},body:void 0};return{id:p.requestId,request:V,response:p,status:p.status,duration:p.duration,simulated:p.simulated}}function d(p){for(const[V,T]of f){const Y=p.get(V);Y?(i(Y,T),f.delete(V)):(p.set(V,c(T)),f.delete(V))}}function B(p,V){for(const[T,Y]of V){const X=p.get(T);X?i(X,Y):f.set(T,Y)}}function q(p){for(const[V,T]of f)p.has(V)||(p.set(V,c(T)),f.delete(V))}function k(p){const V=new Map,T=new Map;for(const X of p.entries)if(X.type==="request"){const ee=X.data;V.set(ee.id,{id:ee.id,request:ee,response:null,status:null,duration:null,simulated:!1})}else if(X.type==="response"){const ee=X.data;T.set(ee.requestId,ee)}d(V),B(V,T),q(V);const Y=Array.from(V.values()).sort((X,ee)=>ee.request.timestamp-X.request.timestamp);n.value=Y.slice(0,s.value),o.value=null}function y(){n.value=[],r.value=null,f.clear()}function g(p){t.value=p}function u(p){o.value=p,t.value=!1}function z(){o.value=null}function E(p){l.value.searchQuery=p}function D(p){const V=l.value.methods.indexOf(p);V===-1?l.value.methods.push(p):l.value.methods.splice(V,1)}function A(p){const V=l.value.statusCodes.indexOf(p);V===-1?l.value.statusCodes.push(p):l.value.statusCodes.splice(V,1)}function j(p){l.value.simulatedOnly=p}function M(){l.value={methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}}function m(){return l.value.searchQuery.trim()!==""||l.value.methods.length>0||l.value.statusCodes.length>0||l.value.simulatedOnly!==null}function b(p){r.value=p}function w(p){const V=Math.max(1,p);s.value=V,n.value.length>V&&(n.value=n.value.slice(0,V))}return{entries:n,isLoading:t,error:o,filter:l,selectedEntryId:r,maxEntries:s,filteredEntries:_,selectedEntry:a,totalCount:h,completedCount:S,pendingCount:C,statusCounts:x,averageDuration:F,addRequest:R,addResponse:$,setTimelineData:k,clearTimeline:y,setLoading:g,setError:u,clearError:z,setSearchQuery:E,toggleMethodFilter:D,toggleStatusFilter:A,setSimulatedFilter:j,clearFilters:M,hasActiveFilters:m,selectEntry:b,setMaxEntries:w}}),Xt=["light","dark","system"];function We(n){return typeof n=="string"&&Xt.includes(n)}const Fe="openapi-devtools-theme",Z=e.ref("system"),te=e.ref(!1);let ge=null,ke=null;function Ee(){return typeof window<"u"&&typeof document<"u"}function vt(){return e.getCurrentInstance()!==null}function en(){const n=e.computed(()=>Z.value==="system"?te.value?"dark":"light":Z.value),t=e.computed(()=>n.value==="dark");function o(){if(!Ee())return;const a=document.documentElement;n.value==="dark"?(a.classList.add("dark"),a.classList.remove("light")):(a.classList.add("light"),a.classList.remove("dark"))}function l(a){if(!We(a)){console.warn(`[DevTools] Invalid theme mode: ${a}`);return}if(Z.value=a,Ee())try{localStorage.setItem(Fe,a)}catch{console.warn("[DevTools] Unable to persist theme preference")}}function r(){Z.value==="system"?l(te.value?"light":"dark"):l(Z.value==="dark"?"light":"dark")}function s(){l("system")}function f(){ge&&ke&&(ge.removeEventListener("change",ke),ge=null,ke=null)}function N(){if(!Ee())return;f();const a=window.matchMedia("(prefers-color-scheme: dark)");te.value=a.matches;const h=S=>{te.value=S.matches};a.addEventListener("change",h),ge=a,ke=h;try{const S=localStorage.getItem(Fe);We(S)&&(Z.value=S)}catch{}o()}function _(){if(f(),Z.value="system",te.value=!1,Ee()){document.documentElement.classList.remove("dark","light");try{localStorage.removeItem(Fe)}catch{}}}return e.watch([Z,te],()=>{o()}),vt()&&(e.onMounted(()=>{N()}),e.onUnmounted(()=>{f()})),{themeMode:e.computed(()=>Z.value),effectiveTheme:n,isDark:t,systemPrefersDark:e.computed(()=>te.value),setTheme:l,toggleTheme:r,resetToSystem:s,initialize:N,resetState:_}}let Ge=!1,Ke=null;function Ze(){if(Ge)return Ke;const n=e.createApp(Gt),t=W.createPinia();return n.use(t),n.use(Ft),n.mount("#app"),Ge=!0,Ke=n,n}typeof window<"u"&&document.getElementById("app")&&Ze();function Ne(n){return n.toUpperCase()}const tn={class:"endpoint-detail"},nn={key:0,class:"endpoint-detail__empty"},on={key:1,class:"endpoint-detail__content"},sn={class:"endpoint-detail__header"},ln={class:"endpoint-detail__path font-mono"},an={class:"endpoint-detail__status"},rn={key:0,class:"endpoint-detail__status-item endpoint-detail__status-item--handler"},cn={key:1,class:"endpoint-detail__status-item endpoint-detail__status-item--seed"},dn={key:2,class:"endpoint-detail__status-item endpoint-detail__status-item--security"},mn={key:3,class:"endpoint-detail__status-item endpoint-detail__status-item--auto"},pn={class:"endpoint-detail__sections"},un={class:"endpoint-detail__section"},fn={class:"endpoint-detail__section-content font-mono"},yn={key:0,class:"endpoint-detail__section"},hn={class:"endpoint-detail__section-title"},_n={class:"endpoint-detail__tags"},gn={key:1,class:"endpoint-detail__section"},kn={class:"endpoint-detail__section-content"},En={key:2,class:"endpoint-detail__section"},Nn={class:"endpoint-detail__section-content endpoint-detail__description"},bn={key:3,class:"endpoint-detail__section"},Vn={class:"endpoint-detail__section-title"},Sn={class:"endpoint-detail__section-content font-mono"},Cn={key:4,class:"endpoint-detail__section"},Bn={class:"endpoint-detail__section-title"},$n={class:"endpoint-detail__security"},xn={class:"endpoint-detail__security-name font-mono"},wn={class:"endpoint-detail__security-scopes text-muted"},Dn=J(e.defineComponent({__name:"EndpointDetail",props:{endpoint:{}},setup(n){const t=n,o=e.computed(()=>t.endpoint?.security&&t.endpoint.security.length>0),l=e.computed(()=>t.endpoint?.security?t.endpoint.security.map(r=>({name:r.name,scopes:r.scopes.length>0?r.scopes.join(", "):"No scopes"})):[]);return(r,s)=>(e.openBlock(),e.createElementBlock("div",tn,[n.endpoint?(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("header",sn,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge","method-badge--large",`method-badge--${n.endpoint.method}`])},e.toDisplayString(e.unref(Ne)(n.endpoint.method)),3),e.createElementVNode("h2",ln,e.toDisplayString(n.endpoint.path),1)]),e.createElementVNode("div",an,[n.endpoint.hasHandler?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(e.unref(Ve),{size:14}),s[2]||(s[2]=e.createElementVNode("span",null,"Has custom handler",-1))])):e.createCommentVNode("",!0),n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",cn,[e.createVNode(e.unref($e),{size:14}),s[3]||(s[3]=e.createElementVNode("span",null,"Has seed data",-1))])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",dn,[e.createVNode(e.unref(lt),{size:14}),s[4]||(s[4]=e.createElementVNode("span",null,"Requires authentication",-1))])):e.createCommentVNode("",!0),!n.endpoint.hasHandler&&!n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",mn,[e.createVNode(e.unref(Ce),{size:14}),s[5]||(s[5]=e.createElementVNode("span",null,"Auto-generated response",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",pn,[e.createElementVNode("section",un,[s[6]||(s[6]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Operation",-1)),e.createElementVNode("p",fn,e.toDisplayString(n.endpoint.operationId),1)]),n.endpoint.tags.length>0?(e.openBlock(),e.createElementBlock("section",yn,[e.createElementVNode("h3",hn,[e.createVNode(e.unref(dt),{size:14}),s[7]||(s[7]=e.createTextVNode(" Tags ",-1))]),e.createElementVNode("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.endpoint.tags,f=>(e.openBlock(),e.createElementBlock("span",{key:f,class:"endpoint-detail__tag"},e.toDisplayString(f),1))),128))])])):e.createCommentVNode("",!0),n.endpoint.summary?(e.openBlock(),e.createElementBlock("section",gn,[s[8]||(s[8]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Summary",-1)),e.createElementVNode("p",kn,e.toDisplayString(n.endpoint.summary),1)])):e.createCommentVNode("",!0),n.endpoint.description?(e.openBlock(),e.createElementBlock("section",En,[s[9]||(s[9]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Description",-1)),e.createElementVNode("p",Nn,e.toDisplayString(n.endpoint.description),1)])):e.createCommentVNode("",!0),n.endpoint.responseSchema?(e.openBlock(),e.createElementBlock("section",bn,[e.createElementVNode("h3",Vn,[e.createVNode(e.unref(Ce),{size:14}),s[10]||(s[10]=e.createTextVNode(" Response Schema ",-1))]),e.createElementVNode("p",Sn,e.toDisplayString(n.endpoint.responseSchema),1)])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("section",Cn,[e.createElementVNode("h3",Bn,[e.createVNode(e.unref(ct),{size:14}),s[11]||(s[11]=e.createTextVNode(" Security ",-1))]),e.createElementVNode("div",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,f=>(e.openBlock(),e.createElementBlock("div",{key:f.name,class:"endpoint-detail__security-item"},[e.createElementVNode("span",xn,e.toDisplayString(f.name),1),e.createElementVNode("span",wn,e.toDisplayString(f.scopes),1)]))),128))])])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",nn,[e.createVNode(e.unref(Ce),{size:48,class:"endpoint-detail__empty-icon"}),s[0]||(s[0]=e.createElementVNode("h3",{class:"endpoint-detail__empty-title"},"No endpoint selected",-1)),s[1]||(s[1]=e.createElementVNode("p",{class:"endpoint-detail__empty-text text-muted"}," Select an endpoint from the list to view its details ",-1))]))]))}}),[["__scopeId","data-v-c66a0f52"]]),Tn={class:"endpoint-list"},In={key:0,class:"endpoint-list__empty"},zn={key:1,class:"endpoint-list__groups"},Mn=["aria-expanded","aria-controls","onClick"],qn={class:"endpoint-group__tag"},Fn={class:"endpoint-group__count text-muted"},Ln=["id","aria-label"],Rn=["aria-selected","onClick"],An={class:"endpoint-item__path font-mono"},On={class:"endpoint-item__indicators"},Pn={key:0,class:"endpoint-item__indicator endpoint-item__indicator--handler",title:"Has custom handler"},Hn={key:1,class:"endpoint-item__indicator endpoint-item__indicator--seed",title:"Has seed data"},jn=J(e.defineComponent({__name:"EndpointList",props:{groups:{},selectedKey:{}},emits:["select","toggle-group"],setup(n,{emit:t}){const o=n,l=t;function r(N){l("select",N.key)}function s(N){l("toggle-group",N)}function f(N){return o.selectedKey===N.key}return(N,_)=>(e.openBlock(),e.createElementBlock("div",Tn,[n.groups.length===0?(e.openBlock(),e.createElementBlock("div",In,[..._[0]||(_[0]=[e.createElementVNode("p",{class:"text-muted"},"No endpoints found",-1)])])):(e.openBlock(),e.createElementBlock("div",zn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groups,a=>(e.openBlock(),e.createElementBlock("div",{key:a.tag,class:"endpoint-group"},[e.createElementVNode("button",{type:"button",class:"endpoint-group__header","aria-expanded":a.isExpanded,"aria-controls":`group-${a.tag}`,onClick:h=>s(a.tag)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.isExpanded?e.unref(v):e.unref(ne)),{size:16,class:"endpoint-group__chevron"})),e.createElementVNode("span",qn,e.toDisplayString(a.tag),1),e.createElementVNode("span",Fn," ("+e.toDisplayString(a.endpoints.length)+") ",1)],8,Mn),e.withDirectives(e.createElementVNode("div",{id:`group-${a.tag}`,class:"endpoint-group__items",role:"group","aria-label":`${a.tag} endpoints`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.endpoints,h=>(e.openBlock(),e.createElementBlock("button",{key:h.key,type:"button",class:e.normalizeClass(["endpoint-item",{"endpoint-item--selected":f(h)}]),"aria-selected":f(h),onClick:S=>r(h)},[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${h.method}`])},e.toDisplayString(e.unref(Ne)(h.method)),3),e.createElementVNode("span",An,e.toDisplayString(h.path),1),e.createElementVNode("div",On,[h.hasHandler?(e.openBlock(),e.createElementBlock("span",Pn,[e.createVNode(e.unref(Ve),{size:12})])):e.createCommentVNode("",!0),h.hasSeed?(e.openBlock(),e.createElementBlock("span",Hn,[e.createVNode(e.unref($e),{size:12})])):e.createCommentVNode("",!0)])],10,Rn))),128))],8,Ln),[[e.vShow,a.isExpanded]])]))),128))]))]))}}),[["__scopeId","data-v-554ffe63"]]),Un={class:"routes-page"},Jn={class:"routes-toolbar"},Qn={class:"routes-search"},Wn=["value"],Gn=["aria-expanded"],Kn={key:0,class:"routes-filter-toggle__badge"},Zn={class:"routes-stats"},Yn={class:"routes-stats__item"},Xn={class:"routes-stats__item"},vn={key:0,class:"routes-filters"},eo={class:"routes-filters__section"},to={class:"routes-filters__methods"},no=["onClick"],oo={class:"routes-filters__section"},so={class:"routes-filters__status"},lo={key:0,class:"routes-filters__actions"},ao={class:"routes-content"},ro={key:0,class:"routes-loading"},io={key:1,class:"routes-error"},co={class:"routes-error__message"},mo={key:2,class:"routes-empty empty-state"},po={key:3,class:"routes-empty empty-state"},uo={class:"routes-list-panel"},fo={class:"routes-detail-panel"},yo=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"RoutesPage",setup(n){const t=Qe(),{send:o,on:l,connected:r}=le(),s=e.ref(!1),f=e.ref(null),N=["get","post","put","patch","delete","options","head","trace"];function _(){r.value&&(t.setLoading(!0),o({type:"get:registry"}))}function a(g){t.setRegistryData(g),t.setLoading(!1)}function h(g){t.selectEndpoint(g)}function S(g){t.toggleGroup(g)}function C(g){const u=g.target;t.setSearchQuery(u.value)}function x(){t.setSearchQuery(""),f.value?.focus()}function F(g){t.toggleMethodFilter(g)}function R(g){return t.filter.methods.includes(g)}function $(){const g=t.filter.hasHandler;t.setHandlerFilter(g===!0?null:!0)}function i(){const g=t.filter.hasSeed;t.setSeedFilter(g===!0?null:!0)}function c(){t.clearFilters()}function d(){s.value=!s.value}const B=e.computed(()=>t.hasActiveFilters());let q=null,k=null,y=null;return e.onMounted(()=>{q=l("registry",a),k=l("handlers:updated",()=>_()),y=l("seeds:updated",()=>_()),r.value&&_()}),e.onUnmounted(()=>{q?.(),k?.(),y?.()}),e.watch(r,g=>{g&&_()}),(g,u)=>(e.openBlock(),e.createElementBlock("div",Un,[e.createElementVNode("div",Jn,[e.createElementVNode("div",Qn,[e.createVNode(e.unref(fe),{size:16,class:"routes-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:f,type:"text",class:"routes-search__input input",placeholder:"Search endpoints...",value:e.unref(t).searchQuery,onInput:C},null,40,Wn),e.unref(t).searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"routes-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:x},[e.createVNode(e.unref(re),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filter-toggle btn btn--secondary",{"routes-filter-toggle--active":B.value}]),"aria-expanded":s.value,onClick:d},[e.createVNode(e.unref(Oe),{size:16}),u[0]||(u[0]=e.createElementVNode("span",null,"Filters",-1)),B.value?(e.openBlock(),e.createElementBlock("span",Kn,e.toDisplayString(e.unref(t).filter.methods.length+(e.unref(t).filter.hasHandler?1:0)+(e.unref(t).filter.hasSeed?1:0)),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value?e.unref(Ae):e.unref(v)),{size:14}))],10,Gn),e.createElementVNode("div",Zn,[e.createElementVNode("span",Yn,e.toDisplayString(e.unref(t).filteredEndpoints.length)+" endpoints ",1),u[1]||(u[1]=e.createElementVNode("span",{class:"routes-stats__separator"},"|",-1)),e.createElementVNode("span",Xn,e.toDisplayString(e.unref(t).allTags.length)+" tags ",1)])]),s.value?(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",eo,[u[2]||(u[2]=e.createElementVNode("h4",{class:"routes-filters__title"},"Methods",-1)),e.createElementVNode("div",to,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,z=>e.createElementVNode("button",{key:z,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${z}`,{"method-badge--inactive":!R(z)&&e.unref(t).filter.methods.length>0}]),onClick:E=>F(z)},e.toDisplayString(z.toUpperCase()),11,no)),64))])]),e.createElementVNode("div",oo,[u[5]||(u[5]=e.createElementVNode("h4",{class:"routes-filters__title"},"Status",-1)),e.createElementVNode("div",so,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasHandler}]),onClick:$},[e.createVNode(e.unref(Ve),{size:14}),u[3]||(u[3]=e.createElementVNode("span",null,"Has Handler",-1))],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasSeed}]),onClick:i},[e.createVNode(e.unref($e),{size:14}),u[4]||(u[4]=e.createElementVNode("span",null,"Has Seed",-1))],2)])]),B.value?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:c},[e.createVNode(e.unref(re),{size:14}),u[6]||(u[6]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ao,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",ro,[...u[7]||(u[7]=[e.createElementVNode("div",{class:"routes-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading endpoints...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("p",co,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:_}," Retry ")])):e.unref(t).endpoints.length===0?(e.openBlock(),e.createElementBlock("div",mo,[e.createVNode(e.unref(Be),{size:48,class:"empty-state__icon"}),u[8]||(u[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No endpoints found",-1)),u[9]||(u[9]=e.createElementVNode("p",{class:"empty-state__description"}," No API endpoints are available. Make sure your OpenAPI spec is loaded. ",-1))])):e.unref(t).filteredEndpoints.length===0?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(fe),{size:48,class:"empty-state__icon"}),u[10]||(u[10]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching endpoints",-1)),u[11]||(u[11]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),B.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:c}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",uo,[e.createVNode(jn,{groups:e.unref(t).groupedEndpoints,"selected-key":e.unref(t).selectedEndpointKey,onSelect:h,onToggleGroup:S},null,8,["groups","selected-key"])]),e.createElementVNode("div",fo,[e.createVNode(Dn,{endpoint:e.unref(t).selectedEndpoint},null,8,["endpoint"])])],64))])]))}}),[["__scopeId","data-v-bdd419e3"]])},Symbol.toStringTag,{value:"Module"})),ho={class:"timeline-detail"},_o={key:0,class:"timeline-detail__empty"},go={key:1,class:"timeline-detail__content"},ko={class:"timeline-detail__header"},Eo={class:"timeline-detail__summary"},No={class:"timeline-detail__path font-mono"},bo={class:"timeline-detail__meta"},Vo={key:1,class:"status-badge status-badge--pending"},So={class:"timeline-detail__duration"},Co={key:2,class:"timeline-detail__simulated",title:"Simulated response"},Bo={class:"timeline-detail__actions"},$o={class:"timeline-detail__info"},xo={class:"timeline-detail__info-item"},wo={class:"timeline-detail__info-value font-mono"},Do={class:"timeline-detail__info-item"},To={class:"timeline-detail__info-value font-mono"},Io={class:"timeline-detail__info-item"},zo={class:"timeline-detail__info-value font-mono"},Mo={class:"timeline-detail__section"},qo={key:0,class:"timeline-detail__subsection"},Fo=["aria-expanded"],Lo={class:"text-muted"},Ro={id:"requestQuery-panel",class:"timeline-detail__subsection-content"},Ao={class:"timeline-detail__kv-key font-mono"},Oo={class:"timeline-detail__kv-value font-mono"},Po={key:1,class:"timeline-detail__subsection"},Ho=["aria-expanded"],jo={class:"text-muted"},Uo={id:"requestHeaders-panel",class:"timeline-detail__subsection-content"},Jo={class:"timeline-detail__kv-key font-mono"},Qo={class:"timeline-detail__kv-value font-mono"},Wo={key:2,class:"timeline-detail__subsection"},Go={class:"timeline-detail__subsection-header",role:"group"},Ko=["aria-expanded"],Zo={id:"requestBody-panel",class:"timeline-detail__subsection-content"},Yo={class:"timeline-detail__json"},Xo={key:0,class:"timeline-detail__section"},vo={key:0,class:"timeline-detail__subsection"},es=["aria-expanded"],ts={class:"text-muted"},ns={id:"responseHeaders-panel",class:"timeline-detail__subsection-content"},os={class:"timeline-detail__kv-key font-mono"},ss={class:"timeline-detail__kv-value font-mono"},ls={key:1,class:"timeline-detail__subsection"},as={class:"timeline-detail__subsection-header",role:"group"},rs=["aria-expanded"],is={id:"responseBody-panel",class:"timeline-detail__subsection-content"},cs={class:"timeline-detail__json"},ds={key:1,class:"timeline-detail__section timeline-detail__section--pending"},ms={class:"timeline-detail__pending"},ps=J(e.defineComponent({__name:"TimelineDetail",props:{entry:{}},setup(n){const t=n,o=e.ref({requestHeaders:!0,requestQuery:!0,requestBody:!0,responseHeaders:!0,responseBody:!0}),l=e.ref(null),r=e.computed(()=>t.entry?new Date(t.entry.request.timestamp).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}):""),s=e.computed(()=>t.entry?.duration==null?"pending...":t.entry.duration<1e3?`${t.entry.duration}ms`:`${(t.entry.duration/1e3).toFixed(2)}s`),f=e.computed(()=>t.entry?.status?t.entry.status<200?"status-badge--1xx":t.entry.status<300?"status-badge--2xx":t.entry.status<400?"status-badge--3xx":t.entry.status<500?"status-badge--4xx":"status-badge--5xx":"status-badge--pending"),N=e.computed(()=>t.entry?.request.query?Object.keys(t.entry.request.query).length>0:!1),_=e.computed(()=>t.entry?.request.headers?Object.keys(t.entry.request.headers).length>0:!1),a=e.computed(()=>t.entry?.request.body!==void 0&&t.entry?.request.body!==null),h=e.computed(()=>t.entry?.response?.headers?Object.keys(t.entry.response.headers).length>0:!1),S=e.computed(()=>t.entry?.response?.body!==void 0&&t.entry?.response?.body!==null);function C($){try{return JSON.stringify($,null,2)}catch{return String($)}}function x($){o.value[$]=!o.value[$]}async function F($,i){try{await navigator.clipboard.writeText($),l.value=i,setTimeout(()=>{l.value=null},2e3)}catch(c){console.error("Failed to copy:",c)}}async function R(){if(!t.entry)return;const $={request:t.entry.request,response:t.entry.response};await F(JSON.stringify($,null,2),"full")}return($,i)=>(e.openBlock(),e.createElementBlock("div",ho,[n.entry?(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",ko,[e.createElementVNode("div",Eo,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Ne)(n.entry.request.method)),3),e.createElementVNode("span",No,e.toDisplayString(n.entry.request.path),1)]),e.createElementVNode("div",bo,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",f.value])},e.toDisplayString(n.entry.status),3)):(e.openBlock(),e.createElementBlock("span",Vo,"pending")),e.createElementVNode("span",So,[e.createVNode(e.unref(K),{size:14}),e.createTextVNode(" "+e.toDisplayString(s.value),1)]),n.entry.simulated?(e.openBlock(),e.createElementBlock("span",Co,[e.createVNode(e.unref(oe),{size:14}),i[9]||(i[9]=e.createTextVNode(" Simulated ",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bo,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--sm",title:"Copy as JSON",onClick:R},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="full"?e.unref(pe):e.unref(Se)),{size:14})),e.createTextVNode(" "+e.toDisplayString(l.value==="full"?"Copied!":"Copy JSON"),1)])])]),e.createElementVNode("div",$o,[e.createElementVNode("div",xo,[i[10]||(i[10]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Timestamp",-1)),e.createElementVNode("span",wo,e.toDisplayString(r.value),1)]),e.createElementVNode("div",Do,[i[11]||(i[11]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Operation ID",-1)),e.createElementVNode("span",To,e.toDisplayString(n.entry.request.operationId),1)]),e.createElementVNode("div",Io,[i[12]||(i[12]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Request ID",-1)),e.createElementVNode("span",zo,e.toDisplayString(n.entry.id),1)])]),e.createElementVNode("div",Mo,[i[16]||(i[16]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Request",-1)),N.value?(e.openBlock(),e.createElementBlock("div",qo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":o.value.requestQuery,"aria-controls":"requestQuery-panel",onClick:i[0]||(i[0]=c=>x("requestQuery"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.requestQuery?e.unref(v):e.unref(ne)),{size:16})),i[13]||(i[13]=e.createElementVNode("span",null,"Query Parameters",-1)),e.createElementVNode("span",Lo,"("+e.toDisplayString(Object.keys(n.entry.request.query).length)+")",1)],8,Fo),e.withDirectives(e.createElementVNode("div",Ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.query,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Ao,e.toDisplayString(d),1),e.createElementVNode("span",Oo,e.toDisplayString(Array.isArray(c)?c.join(", "):c),1)]))),128))],512),[[e.vShow,o.value.requestQuery]])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":o.value.requestHeaders,"aria-controls":"requestHeaders-panel",onClick:i[1]||(i[1]=c=>x("requestHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.requestHeaders?e.unref(v):e.unref(ne)),{size:16})),i[14]||(i[14]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",jo,"("+e.toDisplayString(Object.keys(n.entry.request.headers).length)+")",1)],8,Ho),e.withDirectives(e.createElementVNode("div",Uo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.headers,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Jo,e.toDisplayString(d),1),e.createElementVNode("span",Qo,e.toDisplayString(c),1)]))),128))],512),[[e.vShow,o.value.requestHeaders]])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Go,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":o.value.requestBody,"aria-controls":"requestBody-panel",onClick:i[2]||(i[2]=c=>x("requestBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.requestBody?e.unref(v):e.unref(ne)),{size:16})),i[15]||(i[15]=e.createElementVNode("span",null,"Body",-1))],8,Ko),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:i[3]||(i[3]=e.withModifiers(c=>F(C(n.entry.request.body),"reqBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="reqBody"?e.unref(pe):e.unref(Se)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",Zo,[e.createElementVNode("pre",Yo,e.toDisplayString(C(n.entry.request.body)),1)],512),[[e.vShow,o.value.requestBody]])])):e.createCommentVNode("",!0)]),n.entry.response?(e.openBlock(),e.createElementBlock("div",Xo,[i[19]||(i[19]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),h.value?(e.openBlock(),e.createElementBlock("div",vo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":o.value.responseHeaders,"aria-controls":"responseHeaders-panel",onClick:i[4]||(i[4]=c=>x("responseHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.responseHeaders?e.unref(v):e.unref(ne)),{size:16})),i[17]||(i[17]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",ts,"("+e.toDisplayString(Object.keys(n.entry.response.headers).length)+")",1)],8,es),e.withDirectives(e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.response.headers,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",os,e.toDisplayString(d),1),e.createElementVNode("span",ss,e.toDisplayString(c),1)]))),128))],512),[[e.vShow,o.value.responseHeaders]])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",ls,[e.createElementVNode("div",as,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":o.value.responseBody,"aria-controls":"responseBody-panel",onClick:i[5]||(i[5]=c=>x("responseBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.responseBody?e.unref(v):e.unref(ne)),{size:16})),i[18]||(i[18]=e.createElementVNode("span",null,"Body",-1))],8,rs),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:i[6]||(i[6]=e.withModifiers(c=>F(C(n.entry.response.body),"resBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="resBody"?e.unref(pe):e.unref(Se)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",is,[e.createElementVNode("pre",cs,e.toDisplayString(C(n.entry.response.body)),1)],512),[[e.vShow,o.value.responseBody]])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ds,[i[21]||(i[21]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),e.createElementVNode("div",ms,[e.createVNode(e.unref(K),{size:24,class:"timeline-detail__pending-icon"}),i[20]||(i[20]=e.createElementVNode("span",{class:"text-muted"},"Waiting for response...",-1))])]))])):(e.openBlock(),e.createElementBlock("div",_o,[e.createVNode(e.unref(K),{size:48,class:"timeline-detail__empty-icon"}),i[7]||(i[7]=e.createElementVNode("h3",{class:"timeline-detail__empty-title"},"Select an entry",-1)),i[8]||(i[8]=e.createElementVNode("p",{class:"timeline-detail__empty-description"}," Click on a timeline entry to view its details. ",-1))]))]))}}),[["__scopeId","data-v-b4bdd2d2"]]),us={class:"timeline-entry__time font-mono text-muted"},fs={class:"timeline-entry__method"},ys={class:"timeline-entry__path font-mono"},hs={class:"timeline-entry__status"},_s={key:1,class:"status-badge status-badge--pending"},gs={class:"timeline-entry__duration font-mono text-muted"},ks={key:0,class:"timeline-entry__simulated",title:"Simulated response"},Es=J(e.defineComponent({__name:"TimelineEntry",props:{entry:{},isSelected:{type:Boolean,default:!1}},emits:["select"],setup(n,{emit:t}){const o=n,l=t,r=e.computed(()=>new Date(o.entry.request.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})),s=e.computed(()=>o.entry.duration===null?"pending...":o.entry.duration<1e3?`${o.entry.duration}ms`:`${(o.entry.duration/1e3).toFixed(2)}s`),f=e.computed(()=>o.entry.status===null?"status-badge--pending":o.entry.status<200?"status-badge--1xx":o.entry.status<300?"status-badge--2xx":o.entry.status<400?"status-badge--3xx":o.entry.status<500?"status-badge--4xx":"status-badge--5xx"),N=e.computed(()=>o.entry.status===null?K:o.entry.status<400?st:xe),_=e.computed(()=>o.entry.response===null);function a(){l("select",o.entry.id)}return(h,S)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(["timeline-entry",{"timeline-entry--selected":n.isSelected},{"timeline-entry--pending":_.value},{"timeline-entry--simulated":n.entry.simulated}]),onClick:a},[e.createElementVNode("div",us,e.toDisplayString(r.value),1),e.createElementVNode("div",fs,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Ne)(n.entry.request.method)),3)]),e.createElementVNode("div",ys,e.toDisplayString(n.entry.request.path),1),e.createElementVNode("div",hs,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",f.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N.value),{size:12})),e.createTextVNode(" "+e.toDisplayString(n.entry.status),1)],2)):(e.openBlock(),e.createElementBlock("span",_s,[e.createVNode(e.unref(K),{size:12}),S[0]||(S[0]=e.createTextVNode(" pending ",-1))]))]),e.createElementVNode("div",gs,e.toDisplayString(s.value),1),n.entry.simulated?(e.openBlock(),e.createElementBlock("div",ks,[e.createVNode(e.unref(oe),{size:14})])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-a073dbdf"]]),Ns={class:"timeline-page"},bs={class:"timeline-toolbar"},Vs={class:"timeline-search"},Ss=["value"],Cs=["aria-expanded"],Bs={key:0,class:"timeline-filter-toggle__badge"},$s={class:"timeline-stats"},xs={class:"timeline-stats__item"},ws={key:0,class:"timeline-stats__separator"},Ds={key:1,class:"timeline-stats__item"},Ts=["disabled"],Is={key:0,class:"timeline-filters"},zs={class:"timeline-filters__section"},Ms={class:"timeline-filters__methods"},qs=["onClick"],Fs={class:"timeline-filters__section"},Ls={class:"timeline-filters__status"},Rs=["onClick"],As={class:"timeline-filters__status-count"},Os={class:"timeline-filters__section"},Ps={class:"timeline-filters__type"},Hs={key:0,class:"timeline-filters__actions"},js={class:"timeline-content"},Us={key:0,class:"timeline-loading"},Js={key:1,class:"timeline-error"},Qs={class:"timeline-error__message"},Ws={key:2,class:"timeline-empty empty-state"},Gs={key:3,class:"timeline-empty empty-state"},Ks={class:"timeline-list-panel"},Zs={class:"timeline-list"},Ys={class:"timeline-detail-panel"},Xs=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"TimelinePage",setup(n){const t=Yt(),{send:o,on:l,connected:r}=le(),s=e.ref(!1),f=e.ref(null),N=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD","TRACE"],_=["2xx","3xx","4xx","5xx"];function a(){r.value&&(t.setLoading(!0),o({type:"get:timeline"}))}function h(M){t.setTimelineData(M),t.setLoading(!1)}function S(M){t.addRequest(M)}function C(M){t.addResponse(M)}function x(){t.clearTimeline()}function F(){o({type:"clear:timeline"}),t.clearTimeline()}function R(M){t.selectEntry(M)}function $(M){const m=M.target;t.setSearchQuery(m.value)}function i(){t.setSearchQuery(""),f.value?.focus()}function c(M){t.toggleMethodFilter(M)}function d(M){return t.filter.methods.includes(M)}function B(M){t.toggleStatusFilter(M)}function q(M){return t.filter.statusCodes.includes(M)}function k(){const M=t.filter.simulatedOnly;t.setSimulatedFilter(M===!0?null:!0)}function y(){t.clearFilters()}function g(){s.value=!s.value}const u=e.computed(()=>t.hasActiveFilters()),z=e.computed(()=>t.filter.methods.length+t.filter.statusCodes.length+(t.filter.simulatedOnly!==null?1:0));let E=null,D=null,A=null,j=null;return e.onMounted(()=>{E=l("timeline",h),D=l("request",S),A=l("response",C),j=l("timeline:cleared",x),r.value&&a()}),e.onUnmounted(()=>{E?.(),D?.(),A?.(),j?.()}),e.watch(r,M=>{M&&a()}),(M,m)=>(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",bs,[e.createElementVNode("div",Vs,[e.createVNode(e.unref(fe),{size:16,class:"timeline-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:f,type:"text",class:"timeline-search__input input",placeholder:"Search by path or operation...",value:e.unref(t).filter.searchQuery,onInput:$},null,40,Ss),e.unref(t).filter.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"timeline-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:i},[e.createVNode(e.unref(re),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filter-toggle btn btn--secondary",{"timeline-filter-toggle--active":u.value}]),"aria-expanded":s.value,onClick:g},[e.createVNode(e.unref(Oe),{size:16}),m[0]||(m[0]=e.createElementVNode("span",null,"Filters",-1)),z.value>0?(e.openBlock(),e.createElementBlock("span",Bs,e.toDisplayString(z.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value?e.unref(Ae):e.unref(v)),{size:14}))],10,Cs),e.createElementVNode("div",$s,[e.createElementVNode("span",xs,e.toDisplayString(e.unref(t).filteredEntries.length)+" requests ",1),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",ws,"|")):e.createCommentVNode("",!0),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",Ds," avg "+e.toDisplayString(e.unref(t).averageDuration)+"ms ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"btn btn--secondary btn--icon",title:"Clear timeline",disabled:e.unref(t).entries.length===0,onClick:F},[e.createVNode(e.unref(ye),{size:16})],8,Ts)]),s.value?(e.openBlock(),e.createElementBlock("div",Is,[e.createElementVNode("div",zs,[m[1]||(m[1]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Methods",-1)),e.createElementVNode("div",Ms,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,b=>e.createElementVNode("button",{key:b,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${b.toLowerCase()}`,{"method-badge--inactive":!d(b)&&e.unref(t).filter.methods.length>0}]),onClick:w=>c(b)},e.toDisplayString(b),11,qs)),64))])]),e.createElementVNode("div",Fs,[m[2]||(m[2]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Status",-1)),e.createElementVNode("div",Ls,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,b=>e.createElementVNode("button",{key:b,type:"button",class:e.normalizeClass(["timeline-filters__status-btn",`timeline-filters__status-btn--${b}`,{"timeline-filters__status-btn--active":q(b)}]),onClick:w=>B(b)},[e.createTextVNode(e.toDisplayString(b)+" ",1),e.createElementVNode("span",As," ("+e.toDisplayString(e.unref(t).statusCounts[b])+") ",1)],10,Rs)),64))])]),e.createElementVNode("div",Os,[m[3]||(m[3]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Type",-1)),e.createElementVNode("div",Ps,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filters__status-btn",{"timeline-filters__status-btn--active":e.unref(t).filter.simulatedOnly}]),onClick:k}," Simulated only ",2)])]),u.value?(e.openBlock(),e.createElementBlock("div",Hs,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:y},[e.createVNode(e.unref(re),{size:14}),m[4]||(m[4]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",js,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",Us,[...m[5]||(m[5]=[e.createElementVNode("div",{class:"timeline-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading timeline...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Js,[e.createElementVNode("p",Qs,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:a}," Retry ")])):e.unref(t).entries.length===0?(e.openBlock(),e.createElementBlock("div",Ws,[e.createVNode(e.unref(K),{size:48,class:"empty-state__icon"}),m[6]||(m[6]=e.createElementVNode("h3",{class:"empty-state__title"},"No requests yet",-1)),m[7]||(m[7]=e.createElementVNode("p",{class:"empty-state__description"}," API requests will appear here in real-time as they are made. ",-1))])):e.unref(t).filteredEntries.length===0?(e.openBlock(),e.createElementBlock("div",Gs,[e.createVNode(e.unref(fe),{size:48,class:"empty-state__icon"}),m[8]||(m[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching requests",-1)),m[9]||(m[9]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:y}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ks,[e.createElementVNode("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).filteredEntries,b=>(e.openBlock(),e.createBlock(Es,{key:b.id,entry:b,"is-selected":e.unref(t).selectedEntryId===b.id,onSelect:R},null,8,["entry","is-selected"]))),128))])]),e.createElementVNode("div",Ys,[e.createVNode(ps,{entry:e.unref(t).selectedEntry},null,8,["entry"])])],64))])]))}}),[["__scopeId","data-v-a5c73778"]])},Symbol.toStringTag,{value:"Module"}));function Le(n,t){return n.length<=t?n:`${n.slice(0,t)}…`}function vs(n){return n==null?"--":typeof n=="string"?Le(n,50):typeof n=="number"||typeof n=="boolean"?String(n):Array.isArray(n)||typeof n=="object"?Le(JSON.stringify(n),50):String(n)}function Ye(n,t){if(!(typeof n!="object"||n===null))return n[t]}function el(n,t,o){const l=Ye(n,t);return typeof l=="string"||typeof l=="number"?l:o}function tl(n,t){if(n.length===0)return[];const o=new Set;for(const r of n)if(typeof r=="object"&&r!==null)for(const s of Object.keys(r))o.add(s);if(o.size===0)return[];const l=Array.from(o);return l.includes(t)?[t,...l.filter(r=>r!==t)]:l}const nl={class:"data-table"},ol={key:0,class:"data-table__empty"},sl={key:1,class:"data-table__container"},ll={class:"data-table__table"},al=["onClick"],rl={class:"data-table__row-num"},il={key:2,class:"data-table__footer"},cl={class:"data-table__info"},dl={class:"data-table__info"},ml=J(e.defineComponent({__name:"DataTable",props:{items:{},idField:{},selectedIndex:{default:-1}},emits:["select"],setup(n,{emit:t}){const o=n,l=t,r=e.computed(()=>tl(o.items,o.idField));function s(N){l("select",N)}function f(N,_){return el(N,o.idField,_)}return(N,_)=>(e.openBlock(),e.createElementBlock("div",nl,[n.items.length===0?(e.openBlock(),e.createElementBlock("div",ol,[e.createVNode(e.unref(ue),{size:32,class:"data-table__empty-icon"}),_[0]||(_[0]=e.createElementVNode("span",null,"No items",-1))])):(e.openBlock(),e.createElementBlock("div",sl,[e.createElementVNode("table",ll,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[_[1]||(_[1]=e.createElementVNode("th",{class:"data-table__row-num"},"#",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,a=>(e.openBlock(),e.createElementBlock("th",{key:a,class:e.normalizeClass(["data-table__header",{"data-table__header--id":a===n.idField}])},e.toDisplayString(a),3))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(a,h)=>(e.openBlock(),e.createElementBlock("tr",{key:f(a,h),class:e.normalizeClass(["data-table__row",{"data-table__row--selected":h===n.selectedIndex}]),onClick:S=>s(h)},[e.createElementVNode("td",rl,e.toDisplayString(h+1),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,S=>(e.openBlock(),e.createElementBlock("td",{key:S,class:e.normalizeClass(["data-table__cell",{"data-table__cell--id":S===n.idField}])},e.toDisplayString(e.unref(vs)(e.unref(Ye)(a,S))),3))),128))],10,al))),128))])])])),n.items.length>0?(e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("span",cl,e.toDisplayString(n.items.length)+" items",1),e.createElementVNode("span",dl,e.toDisplayString(r.value.length)+" columns",1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-dcdce8f7"]]),pl={class:"json-editor"},ul={class:"json-editor__container"},fl=["value","readonly","placeholder"],yl={class:"json-editor__status"},hl={class:"json-editor__status-left"},_l={key:0,class:"json-editor__valid"},gl={key:1,class:"json-editor__error"},kl={class:"json-editor__status-right"},El={class:"json-editor__info"},Nl=J(e.defineComponent({__name:"JsonEditor",props:{modelValue:{},readonly:{type:Boolean,default:!1},placeholder:{default:"Enter JSON data..."},minHeight:{default:200}},emits:["update:modelValue"],setup(n,{expose:t,emit:o}){const l=n,r=o,s=e.ref(""),f=e.ref(null),N=e.computed(()=>f.value===null),_=e.computed(()=>s.value.split(`
|
|
2
|
-
`).length),
|
|
3
|
-
`),q=B.length,k=B[B.length-1].length+1;f.value=`Line ${q}, Column ${k}: ${i.message}`}else f.value=i.message}else f.value="Invalid JSON"}}function F(){try{const i=JSON.parse(s.value);s.value=JSON.stringify(i,null,2),f.value=null,r("update:modelValue",i)}catch{}}function R(i){if(i.key==="Tab"){i.preventDefault();const c=i.target,d=c.selectionStart,B=c.selectionEnd,q=`${s.value.substring(0,d)} ${s.value.substring(B)}`;s.value=q,setTimeout(()=>{c.selectionStart=c.selectionEnd=d+2},0),x()}}function $(i){const c=i.target;h.value&&(h.value.scrollTop=c.scrollTop)}return t({formatJson:F,isValid:N}),(i,c)=>(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("div",ul,[e.createElementVNode("div",{ref_key:"linesRef",ref:h,class:"json-editor__lines","aria-hidden":"true"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"json-editor__line-number"},e.toDisplayString(d),1))),128))],512),e.createElementVNode("textarea",{value:s.value,readonly:n.readonly,placeholder:n.placeholder,style:e.normalizeStyle({"--json-editor-min-height":`${n.minHeight}px`}),class:"json-editor__textarea",spellcheck:"false",onInput:C,onKeydown:R,onScroll:$},null,44,fl)]),e.createElementVNode("div",yl,[e.createElementVNode("div",hl,[N.value?(e.openBlock(),e.createElementBlock("div",_l,[e.createVNode(e.unref(pe),{size:14}),c[0]||(c[0]=e.createElementVNode("span",null,"Valid JSON",-1))])):f.value?(e.openBlock(),e.createElementBlock("div",gl,[e.createVNode(e.unref(ot),{size:14}),e.createElementVNode("span",null,e.toDisplayString(f.value),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",kl,[e.createElementVNode("span",El,e.toDisplayString(_.value)+" lines",1)])])]))}}),[["__scopeId","data-v-a953e764"]]),ce=e.ref([]),Q=e.reactive({visible:!1,title:"",message:"",confirmText:"Confirm",cancelText:"Cancel",onConfirm:null,onCancel:null}),ae=new Map;let H=null,bl=0;function Vl(){return`toast-${Date.now()}-${bl++}`}function be(n,t,o=3e3){const l=Vl(),r={id:l,type:n,message:t,duration:o,timestamp:Date.now()};if(ce.value.push(r),o>0){const s=setTimeout(()=>{Xe(l),ae.delete(l)},o);ae.set(l,s)}return l}function Xe(n){const t=ae.get(n);t!==void 0&&(clearTimeout(t),ae.delete(n));const o=ce.value.findIndex(l=>l.id===n);o!==-1&&ce.value.splice(o,1)}function Sl(){function n(_,a){return be("success",_,a)}function t(_,a){return be("error",_,a)}function o(_,a){return be("info",_,a)}function l(_,a){return be("warning",_,a)}function r(_,a){return new Promise(h=>{H&&(H(!1),H=null),H=h,Q.visible=!0,Q.title=a?.title||"Confirm",Q.message=_,Q.confirmText=a?.confirmText||"Confirm",Q.cancelText=a?.cancelText||"Cancel",Q.onConfirm=()=>{Q.visible=!1,H&&(H(!0),H=null)},Q.onCancel=()=>{Q.visible=!1,H&&(H(!1),H=null)}})}function s(){Q.visible=!1,H&&(H(!1),H=null)}function f(_){Xe(_)}function N(){for(const _ of ae.values())clearTimeout(_);ae.clear(),ce.value=[]}return{toasts:ce,confirmDialog:Q,success:n,error:t,info:o,warning:l,dismiss:f,clearAll:N,confirm:r,closeConfirm:s}}const Cl={class:"models-page"},Bl={class:"models-sidebar"},$l={class:"models-sidebar__header"},xl={class:"models-sidebar__badge"},wl={key:0,class:"models-sidebar__loading"},Dl={key:1,class:"models-sidebar__list"},Tl=["onClick"],Il={class:"models-sidebar__name"},zl={class:"models-sidebar__count"},Ml={class:"models-sidebar__footer"},ql={class:"models-sidebar__stat"},Fl={class:"font-mono"},Ll={class:"models-content"},Rl={class:"models-toolbar"},Al={class:"models-toolbar__title"},Ol={class:"font-mono"},Pl={class:"text-muted"},Hl={key:0,class:"models-toolbar__badge models-toolbar__badge--warning"},jl={class:"models-toolbar__actions"},Ul=["disabled"],Jl=["disabled"],Ql={key:0,class:"models-error"},Wl={class:"models-panels"},Gl={class:"models-panel"},Kl={class:"models-panel"},Zl={key:1,class:"models-loading-overlay"},Yl={key:1,class:"empty-state"},Xl={key:0,class:"models-error"},vl={class:"modal__body"},ea={class:"modal__footer"},ta=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"ModelsPage",setup(n){const t=Kt(),{send:o,on:l,connected:r}=le(),{success:s,error:f,confirm:N}=Sl(),_=e.ref(null),a=e.ref(!1),h=e.ref(-1);e.onMounted(async()=>{try{await t.fetchSchemas(),t.schemas.length>0&&!t.selectedSchema&&await t.selectSchemaByName(t.schemas[0].name)}catch(c){t.error||(t.error=c instanceof Error?c.message:"Failed to load schemas")}}),l("store:updated",c=>{const d=c;if(typeof c!="object"||c===null||typeof d.schema!="string"||typeof d.action!="string"||typeof d.count!="number"){console.warn("[ModelsPage] Invalid store:updated payload:",c);return}t.handleStoreUpdate(c),h.value=-1}),l("reseeded",c=>{const d=c;if(typeof c!="object"||c===null||typeof d.success!="boolean"||!Array.isArray(d.schemas)){console.warn("[ModelsPage] Invalid reseeded payload:",c);return}t.handleReseedComplete(c),h.value=-1}),e.watch(()=>t.selectedSchema,async()=>{h.value=-1,_.value&&t.currentItems.length>0&&(await e.nextTick(),_.value?.formatJson())}),e.watch(()=>t.currentItems,(c,d)=>{const B=h.value;if(B<0)return;if(B>=c.length){h.value=-1;return}const q=t.currentSchema?.idField??"id",k=d?.[B],y=c[B];if(k!==y){if(typeof k=="object"&&k!==null&&typeof y=="object"&&y!==null){const g=k[q],u=y[q];if(g!==void 0&&g===u)return}h.value=-1}});async function S(c){t.isDirty&&!await N("You have unsaved changes. Are you sure you want to switch schemas?",{title:"Unsaved Changes",confirmText:"Switch Schema",cancelText:"Cancel"})||await t.selectSchemaByName(c)}async function C(){if(!_.value?.isValid){f("Cannot save invalid JSON. Please fix the errors first.");return}if(await t.saveItems())s("Items saved successfully");else{const d=t.error||"Failed to save items";f(d)}}async function x(){if(!t.isDirty)return;await N("Discard all changes and revert to saved data?",{title:"Discard Changes",confirmText:"Discard",cancelText:"Cancel"})&&(t.discardChanges(),s("Changes discarded"))}async function F(){a.value=!1;try{if(await t.clearSchema())s("Schema cleared successfully");else{const d=t.error||"Failed to clear schema";f(d)}}catch(c){const d=c instanceof Error?c.message:"Failed to clear schema";f(d)}}async function R(){if(!r.value){f("WebSocket not connected. Cannot trigger reseed.");return}await N("This will regenerate all seed data and replace existing items. Continue?",{title:"Reseed All Schemas",confirmText:"Reseed",cancelText:"Cancel"})&&(o({type:"reseed"}),s("Reseed command sent"))}function $(c){t.updateItems(c)}function i(c){h.value=h.value===c?-1:c}return(c,d)=>(e.openBlock(),e.createElementBlock("div",Cl,[e.createElementVNode("aside",Bl,[e.createElementVNode("div",$l,[e.createVNode(e.unref(ue),{size:18}),d[4]||(d[4]=e.createElementVNode("span",null,"Schemas",-1)),e.createElementVNode("span",xl,e.toDisplayString(e.unref(t).schemaCount),1)]),e.unref(t).loading&&e.unref(t).schemas.length===0?(e.openBlock(),e.createElementBlock("div",wl,[...d[5]||(d[5]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):(e.openBlock(),e.createElementBlock("div",Dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).schemas,B=>(e.openBlock(),e.createElementBlock("button",{key:B.name,class:e.normalizeClass(["models-sidebar__item",{"models-sidebar__item--active":e.unref(t).selectedSchema===B.name}]),onClick:q=>S(B.name)},[e.createElementVNode("span",Il,e.toDisplayString(B.name),1),e.createElementVNode("span",zl,e.toDisplayString(B.count),1)],10,Tl))),128))])),e.createElementVNode("div",Ml,[e.createElementVNode("div",ql,[d[6]||(d[6]=e.createElementVNode("span",{class:"text-muted"},"Total Items:",-1)),e.createElementVNode("span",Fl,e.toDisplayString(e.unref(t).totalItems),1)])])]),e.createElementVNode("main",Ll,[e.unref(t).selectedSchema?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Rl,[e.createElementVNode("div",Al,[e.createElementVNode("span",Ol,e.toDisplayString(e.unref(t).selectedSchema),1),e.createElementVNode("span",Pl,"("+e.toDisplayString(e.unref(t).currentItems.length)+" items)",1),e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("span",Hl," Unsaved ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",jl,[e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",title:"Discard changes",onClick:x},[e.createVNode(e.unref(re),{size:16}),d[7]||(d[7]=e.createElementVNode("span",null,"Discard",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{disabled:!e.unref(t).isDirty||e.unref(t).loading,class:"btn btn--primary",title:"Save changes",onClick:C},[e.createVNode(e.unref(it),{size:16}),d[8]||(d[8]=e.createElementVNode("span",null,"Save",-1))],8,Ul),e.createElementVNode("button",{class:"btn btn--danger",title:"Clear all items",onClick:d[0]||(d[0]=B=>a.value=!0)},[e.createVNode(e.unref(ye),{size:16}),d[9]||(d[9]=e.createElementVNode("span",null,"Clear",-1))]),e.createElementVNode("button",{disabled:!e.unref(r),class:"btn btn--secondary",title:"Reseed all schemas with generated data",onClick:R},[e.createVNode(e.unref(rt),{size:16}),d[10]||(d[10]=e.createElementVNode("span",null,"Reseed All",-1))],8,Jl)])]),e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Ql,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wl,[e.createElementVNode("div",Gl,[e.createVNode(Nl,{ref_key:"jsonEditorRef",ref:_,"model-value":e.unref(t).currentItems,readonly:e.unref(t).loading,"min-height":400,"onUpdate:modelValue":$},null,8,["model-value","readonly"])]),e.createElementVNode("div",Kl,[e.createVNode(ml,{items:e.unref(t).currentItems,"id-field":e.unref(t).currentSchema?.idField??"id","selected-index":h.value,onSelect:i},null,8,["items","id-field","selected-index"])])]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("div",Zl,[...d[11]||(d[11]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",Yl,[e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Xl,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(ue),{size:48,class:"empty-state__icon"}),d[12]||(d[12]=e.createElementVNode("h3",{class:"empty-state__title"},"Select a schema",-1)),d[13]||(d[13]=e.createElementVNode("p",{class:"empty-state__description"}," Choose a schema from the sidebar to view and edit its data. ",-1))],64))]))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:d[3]||(d[3]=B=>a.value=!1)},[e.createElementVNode("div",{class:"modal",onClick:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[d[17]||(d[17]=e.createElementVNode("div",{class:"modal__header"},[e.createElementVNode("h3",null,"Clear Schema Data")],-1)),e.createElementVNode("div",vl,[e.createElementVNode("p",null,[d[14]||(d[14]=e.createTextVNode(" Are you sure you want to clear all items for ",-1)),e.createElementVNode("strong",null,e.toDisplayString(e.unref(t).selectedSchema),1),d[15]||(d[15]=e.createTextVNode("? ",-1))]),d[16]||(d[16]=e.createElementVNode("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e.createElementVNode("div",ea,[e.createElementVNode("button",{class:"btn btn--ghost",onClick:d[1]||(d[1]=B=>a.value=!1)}," Cancel "),e.createElementVNode("button",{class:"btn btn--danger",onClick:F}," Clear Schema ")])])])):e.createCommentVNode("",!0)]))]))}}),[["__scopeId","data-v-62a953d5"]])},Symbol.toStringTag,{value:"Module"})),na={class:"simulator-page"},oa={class:"simulator-form card"},sa={class:"simulator-form__header"},la={class:"simulator-form__body"},aa={key:0,class:"simulator-form__row"},ra=["value"],ia={class:"simulator-form__row"},ca=["value"],da={class:"simulator-presets"},ma=["title","onClick"],pa={class:"simulator-preset__label"},ua=["disabled"],fa={class:"simulator-active"},ya={class:"simulator-active__header"},ha={class:"simulator-active__title"},_a=["disabled"],ga={class:"simulator-active__list"},ka={class:"simulator-simulation__info"},Ea={class:"simulator-simulation__path font-mono"},Na={class:"simulator-simulation__preset"},ba={key:0,class:"text-muted"},Va=["disabled","onClick"],Sa={key:0,class:"empty-state"},Ca=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"SimulatorPage",setup(n){const t=Zt(),o=Qe(),{send:l,on:r,connected:s}=le(),f=e.ref(""),N=e.ref("GET"),_=e.ref(null),a=e.ref(null),h=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"];let S=[];const C=e.ref(new Set),x=e.computed(()=>o.endpoints.map(y=>({key:y.key,label:`${y.method.toUpperCase()} ${y.path}`,method:y.method.toUpperCase(),path:y.path,operationId:y.operationId}))),F=e.computed(()=>{const y=f.value.trim()!=="",g=_.value!==null;return y&&g}),R=e.computed(()=>t.activeSimulations.map(y=>{const g=y.presetId?t.getPreset(y.presetId):null;return{...y,preset:g}})),$=e.computed(()=>t.count);function i(){if(!F.value||!_.value||!t.getPreset(_.value))return;const g=f.value.trim();if(!g.startsWith("/")){t.setError("Path must start with /");return}if(g.length>500){t.setError("Path is too long (max 500 characters)");return}if(!/^\/[\w\-/{}:.]*$/.test(g)){t.setError("Path contains invalid characters");return}const u=`${N.value.toLowerCase()}:${g}`,z=t.createSimulationFromPreset(u,_.value,void 0);z&&(t.addSimulationLocal(z,!0),t.setLoading(!0),l({type:"set:simulation",data:{path:z.path,status:z.status,delay:z.delay,body:z.body}}),f.value="",_.value=null,a.value=null)}function c(y){t.removeSimulationLocal(y,!0),t.setLoading(!0),l({type:"clear:simulation",data:{path:y}})}function d(){if($.value!==0){for(const y of t.activeSimulations)C.value.add(y.path),t.removeSimulationLocal(y.path,!0),l({type:"clear:simulation",data:{path:y.path}});t.setLoading(!0)}}function B(){if(!a.value)return;const y=o.endpoints.find(g=>g.key===a.value);y&&(N.value=y.method.toUpperCase(),f.value=y.path)}function q(){a.value=null}function k(){s.value&&(t.setLoading(!0),l({type:"get:registry"}))}return e.onMounted(()=>{S=[r("simulation:active",y=>{t.setSimulations(y.simulations),t.setLoading(!1)}),r("simulation:added",y=>{t.handleSimulationAdded(y)}),r("simulation:removed",y=>{t.handleSimulationRemoved(y)}),r("simulations:cleared",y=>{t.handleSimulationsCleared(y)}),r("simulation:set",y=>{t.handleSimulationSet(y)}),r("simulation:cleared",y=>{C.value.has(y.path)&&C.value.delete(y.path),t.handleSimulationCleared(y)})],s.value&&k()}),e.onUnmounted(()=>{for(const y of S)y()}),e.watch(s,y=>{y?k():t.setLoading(!1)}),(y,g)=>(e.openBlock(),e.createElementBlock("div",na,[e.createElementVNode("div",oa,[e.createElementVNode("div",sa,[e.createVNode(e.unref(oe),{size:18}),g[3]||(g[3]=e.createElementVNode("span",null,"Add Simulation",-1))]),e.createElementVNode("div",la,[x.value.length>0?(e.openBlock(),e.createElementBlock("div",aa,[g[5]||(g[5]=e.createElementVNode("label",{class:"simulator-form__label"},"Select Endpoint (optional):",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[0]||(g[0]=u=>a.value=u),class:"input",onChange:B},[g[4]||(g[4]=e.createElementVNode("option",{value:null},"Manual entry...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,u=>(e.openBlock(),e.createElementBlock("option",{key:u.key,value:u.key},e.toDisplayString(u.label),9,ra))),128))],544),[[e.vModelSelect,a.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",ia,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[1]||(g[1]=u=>N.value=u),class:"simulator-form__method input",onChange:q},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,u=>e.createElementVNode("option",{key:u,value:u},e.toDisplayString(u),9,ca)),64))],544),[[e.vModelSelect,N.value]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[2]||(g[2]=u=>f.value=u),type:"text",class:"simulator-form__path input",placeholder:"/api/path",onInput:q},null,544),[[e.vModelText,f.value]])]),e.createElementVNode("div",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).presets,u=>(e.openBlock(),e.createElementBlock("button",{key:u.id,class:e.normalizeClass(["simulator-preset",{"simulator-preset--selected":_.value===u.id},`simulator-preset--${u.type}`]),title:u.description,onClick:z=>_.value=u.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.type==="delay"?e.unref(K):e.unref(xe)),{size:14})),e.createElementVNode("span",pa,e.toDisplayString(u.label),1)],10,ma))),128))]),e.createElementVNode("button",{class:"btn btn--primary",disabled:!F.value||e.unref(t).isLoading,onClick:i},[e.createVNode(e.unref(at),{size:16}),g[6]||(g[6]=e.createElementVNode("span",null,"Add Simulation",-1))],8,ua)])]),e.createElementVNode("div",fa,[e.createElementVNode("div",ya,[e.createElementVNode("span",ha," Active Simulations ("+e.toDisplayString($.value)+") ",1),$.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",disabled:e.unref(t).isLoading,onClick:d},[e.createVNode(e.unref(ye),{size:14}),g[7]||(g[7]=e.createElementVNode("span",null,"Clear All",-1))],8,_a)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.path,class:"simulator-simulation card"},[e.createElementVNode("div",ka,[e.createElementVNode("span",Ea,e.toDisplayString(u.path),1)]),e.createElementVNode("div",Na,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.preset?.type==="delay"?e.unref(K):e.unref(xe)),{size:14,class:e.normalizeClass({"text-warning":u.preset?.type==="delay","text-error":u.preset?.type==="error","text-muted":u.preset?.type==="empty"})},null,8,["class"])),e.createElementVNode("span",null,e.toDisplayString(u.preset?.label||`HTTP ${u.status}`),1),u.delay?(e.openBlock(),e.createElementBlock("span",ba," ("+e.toDisplayString(u.delay)+"ms) ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn btn--ghost btn--icon",title:"Remove simulation",disabled:e.unref(t).isLoading,onClick:z=>c(u.path)},[e.createVNode(e.unref(ye),{size:14})],8,Va)]))),128)),$.value===0?(e.openBlock(),e.createElementBlock("div",Sa,[e.createVNode(e.unref(oe),{size:48,class:"empty-state__icon"}),g[8]||(g[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No active simulations",-1)),g[9]||(g[9]=e.createElementVNode("p",{class:"empty-state__description"}," Add a simulation above to test error handling and slow responses. ",-1))])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-3076fbb2"]])},Symbol.toStringTag,{value:"Module"}));U.bootstrap=Ze,U.useTheme=en,U.useWebSocket=le,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(Q,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("pinia"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","pinia","vue","vue-router"],K):(Q=typeof globalThis<"u"?globalThis:Q||self,K(Q.ViteOpenApiDevtools={},Q.Pinia,Q.Vue,Q.VueRouter))})(this,(function(Q,K,e,fe){"use strict";const Ue=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lt=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,i)=>i?i.toUpperCase():s.toLowerCase()),at=n=>{const t=lt(n);return t.charAt(0).toUpperCase()+t.slice(1)},rt=(...n)=>n.filter((t,s,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===s).join(" ").trim();var he={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const it=({size:n,strokeWidth:t=2,absoluteStrokeWidth:s,color:i,iconNode:c,name:a,class:u,...p},{slots:g})=>e.h("svg",{...he,width:n||he.width,height:n||he.height,stroke:i||he.stroke,"stroke-width":s?Number(t)*24/Number(n):t,class:rt("lucide",...a?[`lucide-${Ue(at(a))}-icon`,`lucide-${Ue(a)}`]:["lucide-icon"]),...p},[...c.map(d=>e.h(...d)),...g.default?[g.default()]:[]]);const z=(n,t)=>(s,{slots:i})=>e.h(it,{...s,iconNode:t,name:n},i);const ye=z("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const ne=z("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const se=z("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Je=z("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const ct=z("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const dt=z("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const v=z("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const we=z("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const xe=z("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const _e=z("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const De=z("file-json",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);const Qe=z("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);const mt=z("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const pt=z("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ut=z("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Te=z("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const ft=z("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const ge=z("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const ht=z("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const Ie=z("sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);const yt=z("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const ke=z("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Me=z("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const _t=z("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const gt=z("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const ce=z("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const le=z("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),kt="#94a3b8",ee=K.defineStore("specs",()=>{const n=e.ref([]),t=e.ref(null),s=e.computed(()=>new Map(n.value.map(f=>[f.id,f]))),i=e.computed(()=>n.value.map(f=>f.id)),c=e.computed(()=>t.value?s.value.get(t.value)??null:null),a=e.computed(()=>t.value!==null);function u(f){n.value=f,t.value&&!f.some(N=>N.id===t.value)&&(t.value=null)}function p(f){t.value=f!==null&&!n.value.some(N=>N.id===f)?null:f}function g(f){t.value===f?t.value=null:p(f)}function d(f){return s.value.get(f)?.color??kt}return{specs:n,activeSpecFilter:t,specMap:s,specIds:i,activeSpec:c,isFiltered:a,setSpecs:u,setFilter:p,toggleFilter:g,getColor:d}}),ze={path:"/_ws",reconnectDelay:2e3,maxReconnectAttempts:Number.POSITIVE_INFINITY,autoConnect:!0},j=e.ref("disconnected"),Fe=e.ref(null),de=e.ref(0);let A=null,Ee=null,ae={...ze},qe=!1;const Z=new Map;function We(){return typeof window<"u"&&typeof WebSocket<"u"}function Et(){return e.getCurrentInstance()!==null}function St(n){return We()?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${n}`:`ws://localhost${n}`}function Ge(){Ee!==null&&(clearTimeout(Ee),Ee=null)}function Nt(n,t){const s=Z.get(n);if(s)for(const c of s)try{c(t)}catch(a){console.error(`[DevTools WebSocket] Error in event handler for '${n}':`,a)}const i=Z.get("*");if(i)for(const c of i)try{c({type:n,data:t})}catch(a){console.error("[DevTools WebSocket] Error in wildcard event handler:",a)}}function bt(){j.value="connected",de.value=0,Ge()}function Vt(n){for(const t of n)U({type:"get:registry",data:{specId:t.id}}),U({type:"get:timeline",data:{specId:t.id}})}function Ct(n){try{const t=JSON.parse(n.data);if(t.type==="connected"){const s=t.data;Fe.value=s.serverVersion,s.specs&&Array.isArray(s.specs)&&(ee().setSpecs(s.specs),Vt(s.specs))}Nt(t.type,t.data)}catch(t){console.error("[DevTools WebSocket] Failed to parse message:",t)}}function Bt(){j.value,j.value="disconnected",A=null,de.value<ae.maxReconnectAttempts&&(j.value="reconnecting",de.value++,Ee=setTimeout(()=>{Le()},ae.reconnectDelay))}function $t(n){console.error("[DevTools WebSocket] Error:",n)}function Le(){if(!We()||j.value==="connecting"||j.value==="connected"||A&&(A.readyState===WebSocket.CONNECTING||A.readyState===WebSocket.OPEN))return;Ke(),j.value="connecting";const n=St(ae.path);try{A=new WebSocket(n),A.onopen=bt,A.onmessage=Ct,A.onclose=Bt,A.onerror=$t}catch(t){console.error("[DevTools WebSocket] Failed to create WebSocket:",t),j.value="disconnected"}}function Ke(){A&&(A.onopen=null,A.onmessage=null,A.onclose=null,A.onerror=null,(A.readyState===WebSocket.OPEN||A.readyState===WebSocket.CONNECTING)&&A.close(),A=null)}function Ze(){Ge(),Ke(),j.value="disconnected",de.value=0}function U(n){if(!A||A.readyState!==WebSocket.OPEN)return!1;try{return A.send(JSON.stringify(n)),!0}catch(t){return console.error("[DevTools WebSocket] Failed to send command:",t),!1}}function wt(){return U({type:"get:specs"})}function xt(n){return U({type:"get:registry",data:n?{specId:n}:void 0})}function Dt(n,t){const s={};return n&&(s.specId=n),t!==void 0&&(s.limit=t),U({type:"get:timeline",data:Object.keys(s).length>0?s:void 0})}function Tt(n){return U({type:"clear:timeline",data:n?{specId:n}:void 0})}function It(n,t){return U({type:"get:store",data:{specId:n,schema:t}})}function Mt(n,t,s){return U({type:"set:store",data:{specId:n,schema:t,items:s}})}function zt(n,t){return U({type:"clear:store",data:{specId:n,schema:t}})}function Ft(n,t){return U({type:"set:simulation",data:{specId:n,...t}})}function qt(n,t){return U({type:"clear:simulation",data:{specId:n,path:t}})}function Lt(n){return U({type:"reseed",data:{specId:n}})}function Re(n,t){Z.has(n)||Z.set(n,new Set);const s=Z.get(n);return s&&s.add(t),()=>{const i=Z.get(n);i&&(i.delete(t),i.size===0&&Z.delete(n))}}function Ae(n,t){const s=Z.get(n);s&&(s.delete(t),s.size===0&&Z.delete(n))}function Rt(n,t){const s=i=>{Ae(n,s),t(i)};return Re(n,s)}function At(n,t){const s=i=>{t(i)===!0&&Ae(n,s)};return Re(n,s)}function Ot(){Ze(),Fe.value=null,Z.clear(),ae={...ze},qe=!1}function re(n={}){(!qe||j.value==="disconnected")&&(ae={...ze,...n},qe=!0);const t=e.computed(()=>j.value==="connected"),s=e.computed(()=>j.value==="reconnecting");return Et()&&e.onMounted(()=>{ae.autoConnect&&Le()}),{connectionState:e.computed(()=>j.value),connected:t,isReconnecting:s,serverVersion:e.computed(()=>Fe.value),reconnectAttempts:e.computed(()=>de.value),connect:Le,disconnect:Ze,send:U,on:Re,off:Ae,once:Rt,onUntil:At,resetState:Ot,getSpecs:wt,getRegistry:xt,getTimeline:Dt,clearTimeline:Tt,getStore:It,setStore:Mt,clearStore:zt,setSimulation:Ft,clearSimulation:qt,reseed:Lt}}const Ye=[{path:"/",redirect:"/routes"},{path:"/routes",name:"routes",component:()=>Promise.resolve().then(()=>Eo),meta:{title:"Routes",icon:"route"}},{path:"/timeline",name:"timeline",component:()=>Promise.resolve().then(()=>ol),meta:{title:"Timeline",icon:"clock"}},{path:"/models",name:"models",component:()=>Promise.resolve().then(()=>aa),meta:{title:"Models",icon:"database"}},{path:"/simulator",name:"simulator",component:()=>Promise.resolve().then(()=>Da),meta:{title:"Simulator",icon:"zap"}},{path:"/:pathMatch(.*)*",name:"not-found",redirect:"/routes"}],Ht=fe.createRouter({history:fe.createWebHashHistory(),routes:Ye}),Pt={class:"app"},jt={class:"app-header"},Ut={class:"app-header__brand"},Jt={class:"app-nav",role:"tablist","aria-label":"DevTools navigation"},Qt=["aria-selected","aria-current","aria-controls","onClick"],Wt={class:"app-nav__label"},Gt={class:"app-header__status"},Kt={class:"connection-status"},Zt={class:"connection-status__text"},Yt={class:"app-main"},Xt=e.defineComponent({__name:"App",setup(n){const t=fe.useRoute(),s=fe.useRouter(),i=e.computed(()=>Ye.filter(d=>d.name&&d.meta?.title).map(d=>({name:d.name,path:d.path,title:d.meta?.title,icon:d.meta?.icon}))),c=e.computed(()=>t.name);function a(d){s.push(d)}const u={route:Te,clock:v,database:_e,zap:le};function p(d){return u[d]??Te}const{connected:g}=re();return(d,f)=>{const N=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",Pt,[e.createElementVNode("header",jt,[e.createElementVNode("div",Ut,[e.createVNode(e.unref(le),{class:"app-header__logo",size:20}),f[0]||(f[0]=e.createElementVNode("span",{class:"app-header__title"},"OpenAPI DevTools",-1))]),e.createElementVNode("nav",Jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,C=>(e.openBlock(),e.createElementBlock("button",{key:C.name,role:"tab","aria-selected":c.value===C.name,"aria-current":c.value===C.name?"true":void 0,"aria-controls":`panel-${C.name}`,tabindex:0,class:e.normalizeClass(["app-nav__tab",{"app-nav__tab--active":c.value===C.name}]),onClick:I=>a(C.path)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p(C.icon)),{size:16,class:"app-nav__icon"})),e.createElementVNode("span",Wt,e.toDisplayString(C.title),1)],10,Qt))),128))]),e.createElementVNode("div",Gt,[e.createElementVNode("div",Kt,[e.createElementVNode("span",{class:e.normalizeClass(["connection-status__dot",e.unref(g)?"connection-status__dot--connected":"connection-status__dot--disconnected"])},null,2),e.createElementVNode("span",Zt,e.toDisplayString(e.unref(g)?"Connected":"Disconnected"),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(g)?e.unref(gt):e.unref(_t)),{size:14,class:"connection-status__icon"}))])])]),e.createElementVNode("main",Yt,[e.createVNode(N,null,{default:e.withCtx(({Component:C})=>[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C)))]),_:2},1024)]),_:1})])])}}}),W=(n,t)=>{const s=n.__vccOpts||n;for(const[i,c]of t)s[i]=c;return s},vt=W(Xt,[["__scopeId","data-v-0a83e2b9"]]);function Se(n){try{return structuredClone(e.toRaw(n))}catch{return JSON.parse(JSON.stringify(n))}}function Ne(n){return n?`/_api/${encodeURIComponent(n)}`:"/_api"}const en=K.defineStore("models",()=>{const n=ee(),t=e.ref(new Map),s=e.ref(null),i=e.ref(null),c=e.ref([]),a=e.ref([]),u=e.ref(!1),p=e.ref(null);function g(l){if(!s.value||!i.value)return;const b=t.value.get(i.value);if(!b)return;const M=b.findIndex(y=>y.name===s.value);M!==-1&&(b[M].count=l)}const d=e.computed(()=>{const l=n.activeSpecFilter;if(l)return t.value.get(l)??[];const b=[];for(const[,M]of t.value)b.push(...M);return b}),f=e.computed(()=>{if(!s.value||!i.value)return null;const l=t.value.get(i.value);return l?l.find(b=>b.name===s.value)??null:null}),N=e.ref(!1),C=e.computed(()=>N.value),I=e.computed(()=>d.value.length),q=e.computed(()=>d.value.reduce((l,b)=>l+b.count,0));async function L(l){u.value=!0,p.value=null;try{const b=await fetch(`${Ne(l)}/store`);if(!b.ok)throw new Error(`Failed to fetch schemas: ${b.statusText}`);const $=((await b.json()).schemas??[]).map(F=>({...F,specId:l}));t.value.set(l,$)}catch(b){p.value=b instanceof Error?b.message:"Failed to fetch schemas",console.error("[ModelsStore] Error fetching schemas:",b)}finally{u.value=!1}}async function T(l,b){s.value===b&&i.value===l||(s.value=b,i.value=l,await m(l,b))}async function m(l,b){u.value=!0,p.value=null;try{const M=await fetch(`${Ne(l)}/store/${encodeURIComponent(b)}`);if(!M.ok)throw new Error(`Failed to fetch schema data: ${M.statusText}`);const y=await M.json(),$=y.items??[];c.value=Se($),a.value=Se($),N.value=!1;const F=t.value.get(l);if(F){const D=F.findIndex(w=>w.name===b);D!==-1&&(F[D].count=y.count)}}catch(M){p.value=M instanceof Error?M.message:"Failed to fetch schema data",console.error("[ModelsStore] Error fetching schema data:",M)}finally{u.value=!1}}function V(l){if(!Array.isArray(l)){p.value="Invalid data: Expected an array of items",console.error("[ModelsStore] updateItems received non-array value:",typeof l);return}c.value=l,p.value=null,N.value=!0}async function k(){if(!s.value||!i.value)return p.value="No schema selected",!1;u.value=!0,p.value=null;try{const l=await fetch(`${Ne(i.value)}/store/${encodeURIComponent(s.value)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c.value)});if(!l.ok){const M=await l.json().catch(()=>({}));throw new Error(M.error||`Failed to save items: ${l.statusText}`)}const b=await l.json();return a.value=Se(c.value),N.value=!1,g(b.created??c.value.length),!0}catch(l){return p.value=l instanceof Error?l.message:"Failed to save items",console.error("[ModelsStore] Error saving items:",l),!1}finally{u.value=!1}}async function h(){if(!s.value||!i.value)return p.value="No schema selected",!1;u.value=!0,p.value=null;try{const l=await fetch(`${Ne(i.value)}/store/${encodeURIComponent(s.value)}`,{method:"DELETE"});if(!l.ok)throw new Error(`Failed to clear schema: ${l.statusText}`);return c.value=[],a.value=[],N.value=!1,g(0),!0}catch(l){return p.value=l instanceof Error?l.message:"Failed to clear schema",console.error("[ModelsStore] Error clearing schema:",l),!1}finally{u.value=!1}}function B(){c.value=Se(a.value),N.value=!1}async function O(){s.value&&i.value?await m(i.value,s.value):i.value&&await L(i.value)}function R(){t.value.clear(),s.value=null,i.value=null,c.value=[],a.value=[],u.value=!1,p.value=null,N.value=!1}function S(l){const b=t.value.get(l.specId);if(b){const M=b.findIndex(y=>y.name===l.schema);M!==-1&&(b[M].count=l.count)}s.value===l.schema&&i.value===l.specId&&(C.value?console.warn(`[ModelsStore] Skipping auto-refresh for schema "${l.schema}" - unsaved changes exist`):m(l.specId,l.schema))}function E(l){l.success&&(L(l.specId),s.value&&i.value===l.specId&&(C.value?console.warn(`[ModelsStore] Skipping auto-refresh after reseed for schema "${s.value}" - unsaved changes exist`):m(l.specId,s.value)))}return{schemasBySpec:t,schemas:d,selectedSchema:s,selectedSpecId:i,currentItems:c,loading:u,error:p,currentSchema:f,isDirty:C,schemaCount:I,totalItems:q,fetchSchemas:L,selectSchemaByName:T,fetchSchemaData:m,updateItems:V,saveItems:k,clearSchema:h,discardChanges:B,refresh:O,reset:R,handleStoreUpdate:S,handleReseedComplete:E}}),Xe=K.defineStore("registry",()=>{const n=ee(),t=e.ref(new Map),s=e.ref(!1),i=e.ref(null),c=e.ref(""),a=e.ref({methods:[],hasHandler:null,hasSeed:null,tags:[]}),u=e.ref(null),p=e.ref(new Set),g=e.computed(()=>{const o=n.activeSpecFilter;if(o)return t.value.get(o)?.endpoints??[];const r=[];for(const[,_]of t.value)r.push(..._.endpoints);return r}),d=e.computed(()=>{const o=n.activeSpecFilter;if(o)return t.value.get(o)?.stats??{totalEndpoints:0,withCustomHandler:0,totalSchemas:0,withCustomSeed:0,autoGenerated:0};const r={totalEndpoints:0,withCustomHandler:0,totalSchemas:0,withCustomSeed:0,autoGenerated:0};for(const[,_]of t.value)r.totalEndpoints+=_.stats.totalEndpoints,r.withCustomHandler+=_.stats.withCustomHandler,r.totalSchemas+=_.stats.totalSchemas,r.withCustomSeed+=_.stats.withCustomSeed,r.autoGenerated+=_.stats.autoGenerated;return r}),f=e.computed(()=>{const o={totalEndpoints:0,withCustomHandler:0,totalSchemas:0,withCustomSeed:0,autoGenerated:0};for(const[,r]of t.value)o.totalEndpoints+=r.stats.totalEndpoints,o.withCustomHandler+=r.stats.withCustomHandler,o.totalSchemas+=r.stats.totalSchemas,o.withCustomSeed+=r.stats.withCustomSeed,o.autoGenerated+=r.stats.autoGenerated;return o}),N=e.computed(()=>{const o=new Set;for(const r of g.value)for(const _ of r.tags)o.add(_);return Array.from(o).sort()}),C=e.computed(()=>{const o=new Set;for(const r of g.value)r.responseSchema&&o.add(r.responseSchema);return Array.from(o).sort()}),I=e.computed(()=>{let o=g.value;if(c.value.trim()){const r=c.value.toLowerCase().trim();o=o.filter(_=>_.path.toLowerCase().includes(r)||_.operationId.toLowerCase().includes(r)||_.summary?.toLowerCase().includes(r)||_.tags.some(x=>x.toLowerCase().includes(r)))}return a.value.methods.length>0&&(o=o.filter(r=>a.value.methods.includes(r.method))),a.value.hasHandler!==null&&(o=o.filter(r=>r.hasHandler===a.value.hasHandler)),a.value.hasSeed!==null&&(o=o.filter(r=>r.hasSeed===a.value.hasSeed)),a.value.tags.length>0&&(o=o.filter(r=>r.tags.some(_=>a.value.tags.includes(_)))),o}),q=e.computed(()=>{const o=new Map;for(const r of I.value){let _;r.tags.length>0?_=r.tags[0]:r.responseSchema?_=r.responseSchema:_=r.path.split("/").filter(Boolean)[0]||"Other",o.has(_)||o.set(_,[]),o.get(_)?.push(r)}return Array.from(o.entries()).map(([r,_])=>({tag:r,endpoints:_.sort((x,P)=>x.path.localeCompare(P.path)),isExpanded:p.value.has(r)})).sort((r,_)=>r.tag.localeCompare(_.tag))}),L=e.computed(()=>{const o=new Map;for(const[r,_]of t.value){const x=new Map;for(const P of _.endpoints){const ue=P.tags[0]??P.responseSchema??"default";x.has(ue)||x.set(ue,[]),x.get(ue)?.push(P)}o.set(r,x)}return o}),T=e.computed(()=>u.value?g.value.find(o=>o.key===u.value)??null:null),m=e.computed(()=>g.value.filter(o=>o.hasHandler).length),V=e.computed(()=>g.value.filter(o=>o.hasSeed).length);function k(o,r){const _=r.endpoints.map(x=>({...x,specId:o}));t.value.set(o,{endpoints:_,stats:r.stats}),i.value=null;for(const x of _)x.tags.length>0&&p.value.add(x.tags[0])}function h(o){t.value.delete(o)}function B(o){s.value=o}function O(o){i.value=o,s.value=!1}function R(){i.value=null}function S(o){c.value=o}function E(o){const r=a.value.methods.indexOf(o);r===-1?a.value.methods.push(o):a.value.methods.splice(r,1)}function l(o){a.value.hasHandler=o}function b(o){a.value.hasSeed=o}function M(o){const r=a.value.tags.indexOf(o);r===-1?a.value.tags.push(o):a.value.tags.splice(r,1)}function y(){a.value={methods:[],hasHandler:null,hasSeed:null,tags:[]},c.value=""}function $(){return c.value.trim()!==""||a.value.methods.length>0||a.value.hasHandler!==null||a.value.hasSeed!==null||a.value.tags.length>0}function F(o){u.value=o}function D(o){p.value.has(o)?p.value.delete(o):p.value.add(o)}function w(){for(const o of q.value)p.value.add(o.tag)}function H(){p.value.clear()}function pe(o,r){const _=t.value.get(o);if(!_)return;const x=new Set(r);for(const P of _.endpoints)P.hasHandler=x.has(P.operationId)}function je(o,r){const _=t.value.get(o);if(!_)return;const x=new Set(r);for(const P of _.endpoints)P.hasSeed=P.responseSchema?x.has(P.responseSchema):!1}return{registries:t,endpoints:g,stats:d,isLoading:s,error:i,searchQuery:c,filter:a,selectedEndpointKey:u,expandedTags:p,globalStats:f,allTags:N,allSchemas:C,filteredEndpoints:I,groupedEndpoints:q,groupedBySpec:L,selectedEndpoint:T,handlerCount:m,seedCount:V,setRegistryData:k,removeRegistryData:h,setLoading:B,setError:O,clearError:R,setSearchQuery:S,toggleMethodFilter:E,setHandlerFilter:l,setSeedFilter:b,toggleTagFilter:M,clearFilters:y,hasActiveFilters:$,selectEndpoint:F,toggleGroup:D,expandAllGroups:w,collapseAllGroups:H,updateHandlerStatus:pe,updateSeedStatus:je}}),Oe=[{id:"slow-network",label:"Slow Network",description:"3000ms delay (3G simulation)",type:"delay",status:200,delay:3e3},{id:"server-error",label:"Server Error",description:"Returns HTTP 500",type:"error",status:500,body:{error:"Internal Server Error",message:"Simulated server error"}},{id:"rate-limit",label:"Rate Limited",description:"Returns HTTP 429",type:"error",status:429,body:{error:"Too Many Requests",message:"Rate limit exceeded"}},{id:"not-found",label:"Not Found",description:"Returns HTTP 404",type:"error",status:404,body:{error:"Not Found",message:"Resource not found"}},{id:"request-timeout",label:"Request Timeout",description:"30000ms delay (simulates timeout)",type:"delay",status:200,delay:3e4},{id:"empty-response",label:"Empty Response",description:"Returns HTTP 200 with empty body",type:"empty",status:200,body:null},{id:"unauthorized",label:"Unauthorized",description:"Returns HTTP 401",type:"error",status:401,body:{error:"Unauthorized",message:"Authentication required"}}],tn=K.defineStore("simulation",()=>{const n=ee(),t=e.ref(new Map),s=e.ref(new Map),i=e.ref(!1),c=e.ref(null),a=e.computed(()=>{const y=Array.from(t.value.values()),$=n.activeSpecFilter;return $?y.filter(F=>F.specId===$):y}),u=e.computed(()=>a.value.length),p=e.computed(()=>Oe),g=e.computed(()=>a.value.length>0),d=e.computed(()=>{const y={delay:[],error:[],empty:[]};for(const $ of a.value){const F=N($);y[F].push($)}return y}),f=e.computed(()=>t.value.size);function N(y){const $=y.presetId?Oe.find(F=>F.id===y.presetId):null;return $?$.type:y.delay&&y.delay>0?"delay":y.body===null?"empty":"error"}function C(y){t.value.clear();for(const $ of y)t.value.set($.path,$);c.value=null}function I(y,$=!1){if($){const F=t.value.get(y.path)||null;s.value.set(y.path,F)}t.value.set(y.path,y)}function q(y,$=!1){if($){const F=t.value.get(y)||null;s.value.set(y,F)}return t.value.delete(y)}function L(){t.value.clear()}function T(y){return t.value.get(y)}function m(y){return t.value.has(y)}function V(y){return Oe.find($=>$.id===y)}function k(y,$,F,D){const w=V(F);return w?{path:$,operationId:D,status:w.status,delay:w.delay,body:w.body,presetId:w.id,specId:y}:(c.value=`Preset not found: ${F}`,null)}function h(y){i.value=y}function B(y){c.value=y,i.value=!1}function O(){c.value=null}function R(y){if(!s.value.has(y))return;const $=s.value.get(y);$==null?t.value.delete(y):t.value.set(y,$),s.value.delete(y)}function S(y){console.log("[Simulation] Added:",y.path)}function E(y){q(y.path),console.log("[Simulation] Removed:",y.path)}function l(y){L(),console.log("[Simulation] Cleared all:",y.count)}function b(y){y.success?(s.value.delete(y.path),console.log("[Simulation] Set successfully:",y.path)):(R(y.path),B(`Failed to set simulation for ${y.path}`)),h(!1)}function M(y){y.success?(s.value.delete(y.path),console.log("[Simulation] Cleared successfully:",y.path)):(R(y.path),B(`Failed to clear simulation for ${y.path}`)),h(!1)}return{simulations:t,isLoading:i,error:c,activeSimulations:a,count:u,globalCount:f,presets:p,hasActiveSimulations:g,simulationsByType:d,setSimulations:C,addSimulationLocal:I,removeSimulationLocal:q,clearSimulationsLocal:L,getSimulation:T,hasSimulation:m,getPreset:V,createSimulationFromPreset:k,setLoading:h,setError:B,clearError:O,rollbackSimulation:R,handleSimulationAdded:S,handleSimulationRemoved:E,handleSimulationsCleared:l,handleSimulationSet:b,handleSimulationCleared:M}}),nn=K.defineStore("timeline",()=>{const n=ee(),t=e.ref([]),s=e.ref(!1),i=e.ref(null),c=e.ref({methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}),a=e.ref(null),u=e.ref(500),p=new Map;function g(o){return o<200?"1xx":o<300?"2xx":o<400?"3xx":o<500?"4xx":"5xx"}const d=e.computed(()=>{const o=n.activeSpecFilter;return o?t.value.filter(r=>r.specId===o):t.value}),f=e.computed(()=>{let o=d.value;if(c.value.searchQuery.trim()){const r=c.value.searchQuery.toLowerCase().trim();o=o.filter(_=>_.request.path.toLowerCase().includes(r)||_.request.operationId.toLowerCase().includes(r))}return c.value.methods.length>0&&(o=o.filter(r=>c.value.methods.includes(r.request.method.toUpperCase()))),c.value.statusCodes.length>0&&(o=o.filter(r=>{if(r.status===null)return!1;const _=g(r.status);return c.value.statusCodes.includes(_)})),c.value.simulatedOnly!==null&&(o=o.filter(r=>r.simulated===c.value.simulatedOnly)),o}),N=e.computed(()=>a.value?t.value.find(o=>o.id===a.value)??null:null),C=e.computed(()=>d.value.length),I=e.computed(()=>d.value.filter(o=>o.response!==null).length),q=e.computed(()=>d.value.filter(o=>o.response===null).length),L=e.computed(()=>{const o={"1xx":0,"2xx":0,"3xx":0,"4xx":0,"5xx":0};for(const r of d.value)if(r.status!==null){const _=g(r.status);o[_]++}return o}),T=e.computed(()=>{const o=d.value.filter(_=>_.duration!==null);if(o.length===0)return 0;const r=o.reduce((_,x)=>_+(x.duration??0),0);return Math.round(r/o.length)});function m(o,r){const _={id:o.id,request:o,response:null,status:null,duration:null,simulated:!1,specId:r},x=p.get(o.id);x&&(k(_,x),p.delete(o.id)),t.value.unshift(_),t.value.length>u.value&&(t.value=t.value.slice(0,u.value))}function V(o){const r=t.value.find(_=>_.id===o.requestId);if(r)k(r,o),p.delete(o.requestId);else if(p.set(o.requestId,o),p.size>100){const _=h(o);t.value.unshift(_),p.delete(o.requestId),t.value.length>u.value&&(t.value=t.value.slice(0,u.value))}}function k(o,r){o.response=r,o.status=r.status,o.duration=r.duration,o.simulated=r.simulated}function h(o,r="unknown"){const _={id:o.requestId,method:"UNKNOWN",path:"/unknown",operationId:"unknown",timestamp:Date.now(),headers:{},query:{},body:void 0};return{id:o.requestId,request:_,response:o,status:o.status,duration:o.duration,simulated:o.simulated,specId:r}}function B(o){for(const[r,_]of p){const x=o.get(r);x?(k(x,_),p.delete(r)):(o.set(r,h(_)),p.delete(r))}}function O(o,r){for(const[_,x]of r){const P=o.get(_);P?k(P,x):p.set(_,x)}}function R(o){for(const[r,_]of p)o.has(r)||(o.set(r,h(_)),p.delete(r))}function S(o,r){const _=new Map,x=new Map;for(const Y of o.entries)if(Y.type==="request"){const X=Y.data;_.set(X.id,{id:X.id,request:X,response:null,status:null,duration:null,simulated:!1,specId:r})}else if(Y.type==="response"){const X=Y.data;x.set(X.requestId,X)}B(_),O(_,x),R(_);const P=Array.from(_.values()).sort((Y,X)=>X.request.timestamp-Y.request.timestamp),ue=t.value.filter(Y=>Y.specId!==r),Ta=[...P,...ue].sort((Y,X)=>X.request.timestamp-Y.request.timestamp);t.value=Ta.slice(0,u.value),i.value=null}function E(o){o?t.value=t.value.filter(r=>r.specId!==o):(t.value=[],p.clear()),a.value=null}function l(o){s.value=o}function b(o){i.value=o,s.value=!1}function M(){i.value=null}function y(o){c.value.searchQuery=o}function $(o){const r=c.value.methods.indexOf(o);r===-1?c.value.methods.push(o):c.value.methods.splice(r,1)}function F(o){const r=c.value.statusCodes.indexOf(o);r===-1?c.value.statusCodes.push(o):c.value.statusCodes.splice(r,1)}function D(o){c.value.simulatedOnly=o}function w(){c.value={methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}}function H(){return c.value.searchQuery.trim()!==""||c.value.methods.length>0||c.value.statusCodes.length>0||c.value.simulatedOnly!==null}function pe(o){a.value=o}function je(o){const r=Math.max(1,o);u.value=r,t.value.length>r&&(t.value=t.value.slice(0,r))}return{entries:t,isLoading:s,error:i,filter:c,selectedEntryId:a,maxEntries:u,filteredEntries:f,selectedEntry:N,totalCount:C,completedCount:I,pendingCount:q,statusCounts:L,averageDuration:T,addRequest:m,addResponse:V,setTimelineData:S,clearTimeline:E,setLoading:l,setError:b,clearError:M,setSearchQuery:y,toggleMethodFilter:$,toggleStatusFilter:F,setSimulatedFilter:D,clearFilters:w,hasActiveFilters:H,selectEntry:pe,setMaxEntries:je}}),on=["light","dark","system"];function ve(n){return typeof n=="string"&&on.includes(n)}const He="openapi-devtools-theme",te=e.ref("system"),oe=e.ref(!1);let be=null,Ve=null;function Ce(){return typeof window<"u"&&typeof document<"u"}function sn(){return e.getCurrentInstance()!==null}function ln(){const n=e.computed(()=>te.value==="system"?oe.value?"dark":"light":te.value),t=e.computed(()=>n.value==="dark");function s(){if(!Ce())return;const d=document.documentElement;n.value==="dark"?(d.classList.add("dark"),d.classList.remove("light")):(d.classList.add("light"),d.classList.remove("dark"))}function i(d){if(!ve(d)){console.warn(`[DevTools] Invalid theme mode: ${d}`);return}if(te.value=d,Ce())try{localStorage.setItem(He,d)}catch{console.warn("[DevTools] Unable to persist theme preference")}}function c(){te.value==="system"?i(oe.value?"light":"dark"):i(te.value==="dark"?"light":"dark")}function a(){i("system")}function u(){be&&Ve&&(be.removeEventListener("change",Ve),be=null,Ve=null)}function p(){if(!Ce())return;u();const d=window.matchMedia("(prefers-color-scheme: dark)");oe.value=d.matches;const f=N=>{oe.value=N.matches};d.addEventListener("change",f),be=d,Ve=f;try{const N=localStorage.getItem(He);ve(N)&&(te.value=N)}catch{}s()}function g(){if(u(),te.value="system",oe.value=!1,Ce()){document.documentElement.classList.remove("dark","light");try{localStorage.removeItem(He)}catch{}}}return e.watch([te,oe],()=>{s()}),sn()&&(e.onMounted(()=>{p()}),e.onUnmounted(()=>{u()})),{themeMode:e.computed(()=>te.value),effectiveTheme:n,isDark:t,systemPrefersDark:e.computed(()=>oe.value),setTheme:i,toggleTheme:c,resetToSystem:a,initialize:p,resetState:g}}let et=!1,tt=null;function nt(){if(et)return tt;const n=e.createApp(vt),t=K.createPinia();return n.use(t),n.use(Ht),n.mount("#app"),et=!0,tt=n,n}typeof window<"u"&&document.getElementById("app")&&nt();function Be(n){return n.toUpperCase()}const an={class:"endpoint-detail"},rn={key:0,class:"endpoint-detail__empty"},cn={key:1,class:"endpoint-detail__content"},dn={class:"endpoint-detail__header"},mn={class:"endpoint-detail__path font-mono"},pn={class:"endpoint-detail__status"},un={key:0,class:"endpoint-detail__status-item endpoint-detail__status-item--handler"},fn={key:1,class:"endpoint-detail__status-item endpoint-detail__status-item--seed"},hn={key:2,class:"endpoint-detail__status-item endpoint-detail__status-item--security"},yn={key:3,class:"endpoint-detail__status-item endpoint-detail__status-item--auto"},_n={class:"endpoint-detail__sections"},gn={class:"endpoint-detail__section"},kn={class:"endpoint-detail__section-content font-mono"},En={key:0,class:"endpoint-detail__section"},Sn={class:"endpoint-detail__section-title"},Nn={class:"endpoint-detail__tags"},bn={key:1,class:"endpoint-detail__section"},Vn={class:"endpoint-detail__section-content"},Cn={key:2,class:"endpoint-detail__section"},Bn={class:"endpoint-detail__section-content endpoint-detail__description"},$n={key:3,class:"endpoint-detail__section"},wn={class:"endpoint-detail__section-title"},xn={class:"endpoint-detail__section-content font-mono"},Dn={key:4,class:"endpoint-detail__section"},Tn={class:"endpoint-detail__section-title"},In={class:"endpoint-detail__security"},Mn={class:"endpoint-detail__security-name font-mono"},zn={class:"endpoint-detail__security-scopes text-muted"},Fn=W(e.defineComponent({__name:"EndpointDetail",props:{endpoint:{}},setup(n){const t=n,s=e.computed(()=>t.endpoint?.security&&t.endpoint.security.length>0),i=e.computed(()=>t.endpoint?.security?t.endpoint.security.map(c=>({name:c.name,scopes:c.scopes.length>0?c.scopes.join(", "):"No scopes"})):[]);return(c,a)=>(e.openBlock(),e.createElementBlock("div",an,[n.endpoint?(e.openBlock(),e.createElementBlock("div",cn,[e.createElementVNode("header",dn,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge","method-badge--large",`method-badge--${n.endpoint.method}`])},e.toDisplayString(e.unref(Be)(n.endpoint.method)),3),e.createElementVNode("h2",mn,e.toDisplayString(n.endpoint.path),1)]),e.createElementVNode("div",pn,[n.endpoint.hasHandler?(e.openBlock(),e.createElementBlock("div",un,[e.createVNode(e.unref(we),{size:14}),a[2]||(a[2]=e.createElementVNode("span",null,"Has custom handler",-1))])):e.createCommentVNode("",!0),n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",fn,[e.createVNode(e.unref(Ie),{size:14}),a[3]||(a[3]=e.createElementVNode("span",null,"Has seed data",-1))])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",hn,[e.createVNode(e.unref(mt),{size:14}),a[4]||(a[4]=e.createElementVNode("span",null,"Requires authentication",-1))])):e.createCommentVNode("",!0),!n.endpoint.hasHandler&&!n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",yn,[e.createVNode(e.unref(De),{size:14}),a[5]||(a[5]=e.createElementVNode("span",null,"Auto-generated response",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_n,[e.createElementVNode("section",gn,[a[6]||(a[6]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Operation",-1)),e.createElementVNode("p",kn,e.toDisplayString(n.endpoint.operationId),1)]),n.endpoint.tags.length>0?(e.openBlock(),e.createElementBlock("section",En,[e.createElementVNode("h3",Sn,[e.createVNode(e.unref(yt),{size:14}),a[7]||(a[7]=e.createTextVNode(" Tags ",-1))]),e.createElementVNode("div",Nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.endpoint.tags,u=>(e.openBlock(),e.createElementBlock("span",{key:u,class:"endpoint-detail__tag"},e.toDisplayString(u),1))),128))])])):e.createCommentVNode("",!0),n.endpoint.summary?(e.openBlock(),e.createElementBlock("section",bn,[a[8]||(a[8]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Summary",-1)),e.createElementVNode("p",Vn,e.toDisplayString(n.endpoint.summary),1)])):e.createCommentVNode("",!0),n.endpoint.description?(e.openBlock(),e.createElementBlock("section",Cn,[a[9]||(a[9]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Description",-1)),e.createElementVNode("p",Bn,e.toDisplayString(n.endpoint.description),1)])):e.createCommentVNode("",!0),n.endpoint.responseSchema?(e.openBlock(),e.createElementBlock("section",$n,[e.createElementVNode("h3",wn,[e.createVNode(e.unref(De),{size:14}),a[10]||(a[10]=e.createTextVNode(" Response Schema ",-1))]),e.createElementVNode("p",xn,e.toDisplayString(n.endpoint.responseSchema),1)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("section",Dn,[e.createElementVNode("h3",Tn,[e.createVNode(e.unref(ht),{size:14}),a[11]||(a[11]=e.createTextVNode(" Security ",-1))]),e.createElementVNode("div",In,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.name,class:"endpoint-detail__security-item"},[e.createElementVNode("span",Mn,e.toDisplayString(u.name),1),e.createElementVNode("span",zn,e.toDisplayString(u.scopes),1)]))),128))])])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(e.unref(De),{size:48,class:"endpoint-detail__empty-icon"}),a[0]||(a[0]=e.createElementVNode("h3",{class:"endpoint-detail__empty-title"},"No endpoint selected",-1)),a[1]||(a[1]=e.createElementVNode("p",{class:"endpoint-detail__empty-text text-muted"}," Select an endpoint from the list to view its details ",-1))]))]))}}),[["__scopeId","data-v-c66a0f52"]]),qn={class:"endpoint-list"},Ln={key:0,class:"endpoint-list__empty"},Rn={key:1,class:"endpoint-list__groups"},An=["aria-expanded","aria-controls","onClick"],On={class:"endpoint-group__tag"},Hn={class:"endpoint-group__count text-muted"},Pn=["id","aria-label"],jn=["aria-selected","onClick"],Un={class:"endpoint-item__path font-mono"},Jn={class:"endpoint-item__indicators"},Qn={key:0,class:"endpoint-item__indicator endpoint-item__indicator--handler",title:"Has custom handler"},Wn={key:1,class:"endpoint-item__indicator endpoint-item__indicator--seed",title:"Has seed data"},Gn=W(e.defineComponent({__name:"EndpointList",props:{groups:{},selectedKey:{}},emits:["select","toggle-group"],setup(n,{emit:t}){const s=n,i=t;function c(p){i("select",p.key)}function a(p){i("toggle-group",p)}function u(p){return s.selectedKey===p.key}return(p,g)=>(e.openBlock(),e.createElementBlock("div",qn,[n.groups.length===0?(e.openBlock(),e.createElementBlock("div",Ln,[...g[0]||(g[0]=[e.createElementVNode("p",{class:"text-muted"},"No endpoints found",-1)])])):(e.openBlock(),e.createElementBlock("div",Rn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groups,d=>(e.openBlock(),e.createElementBlock("div",{key:d.tag,class:"endpoint-group"},[e.createElementVNode("button",{type:"button",class:"endpoint-group__header","aria-expanded":d.isExpanded,"aria-controls":`group-${d.tag}`,onClick:f=>a(d.tag)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.isExpanded?e.unref(ne):e.unref(se)),{size:16,class:"endpoint-group__chevron"})),e.createElementVNode("span",On,e.toDisplayString(d.tag),1),e.createElementVNode("span",Hn," ("+e.toDisplayString(d.endpoints.length)+") ",1)],8,An),e.withDirectives(e.createElementVNode("div",{id:`group-${d.tag}`,class:"endpoint-group__items",role:"group","aria-label":`${d.tag} endpoints`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.endpoints,f=>(e.openBlock(),e.createElementBlock("button",{key:f.key,type:"button",class:e.normalizeClass(["endpoint-item",{"endpoint-item--selected":u(f)}]),"aria-selected":u(f),onClick:N=>c(f)},[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${f.method}`])},e.toDisplayString(e.unref(Be)(f.method)),3),e.createElementVNode("span",Un,e.toDisplayString(f.path),1),e.createElementVNode("div",Jn,[f.hasHandler?(e.openBlock(),e.createElementBlock("span",Qn,[e.createVNode(e.unref(we),{size:12})])):e.createCommentVNode("",!0),f.hasSeed?(e.openBlock(),e.createElementBlock("span",Wn,[e.createVNode(e.unref(Ie),{size:12})])):e.createCommentVNode("",!0)])],10,jn))),128))],8,Pn),[[e.vShow,d.isExpanded]])]))),128))]))]))}}),[["__scopeId","data-v-554ffe63"]]),Kn={class:"routes-page"},Zn={class:"routes-toolbar"},Yn={class:"routes-search"},Xn=["value"],vn=["aria-expanded"],eo={key:0,class:"routes-filter-toggle__badge"},to={class:"routes-stats"},no={class:"routes-stats__item"},oo={class:"routes-stats__item"},so={key:0,class:"routes-filters"},lo={class:"routes-filters__section"},ao={class:"routes-filters__methods"},ro=["onClick"],io={class:"routes-filters__section"},co={class:"routes-filters__status"},mo={key:0,class:"routes-filters__actions"},po={class:"routes-content"},uo={key:0,class:"routes-loading"},fo={key:1,class:"routes-error"},ho={class:"routes-error__message"},yo={key:2,class:"routes-empty empty-state"},_o={key:3,class:"routes-empty empty-state"},go={class:"routes-list-panel"},ko={class:"routes-detail-panel"},Eo=Object.freeze(Object.defineProperty({__proto__:null,default:W(e.defineComponent({__name:"RoutesPage",setup(n){const t=Xe(),s=ee(),{send:i,on:c,connected:a}=re(),u=e.ref(!1),p=e.ref(null),g=["get","post","put","patch","delete","options","head","trace"];function d(){a.value&&(t.setLoading(!0),i({type:"get:registry"}))}function f(E){t.setRegistryData(s.specIds[0]??"default",E),t.setLoading(!1)}function N(E){t.selectEndpoint(E)}function C(E){t.toggleGroup(E)}function I(E){const l=E.target;t.setSearchQuery(l.value)}function q(){t.setSearchQuery(""),p.value?.focus()}function L(E){t.toggleMethodFilter(E)}function T(E){return t.filter.methods.includes(E)}function m(){const E=t.filter.hasHandler;t.setHandlerFilter(E===!0?null:!0)}function V(){const E=t.filter.hasSeed;t.setSeedFilter(E===!0?null:!0)}function k(){t.clearFilters()}function h(){u.value=!u.value}const B=e.computed(()=>t.hasActiveFilters());let O=null,R=null,S=null;return e.onMounted(()=>{O=c("registry",f),R=c("handlers:updated",()=>d()),S=c("seeds:updated",()=>d()),a.value&&d()}),e.onUnmounted(()=>{O?.(),R?.(),S?.()}),e.watch(a,E=>{E&&d()}),(E,l)=>(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("div",Zn,[e.createElementVNode("div",Yn,[e.createVNode(e.unref(ge),{size:16,class:"routes-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:p,type:"text",class:"routes-search__input input",placeholder:"Search endpoints...",value:e.unref(t).searchQuery,onInput:I},null,40,Xn),e.unref(t).searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"routes-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:q},[e.createVNode(e.unref(ce),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filter-toggle btn btn--secondary",{"routes-filter-toggle--active":B.value}]),"aria-expanded":u.value,onClick:h},[e.createVNode(e.unref(Qe),{size:16}),l[0]||(l[0]=e.createElementVNode("span",null,"Filters",-1)),B.value?(e.openBlock(),e.createElementBlock("span",eo,e.toDisplayString(e.unref(t).filter.methods.length+(e.unref(t).filter.hasHandler?1:0)+(e.unref(t).filter.hasSeed?1:0)),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value?e.unref(Je):e.unref(ne)),{size:14}))],10,vn),e.createElementVNode("div",to,[e.createElementVNode("span",no,e.toDisplayString(e.unref(t).filteredEndpoints.length)+" endpoints ",1),l[1]||(l[1]=e.createElementVNode("span",{class:"routes-stats__separator"},"|",-1)),e.createElementVNode("span",oo,e.toDisplayString(e.unref(t).allTags.length)+" tags ",1)])]),u.value?(e.openBlock(),e.createElementBlock("div",so,[e.createElementVNode("div",lo,[l[2]||(l[2]=e.createElementVNode("h4",{class:"routes-filters__title"},"Methods",-1)),e.createElementVNode("div",ao,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,b=>e.createElementVNode("button",{key:b,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${b}`,{"method-badge--inactive":!T(b)&&e.unref(t).filter.methods.length>0}]),onClick:M=>L(b)},e.toDisplayString(b.toUpperCase()),11,ro)),64))])]),e.createElementVNode("div",io,[l[5]||(l[5]=e.createElementVNode("h4",{class:"routes-filters__title"},"Status",-1)),e.createElementVNode("div",co,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasHandler}]),onClick:m},[e.createVNode(e.unref(we),{size:14}),l[3]||(l[3]=e.createElementVNode("span",null,"Has Handler",-1))],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasSeed}]),onClick:V},[e.createVNode(e.unref(Ie),{size:14}),l[4]||(l[4]=e.createElementVNode("span",null,"Has Seed",-1))],2)])]),B.value?(e.openBlock(),e.createElementBlock("div",mo,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:k},[e.createVNode(e.unref(ce),{size:14}),l[6]||(l[6]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",po,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",uo,[...l[7]||(l[7]=[e.createElementVNode("div",{class:"routes-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading endpoints...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",fo,[e.createElementVNode("p",ho,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:d}," Retry ")])):e.unref(t).endpoints.length===0?(e.openBlock(),e.createElementBlock("div",yo,[e.createVNode(e.unref(Te),{size:48,class:"empty-state__icon"}),l[8]||(l[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No endpoints found",-1)),l[9]||(l[9]=e.createElementVNode("p",{class:"empty-state__description"}," No API endpoints are available. Make sure your OpenAPI spec is loaded. ",-1))])):e.unref(t).filteredEndpoints.length===0?(e.openBlock(),e.createElementBlock("div",_o,[e.createVNode(e.unref(ge),{size:48,class:"empty-state__icon"}),l[10]||(l[10]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching endpoints",-1)),l[11]||(l[11]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),B.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:k}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",go,[e.createVNode(Gn,{groups:e.unref(t).groupedEndpoints,"selected-key":e.unref(t).selectedEndpointKey,onSelect:N,onToggleGroup:C},null,8,["groups","selected-key"])]),e.createElementVNode("div",ko,[e.createVNode(Fn,{endpoint:e.unref(t).selectedEndpoint},null,8,["endpoint"])])],64))])]))}}),[["__scopeId","data-v-c32ae519"]])},Symbol.toStringTag,{value:"Module"})),So={class:"timeline-detail"},No={key:0,class:"timeline-detail__empty"},bo={key:1,class:"timeline-detail__content"},Vo={class:"timeline-detail__header"},Co={class:"timeline-detail__summary"},Bo={class:"timeline-detail__path font-mono"},$o={class:"timeline-detail__meta"},wo={key:1,class:"status-badge status-badge--pending"},xo={class:"timeline-detail__duration"},Do={key:2,class:"timeline-detail__simulated",title:"Simulated response"},To={class:"timeline-detail__actions"},Io={class:"timeline-detail__info"},Mo={class:"timeline-detail__info-item"},zo={class:"timeline-detail__info-value font-mono"},Fo={class:"timeline-detail__info-item"},qo={class:"timeline-detail__info-value font-mono"},Lo={class:"timeline-detail__info-item"},Ro={class:"timeline-detail__info-value font-mono"},Ao={class:"timeline-detail__section"},Oo={key:0,class:"timeline-detail__subsection"},Ho=["aria-expanded"],Po={class:"text-muted"},jo={id:"requestQuery-panel",class:"timeline-detail__subsection-content"},Uo={class:"timeline-detail__kv-key font-mono"},Jo={class:"timeline-detail__kv-value font-mono"},Qo={key:1,class:"timeline-detail__subsection"},Wo=["aria-expanded"],Go={class:"text-muted"},Ko={id:"requestHeaders-panel",class:"timeline-detail__subsection-content"},Zo={class:"timeline-detail__kv-key font-mono"},Yo={class:"timeline-detail__kv-value font-mono"},Xo={key:2,class:"timeline-detail__subsection"},vo={class:"timeline-detail__subsection-header",role:"group"},es=["aria-expanded"],ts={id:"requestBody-panel",class:"timeline-detail__subsection-content"},ns={class:"timeline-detail__json"},os={key:0,class:"timeline-detail__section"},ss={key:0,class:"timeline-detail__subsection"},ls=["aria-expanded"],as={class:"text-muted"},rs={id:"responseHeaders-panel",class:"timeline-detail__subsection-content"},is={class:"timeline-detail__kv-key font-mono"},cs={class:"timeline-detail__kv-value font-mono"},ds={key:1,class:"timeline-detail__subsection"},ms={class:"timeline-detail__subsection-header",role:"group"},ps=["aria-expanded"],us={id:"responseBody-panel",class:"timeline-detail__subsection-content"},fs={class:"timeline-detail__json"},hs={key:1,class:"timeline-detail__section timeline-detail__section--pending"},ys={class:"timeline-detail__pending"},_s=W(e.defineComponent({__name:"TimelineDetail",props:{entry:{}},setup(n){const t=n,s=e.ref({requestHeaders:!0,requestQuery:!0,requestBody:!0,responseHeaders:!0,responseBody:!0}),i=e.ref(null),c=e.computed(()=>t.entry?new Date(t.entry.request.timestamp).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}):""),a=e.computed(()=>t.entry?.duration==null?"pending...":t.entry.duration<1e3?`${t.entry.duration}ms`:`${(t.entry.duration/1e3).toFixed(2)}s`),u=e.computed(()=>t.entry?.status?t.entry.status<200?"status-badge--1xx":t.entry.status<300?"status-badge--2xx":t.entry.status<400?"status-badge--3xx":t.entry.status<500?"status-badge--4xx":"status-badge--5xx":"status-badge--pending"),p=e.computed(()=>t.entry?.request.query?Object.keys(t.entry.request.query).length>0:!1),g=e.computed(()=>t.entry?.request.headers?Object.keys(t.entry.request.headers).length>0:!1),d=e.computed(()=>t.entry?.request.body!==void 0&&t.entry?.request.body!==null),f=e.computed(()=>t.entry?.response?.headers?Object.keys(t.entry.response.headers).length>0:!1),N=e.computed(()=>t.entry?.response?.body!==void 0&&t.entry?.response?.body!==null);function C(T){try{return JSON.stringify(T,null,2)}catch{return String(T)}}function I(T){s.value[T]=!s.value[T]}async function q(T,m){try{await navigator.clipboard.writeText(T),i.value=m,setTimeout(()=>{i.value=null},2e3)}catch(V){console.error("Failed to copy:",V)}}async function L(){if(!t.entry)return;const T={request:t.entry.request,response:t.entry.response};await q(JSON.stringify(T,null,2),"full")}return(T,m)=>(e.openBlock(),e.createElementBlock("div",So,[n.entry?(e.openBlock(),e.createElementBlock("div",bo,[e.createElementVNode("div",Vo,[e.createElementVNode("div",Co,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Be)(n.entry.request.method)),3),e.createElementVNode("span",Bo,e.toDisplayString(n.entry.request.path),1)]),e.createElementVNode("div",$o,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",u.value])},e.toDisplayString(n.entry.status),3)):(e.openBlock(),e.createElementBlock("span",wo,"pending")),e.createElementVNode("span",xo,[e.createVNode(e.unref(v),{size:14}),e.createTextVNode(" "+e.toDisplayString(a.value),1)]),n.entry.simulated?(e.openBlock(),e.createElementBlock("span",Do,[e.createVNode(e.unref(le),{size:14}),m[9]||(m[9]=e.createTextVNode(" Simulated ",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",To,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--sm",title:"Copy as JSON",onClick:L},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value==="full"?e.unref(ye):e.unref(xe)),{size:14})),e.createTextVNode(" "+e.toDisplayString(i.value==="full"?"Copied!":"Copy JSON"),1)])])]),e.createElementVNode("div",Io,[e.createElementVNode("div",Mo,[m[10]||(m[10]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Timestamp",-1)),e.createElementVNode("span",zo,e.toDisplayString(c.value),1)]),e.createElementVNode("div",Fo,[m[11]||(m[11]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Operation ID",-1)),e.createElementVNode("span",qo,e.toDisplayString(n.entry.request.operationId),1)]),e.createElementVNode("div",Lo,[m[12]||(m[12]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Request ID",-1)),e.createElementVNode("span",Ro,e.toDisplayString(n.entry.id),1)])]),e.createElementVNode("div",Ao,[m[16]||(m[16]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Request",-1)),p.value?(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":s.value.requestQuery,"aria-controls":"requestQuery-panel",onClick:m[0]||(m[0]=V=>I("requestQuery"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.requestQuery?e.unref(ne):e.unref(se)),{size:16})),m[13]||(m[13]=e.createElementVNode("span",null,"Query Parameters",-1)),e.createElementVNode("span",Po,"("+e.toDisplayString(Object.keys(n.entry.request.query).length)+")",1)],8,Ho),e.withDirectives(e.createElementVNode("div",jo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.query,(V,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Uo,e.toDisplayString(k),1),e.createElementVNode("span",Jo,e.toDisplayString(Array.isArray(V)?V.join(", "):V),1)]))),128))],512),[[e.vShow,s.value.requestQuery]])])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":s.value.requestHeaders,"aria-controls":"requestHeaders-panel",onClick:m[1]||(m[1]=V=>I("requestHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.requestHeaders?e.unref(ne):e.unref(se)),{size:16})),m[14]||(m[14]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",Go,"("+e.toDisplayString(Object.keys(n.entry.request.headers).length)+")",1)],8,Wo),e.withDirectives(e.createElementVNode("div",Ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.headers,(V,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Zo,e.toDisplayString(k),1),e.createElementVNode("span",Yo,e.toDisplayString(V),1)]))),128))],512),[[e.vShow,s.value.requestHeaders]])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",vo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":s.value.requestBody,"aria-controls":"requestBody-panel",onClick:m[2]||(m[2]=V=>I("requestBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.requestBody?e.unref(ne):e.unref(se)),{size:16})),m[15]||(m[15]=e.createElementVNode("span",null,"Body",-1))],8,es),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:m[3]||(m[3]=e.withModifiers(V=>q(C(n.entry.request.body),"reqBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value==="reqBody"?e.unref(ye):e.unref(xe)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",ts,[e.createElementVNode("pre",ns,e.toDisplayString(C(n.entry.request.body)),1)],512),[[e.vShow,s.value.requestBody]])])):e.createCommentVNode("",!0)]),n.entry.response?(e.openBlock(),e.createElementBlock("div",os,[m[19]||(m[19]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),f.value?(e.openBlock(),e.createElementBlock("div",ss,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":s.value.responseHeaders,"aria-controls":"responseHeaders-panel",onClick:m[4]||(m[4]=V=>I("responseHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.responseHeaders?e.unref(ne):e.unref(se)),{size:16})),m[17]||(m[17]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",as,"("+e.toDisplayString(Object.keys(n.entry.response.headers).length)+")",1)],8,ls),e.withDirectives(e.createElementVNode("div",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.response.headers,(V,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"timeline-detail__kv-row"},[e.createElementVNode("span",is,e.toDisplayString(k),1),e.createElementVNode("span",cs,e.toDisplayString(V),1)]))),128))],512),[[e.vShow,s.value.responseHeaders]])])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",ds,[e.createElementVNode("div",ms,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":s.value.responseBody,"aria-controls":"responseBody-panel",onClick:m[5]||(m[5]=V=>I("responseBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.responseBody?e.unref(ne):e.unref(se)),{size:16})),m[18]||(m[18]=e.createElementVNode("span",null,"Body",-1))],8,ps),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:m[6]||(m[6]=e.withModifiers(V=>q(C(n.entry.response.body),"resBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value==="resBody"?e.unref(ye):e.unref(xe)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",us,[e.createElementVNode("pre",fs,e.toDisplayString(C(n.entry.response.body)),1)],512),[[e.vShow,s.value.responseBody]])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",hs,[m[21]||(m[21]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),e.createElementVNode("div",ys,[e.createVNode(e.unref(v),{size:24,class:"timeline-detail__pending-icon"}),m[20]||(m[20]=e.createElementVNode("span",{class:"text-muted"},"Waiting for response...",-1))])]))])):(e.openBlock(),e.createElementBlock("div",No,[e.createVNode(e.unref(v),{size:48,class:"timeline-detail__empty-icon"}),m[7]||(m[7]=e.createElementVNode("h3",{class:"timeline-detail__empty-title"},"Select an entry",-1)),m[8]||(m[8]=e.createElementVNode("p",{class:"timeline-detail__empty-description"}," Click on a timeline entry to view its details. ",-1))]))]))}}),[["__scopeId","data-v-b4bdd2d2"]]),gs={class:"timeline-entry__time font-mono text-muted"},ks={class:"timeline-entry__method"},Es={class:"timeline-entry__path font-mono"},Ss={class:"timeline-entry__status"},Ns={key:1,class:"status-badge status-badge--pending"},bs={class:"timeline-entry__duration font-mono text-muted"},Vs={key:0,class:"timeline-entry__simulated",title:"Simulated response"},Cs=W(e.defineComponent({__name:"TimelineEntry",props:{entry:{},isSelected:{type:Boolean,default:!1}},emits:["select"],setup(n,{emit:t}){const s=n,i=t,c=e.computed(()=>new Date(s.entry.request.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})),a=e.computed(()=>s.entry.duration===null?"pending...":s.entry.duration<1e3?`${s.entry.duration}ms`:`${(s.entry.duration/1e3).toFixed(2)}s`),u=e.computed(()=>s.entry.status===null?"status-badge--pending":s.entry.status<200?"status-badge--1xx":s.entry.status<300?"status-badge--2xx":s.entry.status<400?"status-badge--3xx":s.entry.status<500?"status-badge--4xx":"status-badge--5xx"),p=e.computed(()=>s.entry.status===null?v:s.entry.status<400?dt:Me),g=e.computed(()=>s.entry.response===null);function d(){i("select",s.entry.id)}return(f,N)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(["timeline-entry",{"timeline-entry--selected":n.isSelected},{"timeline-entry--pending":g.value},{"timeline-entry--simulated":n.entry.simulated}]),onClick:d},[e.createElementVNode("div",gs,e.toDisplayString(c.value),1),e.createElementVNode("div",ks,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Be)(n.entry.request.method)),3)]),e.createElementVNode("div",Es,e.toDisplayString(n.entry.request.path),1),e.createElementVNode("div",Ss,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",u.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),{size:12})),e.createTextVNode(" "+e.toDisplayString(n.entry.status),1)],2)):(e.openBlock(),e.createElementBlock("span",Ns,[e.createVNode(e.unref(v),{size:12}),N[0]||(N[0]=e.createTextVNode(" pending ",-1))]))]),e.createElementVNode("div",bs,e.toDisplayString(a.value),1),n.entry.simulated?(e.openBlock(),e.createElementBlock("div",Vs,[e.createVNode(e.unref(le),{size:14})])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-a073dbdf"]]),Bs={class:"timeline-page"},$s={class:"timeline-toolbar"},ws={class:"timeline-search"},xs=["value"],Ds=["aria-expanded"],Ts={key:0,class:"timeline-filter-toggle__badge"},Is={class:"timeline-stats"},Ms={class:"timeline-stats__item"},zs={key:0,class:"timeline-stats__separator"},Fs={key:1,class:"timeline-stats__item"},qs=["disabled"],Ls={key:0,class:"timeline-filters"},Rs={class:"timeline-filters__section"},As={class:"timeline-filters__methods"},Os=["onClick"],Hs={class:"timeline-filters__section"},Ps={class:"timeline-filters__status"},js=["onClick"],Us={class:"timeline-filters__status-count"},Js={class:"timeline-filters__section"},Qs={class:"timeline-filters__type"},Ws={key:0,class:"timeline-filters__actions"},Gs={class:"timeline-content"},Ks={key:0,class:"timeline-loading"},Zs={key:1,class:"timeline-error"},Ys={class:"timeline-error__message"},Xs={key:2,class:"timeline-empty empty-state"},vs={key:3,class:"timeline-empty empty-state"},el={class:"timeline-list-panel"},tl={class:"timeline-list"},nl={class:"timeline-detail-panel"},ol=Object.freeze(Object.defineProperty({__proto__:null,default:W(e.defineComponent({__name:"TimelinePage",setup(n){const t=nn(),s=ee(),{send:i,on:c,connected:a}=re(),u=e.ref(!1),p=e.ref(null),g=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD","TRACE"],d=["2xx","3xx","4xx","5xx"];function f(){a.value&&(t.setLoading(!0),i({type:"get:timeline"}))}function N(D){t.setTimelineData(D,s.specIds[0]??"default"),t.setLoading(!1)}function C(D){t.addRequest(D,s.specIds[0]??"default")}function I(D){t.addResponse(D)}function q(){t.clearTimeline()}function L(){i({type:"clear:timeline"}),t.clearTimeline()}function T(D){t.selectEntry(D)}function m(D){const w=D.target;t.setSearchQuery(w.value)}function V(){t.setSearchQuery(""),p.value?.focus()}function k(D){t.toggleMethodFilter(D)}function h(D){return t.filter.methods.includes(D)}function B(D){t.toggleStatusFilter(D)}function O(D){return t.filter.statusCodes.includes(D)}function R(){const D=t.filter.simulatedOnly;t.setSimulatedFilter(D===!0?null:!0)}function S(){t.clearFilters()}function E(){u.value=!u.value}const l=e.computed(()=>t.hasActiveFilters()),b=e.computed(()=>t.filter.methods.length+t.filter.statusCodes.length+(t.filter.simulatedOnly!==null?1:0));let M=null,y=null,$=null,F=null;return e.onMounted(()=>{M=c("timeline",N),y=c("request",C),$=c("response",I),F=c("timeline:cleared",q),a.value&&f()}),e.onUnmounted(()=>{M?.(),y?.(),$?.(),F?.()}),e.watch(a,D=>{D&&f()}),(D,w)=>(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("div",$s,[e.createElementVNode("div",ws,[e.createVNode(e.unref(ge),{size:16,class:"timeline-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:p,type:"text",class:"timeline-search__input input",placeholder:"Search by path or operation...",value:e.unref(t).filter.searchQuery,onInput:m},null,40,xs),e.unref(t).filter.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"timeline-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:V},[e.createVNode(e.unref(ce),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filter-toggle btn btn--secondary",{"timeline-filter-toggle--active":l.value}]),"aria-expanded":u.value,onClick:E},[e.createVNode(e.unref(Qe),{size:16}),w[0]||(w[0]=e.createElementVNode("span",null,"Filters",-1)),b.value>0?(e.openBlock(),e.createElementBlock("span",Ts,e.toDisplayString(b.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value?e.unref(Je):e.unref(ne)),{size:14}))],10,Ds),e.createElementVNode("div",Is,[e.createElementVNode("span",Ms,e.toDisplayString(e.unref(t).filteredEntries.length)+" requests ",1),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",zs,"|")):e.createCommentVNode("",!0),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",Fs," avg "+e.toDisplayString(e.unref(t).averageDuration)+"ms ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"btn btn--secondary btn--icon",title:"Clear timeline",disabled:e.unref(t).entries.length===0,onClick:L},[e.createVNode(e.unref(ke),{size:16})],8,qs)]),u.value?(e.openBlock(),e.createElementBlock("div",Ls,[e.createElementVNode("div",Rs,[w[1]||(w[1]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Methods",-1)),e.createElementVNode("div",As,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,H=>e.createElementVNode("button",{key:H,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${H.toLowerCase()}`,{"method-badge--inactive":!h(H)&&e.unref(t).filter.methods.length>0}]),onClick:pe=>k(H)},e.toDisplayString(H),11,Os)),64))])]),e.createElementVNode("div",Hs,[w[2]||(w[2]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Status",-1)),e.createElementVNode("div",Ps,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,H=>e.createElementVNode("button",{key:H,type:"button",class:e.normalizeClass(["timeline-filters__status-btn",`timeline-filters__status-btn--${H}`,{"timeline-filters__status-btn--active":O(H)}]),onClick:pe=>B(H)},[e.createTextVNode(e.toDisplayString(H)+" ",1),e.createElementVNode("span",Us," ("+e.toDisplayString(e.unref(t).statusCounts[H])+") ",1)],10,js)),64))])]),e.createElementVNode("div",Js,[w[3]||(w[3]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Type",-1)),e.createElementVNode("div",Qs,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filters__status-btn",{"timeline-filters__status-btn--active":e.unref(t).filter.simulatedOnly}]),onClick:R}," Simulated only ",2)])]),l.value?(e.openBlock(),e.createElementBlock("div",Ws,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:S},[e.createVNode(e.unref(ce),{size:14}),w[4]||(w[4]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gs,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",Ks,[...w[5]||(w[5]=[e.createElementVNode("div",{class:"timeline-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading timeline...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Zs,[e.createElementVNode("p",Ys,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:f}," Retry ")])):e.unref(t).entries.length===0?(e.openBlock(),e.createElementBlock("div",Xs,[e.createVNode(e.unref(v),{size:48,class:"empty-state__icon"}),w[6]||(w[6]=e.createElementVNode("h3",{class:"empty-state__title"},"No requests yet",-1)),w[7]||(w[7]=e.createElementVNode("p",{class:"empty-state__description"}," API requests will appear here in real-time as they are made. ",-1))])):e.unref(t).filteredEntries.length===0?(e.openBlock(),e.createElementBlock("div",vs,[e.createVNode(e.unref(ge),{size:48,class:"empty-state__icon"}),w[8]||(w[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching requests",-1)),w[9]||(w[9]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),l.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:S}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",el,[e.createElementVNode("div",tl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).filteredEntries,H=>(e.openBlock(),e.createBlock(Cs,{key:H.id,entry:H,"is-selected":e.unref(t).selectedEntryId===H.id,onSelect:T},null,8,["entry","is-selected"]))),128))])]),e.createElementVNode("div",nl,[e.createVNode(_s,{entry:e.unref(t).selectedEntry},null,8,["entry"])])],64))])]))}}),[["__scopeId","data-v-a88e616b"]])},Symbol.toStringTag,{value:"Module"}));function Pe(n,t){return n.length<=t?n:`${n.slice(0,t)}…`}function sl(n){return n==null?"--":typeof n=="string"?Pe(n,50):typeof n=="number"||typeof n=="boolean"?String(n):Array.isArray(n)||typeof n=="object"?Pe(JSON.stringify(n),50):String(n)}function ot(n,t){if(!(typeof n!="object"||n===null))return n[t]}function ll(n,t,s){const i=ot(n,t);return typeof i=="string"||typeof i=="number"?i:s}function al(n,t){if(n.length===0)return[];const s=new Set;for(const c of n)if(typeof c=="object"&&c!==null)for(const a of Object.keys(c))s.add(a);if(s.size===0)return[];const i=Array.from(s);return i.includes(t)?[t,...i.filter(c=>c!==t)]:i}const rl={class:"data-table"},il={key:0,class:"data-table__empty"},cl={key:1,class:"data-table__container"},dl={class:"data-table__table"},ml=["onClick"],pl={class:"data-table__row-num"},ul={key:2,class:"data-table__footer"},fl={class:"data-table__info"},hl={class:"data-table__info"},yl=W(e.defineComponent({__name:"DataTable",props:{items:{},idField:{},selectedIndex:{default:-1}},emits:["select"],setup(n,{emit:t}){const s=n,i=t,c=e.computed(()=>al(s.items,s.idField));function a(p){i("select",p)}function u(p,g){return ll(p,s.idField,g)}return(p,g)=>(e.openBlock(),e.createElementBlock("div",rl,[n.items.length===0?(e.openBlock(),e.createElementBlock("div",il,[e.createVNode(e.unref(_e),{size:32,class:"data-table__empty-icon"}),g[0]||(g[0]=e.createElementVNode("span",null,"No items",-1))])):(e.openBlock(),e.createElementBlock("div",cl,[e.createElementVNode("table",dl,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[g[1]||(g[1]=e.createElementVNode("th",{class:"data-table__row-num"},"#",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,d=>(e.openBlock(),e.createElementBlock("th",{key:d,class:e.normalizeClass(["data-table__header",{"data-table__header--id":d===n.idField}])},e.toDisplayString(d),3))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(d,f)=>(e.openBlock(),e.createElementBlock("tr",{key:u(d,f),class:e.normalizeClass(["data-table__row",{"data-table__row--selected":f===n.selectedIndex}]),onClick:N=>a(f)},[e.createElementVNode("td",pl,e.toDisplayString(f+1),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,N=>(e.openBlock(),e.createElementBlock("td",{key:N,class:e.normalizeClass(["data-table__cell",{"data-table__cell--id":N===n.idField}])},e.toDisplayString(e.unref(sl)(e.unref(ot)(d,N))),3))),128))],10,ml))),128))])])])),n.items.length>0?(e.openBlock(),e.createElementBlock("div",ul,[e.createElementVNode("span",fl,e.toDisplayString(n.items.length)+" items",1),e.createElementVNode("span",hl,e.toDisplayString(c.value.length)+" columns",1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-dcdce8f7"]]),_l={class:"json-editor"},gl={class:"json-editor__container"},kl=["value","readonly","placeholder"],El={class:"json-editor__status"},Sl={class:"json-editor__status-left"},Nl={key:0,class:"json-editor__valid"},bl={key:1,class:"json-editor__error"},Vl={class:"json-editor__status-right"},Cl={class:"json-editor__info"},Bl=W(e.defineComponent({__name:"JsonEditor",props:{modelValue:{},readonly:{type:Boolean,default:!1},placeholder:{default:"Enter JSON data..."},minHeight:{default:200}},emits:["update:modelValue"],setup(n,{expose:t,emit:s}){const i=n,c=s,a=e.ref(""),u=e.ref(null),p=e.computed(()=>u.value===null),g=e.computed(()=>a.value.split(`
|
|
2
|
+
`).length),d=e.computed(()=>Array.from({length:g.value},(m,V)=>V+1)),f=e.ref(null);function N(){try{a.value=JSON.stringify(i.modelValue,null,2),u.value=null}catch{a.value="",u.value="Invalid initial value"}}N(),e.watch(()=>i.modelValue,()=>{try{const m=JSON.parse(a.value);JSON.stringify(m)!==JSON.stringify(i.modelValue)&&N()}catch{N()}});function C(m){const V=m.target;a.value=V.value,I()}function I(){if(a.value.trim()===""){u.value=null,c("update:modelValue",[]);return}try{const m=JSON.parse(a.value);u.value=null,c("update:modelValue",m)}catch(m){if(m instanceof Error){const V=m.message.match(/position (\d+)/);if(V){const k=Number.parseInt(V[1],10),h=a.value.substring(0,k).split(`
|
|
3
|
+
`),B=h.length,O=h[h.length-1].length+1;u.value=`Line ${B}, Column ${O}: ${m.message}`}else u.value=m.message}else u.value="Invalid JSON"}}function q(){try{const m=JSON.parse(a.value);a.value=JSON.stringify(m,null,2),u.value=null,c("update:modelValue",m)}catch{}}function L(m){if(m.key==="Tab"){m.preventDefault();const V=m.target,k=V.selectionStart,h=V.selectionEnd,B=`${a.value.substring(0,k)} ${a.value.substring(h)}`;a.value=B,setTimeout(()=>{V.selectionStart=V.selectionEnd=k+2},0),I()}}function T(m){const V=m.target;f.value&&(f.value.scrollTop=V.scrollTop)}return t({formatJson:q,isValid:p}),(m,V)=>(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("div",gl,[e.createElementVNode("div",{ref_key:"linesRef",ref:f,class:"json-editor__lines","aria-hidden":"true"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"json-editor__line-number"},e.toDisplayString(k),1))),128))],512),e.createElementVNode("textarea",{value:a.value,readonly:n.readonly,placeholder:n.placeholder,style:e.normalizeStyle({"--json-editor-min-height":`${n.minHeight}px`}),class:"json-editor__textarea",spellcheck:"false",onInput:C,onKeydown:L,onScroll:T},null,44,kl)]),e.createElementVNode("div",El,[e.createElementVNode("div",Sl,[p.value?(e.openBlock(),e.createElementBlock("div",Nl,[e.createVNode(e.unref(ye),{size:14}),V[0]||(V[0]=e.createElementVNode("span",null,"Valid JSON",-1))])):u.value?(e.openBlock(),e.createElementBlock("div",bl,[e.createVNode(e.unref(ct),{size:14}),e.createElementVNode("span",null,e.toDisplayString(u.value),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vl,[e.createElementVNode("span",Cl,e.toDisplayString(g.value)+" lines",1)])])]))}}),[["__scopeId","data-v-a953e764"]]),me=e.ref([]),G=e.reactive({visible:!1,title:"",message:"",confirmText:"Confirm",cancelText:"Cancel",onConfirm:null,onCancel:null}),ie=new Map;let J=null,$l=0;function wl(){return`toast-${Date.now()}-${$l++}`}function $e(n,t,s=3e3){const i=wl(),c={id:i,type:n,message:t,duration:s,timestamp:Date.now()};if(me.value.push(c),s>0){const a=setTimeout(()=>{st(i),ie.delete(i)},s);ie.set(i,a)}return i}function st(n){const t=ie.get(n);t!==void 0&&(clearTimeout(t),ie.delete(n));const s=me.value.findIndex(i=>i.id===n);s!==-1&&me.value.splice(s,1)}function xl(){function n(g,d){return $e("success",g,d)}function t(g,d){return $e("error",g,d)}function s(g,d){return $e("info",g,d)}function i(g,d){return $e("warning",g,d)}function c(g,d){return new Promise(f=>{J&&(J(!1),J=null),J=f,G.visible=!0,G.title=d?.title||"Confirm",G.message=g,G.confirmText=d?.confirmText||"Confirm",G.cancelText=d?.cancelText||"Cancel",G.onConfirm=()=>{G.visible=!1,J&&(J(!0),J=null)},G.onCancel=()=>{G.visible=!1,J&&(J(!1),J=null)}})}function a(){G.visible=!1,J&&(J(!1),J=null)}function u(g){st(g)}function p(){for(const g of ie.values())clearTimeout(g);ie.clear(),me.value=[]}return{toasts:me,confirmDialog:G,success:n,error:t,info:s,warning:i,dismiss:u,clearAll:p,confirm:c,closeConfirm:a}}const Dl={class:"models-page"},Tl={class:"models-sidebar"},Il={class:"models-sidebar__header"},Ml={class:"models-sidebar__badge"},zl={key:0,class:"models-sidebar__loading"},Fl={key:1,class:"models-sidebar__list"},ql=["onClick"],Ll={class:"models-sidebar__name"},Rl={class:"models-sidebar__count"},Al={class:"models-sidebar__footer"},Ol={class:"models-sidebar__stat"},Hl={class:"font-mono"},Pl={class:"models-content"},jl={class:"models-toolbar"},Ul={class:"models-toolbar__title"},Jl={class:"font-mono"},Ql={class:"text-muted"},Wl={key:0,class:"models-toolbar__badge models-toolbar__badge--warning"},Gl={class:"models-toolbar__actions"},Kl=["disabled"],Zl=["disabled"],Yl={key:0,class:"models-error"},Xl={class:"models-panels"},vl={class:"models-panel"},ea={class:"models-panel"},ta={key:1,class:"models-loading-overlay"},na={key:1,class:"empty-state"},oa={key:0,class:"models-error"},sa={class:"modal__body"},la={class:"modal__footer"},aa=Object.freeze(Object.defineProperty({__proto__:null,default:W(e.defineComponent({__name:"ModelsPage",setup(n){const t=en(),s=ee(),{send:i,on:c,connected:a}=re(),{success:u,error:p,confirm:g}=xl(),d=e.ref(null),f=e.ref(!1),N=e.ref(-1);e.onMounted(async()=>{try{await t.fetchSchemas(s.specIds[0]??"default"),t.schemas.length>0&&!t.selectedSchema&&await t.selectSchemaByName(s.specIds[0]??"default",t.schemas[0].name)}catch(k){t.error||(t.error=k instanceof Error?k.message:"Failed to load schemas")}}),c("store:updated",k=>{const h=k;if(typeof k!="object"||k===null||typeof h.schema!="string"||typeof h.action!="string"||typeof h.count!="number"){console.warn("[ModelsPage] Invalid store:updated payload:",k);return}t.handleStoreUpdate(k),N.value=-1}),c("reseeded",k=>{const h=k;if(typeof k!="object"||k===null||typeof h.success!="boolean"||!Array.isArray(h.schemas)){console.warn("[ModelsPage] Invalid reseeded payload:",k);return}t.handleReseedComplete(k),N.value=-1}),e.watch(()=>t.selectedSchema,async()=>{N.value=-1,d.value&&t.currentItems.length>0&&(await e.nextTick(),d.value?.formatJson())}),e.watch(()=>t.currentItems,(k,h)=>{const B=N.value;if(B<0)return;if(B>=k.length){N.value=-1;return}const O=t.currentSchema?.idField??"id",R=h?.[B],S=k[B];if(R!==S){if(typeof R=="object"&&R!==null&&typeof S=="object"&&S!==null){const E=R[O],l=S[O];if(E!==void 0&&E===l)return}N.value=-1}});async function C(k){t.isDirty&&!await g("You have unsaved changes. Are you sure you want to switch schemas?",{title:"Unsaved Changes",confirmText:"Switch Schema",cancelText:"Cancel"})||await t.selectSchemaByName(s.specIds[0]??"default",k)}async function I(){if(!d.value?.isValid){p("Cannot save invalid JSON. Please fix the errors first.");return}if(await t.saveItems())u("Items saved successfully");else{const h=t.error||"Failed to save items";p(h)}}async function q(){if(!t.isDirty)return;await g("Discard all changes and revert to saved data?",{title:"Discard Changes",confirmText:"Discard",cancelText:"Cancel"})&&(t.discardChanges(),u("Changes discarded"))}async function L(){f.value=!1;try{if(await t.clearSchema())u("Schema cleared successfully");else{const h=t.error||"Failed to clear schema";p(h)}}catch(k){const h=k instanceof Error?k.message:"Failed to clear schema";p(h)}}async function T(){if(!a.value){p("WebSocket not connected. Cannot trigger reseed.");return}await g("This will regenerate all seed data and replace existing items. Continue?",{title:"Reseed All Schemas",confirmText:"Reseed",cancelText:"Cancel"})&&(i({type:"reseed"}),u("Reseed command sent"))}function m(k){t.updateItems(k)}function V(k){N.value=N.value===k?-1:k}return(k,h)=>(e.openBlock(),e.createElementBlock("div",Dl,[e.createElementVNode("aside",Tl,[e.createElementVNode("div",Il,[e.createVNode(e.unref(_e),{size:18}),h[4]||(h[4]=e.createElementVNode("span",null,"Schemas",-1)),e.createElementVNode("span",Ml,e.toDisplayString(e.unref(t).schemaCount),1)]),e.unref(t).loading&&e.unref(t).schemas.length===0?(e.openBlock(),e.createElementBlock("div",zl,[...h[5]||(h[5]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):(e.openBlock(),e.createElementBlock("div",Fl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).schemas,B=>(e.openBlock(),e.createElementBlock("button",{key:B.name,class:e.normalizeClass(["models-sidebar__item",{"models-sidebar__item--active":e.unref(t).selectedSchema===B.name}]),onClick:O=>C(B.name)},[e.createElementVNode("span",Ll,e.toDisplayString(B.name),1),e.createElementVNode("span",Rl,e.toDisplayString(B.count),1)],10,ql))),128))])),e.createElementVNode("div",Al,[e.createElementVNode("div",Ol,[h[6]||(h[6]=e.createElementVNode("span",{class:"text-muted"},"Total Items:",-1)),e.createElementVNode("span",Hl,e.toDisplayString(e.unref(t).totalItems),1)])])]),e.createElementVNode("main",Pl,[e.unref(t).selectedSchema?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",jl,[e.createElementVNode("div",Ul,[e.createElementVNode("span",Jl,e.toDisplayString(e.unref(t).selectedSchema),1),e.createElementVNode("span",Ql,"("+e.toDisplayString(e.unref(t).currentItems.length)+" items)",1),e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("span",Wl," Unsaved ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gl,[e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",title:"Discard changes",onClick:q},[e.createVNode(e.unref(ce),{size:16}),h[7]||(h[7]=e.createElementVNode("span",null,"Discard",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{disabled:!e.unref(t).isDirty||e.unref(t).loading,class:"btn btn--primary",title:"Save changes",onClick:I},[e.createVNode(e.unref(ft),{size:16}),h[8]||(h[8]=e.createElementVNode("span",null,"Save",-1))],8,Kl),e.createElementVNode("button",{class:"btn btn--danger",title:"Clear all items",onClick:h[0]||(h[0]=B=>f.value=!0)},[e.createVNode(e.unref(ke),{size:16}),h[9]||(h[9]=e.createElementVNode("span",null,"Clear",-1))]),e.createElementVNode("button",{disabled:!e.unref(a),class:"btn btn--secondary",title:"Reseed all schemas with generated data",onClick:T},[e.createVNode(e.unref(ut),{size:16}),h[10]||(h[10]=e.createElementVNode("span",null,"Reseed All",-1))],8,Zl)])]),e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Yl,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xl,[e.createElementVNode("div",vl,[e.createVNode(Bl,{ref_key:"jsonEditorRef",ref:d,"model-value":e.unref(t).currentItems,readonly:e.unref(t).loading,"min-height":400,"onUpdate:modelValue":m},null,8,["model-value","readonly"])]),e.createElementVNode("div",ea,[e.createVNode(yl,{items:e.unref(t).currentItems,"id-field":e.unref(t).currentSchema?.idField??"id","selected-index":N.value,onSelect:V},null,8,["items","id-field","selected-index"])])]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("div",ta,[...h[11]||(h[11]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",na,[e.unref(t).error?(e.openBlock(),e.createElementBlock("div",oa,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(_e),{size:48,class:"empty-state__icon"}),h[12]||(h[12]=e.createElementVNode("h3",{class:"empty-state__title"},"Select a schema",-1)),h[13]||(h[13]=e.createElementVNode("p",{class:"empty-state__description"}," Choose a schema from the sidebar to view and edit its data. ",-1))],64))]))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:h[3]||(h[3]=B=>f.value=!1)},[e.createElementVNode("div",{class:"modal",onClick:h[2]||(h[2]=e.withModifiers(()=>{},["stop"]))},[h[17]||(h[17]=e.createElementVNode("div",{class:"modal__header"},[e.createElementVNode("h3",null,"Clear Schema Data")],-1)),e.createElementVNode("div",sa,[e.createElementVNode("p",null,[h[14]||(h[14]=e.createTextVNode(" Are you sure you want to clear all items for ",-1)),e.createElementVNode("strong",null,e.toDisplayString(e.unref(t).selectedSchema),1),h[15]||(h[15]=e.createTextVNode("? ",-1))]),h[16]||(h[16]=e.createElementVNode("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e.createElementVNode("div",la,[e.createElementVNode("button",{class:"btn btn--ghost",onClick:h[1]||(h[1]=B=>f.value=!1)}," Cancel "),e.createElementVNode("button",{class:"btn btn--danger",onClick:L}," Clear Schema ")])])])):e.createCommentVNode("",!0)]))]))}}),[["__scopeId","data-v-2ada8e9c"]])},Symbol.toStringTag,{value:"Module"})),ra={class:"simulator-page"},ia={class:"simulator-form card"},ca={class:"simulator-form__header"},da={class:"simulator-form__body"},ma={key:0,class:"simulator-form__row"},pa=["value"],ua={class:"simulator-form__row"},fa=["value"],ha={class:"simulator-presets"},ya=["title","onClick"],_a={class:"simulator-preset__label"},ga=["disabled"],ka={class:"simulator-active"},Ea={class:"simulator-active__header"},Sa={class:"simulator-active__title"},Na=["disabled"],ba={class:"simulator-active__list"},Va={class:"simulator-simulation__info"},Ca={class:"simulator-simulation__path font-mono"},Ba={class:"simulator-simulation__preset"},$a={key:0,class:"text-muted"},wa=["disabled","onClick"],xa={key:0,class:"empty-state"},Da=Object.freeze(Object.defineProperty({__proto__:null,default:W(e.defineComponent({__name:"SimulatorPage",setup(n){const t=tn(),s=ee(),i=Xe(),{send:c,on:a,connected:u}=re(),p=e.ref(""),g=e.ref("GET"),d=e.ref(null),f=e.ref(null),N=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"];let C=[];const I=e.ref(new Set),q=e.computed(()=>i.endpoints.map(S=>({key:S.key,label:`${S.method.toUpperCase()} ${S.path}`,method:S.method.toUpperCase(),path:S.path,operationId:S.operationId}))),L=e.computed(()=>{const S=p.value.trim()!=="",E=d.value!==null;return S&&E}),T=e.computed(()=>t.activeSimulations.map(S=>{const E=S.presetId?t.getPreset(S.presetId):null;return{...S,preset:E}})),m=e.computed(()=>t.count);function V(){if(!L.value||!d.value||!t.getPreset(d.value))return;const E=p.value.trim();if(!E.startsWith("/")){t.setError("Path must start with /");return}if(E.length>500){t.setError("Path is too long (max 500 characters)");return}if(!/^\/[\w\-/{}:.]*$/.test(E)){t.setError("Path contains invalid characters");return}const l=`${g.value.toLowerCase()}:${E}`,b=t.createSimulationFromPreset(s.specIds[0]??"default",l,d.value,void 0);b&&(t.addSimulationLocal(b,!0),t.setLoading(!0),c({type:"set:simulation",data:{path:b.path,status:b.status,delay:b.delay,body:b.body}}),p.value="",d.value=null,f.value=null)}function k(S){t.removeSimulationLocal(S,!0),t.setLoading(!0),c({type:"clear:simulation",data:{path:S}})}function h(){if(m.value!==0){for(const S of t.activeSimulations)I.value.add(S.path),t.removeSimulationLocal(S.path,!0),c({type:"clear:simulation",data:{path:S.path}});t.setLoading(!0)}}function B(){if(!f.value)return;const S=i.endpoints.find(E=>E.key===f.value);S&&(g.value=S.method.toUpperCase(),p.value=S.path)}function O(){f.value=null}function R(){u.value&&(t.setLoading(!0),c({type:"get:registry"}))}return e.onMounted(()=>{C=[a("simulation:active",S=>{t.setSimulations(S.simulations),t.setLoading(!1)}),a("simulation:added",S=>{t.handleSimulationAdded(S)}),a("simulation:removed",S=>{t.handleSimulationRemoved(S)}),a("simulations:cleared",S=>{t.handleSimulationsCleared(S)}),a("simulation:set",S=>{t.handleSimulationSet(S)}),a("simulation:cleared",S=>{I.value.has(S.path)&&I.value.delete(S.path),t.handleSimulationCleared(S)})],u.value&&R()}),e.onUnmounted(()=>{for(const S of C)S()}),e.watch(u,S=>{S?R():t.setLoading(!1)}),(S,E)=>(e.openBlock(),e.createElementBlock("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("div",ca,[e.createVNode(e.unref(le),{size:18}),E[3]||(E[3]=e.createElementVNode("span",null,"Add Simulation",-1))]),e.createElementVNode("div",da,[q.value.length>0?(e.openBlock(),e.createElementBlock("div",ma,[E[5]||(E[5]=e.createElementVNode("label",{class:"simulator-form__label"},"Select Endpoint (optional):",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":E[0]||(E[0]=l=>f.value=l),class:"input",onChange:B},[E[4]||(E[4]=e.createElementVNode("option",{value:null},"Manual entry...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,l=>(e.openBlock(),e.createElementBlock("option",{key:l.key,value:l.key},e.toDisplayString(l.label),9,pa))),128))],544),[[e.vModelSelect,f.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",ua,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":E[1]||(E[1]=l=>g.value=l),class:"simulator-form__method input",onChange:O},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,l=>e.createElementVNode("option",{key:l,value:l},e.toDisplayString(l),9,fa)),64))],544),[[e.vModelSelect,g.value]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[2]||(E[2]=l=>p.value=l),type:"text",class:"simulator-form__path input",placeholder:"/api/path",onInput:O},null,544),[[e.vModelText,p.value]])]),e.createElementVNode("div",ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).presets,l=>(e.openBlock(),e.createElementBlock("button",{key:l.id,class:e.normalizeClass(["simulator-preset",{"simulator-preset--selected":d.value===l.id},`simulator-preset--${l.type}`]),title:l.description,onClick:b=>d.value=l.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.type==="delay"?e.unref(v):e.unref(Me)),{size:14})),e.createElementVNode("span",_a,e.toDisplayString(l.label),1)],10,ya))),128))]),e.createElementVNode("button",{class:"btn btn--primary",disabled:!L.value||e.unref(t).isLoading,onClick:V},[e.createVNode(e.unref(pt),{size:16}),E[6]||(E[6]=e.createElementVNode("span",null,"Add Simulation",-1))],8,ga)])]),e.createElementVNode("div",ka,[e.createElementVNode("div",Ea,[e.createElementVNode("span",Sa," Active Simulations ("+e.toDisplayString(m.value)+") ",1),m.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",disabled:e.unref(t).isLoading,onClick:h},[e.createVNode(e.unref(ke),{size:14}),E[7]||(E[7]=e.createElementVNode("span",null,"Clear All",-1))],8,Na)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.path,class:"simulator-simulation card"},[e.createElementVNode("div",Va,[e.createElementVNode("span",Ca,e.toDisplayString(l.path),1)]),e.createElementVNode("div",Ba,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.preset?.type==="delay"?e.unref(v):e.unref(Me)),{size:14,class:e.normalizeClass({"text-warning":l.preset?.type==="delay","text-error":l.preset?.type==="error","text-muted":l.preset?.type==="empty"})},null,8,["class"])),e.createElementVNode("span",null,e.toDisplayString(l.preset?.label||`HTTP ${l.status}`),1),l.delay?(e.openBlock(),e.createElementBlock("span",$a," ("+e.toDisplayString(l.delay)+"ms) ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn btn--ghost btn--icon",title:"Remove simulation",disabled:e.unref(t).isLoading,onClick:b=>k(l.path)},[e.createVNode(e.unref(ke),{size:14})],8,wa)]))),128)),m.value===0?(e.openBlock(),e.createElementBlock("div",xa,[e.createVNode(e.unref(le),{size:48,class:"empty-state__icon"}),E[8]||(E[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No active simulations",-1)),E[9]||(E[9]=e.createElementVNode("p",{class:"empty-state__description"}," Add a simulation above to test error handling and slow responses. ",-1))])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-71832998"]])},Symbol.toStringTag,{value:"Module"}));Q.bootstrap=nt,Q.useTheme=ln,Q.useWebSocket=re,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})}));
|
|
4
4
|
//# sourceMappingURL=devtools.umd.cjs.map
|