apitestcenter 0.18.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/THIRD-PARTY-NOTICES-UI.txt +40 -10
  2. package/dist/THIRD-PARTY-NOTICES.txt +3 -3
  3. package/dist/cli.mjs +341 -335
  4. package/dist/ui/404/index.html +1 -1
  5. package/dist/ui/404.html +1 -1
  6. package/dist/ui/__next.__PAGE__.txt +17 -17
  7. package/dist/ui/__next._full.txt +18 -18
  8. package/dist/ui/__next._tree.txt +2 -2
  9. package/dist/ui/_next/static/chunks/0faedhifzwobh.js +31 -0
  10. package/dist/ui/_next/static/chunks/{0q8iq_7i4ohjr.js → 0glo5t3rr5ux5.js} +2 -2
  11. package/dist/ui/_next/static/chunks/0jksxb6220hcg.js +4 -0
  12. package/dist/ui/_next/static/chunks/0jq6xbzrkaewp.js +2 -0
  13. package/dist/ui/_next/static/chunks/1-9ymrwk2b425.js +1 -0
  14. package/dist/ui/_next/static/chunks/13ez75q2t6tkt.js +51 -0
  15. package/dist/ui/_next/static/chunks/{12whdxhkvkd-y.js → 1s068j2ev364j.js} +1 -1
  16. package/dist/ui/_next/static/chunks/{3wtqdtu331_vc.js → 2-ccpn24ve6pz.js} +3 -3
  17. package/dist/ui/_next/static/chunks/20hgurwocz54g.js +123 -0
  18. package/dist/ui/_next/static/chunks/26cw_brv1ud3e.js +27 -0
  19. package/dist/ui/_next/static/chunks/2at40-h3piqdk.js +50 -0
  20. package/dist/ui/_next/static/chunks/2d4j4s35zfogt.js +3 -0
  21. package/dist/ui/_next/static/chunks/2eitm7108zqkh.js +50 -0
  22. package/dist/ui/_next/static/chunks/{2c1b5jqwxl4ra.js → 2ihpgl_z3eude.js} +87 -86
  23. package/dist/ui/_next/static/chunks/2lr6d098vgexb.js +1 -0
  24. package/dist/ui/_next/static/chunks/2qci5ienr5rb9.css +3 -0
  25. package/dist/ui/_next/static/chunks/33purk5k-9o6l.js +1 -0
  26. package/dist/ui/_next/static/chunks/{0-zga2d528cxt.js → 3ixmudnloab4j.js} +3 -3
  27. package/dist/ui/_next/static/chunks/3ps_0myey2cxz.js +22 -0
  28. package/dist/ui/_next/static/chunks/3rshqqryni7gb.js +2 -0
  29. package/dist/ui/_next/static/chunks/45bkmnyf6ozrx.js +50 -0
  30. package/dist/ui/_not-found/__next._full.txt +13 -13
  31. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +12 -12
  32. package/dist/ui/_not-found/__next._tree.txt +2 -2
  33. package/dist/ui/_not-found/index.html +1 -1
  34. package/dist/ui/_not-found/index.txt +13 -13
  35. package/dist/ui/compare/__next._full.txt +18 -18
  36. package/dist/ui/compare/__next._tree.txt +2 -2
  37. package/dist/ui/compare/__next.compare.__PAGE__.txt +17 -17
  38. package/dist/ui/compare/index.html +1 -1
  39. package/dist/ui/compare/index.txt +18 -18
  40. package/dist/ui/connections/__next._full.txt +16 -16
  41. package/dist/ui/connections/__next._tree.txt +2 -2
  42. package/dist/ui/connections/__next.connections.__PAGE__.txt +15 -15
  43. package/dist/ui/connections/index.html +2 -2
  44. package/dist/ui/connections/index.txt +16 -16
  45. package/dist/ui/history/__next._full.txt +19 -19
  46. package/dist/ui/history/__next._tree.txt +2 -2
  47. package/dist/ui/history/__next.history.__PAGE__.txt +18 -18
  48. package/dist/ui/history/index.html +1 -1
  49. package/dist/ui/history/index.txt +19 -19
  50. package/dist/ui/home/__next._full.txt +18 -18
  51. package/dist/ui/home/__next._tree.txt +2 -2
  52. package/dist/ui/home/__next.home.__PAGE__.txt +17 -17
  53. package/dist/ui/home/index.html +1 -1
  54. package/dist/ui/home/index.txt +18 -18
  55. package/dist/ui/index.html +1 -1
  56. package/dist/ui/index.txt +18 -18
  57. package/dist/ui/preview/__next._full.txt +17 -17
  58. package/dist/ui/preview/__next._tree.txt +2 -2
  59. package/dist/ui/preview/__next.preview.__PAGE__.txt +16 -16
  60. package/dist/ui/preview/index.html +1 -1
  61. package/dist/ui/preview/index.txt +17 -17
  62. package/dist/ui/suite/__next._full.txt +15 -15
  63. package/dist/ui/suite/__next._tree.txt +2 -2
  64. package/dist/ui/suite/__next.suite.__PAGE__.txt +14 -14
  65. package/dist/ui/suite/index.html +1 -1
  66. package/dist/ui/suite/index.txt +15 -15
  67. package/dist/ui/tests/__next._full.txt +13 -13
  68. package/dist/ui/tests/__next._tree.txt +2 -2
  69. package/dist/ui/tests/__next.tests.__PAGE__.txt +12 -12
  70. package/dist/ui/tests/index.html +1 -1
  71. package/dist/ui/tests/index.txt +13 -13
  72. package/package.json +1 -1
  73. package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +0 -123
  74. package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +0 -50
  75. package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +0 -50
  76. package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +0 -1
  77. package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +0 -1
  78. package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +0 -31
  79. package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +0 -50
  80. package/dist/ui/_next/static/chunks/1mm60-ywpri7b.js +0 -2
  81. package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +0 -4
  82. package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +0 -1
  83. package/dist/ui/_next/static/chunks/2sb9zma7ae-_f.js +0 -27
  84. package/dist/ui/_next/static/chunks/2sjog4to0fmbb.css +0 -3
  85. package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +0 -3
  86. package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +0 -51
  87. package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +0 -22
  88. package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +0 -2
  89. /package/dist/ui/_next/static/{8uBf4sRL82dkVbEC6zib9 → P0KsXFffpHNOo_vW1PSSr}/_buildManifest.js +0 -0
  90. /package/dist/ui/_next/static/{8uBf4sRL82dkVbEC6zib9 → P0KsXFffpHNOo_vW1PSSr}/_clientMiddlewareManifest.js +0 -0
  91. /package/dist/ui/_next/static/{8uBf4sRL82dkVbEC6zib9 → P0KsXFffpHNOo_vW1PSSr}/_ssgManifest.js +0 -0
