apitestcenter 0.18.0 → 0.18.2
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/THIRD-PARTY-NOTICES-UI.txt +11 -11
- package/dist/THIRD-PARTY-NOTICES.txt +6 -6
- package/dist/cli.mjs +600 -593
- package/dist/ui/404/index.html +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/__next.__PAGE__.txt +32 -21
- package/dist/ui/__next._full.txt +29 -18
- package/dist/ui/__next._tree.txt +5 -4
- package/dist/ui/_next/static/chunks/0-zga2d528cxt.js +50 -0
- package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +123 -0
- package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +50 -0
- package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +50 -0
- package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +1 -0
- package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +1 -0
- package/dist/ui/_next/static/chunks/0q8iq_7i4ohjr.js +50 -0
- package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +31 -0
- package/dist/ui/_next/static/chunks/12whdxhkvkd-y.js +1 -0
- package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +50 -0
- package/dist/ui/_next/static/chunks/1mm60-ywpri7b.js +2 -0
- package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +4 -0
- package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +1 -0
- package/dist/ui/_next/static/chunks/2c1b5jqwxl4ra.js +906 -0
- package/dist/ui/_next/static/chunks/2sb9zma7ae-_f.js +27 -0
- package/dist/ui/_next/static/chunks/2sjog4to0fmbb.css +3 -0
- package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +3 -0
- package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +51 -0
- package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +22 -0
- package/dist/ui/_next/static/chunks/3wtqdtu331_vc.js +50 -0
- package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +2 -0
- package/dist/ui/_next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
- package/dist/ui/_not-found/__next._full.txt +25 -17
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +28 -20
- package/dist/ui/_not-found/__next._tree.txt +4 -2
- package/dist/ui/_not-found/index.html +1 -1
- package/dist/ui/_not-found/index.txt +25 -17
- package/dist/ui/compare/__next._full.txt +32 -20
- package/dist/ui/compare/__next._tree.txt +6 -4
- package/dist/ui/compare/__next.compare.__PAGE__.txt +36 -24
- package/dist/ui/compare/index.html +1 -1
- package/dist/ui/compare/index.txt +32 -20
- package/dist/ui/connections/__next._full.txt +30 -20
- package/dist/ui/connections/__next._tree.txt +6 -4
- package/dist/ui/connections/__next.connections.__PAGE__.txt +34 -24
- package/dist/ui/connections/index.html +2 -2
- package/dist/ui/connections/index.txt +30 -20
- package/dist/ui/history/__next._full.txt +35 -23
- package/dist/ui/history/__next._tree.txt +6 -4
- package/dist/ui/history/__next.history.__PAGE__.txt +39 -27
- package/dist/ui/history/index.html +1 -1
- package/dist/ui/history/index.txt +35 -23
- package/dist/ui/home/__next._full.txt +32 -20
- package/dist/ui/home/__next._tree.txt +6 -4
- package/dist/ui/home/__next.home.__PAGE__.txt +36 -24
- package/dist/ui/home/index.html +1 -1
- package/dist/ui/home/index.txt +32 -20
- package/dist/ui/index.html +1 -1
- package/dist/ui/index.txt +29 -18
- package/dist/ui/preview/__next._full.txt +33 -23
- package/dist/ui/preview/__next._tree.txt +6 -4
- package/dist/ui/preview/__next.preview.__PAGE__.txt +37 -27
- package/dist/ui/preview/index.html +1 -1
- package/dist/ui/preview/index.txt +33 -23
- package/dist/ui/suite/__next._full.txt +29 -20
- package/dist/ui/suite/__next._tree.txt +6 -4
- package/dist/ui/suite/__next.suite.__PAGE__.txt +33 -24
- package/dist/ui/suite/index.html +1 -1
- package/dist/ui/suite/index.txt +29 -20
- package/dist/ui/tests/__next._full.txt +28 -20
- package/dist/ui/tests/__next._tree.txt +6 -4
- package/dist/ui/tests/__next.tests.__PAGE__.txt +32 -24
- package/dist/ui/tests/index.html +1 -1
- package/dist/ui/tests/index.txt +28 -20
- package/package.json +1 -1
- package/dist/ui/_next/static/chunks/01sqehfan_2j_.js +0 -1
- package/dist/ui/_next/static/chunks/036rg3itpc5ge.js +0 -50
- package/dist/ui/_next/static/chunks/0e8f1i6w6dqos.js +0 -50
- package/dist/ui/_next/static/chunks/0hvubzjy33qo9.js +0 -2
- package/dist/ui/_next/static/chunks/0ktc3lx37s0t5.js +0 -4
- package/dist/ui/_next/static/chunks/0wrod6xlhsv0m.js +0 -3
- package/dist/ui/_next/static/chunks/1-d6f0jo8p7jc.js +0 -913
- package/dist/ui/_next/static/chunks/15pu58j0qz9i8.js +0 -31
- package/dist/ui/_next/static/chunks/1apjslkz52j1a.js +0 -22
- package/dist/ui/_next/static/chunks/1nfb0xrm2a6di.css +0 -3
- package/dist/ui/_next/static/chunks/1pz4ugabfd0qn.js +0 -1
- package/dist/ui/_next/static/chunks/1t823xy7gguwx.js +0 -1
- package/dist/ui/_next/static/chunks/23_x0u07xh89v.js +0 -123
- package/dist/ui/_next/static/chunks/2aifruy-vhchn.js +0 -50
- package/dist/ui/_next/static/chunks/2t65s4y0z2a60.js +0 -50
- package/dist/ui/_next/static/chunks/33kvaxr7qvnue.js +0 -50
- package/dist/ui/_next/static/chunks/36wzwezwmtzq7.js +0 -51
- package/dist/ui/_next/static/chunks/3b26__7yusttj.js +0 -1
- package/dist/ui/_next/static/chunks/3n2xlaj16gyb-.js +0 -2
- package/dist/ui/_next/static/chunks/3vso5wrs90xx-.js +0 -50
- package/dist/ui/_next/static/chunks/3yck6s93oif7s.js +0 -27
- package/dist/ui/_next/static/chunks/turbopack-2qka98q_-4ca1.js +0 -1
- /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_buildManifest.js +0 -0
- /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_ssgManifest.js +0 -0
- /package/dist/ui/_next/static/media/{8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 → 07935285219a259d-s.1qq4vpdcun5oj.woff2} +0 -0
- /package/dist/ui/_next/static/media/{797e433ab948586e-s.p.0r6juujl39pe6.woff2 → 07a39a8a4660cc7c-s.p.0r6juujl39pe6.woff2} +0 -0
- /package/dist/ui/_next/static/media/{bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 → 2a04751c893bf294-s.1rgnod-3esatf.woff2} +0 -0
- /package/dist/ui/_next/static/media/{6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 → 2bb852295097cd96-s.2dbetqa9o8jxf.woff2} +0 -0
- /package/dist/ui/_next/static/media/{fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 → 4f6667dd39116621-s.3p2_lha1f2xer.woff2} +0 -0
- /package/dist/ui/_next/static/media/{caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 → 605ce01b664af129-s.p.0wgildi0cnwt9.woff2} +0 -0
- /package/dist/ui/_next/static/media/{4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 → 6e342921ee4dcd9d-s.2tuy5pz7dlieh.woff2} +0 -0
- /package/dist/ui/_next/static/media/{7178b3e590c64307-s.21jp631_3pja2.woff2 → 77814b00d5ca94a4-s.21jp631_3pja2.woff2} +0 -0
- /package/dist/ui/_next/static/media/{7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 → 9eb5a876700c0028-s.1uyisp29ctx0d.woff2} +0 -0
- /package/dist/ui/_next/static/media/{5ce348bf30bf5439-s.31988l_ccedte.woff2 → b0c6b664fd57c2c6-s.31988l_ccedte.woff2} +0 -0
- /package/dist/ui/_next/static/media/{53b9e256198e5412-s.390ncx5urfkfu.woff2 → f58031ded4338640-s.390ncx5urfkfu.woff2} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,57515,e=>{"use strict";var t=e.i(14368);e.s(["BrandMark",0,function({size:e=24,className:s}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"10.5 8.5 47 47","aria-hidden":!0,className:s,children:[(0,t.jsx)("rect",{x:"10.5",y:"8.5",width:"47",height:"47",rx:"11",fill:"#C8F560"}),(0,t.jsx)("path",{d:"M47.4 32.3 V36.7 Q47.4 40.9 43.75 42.98 L35.65 47.72 Q32 49.8 28.35 47.72 L20.25 42.98 Q16.6 40.9 16.6 36.7 V27.3 Q16.6 23.1 20.25 21.02 L28.35 16.28 Q32 14.2 35.65 16.28 L43.75 21.02 Q47.4 23.1 47.4 27.3",fill:"none",stroke:"#10140A",strokeWidth:"4",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M37.5 29.8 H51.5",stroke:"#10140A",strokeWidth:"2.6"}),(0,t.jsx)("circle",{cx:"51.5",cy:"29.8",r:"3",fill:"#10140A"}),(0,t.jsx)("path",{d:"M22.9 23.7 L29.4 29.8 L22.9 35.9",fill:"none",stroke:"#10140A",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("circle",{cx:"37.5",cy:"29.8",r:"4.1",fill:"#10140A"}),(0,t.jsx)("path",{d:"M27.2 37.9 Q32 42.1 36.8 37.9",fill:"none",stroke:"#10140A",strokeWidth:"3.3",strokeLinecap:"round"})]})}])},69578,30635,91549,e=>{"use strict";e.s(["CommandPalette",()=>en,"OPEN_DRAFT_KEY",()=>et,"OPEN_REQUEST_EVENT",()=>ee,"OPEN_REQUEST_KEY",()=>Z],69578);var t=e.i(14368),s=e.i(78739),n=e.i(7641),a=e.i(72350),r=e.i(67217),i=e.i(56931),o=e.i(5504),l=e.i(22079),c=e.i(74749),d=e.i(97942);e.i(24856);var u=e.i(34593),h=e.i(78451),p=e.i(1675),m=e.i(95486),x=e.i(60961),f=e.i(89932),b=e.i(75117),y=e.i(47677),g=e.i(17819),w=e.i(27813),v=e.i(4488),k=e.i(88293),j=e.i(30135),N=e.i(87283),S=e.i(99181),C=e.i(57515),A=e.i(80707),T=e.i(56396),E=e.i(15060),P=e.i(65238),I=e.i(44505);function $(){let[e,t]=(0,S.useState)(null),[s,n]=(0,S.useState)(!1),a=(0,S.useCallback)(async()=>{let e=(0,I.desktop)()?.projects;n(!!e),e&&t(await e.list().catch(()=>[]))},[]);return(0,S.useEffect)(()=>{a()},[a]),{projects:e,current:e?.find(e=>e.current)??null,refresh:a,supported:s}}let L=["#c8f560","#60a5fa","#c4b5fd","#fbbf24","#5eead4","#fb923c","#f9a8d4"];e.s(["projectTile",0,function(e){let t=0;for(let s of e)t=31*t+s.charCodeAt(0)>>>0;return"default"===e?L[0]:L[t%L.length]},"useProjects",0,$],30635),e.i(42674);var q=e.i(5305),R=e.i(6278),M=e.i(24448);let O="atc:export";function D(e={kind:"project"}){window.dispatchEvent(new CustomEvent(O,{detail:e}))}let F="apitestcenter-export-format";function z({id:e}){if("apitestcenter"===e)return(0,t.jsx)(C.BrandMark,{size:28});let s={postman:{bg:"#ff6c37",fg:"#ffffff",text:"PM"},openapi:{bg:"#6ba539",fg:"#ffffff",text:"{ }"},http:{bg:"#2f6fdb",fg:"#ffffff",text:"HTTP"},docs:{bg:"#c8f560",fg:"#16191f",text:"</>"},markdown:{bg:"#e7e9ed",fg:"#141413",text:"M↓"}}[e];return(0,t.jsx)("span",{className:"grid h-7 w-7 place-items-center rounded-lg font-mono text-[10px] font-bold tracking-tight",style:{background:s.bg,color:s.fg},"aria-hidden":!0,children:s.text})}let W={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"},U=(e,t)=>e.collection===t||e.collection.startsWith(`${t}/`),H=e=>[...e.requests.map(e=>e.id),...e.folders.flatMap(H)];function _({requests:e,initial:s,onDone:n,onCancel:a}){let[r,i]=(0,S.useState)(()=>new Set(s)),[o,l]=(0,S.useState)(""),[c,d]=(0,S.useState)(new Set),u=o.trim().toLowerCase(),f=(0,S.useMemo)(()=>u?e.filter(e=>`${e.name} ${e.collection} ${e.url} ${e.method}`.toLowerCase().includes(u)):e,[e,u]),b=(0,S.useMemo)(()=>(function(e){let t={path:"",name:"",folders:[],requests:[]},s=new Map([["",t]]),n=e=>{let t=s.get(e);if(t)return t;let a=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r={path:e,name:(0,h.folderName)(e),folders:[],requests:[]};return s.set(e,r),n(a).folders.push(r),r};for(let t of e)n(t.collection).requests.push(t);let a=e=>{e.folders.sort((e,t)=>e.name.localeCompare(t.name)),e.folders.forEach(a)};return a(t),t})(f),[f]);(0,S.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.stopPropagation(),a())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[a]);let y=(e,t)=>i(s=>{let n=new Set(s);for(let s of e)t?n.add(s):n.delete(s);return n}),w=e=>(0,t.jsx)("span",{className:`grid h-4 w-4 shrink-0 place-items-center rounded border ${"off"===e?"border-mute/60":"border-accent bg-accent text-canvas"}`,"aria-hidden":!0,children:"on"===e?(0,t.jsx)(p.Check,{size:11,strokeWidth:3}):"some"===e?(0,t.jsx)(v.Minus,{size:11,strokeWidth:3}):null}),j=(e,s)=>(0,t.jsxs)(t.Fragment,{children:[e.folders.map(e=>{let n,a,i,o;return i=0===(a=(n=H(e)).filter(e=>r.has(e)).length)?"off":a===n.length?"on":"some",o=c.has(e.path)&&!u,(0,t.jsxs)("li",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md hover:bg-panel-2",style:{paddingLeft:16*s},children:[(0,t.jsx)("button",{type:"button","aria-label":o?`Open ${e.name}`:`Fold ${e.name}`,onClick:()=>d(t=>{let s=new Set(t);return s.has(e.path)?s.delete(e.path):s.add(e.path),s}),className:"rounded p-1 text-mute",children:o?(0,t.jsx)(x.ChevronRight,{size:13}):(0,t.jsx)(m.ChevronDown,{size:13})}),(0,t.jsxs)("button",{type:"button",role:"checkbox","aria-checked":"on"===i||"some"===i&&"mixed",onClick:()=>y(n,"on"!==i),className:"flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-2 text-left text-sm",children:[w(i),(0,t.jsx)(g.Folder,{size:14,className:"shrink-0 text-mute","aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-medium text-ink",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:["(",n.length,")"]})]})]}),o?null:(0,t.jsx)("ul",{children:j(e,s+1)})]},`f:${e.path}`)}),e.requests.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",role:"checkbox","aria-checked":r.has(e.id),onClick:()=>y([e.id],!r.has(e.id)),className:"flex w-full items-center gap-2 rounded-md py-1.5 pr-2 text-left text-sm hover:bg-panel-2",style:{paddingLeft:16*s+26},children:[w(r.has(e.id)?"on":"off"),(0,t.jsx)("span",{className:`w-10 shrink-0 font-mono text-[10.5px] font-semibold ${W[e.method]??"text-mute"}`,children:"DELETE"===e.method?"DEL":e.method}),(0,t.jsx)("span",{className:"truncate text-ink",children:e.name}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-mute",children:e.url})]})},e.id))]}),C=e.map(e=>e.id),A=r.size===C.length&&C.length>0;return(0,t.jsx)("div",{id:"export-picker",className:"fixed inset-0 z-[67] flex items-center-safe justify-center bg-black/40 p-4 sm:p-12",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&a(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"picker-title",className:"flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h2",{id:"picker-title",className:"flex-1 text-base font-medium text-ink",children:"Pick what to export"}),(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(N.X,{size:16})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[(0,t.jsxs)("label",{className:"relative min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"sr-only",children:"Search requests"}),(0,t.jsx)(k.Search,{size:13,className:"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-mute","aria-hidden":!0}),(0,t.jsx)("input",{autoFocus:!0,value:o,onChange:e=>l(e.target.value),placeholder:"Search by name, folder or address",className:"input h-8 pl-8 text-xs"})]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>y(C,!A),children:A?"Select none":"Select all"})]}),(0,t.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-2",children:f.length?j(b,0):(0,t.jsx)("li",{className:"px-2 py-6 text-sm text-mute",children:"Nothing matches."})}),(0,t.jsxs)("footer",{className:"flex items-center gap-2 border-t border-line px-5 py-3",children:[(0,t.jsxs)("span",{className:"flex-1 text-sm text-ink",children:[r.size," selected"]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:a,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>n(r),children:"Confirm"})]})]})})}e.s(["ExportDialog",0,function(){let e=(0,T.useToast)(),{index:s,environments:n,activeEnv:a}=(0,R.useWorkspace)(),{current:r}=$(),[i,o]=(0,S.useState)(!1),[l,c]=(0,S.useState)("all"),[d,m]=(0,S.useState)(new Set),[g,v]=(0,S.useState)(!1),[k,C]=(0,S.useState)(null),[I,L]=(0,S.useState)("apitestcenter"),[D,W]=(0,S.useState)(""),[H,B]=(0,S.useState)({examples:!0,checks:!0,scripts:!0}),[V,K]=(0,S.useState)(!1),[J,G]=(0,S.useState)(!1),Y=(0,S.useRef)(null),X=(0,S.useMemo)(()=>s?.requests??[],[s]);if((0,S.useEffect)(()=>{let e=e=>{let t=e.detail??{kind:"project"},n=s?.requests??[],r="folder"===t.kind?n.filter(e=>U(e,t.path)).map(e=>e.id):"request"===t.kind?[t.id]:"requests"===t.kind?t.ids:[];c("project"===t.kind?"all":"pick"),C("folder"===t.kind?t.path:null),m(new Set(r)),W(a?.id??"");try{let e=localStorage.getItem(F);e&&u.EXPORT_FORMATS.some(t=>t.id===e)&&L(e)}catch{}o(!0)};return window.addEventListener(O,e),()=>window.removeEventListener(O,e)},[a,s]),(0,S.useEffect)(()=>{if(!i)return;let e=document.activeElement;Y.current?.focus();let t=e=>"Escape"===e.key&&!document.querySelector("[role=listbox]")&&!document.getElementById("export-picker")&&o(!1);return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t),e?.focus?.()}},[i]),!i)return null;let Q="all"===l?X:X.filter(e=>d.has(e.id)),Z=r?.name??"APITestCenter",ee="all"===l?"":function(e){if(!e.length)return"";let t=e[0].collection.split("/").filter(Boolean);for(let s of e.slice(1)){let e=s.collection.split("/"),n=0;for(;n<t.length&&t[n]===e[n];)n++;t=t.slice(0,n)}return t.join("/")}(Q),et=null!==k&&Q.length>0&&Q.length===X.filter(e=>U(e,k)).length&&Q.every(e=>U(e,k)),es="all"===l?Z:et?(0,h.folderName)(k):1===Q.length?Q[0].name:ee?(0,h.folderName)(ee):`${Z} — ${Q.length} requests`,en=u.EXPORT_FORMATS.find(e=>e.id===I),ea=`${es.replace(/[<>:"/\\|?*\x00-\x1f]/g,"").replace(/\s+/g,"-").slice(0,80)||"requests"}${en.extension}`;async function er(){if(!Q.length)return e("Pick at least one request to export","error"),null;K(!0);try{let e=await Promise.all(Q.map(e=>R.workspaceApi.get(e.id))),t=(s?.folders??[]).filter(e=>e.described&&(!ee||e.path===ee||e.path.startsWith(`${ee}/`))),a=Object.fromEntries(await Promise.all(t.map(async e=>[e.path,(await P.folderApi.get(e.path).catch(()=>null))?.settings.description??""])));return(0,u.exportRequests)(I,{title:es,root:ee,requests:e.map(e=>({id:e.id,name:e.name,collection:e.collection,request:(0,q.requestFromUnknown)(e.request)})),environment:n.find(e=>e.id===D)??null,include:H,...ee&&a[ee]?{description:a[ee]}:{},folders:a,generatedAt:new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})})}catch(t){return e(t instanceof Error?t.message:"Could not export","error"),null}finally{K(!1)}}async function ei(){let t=await er();null!==t&&((0,E.downloadText)(ea,t,en.mime),e(`Exported ${Q.length} request${1===Q.length?"":"s"} as ${en.label}`,"success"),o(!1))}async function eo(){let t=await er();null!==t&&await navigator.clipboard.writeText(t).then(()=>{G(!0),window.setTimeout(()=>G(!1),1500)},()=>e("Could not copy — use Save file instead","error"))}let el=(e,s,n)=>(0,t.jsxs)("label",{className:"flex items-start gap-2.5 rounded-md px-1 py-1 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:H[e],onChange:()=>B(t=>({...t,[e]:!t[e]})),className:"mt-0.5 h-4 w-4 accent-[var(--accent)]"}),(0,t.jsxs)("span",{children:[s,(0,t.jsx)("span",{className:"block text-xs text-mute",children:n})]})]});return(0,t.jsxs)("div",{className:"fixed inset-0 z-[66] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-10",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&o(!1),children:[(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"export-title",className:"w-full max-w-3xl rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)(y.FileOutput,{size:16,className:"text-accent","aria-hidden":!0}),(0,t.jsx)("h2",{id:"export-title",className:"min-w-0 truncate text-base font-medium text-ink",children:"Export requests"}),(0,t.jsx)(M.GuideLink,{topic:"exports",className:"ml-auto"}),(0,t.jsx)("button",{ref:Y,type:"button",onClick:()=>o(!1),"aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(N.X,{size:16})})]}),(0,t.jsxs)("div",{className:"space-y-5 px-5 py-5",children:[(0,t.jsxs)("section",{"aria-labelledby":"export-format",children:[(0,t.jsx)("h3",{id:"export-format",className:"mb-2 text-sm font-medium text-ink",children:"Format"}),(0,t.jsx)("div",{role:"radiogroup","aria-labelledby":"export-format",className:"grid grid-cols-3 gap-2 sm:grid-cols-5",children:u.EXPORT_FORMATS.map(e=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":I===e.id,"aria-label":e.label,title:e.note,onClick:()=>(function(e){L(e);try{localStorage.setItem(F,e)}catch{}})(e.id),className:`flex flex-col items-center gap-2 rounded-lg border px-2 py-3 text-center ${I===e.id?"border-accent bg-accent-dim/50 ring-1 ring-accent":"border-line hover:border-mute"}`,children:[(0,t.jsx)(z,{id:e.id}),(0,t.jsx)("span",{className:"text-[13px] font-medium text-ink",children:e.label})]},e.id))}),(0,t.jsxs)("p",{className:"mt-2 text-xs text-mute",children:[en.note,"."]})]}),(0,t.jsxs)("section",{"aria-labelledby":"export-scope",className:"rounded-lg border border-line p-4",children:[(0,t.jsx)("h3",{id:"export-scope",className:"mb-3 text-sm font-medium text-ink",children:"What to export"}),(0,t.jsxs)("div",{role:"radiogroup","aria-labelledby":"export-scope",className:"flex flex-wrap gap-x-6 gap-y-2 text-sm",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-ink",children:[(0,t.jsx)("input",{type:"radio",name:"export-mode",checked:"all"===l,onChange:()=>c("all"),className:"accent-[var(--accent)]"}),"Everything — ",X.length," request",1===X.length?"":"s"]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-ink",children:[(0,t.jsx)("input",{type:"radio",name:"export-mode",checked:"pick"===l,onChange:()=>c("pick"),className:"accent-[var(--accent)]"}),"Pick folders and requests"]})]}),"pick"===l?(0,t.jsxs)("button",{type:"button",onClick:()=>v(!0),className:"mt-3 flex w-full items-center justify-between rounded-md border border-line bg-panel-2 px-3 py-2 text-left text-sm hover:border-mute",children:[(0,t.jsx)("span",{className:Q.length?"text-accent":"text-mute",children:Q.length?`${Q.length} selected`:"Nothing selected yet"}),(0,t.jsx)(x.ChevronRight,{size:14,className:"text-mute","aria-hidden":!0})]}):null,(0,t.jsxs)("div",{className:"mt-4 grid gap-1 border-t border-line pt-3 sm:grid-cols-3",children:[el("examples","Example answers","Kept for the mock server"),el("checks","Checks","Your rules for a good answer"),el("scripts","Scripts","Before and after sending")]})]}),(0,t.jsxs)("label",{className:"flex max-w-sm flex-col gap-1.5 text-sm font-medium text-ink",children:["Include an environment",(0,t.jsx)(A.Select,{label:"Include an environment",value:D,onChange:W,options:[{value:"",label:"None"},...n.map(e=>({value:e.id,label:e.name,hint:`${e.variables.length} variables`}))],className:"input text-left font-normal"})]}),(0,t.jsxs)("p",{className:"flex items-center gap-2 rounded-md bg-ok/10 px-3 py-2 text-xs text-ink",children:[(0,t.jsx)(j.ShieldCheck,{size:14,className:"shrink-0 text-ok","aria-hidden":!0}),"Secret values never go into the file — tokens, passwords and API keys are left empty, ","{{variables}}"," stay."]})]}),(0,t.jsxs)("footer",{className:"flex flex-wrap items-center gap-2 border-t border-line px-5 py-3",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-mute",title:ea,children:Q.length?`${Q.length} request${1===Q.length?"":"s"} → ${ea}`:"Pick what to export"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:V||!Q.length,onClick:()=>void eo(),children:[J?(0,t.jsx)(p.Check,{size:14,className:"text-ok","aria-hidden":!0}):(0,t.jsx)(f.Copy,{size:14,"aria-hidden":!0}),J?"Copied":"Copy"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",disabled:V||!Q.length,onClick:()=>void ei(),children:[V?(0,t.jsx)(w.Loader2,{size:14,className:"animate-spin","aria-hidden":!0}):(0,t.jsx)(b.Download,{size:14,"aria-hidden":!0}),"Save file"]})]})]}),g?(0,t.jsx)(_,{requests:X,initial:d,onDone:e=>{m(e),v(!1)},onCancel:()=>v(!1)}):null]})},"openExport",0,D],91549);var B=e.i(839),V=e.i(5831);let K=(0,e.i(99522).default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var J=e.i(48317),G=e.i(36994),Y=e.i(2603),X=e.i(14865),Q=e.i(15868);let Z="apitestcenter-open-request",ee="atc:open-request",et="apitestcenter-open-draft";function es(e){window.dispatchEvent(new KeyboardEvent("keydown",{key:"Enter",ctrlKey:!0,metaKey:!0,shiftKey:e,bubbles:!0}))}function en(){let e=(0,G.useRouter)(),u=(0,G.usePathname)(),h=(0,Y.useModKey)(),{setTheme:p}=(0,J.useTheme)(),{index:m,environments:x,setActiveEnv:f,activeEnv:b}=(0,R.useWorkspace)(),y=(0,X.useViewPrefs)(),[g,w]=(0,S.useState)(!1),[v,j]=(0,S.useState)(""),[N,C]=(0,S.useState)(0),A=(0,S.useRef)(null),T=(0,S.useRef)(null);(0,S.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),w(e=>!e))},t=()=>w(!0);return window.addEventListener("keydown",e),window.addEventListener("atc:palette",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("atc:palette",t)}},[]),(0,S.useEffect)(()=>{if(!g)return;j(""),C(0);let e=document.activeElement;return window.setTimeout(()=>A.current?.focus(),0),()=>e?.focus?.()},[g]);let E=(0,S.useMemo)(()=>{let t=e=>()=>{w(!1),window.setTimeout(e,0)},g=s=>t(()=>((0,Q.startNavProgress)(),e.push(s))),v="/"===u||"/compare"===u,k=[{id:"go-test",group:"Go to",label:"Test API",run:g("/")},{id:"go-suite",group:"Go to",label:"Run collection",run:g("/suite")},{id:"go-compare",group:"Go to",label:"Compare",run:g("/compare")},{id:"go-history",group:"Go to",label:"History",run:g("/history")},{id:"go-connections",group:"Go to",label:"Connections",run:g("/connections")},{id:"go-open",group:"Go to",label:"Open report",run:g("/preview")},{id:"import",group:"Actions",label:"Import requests — Postman, Insomnia, Bruno, OpenAPI, .http, Hurl",run:t(()=>(0,r.openImport)())},{id:"certificates",group:"Actions",label:"Certificates — client certificates and trusted CAs",run:t(i.openCertificates)},{id:"contracts",group:"Actions",label:"API descriptions — OpenAPI files that answers are checked against (contract tests)",run:t(()=>(0,l.openContracts)())},{id:"cookies",group:"Actions",label:"Cookies — see or delete the cookie jar",run:t(o.openCookies)},{id:"settings",group:"Actions",label:"Settings — appearance, AI assistants, certificates, privacy, files",hint:`${h}+,`,run:t(B.openSettings)},{id:"export",group:"Actions",label:"Export requests — APITestCenter, Postman, OpenAPI, .http, Markdown",run:t(()=>D())},{id:"trash",group:"Actions",label:"Trash — deleted requests, kept 30 days",run:t(d.openTrash)},{id:"mock",group:"Actions",label:"Mock server — answer a collection's requests with examples",run:t(()=>(0,c.openMock)())},...(0,I.desktop)()?.hideToTray?[{id:"hide-to-tray",group:"View",label:"Hide to tray — the app keeps running; open it from the tray icon",run:t(()=>void(0,I.desktop)()?.hideToTray?.())}]:[],{id:"zoom-in",group:"View",label:"Zoom in",hint:`${h}+=`,run:t(y.zoomIn)},{id:"zoom-out",group:"View",label:"Zoom out",hint:`${h}+-`,run:t(y.zoomOut)},{id:"zoom-reset",group:"View",label:"Reset zoom to 100%",hint:`${h}+0`,run:t(y.resetZoom)},{id:"layout",group:"View",label:"below"===y.layout?"Show the response beside the request":"Show the response below the request",run:t(()=>y.setLayout("below"===y.layout?"beside":"below"))},{id:"density",group:"View",label:"compact"===y.density?"Density: comfortable rows":"Density: compact rows",run:t(()=>y.setDensity("compact"===y.density?"comfortable":"compact"))},{id:"shortcuts",group:"Help",label:"Keyboard shortcuts",hint:`${h}+/`,run:t(a.openShortcuts)},{id:"help",group:"Help",label:"Help: what do these words mean?",run:t(n.openHelp)},{id:"about",group:"Help",label:"About APITestCenter — version and updates",run:t(s.openAbout)},{id:"tour",group:"Help",label:"Take the 1-minute tour",run:t(()=>"/"===u?(0,V.startTour)():((0,Q.startNavProgress)(),e.push("/"),window.setTimeout(V.startTour,900)))}];for(let s of(v&&k.push({id:"send",group:"Actions",label:"Send request",hint:`${h}+Enter`,run:t(()=>es(!1))},{id:"run",group:"Actions",label:"/compare"===u?"Compare load":"Run performance test",hint:`${h}+Shift+Enter`,run:t(()=>es(!0))}),m?.requests??[]))k.push({id:`req-${s.id}`,group:"Saved requests",label:`${s.collection?`${s.collection} / `:""}${s.name}`,hint:s.method,run:t(()=>{try{sessionStorage.setItem(Z,s.id)}catch{}"/"===u?window.dispatchEvent(new Event(ee)):e.push("/")})});for(let e of(k.push({id:"env-none",group:"Environment",label:"Use no environment",hint:b?void 0:"current",run:t(()=>f(null))}),x))k.push({id:`env-${e.id}`,group:"Environment",label:`Use environment: ${e.name}`,hint:b?.id===e.id?"current":`${e.variables.length} vars`,run:t(()=>f(e.id))});for(let e of["system","light","dark"])k.push({id:`theme-${e}`,group:"Theme",label:`Theme: ${e[0].toUpperCase()}${e.slice(1)}`,run:t(()=>p(e))});return k},[m,x,b,u,e,h,f,p,y]),P=(0,S.useMemo)(()=>E.map(e=>({item:e,s:function(e,t){if(!t)return 1;let s=e.toLowerCase(),n=t.toLowerCase(),a=0,r=0;for(let e of n){let t=s.indexOf(e,a);if(t<0)return 0;r+=0===t||/[\s/·:-]/.test(s[t-1]??"")?3:t===a?2:1,a=t+1}return r}(`${e.group} ${e.label}`,v)})).filter(e=>e.s>0).sort((e,t)=>v?t.s-e.s:0).map(e=>e.item).slice(0,50),[E,v]);return((0,S.useEffect)(()=>{T.current?.querySelector(`[data-index="${N}"]`)?.scrollIntoView({block:"nearest"})},[N]),g)?(0,t.jsx)("div",{className:"fixed inset-0 z-[60] flex items-start justify-center bg-black/50 p-4 pt-[12vh] backdrop-blur-sm",onMouseDown:e=>e.target===e.currentTarget&&w(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"w-full max-w-xl overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line px-3",children:[(0,t.jsx)(k.Search,{size:16,className:"text-mute","aria-hidden":!0}),(0,t.jsx)("input",{ref:A,value:v,role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":P[N]?`palette-${P[N].id}`:void 0,onChange:e=>{j(e.target.value),C(0)},onKeyDown:e=>{"Escape"===e.key?w(!1):"ArrowDown"===e.key?(e.preventDefault(),C(e=>Math.min(P.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),C(e=>Math.max(0,e-1))):"Enter"===e.key&&(e.preventDefault(),P[N]?.run())},placeholder:"Go to a page, open a saved request, switch environment…",className:"min-w-0 flex-1 bg-transparent py-3 text-sm text-ink outline-none placeholder:text-mute"}),(0,t.jsx)("span",{className:"kbd",children:"Esc"})]}),(0,t.jsxs)("ul",{id:"palette-list",ref:T,role:"listbox","aria-label":"Commands",className:"max-h-[50vh] overflow-auto p-1",children:[0===P.length?(0,t.jsx)("li",{className:"px-3 py-6 text-center text-sm text-mute",children:"No matches."}):null,P.map((e,s)=>{let n=0===s||P[s-1].group!==e.group;return(0,t.jsxs)("li",{children:[n?(0,t.jsx)("div",{className:"px-2 pt-2 pb-1 text-[11px] font-medium tracking-wide text-mute uppercase",children:e.group}):null,(0,t.jsxs)("div",{id:`palette-${e.id}`,role:"option","aria-selected":s===N,"data-index":s,onMouseMove:()=>C(s),onClick:()=>e.run(),className:`flex cursor-pointer items-center justify-between gap-3 rounded-md px-2.5 py-2 text-sm ${s===N?"bg-accent-dim text-ink":"text-ink"}`,children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.label}),e.hint?(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-mute",children:e.hint}):null]})]},e.id)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-t border-line px-3 py-2 text-xs text-mute",children:[(0,t.jsx)(K,{size:12,"aria-hidden":!0})," ",(0,t.jsx)("span",{className:"kbd",children:h}),"+",(0,t.jsx)("span",{className:"kbd",children:"K"})," anywhere · ↑↓ to move · Enter to run"]})]})}):null}},78739,e=>{"use strict";var t=e.i(14368),s=e.i(17118),n=e.i(75117),a=e.i(80190),r=e.i(20621),i=e.i(27813),o=e.i(458),l=e.i(49913),c=e.i(30729),d=e.i(42709),u=e.i(87283),h=e.i(99181),p=e.i(73151),m=e.i(39736),x=e.i(60889),f=e.i(56396),b=e.i(44505),y=e.i(20054),g=e.i(59180);let w="atc:about",v=[{href:"https://apitestcenter.com/docs/",label:"User guide — how everything works"},{href:"https://apitestcenter.com/learn/",label:"Learn — API and load testing, from zero"},{href:"https://apitestcenter.com/whats-new.html",label:"What's new in every version"},{href:"https://apitestcenter.com",label:"apitestcenter.com"},{href:"https://apitestcenter.com/privacy.html",label:"Privacy"},{href:"mailto:support@apitestcenter.com",label:"Report a problem — support@apitestcenter.com"}];function k({status:e}){if(!e)return(0,t.jsx)("p",{className:"text-sm text-mute",children:"Updates are checked by the desktop app. This copy runs in a browser."});switch(e.state){case"unsupported":return(0,t.jsx)("p",{className:"text-sm text-mute",children:"store"===e.reason?"This copy comes from the Microsoft Store, which keeps it up to date.":"off"===e.reason?"Update checks are turned off on this computer (ATC_NO_UPDATE).":"This is a development build; it does not update itself."});case"idle":return(0,t.jsx)("p",{className:"text-sm text-mute",children:"Checks for a new version shortly after opening and every 6 hours."});case"checking":return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(i.Loader2,{size:14,className:"animate-spin text-accent"})," Checking for a new version…"]});case"current":return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(s.CheckCircle2,{size:14,className:"text-ok"})," You have the latest version."]});case"available":return(0,t.jsxs)("p",{className:"text-sm text-ink",children:["Version ",e.version," is available","important"===e.level?" — an important update":"","."]});case"downloading":return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(i.Loader2,{size:14,className:"animate-spin text-accent"})," ",e.percent>=100?`Checking the download of ${e.version}…`:`Downloading version ${e.version}… ${e.percent}%`]}),(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-panel-2",children:(0,t.jsx)("div",{className:"h-full bg-accent",style:{width:`${e.percent}%`}})})]});case"ready":return(0,t.jsxs)("p",{className:"text-sm text-ink",children:["Version ",e.version," is downloaded. Restart to finish updating — or it updates the next time the app quits."]});case"error":return(0,t.jsxs)("p",{className:"flex items-start gap-2 text-sm text-ink",children:[(0,t.jsx)(d.TriangleAlert,{size:14,className:"mt-0.5 shrink-0 text-warn"})," ",e.message]})}}e.s(["AboutDialog",0,function(){let e=(0,f.useToast)(),{appVersion:s,k6Label:i,k6Ready:d,dataDir:j,online:N}=(0,y.useEngineHealth)(),[S,C]=(0,h.useState)(!1),[A,T]=(0,h.useState)(null),E=(0,h.useRef)(null),P=(0,b.desktop)(),I=(0,x.useVersionTaps)((0,h.useCallback)(()=>e("Plan preview unlocked: Settings → Plan","success"),[e]));if((0,h.useEffect)(()=>{let e=()=>C(!0);window.addEventListener(w,e);let t=P?.onUpdateStatus(T);return()=>{window.removeEventListener(w,e),t?.()}},[P]),(0,h.useEffect)(()=>{if(!S)return;P?.updateStatus().then(e=>e&&T(e)),window.setTimeout(()=>E.current?.focus(),0);let e=e=>"Escape"===e.key&&C(!1);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[S,P]),!S)return null;let $=A?.state==="checking"||A?.state==="downloading",L=A?.state==="available"||A?.state==="downloading"||A?.state==="ready"||A?.state==="error"&&!!A.release,q=P&&A&&"unsupported"!==A.state&&!L,R=()=>{C(!1),(0,p.openUpdate)()};return(0,t.jsx)("div",{className:"fixed inset-0 z-[75] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&C(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"about-title",className:"w-full max-w-lg rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-3 border-b border-line px-5 py-4",children:[(0,t.jsx)("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-accent-dim text-xs font-semibold tracking-wider text-accent","aria-hidden":!0,children:"ATC"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{id:"about-title",className:"text-base font-medium text-ink",children:"APITestCenter"}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Version"," ",(0,t.jsx)("span",{className:"font-mono text-ink",onClick:I,children:s&&"dev"!==s?s:"development build"})," · ",N?d?i:"k6 not found":"engine starting…"]})]}),(0,t.jsx)("button",{ref:E,type:"button",onClick:()=>C(!1),"aria-label":"Close",className:"ml-auto self-start rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(u.X,{size:16})})]}),(0,t.jsxs)("section",{className:"space-y-3 border-b border-line px-5 py-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium tracking-wide text-mute uppercase",children:"Updates"}),(0,t.jsx)(k,{status:P?A:null}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[q?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:$,onClick:async()=>{T({state:"checking",canInstall:!!A&&"canInstall"in A&&A.canInstall});let e=await P.checkForUpdates().catch(()=>null);e&&T(e),e?.state==="available"&&R()},children:[(0,t.jsx)(o.RefreshCw,{size:14,className:$?"animate-spin":""})," Check for updates"]}):null,L&&A?(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:R,children:["ready"===A.state?(0,t.jsx)(l.RotateCw,{size:14}):(0,t.jsx)(n.Download,{size:14}),"ready"===A.state?"Restart to update…":"downloading"===A.state?"See the download":`See what's in ${"version"in A?A.version:"it"}…`]}):null,A?.state==="error"&&!A.release&&P?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>void P.openDownloadPage(),children:[(0,t.jsx)(n.Download,{size:14})," Open the download page"]}):null,(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>{C(!1),(0,m.openWhatsNew)()},children:[(0,t.jsx)(c.Sparkles,{size:14,"aria-hidden":!0})," What's new in this version"]})]})]}),(0,t.jsxs)("section",{className:"space-y-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium tracking-wide text-mute uppercase",children:"Your files"}),(0,t.jsx)("p",{className:"text-sm text-mute",children:"Saved requests, environments, and history are plain files on this computer:"}),(0,t.jsx)("p",{className:"truncate rounded-md bg-panel-2 px-2 py-1.5 font-mono text-xs text-ink",title:j,children:j??(N?"…":"Waiting for the engine to start…")}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:!j,onClick:()=>g.historyApi.reveal().catch(t=>e(t instanceof Error?t.message:"Could not open the folder","error")),children:[(0,t.jsx)(r.FolderOpen,{size:14})," Open folder"]})]}),(0,t.jsxs)("section",{className:"px-5 py-4",children:[(0,t.jsx)("ul",{className:"space-y-1.5 text-sm",children:v.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-accent hover:underline",children:[e.label," ",(0,t.jsx)(a.ExternalLink,{size:12,"aria-hidden":!0})]})},e.href))}),(0,t.jsx)("p",{className:"mt-3 text-xs text-mute",children:"© 2026 Ratul Roy. Free to use. Includes open-source software such as Grafana k6 (AGPL-3.0); the full list ships with the app as THIRD-PARTY-NOTICES.txt."})]})]})})},"openAbout",0,function(){window.dispatchEvent(new Event(w))}])},89142,e=>{"use strict";e.s(["GLOSSARY",0,[{group:"Reading results",term:"Response time",tech:"p95 latency",text:"How long requests took. “p95 200 ms” means 95 of every 100 requests finished within 200 ms. It is a better guide than the average, because people notice the slow ones."},{group:"Reading results",term:"Typical response time",tech:"p50 · median",text:"Half of the requests were faster than this, half slower."},{group:"Reading results",term:"Slowest responses",tech:"p99 · max",text:"p99: the slowest 1 in 100 requests took at least this long. Max: the single slowest one."},{group:"Reading results",term:"Requests per second",tech:"throughput · RPS",text:"How many requests the API answered each second. Higher is better, as long as response time stays reasonable."},{group:"Reading results",term:"Failed requests",tech:"error rate",text:"The share of requests that got no answer, or an error status (400 or higher)."},{group:"Reading results",term:"Requests not sent",tech:"dropped iterations",text:"In request-rate tests: requests that could not start on time because every simulated user was still waiting for an answer. A sign the API — or this computer — could not keep up."},{group:"Reading results",term:"User satisfaction score",tech:"Apdex",text:"From 0 to 1. Counts answers that were fast (within your response-time goal) and ones that were slow but bearable (within 4×). 1 means everyone would be happy."},{group:"Reading results",term:"Server time",tech:"TTFB · time to first byte",text:"From sending the request to the first byte of the answer — mostly your API doing its work. Connection times (TCP, TLS) are the network and this computer."},{group:"Reading results",term:"Result",tech:"verdict",text:"The app's plain summary of a run: looks healthy, usable with warnings, or failing. It explains each part underneath."},{group:"Reading results",term:"Reference run",tech:"baseline",text:"A run you choose to compare later runs of the same API against, to see if they got faster or slower. Pick one in a report or in History."},{group:"Setting up a test",term:"Simulated users",tech:"virtual users · VUs",text:"Pretend users. Each one sends a request, waits for the answer, maybe pauses, and sends the next. A slow API gets fewer requests."},{group:"Setting up a test",term:"Request rate",tech:"arrival rate",text:"Instead of users, hold a fixed number of requests per second whatever the API does. The honest way to find how much an API can take."},{group:"Setting up a test",term:"Presets",text:"Smoke: tiny, just checks it works. Average: a normal day. Stress: more than usual. Spike: a sudden burst. Soak: a long run that finds slow leaks."},{group:"Setting up a test",term:"Ramp up / step by step",tech:"stages",text:"Change the load over time — for example, go up to 50 users over a minute, stay there, then go down."},{group:"Setting up a test",term:"Pause between requests",tech:"think time",text:"How long each simulated user waits before sending the next request, like a person reading the page."},{group:"Setting up a test",term:"Checks",text:"Your rules for a correct answer, like “status is 200” or “has a name field”. A fast answer with an error inside fails a good check."},{group:"Setting up a test",term:"Goals",tech:"thresholds",text:"Pass/fail limits for the whole test, like “95% of requests within 500 ms” and “fewer than 1% failed”."},{group:"Setting up a test",term:"Environment",tech:"{{variables}}",text:"A named set of values such as a base URL or a token. Write {{name}} in a request and switch environments (Dev, UAT) without editing it."},{group:"Setting up a test",term:"Run first",tech:"request chaining",text:"Send another saved request first — usually signing in — and use values from its answer, like a token, in this request."},{group:"Setting up a test",term:"Test data",tech:"CSV",text:"A spreadsheet file whose columns become {{variables}}. Each request uses the next row, so a test can use many users or IDs."},{group:"Setting up a test",term:"Auth",tech:"authentication",text:"How the request proves who it is: a Bearer token, a username and password (Basic), or an API key."},{group:"About the app",term:"k6",text:"The open-source load-testing engine the app runs on this computer for load tests."},{group:"About the app",term:"Practice API",text:"A small pretend shop built into the app — products, sign-in, orders, a slow and a flaky endpoint — so you can learn without testing a real system."},{group:"About the app",term:"Where results are kept",text:"On this computer only, as plain files in your app-data folder. History shows them and lets you delete them."}]])},24448,e=>{"use strict";var t=e.i(14368),s=e.i(42025);function n(e){let[t,s]=e.split("#");return`https://apitestcenter.com/docs/${t}.html${s?`#${s}`:""}`}e.s(["GuideLink",0,function({topic:e,className:a=""}){return(0,t.jsxs)("a",{href:n(e),target:"_blank",rel:"noreferrer",title:"How this works, in the user guide (apitestcenter.com)",className:`inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-1 text-xs text-mute hover:text-accent ${a}`,children:[(0,t.jsx)(s.BookOpen,{size:13,"aria-hidden":!0})," Guide"]})},"guideForPath",0,function(e){return e.startsWith("/suite")?{topic:"collection-runner",label:"Collection runs and scheduled checks"}:e.startsWith("/history")?{topic:"history",label:"History"}:e.startsWith("/compare")?{topic:"compare",label:"Compare"}:e.startsWith("/connections")?{topic:"connections",label:"Connections"}:e.startsWith("/home")?{topic:"getting-started",label:"Getting started"}:{topic:"sending-requests",label:"Sending requests"}},"guideUrl",0,n])},7641,97942,839,15868,e=>{"use strict";var t=e.i(14368),s=e.i(42025),n=e.i(8055),a=e.i(88293),r=e.i(87283),i=e.i(36994),o=e.i(99181),l=e.i(89142),c=e.i(24448),d=e.i(5831),u=e.i(45672),h=e.i(78739),p=e.i(58246),m=e.i(42447),x=e.i(83316),f=e.i(20621),b=e.i(65539),y=e.i(48773),g=e.i(31035),w=e.i(42967),v=e.i(29800),k=e.i(34761),j=e.i(73606),N=e.i(29312),S=e.i(50962),C=e.i(30135),A=e.i(30729),T=e.i(745),E=e.i(82129),P=e.i(96659),I=e.i(48317),$=e.i(39736),L=e.i(72350),q=e.i(51554),R=e.i(56396),M=e.i(45449),O=e.i(57489),D=e.i(56931),F=e.i(5504),z=e.i(91694),W=e.i(27813),U=e.i(99522);let H=(0,U.default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var _=e.i(39170),B=e.i(6278);let V="atc:versions",K="atc:trash",J="atc:request-replaced";function G(){window.dispatchEvent(new Event(K))}let Y={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"};function X(e){let t=new Date(e),s=Math.round((Date.now()-t.getTime())/6e4);if(s<1)return"Just now";if(s<60)return`${s} minute${1===s?"":"s"} ago`;let n=t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),a=new Date,r=new Date(a.getTime()-864e5);return t.toDateString()===a.toDateString()?`Today ${n}`:t.toDateString()===r.toDateString()?`Yesterday ${n}`:`${t.toLocaleDateString(void 0,{day:"numeric",month:"short"})} ${n}`}let Q=[["name","Name"],["collection","Folder"],["method","Method"],["url","Address"],["params","Params"],["headers","Headers"],["authMode","Auth"],["bodyMode","Body type"],["bodyText","Body"],["graphqlQuery","GraphQL query"],["graphqlVariables","GraphQL variables"],["formRows","Form"],["checks","Checks"],["saveValues","Save values"],["before","Run first"],["testData","Test data"],["scripts","Scripts"],["mock","Example"]];function Z(e){return null==e||""===e?"":"string"==typeof e?e:Array.isArray(e)&&0===e.length?"":JSON.stringify(e,null,2)}function ee({title:e,icon:s,onClose:n,children:a,wide:i=!1}){let l=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=document.activeElement;l.current?.focus();let t=e=>"Escape"===e.key&&n();return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t),e?.focus?.()}},[n]),(0,t.jsx)("div",{className:"fixed inset-0 z-[66] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-10",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"hd-title",className:`flex max-h-[85vh] w-full flex-col rounded-xl border border-line bg-panel shadow-2xl ${i?"max-w-5xl":"max-w-2xl"}`,children:[(0,t.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-line px-5 py-4",children:[s,(0,t.jsx)("h2",{id:"hd-title",className:"min-w-0 truncate text-base font-medium text-ink",children:e}),(0,t.jsx)("button",{ref:l,type:"button",onClick:n,"aria-label":"Close",className:"ml-auto rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(r.X,{size:16})})]}),a]})})}e.s(["REQUEST_REPLACED_EVENT",0,J,"TrashDialog",0,function(){let e=(0,R.useToast)(),s=(0,_.useConfirm)(),{refresh:n}=(0,B.useWorkspace)(),[a,i]=(0,o.useState)(!1),[l,c]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=()=>i(!0);return window.addEventListener(K,e),()=>window.removeEventListener(K,e)},[]);let d=()=>B.workspaceApi.trash().then(c).catch(t=>e(t instanceof Error?t.message:"Could not read the Trash","error"));if((0,o.useEffect)(()=>{a&&(c(null),d())},[a]),!a)return null;async function u(t){try{await B.workspaceApi.restoreFromTrash(t.id),await n(),e(`Restored “${t.name}”${t.collection?` to ${t.collection}`:""}`,"success"),await d()}catch(t){e(t instanceof Error?t.message:"Could not restore it","error")}}async function h(e){await s({title:`Delete “${e.name}” for good?`,body:"It can't be restored after this.",confirmLabel:"Delete for good",tone:"danger"})&&(await B.workspaceApi.deleteFromTrash(e.id).catch(()=>void 0),await d())}async function p(){await s({title:"Empty the Trash?",body:`${l?.length??0} request${l?.length===1?"":"s"} will be deleted for good.`,confirmLabel:"Empty Trash",tone:"danger"})&&(await B.workspaceApi.emptyTrash().catch(()=>void 0),await d())}return(0,t.jsxs)(ee,{title:"Trash",icon:(0,t.jsx)(P.Trash2,{size:16,className:"text-accent","aria-hidden":!0}),onClose:()=>i(!1),children:[(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:l?0===l.length?(0,t.jsx)("p",{className:"px-5 py-10 text-sm text-mute",children:"The Trash is empty. Deleted requests wait here for 30 days, so you can bring them back."}):(0,t.jsx)("ul",{children:l.map((e,s)=>(0,t.jsxs)("li",{className:`flex items-center gap-3 px-5 py-3 ${s?"border-t border-line":""}`,children:[(0,t.jsx)("span",{className:`w-10 shrink-0 font-mono text-[11px] font-semibold ${Y[e.method]??"text-mute"}`,children:"DELETE"===e.method?"DEL":e.method}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-sm text-ink",children:e.name}),(0,t.jsxs)("span",{className:"block truncate text-xs text-mute",children:[e.collection||"No folder"," · deleted ",X(e.deletedAt).toLowerCase()]})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-xs",onClick:()=>void u(e),children:[(0,t.jsx)(H,{size:13,"aria-hidden":!0})," Restore"]}),(0,t.jsx)("button",{type:"button","aria-label":`Delete ${e.name} for good`,title:"Delete for good",className:"rounded p-1.5 text-mute hover:text-bad",onClick:()=>void h(e),children:(0,t.jsx)(r.X,{size:14})})]},e.id))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-5 py-10 text-sm text-mute",children:[(0,t.jsx)(W.Loader2,{size:14,className:"animate-spin"})," Reading the Trash…"]})}),(0,t.jsxs)("footer",{className:"flex shrink-0 items-center gap-3 border-t border-line px-5 py-3",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 text-xs text-mute",children:"Kept for 30 days, then deleted for good."}),(0,t.jsx)("button",{type:"button",className:"btn btn-danger py-1.5 text-xs",disabled:!l?.length,onClick:()=>void p(),children:"Empty Trash"})]})]})},"VersionsDialog",0,function(){let e=(0,R.useToast)(),s=(0,_.useConfirm)(),{refresh:n}=(0,B.useWorkspace)(),[a,r]=(0,o.useState)(null),[i,l]=(0,o.useState)(null),[c,d]=(0,o.useState)(null),[u,h]=(0,o.useState)(null),[p,m]=(0,o.useState)(null),[x,f]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{let e=e=>r(e.detail.id);return window.addEventListener(V,e),()=>window.removeEventListener(V,e)},[]),(0,o.useEffect)(()=>{a&&(l(null),d(null),h(null),m(null),Promise.all([B.workspaceApi.get(a),B.workspaceApi.versions(a)]).then(([e,t])=>{l(e),d(t),h(t[0]?.at??null)}).catch(t=>{e(t instanceof Error?t.message:"Could not read the versions","error"),r(null)}))},[a,e]),(0,o.useEffect)(()=>{if(!a||!u)return m(null);let e=!0;return B.workspaceApi.version(a,u).then(t=>e&&m(t)).catch(()=>e&&m(null)),()=>{e=!1}},[a,u]),!a)return null;let b=()=>r(null),y=p&&i?function(e,t){let s={...e.request,name:e.name,collection:e.collection},n={...t.request,name:t.name,collection:t.collection},a=[],r=new Set(Q.map(([e])=>e));for(let[e,t]of Q){let r=Z(s[e]),i=Z(n[e]);r!==i&&a.push({label:t,before:r,after:i})}let i=[...new Set([...Object.keys(s),...Object.keys(n)])].filter(e=>!r.has(e)&&Z(s[e])!==Z(n[e]));return i.length&&a.push({label:`Other settings (${i.join(", ")})`,before:i.map(e=>`${e}: ${Z(s[e])||"—"}`).join("\n"),after:i.map(e=>`${e}: ${Z(n[e])||"—"}`).join("\n")}),a}(p,i):[];async function g(){if(a&&u&&i&&await s({title:`Restore the version from ${X(u)}?`,body:"What's saved now is kept as a version, so you can come back to it.",confirmLabel:"Restore"})){f(!0);try{let t=await B.workspaceApi.restoreVersion(a,u);await n(),window.dispatchEvent(new CustomEvent(J,{detail:t})),e(`Restored “${t.name}” to ${X(u)}`,"success"),b()}catch(t){e(t instanceof Error?t.message:"Could not restore it","error")}finally{f(!1)}}}return(0,t.jsx)(ee,{title:i?`${i.name} — version history`:"Version history",icon:(0,t.jsx)(z.History,{size:16,className:"text-accent","aria-hidden":!0}),onClose:b,wide:!0,children:c&&i?0===c.length?(0,t.jsx)("div",{className:"px-5 py-10 text-sm text-mute",children:"No earlier versions yet. Each time you save a change, the version it replaces is kept here — the last 50."}):(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-wrap",children:[(0,t.jsxs)("ol",{"aria-label":"Versions",className:"max-h-[60vh] w-full overflow-y-auto border-line p-2 sm:w-64 sm:border-r",children:[(0,t.jsxs)("li",{className:"px-3 py-2 text-xs text-mute",children:["Now — ",X(i.updatedAt)]}),c.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>h(e.at),"aria-current":u===e.at?"true":void 0,className:`flex w-full flex-col gap-0.5 rounded-md px-3 py-2 text-left ${u===e.at?"bg-accent-dim shadow-[inset_2px_0_0_var(--accent)]":"hover:bg-panel-2"}`,children:[(0,t.jsx)("span",{className:"text-sm text-ink",children:X(e.at)}),(0,t.jsxs)("span",{className:"truncate text-xs text-mute",children:[(0,t.jsx)("span",{className:`font-mono ${Y[e.method]??""}`,children:e.method})," ",e.name]})]})},e.at))]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"max-h-[60vh] min-h-0 flex-1 space-y-3 overflow-y-auto p-5",children:p?0===y.length?(0,t.jsx)("p",{className:"text-sm text-mute",children:"This version is the same as now."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:[y.length," change",1===y.length?"":"s"," from ",X(u)," to now"]}),y.map(e=>(0,t.jsxs)("section",{className:"overflow-hidden rounded-lg border border-line",children:[(0,t.jsx)("h3",{className:"bg-panel-2 px-3 py-1.5 text-xs font-medium text-mute",children:e.label}),(0,t.jsxs)("div",{className:"grid font-mono text-xs sm:grid-cols-2",children:[(0,t.jsxs)("pre",{className:"max-h-48 overflow-auto bg-bad/5 px-3 py-2 break-words whitespace-pre-wrap text-ink",children:[(0,t.jsx)("span",{className:"mb-1 block font-sans text-[11px] text-bad",children:"Then"}),e.before||(0,t.jsx)("span",{className:"text-mute",children:"(empty)"})]}),(0,t.jsxs)("pre",{className:"max-h-48 overflow-auto border-line bg-ok/5 px-3 py-2 break-words whitespace-pre-wrap text-ink sm:border-l",children:[(0,t.jsx)("span",{className:"mb-1 block font-sans text-[11px] text-ok",children:"Now"}),e.after||(0,t.jsx)("span",{className:"text-mute",children:"(empty)"})]})]})]},e.label))]}):(0,t.jsx)("p",{className:"text-sm text-mute",children:"Reading that version…"})}),(0,t.jsxs)("footer",{className:"flex shrink-0 items-center gap-3 border-t border-line px-5 py-3",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 text-xs text-mute",children:"Versions live on this computer. Secret values are never kept in them."}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!p||x||0===y.length,onClick:()=>void g(),children:[x?(0,t.jsx)(W.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(H,{size:14,"aria-hidden":!0}),"Restore this version"]})]})]})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-5 py-10 text-sm text-mute",children:[(0,t.jsx)(W.Loader2,{size:14,className:"animate-spin"})," Reading versions…"]})})},"openTrash",0,G,"openVersions",0,function(e){window.dispatchEvent(new CustomEvent(V,{detail:{id:e}}))}],97942);var et=e.i(44505),es=e.i(20054),en=e.i(19656),ea=e.i(59180),er=e.i(2603),ei=e.i(14865),eo=e.i(30204);e.i(24856);var el=e.i(85903),ec=e.i(99074),ed=e.i(1675),eu=e.i(80190),eh=e.i(19286),ep=e.i(458),em=e.i(63966);let ex=(0,U.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);var ef=e.i(95987);let eb=(0,U.default)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);var ey=e.i(60889);let eg=e=>e?new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):"";function ew({account:e}){let s=(0,R.useToast)(),n=(0,_.useConfirm)(),[a,r]=(0,o.useState)("closed"),[i,l]=(0,o.useState)(""),[c,d]=(0,o.useState)(""),[u,h]=(0,o.useState)(""),[p,m]=(0,o.useState)([]),[x,f]=(0,o.useState)(""),[b,y]=(0,o.useState)(!1),g=async e=>{y(!0);try{await e()}catch(e){s(e instanceof Error?e.message:"Something went wrong.","error")}finally{y(!1)}},w=()=>{r("closed"),d(""),f("")},v=()=>g(async()=>{h(await ey.accountApi.start(i)),d(""),r("code")}),j=e=>g(async()=>{try{let t=await ey.accountApi.verify(i,c,e);w(),s(t.license&&t.fromAccount?`Signed in. ${"team"===t.payload.tier?"Team":"Pro"} is on for this computer.`:"Signed in.","success")}catch(e){if(!(e instanceof ey.TooManyComputers))throw e;m(e.computers),f(e.computers.at(-1)?.id??""),r("computers")}});if(e){let s=e.computers.filter(t=>t.id!==e.session);return(0,t.jsxs)("section",{"aria-label":"Account",className:"space-y-2 rounded-lg border border-line px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(eb,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"truncate text-sm font-medium text-ink",children:["Signed in as ",e.email]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"member"===e.role?"On your company's Team.":"owner"===e.role?"Your plan comes with your account.":e.manages?"You manage a Team plan. To use it here, add your own email to the Team on apitestcenter.com/account.html: it takes one seat.":"No plan on this account: Free."})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:b,onClick:async()=>{await n({title:"Sign out of this computer?",body:"The plan that came with your account leaves this computer; everything you made stays. Sign in again any time.",confirmLabel:"Sign out",cancelLabel:"Stay signed in"})&&g(()=>ey.accountApi.signOut())},children:[(0,t.jsx)(ex,{size:14,"aria-hidden":!0})," Sign out"]})]}),e.computers.length?(0,t.jsxs)("ul",{"aria-label":"Computers signed in",className:"space-y-1 border-t border-line/60 pt-2",children:[[...e.computers.filter(t=>t.id===e.session),...s].map(s=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(k.Monitor,{size:14,className:"shrink-0 text-mute","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-ink",children:[s.computer,(0,t.jsx)("span",{className:"ml-2 text-xs text-mute",children:s.id===e.session?"This computer":`Last used ${eg(s.seen_at)}`})]}),s.id!==e.session?(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",disabled:b,onClick:()=>void g(()=>ey.accountApi.signOut(s.id)),children:"Sign out"}):null]},s.id)),(0,t.jsx)("li",{className:"text-xs text-mute",children:"The plan works on each of these; your requests and results stay on the computer you made them on (keep a project in git or a synced folder to share it)."})]}):null]})}return(0,t.jsxs)("section",{"aria-label":"Account",className:"space-y-2 rounded-lg border border-line px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(eb,{size:18,className:"shrink-0 text-mute","aria-hidden":!0}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-ink",children:"Account"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Bought Pro, or on your company's Team? Sign in with your email and the plan comes to this computer. No password: we email you a code. Optional."})]}),"closed"===a?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>r("email"),children:[(0,t.jsx)(em.LogIn,{size:14,"aria-hidden":!0})," Sign in"]}):null]}),"email"===a?(0,t.jsxs)("form",{"aria-label":"Sign in",className:"flex flex-wrap items-end gap-2",onSubmit:e=>{e.preventDefault(),v()},children:[(0,t.jsxs)("label",{className:"min-w-56 flex-1 space-y-1 text-sm",children:[(0,t.jsx)("span",{className:"text-ink",children:"Email"}),(0,t.jsx)("input",{className:"input w-full",type:"email",autoComplete:"email",value:i,onChange:e=>l(e.target.value),placeholder:"you@company.com",autoFocus:!0})]}),(0,t.jsxs)("button",{type:"submit",className:"btn btn-primary py-1.5 text-sm",disabled:b||!i.trim(),children:[(0,t.jsx)(ef.Mail,{size:14,"aria-hidden":!0})," Email me a code"]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:w,children:"Cancel"})]}):null,"code"===a?(0,t.jsxs)("form",{"aria-label":"Sign-in code",className:"space-y-2",onSubmit:e=>{e.preventDefault(),j()},children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:[u," Check spam too."]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,t.jsxs)("label",{className:"space-y-1 text-sm",children:[(0,t.jsx)("span",{className:"text-ink",children:"6-digit code"}),(0,t.jsx)("input",{className:"input w-36 font-mono tracking-[0.3em]",inputMode:"numeric",autoComplete:"one-time-code",maxLength:7,value:c,onChange:e=>d(e.target.value.replace(/[^\d ]/g,"")),placeholder:"000000",autoFocus:!0})]}),(0,t.jsx)("button",{type:"submit",className:"btn btn-primary py-1.5 text-sm",disabled:b||6!==c.replace(/\s/g,"").length,children:"Sign in"}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:b,onClick:()=>void v(),children:"Send a new code"}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>r("email"),children:"Use another email"})]})]}):null,"computers"===a?(0,t.jsxs)("form",{"aria-label":"Choose a computer to sign out",className:"space-y-2",onSubmit:e=>{e.preventDefault(),j(x)},children:[(0,t.jsxs)("p",{className:"text-sm text-ink",children:["Your plan is signed in on ",p.length," computers already. Sign out of one to use it here:"]}),(0,t.jsx)("div",{className:"space-y-1",children:p.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("input",{type:"radio",name:"replace",checked:x===e.id,onChange:()=>f(e.id)}),(0,t.jsx)("span",{className:"text-ink",children:e.computer}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:["last used ",eg(e.seen_at)]})]},e.id))}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"submit",className:"btn btn-primary py-1.5 text-sm",disabled:b||!x,children:"Sign it out and sign in here"}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:w,children:"Cancel"})]})]}):null]})}let ev="https://apitestcenter.com/#pricing",ek=eo.default.env.NEXT_PUBLIC_ATC_BUY_URL??"https://apitestcenter.com/buy.html",ej=["connections.enterprise","schedules","history.days","baselines","connections.exportRows","connections.expandDepth","exports.unbranded","workspaces.shared"],eN={info:"border-line bg-panel-2/40",warn:"border-warn/40 bg-warn/5",bad:"border-bad/40 bg-bad/5"};function eS(){let e=(0,R.useToast)(),s=(0,_.useConfirm)(),{state:n,preview:a,unlocked:r,license:i}=(0,ey.usePlan)(),[l,c]=(0,o.useState)("yearly"),[d,u]=(0,o.useState)(!1),[h,p]=(0,o.useState)(""),[m,x]=(0,o.useState)(!1),f=!a&&i?.license?i:null,b=(0,el.tierNow)(n),y=(0,el.planNotice)(n),g=t=>e(a?`Plan preview: this would ${t}.`:"Pro isn't on sale yet — the website will say when it is.","success"),v=async t=>{x(!0);try{await t()}catch(t){e(t instanceof Error?t.message:"Something went wrong.","error")}finally{x(!1)}},k=e=>f?v(async()=>window.open(await ey.licenseApi.portal(),"_blank","noopener")):g(e),j=f?.state.renewsAt?new Date(f.state.renewsAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):null,N=i?.account??null,S=`${ek}?plan=pro${N?.id?`&account=${encodeURIComponent(N.id)}&email=${encodeURIComponent(N.email)}`:""}`;return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("section",{"aria-label":"Your plan",className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-line px-4 py-3",children:[(0,t.jsx)(A.Sparkles,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-ink",children:["free"===b?"Free":"team"===b?"Team":"Pro","trial"===n.status?" trial":"",f&&"team"===f.payload.tier?` \xb7 ${f.payload.seats} people`:"",a?(0,t.jsx)("span",{className:"ml-2 rounded bg-accent-dim px-1.5 py-0.5 text-[11px] font-normal text-ink",children:"Preview"}):null,f?.sandbox?(0,t.jsx)("span",{className:"ml-2 rounded bg-warn/15 px-1.5 py-0.5 text-[11px] font-normal text-ink",title:"Bought in Paddle's test mode with a test card. Counts only before Pro launches.",children:"Test license"}):null]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:a?"How the app looks in this state, with the limits on. Only on this computer; nothing is charged or changed.":f?`${"year"===f.payload.interval?"Yearly":"Monthly"}${j?` \xb7 renews ${j}`:""}${f.checkedAt?` \xb7 checked ${new Date(f.checkedAt).toLocaleDateString()}`:""}`:"Free during early access: every feature is included. Pro and Team are coming."})]}),f?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:m,onClick:()=>void k(""),children:[(0,t.jsx)(eu.ExternalLink,{size:14,"aria-hidden":!0})," Manage subscription"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:m,title:"Ask the license server for the newest state of your subscription",onClick:()=>void v(async()=>{await ey.licenseApi.refresh(),e("License is up to date.","success")}),children:[(0,t.jsx)(ep.RefreshCw,{size:14,"aria-hidden":!0})," Check now"]}),f.fromAccount?null:(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:m,onClick:async()=>{await s({title:"Remove the license from this computer?",body:"The app goes back to Free here. The subscription isn't cancelled; paste the key again any time.",confirmLabel:"Remove",cancelLabel:"Keep it"})&&v(()=>ey.licenseApi.remove())},children:"Remove"})]}):"free"===b?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r&&!a?(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>window.open(S,"_blank","noopener"),children:[(0,t.jsx)(eu.ExternalLink,{size:14,"aria-hidden":!0})," Buy Pro"]}):null,(0,t.jsxs)("button",{type:"button",className:`btn ${r&&!a?"btn-secondary":"btn-primary"} py-1.5 text-sm`,onClick:()=>g(`start a ${el.TRIAL_DAYS}-day Pro trial, no card needed`),children:["Try Pro free for ",el.TRIAL_DAYS," days"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm","aria-expanded":d,onClick:()=>a?g("ask for your license key"):u(e=>!e),children:[(0,t.jsx)(eh.KeyRound,{size:14,"aria-hidden":!0})," Enter a license key"]})]}):(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>void k("open your subscription: card, invoices, plan, cancel"),children:"Manage subscription"})]}),!d||f||a?null:(0,t.jsxs)("form",{"aria-label":"Enter a license key",className:"space-y-2 rounded-lg border border-line px-4 py-3",onSubmit:t=>{t.preventDefault(),v(async()=>{await ey.licenseApi.set(h),u(!1),p(""),e("License added. Thank you!","success")})},children:[(0,t.jsxs)("label",{className:"block space-y-1 text-sm",children:[(0,t.jsx)("span",{className:"text-ink",children:"License key"}),(0,t.jsx)("textarea",{className:"input h-20 w-full resize-none font-mono text-xs",value:h,onChange:e=>p(e.target.value),placeholder:"ATC1.…",spellCheck:!1,autoFocus:!0})]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"From the page after you paid. It works offline; the app checks it with the license server about once a day."}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"submit",className:"btn btn-primary py-1.5 text-sm",disabled:m||!h.trim(),children:"Add license"}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>u(!1),children:"Cancel"})]})]}),y?(0,t.jsxs)("div",{role:"status",className:`flex items-start gap-2 rounded-lg border px-4 py-3 text-sm ${eN[y.tone]}`,children:["info"===y.tone?(0,t.jsx)(w.Info,{size:16,className:"mt-0.5 shrink-0 text-mute","aria-hidden":!0}):(0,t.jsx)(ec.CircleAlert,{size:16,className:"mt-0.5 shrink-0 text-warn","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-ink",children:y.title}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:y.body})]}),"payment"===y.action?(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1 text-sm",onClick:()=>void k("open your subscription to change the card"),children:"Update the card"}):"renew"===y.action?(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1 text-sm",onClick:()=>g("open the checkout to renew"),children:"Renew"}):"upgrade"===y.action?(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1 text-sm",onClick:()=>g("open the checkout"),children:"Keep Pro"}):null]}):null,a?null:(0,t.jsx)(ew,{account:N})]}),r?null:(0,t.jsxs)("p",{className:"text-sm text-mute",children:["Pro and Team plans are coming, for people and companies who test every day. Everything you use now stays in Free."," ",(0,t.jsx)("a",{className:"text-accent underline-offset-2 hover:underline",href:ev,target:"_blank",rel:"noreferrer",children:"Tell me when Pro launches"})]}),r?(0,t.jsxs)("section",{"aria-label":"The plans",className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-ink",children:"The plans"}),(0,t.jsx)(M.Segmented,{label:"Billing",value:l,onChange:c,options:[{value:"yearly",label:"Yearly · 2 months free"},{value:"monthly",label:"Monthly"}]})]}),(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg border border-line",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-line text-left",children:[(0,t.jsx)("th",{className:"px-3 py-2 font-normal text-mute",scope:"col",children:(0,t.jsx)("span",{className:"sr-only",children:"Feature"})}),["free","pro","team"].map(e=>(0,t.jsxs)("th",{scope:"col",className:`px-3 py-2 ${e===b?"text-accent":"text-ink"}`,children:[(0,t.jsx)("span",{className:"block font-medium",children:"free"===e?"Free":"pro"===e?"Pro":"Team"}),(0,t.jsx)("span",{className:"block text-xs font-normal text-mute",children:"free"===e?"$0":"yearly"===l?`$${el.PRICES[e].yearly} a year${"team"===e?" per user":""}`:`$${el.PRICES[e].monthly} a month${"team"===e?" per user":""}`})]},e))]})}),(0,t.jsxs)("tbody",{children:[(0,t.jsxs)("tr",{className:"border-b border-line/60",children:[(0,t.jsx)("th",{scope:"row",className:"px-3 py-2 text-left font-normal text-mute",children:"Requests, checks, collections, performance tests, command line, AI agents, mock server"}),["free","pro","team"].map(e=>(0,t.jsx)("td",{className:"px-3 py-2",children:"Everything"},e))]}),ej.map(e=>(0,t.jsxs)("tr",{className:"border-b border-line/60 last:border-0",children:[(0,t.jsx)("th",{scope:"row",className:"px-3 py-2 text-left font-normal text-mute",children:el.FEATURE_LABEL[e]}),["free","pro","team"].map(s=>{var n;return(0,t.jsx)("td",{className:"px-3 py-2 text-ink",children:(n=el.LIMITS[s][e],n===1/0?"Unlimited":"exports.unbranded"===e||"workspaces.shared"===e?n?(0,t.jsx)(ed.Check,{size:14,className:"inline text-ok","aria-label":"Yes"}):(0,t.jsx)("span",{"aria-label":"No",children:"—"}):n.toLocaleString())},s)})]},e))]})]})}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Yearly plans get cheaper the longer you stay: Pro is $",(0,el.yearlyPrice)("pro",0)," the first year, $",(0,el.yearlyPrice)("pro",1)," the second, and $",(0,el.yearlyPrice)("pro",2)," from the third. Stop for more than 30 days and it starts again. Team needs at least ",el.PRICES.team.minSeats," users. When a plan ends, the app goes back to Free and nothing you made is deleted."," ",(0,t.jsx)("a",{className:"text-accent underline-offset-2 hover:underline",href:ev,target:"_blank",rel:"noreferrer",children:"Tell me when Pro launches"})]})]}):null,r?(0,t.jsxs)("section",{"aria-label":"Plan preview",className:"space-y-2 rounded-lg border border-dashed border-line px-4 py-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-ink",children:"Plan preview"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"See the app in each state of a subscription, with the limits on (adding a second SuccessFactors, Salesforce or NetSuite connection, a third scheduled check, exporting more than 1,000 rows). Only on this computer."}),(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-mute",children:"Show the app as"}),(0,t.jsxs)("select",{className:"input w-auto py-1",value:a??"",onChange:e=>(0,ey.setPreview)(e.target.value||null),children:[(0,t.jsx)("option",{value:"",children:"My real plan (no preview)"}),ey.PREVIEWS.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))]})]})]}):null]})}let eC="atc:settings";function eA(e){window.dispatchEvent(new CustomEvent(eC,{detail:e}))}let eT=[{id:"appearance",label:"Appearance",icon:N.Palette},{id:"requests",label:"Requests",icon:S.Send},{id:"network",label:"Network and proxy",icon:g.Globe},{id:"load",label:"Performance tests",icon:b.Gauge},{id:"background",label:"Running in the background",icon:p.AppWindow},{id:"ai",label:"AI assistants (MCP)",icon:m.Bot},{id:"cli",label:"Command line",icon:E.SquareTerminal},{id:"security",label:"Certificates and cookies",icon:C.ShieldCheck},{id:"privacy",label:"Privacy",icon:w.Info},{id:"files",label:"Data and storage",icon:f.FolderOpen},{id:"shortcuts",label:"Keyboard shortcuts",icon:v.Keyboard},{id:"plan",label:"Plan",icon:y.Gem},{id:"about",label:"Updates and about",icon:w.Info}],eE=`{
|
|
2
|
-
"mcpServers": {
|
|
3
|
-
"apitestcenter": { "command": "npx", "args": ["-y", "apitestcenter", "mcp"] }
|
|
4
|
-
}
|
|
5
|
-
}`,eP=`{
|
|
6
|
-
"servers": {
|
|
7
|
-
"apitestcenter": { "type": "stdio", "command": "npx", "args": ["-y", "apitestcenter", "mcp"] }
|
|
8
|
-
}
|
|
9
|
-
}`;function eI(){let e=(0,R.useToast)(),s=(0,_.useConfirm)(),[n,a]=(0,o.useState)(null),r=()=>void fetch("/engine/responses",{cache:"no-store"}).then(e=>e.json()).then(a).catch(()=>a(null));(0,o.useEffect)(r,[]);let i=n?Object.keys(n.requests).length:0;return(0,t.jsx)(M.Row,{title:"Kept answers",hint:`Each saved request keeps its last 20 answers, in full, to look back on and compare.${n?` ${(0,en.formatBytes)(n.total)} for ${i} ${1===i?"request":"requests"}.`:""}`,children:(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:!n?.total,onClick:async()=>{await s({title:"Forget every kept answer?",body:"The saved requests stay; only their earlier answers go. Send again to keep new ones.",confirmLabel:"Forget them",tone:"danger"})&&(await fetch("/engine/responses",{method:"DELETE"}),e("Kept answers cleared","success"),r())},children:[(0,t.jsx)(P.Trash2,{size:14,"aria-hidden":!0})," Clear all"]})})}e.s(["SettingsDialog",0,function(){let e=(0,R.useToast)(),s=(0,er.useModKey)(),{theme:n,setTheme:a}=(0,I.useTheme)(),i=(0,ei.useViewPrefs)(),{dataDir:l,appVersion:d}=(0,es.useEngineHealth)(),[u,p]=(0,o.useState)(!1),[m,b]=(0,o.useState)("appearance"),y=(0,o.useRef)(null),g=(0,ey.useVersionTaps)((0,o.useCallback)(()=>e("Plan preview unlocked: Settings → Plan","success"),[e]));if((0,o.useEffect)(()=>{let e=e=>{let t=e.detail;t&&eT.some(e=>e.id===t)&&b(t),p(!0)},t=e=>{(e.ctrlKey||e.metaKey)&&!e.altKey&&","===e.key&&(e.preventDefault(),p(e=>!e))};return window.addEventListener(eC,e),window.addEventListener("keydown",t),()=>{window.removeEventListener(eC,e),window.removeEventListener("keydown",t)}},[]),(0,o.useEffect)(()=>{if(!u)return;let e=document.activeElement;y.current?.focus();let t=e=>"Escape"===e.key&&!document.querySelector("[role=alertdialog]")&&p(!1);return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t),e?.focus?.()}},[u]),!u)return null;let N=e=>()=>{p(!1),window.setTimeout(e,0)},S=n??"system",E=[{id:"dark",label:"Graphite",icon:j.Moon,swatch:["#0d0f12","#16191f","#c8f560"]},{id:"light",label:"Paper",icon:T.Sun,swatch:["#f4f5f2","#ffffff","#3f6212"]},{id:"system",label:"Follow the system",icon:k.Monitor,swatch:["#0d0f12","#f4f5f2","#c8f560"]}];return(0,t.jsx)("div",{className:"fixed inset-0 z-[66] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-10",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&p(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"settings-title",className:"flex max-h-[85vh] w-full sm:h-[min(620px,85vh)] max-w-4xl flex-wrap overflow-hidden rounded-xl border border-line bg-panel shadow-2xl sm:flex-nowrap",children:[(0,t.jsxs)("nav",{"aria-label":"Settings sections",className:"flex w-full shrink-0 flex-col gap-0.5 border-line bg-canvas/60 p-3 sm:w-60 sm:border-r",children:[(0,t.jsx)("h2",{id:"settings-title",className:"px-2 pt-1 pb-3 text-base font-semibold text-ink",children:"Settings"}),eT.filter(e=>"background"!==e.id||(0,et.desktop)()?.background).map(e=>{let s=e.icon;return(0,t.jsxs)("button",{type:"button",onClick:()=>b(e.id),"aria-current":m===e.id?"page":void 0,className:`flex items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-sm ${m===e.id?"bg-accent-dim text-ink":"text-mute hover:bg-panel-2 hover:text-ink"}`,children:[(0,t.jsx)(s,{size:15,"aria-hidden":!0,className:m===e.id?"text-accent":void 0}),e.label]},e.id)})]}),(0,t.jsxs)("section",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-5",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center",children:[(0,t.jsx)("h3",{className:"flex-1 text-lg font-semibold text-ink",children:eT.find(e=>e.id===m).label}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(c.GuideLink,{topic:"working-in-the-app#settings"}),(0,t.jsx)("button",{ref:y,type:"button",onClick:()=>p(!1),"aria-label":"Close settings",className:"rounded p-1.5 text-mute hover:text-ink",children:(0,t.jsx)(r.X,{size:16})})]})]}),"appearance"===m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"border-b border-line py-4",children:[(0,t.jsx)("div",{className:"mb-3 text-sm font-medium text-ink",children:"Theme"}),(0,t.jsx)("div",{role:"radiogroup","aria-label":"Theme",className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:E.map(e=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":S===e.id,onClick:()=>a(e.id),className:`flex flex-col gap-2 rounded-lg border p-2.5 text-left text-sm ${S===e.id?"border-accent ring-1 ring-accent":"border-line hover:border-mute"}`,children:[(0,t.jsxs)("span",{className:"flex h-14 gap-1 rounded-md p-1.5",style:{background:e.swatch[0]},"aria-hidden":!0,children:[(0,t.jsx)("span",{className:"w-1/4 rounded",style:{background:e.swatch[1]}}),(0,t.jsx)("span",{className:"flex flex-1 items-end rounded p-1",style:{background:e.swatch[1]},children:(0,t.jsx)("span",{className:"h-2 w-8 rounded-full",style:{background:e.swatch[2]}})})]}),(0,t.jsx)("span",{className:"text-ink",children:e.label})]},e.id))})]}),(0,t.jsx)(M.Row,{title:"Zoom",hint:`${s}+ and ${s}− anywhere; ${s}+0 goes back to 100%.`,children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary px-2.5 py-1",onClick:i.zoomOut,"aria-label":"Zoom out",children:"−"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary tabular w-20 justify-center py-1 font-mono",onClick:i.resetZoom,"aria-label":"Reset zoom",children:[Math.round(100*i.zoom),"%"]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary px-2.5 py-1",onClick:i.zoomIn,"aria-label":"Zoom in",children:"+"})]})}),(0,t.jsx)(M.Row,{title:"Density",hint:"How tall rows of saved requests and the tabs are.",children:(0,t.jsx)(M.Segmented,{label:"Density",value:i.density,onChange:i.setDensity,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]})}),(0,t.jsx)(M.Row,{title:"Response",hint:"On Test API, where the answer shows.",children:(0,t.jsx)(M.Segmented,{label:"Response",value:i.layout,onChange:i.setLayout,options:[{value:"beside",label:"Beside the request"},{value:"below",label:"Below it"}]})})]}):null,"requests"===m?(0,t.jsx)(O.RequestSettings,{}):null,"network"===m?(0,t.jsx)(O.NetworkSettings,{}):null,"load"===m?(0,t.jsx)(O.LoadSettings,{}):null,"background"===m?(0,t.jsx)(O.BackgroundSection,{}):null,"cli"===m?(0,t.jsx)(O.CliSettings,{}):null,"ai"===m?(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsx)("p",{className:"text-sm text-mute",children:"Let your AI assistant send requests, run collections and performance tests through APITestCenter — on this computer. Add it once; the assistant starts it when it needs it."}),(0,t.jsx)(M.CopyBlock,{label:"Claude Code — run in a terminal",text:"claude mcp add apitestcenter -- npx -y apitestcenter mcp"}),(0,t.jsx)(M.CopyBlock,{label:"Cursor (.cursor/mcp.json) and Claude Desktop (Settings → Developer → Edit config)",text:eE}),(0,t.jsx)(M.CopyBlock,{label:"VS Code — .vscode/mcp.json",text:eP}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Performance tests from an assistant only reach this computer unless you allow a host: add ",(0,t.jsx)("code",{className:"font-mono text-ink",children:'"--allow-load", "api-uat.example.com"'})," after ",(0,t.jsx)("code",{className:"font-mono text-ink",children:'"mcp"'}),". On Windows, if the assistant can't find npx, use ",(0,t.jsx)("code",{className:"font-mono text-ink",children:'"command": "cmd", "args": ["/c", "npx", …]'}),"."]})]}):null,"security"===m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Row,{title:"Certificates",hint:"Client certificates for APIs that ask for one, and extra CAs to trust. Your computer's own trusted certificates are used already.",children:(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:N(D.openCertificates),children:[(0,t.jsx)(C.ShieldCheck,{size:14,"aria-hidden":!0})," Certificates…"]})}),(0,t.jsx)(M.Row,{title:"Cookies",hint:"Cookies kept between requests, like a browser — see them or delete them.",children:(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:N(F.openCookies),children:[(0,t.jsx)(x.Cookie,{size:14,"aria-hidden":!0})," Cookies…"]})})]}):null,"privacy"===m?(0,t.jsxs)("div",{className:"space-y-3 py-3",children:[(0,t.jsx)("p",{className:"text-sm text-mute",children:"Your requests, answers and reports never leave this computer. The only thing the app sends is this — anonymous counts, on unless you turn them off:"}),(0,t.jsx)(q.UsageSetting,{})]}):null,"files"===m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Row,{title:"Data folder",hint:"Saved requests, environments, history, versions and Trash — plain files.",children:(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:!l,onClick:()=>ea.historyApi.reveal().catch(t=>e(t instanceof Error?t.message:"Could not open the folder","error")),children:[(0,t.jsx)(f.FolderOpen,{size:14,"aria-hidden":!0})," Open folder"]})}),(0,t.jsx)("p",{className:"-mt-2 mb-2 truncate rounded-md bg-panel-2 px-2 py-1.5 font-mono text-xs text-ink",title:l,children:l??"…"}),(0,t.jsx)(eI,{}),(0,t.jsx)(M.Row,{title:"Trash",hint:"Deleted requests, kept for 30 days.",children:(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:N(G),children:[(0,t.jsx)(P.Trash2,{size:14,"aria-hidden":!0})," Open Trash"]})})]}):null,"shortcuts"===m?(0,t.jsx)(M.Row,{title:"Every shortcut on one page",hint:`Also on ${s}+/ anywhere.`,children:(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:N(L.openShortcuts),children:[(0,t.jsx)(v.Keyboard,{size:14,"aria-hidden":!0})," Show shortcuts"]})}):null,"plan"===m?(0,t.jsx)(eS,{}):null,"about"===m?(0,t.jsx)(M.Row,{title:(0,t.jsx)("span",{onClick:g,children:`APITestCenter ${d&&"dev"!==d?d:"(development build)"}`}),hint:"Check for updates, see what's new, and the licenses.",children:(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:N($.openWhatsNew),children:[(0,t.jsx)(A.Sparkles,{size:14,"aria-hidden":!0})," What's new"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:N(h.openAbout),children:[(0,t.jsx)(w.Info,{size:14,"aria-hidden":!0})," Updates and about…"]})]})}):null]})]})})},"openSettings",0,eA],839);let e$="atc:nav-start";function eL(){window.dispatchEvent(new Event(e$))}function eq(){let e=(0,i.usePathname)(),s=(0,i.useSearchParams)(),[n,a]=(0,o.useState)(0),[r,l]=(0,o.useState)(!1),c=(0,o.useRef)({});return(0,o.useEffect)(()=>{let e=[],t=!1,s=0,n=!1,r=0,i=0,o=()=>{e.forEach(e=>window.clearTimeout(e)),e=[]},d=(t,s)=>e.push(window.setTimeout(s,t)),u=()=>{t&&(t=!1,o(),d(Math.max(0,350-(performance.now()-s)),()=>{a(100),d(300,()=>l(!1)),d(550,()=>a(0))}))},h=()=>{if(!t||!n||i>0)return;let e=r-performance.now();e>0?d(e+10,h):u()},p=()=>{if(!t){for(let[e,r]of(t=!0,n=!1,i=0,s=performance.now(),o(),l(!0),a(10),[[80,30],[300,52],[700,68],[1400,80],[2600,88],[4500,93]]))d(e,()=>a(r));d(12e3,u)}};c.current.arrived=()=>{t&&(n=!0,r=performance.now()+400,h())};let m=window.fetch;window.fetch=function(e,s){return t&&(!n||performance.now()<r)?(i++,m.call(window,e,s).finally(()=>{i=Math.max(0,i-1),n&&(r=Math.max(r,performance.now()+60)),h()})):m.call(window,e,s)};let x=e=>{if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target?.closest?.("a");if(!t||"_blank"===t.target||t.hasAttribute("download"))return;let s=t.getAttribute("href");if(!s||s.startsWith("#")||/^(mailto:|tel:|https?:)/i.test(s))return;let n=new URL(s,window.location.href);if(n.origin!==window.location.origin)return;let a=e=>e.replace(/\/+$/,"")||"/";(a(n.pathname)!==a(window.location.pathname)||n.search!==window.location.search)&&p()};return document.addEventListener("click",x,!0),window.addEventListener(e$,p),()=>{document.removeEventListener("click",x,!0),window.removeEventListener(e$,p),window.fetch=m,o()}},[]),(0,o.useEffect)(()=>{c.current.arrived?.()},[e,s]),(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-x-0 z-[100] h-[3px]",style:{top:"calc(48px / var(--zoom, 1) - 3px)"},children:(0,t.jsx)("div",{className:"h-full rounded-r-full bg-accent shadow-[0_0_10px_var(--accent),0_0_4px_var(--accent)] motion-safe:transition-[width,opacity] motion-safe:duration-300 motion-safe:ease-out",style:{width:`${n}%`,opacity:+!!r}})})}e.s(["NavProgress",0,function(){return(0,t.jsx)(o.Suspense,{fallback:null,children:(0,t.jsx)(eq,{})})},"startNavProgress",0,eL],15868);let eR="atc:help";e.s(["HelpPanel",0,function(){let[e,p]=(0,o.useState)(!1),[m,x]=(0,o.useState)(""),f=(0,o.useRef)(null),b=(0,o.useRef)(null),y=(0,i.usePathname)(),g=(0,i.useRouter)();function w(){p(!1),b.current?.focus()}(0,o.useEffect)(()=>{let e=()=>{b.current=document.activeElement,p(!0)};return window.addEventListener(eR,e),()=>window.removeEventListener(eR,e)},[]),(0,o.useEffect)(()=>{if(!e)return;window.setTimeout(()=>f.current?.focus(),0);let t=e=>"Escape"===e.key&&w();return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let v=(0,o.useMemo)(()=>{let e=m.trim().toLowerCase(),t=l.GLOSSARY.filter(t=>!e||`${t.term} ${t.tech??""} ${t.text}`.toLowerCase().includes(e)),s=new Map;for(let e of t)s.set(e.group,[...s.get(e.group)??[],e]);return[...s]},[m]);if(!e)return null;let k=(0,c.guideForPath)(y);return(0,t.jsxs)("div",{className:"fixed inset-0 z-[75] flex justify-end",children:[(0,t.jsx)("button",{type:"button","aria-label":"Close help",className:"absolute inset-0 bg-black/40",onClick:w}),(0,t.jsxs)("aside",{role:"dialog","aria-modal":"true","aria-labelledby":"help-title",className:"relative flex h-full w-full max-w-md flex-col border-l border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h2",{id:"help-title",className:"text-base font-medium text-ink",children:"Help"}),(0,t.jsx)("button",{type:"button",onClick:w,"aria-label":"Close",className:"ml-auto rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(r.X,{size:16})})]}),(0,t.jsxs)("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{p(!1),"/"!==y&&(eL(),g.push("/")),window.setTimeout(d.startTour,"/"===y?50:900)},className:"flex w-full items-center gap-3 rounded-lg border border-line px-3 py-2.5 text-left hover:border-accent",children:[(0,t.jsx)(n.Compass,{size:18,className:"text-accent","aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"block text-sm text-ink",children:"Take the 1-minute tour"}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:"Where to type, how to test once, then under load"})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{(0,u.setWelcomeHidden)(!1),p(!1),"/"!==y&&(eL(),g.push("/"))},className:"text-xs text-accent hover:underline",children:"Show the getting-started guide on Test API again"}),(0,t.jsx)("button",{type:"button",onClick:()=>{p(!1),(0,h.openAbout)()},className:"text-left text-xs text-accent hover:underline",children:"About APITestCenter — version, updates, your files"}),(0,t.jsx)("button",{type:"button",onClick:()=>{p(!1),eA("privacy")},className:"block text-left text-xs text-accent hover:underline",children:"Privacy — anonymous usage counts, on or off, in Settings"}),(0,t.jsxs)("a",{href:(0,c.guideUrl)(k.topic),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 rounded-lg border border-line px-3 py-2 text-sm text-ink hover:border-accent",children:[(0,t.jsx)(s.BookOpen,{size:16,className:"text-accent","aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"block",children:["Guide for this page: ",k.label]}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:"How it works, step by step — and every dialog has a Guide link at its top"})]})]}),(0,t.jsx)("a",{href:"https://apitestcenter.com/docs/",target:"_blank",rel:"noreferrer",className:"block text-xs text-accent hover:underline",children:"User guide — every feature explained, at apitestcenter.com/docs"}),(0,t.jsx)("a",{href:"https://apitestcenter.com/learn/",target:"_blank",rel:"noreferrer",className:"block text-xs text-accent hover:underline",children:"Learn — free lessons on APIs, testing and load testing, from zero"}),(0,t.jsxs)("label",{className:"relative block",children:[(0,t.jsx)("span",{className:"sr-only",children:"Search words"}),(0,t.jsx)(a.Search,{size:14,className:"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-mute","aria-hidden":!0}),(0,t.jsx)("input",{ref:f,value:m,onChange:e=>x(e.target.value),placeholder:"What does … mean?",className:"input py-1.5 pl-8"})]})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:[0===v.length?(0,t.jsxs)("p",{className:"text-sm text-mute",children:["No word matches “",m,"”."]}):null,v.map(([e,s])=>(0,t.jsxs)("section",{className:"mb-6",children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium tracking-wide text-mute uppercase",children:e}),(0,t.jsx)("dl",{className:"space-y-3",children:s.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"text-sm font-medium text-ink",children:[e.term,e.tech?(0,t.jsx)("span",{className:"ml-2 text-xs font-normal text-mute",children:e.tech}):null]}),(0,t.jsx)("dd",{className:"mt-0.5 text-sm text-mute",children:e.text})]},e.term))})]},e))]})]})]})},"openHelp",0,function(){window.dispatchEvent(new Event(eR))}],7641)},72350,2603,51554,45449,95688,99074,11563,e=>{"use strict";var t=e.i(14368),s=e.i(29800),n=e.i(87283),a=e.i(99181);function r(){let[e,t]=(0,a.useState)("Ctrl");return(0,a.useEffect)(()=>t("u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl"),[]),e}e.s(["useModKey",0,r,"useShortcuts",0,function(e){let t=(0,a.useRef)(e);t.current=e,(0,a.useEffect)(()=>{let e=e=>{if(document.querySelector("[aria-modal='true']")||e.defaultPrevented)return;let s=e.ctrlKey||e.metaKey;if(s&&!e.shiftKey&&"s"===e.key.toLowerCase()&&t.current.save){e.preventDefault(),t.current.save();return}if(s&&!e.shiftKey&&!e.altKey&&"b"===e.key.toLowerCase()&&t.current.toggleSaved){e.preventDefault(),t.current.toggleSaved();return}if(s&&"Enter"===e.key){e.preventDefault(),e.shiftKey?t.current.run?.():t.current.send?.();return}if("/"===e.key&&!s&&!e.altKey){let s=e.target;!(s&&(s.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)))&&t.current.focusUrl&&(e.preventDefault(),t.current.focusUrl())}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[])}],2603);let i="atc:shortcuts";e.s(["ShortcutsDialog",0,function(){let e=r(),[o,l]=(0,a.useState)(!1),c=(0,a.useRef)(null);return((0,a.useEffect)(()=>{let e=()=>l(!0),t=e=>{(e.ctrlKey||e.metaKey)&&!e.altKey&&"/"===e.key&&(e.preventDefault(),l(e=>!e))};return window.addEventListener(i,e),window.addEventListener("keydown",t),()=>{window.removeEventListener(i,e),window.removeEventListener("keydown",t)}},[]),(0,a.useEffect)(()=>{if(!o)return;let e=document.activeElement;c.current?.focus();let t=e=>"Escape"===e.key&&l(!1);return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t),e?.focus?.()}},[o]),o)?(0,t.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-12",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&l(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"shortcuts-title",className:"w-full max-w-2xl rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)(s.Keyboard,{size:16,className:"text-accent","aria-hidden":!0}),(0,t.jsx)("h2",{id:"shortcuts-title",className:"text-base font-medium text-ink",children:"Keyboard shortcuts"}),(0,t.jsx)("button",{ref:c,type:"button",onClick:()=>l(!1),"aria-label":"Close",className:"ml-auto rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(n.X,{size:16})})]}),(0,t.jsx)("div",{className:"grid gap-6 px-5 py-5 sm:grid-cols-2",children:[{title:"Anywhere",rows:[[[e,"K"],"Search, run or jump to anything"],[[e,"/"],"These shortcuts"],[[e,","],"Settings"],[[e,"+"],"Zoom in"],[[e,"−"],"Zoom out"],[[e,"0"],"Zoom back to 100%"],[["Esc"],"Close a dialog or menu"]]},{title:"Test API",rows:[[[e,"Enter"],"Send the request"],[[e,"Shift","Enter"],"Run a performance test"],[[e,"S"],"Save the request"],[["/"],"Jump to the address"],[[e,"B"],"Show or hide the saved requests"],[["Middle click"],"Close a request tab"]]},{title:"Report builder",rows:[[["Arrow keys"],"Move the selected widget"],[["Shift","Arrow keys"],"Resize it"],[["Enter"],"Open its settings"],[[e,"D"],"Duplicate it"],[["Delete"],"Remove it"]]}].map(e=>(0,t.jsxs)("section",{"aria-labelledby":`sc-${e.title}`,children:[(0,t.jsx)("h3",{id:`sc-${e.title}`,className:"mb-2 text-xs font-medium tracking-wide text-mute uppercase",children:e.title}),(0,t.jsx)("dl",{className:"space-y-1.5 text-sm",children:e.rows.map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)("dt",{className:"text-ink",children:s}),(0,t.jsx)("dd",{className:"flex shrink-0 items-center gap-1",children:e.map((e,s)=>(0,t.jsx)("span",{className:"kbd",children:e},s))})]},s))})]},e.title))})]})}):null},"openShortcuts",0,function(){window.dispatchEvent(new Event(i))}],72350);var o=e.i(99522);let l=(0,o.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var c=e.i(36994);let d=()=>fetch("/engine/settings/usage",{cache:"no-store"}).then(e=>e.ok?e.json():null),u=e=>fetch("/engine/settings/usage",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:e})}).then(e=>e.json());e.s(["UsageConsent",0,function(){let[e,s]=(0,a.useState)(null),[r,i]=(0,a.useState)(!1),[o,h]=(0,a.useState)(!1),p=(0,c.usePathname)();async function m(t){i(!1),s(await (t?u(!1):fetch("/engine/settings/usage/noticed",{method:"POST"}).then(e=>e.json())).catch(()=>e))}return((0,a.useEffect)(()=>{let e=!1;return d().then(t=>{!e&&t&&(s(t),i(t.available&&!t.managed&&null===t.choice&&!t.noticed&&t.used))}).catch(()=>void 0),()=>{e=!0}},[p]),r&&e)?(0,t.jsxs)("aside",{role:"dialog","aria-labelledby":"usage-title",className:"fixed right-4 bottom-4 z-[60] w-[min(380px,calc(100vw-2rem))] rounded-xl border border-line bg-panel p-4 shadow-2xl",children:[(0,t.jsx)("button",{type:"button",onClick:()=>void m(!1),className:"absolute top-3 right-3 rounded p-1 text-mute hover:text-ink","aria-label":"OK",children:(0,t.jsx)(n.X,{size:14})}),(0,t.jsxs)("h2",{id:"usage-title",className:"flex items-center gap-2 pr-6 text-sm font-medium text-ink",children:[(0,t.jsx)(l,{size:16,className:"text-accent","aria-hidden":!0})," Anonymous usage counts are on"]}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-mute",children:["Once a day the app sends ",(0,t.jsx)("span",{className:"text-ink",children:"counts"})," — how many requests and performance tests you ran — with the app version and your operating system. ",(0,t.jsx)("span",{className:"text-ink",children:"Never"})," URLs, results, or anything you type. It helps us see what to improve."]}),o?(0,t.jsx)("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-panel-2 p-2 font-mono text-[11px] text-mute",children:JSON.stringify(e.next,null,2)}):(0,t.jsx)("button",{type:"button",onClick:()=>h(!0),className:"mt-1 text-xs text-accent hover:underline",children:"See exactly what's sent"}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>void m(!1),className:"btn btn-primary py-1.5 text-xs",children:"OK"}),(0,t.jsx)("button",{type:"button",onClick:()=>void m(!0),className:"rounded-md px-3 py-1.5 text-xs text-mute hover:text-ink",children:"Turn off"})]}),(0,t.jsx)("p",{className:"mt-2 text-[11px] text-mute",children:"Change it any time in Settings → Privacy."})]}):null},"UsageSetting",0,function(){let[e,s]=(0,a.useState)(null),[n,r]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{d().then(s).catch(()=>void 0)},[]),e)?(0,t.jsxs)("section",{className:"space-y-2 rounded-lg border border-line px-3 py-2.5",children:[(0,t.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-ink",children:[(0,t.jsxs)("span",{children:["Share anonymous usage counts",(0,t.jsx)("span",{className:"block text-xs text-mute",children:e.available?e.managed?"Turned off by your organisation (ATC_NO_USAGE).":"On unless you turn it off. Once a day: counts, app version, OS. Never URLs or results.":"Only the desktop app can send these; this window never does."})]}),(0,t.jsx)("input",{type:"checkbox",disabled:!e.available||e.managed,checked:e.available&&e.enabled,onChange:e=>void u(e.target.checked).then(s),className:"h-4 w-4 accent-[var(--accent)]"})]}),(0,t.jsxs)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>r(e=>!e),children:[n?"Hide":"Show"," exactly what would be sent"]}),n?(0,t.jsx)("pre",{className:"max-h-40 overflow-auto rounded-md bg-panel-2 p-2 font-mono text-[11px] text-mute",children:JSON.stringify(e.next,null,2)}):null]}):null}],51554);var h=e.i(1675),p=e.i(89932),m=e.i(56396);e.s(["CopyBlock",0,function({label:e,text:s}){let n=(0,m.useToast)(),[r,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-line",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between bg-panel-2 px-3 py-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-ink",children:e}),(0,t.jsxs)("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(s).then(()=>{i(!0),window.setTimeout(()=>i(!1),1500)},()=>n("Could not copy — select the text instead","error")),className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-mute hover:text-ink",children:[r?(0,t.jsx)(h.Check,{size:12,className:"text-ok","aria-hidden":!0}):(0,t.jsx)(p.Copy,{size:12,"aria-hidden":!0}),r?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{className:"overflow-x-auto px-3 py-2 font-mono text-xs text-ink",children:s})]})},"Row",0,function({title:e,hint:s,children:n}){return(0,t.jsxs)("div",{className:"flex items-center gap-6 border-b border-line py-4 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-ink",children:e}),s?(0,t.jsx)("div",{className:"mt-0.5 text-xs leading-relaxed text-mute",children:s}):null]}),(0,t.jsx)("div",{className:"shrink-0",children:n})]})},"Segmented",0,function({label:e,value:s,options:n,onChange:a}){return(0,t.jsx)("div",{role:"radiogroup","aria-label":e,className:"inline-flex rounded-lg border border-line bg-canvas p-0.5",children:n.map(e=>(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":s===e.value,onClick:()=>a(e.value),className:`rounded-md px-3 py-1.5 text-sm ${s===e.value?"bg-panel-2 text-ink shadow-sm":"text-mute hover:text-ink"}`,children:e.label},e.value))})},"Switch",0,function({label:e,checked:s,onChange:n}){return(0,t.jsx)("button",{type:"button",role:"switch","aria-label":e,"aria-checked":s,onClick:()=>n(!s),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border transition-colors ${s?"border-accent bg-accent":"border-line bg-panel-2"}`,children:(0,t.jsx)("span",{className:`inline-block h-3.5 w-3.5 rounded-full shadow transition-transform ${s?"translate-x-[18px] bg-canvas":"translate-x-[2px] bg-mute"}`})})}],45449);let x=(0,o.default)("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"}]]);e.s(["default",0,x],95688),e.s(["CircleAlert",0,x],99074);let f=(0,o.default)("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"}]]);e.s(["Wifi",0,f],11563)},5831,e=>{"use strict";var t=e.i(14368),s=e.i(99181),n=e.i(68820),a=e.i(14865);let r="atc:tour",i=[{target:"#request-url",title:"1. Where the request goes",body:"Type or paste a URL here — or a whole curl command copied from your browser. {{name}} takes a value from the chosen environment."},{target:"section[aria-label=Request] [role=tablist]",title:"2. What to send",body:"Add parameters, headers, sign-in (Auth), and a body. Checks are your rules for a correct answer; Run first and Test data feed in values."},{target:"[data-tour=send]",title:"3. Try it once",body:"Send one request and see the answer on the right. Always do this first, so you know it works before testing it under load."},{target:"[data-tour=run]",title:"4. Test it under load",body:"Run performance test sends many requests at once with simulated users. Choose how many in the Performance tab, and pass/fail limits in Goals."},{target:"section[aria-label=Results]",title:"5. Read the result",body:"Answers and load reports appear here. Every report is saved on this computer, and you can rearrange its charts with Customize."},{target:"a[href='/history']",title:"6. Look back",body:"History keeps every run. Mark one as your reference run to see whether later runs got faster or slower."},{target:"[data-tour=help]",title:"Any word unclear?",body:"Help explains every term in plain language, and can start this tour again."}];e.s(["Tour",0,function(){let[e,o]=(0,s.useState)(null),[l,c]=(0,s.useState)(null),d=(0,s.useRef)(null),u=(0,s.useRef)(null),h=(0,s.useCallback)(e=>{let t=document.querySelector(i[e].target);return t&&t.getBoundingClientRect().width>0?t:null},[]),p=(0,s.useCallback)((e,t)=>{for(let s=e;s>=0&&s<i.length;s+=t)if(h(s))return o(s);o(null)},[h]);if((0,s.useEffect)(()=>{let e=()=>p(0,1);return window.addEventListener(r,e),()=>window.removeEventListener(r,e)},[p]),(0,s.useLayoutEffect)(()=>{if(null===e)return;let t=()=>{let t=h(e);if(!t)return;t.scrollIntoView({block:"nearest",inline:"nearest"});let s=(0,a.pageRect)(t);c({top:s.top-6,left:s.left-6,width:s.width+12,height:Math.min(s.height+12,(0,a.pageViewport)().height-24)})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,h]),(0,s.useEffect)(()=>{if(null===e)return;u.current?.focus();let t=t=>{"Escape"===t.key&&o(null),"ArrowRight"===t.key&&p(e+1,1),"ArrowLeft"===t.key&&e>0&&p(e-1,-1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,p]),null===e||!l||"u"<typeof document)return null;let m=i[e],x=!i.slice(e+1).some((t,s)=>h(e+1+s)),f=l.top+l.height+180<(0,a.pageViewport)().height?l.top+l.height+10:Math.max(12,l.top-10-(d.current?.offsetHeight??170)),b=Math.min(Math.max(12,l.left),(0,a.pageViewport)().width-320-12);return(0,n.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed z-[80] rounded-lg ring-2 ring-accent transition-all duration-200",style:{...l,boxShadow:"0 0 0 9999px rgb(0 0 0 / 0.55)"}}),(0,t.jsxs)("div",{ref:d,role:"dialog","aria-modal":"false","aria-labelledby":"tour-title",className:"fixed z-[81] rounded-lg border border-line bg-panel p-4 shadow-2xl",style:{top:f,left:b,width:320},children:[(0,t.jsx)("h2",{id:"tour-title",className:"text-sm font-medium text-ink",children:m.title}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-mute",children:m.body}),(0,t.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-mute",children:[e+1," of ",i.length]}),(0,t.jsx)("button",{type:"button",onClick:()=>o(null),className:"ml-auto rounded-md px-2 py-1 text-xs text-mute hover:text-ink",children:"Skip tour"}),e>0?(0,t.jsx)("button",{type:"button",onClick:()=>p(e-1,-1),className:"rounded-md border border-line px-2.5 py-1 text-xs text-ink hover:border-accent",children:"Back"}):null,(0,t.jsx)("button",{ref:u,type:"button",onClick:()=>x?o(null):p(e+1,1),className:"btn btn-primary px-3 py-1 text-xs",children:x?"Done":"Next"})]})]})]}),document.body)},"startTour",0,function(){window.dispatchEvent(new Event(r))}])},73151,11718,45377,39736,e=>{"use strict";var t=e.i(14368);let s=(0,e.i(99522).default)("circle-arrow-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]);e.s(["ArrowDownCircle",0,s],11718);var n=e.i(17118),a=e.i(75117),r=e.i(27813),i=e.i(49913),o=e.i(42709),l=e.i(87283),c=e.i(99181);e.i(24856);var d=e.i(64478);function u({parts:e}){return e.map((e,s)=>"text"===e.kind?(0,t.jsx)("span",{children:e.text},s):"code"===e.kind?(0,t.jsx)("code",{className:"rounded bg-panel-2 px-1 py-px font-mono text-[0.85em] text-ink",children:e.text},s):"strong"===e.kind?(0,t.jsx)("strong",{className:"font-medium text-ink",children:(0,t.jsx)(u,{parts:e.parts})},s):"em"===e.kind?(0,t.jsx)("em",{children:(0,t.jsx)(u,{parts:e.parts})},s):(0,t.jsx)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"text-accent hover:underline",children:(0,t.jsx)(u,{parts:e.parts})},s))}function h({markdown:e}){let s=(0,c.useMemo)(()=>(0,d.noteBlocks)(e),[e]);return(0,t.jsx)("div",{className:"space-y-2.5 text-sm leading-relaxed text-mute",children:s.map((e,s)=>"heading"===e.kind?(0,t.jsx)("h4",{className:"pt-2 text-xs font-medium tracking-wide text-ink uppercase first:pt-0",children:(0,t.jsx)(u,{parts:e.parts})},s):"paragraph"===e.kind?(0,t.jsx)("p",{children:(0,t.jsx)(u,{parts:e.parts})},s):(0,t.jsx)("ul",{className:`space-y-1.5 pl-5 ${e.ordered?"list-decimal":"list-disc"} marker:text-line`,children:e.items.map((e,s)=>(0,t.jsx)("li",{children:(0,t.jsx)(u,{parts:e})},s))},s))})}var p=e.i(44505),m=e.i(20054);function x(){let[e,t]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=(0,p.desktop)();if(!e)return;let s=!0;e.updateStatus().then(e=>s&&e&&t(e));let n=e.onUpdateStatus(t);return()=>{s=!1,n()}},[]),e}e.s(["useUpdateStatus",0,x],45377);let f="atc:update";e.s(["UpdateDialog",0,function(){let e=x(),{appVersion:d}=(0,m.useEngineHealth)(),[u,b]=(0,c.useState)(!1),[y,g]=(0,c.useState)(null),w=(0,c.useRef)(null),v=(0,p.desktop)();if((0,c.useEffect)(()=>{let e=()=>b(!0);return window.addEventListener(f,e),()=>window.removeEventListener(f,e)},[]),(0,c.useEffect)(()=>{let t=e?"available"===e.state||"downloading"===e.state||"ready"===e.state?e:"error"===e.state?e.release??null:null:null;t&&g(t)},[e]),(0,c.useEffect)(()=>{if(!u)return;window.setTimeout(()=>w.current?.focus(),0);let e=e=>"Escape"===e.key&&b(!1);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[u,e?.state]),!u||!y||!e||!v)return null;let k=()=>b(!1),j=e.state,N="important"===y.level,S="downloading"===j?e.percent:0;return(0,t.jsx)("div",{className:"fixed inset-0 z-[78] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&k(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"update-title",className:"flex max-h-[min(720px,calc(100vh-2rem))] w-full max-w-xl flex-col rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-3 border-b border-line px-5 py-4",children:[(0,t.jsx)("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${N?"bg-warn/15 text-warn":"bg-accent-dim text-accent"}`,"aria-hidden":!0,children:"ready"===j?(0,t.jsx)(n.CheckCircle2,{size:18}):(0,t.jsx)(s,{size:18})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{id:"update-title",className:"text-base font-medium text-ink",children:"ready"===j?`Version ${y.version} is ready`:`Version ${y.version} is available`}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:[d&&"dev"!==d?`You have ${d}. `:"","Your tests and history stay as they are."]})]}),(0,t.jsx)("button",{type:"button",onClick:k,"aria-label":"Close",className:"ml-auto self-start rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(l.X,{size:16})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4",children:[N?(0,t.jsxs)("p",{className:"flex items-start gap-2 rounded-md border border-warn/40 bg-warn/10 px-3 py-2 text-sm text-ink",children:[(0,t.jsx)(o.TriangleAlert,{size:14,className:"mt-0.5 shrink-0 text-warn","aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Important update."})," ",y.why??"Install it soon."]})]}):null,"downloading"===j?(0,t.jsxs)("div",{className:"space-y-1.5",role:"status",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(r.Loader2,{size:14,className:"animate-spin text-accent","aria-hidden":!0}),S>=100?"Checking the download…":`Downloading… ${S}%`]}),(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-panel-2",children:(0,t.jsx)("div",{className:"h-full bg-accent transition-[width]",style:{width:`${S}%`}})})]}):null,"ready"===j?(0,t.jsx)("p",{className:"text-sm text-ink",role:"status",children:"Downloaded. Restart to finish updating — or choose Restart later, and it updates the next time the app quits."}):null,"error"===j?(0,t.jsxs)("p",{role:"alert",className:"flex items-start gap-2 text-sm text-ink",children:[(0,t.jsx)(o.TriangleAlert,{size:14,className:"mt-0.5 shrink-0 text-warn","aria-hidden":!0})," ",e.message]}):null,y.notes?(0,t.jsxs)("section",{"aria-label":`What's new in ${y.version}`,children:[(0,t.jsxs)("h3",{className:"mb-2 text-xs font-medium tracking-wide text-mute uppercase",children:["What's new in ",y.version]}),(0,t.jsx)(h,{markdown:y.notes})]}):(0,t.jsxs)("p",{className:"text-sm text-mute",children:["See what's new on"," ",(0,t.jsx)("a",{href:"https://apitestcenter.com/whats-new.html",target:"_blank",rel:"noreferrer",className:"text-accent hover:underline",children:"apitestcenter.com"}),"."]})]}),(0,t.jsx)("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-5 py-3",children:"available"===j||"error"===j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:k,children:"Not now"}),e.canInstall?(0,t.jsxs)("button",{ref:w,type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>void v.downloadUpdate(),disabled:"error"===j&&!e.release,children:[(0,t.jsx)(a.Download,{size:14,"aria-hidden":!0})," ","error"===j?"Try again":"Download and install"]}):(0,t.jsxs)("button",{ref:w,type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>void v.openDownloadPage(),children:[(0,t.jsx)(a.Download,{size:14,"aria-hidden":!0})," Open the download page"]})]}):"downloading"===j?(0,t.jsx)("button",{ref:w,type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:k,title:"It keeps downloading; the status bar says when it's ready",children:"Hide"}):"ready"===j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:k,children:"Restart later"}),(0,t.jsxs)("button",{ref:w,type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>void v.restartToUpdate(),children:[(0,t.jsx)(i.RotateCw,{size:14,"aria-hidden":!0})," Restart now"]})]}):null})]})})},"openUpdate",0,function(){window.dispatchEvent(new Event(f))}],73151);let b={"0.18.0":"## What's new in 0.18.0\n\n**Accounts: sign in with your email, and your plan comes to your computer. Optional — everything works without one.**\n\n### Sign in\n- **Settings → Plan → Sign in**: type your email, then the 6-digit code we email you. No password.\n- Bought Pro, or on your company's Team? The plan turns on by itself — no key to paste.\n- A plan works on up to 3 of your computers. On a 4th, the app lists the other 3 so you can sign one out.\n- Signed in, you see your computers and can sign any of them out. Signing out takes the plan off that computer; everything you made stays.\n- Your requests and results still stay on each computer. Signing in only brings your plan.\n\n### Your account on the website\n- **apitestcenter.com/account.html**: your plan, Manage subscription, your computers, and Delete my account.\n- **Team**: the admin adds people by their work email, up to the seats bought, and each one gets an email saying what to do. Someone not on the list can ask the admin from the same page.\n\n### Fixed\n- **The app no longer freezes for up to half a minute on a busy computer.** Looking for web servers on your computer (for the Base URL list) asked every listening program at once; with hundreds of them, everything else waited. It now asks a few at a time.\n\nPro and Team aren't on sale yet — Free still includes every feature during early access.\n","0.17.2":"## What's new in 0.17.2\n\n**A security update — please install it — and the app is ready for license keys.**\n\n### Security\n- **Websites can't reach the app any more.** The app's engine runs on your computer at 127.0.0.1. A website open in your browser could try to send it requests, or trick the browser into reading its answers (a trick called *DNS rebinding*). Now the engine answers only the app itself and pages on your computer; anything from another website is refused. The command line, AI agents (MCP) and load tests work as before.\n\n### Plans\n- **Settings → Plan → Enter a license key**: paste the key you get after buying Pro or Team. The app checks it on your computer, so a made-up or edited key is refused, and it keeps working offline.\n- With a license: your plan, when it renews, **Manage subscription** (card, invoices, cancel), **Check now** and **Remove**.\n- Pro and Team aren't on sale yet — Free still includes every feature during early access.\n","0.17.1":"## What's new in 0.17.1\n\n**AI agents can now set up requests themselves, and ask you before anything that changes data.**\n\n### AI agents (MCP)\n- **Describe a request in the call**: method, address, parameters, headers, body (JSON, text, form or GraphQL), sign-in and checks. Send it without saving it, change a saved one for one call, or save it.\n- **Sign-in set up by the agent**: Bearer, Basic, Digest, NTLM, API key, OAuth 2.0 client credentials or password — on a request, or once on a folder (`set_folder_auth`). Tokens go in secret environment variables (`save_environment`) and are never shown to the agent again.\n- **Performance tests shaped in full**: the type, then users or requests per second, duration, ramp up and down, custom stages, think time and targets.\n- **You say yes before anything changes data.** GET, HEAD and OPTIONS go straight away. A POST, PUT, PATCH or DELETE — alone, in a collection run, sent first by another request, or under load — waits for your answer in the agent's window (Claude Code 2.1.76 or later, VS Code). The question comes from the app, so the agent can't answer it for you. With an agent that can't ask, they aren't sent, unless you connect with `--allow-changes`.\n- New tools: `get_request`, `save_request`, `set_folder_auth`, `save_environment`. Changes to a request keep its earlier versions in **Version history**. An agent can't delete anything, and won't change a request whose secret only the app can read.\n\n### Plans\n- **Settings → Plan**: you're on Free during early access, with every feature included. Pro and Team are coming; *Tell me when Pro launches* gets you one email when they do.\n","0.17.0":"## What's new in 0.17.0\n\n**API docs from your collections, API descriptions set up in one place, the app in the tray, resting to free memory, and panes you can resize.** Plus updates that ask first, and the command line's version in Settings.\n\n### API docs\n- **A Docs tab on requests and folders**: write a description in Markdown, with a preview.\n- **Export → API docs (HTML)** makes one page to share or host: a searchable list, each request's description, parameters, headers, body, an example answer, its checks, and curl, JavaScript and Python code. Secrets are left out.\n- Descriptions go out with Postman, OpenAPI and Markdown exports, and come in from Postman, OpenAPI, Insomnia and Bruno.\n\n### API descriptions\n- **Set up in one place**: *Ctrl+K → API descriptions* shows four steps (added, a folder uses it, requests for its operations, send or run), and each is done from there. Pick a folder, or make a new one, and **Use it for this folder**.\n- **Add the missing requests** from the dialog or from the folder's own settings, which show what that folder covers. Requests already in the folder stay and count for their operation; ones that aren't in the description are listed by name.\n- **The new requests know where the API runs**: when the description gives only a path, the address it was fetched from fills in the rest, or you type it once.\n- **Paste its text** when an address can't be fetched, say behind a sign-in. Fetching from an address now trusts the same certificates as Send.\n- **Find an operation**: show all, those with no request, or those with one, and search.\n- A file that isn't an API description says which one and why, with a sample of the format.\n\n- **AI agents (MCP)** can see which operations have no request, and add them: `list_api_descriptions`, `api_description_coverage` and `add_missing_requests`.\n\n### Running in the background\n- **Closing the window keeps the app in the tray** while something is running (a request waiting for its answer, a collection run, a performance test, a scheduled check). The tray menu says what's running. **Hide to tray** from the command palette puts it there on purpose.\n- *Settings → Running in the background*: keep scheduled checks running (the default), always stay in the tray, or quit. **Start with Windows** opens into the tray; the installer's last page offers it too, off by default.\n- **Resting**: when the window has been put away for a while (10 minutes by default) with nothing running, the app rests to free memory and comes back as you left it. Scheduled checks keep running and still notify you.\n\n### Test API\n- **Resize the panes**: drag the line beside **Saved requests**, and the one between the request and the answer, side by side or one above the other. History, Connections and Compare have one beside their list too. Arrow keys move them; double-click to reset.\n- **Drop files** on the import, API description and other file dialogs.\n- **Guide links** in dialogs open the page about what you're doing.\n\n### Command line\n- **Settings → Command line** says whether `atc` is installed and which version runs. **Install** puts it on your PATH in one click, no administrator needed.\n- When an older `atc` from npm comes first, it says *New version available*: **Update**, or **Use the app's copy**, which updates with the app.\n\n### Learn\n- **A new lesson: OData, the API of business systems** (SAP, SuccessFactors, Dynamics): `$metadata`, `$filter`, paging, v2 against v4, and what to test, tried on the practice company.\n- **Contracts and schemas** now checks a whole API against its description, with the practice shop's.\n\n### Updates and settings\n- **Updates ask first**: a check shows what's new; nothing downloads until you say so, then you see its progress and choose to restart now or later.\n- **Anonymous usage counts** moved to *Settings → Privacy*. Help links there.\n","0.16.0":"## What's new in 0.16.0\n\n**Contract tests, scheduled checks, Salesforce and NetSuite connections, performance tests by type, and a proxy setting.** Plus answers shown whole, and a card like this one after every update.\n\n### Contract tests\n- **Check every answer against your API's OpenAPI file.** A folder names an **API description**, and each answer inside is checked: is the operation in it, is the status documented (error answers too), is the content type, does the body match the documented schema, are required headers there. On Send, in collection runs, on the command line and for AI agents.\n- **Importing an OpenAPI file** keeps it as the collection's description, so its requests are checked from the start.\n- **See which operations have no test yet**, and add a request for each in one click.\n- Add a description from a file, a web address, or the practice shop's own, at `{{practiceApi}}/openapi.json`. *Ctrl+K → API descriptions*.\n\n### Connections\n- **Salesforce**: sign in with OAuth 2.0 (authorization code or client credentials), browse every queryable object and its fields, and build SOQL with the same builder as OData. **Total count**, related fields like `Owner.Name`, and *Paste URL* take SOQL too.\n- **NetSuite**: account ID and token-based sign-in (or OAuth 2.0), record types from the metadata catalog, and SuiteQL from the builder, 1,000 rows a page.\n- **Names for IDs** in NetSuite: a lookup shows its name next to its ID (*Asha Rao · 500*), and a condition can compare a lookup by its name. Lookups NetSuite won't name show the ID only, and the query still runs.\n- **Related data**: pick a link's fields as columns, click a record to see all of it as a tree, and edit the filter as text.\n- **Export records** as **CSV** or **Excel**: the ones loaded, or all matching, read page by page (up to 50,000).\n- **Save as request** keeps a query as a saved request in the folder you pick, signed in by the connection.\n- Practice Salesforce org and NetSuite account in the practice API, so you can try both without a system of your own.\n\n### Scheduled checks\n- **Run a collection on a schedule** while the app is open, from every 5 minutes to every day, with the environment you pick. *Run collection → Scheduled checks*.\n- **A notification when it starts failing, and when it's fixed**, saying which request failed and why; or on every failure, every run, or never.\n- Each one shows its last runs as green and red bars, when it runs next, and the last failure in full. **Run now**, **Pause**, and it follows its folder when you move it.\n- **Download for CI**'s pipeline has an hourly schedule ready to turn on, for checks while your computer is off.\n\n### Performance tests\n- **Load tests are now performance tests, in six types**: **Smoke**, **Load**, **Stress**, **Spike**, **Soak** and **Breakpoint**. Pick one and the users, duration and stages are set for you.\n- **Each report answers its type's question**: how it did at the peak (Stress), whether it recovered (Spike), whether it slowed down over time (Soak), and the most it handled before a target broke (Breakpoint).\n- **Breakpoint** adds users steadily and stops by itself once your targets are missed, or p95 2 s and 5% errors if you haven't set any.\n- On the command line: `--preset load` and `--preset breakpoint`.\n\n### Requests\n- **Answers are shown whole**, up to 20 MB (was 64 KB). Very big ones wait behind a panel: show it, show it as plain text, or save it to a file.\n- **A Send shows its steps as they happen** (Run first, scripts, sign-in, waiting for the host, downloading) with **Cancel**.\n- **New requests wait 5 minutes** for an answer (was 60 seconds). When one runs out of time, the answer says how long it waited and offers *Wait up to 5m and send again*.\n- **Production is what you say it is**: tick *This is production* on an environment to get the red edge and the question before changes and performance tests. Nothing is guessed from names.\n\n### Settings\n- New sections: **Requests** (defaults for new requests), **Network and proxy**, **Performance tests** (the type new tests start with) and **Command line**.\n- **Proxy**: none, the computer's own (`HTTPS_PROXY`, the default), or one you enter with its sign-in and the hosts that go direct. Used by Send, sign-in, connections, WebSockets, performance tests and the command line. *Reach it* checks it works.\n\n### Updates\n- **What's new**: after an update the app shows what changed, like this. Open it again any time from **About**.\n- **Important updates say so**: they ask you to restart, and say why. Other updates download quietly, show *Update ready* in the status bar, and install when you close the app.\n\n### Look and feel\n- Window buttons match the light and dark themes, and every dialog opens in the middle of the window.\n- **Anonymous usage counts** are on, with a notice before anything is sent. *See exactly what's sent*, or turn them off in Settings.\n","0.15.0":"## What's new in 0.15.0\n\n**Connections: set a system up once, use it from every request.** Plus export, smarter params, and variables you don't have to remember.\n\n### Connections\n- **A connection is a system set up once** — its base URL, sign-in and headers — with a variable like `{{successFactors}}`. Any request whose address starts with it is sent there with that sign-in. Change the sign-in once and every request follows; nothing to copy into each request.\n- **Any sign-in** a request can use: Basic, Bearer, API key, OAuth 2.0 (including SAML bearer for SAP SuccessFactors), OAuth 1.0, NTLM, AWS Signature and more. `{{names}}` in it come from the environment, so one connection serves test and production.\n- **Connectors**: **SAP SuccessFactors**, any **OData** service (v2 and v4), any **REST API**, and a **Practice company** to try it without a system of your own.\n- **Browse OData systems**: their objects with their own names, every field with its label and type, and the records — with conditions, columns (all fields until you pick some), sort, rows at a time, total count, *Load more* and *Copy URL*. **Open as request** opens any query as a request, signed in through the connection.\n- Works on Send, in collection runs, load tests, the command line and for AI agents.\n\n### Export\n- **Export saved requests** — a folder, a few requests, or everything — as **APITestCenter**, **Postman v2.1**, **OpenAPI 3.1**, **.http** or **Markdown**. Secrets never go into the file.\n- **Double-click an `.apitestcenter` file** and the app opens with it, ready to import.\n\n### Requests\n- **Type `{{`** in the address, a param, a header, an auth field or the body: a list of every variable the request can use — connections, folder, environment, saved values, built-in — with their values.\n- **Params and headers turn off** without being deleted, carry a **description**, and can all be edited as text with **Bulk edit**.\n- **Right-click a tab**: Close, Close others, Close to the right, Close unchanged, Close all, Duplicate, Copy URL.\n- **Saved requests**: rename (F2), *Move to…*, drag and drop, several at once, and *New request here* in a folder.\n- The address that answered is readable and copies on a click. Long dropdowns have a search box.\n\n### Installer\n- **Running the installer again** now says what's on your computer and offers **Update**, **Repair** or **Uninstall**. In the app's colours, and a little quicker.\n","0.14.0":"## What's new in 0.14.0\n\n**A new look, projects, and many requests open at once.** The biggest update so far.\n\n### A new look\n- **New logo and colours**: lime on graphite, with a light *Paper* theme. On the Windows taskbar the icon is the hexagon itself.\n- **The app's own title bar**, in the theme's colours — no grey system bar.\n- **A status bar** along the bottom: the engine's state, Import, Cookies, Certificates, Mock server, zoom, density, theme, Help and the version.\n- **Zoom** (Ctrl + / Ctrl − / Ctrl 0) and **compact or comfortable** rows. Menus and dialogs open smoothly.\n- **The app now remembers** your theme, zoom, open tabs and environment between restarts (before, a restart forgot them).\n\n### Work faster\n- **Request tabs**: each request opens in its own tab, keeping its answer. Open tabs come back after a restart.\n- **Ctrl K** finds and runs anything; **Ctrl+/** lists every shortcut; **Ctrl+B** shows or hides the saved requests; **Ctrl+,** opens Settings.\n- **Save** sits beside Run load test, with *Save as a new request…* under its arrow.\n- **The response beside the request, or below it** — your choice.\n- **The environment picker** moved to the right of the tabs, with a warning only when a variable is missing.\n- **Saved requests**: a cleaner panel, a ⋯ menu on requests (Open, Duplicate, Version history, Move to Trash), and right-click on requests and folders.\n\n### Safer\n- **Environment colours**: an environment named like *Production* turns the top of the window red and **asks before a request that changes data, or a load test**. Staging-like names are amber.\n- **Version history**: every save keeps the version it replaces (the last 50). See what changed and restore any version.\n- **Trash**: deleted requests wait 30 days, with their secrets, and can be restored.\n\n### Projects\n- **Several projects**, each a folder of its own — requests, environments, history — that you can keep in Git. **Home** lists them, makes new ones, opens folders you already have, and switches between them in a second.\n\n### Also\n- **Settings** in one window: appearance, copy-ready setup for AI assistants (MCP), certificates and cookies, privacy, your files, shortcuts and updates.\n- **Import** from **Bruno** (a whole folder, with its environments), **.http / .rest** files and **Hurl**, several files at once.\n- **Homebrew** (macOS) and **winget** (Windows) packages.\n- Variables can use other variables (`baseUrl = https://{{host}}`), and imported requests keep their order in collection runs.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.13.1":"## What's new in 0.13.1\n\n- **The loading bar now covers the whole wait.** It used to finish as soon as the next page appeared, while the page was still loading its data. Now it keeps going until the page's data has arrived, stays long enough to see on fast pages, and is a little thicker.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.13.0":"## What's new in 0.13.0\n\n- **Upload files.** The Body tab has **Form with files** (text and file fields, the way web pages upload), **File** (one file as the whole body — drop it in) and **Form** (plain form fields). Files are kept in the app's data folder, so saved requests keep working. Load tests upload them too, with test data filled in for each request, and the code the app makes sends them in every language. Try it with the practice API: `POST {{practiceApi}}/upload` says exactly what arrived.\n- **Imports bring forms with files** — from Postman, Insomnia, browser recordings, OpenAPI and a pasted `curl -F` — instead of leaving the body out. Choose the files again; the import says which.\n- **Learn** — 20 free lessons on APIs, API testing and load testing, from zero, each with something to try in the app, and an A–Z glossary. At apitestcenter.com/learn.\n- **A loading bar** along the top while a page opens.\n- **A smaller installer** (about 8 MB less).\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.12.0":'## What\'s new in 0.12.0\n\n- **AI agents can use the app (MCP).** Connect Claude Code, Cursor, VS Code or Claude Desktop with one line, and ask them to send your requests, run collections and load tests, or read the reports. Secrets stay hidden, and load tests only go to hosts you allow.\n- **WebSockets and event streams.** Type a `ws://` address and press Connect — send and receive messages live. Event-stream (SSE) answers show their events as they arrive. Try both with the practice API.\n- **`pm.sendRequest` in scripts** — sign in or look something up from a script, as in Postman. In load tests these extra requests are left out of the numbers.\n- **Scripts on folders** — write a pre-request or tests script once, for every request inside. Postman collection and folder scripts import to their folders.\n- **Earlier answers** — a saved request keeps its last 20 answers; open one, or see exactly what changed since (field by field, line by line). Secrets are masked before anything is saved.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say "Windows protected your PC"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n',"0.11.0":"## What's new in 0.11.0\n\n- **Scripts.** A pre-request script and a tests script on every request, with Postman's `pm` — `pm.test`, `pm.expect`, `pm.environment.set`, `pm.response.json()`. Tests count like checks, also in collection runs, CI and every request of a load test. Scripts run in a sandbox that can't reach your files, the network or the app.\n- **Postman scripts now import** — request, folder and collection scripts, as Postman runs them.\n- **Mock server.** Answer a collection's requests with example responses on your computer, to build a frontend before the API exists. *Save as example* on any answer, or write one; OpenAPI imports come with examples. Also `atc mock` for pipelines.\n- **OpenAPI imports check the API against its documentation** — every request gets a JSON schema check from the documented response.\n- **Fix for the command line on Node 23 (Windows):** `atc suite` could end with exit code 127 even when everything passed, failing a pipeline. Please update the npm package.\n- **Smoother:** the Saved requests panel slides, switching requests fades, and `atc ui` opens sooner.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.10.0":'## What\'s new in 0.10.0\n\n- **See exactly what was sent.** A new **Request sent** tab shows the request as it went out — after variables, folders, OAuth, signing and cookies — with every header, the body and any redirects. Secrets stay hidden until you choose *Show secrets*.\n- **Copy it as code** — curl, PowerShell, JavaScript, Python, C#, Java, Go, or as a ready k6 load-test script.\n- **Built-in values:** `{{$uuid}}`, `{{$timestamp}}`, `{{$isoTimestamp}}`, `{{$randomInt(1,100)}}`, `{{$randomString}}`, `{{$randomEmail}}`, random names and more — a fresh value for every request, in load tests too. Postman\'s `{{$guid}}` and `{{$timestamp}}` now work as imported.\n- **JSON schema checks.** Make one from the last response in one click, then every answer must have that shape; a mismatch says where (*$.items[0].id should be integer*). Plus new checks: more/less than, type, length, patterns, valid JSON, header does not exist.\n- **Failed checks say why** — *got 404*, *is "pending"* — in the app and in CI output.\n- **Response cookies** in their own tab, and **image answers** shown as pictures.\n- **Running local servers are found reliably** in the Base URL picker, with a refresh button.\n- **Skip TLS certificate check is now on for new requests**, so test servers with their own certificates just work. Requests you saved keep their setting; turn it off to check certificates when testing production.\n- **Fixes:** typing an address with a port (`http://localhost:8080/...`) no longer loses the port; `atc ui` shows the app icon.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say "Windows protected your PC"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n',"0.9.0":"## What's new in 0.9.0\n\n- **GraphQL.** A GraphQL body with a query editor, variables and a schema explorer that loads the API's schema for you. A response with GraphQL `errors` counts as a failure, in load tests too.\n- **Import browser recordings and Insomnia.** Bring in a HAR file saved from your browser's developer tools, or an Insomnia export (v4 JSON or v5 YAML) with its folders, environments and auth.\n- **`atc` comes with the desktop app.** The Windows installer adds the command line to your PATH (open a new terminal); the Linux .deb adds `/usr/bin/atc`; on macOS link it once (see the docs). Same version as the app, no Node.js needed.\n- **`atc ui` opens in its own window,** and Ctrl+C in the terminal closes it. A browser tab says when it was stopped. `--browser` opens a tab instead.\n- **Fix:** an imported request's own Authorization header is kept again, and *Use {{token}} as Bearer* shows when it should.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` (or `atc`, included with the installer) — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.8.0":"## What's new in 0.8.0\n\n- **Fix for long load tests with OAuth 2.0.** In 0.7.0 a renewed token was never picked up during a load test, so a test longer than the token's life started failing with 401. Each simulated user now renews its token properly — please update if you load-test with OAuth.\n- **OAuth 1.0** — for NetSuite token-based authentication and older APIs: consumer and token keys, HMAC-SHA256 or HMAC-SHA1, realm, header or query. Every request gets a fresh signature, in load tests too.\n- **More OAuth 2.0 sign-ins:** JWT bearer (Salesforce, Google service accounts), SAML bearer (SAP SuccessFactors), and client assertion with a private key and certificate (Azure AD, Okta, Keycloak). The private key never goes to the load generator.\n- **Works behind company proxies.** The app trusts the certificates your computer trusts — including a proxy's that inspects https — and you can add your company's own CA, instead of switching the certificate check off.\n- **Cookie jar.** Cookies an API sets are kept and sent back like a browser does, so logins with a session cookie just work — in load tests too. See or delete them under Cookies.\n- **Postman import** now brings OAuth 1.0, Digest, NTLM, AWS Signature and JWT auth across.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.7.0":"## What's new in 0.7.0\n\n- **Folders that sign in once.** Collections now nest (`Orders/Admin`), and a folder can hold auth, headers and variables that every request inside uses. New requests take their folder's sign-in by default. Postman imports keep their folders and folder auth.\n- **Every common way to sign in — and it works under load too.** OAuth 2.0 (client credentials, password, authorization code with PKCE, tokens renewed by themselves), Digest, NTLM (Windows sign-in), AWS Signature (API Gateway, S3, Lambda URLs), JWTs the app signs with your secret or private key, and client certificates (mutual TLS) per host. Load tests keep tokens fresh and sign every request — long tests don't start failing with 401.\n- **Honest numbers with Digest and NTLM.** The sign-in exchange is no longer counted as requests or errors in load reports.\n- **Auth type is a list with a hint for each**, and secrets — client secrets, private keys, passphrases — are kept encrypted on your computer, never in files or exports.\n- **Command line:** `--cert` for client certificates in CI; OAuth tokens signed in from the app are reused.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.6.0":"## What's new in 0.6.0\n\n- **Everything from the command line — no desktop app needed.** `npx apitestcenter ui` opens the full app in your browser on any folder, so you can build tests on a build server or a locked-down laptop. `npx apitestcenter init` starts a test folder in your repository with a starter request and a ready GitHub Actions pipeline. Guide: apitestcenter.com/docs/cli-and-ci.html\n- **Pick the server, type the path.** A **Base URL** picker sits between the method and the URL. It lists the web addresses in your environment and the web servers running on your computer right now, each with its program and http or https (*localhost:5176 · Orders.Api · http*). Background services are left out, and nothing leaves your computer.\n- **Save an address as a base URL.** Sent a request to a full address? One click keeps the server in an environment as `{{baseUrl}}`, and can switch your other saved requests that use it too.\n- **A clearer Compare.** Results open full width, with a Comparison tab and a tab for each API's full report. When runs had different load or length, Compare says so, names the odd one out, and doesn't call a winner. Charts mark where a shorter run ended, and the error-rate chart no longer runs past 100%.\n- **Dropdowns that match the app**, with keyboard support, instead of the operating system's lists.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n","0.5.0":'## What\'s new in 0.5.0\n\n- **Before / after: did your release make it slower?** Every report of a request you\'ve run before now compares with your reference run (or the previous one) in one plain sentence — *"After is 18% slower"*, or *"About the same"* — with every measure marked better, worse, or about the same, and both runs on the same charts. Small run-to-run differences don\'t count, and a comparison with different load is called unfair instead of judged.\n- **Compare any runs, side by side.** *Add to compare* on any report collects runs in a tray at the bottom of the page — different APIs, different days. *Compare* opens them together, with a tab for each run\'s full report.\n- **Download for CI.** On *Run collection*, one click gives you a zip for your repository: the collection (never secrets), and a ready GitHub Actions pipeline. A new guide walks you through it: apitestcenter.com/docs/ci-walkthrough.html\n- **Fail the build when an API gets slower.** The command line (`npx apitestcenter`) gains `--baseline`, `--max-slower`, and `--save-baseline`, with the comparison as its own JUnit test case.\n- **Better reports.** The HTML export has a Before / after section, lays out cards without gaps, and keeps chart labels readable; the response-time distribution fits its card; words no longer break in the middle.\n- **About** now links to the user guide.\n\nAlready on 0.3.0 or later? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\nCommand line for CI: `npx apitestcenter` — see apitestcenter.com/docs/cli-and-ci.html\n\n**Windows may say "Windows protected your PC"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n',"0.4.0":'## What\'s new in 0.4.0\n\n- **Run a whole collection.** Click ▶ next to a collection, or open *Run collection*. Every request is sent once, in the order you choose, and you see which passed — and why the others didn\'t. Save the result as HTML, JUnit (for CI dashboards), or JSON.\n- **Pass values from one request to the next.** The new *Save values* tab takes a value from an answer — like the id of a new order — as `{{orderId}}` for the requests after it. Works in collection runs and between Sends.\n- **Honest reports when you\'re blocked.** If a server or its firewall refuses your load test (429 "too many requests", 403), the report now says so plainly, shows when it started and at what load, and stops praising response times that were really just fast error replies. Peak requests per second and average users are now measured correctly — older reports are corrected when you open them.\n- **About and Check for updates.** See your version, check for a new one, and open your data folder — from "Version … · About" at the bottom of the sidebar.\n- **Practice API:** create an order (`POST /orders`) and fetch it (`GET /orders/{id}`) to try passing values safely.\n\nAlready on 0.3.0 or 0.3.1? The app updates itself (installer version) — just restart when it asks.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\n**Windows may say "Windows protected your PC"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n',"0.3.1":'## What\'s new in 0.3.1\n\n- **HTML report matches your report.** The exported HTML report now shows the same widgets, in the same order, as your report view, plus a short written debrief: what went well, what to look at, and what to try next. It is a single file that opens in any browser.\n- **New app icon.** The taskbar, Start menu, and installer show the APITestCenter logo instead of the default one.\n- **Help bubbles no longer get cut off** at the edge of a card.\n- **Usage counts: no means no.** If you say no to usage counts, the app stops counting entirely and deletes any counts it was keeping. Details: https://apitestcenter.com/privacy.html\n\nAlready on 0.3.0? The app offers this update by itself (installer version); just restart when it asks. Coming from 0.2.0? Download and install this version once.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\n**Windows may say "Windows protected your PC"** — choose *More info → Run anyway*. On macOS, right-click the app and choose *Open* the first time. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n',"0.3.0":"## What's new in 0.3.0\n\n- **Import from Postman and OpenAPI.** Bring in Postman collections and environments, or OpenAPI 3 / Swagger 2 files (JSON or YAML). Folders, auth, bodies, and variables come along; anything that can't is listed first.\n- **Single-number tiles and section headings.** Put one big number anywhere on a report, group charts under headings, and try the new *By topic* view (Speed, Reliability, Load). Eight more numbers to choose from, in the order you pick.\n- **Formatted email report.** Copy a designed summary into Outlook or Gmail, or download an email draft (.eml) with the full report attached.\n- **Updates.** The installed app now checks for new versions and offers to restart into them. (Portable and macOS show a download link.)\n- **Optional usage counts.** The app asks once whether to share anonymous counts. Say no and nothing is sent. Details: https://apitestcenter.com/privacy.html\n- **macOS and Linux previews** (when attached below). Not yet signed: on macOS, right-click the app and choose *Open* the first time.\n\nComing from 0.2.0? Download and install this version once; after that, updates arrive by themselves.\n\n## Download\n\n| File | For |\n| --- | --- |\n| **APITestCenter-Setup.exe** | Windows 10 and 11 (64-bit) — recommended |\n| **APITestCenter-Portable.exe** | Windows, no install |\n| APITestCenter-mac-arm64.dmg / -mac-x64.dmg | macOS, Apple Silicon / Intel (preview) |\n| APITestCenter-linux-x64.AppImage / .deb | Linux 64-bit (preview) |\n\n**Windows may say \"Windows protected your PC\"** — choose *More info → Run anyway*. Checksums are in `SHA256SUMS.txt`.\n\nFree to use under `LICENSE.txt`. Includes open-source software listed in `THIRD-PARTY-NOTICES.txt`, including k6 v2.2.0 (AGPL-3.0, unmodified; source: https://github.com/grafana/k6/tree/v2.2.0).\n"};var y=e.i(80190),g=e.i(30729);let w="atc:whats-new",v="apitestcenter-seen-version";try{localStorage.getItem(v)||localStorage.setItem(v,Object.keys(localStorage).some(e=>e.startsWith("apitestcenter-"))?"earlier":"first")}catch{}e.s(["WhatsNewDialog",0,function(){let{appVersion:e}=(0,m.useEngineHealth)(),s=(0,c.useMemo)(()=>(0,d.releaseNotes)(b),[]),[n,a]=(0,c.useState)(null),r=(0,c.useRef)(null);if((0,c.useEffect)(()=>{if(!e)return;let t=null;try{t=localStorage.getItem(v),/^\d/.test(e)&&localStorage.setItem(v,e)}catch{return}let n=(0,d.whatsNewFor)(s,e,t&&/^\d/.test(t)?t:null,"earlier"===t);n.length&&a(n)},[e,s]),(0,c.useEffect)(()=>{let t=()=>{let t=(0,d.noteFor)(s,e);a(t?[t]:[])};return window.addEventListener(w,t),()=>window.removeEventListener(w,t)},[e,s]),(0,c.useEffect)(()=>{if(!n)return;window.setTimeout(()=>r.current?.focus(),0);let e=e=>"Escape"===e.key&&a(null);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),!n)return null;let[i,...o]=n,u=()=>a(null);return(0,t.jsx)("div",{className:"fixed inset-0 z-[75] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&u(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-title",className:"flex max-h-[min(720px,calc(100vh-2rem))] w-full max-w-xl flex-col rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-3 border-b border-line px-5 py-4",children:[(0,t.jsx)("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-accent-dim text-accent","aria-hidden":!0,children:(0,t.jsx)(g.Sparkles,{size:18})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{id:"whats-new-title",className:"text-base font-medium text-ink",children:i?`What's new in ${i.version}`:"What's new"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:o.length?`And in ${1===o.length?"1 version":`${o.length} versions`} since you last opened the app`:"Your tests and history stay as they were."})]}),(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Close",className:"ml-auto self-start rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(l.X,{size:16})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4",children:[i?(0,t.jsx)(h,{markdown:i.markdown}):(0,t.jsx)("p",{className:"text-sm text-mute",children:"There are no notes for this version in the app. Every version's are on the website."}),o.map(e=>(0,t.jsxs)("details",{className:"rounded-lg border border-line",children:[(0,t.jsxs)("summary",{className:"cursor-pointer px-3 py-2 text-sm font-medium text-ink select-none",children:["Also new in ",e.version]}),(0,t.jsx)("div",{className:"border-t border-line px-3 py-3",children:(0,t.jsx)(h,{markdown:e.markdown})})]},e.version))]}),(0,t.jsxs)("footer",{className:"flex items-center gap-3 border-t border-line px-5 py-3",children:[(0,t.jsxs)("a",{href:"https://apitestcenter.com/whats-new.html",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:underline",children:["Every version ",(0,t.jsx)(y.ExternalLink,{size:12,"aria-hidden":!0})]}),(0,t.jsx)("button",{ref:r,type:"button",onClick:u,className:"btn btn-primary ml-auto py-1.5 text-sm",children:"Got it"})]})]})})},"openWhatsNew",0,function(){window.dispatchEvent(new Event(w))}],39736)},45672,58246,e=>{"use strict";var t=e.i(14368),s=e.i(8055),n=e.i(19286),a=e.i(50962),r=e.i(87283),i=e.i(5831);let o="apitestcenter-welcome",l="atc:welcome";function c({icon:e,title:s,text:n,onClick:a,disabled:r}){return(0,t.jsxs)("button",{type:"button",onClick:a,disabled:r,className:"flex flex-col items-start gap-1.5 rounded-lg border border-line bg-panel-2 px-4 py-3 text-left hover:border-accent disabled:opacity-50 disabled:hover:border-line",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-ink",children:[(0,t.jsx)("span",{className:"text-accent",children:e}),s]}),(0,t.jsx)("span",{className:"text-xs text-mute",children:n})]})}e.s(["WELCOME_EVENT",0,l,"WelcomeCard",0,function({practiceReady:e,onSimple:o,onSignIn:l,onHide:d}){return(0,t.jsxs)("div",{className:"relative flex flex-1 flex-col justify-center rounded-lg border border-line bg-panel px-6 py-8",children:[(0,t.jsx)("button",{type:"button",onClick:d,className:"absolute top-3 right-3 rounded p-1 text-mute hover:text-ink","aria-label":"Hide the getting-started guide",title:"Hide (bring it back from Help)",children:(0,t.jsx)(r.X,{size:15})}),(0,t.jsx)("h2",{className:"text-lg font-medium text-ink",children:"New here? Start with something safe to test"}),(0,t.jsx)("p",{className:"mt-1 max-w-xl text-sm text-mute",children:"The app has a small practice shop API built in. Nothing leaves this computer, so you can send requests and run performance tests without worrying about a real system."}),(0,t.jsxs)("div",{className:"mt-5 grid gap-3",children:[(0,t.jsx)(c,{icon:(0,t.jsx)(a.Send,{size:16,"aria-hidden":!0}),title:"Try a simple request",text:"Fill in a request for the product list, with a check that the answer is right. Then press Send.",disabled:!e,onClick:o}),(0,t.jsx)(c,{icon:(0,t.jsx)(n.KeyRound,{size:16,"aria-hidden":!0}),title:"Try a sign-in example",text:"Adds two requests to Saved requests → Practice: Sign in, and My orders, which signs in first and uses the token.",disabled:!e,onClick:l}),(0,t.jsx)(c,{icon:(0,t.jsx)(s.Compass,{size:16,"aria-hidden":!0}),title:"Take the 1-minute tour",text:"See where to type, how to try a request once, then test it under load.",onClick:i.startTour})]}),e?null:(0,t.jsx)("p",{className:"mt-3 text-xs text-warn",children:"The practice API starts with the engine — it is offline right now."}),(0,t.jsx)("p",{className:"mt-5 text-xs text-mute",children:"Have your own API? Paste its URL — or a curl command from your browser's DevTools — into the bar above."}),(0,t.jsxs)("p",{className:"mt-2 text-xs text-mute",children:["Bought Pro, or on your company's Team?"," ",(0,t.jsx)("button",{type:"button",className:"text-accent underline-offset-2 hover:underline",onClick:()=>window.dispatchEvent(new CustomEvent("atc:settings",{detail:"plan"})),children:"Sign in"})," ","with your email. It's optional: everything works without an account."]})]})},"setWelcomeHidden",0,function(e){try{e?localStorage.setItem(o,"hidden"):localStorage.removeItem(o)}catch{}window.dispatchEvent(new Event(l))},"welcomeHidden",0,function(){try{return"hidden"===localStorage.getItem(o)}catch{return!1}}],45672);let d=(0,e.i(99522).default)("app-window",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]);e.s(["AppWindow",0,d],58246)},41997,e=>{"use strict";e.s(["AuthFields",()=>w,"authModeLabel",()=>k],41997);var t=e.i(14368);e.i(24856);var s=e.i(59100),n=e.i(59674),a=e.i(78451),r=e.i(19286),i=e.i(27813),o=e.i(63966),l=e.i(458),c=e.i(96659),d=e.i(99181),u=e.i(36e3),h=e.i(31753),p=e.i(28867),m=e.i(80707);e.i(42674);var x=e.i(5305),f=e.i(6278);async function b(e,t){let s=await fetch(`/engine${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>null);if(!s.ok)throw Error(n?.error??`Engine error (${s.status})`);return n}function y({value:e,onChange:s,defaults:n={}}){let{vars:w}=(0,f.useWorkspace)(),v=t=>s({...e,...t}),[k,j]=(0,d.useState)(null),[N,S]=(0,d.useState)(null),[C,A]=(0,d.useState)(null),[T,E]=(0,d.useState)(!1),P=(0,d.useRef)(null),I=(0,d.useCallback)(()=>{let{value:t,missing:s}=(0,a.substituteDeep)(e,{...n,...w});if(s.length)throw Error(`${s.map(e=>`{{${e}}}`).join(", ")} ${1===s.length?"isn't":"aren't"} defined — pick an environment`);return(0,x.oauthWire)(t)},[e,n,w]),$=(0,d.useCallback)(async()=>{try{let e=I();j(await b("/oauth/status",{oauth:e})),A(null)}catch(e){j(null),A(e instanceof Error?e.message:String(e))}},[I]);async function L(){S("token");try{j(await b("/oauth/token",{oauth:I()})),A(null)}catch(e){A(e instanceof Error?e.message:String(e))}finally{S(null)}}async function q(){S("browser");try{let e=I(),{id:t,url:s}=await b("/oauth/authorize",{oauth:e});window.open(s,"_blank","noopener"),E(!0),A(null);let n=Date.now();P.current&&window.clearInterval(P.current),P.current=window.setInterval(async()=>{let e=await fetch(`/engine/oauth/authorize/${t}`).then(e=>e.json()).catch(()=>({status:"unknown"}));"waiting"===e.status&&Date.now()-n<33e4||(window.clearInterval(P.current),P.current=null,E(!1),"done"===e.status?await $():A(e.error??"The sign-in ended without a token — try again"))},1500)}catch(e){A(e instanceof Error?e.message:String(e))}finally{S(null)}}async function R(){try{j(await b("/oauth/clear",{oauth:I()}))}catch(e){A(e instanceof Error?e.message:String(e))}}(0,d.useEffect)(()=>{let e=window.setTimeout(()=>void $(),400);return()=>window.clearTimeout(e)},[$]),(0,d.useEffect)(()=>()=>void(P.current&&window.clearInterval(P.current)),[]);let M="authorization_code"===e.grant;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Grant type"}),(0,t.jsx)(m.Select,{label:"Grant type",value:e.grant,onChange:e=>v({grant:e}),minWidth:340,options:[{value:"client_credentials",label:"Client credentials",hint:"Service to service — the app signs in as itself. Best for performance tests."},{value:"password",label:"Password",hint:"As a user, with a username and password"},{value:"authorization_code",label:"Authorization code",hint:"As a user, in the browser once; then kept and renewed"},{value:"jwt_bearer",label:"JWT bearer",hint:"A JWT signed with your private key (Salesforce, Google service accounts)"},{value:"saml_bearer",label:"SAML bearer",hint:"A SAML assertion (SAP SuccessFactors)"}],className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 text-sm text-ink"})]}),M?(0,t.jsx)(h.LabeledInput,{label:"Authorization URL",mono:!0,value:e.authUrl,placeholder:"https://auth.example.com/oauth/authorize",onChange:e=>v({authUrl:e})}):null,(0,t.jsx)(h.LabeledInput,{label:"Token URL",mono:!0,value:e.tokenUrl,placeholder:"https://auth.example.com/oauth/token",onChange:e=>v({tokenUrl:e})}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(h.LabeledInput,{label:"Client ID",mono:!0,value:e.clientId,onChange:e=>v({clientId:e})}),(0,t.jsx)(h.LabeledInput,{label:M||"jwt_bearer"===e.grant||"saml_bearer"===e.grant||"private_key_jwt"===e.clientAuth?"Client secret (if it has one)":"Client secret",secret:!0,mono:!0,value:e.clientSecret,placeholder:"or {{clientSecret}}",onChange:e=>v({clientSecret:e})})]}),"jwt_bearer"===e.grant?(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsx)(h.LabeledInput,{label:"Issuer (iss)",mono:!0,value:e.issuer,placeholder:"the client ID",onChange:e=>v({issuer:e})}),(0,t.jsx)(h.LabeledInput,{label:"Subject (sub)",mono:!0,value:e.subject,placeholder:"user, if the API wants one",onChange:e=>v({subject:e})}),(0,t.jsx)(h.LabeledInput,{label:"Audience (aud)",mono:!0,value:e.audience,placeholder:"the token URL",onChange:e=>v({audience:e})})]}):null,"saml_bearer"===e.grant?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(p.Segmented,{label:"SAML assertion source",value:e.samlSource,onChange:e=>v({samlSource:e}),options:[{value:"idp",label:"SuccessFactors builds it (/oauth/idp)"},{value:"assertion",label:"I have an assertion"}]}),"idp"===e.samlSource?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsx)(h.LabeledInput,{label:"Assertion URL",mono:!0,value:e.idpUrl,placeholder:"https://api-server/oauth/idp",onChange:e=>v({idpUrl:e})}),(0,t.jsx)(h.LabeledInput,{label:"User ID",mono:!0,value:e.userId,placeholder:"the API user",onChange:e=>v({userId:e})}),(0,t.jsx)(h.LabeledInput,{label:"Company ID",mono:!0,value:e.companyId,onChange:e=>v({companyId:e})})]}),(0,t.jsx)("p",{className:"text-xs text-warn",children:"This way sends your private key to SuccessFactors, which builds the assertion — SAP's documented quick path. For production, prefer an assertion made by your identity provider."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.LabeledInput,{label:"Company ID",mono:!0,value:e.companyId,onChange:e=>v({companyId:e})}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"SAML assertion (base64)"}),(0,t.jsx)("textarea",{value:e.assertion,onChange:e=>v({assertion:e.target.value}),rows:3,spellCheck:!1,placeholder:"PHNhbWwyOkFzc2VydGlvbi… or {{samlAssertion}}",className:"input font-mono text-xs"})]})]})]}):null,"jwt_bearer"===e.grant||"private_key_jwt"===e.clientAuth||"saml_bearer"===e.grant&&"idp"===e.samlSource?(0,t.jsx)(g,{value:e,set:v}):null,"password"===e.grant?(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(h.LabeledInput,{label:"Username",value:e.username,onChange:e=>v({username:e})}),(0,t.jsx)(h.LabeledInput,{label:"Password",secret:!0,value:e.password,onChange:e=>v({password:e})})]}):null,(0,t.jsx)(h.LabeledInput,{label:"Scope",mono:!0,value:e.scope,placeholder:"orders:read orders:write",onChange:e=>v({scope:e}),hint:"Space-separated. Leave empty for the server's default."}),M?(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:[(0,t.jsx)(h.LabeledInput,{label:"Redirect URL",mono:!0,value:e.redirectUri,onChange:e=>v({redirectUri:e}),hint:"Add exactly this address to your OAuth app. It must be on this computer (127.0.0.1 or localhost)."}),(0,t.jsxs)("label",{className:"mb-6 flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.pkce,onChange:e=>v({pkce:e.target.checked}),className:"accent-[var(--accent)]"}),"PKCE"]})]}):null,(0,t.jsxs)("details",{className:"rounded-md border border-line",children:[(0,t.jsx)("summary",{className:"cursor-pointer px-3 py-2 text-sm text-mute hover:text-ink",children:"More: client authentication, extra fields"}),(0,t.jsxs)("div",{className:"space-y-3 border-t border-line p-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Send the client ID and secret"}),(0,t.jsx)(p.Segmented,{label:"Client authentication",value:e.clientAuth,onChange:e=>v({clientAuth:e}),options:[{value:"basic",label:"In a Basic auth header"},{value:"body",label:"In the request body"},{value:"private_key_jwt",label:"Signed with a private key"}]}),"private_key_jwt"===e.clientAuth?(0,t.jsx)("p",{className:"mt-1 text-xs text-mute",children:"Client assertion (private_key_jwt): instead of a secret, the app signs a short JWT with the private key above — Azure AD with a certificate, Okta, Keycloak."}):null]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Extra fields for the token request (and the sign-in page), e.g. audience or resource"}),(0,t.jsx)(u.KeyValueEditor,{simple:!0,rows:e.extra,onChange:e=>v({extra:e}),keyPlaceholder:"audience",valuePlaceholder:"https://api.example.com",noun:"field"})]})]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-line bg-panel-2/50 px-3 py-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)(r.KeyRound,{size:14,className:k?.hasToken?"text-ok":"text-mute","aria-hidden":!0}),T?(0,t.jsx)("span",{className:"text-ink",children:"Waiting for you to sign in in the browser…"}):k?.hasToken?(0,t.jsxs)("span",{className:"text-ink",children:["Token ready ",(0,t.jsxs)("span",{className:"text-mute",children:["· ",function(e){if(null===e)return"no expiry given";let t=Math.round((e-Date.now())/6e4);return t<=0?"expired — a new one is fetched on the next request":t<90?`expires in ${t} min`:`expires in ${Math.round(t/60)} h`}(k.expiresAt),k.scope?` \xb7 ${k.scope}`:""]})]}):(0,t.jsx)("span",{className:"text-mute",children:M?"Not signed in yet.":"No token yet — one is fetched on the first Send or performance test."}),(0,t.jsxs)("span",{className:"ml-auto flex gap-1.5",children:[M?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",disabled:null!==N||T,onClick:()=>void q(),children:["browser"===N?(0,t.jsx)(i.Loader2,{size:13,className:"animate-spin"}):(0,t.jsx)(o.LogIn,{size:13}),k?.hasToken?"Sign in again":"Sign in in the browser"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",disabled:null!==N,onClick:()=>void L(),children:["token"===N?(0,t.jsx)(i.Loader2,{size:13,className:"animate-spin"}):(0,t.jsx)(l.RefreshCw,{size:13}),"Get new token"]}),k?.hasToken?(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-bad",title:"Forget this token","aria-label":"Forget this token",onClick:()=>void R(),children:(0,t.jsx)(c.Trash2,{size:13})}):null]})]}),C?(0,t.jsx)("p",{className:"mt-1.5 text-xs text-bad",children:C}):null,(0,t.jsxs)("p",{className:"mt-1.5 text-xs text-mute",children:["Requests go out with ",(0,t.jsx)("code",{className:"font-mono",children:"Authorization: Bearer …"}),". The token is kept encrypted on this computer and renewed before it runs out — in performance tests too."]})]})]})}function g({value:e,set:s}){let n="jwt_bearer"===e.grant||"private_key_jwt"===e.clientAuth,a=e=>t=>{let n=t.target.files?.[0];n&&n.text().then(t=>s({[e]:t})),t.target.value=""};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border border-line p-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsxs)("span",{className:"mb-1 flex items-center justify-between text-xs text-mute",children:["Private key (PEM)",(0,t.jsxs)("span",{className:"relative cursor-pointer text-accent hover:underline",children:["Load a .pem file",(0,t.jsx)("input",{type:"file",accept:".pem,.key",className:"absolute inset-0 cursor-pointer opacity-0",onChange:a("privateKey")})]})]}),(0,t.jsx)("textarea",{value:e.privateKey,onChange:e=>s({privateKey:e.target.value}),rows:3,spellCheck:!1,placeholder:"-----BEGIN PRIVATE KEY-----\n…",className:"input font-mono text-xs"})]}),n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-end",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Signing algorithm",(0,t.jsx)(m.Select,{label:"Assertion algorithm",value:e.assertionAlgorithm,onChange:e=>s({assertionAlgorithm:e}),options:["RS256","RS384","RS512","PS256","ES256","ES384"].map(e=>({value:e,label:e})),className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 font-mono text-sm text-ink"})]}),(0,t.jsx)(h.LabeledInput,{label:"Key ID (kid)",mono:!0,value:e.kid,placeholder:"optional",onChange:e=>s({kid:e})})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsxs)("span",{className:"mb-1 flex items-center justify-between text-xs text-mute",children:["Certificate (PEM) — optional; Azure AD finds the key by its thumbprint",(0,t.jsxs)("span",{className:"relative cursor-pointer text-accent hover:underline",children:["Load a file",(0,t.jsx)("input",{type:"file",accept:".pem,.crt,.cer",className:"absolute inset-0 cursor-pointer opacity-0",onChange:a("certificate")})]})]}),(0,t.jsx)("textarea",{value:e.certificate,onChange:e=>s({certificate:e.target.value}),rows:2,spellCheck:!1,placeholder:"-----BEGIN CERTIFICATE-----",className:"input font-mono text-xs"})]}),"jwt_bearer"===e.grant?(0,t.jsxs)("label",{className:"block",children:[(0,t.jsxs)("span",{className:"mb-1 block text-xs text-mute",children:["Extra claims (JSON), e.g. ",'{ "scope": "https://www.googleapis.com/auth/cloud-platform" }']}),(0,t.jsx)("textarea",{value:e.extraClaims,onChange:e=>s({extraClaims:e.target.value}),rows:2,spellCheck:!1,className:"input font-mono text-xs"})]}):null]}):null,(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Kept encrypted on this computer."," ",n?"In performance tests the assertions are signed by the app ahead of time — the key never goes to the load generator.":"SuccessFactors tokens last about a day, so a performance test rarely needs a new one."]})]})}function w({value:e,onChange:a,inheritLabel:r="Inherit",inheritNote:i,secretNote:o,defaults:l,noInherit:c=!1}){let d=e.authMode;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2 text-xs text-mute",children:["Auth type",(0,t.jsx)(m.Select,{label:"Auth type",value:d,onChange:e=>a({authMode:e}),minWidth:300,options:[...c?[]:[{value:"inherit",label:r,hint:"Use the auth set on the folder above, or the request's connection"}],{value:"none",label:"None",hint:"No credentials"},{value:"bearer",label:"Bearer token",hint:"Authorization: Bearer …"},{value:"basic",label:"Basic",hint:"Username and password, in every request"},{value:"api_key",label:"API key",hint:"A key in a header or the query"},{value:"oauth2",label:"OAuth 2.0",hint:"Get a token from a sign-in server, renewed by itself"},{value:"oauth1",label:"OAuth 1.0",hint:"Sign every request with consumer and token secrets (NetSuite TBA)"},{value:"digest",label:"Digest",hint:"Username and password, answered to the server's challenge"},{value:"ntlm",label:"NTLM",hint:"Windows sign-in (IIS, SharePoint, internal APIs)"},{value:"aws_sigv4",label:"AWS Signature",hint:"Sign every request with an AWS key (API Gateway, S3, Lambda URLs)"},{value:"jwt",label:"JWT (signed here)",hint:"The app signs a JSON Web Token with your secret or private key"}],className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 text-sm text-ink hover:border-mute focus-visible:border-accent focus-visible:outline-none"})]}),"oauth2"===d?(0,t.jsx)(y,{value:e.oauth,onChange:e=>a({oauth:e}),defaults:l}):null,"oauth1"===d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(h.LabeledInput,{label:"Consumer key",mono:!0,value:e.oauth1.consumerKey,placeholder:"or {{consumerKey}}",onChange:t=>a({oauth1:{...e.oauth1,consumerKey:t}})}),(0,t.jsx)(h.LabeledInput,{label:"Consumer secret",secret:!0,mono:!0,value:e.oauth1.consumerSecret,placeholder:"or {{consumerSecret}}",onChange:t=>a({oauth1:{...e.oauth1,consumerSecret:t}})}),(0,t.jsx)(h.LabeledInput,{label:"Token (access token)",mono:!0,value:e.oauth1.token,placeholder:"or {{tokenId}}",onChange:t=>a({oauth1:{...e.oauth1,token:t}})}),(0,t.jsx)(h.LabeledInput,{label:"Token secret",secret:!0,mono:!0,value:e.oauth1.tokenSecret,placeholder:"or {{tokenSecret}}",onChange:t=>a({oauth1:{...e.oauth1,tokenSecret:t}})})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3 sm:items-end",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Signature method",(0,t.jsx)(m.Select,{label:"Signature method",value:e.oauth1.signatureMethod,onChange:t=>a({oauth1:{...e.oauth1,signatureMethod:t}}),options:[{value:"HMAC-SHA256",label:"HMAC-SHA256",hint:"NetSuite and most current APIs"},{value:"HMAC-SHA1",label:"HMAC-SHA1",hint:"Older APIs"},{value:"PLAINTEXT",label:"PLAINTEXT",hint:"Only over https"}],className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 font-mono text-sm text-ink"})]}),(0,t.jsx)(h.LabeledInput,{label:"Realm",mono:!0,value:e.oauth1.realm,placeholder:"NetSuite: account ID, e.g. 1234567_SB1",onChange:t=>a({oauth1:{...e.oauth1,realm:t}})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Send the signature in"}),(0,t.jsx)(p.Segmented,{label:"OAuth 1.0 placement",value:e.oauth1.addTo,onChange:t=>a({oauth1:{...e.oauth1,addTo:t}}),options:[{value:"header",label:"Header"},{value:"query",label:"Query"}]})]})]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Each request gets a fresh nonce, timestamp and signature — in performance tests too. Form bodies are signed with the address. The secrets are kept encrypted on this computer."})]}):null,"jwt"===d?(0,t.jsx)(n.JwtFields,{value:e.jwt,onChange:e=>a({jwt:e})}):null,"aws_sigv4"===d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(h.LabeledInput,{label:"Access key ID",mono:!0,value:e.aws.accessKeyId,placeholder:"AKIA… or {{awsAccessKeyId}}",onChange:t=>a({aws:{...e.aws,accessKeyId:t}})}),(0,t.jsx)(h.LabeledInput,{label:"Secret access key",secret:!0,mono:!0,value:e.aws.secretAccessKey,placeholder:"or {{awsSecretAccessKey}}",onChange:t=>a({aws:{...e.aws,secretAccessKey:t}})}),(0,t.jsx)(h.LabeledInput,{label:"Region",mono:!0,value:e.aws.region,placeholder:"eu-west-1",onChange:t=>a({aws:{...e.aws,region:t}})}),(0,t.jsx)(h.LabeledInput,{label:"Service",mono:!0,value:e.aws.service,placeholder:"execute-api",onChange:t=>a({aws:{...e.aws,service:t}}),hint:"execute-api (API Gateway), s3, lambda (function URLs), es…"})]}),(0,t.jsx)(h.LabeledInput,{label:"Session token (temporary credentials only)",secret:!0,mono:!0,value:e.aws.sessionToken,placeholder:"or {{awsSessionToken}}",onChange:t=>a({aws:{...e.aws,sessionToken:t}})}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Every request is signed just before it goes out — in performance tests too, one fresh signature per request. The secret key and token are kept encrypted on this computer."})]}):null,"inherit"===d?(0,t.jsx)("div",{className:"text-sm text-mute",children:i}):null,"none"===d?(0,t.jsx)("p",{className:"text-sm text-mute",children:"No credentials are sent."}):null,"bearer"===d?(0,t.jsx)(h.LabeledInput,{label:"Token",secret:!0,mono:!0,value:e.token,placeholder:"eyJhbGciOi… or {{token}}",onChange:e=>a({token:(0,s.normalizeBearerToken)(e)}),hint:'Paste with or without the "Bearer " prefix.'}):null,"basic"===d||"digest"===d?(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(h.LabeledInput,{label:"Username",value:e.username,onChange:e=>a({username:e})}),(0,t.jsx)(h.LabeledInput,{label:"Password",secret:!0,value:e.password,onChange:e=>a({password:e})})]}):null,"digest"===d?(0,t.jsx)("p",{className:"text-xs text-mute",children:"The server answers the first request with a challenge (401); the app answers it without sending the password. MD5 and SHA-256, with or without -sess."}):null,"ntlm"===d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsx)(h.LabeledInput,{label:"Username",value:e.username,placeholder:"ann or CORP\\ann",onChange:e=>a({username:e})}),(0,t.jsx)(h.LabeledInput,{label:"Password",secret:!0,value:e.password,onChange:e=>a({password:e})}),(0,t.jsx)(h.LabeledInput,{label:"Domain",value:e.domain,placeholder:"CORP",onChange:e=>a({domain:e})})]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"NTLMv2. The sign-in takes a short exchange with the server on one connection; in performance tests those extra 401 replies are not counted as requests."})]}):null,"api_key"===d?(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_auto]",children:[(0,t.jsx)(h.LabeledInput,{label:"Name",mono:!0,value:e.apiName,onChange:e=>a({apiName:e})}),(0,t.jsx)(h.LabeledInput,{label:"Value",secret:!0,mono:!0,value:e.apiValue,onChange:e=>a({apiValue:e})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Send in"}),(0,t.jsx)(p.Segmented,{label:"Send API key in",value:e.apiIn,onChange:e=>a({apiIn:e}),options:[{value:"header",label:"Header"},{value:"query",label:"Query"}]})]})]}):null,"none"!==d&&"inherit"!==d&&"oauth2"!==d&&"aws_sigv4"!==d&&"jwt"!==d&&"oauth1"!==d&&o?(0,t.jsx)("p",{className:"text-xs text-mute",children:o}):null]})}let v={bearer:"Bearer token",basic:"Basic sign-in",api_key:"API key",oauth2:"OAuth 2.0 sign-in",digest:"Digest sign-in",ntlm:"NTLM sign-in",aws_sigv4:"AWS signature",jwt:"signed JWT",oauth1:"OAuth 1.0 signature"};function k(e){return"inherit"===e?"inherited":"none"===e?"no auth":v[e]}},1359,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(89662),n=e.i(47677),a=e.i(99181),r=e.i(28867);function i({parts:e}){return e.map((e,s)=>"text"===e.kind?(0,t.jsx)("span",{children:e.text},s):"code"===e.kind?(0,t.jsx)("code",{className:"rounded bg-panel-2 px-1 py-px font-mono text-[0.85em] text-ink",children:e.text},s):"strong"===e.kind?(0,t.jsx)("strong",{className:"font-medium text-ink",children:(0,t.jsx)(i,{parts:e.parts})},s):"em"===e.kind?(0,t.jsx)("em",{children:(0,t.jsx)(i,{parts:e.parts})},s):(0,t.jsx)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"text-accent hover:underline",children:(0,t.jsx)(i,{parts:e.parts})},s))}let o=["","text-lg font-semibold","text-base font-semibold","text-sm font-semibold","text-sm font-medium"];function l({b:e}){switch(e.kind){case"heading":{let s=["h3","h3","h4","h5","h6"][e.level];return(0,t.jsx)(s,{className:`pt-1 text-ink ${o[e.level]}`,children:(0,t.jsx)(i,{parts:e.parts})})}case"paragraph":return(0,t.jsx)("p",{children:(0,t.jsx)(i,{parts:e.parts})});case"list":{let s=e.ordered?"ol":"ul";return(0,t.jsx)(s,{className:`space-y-1 pl-5 ${e.ordered?"list-decimal":"list-disc"} marker:text-line`,children:e.items.map((e,s)=>(0,t.jsx)("li",{children:(0,t.jsx)(i,{parts:e})},s))})}case"code":return(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-panel-2 p-3 font-mono text-[13px] leading-5 text-ink",children:e.text});case"table":return(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full border-collapse text-left text-[13px]",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:e.head.map((e,s)=>(0,t.jsx)("th",{className:"border-b border-line px-2 py-1.5 font-medium text-mute",children:(0,t.jsx)(i,{parts:e})},s))})}),(0,t.jsx)("tbody",{children:e.rows.map((e,s)=>(0,t.jsx)("tr",{children:e.map((e,s)=>(0,t.jsx)("td",{className:"border-b border-line px-2 py-1.5 align-top",children:(0,t.jsx)(i,{parts:e})},s))},s))})]})});case"quote":return(0,t.jsx)("blockquote",{className:"border-l-2 border-accent pl-3",children:(0,t.jsx)(i,{parts:e.parts})});case"rule":return(0,t.jsx)("hr",{className:"border-line"})}}function c({markdown:e}){let n=(0,a.useMemo)(()=>(0,s.docBlocks)(e),[e]);return(0,t.jsx)("div",{className:"space-y-2.5 text-sm leading-relaxed text-mute",children:n.map((e,s)=>(0,t.jsx)(l,{b:e},s))})}e.s(["DocsPanel",0,function({value:e,onChange:i,forFolder:o=!1}){let[l,d]=(0,a.useState)(e.trim()?"preview":"write"),u=o?"this folder":"this request";return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(r.Segmented,{label:"Docs",value:l,onChange:d,options:[{value:"write",label:"Write"},{value:"preview",label:"Preview"}]}),(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-mute",children:[(0,t.jsx)(n.FileOutput,{size:12,"aria-hidden":!0})," What ",u," is for, in Markdown — it goes into Export → API docs."]})]}),"write"===l?(0,t.jsx)("textarea",{"aria-label":o?"Folder description":"Request description",value:e,maxLength:s.DESCRIPTION_MAX,onChange:e=>i(e.target.value),onKeyDown:e=>"Escape"===e.key&&e.currentTarget.blur(),rows:10,placeholder:o?"## Orders\nEverything about orders: placing one, paying, and its status.\n\nAll of them need a signed-in user.":"Places an order for the items in the cart.\n\n- Answers **201** with the new order's `id`\n- **409** when an item is out of stock",className:"min-h-[12rem] w-full resize-y rounded-md border border-line bg-panel-2 p-3 font-mono text-[13px] leading-5 text-ink outline-none focus:border-accent"}):e.trim()?(0,t.jsx)("div",{className:"rounded-md border border-line p-4","aria-label":"Preview",children:(0,t.jsx)(c,{markdown:e})}):(0,t.jsxs)("p",{className:"rounded-md border border-dashed border-line p-4 text-sm text-mute",children:["Nothing written yet."," ",(0,t.jsxs)("button",{type:"button",className:"text-accent hover:underline",onClick:()=>d("write"),children:["Write what ",u," is for"]}),"."]})]})}])},90176,74749,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(36163),n=e.i(67290),a=e.i(89932),r=e.i(87283),i=e.i(99181),o=e.i(80707),l=e.i(56396),c=e.i(6278),d=e.i(24448);let u="atc:mock",h="apitestcenter-mock-port";function p(e){window.dispatchEvent(new CustomEvent(u,{detail:e}))}let m="\0all";e.s(["MockDialog",0,function(){let e=(0,l.useToast)(),{index:s}=(0,c.useWorkspace)(),[p,x]=(0,i.useState)(!1),[f,b]=(0,i.useState)(m),[y,g]=(0,i.useState)("4010"),[w,v]=(0,i.useState)(null),[k,j]=(0,i.useState)(null),[N,S]=(0,i.useState)(!1),C=(0,i.useCallback)(()=>void fetch("/engine/mock",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>e&&v(e)).catch(()=>void 0),[]);(0,i.useEffect)(()=>{let e=e=>{let t=e.detail;"string"==typeof t&&b(t||m),j(null),x(!0)};window.addEventListener(u,e);try{let e=localStorage.getItem(h);e&&/^\d{2,5}$/.test(e)&&g(e)}catch{}return()=>window.removeEventListener(u,e)},[]),(0,i.useEffect)(()=>{if(!p)return;C();let e=window.setInterval(C,1500);return()=>window.clearInterval(e)},[p,C]);let A=async()=>{S(!0),j(null);try{let e=await fetch("/engine/mock/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({collection:f===m?"":f,port:Number(y)})}),t=await e.json();if(e.ok){v(t);try{localStorage.setItem(h,y)}catch{}}else j(t.error??"The mock server could not start")}catch(e){j(e instanceof Error?e.message:String(e))}finally{S(!1)}},T=async()=>{S(!0),await fetch("/engine/mock/stop",{method:"POST"}).catch(()=>void 0),S(!1),C()};if(!p)return null;let E=[...new Set([...(s?.folders??[]).map(e=>e.path),...(s?.requests??[]).map(e=>e.collection).filter(Boolean)])].sort((e,t)=>e.localeCompare(t)),P=w?.running===!0,I=w?.routes.filter(e=>!e.hasExample).length??0;return(0,t.jsx)("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>e.target===e.currentTarget&&x(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"mock-title",onKeyDown:e=>"Escape"===e.key&&x(!1),className:"flex max-h-[85vh] w-full max-w-3xl flex-col overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h2",{id:"mock-title",className:"flex items-center gap-2 text-base font-medium text-ink",children:[(0,t.jsx)(n.Server,{size:16,"aria-hidden":!0})," Mock server"]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Answers a collection's requests with their example responses, on this computer — to build a frontend before the API exists, or to test while it's down."})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(d.GuideLink,{topic:"mock-server"}),(0,t.jsx)("button",{type:"button","aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>x(!1),children:(0,t.jsx)(r.X,{size:16})})]})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-auto px-5 py-4",children:[P?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-md border border-ok/40 bg-ok/10 px-3 py-2.5",children:[(0,t.jsxs)("span",{className:"text-sm text-ink",children:["Running for ",(0,t.jsx)("strong",{children:w.collection||"all requests"})," at"]}),(0,t.jsx)("code",{className:"font-mono text-sm text-accent",children:w.url}),(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-mute hover:text-ink",onClick:()=>{navigator.clipboard.writeText(w.url??""),e("Address copied","success")},children:[(0,t.jsx)(a.Copy,{size:12})," Copy"]}),(0,t.jsx)("button",{type:"button",disabled:N,className:"btn btn-secondary ml-auto py-1 text-xs",onClick:()=>void T(),children:"Stop"})]}):(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("label",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Collection or folder"}),(0,t.jsx)(o.Select,{label:"Collection to mock",value:f,onChange:b,options:[{value:m,label:"All saved requests"},...E.map(e=>({value:e,label:e}))],minWidth:260,className:"input text-left text-sm"})]}),(0,t.jsxs)("label",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Port"}),(0,t.jsx)("input",{value:y,onChange:e=>g(e.target.value.replace(/\D/g,"").slice(0,5)),inputMode:"numeric","aria-label":"Port",className:"input w-24 font-mono text-sm"})]}),(0,t.jsx)("button",{type:"button",disabled:N||!y,className:"btn btn-primary text-sm",onClick:()=>void A(),children:"Start"})]}),k?(0,t.jsx)("p",{role:"alert",className:"text-sm text-bad",children:k}):null,P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Point your app at it — or set ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{baseUrl}}"})," to it in an environment. A path value like ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{id}}"})," in a saved request matches anything, and can be used in the example's body. It keeps running until you stop it or close the app. Only this computer can reach it."]}),(0,t.jsxs)("section",{"aria-label":"Requests it answers",children:[(0,t.jsxs)("h3",{className:"mb-1.5 text-xs font-medium text-mute",children:["Answers ",w.routes.length," request",1===w.routes.length?"":"s",I?(0,t.jsxs)("span",{className:"text-warn",children:[" · ",I," without an example yet (they answer 501)"]}):null]}),(0,t.jsx)("div",{className:"max-h-64 overflow-auto rounded-md border border-line",children:(0,t.jsx)("table",{className:"w-full text-left text-[13px]",children:(0,t.jsx)("tbody",{children:w.routes.map(e=>(0,t.jsxs)("tr",{className:"border-t border-line first:border-t-0",children:[(0,t.jsx)("td",{className:"w-16 px-3 py-1.5 font-mono text-xs text-accent",children:e.method}),(0,t.jsx)("td",{className:"px-3 py-1.5 font-mono break-all text-ink",children:e.path}),(0,t.jsx)("td",{className:"px-3 py-1.5 text-xs text-mute",children:e.name}),(0,t.jsx)("td",{className:`px-3 py-1.5 text-xs ${e.hasExample?"text-ok":"text-warn"}`,children:e.hasExample?"example":"no example"})]},e.id))})})})]}),(0,t.jsxs)("section",{"aria-label":"Recent calls",children:[(0,t.jsx)("h3",{className:"mb-1.5 text-xs font-medium text-mute",children:"Recent calls"}),w.hits.length?(0,t.jsx)("ul",{className:"max-h-48 space-y-0.5 overflow-auto font-mono text-xs",children:w.hits.slice(0,30).map((e,s)=>(0,t.jsxs)("li",{className:"flex gap-3",children:[(0,t.jsx)("span",{className:"text-mute",children:new Date(e.at).toLocaleTimeString()}),(0,t.jsx)("span",{className:e.status<400?"text-ok":"text-warn",children:e.status}),(0,t.jsxs)("span",{className:"text-ink",children:[e.method," ",e.path]}),e.route?(0,t.jsxs)("span",{className:"text-mute",children:["→ ",e.route]}):null]},s))}):(0,t.jsx)("p",{className:"text-xs text-mute",children:"None yet."})]})]}):(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Each request answers with its ",(0,t.jsx)("strong",{className:"text-ink",children:"example"}),": send it once and choose ",(0,t.jsx)("strong",{className:"text-ink",children:"Save as example"})," on the answer, or write one on its Example tab. Requests imported from OpenAPI already have one."]})]})]})})},"openMock",0,p],74749);let x="rounded-md border border-line bg-panel-2 px-2 py-1 text-[13px] text-ink outline-none focus:border-accent";e.s(["ExamplePanel",0,function({draft:e,onChange:a,last:r,collection:i}){let o=e.mock,l=t=>a({...e,mock:t}),c=r&&r.status?(0,s.exampleFromResponse)(r.status,r.headers,r.body):null;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["What the ",(0,t.jsx)("strong",{className:"text-ink",children:"mock server"})," answers for this request. ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{id}}"})," in the path matches any value, and ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{id}}"})," or"," ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{$uuid}}"})," in the body is filled in."]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",disabled:!c,title:c?void 0:"Send the request first",className:"btn btn-secondary py-1 text-xs",onClick:()=>c&&l(c),children:["Use the last answer",c?` (${c.status})`:""]}),o?(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>l(null),children:"Remove the example"}):(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>l({status:200,headers:[["Content-Type","application/json"]],body:"{\n \n}",delayMs:0}),children:"Write one"}),(0,t.jsxs)("button",{type:"button",className:"ml-auto inline-flex items-center gap-1 text-xs text-accent hover:underline",onClick:()=>p(i??void 0),children:[(0,t.jsx)(n.Server,{size:12,"aria-hidden":!0})," Mock server"]})]}),o?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-mute",children:["Status",(0,t.jsx)("input",{"aria-label":"Example status",inputMode:"numeric",value:o.status,onChange:e=>{let t=Number(e.target.value.replace(/\D/g,"").slice(0,3));l({...o,status:t>=100&&t<=599?t:o.status})},className:`${x} w-16 font-mono`})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-mute",children:["Wait",(0,t.jsx)("input",{"aria-label":"Delay in milliseconds",inputMode:"numeric",value:o.delayMs,onChange:e=>l({...o,delayMs:Math.min(3e4,Number(e.target.value.replace(/\D/g,""))||0)}),className:`${x} w-20 font-mono`}),"ms before answering"]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Headers, one per line"}),(0,t.jsx)("textarea",{"aria-label":"Example headers",value:o.headers.map(([e,t])=>`${e}: ${t}`).join("\n"),onChange:e=>l({...o,headers:e.target.value.split("\n").flatMap(e=>{let t=e.indexOf(":");return t>0?[[e.slice(0,t).trim(),e.slice(t+1).trim()]]:e.trim()?[[e.trim(),""]]:[]})}),rows:Math.min(6,Math.max(2,o.headers.length+1)),spellCheck:!1,placeholder:"Content-Type: application/json",className:`${x} w-full resize-y font-mono text-xs`})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Body"}),(0,t.jsx)("textarea",{"aria-label":"Example body",value:o.body,onChange:e=>l({...o,body:e.target.value}),rows:Math.min(18,Math.max(5,o.body.split("\n").length+1)),spellCheck:!1,className:`${x} w-full resize-y font-mono text-xs leading-5`})]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Save the request to keep the example — the mock server uses the saved one."})]}):(0,t.jsx)("p",{className:"rounded-md border border-dashed border-line px-3 py-3 text-sm text-mute",children:"No example yet. The mock server answers this request with 501 until it has one."})]})}],90176)},58888,21206,13318,e=>{"use strict";var t=e.i(14368);function s(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}e.i(24856);var n=e.i(67938);let a=(0,e.i(99522).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var r=e.i(87283),i=e.i(99181),o=e.i(59100);function l(e,t,s=0){return{ok:!1,status:s,statusText:"",headers:{},body:"",truncated:!1,durationMs:0,url:e,error:t}}async function c(e){let t=await e.text();try{return{json:JSON.parse(t),text:t}}catch{return{json:null,text:t}}}function d(e){return e.slice(0,180).replace(/\s+/g," ").trim()}async function u(e,t,s={}){let n=e.request.url;try{let a=await fetch("/engine/probe",{method:"POST",headers:{"content-type":"application/json",...s.onStep?{accept:"application/x-ndjson"}:{}},body:JSON.stringify({request:e.request,auth:e.auth,options:e.options,setup:e.setup,data:e.data,save:e.save,scripts:e.scripts,live:!0,...e.contract?{contract:e.contract}:{},...t?{keepFor:t}:{}}),signal:s.signal});if(s.onStep&&a.ok&&a.body&&(a.headers.get("content-type")??"").includes("ndjson")){let e=a.body.getReader(),t=new TextDecoder,r="",i=null,o=null;for(;;){let n,{value:a,done:l}=await e.read();if(l)break;for(r+=t.decode(a,{stream:!0});(n=r.indexOf("\n"))>=0;){let e=r.slice(0,n).trim();if(r=r.slice(n+1),!e)continue;let t=JSON.parse(e);t.step&&s.onStep(t.step),t.result&&(i=t.result),t.error&&(o=t.error)}}return i??l(n,o??"The engine stopped before answering")}let{json:r,text:i}=await c(a);if(!r){let e=d(i);return l(n,e?`Engine error (${a.status}): ${e}`:`Engine error (${a.status}). Is it running?`,a.status)}if(!a.ok)return l(n,"string"==typeof r.error?r.error:"Request failed",a.status);return r}catch(e){if(s.signal?.aborted)return l(n,"Cancelled — the request was stopped");return l(n,e instanceof Error?e.message:"Engine unreachable")}}async function h(e){let t,s=`name=${encodeURIComponent(e.name)}${e.type?`&type=${encodeURIComponent(e.type)}`:""}`;try{t=await fetch(`/engine/files?${s}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:e})}catch{throw Error("The engine isn't reachable — is the app running?")}let{json:n}=await c(t);if(!t.ok||!n?.id)throw Error(n?.error??`Could not keep the file (${t.status})`);return n}async function p(e){let t=await fetch("/engine/runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),{json:s,text:n}=await c(t);if(!s)throw Error(d(n)||"Failed to start load");if(!t.ok)throw Error("string"==typeof s.error?s.error:"Failed to start load");return s}async function m(e){try{let t=await fetch(`/engine/runs/${e}`,{cache:"no-store"});if(!t.ok)return null;return await t.json()}catch{return null}}async function x(e){try{let t=await fetch(`/engine/runs/${e}/stop`,{method:"POST"});if(!t.ok)return null;return await t.json()}catch{return null}}let f=new Set(["completed","failed","cancelled","interrupted"]);function b(e){let[t,s]=(0,i.useState)(!1),[n,a]=(0,i.useState)(null);return{busy:t,error:n,upload:async function(t){if(t){s(!0),a(null);try{e(await h(t))}catch(e){a(e instanceof Error?e.message:"Could not keep the file")}finally{s(!1)}}}}}function y({file:e,onFile:a,label:r}){let o=(0,i.useRef)(null),{busy:l,error:c,upload:d}=b(a);return(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-2.5 py-1",children:[(0,t.jsx)("input",{ref:o,type:"file",className:"hidden","aria-label":r,onChange:e=>void d(e.target.files?.[0]).finally(()=>e.target.value="")}),(0,t.jsxs)("button",{type:"button",onClick:()=>o.current?.click(),disabled:l,title:e?"Choose another file":void 0,"aria-label":e&&!l?"Choose another file":void 0,className:"btn btn-secondary shrink-0 gap-1 px-2 py-0.5 text-xs",children:[(0,t.jsx)(n.FileUp,{size:13,"aria-hidden":!0})," ",l?"Adding…":e?null:"Choose file"]}),e?(0,t.jsxs)("span",{className:"min-w-0 truncate font-mono text-[13px] text-ink",title:`${e.name} \xb7 ${s(e.size)} \xb7 ${e.contentType}`,children:[e.name," ",(0,t.jsxs)("span",{className:"text-mute",children:["· ",s(e.size)]})]}):c?(0,t.jsx)("span",{role:"alert",className:"min-w-0 truncate text-xs text-bad",title:c,children:c}):(0,t.jsx)("span",{className:"text-xs text-mute",children:"No file chosen"})]})}e.s(["fetchRun",0,m,"hostOf",0,function(e){try{return new URL(e).host}catch{return e}},"isSuccess",0,function(e){return!!(e&&e.ok&&e.status>=200&&e.status<300)},"isTerminalStatus",0,function(e){return f.has(e)},"needsLoadConfirm",0,function(e,t,s){if(function(e){try{let t=new URL(e).hostname.toLowerCase();return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||"::1"===t||t.endsWith(".localhost")}catch{return!1}}(s))return!1;if("stress"===e||"spike"===e||"soak"===e||"breakpoint"===e)return!0;let n=(0,o.isArrivalRate)(t.executor)?t.rate??Math.max(0,...t.stages.map(e=>e.target)):null;return null!=n?n>=50:((0,o.isArrivalRate)(t.executor)?t.maxVUs??t.vus:t.stages.length>0?Math.max(t.vus,...t.stages.map(e=>e.target)):t.vus)>=25},"sendRequest",0,u,"startLoadRun",0,p,"stopLoadRun",0,x,"uploadFile",0,h],21206),e.s(["FileBodyEditor",0,function({file:e,contentType:n,onChange:r}){var o;let l=(0,i.useRef)(null),[c,d]=(0,i.useState)(!1),{busy:u,error:h,upload:p}=b(e=>r({bodyFile:e,bodyFileType:""}));return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("input",{ref:l,type:"file",className:"hidden","aria-label":"File to send",onChange:e=>void p(e.target.files?.[0]).finally(()=>e.target.value="")}),(0,t.jsxs)("button",{type:"button",onClick:()=>l.current?.click(),onDragOver:e=>{e.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:function(e){e.preventDefault(),d(!1),p(e.dataTransfer.files?.[0])},disabled:u,className:`flex w-full items-center gap-3 rounded-md border border-dashed px-4 py-5 text-left transition-colors ${c?"border-accent bg-accent/5":"border-line hover:border-accent/60"}`,children:[(0,t.jsx)(a,{size:18,className:"shrink-0 text-mute","aria-hidden":!0}),u?(0,t.jsx)("span",{className:"text-sm text-mute",children:"Adding the file…"}):e?(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-[13px] text-ink",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:[s(e.size)," · click or drop another file to change it"]})]}):(0,t.jsx)("span",{className:"text-sm text-mute",children:"Drop a file here, or click to choose one (up to 50 MB)"})]}),h?(0,t.jsx)("p",{role:"alert",className:"text-xs text-bad",children:h}):null,e?(0,t.jsxs)("label",{className:"block max-w-sm",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Content type"}),(0,t.jsx)("input",{value:n,placeholder:e.contentType||(o=e.name,({json:"application/json",xml:"application/xml",pdf:"application/pdf",zip:"application/zip",gz:"application/gzip",csv:"text/csv",txt:"text/plain",html:"text/html",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})[/\.([a-z0-9]+)$/i.exec(o)?.[1]?.toLowerCase()??""]??"application/octet-stream"),onChange:e=>r({bodyFileType:e.target.value}),className:"input font-mono text-[13px]"})]}):null,(0,t.jsx)("p",{className:"text-xs text-mute",children:"The file's bytes are the whole body, as they are — for an image, a PDF or a ZIP an API takes directly. The file is copied into the app's data folder."})]})},"FormBodyEditor",0,function({rows:e,onChange:s,files:n}){let a=[...e,{key:"",value:"",kind:"text",file:null}],i=n?"grid-cols-[minmax(0,2fr)_5.5rem_minmax(0,3fr)_2rem]":"grid-cols-[minmax(0,2fr)_minmax(0,3fr)_2rem]";function o(e,t){let n=a.map((s,n)=>n===e?{...s,...t}:s);s(n.filter((e,t)=>t<n.length-1||e.key||e.value||e.file||"file"===e.kind))}return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"overflow-hidden rounded-md border border-line",children:[(0,t.jsxs)("div",{className:`grid ${i} bg-panel-2 text-xs text-mute`,children:[(0,t.jsx)("span",{className:"px-2.5 py-1.5",children:"Field"}),n?(0,t.jsx)("span",{className:"border-l border-line px-2.5 py-1.5",children:"Type"}):null,(0,t.jsx)("span",{className:"border-l border-line px-2.5 py-1.5",children:"Value"}),(0,t.jsx)("span",{})]}),a.map((l,c)=>{let d=c===a.length-1,u=n&&"file"===l.kind;return(0,t.jsxs)("div",{className:`group grid ${i} border-t border-line`,children:[(0,t.jsx)("input",{value:l.key,"aria-label":`Form field ${c+1} name`,placeholder:d?"Add field":"",onChange:e=>o(c,{key:e.target.value}),className:"min-w-0 bg-transparent px-2.5 py-1.5 font-mono text-[13px] text-ink outline-none placeholder:text-mute focus:bg-panel-2"}),n?(0,t.jsxs)("select",{value:l.kind,"aria-label":`Form field ${c+1} type`,onChange:e=>o(c,{kind:"file"===e.target.value?"file":"text"}),className:"min-w-0 border-l border-line bg-transparent px-1.5 text-[13px] text-ink outline-none focus:bg-panel-2",children:[(0,t.jsx)("option",{value:"text",children:"Text"}),(0,t.jsx)("option",{value:"file",children:"File"})]}):null,(0,t.jsx)("div",{className:"min-w-0 border-l border-line",children:u?(0,t.jsx)(y,{file:l.file,label:`Form field ${c+1} file`,onFile:e=>o(c,{file:e,key:l.key||"file"})}):(0,t.jsx)("input",{value:l.value,"aria-label":`Form field ${c+1} value`,onChange:e=>o(c,{value:e.target.value}),className:"w-full min-w-0 bg-transparent px-2.5 py-1.5 font-mono text-[13px] text-ink outline-none focus:bg-panel-2"})}),d?(0,t.jsx)("span",{}):(0,t.jsx)("button",{type:"button","aria-label":`Remove form field ${l.key||c+1}`,onClick:()=>s(e.filter((e,t)=>t!==c)),className:"grid place-items-center text-mute opacity-60 group-hover:opacity-100 hover:text-bad focus:opacity-100",children:(0,t.jsx)(r.X,{size:14})})]},c)})]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:n?"Sent as multipart/form-data, the way a web page uploads files. Chosen files are copied into the app's data folder, so the request keeps working after you move or delete the original.":"Sent as application/x-www-form-urlencoded (name=value&…), like a plain web form."})]})}],58888),e.s(["Tabs",0,function({id:e,items:s,value:n,onChange:a,label:r,trailing:o,className:l=""}){let c=(0,i.useRef)([]);return(0,t.jsxs)("div",{className:`flex items-end gap-2 border-b border-line ${l}`,children:[(0,t.jsx)("div",{role:"tablist","aria-label":r,className:"-mb-px flex min-w-0 flex-1 flex-wrap gap-x-1",children:s.map((r,i)=>{let o=r.id===n;return(0,t.jsxs)("button",{ref:e=>{c.current[i]=e},id:`${e}-tab-${r.id}`,type:"button",role:"tab","aria-selected":o,"aria-controls":`${e}-panel-${r.id}`,tabIndex:o?0:-1,onClick:()=>a(r.id),onKeyDown:e=>{let t;return t=-1,void("ArrowRight"===e.key&&(t=(i+1)%s.length),"ArrowLeft"===e.key&&(t=(i-1+s.length)%s.length),"Home"===e.key&&(t=0),"End"===e.key&&(t=s.length-1),!(t<0)&&(e.preventDefault(),a(s[t].id),c.current[t]?.focus()))},className:`flex shrink-0 items-center gap-1.5 border-b-2 px-2 py-2 text-sm transition-colors ${o?"border-accent text-ink":"border-transparent text-mute hover:text-ink"}`,children:[r.label,null!=r.badge&&!1!==r.badge?(0,t.jsx)("span",{className:"rounded bg-panel-2 px-1.5 font-mono text-xs text-mute",children:r.badge}):null]},r.id)})}),o?(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2 pb-1.5",children:o}):null]})},"tabPanelProps",0,function(e,t){return{role:"tabpanel",id:`${e}-panel-${t}`,"aria-labelledby":`${e}-tab-${t}`}}],13318)},53110,18043,28202,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(90870),n=e.i(27813),a=e.i(88293),r=e.i(99181);e.s(["GraphqlEditor",0,function({draft:e,patch:i,introspect:o}){let[l,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(!1),[h,p]=(0,r.useState)(null),[m,x]=(0,r.useState)(""),f=(0,r.useMemo)(()=>{if(!e.graphqlVariables.trim())return null;try{let t=JSON.parse(e.graphqlVariables);return t&&"object"==typeof t&&!Array.isArray(t)?null:"Variables must be a JSON object"}catch(e){return e instanceof Error?e.message:"Not valid JSON"}},[e.graphqlVariables]);async function b(){if(o){u(!0),p(null);try{let e=await o();if(!e)return;if(e.error||0===e.status)throw Error(e.error??"No answer");c((0,s.readSchema)(JSON.parse(e.body)))}catch(e){p(e instanceof Error?e.message.replace(/^Unexpected token.*/,"The answer wasn't JSON — check the URL"):String(e))}finally{u(!1)}}}let y=(l?.operations??[]).filter(e=>!m||e.name.toLowerCase().includes(m.toLowerCase()));return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("aside",{className:"space-y-2 rounded-md border border-line p-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-ink",children:"Schema"}),o?(0,t.jsxs)("button",{type:"button",className:"text-xs text-accent hover:underline disabled:opacity-50",disabled:d,onClick:()=>void b(),children:[d?(0,t.jsx)(n.Loader2,{size:12,className:"inline animate-spin"}):null," ",l?"Reload":"Load schema"]}):null]}),h?(0,t.jsx)("p",{className:"text-xs text-bad",children:h}):null,l||h?null:(0,t.jsx)("p",{className:"text-xs text-mute",children:"Asks the server which queries and mutations it has (introspection) — click one to start from it."}),l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"relative block",children:[(0,t.jsx)(a.Search,{size:12,className:"pointer-events-none absolute top-1/2 left-2 -translate-y-1/2 text-mute","aria-hidden":!0}),(0,t.jsx)("input",{value:m,onChange:e=>x(e.target.value),placeholder:"Find",className:"input py-1 pl-6 text-xs","aria-label":"Find an operation"})]}),(0,t.jsxs)("ul",{className:"max-h-56 space-y-0.5 overflow-auto",children:[y.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>(e=>{if(!l)return;let t=(0,s.operationTemplate)(l,e);i({graphqlQuery:t.query,graphqlVariables:t.variables,graphqlOperation:t.operationName,method:"POST"})})(e),title:e.description||`${e.kind} ${e.name}`,className:"w-full rounded px-1.5 py-1 text-left hover:bg-panel-2",children:[(0,t.jsx)("span",{className:`mr-1 font-mono text-[10px] uppercase ${"mutation"===e.kind?"text-warn":"text-ok"}`,children:"mutation"===e.kind?"mut":"qry"}),(0,t.jsx)("span",{className:"font-mono text-xs text-ink",children:e.name}),(0,t.jsxs)("span",{className:"block truncate font-mono text-[11px] text-mute",children:["(",e.args.map(e=>`${e.name}: ${e.type}`).join(", "),"): ",e.returns]})]})},`${e.kind}:${e.name}`)),y.length?null:(0,t.jsx)("li",{className:"px-1.5 text-xs text-mute",children:"Nothing matches."})]})]}):null]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Query"}),(0,t.jsx)("textarea",{value:e.graphqlQuery,"aria-label":"GraphQL query",spellCheck:!1,onChange:e=>i({graphqlQuery:e.target.value}),rows:11,placeholder:"query Orders($first: Int) {\n orders(first: $first) {\n id\n total\n }\n}",className:"input font-mono text-[13px] leading-5"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Variables (JSON)"}),(0,t.jsx)("textarea",{value:e.graphqlVariables,"aria-label":"GraphQL variables",spellCheck:!1,onChange:e=>i({graphqlVariables:e.target.value}),rows:4,placeholder:'{ "first": 10 }',className:`input font-mono text-[13px] ${f?"border-bad":""}`}),f?(0,t.jsx)("span",{className:"mt-1 block text-xs text-bad",children:f}):(0,t.jsx)("span",{className:"mt-1 block text-xs text-mute",children:"{{variables}} work here and in the query; quote ones from test data."})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Operation name (optional)"}),(0,t.jsx)("input",{value:e.graphqlOperation,onChange:e=>i({graphqlOperation:e.target.value}),className:"input font-mono",placeholder:"Orders"})]})]}),(0,t.jsxs)("label",{className:"flex items-start gap-2 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.graphqlErrorsFail,onChange:e=>i({graphqlErrorsFail:e.target.checked}),className:"mt-1 accent-[var(--accent)]"}),(0,t.jsxs)("span",{children:["Count GraphQL errors as failures",(0,t.jsx)("span",{className:"block text-xs text-mute",children:'GraphQL servers usually answer 200 even when the query failed, with an "errors" list. On, such an answer fails — on Send, in runs and in load reports.'})]})]}),"POST"!==e.method?(0,t.jsx)("p",{className:"text-xs text-warn",children:"GraphQL is sent as POST — switch the method to POST."}):null]})]})}],53110);var i=e.i(78451),o=e.i(99112),l=e.i(67938),c=e.i(71189),d=e.i(87283),u=e.i(28867),h=e.i(6278);let p=[{value:"json",label:"JSON field",placeholder:"data.access_token",hint:"Path in the JSON answer, like data.items[0].id"},{value:"header",label:"Header",placeholder:"X-Request-Id",hint:"A response header name"},{value:"body",label:"Text pattern",placeholder:"token=(\\w+)",hint:"A regular expression; the part in ( ) is kept"}];function m({rules:e,onChange:s,results:n,showUnused:a}){let r=(t,n)=>s(e.map((e,s)=>s===t?{...e,...n}:e));return(0,t.jsx)("ul",{className:"space-y-2",children:e.map((i,o)=>{let l=p.find(e=>e.value===i.from),c=n.get(i.name);return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-2 rounded-md border border-line bg-panel px-2.5 py-2",children:[(0,t.jsx)("span",{className:"text-xs text-mute",children:"Save"}),(0,t.jsx)("select",{value:i.from,onChange:e=>r(o,{from:e.target.value}),className:"input w-auto py-1","aria-label":"Where the value is",children:p.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)("input",{value:i.path,onChange:e=>r(o,{path:e.target.value}),placeholder:l.placeholder,title:l.hint,"aria-label":l.hint,className:"input min-w-40 flex-1 py-1 font-mono text-xs"}),(0,t.jsx)("span",{className:"text-xs text-mute",children:"as"}),(0,t.jsxs)("span",{className:"inline-flex items-center font-mono text-xs text-mute",children:["{{",(0,t.jsx)("input",{value:i.name,onChange:e=>r(o,{name:e.target.value.replace(/[^\w.-]/g,"")}),"aria-label":"Variable name",className:"input mx-0.5 w-28 py-1 font-mono text-xs"}),"}}"]}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-2",children:[c?c.found?(0,t.jsxs)("span",{className:"text-xs text-ok",title:"Found on the last Send",children:["✓ ",c.preview]}):(0,t.jsx)("span",{className:"text-xs text-bad",title:"Not found on the last Send",children:"✕ not found"}):a&&!a.has(i.name)&&i.name?(0,t.jsx)("span",{className:"text-xs text-warn",children:"not used yet"}):null,(0,t.jsx)("button",{type:"button",onClick:()=>s(e.filter((e,t)=>t!==o)),className:"rounded p-1 text-mute hover:text-bad","aria-label":`Remove {{${i.name}}}`,children:(0,t.jsx)(d.X,{size:14})})]})]},o)})})}function x(e){let t=[e.url,e.bodyText,e.token,e.username,e.password,e.apiName,e.apiValue,...e.params.flatMap(e=>[e.key,e.value]),...e.headers.map(e=>e.value)].join("\n");return new Set((0,i.findVariables)(t))}function f({name:e,used:s}){return(0,t.jsx)("code",{className:`rounded px-1.5 py-0.5 font-mono text-xs ${!1===s?"bg-warn/10 text-warn":"bg-accent-dim text-accent"}`,title:!1===s?"Not used in this request yet":void 0,children:`{{${e}}}`})}let b=[{value:"sequential",label:"In order",title:"Request 1 uses row 1, request 2 uses row 2… then starts again"},{value:"random",label:"Random",title:"Each request picks a random row"},{value:"per-user",label:"One row per user",title:"Each simulated user keeps its own row — good for logins"}];e.s(["RunFirstPanel",0,function({draft:e,onChange:s,currentId:n,result:a}){let{index:r}=(0,h.useWorkspace)(),i=(r?.requests??[]).filter(e=>e.id!==n),o=e.before,l=x(e),d=t=>s({...e,before:t}),u=o?.extract??[],p=new Map((a?.values??[]).map(e=>[e.name,e]));return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["Send another saved request first — like signing in — and use values from its answer here. A sign-in token becomes"," ",(0,t.jsx)(f,{name:"token"}),", which you can put in Auth, a header, the URL, or the body."]}),(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-ink",children:"First, send"}),(0,t.jsxs)("select",{value:o?.requestId??"",onChange:e=>(e=>{if(!e)return d(null);let t=i.find(t=>t.id===e);t&&d({requestId:t.id,requestName:t.name,extract:u.length?u:[{name:"token",from:"json",path:""}]})})(e.target.value),className:"input w-auto min-w-56 py-1","aria-label":"Saved request to send first",children:[(0,t.jsx)("option",{value:"",children:"Nothing — send this request on its own"}),i.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.collection?`${e.collection} / `:"",e.name," · ",e.method]},e.id))]}),o&&!i.some(e=>e.id===o.requestId)?(0,t.jsxs)("span",{className:"text-xs text-bad",children:["“",o.requestName,"” is no longer saved — pick another"]}):null]}),i.length?null:(0,t.jsxs)("p",{className:"rounded-md border border-dashed border-line px-3 py-2 text-xs text-mute",children:["No other saved requests yet. Open your sign-in request, press ",(0,t.jsx)("kbd",{className:"kbd",children:"Ctrl"})," + ",(0,t.jsx)("kbd",{className:"kbd",children:"S"})," to save it, then pick it here."]}),o?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-mute",children:"Values to take from its answer"}),(0,t.jsx)(m,{rules:u,onChange:e=>d({...o,extract:e}),results:p,showUnused:l}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>d({...o,extract:[...u,{name:`value${u.length+1}`,from:"json",path:""}]}),className:"inline-flex items-center gap-1 rounded-md border border-line px-2.5 py-1 text-xs text-ink hover:border-accent",children:[(0,t.jsx)(c.Plus,{size:13,"aria-hidden":!0})," Add a value"]}),u.some(e=>"token"===e.name)&&("none"===e.authMode||"inherit"===e.authMode)?(0,t.jsxs)("button",{type:"button",onClick:()=>s({...e,authMode:"bearer",token:"{{token}}"}),className:"inline-flex items-center gap-1 rounded-md border border-accent/40 px-2.5 py-1 text-xs text-accent hover:bg-accent-dim",children:["Use ","{{token}}"," as the Bearer token"]}):null]}),a&&!a.ok&&a.error?(0,t.jsx)("p",{className:"text-xs text-bad",children:a.error}):null,(0,t.jsx)("p",{className:"text-xs text-mute",children:"Send runs it every time. A performance test runs it once before starting, and every request uses the same values."})]}):null]})},"SaveValuesPanel",0,function({draft:e,onChange:s,results:n}){let a=e.saveValues,r=t=>s({...e,saveValues:t}),i=new Map((n??[]).map(e=>[e.name,e]));return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["Take values from this answer for the requests after it — like the id of a new order, used by “Get order” as ",(0,t.jsx)(f,{name:"orderId"}),"."]}),a.length?(0,t.jsx)(m,{rules:a,onChange:r,results:i}):null,(0,t.jsxs)("button",{type:"button",onClick:()=>r([...a,{name:a.length?`value${a.length+1}`:"id",from:"json",path:a.length?"":"id"}]),className:"inline-flex items-center gap-1 rounded-md border border-line px-2.5 py-1 text-xs text-ink hover:border-accent",children:[(0,t.jsx)(c.Plus,{size:13,"aria-hidden":!0})," Add a value"]}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-xs text-mute",children:[(0,t.jsxs)("li",{children:["In ",(0,t.jsx)("span",{className:"text-ink",children:"Run collection"}),", every request after this one can use them. Put this request first in the run order."]}),(0,t.jsx)("li",{children:"After a Send, they stay until you close the app, so the next request you send can use them too."}),(0,t.jsx)("li",{children:"A performance test does not save values; it uses the ones saved by your last Send."})]})]})},"TestDataPanel",0,function({draft:e,onChange:s}){let n=(0,r.useRef)(null),[a,i]=(0,r.useState)([]),[c,d]=(0,r.useState)(null),h=e.testData,p=x(e),m=t=>s({...e,testData:t});async function y(t){if(d(null),i([]),t.size>5242880)return d(`${t.name} is ${(t.size/1024/1024).toFixed(1)} MB — the limit is 5 MB`);let s=(0,o.parseCsv)(await t.text());if(!s.columns.length)return d(`${t.name} is empty`);if(!s.rows.length)return d(`${t.name} has a header row but no data rows`);if(s.rows.length>1e5)return d(`${t.name} has ${s.rows.length.toLocaleString()} rows — the limit is 100,000`);let n=s.columns.find(t=>e.before?.extract.some(e=>e.name===t));if(n)return d(`The column “${n}” has the same name as a Run-first value — rename one of them`);i(s.problems),m({fileName:t.name,columns:s.columns,rows:s.rows,order:h?.order??"sequential"})}return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["Test with many users, IDs, or search terms. Each column in a CSV file becomes a variable such as ",(0,t.jsx)(f,{name:"email"}),", and each request uses the next row."]}),(0,t.jsx)("input",{ref:n,type:"file",accept:".csv,text/csv,text/plain",className:"sr-only","aria-label":"Choose a CSV file",onChange:e=>{let t=e.target.files?.[0];e.target.value="",t&&y(t)}}),h?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"font-medium text-ink",children:h.fileName}),(0,t.jsxs)("span",{className:"text-mute",children:["· ",h.rows.length.toLocaleString()," rows"]}),(0,t.jsxs)("span",{className:"ml-auto flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>n.current?.click(),className:"rounded-md border border-line px-2.5 py-1 text-xs text-ink hover:border-accent",children:"Replace"}),(0,t.jsx)("button",{type:"button",onClick:()=>m(null),className:"rounded-md border border-line px-2.5 py-1 text-xs text-ink hover:border-bad hover:text-bad",children:"Remove"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 text-xs text-mute",children:["Variables:",h.columns.map(e=>(0,t.jsx)(f,{name:e,used:p.has(e)},e))]}),h.columns.some(e=>!p.has(e))?(0,t.jsx)("p",{className:"text-xs text-warn",children:"Highlighted columns are not used in this request yet — type them into the URL, params, headers, or body."}):null,(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-mute",children:"Which row each request uses"}),(0,t.jsx)(u.Segmented,{label:"Row order",value:h.order,options:b,onChange:e=>m({...h,order:e})})]}),(0,t.jsx)("div",{className:"overflow-x-auto rounded-md border border-line",children:(0,t.jsxs)("table",{className:"w-full text-left font-mono text-xs",children:[(0,t.jsxs)("caption",{className:"sr-only",children:["First rows of ",h.fileName]}),(0,t.jsx)("thead",{className:"bg-panel-2 text-mute",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{scope:"col",className:"px-2 py-1 font-normal",children:"#"}),h.columns.map(e=>(0,t.jsx)("th",{scope:"col",className:"px-2 py-1 font-normal",children:e},e))]})}),(0,t.jsx)("tbody",{children:h.rows.slice(0,5).map((e,s)=>(0,t.jsxs)("tr",{className:"border-t border-line",children:[(0,t.jsx)("td",{className:"px-2 py-1 text-mute",children:s+1}),e.map((e,s)=>(0,t.jsx)("td",{className:"max-w-48 truncate px-2 py-1 text-ink",title:e,children:e},s))]},s))})]})}),h.rows.length>5?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Showing 5 of ",h.rows.length.toLocaleString()," rows. Send uses row 1."]}):(0,t.jsx)("p",{className:"text-xs text-mute",children:"Send uses row 1."})]}):(0,t.jsxs)("button",{type:"button",onClick:()=>n.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault();let t=e.dataTransfer.files[0];t&&y(t)},className:"flex w-full flex-col items-center gap-1 rounded-lg border border-dashed border-line px-4 py-6 text-sm text-mute hover:border-accent hover:text-ink",children:[(0,t.jsx)(l.FileUp,{size:18,"aria-hidden":!0}),(0,t.jsx)("span",{className:"text-ink",children:"Choose a CSV file"}),(0,t.jsx)("span",{className:"text-xs",children:"or drop it here · first row is the column names · up to 5 MB"})]}),c?(0,t.jsx)("p",{className:"text-xs text-bad",children:c}):null,a.length?(0,t.jsx)("ul",{className:"list-disc space-y-0.5 pl-5 text-xs text-warn",children:a.map(e=>(0,t.jsx)("li",{children:e},e))}):null]})}],18043);var y=e.i(70632);let g=(0,e.i(99522).default)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]),w=[{label:"Status",make:()=>({type:"status",expect:"2xx"})},{label:"JSON field",make:()=>({type:"json",path:"",op:"exists",value:""})},{label:"Body text",make:()=>({type:"body",op:"contains",value:""})},{label:"Header",make:()=>({type:"header",name:"content-type",op:"contains",value:"json"})},{label:"Response time",make:()=>({type:"time",maxMs:1e3})},{label:"JSON schema",make:()=>({type:"schema",schema:""})}],v={status:"Status",json:"JSON",body:"Body",header:"Header",time:"Time",schema:"Schema"},k="rounded-md border border-line bg-panel-2 px-2 py-1 text-[13px] text-ink outline-none focus:border-accent";function j({check:e,onChange:s,lastBody:n}){switch(e.type){case"status":return(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-mute",children:["is",(0,t.jsx)("input",{"aria-label":"Expected status",value:e.expect,onChange:t=>s({...e,expect:t.target.value}),placeholder:"2xx",className:`${k} w-32 font-mono`})]});case"time":return(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-mute",children:["within",(0,t.jsx)("input",{"aria-label":"Maximum response time in ms",type:"number",min:1,value:e.maxMs,onChange:t=>s({...e,maxMs:Math.max(1,Number(t.target.value)||1)}),className:`${k} w-24 font-mono`}),"ms"]});case"body":return(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,t.jsxs)("select",{"aria-label":"Body condition",value:e.op,onChange:t=>s({...e,op:t.target.value}),className:k,children:[(0,t.jsx)("option",{value:"contains",children:"contains"}),(0,t.jsx)("option",{value:"not_contains",children:"does not contain"}),(0,t.jsx)("option",{value:"matches",children:"matches pattern"}),(0,t.jsx)("option",{value:"is_json",children:"is valid JSON"})]}),"is_json"!==e.op?(0,t.jsx)("input",{"aria-label":"matches"===e.op?"Pattern":"Text",value:e.value,onChange:t=>s({...e,value:t.target.value}),placeholder:"matches"===e.op?'"id":\\s*\\d+':'"status":"ok"',className:`${k} min-w-0 flex-1 font-mono`}):null]});case"json":return(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:[(0,t.jsx)("input",{"aria-label":"JSON path",value:e.path,onChange:t=>s({...e,path:t.target.value}),placeholder:"data.id",className:`${k} w-40 font-mono`}),(0,t.jsxs)("select",{"aria-label":"JSON condition",value:e.op,onChange:t=>s({...e,op:t.target.value}),className:k,children:[(0,t.jsx)("option",{value:"exists",children:"exists"}),(0,t.jsx)("option",{value:"not_exists",children:"does not exist"}),(0,t.jsx)("option",{value:"equals",children:"equals"}),(0,t.jsx)("option",{value:"not_equals",children:"does not equal"}),(0,t.jsx)("option",{value:"contains",children:"contains"}),(0,t.jsx)("option",{value:"greater",children:"is more than"}),(0,t.jsx)("option",{value:"less",children:"is less than"}),(0,t.jsx)("option",{value:"matches",children:"matches pattern"}),(0,t.jsx)("option",{value:"type",children:"is of type"}),(0,t.jsx)("option",{value:"length",children:"has length"})]}),"type"===e.op?(0,t.jsxs)("select",{"aria-label":"Type",value:e.value,onChange:t=>s({...e,value:t.target.value}),className:k,children:[y.JSON_TYPES.includes(e.value)?null:(0,t.jsx)("option",{value:e.value,children:"choose…"}),y.JSON_TYPES.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}):"exists"!==e.op&&"not_exists"!==e.op?(0,t.jsx)("input",{"aria-label":"matches"===e.op?"Pattern":"length"===e.op?"Length":"Expected value",value:e.value,onChange:t=>s({...e,value:t.target.value}),placeholder:"length"===e.op?">0":"greater"===e.op||"less"===e.op?"0":"matches"===e.op?"^ord_":"ok",inputMode:"greater"===e.op||"less"===e.op?"decimal":void 0,className:`${k} min-w-0 flex-1 font-mono`}):null]});case"header":return(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2",children:[(0,t.jsx)("input",{"aria-label":"Header name",value:e.name,onChange:t=>s({...e,name:t.target.value}),placeholder:"content-type",className:`${k} w-36 font-mono`}),(0,t.jsxs)("select",{"aria-label":"Header condition",value:e.op,onChange:t=>s({...e,op:t.target.value}),className:k,children:[(0,t.jsx)("option",{value:"exists",children:"exists"}),(0,t.jsx)("option",{value:"not_exists",children:"does not exist"}),(0,t.jsx)("option",{value:"equals",children:"equals"}),(0,t.jsx)("option",{value:"contains",children:"contains"}),(0,t.jsx)("option",{value:"matches",children:"matches pattern"})]}),"exists"!==e.op&&"not_exists"!==e.op?(0,t.jsx)("input",{"aria-label":"matches"===e.op?"Pattern":"Expected value",value:e.value,onChange:t=>s({...e,value:t.target.value}),className:`${k} min-w-0 flex-1 font-mono`}):null]});case"schema":return(0,t.jsx)(N,{check:e,onChange:s,lastBody:n})}}function N({check:e,onChange:s,lastBody:n}){let a,r=null;if(e.schema.trim())try{let t=JSON.parse(e.schema);(!t||"object"!=typeof t||Array.isArray(t))&&(r='A schema is a JSON object, like { "type": "object" }')}catch(e){r=`Not valid JSON: ${e instanceof Error?e.message:"parse error"}`}let i=!1;try{n&&(a=JSON.parse(n),i=!0)}catch{i=!1}return(0,t.jsxs)("span",{className:"flex w-full min-w-0 flex-col gap-1.5",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2 text-xs text-mute",children:["The whole body must match this JSON Schema.",(0,t.jsxs)("button",{type:"button",disabled:!i,title:i?"Write a schema that the last response matches; then loosen or tighten it":"Send the request first: the schema is made from a JSON response",onClick:()=>s({...e,schema:JSON.stringify((0,y.schemaFromValue)(a),null,2)}),className:"inline-flex items-center gap-1 rounded-md border border-line px-2 py-0.5 text-ink hover:border-accent disabled:opacity-40",children:[(0,t.jsx)(g,{size:12,"aria-hidden":!0}),"Make it from the last response"]})]}),(0,t.jsx)("textarea",{"aria-label":"JSON Schema",value:e.schema,onChange:t=>s({...e,schema:t.target.value}),spellCheck:!1,rows:Math.min(14,Math.max(4,e.schema.split("\n").length)),placeholder:'{ "type": "object", "required": ["id"], "properties": { "id": { "type": "integer" } } }',className:`${k} w-full resize-y font-mono text-xs leading-relaxed`}),r?(0,t.jsx)("span",{role:"alert",className:"text-xs text-bad",children:r}):null]})}e.s(["ChecksEditor",0,function({checks:e,onChange:s,results:n,lastBody:a}){let r=new Map((n??[]).map(e=>[e.name,e]));return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["Checks decide whether a response is ",(0,t.jsx)("em",{children:"correct"}),", not just fast. A 200 with an error message inside fails a good check."]}),e.length>0?(0,t.jsx)("ul",{className:"space-y-2",children:e.map((n,i)=>{let o=r.get((0,y.checkLabel)(n));return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-2 rounded-md border border-line bg-panel px-2.5 py-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs font-medium text-mute",children:v[n.type]}),(0,t.jsx)(j,{check:n,onChange:t=>s(e.map((e,s)=>s===i?t:e)),lastBody:a}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-2",children:[void 0===o?null:o.ok?(0,t.jsx)("span",{className:"text-xs text-ok",title:"Passed on the last Send",children:"✓ pass"}):(0,t.jsxs)("span",{className:"text-xs text-bad",title:"Failed on the last Send",children:["✕ fail",o.detail?` — ${o.detail}`:""]}),(0,t.jsx)("button",{type:"button","aria-label":`Remove check: ${(0,y.checkLabel)(n)}`,onClick:()=>s(e.filter((e,t)=>t!==i)),className:"rounded p-1 text-mute hover:text-bad",children:(0,t.jsx)(d.X,{size:14})})]})]},i)})}):(0,t.jsx)("p",{className:"rounded-md border border-dashed border-line px-3 py-3 text-sm text-mute",children:"No checks yet. Without checks, a performance test only counts HTTP errors (4xx, 5xx, timeouts)."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-mute",children:"Add"}),w.map(n=>(0,t.jsxs)("button",{type:"button",disabled:e.length>=20,onClick:()=>s([...e,n.make()]),className:"inline-flex items-center gap-1 rounded-md border border-line px-2 py-1 text-xs text-ink hover:border-accent disabled:opacity-40",children:[(0,t.jsx)(c.Plus,{size:12,"aria-hidden":!0}),n.label]},n.label))]}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["JSON paths look like ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"data.items[0].id"}),". Status accepts"," ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"2xx"}),", ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"200,201"}),", or"," ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"200-299"}),". Length takes ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"3"}),","," ",(0,t.jsx)("code",{className:"font-mono text-ink",children:">0"})," or ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"<=10"}),"; patterns are regular expressions."]})]})}],28202)},59674,e=>{"use strict";e.s(["JwtFields",()=>i]);var t=e.i(14368),s=e.i(67938),n=e.i(31753),a=e.i(11052),r=e.i(80707);function i({value:e,onChange:o}){let l=t=>o({...e,...t}),c=e.algorithm.startsWith("HS"),d=function(e){try{let t=JSON.parse(e||"{}");return t&&"object"==typeof t&&!Array.isArray(t)?null:"The claims must be a JSON object"}catch(e){return e instanceof Error?e.message:"Not valid JSON"}}(e.payload);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-end",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Algorithm",(0,t.jsx)(r.Select,{label:"JWT algorithm",value:e.algorithm,onChange:e=>l({algorithm:e}),minWidth:260,options:[{value:"HS256",label:"HS256",hint:"HMAC with a shared secret"},{value:"HS384",label:"HS384",hint:"HMAC with a shared secret"},{value:"HS512",label:"HS512",hint:"HMAC with a shared secret"},{value:"RS256",label:"RS256",hint:"RSA private key"},{value:"RS384",label:"RS384",hint:"RSA private key"},{value:"RS512",label:"RS512",hint:"RSA private key"},{value:"PS256",label:"PS256",hint:"RSA-PSS private key"},{value:"ES256",label:"ES256",hint:"EC private key (P-256)"},{value:"ES384",label:"ES384",hint:"EC private key (P-384)"},{value:"ES512",label:"ES512",hint:"EC private key (P-521)"}],className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 font-mono text-sm text-ink"})]}),c?(0,t.jsx)(n.LabeledInput,{label:"Secret",secret:!0,mono:!0,value:e.secret,placeholder:"or {{jwtSecret}}",onChange:e=>l({secret:e})}):(0,t.jsx)("div",{className:"text-xs text-mute",children:"The private key (PEM) below signs the token; the API checks it with the public key."})]}),c?null:(0,t.jsxs)(a.DropLabel,{className:"group block",onFile:e=>void e.text().then(e=>l({privateKey:e})),children:[(0,t.jsxs)("span",{className:"mb-1 flex items-center justify-between text-xs text-mute",children:["Private key (PEM)",(0,t.jsxs)("span",{className:"relative inline-flex cursor-pointer items-center gap-1 text-accent hover:underline",children:[(0,t.jsx)(s.FileUp,{size:12,"aria-hidden":!0})," Load a .pem file",(0,t.jsx)("input",{type:"file",accept:".pem,.key",className:"absolute inset-0 cursor-pointer opacity-0",onChange:e=>{let t=e.target.files?.[0];t&&t.text().then(e=>l({privateKey:e})),e.target.value=""}})]})]}),(0,t.jsx)("textarea",{value:e.privateKey,onChange:e=>l({privateKey:e.target.value}),rows:4,spellCheck:!1,placeholder:"-----BEGIN PRIVATE KEY-----\n…\n-----END PRIVATE KEY-----",className:"input font-mono text-xs group-data-[over]:border-accent"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Claims (JSON) — iat and exp are added unless you set them"}),(0,t.jsx)("textarea",{value:e.payload,onChange:e=>l({payload:e.target.value}),rows:5,spellCheck:!1,className:`input font-mono text-[13px] ${d?"border-bad":""}`}),(0,t.jsx)("span",{className:`mt-1 block text-xs ${d?"text-bad":"text-mute"}`,children:d??'For example { "sub": "user-1", "aud": "orders-api", "scope": "read" }. {{variables}} work here.'})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1.5fr)_minmax(0,1fr)]",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Valid for (minutes)"}),(0,t.jsx)("input",{type:"number",min:1,value:Math.max(1,Math.round(e.lifetimeSec/60)),onChange:e=>l({lifetimeSec:Math.max(60,60*Math.round(Number(e.target.value)||1))}),className:"input font-mono"})]}),(0,t.jsx)(n.LabeledInput,{label:"Key ID (kid)",mono:!0,value:e.kid,placeholder:"optional",onChange:e=>l({kid:e})}),(0,t.jsx)(n.LabeledInput,{label:"Header",mono:!0,value:e.headerName,onChange:e=>l({headerName:e})}),(0,t.jsx)(n.LabeledInput,{label:"Prefix",mono:!0,value:e.prefix,placeholder:"none",onChange:e=>l({prefix:e})})]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"A fresh token is signed for every Send. In performance tests the app signs the tokens before the test starts and switches to the next before one expires — the key itself never goes to the load generator. The secret and key are kept encrypted on this computer."})]})}},36e3,65238,7149,84575,e=>{"use strict";var t=e.i(14368),s=e.i(29091),n=e.i(87283),a=e.i(99181),r=e.i(68820),i=e.i(14865);e.i(24856);var o=e.i(99112),l=e.i(70746),c=e.i(84201),d=e.i(15487);e.i(42674);var u=e.i(5305),h=e.i(6278);async function p(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}let m=(e,t,s)=>fetch(t,{method:e,headers:void 0===s?void 0:{"content-type":"application/json"},body:void 0===s?void 0:JSON.stringify(s)}),x={get:e=>fetch(`/engine/workspace/folders?path=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>p(e)),chain:(e,t="")=>e||(0,c.leadingVariable)(t)?fetch(`/engine/workspace/folders/chain?collection=${encodeURIComponent(e)}&url=${encodeURIComponent(t)}`,{cache:"no-store"}).then(e=>p(e)):Promise.resolve([]),save:(e,t)=>m("PUT","/engine/workspace/folders",{path:e,settings:t}).then(e=>p(e)),move:(e,t)=>m("POST","/engine/workspace/folders/move",{from:e,to:t}).then(e=>p(e)),remove:e=>m("DELETE",`/engine/workspace/folders?path=${encodeURIComponent(e)}`).then(e=>p(e))};async function f(e,t,s){let n=(0,u.applyFolders)(e,await x.chain(t??"",e.url));return{draft:n.draft,vars:{...n.vars,...s},contract:n.inherited.contract?.id}}function b(e,t=""){let{index:s}=(0,h.useWorkspace)(),[n,r]=(0,a.useState)([]),i=(0,c.leadingVariable)(t)??"";return(0,a.useEffect)(()=>{let t=!0;return x.chain(e??"",i?`{{${i}}}`:"").then(e=>t&&r(e)).catch(()=>t&&r([])),()=>{t=!1}},[e,i,s]),n}e.s(["folderApi",0,x,"useFolderChain",0,b,"useFolderVarNames",0,function(e){let{index:t}=(0,h.useWorkspace)(),s=[...new Set(e.filter(e=>!!e))].sort().join("\n"),[n,r]=(0,a.useState)(new Set);return(0,a.useEffect)(()=>{let e=!0;return Promise.all((s?s.split("\n"):[]).map(e=>x.chain(e).catch(()=>[]))).then(async t=>{let s=t.flat().flatMap(e=>[...e.settings.variables.map(e=>e.key),...(0,d.scriptSetNames)(e.settings.preScript??"")]),n=await fetch("/engine/connections",{cache:"no-store"}).then(e=>e.json()).then(e=>(e.connections??[]).map(e=>e.variable)).catch(()=>[]);e&&r(new Set([...s,...n]))}),()=>{e=!1}},[s,t]),n},"withFolders",0,f],65238);let y={connection:"Connections",folder:"Folder",environment:"Environment",saved:"Saved values",builtin:"Built-in"},g=(0,a.createContext)({});function w(){let{collection:e,url:t}=(0,a.useContext)(g),{activeEnv:s,savedValues:n,vars:r}=(0,h.useWorkspace)(),i=(0,l.useConnections)(),c=b(e,t??"");return(0,a.useMemo)(()=>{let e=[];for(let t of i)e.push({name:t.variable,value:t.baseUrl,source:"connection",from:t.name});for(let t of c)if(!t.connection)for(let s of t.settings.variables)e.push({name:s.key,value:s.value,source:"folder",from:t.path,secret:s.secret});for(let t of s?.variables??[])t.key.trim()&&e.push({name:t.key,value:t.value,source:"environment",from:s.name,secret:t.secret});for(let[t,s]of Object.entries(n))e.push({name:t,value:s.value,source:"saved",from:s.from});for(let[t,s]of Object.entries(r))e.some(e=>e.name===t)||e.push({name:t,value:s,source:"builtin",from:"This app"});for(let t of o.BUILTIN_VALUES)e.push({name:t.name,value:"",source:"builtin",from:"Made when sent",description:t.description});return e},[i,c,s,n,r])}e.s(["SOURCE_LABEL",0,y,"VariableScope",0,function({collection:e,url:s,children:n}){let r=(0,a.useMemo)(()=>({collection:e,url:s}),[e,s]);return(0,t.jsx)(g.Provider,{value:r,children:n})},"useReachableVariables",0,w],7149);let v=/\{\{\s*([\w.$-]*)$/;function k(e,s){let n=w(),[r,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(0),c=(0,a.useId)(),d=r?.query.toLowerCase()??"",u=new Set,h=r?n.filter(e=>!u.has(e.name)&&!!e.name.toLowerCase().includes(d)&&(u.add(e.name),!0)):[];h.sort((e,t)=>Number(!e.name.toLowerCase().startsWith(d))-Number(!t.name.toLowerCase().startsWith(d)));let p=!!r&&h.length>0;function m(){let t=e.current;if(!t||document.activeElement!==t)return i(null);let s=t.selectionStart??t.value.length,n=v.exec(t.value.slice(0,s));if(!n)return i(null);i(e=>{let t={start:s-n[0].length,query:n[1]??""};return e&&e.query===t.query||l(0),t})}function x(t){let n=e.current;if(!n||!r)return;let a=n.selectionStart??n.value.length,o=n.value.slice(a).replace(/^[\w.$-]*\s*\}\}/,""),l=`{{${t.name}}}`;s(`${n.value.slice(0,r.start)}${l}${o}`),i(null);let c=r.start+l.length;requestAnimationFrame(()=>{let t=e.current;if(!t)return;t.focus();let s=t.value.indexOf(l),n=s>=0?s+l.length:c;t.setSelectionRange(n,n)})}return{handlers:{onKeyUp:m,onClick:m,onSelect:m,onBlur:()=>i(null),"aria-autocomplete":"list","aria-controls":p?c:void 0,"aria-activedescendant":p?`${c}-${o}`:void 0},onKeyDown:function(e){return!!p&&("ArrowDown"===e.key||"ArrowUp"===e.key?(e.preventDefault(),l(t=>"ArrowDown"===e.key?Math.min(h.length-1,t+1):Math.max(0,t-1)),!0):"Enter"===e.key||"Tab"===e.key?(e.preventDefault(),x(h[o]),!0):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),i(null),!0))},popup:p?(0,t.jsx)(j,{id:c,anchor:e,items:h,active:o,onHover:l,onPick:x}):null,check:m}}function j({id:e,anchor:s,items:n,active:o,onHover:l,onPick:c}){let[d,u]=(0,a.useState)(null),h=(0,a.useRef)(null);if((0,a.useLayoutEffect)(()=>{if(!s.current)return;let e=(0,i.pageRect)(s.current),t=(0,i.pageViewport)(),n=Math.min(Math.max(e.width,360),520,t.width-16),a=t.height-e.bottom-8,r=a<200&&e.top>a;u({left:Math.min(Math.max(8,e.left),t.width-n-8),top:r?Math.max(8,e.top-Math.min(320,e.top-8)-4):e.bottom+4,width:n,maxHeight:Math.min(320,(r?e.top:a)-8)})},[s,n.length]),(0,a.useEffect)(()=>{h.current?.querySelector(`[data-index="${o}"]`)?.scrollIntoView({block:"nearest"})},[o]),"u"<typeof document)return null;let p="";return(0,r.createPortal)((0,t.jsx)("ul",{ref:h,id:e,role:"listbox","aria-label":"Variables",style:{top:d?.top??-9999,left:d?.left??-9999,width:d?.width,maxHeight:d?.maxHeight},className:"fixed z-[90] overflow-auto rounded-lg border border-line bg-panel p-1 shadow-2xl",children:n.map((s,n)=>{let a=s.source!==p?(0,t.jsx)("li",{role:"presentation",className:"px-2.5 pt-1.5 pb-0.5 text-[11px] font-medium text-mute",children:y[s.source]},`h:${s.source}`):null;return p=s.source,[a,(0,t.jsxs)("li",{id:`${e}-${n}`,"data-index":n,role:"option","aria-selected":n===o,onPointerEnter:()=>l(n),onPointerDown:e=>e.preventDefault(),onClick:()=>c(s),className:`flex cursor-pointer items-baseline gap-3 rounded-md px-2.5 py-1 ${n===o?"bg-panel-2":""}`,children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-[13px] text-accent",children:`{{${s.name}}}`}),(0,t.jsxs)("span",{className:"ml-auto min-w-0 truncate text-right text-xs text-mute",title:s.secret?void 0:s.description??s.value,children:[s.secret?"●●●●●●":s.description??s.value,"builtin"!==s.source&&"saved"!==s.source?(0,t.jsxs)("span",{className:"text-mute/70",children:[" · ",s.from]}):null]})]},`${s.source}:${s.name}`)]})}),document.body)}let N=(0,a.forwardRef)(function({value:e,onValue:s,onKeyDown:n,...r},i){let o=(0,a.useRef)(null);(0,a.useImperativeHandle)(i,()=>o.current);let l=k(o,s);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{...r,...l.handlers,ref:o,value:e,onChange:e=>s(e.target.value),onKeyDown:e=>{l.onKeyDown(e)||n?.(e)}}),l.popup]})});function S({noun:e,rows:r,onCancel:i,onDone:o}){let[l,c]=(0,a.useState)(()=>r.map(e=>`${!1===e.enabled?"// ":""}${e.key}: ${e.value}${e.description?` # ${e.description}`:""}`).join("\n")),d=(0,a.useRef)(null);return(0,a.useEffect)(()=>{d.current?.focus();let e=e=>{"Escape"===e.key&&(e.stopPropagation(),i())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[i]),(0,t.jsx)("div",{className:"fixed inset-0 z-[66] flex items-center-safe justify-center bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&i(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"bulk-title",className:"w-full max-w-xl rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)(s.ListChecks,{size:16,className:"text-accent","aria-hidden":!0}),(0,t.jsxs)("h2",{id:"bulk-title",className:"flex-1 text-base font-medium text-ink",children:["Edit every ",e," as text"]}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(n.X,{size:16})})]}),(0,t.jsxs)("div",{className:"space-y-2 px-5 py-4",children:[(0,t.jsx)("textarea",{ref:d,value:l,onChange:e=>c(e.target.value),rows:10,spellCheck:!1,"aria-label":`Every ${e}, one a line`,className:"input w-full font-mono text-xs leading-relaxed",placeholder:"name: value\n// turned-off: value\nlimit: 20 # a note"}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["One a line as ",(0,t.jsx)("span",{className:"font-mono text-ink",children:"name: value"}),". Start a line with ",(0,t.jsx)("span",{className:"font-mono text-ink",children:"//"})," to keep it turned off; add"," ",(0,t.jsx)("span",{className:"font-mono text-ink",children:"# note"})," after for a description. Paste from Postman or a browser's DevTools."]})]}),(0,t.jsxs)("footer",{className:"flex justify-end gap-2 border-t border-line px-5 py-3",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:i,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>o(l.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.startsWith("//"),s=t?e.slice(2).trim():e,n=s.search(/\s#\s/),a=n>=0?s.slice(0,n):s,r=n>=0?s.slice(n).replace(/^\s#\s/,"").trim():"",i=a.indexOf(":");return{key:(i>=0?a.slice(0,i):a).trim(),value:i>=0?a.slice(i+1).trim():"",...t?{enabled:!1}:{},...r?{description:r}:{}}}).filter(e=>e.key)),children:"Done"})]})]})})}e.s(["SuggestInput",0,N,"SuggestTextarea",0,function({value:e,onValue:s,onKeyDown:n,...r}){let i=(0,a.useRef)(null),o=k(i,s);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("textarea",{...r,...o.handlers,ref:i,value:e,onChange:e=>s(e.target.value),onKeyDown:e=>{o.onKeyDown(e)||n?.(e)}}),o.popup]})},"useVariableSuggest",0,k],84575),e.s(["KeyValueEditor",0,function({rows:e,onChange:r,keyPlaceholder:i,valuePlaceholder:o,noun:l,secretValues:c=!1,simple:d=!1}){let[u,h]=(0,a.useState)(!1),p=[...e,{key:"",value:""}],m=d?"grid-cols-[minmax(0,2fr)_minmax(0,3fr)_2rem]":"grid-cols-[2rem_minmax(0,2fr)_minmax(0,3fr)_minmax(0,2fr)_2rem]",x=e.length>0&&e.every(e=>!1!==e.enabled),f=e.some(e=>!1!==e.enabled);function b(e,t){let s=p.map((s,n)=>n===e?{...s,...t}:s);r(s.filter((e,t)=>t<s.length-1||e.key||e.value))}return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"overflow-hidden rounded-md border border-line",children:[(0,t.jsxs)("div",{className:`grid ${m} items-center bg-panel-2 text-xs text-mute`,children:[d?null:(0,t.jsx)("span",{className:"grid place-items-center",children:(0,t.jsx)("input",{type:"checkbox","aria-label":x?`Turn off every ${l}`:`Turn on every ${l}`,checked:x,ref:e=>{e&&(e.indeterminate=f&&!x)},disabled:!e.length,onChange:()=>r(e.map(e=>x?{...e,enabled:!1}:{key:e.key,value:e.value,...e.description?{description:e.description}:{}})),className:"h-3.5 w-3.5 accent-[var(--accent)]"})}),(0,t.jsx)("span",{className:`px-2.5 py-1.5 ${d?"":"border-l border-line"}`,children:i}),(0,t.jsx)("span",{className:"border-l border-line px-2.5 py-1.5",children:o}),d?null:(0,t.jsx)("span",{className:"border-l border-line px-2.5 py-1.5",children:"Description"}),(0,t.jsx)("span",{})]}),p.map((s,a)=>{let i=a===p.length-1,o=!1===s.enabled,u=o?"text-mute line-through decoration-mute/40":"text-ink";return(0,t.jsxs)("div",{className:`group grid ${m} border-t border-line ${o?"bg-panel-2/40":""}`,children:[d?null:(0,t.jsx)("span",{className:"grid place-items-center",children:i?null:(0,t.jsx)("input",{type:"checkbox","aria-label":`${o?"Turn on":"Turn off"} ${l} ${s.key||a+1}`,checked:!o,onChange:()=>b(a,o?{enabled:void 0}:{enabled:!1}),className:"h-3.5 w-3.5 accent-[var(--accent)]"})}),(0,t.jsx)("input",{value:s.key,"aria-label":`${l} ${a+1} name`,placeholder:i?`Add ${l}`:"",onChange:e=>b(a,{key:e.target.value}),className:`min-w-0 bg-transparent px-2.5 py-1.5 font-mono text-[13px] outline-none placeholder:text-mute focus:bg-panel-2 ${d?"":"border-l border-line"} ${u}`}),(0,t.jsx)(N,{value:s.value,type:c?"password":"text","aria-label":`${l} ${a+1} value`,onValue:e=>b(a,{value:e}),className:`min-w-0 border-l border-line bg-transparent px-2.5 py-1.5 font-mono text-[13px] outline-none focus:bg-panel-2 ${u}`}),d?null:(0,t.jsx)("input",{value:s.description??"","aria-label":`${l} ${a+1} description`,placeholder:i?"":"—",onChange:e=>b(a,{description:e.target.value||void 0}),className:"min-w-0 border-l border-line bg-transparent px-2.5 py-1.5 text-[13px] text-mute outline-none placeholder:text-mute/50 focus:bg-panel-2 focus:text-ink"}),i?(0,t.jsx)("span",{}):(0,t.jsx)("button",{type:"button","aria-label":`Remove ${l} ${s.key||a+1}`,onClick:()=>r(e.filter((e,t)=>t!==a)),className:"grid place-items-center text-mute opacity-60 group-hover:opacity-100 hover:text-bad focus:opacity-100",children:(0,t.jsx)(n.X,{size:14})})]},a)})]}),d?null:(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-mute hover:text-ink",children:[(0,t.jsx)(s.ListChecks,{size:12,"aria-hidden":!0})," Bulk edit"]})}),u?(0,t.jsx)(S,{noun:l,rows:e,onCancel:()=>h(!1),onDone:e=>{r(e),h(!1)}}):null]})}],36e3)},31753,5504,e=>{"use strict";e.s(["LabeledInput",()=>M,"RequestEditor",()=>I],31753);var t=e.i(14368);e.i(24856);var s=e.i(70632),n=e.i(78451),a=e.i(43514),r=e.i(99181),i=e.i(22543),o=e.i(41997),l=e.i(53110),c=e.i(18043),d=e.i(28202),u=e.i(55925),h=e.i(90176),p=e.i(1359),m=e.i(36e3),x=e.i(58888),f=e.i(28867),b=e.i(13318),y=e.i(56931),g=e.i(83316),w=e.i(96659),v=e.i(87283),k=e.i(39170),j=e.i(24448);let N="atc:cookies";function S(){window.dispatchEvent(new Event(N))}e.s(["CookiesDialog",0,function(){let e=(0,k.useConfirm)(),[s,n]=(0,r.useState)(!1),[a,i]=(0,r.useState)([]),o=(0,r.useCallback)(()=>void fetch("/engine/cookies",{cache:"no-store"}).then(e=>e.ok?e.json():[]).then(i),[]);(0,r.useEffect)(()=>{let e=()=>n(!0);return window.addEventListener(N,e),()=>window.removeEventListener(N,e)},[]),(0,r.useEffect)(()=>{s&&o()},[s,o]);let l=async e=>{await fetch("/engine/cookies/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}).catch(()=>void 0),o()};if(!s)return null;let c=[...new Set(a.map(e=>e.domain))].sort();return(0,t.jsx)("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>e.target===e.currentTarget&&n(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"cookies-title",onKeyDown:e=>"Escape"===e.key&&n(!1),className:"flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{id:"cookies-title",className:"text-base font-medium text-ink",children:"Cookies"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Cookies APIs have set — sent back to them on later requests, like a browser. Session cookies are gone when the app closes; values are shown shortened."})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(j.GuideLink,{topic:"sending-requests#cookies"}),(0,t.jsx)("button",{type:"button","aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>n(!1),children:(0,t.jsx)(v.X,{size:16})})]})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 space-y-4 overflow-auto px-5 py-4",children:0===c.length?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-mute",children:[(0,t.jsx)(g.Cookie,{size:15,"aria-hidden":!0})," No cookies yet. They appear when an API sets one (a login, for example)."]}):c.map(e=>(0,t.jsxs)("section",{className:"rounded-md border border-line",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line bg-panel-2 px-3 py-1.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono text-ink",children:e}),(0,t.jsx)("button",{type:"button",className:"ml-auto text-mute hover:text-bad",onClick:()=>void l({domainOnly:e}),children:"Delete all for this site"})]}),(0,t.jsx)("ul",{className:"divide-y divide-line",children:a.filter(t=>t.domain===e).map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-3 px-3 py-1.5 text-sm",children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"font-mono text-ink",children:e.name})," ",(0,t.jsxs)("span",{className:"font-mono text-mute",children:["= ",e.value]}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:["/"!==e.path?`path ${e.path}`:"",e.includeSubdomains?"and subdomains":"",e.secure?"https only":"",e.httpOnly?"HttpOnly":"",e.expires?`until ${new Date(e.expires).toLocaleString()}`:"until the app closes"].filter(Boolean).join(" · ")})]}),(0,t.jsx)("button",{type:"button","aria-label":`Delete ${e.name}`,className:"rounded p-1 text-mute hover:text-bad",onClick:()=>void l({name:e.name,domain:e.domain,path:e.path}),children:(0,t.jsx)(w.Trash2,{size:14})})]},`${e.name}|${e.path}`))})]},e))}),a.length?(0,t.jsx)("footer",{className:"flex justify-end border-t border-line px-5 py-3",children:(0,t.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:async()=>{await e({title:"Delete every cookie?",body:"You'll be signed out of sites that used them.",confirmLabel:"Delete all",tone:"danger"})&&await l({all:!0})},children:"Delete all cookies"})}):null]})})},"openCookies",0,S],5504);var C=e.i(65238),A=e.i(6278);e.i(42674);var T=e.i(5305),E=e.i(70746),P=e.i(84575);function I({id:e,draft:n,onChange:i,extraTabs:o=[],checkResults:l,lastBody:m,lastResult:x,currentId:f,setupResult:y,savedResults:g,collection:w,introspect:v}){var k,j;let[N,S]=(0,r.useState)("params"),A=(0,T.draftCounts)(n),E=(0,C.useFolderChain)(w,n.url),P=(0,T.applyFolders)(n,E).inherited,q=e=>i({...n,...e}),R=new Set(n.checks.map(e=>(0,s.checkLabel)(e))),M=l?.filter(e=>!R.has(e.name)),O=[{id:"params",label:"Params",badge:A.params||void 0},{id:"headers",label:"Headers",badge:A.headers+P.headers.length||void 0},{id:"auth",label:A.auth||P.authFrom?(0,t.jsxs)("span",{title:P.authFrom?`Auth from ${P.authFromConnection?"connection":"folder"} ${P.authFrom}`:`Auth: ${$(n.authMode)}`,children:["Auth ",(0,t.jsx)("span",{className:"text-ok","aria-label":P.authFrom?`(from ${P.authFromConnection?"connection":"folder"})`:`(${$(n.authMode)})`,children:"●"})]}):"Auth"},...(0,T.hasBody)(n.method)?[{id:"body",label:"Body",badge:A.body?"multipart"===n.bodyMode?"form + files":n.bodyMode:void 0}]:[],{id:"checks",label:"Checks",badge:function(e,s){if(!e)return;if(!s||0===s.length)return e;let n=s.filter(e=>e.ok).length;return(0,t.jsxs)("span",{className:n===s.length?"text-ok":"text-bad",title:`${n} of ${s.length} passed on the last Send`,children:[n,"/",s.length]})}(A.checks,l)},{id:"save",label:(0,t.jsx)("span",{title:"Take values from this answer, like an order id, for the requests after it",children:"Save values"}),badge:A.saveValues?function(e,s){if(!s?.length)return e;let n=s.filter(e=>e.found).length;return(0,t.jsxs)("span",{className:n===s.length?"text-ok":"text-bad",title:`${n} of ${s.length} found on the last Send`,children:[n,"/",s.length]})}(A.saveValues,g):void 0},{id:"before",label:(0,t.jsx)("span",{title:"Send a saved request first, like signing in, and use values from its answer",children:"Run first"}),badge:A.before?(k=y)?k.ok?(0,t.jsx)("span",{className:"text-ok",title:"Worked on the last Send",children:"✓"}):(0,t.jsx)("span",{className:"text-bad",title:k.error,children:"✕"}):"on":void 0},{id:"data",label:(0,t.jsx)("span",{title:"Use rows from a CSV file as variables",children:"Test data"}),badge:A.testData?(j=A.testData)>=1e3?`${Math.round(j/100)/10}k rows`:`${j} row${1===j?"":"s"}`:void 0},{id:"scripts",label:(0,t.jsx)("span",{title:"JavaScript before the request and on its answer (Postman-style pm)",children:"Scripts"}),badge:A.scripts?function(e,s){if(!s?.length)return e;let n=s.filter(e=>e.ok).length;return(0,t.jsxs)("span",{className:n===s.length?"text-ok":"text-bad",title:`${n} of ${s.length} tests passed on the last Send`,children:[n,"/",s.length]})}(A.scripts,M):void 0},{id:"example",label:(0,t.jsx)("span",{title:"What the mock server answers for this request",children:"Example"}),badge:n.mock?n.mock.status:void 0},{id:"docs",label:(0,t.jsx)("span",{title:"What this request is for, in Markdown — it goes into Export → API docs",children:"Docs"}),badge:n.description.trim()?"✓":void 0},...o.map(e=>({id:e.id,label:e.label,badge:e.badge})),{id:"settings",label:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",title:"Timeout, redirects, connections, TLS",children:[(0,t.jsx)(a.Settings2,{size:14,"aria-hidden":!0}),"Settings"]})}],D=O.some(e=>e.id===N)?N:"params",F=o.find(e=>e.id===D);return(0,t.jsxs)("div",{children:[(0,t.jsx)(b.Tabs,{id:e,label:"Request settings",items:O,value:D,onChange:S}),(0,t.jsx)("div",{...(0,b.tabPanelProps)(e,D),className:"pt-4",children:F?F.content:"checks"===D?(0,t.jsx)(d.ChecksEditor,{checks:n.checks,onChange:e=>q({checks:e}),results:l,lastBody:m}):"save"===D?(0,t.jsx)(c.SaveValuesPanel,{draft:n,onChange:i,results:g}):"before"===D?(0,t.jsx)(c.RunFirstPanel,{draft:n,onChange:i,currentId:f,result:y}):"data"===D?(0,t.jsx)(c.TestDataPanel,{draft:n,onChange:i}):"example"===D?(0,t.jsx)(h.ExamplePanel,{draft:n,onChange:i,last:x,collection:w}):"docs"===D?(0,t.jsx)(p.DocsPanel,{value:n.description,onChange:e=>q({description:e})}):"scripts"===D?(0,t.jsx)(u.ScriptsPanel,{draft:n,onChange:i,results:M,folderScripts:P.scripts}):(0,t.jsx)(L,{tab:D,draft:n,onChange:i,patch:q,chain:E,collection:w??null,introspect:v})})]})}function $(e){return"api_key"===e?"key":e}function L({tab:e,draft:s,onChange:n,patch:a,chain:r,collection:i,introspect:c}){if("params"===e)return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(m.KeyValueEditor,{rows:s.params,onChange:e=>n((0,T.withParts)(s,{params:e})),keyPlaceholder:"Query parameter",valuePlaceholder:"Value",noun:"parameter"}),(0,t.jsxs)("details",{className:"group rounded-md border border-line",children:[(0,t.jsx)("summary",{className:"cursor-pointer px-3 py-2 text-sm text-mute hover:text-ink",children:"Edit origin and path separately"}),(0,t.jsxs)("div",{className:"grid gap-3 border-t border-line p-3 sm:grid-cols-2",children:[(0,t.jsx)(M,{label:"Base URL",value:s.baseUrl,placeholder:"https://api.example.com",onChange:e=>n((0,T.withParts)(s,{baseUrl:e}))}),(0,t.jsx)(M,{label:"Path",value:s.endpoint,placeholder:"/v1/orders",onChange:e=>n((0,T.withParts)(s,{endpoint:e}))})]})]})]});if("headers"===e){let e=function(e,t){let s=new Set(e.headers.filter(T.isOn).map(e=>e.key.trim().toLowerCase())),n=new Map;for(let e of t)for(let t of e.settings.headers)(0,T.isOn)(t)&&n.set(t.key.trim().toLowerCase(),{key:t.key.trim(),value:t.value,from:e.path});return[...n.entries()].filter(([e])=>!s.has(e)).map(([,e])=>e)}(s,r);return(0,t.jsxs)("div",{className:"space-y-2",children:[e.length?(0,t.jsxs)("div",{className:"rounded-md border border-line bg-panel-2/50 px-3 py-2 text-xs",children:[(0,t.jsx)("p",{className:"mb-1 text-mute",children:"Also sent, from its folder — a header with the same name below replaces it:"}),(0,t.jsx)("ul",{className:"space-y-0.5 font-mono",children:e.map(e=>(0,t.jsxs)("li",{className:"flex flex-wrap gap-x-2",children:[(0,t.jsx)("span",{className:"text-ink",children:e.key}),(0,t.jsx)("span",{className:"min-w-0 truncate text-mute",children:e.value}),(0,t.jsxs)("span",{className:"font-sans text-mute",children:["· ",e.from]})]},e.key))})]}):null,(0,t.jsx)(m.KeyValueEditor,{rows:s.headers,onChange:e=>a({headers:e}),keyPlaceholder:"Header",valuePlaceholder:"Value",noun:"header"}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Credentials belong in ",(0,t.jsx)("span",{className:"text-ink",children:"Auth"})," — they are masked there and never exported."]})]})}if("auth"===e){let e=(0,T.applyFolders)(s,r).inherited.authFrom,n=e?r.find(t=>t.path===e):void 0;return(0,t.jsx)(o.AuthFields,{value:s,onChange:a,defaults:(0,T.applyFolders)(s,r).vars,inheritLabel:"From folder or connection",inheritNote:n?.connection?(0,t.jsxs)(t.Fragment,{children:["Uses the ",(0,t.jsx)("span",{className:"text-ink",children:(0,o.authModeLabel)(n.settings.auth.authMode)})," of the connection"," ",(0,t.jsx)("span",{className:"text-ink",children:n.path})," — the address starts with its variable. Change it on the Connections page."]}):n?(0,t.jsxs)(t.Fragment,{children:["Uses the ",(0,t.jsx)("span",{className:"text-ink",children:(0,o.authModeLabel)(n.settings.auth.authMode)})," set on the folder"," ",(0,t.jsx)("span",{className:"text-ink",children:n.path}),". Change it in that folder's settings (⋯ next to the folder)."]}):(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(t.Fragment,{children:"No folder above this request sets auth, so no credentials are sent. Set it once on a folder (⋯ → Folder settings) and every request inside uses it."}):(0,t.jsx)(t.Fragment,{children:"This request isn't saved in a folder, so no credentials are sent. Save it in a folder that has auth, or pick a type here."}),(0,t.jsx)(D,{draft:s,onUrl:e=>a((0,T.withUrl)(s,e))})]}),secretNote:"Kept encrypted on this computer. Exports record the auth type, never the secret."})}return"body"===e?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)(f.Segmented,{label:"Body type",value:s.bodyMode,onChange:e=>a({bodyMode:e}),options:[{value:"none",label:"None"},{value:"json",label:"JSON"},{value:"text",label:"Text"},{value:"form",label:"Form",title:"Fields sent as name=value&… (application/x-www-form-urlencoded)"},{value:"multipart",label:"Form with files",title:"Fields and files (multipart/form-data) — how web pages upload files"},{value:"file",label:"File",title:"One file as the whole body"},{value:"graphql",label:"GraphQL"}]}),"json"===s.bodyMode?(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>a({bodyText:function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(s.bodyText)}),children:"Format JSON"}):null]}),"graphql"===s.bodyMode?(0,t.jsx)(l.GraphqlEditor,{draft:s,patch:a,introspect:c}):"form"===s.bodyMode||"multipart"===s.bodyMode?(0,t.jsx)(x.FormBodyEditor,{rows:s.formRows,files:"multipart"===s.bodyMode,onChange:e=>a({formRows:e})}):"file"===s.bodyMode?(0,t.jsx)(x.FileBodyEditor,{file:s.bodyFile,contentType:s.bodyFileType,onChange:a}):"none"!==s.bodyMode?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.SuggestTextarea,{value:s.bodyText,"aria-label":"Request body",spellCheck:!1,onValue:e=>a({bodyText:e}),rows:12,className:"input font-mono text-[13px] leading-5",placeholder:"json"===s.bodyMode?'{\n "id": 1\n}':"raw body"}),"json"===s.bodyMode?(0,t.jsx)(R,{text:s.bodyText}):null]}):(0,t.jsx)("p",{className:"text-sm text-mute",children:"No body is sent."})]}):(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(M,{label:"Timeout",mono:!0,value:s.timeout,error:(0,T.durationError)(s.timeout,!1),onChange:e=>a({timeout:e}),hint:"Per request, e.g. 30s or 2m."}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Max redirects"}),(0,t.jsx)("input",{type:"number",min:0,max:20,value:s.maxRedirects,onChange:e=>a({maxRedirects:Number(e.target.value)}),className:"input font-mono"})]}),(0,t.jsx)(O,{checked:s.connectionReuse,onChange:e=>a({connectionReuse:e}),label:"Reuse TCP connections",hint:"On mirrors a real client with keep-alive. Off makes every request pay DNS, TCP, and TLS again."}),(0,t.jsx)(O,{checked:s.tlsSkip,onChange:e=>a({tlsSkip:e}),label:"Skip TLS certificate check",hint:"On for new requests: any certificate is accepted, so test servers with their own (self-signed) certificates just work. Turn it off to check certificates like a browser does, e.g. when testing production."}),(0,t.jsxs)("div",{children:[(0,t.jsx)(O,{checked:s.useCookies,onChange:e=>a({useCookies:e}),label:"Use the cookie jar",hint:"Send cookies APIs have set (a login's session) and keep new ones. Off sends only the Cookie header you add."}),(0,t.jsx)("button",{type:"button",className:"mt-1 text-xs text-accent hover:underline",onClick:S,children:"See cookies"})]}),(0,t.jsx)("div",{className:"sm:col-span-2",children:(0,t.jsx)(q,{url:s.url,defaults:(0,T.applyFolders)(s,r).vars})})]})}function q({url:e,defaults:s}){let{vars:a}=(0,A.useWorkspace)(),[i,o]=(0,r.useState)(null),[l,c]=(0,r.useState)(0),d=(0,n.substitute)(e,{...s,...a}).text,u=/^https:\/\//i.test(d);return(0,r.useEffect)(()=>{let e=()=>c(e=>e+1);return window.addEventListener(y.CERTIFICATES_CHANGED,e),()=>window.removeEventListener(y.CERTIFICATES_CHANGED,e)},[]),(0,r.useEffect)(()=>{if(!u)return o(null);let e=!0,t=window.setTimeout(()=>void y.certificateApi.match(d).then(t=>e&&o(t.host)),300);return()=>{e=!1,window.clearTimeout(t)}},[d,u,l]),(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 rounded-md border border-line px-3 py-2 text-sm",children:[(0,t.jsx)("span",{className:"text-mute",children:"Client certificate (mutual TLS):"}),(0,t.jsx)("span",{className:"text-ink",children:i?(0,t.jsxs)(t.Fragment,{children:["the one for ",(0,t.jsx)("span",{className:"font-mono",children:i})]}):u?"none for this host":"only for https addresses"}),(0,t.jsx)("button",{type:"button",className:"ml-auto text-xs text-accent hover:underline",onClick:y.openCertificates,children:"Manage certificates"})]})}function R({text:e}){if(!e.trim())return(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Empty body sends ","{}","."]});try{return JSON.parse(e),(0,t.jsx)("p",{className:"text-xs text-ok",children:"Valid JSON"})}catch(e){return(0,t.jsx)("p",{className:"text-xs text-bad",children:e instanceof Error?e.message:"Invalid JSON"})}}function M({label:e,value:s,onChange:n,placeholder:a,hint:i,secret:o=!1,mono:l=!1,type:c="text",error:d}){let[u,h]=(0,r.useState)(!1);return(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:e}),(0,t.jsxs)("span",{className:"relative block",children:[(0,t.jsx)(P.SuggestInput,{type:o&&!u?"password":c,autoComplete:"off",spellCheck:!1,value:s,placeholder:a,"aria-invalid":!!d||void 0,onValue:n,className:`input ${l?"font-mono":""} ${o?"pr-14":""} ${d?"border-bad":""}`}),o?(0,t.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),h(e=>!e)},className:"absolute inset-y-0 right-1 my-1 rounded px-2 text-xs text-mute hover:text-ink",children:u?"Hide":"Show"}):null]}),d?(0,t.jsx)("span",{className:"mt-1 block text-xs text-bad",children:d}):i?(0,t.jsx)("span",{className:"mt-1 block text-xs text-mute",children:i}):null]})}function O({checked:e,onChange:s,label:n,hint:a}){return(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-line px-3 py-2.5 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:e,onChange:e=>s(e.target.checked),className:"mt-0.5 accent-[var(--accent)]"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[n,a?(0,t.jsx)(i.Hint,{text:a,label:`About ${n}`}):null]})]})}function D({draft:e,onUrl:s}){let n=(0,E.useConnections)();if(!n.length)return null;let a=e.url.replace(/^\s*(\{\{[^}]*\}\}|https?:\/\/[^/?#]*)/i,"");return(0,t.jsxs)("span",{className:"mt-3 block",children:[(0,t.jsx)("span",{className:"block text-xs",children:"Or use a connection — its sign-in comes with it:"}),(0,t.jsx)("span",{className:"mt-1.5 flex flex-wrap gap-1.5",children:n.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>s(`{{${e.variable}}}${a&&!/^[/?#]/.test(a)?"/":""}${a}`),className:"rounded-md border border-line px-2 py-1 text-xs text-ink hover:border-accent",title:e.baseUrl,children:[e.name," ",(0,t.jsx)("span",{className:"font-mono text-accent",children:`{{${e.variable}}}`})]},e.id))})]})}},55925,67290,e=>{"use strict";var t=e.i(14368),s=e.i(71189),n=e.i(30135),a=e.i(99181),r=e.i(28867);let i={pre:[{label:"Set a value",code:'pm.environment.set("orderRef", "ord-" + Date.now());'},{label:"Add a header",code:'pm.request.headers.upsert({ key: "X-Request-Id", value: "{{$uuid}}" });'},{label:"Use a value from before",code:'const token = pm.environment.get("token");\nif (!token) console.log("No token yet — send the sign-in request first");'},{label:"Change the body",code:'const body = JSON.parse(pm.request.body.raw || "{}");\nbody.sentAt = new Date().toISOString();\npm.request.body.update(JSON.stringify(body));'},{label:"Log the request",code:"console.log(pm.request.method, pm.request.url.toString());"}],post:[{label:"Status is 200",code:'pm.test("status is 200", () => pm.response.to.have.status(200));'},{label:"Answers within 500 ms",code:'pm.test("answers within 500 ms", () => pm.expect(pm.response.responseTime).to.be.below(500));'},{label:"A field has a value",code:'pm.test("status is active", () => {\n pm.expect(pm.response.json().status).to.eql("active");\n});'},{label:"A list is not empty",code:'pm.test("has items", () => {\n pm.expect(pm.response.json().items).to.be.an("array").that.is.not.empty;\n});'},{label:"Has a header",code:'pm.test("has Content-Type", () => pm.response.to.have.header("Content-Type"));'},{label:"Save a value for the next requests",code:'pm.environment.set("token", pm.response.json().token);'}]};e.s(["ScriptsPanel",0,function({draft:e,onChange:o,results:l,folderScripts:c,forFolder:d=!1}){let[u,h]=(0,a.useState)(e.preScript.trim()&&!e.postScript.trim()?"pre":"post"),p=(0,a.useRef)(null),m="pre"===u?e.preScript:e.postScript,x=t=>o({...e,["pre"===u?"preScript":"postScript"]:t});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(r.Segmented,{label:"Script",value:u,onChange:h,options:[{value:"pre",label:(0,t.jsxs)("span",{children:["Pre-request",e.preScript.trim()?(0,t.jsx)("span",{className:"ml-1 text-ok",children:"●"}):null]})},{value:"post",label:(0,t.jsxs)("span",{children:["Tests",e.postScript.trim()?(0,t.jsx)("span",{className:"ml-1 text-ok",children:"●"}):null]})}]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:d?"pre"===u?"Runs before every request in this folder and its subfolders — before the request's own script.":"Runs on the answer of every request in this folder and its subfolders. Its pm.test(…) results count like checks.":"pre"===u?"Runs before the request is sent: change headers, the address or the body, or set {{values}} it uses.":"Runs on the answer. Each pm.test(…) counts like a check — on Send, in collection runs and CI, and for every request of a performance test."})]}),c?.length?(0,t.jsxs)("p",{className:"rounded-md border border-line bg-panel-2/50 px-3 py-2 text-xs text-mute",children:["First, the scripts of ",1===c.length?"the folder":"the folders"," ",(0,t.jsx)("span",{className:"text-ink",children:c.join(", ")})," run (Folder settings → Scripts), then this one."]}):null,(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-mute",children:"Add"}),i[u].map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;let s,n,a,r;return t=e.code,n=(s=p.current)&&document.activeElement===s?s.selectionStart:m.length,r=(a=m.slice(0,n))&&!a.endsWith("\n")?"\n":"",void(x(`${a}${r}${t}
|
|
10
|
-
${m.slice(n)}`),window.setTimeout(()=>{s?.focus();let e=a.length+r.length+t.length+1;s?.setSelectionRange(e,e)},0))},className:"inline-flex items-center gap-1 rounded-md border border-line px-2 py-1 text-xs text-ink hover:border-accent",children:[(0,t.jsx)(s.Plus,{size:12,"aria-hidden":!0,className:"text-mute"}),e.label]},e.label))]}),(0,t.jsx)("textarea",{ref:p,"aria-label":"pre"===u?"Pre-request script":"Tests script",value:m,onChange:e=>x(e.target.value),onKeyDown:e=>{if("Tab"===e.key&&!e.shiftKey){e.preventDefault();let t=e.currentTarget,s=t.selectionStart;x(`${m.slice(0,s)} ${m.slice(t.selectionEnd)}`),window.setTimeout(()=>t.setSelectionRange(s+2,s+2),0)}"Escape"===e.key&&e.currentTarget.blur()},spellCheck:!1,rows:14,placeholder:"pre"===u?'pm.environment.set("ts", Date.now());':'pm.test("status is 200", () => pm.response.to.have.status(200));',wrap:"off",className:"min-h-[14rem] w-full resize-y overflow-auto rounded-md border border-line bg-panel-2 p-3 font-mono text-[13px] leading-5 whitespace-pre text-ink outline-none focus:border-accent"}),"post"===u&&l?.length?(0,t.jsx)("ul",{className:"space-y-1","aria-label":"Test results of the last Send",children:l.map((e,s)=>(0,t.jsxs)("li",{className:`text-xs ${e.ok?"text-ok":"text-bad"}`,children:[e.ok?"✓":"✕"," ",e.name,!e.ok&&e.detail?(0,t.jsxs)("span",{className:"text-mute",children:[" — ",e.detail]}):null]},s))}):null,(0,t.jsxs)("p",{className:"flex items-start gap-1.5 text-xs text-mute",children:[(0,t.jsx)(n.ShieldCheck,{size:12,className:"mt-0.5 shrink-0","aria-hidden":!0}),"Scripts run in a sandbox: they see the request, the answer and your values — not your files, the network or other programs. Up to 2 seconds each. Auth is added after the pre-request script. console.log lines show under Console in the response."]})]})}],55925);let o=(0,e.i(99522).default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,o],67290)},57489,21407,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(19166),n=e.i(30340),a=e.i(17118),r=e.i(99074),i=e.i(27813),o=e.i(11563),l=e.i(99181),c=e.i(45449),d=e.i(56396);e.i(42674);var u=e.i(5305);let h="apitestcenter-app-settings";function p(e){(0,u.setNewDraftDefaults)({requests:e.requests,loadPreset:e.load.preset})}try{let e=window.localStorage.getItem(h);e&&p((0,s.normalizeAppSettings)(JSON.parse(e)))}catch{}function m(e){p(e);try{window.localStorage.setItem(h,JSON.stringify({proxy:e.proxy,requests:e.requests,load:e.load}))}catch{}return e}async function x(e){let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}let f={get:()=>fetch("/engine/settings/app",{cache:"no-store"}).then(e=>x(e)).then(m),save:(e,t)=>fetch("/engine/settings/app",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({settings:e,proxyPassword:t})}).then(e=>x(e)).then(m),testNetwork:e=>fetch("/engine/settings/app/test-network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({url:e})}).then(e=>x(e))};e.s(["appSettingsApi",0,f,"loadAppSettings",0,function(){f.get().catch(()=>void 0)}],21407);var b=e.i(44505);function y(){let e=(0,d.useToast)(),[t,s]=(0,l.useState)(null);return(0,l.useEffect)(()=>{f.get().then(s,()=>s(null))},[]),{view:t,save:async function(t,n){try{return s(await f.save(t,n)),!0}catch(t){return e(t instanceof Error?t.message:"Could not save the setting","error"),!1}}}}function g({label:e,value:s,onSave:n,placeholder:a,type:r="text",className:i="w-64"}){let[o,c]=(0,l.useState)(s);(0,l.useEffect)(()=>c(s),[s]);let d=()=>o!==s&&n(o);return(0,t.jsx)("input",{"aria-label":e,type:r,value:o,placeholder:a,onChange:e=>c(e.target.value),onBlur:d,onKeyDown:e=>"Enter"===e.key&&d(),spellCheck:!1,className:`input py-1.5 font-mono text-sm ${i}`})}function w(){return(0,t.jsxs)("p",{className:"flex items-center gap-2 py-4 text-sm text-mute",children:[(0,t.jsx)(i.Loader2,{size:14,className:"animate-spin","aria-hidden":!0})," Reading settings…"]})}function v(){let e=(0,d.useToast)(),s=(0,b.desktop)()?.cli,[n,o]=(0,l.useState)(void 0),[c,u]=(0,l.useState)(null);(0,l.useEffect)(()=>{s?.status().then(e=>o(e&&"error"in e?null:e),()=>o(null))},[s]);let h=async(t,s,n)=>{u(t);let a=await s().catch(e=>({error:e instanceof Error?e.message:String(e)}));if(u(null),!a||"error"in a)return e(a&&"error"in a?`That didn't work: ${a.error}`:"That didn't work","error");o(a);let r=n(a);r&&e(r,"success")},p=e=>c===e?(0,t.jsx)(i.Loader2,{size:13,className:"animate-spin","aria-hidden":!0}):null;if(!s||null===n||n?.reason==="not-windows")return null;if(void 0===n)return(0,t.jsx)(w,{});if(!n.canInstall)return(0,t.jsx)("p",{className:"rounded-lg border border-line px-3 py-2.5 text-xs text-mute",children:"portable"===n.reason?"This portable copy runs without installing, so it doesn't put atc on your PATH. Install the app for that — or, anywhere with Node.js 20+, use npx apitestcenter.":"store"===n.reason?"The Microsoft Store version can't change your PATH. Anywhere with Node.js 20+: npx apitestcenter, or npm i -g apitestcenter.":"A development build: run the command line with pnpm atc from the repository."});let m=n.other;if(m){let e=!!m.version&&0>function(e,t){let s=e.split(".").map(Number),n=t.split(".").map(Number);for(let e=0;e<3;e++)if((s[e]??0)!==(n[e]??0))return(s[e]??0)<(n[e]??0)?-1:1;return 0}(m.version,n.appVersion);return(0,t.jsxs)("div",{className:`space-y-2 rounded-lg border px-3 py-2.5 text-sm ${e?"border-warn/40 bg-warn/5":"border-line"}`,role:"status",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[e?(0,t.jsx)(r.CircleAlert,{size:16,className:"mt-0.5 shrink-0 text-warn","aria-hidden":!0}):(0,t.jsx)(a.CheckCircle2,{size:16,className:"mt-0.5 shrink-0 text-ok","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block text-ink",children:e?`New version available: atc ${n.appVersion}`:m.version?`atc ${m.version} is installed`:"atc is installed"}),(0,t.jsx)("span",{className:"block text-xs break-all text-mute",title:m.dir,children:e?`You have ${m.version}${m.npm?", from npm":""}.`:m.npm?"From npm.":`From ${m.dir}.`})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pl-6",children:[m.npm&&e?(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1 text-sm",disabled:!!c,onClick:()=>void h("npm",s.updateNpm,e=>`atc ${e.other?.version??e.version??""} is ready — open a new terminal.`),children:[p("npm")," Update"]}):null,m.canPutBehind?(0,t.jsxs)("button",{type:"button",className:`btn py-1 text-sm ${e&&!m.npm?"btn-primary":"btn-secondary"}`,disabled:!!c,title:"Puts this app's atc first on your PATH; it then updates with the app",onClick:()=>void h("first",s.putFirst,()=>`atc ${n.appVersion} is ready — open a new terminal.`),children:[p("first")," Use the app's copy"]}):e?(0,t.jsx)("span",{className:"text-xs text-mute",children:"To update it, remove it from the computer's PATH."}):null]})]})}return n.installed?(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-ok/40 bg-ok/5 px-3 py-2.5 text-sm",role:"status",children:[(0,t.jsx)(a.CheckCircle2,{size:16,className:"mt-0.5 shrink-0 text-ok","aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"block text-ink",children:["atc ",n.version??n.appVersion," is installed and up to date"]}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:"It updates with the app. Type atc in a new terminal."})]})]}):(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-warn/40 bg-warn/5 px-3 py-2.5 text-sm",role:"status",children:[(0,t.jsx)(r.CircleAlert,{size:16,className:"shrink-0 text-warn","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-ink",children:"atc isn't installed"}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:"One click, no administrator needed."})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",disabled:!!c,onClick:()=>void h("install",s.install,()=>"atc is installed. Open a new terminal and type atc."),children:[p("install")," Install"]})]})}let k=[{id:"busy",label:"Keep running while something's running",hint:"A request waiting for its answer, a collection run, a performance test or a scheduled check keeps going in the tray and tells you when it finishes or fails. With nothing running, closing quits."},{id:"tray",label:"Always keep running in the tray",hint:"Closing the window hides it; the app waits in the tray and opens at a click."},{id:"quit",label:"Quit",hint:"Whatever is running stops. A scheduled check that's due runs once when the app is open again."}],j=[{value:2,label:"After 2 minutes"},{value:10,label:"After 10 minutes"},{value:30,label:"After 30 minutes"},{value:0,label:"Never"}];e.s(["BackgroundSection",0,function(){let e=(0,d.useToast)(),s=(0,b.desktop)()?.background,n=(0,b.desktop)()?.platform==="darwin",[a,r]=(0,l.useState)(null);if((0,l.useEffect)(()=>{s?.get().then(r,()=>r(null))},[s]),!s)return null;if(!a)return(0,t.jsx)(w,{});let i=t=>s.set(t).then(e=>e&&r(e),()=>e("Could not save the setting","error")),o=n?"the menu bar":"the tray";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"py-2 text-sm text-mute",children:["Requests, runs and scheduled checks run in the app. When you close the window, it can stay in ",o," so they keep going."]}),(0,t.jsx)("div",{role:"radiogroup","aria-label":"When I close the window",className:"mt-1 grid gap-2",children:k.map(e=>{let s=a.whenClosed===e.id;return(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":s,"aria-label":e.label,onClick:()=>void i({whenClosed:e.id}),className:`flex items-start gap-3 rounded-lg border px-3 py-2.5 text-left ${s?"border-accent bg-accent-dim":"border-line hover:border-mute"}`,children:[(0,t.jsx)("span",{className:`mt-1 h-3 w-3 shrink-0 rounded-full border ${s?"border-accent bg-accent":"border-mute"}`,"aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block text-sm font-medium text-ink",children:e.label.replace("the tray",o)}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:e.hint.replace("the tray",o)})]})]},e.id)})}),a.canStartAtLogin?(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(c.Row,{title:n?"Open at login":"Start with Windows",hint:`Opens into ${o} when you sign in, so scheduled checks run without opening the app.`,children:(0,t.jsx)(c.Switch,{label:n?"Open at login":"Start with Windows",checked:a.startAtLogin,onChange:e=>void i({startAtLogin:e})})})}):null,void 0!==a.restAfter?(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(c.Row,{title:"Free memory when it's put away",hint:`In ${o} or minimized, with nothing running, the app unloads its page and gives the memory back to your computer. Opening it brings everything back where it was, in about a second. Scheduled checks keep running and still notify.`,children:(0,t.jsx)("select",{"aria-label":"Free memory when it's put away",value:a.restAfter,onChange:e=>void i({restAfter:Number(e.target.value)}),className:"input w-auto py-1 text-sm",children:j.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})})}):null,(0,t.jsxs)("p",{className:"pt-3 text-xs text-mute",children:["To send it to ",o," now, use ",(0,t.jsx)("span",{className:"text-ink",children:"Hide to tray"})," in the command palette. Quit for good from the ",n?"menu bar icon":"tray icon's menu",". A downloaded update installs when the app quits."]})]})},"CliSettings",0,function(){let[e,s]=(0,l.useState)("");return(0,l.useEffect)(()=>s(navigator.userAgent.includes("Windows")?"win":"other"),[]),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:[(0,t.jsx)("code",{className:"font-mono text-ink",children:"atc"})," runs your saved requests, collections and performance tests from a terminal or a CI pipeline — the same requests, environments and checks as the app, with pass/fail exit codes and JUnit reports."]}),(0,b.desktop)()?.cli&&"win"===e?(0,t.jsx)(v,{}):"win"===e?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["The Windows installer puts ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"atc"})," on your PATH: open a new terminal and type it."]}):(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Anywhere with Node.js 20+: ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"npx apitestcenter"}),", or install it with ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"npm i -g apitestcenter"}),"."]}),(0,t.jsx)(c.CopyBlock,{label:"See your saved requests and environments",text:"atc list"}),(0,t.jsx)(c.CopyBlock,{label:"Send every request in a collection once, and check each one",text:'atc suite "My collection" --env UAT --junit results.xml'}),(0,t.jsx)(c.CopyBlock,{label:"Load-test one request: passes or fails on your targets",text:'atc run "My collection/Get orders" --env UAT --preset smoke --p95 500 --errors 1'}),(0,t.jsx)(c.CopyBlock,{label:"Start api-tests/ in a repository, with a CI pipeline",text:"atc init"}),(0,t.jsxs)("div",{className:"rounded-lg border border-line p-3 text-xs text-mute",children:[(0,t.jsx)("div",{className:"mb-1 font-medium text-ink",children:"Good to know"}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-4",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"font-mono text-ink",children:"--env <name>"})," picks an environment; ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--var key=value"})," sets or overrides one variable (repeat it)."]}),(0,t.jsxs)("li",{children:["Exit codes: ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"0"})," passed, ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"1"})," failed (a check or a target), ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"2"})," couldn't run."]}),(0,t.jsxs)("li",{children:["Reports: ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--junit"}),", ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--json"})," and ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--html"})," files; ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--save"})," keeps a run in History too."]}),(0,t.jsx)("li",{children:"The proxy from Settings → Network applies on the command line as well."}),(0,t.jsxs)("li",{children:["Secrets saved in the app stay in the app: in CI, pass them with ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--var"})," from the pipeline's secret store."]})]})]}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Everything it can do: ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"atc --help"}),"."]})]})},"LoadSettings",0,function(){let{view:e,save:s}=y();return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"py-2 text-sm text-mute",children:"A new performance test starts as the type you pick here. Change users, duration and targets on the request's Performance tab as usual."}),(0,t.jsx)("div",{role:"radiogroup","aria-label":"Performance test to start with",className:"mt-1 grid gap-2",children:n.TEST_TYPES.map(n=>{let a=e.load.preset===n.id;return(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":a,"aria-label":n.label,onClick:()=>void s({...e,load:{preset:n.id}}),className:`flex items-start gap-3 rounded-lg border px-3 py-2.5 text-left ${a?"border-accent bg-accent-dim":"border-line hover:border-mute"}`,children:[(0,t.jsx)("span",{className:`mt-1 h-3 w-3 shrink-0 rounded-full border ${a?"border-accent bg-accent":"border-mute"}`,"aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsxs)("span",{className:"block text-sm font-medium text-ink",children:[n.label," ",(0,t.jsxs)("span",{className:"font-normal text-mute",children:["— ",n.question]})]}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:n.hint})]})]},n.id)})}),(0,t.jsx)("p",{className:"pt-3 text-xs text-mute",children:"Performance tests run with k6 on this computer, through the proxy from Settings → Network."})]}):(0,t.jsx)(w,{})},"NetworkSettings",0,function(){let{view:e,save:s}=y(),[n,a]=(0,l.useState)("https://github.com"),[r,d]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1);if(!e)return(0,t.jsx)(w,{});let p=e.proxy,m=(t,n)=>(d(null),s({...e,proxy:{...p,...t}},n)),x=e.environment;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"py-2 text-sm text-mute",children:["Most people never need this. It's for networks that send traffic through a proxy — common at companies: if an API works in your browser but here says ",(0,t.jsx)("span",{className:"text-ink",children:"Host not found"})," or times out, ask IT for the proxy address and put it in below. It applies to Send, collection runs, sign-in, connections and performance tests, here and on the command line. This computer (localhost) always goes direct."]}),(0,t.jsx)(c.Row,{title:"Proxy",children:(0,t.jsx)(c.Segmented,{label:"Proxy",value:p.mode,onChange:e=>void m({mode:e}),options:[{value:"off",label:"None"},{value:"environment",label:"The computer's"},{value:"manual",label:"This proxy"}]})}),"environment"===p.mode?(0,t.jsxs)("div",{className:"space-y-1 border-b border-line py-4 text-xs text-mute",children:[(0,t.jsx)("p",{children:"The proxy from the environment variables HTTPS_PROXY, HTTP_PROXY and NO_PROXY — the ones curl, git and k6 read."}),x.https||x.http?(0,t.jsxs)("dl",{className:"mt-2 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 font-mono",children:[x.https?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:"HTTPS_PROXY"}),(0,t.jsx)("dd",{className:"truncate text-ink",children:x.https})]}):null,x.http?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:"HTTP_PROXY"}),(0,t.jsx)("dd",{className:"truncate text-ink",children:x.http})]}):null,x.noProxy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:"NO_PROXY"}),(0,t.jsx)("dd",{className:"truncate text-ink",children:x.noProxy})]}):null]}):(0,t.jsx)("p",{className:"text-ink",children:"None are set on this computer, so requests go direct."})]}):null,"manual"===p.mode?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Row,{title:"Address",hint:"http://proxy.example.com:8080",children:(0,t.jsx)(g,{label:"Proxy address",value:p.url,placeholder:"http://proxy.example.com:8080",onSave:e=>void m({url:e})})}),(0,t.jsx)(c.Row,{title:"User name",hint:"If the proxy asks you to sign in.",children:(0,t.jsx)(g,{label:"Proxy user name",value:p.username,className:"w-48",onSave:e=>void m({username:e.trim()})})}),(0,t.jsx)(c.Row,{title:"Password",hint:e.proxyPassword?"Kept encrypted on this computer. Type a new one to change it.":"Kept encrypted on this computer.",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{label:"Proxy password",type:"password",value:"",placeholder:e.proxyPassword?"••••••••":"",className:"w-48",onSave:e=>void m({},e)}),e.proxyPassword?(0,t.jsx)("button",{type:"button",className:"text-xs text-mute hover:text-bad",onClick:()=>void m({},""),children:"Remove"}):null]})}),(0,t.jsx)(c.Row,{title:"Go direct to",hint:"Hosts that skip the proxy, separated by commas: intranet.example.com, .example.com, 10.0.0.5",children:(0,t.jsx)(g,{label:"Hosts that skip the proxy",value:p.bypass,placeholder:".example.com, 10.0.0.5",onSave:e=>void m({bypass:e})})})]}):null,(0,t.jsxs)("div",{className:"space-y-2 py-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-ink",children:"Check the way out"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("input",{"aria-label":"Address to reach",value:n,onChange:e=>a(e.target.value),spellCheck:!1,className:"input w-72 py-1.5 font-mono text-sm"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:u,onClick:async()=>{h(!0),d(await f.testNetwork(n).catch(e=>({ok:!1,message:e instanceof Error?e.message:"Could not check"}))),h(!1)},children:[u?(0,t.jsx)(i.Loader2,{size:14,className:"animate-spin","aria-hidden":!0}):(0,t.jsx)(o.Wifi,{size:14,"aria-hidden":!0})," Reach it"]})]}),r?(0,t.jsx)("p",{role:"status",className:`text-sm ${r.ok?"text-ok":"text-bad"}`,children:r.message}):(0,t.jsx)("p",{className:"text-xs text-mute",children:"Asks the address for its headers only (HEAD), the way your requests will go."})]})]})},"RequestSettings",0,function(){let{view:e,save:n}=y();if(!e)return(0,t.jsx)(w,{});let a=e.requests,r=t=>void n({...e,requests:{...a,...t}});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"py-2 text-sm text-mute",children:"New requests start with these. A saved request keeps its own — change one on its Settings tab."}),(0,t.jsx)(c.Row,{title:"Timeout",hint:'How long to wait for an answer: "30s", "2m", "500ms".',children:(0,t.jsx)(g,{label:"Timeout",value:a.timeout,className:"w-28",onSave:e=>/^\d+(ms|s|m)$/.test(e.trim())?r({timeout:e.trim()}):void 0})}),(0,t.jsx)(c.Row,{title:"Follow redirects",hint:"How many redirects (301, 302…) to follow; 0 shows the redirect itself.",children:(0,t.jsx)(g,{label:"Redirects to follow",type:"number",value:String(a.maxRedirects),className:"w-20",onSave:e=>r({maxRedirects:Math.max(0,Math.min(20,Math.round(Number(e)||0)))})})}),(0,t.jsx)(c.Row,{title:"Keep cookies",hint:"Send cookies an API set earlier, like a browser (Settings → Certificates and cookies shows them).",children:(0,t.jsx)(c.Switch,{label:"Keep cookies",checked:a.useCookies,onChange:e=>r({useCookies:e})})}),(0,t.jsx)(c.Row,{title:"Skip the TLS certificate check",hint:"So test servers with their own certificates just work. Off: a certificate the computer doesn't trust stops the request.",children:(0,t.jsx)(c.Switch,{label:"Skip the TLS certificate check",checked:a.tlsSkip,onChange:e=>r({tlsSkip:e})})}),(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)("button",{type:"button",className:"text-xs text-mute hover:text-ink",onClick:()=>void n({...e,requests:s.DEFAULT_APP_SETTINGS.requests}),children:"Back to the defaults"})})]})}],57489)},11052,e=>{"use strict";var t=e.i(14368),s=e.i(99181);let n=e=>[...e.dataTransfer.types].includes("Files");function a(e,t=!0){let[r,i]=(0,s.useState)(!1),o=(0,s.useRef)(0);return{over:r,props:{onDragEnter:e=>{t&&n(e)&&(e.preventDefault(),o.current+=1,i(!0))},onDragOver:e=>{t&&n(e)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:e=>{t&&n(e)&&(o.current=Math.max(0,o.current-1),o.current||i(!1))},onDrop:s=>{if(!t||!n(s))return;s.preventDefault(),o.current=0,i(!1);let a=[...s.dataTransfer.files];a.length&&e(a)}}}}e.s(["DropLabel",0,function({onFile:e,className:s,children:n}){let r=a(t=>e(t[0]));return(0,t.jsx)("label",{...r.props,"data-over":r.over?"":void 0,className:s,children:n})},"useFileDrop",0,a])},80707,e=>{"use strict";var t=e.i(14368),s=e.i(1675),n=e.i(95486),a=e.i(60961),r=e.i(88293),i=e.i(99181),o=e.i(68820),l=e.i(14865);e.s(["Select",0,function({value:e,options:c,groups:d=[],onChange:u,onOpen:h,label:p,className:m="",buttonContent:x,minWidth:f=180,disabled:b=!1,search:y}){let[g,w]=(0,i.useState)(!1),[v,k]=(0,i.useState)(""),j=y??c.length>10,N=(0,i.useRef)(null),S=(0,i.useRef)(null),[C,A]=(0,i.useState)(0),[T,E]=(0,i.useState)(new Set),[P,I]=(0,i.useState)(null),$=(0,i.useRef)(null),L=(0,i.useRef)(null),q=(0,i.useId)(),R=c.find(t=>t.value===e),M=[],O=new Set,D=v.trim().toLowerCase(),F=e=>"string"==typeof e||"number"==typeof e?String(e):"";D?c.forEach((e,t)=>{`${e.text??""} ${F(e.label)} ${F(e.hint)} ${e.value}`.toLowerCase().includes(D)&&M.push({kind:"option",index:t})}):c.forEach((e,t)=>{let s=e.group?d.find(t=>t.id===e.group):void 0;s&&!O.has(s.id)&&(O.add(s.id),M.push({kind:"group",group:s})),(!s||T.has(s.id))&&M.push({kind:"option",index:t})}),(0,i.useLayoutEffect)(()=>{if(!g)return;let e=()=>{if(!$.current)return;let e=(0,l.pageRect)($.current),t=(0,l.pageViewport)(),s=Math.max(e.width,f),n=N.current?.offsetHeight??260,a=t.height-e.bottom-8,r=e.top-8,i=a<Math.min(n,200)&&r>a;I({left:Math.min(Math.max(8,e.left),t.width-s-8),top:i?Math.max(8,e.top-Math.min(n,r)-4):e.bottom+4,width:s,maxHeight:Math.max(140,(i?r:a)-4-44*!!j)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[g,f,M.length,j]),(0,i.useEffect)(()=>{if(!g)return;let e=e=>{let t=e.target;N.current?.contains(t)||$.current?.contains(t)||w(!1)},t=e=>{N.current?.contains(e.target)||w(!1)};return document.addEventListener("pointerdown",e,!0),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("scroll",t,!0)}},[g]),(0,i.useEffect)(()=>{g&&L.current?.querySelector(`[data-index="${C}"]`)?.scrollIntoView({block:"nearest"})},[g,C]);let z=()=>{let t=new Set(d.filter(e=>e.defaultOpen).map(e=>e.id));R?.group&&t.add(R.group),E(t);let s=0,n=0,a=new Set;for(let r of c){let i=r.group&&d.some(e=>e.id===r.group)?r.group:void 0;i&&!a.has(i)&&(a.add(i),n++),(!i||t.has(i))&&(r.value===e&&(s=n),n++)}A(s),k(""),w(!0),h?.(),j&&window.setTimeout(()=>S.current?.focus(),0)},W=()=>{w(!1),$.current?.focus()},U=(e,t)=>E(s=>{let n=new Set(s);return t??!n.has(e.id)?n.add(e.id):n.delete(e.id),n}),H=e=>{let t=M[e];if(!t)return;if("group"===t.kind)return U(t.group);let s=c[t.index];s&&u(s.value),W()},_=e=>{if("group"===e.kind)return e.group.text.toLowerCase();let t=c[e.index];return(t.text??("string"==typeof t.label?t.label:String(t.value))).toLowerCase()};function B(e){if(b)return;let t=e.currentTarget===S.current;if(!g){["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),z());return}let s=M[C];if("Escape"===e.key||"Tab"===e.key)"Escape"===e.key&&(e.preventDefault(),e.stopPropagation()),t&&"Escape"===e.key?W():w(!1);else if("ArrowDown"===e.key)e.preventDefault(),A(e=>Math.min(M.length-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),A(e=>Math.max(0,e-1));else if("Home"===e.key||"End"===e.key)e.preventDefault(),A("Home"===e.key?0:M.length-1);else if("ArrowRight"!==e.key||s?.kind!=="group"||t)if("ArrowLeft"===e.key&&s&&!t){e.preventDefault();let t="group"===s.kind?s.group.id:c[s.index].group,n=M.findIndex(e=>"group"===e.kind&&e.group.id===t);if(n<0)return;A(n),U(M[n].group,!1)}else if("Enter"!==e.key&&(" "!==e.key||t)){if(1===e.key.length&&!j){let t=e.key.toLowerCase(),s=M.findIndex((e,s)=>s>C&&_(e).startsWith(t)),n=s>=0?s:M.findIndex(e=>_(e).startsWith(t));n>=0&&A(n)}}else e.preventDefault(),H(C);else e.preventDefault(),U(s.group,!0)}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{ref:$,type:"button",disabled:b,role:"combobox","aria-label":p,"aria-haspopup":"listbox","aria-expanded":g,"aria-controls":g?q:void 0,"aria-activedescendant":g?`${q}-${C}`:void 0,onClick:()=>g?w(!1):z(),onKeyDown:B,className:`inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap disabled:opacity-50 ${m}`,children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:x??R?.label}),(0,t.jsx)(n.ChevronDown,{size:14,"aria-hidden":!0,className:`shrink-0 text-mute transition-transform ${g?"rotate-180":""}`})]}),g&&"u">typeof document?(0,o.createPortal)((0,t.jsxs)("div",{ref:N,style:{top:P?.top??-9999,left:P?.left??-9999,minWidth:P?.width},className:"fixed z-[80] max-w-[min(32rem,calc(100vw-16px))] rounded-lg border border-line bg-panel shadow-2xl",children:[j?(0,t.jsxs)("div",{className:"relative border-b border-line p-1.5",children:[(0,t.jsx)(r.Search,{size:13,"aria-hidden":!0,className:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-mute"}),(0,t.jsx)("input",{ref:S,value:v,onChange:e=>{k(e.target.value),A(0)},onKeyDown:B,"aria-label":`Search ${p}`,"aria-controls":q,"aria-activedescendant":`${q}-${C}`,placeholder:`Search ${c.length}…`,className:"input py-1 pl-7 text-xs"})]}):null,(0,t.jsxs)("ul",{ref:L,id:q,role:"listbox","aria-label":p,style:{maxHeight:P?.maxHeight},className:"overflow-auto p-1",children:[M.map((n,r)=>{if("group"===n.kind){let e=n.group,s=T.has(e.id);return(0,t.jsxs)("li",{id:`${q}-${r}`,"data-index":r,role:"option","aria-selected":!1,"aria-expanded":s,onPointerEnter:()=>A(r),onPointerDown:e=>e.preventDefault(),onClick:()=>U(e),className:`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5 text-xs font-medium text-mute ${r===C?"bg-panel-2":""} ${r>0?"mt-0.5":""}`,children:[(0,t.jsx)(a.ChevronRight,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform ${s?"rotate-90":""}`}),(0,t.jsx)("span",{className:"min-w-0 truncate text-ink",children:e.label}),e.hint?(0,t.jsx)("span",{className:"shrink-0 font-normal",children:e.hint}):null,e.action?(0,t.jsx)("button",{type:"button",title:e.action.title,"aria-label":e.action.title,onClick:t=>{t.stopPropagation(),e.action.keepOpen||w(!1),e.action.onClick()},className:"ml-auto shrink-0 rounded px-1 font-normal text-accent hover:underline",children:e.action.label}):null]},`g:${e.id}`)}let i=c[n.index];return(0,t.jsxs)("li",{id:`${q}-${r}`,"data-index":r,role:"option","aria-selected":i.value===e,onPointerEnter:()=>A(r),onPointerDown:e=>e.preventDefault(),onClick:()=>H(r),className:`flex cursor-pointer items-start gap-2 rounded-md py-1.5 pr-2.5 text-sm ${i.group?"pl-6":"pl-2.5"} ${r===C?"bg-panel-2":""} ${i.className??"text-ink"}`,children:[(0,t.jsx)(s.Check,{size:14,"aria-hidden":!0,className:`mt-0.5 shrink-0 ${i.value===e?"text-accent":"invisible"}`}),i.inline?(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-4",children:[(0,t.jsx)("span",{className:"shrink-0",children:i.label}),i.hint?(0,t.jsx)("span",{className:"ml-auto min-w-0 truncate text-xs text-mute",children:i.hint}):null]}):(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block truncate",children:i.label}),i.hint?(0,t.jsx)("span",{className:"block truncate text-xs text-mute",children:i.hint}):null]})]},i.value)}),D&&!M.length?(0,t.jsx)("li",{className:"px-2.5 py-1.5 text-xs text-mute",children:"Nothing matches."}):null]})]}),document.body):null]})}])},56931,e=>{"use strict";e.s(["CERTIFICATES_CHANGED",()=>x,"CertificatesDialog",()=>g,"certificateApi",()=>b,"openCertificates",()=>f]);var t=e.i(14368),s=e.i(67938),n=e.i(27813),a=e.i(30135),r=e.i(96659),i=e.i(87283),o=e.i(99181),l=e.i(31753),c=e.i(39170),d=e.i(11052),u=e.i(28867),h=e.i(56396),p=e.i(24448);let m="atc:certificates",x="atc:certificates-changed";function f(){window.dispatchEvent(new Event(m))}let b={list:()=>fetch("/engine/certificates",{cache:"no-store"}).then(e=>e.ok?e.json():[]),match:e=>fetch(`/engine/certificates/match?url=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>e.ok?e.json():{host:null}).catch(()=>({host:null}))};async function y(e,t){if(!t)return{name:e.name,text:await e.text()};let s=new Uint8Array(await e.arrayBuffer()),n="";for(let e=0;e<s.length;e+=32768)n+=String.fromCharCode(...s.subarray(e,e+32768));return{name:e.name,base64:btoa(n)}}function g(){let e=(0,h.useToast)(),f=(0,c.useConfirm)(),[g,w]=(0,o.useState)(!1),[v,k]=(0,o.useState)([]),[j,N]=(0,o.useState)(""),[S,C]=(0,o.useState)("pem"),[A,T]=(0,o.useState)(null),[E,P]=(0,o.useState)(null),[I,$]=(0,o.useState)(null),[L,q]=(0,o.useState)(""),[R,M]=(0,o.useState)(!1),[O,D]=(0,o.useState)(null),F=(0,o.useRef)(null),[z,W]=(0,o.useState)([]),[U,H]=(0,o.useState)(null),[_,B]=(0,o.useState)(null);async function V(t){B(null);let s=await fetch("/engine/certificates/cas",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pem:await t.text()})}),n=await s.json().catch(()=>null);if(!s.ok||!Array.isArray(n))return B(n?.error??"Could not add it");W(n),e("Trusted — requests to servers it signed are now checked against it","success")}async function K(e,t){await f({title:`Stop trusting ${t}?`,body:"Servers whose certificate it signed will fail the certificate check again.",confirmLabel:"Remove",tone:"danger"})&&(await fetch(`/engine/certificates/cas/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>void 0),W(await fetch("/engine/certificates/cas").then(e=>e.ok?e.json():[])))}async function J(){M(!0),D(null);try{let t=await fetch("/engine/certificates",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({host:j,kind:S,cert:A?.text,key:E?.text,pfx:I?.base64,passphrase:L||void 0})}),s=await t.json().catch(()=>null);if(!t.ok)throw Error(s?.error??"Could not save the certificate");e(`Requests to ${s?.host??j} now present this certificate`,"success"),N(""),T(null),P(null),$(null),q(""),D(null),k(await b.list()),window.dispatchEvent(new Event(x))}catch(e){D(e instanceof Error?e.message:String(e))}finally{M(!1)}}async function G(e){await f({title:`Remove the certificate for ${e.host}?`,body:"Requests to that host stop presenting it. Its private key is deleted from this computer.",confirmLabel:"Remove",tone:"danger"})&&(await fetch(`/engine/certificates/${encodeURIComponent(e.id)}`,{method:"DELETE"}).catch(()=>void 0),k(await b.list()),window.dispatchEvent(new Event(x)))}if((0,o.useEffect)(()=>{let e=()=>w(!0);return window.addEventListener(m,e),()=>window.removeEventListener(m,e)},[]),(0,o.useEffect)(()=>{g&&(b.list().then(k),fetch("/engine/certificates/cas").then(e=>e.ok?e.json():[]).then(W),fetch("/engine/certificates/system").then(e=>e.ok?e.json():{count:0}).then(e=>H(e.count)))},[g]),!g)return null;let Y=j.trim()&&("pfx"===S?I:A&&E),X=(e,n,a,r,i=!1)=>(0,t.jsxs)(d.DropLabel,{className:"group block",onFile:e=>void y(e,i).then(r),children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:e}),(0,t.jsxs)("span",{className:"flex items-center gap-2 rounded-md border border-dashed border-line px-3 py-2 text-sm group-data-[over]:border-accent hover:border-mute",children:[(0,t.jsx)(s.FileUp,{size:14,className:"text-mute","aria-hidden":!0}),(0,t.jsx)("span",{className:`min-w-0 truncate ${a?"text-ink":"text-mute"}`,children:a?.name??"Choose a file…"}),(0,t.jsx)("input",{type:"file",accept:n,className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&y(t,i).then(r),e.target.value=""}})]})]});return(0,t.jsx)("div",{className:"fixed inset-0 z-50 grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>e.target===e.currentTarget&&w(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"certs-title",onKeyDown:e=>"Escape"===e.key&&w(!1),className:"flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{id:"certs-title",className:"text-base font-medium text-ink",children:"Certificates"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"For APIs that ask for a certificate (mutual TLS). Every request to the host presents it — on Send, in collection runs and in performance tests."})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(p.GuideLink,{topic:"sending-requests#client-certificates-mutual-tls"}),(0,t.jsx)("button",{type:"button","aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>w(!1),children:(0,t.jsx)(i.X,{size:16})})]})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-auto px-5 py-4",children:[v.length?(0,t.jsx)("ul",{className:"divide-y divide-line rounded-md border border-line",children:v.map(e=>{let s=!!e.expires&&Date.parse(e.expires)<Date.now();return(0,t.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2 text-sm",children:[(0,t.jsx)(a.ShieldCheck,{size:15,className:s?"text-bad":"text-ok","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-ink",children:e.host}),(0,t.jsx)("span",{className:"block truncate text-xs text-mute",children:[e.subject?`CN ${e.subject}`:"","pfx"===e.kind?"PFX":"PEM",e.hasPassphrase?"passphrase saved":"",e.expires?`${s?"expired":"valid until"} ${new Date(e.expires).toLocaleDateString()}`:""].filter(Boolean).join(" · ")})]}),(0,t.jsx)("button",{type:"button","aria-label":`Remove the certificate for ${e.host}`,onClick:()=>void G(e),className:"rounded p-1 text-mute hover:text-bad",children:(0,t.jsx)(r.Trash2,{size:14})})]},e.id)})}):(0,t.jsx)("p",{className:"text-sm text-mute",children:"No certificates yet."}),(0,t.jsxs)("section",{className:"space-y-3 rounded-md border border-line p-4",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-ink",children:"Add a certificate"}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Host"}),(0,t.jsx)("input",{ref:F,value:j,onChange:e=>N(e.target.value),placeholder:"api.example.com",className:"input font-mono",spellCheck:!1}),(0,t.jsxs)("span",{className:"mt-1 block text-xs text-mute",children:[(0,t.jsx)("code",{className:"font-mono",children:"*.example.com"})," for every subdomain; add ",(0,t.jsx)("code",{className:"font-mono",children:":8443"})," for one port only."]})]}),(0,t.jsx)(u.Segmented,{label:"Certificate format",value:S,onChange:C,options:[{value:"pem",label:"Certificate + key (PEM, CRT)"},{value:"pfx",label:"PFX / P12"}]}),"pem"===S?(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[X("Certificate",".pem,.crt,.cer",A,T),X("Private key",".pem,.key",E,P)]}):X("PFX or P12 file",".pfx,.p12",I,$,!0),(0,t.jsx)(l.LabeledInput,{label:"Passphrase (if the key or file has one)",secret:!0,value:L,onChange:q}),O?(0,t.jsx)("p",{className:"text-sm text-bad",children:O}):null,(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("p",{className:"text-xs text-mute",children:"Checked before saving. The private key and passphrase are kept encrypted on this computer and never exported."}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary shrink-0",disabled:!Y||R,onClick:()=>void J(),children:[R?(0,t.jsx)(n.Loader2,{size:14,className:"animate-spin"}):null,"Add certificate"]})]})]}),(0,t.jsxs)("section",{className:"space-y-3 rounded-md border border-line p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-ink",children:"Trusted certificate authorities"}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["For internal servers whose certificate comes from your company's own CA — instead of skipping the certificate check.",U?` The ${U} certificates this computer already trusts (including a company proxy's) are used automatically.`:""]})]}),z.length?(0,t.jsx)("ul",{className:"divide-y divide-line rounded-md border border-line",children:z.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2 text-sm",children:[(0,t.jsx)(a.ShieldCheck,{size:15,className:Date.parse(e.expires)<Date.now()?"text-bad":"text-ok","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-ink",children:e.subject}),(0,t.jsxs)("span",{className:"block text-xs text-mute",children:["valid until ",new Date(e.expires).toLocaleDateString()]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Stop trusting ${e.subject}`,onClick:()=>void K(e.id,e.subject),className:"rounded p-1 text-mute hover:text-bad",children:(0,t.jsx)(r.Trash2,{size:14})})]},e.id))}):null,(0,t.jsxs)(d.DropLabel,{onFile:e=>void V(e),className:"inline-flex cursor-pointer items-center gap-2 rounded-md border border-dashed border-line px-3 py-2 text-sm text-ink data-[over]:border-accent hover:border-mute",children:[(0,t.jsx)(s.FileUp,{size:14,className:"text-mute","aria-hidden":!0})," Add a CA certificate (.pem, .crt) — or drop it here",(0,t.jsx)("input",{type:"file",accept:".pem,.crt,.cer",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&V(t),e.target.value=""}})]}),_?(0,t.jsx)("p",{className:"text-sm text-bad",children:_}):null]})]})]})})}},22079,69159,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(54185),n=e.i(51342),a=e.i(17118),r=e.i(68204),i=e.i(75117),o=e.i(58606),l=e.i(67938),c=e.i(31035),d=e.i(27813),u=e.i(73617),h=e.i(96659),p=e.i(87283),m=e.i(99181),x=e.i(39170),f=e.i(11052),b=e.i(56396),y=e.i(15060),g=e.i(40945),w=e.i(44085),v=e.i(71189),k=e.i(88293),j=e.i(23227),N=e.i(6278);function S({covered:e,total:s}){let n=s?Math.round(e/s*100):0;return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-sm",children:[(0,t.jsxs)("span",{className:"font-medium text-ink",children:[e," of ",s," operations have a request"]}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:[n,"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-panel-2",role:"progressbar","aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":e,"aria-label":"Operations with a request",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-300",style:{width:`${n}%`}})})]})}function C({requests:e,name:s}){let[n,a]=(0,m.useState)(!1);return e.length?(0,t.jsxs)("div",{className:"rounded-md border border-warn/40 bg-warn/5 px-3 py-2 text-sm",children:[(0,t.jsxs)("button",{type:"button",className:"w-full text-left text-ink",onClick:()=>a(e=>!e),"aria-expanded":n,children:[e.length," saved request",1===e.length?" isn't":"s aren't"," in the description",(0,t.jsxs)("span",{className:"block text-xs text-mute",children:["They stay as they are; their answers fail ",(0,t.jsxs)("span",{className:"text-ink",children:["… is in “",s,"”"]}),". Either the path differs, or the description is missing it. ",n?"Hide":"Show"," them."]})]}),n?(0,t.jsx)("ul",{className:"mt-2 space-y-0.5 text-xs",children:e.map(e=>(0,t.jsxs)("li",{className:"flex gap-2",children:[(0,t.jsx)("span",{className:"w-12 shrink-0 font-mono text-mute",children:e.method}),(0,t.jsxs)("span",{className:"min-w-0 truncate text-ink",title:e.url,children:[e.collection,"/",e.name]})]},e.id))}):null]}):null}function A({detail:e,missing:s,folder:n,onDone:a,label:r}){let i=(0,b.useToast)(),{refresh:o}=(0,N.useWorkspace)(),[l,c]=(0,m.useState)(e.server??""),[u,h]=(0,m.useState)(!e.server),[p,x]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{c(e.server??""),h(!e.server)},[e.id,e.server]),!s||!n)return null;let f=/^https?:\/\/[^/\s]+/i.test(l.trim());return(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-line p-3",children:[u?(0,t.jsxs)("label",{className:"block space-y-1",children:[(0,t.jsxs)("span",{className:"text-xs text-mute",children:["Where the API runs",e.server?"":" — the description gives only a path, so the new requests need the address"]}),(0,t.jsx)("input",{value:l,onChange:e=>c(e.target.value),placeholder:"https://api.example.com/v1","aria-label":"Where the API runs",className:`input py-1.5 font-mono text-sm ${l&&!f?"border-bad":""}`})]}):(0,t.jsxs)("p",{className:"text-xs text-mute",children:["New requests go to ",(0,t.jsx)("code",{className:"font-mono text-ink",children:l}),", as ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{baseUrl}}"})," in an environment named after the API."," ",(0,t.jsx)("button",{type:"button",className:"text-accent hover:underline",onClick:()=>h(!0),children:"Change"})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",disabled:p||!f,onClick:async()=>{x(!0);try{let t=await j.contractsApi.addMissing(e.id,n,l.trim());await o(),i(`Added ${t.added} request${1===t.added?"":"s"} to ${n}${t.environment?` — pick the “${t.environment}” environment to send them`:""}`,"success"),a()}catch(e){i(e instanceof Error?e.message:"Couldn't add them","error")}finally{x(!1)}},children:[p?(0,t.jsx)(d.Loader2,{size:13,className:"animate-spin","aria-hidden":!0}):(0,t.jsx)(v.Plus,{size:13,"aria-hidden":!0})," ",r??`Add ${s} missing request${1===s?"":"s"} to ${n}`]}),(0,t.jsx)("p",{className:"text-[11px] text-mute",children:"Requests already in the folder stay as they are — only operations with none get one, with example values and a status check."})]})}function T({id:e,suggested:s,onUsed:n}){let a=(0,b.useToast)(),{index:r,refresh:i}=(0,N.useWorkspace)(),o=(0,m.useMemo)(()=>(r?.folders??[]).map(e=>e.path).sort((e,t)=>e.localeCompare(t)),[r]),l="\0new",[c,u]=(0,m.useState)(l),[h,p]=(0,m.useState)(s),[x,f]=(0,m.useState)(!1),y=c===l?h.trim():c;return(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,t.jsxs)("label",{className:"min-w-[12rem] flex-1 space-y-1",children:[(0,t.jsx)("span",{className:"text-xs text-mute",children:"Folder"}),(0,t.jsxs)("select",{value:c,onChange:e=>u(e.target.value),"aria-label":"Folder to check",className:"input py-1.5 text-sm",children:[(0,t.jsx)("option",{value:l,children:"A new folder…"}),o.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})]}),c===l?(0,t.jsxs)("label",{className:"min-w-[12rem] flex-1 space-y-1",children:[(0,t.jsx)("span",{className:"text-xs text-mute",children:"Its name"}),(0,t.jsx)("input",{value:h,onChange:e=>p(e.target.value),"aria-label":"New folder's name",className:"input py-1.5 text-sm"})]}):null,(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",disabled:x||!y,onClick:async()=>{f(!0);try{await j.contractsApi.use(e,y),await i(),a(`${y} checks its answers against it now`,"success"),n(y)}catch(e){a(e instanceof Error?e.message:"Couldn't use it","error")}finally{f(!1)}},children:[x?(0,t.jsx)(d.Loader2,{size:13,className:"animate-spin","aria-hidden":!0}):(0,t.jsx)(w.FolderPlus,{size:13,"aria-hidden":!0})," Use it for this folder"]})]})}function E({operations:e}){let[s,n]=(0,m.useState)("all"),[r,i]=(0,m.useState)(""),o=e.filter(e=>e.requests.length).length,l=e.filter(e=>{if("missing"===s&&e.requests.length||"covered"===s&&!e.requests.length)return!1;let t=r.trim().toLowerCase();return!t||`${e.method} ${e.path} ${e.summary??""}`.toLowerCase().includes(t)}),c=(e,a)=>(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":s===e,onClick:()=>n(e),className:`rounded-md px-2.5 py-1 text-xs ${s===e?"bg-accent-dim text-ink":"text-mute hover:text-ink"}`,children:a});return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{role:"radiogroup","aria-label":"Show operations",className:"flex rounded-lg border border-line p-0.5",children:[c("all",`All ${e.length}`),c("missing",`No request ${e.length-o}`),c("covered",`Have one ${o}`)]}),(0,t.jsxs)("label",{className:"relative ml-auto min-w-[10rem] flex-1 sm:max-w-xs",children:[(0,t.jsx)(k.Search,{size:13,className:"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-mute","aria-hidden":!0}),(0,t.jsx)("input",{value:r,onChange:e=>i(e.target.value),placeholder:"Find an operation","aria-label":"Find an operation",className:"input py-1 pr-7 pl-8 text-sm"}),r?(0,t.jsx)("button",{type:"button","aria-label":"Clear",onClick:()=>i(""),className:"absolute top-1/2 right-2 -translate-y-1/2 text-mute hover:text-ink",children:(0,t.jsx)(p.X,{size:12})}):null]})]}),(0,t.jsxs)("ul",{className:"divide-y divide-line rounded-md border border-line","aria-label":"Operations",children:[l.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2.5 px-3 py-2 text-sm",children:[e.requests.length?(0,t.jsx)(a.CheckCircle2,{size:15,className:"mt-0.5 shrink-0 text-ok","aria-label":"Has a request"}):(0,t.jsx)(g.Circle,{size:15,className:"mt-0.5 shrink-0 text-line","aria-label":"No request"}),(0,t.jsx)("span",{className:"w-14 shrink-0 font-mono text-xs leading-5 text-mute",children:e.method}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"font-mono break-all text-ink",children:e.path}),e.summary?(0,t.jsx)("span",{className:"block text-xs text-mute",children:e.summary}):null]}),(0,t.jsx)("span",{className:"max-w-[40%] shrink-0 truncate text-right text-xs text-mute",title:e.requests.map(e=>`${e.collection}/${e.name}`).join("\n"),children:e.requests.length?e.requests.map(e=>e.name).join(", "):"No request"})]},`${e.method} ${e.path}`)),l.length?null:(0,t.jsxs)("li",{className:"px-3 py-4 text-center text-sm text-mute",children:["None ",r?`match “${r}”`:"here","."]})]})]})}e.s(["AddMissing",0,A,"CoverageBar",0,S,"FolderCoverage",0,function({id:e,folder:s}){let[n,a]=(0,m.useState)(null),[r,i]=(0,m.useState)(null),o=()=>j.contractsApi.get(e,s).then(e=>(a(e),i(null)),e=>i(e instanceof Error?e.message:"Couldn't read it"));if((0,m.useEffect)(()=>{a(null),o()},[e,s]),r)return(0,t.jsx)("p",{className:"text-sm text-bad",children:r});if(!n)return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-mute",children:[(0,t.jsx)(d.Loader2,{size:14,className:"animate-spin","aria-hidden":!0})," Reading it…"]});if(n.error)return(0,t.jsx)("p",{className:"text-sm text-bad",children:n.error});let l=n.operations.filter(e=>e.requests.length).length,c=n.operations.length-l;return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border border-line bg-panel-2/40 p-3",children:[(0,t.jsx)("p",{className:"text-xs font-medium tracking-wide text-mute uppercase",children:"In this folder"}),(0,t.jsx)(S,{covered:l,total:n.operations.length}),(0,t.jsx)(C,{requests:n.unmatched,name:n.name}),c?(0,t.jsx)(A,{detail:n,missing:c,folder:s,onDone:()=>void o(),label:`Add the ${c} missing request${1===c?"":"s"} here`}):(0,t.jsx)("p",{className:"text-sm text-ok",children:"Every operation has a request here."})]})},"OperationList",0,E,"Unmatched",0,C,"UseInFolder",0,T],69159);var P=e.i(24448);let I="atc:contracts";function $({detail:e,covered:s}){let n=[{done:!0,title:"Added",text:`${e.operations.length} operations`},{done:e.folders.length>0,title:"A folder uses it",text:e.folders.length?e.folders.join(", "):"Pick one below"},{done:s>0,title:"Requests for its operations",text:s?`${s} have one`:"Yours, or added for you"},{done:!1,title:"Send or run",text:"Each answer is checked — see the Checks tab"}];return(0,t.jsx)("ol",{className:"grid gap-2 sm:grid-cols-4","aria-label":"How it works",children:n.map((e,s)=>(0,t.jsxs)("li",{className:`rounded-lg border px-2.5 py-2 ${e.done?"border-accent/50 bg-accent-dim":"border-line"}`,children:[(0,t.jsxs)("span",{className:"flex items-start gap-1.5 text-xs font-medium text-ink",children:[e.done?(0,t.jsx)(a.CheckCircle2,{size:13,className:"mt-px shrink-0 text-accent","aria-label":"Done"}):(0,t.jsx)("span",{className:"mt-px grid h-[13px] w-[13px] shrink-0 place-items-center rounded-full border border-mute text-[9px] text-mute",children:s+1}),e.title]}),(0,t.jsx)("span",{className:"mt-0.5 block pl-[19px] text-[11px] leading-4 text-mute",children:e.text})]},e.title))})}function L(){return(0,t.jsxs)("div",{className:"space-y-2 text-sm text-mute",children:[(0,t.jsxs)("p",{children:["An API description is an ",(0,t.jsx)("span",{className:"text-ink",children:"OpenAPI 3"})," or ",(0,t.jsx)("span",{className:"text-ink",children:"Swagger 2"})," file, in JSON or YAML. It names the API's operations and what each one answers. A small one:"]}),(0,t.jsx)("pre",{className:"max-h-56 overflow-auto rounded-md border border-line bg-panel-2 p-3 font-mono text-xs leading-5 text-ink","aria-label":"A sample API description",children:s.CONTRACT_SAMPLE}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-sm",onClick:()=>(0,y.downloadText)("openapi-sample.yaml",s.CONTRACT_SAMPLE,"text/yaml"),children:[(0,t.jsx)(i.Download,{size:13,"aria-hidden":!0})," Download this sample"]}),(0,t.jsx)("a",{href:"https://apitestcenter.com/docs/contract-tests.html",target:"_blank",rel:"noreferrer",className:"btn btn-secondary py-1 text-sm",children:"Contract tests in the guide"})]}),(0,t.jsxs)("p",{className:"text-xs",children:["Where to find your API's: most frameworks publish it at an address — ",(0,t.jsx)("code",{children:"/openapi.json"})," (FastAPI, NestJS), ",(0,t.jsx)("code",{children:"/v3/api-docs"})," (Spring), ",(0,t.jsx)("code",{children:"/swagger/v1/swagger.json"})," (.NET) — add it with ",(0,t.jsx)("span",{className:"text-ink",children:"From a web address"}),". Or ask the API's team for its OpenAPI file."]})]})}e.s(["ContractsDialog",0,function(){let e=(0,b.useToast)(),a=(0,x.useConfirm)(),{refresh:i}=(0,N.useWorkspace)(),y=(0,j.useContracts)(),[g,w]=(0,m.useState)(!1),[v,k]=(0,m.useState)(null),[q,R]=(0,m.useState)(null),[M,O]=(0,m.useState)(null),[D,F]=(0,m.useState)(null),[z,W]=(0,m.useState)(""),[U,H]=(0,m.useState)(!1),[_,B]=(0,m.useState)(null),[V,K]=(0,m.useState)(!1),[J,G]=(0,m.useState)(null),Y=(0,m.useRef)(null),X=(0,m.useRef)(null),Q=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=e=>{w(!0);let t=e.detail;t&&k(t)};return window.addEventListener(I,e),()=>window.removeEventListener(I,e)},[]),(0,m.useEffect)(()=>{if(!g)return;window.setTimeout(()=>Q.current?.focus(),0);let e=e=>"Escape"===e.key&&!M&&w(!1);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,M]),(0,m.useEffect)(()=>{!y||v&&y.some(e=>e.id===v)||k(y[0]?.id??null)},[y,v]);let Z=e=>e?j.contractsApi.get(e).then(e=>{R(e),W(t=>e.folders.includes(t)?t:e.folders[0]??"")},()=>R(null)):Promise.resolve(R(null));async function ee(t,s,n){O(t);try{let t=await s();return n&&e(n(t),"success"),t}catch(t){e(t instanceof Error?t.message:"That didn't work","error");return}finally{O(null)}}async function et(t,n){if(t){if(t.size>0xa00000)return B({what:t.name,message:"It's larger than 10 MB."});O(n?"replace":"add");try{let a=await t.text();(0,s.readContract)(a);let r=await (n?j.contractsApi.update(n,{text:a}):j.contractsApi.add({text:a}));B(null),e(n?`Replaced the file of ${r.name}`:`Added ${r.name}: ${r.operations} operations`,"success"),k(r.id)}catch(e){B({what:t.name,message:e instanceof Error?e.message:"It couldn't be read."})}finally{O(null)}}}async function es(t){try{(0,s.readContract)(t)}catch(e){return B({what:"the pasted text",message:e instanceof Error?e.message:"It couldn't be read."})}O("paste");try{let s=await j.contractsApi.add({text:t});B(null),G(null),e(`Added ${s.name}: ${s.operations} operations`,"success"),k(s.id)}catch(e){B({what:"the pasted text",message:e instanceof Error?e.message:"It couldn't be read."})}finally{O(null)}}async function en(e){for(let t of e)await et(t)}(0,m.useEffect)(()=>{g&&Z(v)},[g,v,y]);let ea=(0,f.useFileDrop)(e=>void en(e),g&&!M);if(!g)return null;let er=q?.operations.filter(e=>e.requests.length).length??0,ei=(q?.operations.length??0)-er;return(0,t.jsx)("div",{className:"fixed inset-0 z-[80] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-10",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&!M&&w(!1),children:(0,t.jsxs)("div",{...ea.props,role:"dialog","aria-modal":"true","aria-labelledby":"contracts-title",className:"relative flex h-[min(680px,calc(100vh-2rem))] w-full max-w-4xl flex-col rounded-xl border border-line bg-panel shadow-2xl",children:[ea.over?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-2 z-10 flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-accent bg-panel/90 text-sm text-ink",children:[(0,t.jsx)(l.FileUp,{size:24,className:"text-accent","aria-hidden":!0}),"Drop the OpenAPI or Swagger file to add it"]}):null,(0,t.jsxs)("header",{className:"flex items-start gap-3 border-b border-line px-5 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{id:"contracts-title",className:"text-base font-medium text-ink",children:"API descriptions"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"OpenAPI or Swagger files that answers are checked against — the contract. A folder picks one in its settings, and every request inside is checked on Send and in collection runs."})]}),(0,t.jsx)(P.GuideLink,{topic:"contract-tests",className:"ml-auto"}),(0,t.jsx)("button",{ref:Q,type:"button",onClick:()=>w(!1),disabled:!!M,"aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(p.X,{size:16})})]}),(0,t.jsx)("input",{ref:Y,type:"file",accept:".json,.yaml,.yml,application/json,text/yaml",className:"sr-only","aria-label":"Choose an OpenAPI file",onChange:e=>(et(e.target.files?.[0]),e.target.value="")}),(0,t.jsx)("input",{ref:X,type:"file",accept:".json,.yaml,.yml,application/json,text/yaml",className:"sr-only","aria-label":"Choose the new file",onChange:e=>(et(e.target.files?.[0],v??void 0),e.target.value="")}),(0,t.jsxs)("div",{className:"grid min-h-0 flex-1 md:grid-cols-[240px_1fr]",children:[(0,t.jsxs)("aside",{className:"flex min-h-0 flex-col border-b border-line md:border-r md:border-b-0",children:[(0,t.jsxs)("ul",{className:"min-h-0 flex-1 overflow-y-auto p-2","aria-label":"API descriptions",children:[null===y?(0,t.jsx)("li",{className:"p-2 text-sm text-mute",children:"Loading…"}):null,y?.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","aria-current":e.id===v,onClick:()=>k(e.id),className:`w-full rounded-md px-2.5 py-2 text-left ${e.id===v?"bg-accent-dim":"hover:bg-panel-2"}`,children:[(0,t.jsx)("span",{className:"block truncate text-sm text-ink",children:e.name}),(0,t.jsx)("span",{className:"block truncate text-xs text-mute",children:e.error?"Doesn't read":`${e.operations} operations${e.version?` \xb7 v${e.version}`:""}`})]})},e.id))]}),(0,t.jsxs)("div",{className:"space-y-1.5 border-t border-line p-2",children:[(0,t.jsx)("p",{className:"px-1 text-xs font-medium tracking-wide text-mute uppercase",children:"Add one"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary w-full justify-start py-1.5 text-sm",disabled:!!M,onClick:()=>Y.current?.click(),children:[(0,t.jsx)(l.FileUp,{size:14,"aria-hidden":!0})," A file… ",(0,t.jsx)("span",{className:"ml-auto text-xs text-mute",children:"or drop it"})]}),null===D?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary w-full justify-start py-1.5 text-sm",disabled:!!M,onClick:()=>F(""),children:[(0,t.jsx)(c.Globe,{size:14,"aria-hidden":!0})," From a web address…"]}):(0,t.jsxs)("form",{className:"space-y-1.5",onSubmit:t=>{t.preventDefault(),O("url"),j.contractsApi.add({url:D}).then(t=>{e(`Added ${t.name}: ${t.operations} operations`,"success"),B(null),k(t.id),F(null)},e=>B({what:D.trim(),message:e instanceof Error?e.message:"It couldn't be read."})).finally(()=>O(null))},children:[(0,t.jsx)("input",{autoFocus:!0,value:D,onChange:e=>F(e.target.value),placeholder:"https://…/openapi.json","aria-label":"Address of the description",className:"input py-1.5 text-sm"}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsxs)("button",{type:"submit",className:"btn btn-primary flex-1 py-1 text-sm",disabled:!D.trim()||!!M,children:["url"===M?(0,t.jsx)(d.Loader2,{size:13,className:"animate-spin"}):null," Add"]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1 text-sm",onClick:()=>F(null),children:"Cancel"})]})]}),null===J?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary w-full justify-start py-1.5 text-sm",disabled:!!M,onClick:()=>G(""),children:[(0,t.jsx)(r.ClipboardPaste,{size:14,"aria-hidden":!0})," Paste its text…"]}):(0,t.jsxs)("form",{className:"space-y-1.5",onSubmit:e=>{e.preventDefault(),es(J)},children:[(0,t.jsx)("textarea",{autoFocus:!0,value:J,onChange:e=>G(e.target.value),rows:5,spellCheck:!1,placeholder:"openapi: 3.0.3\ninfo: …\npaths: …","aria-label":"The description's text",className:"input font-mono text-xs"}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsxs)("button",{type:"submit",className:"btn btn-primary flex-1 py-1 text-sm",disabled:!J.trim()||!!M,children:["paste"===M?(0,t.jsx)(d.Loader2,{size:13,className:"animate-spin"}):null," Add"]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1 text-sm",onClick:()=>G(null),children:"Cancel"})]})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary w-full justify-start py-1.5 text-sm",disabled:!!M,title:"The practice API's own description, to try contract tests",onClick:()=>void ee("practice",()=>j.contractsApi.add({practice:!0}),e=>`Added ${e.name}: ${e.operations} operations`).then(e=>e&&k(e.id)),children:[(0,t.jsx)(u.Store,{size:14,"aria-hidden":!0})," Practice shop"]})]})]}),(0,t.jsxs)("section",{className:"min-h-0 overflow-y-auto px-5 py-4","aria-label":"The description",children:[_?(0,t.jsxs)("div",{role:"alert",className:"mb-4 space-y-3 rounded-lg border border-bad/40 bg-bad/5 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(n.AlertCircle,{size:16,className:"mt-0.5 shrink-0 text-bad","aria-hidden":!0}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-medium break-all text-ink",children:["Couldn't add ",_.what]}),(0,t.jsx)("p",{className:"text-sm text-mute",children:_.message}),/^https?:\/\//i.test(_.what)?(0,t.jsxs)("p",{className:"mt-1 text-sm text-mute",children:["If it opens in your browser, copy all of it there (",(0,t.jsx)("kbd",{children:"Ctrl+A"}),", ",(0,t.jsx)("kbd",{children:"Ctrl+C"}),") and use"," ",(0,t.jsx)("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{B(null),G("")},children:"Paste its text"}),". Or save it as a file and drop it here."]}):null]}),(0,t.jsx)("button",{type:"button",onClick:()=>B(null),"aria-label":"Close the message",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(p.X,{size:14})})]}),(0,t.jsx)(L,{})]}):null,y&&!y.length?_?null:(0,t.jsxs)("div",{className:"mx-auto max-w-lg space-y-2 pt-10 text-center text-sm text-mute",children:[(0,t.jsx)(o.FileCode2,{size:28,className:"mx-auto text-line","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-ink",children:"No API descriptions yet."}),(0,t.jsx)("p",{children:"Add your API's OpenAPI file — choose it, or drop it here — or the practice shop's, to try it. Importing an OpenAPI file also adds it."}),(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>K(e=>!e),"aria-expanded":V,children:V?"Hide the sample":"What does one look like?"}),V?(0,t.jsx)("div",{className:"pt-2 text-left",children:(0,t.jsx)(L,{})}):null]}):q?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("input",{defaultValue:q.name,"aria-label":"Name",className:"input w-full py-1.5 text-base font-medium",onBlur:e=>{let t=e.target.value.trim();t&&t!==q.name&&ee("rename",()=>j.contractsApi.update(q.id,{name:t}))}},q.id),(0,t.jsx)("p",{className:"mt-1 text-xs text-mute",children:q.error?(0,t.jsx)("span",{className:"text-bad",children:q.error}):`${q.title}${q.version?` ${q.version}`:""} \xb7 ${"swagger"===q.kind?"Swagger 2.0":"OpenAPI 3"}`})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:!!M,onClick:()=>X.current?.click(),children:[(0,t.jsx)(l.FileUp,{size:14,"aria-hidden":!0})," Replace the file…"]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:!!M,"aria-label":`Delete ${q.name}`,onClick:async()=>{await a({title:`Delete ${q.name}?`,body:q.folders.length?`${q.folders.join(", ")} will stop checking answers against it. Requests stay as they are.`:"Requests stay as they are.",confirmLabel:"Delete",tone:"danger"})&&ee("delete",()=>j.contractsApi.remove(q.id).then(()=>i()),()=>`Deleted ${q.name}`)},children:(0,t.jsx)(h.Trash2,{size:14,"aria-hidden":!0})})]}),(0,t.jsx)($,{detail:q,covered:er}),(0,t.jsxs)("section",{"aria-label":"Folders that check against it",className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-ink",children:"Folders that check against it"}),q.folders.length?(0,t.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:q.folders.map(e=>(0,t.jsxs)("li",{className:"inline-flex items-center gap-1 rounded-full border border-line bg-panel-2 py-0.5 pr-1 pl-2.5 text-sm text-ink",children:[e,(0,t.jsx)("button",{type:"button","aria-label":`Stop checking ${e}`,title:"Stop checking this folder (its requests stay)",className:"rounded-full p-0.5 text-mute hover:text-bad",onClick:()=>void ee("stop",()=>j.contractsApi.use(q.id,e,!1).then(()=>i()),()=>`${e} doesn't check against it any more`),children:(0,t.jsx)(p.X,{size:12})})]},e))}):(0,t.jsx)("p",{className:"text-sm text-mute",children:"None yet. Pick the folder with this API's requests — or a new one, to fill with a request for every operation."}),q.folders.length&&!U?(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>H(!0),children:"Use it for another folder too…"}):(0,t.jsx)(T,{id:q.id,suggested:q.name,onUsed:e=>{H(!1),W(e),Z(q.id)}},q.id)]}),(0,t.jsxs)("section",{"aria-label":"Requests for its operations",className:"space-y-2",children:[(0,t.jsx)(S,{covered:er,total:q.operations.length}),q.folders.length>1&&ei?(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-mute",children:["New requests go in",(0,t.jsx)("select",{value:z,onChange:e=>W(e.target.value),"aria-label":"Folder for the new requests",className:"input w-auto py-1 text-sm",children:q.folders.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}):null,q.folders.length?(0,t.jsx)(A,{detail:q,missing:ei,folder:z,onDone:()=>void Z(q.id)}):null,(0,t.jsx)(C,{requests:q.unmatched??[],name:q.name})]}),(0,t.jsx)(E,{operations:q.operations})]}):null]})]})]})})},"openContracts",0,function(e){window.dispatchEvent(new CustomEvent(I,{detail:e}))}],22079)},67217,e=>{"use strict";e.s(["ImportDialog",()=>w,"openImport",()=>b]);var t=e.i(14368);e.i(24856);var s=e.i(90372),n=e.i(67938),a=e.i(27813),r=e.i(42709),i=e.i(87283),o=e.i(36994),l=e.i(99181),c=e.i(69578),d=e.i(56396),u=e.i(23227),h=e.i(44505),p=e.i(65238),m=e.i(6278),x=e.i(24448);let f="atc:import";function b(){window.dispatchEvent(new Event(f))}let y={postman:"Postman collection","postman-environment":"Postman environment",openapi:"OpenAPI",swagger:"Swagger 2.0",har:"Browser recording (HAR)",insomnia:"Insomnia",http:".http file",hurl:"Hurl file",bruno:"Bruno",several:"Several files",apitestcenter:"APITestCenter collection"},g={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"};function w(){let[e,b]=(0,l.useState)(!1),[w,v]=(0,l.useState)(null),[k,j]=(0,l.useState)(""),[N,S]=(0,l.useState)(""),[C,A]=(0,l.useState)(null),[T,E]=(0,l.useState)(!1),[P,I]=(0,l.useState)(""),[$,L]=(0,l.useState)(!1),[q,R]=(0,l.useState)(null),[M,O]=(0,l.useState)(!0),D=(0,l.useRef)(null),F=(0,l.useRef)(null),{refresh:z,index:W,setActiveEnv:U}=(0,m.useWorkspace)(),H=(0,d.useToast)(),_=(0,o.useRouter)(),B=(0,o.usePathname)();function V(e,t){A(null);try{let n=(0,s.importFile)(e,t);v(n),R("openapi"===n.kind||"swagger"===n.kind?e:null),j(t),S(n.title.slice(0,60))}catch(e){v(null),A(e instanceof Error?e.message:"Could not read that file")}}async function K(e){let t=[...e];if(!t.length)return;let n=t.find(e=>e.size>0x1400000);if(n)return A(`${n.name} is larger than 20 MB`);if(1===t.length)return V(await t[0].text(),t[0].name);A(null);try{let e=(0,s.importFiles)(await Promise.all(t.map(async e=>({name:e.name,text:await e.text()}))));v(e),R(null),j(`${t.length} files`),S(e.title.slice(0,60))}catch(e){v(null),A(e instanceof Error?e.message:"Could not read those files")}}(0,l.useEffect)(()=>{let e=()=>{b(!0),v(null),A(null),E(!1),I("")};return window.addEventListener(f,e),()=>window.removeEventListener(f,e)},[]),(0,l.useEffect)(()=>{let e=(0,h.desktop)();if(!e?.takeOpenedFile)return;let t=()=>void e.takeOpenedFile().then(e=>{e&&(b(!0),E(!1),V(e.text,e.name))});return t(),e.onFileOpened?.(t)},[]),(0,l.useEffect)(()=>{if(!e)return;F.current?.focus();let t=e=>"Escape"===e.key&&!$&&b(!1);return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,$]);let J=(0,l.useMemo)(()=>{if(!w)return 0;let e=N.trim().toLowerCase();return(W?.requests??[]).filter(t=>t.collection.toLowerCase()===e).length},[W,w,N]);async function G(){if(w){L(!0);try{let e=N.trim()||w.title,t=t=>[e,...t.split("/").slice(1)].join("/"),s=q&&M?await u.contractsApi.add({text:q,name:e}):null,n=await m.workspaceApi.importAll({requests:w.requests.map(e=>({collection:t(e.collection),name:e.name.slice(0,200),request:s?{...e.request,checks:e.request.checks.filter(e=>"schema"!==e.type)}:e.request,...e.ref?{ref:e.ref}:{},...e.runFirst?{runFirst:e.runFirst}:{}})),folders:(w.folders??[]).map(e=>({path:t(e.path),settings:e.settings})),environments:w.environments});if(s){let t=await p.folderApi.get(e);await p.folderApi.save(e,{...t.settings,contract:s.id})}if(await z(),"apitestcenter"===w.kind&&w.environments.length){let e=(await m.workspaceApi.index()).environments.find(e=>e.name.toLowerCase()===w.environments[0].name.toLowerCase());e&&U(e.id)}b(!1);let a=n.environments.added||n.environments.merged?` and ${n.environments.added+n.environments.merged} environment${n.environments.added+n.environments.merged===1?"":"s"}`:"";H(`Imported ${n.requests} request${1===n.requests?"":"s"}${a}${s?", checked against the API description":""} — pick the environment on the right of the tabs`,"success"),n.firstId&&(sessionStorage.setItem(c.OPEN_REQUEST_KEY,n.firstId),"/"===B?window.dispatchEvent(new Event(c.OPEN_REQUEST_EVENT)):_.push("/"))}catch(e){A(e instanceof Error?e.message:"Import failed")}finally{L(!1)}}}return e?(0,t.jsx)("div",{className:"fixed inset-0 z-[75] flex items-center-safe justify-center overflow-y-auto bg-black/50 p-4 sm:p-10",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&!$&&b(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"import-title",className:"w-full max-w-2xl rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h2",{id:"import-title",className:"text-base font-medium text-ink",children:"Import requests"}),(0,t.jsx)(x.GuideLink,{topic:"sending-requests#importing-requests",className:"ml-auto"}),(0,t.jsx)("button",{ref:F,type:"button",onClick:()=>b(!1),disabled:$,"aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(i.X,{size:16})})]}),(0,t.jsxs)("div",{className:"space-y-4 px-5 py-4",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["From a ",(0,t.jsx)("span",{className:"text-ink",children:"Postman"})," collection or environment (v2.1 export), an ",(0,t.jsx)("span",{className:"text-ink",children:"Insomnia"})," export, a ",(0,t.jsx)("span",{className:"text-ink",children:"Bruno"})," collection (exported as JSON, or its ",(0,t.jsx)("code",{children:".bru"})," files — choose them all at once), ",(0,t.jsx)("span",{className:"text-ink",children:".http"})," / ",(0,t.jsx)("span",{className:"text-ink",children:".rest"})," files (VS Code REST Client, JetBrains HTTP Client), ",(0,t.jsx)("span",{className:"text-ink",children:"Hurl"})," files, a browser recording (",(0,t.jsx)("span",{className:"text-ink",children:"HAR"}),", from DevTools → Network → Save all as HAR), or an ",(0,t.jsx)("span",{className:"text-ink",children:"OpenAPI 3"})," / ",(0,t.jsx)("span",{className:"text-ink",children:"Swagger 2"})," file in JSON or YAML. Your current requests are not changed."]}),(0,t.jsx)("input",{ref:D,type:"file",accept:".json,.yaml,.yml,.har,.http,.rest,.hurl,.bru,.apitestcenter,application/json,text/yaml",multiple:!0,className:"sr-only","aria-label":"Choose files to import",onChange:e=>{let t=e.target.files?[...e.target.files]:[];e.target.value="",t.length&&K(t)}}),w||T?null:(0,t.jsxs)("button",{type:"button",onClick:()=>D.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.dataTransfer.files.length&&K(e.dataTransfer.files)},className:"flex w-full flex-col items-center gap-1 rounded-lg border border-dashed border-line px-4 py-8 text-sm text-mute hover:border-accent hover:text-ink",children:[(0,t.jsx)(n.FileUp,{size:20,"aria-hidden":!0}),(0,t.jsx)("span",{className:"text-ink",children:"Choose a file — or several"}),(0,t.jsx)("span",{className:"text-xs",children:"or drop them here · .json, .yaml, .har, .bru, .http, .rest, .hurl"})]}),w?null:T?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("textarea",{value:P,onChange:e=>I(e.target.value),rows:8,placeholder:"Paste the JSON, YAML, .http or Hurl text here","aria-label":"Paste a file's contents",className:"input w-full font-mono text-xs"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1.5 text-xs",disabled:!P.trim(),onClick:()=>V(P,"pasted"),children:"Read it"}),(0,t.jsx)("button",{type:"button",className:"rounded-md px-2 py-1.5 text-xs text-mute hover:text-ink",onClick:()=>E(!1),children:"Back"})]})]}):(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>E(!0),children:"Or paste it instead"}),w?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"rounded-full border border-line px-2 py-0.5 text-xs text-mute",children:y[w.kind]}),(0,t.jsx)("span",{className:"font-medium text-ink",children:w.title}),(0,t.jsxs)("span",{className:"text-mute",children:["from ",k]}),(0,t.jsx)("button",{type:"button",className:"ml-auto text-xs text-accent hover:underline",onClick:()=>v(null),children:"Choose another file"})]}),w.requests.length?(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-mute",children:"Put the requests in collection"}),(0,t.jsx)("input",{value:N,onChange:e=>S(e.target.value.slice(0,60)),className:"input w-56 py-1","aria-label":"Collection name"}),J?(0,t.jsxs)("span",{className:"text-xs text-warn",children:[J," request",1===J?"":"s"," already in it — they are kept, new ones are added"]}):null]}):null,q?(0,t.jsxs)("label",{className:"flex items-start gap-2 text-sm",children:[(0,t.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:M,onChange:e=>O(e.target.checked)}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-ink",children:"Check answers against this description"}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:"Kept as the collection's API description: every answer is checked for a documented status, content type and body (a contract test)."})]})]}):null,(0,t.jsxs)("ul",{className:"max-h-64 space-y-0.5 overflow-y-auto rounded-md border border-line p-2 text-sm",children:[w.requests.slice(0,300).map((e,s)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)("span",{className:`w-14 shrink-0 font-mono text-xs ${g[e.request.method]??"text-mute"}`,children:e.request.method}),(0,t.jsxs)("span",{className:"truncate text-ink",children:[e.collection.includes("/")?(0,t.jsxs)("span",{className:"text-mute",children:[e.collection.split("/").slice(1).join(" › ")," › "]}):null,e.name]})]},s)),w.requests.length>300?(0,t.jsxs)("li",{className:"text-xs text-mute",children:["…and ",w.requests.length-300," more"]}):null,w.environments.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-mute",children:"ENV"}),(0,t.jsx)("span",{className:"truncate text-ink",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:["· ",e.variables.length," variable",1===e.variables.length?"":"s",e.variables.some(e=>e.secret)?", secrets encrypted":""]})]},e.name))]}),w.warnings.length?(0,t.jsxs)("div",{className:"rounded-md border border-warn/40 bg-warn/5 px-3 py-2 text-xs text-warn",children:[(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 font-medium",children:[(0,t.jsx)(r.TriangleAlert,{size:13,"aria-hidden":!0})," ",w.warnings.length," thing",1===w.warnings.length?"":"s"," to know"]}),(0,t.jsxs)("ul",{className:"list-disc space-y-0.5 pl-5",children:[w.warnings.slice(0,12).map(e=>(0,t.jsx)("li",{children:e},e)),w.warnings.length>12?(0,t.jsxs)("li",{children:["…and ",w.warnings.length-12," more"]}):null]})]}):null]}):null,C?(0,t.jsx)("p",{role:"alert",className:"text-sm text-bad",children:C}):null]}),(0,t.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[(0,t.jsx)("button",{type:"button",className:"rounded-md px-3 py-1.5 text-sm text-mute hover:text-ink",disabled:$,onClick:()=>b(!1),children:"Cancel"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!w||$||!w.requests.length&&!w.environments.length,onClick:()=>void G(),children:[$?(0,t.jsx)(a.Loader2,{size:16,className:"animate-spin"}):null,w?`Import ${[w.requests.length?`${w.requests.length} request${1===w.requests.length?"":"s"}`:"",w.environments.length?`${w.environments.length} environment${1===w.environments.length?"":"s"}`:""].filter(Boolean).join(" and ")}`:"Import"]})]})]})}):null}},70746,e=>{"use strict";var t=e.i(99181);async function s(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error([t?.error??`Engine error (${e.status})`,t?.hint].filter(Boolean).join(" — "));return t}let n=(e,t,s)=>fetch(t,{method:e,headers:void 0===s?void 0:{"content-type":"application/json"},body:void 0===s?void 0:JSON.stringify(s),cache:"no-store"}),a=e=>`/engine/connections/${encodeURIComponent(e)}`,r={list:()=>n("GET","/engine/connections").then(e=>s(e)).then(e=>e.connections),create:e=>n("POST","/engine/connections",e).then(e=>s(e)).then(l),update:(e,t)=>n("PUT",a(e),t).then(e=>s(e)).then(l),remove:e=>n("DELETE",a(e)).then(e=>s(e)).then(l),test:(e,t)=>n("POST","/engine/connections/test",{...e,vars:t}).then(e=>s(e)),schema:(e,t,r=!1)=>n("POST",`${a(e)}/schema`,{refresh:r,vars:t}).then(e=>s(e)),describe:(e,t,r)=>n("POST",`${a(e)}/describe`,{name:t,vars:r}).then(e=>s(e)),get:(e,t,r)=>n("POST",`${a(e)}/get`,{path:t,vars:r}).then(e=>s(e))},i="atc:connections-changed",o=null;function l(e){return o=null,window.dispatchEvent(new Event(i)),e}e.s(["KIND_LABEL",0,{successfactors:"SAP SuccessFactors",salesforce:"Salesforce",netsuite:"NetSuite",odata:"OData service",api:"REST API"},"connectionsApi",0,r,"useConnections",0,function(){let[e,s]=(0,t.useState)([]);return(0,t.useEffect)(()=>{let e=!0,t=()=>{(o??=r.list().catch(()=>[])).then(t=>e&&s(t))};return t(),window.addEventListener(i,t),()=>{e=!1,window.removeEventListener(i,t)}},[]),e}])},23227,e=>{"use strict";var t=e.i(99181);let s="atc:contracts-changed";async function n(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}let a=(e,t,s)=>fetch(t,{method:e,headers:void 0===s?void 0:{"content-type":"application/json"},body:void 0===s?void 0:JSON.stringify(s)}),r=e=>(window.dispatchEvent(new Event(s)),e),i={list:()=>fetch("/engine/contracts",{cache:"no-store"}).then(e=>n(e)).then(e=>e.contracts),get:(e,t)=>fetch(`/engine/contracts/${encodeURIComponent(e)}${t?`?folder=${encodeURIComponent(t)}`:""}`,{cache:"no-store"}).then(e=>n(e)),use:(e,t,s=!0)=>a("POST",`/engine/contracts/${encodeURIComponent(e)}/use`,{folder:t,use:s}).then(e=>n(e)).then(r),add:e=>a("POST","/engine/contracts",e).then(e=>n(e)).then(r),update:(e,t)=>a("PUT",`/engine/contracts/${encodeURIComponent(e)}`,t).then(e=>n(e)).then(r),remove:e=>a("DELETE",`/engine/contracts/${encodeURIComponent(e)}`).then(e=>n(e)).then(r),addMissing:(e,t,s)=>a("POST",`/engine/contracts/${encodeURIComponent(e)}/add-missing`,{folder:t,...s?{baseUrl:s}:{}}).then(e=>n(e)).then(r)};e.s(["contractsApi",0,i,"useContracts",0,function(){let[e,n]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=!0,t=()=>void i.list().then(t=>e&&n(t),()=>e&&n([]));return t(),window.addEventListener(s,t),()=>{e=!1,window.removeEventListener(s,t)}},[]),e}])},20054,e=>{"use strict";var t=e.i(14368),s=e.i(99181);let n={checked:!1,online:!1,k6Ready:!1,k6Label:"Checking engine…"},a=(0,s.createContext)(n);e.s(["EngineHealthProvider",0,function({children:e}){let[r,i]=(0,s.useState)(n);return(0,s.useEffect)(()=>{let e,t=!1,s=0,n=async()=>{try{var a;let r,o=await fetch("/engine/health",{cache:"no-store"});if(!o.ok)throw Error(String(o.status));let l=await o.json();if(t)return;"cli"===l.host&&"cli"!==e&&(window.clearInterval(s),s=window.setInterval(()=>void n(),3e3)),e=l.host;let c=!!l.k6?.available;i({checked:!0,online:"ok"===l.status,k6Ready:c,k6Label:c?(a=l.k6?.version,(r=a?.match(/v?\d+\.\d+\.\d+/))?`k6 ${r[0].startsWith("v")?r[0]:`v${r[0]}`}`:"k6 ready"):l.k6?.reason??"k6 not found",demoApi:l.demoApi,appVersion:l.version,dataDir:l.dataDir,host:l.host})}catch{t||i({checked:!0,online:!1,k6Ready:!1,k6Label:"Engine offline",host:e,stopped:"cli"===e})}};n(),s=window.setInterval(()=>void n(),8e3);let a=()=>void n();return window.addEventListener("focus",a),()=>{t=!0,window.clearInterval(s),window.removeEventListener("focus",a)}},[]),(0,t.jsx)(a.Provider,{value:r,children:e})},"useEngineHealth",0,function(){return(0,s.useContext)(a)}])},60889,85903,e=>{"use strict";e.i(24856);let t={status:"free",tier:"free"},s={pro:{monthly:9,yearly:90},team:{monthly:15,yearly:150,minSeats:3}},n=[0,.1,.2];function a(e,t){let a=n[Math.min(Math.max(0,Math.floor(t)),n.length-1)];return Math.round(s[e].yearly*(1-a))}let r={free:{"connections.enterprise":1,"connections.expandDepth":1,"connections.exportRows":1e3,schedules:2,"history.days":30,baselines:1,"exports.unbranded":0,"workspaces.shared":0},pro:{"connections.enterprise":1/0,"connections.expandDepth":3,"connections.exportRows":5e4,schedules:1/0,"history.days":1/0,baselines:1/0,"exports.unbranded":1,"workspaces.shared":0},team:{"connections.enterprise":1/0,"connections.expandDepth":3,"connections.exportRows":5e4,schedules:1/0,"history.days":1/0,baselines:1/0,"exports.unbranded":1,"workspaces.shared":1}},i={"connections.enterprise":"SuccessFactors, Salesforce and NetSuite connections","connections.expandDepth":"Levels of related data in Connections","connections.exportRows":"Rows in a connection export",schedules:"Scheduled checks","history.days":"Days of History",baselines:"Reference runs","exports.unbranded":"Reports and API docs without the “Made with” line","workspaces.shared":"Shared workspaces"};function o(e){return"free"===e.status||"expired"===e.status?"free":e.tier}function l(e,t,s=1,n=!1){let a=o(e),i=r[a][t],c=s<=i;return{ok:c||!n,limit:i,tier:a,needs:c?null:["free","pro","team"].find(e=>s<=r[e][t])??null,...c||n?{}:{preview:!0}}}let c=(e,t)=>e?Math.max(0,Math.ceil((Date.parse(e)-t.getTime())/864e5)):0,d=(e,t)=>`${e} ${t}${1===e?"":"s"}`,u=e=>e?new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):"";function h(e,s=new Date){let n=e=>new Date(s.getTime()+864e5*e).toISOString();switch(e){case"trial":return{status:"trial",tier:"pro",trialEndsAt:n(13)};case"trial-last":return{status:"trial",tier:"pro",trialEndsAt:n(.5)};case"active":return{status:"active",tier:"pro",billing:"yearly",renewals:0,renewsAt:n(200)};case"renewing":return{status:"renewing",tier:"pro",billing:"yearly",renewals:0,renewsAt:n(7)};case"renewing-loyal":return{status:"renewing",tier:"pro",billing:"yearly",renewals:2,renewsAt:n(7)};case"past_due":return{status:"past_due",tier:"pro",billing:"yearly",renewals:1,renewsAt:n(-2)};case"grace":return{status:"grace",tier:"pro",billing:"yearly",renewals:1,graceEndsAt:n(9)};case"expired":return{status:"expired",tier:"pro",billing:"yearly",renewals:1,endedAt:n(-20)};default:return t}}e.s(["FEATURE_LABEL",0,i,"FREE",0,t,"LIMITS",0,r,"PRICES",0,s,"TRIAL_DAYS",0,14,"allows",0,l,"planNotice",0,function(e,t=new Date){let s="team"===e.tier?"Team":"Pro";switch(e.status){case"trial":{let n=c(e.trialEndsAt,t);return n<=3?{tone:"warn",title:0===n?`Your ${s} trial ends today`:`${d(n,"day")} left of your ${s} trial`,body:"After it, the app goes back to Free. Nothing you made is deleted.",action:"upgrade"}:{tone:"info",title:`${s} trial: ${d(n,"day")} left`,body:`Everything in ${s}, until ${u(e.trialEndsAt)}.`,action:"upgrade"}}case"renewing":{let t="monthly"!==e.billing,n=t&&"free"!==e.tier?a(e.tier,(e.renewals??0)+1):null,r=t&&"free"!==e.tier?a(e.tier,(e.renewals??0)+2):null;return{tone:"info",title:`${s} renews on ${u(e.renewsAt)}`,body:null!==n?`$${n} for the next year${null!==r&&r<n?`, and $${r} the year after if you stay`:""}.`:"It renews by itself; nothing to do.",action:"manage"}}case"ending":return{tone:"info",title:`${s} ends on ${u(e.endedAt)}`,body:"You cancelled it; everything keeps working until then. Changed your mind? Resume it in your subscription.",action:"manage"};case"past_due":return{tone:"warn",title:"The payment didn't go through",body:`${s} keeps working while it's tried again. Check the card in your subscription.`,action:"payment"};case"grace":return{tone:"warn",title:`${s} ended — ${d(c(e.graceEndsAt,t),"day")} to renew`,body:`Everything keeps working until ${u(e.graceEndsAt)}. Renew to keep your renewal price.`,action:"renew"};case"expired":{let n=e.endedAt?Math.floor((t.getTime()-Date.parse(e.endedAt))/864e5):0;return{tone:"info",title:"You're on Free again",body:`Nothing you made is deleted; ${s} features wait for you.${n<30&&(e.renewals??0)>0?` Renew within ${d(30-n,"day")} to keep your renewal price.`:""}`,action:"renew"}}default:return null}},"previewState",0,h,"tierNow",0,o,"yearlyPrice",0,a],85903);var p=e.i(99181),m=e.i(39170);let x="apitestcenter-plan-preview",f="apitestcenter-plan-preview-unlocked",b="atc:plan",y=e=>{try{return localStorage.getItem(e)}catch{return null}},g=(e,t)=>{try{null===t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}window.dispatchEvent(new Event(b))},w=null,v=null,k=e=>(w=e,window.dispatchEvent(new Event(b)),e);async function j(e){let t=await e.json().catch(()=>({}));if(!e.ok)throw 410===e.status&&k({account:w?.account??null,license:null}),Error(t.error??"Something went wrong with the license.");return k(t)}class N extends Error{computers;constructor(e,t){super(e),this.computers=t}}let S=(e,t)=>fetch(`/engine/settings/account/${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});function C(){let[e,s]=(0,p.useState)({preview:null,unlocked:!1,license:null});(0,p.useEffect)(()=>{let e=()=>s({preview:y(x)??null,unlocked:"1"===y(f),license:w});return e(),v??=fetch("/engine/settings/license",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>void(e&&k(e))).catch(()=>void 0),window.addEventListener(b,e),window.addEventListener("storage",e),()=>{window.removeEventListener(b,e),window.removeEventListener("storage",e)}},[]);let n=e.license?.license?e.license.state:t;return{state:e.preview?h(e.preview):n,preview:e.preview,unlocked:e.unlocked,license:e.license}}e.s(["PREVIEWS",0,[{id:"free",label:"Free"},{id:"trial",label:"Pro trial, day 1"},{id:"trial-last",label:"Pro trial, last day"},{id:"active",label:"Pro, paid yearly"},{id:"renewing",label:"Pro, renews in 7 days (first renewal)"},{id:"renewing-loyal",label:"Pro, renews in 7 days (third year)"},{id:"past_due",label:"Payment failed"},{id:"grace",label:"Grace period"},{id:"expired",label:"Expired, back on Free"}],"TooManyComputers",0,N,"accountApi",0,{start:async e=>{let t=await S("start",{email:e}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error??"Couldn't send the code. Try again in a minute.");return s.message??"We've emailed you a code."},verify:async(e,t,s)=>{let n=await S("verify",{email:e,code:t,...s?{replace:s}:{}});if(409===n.status){let e=await n.json().catch(()=>({}));throw new N(e.error??"You're signed in on too many computers.",e.computers??[])}return j(n)},signOut:e=>S("signout",e?{computer:e}:{}).then(j)},"licenseApi",0,{set:e=>fetch("/engine/settings/license",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({license:e})}).then(j),remove:()=>fetch("/engine/settings/license",{method:"DELETE"}).then(j),refresh:()=>fetch("/engine/settings/license/refresh",{method:"POST"}).then(j),portal:async()=>{let e=await fetch("/engine/settings/license/portal",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok||!t.url)throw Error(t.error??"Couldn't open the subscription page.");return t.url}},"setPreview",0,function(e){g(x,e)},"usePlan",0,C,"usePlanGate",0,function(){let{state:e,preview:t}=C(),s=(0,m.useConfirm)();return(0,p.useCallback)(async(n,a)=>{let r=l(e,n,a,null!==t);return!!r.ok||(await s({title:`${"team"===r.needs?"A Team":"A Pro"} feature`,body:`${i[n]}: Free includes ${0===r.limit?"none":r.limit.toLocaleString()}. ${"team"===r.needs?"Team":"Pro"} includes ${"team"===r.needs?"it":"more"}. Everything you've made stays as it is.`,confirmLabel:"See the plans",cancelLabel:"Not now"})&&window.dispatchEvent(new CustomEvent("atc:settings",{detail:"plan"})),!1)},[s,t,e])},"useVersionTaps",0,function(e){let t=(0,p.useRef)(0);return(0,p.useCallback)(()=>{"1"===y(f)||++t.current<7||(g(f,"1"),e())},[e])}],60889)},42674,e=>{"use strict";e.i(5305),e.s([])},6278,25120,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(78451),n=e.i(99181),a=e.i(20054);let r=(new URLSearchParams(window.location.search).get("project")??"").slice(0,64);function i(e){return r&&"default"!==r?`${e}@${r}`:e}async function o(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}e.s(["projectKey",0,i],25120);let l=(e,t,s)=>fetch(t,{method:e,headers:void 0===s?void 0:{"content-type":"application/json"},body:void 0===s?void 0:JSON.stringify(s)}),c={index:()=>fetch("/engine/workspace",{cache:"no-store"}).then(e=>o(e)),get:e=>fetch(`/engine/workspace/requests/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>o(e)),create:e=>l("POST","/engine/workspace/requests",e).then(e=>o(e)),update:(e,t)=>l("PUT",`/engine/workspace/requests/${encodeURIComponent(e)}`,t).then(e=>o(e)),remove:e=>l("DELETE",`/engine/workspace/requests/${encodeURIComponent(e)}`).then(e=>o(e)),importAll:e=>l("POST","/engine/workspace/import",e).then(e=>o(e)),versions:e=>fetch(`/engine/workspace/requests/${encodeURIComponent(e)}/versions`,{cache:"no-store"}).then(e=>o(e)),version:(e,t)=>fetch(`/engine/workspace/requests/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}`,{cache:"no-store"}).then(e=>o(e)),restoreVersion:(e,t)=>l("POST",`/engine/workspace/requests/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}/restore`).then(e=>o(e)),trash:()=>fetch("/engine/workspace/trash",{cache:"no-store"}).then(e=>o(e)),restoreFromTrash:e=>l("POST",`/engine/workspace/trash/${encodeURIComponent(e)}/restore`).then(e=>o(e)),deleteFromTrash:e=>l("DELETE",`/engine/workspace/trash/${encodeURIComponent(e)}`).then(e=>o(e)),emptyTrash:()=>l("DELETE","/engine/workspace/trash").then(e=>o(e)),saveEnvironments:e=>l("PUT","/engine/workspace/environments",e).then(e=>o(e))},d=(0,n.createContext)({index:null,refresh:async()=>{},environments:[],activeEnv:null,setActiveEnv:()=>{},vars:{},saveEnvironments:async()=>{},savedValues:{},rememberValues:()=>{},clearSavedValues:()=>{}}),u=i("apitestcenter-active-env"),h=i("apitestcenter-saved-values");e.s(["WorkspaceProvider",0,function({children:e}){let[r,i]=(0,n.useState)(null),[o,l]=(0,n.useState)(null),[p,m]=(0,n.useState)({}),x=(0,n.useCallback)(async()=>{try{i(await c.index())}catch{}},[]);(0,n.useEffect)(()=>{try{l(localStorage.getItem(u))}catch{}try{let e=sessionStorage.getItem(h);e&&m(JSON.parse(e))}catch{}x();let e=()=>void x();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[x]);let f=(0,n.useCallback)(e=>{l(e);try{e?localStorage.setItem(u,e):localStorage.removeItem(u)}catch{}},[]),b=(0,n.useCallback)(async e=>{await c.saveEnvironments(e),await x()},[x]),y=(0,n.useCallback)(e=>{m(e);try{Object.keys(e).length?sessionStorage.setItem(h,JSON.stringify(e)):sessionStorage.removeItem(h)}catch{}},[]),g=(0,n.useCallback)((e,t)=>{e.length&&m(s=>{let n={...s};for(let s of e)n[s.name]={value:s.value,from:t};try{sessionStorage.setItem(h,JSON.stringify(n))}catch{}return n})},[]),w=(0,n.useCallback)(()=>y({}),[y]),{demoApi:v}=(0,a.useEngineHealth)(),k=(0,n.useMemo)(()=>{let e=r?.environments??[],t=e.find(e=>e.id===o)??null,n=v?{practiceApi:v,practiceWs:v.replace(/^http/i,"ws")}:{},a=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,t.value]));return{index:r,refresh:x,environments:e,activeEnv:t,setActiveEnv:f,vars:(0,s.resolveVariables)({...n,...(0,s.variablesOf)(t),...a}),saveEnvironments:b,savedValues:p,rememberValues:g,clearSavedValues:w}},[r,o,x,f,b,v,p,g,w]);return(0,t.jsx)(d.Provider,{value:k,children:e})},"useWorkspace",0,function(){return(0,n.useContext)(d)},"workspaceApi",0,c],6278)},42025,e=>{"use strict";let t=(0,e.i(99522).default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);e.s(["BookOpen",0,t],42025)},42447,e=>{"use strict";let t=(0,e.i(99522).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,t],42447)},60961,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],60961)},51342,e=>{"use strict";var t=e.i(95688);e.s(["AlertCircle",()=>t.default])},40945,e=>{"use strict";let t=(0,e.i(99522).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",0,t],40945)},68204,e=>{"use strict";let t=(0,e.i(99522).default)("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]);e.s(["ClipboardPaste",0,t],68204)},8055,e=>{"use strict";let t=(0,e.i(99522).default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Compass",0,t],8055)},83316,e=>{"use strict";let t=(0,e.i(99522).default)("cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);e.s(["Cookie",0,t],83316)},80190,e=>{"use strict";let t=(0,e.i(99522).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],80190)},58606,73617,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);e.s(["FileCode2",0,s],58606);let n=(0,t.default)("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]);e.s(["Store",0,n],73617)},47677,e=>{"use strict";let t=(0,e.i(99522).default)("file-output",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);e.s(["FileOutput",0,t],47677)},20621,e=>{"use strict";let t=(0,e.i(99522).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],20621)},44085,e=>{"use strict";let t=(0,e.i(99522).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],44085)},17819,e=>{"use strict";let t=(0,e.i(99522).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],17819)},65539,48773,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);e.s(["Gauge",0,s],65539);let n=(0,t.default)("gem",[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]]);e.s(["Gem",0,n],48773)},31035,e=>{"use strict";let t=(0,e.i(99522).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",0,t],31035)},91694,e=>{"use strict";let t=(0,e.i(99522).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,t],91694)},19286,e=>{"use strict";let t=(0,e.i(99522).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",0,t],19286)},29800,e=>{"use strict";let t=(0,e.i(99522).default)("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);e.s(["Keyboard",0,t],29800)},29091,e=>{"use strict";let t=(0,e.i(99522).default)("list-checks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);e.s(["ListChecks",0,t],29091)},63966,e=>{"use strict";let t=(0,e.i(99522).default)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]);e.s(["LogIn",0,t],63966)},4488,e=>{"use strict";let t=(0,e.i(99522).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,t],4488)},34761,e=>{"use strict";let t=(0,e.i(99522).default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);e.s(["Monitor",0,t],34761)},73606,29312,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,s],73606);let n=(0,t.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);e.s(["Palette",0,n],29312)},458,e=>{"use strict";let t=(0,e.i(99522).default)("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"}]]);e.s(["RefreshCw",0,t],458)},49913,30729,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,s],49913);let n=(0,t.default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,n],30729)},88293,e=>{"use strict";let t=(0,e.i(99522).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],88293)},50962,e=>{"use strict";let t=(0,e.i(99522).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],50962)},30135,e=>{"use strict";let t=(0,e.i(99522).default)("shield-check",[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,t],30135)},745,82129,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,s],745);let n=(0,t.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);e.s(["SquareTerminal",0,n],82129)},96659,e=>{"use strict";let t=(0,e.i(99522).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],96659)},42709,e=>{"use strict";var t=e.i(30844);e.s(["TriangleAlert",()=>t.default])},48317,e=>{"use strict";var t=e.i(99181),s=(e,t,s,n,a,r,i,o)=>{let l=document.documentElement,c=["light","dark"];function d(t){var s;(Array.isArray(e)?e:[e]).forEach(e=>{let s="class"===e,n=s&&r?a.map(e=>r[e]||e):a;s?(l.classList.remove(...n),l.classList.add(r&&r[t]?r[t]:t)):l.setAttribute(e,t)}),s=t,o&&c.includes(s)&&(l.style.colorScheme=s)}if(n)d(n);else try{let e=localStorage.getItem(t)||s,n=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(n)}catch(e){}},n=["light","dark"],a="(prefers-color-scheme: dark)",r="u"<typeof window,i=t.createContext(void 0),o={setTheme:e=>{},themes:[]},l=["light","dark"],c=({forcedTheme:e,disableTransitionOnChange:s=!1,enableSystem:r=!0,enableColorScheme:o=!0,storageKey:c="theme",themes:m=l,defaultTheme:x=r?"system":"light",attribute:f="data-theme",value:b,children:y,nonce:g,scriptProps:w})=>{let[v,k]=t.useState(()=>u(c,x)),[j,N]=t.useState(()=>"system"===v?p():v),S=b?Object.values(b):m,C=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&r&&(t=p());let a=b?b[t]:t,i=s?h(g):null,l=document.documentElement,c=e=>{"class"===e?(l.classList.remove(...S),a&&l.classList.add(a)):e.startsWith("data-")&&(a?l.setAttribute(e,a):l.removeAttribute(e))};if(Array.isArray(f)?f.forEach(c):c(f),o){let e=n.includes(x)?x:null,s=n.includes(t)?t:e;l.style.colorScheme=s}null==i||i()},[g]),A=t.useCallback(e=>{let t="function"==typeof e?e(v):e;k(t);try{localStorage.setItem(c,t)}catch(e){}},[v]),T=t.useCallback(t=>{N(p(t)),"system"===v&&r&&!e&&C("system")},[v,e]);t.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(T),T(e),()=>e.removeListener(T)},[T]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?k(e.newValue):A(x))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[A]),t.useEffect(()=>{C(null!=e?e:v)},[e,v]);let E=t.useMemo(()=>({theme:v,setTheme:A,forcedTheme:e,resolvedTheme:"system"===v?j:v,themes:r?[...m,"system"]:m,systemTheme:r?j:void 0}),[v,A,e,j,r,m]);return t.createElement(i.Provider,{value:E},t.createElement(d,{forcedTheme:e,storageKey:c,attribute:f,enableSystem:r,enableColorScheme:o,defaultTheme:x,value:b,themes:m,nonce:g,scriptProps:w}),y)},d=t.memo(({forcedTheme:e,storageKey:n,attribute:a,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:l,themes:c,nonce:d,scriptProps:u})=>{let h=JSON.stringify([a,n,o,e,c,l,r,i]).slice(1,-1);return t.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${s.toString()})(${h})`}})}),u=(e,t)=>{let s;if(!r){try{s=localStorage.getItem(e)||void 0}catch(e){}return s||t}},h=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},p=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(c,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(i))?e:o}])},36994,(e,t,s)=>{t.exports=e.r(85779)},84201,e=>{"use strict";e.s(["BROWSABLE_KINDS",0,["successfactors","salesforce","netsuite","odata"],"connectionVariableName",0,function(e,t=[]){let s=e.normalize("NFKD").replace(/[^\w\s]/g," ").split(/[\s_]+/).filter(Boolean).map((e,t)=>0===t?e.charAt(0).toLowerCase()+e.slice(1):e.charAt(0).toUpperCase()+e.slice(1)).join("")||"connection";/^\d/.test(s)&&(s=`c${s}`),s=s.slice(0,40);let n=new Set(t);if(!n.has(s))return s;for(let e=2;;e++)if(!n.has(`${s}${e}`))return`${s}${e}`},"leadingVariable",0,function(e){return/^\s*\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/.exec(e)?.[1]??null}])},90870,e=>{"use strict";let t=`query IntrospectionQuery {
|
|
11
|
-
__schema {
|
|
12
|
-
queryType { name }
|
|
13
|
-
mutationType { name }
|
|
14
|
-
types {
|
|
15
|
-
kind
|
|
16
|
-
name
|
|
17
|
-
fields { name description args { name type { ...TypeRef } } type { ...TypeRef } }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
fragment TypeRef on __Type { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } }`;function s(e){return"NON_NULL"===e.kind?`${s(e.ofType)}!`:"LIST"===e.kind?`[${s(e.ofType)}]`:e.name??"?"}function n(e){return e.ofType?n(e.ofType):e}e.s(["INTROSPECTION_QUERY",0,t,"operationTemplate",0,function(e,t){let s=t.name.charAt(0).toUpperCase()+t.name.slice(1),a=t.args.map(e=>`$${e.name}: ${e.type}`).join(", "),r=t.args.map(e=>`${e.name}: $${e.name}`).join(", "),i=(e.types.get("query"===t.kind?"Query":"Mutation")?.fields??[]).find(e=>e.name===t.name)??[...e.types.values()].flatMap(e=>e.fields??[]).find(e=>e.name===t.name),o=i?function e(t,s,a,r){let i=t.types.get(n(s).name??"");if(!i?.fields?.length)return"";let o=[];for(let s of i.fields){let i=n(s.type);if(!s.args?.some(e=>"NON_NULL"===e.type.kind)){if("SCALAR"===i.kind||"ENUM"===i.kind)o.push(`${r}${s.name}`);else if(a>0&&("OBJECT"===i.kind||"INTERFACE"===i.kind)){let n=e(t,s.type,a-1,`${r} `);n&&o.push(`${r}${s.name} {
|
|
22
|
-
${n}
|
|
23
|
-
${r}}`)}if(o.length>=12)break}}return o.join("\n")}(e,i.type,1," "):"";return{query:`${t.kind} ${s}${a?`(${a})`:""} {
|
|
24
|
-
${t.name}${r?`(${r})`:""}${o?` {
|
|
25
|
-
${o}
|
|
26
|
-
}`:""}
|
|
27
|
-
}`,variables:t.args.length?JSON.stringify(Object.fromEntries(t.args.map(e=>{var t;let s;return[e.name,(s=(t=e.type).replace(/[[\]!]/g,""),t.startsWith("[")?[]:"Int"===s||"Float"===s?0:"Boolean"!==s&&("String"===s||"ID"===s?"":null))]})),null,2):"",operationName:s}},"readSchema",0,function(e){let t=e?.data?.__schema;if(!t?.types){let t=e?.errors;throw Error(t?.length?`The server refused the schema question: ${t[0]?.message??"error"}`:"That didn't look like a GraphQL schema — check the URL, and that introspection is allowed")}let n=new Map(t.types.map(e=>[e.name,e])),a=[];for(let[e,r]of[["query",t.queryType?.name],["mutation",t.mutationType?.name]])for(let t of r&&n.get(r)?.fields||[])a.push({kind:e,name:t.name,description:t.description??"",args:(t.args??[]).map(e=>({name:e.name,type:s(e.type),required:"NON_NULL"===e.type.kind})),returns:s(t.type)});return{operations:a,types:n}}])}]);
|