import{ak as ke,ag as Ie,b as Pe,a2 as Ve,u as Le,k as He,r as d,cl as fe,cn as xe,j as e}from"./index-gnHkq9KV.js";const ve="armada_api_explorer_history",Je=["preview","body","headers","status","code"],Ue=["curl","fetch","csharp"];function Me(t){return!(!t||Array.isArray(t))}function Fe(){try{const t=localStorage.getItem(ve);return t?JSON.parse(t):[]}catch{return[]}}function ye(t){localStorage.setItem(ve,JSON.stringify(t.slice(0,12)))}function te(t,a){if(!t)return a;try{return JSON.parse(t)}catch{return a}}function je(t){const a=t.detail;return{method:t.entry.method,route:t.entry.route,routeTemplate:t.entry.routeTemplate,pathValues:te(a==null?void 0:a.pathParamsJson,{}),queryValues:te(a==null?void 0:a.queryParamsJson,{}),headerValues:te(a==null?void 0:a.requestHeadersJson,{}),bodyValue:(a==null?void 0:a.requestBodyText)||""}}function A(t,a,n=new Set){var u,r,h,p,N;if(!t)return null;if(t.$ref){const f=t.$ref.split("/").pop();return!f||n.has(f)?null:(n.add(f),A((r=(u=a==null?void 0:a.components)==null?void 0:u.schemas)==null?void 0:r[f],a,n))}return(h=t.allOf)!=null&&h.length?t.allOf.reduce((f,j)=>{const g=A(j,a,new Set(n));return{...f,...g,properties:{...f.properties||{},...(g==null?void 0:g.properties)||{}}}},{}):(p=t.oneOf)!=null&&p.length?A(t.oneOf[0],a,n):(N=t.anyOf)!=null&&N.length?A(t.anyOf[0],a,n):t}function ne(t,a){var u;const n=A(t,a);if(!n)return{};if(n.example!==void 0)return n.example;if(n.default!==void 0)return n.default;switch(n.type){case"object":{const r={};return Object.entries(n.properties||{}).forEach(([h,p])=>{r[h]=ne(p,a)}),r}case"array":return n.items?[ne(n.items,a)]:[];case"integer":case"number":return 0;case"boolean":return!1;case"string":return(u=n.enum)!=null&&u.length?n.enum[0]:n.format==="date-time"?new Date().toISOString():"";default:return{}}}function se(t,a){var u;if(t.example!==void 0)return String(t.example);const n=A(t.schema,a);return(n==null?void 0:n.default)!==void 0?String(n.default):(u=n==null?void 0:n.enum)!=null&&u.length?String(n.enum[0]):""}function Ne(t){if(!t)return"0 B";const a=["B","KB","MB","GB"];let n=t,u=0;for(;n>=1024&&u<a.length-1;)n/=1024,u+=1;return`${n.toFixed(n>=10||u===0?0:1)} ${a[u]}`}function Ce(t,a){if(!t)return"(empty)";if(a.includes("application/json"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}return t}function ze(t){const a=Object.entries(t.headers||{}),n=a.map(([j,g])=>`-H "${j}: ${g}"`).join(` \\
  `),u=a.length>0?`,
  headers: ${JSON.stringify(t.headers,null,2).replace(/\n/g,`
  `)}`:"",r=a.map(([j,g])=>`request.Headers.TryAddWithoutValidation("${j}", "${g}");`).join(`
`),h=t.body?Ce(t.body,t.contentType||"application/json"):"",p=t.body?` \\
  --data '${h.replace(/'/g,"'\\''")}'`:"",N=t.body?`,
  body: ${JSON.stringify(h)}`:"",f=t.body?`request.Content = new StringContent(${JSON.stringify(h)}, Encoding.UTF8, "${t.contentType||"application/json"}");`:"";return{curl:`curl -X ${t.method.toUpperCase()} "${t.url}"${n?` \\
  ${n}`:""}${p}`,fetch:`const response = await fetch(${JSON.stringify(t.url)}, {
  method: ${JSON.stringify(t.method.toUpperCase())}${u}${N}
});

const data = await response.text();`,csharp:`using System.Net.Http;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.${t.method.charAt(0).toUpperCase()+t.method.slice(1).toLowerCase()}, ${JSON.stringify(t.url)});
${r}${f?`
${f}`:""}
using var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();`}}function z(t){return`request-method-pill request-method-${t.toLowerCase()}`}function ge(t){var r,h;const a=(r=t.summary)==null?void 0:r.trim(),n=(h=t.description)==null?void 0:h.trim(),u=`${t.method.toUpperCase()} ${t.path}`;return n&&n!==a&&n!==u&&n!==t.path?n:a&&a!==u&&a!==t.path?a:""}function Se(t,a,n){return t?a==="headers"?JSON.stringify(t.headers,null,2):a==="status"?JSON.stringify({status:t.status,statusText:t.statusText,contentType:t.contentType,durationMs:t.durationMs,sizeBytes:t.sizeBytes},null,2):a==="code"?t.code[n]:a==="preview"?typeof t.preview=="string"?t.preview:JSON.stringify(t.preview,null,2):Ce(t.body,t.contentType):""}function De(){return window.location.origin}function _e(t){const a=[],n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\{([^}]+)\\\}/g,(u,r)=>(a.push(r),"([^/]+)"));return{regex:new RegExp(`^${n}$`),keys:a}}function be(t,a,n){const{regex:u,keys:r}=_e(t),h=u.exec(a),p={...n||{}};return h&&r.forEach((N,f)=>{(!(N in p)||p[N]==null||p[N]==="")&&(p[N]=decodeURIComponent(h[f+1]))}),p}function Qe(t,a){for(const n of t){if(n.method.toLowerCase()!==a.method.toLowerCase())continue;if(a.routeTemplate&&a.routeTemplate===n.path)return{operationId:n.id,pathValues:be(n.path,a.route,a.pathValues)};const u=be(n.path,a.route,a.pathValues);if(!(Object.keys(u).length===0&&n.path!==a.route))return{operationId:n.id,pathValues:u}}return null}function ae({title:t,parameters:a,values:n,onChange:u}){return e.jsxs("div",{className:"api-parameter-section",children:[e.jsxs("div",{className:"api-section-heading",children:[e.jsx("h4",{children:t}),e.jsx("span",{children:a.length})]}),a.length===0?e.jsx("div",{className:"api-empty-copy",children:"No parameters"}):e.jsx("div",{className:"api-input-stack",children:a.map(r=>e.jsxs("label",{className:"api-input-field",children:[e.jsx("span",{children:r.name}),e.jsx("input",{type:"text",value:n[r.name]||"",onChange:h=>u(p=>({...p,[r.name]:h.target.value})),placeholder:r.description||r.name})]},`${r.in}-${r.name}`))})]})}function Xe({response:t,responseTab:a,codeTab:n,onCodeTabChange:u}){if(a==="headers")return e.jsx("div",{className:"api-response-table",children:Object.entries(t.headers).map(([h,p])=>e.jsxs("div",{className:"api-response-row",children:[e.jsx("span",{children:h}),e.jsx("code",{children:p})]},h))});if(a==="status")return e.jsxs("div",{className:"api-status-grid",children:[e.jsxs("div",{className:"api-stat-card",children:[e.jsx("span",{children:"Status"}),e.jsx("strong",{children:t.status})]}),e.jsxs("div",{className:"api-stat-card",children:[e.jsx("span",{children:"Content Type"}),e.jsx("strong",{children:t.contentType||"n/a"})]}),e.jsxs("div",{className:"api-stat-card",children:[e.jsx("span",{children:"Duration"}),e.jsxs("strong",{children:[t.durationMs.toFixed(2)," ms"]})]}),e.jsxs("div",{className:"api-stat-card",children:[e.jsx("span",{children:"Size"}),e.jsx("strong",{children:Ne(t.sizeBytes)})]})]});if(a==="code")return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"api-tab-row nested",children:Ue.map(h=>e.jsx("button",{type:"button",className:`api-tab ${n===h?"active":""}`,onClick:()=>u(h),children:h},h))}),e.jsx("pre",{className:"api-code-block",children:t.code[n]})]});const r=Se(t,a,n);return e.jsx("pre",{className:"api-code-block",children:r||"(empty)"})}function Ke(){const{operationId:t}=ke(),a=Ie(),n=Pe(),{sessionToken:u}=Ve(),{t:r}=Le(),{pushToast:h}=He(),[p,N]=d.useState(null),[f,j]=d.useState(""),[g,re]=d.useState(!0),[ie,B]=d.useState(t||""),[V,we]=d.useState(""),[L,$e]=d.useState("All"),[k,D]=d.useState({}),[I,_]=d.useState({}),[P,Q]=d.useState({}),[O,X]=d.useState(""),[b,oe]=d.useState(null),[H,ce]=d.useState("preview"),[G,le]=d.useState("curl"),[K,de]=d.useState(()=>Fe()),[ue,W]=d.useState([]),[J,pe]=d.useState(null),[y,R]=d.useState(null),[he,Y]=d.useState(!1),Z=d.useRef(null),C=d.useMemo(()=>p!=null&&p.paths?Object.entries(p.paths).flatMap(([s,c])=>Object.entries(c).flatMap(([o,l])=>{var $,U;if(!["get","post","put","delete","patch","head"].includes(o))return[];if(!Me(l))return[];const w=[...Array.isArray(c.parameters)?c.parameters:[],...l.parameters||[]],E=w.filter((M,S)=>{const F=`${M.in}:${M.name}`;return w.findIndex(me=>`${me.in}:${me.name}`===F)===S}),v=(($=l.requestBody)==null?void 0:$.content)||{},T=v["application/json"]?"application/json":Object.keys(v)[0]||"";return[{id:l.operationId||`${o}:${s}`,method:o,path:s,summary:l.summary||`${o.toUpperCase()} ${s}`,description:l.description||"",tag:((U=l.tags)==null?void 0:U[0])||"General",parameters:E,requestBody:v[T]||null,requestBodyContentType:T}]})):[],[p]),qe=d.useMemo(()=>["All",...new Set(C.map(s=>s.tag))],[C]),q=d.useMemo(()=>C.filter(s=>{const c=L==="All"||s.tag===L,o=`${s.summary} ${s.path} ${s.tag}`.toLowerCase(),l=!V||o.includes(V.toLowerCase());return c&&l}),[V,C,L]),Oe=d.useMemo(()=>{const s=new Map;return q.forEach(c=>{const o=s.get(c.tag)||[];o.push(c),s.set(c.tag,o)}),Array.from(s.entries()).sort((c,o)=>c[0].localeCompare(o[0]))},[q]),i=d.useMemo(()=>C.find(s=>s.id===ie)||q[0]||null,[q,C,ie]),m=d.useMemo(()=>{if(!i)return null;const s=Object.entries(k).reduce((l,[x,w])=>l.replace(`{${x}}`,encodeURIComponent(w||`{${x}}`)),i.path),c=new URL(s,De());Object.entries(I).forEach(([l,x])=>{x!==""&&c.searchParams.set(l,x)});const o={};return u&&(o["X-Token"]=u),Object.entries(P).forEach(([l,x])=>{x!==""&&!["x-token"].includes(l.toLowerCase())&&(o[l]=x)}),i.requestBody&&O.trim()&&(o["Content-Type"]=i.requestBodyContentType||"application/json"),{method:i.method,url:c.toString(),headers:o,body:O.trim()||"",contentType:i.requestBodyContentType||"application/json"}},[O,P,k,I,i,u]),ee=d.useMemo(()=>Se(b,H,G),[G,b,H]);d.useEffect(()=>{const s=a.state;s!=null&&s.replayRequest&&(R(s.replayRequest),n(a.pathname,{replace:!0,state:null}))},[a.pathname,a.state,n]),d.useEffect(()=>{let s=!1;const c=new AbortController;async function o(){re(!0),j("");try{const l={};u&&(l["X-Token"]=u);const x=await fetch("/openapi.json",{headers:l,signal:c.signal});if(!x.ok)throw new Error(`Failed to load OpenAPI document (${x.status})`);const w=await x.json();s||N(w)}catch(l){!s&&!(l instanceof DOMException&&l.name==="AbortError")&&j(l instanceof Error?l.message:r("Failed to load OpenAPI document."))}finally{s||re(!1)}}return o(),()=>{s=!0,c.abort()}},[u,r]),d.useEffect(()=>{let s=!1;async function c(){try{const o=await fe({pageNumber:1,pageSize:8});s||W(o.objects||[])}catch{s||W([])}}return c(),()=>{s=!0}},[]),d.useEffect(()=>{!i&&q.length>0&&B(t||q[0].id)},[q,t,i]),d.useEffect(()=>{if(!y||!C.length||y.operationId)return;const s=Qe(C,y);if(!s){j(r("No matching OpenAPI operation was found for the replay request.")),R(null);return}R({...y,operationId:s.operationId,pathValues:{...y.pathValues,...s.pathValues}}),B(s.operationId)},[C,y,r]),d.useEffect(()=>{if(i){if((y==null?void 0:y.operationId)===i.id){D(Object.fromEntries(Object.entries(y.pathValues||{}).map(([c,o])=>[c,o||""]))),_(Object.fromEntries(Object.entries(y.queryValues||{}).map(([c,o])=>[c,o||""])));const s=Object.fromEntries(Object.entries(y.headerValues||{}).filter(([c])=>!["x-token","authorization"].includes(c.toLowerCase())).map(([c,o])=>[c,o||""]));Q(s),X(y.bodyValue||""),Z.current=i.id,R(null)}else{if(Z.current===i.id){Z.current=null;return}const s={},c={},o={};i.parameters.forEach(l=>{l.in==="path"&&(s[l.name]=se(l,p)),l.in==="query"&&(c[l.name]=se(l,p)),l.in==="header"&&!["x-token","authorization","content-type"].includes(l.name.toLowerCase())&&(o[l.name]=se(l,p))}),D(s),_(c),Q(o),X(i.requestBody?JSON.stringify(ne(i.requestBody.schema,p),null,2):"")}oe(null),ce("preview"),le("curl")}},[y,i,p]),d.useEffect(()=>{t&&B(t)},[t]);const Re=d.useCallback(async()=>{if(!m)return;const s=new AbortController;pe(s),j("");const c=performance.now();try{const o=new Headers(m.headers),l=await fetch(m.url,{method:m.method.toUpperCase(),headers:o,body:m.body||void 0,signal:s.signal}),x=performance.now()-c,w=Object.fromEntries(l.headers.entries()),E=l.headers.get("content-type")||"";let v="",T=0,$=null;if(E.includes("application/json")||E.startsWith("text/"))if(v=await l.text(),T=new TextEncoder().encode(v).length,E.includes("application/json"))try{$=JSON.parse(v)}catch{$=v}else $=v;else{const S=await l.blob();T=S.size,v=`Binary response (${S.type||"application/octet-stream"}, ${S.size} bytes)`,$=v}const U={ok:l.ok,status:l.status,statusText:l.statusText,durationMs:x,headers:w,contentType:E,body:v,preview:$,sizeBytes:T,code:ze(m)};oe(U),Y(!1);const M={id:crypto.randomUUID(),timestamp:new Date().toISOString(),operationId:(i==null?void 0:i.id)||`${m.method}:${(i==null?void 0:i.path)||m.url}`,summary:(i==null?void 0:i.summary)||`${m.method.toUpperCase()} ${(i==null?void 0:i.path)||m.url}`,method:(i==null?void 0:i.method)||m.method,path:(i==null?void 0:i.path)||m.url,status:l.status,request:{operationId:i==null?void 0:i.id,method:m.method,route:(i==null?void 0:i.path)||m.url,pathValues:k,queryValues:I,headerValues:P,bodyValue:O}};de(S=>{const F=[M,...S].slice(0,12);return ye(F),F}),fe({pageNumber:1,pageSize:8}).then(S=>W(S.objects||[])).catch(()=>{}),h("success",r("Request completed with status {{status}}.",{status:l.status}))}catch(o){o instanceof DOMException&&o.name==="AbortError"||j(o instanceof Error?o.message:r("Request failed."))}finally{pe(null)}},[O,P,k,h,I,m,i,r]),Ee=d.useCallback(async()=>{if(ee)try{await navigator.clipboard.writeText(ee),Y(!0),window.setTimeout(()=>Y(!1),2e3)}catch{}},[ee]),Te=d.useCallback(s=>{R(s.request),B(s.operationId)},[]),Ae=d.useCallback(async s=>{try{const c=await xe(s.id);R(je(c))}catch(c){j(c instanceof Error?c.message:r("Failed to load captured request for replay."))}},[r]),Be=d.useCallback(async s=>{try{const c=await xe(s.id);n("/api-explorer",{state:{replayRequest:je(c)}})}catch(c){j(c instanceof Error?c.message:r("Failed to open captured request."))}},[n,r]);return e.jsxs("div",{className:"api-explorer-page",children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:r("API Explorer")}),e.jsx("p",{className:"text-dim view-subtitle",children:r("Browse the live OpenAPI document, execute authenticated requests, inspect responses, and replay captured traffic.")})]}),e.jsxs("div",{className:"page-actions",children:[e.jsx("button",{className:"btn btn-sm",onClick:()=>n("/requests"),children:r("Requests")}),e.jsx("a",{className:"btn btn-sm",href:"/openapi.json",target:"_blank",rel:"noreferrer",children:r("OpenAPI JSON")}),e.jsx("a",{className:"btn btn-sm",href:"/swagger",target:"_blank",rel:"noreferrer",children:r("Swagger")}),e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>void Re(),disabled:!i||!!J||g,children:r(J?"Running...":"Send Request")}),J&&e.jsx("button",{className:"btn btn-sm",onClick:()=>J.abort(),children:r("Abort")})]})]}),f&&e.jsx("div",{className:"api-tool-error",children:f}),e.jsxs("div",{className:"api-explorer-layout",children:[e.jsxs("div",{className:"api-explorer-sidebar",children:[e.jsxs("div",{className:"card api-card",children:[e.jsx("div",{className:"request-card-header",children:e.jsxs("div",{children:[e.jsx("h3",{children:r("Operations")}),e.jsx("p",{className:"text-dim",children:r("Search and filter the live Armada API surface by tag, path, or summary.")})]})}),e.jsxs("div",{className:"request-card-body api-card-body",children:[e.jsxs("div",{className:"api-explorer-filters",children:[e.jsx("input",{value:V,onChange:s=>we(s.target.value),placeholder:r("Filter operations")}),e.jsx("select",{value:L,onChange:s=>$e(s.target.value),children:qe.map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsxs("div",{className:"api-operation-list",children:[g&&e.jsx("div",{className:"request-history-empty",children:r("Loading OpenAPI document...")}),!g&&Oe.map(([s,c])=>e.jsxs("div",{className:"api-operation-group",children:[e.jsxs("div",{className:"api-operation-group-label",children:[e.jsx("span",{children:s}),e.jsx("span",{children:c.length})]}),e.jsx("div",{className:"api-operation-group-list",children:c.map(o=>e.jsxs("button",{type:"button",className:`api-operation-item ${(i==null?void 0:i.id)===o.id?"active":""}`,onClick:()=>{B(o.id),n(`/api-explorer/${encodeURIComponent(o.id)}`)},children:[e.jsx("span",{className:"api-operation-item-method",children:e.jsx("span",{className:z(o.method),children:o.method.toUpperCase()})}),e.jsx("span",{className:"api-operation-label",children:o.path}),ge(o)&&e.jsx("span",{className:"api-operation-subtext",children:ge(o)})]},o.id))})]},s))]})]})]}),e.jsxs("div",{className:"card api-card",children:[e.jsxs("div",{className:"request-card-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:r("Recent Local")}),e.jsx("p",{className:"text-dim",children:r("Browser-side recent requests captured in this dashboard session.")})]}),e.jsx("button",{className:"btn btn-sm",onClick:()=>{de([]),ye([])},disabled:K.length===0,children:r("Clear")})]}),e.jsx("div",{className:"request-card-body api-card-body",children:K.length===0?e.jsx("div",{className:"request-history-empty",children:r("Local replay history is empty.")}):e.jsx("div",{className:"api-history-list",children:K.map(s=>e.jsxs("button",{type:"button",className:"api-history-item",onClick:()=>Te(s),children:[e.jsx("span",{className:z(s.method),children:s.method.toUpperCase()}),e.jsx("span",{className:"api-history-summary",children:s.summary}),e.jsxs("span",{className:"api-history-meta",children:[new Date(s.timestamp).toLocaleString()," - ",s.status??"pending"]})]},s.id))})})]}),e.jsxs("div",{className:"card api-card",children:[e.jsx("div",{className:"request-card-header",children:e.jsxs("div",{children:[e.jsx("h3",{children:r("Recent Captured")}),e.jsx("p",{className:"text-dim",children:r("Replay persisted request-history entries captured by the Armada server.")})]})}),e.jsx("div",{className:"request-card-body api-card-body",children:ue.length===0?e.jsx("div",{className:"request-history-empty",children:r("No captured requests available yet.")}):e.jsx("div",{className:"api-history-list",children:ue.map(s=>e.jsxs("div",{className:"api-captured-entry",children:[e.jsxs("button",{type:"button",className:"api-history-item",onClick:()=>void Ae(s),children:[e.jsx("span",{className:z(s.method),children:s.method.toUpperCase()}),e.jsx("span",{className:"api-history-summary",children:s.route}),e.jsxs("span",{className:"api-history-meta",children:[s.statusCode," - ",s.principalDisplay||r("Anonymous")]})]}),e.jsx("button",{className:"api-mini-link",onClick:()=>void Be(s),children:r("Open")})]},s.id))})})]})]}),e.jsxs("div",{className:"api-explorer-main",children:[e.jsxs("div",{className:"card api-card",children:[e.jsxs("div",{className:"request-card-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:(i==null?void 0:i.summary)||r("Request Builder")}),i&&e.jsx("p",{className:"text-dim",children:i.description||i.path})]}),i&&e.jsx("span",{className:"api-tag-badge",children:i.tag})]}),e.jsx("div",{className:"request-card-body api-card-body",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"api-request-overview",children:[e.jsx("span",{className:z(i.method),children:i.method.toUpperCase()}),e.jsx("code",{children:i.path})]}),e.jsxs("div",{className:"api-parameter-grid",children:[e.jsx(ae,{title:r("Path Parameters"),parameters:i.parameters.filter(s=>s.in==="path"),values:k,onChange:D}),e.jsx(ae,{title:r("Query Parameters"),parameters:i.parameters.filter(s=>s.in==="query"),values:I,onChange:_}),e.jsx(ae,{title:r("Headers"),parameters:i.parameters.filter(s=>s.in==="header"&&!["x-token","authorization","content-type"].includes(s.name.toLowerCase())),values:P,onChange:Q})]}),i.requestBody&&e.jsxs("div",{className:"api-body-section",children:[e.jsxs("div",{className:"api-section-heading",children:[e.jsx("h4",{children:r("Request Body")}),e.jsx("span",{children:i.requestBodyContentType||"application/json"})]}),e.jsx("textarea",{value:O,onChange:s=>X(s.target.value),spellCheck:!1,rows:14})]}),m&&e.jsxs("div",{className:"api-request-preview",children:[e.jsxs("div",{className:"api-section-heading",children:[e.jsx("h4",{children:r("Request Preview")}),e.jsx("span",{children:m.method.toUpperCase()})]}),e.jsx("pre",{children:m.url})]})]}):e.jsx("div",{className:"request-history-empty",children:r("No operations are available in the current OpenAPI document.")})})]}),e.jsxs("div",{className:"card api-card",children:[e.jsxs("div",{className:"request-card-header",children:[e.jsxs("div",{children:[e.jsx("h3",{children:r("Response")}),b&&e.jsxs("p",{className:"text-dim",children:[e.jsxs("span",{className:`request-status-pill ${b.ok?"success":"error"}`,children:[b.status," ",b.statusText]})," ",b.durationMs.toFixed(2)," ms"," ",Ne(b.sizeBytes)]})]}),b&&e.jsx("button",{className:`btn btn-sm${he?" btn-primary":""}`,onClick:()=>void Ee(),children:r(he?"Copied!":"Copy View")})]}),e.jsxs("div",{className:"request-card-body api-card-body",children:[e.jsx("div",{className:"api-tab-row",children:Je.map(s=>e.jsx("button",{type:"button",className:`api-tab ${H===s?"active":""}`,onClick:()=>ce(s),disabled:!b,children:r(s.charAt(0).toUpperCase()+s.slice(1))},s))}),b?e.jsx(Xe,{response:b,responseTab:H,codeTab:G,onCodeTabChange:le}):e.jsx("div",{className:"request-history-empty",children:r("Send a request to inspect the live response here.")})]})]})]})]})]})}export{Ke as default};