@@ -0,0 +1,123 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93639,e=>{var t=e.i(51487);e.i(24856);var s=e.i(78451);function a(e){let t=t=>e.filter(e=>e.state===t).length;return{total:e.length,passed:t("passed"),failed:t("failed"),errors:t("error"),skipped:t("skipped"),durationMs:Math.round(e.reduce((e,t)=>e+(t.durationMs??0),0))}}function n(e){let t=a(e.steps);return t.passed>0&&0===t.failed&&0===t.errors}function i(e){let t=a(e.steps),s=t.total-t.skipped;if("running"===e.status)return`Running ${t.passed+t.failed+t.errors+1} of ${s}…`;if(!s)return"Nothing ran";let n=[`${t.passed} of ${s} passed`];return t.failed&&n.push(`${t.failed} failed`),t.errors&&n.push(`${t.errors} could not run`),t.skipped&&n.push(`${t.skipped} skipped`),"stopped"===e.status&&n.push("stopped early"),n.join(" · ")}let l=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),r=e=>((e??0)/1e3).toFixed(3),o=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),d={passed:"Passed",failed:"Failed",error:"Could not run",skipped:"Skipped",pending:"Not run",running:"Not finished"};var c=e.i(23986),u=e.i(56003);let p={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};p.node;let m=(0,u.f)(p),x={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};x.node;let h=(0,u.f)(x);var f=e.i(75380),b=e.i(30932),g=e.i(78e3),v=e.i(97564),y=e.i(87953);let k={name:"file-archive",size:24,node:[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]};k.node;let j=(0,u.f)(k);var w=e.i(29095),$=e.i(97424);let N={name:"circle-minus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["minus-circle"]};N.node;let S=(0,u.f)(N);var z=e.i(92368),C=e.i(47298),M=e.i(9219),q=e.i(53798),R=e.i(77306),P=e.i(69578),A=e.i(80707),I=e.i(56396);function T({collection:e,environment:t,data:s="api-tests"}){let a=t?` --env ${JSON.stringify(t)}`:"";return`npx --yes apitestcenter suite ${JSON.stringify(e)} --data ${s}${a} --junit atc-results.xml`}var E=e.i(17219);async function O(e,t){var s;let a,n=await fetch(`/engine/suites/export?collection=${encodeURIComponent(e)}`,{cache:"no-store"}),i=await n.json().catch(()=>null);if(!n.ok||!i?.files)throw Error(i?.error??`Engine error (${n.status})`);let l=i.secrets??[],r={};for(let e of i.files)r[`api-tests/${e.path}`]=e.text;r["api-tests/README.md"]=function(e){let{collection:t,environment:s,secrets:a=[],data:n="api-tests"}=e,i=s?` --env ${JSON.stringify(s)}`:"";return`# API checks — ${t||"requests outside a collection"}
2
+
3
+ Every request in this collection is sent once, in the saved order, and checked. The run fails
4
+ (exit code 1) when any request fails.
5
+
6
+ ${T(e)}
7
+
8
+ - Nothing to install first: \`npx\` fetches the command line (Node.js 20 or later).
9
+ - Edit these tests in a window: \`npx apitestcenter ui --data ${n}\` (or the desktop app).
10
+ - \`${n}/requests\` holds the saved requests, \`environments.json\` the environments, and
11
+ \`suites.json\` the run order. Secret values are never in these files.
12
+ - Pass secrets from your CI's secret store: write \`{{token}}\` in the request, then add
13
+ \`--var token=$MY_TOKEN\` to the command.
14
+ ${a.length?`
15
+ **These requests have a secret typed straight into them, which is not exported** — change it to a
16
+ {{variable}} and pass it with --var, or they will not run here:
17
+
18
+ ${a.map(e=>`- ${e}`).join("\n")}
19
+ `:""}
20
+ To check speed too, load-test one request with goals, and compare with a baseline:
21
+
22
+ npx --yes apitestcenter run "${t?`${t}/`:""}<request name>" --data ${n}${i} --p95 500 --errors 1 --baseline ${n}/baseline.json --max-slower 10
23
+
24
+ Guide: https://apitestcenter.com/docs/ci-walkthrough.html
25
+ `}({collection:e,environment:t,secrets:l}),r[".github/workflows/api-checks.yml"]=(a=(s={collection:e,environment:t}).collection||"requests outside a collection",`# Runs the "${a}" API checks on every push. Made by APITestCenter.
26
+ # Guide: https://apitestcenter.com/docs/ci-walkthrough.html
27
+ name: API checks
28
+
29
+ on:
30
+ push:
31
+ workflow_dispatch:
32
+ # Every hour too, even when nobody pushes (a scheduled check that runs while your computer is off):
33
+ # remove the # from the next two lines.
34
+ # schedule:
35
+ # - cron: "0 * * * *"
36
+
37
+ jobs:
38
+ api-checks:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - uses: actions/setup-node@v4
44
+ with:
45
+ node-version: 22
46
+
47
+ # Fails the job when any request fails. Secrets: add --var name=$\{{ secrets.NAME }}
48
+ - name: Check every request
49
+ run: ${T(s)}
50
+
51
+ - name: Keep the results
52
+ if: always()
53
+ uses: actions/upload-artifact@v4
54
+ with:
55
+ name: api-check-results
56
+ path: atc-results.xml
57
+ `);let o=(e||"requests").replace(/[^\w.-]+/g,"-").replace(/^-|-$/g,"")||"requests";return{blob:(0,E.f)(r),name:`${o}-for-ci.zip`,secrets:l}}var U=e.i(15060),L=e.i(14168),F=e.i(6278),D=e.i(15868),H=e.i(92084),J=e.i(32035);let Y={name:"bell-ring",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]};Y.node;let V=(0,u.f)(Y),W={name:"calendar-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v3",key:"otl347"}],["path",{d:"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338",key:"7hb8p4"}],["path",{d:"M3 9h5.859",key:"numkqi"}],["path",{d:"M8 2v3",key:"1ioesn"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};W.node;let B=(0,u.f)(W),G={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};G.node;let K=(0,u.f)(G);var _=e.i(98848),X=e.i(1326),Q=e.i(39170),Z=e.i(727),ee=e.i(44505),et=e.i(43101),es=e.i(60889);let ea=e=>{let t=new Date(e);return new Date().toDateString()===t.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},en=Object.entries(H.S);function ei({collection:e,environment:s}){let a=(0,I.d)(),n=(0,Q.L)(),{environments:i}=(0,F.U)(),l=(0,et.C)(),r=(0,Z.I)(),[o,d]=(0,R.useState)(15),[c,u]=(0,R.useState)("changes"),[p,m]=(0,R.useState)(null),x=(0,es.d)(),h=e=>e?i.find(t=>t.id===e)?.name??"an environment that was removed":"no environment",f=l?.find(t=>t.collection===e&&t.environment===s);async function b(e,t,s){m(e);try{let e=await t(),n=s?.(e);n&&a(n,"success")}catch(e){a(e instanceof Error?e.message:"That didn't work","error")}finally{m(null)}}return(0,t.jsxs)("section",{"aria-label":"Scheduled checks",className:"rounded-lg border border-line bg-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-line px-4 py-2 text-xs text-mute",children:[(0,t.jsx)(B,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{className:"font-medium text-ink",children:"Scheduled checks"}),(0,t.jsxs)("span",{children:["— a collection run every few minutes while the app runs, with a notification when it starts failing.",(0,ee.f)()?.background?" Closing the window keeps it running in the tray.":""]}),"ask"===r||"off"===r?(0,t.jsxs)("button",{type:"button",className:"ml-auto inline-flex items-center gap-1 text-accent hover:underline",onClick:()=>void(0,Z.y)(),children:[(0,t.jsx)(V,{size:12,"aria-hidden":!0})," Turn on desktop notifications"]}):"blocked"===r?(0,t.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1",children:[(0,t.jsx)(J.f,{size:12,"aria-hidden":!0})," Notifications are blocked — you'll see them in the app only"]}):null]}),null===e||f?null:(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3 border-b border-line px-4 py-3",children:[(0,t.jsxs)("p",{className:"w-full text-sm text-ink",children:["Run ",(0,t.jsx)("span",{className:"font-medium",children:e||"requests outside a folder"})," with ",h(s),":"]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["How often",(0,t.jsx)("select",{value:o,onChange:e=>d(Number(e.target.value)),className:"rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:H.l.map(e=>(0,t.jsx)("option",{value:e,children:(0,H.s)(e).replace(/^every /,"Every ")},e))})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Notify me",(0,t.jsx)("select",{value:c,onChange:e=>u(e.target.value),className:"rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:en.map(([e,s])=>(0,t.jsx)("option",{value:e,children:s},e))})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:"add"===p,onClick:async()=>await x("schedules",(l?.length??0)+1)&&void b("add",()=>et.c.add({collection:e,environment:s,everyMinutes:o,notify:c}),()=>`Scheduled: ${e||"requests outside a folder"} ${(0,H.s)(o)} — the first run starts now`),children:["add"===p?(0,t.jsx)($.f,{size:14,className:"animate-spin"}):(0,t.jsx)(B,{size:14}),"Schedule it"]})]}),null===l?(0,t.jsx)("p",{className:"px-4 py-3 text-sm text-mute",children:"Loading…"}):l.length?(0,t.jsx)("ul",{className:"divide-y divide-line","aria-label":"Scheduled collections",children:l.map(e=>(0,t.jsx)(el,{s:e,env:h(e.environment),busy:p,current:e.id===f?.id,act:b,onRemove:async()=>{await n({title:`Stop running ${e.collection||"requests outside a folder"} on a schedule?`,body:"Its results go too. The requests stay.",confirmLabel:"Remove",tone:"danger"})&&await b(`rm:${e.id}`,()=>et.c.remove(e.id))}},e.id))}):(0,t.jsx)("p",{className:"px-4 py-3 text-sm text-mute",children:"None yet. A scheduled check keeps running while you work on something else."})]})}function el({s:e,env:s,busy:a,current:n,act:i,onRemove:l}){let r=e.results.at(-1),[o,d]=(0,R.useState)(!1),c=e.collection||"Requests outside a folder";return(0,t.jsxs)("li",{className:n?"bg-accent-dim/30":void 0,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 px-4 py-2.5",children:[r?r.passed?(0,t.jsx)(f.f,{size:16,className:"shrink-0 text-ok","aria-label":"Last run passed"}):(0,t.jsx)(M.f,{size:16,className:"shrink-0 text-bad","aria-label":"Last run failed"}):(0,t.jsx)(B,{size:16,className:"shrink-0 text-mute","aria-label":"Not run yet"}),(0,t.jsxs)("button",{type:"button",className:"min-w-0 text-left",onClick:()=>d(e=>!e),"aria-expanded":o,children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium text-ink",children:c}),(0,t.jsxs)("span",{className:"block text-xs text-mute",children:[(0,H.s)(e.everyMinutes)," · ",s," · ",e.enabled?r?`next at ${ea(Math.max((0,H.K)(e),Date.now()))}`:"first run starting":"paused"]})]}),(0,t.jsx)("span",{className:"flex items-center gap-0.5","aria-label":`Last ${e.results.length} runs`,title:"Oldest on the left",children:e.results.slice(-20).map(e=>(0,t.jsx)("span",{title:`${ea(e.at)} — ${e.headline}`,className:`h-3.5 w-1.5 rounded-sm ${e.passed?"bg-ok":"bg-bad"}`},e.at))}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[r?(0,t.jsxs)("span",{className:"mr-2 hidden text-xs text-mute sm:inline",children:[ea(r.at),": ",r.headline]}):null,(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",disabled:a===`run:${e.id}`,onClick:()=>void i(`run:${e.id}`,()=>et.c.run(e.id),e=>e.passed?`${c}: ${e.headline}`:null),title:"Run it now",children:[a===`run:${e.id}`?(0,t.jsx)($.f,{size:12,className:"animate-spin"}):(0,t.jsx)(_.f,{size:12})," Run now"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>void i(`pause:${e.id}`,()=>et.c.update(e.id,{enabled:!e.enabled})),"aria-label":e.enabled?`Pause ${c}`:`Resume ${c}`,children:[e.enabled?(0,t.jsx)(K,{size:12}):(0,t.jsx)(z.f,{size:12})," ",e.enabled?"Pause":"Resume"]}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-bad",onClick:l,"aria-label":`Remove the schedule of ${c}`,children:(0,t.jsx)(X.f,{size:14})})]})]}),o||r&&!r.passed?(0,t.jsxs)("div",{className:"space-y-2 px-4 pb-3 pl-11 text-xs text-mute",children:[r&&!r.passed?(0,t.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-ink",children:r.headline}),r.failed.length?(0,t.jsx)("ul",{className:"mt-1 list-disc space-y-0.5 pl-4",children:r.failed.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"text-ink",children:e.name}),e.message?` — ${e.message}`:""]},e.name))}):null]}):null,o?(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2",children:["Notify me",(0,t.jsx)("select",{value:e.notify,onChange:t=>void i(`notify:${e.id}`,()=>et.c.update(e.id,{notify:t.target.value})),className:"rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink",children:en.map(([e,s])=>(0,t.jsx)("option",{value:e,children:s},e))}),"How often",(0,t.jsx)("select",{value:e.everyMinutes,onChange:t=>void i(`every:${e.id}`,()=>et.c.update(e.id,{everyMinutes:Number(t.target.value)})),className:"rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink",children:[...new Set([...H.l,e.everyMinutes])].sort((e,t)=>e-t).map(e=>(0,t.jsx)("option",{value:e,children:(0,H.s)(e).replace(/^every /,"Every ")},e))})]}):null]}):null]})}let er={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"},eo="apitestcenter-suite-stop-on-fail";function ed({state:e}){return"passed"===e?(0,t.jsx)(f.f,{size:16,className:"text-ok","aria-label":"Passed"}):"failed"===e?(0,t.jsx)(M.f,{size:16,className:"text-bad","aria-label":"Failed"}):"error"===e?(0,t.jsx)(c.f,{size:16,className:"text-bad","aria-label":"Could not run"}):"skipped"===e?(0,t.jsx)(S,{size:16,className:"text-mute","aria-label":"Skipped"}):"running"===e?(0,t.jsx)($.f,{size:16,className:"animate-spin text-accent","aria-label":"Running"}):(0,t.jsx)(v.f,{size:16,className:"text-line","aria-label":"Not run yet"})}let ec=e=>`${(e.collection||"requests").replace(/[^\w.-]+/g,"-")}-${e.startedAt.slice(0,16).replace(/[:T]/g,"-")}`;e.s(["SuitePage",0,function(){let e=(0,q.useRouter)(),c=(0,q.useSearchParams)(),u=(0,I.d)(),{index:p,environments:x,activeEnv:v,setActiveEnv:k}=(0,F.U)(),N=(0,R.useMemo)(()=>p?.requests??[],[p]),S=(0,R.useMemo)(()=>[...new Set(N.flatMap(e=>e.collection?(0,s.W)(e.collection):[""]))].sort((e,t)=>""===e?1:""===t?-1:e.localeCompare(t)),[N]),T=(0,R.useCallback)(e=>N.filter(t=>e?(0,s.T)(t.collection,e):""===t.collection),[N]),E=c.get("c"),H=null!==E&&S.includes(E)?E:S[0]??null,J=(0,R.useMemo)(()=>null===H?[]:T(H),[T,H]),[Y,V]=(0,R.useState)(null),[W,B]=(0,R.useState)(null),[G,K]=(0,R.useState)(!1),[_,X]=(0,R.useState)(new Set),[Q,Z]=(0,R.useState)(!1),[ee,et]=(0,R.useState)(!1),es=(0,R.useRef)(null);(0,R.useEffect)(()=>{try{K("1"===localStorage.getItem(eo))}catch{}},[]),(0,R.useEffect)(()=>{if(null===H)return;V(null),B(null),X(new Set);let e=!0;return L.Y.plan(H).then(t=>e&&V(t)).catch(()=>e&&V({order:[],skip:[]})),()=>{e=!1}},[H]),(0,R.useEffect)(()=>()=>void(es.current&&window.clearInterval(es.current)),[]);let ea=(0,R.useMemo)(()=>(function(e,t){let s=new Map(e.map(e=>[e.id,e])),a=new Set,n=[];for(let e of t?.order??[]){let t=s.get(e);t&&!a.has(e)&&(n.push(t),a.add(e))}for(let t of e)a.has(t.id)||n.push(t);let i=new Set(t?.skip??[]);return n.map(e=>({item:e,skipped:i.has(e.id)}))})(J,Y),[J,Y]),en=W?.status==="running";(0,R.useMemo)(()=>new Map((W?.steps??[]).map(e=>[e.id,e])),[W]);let el=W?W.steps.flatMap(e=>{let t=J.find(t=>t.id===e.id);return t?[{item:t,skipped:"skipped"===e.state&&!!e.message?.startsWith("Left out"),step:e}]:[]}):ea,eu=(0,R.useCallback)(e=>{null!==H&&(V(e),L.Y.savePlan(H,e).catch(e=>u(e instanceof Error?e.message:"Could not save the order","error")))},[H,u]);function ep(e,t){let s=ea.map(e=>e.item.id),a=s.indexOf(e),n=a+t;a<0||n<0||n>=s.length||([s[a],s[n]]=[s[n],s[a]],B(null),eu({order:s,skip:Y?.skip??[]}))}async function em(){if(null!==H&&!Q){Z(!0),X(new Set);try{let e=await L.Y.start({collection:H,environmentId:v?.id??null,stopOnFail:G});B(e),es.current&&window.clearInterval(es.current),es.current=window.setInterval(async()=>{try{let t=await L.Y.get(e.id);B(t),"running"!==t.status&&(window.clearInterval(es.current),es.current=null,X(new Set(t.steps.filter(e=>"failed"===e.state||"error"===e.state).map(e=>e.id))))}catch{}},400)}catch(e){u(e instanceof Error?e.message:"Could not start the run","error")}finally{Z(!1)}}}async function ex(){if(null!==H){et(!0);try{let{blob:e,name:t,secrets:s}=await O(H,v?.name??null);(0,U.h)(t,e),u(s.length?`Saved ${t}. ${s.length} request${1===s.length?" has":"s have"} a secret typed in — switch to a {{variable}} for CI (see README in the zip).`:`Saved ${t} — unzip it into your repository. No secrets are in it.`,s.length?"info":"success")}catch(e){u(e instanceof Error?e.message:"Could not export","error")}finally{et(!1)}}}async function eh(){W&&await L.Y.stop(W.id).catch(()=>void 0)}let ef=W?a(W.steps):null,eb=W&&"running"!==W.status,eg=ea.filter(e=>!e.skipped).length;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("header",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line bg-panel px-4 py-3 lg:px-6",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h1",{className:"text-lg font-medium text-ink",children:"Run a collection"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Sends every request once, in order, and checks each one. Passes when all its checks pass, or on any 2xx/3xx when it has none."})]})}),0===S.length?(0,t.jsx)("div",{className:"m-6 max-w-xl space-y-2 text-sm text-mute",children:(0,t.jsx)("p",{children:"No saved requests yet. Save requests into a collection on the Test API page (Ctrl+S), or import a Postman collection, then come back here to run them all."})}):(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 lg:px-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Collection",(0,t.jsx)(A.f,{label:"Collection",value:H??"",disabled:en,onChange:t=>e.replace((0,L.W)(t)),minWidth:240,buttonContent:null===H?"":`${H||"No collection"} (${J.length})`,options:S.map(e=>({value:e,label:(0,t.jsx)("span",{style:{paddingLeft:`${.9*Math.max(0,(0,s.W)(e).length-1)}rem`},children:e?(0,s.g)(e):"No collection"}),hint:`${T(e).length} request${1===T(e).length?"":"s"}${e.includes("/")?` \xb7 ${e}`:""}`,text:e||"no collection"})),className:"min-w-48 rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink"})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Environment",(0,t.jsxs)("select",{value:v?.id??"",disabled:en,onChange:e=>k(e.target.value||null),className:"min-w-40 rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:[(0,t.jsx)("option",{value:"",children:"None"}),x.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 pb-1.5 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:G,disabled:en,onChange:e=>{K(e.target.checked);try{localStorage.setItem(eo,e.target.checked?"1":"0")}catch{}}}),"Stop at the first failure"]}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",disabled:ee||null===H,onClick:()=>void ex(),title:"A zip for your repository: this collection's requests, environments and run order (never secrets), plus a ready GitHub Actions pipeline",children:[ee?(0,t.jsx)($.f,{size:14,className:"animate-spin"}):(0,t.jsx)(j,{size:14}),"Download for CI"]}),en?(0,t.jsxs)("button",{type:"button",className:"btn btn-danger",onClick:()=>void eh(),children:[(0,t.jsx)(C.f,{size:14})," Stop"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!Y||0===eg||Q,onClick:()=>void em(),children:[Q?(0,t.jsx)($.f,{size:14,className:"animate-spin"}):(0,t.jsx)(z.f,{size:14}),"Run ",eg," request",1===eg?"":"s"]})]})]}),W?(0,t.jsxs)("div",{role:"status",className:`flex flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border px-4 py-3 ${en?"border-line bg-panel":n(W)?"border-ok/40 bg-ok/10":"border-bad/40 bg-bad/10"}`,children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium text-ink",children:[en?(0,t.jsx)($.f,{size:16,className:"animate-spin text-accent"}):n(W)?(0,t.jsx)(f.f,{size:16,className:"text-ok"}):(0,t.jsx)(M.f,{size:16,className:"text-bad"}),en?"Running…":n(W)?"All requests passed":"Not all requests passed"]}),(0,t.jsx)("span",{className:"text-sm text-mute",children:i(W)}),ef&&eb?(0,t.jsxs)("span",{className:"text-sm text-mute",children:["· ",(ef.durationMs/1e3).toFixed(1)," s of response time"]}):null,eb?(0,t.jsxs)("span",{className:"ml-auto flex flex-wrap items-center gap-1",children:[(0,t.jsx)("span",{className:"mr-1 text-xs text-mute",children:"Save as"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>(0,U.N)(`${ec(W)}.html`,function(e,t={}){let s=a(e.steps),l=n(e),r=e.collection||"Saved requests",c=e=>"passed"===e?"ok":"failed"===e||"error"===e?"bad":"mute",u=e.steps.map((e,t)=>{let s=e.checks?.length?`<ul class="checks">${e.checks.map(e=>`<li class="${e.ok?"ok":"bad"}">${e.ok?"✓":"✕"} ${o(e.name)}</li>`).join("")}</ul>`:"",a=e.bodyPreview?`<details><summary>Response body</summary><pre>${o(e.bodyPreview)}</pre></details>`:"",n=e.runFirst?`<div class="sub">Run first: ${o(e.runFirst.label)}${e.runFirst.reused?" (reused)":""}</div>`:"",i=e.saved?.length?`<div class="sub">${e.saved.map(e=>e.found?`Saved {{${o(e.name)}}} = ${o(e.preview??"")}`:`✕ {{${o(e.name)}}} not found`).join(" · ")}</div>`:"";return`<tr>
58
+ <td class="n">${t+1}</td>
59
+ <td><span class="state ${c(e.state)}">${d[e.state]}</span></td>
60
+ <td><div><b class="m">${o(e.method)}</b> ${o(e.name)}</div><div class="sub mono">${o(e.url)}</div>${n}${i}${e.message?`<div class="msg ${c(e.state)}">${o(e.message)}</div>`:""}${s}${a}</td>
61
+ <td class="num">${e.status??"–"}</td>
62
+ <td class="num">${null!=e.durationMs?`${Math.round(e.durationMs)} ms`:"–"}</td>
63
+ </tr>`}).join("\n");return`<!doctype html>
64
+ <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
65
+ <title>${o(r)} — collection run</title>
66
+ <style>
67
+ :root { --ink:#12151c; --mute:#5c6778; --line:#d5dce6; --panel:#fff; --canvas:#f4f6f9; --ok:#137333; --bad:#c62828; --okbg:#e6f4ea; --badbg:#fce8e6; }
68
+ * { box-sizing:border-box; }
69
+ body { margin:0; background:var(--canvas); color:var(--ink); font:14px/1.5 "Segoe UI",system-ui,-apple-system,sans-serif; }
70
+ main { max-width:1000px; margin:0 auto; padding:28px 16px 48px; }
71
+ h1 { font-size:22px; margin:0 0 4px; }
72
+ .meta { color:var(--mute); font-size:13px; margin-bottom:18px; }
73
+ .banner { border-radius:10px; padding:14px 16px; font-weight:600; margin-bottom:16px; }
74
+ .banner.ok { background:var(--okbg); color:var(--ok); } .banner.bad { background:var(--badbg); color:var(--bad); }
75
+ .tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-bottom:18px; }
76
+ .tile { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:10px 14px; }
77
+ .tile b { display:block; font-size:24px; }
78
+ .tile span { color:var(--mute); font-size:12.5px; }
79
+ table { width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
80
+ th, td { text-align:left; vertical-align:top; padding:9px 10px; border-bottom:1px solid var(--line); }
81
+ th { font-size:12px; color:var(--mute); font-weight:600; background:#eef1f6; }
82
+ .n, .num { white-space:nowrap; font-variant-numeric:tabular-nums; } .num { text-align:right; }
83
+ .state { display:inline-block; font-size:12px; font-weight:600; padding:1px 8px; border-radius:999px; white-space:nowrap; }
84
+ .state.ok { background:var(--okbg); color:var(--ok); } .state.bad { background:var(--badbg); color:var(--bad); } .state.mute { background:#eef1f6; color:var(--mute); }
85
+ .m { font-family:ui-monospace,Consolas,monospace; font-size:12px; }
86
+ .sub { color:var(--mute); font-size:12.5px; } .mono { font-family:ui-monospace,Consolas,monospace; word-break:break-all; }
87
+ .msg { font-size:13px; margin-top:4px; } .msg.bad { color:var(--bad); } .msg.mute { color:var(--mute); }
88
+ .checks { list-style:none; padding:0; margin:6px 0 0; font-size:12.5px; } .checks .ok { color:var(--ok); } .checks .bad { color:var(--bad); }
89
+ details { margin-top:6px; font-size:12.5px; } summary { cursor:pointer; color:var(--mute); }
90
+ pre { white-space:pre-wrap; word-break:break-all; background:#eef1f6; padding:8px; border-radius:6px; max-height:300px; overflow:auto; }
91
+ footer { color:var(--mute); font-size:12px; margin-top:16px; }
92
+ </style></head><body><main>
93
+ <h1>${o(r)}</h1>
94
+ <div class="meta">Collection run \xb7 ${o(new Date(e.startedAt).toLocaleString("en-GB"))}${e.environment?` \xb7 environment ${o(e.environment)}`:""}</div>
95
+ <div class="banner ${l?"ok":"bad"}">${l?"✓ All requests passed":"✕ Not all requests passed"} — ${o(i(e))}</div>
96
+ <div class="tiles">
97
+ <div class="tile"><b>${s.passed}</b><span>passed</span></div>
98
+ <div class="tile"><b>${s.failed}</b><span>failed</span></div>
99
+ <div class="tile"><b>${s.errors}</b><span>could not run</span></div>
100
+ <div class="tile"><b>${s.skipped}</b><span>skipped</span></div>
101
+ <div class="tile"><b>${(s.durationMs/1e3).toFixed(1)} s</b><span>total response time</span></div>
102
+ </div>
103
+ <table>
104
+ <thead><tr><th>#</th><th>Result</th><th>Request</th><th class="num">Status</th><th class="num">Time</th></tr></thead>
105
+ <tbody>
106
+ ${u}
107
+ </tbody></table>
108
+ <footer>Made with APITestCenter \xb7 ${o(t.generatedAt??new Date().toISOString())}. A request passes when all its checks pass; without checks, on any 2xx or 3xx status.</footer>
109
+ </main></body></html>
110
+ `}(W),"text/html"),children:[(0,t.jsx)(y.f,{size:12})," HTML"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>{let e,t,s,n;return(0,U.N)(`${ec(W)}.xml`,(e=a(W.steps),t=W.collection||"Saved requests",s=W.steps.map(e=>{let s=`${e.method} ${e.name}`,a=` <testcase classname="${l(t)}" name="${l(s)}" time="${r(e.durationMs)}">`;if("passed"===e.state)return`${a}</testcase>`;if("skipped"===e.state||"pending"===e.state||"running"===e.state)return`${a}
111
+ <skipped message="${l(e.message??"Not run")}"/>
112
+ </testcase>`;let n="error"===e.state?"error":"failure",i=[e.status?`Status ${e.status}`:"",...(e.checks??[]).map(e=>`${e.ok?"✓":"✕"} ${e.name}`),e.bodyPreview?`
113
+ Response:
114
+ ${e.bodyPreview}`:""].filter(Boolean).join("\n");return`${a}
115
+ <${n} message="${l(e.message??e.state)}">${l(i)}</${n}>
116
+ </testcase>`}),n=r(e.durationMs),`<?xml version="1.0" encoding="UTF-8"?>
117
+ <testsuites name="APITestCenter" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}">
118
+ <testsuite name="${l(t)}" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}" timestamp="${l(W.startedAt)}">
119
+ ${s.join("\n")}
120
+ </testsuite>
121
+ </testsuites>
122
+ `),"application/xml")},title:"JUnit XML for CI dashboards",children:[(0,t.jsx)(y.f,{size:12})," JUnit"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>(0,U.N)(`${ec(W)}.json`,`${JSON.stringify({kind:"apitestcenter-suite",version:1,...W,totals:a(W.steps),passed:n(W)},null,2)}
123
+ `,"application/json"),children:[(0,t.jsx)(y.f,{size:12})," JSON"]})]}):null]}):null,(0,t.jsxs)("section",{"aria-label":"Requests in run order",className:"overflow-hidden rounded-lg border border-line bg-panel",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2 text-xs text-mute",children:[(0,t.jsx)(w.f,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{children:W?"Results":"Run order — untick to leave a request out; use the arrows to reorder. Saved for next time and for the CLI."})]}),Y?(0,t.jsx)("ol",{children:el.map(({item:s,skipped:a,step:n},i)=>{let l=_.has(s.id),r=n&&(n.message||n.checks?.length||n.bodyPreview||n.runFirst||n.saved?.length);return(0,t.jsxs)("li",{className:"border-b border-line last:border-b-0",children:[(0,t.jsxs)("div",{className:`flex items-center gap-3 px-4 py-2 ${a&&!W?"opacity-50":""}`,children:[W?(0,t.jsx)(ed,{state:n?.state??"pending"}):(0,t.jsx)("input",{type:"checkbox",checked:!a,onChange:()=>{var e;let t;return e=s.id,void((t=new Set(Y?.skip??[])).has(e)?t.delete(e):t.add(e),B(null),eu({order:ea.map(e=>e.item.id),skip:[...t]}))},"aria-label":`Include ${s.name}`}),(0,t.jsx)("span",{className:"w-6 shrink-0 text-right font-mono text-xs text-mute",children:i+1}),(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left",onClick:()=>r?X(e=>{let t=new Set(e);return t.has(s.id)?t.delete(s.id):t.add(s.id),t}):void 0,"aria-expanded":r?l:void 0,children:[(0,t.jsx)("span",{className:`w-14 shrink-0 font-mono text-xs font-medium ${er[s.method]??"text-mute"}`,children:s.method}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block truncate text-sm text-ink",children:s.name}),(0,t.jsx)("span",{className:"block truncate font-mono text-[11px] text-mute",children:s.url})]}),r?l?(0,t.jsx)(b.f,{size:14,className:"shrink-0 text-mute"}):(0,t.jsx)(g.f,{size:14,className:"shrink-0 text-mute"}):null]}),n?.status?(0,t.jsx)("span",{className:`font-mono text-xs ${n.status<400?"text-ok":"text-bad"}`,children:n.status}):null,n?.durationMs!=null?(0,t.jsxs)("span",{className:"w-16 text-right font-mono text-xs text-mute",children:[Math.round(n.durationMs)," ms"]}):null,W?null:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-ink disabled:opacity-30",disabled:0===i,onClick:()=>ep(s.id,-1),"aria-label":`Move ${s.name} up`,children:(0,t.jsx)(h,{size:14})}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-ink disabled:opacity-30",disabled:i===el.length-1,onClick:()=>ep(s.id,1),"aria-label":`Move ${s.name} down`,children:(0,t.jsx)(m,{size:14})})]})]}),l&&n?(0,t.jsxs)("div",{className:"space-y-2 bg-panel-2 px-4 py-3 pl-[4.75rem] text-sm",children:[n.message?(0,t.jsx)("p",{className:"skipped"===n.state?"text-mute":"text-bad",children:n.message}):null,n.runFirst?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Run first: ",n.runFirst.label,n.runFirst.reused?" (reused from an earlier request)":""]}):null,n.saved?.length?(0,t.jsx)("p",{className:"text-xs",children:n.saved.map(e=>(0,t.jsx)("span",{className:`mr-3 ${e.found?"text-ok":"text-bad"}`,children:e.found?`Saved {{${e.name}}} = ${e.preview??""}`:`✕ {{${e.name}}} not found`},e.name))}):null,n.checks?.length?(0,t.jsx)("ul",{className:"space-y-0.5 text-xs",children:n.checks.map((e,s)=>(0,t.jsxs)("li",{className: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,n.bodyPreview?(0,t.jsx)("pre",{className:"max-h-48 overflow-auto rounded-md border border-line bg-canvas p-2 font-mono text-[11px] whitespace-pre-wrap text-ink",children:n.bodyPreview}):null,(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>(function(t){try{sessionStorage.setItem(P.M,t)}catch{}(0,D.m)(),e.push("/")})(s.id),children:"Open this request"})]}):null]},s.id)})}):(0,t.jsx)("p",{className:"px-4 py-6 text-sm text-mute",children:"Loading…"}),eb?(0,t.jsx)("div",{className:"border-t border-line px-4 py-2 text-right",children:(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>B(null),children:"Edit the run order"})}):null]}),(0,t.jsx)(ei,{collection:H,environment:v?.id??null})]})})]})}],93639)},17219,e=>{let t=new Uint32Array(256).map((e,t)=>{let s=t;for(let e=0;e<8;e++)s=1&s?0xedb88320^s>>>1:s>>>1;return s>>>0});function s(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function a(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function n(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),s=0;for(let a of e)t.set(a,s),s+=a.length;return t}e.s(["f",0,function(e){let i=new TextEncoder,l=[],r=[],o=0;for(let[d,c]of Object.entries(e)){let e=i.encode(d),u="string"==typeof c?i.encode(c):c,p=function(e){let s=0xffffffff;for(let a of e)s=t[(s^a)&255]^s>>>8;return(0xffffffff^s)>>>0}(u),m=n([a(0x4034b50),s(20),s(0),s(0),s(0),s(0),a(p),a(u.length),a(u.length),s(e.length),s(0),e,u]),x=n([a(0x2014b50),s(20),s(20),s(0),s(0),s(0),s(0),a(p),a(u.length),a(u.length),s(e.length),s(0),s(0),s(0),s(0),a(0),a(o),e]);l.push(m),r.push(x),o+=m.length}let d=n(r),c=n([a(0x6054b50),s(0),s(0),s(Object.keys(e).length),s(Object.keys(e).length),a(d.length),a(o),s(0)]),u=n([...l,d,c]);return new Blob([u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)],{type:"application/zip"})}])},32035,e=>{var t=e.i(56003);let s={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],32035)},92368,e=>{var t=e.i(56003);let s={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],92368)},47298,14168,e=>{var t=e.i(56003);let s={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};s.node;let a=(0,t.f)(s);async function n(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}e.s(["f",0,a],47298);let i=(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)});e.s(["Y",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),savePlan:(e,t)=>i("PUT","/engine/suites/plan",{collection:e,...t}).then(e=>n(e)),start:e=>i("POST","/engine/suites/runs",e).then(e=>n(e)),get:e=>fetch(`/engine/suites/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),stop:e=>i("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>n(e))},"W",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}],14168)}])})();