apitestcenter 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/LICENSE.txt +5 -2
  2. package/dist/THIRD-PARTY-NOTICES-UI.txt +622 -1
  3. package/dist/THIRD-PARTY-NOTICES.txt +1 -1
  4. package/dist/cli.mjs +3560 -118756
  5. package/dist/ui/404/index.html +1 -1
  6. package/dist/ui/404.html +1 -1
  7. package/dist/ui/__next.__PAGE__.txt +11 -11
  8. package/dist/ui/__next._full.txt +15 -16
  9. package/dist/ui/__next._tree.txt +4 -5
  10. package/dist/ui/_next/static/chunks/01sqehfan_2j_.js +1 -0
  11. package/dist/ui/_next/static/chunks/09i5zrliu0ihk.js +2 -0
  12. package/dist/ui/_next/static/chunks/{2lw9bsrnh8k4u.js → 0_0x8uij5q9uo.js} +1 -1
  13. package/dist/ui/_next/static/chunks/0hcsfv99w40pd.js +1 -0
  14. package/dist/ui/_next/static/chunks/{0gi0-hmzkqhl_.js → 0hzm2s0wkhmzk.js} +4 -4
  15. package/dist/ui/_next/static/chunks/0jepa0hc-rzkw.js +27 -0
  16. package/dist/ui/_next/static/chunks/15pu58j0qz9i8.js +31 -0
  17. package/dist/ui/_next/static/chunks/1apjslkz52j1a.js +22 -0
  18. package/dist/ui/_next/static/chunks/{1zmkb7tfqygqs.js → 1d3l7hra87g66.js} +1 -1
  19. package/dist/ui/_next/static/chunks/1pz4ugabfd0qn.js +1 -0
  20. package/dist/ui/_next/static/chunks/2dn12byo9lp8w.js +1 -0
  21. package/dist/ui/_next/static/chunks/{0k57pe238zzo_.js → 2nuly7x38k2--.js} +1 -1
  22. package/dist/ui/_next/static/chunks/{115l_disvbdxa.js → 2u2hx7jqhjo62.js} +1 -1
  23. package/dist/ui/_next/static/chunks/3een3k2hd15nf.css +3 -0
  24. package/dist/ui/_next/static/chunks/3hn-tmfmw2hkd.js +59 -0
  25. package/dist/ui/_next/static/chunks/{3rlhnherpqpp5.js → 3qrp203pdimxn.js} +61 -61
  26. package/dist/ui/_next/static/chunks/40n7rab9memc2.js +1 -0
  27. package/dist/ui/_next/static/chunks/{turbopack-2kiaj9_7vlslw.js → turbopack-2ryv3cb9r14p8.js} +1 -1
  28. package/dist/ui/_next/static/media/4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 +0 -0
  29. package/dist/ui/_next/static/media/53b9e256198e5412-s.390ncx5urfkfu.woff2 +0 -0
  30. package/dist/ui/_next/static/media/5ce348bf30bf5439-s.31988l_ccedte.woff2 +0 -0
  31. package/dist/ui/_next/static/media/6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 +0 -0
  32. package/dist/ui/_next/static/media/7178b3e590c64307-s.21jp631_3pja2.woff2 +0 -0
  33. package/dist/ui/_next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2 +0 -0
  34. package/dist/ui/_next/static/media/7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 +0 -0
  35. package/dist/ui/_next/static/media/8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 +0 -0
  36. package/dist/ui/_next/static/media/bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 +0 -0
  37. package/dist/ui/_next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 +0 -0
  38. package/dist/ui/_next/static/media/favicon.0pwkek30ie1za.ico +0 -0
  39. package/dist/ui/_next/static/media/fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 +0 -0
  40. package/dist/ui/_next/static/media/icon.3k806k9hro987.png +0 -0
  41. package/dist/ui/_not-found/__next._full.txt +12 -12
  42. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +10 -10
  43. package/dist/ui/_not-found/__next._tree.txt +2 -2
  44. package/dist/ui/_not-found/index.html +1 -1
  45. package/dist/ui/_not-found/index.txt +12 -12
  46. package/dist/ui/compare/__next._full.txt +15 -16
  47. package/dist/ui/compare/__next._tree.txt +4 -5
  48. package/dist/ui/compare/__next.compare.__PAGE__.txt +11 -11
  49. package/dist/ui/compare/index.html +1 -1
  50. package/dist/ui/compare/index.txt +15 -16
  51. package/dist/ui/favicon.ico +0 -0
  52. package/dist/ui/history/__next._full.txt +16 -17
  53. package/dist/ui/history/__next._tree.txt +4 -5
  54. package/dist/ui/history/__next.history.__PAGE__.txt +12 -12
  55. package/dist/ui/history/index.html +1 -1
  56. package/dist/ui/history/index.txt +16 -17
  57. package/dist/ui/home/__next._full.txt +22 -0
  58. package/dist/ui/home/__next._tree.txt +5 -0
  59. package/dist/ui/home/__next.home.__PAGE__.txt +26 -0
  60. package/dist/ui/home/index.html +1 -0
  61. package/dist/ui/home/index.txt +22 -0
  62. package/dist/ui/icon.png +0 -0
  63. package/dist/ui/index.html +1 -1
  64. package/dist/ui/index.txt +15 -16
  65. package/dist/ui/preview/__next._full.txt +16 -17
  66. package/dist/ui/preview/__next._tree.txt +4 -5
  67. package/dist/ui/preview/__next.preview.__PAGE__.txt +12 -12
  68. package/dist/ui/preview/index.html +1 -1
  69. package/dist/ui/preview/index.txt +16 -17
  70. package/dist/ui/suite/__next._full.txt +15 -16
  71. package/dist/ui/suite/__next._tree.txt +4 -5
  72. package/dist/ui/suite/__next.suite.__PAGE__.txt +11 -11
  73. package/dist/ui/suite/index.html +1 -1
  74. package/dist/ui/suite/index.txt +15 -16
  75. package/dist/ui/tests/__next._full.txt +14 -15
  76. package/dist/ui/tests/__next._tree.txt +4 -5
  77. package/dist/ui/tests/__next.tests.__PAGE__.txt +10 -10
  78. package/dist/ui/tests/index.html +1 -1
  79. package/dist/ui/tests/index.txt +14 -15
  80. package/package.json +1 -1
  81. package/dist/ui/_next/static/chunks/08w_94tt7q8fk.js +0 -1
  82. package/dist/ui/_next/static/chunks/0ezgetg09gtvn.js +0 -1
  83. package/dist/ui/_next/static/chunks/1l0uy37izo74u.js +0 -22
  84. package/dist/ui/_next/static/chunks/1xkm-ij6841fr.js +0 -19
  85. package/dist/ui/_next/static/chunks/2alsmi687ind7.css +0 -3
  86. package/dist/ui/_next/static/chunks/2t9juu3lz_5u-.js +0 -59
  87. package/dist/ui/_next/static/chunks/3238j0_19x8_p.js +0 -2
  88. package/dist/ui/_next/static/chunks/3fb2986f7qg9x.js +0 -1
  89. package/dist/ui/_next/static/chunks/3nzrtm85qus90.js +0 -1
  90. package/dist/ui/_next/static/chunks/41ad2nnyaestx.js +0 -31
  91. package/dist/ui/_next/static/media/02263ebadd758ea4-s.29yke99gs9qpn.woff2 +0 -0
  92. package/dist/ui/_next/static/media/03fc1b4a8d284b5e-s.p.0wiir8udbzjvx.woff2 +0 -0
  93. package/dist/ui/_next/static/media/1bcd0e671759a44c-s.2qt3tdwt-y9x_.woff2 +0 -0
  94. package/dist/ui/_next/static/media/2fe89d53234c61d4-s.1u30mmyq6lnsd.woff2 +0 -0
  95. package/dist/ui/_next/static/media/57215795b8570f5c-s.2rixgazldzomk.woff2 +0 -0
  96. package/dist/ui/_next/static/media/59b15b4bcd7b1eb5-s.2vemzm0itqzfy.woff2 +0 -0
  97. package/dist/ui/_next/static/media/5e05ae5b48faa55e-s.1yd4_i3e35931.woff2 +0 -0
  98. package/dist/ui/_next/static/media/68757d6cddeff913-s.1i-sca43-qwng.woff2 +0 -0
  99. package/dist/ui/_next/static/media/7fea77d1d19108bf-s.2y65deuc30pmy.woff2 +0 -0
  100. package/dist/ui/_next/static/media/90c51ce8fb754fe8-s.02z5rrbg5nt92.woff2 +0 -0
  101. package/dist/ui/_next/static/media/99e609270109b47d-s.p.40sczeszzbjw1.woff2 +0 -0
  102. package/dist/ui/_next/static/media/a7afbb44bec2bb18-s.1qc6dx89jd2qv.woff2 +0 -0
  103. package/dist/ui/_next/static/media/e15f58668ad64cb8-s.3cvcemwuzoywn.woff2 +0 -0
  104. package/dist/ui/_next/static/media/e390973e931a41c5-s.0rgnxg2b64rzs.woff2 +0 -0
  105. package/dist/ui/_next/static/media/e532fa1b9921e1cd-s.3cb5lpr2l6xud.woff2 +0 -0
  106. package/dist/ui/_next/static/media/effe91970fc4db64-s.p.0oace-s_gkfks.woff2 +0 -0
  107. package/dist/ui/_next/static/media/icon.1oy4kb0w-k_2v.png +0 -0
  108. /package/dist/ui/_next/static/{9J5wOX3Ij2I3Gph37vpQ- → xVTi1MWdof3rkYYR1nxdn}/_buildManifest.js +0 -0
  109. /package/dist/ui/_next/static/{9J5wOX3Ij2I3Gph37vpQ- → xVTi1MWdof3rkYYR1nxdn}/_clientMiddlewareManifest.js +0 -0
  110. /package/dist/ui/_next/static/{9J5wOX3Ij2I3Gph37vpQ- → xVTi1MWdof3rkYYR1nxdn}/_ssgManifest.js +0 -0
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6980,e=>{"use strict";var t=e.i(14368);e.i(24856);var s=e.i(90870),a=e.i(2385),n=e.i(36163),r=e.i(78451),l=e.i(95486),i=e.i(99522);let o=(0,i.default)("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);var d=e.i(20621),c=e.i(27813);let u=(0,i.default)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),m=(0,i.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var h=e.i(3792);let p=(0,i.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"}]]);var x=e.i(71189);let f=(0,i.default)("rows-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]),b=(0,i.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"}]]);var g=e.i(50962),y=e.i(66478),v=e.i(42709),k=e.i(10281),w=e.i(87283),j=e.i(99181),N=e.i(63343),S=e.i(44794),E=e.i(31753),q=e.i(29724),R=e.i(60566),$=e.i(39170),C=e.i(13318),L=e.i(68228),O=e.i(59100);let T=(0,i.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var M=e.i(80707),A=e.i(56396);e.i(42674);var P=e.i(5305),U=e.i(6278);let F="\0new";function I(e,t){if(!t.has("baseUrl"))return"baseUrl";let s="api";try{s=new URL(e).hostname.split(".")[0].replace(/[^A-Za-z0-9]/g,"")||"api"}catch{}let a=`${s}Url`;for(let e=2;t.has(a);e++)a=`${s}Url${e}`;return a}function D({draft:e,sent:s,onChange:a}){let{environments:n,activeEnv:r,vars:l}=(0,U.useWorkspace)(),[i,o]=(0,j.useState)(!1),d=function(e){try{let t=new URL(e);if(!/^https?:$/.test(t.protocol)||["localhost","127.0.0.1"].includes(t.hostname))return[];let s=t.origin,a=t.pathname.split("/").filter(Boolean);return a.length>=2?[s,`${s}/${a[0]}`]:[s]}catch{return[]}}(e.url),c=new Set(Object.values(l).map(e=>e.trim().replace(/\/+$/,"")));return!s||!d.length||d.some(e=>c.has(e))?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>o(!0),className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-accent hover:underline",title:"Keep this server address in an environment",children:[(0,t.jsx)(T,{size:13,"aria-hidden":!0})," Save ",d[0].replace(/^https?:\/\//,"")," as a base URL"]}),i?(0,t.jsx)(_,{draft:e,addresses:d,environments:n,activeEnvId:r?.id??null,onChange:a,onClose:()=>o(!1)}):null]})}function _({draft:e,addresses:s,environments:a,activeEnvId:n,onChange:r,onClose:l}){let i=(0,A.useToast)(),{index:o,saveEnvironments:d,setActiveEnv:c,refresh:u}=(0,U.useWorkspace)(),[m,h]=(0,j.useState)(s[0]),[p,x]=(0,j.useState)(n??a[0]?.id??F),[f,b]=(0,j.useState)(()=>{try{return new URL(s[0]).hostname.split(".").slice(0,2).join(" ")}catch{return"My API"}}),g=a.find(e=>e.id===p)??null,y=(0,j.useMemo)(()=>new Set((g?.variables??[]).map(e=>e.key)),[g]),[v,k]=(0,j.useState)(()=>I(s[0],y)),[N,S]=(0,j.useState)(!0),[E,q]=(0,j.useState)(!1),R=(0,j.useRef)(null);(0,j.useEffect)(()=>R.current?.focus(),[]),(0,j.useEffect)(()=>k(I(m,y)),[m,y]);let $=(o?.requests??[]).filter(t=>t.url.startsWith(m)&&t.url!==e.url),C=g?.variables.find(e=>e.key===v),L=O.VARIABLE_NAME.test(v)&&(p!==F||f.trim());async function T(){if(L&&!E){q(!0);try{let t=p===F?globalThis.crypto?.randomUUID?.()??`env-${Date.now().toString(36)}`:p,s=structuredClone(a),n=s.find(e=>e.id===t);n||(n={id:t,name:f.trim(),variables:[]},s.push(n)),n.variables=[...n.variables.filter(e=>e.key!==v),{key:v,value:m,secret:!1}],await d(s),c(t),r((0,P.withUrl)(e,`{{${v}}}${e.url.slice(m.length)}`));let o=0,h=0;if(N){for(let e of $){let t=await U.workspaceApi.get(e.id).catch(()=>null);if(!t||t.secretsMissing?.length){h++;continue}let s=(0,P.requestFromUnknown)(t.request);s.url.startsWith(m)&&(await U.workspaceApi.update(e.id,{name:t.name,collection:t.collection,request:(0,P.withUrl)(s,`{{${v}}}${s.url.slice(m.length)}`)}),o++)}await u()}i(`Saved {{${v}}} in ${n.name}.${o?` ${o} other saved request${1===o?"":"s"} now use it.`:""}${h?` ${h} left as they were (a saved secret isn't available).`:""} Save this request to keep the change.`,"success"),l()}catch(e){i(e instanceof Error?e.message:"Could not save the base URL","error")}finally{q(!1)}}}return(0,t.jsx)("div",{className:"fixed inset-0 z-[75] flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&!E&&l(),children:(0,t.jsxs)("form",{role:"dialog","aria-modal":"true","aria-labelledby":"save-base-title",onSubmit:e=>{e.preventDefault(),T()},onKeyDown:e=>"Escape"===e.key&&!E&&l(),className:"w-full max-w-lg space-y-4 rounded-xl border border-line bg-panel p-5 shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{id:"save-base-title",className:"text-base font-medium text-ink",children:"Save as a base URL"}),(0,t.jsx)("button",{type:"button",onClick:l,"aria-label":"Close",className:"ml-auto rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(w.X,{size:16})})]}),(0,t.jsx)("p",{className:"text-sm text-mute",children:"Keep the server address in an environment, so you type only the path — and switch servers (UAT, Prod) by switching environments."}),(0,t.jsxs)("fieldset",{className:"space-y-1.5",children:[(0,t.jsx)("legend",{className:"mb-1 text-xs text-mute",children:"Address"}),s.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)("input",{type:"radio",name:"address",checked:m===e,onChange:()=>h(e)}),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e})]},e))]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Environment",(0,t.jsx)(M.Select,{label:"Environment",value:p,onChange:x,options:[...a.map(e=>({value:e.id,label:e.name,hint:`${e.variables.length} variables`})),{value:F,label:"New environment…"}],className:"rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink"})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Variable name",(0,t.jsx)("input",{ref:R,value:v,onChange:e=>k(e.target.value.replace(/[^\w.-]/g,"")),className:"input py-1.5 font-mono text-sm"})]}),p===F?(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute sm:col-span-2",children:["New environment name",(0,t.jsx)("input",{value:f,onChange:e=>b(e.target.value),className:"input py-1.5 text-sm"})]}):null]}),C&&C.value!==m?(0,t.jsxs)("p",{className:"text-xs text-warn",children:[`{{${v}}}`," already exists in this environment (",C.value,") — it will be replaced."]}):null,(0,t.jsxs)("p",{className:"rounded-md bg-panel-2 px-3 py-2 font-mono text-xs text-ink break-all",children:[`{{${v}}}`,(0,t.jsx)("span",{className:"text-mute",children:e.url.slice(m.length)||"/"})]}),$.length?(0,t.jsxs)("label",{className:"flex items-start gap-2 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:N,onChange:e=>S(e.target.checked),className:"mt-1"}),(0,t.jsxs)("span",{children:["Also switch ",$.length," other saved request",1===$.length?"":"s"," that use this address",(0,t.jsxs)("span",{className:"block text-xs text-mute",children:[$.slice(0,3).map(e=>e.name).join(", "),$.length>3?` and ${$.length-3} more`:""]})]})]}):null,(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:l,disabled:E,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:!L||E,children:"Save base URL"})]})]})})}var z=e.i(65638),V=e.i(37837);function J(e,t){let s=(0,j.useRef)(!0);(0,j.useEffect)(()=>{if(s.current){s.current=!1;return}let t=e.current;!t||function(){try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()||"function"!=typeof t.animate||t.animate([{opacity:.35,transform:"translateY(3px)"},{opacity:1,transform:"none"}],{duration:180,easing:"cubic-bezier(0.2, 0, 0, 1)"})},[e,t])}var K=e.i(97716);let H=(e,t)=>"number"==typeof t?`${e}[${t}]`:/^[A-Za-z_$][\w$]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`;var B=e.i(91694),W=e.i(96659);function Q({requestId:e,refreshKey:s,onOpen:a}){let n=(0,j.useRef)(null),[r,l]=(0,j.useState)(!1),[i,o]=(0,j.useState)([]),d=()=>void fetch(`/engine/responses/${e}`,{cache:"no-store"}).then(e=>e.ok?e.json():{answers:[]}).then(e=>o(e.answers)).catch(()=>void 0);return((0,j.useEffect)(d,[e,s]),i.length<2)?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{ref:n,type:"button",onClick:()=>l(e=>!e),"aria-expanded":r,title:"Earlier answers of this request — open one, or see what changed",className:"inline-flex items-center gap-1 rounded-md border border-line px-2 py-0.5 text-xs text-mute hover:border-accent hover:text-ink",children:[(0,t.jsx)(B.History,{size:12,"aria-hidden":!0})," Earlier · ",i.length-1]}),(0,t.jsx)(V.Popover,{anchor:n,open:r,onClose:()=>l(!1),label:"Earlier answers",width:340,children:(0,t.jsxs)("div",{className:"max-h-80 overflow-auto p-1",children:[(0,t.jsxs)("p",{className:"px-2 py-1.5 text-xs text-mute",children:["The last ",i.length," answers of this request, newest first."]}),(0,t.jsx)("ul",{children:i.map((s,n)=>{let r;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:async()=>{let t=await fetch(`/engine/responses/${e}/${n}`,{cache:"no-store"});t.ok&&a(await t.json(),n),l(!1)},className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-panel-2",children:[(0,t.jsx)("span",{className:`rounded border px-1.5 font-mono ${(0,R.statusTone)(s.status)}`,children:s.status||"ERR"}),(0,t.jsx)("span",{className:"text-ink",children:0===n?"Latest":(r=new Date(s.at),new Date().toDateString()===r.toDateString()?r.toLocaleTimeString():r.toLocaleString())}),(0,t.jsxs)("span",{className:"ml-auto font-mono text-mute",children:[Math.round(s.durationMs)," ms"]}),s.checks?(0,t.jsxs)("span",{className:s.passed===s.checks?"text-ok":"text-bad",children:[s.passed,"/",s.checks]}):null]})},s.at)})}),(0,t.jsxs)("button",{type:"button",onClick:async()=>{await fetch(`/engine/responses/${e}`,{method:"DELETE"}),l(!1),d()},className:"mt-1 flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs text-mute hover:bg-panel-2 hover:text-bad",children:[(0,t.jsx)(W.Trash2,{size:12,"aria-hidden":!0})," Forget these answers"]})]})})]})}function Y(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}let Z=e=>{let t="string"==typeof e?JSON.stringify(e):JSON.stringify(e)??"undefined";return t.length>80?`${t.slice(0,79)}…`:t};function G({earlier:e,latest:s}){let a=(0,j.useMemo)(()=>(function(e,t,s=200){let a,n;try{a=JSON.parse(e),n=JSON.parse(t)}catch{return null}let r=[],l=(e,t,a,n)=>{if(r.length>=s)return;let i=null!==t&&"object"==typeof t;if(null!==e&&"object"==typeof e&&i&&Array.isArray(e)===Array.isArray(t)&&n<40){if(Array.isArray(e)&&Array.isArray(t)){for(let i=0;i<Math.max(e.length,t.length)&&(i>=e.length?r.push({path:H(a,i),kind:"added",after:t[i]}):i>=t.length?r.push({path:H(a,i),kind:"removed",before:e[i]}):l(e[i],t[i],H(a,i),n+1),!(r.length>=s));i++);return}for(let i of new Set([...Object.keys(e),...Object.keys(t)]))if(i in t?i in e?l(e[i],t[i],H(a,i),n+1):r.push({path:H(a,i),kind:"added",after:t[i]}):r.push({path:H(a,i),kind:"removed",before:e[i]}),r.length>=s)break;return}JSON.stringify(e)!==JSON.stringify(t)&&r.push({path:a,kind:"changed",before:e,after:t})};return l(a,n,"$",0),r})(e.body,s.body),[e.body,s.body]),n=(0,j.useMemo)(()=>(function(e,t,s=3e3){let a=e.split("\n"),n=t.split("\n"),r=a.length>s||n.length>s;a=a.slice(0,s),n=n.slice(0,s);let l=0;for(;l<a.length&&l<n.length&&a[l]===n[l];)l++;let i=a.length,o=n.length;for(;i>l&&o>l&&a[i-1]===n[o-1];)i--,o--;let d=a.slice(l,i),c=n.slice(l,o),u=a.slice(0,l).map(e=>({kind:"same",text:e}));if(d.length*c.length>4e6)u.push(...d.map(e=>({kind:"removed",text:e})),...c.map(e=>({kind:"added",text:e})));else{let e=c.length+1,t=new Uint32Array((d.length+1)*e);for(let s=d.length-1;s>=0;s--)for(let a=c.length-1;a>=0;a--)t[s*e+a]=d[s]===c[a]?t[(s+1)*e+a+1]+1:Math.max(t[(s+1)*e+a],t[s*e+a+1]);let s=0,a=0;for(;s<d.length&&a<c.length;)d[s]===c[a]?(u.push({kind:"same",text:d[s]}),s++,a++):t[(s+1)*e+a]>=t[s*e+a+1]?u.push({kind:"removed",text:d[s++]}):u.push({kind:"added",text:c[a++]});for(;s<d.length;)u.push({kind:"removed",text:d[s++]});for(;a<c.length;)u.push({kind:"added",text:c[a++]})}return u.push(...a.slice(i).map(e=>({kind:"same",text:e}))),{lines:u,cut:r}})(Y(e.body),Y(s.body)),[e.body,s.body]),r=n.lines.filter(e=>"same"!==e.kind).length;return(0,t.jsxs)("div",{className:"space-y-3 overflow-auto",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-mute",children:[(0,t.jsxs)("span",{children:["Status ",(0,t.jsx)("span",{className:"font-mono text-ink",children:e.status})," → ",(0,t.jsx)("span",{className:"font-mono text-ink",children:s.status}),e.status===s.status?" (same)":""]}),(0,t.jsxs)("span",{children:["Time ",(0,t.jsxs)("span",{className:"font-mono text-ink",children:[Math.round(e.durationMs)," ms"]})," → ",(0,t.jsxs)("span",{className:"font-mono text-ink",children:[Math.round(s.durationMs)," ms"]})]}),(0,t.jsx)("span",{children:r?`${r} line${1===r?"":"s"} differ`:"The body is the same"})]}),e.masked?(0,t.jsx)("p",{className:"text-xs text-mute",children:"Values that look like secrets were hidden when the earlier answer was kept, so they show as changed."}):null,a&&a.length?(0,t.jsxs)("section",{"aria-label":"Changed fields",children:[(0,t.jsxs)("h3",{className:"mb-1 text-xs font-medium text-mute",children:[a.length," field",1===a.length?"":"s"," changed",a.length>=200?" (the first 200)":""]}),(0,t.jsx)("ul",{className:"max-h-56 space-y-0.5 overflow-auto rounded-md border border-line bg-panel-2 p-2 font-mono text-xs",children:a.map((e,s)=>(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"text-ink",children:e.path})," ","changed"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-bad line-through decoration-bad/60",children:Z(e.before)})," → ",(0,t.jsx)("span",{className:"text-ok",children:Z(e.after)})]}):"added"===e.kind?(0,t.jsxs)("span",{className:"text-ok",children:["added ",Z(e.after)]}):(0,t.jsxs)("span",{className:"text-bad",children:["removed (was ",Z(e.before),")"]})]},s))})]}):null,(0,t.jsxs)("section",{"aria-label":"Line by line",children:[(0,t.jsxs)("h3",{className:"mb-1 text-xs font-medium text-mute",children:["Line by line",n.cut?" (the first 3,000 lines)":""]}),(0,t.jsx)("pre",{className:"max-h-[28rem] overflow-auto rounded-md border border-line bg-panel-2 py-2 font-mono text-[12.5px] leading-5",children:n.lines.map((e,s)=>(0,t.jsxs)("div",{className:"added"===e.kind?"bg-ok/10 text-ok":"removed"===e.kind?"bg-bad/10 text-bad":"text-ink",children:[(0,t.jsx)("span",{className:"inline-block w-5 select-none text-center text-mute",children:"added"===e.kind?"+":"removed"===e.kind?"−":" "}),e.text]},s))})]})]})}var X=e.i(21206),ee=e.i(20054);let et="apitestcenter-lab-draft";var es=e.i(59180),ea=e.i(88153),en=e.i(2603),er=e.i(14865),el=e.i(46679),ei=e.i(65238),eo=e.i(727),ed=e.i(45672),ec=e.i(69578),eu=e.i(48181),em=e.i(25120),eh=e.i(97942);let ep=(0,em.projectKey)("apitestcenter-lab-saved"),ex="apitestcenter-requests-panel",ef=(0,em.projectKey)("apitestcenter-lab-tabs"),eb=()=>Math.random().toString(36).slice(2,10),eg=JSON.stringify((0,P.defaultRequestDraft)()),ey=()=>({key:eb(),draft:(0,P.defaultRequestDraft)(),saved:null,result:null,liveId:null,liveOpen:!1}),ev=e=>e.saved?.name??(e.draft.url.trim()?(0,P.autoRunName)(e.draft).replace(/ · \d.*$/,"").replace(/^[A-Z]+ /,""):"New request"),ek=e=>e.saved?JSON.stringify(e.draft)!==e.saved.snapshot:JSON.stringify(e.draft)!==eg,ew={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"},ej=(0,em.projectKey)("apitestcenter-last-run");function eN(e){try{sessionStorage.setItem(ej,e)}catch{}}function eS(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-accent opacity-60"}),(0,t.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-accent"})]}),"Load running"]})}function eE({title:e,lines:s,action:a}){return(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center rounded-lg border border-dashed border-line px-6 py-14 text-center",children:[(0,t.jsx)("h2",{className:"text-base font-medium text-ink",children:e}),(0,t.jsx)("div",{className:"mt-2 max-w-md space-y-1.5 text-sm text-mute",children:s.map((e,s)=>(0,t.jsx)("p",{children:e},s))}),a?(0,t.jsx)("div",{className:"mt-5",children:a}):null]})}function eq({runs:e,current:s,disabled:n,onPick:r}){let{slo:i}=(0,ea.useSlo)(),[o,d]=(0,j.useState)(!1),c=(0,j.useRef)(null),u=(0,j.useMemo)(()=>e.slice(0,30),[e]);return(0,j.useEffect)(()=>{if(!o)return;let e=e=>{c.current?.contains(e.target)||d(!1)},t=e=>"Escape"===e.key&&d(!1);return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[o]),(0,t.jsxs)("div",{ref:c,className:"relative",children:[(0,t.jsxs)("button",{type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":o,onClick:()=>d(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:["Recent runs",(0,t.jsx)(l.ChevronDown,{size:12})]}),o?(0,t.jsx)("ul",{role:"listbox","aria-label":"Recent runs",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:u.map(e=>{let n=(0,a.buildVerdictFromInputs)(e.verdict,{slo:i}).overall,l=s?.id===e.id;return(0,t.jsx)("li",{role:"option","aria-selected":l,children:(0,t.jsxs)("button",{type:"button",onClick:()=>{r(e),d(!1)},className:`flex w-full items-center justify-between gap-2 rounded px-2 py-1.5 text-left text-xs ${l?"bg-accent-dim text-ink":"text-ink hover:bg-panel-2"}`,children:[(0,t.jsxs)("span",{className:"min-w-0 truncate",children:[e.baseline?(0,t.jsx)("span",{className:"mr-1 text-accent",title:"Baseline",children:"◆"}):null,e.name]}),(0,t.jsx)(eR,{level:n})]})},e.id)})}):null]})}function eR({level:e}){let s="pass"===e?"text-ok":"fail"===e?"text-bad":"text-warn";return(0,t.jsxs)("span",{className:`shrink-0 font-mono text-xs uppercase ${s}`,children:[(0,t.jsxs)("span",{"aria-hidden":!0,children:["pass"===e?"✓":"fail"===e?"✕":"!"," "]}),e]})}function e$(){let{slo:e,setSlo:s,ready:a}=(0,ea.useSlo)(),[n,r]=(0,j.useState)(!1),[l,i]=(0,j.useState)(500),[o,d]=(0,j.useState)(0),[c,u]=(0,j.useState)(1),[m,h]=(0,j.useState)(99),[p,x]=(0,j.useState)(!1),f=(0,j.useRef)(!1);function b(e){let t={on:n,p95:l,p99:o,errPct:c,checksPct:m,abort:p,...e};if(r(t.on),i(t.p95),d(t.p99),u(t.errPct),h(t.checksPct),x(t.abort),!t.on||!(t.p95>0)||t.errPct<0)return s(null);s({p95Ms:t.p95,errorRate:t.errPct/100,p99Ms:t.p99>0?t.p99:void 0,checksRate:Math.min(100,Math.max(0,t.checksPct))/100,abortOnFail:t.abort})}(0,j.useEffect)(()=>{a&&!f.current&&(f.current=!0,e&&(r(!0),i(e.p95Ms),d(e.p99Ms??0),u(Number((100*e.errorRate).toFixed(4))),h(null!=e.checksRate?Number((100*e.checksRate).toFixed(2)):99),x(!0===e.abortOnFail)))},[a,e]);let g=(e,s,a,n)=>(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:e}),(0,t.jsx)("input",{type:"number",min:n.min,max:n.max,step:n.step,value:s,onChange:e=>b({[a]:Number(e.target.value)}),className:"input font-mono"}),n.hint?(0,t.jsx)("span",{className:"mt-1 block text-xs text-mute",children:n.hint}):null]});return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-mute",children:"Targets decide whether a load test passes. They are sent to k6 as thresholds, drive the verdict and the report colours, and are remembered on this computer."}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:n,onChange:e=>b({on:e.target.checked}),className:"accent-[var(--accent)]"}),"Use my own performance targets"]}),n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[g("p95 must stay under (ms)",l,"p95",{min:1}),g("p99 must stay under (ms)",o,"p99",{min:0,hint:"0 = no p99 target"}),g("Error rate must stay under (%)",c,"errPct",{min:0,max:100,step:.1}),g("Checks must pass at least (%)",m,"checksPct",{min:0,max:100,step:.1,hint:"Only used when the request has checks"})]}),(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-line px-3 py-2.5 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:p,onChange:e=>b({abort:e.target.checked}),className:"mt-0.5 accent-[var(--accent)]"}),(0,t.jsxs)("span",{children:["Stop the test early if a target is clearly missed",(0,t.jsx)("span",{className:"block text-xs text-mute",children:"After a 10-second warm-up, k6 ends the run as soon as a target fails — saves time and stops hammering a struggling API."})]})]})]}):(0,t.jsx)("p",{className:"rounded-md bg-panel-2 px-3 py-2 text-sm text-mute",children:"Using built-in defaults: warn at p95 ≥ 500 ms or errors ≥ 1%, fail at p95 ≥ 2 s or errors ≥ 5%. No thresholds are sent to k6."})]})}function eC({dirty:e,isSaved:s,title:a,onSave:n,onSaveAs:r,onHistory:i}){let[o,d]=(0,j.useState)(!1),c=(0,j.useRef)(null);return(0,t.jsxs)("div",{className:"inline-flex",children:[(0,t.jsxs)("button",{type:"button",onClick:n,disabled:s&&!e,title:a,className:"btn btn-secondary rounded-r-none border-r-0",children:[(0,t.jsx)(b,{size:16,"aria-hidden":!0}),"Save",e?(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-accent","aria-label":"unsaved changes"}):null]}),(0,t.jsx)("button",{ref:c,type:"button",onClick:()=>d(e=>!e),"aria-label":"More ways to save","aria-haspopup":"menu","aria-expanded":o,className:"btn btn-secondary rounded-l-none px-2",children:(0,t.jsx)(l.ChevronDown,{size:14,"aria-hidden":!0})}),(0,t.jsx)(V.Popover,{anchor:c,open:o,onClose:()=>d(!1),label:"More ways to save",width:220,role:"menu",children:(0,t.jsxs)("div",{className:"p-1",children:[(0,t.jsx)("button",{type:"button",role:"menuitem",onClick:()=>{d(!1),r()},className:"block w-full rounded px-2.5 py-1.5 text-left text-sm text-ink hover:bg-panel-2",children:s?"Save as a new request…":"Save to a folder…"}),i?(0,t.jsx)("button",{type:"button",role:"menuitem",onClick:()=>{d(!1),i()},className:"block w-full rounded px-2.5 py-1.5 text-left text-sm text-ink hover:bg-panel-2",children:"Version history…"}):null]})})]})}e.s(["LabPage",0,function(){var e;let l=(0,A.useToast)(),i=(0,$.useConfirm)(),b=(0,ee.useEngineHealth)(),O=(0,en.useModKey)(),{slo:T}=(0,ea.useSlo)(),{vars:M,activeEnv:F,refresh:I,rememberValues:_}=(0,U.useWorkspace)(),[V,H]=(0,j.useState)(null),[B,W]=(0,j.useState)(!1),[Y,Z]=(0,j.useState)(!0),em=(0,j.useRef)(null),[eR,eL]=(0,j.useState)(P.defaultRequestDraft),[eO,eT]=(0,j.useState)(P.DEFAULT_LOAD),[eM,eA]=(0,j.useState)(!1),[eP,eU]=(0,j.useState)(null),[eF,eI]=(0,j.useState)(null),[eD,e_]=(0,j.useState)(!1),[ez,eV]=(0,j.useState)(null),[eJ,eK]=(0,j.useState)(!1),eH=(0,j.useRef)(null),eB=(0,j.useRef)(null);J(eH,V?.id),J(eB,eP);let[eW,eQ]=(0,j.useState)(!1),[eY,eZ]=(0,j.useState)(!1),[eG,eX]=(0,j.useState)(!1),[e0,e1]=(0,j.useState)(null),[e2,e5]=(0,j.useState)(null),{index:e6,refresh:e3}=(0,es.useHistory)(),e4=e6?.runs??[],[e9,e7]=(0,j.useState)("response"),[e8,te]=(0,j.useState)(!1),{layout:tt,setLayout:ts}=(0,er.useViewPrefs)(),ta="below"===tt,[tn,tr]=(0,j.useState)([]),[tl,ti]=(0,j.useState)(""),to=e2?.status==="running"||e2?.status==="queued",td=(0,P.isReady)(eR),tc=(0,P.loadProblem)(eO),tu=eW||eY;(0,j.useEffect)(()=>{let e=null;try{e=sessionStorage.getItem(ej)}catch{}e&&(0,X.fetchRun)(e).then(async t=>{if(t)return e5(t);let s=await es.historyApi.run(e).catch(()=>null);s&&e5({id:s.report.id,status:s.report.status,report:s.report})});let t=function(){try{let e=sessionStorage.getItem(et);if(!e)return null;let t=JSON.parse(e);if(2===t.v)return{request:(0,P.requestFromUnknown)(t.request),load:(0,P.loadFromUnknown)(t.load)};return{request:(0,P.requestFromUnknown)(t),load:(0,P.loadFromUnknown)(t)}}catch{return null}}();t&&eT(t.load);let s=[],a="";try{let e=JSON.parse(localStorage.getItem(ef)??"null");s=(e?.tabs??[]).map(e=>({key:e.key||eb(),draft:(0,P.requestFromUnknown)(e.draft),saved:e.saved??null,result:null,liveId:null,liveOpen:!1})),a=e?.active??"",Z("closed"!==localStorage.getItem(ex))}catch{}if(!s.length){let e=null;try{e=JSON.parse(sessionStorage.getItem(ep)??"null")}catch{}s=[{...ey(),draft:t?.request??(0,P.defaultRequestDraft)(),saved:e}]}let n=s.find(e=>e.key===a)??s[0];tr(s),ti(n.key),eL(n.draft),H(n.saved),eA(!0)},[]),(0,j.useEffect)(()=>{if(!eM)return;let e=window.setTimeout(()=>{try{sessionStorage.setItem(et,JSON.stringify({v:2,request:eR,load:eO}))}catch{}try{let e=tn.map(e=>e.key===tl?{key:e.key,draft:eR,saved:V}:{key:e.key,draft:e.draft,saved:e.saved});localStorage.setItem(ef,JSON.stringify({tabs:e,active:tl}))}catch{}},250);return()=>window.clearTimeout(e)},[eR,eO,eM,tn,tl,V]),(0,j.useEffect)(()=>{if(!e2||!to)return;let e=!1,t=window.setInterval(async()=>{let t=await (0,X.fetchRun)(e2.id);if(t&&!e&&(e5(t),(0,X.isTerminalStatus)(t.status))){e3();let e="completed"===t.status?"finished":t.status;l(`Load test ${e}`,"failed"===t.status?"error":"success");let s=(0,a.buildVerdict)(t.report,{slo:T});(0,eo.notifyFinished)({title:`Load test ${e}`,body:`${t.report.testName}
2
+ ${"completed"===t.status?s.headline:t.error??"See the report for details."}`,ok:"completed"===t.status&&"fail"!==s.overall})}},500);return()=>{e=!0,window.clearInterval(t)}},[e2?.id,to]);let tm=!!V&&JSON.stringify(eR)!==V.snapshot;function th(e){H(e);try{e?sessionStorage.setItem(ep,JSON.stringify(e)):sessionStorage.removeItem(ep)}catch{}}function tp(e){Z(e);try{localStorage.setItem(ex,e?"open":"closed")}catch{}}async function tx(e){try{let t={name:e?.name??V.name,collection:e?.collection??V.collection,request:eR},s=V&&!e?await U.workspaceApi.update(V.id,t):await U.workspaceApi.create(t);th({id:s.id,name:s.name,collection:s.collection,snapshot:JSON.stringify(eR)}),W(!1),await I(),l(`Saved “${s.name}”${s.collection?` in ${s.collection}`:""}`,"success")}catch(e){l(e instanceof Error?e.message:"Could not save the request","error")}}let tf=()=>({key:tl,draft:eR,saved:V,result:eP,liveId:eF,liveOpen:eD});function tb(e){ti(e.key),eL(e.draft),th(e.saved),eU(e.result),eI(e.liveId),e_(e.liveOpen),eV(null),eK(!1),eX(!1),e1(null),W(!1),e7("response")}function tg(e){if(e===tl)return;let t=tn.find(t=>t.key===e);t&&(tr(e=>e.map(e=>e.key===tl?tf():e)),tb(t))}function ty(e,t){let s=!V&&!eP&&!eF&&JSON.stringify(eR)===eg,a={key:s?tl:eb(),draft:e,saved:t,result:null,liveId:null,liveOpen:!1};tr(e=>{if(s)return e.map(e=>e.key===tl?a:e);let t=e.map(e=>e.key===tl?tf():e),n=t.findIndex(e=>e.key===tl);return[...t.slice(0,n+1),a,...t.slice(n+1)]}),tb(a)}async function tv(e){let t=e===tl?tf():tn.find(t=>t.key===e);if(!t||ek(t)&&!await i({title:`Close “${ev(t)}” without saving?`,body:"Its changes have not been saved.",confirmLabel:"Close",tone:"danger"}))return;t.liveId&&K.realtimeApi.close(t.liveId);let s=tn.findIndex(t=>t.key===e),a=tn.filter(t=>t.key!==e);if(e!==tl)return tr(a);let n=a[Math.min(s,a.length-1)]??ey();tr(a.length?a:[n]),tb(n)}let[tk,tw]=(0,j.useState)(!1);async function tj(){try{let e=await U.workspaceApi.index(),t=t=>e.requests.find(e=>"Practice"===e.collection&&e.name===t),s=t("Sign in")?.id??(await U.workspaceApi.create({name:"Sign in",collection:"Practice",request:{...(0,P.withUrl)({...(0,P.defaultRequestDraft)(),method:"POST"},"{{practiceApi}}/login"),bodyMode:"json",bodyText:'{\n "username": "you",\n "password": "demo"\n}',checks:[{type:"status",expect:"200"}]}})).id,a=t("My orders"),n=a?await U.workspaceApi.get(a.id):await U.workspaceApi.create({name:"My orders",collection:"Practice",request:{...(0,P.withUrl)((0,P.defaultRequestDraft)(),"{{practiceApi}}/orders"),authMode:"bearer",token:"{{token}}",checks:[{type:"status",expect:"200"}],before:{requestId:s,requestName:"Sign in",extract:[{name:"token",from:"json",path:"data.token"}]}}});await I(),tp(!0),await tN(n),l("Added Practice → Sign in and My orders. Press Send: it signs in first, then uses the token.","success")}catch(e){l(e instanceof Error?e.message:"Could not add the practice requests","error")}}function tN(e){if(V?.id===e.id)return;let t=tn.find(t=>t.key!==tl&&t.saved?.id===e.id);if(t)return tg(t.key);let s=(0,P.requestFromUnknown)(e.request);ty(s,{id:e.id,name:e.name,collection:e.collection,snapshot:JSON.stringify(s)})}(0,j.useEffect)(()=>{let e=()=>tw(!(0,ed.welcomeHidden)());return e(),window.addEventListener(ed.WELCOME_EVENT,e),()=>window.removeEventListener(ed.WELCOME_EVENT,e)},[]);let tS=(0,j.useRef)(()=>{});tS.current=e=>{let t=(0,P.requestFromUnknown)(e.request),s={id:e.id,name:e.name,collection:e.collection,snapshot:JSON.stringify(t)};V?.id===e.id?(eL(t),th(s)):tr(a=>a.map(a=>a.saved?.id===e.id?{...a,draft:t,saved:s}:a))},(0,j.useEffect)(()=>{let e=e=>tS.current(e.detail);return window.addEventListener(eh.REQUEST_REPLACED_EVENT,e),()=>window.removeEventListener(eh.REQUEST_REPLACED_EVENT,e)},[]);let tE=(0,j.useRef)(tN);function tq(){ty((0,P.defaultRequestDraft)(),null),window.setTimeout(()=>em.current?.focus(),0)}async function tR(){try{e1(null);let e=await (0,ei.withFolders)(eR,V?.collection,M),t=(0,P.resolveDraft)(e.draft,e.vars,F?.name),s=/^wss?:\/\//i.test(t.url),a=s?(0,P.withUrl)(t,t.url.replace(/^ws/i,"http")):t,n=(0,P.buildPayload)(a,(0,P.toLoadConfig)(eO),(0,P.autoRunName)(a,V?.name),(0,P.targetsFromSlo)(T));return s&&(n.request={...n.request,url:n.request.url.replace(/^http/i,"ws")}),await (0,el.withRunFirst)(n,t,M,F?.name)}catch(e){return e1(e instanceof Error?e.message:"Request is not valid"),null}}async function t$(){try{let e={...eR,method:"POST",bodyMode:"graphql",graphqlQuery:s.INTROSPECTION_QUERY,graphqlVariables:"",graphqlOperation:"IntrospectionQuery",graphqlErrorsFail:!1,checks:[],saveValues:[],testData:null},t=await (0,ei.withFolders)(e,V?.collection,M),a=(0,P.resolveDraft)(t.draft,t.vars,F?.name),{request:n,auth:r,options:l,setup:i}=await (0,el.withRunFirst)((0,P.buildPayload)(a,(0,P.toLoadConfig)(eO),"schema"),a,M,F?.name),o=await fetch("/engine/graphql/introspect",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({request:n,auth:r,options:l,setup:i})}),d=await o.json();return o.ok?d:{status:0,body:"",error:d.error??`Engine error (${o.status})`}}catch(e){return{status:0,body:"",error:e instanceof Error?e.message:String(e)}}}async function tC(){if(tu||!td)return;let e=await tR();if(e){if(/^wss?:\/\//i.test(e.request.url)){if(eF&&eD)return void await K.realtimeApi.close(eF);eQ(!0),e7("response");try{eF&&K.realtimeApi.close(eF);let{id:t}=await K.realtimeApi.connect({request:e.request,auth:e.auth,options:e.options});eU(null),eI(t),e_(!0)}catch(e){e1(e instanceof Error?e.message:"Could not connect")}finally{eQ(!1)}return}if("production"===(0,eu.envKind)(F?.name)&&!(0,eu.isReadOnlyMethod)(e.request.method)&&!await i({title:`Send ${e.request.method} to ${F.name}?`,body:(0,t.jsxs)(t.Fragment,{children:["This request can change real data on ",(0,X.hostOf)(e.request.url),"."]}),confirmLabel:`Send to ${F.name}`,tone:"danger"}))return;eQ(!0),eX(!1),e7("response");try{eI(null);let t=await (0,X.sendRequest)(e,V?.id);eV(null),eK(!1),eU(t);let s=(t.saved??[]).flatMap(e=>e.found&&void 0!==e.value?[{name:e.name,value:e.value}]:[]);_(s,V?.name??"the last Send")}finally{eQ(!1)}}}async function tL(e=!1){if(tu||to||!td||!b.k6Ready)return;if(tc)return void e1(tc);let s=await tR();if(s){if(eX(!1),!e){eZ(!0);try{let e=await (0,X.sendRequest)(s);if(eU(e),!(0,X.isSuccess)(e)){eX(!0),e7("response");return}}finally{eZ(!1)}}if("production"===(0,eu.envKind)(F?.name)){if(!await i({title:`Load test ${F.name}?`,body:(0,t.jsxs)(t.Fragment,{children:["A load test sends many requests at once to ",(0,X.hostOf)(s.request.url),". Real users of that system may notice."]}),confirmLabel:"Start load test",tone:"danger"}))return}else if((0,X.needsLoadConfirm)(eO.preset,s.load,s.request.url)&&!await i({title:`Start a ${(0,N.profileSummary)(eO)} load test against ${(0,X.hostOf)(s.request.url)}?`,body:(0,t.jsxs)(t.Fragment,{children:["This is a ",(0,t.jsx)("span",{className:"text-ink",children:eO.preset})," profile against a non-local host (",(0,N.profileSummary)(eO),"). 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 load test",tone:"danger"}))return;try{let e=await (0,X.startLoadRun)(s);eN(e.id),e5(e),e7("report")}catch(e){l(e instanceof Error?e.message:"Failed to start load","error")}}}async function tO(){if(!e2)return;let e=await (0,X.stopLoadRun)(e2.id);e?e5(e):l("Could not reach the engine to stop the run","error")}tE.current=tN,(0,j.useEffect)(()=>{let e=()=>{let e=null;try{e=sessionStorage.getItem(ec.OPEN_REQUEST_KEY),sessionStorage.removeItem(ec.OPEN_REQUEST_KEY)}catch{}e&&U.workspaceApi.get(e).then(e=>tE.current(e)).catch(()=>l("That saved request is gone","error"))};return eM&&e(),window.addEventListener(ec.OPEN_REQUEST_EVENT,e),()=>window.removeEventListener(ec.OPEN_REQUEST_EVENT,e)},[eM]),(0,en.useShortcuts)({send:()=>void tC(),run:()=>void tL(),focusUrl:()=>em.current?.focus(),save:()=>V?void tx():W(!0),toggleSaved:()=>tp(!Y)});let tT=/^wss?:\/\//i.test((0,r.substitute)(eR.url,M).text),tM=tT?"Load tests of WebSockets aren't available yet — Connect to try it":b.k6Ready?td?tc??void 0:"Enter a URL first":b.k6Label,tA=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button","data-tour":"send",onClick:()=>void tC(),disabled:tu||!td,title:tT?eD?"Close the connection":`Open the WebSocket (${O}+Enter)`:`Send one request (${O}+Enter)`,className:tT&&eD?"btn btn-secondary":"btn btn-primary",children:[eW?(0,t.jsx)(c.Loader2,{size:16,className:"animate-spin"}):tT?eD?(0,t.jsx)(k.Unplug,{size:16}):(0,t.jsx)(p,{size:16}):(0,t.jsx)(g.Send,{size:16}),tT?eD?"Disconnect":"Connect":"Send"]}),to?(0,t.jsxs)("button",{type:"button",onClick:()=>void tO(),disabled:e2?.stopping,className:"btn btn-danger",children:[e2?.stopping?(0,t.jsx)(c.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(y.Square,{size:16}),e2?.stopping?"Stopping…":"Stop"]}):(0,t.jsxs)("button",{type:"button","data-tour":"run",onClick:()=>void tL(),disabled:tu||!!tM,title:tM??`Check the request, then run the load profile (${O}+Shift+Enter)`,className:"btn btn-secondary",children:[eY?(0,t.jsx)(c.Loader2,{size:16,className:"animate-spin"}):(0,t.jsx)(h.Play,{size:16}),eY?"Checking…":"Run load test"]}),(0,t.jsx)(eC,{dirty:V?tm:JSON.stringify(eR)!==eg,isSaved:!!V,onHistory:V?()=>(0,eh.openVersions)(V.id):void 0,title:`Save request (${O}+S)`,onSave:()=>V?void tx():W(!0),onSaveAs:()=>W(!0)})]}),tP=tn.map(e=>e.key===tl?tf():e),tU="production"===(0,eu.envKind)(F?.name);return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[tP.length?(0,t.jsxs)("div",{className:"flex shrink-0 items-stretch border-b border-line bg-canvas",children:[(0,t.jsx)("button",{type:"button",onClick:()=>tp(!Y),"aria-label":Y?`Hide saved requests (${O}+B)`:`Show saved requests (${O}+B)`,"aria-pressed":Y,title:Y?`Hide saved requests (${O}+B)`:`Show saved requests (${O}+B)`,className:`hidden shrink-0 items-center border-r border-line px-3 hover:bg-panel/60 hover:text-ink lg:flex ${Y?"text-ink":"text-mute"}`,children:(0,t.jsx)(d.FolderOpen,{size:15,"aria-hidden":!0})}),(0,t.jsx)("div",{role:"tablist","aria-label":"Open requests",className:"flex min-w-0 items-stretch overflow-x-auto",children:tP.map(e=>{let s=e.key===tl,a=ev(e);return(0,t.jsxs)("div",{onMouseDown:t=>{1===t.button&&(t.preventDefault(),tv(e.key))},className:`flex max-w-60 min-w-0 shrink-0 items-center border-r border-line ${s?"bg-panel shadow-[inset_0_2px_0_var(--accent)]":"hover:bg-panel/60"}`,children:[(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":s,onClick:()=>tg(e.key),title:e.saved?.collection?`${e.saved.collection} / ${a}`:a,className:"tab-btn flex min-w-0 items-center gap-2 py-2 pr-1 pl-3 text-sm",children:[(0,t.jsx)("span",{className:`font-mono text-[11px] font-semibold ${ew[e.draft.method]??"text-mute"}`,children:"DELETE"===e.draft.method?"DEL":e.draft.method}),(0,t.jsx)("span",{className:`truncate ${s?"text-ink":"text-mute"}`,children:a})]}),e.saved&&ek(e)?(0,t.jsx)("span",{title:"Not saved","aria-label":"not saved",className:"h-1.5 w-1.5 shrink-0 rounded-full bg-accent"}):null,(0,t.jsx)("button",{type:"button",onClick:()=>void tv(e.key),"aria-label":`Close ${a}`,title:"Close (middle click)",className:"mx-1 shrink-0 rounded p-1 text-mute hover:bg-panel-2 hover:text-ink",children:(0,t.jsx)(w.X,{size:13,"aria-hidden":!0})})]},e.key)})}),(0,t.jsx)("button",{type:"button",onClick:()=>tq(),"aria-label":"New request tab",title:"New request",className:"shrink-0 px-3 text-mute hover:bg-panel/60 hover:text-ink",children:(0,t.jsx)(x.Plus,{size:15,"aria-hidden":!0})}),(0,t.jsx)("div",{className:"ml-auto flex shrink-0 items-center px-2",children:(0,t.jsx)(L.EnvironmentBar,{compact:!0,drafts:[eR],collections:[V?.collection]})})]}):null,(0,t.jsxs)("header",{className:"border-b border-line bg-panel px-4 py-3 lg:px-6",children:[(0,t.jsx)("h1",{className:"sr-only",children:"Test an API"}),(0,t.jsx)(S.RequestBar,{ref:em,draft:eR,onChange:e=>{eL(e),e1(null)},onImported:e=>l(e,"success"),actions:tA}),tU?(0,t.jsxs)("p",{role:"note",className:"mt-2 flex items-center gap-2 rounded-md border border-bad/40 bg-bad/10 px-3 py-1.5 text-xs text-bad",children:[(0,t.jsx)(v.TriangleAlert,{size:13,"aria-hidden":!0,className:"shrink-0"}),F.name," — requests here reach real data. Sends that change data, and load tests, ask first."]}):null,(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-mute empty:hidden",children:[(0,t.jsx)(D,{draft:eR,sent:!!(eP&&eP.status>0),onChange:eL}),B?(0,t.jsx)(z.SaveRequestForm,{initial:{name:V?.name??(0,P.autoRunName)(eR).replace(/ · \d.*$/,""),collection:V?.collection??""},onSave:(e,t)=>void tx({name:e,collection:t}),onCancel:()=>W(!1)}):null,e0?(0,t.jsx)("span",{className:"text-bad",role:"alert",children:e0}):null]})]}),(0,t.jsxs)("div",{className:`grid min-h-0 flex-1 overflow-y-auto transition-[grid-template-columns] duration-200 ease-out motion-reduce:transition-none lg:overflow-hidden ${e8?"":ta?`lg:grid-rows-[minmax(0,1fr)_minmax(0,1fr)] ${Y?"lg:grid-cols-[15rem_minmax(0,1fr)] 2xl:grid-cols-[16rem_minmax(0,1fr)]":"lg:grid-cols-[0rem_minmax(0,1fr)]"}`:Y?"lg:grid-cols-[15rem_minmax(0,1fr)_minmax(0,1fr)] 2xl:grid-cols-[16rem_minmax(0,5fr)_minmax(0,7fr)]":"lg:grid-cols-[0rem_minmax(0,1fr)_minmax(0,1fr)] 2xl:grid-cols-[0rem_minmax(0,5fr)_minmax(0,7fr)]"}`,children:[e8?null:(0,t.jsx)("div",{inert:!Y,"aria-hidden":!Y||void 0,className:`min-h-0 min-w-0 overflow-hidden transition-opacity duration-200 motion-reduce:transition-none ${ta?"lg:row-span-2":""} ${Y?"opacity-100":"opacity-0 max-lg:hidden"}`,children:(0,t.jsx)("div",{className:"flex h-full w-[15rem] flex-col 2xl:w-[16rem] [&>aside]:flex-1",children:(0,t.jsx)(z.RequestsPanel,{activeId:V?.id??null,onOpen:e=>void tN(e),onNew:()=>void tq()})})}),e8?null:(0,t.jsx)("section",{ref:eH,"aria-label":"Request",className:"min-w-0 px-4 py-4 lg:overflow-y-auto lg:px-6",children:(0,t.jsx)(E.RequestEditor,{id:"lab-request",draft:eR,onChange:eL,checkResults:eP?.checks,lastBody:eP?.body,lastResult:eP??void 0,setupResult:eP?.setup,savedResults:eP?.saved,currentId:V?.id,collection:V?.collection,introspect:t$,extraTabs:[{id:"load",label:"Load",badge:eO.stages?.length?"stages":"rate"===eO.mode?`${eO.rps}/s`:`${eO.vus} users \xb7 ${eO.duration}`,content:(0,t.jsx)(N.LoadEditor,{load:eO,onChange:eT})},{id:"targets",label:"Goals",content:(0,t.jsx)(e$,{})}]})}),(0,t.jsxs)("section",{ref:eB,"aria-label":"Results",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:px-6 ${ta&&!e8?"lg:border-t":"lg:border-l"}`,children:[(0,t.jsx)(C.Tabs,{id:"lab-results",label:"Results",value:e9,onChange:e7,items:[{id:"response",label:"Response",badge:eP?eP.status||"ERR":void 0},{id:"report",label:to?(0,t.jsx)(eS,{}):"Load report",badge:e4.length||void 0}],trailing:(0,t.jsxs)(t.Fragment,{children:["report"===e9&&e4.length>0?(0,t.jsx)(eq,{runs:e4,current:e2,disabled:to,onPick:async e=>{try{let t=await es.historyApi.run(e.id);eN(e.id),e5({id:t.report.id,status:t.report.status,report:t.report})}catch(e){l(e instanceof Error?e.message:"Could not open that run","error")}}}):null,e8?null:(0,t.jsx)("button",{type:"button",onClick:()=>ts(ta?"beside":"below"),"aria-label":ta?"Show the response beside the request":"Show the response below the request",title:ta?"Response beside the request":"Response below the request",className:"hidden rounded p-1.5 text-mute hover:bg-panel-2 hover:text-ink lg:block",children:ta?(0,t.jsx)(o,{size:14}):(0,t.jsx)(f,{size:14})}),(0,t.jsx)("button",{type:"button",onClick:()=>te(e=>!e),"aria-label":e8?"Show the request editor":"Expand results to full width",title:e8?"Show the request editor":"Expand results",className:"hidden rounded p-1.5 text-mute hover:bg-panel-2 hover:text-ink lg:block",children:e8?(0,t.jsx)(m,{size:14}):(0,t.jsx)(u,{size:14})})]})}),(0,t.jsx)("div",{...(0,C.tabPanelProps)("lab-results",e9),className:"flex min-h-0 flex-1 flex-col pt-4",children:"response"===e9?(0,t.jsxs)(t.Fragment,{children:[eG&&eP?(0,t.jsxs)("div",{role:"alert",className:"mb-4 flex flex-wrap items-center gap-3 rounded-md border border-warn/40 bg-warn/10 px-3 py-2.5",children:[(0,t.jsxs)("p",{className:"min-w-0 flex-1 text-sm text-ink",children:[(0,t.jsx)("span",{className:"font-medium text-warn",children:"Load test not started."})," The check returned"," ",eP.status||"an error",", not 2xx. Fix the request, or run anyway if this status is expected."]}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-xs",onClick:()=>void tL(!0),children:"Run anyway"})]}):null,eF&&!eP?(0,t.jsx)(K.LiveView,{id:eF,onClosed:()=>e_(!1)}):eP&&ez?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-accent/40 bg-accent/10 px-3 py-2 text-xs",children:[(0,t.jsxs)("span",{className:"text-ink",children:[eJ?"What changed since":"An earlier answer —"," ",new Date(ez.answer.at).toLocaleString()]}),(0,t.jsxs)("span",{className:"ml-auto flex gap-2",children:[(0,t.jsx)("button",{type:"button",className:"text-accent hover:underline",onClick:()=>eK(e=>!e),children:eJ?"Show that answer":"Compare with the latest"}),(0,t.jsx)("button",{type:"button",className:"text-accent hover:underline",onClick:()=>eV(null),children:"Back to the latest"})]})]}),eJ?(0,t.jsx)(G,{earlier:ez.answer,latest:eP}):(0,t.jsx)(R.ResponseViewer,{result:{ok:(e=ez.answer).status>=200&&e.status<400,status:e.status,statusText:String(e.status),headers:e.headers,body:e.body,truncated:e.truncated,durationMs:e.durationMs,url:e.url,...e.error?{error:e.error}:{},...e.checks?{checks:e.checks}:{}}})]}):eP?(0,t.jsx)(R.ResponseViewer,{result:eP,extra:V?.id?(0,t.jsx)(Q,{requestId:V.id,refreshKey:eP,onOpen:(e,t)=>0===t?eV(null):(eV({answer:e,index:t}),eK(!1))}):null,onSaveExample:()=>{eL(e=>({...e,mock:(0,n.exampleFromResponse)(eP.status,eP.headers,eP.body)})),l(V?"Kept as the mock example — save the request to keep it":"Kept as the mock example — save the request to use it in the mock server","success")}}):tk?(0,t.jsx)(ed.WelcomeCard,{practiceReady:!!b.demoApi,onSimple:()=>void(ty({...(0,P.withUrl)((0,P.defaultRequestDraft)(),"{{practiceApi}}/products"),checks:[{type:"status",expect:"2xx"},{type:"json",path:"items[0].name",op:"exists",value:""}]},null),l("Practice request ready — press Send","success")),onSignIn:()=>void tj(),onHide:()=>(0,ed.setWelcomeHidden)(!0)}):(0,t.jsx)(eE,{title:"Send a request to see the response",lines:[(0,t.jsx)(t.Fragment,{children:"Paste a URL — or a whole curl command from your browser's DevTools — into the bar above."}),(0,t.jsxs)(t.Fragment,{children:["Press ",(0,t.jsx)("span",{className:"kbd",children:O}),"+",(0,t.jsx)("span",{className:"kbd",children:"Enter"})," to send it."]})]})]}):e2?(0,t.jsxs)(t.Fragment,{children:[e2.error?(0,t.jsx)("p",{role:"alert",className:"mb-3 rounded-md border border-bad/40 bg-bad/10 px-3 py-2 text-sm text-bad",children:e2.error}):null,(0,t.jsx)(q.ReportView,{report:e2.report,source:"session",live:to,probe:eP})]}):(0,t.jsx)(eE,{title:"No load test yet",lines:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-ink",children:"Run load test"})," sends one check request first, then runs"," ",(0,t.jsx)("span",{className:"font-mono text-ink",children:(0,N.profileSummary)(eO)})," with k6."]}),(0,t.jsx)(t.Fragment,{children:"Change users, duration, and ramps in the Load tab. Set pass/fail goals in Goals."})],action:(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:tu||!!tM,title:tM,onClick:()=>void tL(),children:[(0,t.jsx)(h.Play,{size:16}),"Run load test"]})})})]})]})]})},"VerdictTag",0,eR],6980)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33622,e=>{"use strict";var t=e.i(61666);e.i(24856);var r=e.i(48191);function n(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.testName&&Array.isArray(e.buckets)&&"object"==typeof e.summary&&null!==e.summary}var a=e.i(45404),s=e.i(29724),o=e.i(88153),l=e.i(56396),i=e.i(59180),c=e.i(67938),p=e.i(50804),d=e.i(83067);e.s(["default",0,function(){let[e,u]=(0,d.useState)(null),[x,f]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[j,g]=(0,d.useState)(!1),[v,N]=(0,d.useState)(!1),[w,S]=(0,d.useState)(null),[O,k]=(0,d.useState)(!1),A=(0,l.useToast)(),{refresh:T}=(0,i.useHistory)();async function C(){k(!0);try{await i.historyApi.import(w),await T(),N(!0),A("Saved to History","success")}catch(e){A(e instanceof Error?e.message:"Could not save to History","error")}finally{k(!1)}}let U=(0,d.useCallback)(async e=>{h(null),N(!1),u(null),f(null);let t=e.name.toLowerCase();if(t.endsWith(".html")||t.endsWith(".xlsx")||t.endsWith(".csv")||t.endsWith(".zip")){b(e.name),h("Preview needs the JSON export from the lab. HTML and Excel are for sharing, not for opening back here.");return}try{let t=await e.text(),a=JSON.parse(t),s=function(e){if(!e||"object"!=typeof e)throw Error("That file is not JSON we can open.");if("compare"===e.kind||Array.isArray(e.apis)&&e.apis.length>0){if(!(e&&"object"==typeof e&&"compare"===e.kind&&Array.isArray(e.apis)&&e.apis.length>=1&&e.apis.every(e=>e&&"object"==typeof e&&n(e.report))))throw Error("Not a valid APITestCenter compare export.");return{kind:"compare",doc:{...e,apis:e.apis.map(e=>({...e,report:(0,r.repairSummary)(e.report)}))}}}if(n(e.report))return{kind:"report",report:(0,r.repairSummary)(e.report)};if(n(e))return{kind:"report",report:(0,r.repairSummary)(e)};throw Error("Not an APITestCenter report. Export JSON from the lab (not HTML or Excel).")}(a);S(a),b(e.name),"compare"===s.kind?f(s.doc):u(s.report)}catch(t){b(e.name),h(t instanceof Error?t.message:"Could not read that file.")}},[]);function E(e){e.preventDefault(),g(!0)}function D(e){e.preventDefault(),g(!1);let t=e.dataTransfer.files[0];t&&U(t)}let H=j?"border-accent bg-accent-dim":"border-line bg-panel",L=x?.apis.map(e=>e.title)??[],{slo:R}=(0,o.useSlo)();return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col p-6 lg:p-8",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-medium text-ink",children:"Open a report"}),(0,t.jsx)("p",{className:"mt-1 max-w-xl text-sm text-mute",children:"Reopen a JSON report you exported earlier — a single run or a compare. Excel and HTML exports are for sharing and can't be reopened."})]}),e||x?(0,t.jsxs)("label",{onDragOver:E,onDragLeave:()=>g(!1),onDrop:D,className:`inline-flex cursor-pointer items-center gap-2 rounded-md border border-dashed px-3 py-2 text-xs ${H}`,children:[(0,t.jsx)(c.FileUp,{size:14,className:"text-accent"}),"Replace JSON",(0,t.jsx)("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&U(t),e.target.value=""}})]}):null]}),m?(0,t.jsx)("p",{className:"mt-4 text-sm text-bad",children:m}):null,x?(0,t.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:[y," · compare · ",x.mode]}),(0,t.jsx)("button",{type:"button",disabled:v||O,onClick:()=>void C(),className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink hover:border-accent disabled:opacity-40",children:v?"Saved to History":"Keep in History"})]}),(0,t.jsx)(a.Dashboard,{scope:"compare",data:{reports:x.apis.map(e=>e.report),titles:L,slo:R,live:!1}}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Open"," ",(0,t.jsx)(p.default,{href:"/compare",className:"text-accent hover:underline",children:"Compare"})," ","to re-run these APIs live."]})]}):e?(0,t.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-xs text-mute",children:y}),(0,t.jsx)("button",{type:"button",disabled:v||O,onClick:()=>void C(),className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink hover:border-accent disabled:opacity-40",children:v?"Saved to History":"Keep in History"})]}),v?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Open it anytime on"," ",(0,t.jsx)(p.default,{href:"/history",className:"text-accent hover:underline",children:"History"}),"."]}):null,(0,t.jsx)("div",{className:"rounded-lg border border-line bg-panel p-4",children:(0,t.jsx)(s.ReportView,{report:e,source:"file"})})]}):(0,t.jsxs)("label",{onDragOver:E,onDragLeave:()=>g(!1),onDrop:D,className:`mt-6 flex min-h-0 flex-1 cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed px-8 py-16 text-center ${H}`,children:[(0,t.jsx)(c.FileUp,{size:28,className:"text-accent"}),(0,t.jsx)("span",{className:"mt-4 text-base text-ink",children:"Drop a JSON report here, or click to choose"}),(0,t.jsx)("span",{className:"mt-2 max-w-md text-sm text-mute",children:"Single-run or compare JSON from Export. HTML, Excel, and zip are for sharing — they will not open here."}),(0,t.jsx)("span",{className:"mt-4 font-mono text-xs text-mute",children:"apitestcenter-*.json"}),(0,t.jsx)("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&U(t),e.target.value=""}})]})]})}],33622)},17219,15060,e=>{"use strict";let t=new Uint32Array(256).map((e,t)=>{let r=t;for(let e=0;e<8;e++)r=1&r?0xedb88320^r>>>1:r>>>1;return r>>>0});function r(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function n(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function a(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}function s(e,t){let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=e,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(r)}e.s(["zipStore",0,function(e){let s=new TextEncoder,o=[],l=[],i=0;for(let[c,p]of Object.entries(e)){let e=s.encode(c),d="string"==typeof p?s.encode(p):p,u=function(e){let r=0xffffffff;for(let n of e)r=t[(r^n)&255]^r>>>8;return(0xffffffff^r)>>>0}(d),x=a([n(0x4034b50),r(20),r(0),r(0),r(0),r(0),n(u),n(d.length),n(d.length),r(e.length),r(0),e,d]),f=a([n(0x2014b50),r(20),r(20),r(0),r(0),r(0),r(0),n(u),n(d.length),n(d.length),r(e.length),r(0),r(0),r(0),r(0),n(0),n(i),e]);o.push(x),l.push(f),i+=x.length}let c=a(l),p=a([n(0x6054b50),r(0),r(0),r(Object.keys(e).length),r(Object.keys(e).length),n(c.length),n(i),r(0)]),d=a([...o,c,p]);return new Blob([d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength)],{type:"application/zip"})}],17219),e.s(["downloadBlob",0,s,"downloadText",0,function(e,t,r){s(e,new Blob([t],{type:r}))}],15060)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33622,e=>{"use strict";var t=e.i(14368);e.i(24856);var r=e.i(48191);function n(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.testName&&Array.isArray(e.buckets)&&"object"==typeof e.summary&&null!==e.summary}var a=e.i(45404),s=e.i(29724),o=e.i(88153),l=e.i(56396),i=e.i(59180),c=e.i(67938),p=e.i(30099),d=e.i(99181);e.s(["default",0,function(){let[e,u]=(0,d.useState)(null),[x,f]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[j,g]=(0,d.useState)(!1),[v,N]=(0,d.useState)(!1),[w,S]=(0,d.useState)(null),[O,k]=(0,d.useState)(!1),A=(0,l.useToast)(),{refresh:T}=(0,i.useHistory)();async function C(){k(!0);try{await i.historyApi.import(w),await T(),N(!0),A("Saved to History","success")}catch(e){A(e instanceof Error?e.message:"Could not save to History","error")}finally{k(!1)}}let U=(0,d.useCallback)(async e=>{h(null),N(!1),u(null),f(null);let t=e.name.toLowerCase();if(t.endsWith(".html")||t.endsWith(".xlsx")||t.endsWith(".csv")||t.endsWith(".zip")){b(e.name),h("Preview needs the JSON export from the lab. HTML and Excel are for sharing, not for opening back here.");return}try{let t=await e.text(),a=JSON.parse(t),s=function(e){if(!e||"object"!=typeof e)throw Error("That file is not JSON we can open.");if("compare"===e.kind||Array.isArray(e.apis)&&e.apis.length>0){if(!(e&&"object"==typeof e&&"compare"===e.kind&&Array.isArray(e.apis)&&e.apis.length>=1&&e.apis.every(e=>e&&"object"==typeof e&&n(e.report))))throw Error("Not a valid APITestCenter compare export.");return{kind:"compare",doc:{...e,apis:e.apis.map(e=>({...e,report:(0,r.repairSummary)(e.report)}))}}}if(n(e.report))return{kind:"report",report:(0,r.repairSummary)(e.report)};if(n(e))return{kind:"report",report:(0,r.repairSummary)(e)};throw Error("Not an APITestCenter report. Export JSON from the lab (not HTML or Excel).")}(a);S(a),b(e.name),"compare"===s.kind?f(s.doc):u(s.report)}catch(t){b(e.name),h(t instanceof Error?t.message:"Could not read that file.")}},[]);function E(e){e.preventDefault(),g(!0)}function D(e){e.preventDefault(),g(!1);let t=e.dataTransfer.files[0];t&&U(t)}let H=j?"border-accent bg-accent-dim":"border-line bg-panel",L=x?.apis.map(e=>e.title)??[],{slo:R}=(0,o.useSlo)();return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col p-6 lg:p-8",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-medium text-ink",children:"Open a report"}),(0,t.jsx)("p",{className:"mt-1 max-w-xl text-sm text-mute",children:"Reopen a JSON report you exported earlier — a single run or a compare. Excel and HTML exports are for sharing and can't be reopened."})]}),e||x?(0,t.jsxs)("label",{onDragOver:E,onDragLeave:()=>g(!1),onDrop:D,className:`inline-flex cursor-pointer items-center gap-2 rounded-md border border-dashed px-3 py-2 text-xs ${H}`,children:[(0,t.jsx)(c.FileUp,{size:14,className:"text-accent"}),"Replace JSON",(0,t.jsx)("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&U(t),e.target.value=""}})]}):null]}),m?(0,t.jsx)("p",{className:"mt-4 text-sm text-bad",children:m}):null,x?(0,t.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:[y," · compare · ",x.mode]}),(0,t.jsx)("button",{type:"button",disabled:v||O,onClick:()=>void C(),className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink hover:border-accent disabled:opacity-40",children:v?"Saved to History":"Keep in History"})]}),(0,t.jsx)(a.Dashboard,{scope:"compare",data:{reports:x.apis.map(e=>e.report),titles:L,slo:R,live:!1}}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Open"," ",(0,t.jsx)(p.default,{href:"/compare",className:"text-accent hover:underline",children:"Compare"})," ","to re-run these APIs live."]})]}):e?(0,t.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-xs text-mute",children:y}),(0,t.jsx)("button",{type:"button",disabled:v||O,onClick:()=>void C(),className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink hover:border-accent disabled:opacity-40",children:v?"Saved to History":"Keep in History"})]}),v?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Open it anytime on"," ",(0,t.jsx)(p.default,{href:"/history",className:"text-accent hover:underline",children:"History"}),"."]}):null,(0,t.jsx)("div",{className:"rounded-lg border border-line bg-panel p-4",children:(0,t.jsx)(s.ReportView,{report:e,source:"file"})})]}):(0,t.jsxs)("label",{onDragOver:E,onDragLeave:()=>g(!1),onDrop:D,className:`mt-6 flex min-h-0 flex-1 cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed px-8 py-16 text-center ${H}`,children:[(0,t.jsx)(c.FileUp,{size:28,className:"text-accent"}),(0,t.jsx)("span",{className:"mt-4 text-base text-ink",children:"Drop a JSON report here, or click to choose"}),(0,t.jsx)("span",{className:"mt-2 max-w-md text-sm text-mute",children:"Single-run or compare JSON from Export. HTML, Excel, and zip are for sharing — they will not open here."}),(0,t.jsx)("span",{className:"mt-4 font-mono text-xs text-mute",children:"apitestcenter-*.json"}),(0,t.jsx)("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&U(t),e.target.value=""}})]})]})}],33622)},17219,15060,e=>{"use strict";let t=new Uint32Array(256).map((e,t)=>{let r=t;for(let e=0;e<8;e++)r=1&r?0xedb88320^r>>>1:r>>>1;return r>>>0});function r(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function n(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function a(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}function s(e,t){let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=e,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(r)}e.s(["zipStore",0,function(e){let s=new TextEncoder,o=[],l=[],i=0;for(let[c,p]of Object.entries(e)){let e=s.encode(c),d="string"==typeof p?s.encode(p):p,u=function(e){let r=0xffffffff;for(let n of e)r=t[(r^n)&255]^r>>>8;return(0xffffffff^r)>>>0}(d),x=a([n(0x4034b50),r(20),r(0),r(0),r(0),r(0),n(u),n(d.length),n(d.length),r(e.length),r(0),e,d]),f=a([n(0x2014b50),r(20),r(20),r(0),r(0),r(0),r(0),n(u),n(d.length),n(d.length),r(e.length),r(0),r(0),r(0),r(0),n(0),n(i),e]);o.push(x),l.push(f),i+=x.length}let c=a(l),p=a([n(0x6054b50),r(0),r(0),r(Object.keys(e).length),r(Object.keys(e).length),n(c.length),n(i),r(0)]),d=a([...o,c,p]);return new Blob([d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength)],{type:"application/zip"})}],17219),e.s(["downloadBlob",0,s,"downloadText",0,function(e,t,r){s(e,new Blob([t],{type:r}))}],15060)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60459,e=>{"use strict";var t=e.i(14368),r=e.i(95486),n=e.i(99522);let i=(0,n.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 a=e.i(84355),s=e.i(67951),o=e.i(91694);let l=(0,n.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(88293);let h=(0,n.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),f=e.i(87283),m=e.i(30099),x=e.i(36994),g=e.i(48317),y=e.i(99181);function b({size:e=24,className:r}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"10.5 8.5 47 47","aria-hidden":!0,className:r,children:[(0,t.jsx)("rect",{x:"10.5",y:"8.5",width:"47",height:"47",rx:"11",fill:"#C8F560"}),(0,t.jsx)("path",{d:"M47.4 32.3 V36.7 Q47.4 40.9 43.75 42.98 L35.65 47.72 Q32 49.8 28.35 47.72 L20.25 42.98 Q16.6 40.9 16.6 36.7 V27.3 Q16.6 23.1 20.25 21.02 L28.35 16.28 Q32 14.2 35.65 16.28 L43.75 21.02 Q47.4 23.1 47.4 27.3",fill:"none",stroke:"#10140A",strokeWidth:"4",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M37.5 29.8 H51.5",stroke:"#10140A",strokeWidth:"2.6"}),(0,t.jsx)("circle",{cx:"51.5",cy:"29.8",r:"3",fill:"#10140A"}),(0,t.jsx)("path",{d:"M22.9 23.7 L29.4 29.8 L22.9 35.9",fill:"none",stroke:"#10140A",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("circle",{cx:"37.5",cy:"29.8",r:"4.1",fill:"#10140A"}),(0,t.jsx)("path",{d:"M27.2 37.9 Q32 42.1 36.8 37.9",fill:"none",stroke:"#10140A",strokeWidth:"3.3",strokeLinecap:"round"})]})}var j=e.i(69578),v=e.i(78739),k=e.i(68865),w=e.i(15868);function C(){let{items:e,remove:r,clear:n}=(0,k.useCompareTray)(),i=(0,x.usePathname)(),a=(0,x.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)(s.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 ",k.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:()=>r(e.id),className:"rounded-full p-0.5 text-mute hover:text-bad","aria-label":`Remove ${e.name} from compare`,children:(0,t.jsx)(f.X,{size:12})})]},e.id))}),(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:n,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,w.startNavProgress)(),a.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 N=e.i(7641),S=e.i(72350),P=e.i(5831),M=e.i(67217),E=e.i(56931),T=e.i(5504),A=e.i(74749),O=e.i(97942);let I=(0,n.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 _=e.i(20054);function R(){let{stopped:e}=(0,_.useEngineHealth)();return((0,y.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)(I,{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 z=e.i(839);let L=(0,n.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 $=e.i(83316),D=e.i(67938);let U=(0,n.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var F=e.i(73606),H=e.i(71189);let V=(0,n.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"}]]),q=(0,n.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 B=e.i(67290),W=e.i(30135),K=e.i(745),Q=e.i(14865);let Z=[{id:"system",label:"Theme follows the system",icon:u.Monitor},{id:"light",label:"Light theme",icon:K.Sun},{id:"dark",label:"Dark theme",icon:F.Moon}];function J({onClick:e,title:r,children:n,label:i}){return(0,t.jsx)("button",{type:"button",onClick:e,title:r,"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:n})}function X(){let{checked:e,online:r,k6Ready:n,k6Label:i,appVersion:a}=(0,_.useEngineHealth)(),{zoom:s,zoomIn:o,zoomOut:l,resetZoom:c,density:u,setDensity:d}=(0,Q.useViewPrefs)(),{theme:h,setTheme:p}=(0,g.useTheme)(),[f,m]=(0,y.useState)(!1);(0,y.useEffect)(()=>m(!0),[]);let x=Math.max(0,Z.findIndex(e=>e.id===(f?h??"system":"system"))),b=Z[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:r?i:"Start it with pnpm dev",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${e?r&&n?"bg-ok":r?"bg-warn":"bg-bad":"bg-mute"}`,"aria-hidden":!0}),e?r?n?"Engine ready":"Engine online, k6 missing":"Engine offline":"Checking engine"]}),r?(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)(J,{onClick:()=>(0,M.openImport)(),title:"Import requests — Postman, Insomnia, Bruno, OpenAPI, .http, Hurl, HAR",children:[(0,t.jsx)(D.FileUp,{size:13,"aria-hidden":!0})," Import"]}),(0,t.jsxs)(J,{onClick:()=>(0,T.openCookies)(),title:"Cookies kept between requests",children:[(0,t.jsx)($.Cookie,{size:13,"aria-hidden":!0})," Cookies"]}),(0,t.jsxs)(J,{onClick:()=>(0,E.openCertificates)(),title:"Client certificates and trusted CAs",children:[(0,t.jsx)(W.ShieldCheck,{size:13,"aria-hidden":!0})," Certificates"]}),(0,t.jsxs)(J,{onClick:()=>(0,A.openMock)(),title:"Answer requests with example responses",children:[(0,t.jsx)(B.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)(J,{onClick:l,title:"Zoom out (Ctrl −)",label:"Zoom out",children:(0,t.jsx)(U,{size:13,"aria-hidden":!0})}),(0,t.jsx)(J,{onClick:c,title:"Reset zoom (Ctrl 0)",label:`Zoom ${Math.round(100*s)}%, reset`,children:(0,t.jsxs)("span",{className:"tabular w-9 text-center font-mono",children:[Math.round(100*s),"%"]})}),(0,t.jsx)(J,{onClick:o,title:"Zoom in (Ctrl +)",label:"Zoom in",children:(0,t.jsx)(H.Plus,{size:13,"aria-hidden":!0})})]}),(0,t.jsxs)(J,{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)(q,{size:13,"aria-hidden":!0}):(0,t.jsx)(V,{size:13,"aria-hidden":!0}),"compact"===u?"Compact":"Comfortable"]}),(0,t.jsx)(J,{onClick:()=>p(Z[(x+1)%Z.length].id),title:`${Z[x].label} — click to change`,label:`${Z[x].label}. Click to change.`,children:(0,t.jsx)(b,{size:13,"aria-hidden":!0})}),(0,t.jsx)("span",{"data-tour":"help",className:"inline-flex",children:(0,t.jsxs)(J,{onClick:N.openHelp,title:"What the words mean, and the tour",children:[(0,t.jsx)(L,{size:13,"aria-hidden":!0})," Help"]})}),(0,t.jsx)(J,{onClick:v.openAbout,title:"Version, updates, and where your files are",children:a&&"dev"!==a?`v${a}`:"Development build"})]})}var G=e.i(51554),Y=e.i(44505),ee=e.i(48181),et=e.i(2603),er=e.i(30635),en=e.i(6278);let ei=[{href:"/home",label:"Home",icon:l},{href:"/",label:"Test API",icon:a.FlaskConical},{href:"/suite",label:"Run collection",icon:c.ListChecks},{href:"/compare",label:"Compare",icon:s.GitCompareArrows},{href:"/history",label:"History",icon:o.History},{href:"/preview",label:"Open report",icon:i}],ea="apitestcenter-phone-notice";function es({children:e}){let n=(0,x.usePathname)(),i=(0,et.useModKey)(),{activeEnv:a}=(0,en.useWorkspace)(),s=(0,ee.envKind)(a?.name),o=ee.ENV_COLOUR[s],[l,c]=(0,y.useState)(!1),{resolvedTheme:k}=(0,g.useTheme)(),{current:I}=(0,er.useProjects)();return(0,y.useEffect)(()=>{let e=(0,Y.desktop)();e?.platform&&(document.documentElement.dataset.desktop=e.platform)},[]),(0,y.useEffect)(()=>{let e=(0,Y.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)},[k]),(0,y.useEffect)(()=>{c(window.matchMedia("(max-width: 767px)").matches&&"dismissed"!==window.sessionStorage.getItem(ea))},[]),(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 top-0 z-[90]",style:{background:o,height:"production"===s?3:2}}):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)(m.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,{size:26}),(0,t.jsx)("span",{className:"hidden text-sm font-semibold tracking-tight text-ink sm:inline",children:"APITestCenter"})]}),I?(0,t.jsxs)(m.default,{href:"/home",title:`${I.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,er.projectTile)(I.id)},"aria-hidden":!0}),(0,t.jsx)("span",{className:"max-w-48 truncate",children:I.name}),(0,t.jsx)(r.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)(d.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:[a?(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${"production"===s?"border-bad/50 bg-bad/10 text-bad":"staging"===s?"border-warn/50 bg-warn/10 text-warn":"border-line text-mute"}`,title:"production"===s?"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}),a.name]}):null,(0,t.jsx)("button",{type:"button",onClick:z.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:ei.map(e=>{let r="/"===e.href?"/"===n:n===e.href||n.startsWith(`${e.href}/`),i=e.icon;return(0,t.jsxs)(m.default,{href:e.href,"aria-current":r?"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 ${r?"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:r?"text-accent":void 0}),e.label]},e.href)})}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("button",{type:"button",onClick:O.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. Load 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(ea,"dismissed"),c(!1)},children:(0,t.jsx)(f.X,{size:16})})]}):null,e]})]}),(0,t.jsx)(X,{}),(0,t.jsx)(j.CommandPalette,{}),(0,t.jsx)(N.HelpPanel,{}),(0,t.jsx)(P.Tour,{}),(0,t.jsx)(M.ImportDialog,{}),(0,t.jsx)(E.CertificatesDialog,{}),(0,t.jsx)(T.CookiesDialog,{}),(0,t.jsx)(A.MockDialog,{}),(0,t.jsx)(O.VersionsDialog,{}),(0,t.jsx)(O.TrashDialog,{}),(0,t.jsx)(R,{}),(0,t.jsx)(w.NavProgress,{}),(0,t.jsx)(v.AboutDialog,{}),(0,t.jsx)(S.ShortcutsDialog,{}),(0,t.jsx)(z.SettingsDialog,{}),(0,t.jsx)(C,{}),(0,t.jsx)(G.UsageConsent,{})]})}e.s(["AppShell",0,function({children:e}){return(0,t.jsx)(Q.ViewPrefsProvider,{children:(0,t.jsx)(es,{children:e})})}],60459)},87329,e=>{"use strict";var t=e.i(14368),r=e.i(48317),n=e.i(39170),i=e.i(68865),a=e.i(56396),s=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)(r.ThemeProvider,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"apitestcenter-theme",children:(0,t.jsx)(s.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)(a.ToastProvider,{children:(0,t.jsx)(n.ConfirmProvider,{children:(0,t.jsx)(i.CompareTrayProvider,{children:e})})})})})})})})})}])},68865,e=>{"use strict";var t=e.i(14368),r=e.i(99181);let n="apitestcenter-compare-tray",i=(0,r.createContext)({items:[],has:()=>!1,toggle:()=>!1,remove:()=>{},clear:()=>{}});e.s(["CompareTrayProvider",0,function({children:e}){let[a,s]=(0,r.useState)([]);(0,r.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(n)??"[]");Array.isArray(e)&&s(e.filter(e=>"string"==typeof e?.id&&"string"==typeof e?.name).slice(0,6))}catch{}},[]);let o=(0,r.useCallback)(e=>{s(e);try{localStorage.setItem(n,JSON.stringify(e))}catch{}},[]),l=(0,r.useMemo)(()=>({items:a,has:e=>a.some(t=>t.id===e),toggle:e=>a.some(t=>t.id===e.id)?(o(a.filter(t=>t.id!==e.id)),!0):!(a.length>=6)&&(o([...a,e]),!0),remove:e=>o(a.filter(t=>t.id!==e)),clear:()=>o([])}),[a,o]);return(0,t.jsx)(i.Provider,{value:l,children:e})},"TRAY_MAX",0,6,"useCompareTray",0,function(){return(0,r.useContext)(i)}])},48181,e=>{"use strict";e.s(["ENV_COLOUR",0,{production:"var(--bad)",staging:"var(--warn)",other:null},"envKind",0,function(e){let t=(e??"").toLowerCase();return/\b(prod|production|live|prd)\b/.test(t)&&!/\b(pre-?prod|non-?prod)\b/.test(t)?"production":/\b(staging|stage|stg|uat|pre-?prod|qa)\b/.test(t)?"staging":"other"},"isReadOnlyMethod",0,e=>/^(GET|HEAD|OPTIONS)$/i.test(e)])},30635,e=>{"use strict";var t=e.i(99181),r=e.i(44505);let n=["#c8f560","#60a5fa","#c4b5fd","#fbbf24","#5eead4","#fb923c","#f9a8d4"];e.s(["projectTile",0,function(e){let t=0;for(let r of e)t=31*t+r.charCodeAt(0)>>>0;return"default"===e?n[0]:n[t%n.length]},"useProjects",0,function(){let[e,n]=(0,t.useState)(null),[i,a]=(0,t.useState)(!1),s=(0,t.useCallback)(async()=>{let e=(0,r.desktop)()?.projects;a(!!e),e&&n(await e.list().catch(()=>[]))},[]);return(0,t.useEffect)(()=>{s()},[s]),{projects:e,current:e?.find(e=>e.current)??null,refresh:s,supported:i}}])},88153,e=>{"use strict";var t=e.i(14368),r=e.i(99181);let n="apitestcenter-session-slo",i=(0,r.createContext)({slo:null,setSlo:()=>{},ready:!1});e.s(["SloProvider",0,function({children:e}){let[a,s]=(0,r.useState)(null),[o,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{s(function(){try{let e=localStorage.getItem(n)??sessionStorage.getItem(n);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:a,setSlo:function(e){s(e);try{sessionStorage.removeItem(n),e?localStorage.setItem(n,JSON.stringify(e)):localStorage.removeItem(n)}catch{}},ready:o},children:e})},"useSlo",0,function(){return(0,r.useContext)(i)}])},48321,e=>{"use strict";var t=e.i(14368);e.i(24856);var r=e.i(86483),n=e.i(99181);let i=(0,r.normalizeViewsFile)(null),a=(0,n.createContext)({file:i,ready:!1,viewsFor:e=>r.BUILT_IN_VIEWS.filter(t=>t.scope===e),save:async e=>e});function s(){return(0,n.useContext)(a)}let o=e=>`apitestcenter-last-view-${e}`;e.s(["ViewsProvider",0,function({children:e}){let[s,o]=(0,n.useState)(i),[l,c]=(0,n.useState)(!1);(0,n.useEffect)(()=>{fetch("/engine/settings/views",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>e&&o((0,r.normalizeViewsFile)(e))).catch(()=>void 0).finally(()=>c(!0))},[]);let u=(0,n.useCallback)(async e=>{let t=await fetch("/engine/settings/views",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw Error(n.error??"Could not save the view");let i=(0,r.normalizeViewsFile)(n);return o(i),i},[]),d=(0,n.useMemo)(()=>({file:s,ready:l,viewsFor:e=>[...r.BUILT_IN_VIEWS,...s.views].filter(t=>t.scope===e),save:u}),[s,l,u]);return(0,t.jsx)(a.Provider,{value:d,children:e})},"useSelectedView",0,function(e){let{file:t,viewsFor:r}=s(),[i,a]=(0,n.useState)(null);(0,n.useEffect)(()=>{try{a(localStorage.getItem(o(e)))}catch{}},[e]);let l=r(e);return[l.find(e=>e.id===i)??l.find(r=>r.id===t.defaults[e])??l[0],(0,n.useCallback)(t=>{a(t);try{localStorage.setItem(o(e),t)}catch{}},[e])]},"useViews",0,s])},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)},29091,e=>{"use strict";let t=(0,e.i(99522).default)("list-checks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);e.s(["ListChecks",0,t],29091)},30099,(e,t,r)=>{"use strict";e.i(30204),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return b}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(56421),s=e.r(14368),o=a._(e.r(99181)),l=e.r(36176),c=e.r(64937),u=e.r(24967),d=e.r(61908),h=e.r(14648),p=e.r(43491),f=e.r(89960),m=e.r(53543),x=e.r(63663);function g(t){var r;let n,i,a,[g,b]=(0,o.useOptimistic)(f.IDLE_LINK_STATUS),j=(0,o.useRef)(null),{href:v,as:k,children:w,prefetch:C=null,passHref:N,replace:S,shallow:P,scroll:M,onClick:E,onMouseEnter:T,onTouchStart:A,legacyBehavior:O=!1,onNavigate:I,transitionTypes:_,ref:R,unstable_dynamicOnHover:z,...L}=t;n=w,O&&("string"==typeof n||"number"==typeof n)&&(n=(0,s.jsx)("a",{children:n}));let $=o.default.useContext(c.AppRouterContext),D=!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(r=k||v)?r:(0,l.formatUrl)(r);if(O){if(n?.$$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(n)}let V=O?i&&"object"==typeof i&&i.ref:R,q,B=o.default.useCallback(e=>(null!==$&&(j.current=(0,f.mountLinkInstance)(e,H,$,F,D,b,q)),()=>{j.current&&((0,f.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,f.unmountPrefetchableInstance)(e)}),[D,H,$,F,b,q]),W={ref:(0,u.useMergedRef)(B,V),onClick(t){O||"function"!=typeof E||E(t),O&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,i,a,s,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)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:h}=e.r(63059);o.default.startTransition(()=>{h(r,i?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l,c)})}}(t,H,j,S,M,I,_,U)},onMouseEnter(e){O||"function"!=typeof T||T(e),O&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),$&&D&&(0,f.onNavigationIntent)(e.currentTarget,!0===z)},onTouchStart:function(e){O||"function"!=typeof A||A(e),O&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),$&&D&&(0,f.onNavigationIntent)(e.currentTarget,!0===z)}};return(0,d.isAbsoluteUrl)(H)?W.href=H:O&&!N&&("a"!==i.type||"href"in i.props)||(W.href=(0,h.addBasePath)(H)),a=O?o.default.cloneElement(i,W):(0,s.jsx)("a",{...L,...W,children:n}),(0,s.jsx)(y.Provider,{value:g,children:a})}let y=(0,o.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,o.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},24967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=e.r(99181);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=a(e,n)),t&&(i.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},61908,(e,t,r)=>{"use strict";e.i(30204),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return j},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return x},WEB_VITALS:function(){return a},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return k}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),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:r}=window.location;return`${e}//${t}${r?":"+r:""}`}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 h(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&h(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}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 b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class j extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class v 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,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(61908),i=e.r(85594);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},62298,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return o}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function s(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[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,s(e));else t.set(r,s(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},36176,(e,t,r)=>{"use strict";e.i(30204),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(56421)._(e.r(62298)),s=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=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:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!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"),`${n}${c}${i}${u}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}}]);