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.
Files changed (109) hide show
  1. package/dist/THIRD-PARTY-NOTICES-UI.txt +11 -11
  2. package/dist/THIRD-PARTY-NOTICES.txt +6 -6
  3. package/dist/cli.mjs +600 -593
  4. package/dist/ui/404/index.html +1 -1
  5. package/dist/ui/404.html +1 -1
  6. package/dist/ui/__next.__PAGE__.txt +32 -21
  7. package/dist/ui/__next._full.txt +29 -18
  8. package/dist/ui/__next._tree.txt +5 -4
  9. package/dist/ui/_next/static/chunks/0-zga2d528cxt.js +50 -0
  10. package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +123 -0
  11. package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +50 -0
  12. package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +50 -0
  13. package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +1 -0
  14. package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +1 -0
  15. package/dist/ui/_next/static/chunks/0q8iq_7i4ohjr.js +50 -0
  16. package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +31 -0
  17. package/dist/ui/_next/static/chunks/12whdxhkvkd-y.js +1 -0
  18. package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +50 -0
  19. package/dist/ui/_next/static/chunks/1mm60-ywpri7b.js +2 -0
  20. package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +4 -0
  21. package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +1 -0
  22. package/dist/ui/_next/static/chunks/2c1b5jqwxl4ra.js +906 -0
  23. package/dist/ui/_next/static/chunks/2sb9zma7ae-_f.js +27 -0
  24. package/dist/ui/_next/static/chunks/2sjog4to0fmbb.css +3 -0
  25. package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +3 -0
  26. package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +51 -0
  27. package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +22 -0
  28. package/dist/ui/_next/static/chunks/3wtqdtu331_vc.js +50 -0
  29. package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +2 -0
  30. package/dist/ui/_next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
  31. package/dist/ui/_not-found/__next._full.txt +25 -17
  32. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +28 -20
  33. package/dist/ui/_not-found/__next._tree.txt +4 -2
  34. package/dist/ui/_not-found/index.html +1 -1
  35. package/dist/ui/_not-found/index.txt +25 -17
  36. package/dist/ui/compare/__next._full.txt +32 -20
  37. package/dist/ui/compare/__next._tree.txt +6 -4
  38. package/dist/ui/compare/__next.compare.__PAGE__.txt +36 -24
  39. package/dist/ui/compare/index.html +1 -1
  40. package/dist/ui/compare/index.txt +32 -20
  41. package/dist/ui/connections/__next._full.txt +30 -20
  42. package/dist/ui/connections/__next._tree.txt +6 -4
  43. package/dist/ui/connections/__next.connections.__PAGE__.txt +34 -24
  44. package/dist/ui/connections/index.html +2 -2
  45. package/dist/ui/connections/index.txt +30 -20
  46. package/dist/ui/history/__next._full.txt +35 -23
  47. package/dist/ui/history/__next._tree.txt +6 -4
  48. package/dist/ui/history/__next.history.__PAGE__.txt +39 -27
  49. package/dist/ui/history/index.html +1 -1
  50. package/dist/ui/history/index.txt +35 -23
  51. package/dist/ui/home/__next._full.txt +32 -20
  52. package/dist/ui/home/__next._tree.txt +6 -4
  53. package/dist/ui/home/__next.home.__PAGE__.txt +36 -24
  54. package/dist/ui/home/index.html +1 -1
  55. package/dist/ui/home/index.txt +32 -20
  56. package/dist/ui/index.html +1 -1
  57. package/dist/ui/index.txt +29 -18
  58. package/dist/ui/preview/__next._full.txt +33 -23
  59. package/dist/ui/preview/__next._tree.txt +6 -4
  60. package/dist/ui/preview/__next.preview.__PAGE__.txt +37 -27
  61. package/dist/ui/preview/index.html +1 -1
  62. package/dist/ui/preview/index.txt +33 -23
  63. package/dist/ui/suite/__next._full.txt +29 -20
  64. package/dist/ui/suite/__next._tree.txt +6 -4
  65. package/dist/ui/suite/__next.suite.__PAGE__.txt +33 -24
  66. package/dist/ui/suite/index.html +1 -1
  67. package/dist/ui/suite/index.txt +29 -20
  68. package/dist/ui/tests/__next._full.txt +28 -20
  69. package/dist/ui/tests/__next._tree.txt +6 -4
  70. package/dist/ui/tests/__next.tests.__PAGE__.txt +32 -24
  71. package/dist/ui/tests/index.html +1 -1
  72. package/dist/ui/tests/index.txt +28 -20
  73. package/package.json +1 -1
  74. package/dist/ui/_next/static/chunks/01sqehfan_2j_.js +0 -1
  75. package/dist/ui/_next/static/chunks/036rg3itpc5ge.js +0 -50
  76. package/dist/ui/_next/static/chunks/0e8f1i6w6dqos.js +0 -50
  77. package/dist/ui/_next/static/chunks/0hvubzjy33qo9.js +0 -2
  78. package/dist/ui/_next/static/chunks/0ktc3lx37s0t5.js +0 -4
  79. package/dist/ui/_next/static/chunks/0wrod6xlhsv0m.js +0 -3
  80. package/dist/ui/_next/static/chunks/1-d6f0jo8p7jc.js +0 -913
  81. package/dist/ui/_next/static/chunks/15pu58j0qz9i8.js +0 -31
  82. package/dist/ui/_next/static/chunks/1apjslkz52j1a.js +0 -22
  83. package/dist/ui/_next/static/chunks/1nfb0xrm2a6di.css +0 -3
  84. package/dist/ui/_next/static/chunks/1pz4ugabfd0qn.js +0 -1
  85. package/dist/ui/_next/static/chunks/1t823xy7gguwx.js +0 -1
  86. package/dist/ui/_next/static/chunks/23_x0u07xh89v.js +0 -123
  87. package/dist/ui/_next/static/chunks/2aifruy-vhchn.js +0 -50
  88. package/dist/ui/_next/static/chunks/2t65s4y0z2a60.js +0 -50
  89. package/dist/ui/_next/static/chunks/33kvaxr7qvnue.js +0 -50
  90. package/dist/ui/_next/static/chunks/36wzwezwmtzq7.js +0 -51
  91. package/dist/ui/_next/static/chunks/3b26__7yusttj.js +0 -1
  92. package/dist/ui/_next/static/chunks/3n2xlaj16gyb-.js +0 -2
  93. package/dist/ui/_next/static/chunks/3vso5wrs90xx-.js +0 -50
  94. package/dist/ui/_next/static/chunks/3yck6s93oif7s.js +0 -27
  95. package/dist/ui/_next/static/chunks/turbopack-2qka98q_-4ca1.js +0 -1
  96. /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_buildManifest.js +0 -0
  97. /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_clientMiddlewareManifest.js +0 -0
  98. /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_ssgManifest.js +0 -0
  99. /package/dist/ui/_next/static/media/{8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 → 07935285219a259d-s.1qq4vpdcun5oj.woff2} +0 -0
  100. /package/dist/ui/_next/static/media/{797e433ab948586e-s.p.0r6juujl39pe6.woff2 → 07a39a8a4660cc7c-s.p.0r6juujl39pe6.woff2} +0 -0
  101. /package/dist/ui/_next/static/media/{bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 → 2a04751c893bf294-s.1rgnod-3esatf.woff2} +0 -0
  102. /package/dist/ui/_next/static/media/{6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 → 2bb852295097cd96-s.2dbetqa9o8jxf.woff2} +0 -0
  103. /package/dist/ui/_next/static/media/{fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 → 4f6667dd39116621-s.3p2_lha1f2xer.woff2} +0 -0
  104. /package/dist/ui/_next/static/media/{caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 → 605ce01b664af129-s.p.0wgildi0cnwt9.woff2} +0 -0
  105. /package/dist/ui/_next/static/media/{4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 → 6e342921ee4dcd9d-s.2tuy5pz7dlieh.woff2} +0 -0
  106. /package/dist/ui/_next/static/media/{7178b3e590c64307-s.21jp631_3pja2.woff2 → 77814b00d5ca94a4-s.21jp631_3pja2.woff2} +0 -0
  107. /package/dist/ui/_next/static/media/{7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 → 9eb5a876700c0028-s.1uyisp29ctx0d.woff2} +0 -0
  108. /package/dist/ui/_next/static/media/{5ce348bf30bf5439-s.31988l_ccedte.woff2 → b0c6b664fd57c2c6-s.31988l_ccedte.woff2} +0 -0
  109. /package/dist/ui/_next/static/media/{53b9e256198e5412-s.390ncx5urfkfu.woff2 → f58031ded4338640-s.390ncx5urfkfu.woff2} +0 -0
@@ -1,50 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37837,e=>{"use strict";var t=e.i(14368),n=e.i(99181),s=e.i(68820),r=e.i(14865);e.s(["Popover",0,function({anchor:e,open:o,onClose:a,children:l,label:i,width:c=280,role:d="dialog"}){let u=(0,n.useRef)(null),[p,m]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{if(!o)return;let t=()=>{if(!e.current)return;let t=(0,r.pageRect)(e.current),n=(0,r.pageViewport)(),s=u.current?.offsetHeight??320,o=n.height-t.bottom-8,a=t.top-8,l=o<Math.min(s,240)&&a>o,i=Math.min(Math.max(8,t.right-c),n.width-c-8);m({top:l?Math.max(8,t.top-Math.min(s,a)-4):t.bottom+4,left:i,maxHeight:Math.max(160,(l?a:o)-4)})};t();let n=window.requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[o,e,c]),(0,n.useEffect)(()=>{if(!o)return;let t=t=>{let n=t.target;u.current?.contains(n)||e.current?.contains(n)||a()},n=t=>{"Escape"===t.key&&(t.stopPropagation(),a(),e.current?.focus())},s=e=>{u.current?.contains(e.target)||a()},r=t=>{e.current?.contains(t.target)&&(t.stopPropagation(),t.preventDefault(),a())};return document.addEventListener("pointerdown",t,!0),document.addEventListener("click",r,!0),document.addEventListener("keydown",n,!0),document.addEventListener("scroll",s,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("click",r,!0),document.removeEventListener("keydown",n,!0),document.removeEventListener("scroll",s,!0)}},[o,a,e]),(0,n.useEffect)(()=>{o&&window.setTimeout(()=>u.current?.querySelector("[role=menuitem], input, select, button")?.focus(),0)},[o]),!o||"u"<typeof document)?null:(0,s.createPortal)((0,t.jsx)("div",{ref:u,role:d,"aria-label":i,style:{top:p?.top??-9999,left:p?.left??-9999,width:c,maxHeight:p?.maxHeight},className:"anim-pop fixed z-[70] overflow-auto rounded-lg border border-line bg-panel p-3 shadow-2xl",children:l}),document.body)}])},32610,e=>{"use strict";var t=e.i(14368),n=e.i(99181);e.s(["Splitter",0,function({orientation:e,label:s,value:r,onMove:o,onStep:a,onReset:l,onDragging:i,className:c="",style:d}){let[u,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>i?.(u),[u,i]),(0,n.useEffect)(()=>{if(!u)return;let t=e=>o(e.clientX,e.clientY),n=()=>p(!1);return document.body.style.userSelect="none",document.body.style.cursor="vertical"===e?"col-resize":"row-resize",window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),()=>{document.body.style.userSelect="",document.body.style.cursor="",window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n)}},[u,o,e]);let m="vertical"===e;return(0,t.jsx)("div",{role:"separator",tabIndex:0,"aria-orientation":e,"aria-label":s,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r),title:`${s} — drag, or double-click to reset`,onPointerDown:e=>{0===e.button&&(e.preventDefault(),p(!0))},onDoubleClick:l,style:{...d,outline:"none"},onKeyDown:e=>{let t=m?"ArrowLeft":"ArrowUp";e.key===t||e.key===(m?"ArrowRight":"ArrowDown")?(e.preventDefault(),a(e.key===t?-1:1,e.shiftKey)):("Enter"===e.key||"Home"===e.key)&&(e.preventDefault(),l())},className:`group z-20 hidden touch-none outline-none lg:block ${m?"w-2 cursor-col-resize":"h-2 cursor-row-resize"} ${c}`,children:(0,t.jsx)("span",{"aria-hidden":!0,className:`pointer-events-none absolute bg-accent opacity-0 transition-opacity group-hover:opacity-60 group-focus-visible:opacity-100 ${u?"opacity-100":""} ${m?"inset-y-0 left-1/2 w-0.5 -translate-x-1/2":"inset-x-0 top-1/2 h-0.5 -translate-y-1/2"}`})})}])},30617,e=>{"use strict";e.i(24856);var t=e.i(46306),n=e.i(36558),s=e.i(2385),r=e.i(17219);let o={base:0,header:1,desc:2,pass:3,warn:4,fail:5};function a(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("\n","&#10;")}function l(e,t,n){if("level"===e)return"pass"===t?o.pass:"warn"===t?o.warn:"fail"===t?o.fail:o.base;let s="number"==typeof t?t:Number(t);return"errors"===e?s>=n.errorFail?o.fail:s>=n.errorWarn?o.warn:o.pass:s>=n.p95FailMs?o.fail:s>=n.p95WarnMs?o.warn:o.pass}let i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
3
- <fonts count="3">
4
- <font><sz val="11"/><name val="Calibri"/></font>
5
- <font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font>
6
- <font><sz val="10"/><color rgb="FF5C6778"/><name val="Calibri"/></font>
7
- </fonts>
8
- <fills count="6">
9
- <fill><patternFill patternType="none"/></fill>
10
- <fill><patternFill patternType="gray125"/></fill>
11
- <fill><patternFill patternType="solid"><fgColor rgb="FF0B8F7C"/></patternFill></fill>
12
- <fill><patternFill patternType="solid"><fgColor rgb="FFDCFCE7"/></patternFill></fill>
13
- <fill><patternFill patternType="solid"><fgColor rgb="FFFEF3C7"/></patternFill></fill>
14
- <fill><patternFill patternType="solid"><fgColor rgb="FFFECACA"/></patternFill></fill>
15
- </fills>
16
- <borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>
17
- <cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
18
- <cellXfs count="6">
19
- <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
20
- <xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center"/></xf>
21
- <xf numFmtId="0" fontId="2" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment wrapText="1" vertical="center"/></xf>
22
- <xf numFmtId="0" fontId="0" fillId="3" borderId="0" xfId="0" applyFill="1"/>
23
- <xf numFmtId="0" fontId="0" fillId="4" borderId="0" xfId="0" applyFill="1"/>
24
- <xf numFmtId="0" fontId="0" fillId="5" borderId="0" xfId="0" applyFill="1"/>
25
- </cellXfs>
26
- </styleSheet>`;async function c(e,r,a){let i=(0,s.buildVerdict)(e,{slo:r}),c=(0,s.verdictBars)(r),u=(0,t.normalizeChartLayout)(a,(0,t.hasThresholdTiles)(e));return d([{name:"Overview",rows:[[{v:"Key",s:o.header},{v:"Value",s:o.header},{v:"What this means",s:o.header}],...(0,n.summaryExportRows)(e).map(e=>{let t=o.base;return"failed_rate"===e.key&&(t=l("errors",e.value,c)),"latency_p95_ms"===e.key&&(t=l("latency",e.value,c)),(e.key.startsWith("status_5")||"status_0"===e.key)&&(t=Number(e.value)>0?o.fail:o.pass),e.key.startsWith("status_4")&&Number(e.value)>0&&(t=o.warn),e.key.startsWith("threshold:")&&(t="pass"===e.value?o.pass:o.fail),[{v:e.key},{v:e.value,s:t},{v:e.description,s:o.desc}]})]},{name:"Result summary",rows:[[{v:"Field",s:o.header},{v:"Level",s:o.header},{v:"What this means",s:o.header}],[{v:"overall"},{v:i.overall,s:l("level",i.overall,c)},{v:i.headline,s:o.desc}],...i.aspects.map(e=>[{v:e.title},{v:e.level,s:l("level",e.level,c)},{v:e.summary,s:o.desc}]),[{v:"disclaimer"},{v:""},{v:i.disclaimer,s:o.desc}],...u.map((e,n)=>[{v:`chart_${n+1}`},{v:`${e.w}x${e.h}`},{v:t.CHART_TILE_TITLES[e.id],s:o.desc}])]},{name:"Second by second",rows:[n.SERIES_COLUMNS.map(e=>({v:e.header,s:o.header})),...e.buckets.map(e=>(0,n.seriesExportRow)(e).map((e,t)=>{let s=n.SERIES_COLUMNS[t]?.key,r=o.base;return"p95_ms"===s&&(r=l("latency",e,c)),"failed_rate"===s&&(r=l("errors",e,c)),"http_5xx"===s&&Number(e)>0&&(r=o.fail),"http_0"===s&&Number(e)>0&&(r=o.fail),"http_4xx"===s&&Number(e)>0&&(r=o.warn),"http_2xx"===s&&Number(e)>0&&(r=o.pass),{v:e,s:r}}))]}])}function d(e){let t={"[Content_Types].xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
27
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
28
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
29
- <Default Extension="xml" ContentType="application/xml"/>
30
- <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
31
- <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
32
- ${e.map((e,t)=>` <Override PartName="/xl/worksheets/sheet${t+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("\n")}
33
- </Types>`,"_rels/.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
34
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
35
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
36
- </Relationships>`,"xl/workbook.xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
37
- <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
38
- <sheets>
39
- ${e.map((e,t)=>` <sheet name="${a(e.name.replace(/[:\\/?*[\]]/g," ").trim().slice(0,31)||"Sheet")}" sheetId="${t+1}" r:id="rId${t+1}"/>`).join("\n")}
40
- </sheets>
41
- </workbook>`,"xl/_rels/workbook.xml.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
42
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
43
- ${e.map((e,t)=>` <Relationship Id="rId${t+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${t+1}.xml"/>`).join("\n")}
44
- <Relationship Id="rId${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
45
- </Relationships>`,"xl/styles.xml":i};return e.forEach((e,n)=>{var s;let r,o,l;return t[`xl/worksheets/sheet${n+1}.xml`]=(s=e.rows,o=Array.from({length:r=s[0]?.length??0},(e,t)=>{let n=function(e,t,n=10,s=48){let r=n;for(let n of e){let e=n[t]?.v;void 0!==e&&(r=Math.max(r,String(e).length+2))}return Math.min(s,r)}(s,t,t===r-1&&r>=3?36:12,t===r-1&&r>=3?72:42);return`<col min="${t+1}" max="${t+1}" width="${n}" customWidth="1"/>`}).join(""),l=s.map((e,t)=>`<row r="${t+1}" ht="${0===t?22:18}" customHeight="1">${e.map((e,n)=>{var s;let r,o;return s=t+1,r=`${function(e){let t=e+1,n="";for(;t>0;)n=String.fromCharCode(65+(t-1)%26)+n,t=Math.floor((t-1)/26);return n}(n)}${s}`,o=void 0!==e.s?` s="${e.s}"`:"","number"==typeof e.v&&Number.isFinite(e.v)?`<c r="${r}"${o}><v>${e.v}</v></c>`:`<c r="${r}"${o} t="inlineStr"><is><t xml:space="preserve">${a(e.v)}</t></is></c>`}).join("")}</row>`).join(""),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
46
- <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
47
- <sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>
48
- <cols>${o}</cols>
49
- <sheetData>${l}</sheetData>
50
- </worksheet>`)}),new Blob([(0,r.zipStore)(t)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}e.s(["S",0,o,"exportRunXlsx",0,c,"xlsxBook",0,d])},62766,e=>{"use strict";var t=e.i(99181);let n="apitestcenter-pane-sizes",s=(e,t,n)=>Math.min(n,Math.max(t,e));function r(e){let[n,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let t=window.matchMedia(e),n=()=>s(t.matches);return n(),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e]),n}e.s(["useColumnSplit",0,function(e,{min:o=220,max:a=900,rest:l=360}={}){let i=r("(min-width: 1024px)"),c=(0,t.useRef)(null),d=`${n}:${e}`,[u,p]=(0,t.useState)(null),[m,h]=(0,t.useState)(0);(0,t.useEffect)(()=>{try{let e=Number(JSON.parse(localStorage.getItem(d)??"null"));Number.isFinite(e)&&e>0&&p(e)}catch{}},[d]),(0,t.useEffect)(()=>{let e=[...c.current?.children??[]].find(e=>"separator"!==e.getAttribute("role"));if(!e)return;let t=new ResizeObserver(()=>h(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[i]);let f=(0,t.useCallback)(e=>{let t=c.current?.getBoundingClientRect(),n=null===e?null:Math.round(s(e,o,Math.max(o,Math.min(a,(t?.width??a+l)-l))));p(n);try{null===n?localStorage.removeItem(d):localStorage.setItem(d,JSON.stringify(n))}catch{}},[a,o,l,d]),y=()=>c.current?.getBoundingClientRect();return{wide:i,gridRef:c,gridStyle:i&&null!==u?{gridTemplateColumns:`${u}px minmax(0,1fr)`}:void 0,splitter:{orientation:"vertical",value:(u??m)/Math.max(1,y()?.width??1)*100,onMove:e=>{let t=y();t&&f(e-t.left)},onStep:(e,t)=>f((u??m)+16*e*(t?4:1)),onReset:()=>f(null),className:"absolute inset-y-0 -translate-x-1/2",style:{left:`${m}px`}}}},"usePaneSizes",0,function(e,o){let a=r("(min-width: 1024px)"),l=r("(min-width: 1536px)"),i=(0,t.useRef)(null),[c,d]=(0,t.useState)({panel:null,beside:null,below:null});(0,t.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(n)??"null"),t=e=>"number"==typeof e&&Number.isFinite(e)?e:null;e&&d({panel:t(e.panel),beside:t(e.beside),below:t(e.below)})}catch{}},[]);let u=(0,t.useCallback)(e=>{d(t=>{let s={...t,...e};try{localStorage.setItem(n,JSON.stringify(s))}catch{}return s})},[]),p=s(c.panel??(l?256:240),180,480),m=o?p:0,h=s("below"===e?c.below??.5:c.beside??(l?5/12:.5),.2,.8),f=a?"below"===e?{gridTemplateColumns:`${m}px minmax(0,1fr)`,gridTemplateRows:`minmax(0,${h}fr) minmax(0,${1-h}fr)`}:{gridTemplateColumns:`${m}px minmax(0,${h}fr) minmax(0,${1-h}fr)`}:void 0,y=()=>i.current?.getBoundingClientRect(),v=(0,t.useCallback)(e=>{let t=y();t&&u({panel:s(e-t.left,180,Math.min(480,.4*t.width))})},[u]),x=(0,t.useCallback)((t,n)=>{let r=y();r&&("below"===e?u({below:s((n-r.top)/r.height,.2,.8)}):u({beside:s((t-r.left-m)/Math.max(1,r.width-m),.2,.8)}))},[u,e,m]);return{wide:a,gridRef:i,gridStyle:f,panelWidth:a?p:void 0,panel:{value:p/480*100,onMove:e=>v(e),onStep:(e,t)=>u({panel:s(p+16*e*(t?4:1),180,480)}),onReset:()=>u({panel:null}),style:{left:`${m}px`}},split:{value:100*h,onMove:x,onStep:(t,n)=>u("below"===e?{below:s(h+.02*t*(n?5:1),.2,.8)}:{beside:s(h+.02*t*(n?5:1),.2,.8)}),onReset:()=>u("below"===e?{below:null}:{beside:null}),style:"below"===e?{top:`${100*h}%`,left:`${m}px`,right:0}:{left:`calc(${m}px + (100% - ${m}px) * ${h})`,top:0,bottom:0}}}}])},61230,17847,e=>{"use strict";e.s(["readableUrl",0,function(e){try{return decodeURI(e.replace(/\+/g,"%20")).replace(/%2C/gi,",").replace(/%24/g,"$").replace(/%27/g,"'").replace(/%3A/gi,":").replace(/%2F/gi,"/").replace(/%3D/gi,"=")}catch{return e}}],61230);var t=e.i(14368),n=e.i(99181),s=e.i(68820),r=e.i(14865);e.s(["ContextMenu",0,function({at:e,label:o,onClose:a,children:l}){let i=(0,n.useRef)(null),[c,d]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{let t=i.current;if(!t)return;let n=(0,r.pageViewport)();d({left:Math.max(8,Math.min(e.x,n.width-t.offsetWidth-8)),top:Math.max(8,Math.min(e.y,n.height-t.offsetHeight-8))}),t.querySelector('[role="menuitem"]:not(:disabled)')?.focus()},[e]),(0,n.useEffect)(()=>{let e=e=>{i.current?.contains(e.target)||a()},t=e=>{if("Escape"===e.key)e.stopPropagation(),a();else if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault();let t=[...i.current?.querySelectorAll('[role="menuitem"]:not(:disabled)')??[]],n=t.indexOf(document.activeElement);t[(n+("ArrowDown"===e.key?1:-1)+t.length)%t.length]?.focus()}};return document.addEventListener("pointerdown",e,!0),document.addEventListener("scroll",e,!0),window.addEventListener("resize",a),window.addEventListener("keydown",t,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("scroll",e,!0),window.removeEventListener("resize",a),window.removeEventListener("keydown",t,!0)}},[a]),"u"<typeof document)?null:(0,s.createPortal)((0,t.jsx)("div",{ref:i,role:"menu","aria-label":o,style:{left:c?.left??-9999,top:c?.top??-9999},className:"fixed z-[80] w-56 rounded-lg border border-line bg-panel p-1 shadow-2xl",children:l}),document.body)},"MenuItem",0,function({icon:e,label:n,hint:s,onSelect:r,danger:o=!1,disabled:a=!1}){return(0,t.jsxs)("button",{type:"button",role:"menuitem",disabled:a,onClick:r,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm disabled:opacity-40 ${o?"text-bad hover:bg-bad/10":"text-ink hover:bg-panel-2"}`,children:[(0,t.jsx)("span",{className:`flex w-4 shrink-0 justify-center ${o?"":"text-mute"}`,"aria-hidden":!0,children:e?(0,t.jsx)(e,{size:14}):null}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:n}),s?(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-mute",children:s}):null]})},"MenuLabel",0,function({children:e}){return(0,t.jsx)("div",{className:"px-2.5 pt-1.5 pb-1 text-[11px] font-medium tracking-wide text-mute uppercase",children:e})},"MenuSeparator",0,function(){return(0,t.jsx)("div",{role:"separator",className:"my-1 h-px bg-line"})}],17847)},17219,e=>{"use strict";let t=new Uint32Array(256).map((e,t)=>{let n=t;for(let e=0;e<8;e++)n=1&n?0xedb88320^n>>>1:n>>>1;return n>>>0});function n(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function s(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function r(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let s of e)t.set(s,n),n+=s.length;return t}e.s(["zipStore",0,function(e){let o=new TextEncoder,a=[],l=[],i=0;for(let[c,d]of Object.entries(e)){let e=o.encode(c),u="string"==typeof d?o.encode(d):d,p=function(e){let n=0xffffffff;for(let s of e)n=t[(n^s)&255]^n>>>8;return(0xffffffff^n)>>>0}(u),m=r([s(0x4034b50),n(20),n(0),n(0),n(0),n(0),s(p),s(u.length),s(u.length),n(e.length),n(0),e,u]),h=r([s(0x2014b50),n(20),n(20),n(0),n(0),n(0),n(0),s(p),s(u.length),s(u.length),n(e.length),n(0),n(0),n(0),n(0),s(0),s(i),e]);a.push(m),l.push(h),i+=m.length}let c=r(l),d=r([s(0x6054b50),n(0),n(0),n(Object.keys(e).length),n(Object.keys(e).length),s(c.length),s(i),n(0)]),u=r([...a,c,d]);return new Blob([u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)],{type:"application/zip"})}])},13643,e=>{"use strict";let t=(0,e.i(99522).default)("bell-off",[["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"}]]);e.s(["BellOff",0,t],13643)},95211,e=>{"use strict";let t=(0,e.i(99522).default)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);e.s(["Columns3",0,t],95211)},81538,e=>{"use strict";let t=(0,e.i(99522).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["MoreHorizontal",0,t],81538)},13163,e=>{"use strict";let t=(0,e.i(99522).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],13163)},3792,e=>{"use strict";let t=(0,e.i(99522).default)("play",[["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"}]]);e.s(["Play",0,t],3792)},95927,e=>{"use strict";let t=(0,e.i(99522).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],95927)},66478,14168,e=>{"use strict";let t=(0,e.i(99522).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);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(["Square",0,t],66478);let s=(e,t,n)=>fetch(t,{method:e,headers:void 0===n?void 0:{"content-type":"application/json"},body:void 0===n?void 0:JSON.stringify(n)});e.s(["suiteApi",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),savePlan:(e,t)=>s("PUT","/engine/suites/plan",{collection:e,...t}).then(e=>n(e)),start:e=>s("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=>s("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>n(e))},"suiteHref",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}],14168)},36558,e=>{"use strict";function t(e,n=2){if(!Number.isFinite(e))return 0;let s=10**n;return Math.round(e*s)/s}function n(e){return e>=100?Math.round(e):e>=10?t(e,1):t(e,2)}function s(e){return e>=10?Math.round(e):t(e,1)}function r(e,t=e=>e){return null==e?"":t(e)}e.s(["SERIES_COLUMNS",0,[{key:"elapsed_s",header:"Seconds into test",description:"Seconds from the start of the run."},{key:"ts",header:"Clock time",description:"Wall-clock time for this one-second sample."},{key:"vus",header:"Concurrent users",description:"Virtual users (VUs) active in this second."},{key:"rps",header:"Requests per second",description:"Completed requests in this second."},{key:"p50_ms",header:"Median latency (ms)",description:"Half of requests this second were faster than this."},{key:"p95_ms",header:"95th percentile (ms)",description:"95% of requests this second were faster than this."},{key:"p99_ms",header:"99th percentile (ms)",description:"The slow tail this second — 1 in 100 was slower."},{key:"failed_rate",header:"Error rate",description:"Share of requests that failed in this second (0–1)."},{key:"http_2xx",header:"Success (2xx)",description:"Successful HTTP responses this second."},{key:"http_4xx",header:"Client errors (4xx)",description:"Client / auth errors this second."},{key:"http_5xx",header:"Server errors (5xx)",description:"Server errors this second."},{key:"http_0",header:"Network failures",description:"No HTTP status (timeout / reset) this second."},{key:"bytes_in",header:"Bytes received",description:"Response bytes this second."},{key:"bytes_out",header:"Bytes sent",description:"Request bytes this second."},{key:"p90_ms",header:"90th percentile (ms)",description:"90% of requests this second were faster than this."},{key:"p999_ms",header:"99.9th percentile (ms)",description:"1 in 1,000 requests this second was slower than this."},{key:"max_ms",header:"Slowest (ms)",description:"Slowest request this second."},{key:"ttfb_ms",header:"Server time (ms)",description:"Average time to first byte this second — the server's own work."},{key:"connect_ms",header:"TCP connect (ms)",description:"Average TCP connect time this second (0 when connections are reused)."},{key:"tls_ms",header:"TLS handshake (ms)",description:"Average TLS handshake time this second."},{key:"checks_passed",header:"Checks passed",description:"Response checks that passed this second."},{key:"checks_failed",header:"Checks failed",description:"Response checks that failed this second."},{key:"dropped",header:"Dropped requests",description:"Rate mode: requests k6 could not start this second."}],"seriesExportRow",0,function(e){return[e.elapsedS,e.ts,t(e.vus,1),n(e.rps),s(e.p50Ms),s(e.p95Ms),s(e.p99Ms),t(e.failedRate,4),e.http2xx,e.http4xx,e.http5xx,e.http0,e.bytesIn,e.bytesOut,r(e.p90Ms,s),r(e.p999Ms,s),r(e.maxMs,s),r(e.ttfbMs,s),r(e.connectMs,s),r(e.tlsMs,s),r(e.checksPassed),r(e.checksFailed),r(e.dropped)]},"summaryExportRows",0,function(e){let{summary:r}=e,o=[{key:"run_id",value:e.id,description:"Id of this run in this browser tab."},{key:"test_name",value:e.testName,description:"Display name (method, path, time)."},{key:"status",value:e.status,description:"completed, failed, cancelled, or still running."},{key:"started_at",value:e.startedAt,description:"When the load test started (UTC)."},{key:"ended_at",value:e.endedAt,description:"When the load test finished (UTC)."},{key:"method",value:e.definition.method,description:"HTTP method that was repeated."},{key:"url",value:e.definition.url,description:"Target URL (secrets are not exported)."},{key:"auth_mode",value:e.definition.auth.mode,description:"Auth used: none, bearer, basic, or api_key. The secret is not exported."},{key:"executor",value:e.definition.load.executor,description:"Load pattern: constant-vus (steady) or ramping-vus (ramp / hold / down)."},{key:"requests",value:r.http.requests,description:"How many HTTP calls finished. Zero usually means the target never answered."},{key:"rps_avg",value:n(r.http.rps.avg),description:"Average requests per second completed by this generator."},{key:"rps_max",value:n(r.http.rps.max),description:"Peak requests per second in any one-second sample."},{key:"failed_count",value:r.http.failed.count,description:"Requests that failed (4xx, 5xx, timeout, or no status)."},{key:"failed_rate",value:t(r.http.failed.rate,4),description:"Failed / total. Default warning bar is 1% (0.01)."},{key:"latency_min_ms",value:s(r.latencyMs.min),description:"Fastest request (milliseconds)."},{key:"latency_mean_ms",value:s(r.latencyMs.mean),description:"Average response time. Slow outliers pull this up."},{key:"latency_p50_ms",value:s(r.latencyMs.median),description:"Median — half of requests were faster than this."},{key:"latency_p95_ms",value:s(r.latencyMs.p95),description:"95th percentile — 95% of requests were faster. Usual headline latency."},{key:"latency_p99_ms",value:s(r.latencyMs.p99),description:"99th percentile — the slow tail (1 in 100 was slower)."},{key:"latency_max_ms",value:s(r.latencyMs.max),description:"Slowest single request."},{key:"vus_max",value:r.vus.max,description:"Peak concurrent users (virtual users / VUs)."},{key:"vus_avg",value:t(r.vus.avg,1),description:"Average concurrent users over the run."},{key:"bytes_in",value:r.data.bytesIn,description:"Response bytes received by the generator."},{key:"bytes_out",value:r.data.bytesOut,description:"Request bytes sent by the generator."},{key:"phase_ttfb_avg_ms",value:s(r.phasesMs.ttfb.avg),description:"Time to first byte — waiting on the server after the connection is up."},{key:"phase_tls_avg_ms",value:s(r.phasesMs.tls.avg),description:"TLS handshake time. High values often mean a far or overloaded endpoint."}];for(let[e,t]of Object.entries(r.http.status)){let n="0"===e?"No HTTP status (timeout / network).":Number(e)>=500?"Server error.":Number(e)>=400?"Client / auth error.":"Success-class response.";o.push({key:`status_${e}`,value:t,description:`How many responses had status ${e}. ${n}`})}for(let e of r.thresholds)o.push({key:`threshold:${e.name}`,value:e.ok?"pass":"fail",description:"k6 threshold result for this run."});return o}])}]);
@@ -1,51 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,49186,e=>{"use strict";var t=e.i(14368),s=e.i(32610),r=e.i(62766);e.i(24856);var a=e.i(99522);let n=(0,a.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var l=e.i(95486),i=e.i(27813),o=e.i(13163),d=e.i(3792),c=e.i(71189),p=e.i(50962);let m=(0,a.default)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);var u=e.i(66478),x=e.i(87283),h=e.i(30099),f=e.i(36994),b=e.i(99181),g=e.i(60617),y=e.i(88491),v=e.i(75117),w=e.i(62350),j=e.i(36558),k=e.i(17219);function N(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("\n","&#10;")}let I=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
3
- <fonts count="3">
4
- <font><sz val="11"/><name val="Calibri"/></font>
5
- <font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font>
6
- <font><sz val="10"/><color rgb="FF5C6778"/><name val="Calibri"/></font>
7
- </fonts>
8
- <fills count="6">
9
- <fill><patternFill patternType="none"/></fill>
10
- <fill><patternFill patternType="gray125"/></fill>
11
- <fill><patternFill patternType="solid"><fgColor rgb="FF0B8F7C"/></patternFill></fill>
12
- <fill><patternFill patternType="solid"><fgColor rgb="FFDCFCE7"/></patternFill></fill>
13
- <fill><patternFill patternType="solid"><fgColor rgb="FFFEF3C7"/></patternFill></fill>
14
- <fill><patternFill patternType="solid"><fgColor rgb="FFFECACA"/></patternFill></fill>
15
- </fills>
16
- <borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>
17
- <cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
18
- <cellXfs count="6">
19
- <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
20
- <xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center"/></xf>
21
- <xf numFmtId="0" fontId="2" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment wrapText="1" vertical="center"/></xf>
22
- <xf numFmtId="0" fontId="0" fillId="3" borderId="0" xfId="0" applyFill="1"/>
23
- <xf numFmtId="0" fontId="0" fillId="4" borderId="0" xfId="0" applyFill="1"/>
24
- <xf numFmtId="0" fontId="0" fillId="5" borderId="0" xfId="0" applyFill="1"/>
25
- </cellXfs>
26
- </styleSheet>`;function S(){let e=new Date().toISOString().slice(0,19).replace(/[:T]/g,"-");return`compare-${e}.xlsx`}async function C(e,t,s){let r=e.map(e=>e.report),a=e.map(e=>e.title),n=r.length>=2?(0,g.compareKpis)(r):[],l=(0,g.overlayBuckets)(r),i=(0,y.compareVerdictRows)(e,s),o=[[{v:"Metric",s:1},...a.map(e=>({v:e,s:1})),{v:"Best",s:1}],...n.map(e=>[{v:e.label},...e.values.map((t,s)=>{var r;return{v:"ms"===(r=e.unit)?`${Math.round(t)} ms`:"rps"===r?`${t.toFixed(1)} rps`:"pct"===r?`${(100*t).toFixed(2)}%`:String(Math.round(t)),s:3*(e.winner===s)}}),{v:(0,y.compareWinnerLabel)(e,a)}]),[{v:"Run mode"},{v:t},...a.slice(1).map(()=>({v:""})),{v:""}]],d=[{v:"Seconds into test",s:1}];a.forEach(e=>{d.push({v:`${e} — 95th pct (ms)`,s:1}),d.push({v:`${e} — req/s`,s:1}),d.push({v:`${e} — error rate`,s:1}),d.push({v:`${e} — VUs`,s:1})});let c=[{name:"Side by side",rows:o},{name:"Over time",rows:[d,...l.map(e=>{let t=[{v:e.elapsedS}];return e.p95.forEach((s,r)=>{t.push({v:s??""}),t.push({v:e.rps[r]??""}),t.push({v:e.failedRate[r]??""}),t.push({v:e.vus[r]??""})}),t})]},{name:"Result summary",rows:[[{v:"API",s:1},{v:"Result",s:1},{v:"What this means",s:1}],...i.map(e=>{var t;return[{v:e.title},{v:e.overall,s:"pass"===(t=e.overall)?3:"warn"===t?4:5*("fail"===t)},{v:e.headline,s:2}]})]},...e.map((e,t)=>{var s;return{name:(s=e.title,(s.replace(/[\\/?*[\]:]/g,"").slice(0,24)||`API ${t+1}`).slice(0,31)),rows:[[{v:"Key",s:1},{v:"Value",s:1},{v:"What this means",s:1}],...(0,j.summaryExportRows)(e.report).map(e=>[{v:e.key},{v:e.value},{v:e.description,s:2}])]}})].map((e,t)=>{var s;let r,a,n;return{id:t+1,relId:`rId${t+1}`,name:e.name,xml:(s=e.rows,a=Array.from({length:r=s[0]?.length??0},(e,t)=>{let a=function(e,t,s=10,r=48){let a=s;for(let s of e){let e=s[t]?.v;void 0!==e&&(a=Math.max(a,String(e).length+2))}return Math.min(r,a)}(s,t,0===t?14:12,t===r-1&&r>=3?72:42);return`<col min="${t+1}" max="${t+1}" width="${a}" customWidth="1"/>`}).join(""),n=s.map((e,t)=>`<row r="${t+1}" ht="${0===t?22:18}" customHeight="1">${e.map((e,s)=>{var r;let a,n;return r=t+1,a=`${function(e){let t=e+1,s="";for(;t>0;)s=String.fromCharCode(65+(t-1)%26)+s,t=Math.floor((t-1)/26);return s}(s)}${r}`,n=void 0!==e.s?` s="${e.s}"`:"","number"==typeof e.v&&Number.isFinite(e.v)?`<c r="${a}"${n}><v>${e.v}</v></c>`:`<c r="${a}"${n} t="inlineStr"><is><t xml:space="preserve">${N(e.v)}</t></is></c>`}).join("")}</row>`).join(""),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
27
- <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
28
- <sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>
29
- <cols>${a}</cols>
30
- <sheetData>${n}</sheetData>
31
- </worksheet>`)}}),p=c.map(e=>`<Override PartName="/xl/worksheets/sheet${e.id}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("\n "),m=c.map(e=>`<sheet name="${N(e.name)}" sheetId="${e.id}" r:id="${e.relId}"/>`).join("\n "),u=c.map(e=>`<Relationship Id="${e.relId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${e.id}.xml"/>`).join("\n "),x={"[Content_Types].xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
32
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
33
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
34
- <Default Extension="xml" ContentType="application/xml"/>
35
- <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
36
- <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
37
- ${p}
38
- </Types>`,"_rels/.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
39
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
40
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
41
- </Relationships>`,"xl/workbook.xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
42
- <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
43
- <sheets>
44
- ${m}
45
- </sheets>
46
- </workbook>`,"xl/_rels/workbook.xml.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
47
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
48
- ${u}
49
- <Relationship Id="rId${c.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
50
- </Relationships>`,"xl/styles.xml":I};for(let e of c)x[`xl/worksheets/sheet${e.id}.xml`]=e.xml;return new Blob([(0,k.zipStore)(x)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}async function $(e,t,s){let r=S().replace(/\.xlsx$/,""),a={[`${r}.xlsx`]:new Uint8Array(await (await C(e,t,s)).arrayBuffer()),[`${r}.json`]:(0,y.exportCompareJson)(e,t)};for(let t of e){if(!t.probe)continue;let e=t.title.replace(/[^\w.-]+/g,"-").slice(0,40)||t.id.slice(0,8);a[`${e}-probe.json`]=(0,y.exportProbeJson)(t.probe)}return{base:r,blob:(0,k.zipStore)(a)}}var A=e.i(15060),P=e.i(88153);function F({apis:e,mode:s,probes:r}){var a,n,i;let o,d,c,p,m,{slo:u}=(0,P.useSlo)(),x=S(),h=x.replace(/\.xlsx$/,""),f=Object.entries(r).filter(e=>!!e[1]),[j,N]=(0,b.useState)(!1),[I,E]=(0,b.useState)(null),[T,z]=(0,b.useState)(null);if(0===e.length)return null;let D=(a=e,n=s,i=u,o=a.map(e=>e.title),d=`Compare: ${o.join(" vs ")}`.slice(0,120),c=a.length>=2?(0,g.compareKpis)(a.map(e=>e.report)):[],p=[`APITestCenter compare (${n})`,"",...a.map(e=>`- ${e.title}: ${e.report.testName} [${e.report.status}]`),"",...c.map(e=>{let t=e.values.map((t,s)=>{var r,a;return`${o[s]}=${r=t,"ms"===(a=e.unit)?`${Math.round(r)}ms`:"rps"===a?`${r.toFixed(1)}/s`:"pct"===a?`${(100*r).toFixed(2)}%`:String(Math.round(r))}`}).join(", "),s=null==e.winner?"tie":o[e.winner]??"tie";return`${e.label}: ${t} (best: ${s})`})],i&&p.push("",`Performance targets: p95 ${i.p95Ms} ms, errors ${(100*i.errorRate).toFixed(1)}%`),p.push("","Attach the Excel or Zip export from APITestCenter."),{subject:d,body:m=p.join("\n"),mailto:`mailto:?subject=${encodeURIComponent(d)}&body=${encodeURIComponent(m)}`,gmail:`https://mail.google.com/mail/?view=cm&fs=1&tf=1&su=${encodeURIComponent(d)}&body=${encodeURIComponent(m)}`,outlook:`https://outlook.office.com/mail/deeplink/compose?subject=${encodeURIComponent(d)}&body=${encodeURIComponent(m)}`});async function O(){z(null),N(!1);try{let{base:t,blob:r}=await $(e,s,u),a={files:[new File([r],`${t}-export.zip`,{type:"application/zip"})],title:D.subject,text:D.body};if(navigator.canShare?.({files:a.files}))return void await navigator.share(a);E("mailto")}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;E("mailto"),z(e instanceof Error?e.message:"Share failed")}}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)("span",{className:"mr-1 flex items-center gap-1.5 text-xs text-mute",children:[(0,t.jsx)(v.Download,{size:14}),"Export"]}),(0,t.jsx)("button",{type:"button",disabled:e.length<2,className:"rounded-md border border-line bg-panel-2 px-2.5 py-1 text-xs text-ink hover:border-accent hover:text-accent disabled:opacity-40",onClick:()=>void C(e,s,u).then(e=>(0,A.downloadBlob)(x,e)),children:"Excel"}),(0,t.jsx)("button",{type:"button",className:"rounded-md border border-line bg-panel-2 px-2.5 py-1 text-xs text-ink hover:border-accent hover:text-accent",onClick:()=>(0,A.downloadText)(`${h}.json`,(0,y.exportCompareJson)(e,s),"application/json"),children:"JSON"}),(0,t.jsx)("button",{type:"button",disabled:0===f.length,className:"rounded-md border border-line bg-panel-2 px-2.5 py-1 text-xs text-ink hover:border-accent hover:text-accent disabled:opacity-40",onClick:()=>{let t={};for(let[s,r]of f){let a=e.find(e=>e.id===s),n=(a?.title??s).replace(/[^\w.-]+/g,"-").slice(0,40);t[`${n}-probe.json`]=(0,y.exportProbeJson)(r)}(0,A.downloadBlob)(`${h}-probes.zip`,(0,k.zipStore)(t))},children:"Response JSONs"}),(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-md border border-line bg-panel-2 px-2.5 py-1 text-xs text-ink hover:border-accent hover:text-accent",onClick:()=>void $(e,s,u).then(({base:e,blob:t})=>(0,A.downloadBlob)(`${e}-export.zip`,t)),children:[(0,t.jsx)(v.Download,{size:12}),"Zip"]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>N(e=>!e),className:"inline-flex items-center gap-1 rounded-md border border-line bg-panel-2 px-2.5 py-1 text-xs text-ink hover:border-accent hover:text-accent",children:[(0,t.jsx)(w.Share2,{size:12}),"Share",(0,t.jsx)(l.ChevronDown,{size:12})]}),j?(0,t.jsxs)("div",{className:"absolute right-0 z-20 mt-1 w-56 rounded-md border border-line bg-panel p-1 shadow-lg",children:[(0,t.jsx)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-ink hover:bg-panel-2",onClick:()=>{N(!1),E("gmail")},children:"Gmail"}),(0,t.jsx)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-ink hover:bg-panel-2",onClick:()=>{N(!1),E("outlook")},children:"Outlook on the web"}),(0,t.jsx)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-ink hover:bg-panel-2",onClick:()=>{N(!1),E("mailto")},children:"Default mail app"}),(0,t.jsx)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-ink hover:bg-panel-2",onClick:()=>void O(),children:"System share"})]}):null]})]}),T?(0,t.jsx)("p",{className:"max-w-md text-xs text-mute",children:T}):null,I?(0,t.jsx)(R,{apis:e,mode:s,target:I,links:D,onClose:()=>E(null)}):null]})}function R({apis:e,mode:s,target:r,links:a,onClose:n}){let{slo:l}=(0,P.useSlo)(),i={gmail:"Gmail",outlook:"Outlook on the web",mailto:"default mail app"},o="gmail"===r?a.gmail:"outlook"===r?a.outlook:a.mailto;return(0,t.jsx)("div",{className:"fixed inset-0 z-50 grid place-items-center bg-canvas/70 p-4",role:"presentation",onClick:n,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:"w-full max-w-md rounded-lg border border-line bg-panel p-4 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("h2",{className:"text-sm font-medium text-ink",children:["Share via ",i[r]]}),(0,t.jsx)("p",{className:"mt-2 text-xs leading-5 text-mute",children:"Download the compare package, then attach it in the compose window. Browsers cannot attach files for you."}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 text-xs text-ink",onClick:()=>void C(e,s,l).then(e=>(0,A.downloadBlob)(S(),e)),children:"Download Excel"}),(0,t.jsx)("button",{type:"button",className:"rounded-md border border-line bg-panel-2 px-2.5 py-1.5 text-xs text-ink",onClick:()=>void $(e,s,l).then(({base:e,blob:t})=>(0,A.downloadBlob)(`${e}-export.zip`,t)),children:"Download Zip"}),(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noreferrer",className:"rounded-md bg-accent px-2.5 py-1.5 text-xs font-medium text-canvas",onClick:n,children:["Open ",i[r]]}),(0,t.jsx)("button",{type:"button",className:"rounded-md px-2.5 py-1.5 text-xs text-mute",onClick:n,children:"Close"})]})]})})}var E=e.i(55658),T=e.i(53012),z=e.i(45404),D=e.i(29724),O=e.i(88231);function q({items:e,liveTabs:s,running:r,source:a,mode:n,slo:l,title:o,actions:d,status:c,exportBar:p}){let[m,u]=(0,b.useState)("all"),x=(0,b.useRef)(null),h=e.map((e,t)=>(0,g.compareSeriesLabel)(t,e.title)),f=r||!e.some(e=>e.tabId===m)?"all":m,y=e.filter(e=>!s.has(e.tabId)),v=!r&&y.length>=2?(0,E.compareFairness)(y.map(e=>e.report),y.map(t=>h[e.indexOf(t)])):null;return(0,t.jsxs)("div",{ref:x,className:"min-h-0 flex-1 overflow-y-auto",children:[(0,t.jsxs)("header",{className:"sticky top-0 z-10 border-b border-line bg-canvas/95 px-4 pt-3 backdrop-blur lg:px-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)("h2",{className:"text-base font-medium text-ink",children:o}),(0,t.jsx)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:d})]}),(0,t.jsx)("div",{role:"tablist","aria-label":"Comparison or one run",className:"-mb-px mt-3 flex gap-1 overflow-x-auto",children:[{id:"all",label:"Comparison",color:null},...e.map((e,t)=>({id:e.tabId,label:h[t],color:(0,O.seriesColor)(t)}))].map(e=>{let a=f===e.id,n=s.has(e.id);return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":a,disabled:r&&"all"!==e.id,title:r&&"all"!==e.id?"Each run's own report opens when the compare has finished":e.label,onClick:()=>{u(e.id),x.current?.scrollTo({top:0})},className:`flex max-w-[18rem] shrink-0 items-center gap-2 rounded-t-md border border-b-0 px-3 py-2 text-sm disabled:opacity-50 ${a?"border-line bg-panel font-medium text-ink":"border-transparent text-mute hover:bg-panel-2 hover:text-ink"}`,children:[e.color?(0,t.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:e.color},"aria-hidden":!0}):null,(0,t.jsx)("span",{className:"truncate",children:e.label}),n?(0,t.jsx)(i.Loader2,{size:12,className:"shrink-0 animate-spin text-accent","aria-label":"running"}):null]},e.id)})})]}),(0,t.jsx)("div",{className:"space-y-4 px-4 py-4 lg:px-6",children:"all"===f?(0,t.jsxs)(t.Fragment,{children:[c,p,v?.unfair?(0,t.jsxs)("p",{role:"note",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)(T.AlertTriangle,{size:16,className:"mt-0.5 shrink-0 text-warn","aria-hidden":!0}),(0,t.jsxs)("span",{children:[v.unfair," Compare runs with the same load and length to say which API is faster."]})]}):null,(0,t.jsxs)("p",{className:"text-xs text-mute",children:["saved"===a?`Saved runs: ${e.map((e,t)=>{let s;return`${h[t]} ${Number.isNaN((s=new Date(e.report.startedAt)).getTime())?"":s.toLocaleString(void 0,{day:"numeric",month:"short",hour:"numeric",minute:"2-digit"})}`}).join(" · ")}.`:"parallel"===n?"Ran at the same time — the runs shared this computer's CPU and network, so treat the numbers as directional.":"Ran one after another with the same load.",v&&!v.unfair&&v.caveats.length?` Note: ${v.caveats.join("; ")}.`:""]}),e.length>=2?(0,t.jsx)(z.Dashboard,{scope:"compare",data:{reports:e.map(e=>e.report),titles:e.map((e,t)=>h[t]+(s.has(e.tabId)?" · live":"")),slo:l,live:r}}):(0,t.jsx)("p",{className:"rounded-lg border border-dashed border-line px-6 py-14 text-center text-sm text-mute",children:r?"The overlay appears when the first API is under way…":"The overlay needs at least two finished runs."})]}):(0,t.jsx)(D.ReportView,{report:e.find(e=>e.tabId===f).report,source:"engine"})})]})}var L=e.i(2385),M=e.i(19656);function U(e){let t=Math.max(0,Math.ceil(e/1e3)),s=Math.floor(t/60),r=t%60;return s>0?`${s}:${String(r).padStart(2,"0")}`:`${r}s`}function B(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let s=Math.floor(t/60),r=t%60;return r?`${s}m ${r}s`:`${s}m`}function J({mode:e,phase:s,liveRuns:r,startedAt:a,endedAt:n}){let[l,i]=(0,b.useState)(()=>Date.now()),o="running"===s||"probing"===s||"between"===s;return((0,b.useEffect)(()=>{if(!o)return;let e=setInterval(()=>i(Date.now()),250);return()=>clearInterval(e)},[o]),"idle"===s)?null:"probing"===s?(0,t.jsxs)("div",{className:"rounded-md border border-accent/30 bg-accent-dim px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs tracking-wide text-accent uppercase",children:"Checking APIs"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-mute",children:"Probing each API before load. This can take a few seconds."})]}):"between"===s?(0,t.jsxs)("div",{className:"rounded-md border border-accent/30 bg-accent-dim px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs tracking-wide text-accent uppercase",children:"Preparing next API"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-mute",children:"Processing the last run and starting the next one. Sequence compares take a moment between APIs."}),a?(0,t.jsxs)("p",{className:"mt-1 font-mono text-sm text-ink",children:["Elapsed ",B(l-Date.parse(a))]}):null]}):"done"===s&&a&&n?(0,t.jsxs)("div",{className:"rounded-md border border-line bg-panel-2 px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs tracking-wide text-mute uppercase",children:"Overall time taken"}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-lg text-ink",children:(0,M.formatDuration)(a,n)}),(0,t.jsxs)("p",{className:"mt-0.5 text-xs text-mute",children:["Wall clock for the whole compare (",e,"), including probes and gaps between runs."]})]}):"running"!==s||0===r.length?null:(0,t.jsxs)("div",{className:"space-y-2",children:[r.map(e=>{let s=(0,L.expectedLoadMs)(e.report),r=Math.max(0,l-Date.parse(e.report.startedAt)),a=Math.max(0,s-r),n="running"===e.status&&0===a;return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-accent/30 bg-accent-dim px-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs tracking-wide text-accent uppercase",children:["queued"===e.status?"Starting":n?"Finishing":"Load running"," · ",e.title]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-mute",children:n?"Clock hit zero. k6 is letting in-flight requests finish.":`${U(r)} elapsed`})]}),(0,t.jsx)("div",{className:"font-mono text-2xl tabular text-ink",children:"queued"===e.status?"…":n?"—":U(a)})]},e.report.id)}),a?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Compare elapsed ",B(l-Date.parse(a))]}):null]})}var V=e.i(22543),H=e.i(63343),K=e.i(44794),_=e.i(31753),W=e.i(60566),X=e.i(39170),G=e.i(28867),Z=e.i(56396);e.i(42674);var Q=e.i(5305);let Y="apitestcenter-compare-draft";function ee(){return globalThis.crypto?.randomUUID?.()??`tab-${Date.now()}-${Math.random().toString(16).slice(2)}`}function et(e){return{...(0,Q.defaultRequestDraft)(),id:ee(),title:e}}function es(){let e=et("API 1");return{tabs:[e,et("API 2")],activeId:e.id,load:{...Q.DEFAULT_LOAD}}}function er(e,t){let s=e&&"object"==typeof e?e:{},r="string"==typeof s.title&&s.title.trim()||"string"==typeof s.label&&s.label.trim()||t;return{...(0,Q.requestFromUnknown)(e),id:"string"==typeof s.id&&s.id?s.id:ee(),title:r,collection:"string"==typeof s.collection&&s.collection?s.collection:void 0}}var ea=e.i(21206),en=e.i(20054),el=e.i(68228),ei=e.i(65638),eo=e.i(6278),ed=e.i(46679),ec=e.i(65238),ep=e.i(727),em=e.i(59180),eu=e.i(2603);let ex=new Set(["title"]);function eh({tabs:e,activeId:s,probes:r,liveByTab:a,reports:n,running:l,onSelect:o,onRename:d,onClose:p,onAdd:m}){let[u,h]=(0,b.useState)(null);return(0,t.jsxs)("div",{className:"flex items-end gap-1 overflow-x-auto border-b border-line bg-canvas px-2 pt-2",role:"tablist","aria-label":"APIs to compare",children:[e.map((c,m)=>{let f=c.id===s,b=r[c.id],g=!!a[c.id],y=n.some(e=>e.tabId===c.id);return(0,t.jsxs)("div",{className:`group flex max-w-[15rem] shrink-0 items-center gap-1.5 rounded-t-md border border-b-0 pr-1 pl-2.5 text-sm ${f?"-mb-px border-line bg-panel text-ink":"border-transparent text-mute hover:bg-panel-2 hover:text-ink"}`,children:[(0,t.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:(0,O.seriesColor)(m)},"aria-hidden":!0}),u===c.id?(0,t.jsx)("input",{autoFocus:!0,defaultValue:c.title,"aria-label":"API name",onBlur:e=>{d(c.id,e.target.value.trim()||`API ${m+1}`),h(null)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur(),"Escape"===e.key&&h(null)},className:"w-32 bg-transparent py-2 outline-none"}):(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f,title:"Double-click to rename",onClick:()=>o(c.id),onDoubleClick:()=>h(c.id),className:"flex min-w-0 items-center gap-1.5 py-2",children:[(0,t.jsx)("span",{className:"truncate",children:c.title||"Untitled"}),g?(0,t.jsx)(i.Loader2,{size:12,className:"shrink-0 animate-spin text-accent","aria-label":"running"}):b?(0,t.jsx)("span",{className:`shrink-0 font-mono text-xs ${(0,ea.isSuccess)(b)?"text-ok":"text-bad"}`,children:b.status||"ERR"}):y?(0,t.jsx)("span",{className:"shrink-0 text-xs text-ok",children:"done"}):null]}),e.length>2?(0,t.jsx)("button",{type:"button","aria-label":`Close ${c.title}`,disabled:l,onClick:()=>p(c.id),className:"rounded p-0.5 text-mute opacity-0 group-hover:opacity-100 hover:bg-panel-2 hover:text-bad focus:opacity-100 disabled:opacity-0",children:(0,t.jsx)(x.X,{size:12})}):null]},c.id)}),(0,t.jsxs)("button",{type:"button",onClick:m,disabled:e.length>=6||l,title:e.length>=6?"Up to 6 APIs":"Add an API",className:"mb-1 ml-1 inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1.5 text-xs text-mute hover:bg-panel-2 hover:text-ink disabled:opacity-40",children:[(0,t.jsx)(c.Plus,{size:14}),"Add API"]})]})}function ef({contract:e,blocked:s,skipped:r,busy:a,onProceed:n}){if(!e)return null;if("pass"===e.level)return(0,t.jsx)("p",{className:"rounded-md border border-ok/40 bg-ok/10 px-3 py-2 text-sm text-ok",children:"✓ Every API returned the same response structure."});let l=e.issues.filter(e=>!/Need at least two/.test(e.message));return(0,t.jsxs)("div",{role:s?"alert":void 0,className:"rounded-md border border-warn/40 bg-warn/10 px-3 py-2.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-warn",children:s?"Compare not started — responses differ.":r?"Structures differ (allowed for this compare).":"Responses differ."}),l.length?(0,t.jsx)("ul",{className:"mt-1 list-disc space-y-0.5 pl-5 text-sm text-ink",children:l.map((e,s)=>(0,t.jsx)("li",{children:e.message},s))}):null,s?(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-xs",disabled:a,onClick:n,children:"Compare anyway"})}):null]})}function eb({entries:e,disabled:s,onPick:r}){let[a,n]=(0,b.useState)(!1),i=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(!a)return;let e=e=>!i.current?.contains(e.target)&&n(!1),t=e=>"Escape"===e.key&&n(!1);return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[a]),(0,t.jsxs)("div",{ref:i,className:"relative",children:[(0,t.jsxs)("button",{type:"button",disabled:s,"aria-haspopup":"listbox","aria-expanded":a,onClick:()=>n(e=>!e),className:"inline-flex items-center gap-1 rounded-md border border-line px-2 py-1 text-xs text-mute hover:text-ink disabled:opacity-40",children:["Past compares",(0,t.jsx)(l.ChevronDown,{size:12})]}),a?(0,t.jsx)("ul",{role:"listbox","aria-label":"Past compares",className:"absolute right-0 z-30 mt-1 max-h-80 w-80 overflow-auto rounded-md border border-line bg-panel p-1 shadow-xl",children:e.map(e=>(0,t.jsx)("li",{role:"option","aria-selected":!1,children:(0,t.jsxs)("button",{type:"button",onClick:()=>{r(e),n(!1)},className:"flex w-full items-center justify-between gap-2 rounded px-2 py-1.5 text-left text-xs text-ink hover:bg-panel-2",children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.name}),(0,t.jsxs)("span",{className:"shrink-0 text-mute",children:[e.titles.length," APIs"]})]})},e.id))}):null]})}function eg({children:e}){return(0,t.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center rounded-lg border border-dashed border-line px-6 py-14 text-center text-sm text-mute",children:(0,t.jsx)("div",{className:"max-w-md",children:e})})}function ey(e,t){return function(e){let t=[];if(e.length<2)return{level:"fail",issues:[{level:"fail",message:"Need at least two APIs to compare"}]};for(let r of e){var s;r.probe.ok&&(s=r.probe.status)>=200&&s<300||t.push({level:"fail",message:`${r.label}: probe was ${r.probe.status||"ERR"}, not 2xx`}),r.probe.truncated&&t.push({level:"fail",message:`${r.label}: body was truncated, so the structure cannot be proven`})}let r=e.map(e=>({...e,structure:function(e){var t;let s,r=function(e,t){if(!e.trim())return"empty";if(t.toLowerCase().includes("json"))return"json";try{return JSON.parse(e),"json"}catch{return"text"}}(e.body,(s=Object.keys(t=e.headers).find(e=>"content-type"===e.toLowerCase()))?t[s]:"");if("empty"===r)return"empty";if("text"===r)return`text:${e.body}`;try{return`json:${JSON.stringify(function e(t){if(null===t)return"null";if(Array.isArray(t))return{type:"array",item:t.length>0?e(t[0]):"unknown"};if("object"==typeof t){let s={};for(let r of Object.keys(t).sort())s[r]=e(t[r]);return{type:"object",fields:s}}return typeof t}(JSON.parse(e.body)))}`}catch{return null}}(e.probe)}));if(r.some(e=>null==e.structure))t.push({level:"fail",message:"Could not parse one or more JSON bodies"});else{let e=r[0];if(e)for(let s of r.slice(1))s.structure!==e.structure&&t.push({level:"fail",message:`${s.label} response structure does not match ${e.label}`})}return{level:t.some(e=>"fail"===e.level)?"fail":t.some(e=>"warn"===e.level)?"warn":"pass",issues:t}}(e.map(e=>t[e.id]?{label:e.title||e.id,probe:t[e.id]}:null).filter(e=>!!e))}e.s(["ComparePage",0,function(){let e=(0,r.useColumnSplit)("compare",{min:320}),a=(0,f.useSearchParams)(),l=(0,f.useRouter)(),c=(0,Z.useToast)(),g=(0,X.useConfirm)(),y=(0,en.useEngineHealth)(),v=(0,eu.useModKey)(),{slo:w}=(0,P.useSlo)(),{vars:j,activeEnv:k}=(0,eo.useWorkspace)(),N=(0,b.useRef)(null),[I,S]=(0,b.useState)(es),[C,$]=(0,b.useState)(!1),[A,R]=(0,b.useState)(!1),[E,T]=(0,b.useState)(null),[z,D]=(0,b.useState)({}),[O,L]=(0,b.useState)(null),[M,U]=(0,b.useState)(!1),[B,ee]=(0,b.useState)("sequence"),[ev,ew]=(0,b.useState)(!1),[ej,ek]=(0,b.useState)(!1),[eN,eI]=(0,b.useState)(!1),[eS,eC]=(0,b.useState)(!1),[e$,eA]=(0,b.useState)({}),[eP,eF]=(0,b.useState)([]),[eR,eE]=(0,b.useState)(!1),[eT,ez]=(0,b.useState)(!1),{index:eD,refresh:eO}=(0,em.useHistory)(),eq=eD?.compares??[],[eL,eM]=(0,b.useState)("idle"),[eU,eB]=(0,b.useState)(null),[eJ,eV]=(0,b.useState)(null),[eH,eK]=(0,b.useState)("response"),e_=(0,b.useRef)(!1),eW=(0,b.useRef)(new Set);(0,b.useEffect)(()=>{let e=function(){try{let e=sessionStorage.getItem(Y);if(!e)return null;let t=JSON.parse(e),s=[];if(Array.isArray(t.tabs)&&t.tabs.length>0)s=t.tabs.map((e,t)=>er(e,`API ${t+1}`)).slice(0,6);else{if(!t.a||!t.b)return null;s=[er(t.a,"API 1"),er(t.b,"API 2")]}let r="string"==typeof t.activeId&&s.some(e=>e.id===t.activeId)?t.activeId:s[0].id,a=(0,Q.loadFromUnknown)(t.load??t);return{tabs:s,activeId:r,load:a}}catch{return null}}();e&&S(e);let t=a.get("compare"),s=(a.get("ids")??[a.get("a"),a.get("b")].filter(Boolean).join(",")).split(",").map(e=>e.trim()).filter(Boolean);t?em.historyApi.compare(t).then(ta).catch(()=>c("That compare is no longer in History","error")):s.length>=2&&Promise.all(s.map(e=>em.historyApi.run(e).catch(()=>null))).then(e=>{let t=e.filter(e=>!!e);if(t.length<2)return c("Need at least two of those runs to overlay","error");eF(t.map((e,t)=>({tabId:e.report.id,title:e.meta?.name||e.report.testName||`API ${t+1}`,report:e.report}))),eE(!0),ez(!0),eM("done"),eK("results")}),$(!0)},[a]),(0,b.useEffect)(()=>{if(!C)return;let e=window.setTimeout(()=>(function(e){try{sessionStorage.setItem(Y,JSON.stringify(e))}catch{}})(I),250);return()=>window.clearTimeout(e)},[I,C]);let eX=I.tabs.find(e=>e.id===I.activeId)??I.tabs[0],eG=I.tabs.filter(Q.isReady),eZ=eG.length>=2,eQ=(0,Q.loadProblem)(I.load),eY=(0,b.useMemo)(()=>{let e=new Map(eP.map(e=>[e.tabId,e]));for(let[t,s]of Object.entries(e$)){if(e.has(t))continue;let r=I.tabs.find(e=>e.id===t);e.set(t,{tabId:t,title:r?.title??t,report:s.report})}let t=I.tabs.filter(t=>e.has(t.id)).map(t=>e.get(t.id));return t.length===e.size?t:[...e.values()]},[eP,e$,I.tabs]),e0=eP.map(e=>({id:e.tabId,title:e.title,report:e.report,probe:z[e.tabId]??null})),e1=Object.entries(e$).map(([e,t])=>({title:I.tabs.find(t=>t.id===e)?.title||e,status:t.status,report:t.report}));function e2(e,t){let s=I.tabs.find(t=>t.id===e);s&&Object.keys(t).some(e=>!ex.has(e)&&t[e]!==s[e])&&z[e]&&(D(({[e]:t,...s})=>s),L(null),U(!1)),S(s=>({...s,tabs:s.tabs.map(s=>s.id===e?t:s)}))}async function e6(e){try{let t=await (0,ec.withFolders)(e,e.collection,j),s=(0,Q.resolveDraft)(t.draft,t.vars,k?.name),r=(0,Q.buildPayload)(s,(0,Q.toLoadConfig)(I.load),(0,Q.autoRunName)(s,e.title),(0,Q.targetsFromSlo)(w));return await (0,ed.withRunFirst)(r,s,j,k?.name)}catch(t){throw Error(`${e.title||"API"}: ${t instanceof Error?t.message:"invalid request"}`)}}async function e5(){let e;if(!A&&!eN&&(0,Q.isReady)(eX)){try{e=await e6(eX)}catch(e){T(e instanceof Error?e.message:"Invalid request");return}R(!0),T(null),eK("response");try{let t=await (0,ea.sendRequest)(e),s={...z,[eX.id]:t};D(s),L(ey(eG,s))}finally{R(!1)}}}async function e4(e,t){let s=Object.fromEntries(await Promise.all(e.map(async e=>[e.id,await (0,ea.sendRequest)(t.get(e.id))])));return D(e=>({...e,...s})),s}async function e3(){let e;if(!A&&!eN&&eZ){try{e=new Map(await Promise.all(eG.map(async e=>[e.id,await e6(e)])))}catch(e){T(e instanceof Error?e.message:"Invalid request");return}R(!0),T(null),U(!1);try{let t=await e4(eG,e),s=ey(eG,t);L(s),eK("response"),c("pass"===s.level?"Every API answered with the same structure":"Checked — see the structure result","pass"===s.level?"success":"info")}finally{R(!1)}}}async function e8(e,t){let s=0;for(;;){let r=await (0,ea.fetchRun)(t);if(r){if(s=0,eA(t=>({...t,[e.id]:r})),(0,ea.isTerminalStatus)(r.status))return eW.current.delete(t),e_.current||eF(t=>[...t.filter(t=>t.tabId!==e.id),{tabId:e.id,title:e.title,report:r.report}]),eA(({[e.id]:t,...s})=>s),e_.current?null:r.report}else if(++s>=20)throw Error(`Lost contact with the engine while ${e.title} was running`);await new Promise(e=>window.setTimeout(e,500))}}async function e7(e,t){let s=await (0,ea.startLoadRun)(t);return eW.current.add(s.id),eA(t=>({...t,[e.id]:s})),s}async function e9(e,t){let s=[];for(let r=0;r<e.length&&!e_.current;r++){let a=e[r];eM(r>0?"between":"running"),S(e=>({...e,activeId:a.id}));let n=await e7(a,t.get(a.id));eM("running");let l=await e8(a,n.id);if(!l)break;s.push({tabId:a.id,title:a.title,report:l})}return s}async function te(e,t){eM("running");let s=await Promise.allSettled(e.map(e=>e7(e,t.get(e.id)))),r=s.find(e=>"rejected"===e.status);if(r)throw await ts(),r.reason instanceof Error?r.reason:Error("Failed to start load");return(await Promise.all(e.map(async(e,t)=>{let r=s[t].value,a=await e8(e,r.id);return a?{tabId:e.id,title:e.title,report:a}:null}))).filter(e=>!!e)}async function tt(e){let s;if(A||eN||!eZ||!y.k6Ready)return;if(eQ)return void T(eQ);try{s=new Map(await Promise.all(eG.map(async e=>[e.id,await e6(e)])))}catch(e){T(e instanceof Error?e.message:"Invalid request");return}let r=eG.filter(e=>(0,ea.needsLoadConfirm)(I.load.preset,s.get(e.id).load,s.get(e.id).request.url));if(r.length>0&&!await g({title:`Start a ${(0,H.profileSummary)(I.load)} performance test against ${1===r.length?(0,ea.hostOf)(s.get(r[0].id).request.url):`${r.length} hosts`}?`,body:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{className:"mb-2 list-disc pl-5 font-mono text-xs text-ink",children:r.map(e=>(0,t.jsx)("li",{children:(0,ea.hostOf)(s.get(e.id).request.url)},e.id))}),"parallel"===B?"All APIs run at the same time":"APIs run one after another"," with"," ",(0,H.profileSummary)(I.load)," each. Only load-test systems you own or are allowed to test.",(0,t.jsxs)("span",{className:"mt-2 block",children:["Each simulated user sends its next request as soon as the last one returns, so a few dozen users can mean thousands of requests per second. Public sites and APIs behind a CDN or firewall usually answer that with ",(0,t.jsx)("span",{className:"text-ink",children:"429"})," or"," ",(0,t.jsx)("span",{className:"text-ink",children:"403"})," and may block this computer for a while — test a staging server, or use Requests per second mode with a modest rate."]})]}),confirmLabel:"Start compare",tone:"danger"}))return;let a=e||ev;e_.current=!1,eW.current.clear(),T(null),R(!0),eI(!0),eE(!1),ez(!1),eF([]),eA({}),ek(!1),eB(new Date().toISOString()),eV(null),eM("probing"),eK("results");try{let e=await e4(eG,s),t=eG.filter(t=>!(0,ea.isSuccess)(e[t.id]));if(t.length){T(`Every API needs a 2xx check before load. Not 2xx: ${t.map(t=>`${t.title} (${e[t.id]?.status||"error"})`).join(", ")}`),S(e=>({...e,activeId:t[0].id})),eK("response"),eM("idle");return}let r=ey(eG,e);if(L(r),"fail"===r.level&&!a){U(!0),eK("response"),eM("idle");return}U(!1),"fail"===r.level&&ek(!0);let n="parallel"===B?await te(eG,s):await e9(eG,s);if(eV(new Date().toISOString()),n.length>=2&&!e_.current){try{await em.historyApi.saveCompare({mode:B,ignoreStructure:a,apis:n.map(t=>({id:t.tabId,title:t.title,report:t.report,probe:e[t.tabId]??null}))}),c("Compare finished and saved to History","success"),(0,ep.notifyFinished)({title:"Compare finished",body:`${n.map(e=>e.title).join(" vs ")}
51
- Saved to History.`,ok:!0})}catch(e){c(`Compare finished, but saving it failed: ${e instanceof Error?e.message:"unknown error"}`,"error")}eO()}else e_.current&&c("Compare stopped","info");eM(e_.current?"idle":"done")}catch(e){T(e instanceof Error?e.message:"Compare failed"),eM("idle")}finally{eW.current.size>0&&await ts(),R(!1),eI(!1),eC(!1),eA({})}}async function ts(){await Promise.all([...eW.current].map(e=>(0,ea.stopLoadRun)(e)))}async function tr(){e_.current=!0,eC(!0),await ts()}function ta(e){eF(e.apis.map(e=>({tabId:e.id,title:e.title,report:e.report})));let t={};for(let s of e.apis)s.probe&&(t[s.id]=s.probe);D(t),ee(e.mode),ew(!!e.meta?.ignoreStructure),ek(!!e.meta?.ignoreStructure),eE(!0),ez(!1),U(!1),L(null),eM("done");let s=e.apis.map(e=>Date.parse(e.report.startedAt)).filter(Number.isFinite),r=e.apis.map(e=>Date.parse(e.report.endedAt)).filter(Number.isFinite);eB(s.length?new Date(Math.min(...s)).toISOString():e.exportedAt),eV(r.length?new Date(Math.max(...r)).toISOString():e.exportedAt),eK("results")}async function tn(e){try{ta(await em.historyApi.compare(e.id))}catch(e){c(e instanceof Error?e.message:"Could not open that compare","error")}}(0,eu.useShortcuts)({send:()=>void e5(),run:()=>void tt(!1),focusUrl:()=>N.current?.focus()});let tl=z[eX.id],ti=y.k6Ready?eZ?eQ??void 0:"Give at least two APIs a URL":y.k6Label,to=eq.length>0?(0,t.jsx)(eb,{entries:eq,disabled:eN,onPick:e=>void tn(e)}):null;if("results"===eH){let e=eY.length||eG.length;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("h1",{className:"sr-only",children:"Compare APIs"}),(0,t.jsx)(q,{items:eY,liveTabs:new Set(Object.keys(e$)),running:eN,source:eT?"saved":"compare",mode:B,slo:w,title:eT?`Comparing ${e} saved runs`:eR?`Saved compare \xb7 ${e} APIs`:eN?`Comparing ${e} APIs…`:`Compare results \xb7 ${e} APIs`,actions:eN?(0,t.jsxs)("button",{type:"button",className:"btn btn-danger",disabled:eS,onClick:()=>void tr(),children:[eS?(0,t.jsx)(i.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(u.Square,{size:16}),eS?"Stopping…":"Stop"]}):(0,t.jsxs)(t.Fragment,{children:[to,eR?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",onClick:()=>{eF([]),D({}),eE(!1),ez(!1),eM("idle"),eK("response"),l.replace("/compare")},title:"Close these results and set up a new compare",children:[(0,t.jsx)(x.X,{size:16}),"Close"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",onClick:()=>eK("response"),title:"Back to the APIs and the shared load",children:[(0,t.jsx)(o.Pencil,{size:16}),"Edit setup"]})]}),status:eT?null:(0,t.jsx)(J,{mode:B,phase:eL,liveRuns:e1,startedAt:eU,endedAt:eJ}),exportBar:e0.length>0&&!eN?(0,t.jsx)(F,{apis:e0,mode:B,probes:z}):null})]})}return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("h1",{className:"sr-only",children:"Compare APIs"}),(0,t.jsx)(eh,{tabs:I.tabs,activeId:eX.id,probes:z,liveByTab:e$,reports:eP,running:eN,onSelect:e=>S(t=>({...t,activeId:e})),onRename:(e,t)=>e2(e,{...I.tabs.find(t=>t.id===e),title:t}),onClose:function(e){I.tabs.length<=2||eN||(S(t=>{let s=t.tabs.findIndex(t=>t.id===e),r=t.tabs.filter(t=>t.id!==e),a=t.activeId===e?r[Math.max(0,s-1)]?.id??r[0].id:t.activeId;return{...t,tabs:r,activeId:a}}),D(({[e]:t,...s})=>s),eF(t=>t.filter(t=>t.tabId!==e)))},onAdd:function(){if(I.tabs.length>=6)return;let e=et(`API ${I.tabs.length+1}`);S(t=>({...t,tabs:[...t.tabs,e],activeId:e.id})),window.setTimeout(()=>N.current?.focus(),0)}}),(0,t.jsxs)("header",{className:"border-b border-line bg-panel px-4 py-3 lg:px-6",children:[(0,t.jsx)(K.RequestBar,{ref:N,draft:eX,onChange:e=>e2(eX.id,{...eX,...e}),onImported:e=>c(e,"success"),actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:A||eN||!(0,Q.isReady)(eX),title:`Send this API once (${v}+Enter)`,onClick:()=>void e5(),children:[A&&!eN?(0,t.jsx)(i.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(p.Send,{size:16}),"Send"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",disabled:A||eN||!eZ,title:"Send every API once and compare response structure",onClick:()=>void e3(),children:[(0,t.jsx)(m,{size:16}),"Send all"]}),eN?(0,t.jsxs)("button",{type:"button",className:"btn btn-danger",disabled:eS,onClick:()=>void tr(),children:[eS?(0,t.jsx)(i.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(u.Square,{size:16}),eS?"Stopping…":"Stop"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",disabled:A||!!ti,title:ti??`Check every API, then run the shared load on each (${v}+Shift+Enter)`,onClick:()=>void tt(!1),children:[(0,t.jsx)(d.Play,{size:16}),"Compare load"]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)(el.EnvironmentBar,{drafts:I.tabs,collections:I.tabs.map(e=>e.collection)}),(0,t.jsx)(ei.RequestPicker,{onOpen:e=>{e2(eX.id,{...eX,...(0,Q.requestFromUnknown)(e.request),id:eX.id,title:e.name,collection:e.collection||void 0}),c(`Loaded “${e.name}” into this tab`,"success")}}),E?(0,t.jsx)("p",{role:"alert",className:"text-xs text-bad",children:E}):null]})]}),(0,t.jsxs)("div",{ref:e.gridRef,style:e.gridStyle,className:"relative grid min-h-0 flex-1 overflow-y-auto lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] lg:overflow-hidden 2xl:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[(0,t.jsx)(s.Splitter,{label:"Compare panes width",...e.splitter}),(0,t.jsxs)("section",{"aria-label":"Request",className:"min-w-0 space-y-6 px-4 py-4 lg:overflow-y-auto lg:px-6",children:[(0,t.jsx)(_.RequestEditor,{id:"compare-request",draft:eX,collection:eX.collection,onChange:e=>e2(eX.id,{...eX,...e}),checkResults:z[eX.id]?.checks,lastBody:z[eX.id]?.body,setupResult:z[eX.id]?.setup}),(0,t.jsxs)("section",{className:"space-y-4 rounded-lg border border-line bg-panel p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h2",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:["Compare setup",(0,t.jsx)(V.Hint,{text:"These settings apply to every API, so their timelines line up in the overlay."})]}),(0,t.jsxs)("p",{className:"mt-0.5 text-xs text-mute",children:["Applies to all ",I.tabs.length," APIs."]})]}),(0,t.jsx)(H.LoadEditor,{load:I.load,onChange:e=>S(t=>({...t,load:e}))}),(0,t.jsxs)("div",{className:"space-y-2 border-t border-line pt-4",children:[(0,t.jsx)("span",{className:"block text-xs text-mute",children:"Run mode"}),(0,t.jsx)(G.Segmented,{label:"Run mode",value:B,onChange:ee,options:[{value:"sequence",label:"One after another"},{value:"parallel",label:"All at once"}]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"sequence"===B?"Fairest comparison: each API gets this computer's full CPU and network.":"Faster, but the runs share CPU and network, so treat the numbers as directional."}),(0,t.jsxs)("label",{className:"flex items-start gap-2 pt-1 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:ev,onChange:e=>ew(e.target.checked),className:"mt-1 accent-[var(--accent)]"}),(0,t.jsxs)("span",{children:["Allow different response structures",(0,t.jsx)("span",{className:"block text-xs text-mute",children:"By default every API must return the same JSON shape, so you compare like with like. Each still needs a 2xx."})]})]})]})]})]}),(0,t.jsxs)("section",{"aria-label":"Response",className:"@container flex min-h-[32rem] min-w-0 flex-col border-line bg-panel/40 px-4 py-4 lg:min-h-0 lg:overflow-y-auto lg:border-l lg:px-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-line pb-2",children:[(0,t.jsxs)("h2",{className:"text-sm font-medium text-ink",children:["Response · ",eX.title||"API",tl?(0,t.jsx)("span",{className:`ml-2 font-mono text-xs ${(0,ea.isSuccess)(tl)?"text-ok":"text-bad"}`,children:tl.status||"ERR"}):null]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[to,eY.length>=2?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>eK("results"),children:["View results",(0,t.jsx)(n,{size:14})]}):null]})]}),(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col space-y-4 pt-4",children:[(0,t.jsx)(ef,{contract:O,blocked:M,skipped:ej,busy:A||eN,onProceed:()=>void tt(!0)}),tl?(0,t.jsx)(W.ResponseViewer,{result:tl}):(0,t.jsxs)(eg,{children:[(0,t.jsxs)("p",{children:["Give each tab a URL, choose the shared load, then press ",(0,t.jsx)("span",{className:"text-ink",children:"Compare load"}),". Each API is checked first; the results open full width, with a tab for each API."]}),(0,t.jsxs)("p",{className:"mt-2",children:[(0,t.jsx)("span",{className:"text-ink",children:"Send"})," checks this API once; ",(0,t.jsx)("span",{className:"text-ink",children:"Send all"})," checks every API and confirms they return the same structure. To compare finished runs, use ",(0,t.jsx)("span",{className:"text-ink",children:"Add to compare"})," on a report, or tick runs on"," ",(0,t.jsx)(h.default,{href:"/history",className:"text-accent hover:underline",children:"History"}),"."]})]})]})]})]})]})}],49186)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60459,e=>{"use strict";var t=e.i(14368),n=e.i(95486),r=e.i(99522);let i=(0,r.default)("file-search",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);var s=e.i(84355),a=e.i(67951),o=e.i(91694);let l=(0,r.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);var c=e.i(29091),u=e.i(34761),d=e.i(5769),f=e.i(88293);let h=(0,r.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var p=e.i(96659),m=e.i(87283),x=e.i(30099),g=e.i(36994),y=e.i(48317),v=e.i(99181),b=e.i(57515),w=e.i(69578),k=e.i(78739),j=e.i(22079);e.i(24856);var C=e.i(92084),N=e.i(56396),S=e.i(727),E=e.i(43101);function P(){let e=(0,N.useToast)(),t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let n=!0,r=async()=>{try{let{now:r,results:i}=await E.schedulesApi.since(t.current??new Date(Date.now()+31536e6).toISOString());if(!n)return;if(null===t.current){t.current=r;return}for(let n of(t.current=i.at(-1)?.at??t.current,i.filter(e=>e.schedule&&!e.manual&&(0,C.shouldNotify)(e.schedule.notify,e)))){let t=(0,C.scheduleNotice)(n,n.schedule);e(`${t.title}. ${t.body}`,t.ok?"success":"error"),(0,S.notifyAway)({title:t.title,body:t.body,tag:`atc-schedule-${n.scheduleId}`})}i.length&&window.dispatchEvent(new Event(E.SCHEDULES_CHANGED))}catch{}};r();let i=window.setInterval(()=>void r(),2e4);return()=>{n=!1,window.clearInterval(i)}},[e]),null}var M=e.i(39736),T=e.i(73151),A=e.i(68865),I=e.i(15868);function $(){let{items:e,remove:n,clear:r}=(0,A.useCompareTray)(),i=(0,g.usePathname)(),s=(0,g.useRouter)();if(!e.length||i.startsWith("/compare"))return null;let o=e.length>=2;return(0,t.jsx)("div",{role:"region","aria-label":"Runs to compare",className:"fixed bottom-4 left-1/2 z-[60] w-[min(56rem,calc(100%-2rem))] -translate-x-1/2",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-accent/40 bg-panel px-3 py-2.5 shadow-2xl",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[(0,t.jsx)(a.GitCompareArrows,{size:16,className:"text-accent","aria-hidden":!0}),"Compare",(0,t.jsxs)("span",{className:"text-xs font-normal text-mute",children:[e.length," of ",A.TRAY_MAX]})]}),(0,t.jsx)("ul",{className:"flex min-w-0 flex-1 flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)("li",{className:"flex max-w-56 items-center gap-1 rounded-full border border-line bg-panel-2 py-0.5 pr-1 pl-2.5 text-xs text-ink",title:`${e.endpoint} \xb7 ${new Date(e.startedAt).toLocaleString()}`,children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("button",{type:"button",onClick:()=>n(e.id),className:"rounded-full p-0.5 text-mute hover:text-bad","aria-label":`Remove ${e.name} from compare`,children:(0,t.jsx)(m.X,{size:12})})]},e.id))}),(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs text-mute hover:text-ink",children:"Clear"}),(0,t.jsx)("button",{type:"button",disabled:!o,title:o?"Open these runs side by side on Compare":"Add at least two runs",onClick:()=>((0,I.startNavProgress)(),s.push(`/compare?ids=${e.map(e=>e.id).join(",")}`)),className:"btn btn-primary py-1.5 text-sm",children:o?`Compare ${e.length} runs`:"Add one more run"})]})]})})}var O=e.i(7641),R=e.i(72350),_=e.i(5831),z=e.i(67217),D=e.i(56931),L=e.i(5504),U=e.i(74749),F=e.i(91549),H=e.i(97942);let V=(0,r.default)("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var q=e.i(20054);function B(){let{stopped:e}=(0,q.useEngineHealth)();return((0,v.useEffect)(()=>{e&&window.close()},[e]),e)?(0,t.jsx)("div",{role:"alertdialog","aria-labelledby":"stopped-title",className:"fixed inset-0 z-[90] grid place-items-center bg-canvas/95 p-6 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"max-w-md space-y-3 text-center",children:[(0,t.jsx)(V,{size:28,className:"mx-auto text-mute","aria-hidden":!0}),(0,t.jsx)("h2",{id:"stopped-title",className:"text-lg font-medium text-ink",children:"APITestCenter was stopped"}),(0,t.jsx)("p",{className:"text-sm text-mute",children:"It was closed from the command line (Ctrl+C). Your saved requests are safe in their folder. You can close this tab."}),(0,t.jsxs)("p",{className:"text-sm text-mute",children:["To open it again, run ",(0,t.jsx)("code",{className:"rounded bg-panel-2 px-1.5 py-0.5 font-mono text-ink",children:"atc ui"})," — this page reconnects by itself if it starts on the same address."]})]})}):null}var K=e.i(839),W=e.i(11718);let J=(0,r.default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var Z=e.i(83316),G=e.i(67938),X=e.i(4488),Y=e.i(73606),Q=e.i(71189);let ee=(0,r.default)("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]),et=(0,r.default)("rows-4",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 7.5H3",key:"1hm9pq"}],["path",{d:"M21 12H3",key:"2avoz0"}],["path",{d:"M21 16.5H3",key:"n7jzkj"}]]);var en=e.i(67290),er=e.i(30135),ei=e.i(745),es=e.i(45377),ea=e.i(14865);let eo=[{id:"system",label:"Theme follows the system",icon:u.Monitor},{id:"light",label:"Light theme",icon:ei.Sun},{id:"dark",label:"Dark theme",icon:Y.Moon}];function el({onClick:e,title:n,children:r,label:i}){return(0,t.jsx)("button",{type:"button",onClick:e,title:n,"aria-label":i,className:"inline-flex h-6 shrink-0 items-center gap-1.5 rounded px-2 text-mute hover:bg-panel-2 hover:text-ink",children:r})}function ec(){let e=(0,es.useUpdateStatus)();if(!e||"ready"!==e.state&&"available"!==e.state&&"downloading"!==e.state)return null;let n="important"===e.level,r="ready"===e.state?"Restart to update":"downloading"===e.state?`Downloading ${e.percent}%`:n?`Important update: ${e.version}`:`${e.version} available`,i="ready"===e.state?`Version ${e.version} is downloaded: restart to update, or it installs when you close the app`:"downloading"===e.state?`Downloading version ${e.version}`:`Version ${e.version} is available — see what's new`;return(0,t.jsxs)("button",{type:"button",onClick:T.openUpdate,title:n&&e.why?`${i}. ${e.why}`:i,className:`inline-flex h-6 shrink-0 items-center gap-1.5 rounded px-2 font-medium ${n?"bg-warn/15 text-warn hover:bg-warn/25":"bg-accent-dim text-accent hover:brightness-110"}`,children:[(0,t.jsx)(W.ArrowDownCircle,{size:13,"aria-hidden":!0})," ",r]})}function eu(){let{checked:e,online:n,k6Ready:r,k6Label:i,appVersion:s}=(0,q.useEngineHealth)(),{zoom:a,zoomIn:o,zoomOut:l,resetZoom:c,density:u,setDensity:d}=(0,ea.useViewPrefs)(),{theme:f,setTheme:h}=(0,y.useTheme)(),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>m(!0),[]);let x=Math.max(0,eo.findIndex(e=>e.id===(p?f??"system":"system"))),g=eo[x].icon;return(0,t.jsxs)("footer",{"aria-label":"Status bar",className:"flex h-8 shrink-0 items-center gap-0.5 overflow-x-auto border-t border-line bg-panel px-2 text-xs whitespace-nowrap",children:[(0,t.jsxs)("span",{role:"status",className:"inline-flex shrink-0 items-center gap-2 px-2 text-ink",title:n?i:"Start it with pnpm dev",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${e?n&&r?"bg-ok":n?"bg-warn":"bg-bad":"bg-mute"}`,"aria-hidden":!0}),e?n?r?"Engine ready":"Engine online, k6 missing":"Engine offline":"Checking engine"]}),n?(0,t.jsx)("span",{className:"hidden shrink-0 px-1 text-mute md:inline",children:i}):null,(0,t.jsx)("span",{className:"mx-1 h-4 w-px shrink-0 bg-line","aria-hidden":!0}),(0,t.jsxs)(el,{onClick:()=>(0,z.openImport)(),title:"Import requests — Postman, Insomnia, Bruno, OpenAPI, .http, Hurl, HAR",children:[(0,t.jsx)(G.FileUp,{size:13,"aria-hidden":!0})," Import"]}),(0,t.jsxs)(el,{onClick:()=>(0,L.openCookies)(),title:"Cookies kept between requests",children:[(0,t.jsx)(Z.Cookie,{size:13,"aria-hidden":!0})," Cookies"]}),(0,t.jsxs)(el,{onClick:()=>(0,D.openCertificates)(),title:"Client certificates and trusted CAs",children:[(0,t.jsx)(er.ShieldCheck,{size:13,"aria-hidden":!0})," Certificates"]}),(0,t.jsxs)(el,{onClick:()=>(0,U.openMock)(),title:"Answer requests with example responses",children:[(0,t.jsx)(en.Server,{size:13,"aria-hidden":!0})," Mock server"]}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{role:"group","aria-label":"Zoom",className:"inline-flex shrink-0 items-center",children:[(0,t.jsx)(el,{onClick:l,title:"Zoom out (Ctrl −)",label:"Zoom out",children:(0,t.jsx)(X.Minus,{size:13,"aria-hidden":!0})}),(0,t.jsx)(el,{onClick:c,title:"Reset zoom (Ctrl 0)",label:`Zoom ${Math.round(100*a)}%, reset`,children:(0,t.jsxs)("span",{className:"tabular w-9 text-center font-mono",children:[Math.round(100*a),"%"]})}),(0,t.jsx)(el,{onClick:o,title:"Zoom in (Ctrl +)",label:"Zoom in",children:(0,t.jsx)(Q.Plus,{size:13,"aria-hidden":!0})})]}),(0,t.jsxs)(el,{onClick:()=>d("compact"===u?"comfortable":"compact"),title:"compact"===u?"Compact rows — click for comfortable":"Comfortable rows — click for compact",children:["compact"===u?(0,t.jsx)(et,{size:13,"aria-hidden":!0}):(0,t.jsx)(ee,{size:13,"aria-hidden":!0}),"compact"===u?"Compact":"Comfortable"]}),(0,t.jsx)(el,{onClick:()=>h(eo[(x+1)%eo.length].id),title:`${eo[x].label} — click to change`,label:`${eo[x].label}. Click to change.`,children:(0,t.jsx)(g,{size:13,"aria-hidden":!0})}),(0,t.jsx)("span",{"data-tour":"help",className:"inline-flex",children:(0,t.jsxs)(el,{onClick:O.openHelp,title:"What the words mean, and the tour",children:[(0,t.jsx)(J,{size:13,"aria-hidden":!0})," Help"]})}),(0,t.jsx)(ec,{}),(0,t.jsx)(el,{onClick:k.openAbout,title:"Version, updates, and where your files are",children:s&&"dev"!==s?`v${s}`:"Development build"})]})}var ed=e.i(51554),ef=e.i(21407),eh=e.i(44505),ep=e.i(99822),em=e.i(48181),ex=e.i(2603),eg=e.i(30635),ey=e.i(6278);let ev=[{href:"/home",label:"Home",icon:l},{href:"/",label:"Test API",icon:s.FlaskConical},{href:"/suite",label:"Run collection",icon:c.ListChecks},{href:"/compare",label:"Compare",icon:a.GitCompareArrows},{href:"/connections",label:"Connections",icon:d.Plug},{href:"/history",label:"History",icon:o.History},{href:"/preview",label:"Open report",icon:i}],eb="apitestcenter-phone-notice";function ew({children:e}){let r=(0,g.usePathname)(),i=(0,ex.useModKey)(),{activeEnv:s}=(0,ey.useWorkspace)(),a=(0,em.envKind)(s),o=em.ENV_COLOUR[a],[l,c]=(0,v.useState)(!1),{resolvedTheme:d}=(0,y.useTheme)(),{current:C}=(0,eg.useProjects)();return(0,v.useEffect)(ef.loadAppSettings,[]),(0,v.useEffect)(()=>{let e=(0,eh.desktop)();e?.platform&&(document.documentElement.dataset.desktop=e.platform),e&&(0,ep.installRest)()},[]),(0,v.useEffect)(()=>{let e=(0,eh.desktop)();if(!e?.setTitleBarColours)return;let t=requestAnimationFrame(()=>{let t=getComputedStyle(document.documentElement);e.setTitleBarColours(t.getPropertyValue("--panel").trim(),t.getPropertyValue("--ink").trim())});return()=>cancelAnimationFrame(t)},[d]),(0,v.useEffect)(()=>{c(window.matchMedia("(max-width: 767px)").matches&&"dismissed"!==window.sessionStorage.getItem(eb))},[]),(0,t.jsxs)("div",{className:"flex flex-col overflow-hidden",style:{height:"calc(100dvh / var(--zoom, 1))"},children:[(0,t.jsx)("a",{href:"#main",className:"sr-only z-50 rounded-md bg-accent px-3 py-2 text-sm text-canvas focus:not-sr-only focus:fixed focus:top-2 focus:left-2",children:"Skip to content"}),o?(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-x-0 z-[90]",style:{background:o,height:3,top:"calc(48px / var(--zoom, 1) - 3px)"}}):null,(0,t.jsxs)("header",{className:"app-titlebar flex shrink-0 items-center gap-3 border-b border-line bg-panel px-3",style:{height:"calc(48px / var(--zoom, 1))"},children:[(0,t.jsxs)(x.default,{href:"/",className:"flex shrink-0 items-center gap-2 rounded-md px-1 py-1","aria-label":"APITestCenter home",children:[(0,t.jsx)(b.BrandMark,{size:26}),(0,t.jsx)("span",{className:"hidden text-sm font-semibold tracking-tight text-ink sm:inline",children:"APITestCenter"})]}),C?(0,t.jsxs)(x.default,{href:"/home",title:`${C.path} — switch project`,className:"flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm text-ink hover:bg-panel-2",children:[(0,t.jsx)("span",{className:"text-mute","aria-hidden":!0,children:"/"}),(0,t.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{background:(0,eg.projectTile)(C.id)},"aria-hidden":!0}),(0,t.jsx)("span",{className:"max-w-48 truncate",children:C.name}),(0,t.jsx)(n.ChevronDown,{size:13,className:"shrink-0 text-mute","aria-hidden":!0})]}):null,(0,t.jsx)("div",{className:"flex min-w-0 flex-1 justify-center",children:(0,t.jsxs)("button",{type:"button",onClick:()=>window.dispatchEvent(new Event("atc:palette")),"aria-label":"Open command palette",title:`Search, run or jump to anything (${i}+K)`,className:"flex h-8 w-full max-w-md min-w-0 items-center gap-2 rounded-lg border border-line bg-canvas px-3 text-sm text-mute hover:border-mute hover:text-ink",children:[(0,t.jsx)(f.Search,{size:14,"aria-hidden":!0,className:"shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:"Search, run or jump to anything"}),(0,t.jsxs)("span",{className:"kbd shrink-0",children:[i," K"]})]})}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2 sm:min-w-40",children:[s?(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${"production"===a?"border-bad/50 bg-bad/10 text-bad":"border-line text-mute"}`,title:"production"===a?"Production: sends that change data ask first":"The environment in use — change it on the right of the request tabs",children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full",style:{background:o??"var(--ok)"},"aria-hidden":!0}),s.name]}):null,(0,t.jsx)("button",{type:"button",onClick:()=>(0,K.openSettings)(),"aria-label":"Settings",title:`Settings (${i}+,)`,className:"rounded-md p-1.5 text-mute hover:bg-panel-2 hover:text-ink",children:(0,t.jsx)(h,{size:16,"aria-hidden":!0})})]})]}),(0,t.jsxs)("div",{className:"flex min-h-0 flex-1",children:[(0,t.jsxs)("aside",{"aria-label":"Main navigation",className:"flex w-[4.75rem] shrink-0 flex-col items-center gap-1 border-r border-line bg-panel py-2",children:[(0,t.jsx)("nav",{className:"flex w-full flex-col items-center gap-1 px-1.5",children:ev.map(e=>{let n="/"===e.href?"/"===r:r===e.href||r.startsWith(`${e.href}/`),i=e.icon;return(0,t.jsxs)(x.default,{href:e.href,"aria-current":n?"page":void 0,className:`flex w-full flex-col items-center gap-1 rounded-lg px-1 py-2 text-center text-[11px] leading-tight transition-colors ${n?"bg-accent-dim text-ink":"text-mute hover:bg-panel-2 hover:text-ink"}`,children:[(0,t.jsx)(i,{size:18,strokeWidth:1.75,"aria-hidden":!0,className:n?"text-accent":void 0}),e.label]},e.href)})}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("button",{type:"button",onClick:H.openTrash,title:"Deleted requests — restore them for 30 days",className:"flex w-[calc(100%-0.75rem)] flex-col items-center gap-1 rounded-lg px-1 py-2 text-center text-[11px] leading-tight text-mute hover:bg-panel-2 hover:text-ink",children:[(0,t.jsx)(p.Trash2,{size:18,strokeWidth:1.75,"aria-hidden":!0}),"Trash"]})]}),(0,t.jsxs)("main",{id:"main",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:[l?(0,t.jsxs)("div",{role:"note",className:"flex items-start gap-3 border-b border-line bg-accent-dim px-4 py-3 text-sm text-ink",children:[(0,t.jsx)(u.Monitor,{size:18,className:"mt-0.5 shrink-0 text-accent","aria-hidden":!0}),(0,t.jsx)("p",{className:"min-w-0 flex-1",children:"APITestCenter is built for a computer. Performance tests run from the machine you use, and the editor needs room. You can still read reports here."}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"shrink-0 rounded p-1 text-mute hover:text-ink",onClick:()=>{window.sessionStorage.setItem(eb,"dismissed"),c(!1)},children:(0,t.jsx)(m.X,{size:16})})]}):null,e]})]}),(0,t.jsx)(eu,{}),(0,t.jsx)(w.CommandPalette,{}),(0,t.jsx)(O.HelpPanel,{}),(0,t.jsx)(_.Tour,{}),(0,t.jsx)(z.ImportDialog,{}),(0,t.jsx)(D.CertificatesDialog,{}),(0,t.jsx)(L.CookiesDialog,{}),(0,t.jsx)(U.MockDialog,{}),(0,t.jsx)(F.ExportDialog,{}),(0,t.jsx)(H.VersionsDialog,{}),(0,t.jsx)(H.TrashDialog,{}),(0,t.jsx)(B,{}),(0,t.jsx)(I.NavProgress,{}),(0,t.jsx)(k.AboutDialog,{}),(0,t.jsx)(j.ContractsDialog,{}),(0,t.jsx)(P,{}),(0,t.jsx)(M.WhatsNewDialog,{}),(0,t.jsx)(T.UpdateDialog,{}),(0,t.jsx)(R.ShortcutsDialog,{}),(0,t.jsx)(K.SettingsDialog,{}),(0,t.jsx)($,{}),(0,t.jsx)(ed.UsageConsent,{})]})}e.s(["AppShell",0,function({children:e}){return(0,t.jsx)(ea.ViewPrefsProvider,{children:(0,t.jsx)(ew,{children:e})})}],60459)},87329,e=>{"use strict";var t=e.i(14368),n=e.i(48317),r=e.i(39170),i=e.i(68865),s=e.i(56396),a=e.i(20054),o=e.i(59180),l=e.i(48321),c=e.i(6278),u=e.i(88153);e.s(["Providers",0,function({children:e}){return(0,t.jsx)(n.ThemeProvider,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"apitestcenter-theme",children:(0,t.jsx)(a.EngineHealthProvider,{children:(0,t.jsx)(o.HistoryProvider,{children:(0,t.jsx)(l.ViewsProvider,{children:(0,t.jsx)(c.WorkspaceProvider,{children:(0,t.jsx)(u.SloProvider,{children:(0,t.jsx)(s.ToastProvider,{children:(0,t.jsx)(r.ConfirmProvider,{children:(0,t.jsx)(i.CompareTrayProvider,{children:e})})})})})})})})})}])},68865,e=>{"use strict";var t=e.i(14368),n=e.i(99181);let r="apitestcenter-compare-tray",i=(0,n.createContext)({items:[],has:()=>!1,toggle:()=>!1,remove:()=>{},clear:()=>{}});e.s(["CompareTrayProvider",0,function({children:e}){let[s,a]=(0,n.useState)([]);(0,n.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(r)??"[]");Array.isArray(e)&&a(e.filter(e=>"string"==typeof e?.id&&"string"==typeof e?.name).slice(0,6))}catch{}},[]);let o=(0,n.useCallback)(e=>{a(e);try{localStorage.setItem(r,JSON.stringify(e))}catch{}},[]),l=(0,n.useMemo)(()=>({items:s,has:e=>s.some(t=>t.id===e),toggle:e=>s.some(t=>t.id===e.id)?(o(s.filter(t=>t.id!==e.id)),!0):!(s.length>=6)&&(o([...s,e]),!0),remove:e=>o(s.filter(t=>t.id!==e)),clear:()=>o([])}),[s,o]);return(0,t.jsx)(i.Provider,{value:l,children:e})},"TRAY_MAX",0,6,"useCompareTray",0,function(){return(0,n.useContext)(i)}])},48181,e=>{"use strict";e.s(["ENV_COLOUR",0,{production:"var(--bad)",other:null},"envKind",0,function(e){return e?.production?"production":"other"},"isReadOnlyMethod",0,e=>/^(GET|HEAD|OPTIONS)$/i.test(e)])},727,e=>{"use strict";var t=e.i(99181),n=e.i(44505);let r="apitestcenter-notify",i="apitestcenter-notify-change";function s(){let e="Notification"in window?Notification.permission:"unsupported";return"unsupported"===e?"unsupported":"denied"===e?"blocked":"default"===e?"ask":"off"===function(){try{let e=localStorage.getItem(r);return"on"===e||"off"===e?e:null}catch{return null}}()?"off":"on"}function a(e){try{localStorage.setItem(r,e)}catch{}window.dispatchEvent(new Event(i))}async function o(){let e=s();return"ask"===e?"granted"===await Notification.requestPermission()?a("on"):window.dispatchEvent(new Event(i)):("on"===e||"off"===e)&&a("on"===e?"off":"on"),s()}let l=()=>"hidden"===document.visibilityState||!document.hasFocus(),c=null,u=null;function d(){null!==c&&(document.title=c),c=null}e.s(["noticeState",0,s,"notifyAway",0,function({title:e,body:t,tag:r}){if("u">typeof document&&l()&&"on"===s())try{let i=new Notification(e,{body:t,tag:r});i.onclick=()=>{(0,n.desktop)()?.showWindow?.(),window.focus(),i.close()}}catch{}},"notifyFinished",0,function({title:e,body:t,ok:r}){if("u"<typeof document||!l())return;u=null,c??=document.title,document.title=`${r?"✓":"✕"} ${e} — APITestCenter`;let i=()=>{d(),window.removeEventListener("focus",i)};if(window.addEventListener("focus",i),"on"===s())try{let r=new Notification(e,{body:t,tag:"apitestcenter-run",silent:!1});r.onclick=()=>{(0,n.desktop)()?.showWindow?.(),window.focus(),r.close()}}catch{}},"toggleNotices",0,o,"useLiveTitle",0,function(e){(0,t.useEffect)(()=>{e?(c??=document.title,u=e,document.title=`${e} — APITestCenter`):u&&(u=null,d())},[e]),(0,t.useEffect)(()=>()=>{u&&(u=null,d())},[])},"useNoticeState",0,function(){let[e,n]=(0,t.useState)("unsupported");return(0,t.useEffect)(()=>{let e=()=>n(s());return e(),window.addEventListener(i,e),window.addEventListener("focus",e),()=>{window.removeEventListener(i,e),window.removeEventListener("focus",e)}},[]),e}])},99822,e=>{"use strict";var t=e.i(99181),n=e.i(727),r=e.i(28950);let i=new Map,s=0;function a(){let e=[...new Set(i.values())];if(document.querySelector('[role="dialog"][aria-modal="true"], [role="alertdialog"]')&&e.push("a dialog is open"),e.length)return{ok:!1,holds:e};(0,r.keepForReload)();let t=getComputedStyle(document.body);return{ok:!0,notify:"on"===(0,n.noticeState)(),colours:{bg:t.backgroundColor,fg:t.color}}}e.s(["installRest",0,function(){window.atcRest=a},"useKeepAwake",0,function(e,n){(0,t.useEffect)(()=>{if(!e)return;let t=String(++s);return i.set(t,n),()=>void i.delete(t)},[e,n])}])},88153,e=>{"use strict";var t=e.i(14368),n=e.i(99181);let r="apitestcenter-session-slo",i=(0,n.createContext)({slo:null,setSlo:()=>{},ready:!1});e.s(["SloProvider",0,function({children:e}){let[s,a]=(0,n.useState)(null),[o,l]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{a(function(){try{let e=localStorage.getItem(r)??sessionStorage.getItem(r);if(!e)return null;let t=JSON.parse(e);if("number"!=typeof t.p95Ms||"number"!=typeof t.errorRate||!(t.p95Ms>0)||t.errorRate<0)return null;return{p95Ms:t.p95Ms,errorRate:t.errorRate,p99Ms:"number"==typeof t.p99Ms&&t.p99Ms>0?t.p99Ms:void 0,checksRate:"number"==typeof t.checksRate?t.checksRate:void 0,abortOnFail:!0===t.abortOnFail}}catch{return null}}()),l(!0)},[]),(0,t.jsx)(i.Provider,{value:{slo:s,setSlo:function(e){a(e);try{sessionStorage.removeItem(r),e?localStorage.setItem(r,JSON.stringify(e)):localStorage.removeItem(r)}catch{}},ready:o},children:e})},"useSlo",0,function(){return(0,n.useContext)(i)}])},48321,e=>{"use strict";var t=e.i(14368);e.i(24856);var n=e.i(86483),r=e.i(99181);let i=(0,n.normalizeViewsFile)(null),s=(0,r.createContext)({file:i,ready:!1,viewsFor:e=>n.BUILT_IN_VIEWS.filter(t=>t.scope===e),save:async e=>e});function a(){return(0,r.useContext)(s)}let o=e=>`apitestcenter-last-view-${e}`;e.s(["ViewsProvider",0,function({children:e}){let[a,o]=(0,r.useState)(i),[l,c]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/engine/settings/views",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>e&&o((0,n.normalizeViewsFile)(e))).catch(()=>void 0).finally(()=>c(!0))},[]);let u=(0,r.useCallback)(async e=>{let t=await fetch("/engine/settings/views",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),r=await t.json();if(!t.ok)throw Error(r.error??"Could not save the view");let i=(0,n.normalizeViewsFile)(r);return o(i),i},[]),d=(0,r.useMemo)(()=>({file:a,ready:l,viewsFor:e=>[...n.BUILT_IN_VIEWS,...a.views].filter(t=>t.scope===e),save:u}),[a,l,u]);return(0,t.jsx)(s.Provider,{value:d,children:e})},"useSelectedView",0,function(e){let{file:t,viewsFor:n}=a(),[i,s]=(0,r.useState)(null);(0,r.useEffect)(()=>{try{s(localStorage.getItem(o(e)))}catch{}},[e]);let l=n(e);return[l.find(e=>e.id===i)??l.find(n=>n.id===t.defaults[e])??l[0],(0,r.useCallback)(t=>{s(t);try{localStorage.setItem(o(e),t)}catch{}},[e])]},"useViews",0,a])},84355,e=>{"use strict";let t=(0,e.i(99522).default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);e.s(["FlaskConical",0,t],84355)},67951,e=>{"use strict";let t=(0,e.i(99522).default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);e.s(["GitCompareArrows",0,t],67951)},5769,28950,e=>{"use strict";let t=(0,e.i(99522).default)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);e.s(["Plug",0,t],5769);var n=e.i(99181);let r=new Map,i="apitestcenter-resting-memory";try{let e=sessionStorage.getItem(i);if(sessionStorage.removeItem(i),e)for(let[t,n]of Object.entries(JSON.parse(e)))r.set(t,n)}catch{}e.s(["keepForReload",0,function(){let e={},t=0;for(let[n,i]of r)try{let r=JSON.stringify(i);if(void 0===r||t+r.length>4e6)continue;e[n]=i,t+=r.length}catch{}try{sessionStorage.setItem(i,JSON.stringify(e))}catch{}},"recall",0,function(e){return r.get(e)},"remember",0,function(e,t){r.set(e,t)},"useRemembered",0,function(e,t){let[i,s]=(0,n.useState)(()=>r.has(e)?r.get(e):"function"==typeof t?t():t);return(0,n.useEffect)(()=>{r.set(e,i)},[e,i]),[i,s]}],28950)},30099,(e,t,n)=>{"use strict";e.i(30204),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return g},useLinkStatus:function(){return v}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=e.r(56421),a=e.r(14368),o=s._(e.r(99181)),l=e.r(36176),c=e.r(64937),u=e.r(24967),d=e.r(61908),f=e.r(14648),h=e.r(43491),p=e.r(89960),m=e.r(53543),x=e.r(63663);function g(t){var n;let r,i,s,[g,v]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,o.useRef)(null),{href:w,as:k,children:j,prefetch:C=null,passHref:N,replace:S,shallow:E,scroll:P,onClick:M,onMouseEnter:T,onTouchStart:A,legacyBehavior:I=!1,onNavigate:$,transitionTypes:O,ref:R,unstable_dynamicOnHover:_,...z}=t;r=j,I&&("string"==typeof r||"number"==typeof r)&&(r=(0,a.jsx)("a",{children:r}));let D=o.default.useContext(c.AppRouterContext),L=!1!==C,U=!1===C?"none":!0===C?"full":"auto",F="none"!==U?"auto"===U?x.FetchStrategy.PPR:x.FetchStrategy.Full:x.FetchStrategy.PPR,H="string"==typeof(n=k||w)?n:(0,l.formatUrl)(n);if(I){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=o.default.Children.only(r)}let V=I?i&&"object"==typeof i&&i.ref:R,q,B=o.default.useCallback(e=>(null!==D&&(b.current=(0,p.mountLinkInstance)(e,H,D,F,L,v,q)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[L,H,D,F,v,q]),K={ref:(0,u.useMergedRef)(B,V),onClick(t){I||"function"!=typeof M||M(t),I&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!D||t.defaultPrevented||function(t,n,r,i,s,a,l,c="none"){if("u">typeof window){let u,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(n)){i&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(63059);o.default.startTransition(()=>{f(n,i?"replace":"push",!1===s?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,r.current,l,c)})}}(t,H,b,S,P,$,O,U)},onMouseEnter(e){I||"function"!=typeof T||T(e),I&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),D&&L&&(0,p.onNavigationIntent)(e.currentTarget,!0===_)},onTouchStart:function(e){I||"function"!=typeof A||A(e),I&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),D&&L&&(0,p.onNavigationIntent)(e.currentTarget,!0===_)}};return(0,d.isAbsoluteUrl)(H)?K.href=H:I&&!N&&("a"!==i.type||"href"in i.props)||(K.href=(0,f.addBasePath)(H)),s=I?o.default.cloneElement(i,K):(0,a.jsx)("a",{...z,...K,children:r}),(0,a.jsx)(y.Provider,{value:g,children:s})}let y=(0,o.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,o.useContext)(y);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},24967,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(99181);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=s(e,r)),t&&(i.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},61908,(e,t,n)=>{"use strict";e.i(30204),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return b},NormalizeError:function(){return y},PageNotFoundError:function(){return v},SP:function(){return m},ST:function(){return x},WEB_VITALS:function(){return s},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return k}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&o.test(e)};function c(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}let m="u">typeof performance,x=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class y extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},53543,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(61908),i=e.r(85594);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,i.hasBasePath)(n.pathname)}catch(e){return!1}}},62298,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return l},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return o}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});function s(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,a(e));else t.set(n,a(r));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},36176,(e,t,n)=>{"use strict";e.i(30204),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=e.r(56421)._(e.r(62298)),a=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:n}=e,r=e.protocol||"",i=e.pathname||"",o=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||a.test(r))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${r}${c}${i}${u}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},92084,43101,e=>{"use strict";e.s(["NOTIFY_LABELS",0,{changes:"When it starts failing, and when it's fixed",failures:"Every failed run",always:"Every run",never:"Never"},"SCHEDULE_EVERY",0,[5,15,30,60,180,360,720,1440],"everyLabel",0,function(e){return e<60?`every ${e} minutes`:60===e?"every hour":e<1440?`every ${e/60} hours`:1440===e?"every day":`every ${e/1440} days`},"nextRunAt",0,function(e){return e.lastRunAt?Date.parse(e.lastRunAt)+6e4*e.everyMinutes:Date.parse(e.createdAt)},"scheduleNotice",0,function(e,t){let n=t.collection||"Requests outside a folder";if("fixed"===e.change)return{ok:!0,title:`${n} is passing again`,body:e.headline};if(!e.passed){let t=e.failed[0];return{ok:!1,title:`${n} ${"failing"===e.change?"started failing":"failed again"}`,body:t?`${e.headline} — ${t.name}${t.message?`: ${t.message}`:""}`:e.headline}}return{ok:!0,title:`${n} passed`,body:e.headline}},"shouldNotify",0,function(e,t){return"never"!==e&&("always"===e||("failures"===e?!t.passed||"fixed"===t.change:null!==t.change))}],92084);var t=e.i(99181);let n="atc:schedules-changed";async function r(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}let i=(e,t,n)=>fetch(t,{method:e,headers:void 0===n?void 0:{"content-type":"application/json"},body:void 0===n?void 0:JSON.stringify(n)}),s=e=>(window.dispatchEvent(new Event(n)),e),a={list:()=>fetch("/engine/schedules",{cache:"no-store"}).then(e=>r(e)).then(e=>e.schedules),add:e=>i("POST","/engine/schedules",e).then(e=>r(e)).then(s),update:(e,t)=>i("PUT",`/engine/schedules/${encodeURIComponent(e)}`,t).then(e=>r(e)).then(s),remove:e=>i("DELETE",`/engine/schedules/${encodeURIComponent(e)}`).then(e=>r(e)).then(s),run:e=>i("POST",`/engine/schedules/${encodeURIComponent(e)}/run`).then(e=>r(e)).then(s),since:e=>fetch(`/engine/schedules/results?since=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>r(e))};e.s(["SCHEDULES_CHANGED",0,n,"schedulesApi",0,a,"useSchedules",0,function(){let[e,r]=(0,t.useState)(null),i=(0,t.useCallback)(()=>void a.list().then(r,()=>r(e=>e??[])),[]);return(0,t.useEffect)(()=>{i();let e=window.setInterval(i,3e4);return window.addEventListener(n,i),()=>{window.clearInterval(e),window.removeEventListener(n,i)}},[i]),e}],43101)}]);