apitestcenter 0.18.2 → 0.18.3

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 (57) hide show
  1. package/dist/THIRD-PARTY-NOTICES-UI.txt +1 -1
  2. package/dist/THIRD-PARTY-NOTICES.txt +1 -1
  3. package/dist/cli.mjs +245 -245
  4. package/dist/ui/404/index.html +1 -1
  5. package/dist/ui/404.html +1 -1
  6. package/dist/ui/__next.__PAGE__.txt +5 -5
  7. package/dist/ui/__next._full.txt +5 -5
  8. package/dist/ui/__next._tree.txt +1 -1
  9. package/dist/ui/_next/static/chunks/{2c1b5jqwxl4ra.js → 1snbdq1z951ks.js} +2 -2
  10. package/dist/ui/_next/static/chunks/{2sb9zma7ae-_f.js → 2sr5dm3__ghgo.js} +1 -1
  11. package/dist/ui/_next/static/chunks/{1mm60-ywpri7b.js → 3eti_s9gpiis0.js} +2 -2
  12. package/dist/ui/_not-found/__next._full.txt +3 -3
  13. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +3 -3
  14. package/dist/ui/_not-found/__next._tree.txt +1 -1
  15. package/dist/ui/_not-found/index.html +1 -1
  16. package/dist/ui/_not-found/index.txt +3 -3
  17. package/dist/ui/compare/__next._full.txt +3 -3
  18. package/dist/ui/compare/__next._tree.txt +1 -1
  19. package/dist/ui/compare/__next.compare.__PAGE__.txt +3 -3
  20. package/dist/ui/compare/index.html +1 -1
  21. package/dist/ui/compare/index.txt +3 -3
  22. package/dist/ui/connections/__next._full.txt +3 -3
  23. package/dist/ui/connections/__next._tree.txt +1 -1
  24. package/dist/ui/connections/__next.connections.__PAGE__.txt +3 -3
  25. package/dist/ui/connections/index.html +2 -2
  26. package/dist/ui/connections/index.txt +3 -3
  27. package/dist/ui/history/__next._full.txt +5 -5
  28. package/dist/ui/history/__next._tree.txt +1 -1
  29. package/dist/ui/history/__next.history.__PAGE__.txt +5 -5
  30. package/dist/ui/history/index.html +1 -1
  31. package/dist/ui/history/index.txt +5 -5
  32. package/dist/ui/home/__next._full.txt +5 -5
  33. package/dist/ui/home/__next._tree.txt +1 -1
  34. package/dist/ui/home/__next.home.__PAGE__.txt +5 -5
  35. package/dist/ui/home/index.html +1 -1
  36. package/dist/ui/home/index.txt +5 -5
  37. package/dist/ui/index.html +1 -1
  38. package/dist/ui/index.txt +5 -5
  39. package/dist/ui/preview/__next._full.txt +3 -3
  40. package/dist/ui/preview/__next._tree.txt +1 -1
  41. package/dist/ui/preview/__next.preview.__PAGE__.txt +3 -3
  42. package/dist/ui/preview/index.html +1 -1
  43. package/dist/ui/preview/index.txt +3 -3
  44. package/dist/ui/suite/__next._full.txt +3 -3
  45. package/dist/ui/suite/__next._tree.txt +1 -1
  46. package/dist/ui/suite/__next.suite.__PAGE__.txt +3 -3
  47. package/dist/ui/suite/index.html +1 -1
  48. package/dist/ui/suite/index.txt +3 -3
  49. package/dist/ui/tests/__next._full.txt +3 -3
  50. package/dist/ui/tests/__next._tree.txt +1 -1
  51. package/dist/ui/tests/__next.tests.__PAGE__.txt +3 -3
  52. package/dist/ui/tests/index.html +1 -1
  53. package/dist/ui/tests/index.txt +3 -3
  54. package/package.json +1 -1
  55. /package/dist/ui/_next/static/{8uBf4sRL82dkVbEC6zib9 → lomhkNrlljr9WxdUu6_Mc}/_buildManifest.js +0 -0
  56. /package/dist/ui/_next/static/{8uBf4sRL82dkVbEC6zib9 → lomhkNrlljr9WxdUu6_Mc}/_clientMiddlewareManifest.js +0 -0
  57. /package/dist/ui/_next/static/{8uBf4sRL82dkVbEC6zib9 → lomhkNrlljr9WxdUu6_Mc}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[22543,e=>{var t=e.i(72587),r=e.i(55218),n=e.i(90484),s=e.i(14865);e.s(["f",0,function({text:e,label:i="More information"}){let a=(0,r.useRef)(null),o=(0,r.useRef)(null),[l,u]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1),[d,h]=(0,r.useState)(null),f=l||c;return(0,r.useLayoutEffect)(()=>{if(!f)return h(null);let e=()=>{if(!a.current)return;let e=(0,s.C)(a.current),t=(0,s.v)(),r=Math.min(256,t.width-32),n=o.current?.offsetHeight??80,i=Math.min(Math.max(16,e.left),t.width-r-16);h({top:e.bottom+6+n<=t.height-8?e.bottom+6:Math.max(8,e.top-6-n),left:i})};e();let t=requestAnimationFrame(e);return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f]),(0,r.useEffect)(()=>{if(!l)return;let e=e=>{let t=e.target;a.current?.contains(t)||o.current?.contains(t)||u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[l]),(0,t.jsxs)("span",{ref:a,className:"relative inline-flex align-middle",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,t.jsx)("button",{type:"button",className:"grid h-4 w-4 place-items-center rounded-full border border-line text-[11px] leading-none text-mute hover:border-accent hover:text-accent","aria-label":i,"aria-expanded":f,onClick:e=>{e.stopPropagation(),u(e=>!e)},onFocus:()=>p(!0),onBlur:()=>p(!1),children:"?"}),f&&"u">typeof document?(0,n.createPortal)((0,t.jsx)("span",{ref:o,role:"tooltip",style:{width:"min(256px, calc(100vw - 2rem))",top:d?.top??-9999,left:d?.left??-9999},className:"fixed z-[80] rounded-md border border-line bg-panel-2 px-2.5 py-2 text-xs leading-5 font-normal tracking-normal text-ink normal-case shadow-lg",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:e}),document.body):null]})}])},39170,e=>{var t=e.i(72587),r=e.i(53012),n=e.i(55218);let s=(0,n.createContext)(async()=>!1);function i({options:e,onClose:s}){let a=(0,n.useRef)(null),o=(0,n.useRef)(null),l=(0,n.useRef)(null),u="danger"===e.tone;return(0,n.useEffect)(()=>{let e=document.activeElement;return(u?o:l).current?.focus(),()=>e?.focus()},[u]),(0,t.jsx)("div",{className:"fixed inset-0 z-[95] grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>{e.target===e.currentTarget&&s(!1)},children:(0,t.jsxs)("div",{ref:a,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",onKeyDown:function(e){if("Escape"===e.key&&(e.stopPropagation(),s(!1)),"Tab"===e.key){let t=a.current?.querySelectorAll("button");if(!t||0===t.length)return;let r=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),r.focus())}},className:"w-full max-w-md rounded-xl border border-line bg-panel p-5 shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[u?(0,t.jsx)("span",{className:"mt-0.5 grid h-8 w-8 shrink-0 place-items-center rounded-full bg-warn/15 text-warn",children:(0,t.jsx)(r.f,{size:16})}):null,(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{id:"confirm-title",className:"text-base font-medium text-ink",children:e.title}),e.body?(0,t.jsx)("div",{className:"mt-2 text-sm text-mute",children:e.body}):null]})]}),(0,t.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,t.jsx)("button",{ref:o,type:"button",className:"btn btn-secondary",onClick:()=>s(!1),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{ref:l,type:"button",className:"btn btn-primary",onClick:()=>s(!0),children:e.confirmLabel??"Continue"})]})]})})}e.s(["a",0,function({children:e}){let[r,a]=(0,n.useState)(null),o=(0,n.useCallback)(e=>new Promise(t=>a({...e,resolve:t})),[]);return(0,t.jsxs)(s.Provider,{value:o,children:[e,r?(0,t.jsx)(i,{options:r,onClose:function(e){r?.resolve(e),a(null)}}):null]})},"L",0,function(){return(0,n.useContext)(s)}])},28867,e=>{var t=e.i(72587);e.s(["f",0,function({value:e,options:r,onChange:n,label:s,size:i="sm"}){return(0,t.jsx)("div",{role:"group","aria-label":s,className:"inline-flex flex-wrap rounded-md border border-line bg-panel-2 p-0.5",children:r.map(r=>{let s=r.value===e;return(0,t.jsx)("button",{type:"button","aria-pressed":s,title:r.title,onClick:()=>n(r.value),className:`rounded px-2.5 ${"md"===i?"py-1.5 text-sm":"py-1 text-xs"} transition-colors ${s?"bg-panel text-ink shadow-sm":"text-mute hover:text-ink"}`,children:r.label},r.value)})})}])},56396,e=>{var t=e.i(72587),r=e.i(17118),n=e.i(42967),s=e.i(87283),i=e.i(27122),a=e.i(55218);let o=(0,a.createContext)(()=>{}),l=1;e.s(["N",0,function({children:e}){let[u,c]=(0,a.useState)([]),p=(0,a.useCallback)(e=>c(t=>t.filter(t=>t.id!==e)),[]),d=(0,a.useCallback)((e,t="info")=>{let r=l++;c(n=>[...n.slice(-3),{id:r,tone:t,message:e}]),window.setTimeout(()=>p(r),"error"===t?6e3:3200)},[p]);return(0,t.jsxs)(o.Provider,{value:d,children:[e,(0,t.jsx)("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 z-50 flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2",children:u.map(e=>{let a="success"===e.tone?r.f:"error"===e.tone?i.f:n.f,o="success"===e.tone?"text-ok":"error"===e.tone?"text-bad":"text-accent";return(0,t.jsxs)("div",{role:"error"===e.tone?"alert":"status",className:"pointer-events-auto flex items-start gap-2 rounded-lg border border-line bg-panel px-3 py-2.5 text-sm text-ink shadow-xl",children:[(0,t.jsx)(a,{size:16,className:`mt-0.5 shrink-0 ${o}`}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e.message}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"shrink-0 rounded p-0.5 text-mute hover:text-ink",onClick:()=>p(e.id),children:(0,t.jsx)(s.X,{size:14})})]},e.id)})})]})},"d",0,function(){return(0,a.useContext)(o)}])},44505,e=>{e.s(["f",0,function(){return window.atcDesktop??null}])},15060,e=>{function t(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(["h",0,t,"N",0,function(e,r,n){t(e,new Blob([r],{type:n}))}])},19656,e=>{e.s(["L",0,function(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`},"B",0,function(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})},"W",0,function(e){return new Intl.NumberFormat("en-US").format(Math.round(e))},"M",0,function(e,t){let r=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));if(r<60)return`${r}s`;let n=Math.floor(r/60),s=r%60;return s?`${n}m ${s}s`:`${n}m`},"E",0,function(e){return Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:`${Math.round(e)} ms`:"—"},"Z",0,function(e){return`${(100*e).toFixed(e<.01?2:1)}%`},"m",0,function(e){return Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—"}])},59180,e=>{var t=e.i(72587),r=e.i(55218);async function n(e){let t=await e.text(),r=null;try{r=t?JSON.parse(t):null}catch{}if(!e.ok)throw Error(r?.error??`Engine error (${e.status})`);return r}let s=(e,t)=>fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),i={index:()=>fetch("/engine/history",{cache:"no-store"}).then(e=>n(e)),run:e=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),compare:e=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),updateRun:(e,t)=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>n(e)),updateCompare:(e,t)=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>n(e)),remove:e=>s("/engine/history/delete",e).then(e=>n(e)),saveCompare:e=>s("/engine/history/compares",e).then(e=>n(e)),import:e=>s("/engine/history/import",e).then(e=>n(e)),reveal:e=>s("/engine/history/reveal",e??{}).then(e=>n(e))},a=(0,r.createContext)({index:null,error:null,loading:!0,refresh:async()=>null,baselineFor:()=>void 0}),o="apitestcenter-history-migrated";async function l(){try{if(localStorage.getItem(o))return;let e=JSON.parse(sessionStorage.getItem("apitestcenter-session-runs")??"[]"),t=JSON.parse(sessionStorage.getItem("apitestcenter-compare-history")??"[]");for(let t of Array.isArray(e)?e:[])await i.import({report:t}).catch(()=>void 0);for(let e of Array.isArray(t)?t:[])e?.apis&&!(e.apis.length<2)&&await i.import({kind:"compare",mode:"parallel"===e.mode?"parallel":"sequence",apis:e.apis,meta:{name:e.title}}).catch(()=>void 0);sessionStorage.removeItem("apitestcenter-session-runs"),sessionStorage.removeItem("apitestcenter-compare-history"),localStorage.setItem(o,new Date().toISOString())}catch{}}e.s(["w",0,function({children:e}){let[n,s]=(0,r.useState)(null),[o,u]=(0,r.useState)(null),[c,p]=(0,r.useState)(!0),d=(0,r.useRef)(null),h=(0,r.useCallback)(()=>{if(d.current)return d.current;let e=i.index().then(e=>(s(e),u(null),e)).catch(e=>(u(e instanceof Error?e.message:"History unavailable"),null)).finally(()=>{p(!1),d.current=null});return d.current=e,e},[]);(0,r.useEffect)(()=>{l().finally(()=>void h());let e=()=>void h();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[h]);let f=(0,r.useMemo)(()=>{let e=new Map;for(let t of n?.runs??[])t.baseline&&e.set(t.endpoint,t);return{index:n,error:o,loading:c,refresh:h,baselineFor:t=>e.get(t)}},[n,o,c,h]);return(0,t.jsx)(a.Provider,{value:f,children:e})},"c",0,i,"K",0,function(){return(0,r.useContext)(a)}])},14865,e=>{var t=e.i(72587),r=e.i(55218);let n=[.8,.9,1,1.1,1.25,1.4,1.6],s="apitestcenter-zoom",i="apitestcenter-density",a="apitestcenter-layout",o=(0,r.createContext)({zoom:1,zoomIn:()=>{},zoomOut:()=>{},resetZoom:()=>{},density:"comfortable",setDensity:()=>{},layout:"beside",setLayout:()=>{}});function l(e){try{return localStorage.getItem(e)}catch{return null}}function u(e,t){try{localStorage.setItem(e,t)}catch{}}e.s(["c",0,function({children:e}){let[c,p]=(0,r.useState)(1),[d,h]=(0,r.useState)("comfortable"),[f,m]=(0,r.useState)("beside");(0,r.useEffect)(()=>{let e=Number(l(s));n.includes(e)&&p(e),"compact"===l(i)&&h("compact"),"below"===l(a)&&m("below")},[]),(0,r.useEffect)(()=>{document.documentElement.style.setProperty("--zoom",String(c)),document.documentElement.style.zoom=1===c?"":String(c)},[c]),(0,r.useEffect)(()=>{document.documentElement.dataset.density=d},[d]);let y=(0,r.useCallback)(e=>{p(t=>{let r=n.findIndex(e=>e>=t-.001),i=n[Math.min(n.length-1,Math.max(0,(r<0?2:r)+e))];return u(s,String(i)),i})},[]),g=(0,r.useCallback)(()=>{p(1),u(s,"1")},[]),b=(0,r.useCallback)(e=>{h(e),u(i,e)},[]),v=(0,r.useCallback)(e=>{m(e),u(a,e)},[]);(0,r.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&!e.altKey){if("="===e.key||"+"===e.key)y(1);else if("-"===e.key||"_"===e.key)y(-1);else{if("0"!==e.key)return;g()}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,g]);let w=(0,r.useMemo)(()=>({zoom:c,zoomIn:()=>y(1),zoomOut:()=>y(-1),resetZoom:g,density:d,setDensity:b,layout:f,setLayout:v}),[c,y,g,d,b,f,v]);return(0,t.jsx)(o.Provider,{value:w,children:e})},"C",0,function(e){let t=Number(document.documentElement.style.zoom)||1,r=e.getBoundingClientRect();return{top:r.top/t,left:r.left/t,bottom:r.bottom/t,right:r.right/t,width:r.width/t,height:r.height/t}},"v",0,function(){let e=Number(document.documentElement.style.zoom)||1;return{width:window.innerWidth/e,height:window.innerHeight/e}},"x",0,()=>(0,r.useContext)(o)])},99522,e=>{var t=e.i(55218);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:l,iconNode:u,...c},p)=>(0,t.createElement)("svg",{ref:p,...s,width:r,height:r,stroke:e,strokeWidth:a?24*Number(i)/Number(r):i,className:n("lucide",o),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...u.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["f",0,(e,s)=>{let a=(0,t.forwardRef)(({className:a,...o},l)=>(0,t.createElement)(i,{ref:l,iconNode:s,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...o}));return a.displayName=r(e),a}],99522)},1675,e=>{let t=(0,e.i(99522).f)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["f",0,t],1675)},95486,e=>{let t=(0,e.i(99522).f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,t],95486)},95754,e=>{let t=(0,e.i(99522).f)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["f",0,t])},17118,e=>{var t=e.i(95754);e.s(["f",()=>t.f])},27122,e=>{let t=(0,e.i(99522).f)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["f",0,t],27122)},89932,e=>{let t=(0,e.i(99522).f)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["f",0,t],89932)},75117,e=>{let t=(0,e.i(99522).f)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["f",0,t],75117)},67938,e=>{let t=(0,e.i(99522).f)("file-up",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);e.s(["f",0,t],67938)},42967,e=>{let t=(0,e.i(99522).f)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["f",0,t],42967)},27813,e=>{let t=(0,e.i(99522).f)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["f",0,t],27813)},95987,e=>{let t=(0,e.i(99522).f)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["f",0,t],95987)},71189,e=>{let t=(0,e.i(99522).f)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["f",0,t],71189)},43514,e=>{let t=(0,e.i(99522).f)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);e.s(["f",0,t],43514)},53012,30844,e=>{let t=(0,e.i(99522).f)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["f",0,t],30844),e.s(["f",0,t],53012)},87283,e=>{let t=(0,e.i(99522).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],87283)},24856,86483,70632,15487,59100,99112,75606,64478,89662,36163,78451,5305,25949,90372,47253,48191,2385,94122,54608,55658,46306,60617,81609,88491,94713,19166,30340,54185,e=>{let t,r,n,s,i,a,o,l,u,c,p;e.s(["BIGINT_FORMAT_RANGES",()=>ew,"CONSTANT_CATCH",()=>e6,"Class",()=>eG,"NUMBER_FORMAT_RANGES",()=>ev,"aborted",()=>eM,"allowsEval",()=>ea,"assert",()=>I,"assertEqual",()=>O,"assertIs",()=>j,"assertNever",()=>N,"assertNotEqual",()=>E,"assignProp",()=>Z,"attachSchema",()=>ez,"base64ToUint8Array",()=>eK,"base64urlToUint8Array",()=>eJ,"cached",()=>R,"captureStackTrace",()=>es,"cleanEnum",()=>eB,"cleanRegex",()=>U,"clone",()=>ef,"cloneDef",()=>Y,"codePointLength",()=>eL,"constantCatch",()=>e4,"createTransparentProxy",()=>ey,"defineLazy",()=>B,"defineLazyInternal",()=>e5,"derived",()=>e0,"esc",()=>er,"escapeRegex",()=>eh,"explicitlyAborted",()=>ej,"extend",()=>eS,"finalizeIssue",()=>eC,"floatSafeRemainder",()=>F,"getElementAtPath",()=>Q,"getEnumValues",()=>q,"getLengthableOrigin",()=>eU,"getParsedType",()=>ec,"getSizableOrigin",()=>eP,"hexToUint8Array",()=>eV,"hide",()=>eQ,"installLazyProp",()=>e9,"isObject",()=>ei,"isPlainObject",()=>eo,"issue",()=>eD,"joinValues",()=>z,"jsonStringifyReplacer",()=>C,"members",()=>eX,"merge",()=>eT,"mergeDefs",()=>X,"normalizeParams",()=>em,"nullish",()=>L,"numKeys",()=>eu,"objectClone",()=>K,"omit",()=>e$,"optionalKeys",()=>eb,"own",()=>eY,"parsedType",()=>eF,"partial",()=>eO,"pick",()=>ek,"prefixIssues",()=>eN,"primitiveTypes",()=>ed,"promiseAllObject",()=>ee,"propertyKeyTypes",()=>ep,"randomString",()=>et,"rawShape",()=>J,"required",()=>eE,"safeExtend",()=>eA,"shallowClone",()=>el,"sizeCaps",()=>eq,"slugify",()=>en,"stringifyPrimitive",()=>eg,"toZod",()=>M,"uint8ArrayToBase64",()=>eZ,"uint8ArrayToBase64url",()=>eH,"uint8ArrayToHex",()=>eW,"unwrapMessage",()=>eI],22210),e.s(["_",()=>lv,"j",()=>lT,"n",()=>lx],25949),e.s(["y",()=>pO,"g",()=>pE,"w",()=>pI],90372),Date.parse("2026-08-20T10:00:00.000Z");let d=["p50","p90","p95","p99","p999","max"],h={p50:"Typical (p50)",p90:"Most requests (p90)",p95:"95% of requests (p95)",p99:"Slowest 1% (p99)",p999:"Slowest 0.1% (p99.9)",max:"Slowest (max)"},f=["throughput","peakRps","p95","p50","avg","p99","max","ttfb","errors","checks","vus","requests","dropped","apdex","data","sent","duration"],m={throughput:"Requests per second",p95:"Response time",p99:"Slowest 1%",errors:"Failed requests",vus:"Simulated users",requests:"Total requests",dropped:"Requests not sent",apdex:"User satisfaction",data:"Data received",peakRps:"Peak requests per second",p50:"Typical response time",avg:"Average response time",max:"Slowest response",ttfb:"Server time",checks:"Checks passing",sent:"Data sent",duration:"Test length"},y={throughput:"throughput · RPS",p95:"p95 latency",p99:"p99 latency",errors:"error rate",vus:"VUs",requests:"HTTP requests",dropped:"dropped iterations",apdex:"Apdex",data:"bytes in",peakRps:"max throughput",p50:"p50 · median",avg:"mean latency",max:"max latency",ttfb:"TTFB average",checks:"check pass rate",sent:"bytes out",duration:"run duration"},g=["ttfb","connect","tls","blocked"],b={kpis:{id:"kpis",autoHeight:!0,label:"Key numbers",description:"The headline numbers — speed, response time, failures, users. Pick which ones.",group:"Summary",kinds:["stat","table"],size:{w:12,h:3},min:{w:3,h:3},compare:!0,defaults:{kpis:["throughput","p95","errors","vus","requests"]}},number:{id:"number",autoHeight:!0,label:"Single number",description:"One number, big — place and size it anywhere. Shows the change against your reference run.",group:"Summary",kinds:["stat"],size:{w:3,h:3},min:{w:2,h:2},compare:!0,defaults:{kpis:["p95"]}},heading:{id:"heading",autoHeight:!0,bare:!0,label:"Section heading",description:"A title that groups the widgets under it — like “Speed” or “Reliability”.",group:"Layout",kinds:["panel"],size:{w:12,h:2},min:{w:3,h:1},compare:!0,defaults:{note:""}},verdict:{id:"verdict",autoHeight:!0,label:"Result",tech:"verdict",description:"Pass / warn / fail in plain words, with the reasons.",group:"Summary",kinds:["panel"],size:{w:12,h:3},min:{w:4,h:2},compare:!0},apdex:{id:"apdex",autoHeight:!0,label:"User satisfaction score",tech:"Apdex",description:"0–1 user-satisfaction score from response times against your p95 target (or 500 ms).",group:"Summary",kinds:["stat"],size:{w:3,h:4},min:{w:2,h:3},compare:!0,recent:!0},latency:{id:"latency",label:"Response time",tech:"latency percentiles",description:"Percentiles per second. Pick which percentiles to draw.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{percentiles:["p50","p95","p99"],showTarget:!0}},throughput:{id:"throughput",label:"Requests per second",tech:"throughput",description:"Requests per second, with the target rate in rate mode.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{showTarget:!0}},vus:{id:"vus",label:"Simulated users",tech:"VUs",description:"How many simulated users were sending requests at each moment.",group:"Over time",kinds:["area","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},errors:{id:"errors",label:"Failed requests",tech:"error rate",description:"Share of failed requests per second.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,defaults:{showTarget:!0}},status:{id:"status",label:"Responses by outcome",tech:"HTTP status",description:"Responses per second by outcome: 2xx, 4xx, 5xx, network failures.",group:"Over time",kinds:["stacked-area","stacked-bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!1},data:{id:"data",label:"Data transfer",tech:"bytes in / out",description:"Bytes received and sent per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},serverTime:{id:"serverTime",label:"Server and connection time",tech:"TTFB · TCP · TLS",description:"Average server time (TTFB), connect, TLS, and wait time per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0,defaults:{phases:["ttfb","connect","tls"]}},checksRate:{id:"checksRate",label:"Checks passing",tech:"check pass rate",description:"Share of checks passing each second.",group:"Correctness",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},dropped:{id:"dropped",label:"Requests not sent",tech:"dropped iterations",description:"Requests a rate-mode run could not start each second.",group:"Over time",kinds:["bar","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},histogram:{id:"histogram",label:"Response time spread",tech:"latency histogram",description:"How many requests fell into each response-time band.",group:"Distribution",kinds:["histogram"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0},heatmap:{id:"heatmap",label:"Response time over time, by speed",tech:"latency heatmap",description:"Response-time bands over time; darker = more requests. Shows bimodal or drifting latency.",group:"Distribution",kinds:["heatmap"],size:{w:12,h:8},min:{w:4,h:5},compare:!1,recent:!0},percentiles:{id:"percentiles",label:"Response time distribution",tech:"min · p50 · p95 · p99 · max",description:"min, p50, p90, p95, p99, max over the whole run.",group:"Distribution",kinds:["ladder","table","bar"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},phases:{id:"phases",autoHeight:!0,label:"Where the time went",tech:"timing phases",description:"Average split of each request: DNS, connect, TLS, server, download.",group:"Distribution",kinds:["breakdown","table"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},concurrency:{id:"concurrency",label:"Load vs response time",tech:"VUs or RPS vs p95",description:"Each second as a dot: load against response time. Where the dots bend upward is the point the API starts to struggle.",group:"Distribution",kinds:["scatter"],size:{w:6,h:8},min:{w:3,h:5},compare:!0},targets:{id:"targets",autoHeight:!0,label:"Pass/fail goals",tech:"thresholds and checks",description:"Each target met or missed, and each check's pass rate.",group:"Correctness",kinds:["panel"],size:{w:6,h:7},min:{w:3,h:4},compare:!1},statusTable:{id:"statusTable",autoHeight:!0,label:"Response codes",tech:"HTTP status codes",description:"Count of every HTTP status code returned.",group:"Details",kinds:["table","bar"],size:{w:4,h:6},min:{w:3,h:4},compare:!0},config:{id:"config",autoHeight:!0,label:"Test settings",tech:"run configuration",description:"Method, URL, auth type, load shape, times, bytes.",group:"Details",kinds:["panel"],size:{w:12,h:5},min:{w:4,h:3},compare:!1}},v=Object.keys(b);function w(e,t,r,n,s={}){let i=b[t];return{id:e,metric:t,kind:i.kinds[0],x:r,y:n,w:i.size.w,h:i.size.h,options:i.defaults,...s}}let k=[{id:"builtin-overview",name:"Overview",scope:"run",builtIn:!0,widgets:[w("kpis","kpis",0,0),w("verdict","verdict",0,3),w("latency","latency",0,6),w("throughput","throughput",6,6),w("status","status",0,14),w("percentiles","percentiles",6,14,{h:8}),w("phases","phases",0,22),w("targets","targets",6,22),w("config","config",0,29)]},{id:"builtin-developer",name:"Developer",scope:"run",builtIn:!0,widgets:[w("latency","latency",0,0,{w:12,options:{percentiles:["p50","p90","p95","p99","max"],showTarget:!0}}),w("server","serverTime",0,8),w("phases","phases",6,8,{h:8}),w("histogram","histogram",0,16),w("status","status",6,16),w("heatmap","heatmap",0,24),w("targets","targets",0,32),w("codes","statusTable",6,32,{w:6,h:7})]},{id:"builtin-capacity",name:"Capacity",scope:"run",builtIn:!0,widgets:[w("kpis","kpis",0,0,{options:{kpis:["throughput","p95","errors","vus","dropped"]}}),w("concurrency","concurrency",0,3),w("throughput","throughput",6,3),w("latency","latency",0,11,{options:{percentiles:["p95","p99"],showTarget:!0}}),w("vus","vus",6,11,{h:8}),w("errors","errors",0,19),w("dropped","dropped",6,19)]},{id:"builtin-executive",name:"Executive",scope:"run",builtIn:!0,widgets:[w("verdict","verdict",0,0),w("kpis","kpis",0,3,{w:9,options:{kpis:["p95","errors","throughput","requests"]}}),w("apdex","apdex",9,3,{h:3}),w("latency","latency",0,6,{options:{percentiles:["p95"],showTarget:!0}}),w("targets","targets",6,6,{h:8})]},{id:"builtin-topics",name:"By topic",scope:"run",builtIn:!0,widgets:[w("verdict","verdict",0,0),w("h-speed","heading",0,3,{title:"Speed",options:{note:"How fast the API answers"}}),w("n-p95","number",0,5,{options:{kpis:["p95"]}}),w("n-p50","number",3,5,{options:{kpis:["p50"]}}),w("n-max","number",6,5,{options:{kpis:["max"]}}),w("n-ttfb","number",9,5,{options:{kpis:["ttfb"]}}),w("latency","latency",0,8,{options:{percentiles:["p50","p95","p99"],showTarget:!0}}),w("percentiles","percentiles",6,8),w("h-rel","heading",0,18,{title:"Reliability",options:{note:"Did it answer correctly, every time?"}}),w("n-errors","number",0,20,{options:{kpis:["errors"]}}),w("n-checks","number",3,20,{options:{kpis:["checks"]}}),w("status","status",6,20,{w:6}),w("targets","targets",0,23,{w:6}),w("h-load","heading",0,33,{title:"Load",options:{note:"How much traffic it handled"}}),w("n-rps","number",0,35,{options:{kpis:["throughput"]}}),w("n-peak","number",3,35,{options:{kpis:["peakRps"]}}),w("n-vus","number",6,35,{options:{kpis:["vus"]}}),w("n-total","number",9,35,{options:{kpis:["requests"]}}),w("throughput","throughput",0,38),w("concurrency","concurrency",6,38)]},{id:"builtin-compare",name:"Compare overview",scope:"compare",builtIn:!0,widgets:[w("kpis","kpis",0,0,{kind:"table",h:6,options:{kpis:["throughput","p95","p99","errors","requests"]}}),w("verdict","verdict",0,6,{h:7}),w("latency","latency",0,13,{options:{percentiles:["p95"],showTarget:!0}}),w("throughput","throughput",6,13),w("errors","errors",0,21,{h:7}),w("vus","vus",6,21,{h:7}),w("phases","phases",0,28,{w:12,kind:"table"})]}];function x(e){return k.find(t=>t.scope===e)}let $=(e,t,r)=>Math.min(r,Math.max(t,Math.round(e)));function S(e){if(!e||"object"!=typeof e||"string"!=typeof e.id||!e.id||"string"!=typeof e.name)return null;let t="compare"===e.scope?"compare":"run",r=new Set,n=[];for(let s of Array.isArray(e.widgets)?e.widgets:[]){let e=b[s.metric];if(!e||"compare"===t&&!e.compare)continue;let i="string"==typeof s.id&&s.id?s.id:`${e.id}-${n.length}`;for(;r.has(i);)i=`${i}-x`;r.add(i);let a=e.kinds.includes(s.kind)?s.kind:e.kinds[0],o=$(s.w??e.size.w,e.min.w,12);n.push({id:i,metric:e.id,kind:a,title:"string"==typeof s.title&&s.title.trim()?s.title.trim().slice(0,80):void 0,options:function(e,t){let r=t&&"object"==typeof t?t:{},n=(e,t,r)=>{let n=Array.isArray(e)?e.filter(e=>t.includes(e)):[];return n.length?n:r},s={};if(e.defaults?.percentiles&&(s.percentiles=n(r.percentiles,d,e.defaults.percentiles)),e.defaults?.kpis){let t=[...new Set(n(r.kpis,f,e.defaults.kpis))];s.kpis="number"===e.id?t.slice(0,1):t}return e.defaults?.note!==void 0&&(s.note="string"==typeof r.note?r.note.slice(0,200):""),e.defaults?.phases&&(s.phases=n(r.phases,g,e.defaults.phases)),e.defaults?.showTarget!==void 0&&(s.showTarget=r.showTarget??e.defaults.showTarget),Object.keys(s).length?s:void 0}(e,s.options),x:$(s.x??0,0,12-o),y:$(s.y??0,0,1e4),w:o,h:$(s.h??e.size.h,e.min.h,40)})}return{id:e.id,name:e.name.trim().slice(0,60)||"Untitled view",scope:t,builtIn:!0===e.builtIn,widgets:n}}function _(e){return e.title?e.title:"number"===e.metric?m[e.options?.kpis?.[0]??"p95"]:b[e.metric].label}function A(e){if(!e.title)return"number"===e.metric?y[e.options?.kpis?.[0]??"p95"]:b[e.metric].tech}function T(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}function O(e){return e}function E(e){return e}function M(){return e=>e}function j(e){}function N(e){throw Error("Unexpected value in exhaustive check")}function I(e){}function q(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function z(e,t="|"){return e.map(e=>eg(e)).join(t)}function C(e,t){return"bigint"==typeof t?t.toString():t}e.s(["W",0,k,"Z",0,{line:"Line",area:"Area",bar:"Bars","stacked-area":"Stacked area","stacked-bar":"Stacked bars",stat:"Numbers",table:"Table",histogram:"Histogram",heatmap:"Heatmap",ladder:"Percentile ladder",breakdown:"Breakdown bar",scatter:"Scatter",panel:"Panel"},"c",0,12,"B",0,36,"f",0,f,"O",0,m,"t",0,y,"U",0,b,"r",0,d,"T",0,h,"E",0,g,"J",0,{ttfb:"Server time (TTFB)",connect:"TCP connect",tls:"TLS handshake",blocked:"Waiting for a connection"},"g",0,x,"s",0,function(e){let t={latency:"latency",throughput:"throughput",status:"status",phases:"phase",percentiles:"percentiles",targets:"thresholds"},r=[];for(let n of T(e.widgets)){let e=t[n.metric];!e||r.some(t=>t.id===e)||r.push({id:e,w:n.w>=9?2:1,h:n.h>=12?2:1})}return r},"x",0,function(e){return v.map(e=>b[e]).filter(t=>"run"===e||t.compare)},"A",0,function(e,t,r){let n=T(e),s=n.findIndex(e=>e.id===t);if(s<0)return e;if("first"===r||"last"===r){let e=n[s],i=n.filter(e=>e.id!==t);if("first"===r)return[{...e,x:0,y:0},...i.map(t=>({...t,y:t.y+e.h}))];let a=i.reduce((e,t)=>Math.max(e,t.y+t.h),0);return[...i,{...e,x:0,y:a}]}let i="earlier"===r?s-1:s+1;if(i<0||i>=n.length)return e;let a=n[s],o=n[i];return e.map(e=>e.id===a.id?{...e,x:Math.min(o.x,12-e.w),y:o.y}:e.id===o.id?{...e,x:Math.min(a.x,12-e.w),y:a.y}:e)},"V",0,function(e,t){let r=b[e],n=t.reduce((e,t)=>Math.max(e,t.y+t.h),0),s=t.length+1,i=new Set(t.map(e=>e.id));for(;i.has(`${e}-${s}`);)s++;return{id:`${e}-${s}`,metric:e,kind:r.kinds[0],title:"heading"===e?"New section":void 0,x:0,y:n,w:r.size.w,h:r.size.h,options:r.defaults}},"R",0,S,"e",0,function(e){let t=e&&"object"==typeof e?e:{},r=(Array.isArray(t.views)?t.views:[]).map(S).filter(e=>!!e&&!e.builtIn&&!e.id.startsWith("builtin-")),n=[...k,...r],s=(e,t)=>"string"==typeof t&&n.some(r=>r.id===t&&r.scope===e)?t:x(e).id;return{version:1,defaults:{run:s("run",t.defaults?.run),compare:s("compare",t.defaults?.compare)},views:r}},"F",0,T,"u",0,function(e,t,r,n){return e.map(e=>{if(e.id!==t)return e;let s=b[e.metric],i=$(e.w+r,s.min.w,12);return{...e,w:i,h:$(e.h+n,s.min.h,40),x:Math.min(e.x,12-i)}})},"X",0,A,"L",0,_],86483);class P{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function R(e){return new P(e)}function L(e){return null==e}function U(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function F(e,t){let r=e/t,n=Math.round(r),s=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<s?0:r-n}let D=Symbol("evaluating");function B(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==D)return void 0===n&&(n=D,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function K(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Z(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function J(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function H(e){return J(e._zod.def)??e._zod.def.shape}function V(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return Z(this,t,e),e},enumerable:!0,configurable:!0})}function W(e,t,r){t in e?Z(e,t,r):e[t]=r}function G(e,t,r,n){let s=H(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(s,i);r.enumerable&&(r.get?V(e,i,()=>{let e=t._zod.def.shape[i];return n?n(e,i):e}):W(e,i,n?n(r.value,i):r.value))}}function X(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function Y(e){return X(e._zod.def)}function Q(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ee(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function et(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function er(e){return JSON.stringify(e)}function en(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let es="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ea=R(()=>{if(tr.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eo(e){if(!1===ei(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==ei(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function el(e){return eo(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function eu(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let ec=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},ep=new Set(["string","number","symbol"]),ed=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ef(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function em(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ey(e){let t;return new Proxy({},{get:(r,n,s)=>(t??(t=e()),Reflect.get(t,n,s)),set:(r,n,s,i)=>(t??(t=e()),Reflect.set(t,n,s,i)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,s)=>(t??(t=e()),Reflect.defineProperty(t,n,s))})}function eg(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function eb(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let ev={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ew={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ek(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return G(s,e,ex(e,t)),ef(e,X(r,{shape:s,checks:[]}))}function ex(e,t){let r=H(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function e$(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ex(e,t)),i={};return G(i,e,Reflect.ownKeys(H(e)).filter(e=>!s.has(e))),ef(e,X(r,{shape:i,checks:[]}))}function eS(e,t){if(!eo(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=H(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ef(e,X(e._zod.def,{shape:e_(e,t)}))}function e_(e,t){let r={};G(r,e,Reflect.ownKeys(H(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?V(r,e,()=>t[e]):W(r,e,n.value))}return r}function eA(e,t){if(!eo(t))throw Error("Invalid input to safeExtend: expected a plain object");return ef(e,X(e._zod.def,{shape:e_(e,t)}))}function eT(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(H(e))),G(r,t,Reflect.ownKeys(H(t)));let n=X(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ef(e,n)}function eO(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let i=r?new Set(ex(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(H(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),ef(t,X(t._zod.def,{shape:a,checks:[]}))}function eE(e,t,r){let n=r?new Set(ex(t,r)):void 0,s={};return G(s,t,Reflect.ownKeys(H(t)),(t,r)=>n&&!n.has(r)?t:new e({type:"nonoptional",innerType:t})),ef(t,X(t._zod.def,{shape:s}))}function eM(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ej(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function eN(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eI(e){return"string"==typeof e?e:e?.message}function eq(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,r])}return t}function ez(e,t,r){var n;for(let s=t;s<e.length;s++)(n=e[s]).schema??(n.schema=r)}function eC(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eI(e.inst?._zod.def?.error?.(e))??eI(s?.(e))??eI(t?.error?.(e))??eI(r.customError?.(e))??eI(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function eP(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let eR=/[\uD800-\uDBFF]/;function eL(e){let t=e.length;if(!eR.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function eU(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eF(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function eD(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eB(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function eK(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function eZ(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function eJ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eK(t+r)}function eH(e){return eZ(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eV(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function eW(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class eG{constructor(...e){}}function eX(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eY(this,t,r.bind(this))},set(e){eY(this,t,e)}})}(e,r,n.value)}}function eY(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function eQ(e,t,r){return eY(e,t,r,!1)}function e0(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eY(this,r,n(this))},set(e){eY(this,r,e)}})}return t}let e1=!1,e2={configurable:!0,get(){e1=!0}};function e5(e,r,n){let s=Object.getPrototypeOf(e._zod);if(r in s&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(s,r,{configurable:!0,get(){Object.defineProperty(this,r,e2);let e=e1;e1=!1;try{let t=n(this);return e1?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),e1=e1||e,t}catch(t){throw delete this[r],e1=e1||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}function e9(e,t,r,n){let s,i=t in(s=Object.getPrototypeOf(e))?void 0:s;i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,e),e.value=r(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:e})}})}let e6="~constantCatch";function e4(e){let t=()=>e;return t[e6]=!0,t}let e3={value:void 0,enumerable:!1},e8="captureStackTrace"in Error?Error:null;function e7(e,t,r,n){function s(e){this.def=e,this.constr=u,this.traits=new Set}s.prototype={};let i=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{e3.value=new s(a);try{Object.defineProperty(n,"_zod",e3)}finally{e3.value=void 0}}if(n._zod.traits.add(e),t(n,a),i){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,s=e;for(;s&&s!==t;)s=Object.getPrototypeOf(s);let a=s??e;i.has(a)||(i.add(a),eX(a,r))}let o=u.prototype;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(e in n||(n[e]=o[e].bind(n)))}let o=n?.Parent??Object;class l extends o{}function u(e){let t=n?.Parent?function(e){let t=e8;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return e8=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let s=globalThis.__zod_globalConfig?.postProcessor;return s&&s(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class te extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(sb=globalThis).__zod_globalConfig??(sb.__zod_globalConfig={});let tr=globalThis.__zod_globalConfig;function tn(e){return e&&Object.assign(tr,e),tr}class ts extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let ti="~memo",ta=[];function to(e){return null!==e&&"object"==typeof e}function tl(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let tu=new WeakMap,tc=[],tp={alloc(e,t,n){let s=r;if(!s)return n;r=void 0;let i={value:n,issues:null};return s.set(t.value,i),tc.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,s;let i;if("backward"!==r.direction&&(n=r,s=e.value,void 0!==(i=n[ti]?.backEdges)&&to(s)&&i.has(s)))throw new ts;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var t;let n,s,i,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(l,u)=>{let c;if(void 0===n){let r=function e(t,r,n){var s,i;let a=tu.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let o=0,l=t=>{if(2!==o&&t?._zod){let s=e(t,r,n);s>o&&(o=s)}},u=e=>{e>o&&(o=e)},c=t._zod.def;switch(c.type){case"object":{let t=J(c);u(t?((t,s)=>{let i=0;for(let a of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,a);if(s&&!o.enumerable)continue;let l=o.get?1:o.value?._zod?e(o.value,r,n):0;l>i&&(i=l)}return i})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let s=c._cachedInner??(n?t._zod.innerType:void 0);u(s?e(s,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),s=t,1!==(i=o)&&tu.set(s,2===i),i}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(l,u);2===r||a?n=!0:a=!0}let p=l.value;if(!to(p))return t(l,u);let d=u[ti];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[ti]=d),s===u)c=i;else{var h;let t;(t=(h=d).buckets.get(e))||(t=new WeakMap,h.buckets.set(e,t)),c=t,s=u,i=c}let f=c.get(p);if(f)return l.value=f.value,f.issues?f.issues.length&&l.issues.push(...tl(f.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),l;r=c;let m=tc.length,y=t(l,u);r=void 0;let g=tc.length>m?tc.pop():void 0;return y instanceof Promise?y.then(e=>(g&&(g.issues=e.issues.length?tl(e.issues):ta),e)):(g&&(g.issues=y.issues.length?tl(y.issues):ta),y)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};(sv=globalThis).__zod_globalRegistry??(sv.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let td=globalThis.__zod_globalRegistry,th=/^[cC][0-9a-z]{6,}$/,tf=/^[0-9a-z]+$/,tm=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ty=/^[0-9a-vA-V]{20}$/,tg=/^[A-Za-z0-9]{27}$/,tb=/^[a-zA-Z0-9_-]{21}$/;function tv(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let tw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tx=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,t$=tx(4),tS=tx(6),t_=tx(7),tA=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tT=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function tO(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let tE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tj=e=>{let t=eh(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tq=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tz=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tC=/^https?$/,tP=/^\+[1-9]\d{6,14}$/,tR=/^\d(?:[ -]?\d){11,18}$/,tL=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tU="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tF=RegExp(`^${tU}$`);function tD(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tB(e){return RegExp(`^${tD(e)}$`)}function tK(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${tD({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${tD({precision:e.precision})}`:r;return RegExp(`^${tU}T(?:${n})$`)}let tZ=/^[\s\S]{0,}$/,tJ=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tH=/^-?\d+n?$/,tV=/^-?\d+$/,tW=/^-?\d+(?:\.\d+)?$/,tG=/^(?:true|false)$/i,tX=/^null$/i,tY=/^undefined$/i,tQ=/^[^A-Z]*$/,t0=/^[^a-z]*$/;function t1(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function t2(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let t5=t1(22,"=="),t9=t2(22),t6=t1(27,"="),t4=t2(27),t3=t1(43,"="),t8=t2(43),t7=t1(64,""),re=t2(64),rt=t1(86,"=="),rr=t2(86);e.s(["anyString",0,tZ,"base64",0,tq,"base64url",0,tz,"bigint",0,tH,"boolean",0,tG,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,tN,"cidrv6",0,tI,"creditCard",0,tR,"cuid",0,th,"cuid2",0,tf,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,tF,"datetime",0,tK,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,tw,"e164",0,tP,"email",0,tA,"emoji",0,tO,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,tk,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,tC,"iban",0,tL,"idnEmail",0,tT,"integer",0,tV,"ipv4",0,tE,"ipv6",0,tM,"ksuid",0,tg,"lowercase",0,tQ,"mac",0,tj,"md5_base64",0,t5,"md5_base64url",0,t9,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,tb,"nanoidOfLength",0,tv,"null",0,tX,"number",0,tW,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,t6,"sha1_base64url",0,t4,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,t3,"sha256_base64url",0,t8,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,t7,"sha384_base64url",0,re,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,rt,"sha512_base64url",0,rr,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tJ,"time",0,tB,"ulid",0,tm,"undefined",0,tY,"unicodeEmail",0,tT,"uppercase",0,t0,"uuid",0,tx,"uuid4",0,t$,"uuid6",0,tS,"uuid7",0,t_,"xid",0,ty],79692);let rn=e7("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rs=e=>{let t=e.value;return!L(t)&&void 0!==t.size},ri=e=>{let t=e.value;return!L(t)&&void 0!==t.length},ra={number:"number",bigint:"bigint",object:"date"},ro=e7("$ZodCheckLessThan",(e,t)=>{rn.init(e,t);let r=ra[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ra[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=e7("$ZodCheckGreaterThan",(e,t)=>{rn.init(e,t);let r=ra[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ra[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ru=e7("$ZodCheckMultipleOf",(e,t)=>{rn.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0===F(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),rc=e7("$ZodCheckNumberFormat",(e,t)=>{rn.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,i]=ev[t.format];e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>i&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),rp=e7("$ZodCheckBigIntFormat",(e,t)=>{rn.init(e,t);let[r,n]=ew[t.format];e._zod.check=s=>{let i=s.value;i<r&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),rd=e7("$ZodCheckMaxSize",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:eP(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rh=e7("$ZodCheckMinSize",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:eP(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rf=e7("$ZodCheckSizeEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let i=s>t.size;r.issues.push({origin:eP(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rm=e7("$ZodCheckMaxLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>t.maximum?eL(n):s)<=t.maximum)return;let i=eU(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ry=e7("$ZodCheckMinLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>=t.minimum&&s<2*t.minimum?eL(n):s)>=t.minimum)return;let i=eU(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rg=e7("$ZodCheckLengthEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length,i="string"==typeof n&&s>=t.length&&s<=2*t.length?eL(n):s;if(i===t.length)return;let a=eU(n),o=i>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rb=e7("$ZodCheckStringFormat",(e,t)=>{var r,n;rn.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),rv=e7("$ZodCheckRegex",(e,t)=>{rb.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rw=e7("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tQ),rb.init(e,t)}),rk=e7("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=t0),rb.init(e,t)}),rx=e7("$ZodCheckIncludes",(e,t)=>{rn.init(e,t);let r=eh(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),r$=e7("$ZodCheckStartsWith",(e,t)=>{rn.init(e,t);let r=RegExp(`^${eh(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),rS=e7("$ZodCheckEndsWith",(e,t)=>{rn.init(e,t);let r=RegExp(`.*${eh(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function r_(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues))}(e,t)=>{let r;rn.init(e,t),eQ(e,Symbol.iterator,function*(){yield e}),e._zod.check=n=>{let s;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let i=n.value;for(let[e,t]of r){let r=t._zod.run({value:i[e],issues:[]},{});r instanceof Promise?(s??(s=[]),s.push(r.then(t=>r_(t,n,e)))):r_(r,n,e)}if(s)return Promise.all(s).then(()=>void 0)}},(e,t)=>{rn.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let rA=e7("$ZodCheckOverwrite",(e,t)=>{rn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rT{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[22543,e=>{var t=e.i(72587),r=e.i(55218),n=e.i(90484),s=e.i(14865);e.s(["f",0,function({text:e,label:i="More information"}){let a=(0,r.useRef)(null),o=(0,r.useRef)(null),[l,u]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1),[d,h]=(0,r.useState)(null),f=l||c;return(0,r.useLayoutEffect)(()=>{if(!f)return h(null);let e=()=>{if(!a.current)return;let e=(0,s.C)(a.current),t=(0,s.v)(),r=Math.min(256,t.width-32),n=o.current?.offsetHeight??80,i=Math.min(Math.max(16,e.left),t.width-r-16);h({top:e.bottom+6+n<=t.height-8?e.bottom+6:Math.max(8,e.top-6-n),left:i})};e();let t=requestAnimationFrame(e);return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f]),(0,r.useEffect)(()=>{if(!l)return;let e=e=>{let t=e.target;a.current?.contains(t)||o.current?.contains(t)||u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[l]),(0,t.jsxs)("span",{ref:a,className:"relative inline-flex align-middle",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,t.jsx)("button",{type:"button",className:"grid h-4 w-4 place-items-center rounded-full border border-line text-[11px] leading-none text-mute hover:border-accent hover:text-accent","aria-label":i,"aria-expanded":f,onClick:e=>{e.stopPropagation(),u(e=>!e)},onFocus:()=>p(!0),onBlur:()=>p(!1),children:"?"}),f&&"u">typeof document?(0,n.createPortal)((0,t.jsx)("span",{ref:o,role:"tooltip",style:{width:"min(256px, calc(100vw - 2rem))",top:d?.top??-9999,left:d?.left??-9999},className:"fixed z-[80] rounded-md border border-line bg-panel-2 px-2.5 py-2 text-xs leading-5 font-normal tracking-normal text-ink normal-case shadow-lg",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:e}),document.body):null]})}])},39170,e=>{var t=e.i(72587),r=e.i(53012),n=e.i(55218);let s=(0,n.createContext)(async()=>!1);function i({options:e,onClose:s}){let a=(0,n.useRef)(null),o=(0,n.useRef)(null),l=(0,n.useRef)(null),u="danger"===e.tone;return(0,n.useEffect)(()=>{let e=document.activeElement;return(u?o:l).current?.focus(),()=>e?.focus()},[u]),(0,t.jsx)("div",{className:"fixed inset-0 z-[95] grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>{e.target===e.currentTarget&&s(!1)},children:(0,t.jsxs)("div",{ref:a,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",onKeyDown:function(e){if("Escape"===e.key&&(e.stopPropagation(),s(!1)),"Tab"===e.key){let t=a.current?.querySelectorAll("button");if(!t||0===t.length)return;let r=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),r.focus())}},className:"w-full max-w-md rounded-xl border border-line bg-panel p-5 shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[u?(0,t.jsx)("span",{className:"mt-0.5 grid h-8 w-8 shrink-0 place-items-center rounded-full bg-warn/15 text-warn",children:(0,t.jsx)(r.f,{size:16})}):null,(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{id:"confirm-title",className:"text-base font-medium text-ink",children:e.title}),e.body?(0,t.jsx)("div",{className:"mt-2 text-sm text-mute",children:e.body}):null]})]}),(0,t.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,t.jsx)("button",{ref:o,type:"button",className:"btn btn-secondary",onClick:()=>s(!1),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{ref:l,type:"button",className:"btn btn-primary",onClick:()=>s(!0),children:e.confirmLabel??"Continue"})]})]})})}e.s(["a",0,function({children:e}){let[r,a]=(0,n.useState)(null),o=(0,n.useCallback)(e=>new Promise(t=>a({...e,resolve:t})),[]);return(0,t.jsxs)(s.Provider,{value:o,children:[e,r?(0,t.jsx)(i,{options:r,onClose:function(e){r?.resolve(e),a(null)}}):null]})},"L",0,function(){return(0,n.useContext)(s)}])},28867,e=>{var t=e.i(72587);e.s(["f",0,function({value:e,options:r,onChange:n,label:s,size:i="sm"}){return(0,t.jsx)("div",{role:"group","aria-label":s,className:"inline-flex flex-wrap rounded-md border border-line bg-panel-2 p-0.5",children:r.map(r=>{let s=r.value===e;return(0,t.jsx)("button",{type:"button","aria-pressed":s,title:r.title,onClick:()=>n(r.value),className:`rounded px-2.5 ${"md"===i?"py-1.5 text-sm":"py-1 text-xs"} transition-colors ${s?"bg-panel text-ink shadow-sm":"text-mute hover:text-ink"}`,children:r.label},r.value)})})}])},56396,e=>{var t=e.i(72587),r=e.i(17118),n=e.i(42967),s=e.i(87283),i=e.i(27122),a=e.i(55218);let o=(0,a.createContext)(()=>{}),l=1;e.s(["N",0,function({children:e}){let[u,c]=(0,a.useState)([]),p=(0,a.useCallback)(e=>c(t=>t.filter(t=>t.id!==e)),[]),d=(0,a.useCallback)((e,t="info")=>{let r=l++;c(n=>[...n.slice(-3),{id:r,tone:t,message:e}]),window.setTimeout(()=>p(r),"error"===t?6e3:3200)},[p]);return(0,t.jsxs)(o.Provider,{value:d,children:[e,(0,t.jsx)("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 z-50 flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2",children:u.map(e=>{let a="success"===e.tone?r.f:"error"===e.tone?i.f:n.f,o="success"===e.tone?"text-ok":"error"===e.tone?"text-bad":"text-accent";return(0,t.jsxs)("div",{role:"error"===e.tone?"alert":"status",className:"pointer-events-auto flex items-start gap-2 rounded-lg border border-line bg-panel px-3 py-2.5 text-sm text-ink shadow-xl",children:[(0,t.jsx)(a,{size:16,className:`mt-0.5 shrink-0 ${o}`}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e.message}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"shrink-0 rounded p-0.5 text-mute hover:text-ink",onClick:()=>p(e.id),children:(0,t.jsx)(s.X,{size:14})})]},e.id)})})]})},"d",0,function(){return(0,a.useContext)(o)}])},44505,e=>{e.s(["f",0,function(){return window.atcDesktop??null}])},15060,e=>{function t(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(),setTimeout(()=>URL.revokeObjectURL(r),6e4)}e.s(["h",0,t,"N",0,function(e,r,n){t(e,new Blob([r],{type:n}))}])},19656,e=>{e.s(["L",0,function(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`},"B",0,function(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})},"W",0,function(e){return new Intl.NumberFormat("en-US").format(Math.round(e))},"M",0,function(e,t){let r=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));if(r<60)return`${r}s`;let n=Math.floor(r/60),s=r%60;return s?`${n}m ${s}s`:`${n}m`},"E",0,function(e){return Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:`${Math.round(e)} ms`:"—"},"Z",0,function(e){return`${(100*e).toFixed(e<.01?2:1)}%`},"m",0,function(e){return Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—"}])},59180,e=>{var t=e.i(72587),r=e.i(55218);async function n(e){let t=await e.text(),r=null;try{r=t?JSON.parse(t):null}catch{}if(!e.ok)throw Error(r?.error??`Engine error (${e.status})`);return r}let s=(e,t)=>fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),i={index:()=>fetch("/engine/history",{cache:"no-store"}).then(e=>n(e)),run:e=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),compare:e=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),updateRun:(e,t)=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>n(e)),updateCompare:(e,t)=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>n(e)),remove:e=>s("/engine/history/delete",e).then(e=>n(e)),saveCompare:e=>s("/engine/history/compares",e).then(e=>n(e)),import:e=>s("/engine/history/import",e).then(e=>n(e)),reveal:e=>s("/engine/history/reveal",e??{}).then(e=>n(e))},a=(0,r.createContext)({index:null,error:null,loading:!0,refresh:async()=>null,baselineFor:()=>void 0}),o="apitestcenter-history-migrated";async function l(){try{if(localStorage.getItem(o))return;let e=JSON.parse(sessionStorage.getItem("apitestcenter-session-runs")??"[]"),t=JSON.parse(sessionStorage.getItem("apitestcenter-compare-history")??"[]");for(let t of Array.isArray(e)?e:[])await i.import({report:t}).catch(()=>void 0);for(let e of Array.isArray(t)?t:[])e?.apis&&!(e.apis.length<2)&&await i.import({kind:"compare",mode:"parallel"===e.mode?"parallel":"sequence",apis:e.apis,meta:{name:e.title}}).catch(()=>void 0);sessionStorage.removeItem("apitestcenter-session-runs"),sessionStorage.removeItem("apitestcenter-compare-history"),localStorage.setItem(o,new Date().toISOString())}catch{}}e.s(["w",0,function({children:e}){let[n,s]=(0,r.useState)(null),[o,u]=(0,r.useState)(null),[c,p]=(0,r.useState)(!0),d=(0,r.useRef)(null),h=(0,r.useCallback)(()=>{if(d.current)return d.current;let e=i.index().then(e=>(s(e),u(null),e)).catch(e=>(u(e instanceof Error?e.message:"History unavailable"),null)).finally(()=>{p(!1),d.current=null});return d.current=e,e},[]);(0,r.useEffect)(()=>{l().finally(()=>void h());let e=()=>void h();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[h]);let f=(0,r.useMemo)(()=>{let e=new Map;for(let t of n?.runs??[])t.baseline&&e.set(t.endpoint,t);return{index:n,error:o,loading:c,refresh:h,baselineFor:t=>e.get(t)}},[n,o,c,h]);return(0,t.jsx)(a.Provider,{value:f,children:e})},"c",0,i,"K",0,function(){return(0,r.useContext)(a)}])},14865,e=>{var t=e.i(72587),r=e.i(55218);let n=[.8,.9,1,1.1,1.25,1.4,1.6],s="apitestcenter-zoom",i="apitestcenter-density",a="apitestcenter-layout",o=(0,r.createContext)({zoom:1,zoomIn:()=>{},zoomOut:()=>{},resetZoom:()=>{},density:"comfortable",setDensity:()=>{},layout:"beside",setLayout:()=>{}});function l(e){try{return localStorage.getItem(e)}catch{return null}}function u(e,t){try{localStorage.setItem(e,t)}catch{}}e.s(["c",0,function({children:e}){let[c,p]=(0,r.useState)(1),[d,h]=(0,r.useState)("comfortable"),[f,m]=(0,r.useState)("beside");(0,r.useEffect)(()=>{let e=Number(l(s));n.includes(e)&&p(e),"compact"===l(i)&&h("compact"),"below"===l(a)&&m("below")},[]),(0,r.useEffect)(()=>{document.documentElement.style.setProperty("--zoom",String(c)),document.documentElement.style.zoom=1===c?"":String(c)},[c]),(0,r.useEffect)(()=>{document.documentElement.dataset.density=d},[d]);let y=(0,r.useCallback)(e=>{p(t=>{let r=n.findIndex(e=>e>=t-.001),i=n[Math.min(n.length-1,Math.max(0,(r<0?2:r)+e))];return u(s,String(i)),i})},[]),g=(0,r.useCallback)(()=>{p(1),u(s,"1")},[]),b=(0,r.useCallback)(e=>{h(e),u(i,e)},[]),v=(0,r.useCallback)(e=>{m(e),u(a,e)},[]);(0,r.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&!e.altKey){if("="===e.key||"+"===e.key)y(1);else if("-"===e.key||"_"===e.key)y(-1);else{if("0"!==e.key)return;g()}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,g]);let w=(0,r.useMemo)(()=>({zoom:c,zoomIn:()=>y(1),zoomOut:()=>y(-1),resetZoom:g,density:d,setDensity:b,layout:f,setLayout:v}),[c,y,g,d,b,f,v]);return(0,t.jsx)(o.Provider,{value:w,children:e})},"C",0,function(e){let t=Number(document.documentElement.style.zoom)||1,r=e.getBoundingClientRect();return{top:r.top/t,left:r.left/t,bottom:r.bottom/t,right:r.right/t,width:r.width/t,height:r.height/t}},"v",0,function(){let e=Number(document.documentElement.style.zoom)||1;return{width:window.innerWidth/e,height:window.innerHeight/e}},"x",0,()=>(0,r.useContext)(o)])},99522,e=>{var t=e.i(55218);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:l,iconNode:u,...c},p)=>(0,t.createElement)("svg",{ref:p,...s,width:r,height:r,stroke:e,strokeWidth:a?24*Number(i)/Number(r):i,className:n("lucide",o),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...u.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["f",0,(e,s)=>{let a=(0,t.forwardRef)(({className:a,...o},l)=>(0,t.createElement)(i,{ref:l,iconNode:s,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...o}));return a.displayName=r(e),a}],99522)},1675,e=>{let t=(0,e.i(99522).f)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["f",0,t],1675)},95486,e=>{let t=(0,e.i(99522).f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,t],95486)},95754,e=>{let t=(0,e.i(99522).f)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["f",0,t])},17118,e=>{var t=e.i(95754);e.s(["f",()=>t.f])},27122,e=>{let t=(0,e.i(99522).f)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["f",0,t],27122)},89932,e=>{let t=(0,e.i(99522).f)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["f",0,t],89932)},75117,e=>{let t=(0,e.i(99522).f)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["f",0,t],75117)},67938,e=>{let t=(0,e.i(99522).f)("file-up",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);e.s(["f",0,t],67938)},42967,e=>{let t=(0,e.i(99522).f)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["f",0,t],42967)},27813,e=>{let t=(0,e.i(99522).f)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["f",0,t],27813)},95987,e=>{let t=(0,e.i(99522).f)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["f",0,t],95987)},71189,e=>{let t=(0,e.i(99522).f)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["f",0,t],71189)},43514,e=>{let t=(0,e.i(99522).f)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);e.s(["f",0,t],43514)},53012,30844,e=>{let t=(0,e.i(99522).f)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["f",0,t],30844),e.s(["f",0,t],53012)},87283,e=>{let t=(0,e.i(99522).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],87283)},24856,86483,70632,15487,59100,99112,75606,64478,89662,36163,78451,5305,25949,90372,47253,48191,2385,94122,54608,55658,46306,60617,81609,88491,94713,19166,30340,54185,e=>{let t,r,n,s,i,a,o,l,u,c,p;e.s(["BIGINT_FORMAT_RANGES",()=>ew,"CONSTANT_CATCH",()=>e6,"Class",()=>eG,"NUMBER_FORMAT_RANGES",()=>ev,"aborted",()=>eM,"allowsEval",()=>ea,"assert",()=>I,"assertEqual",()=>O,"assertIs",()=>j,"assertNever",()=>N,"assertNotEqual",()=>E,"assignProp",()=>Z,"attachSchema",()=>ez,"base64ToUint8Array",()=>eK,"base64urlToUint8Array",()=>eJ,"cached",()=>R,"captureStackTrace",()=>es,"cleanEnum",()=>eB,"cleanRegex",()=>U,"clone",()=>ef,"cloneDef",()=>Y,"codePointLength",()=>eL,"constantCatch",()=>e4,"createTransparentProxy",()=>ey,"defineLazy",()=>B,"defineLazyInternal",()=>e5,"derived",()=>e0,"esc",()=>er,"escapeRegex",()=>eh,"explicitlyAborted",()=>ej,"extend",()=>eS,"finalizeIssue",()=>eC,"floatSafeRemainder",()=>F,"getElementAtPath",()=>Q,"getEnumValues",()=>q,"getLengthableOrigin",()=>eU,"getParsedType",()=>ec,"getSizableOrigin",()=>eP,"hexToUint8Array",()=>eV,"hide",()=>eQ,"installLazyProp",()=>e9,"isObject",()=>ei,"isPlainObject",()=>eo,"issue",()=>eD,"joinValues",()=>z,"jsonStringifyReplacer",()=>C,"members",()=>eX,"merge",()=>eT,"mergeDefs",()=>X,"normalizeParams",()=>em,"nullish",()=>L,"numKeys",()=>eu,"objectClone",()=>K,"omit",()=>e$,"optionalKeys",()=>eb,"own",()=>eY,"parsedType",()=>eF,"partial",()=>eO,"pick",()=>ek,"prefixIssues",()=>eN,"primitiveTypes",()=>ed,"promiseAllObject",()=>ee,"propertyKeyTypes",()=>ep,"randomString",()=>et,"rawShape",()=>J,"required",()=>eE,"safeExtend",()=>eA,"shallowClone",()=>el,"sizeCaps",()=>eq,"slugify",()=>en,"stringifyPrimitive",()=>eg,"toZod",()=>M,"uint8ArrayToBase64",()=>eZ,"uint8ArrayToBase64url",()=>eH,"uint8ArrayToHex",()=>eW,"unwrapMessage",()=>eI],22210),e.s(["_",()=>lv,"j",()=>lT,"n",()=>lx],25949),e.s(["y",()=>pO,"g",()=>pE,"w",()=>pI],90372),Date.parse("2026-08-20T10:00:00.000Z");let d=["p50","p90","p95","p99","p999","max"],h={p50:"Typical (p50)",p90:"Most requests (p90)",p95:"95% of requests (p95)",p99:"Slowest 1% (p99)",p999:"Slowest 0.1% (p99.9)",max:"Slowest (max)"},f=["throughput","peakRps","p95","p50","avg","p99","max","ttfb","errors","checks","vus","requests","dropped","apdex","data","sent","duration"],m={throughput:"Requests per second",p95:"Response time",p99:"Slowest 1%",errors:"Failed requests",vus:"Simulated users",requests:"Total requests",dropped:"Requests not sent",apdex:"User satisfaction",data:"Data received",peakRps:"Peak requests per second",p50:"Typical response time",avg:"Average response time",max:"Slowest response",ttfb:"Server time",checks:"Checks passing",sent:"Data sent",duration:"Test length"},y={throughput:"throughput · RPS",p95:"p95 latency",p99:"p99 latency",errors:"error rate",vus:"VUs",requests:"HTTP requests",dropped:"dropped iterations",apdex:"Apdex",data:"bytes in",peakRps:"max throughput",p50:"p50 · median",avg:"mean latency",max:"max latency",ttfb:"TTFB average",checks:"check pass rate",sent:"bytes out",duration:"run duration"},g=["ttfb","connect","tls","blocked"],b={kpis:{id:"kpis",autoHeight:!0,label:"Key numbers",description:"The headline numbers — speed, response time, failures, users. Pick which ones.",group:"Summary",kinds:["stat","table"],size:{w:12,h:3},min:{w:3,h:3},compare:!0,defaults:{kpis:["throughput","p95","errors","vus","requests"]}},number:{id:"number",autoHeight:!0,label:"Single number",description:"One number, big — place and size it anywhere. Shows the change against your reference run.",group:"Summary",kinds:["stat"],size:{w:3,h:3},min:{w:2,h:2},compare:!0,defaults:{kpis:["p95"]}},heading:{id:"heading",autoHeight:!0,bare:!0,label:"Section heading",description:"A title that groups the widgets under it — like “Speed” or “Reliability”.",group:"Layout",kinds:["panel"],size:{w:12,h:2},min:{w:3,h:1},compare:!0,defaults:{note:""}},verdict:{id:"verdict",autoHeight:!0,label:"Result",tech:"verdict",description:"Pass / warn / fail in plain words, with the reasons.",group:"Summary",kinds:["panel"],size:{w:12,h:3},min:{w:4,h:2},compare:!0},apdex:{id:"apdex",autoHeight:!0,label:"User satisfaction score",tech:"Apdex",description:"0–1 user-satisfaction score from response times against your p95 target (or 500 ms).",group:"Summary",kinds:["stat"],size:{w:3,h:4},min:{w:2,h:3},compare:!0,recent:!0},latency:{id:"latency",label:"Response time",tech:"latency percentiles",description:"Percentiles per second. Pick which percentiles to draw.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{percentiles:["p50","p95","p99"],showTarget:!0}},throughput:{id:"throughput",label:"Requests per second",tech:"throughput",description:"Requests per second, with the target rate in rate mode.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{showTarget:!0}},vus:{id:"vus",label:"Simulated users",tech:"VUs",description:"How many simulated users were sending requests at each moment.",group:"Over time",kinds:["area","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},errors:{id:"errors",label:"Failed requests",tech:"error rate",description:"Share of failed requests per second.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,defaults:{showTarget:!0}},status:{id:"status",label:"Responses by outcome",tech:"HTTP status",description:"Responses per second by outcome: 2xx, 4xx, 5xx, network failures.",group:"Over time",kinds:["stacked-area","stacked-bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!1},data:{id:"data",label:"Data transfer",tech:"bytes in / out",description:"Bytes received and sent per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},serverTime:{id:"serverTime",label:"Server and connection time",tech:"TTFB · TCP · TLS",description:"Average server time (TTFB), connect, TLS, and wait time per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0,defaults:{phases:["ttfb","connect","tls"]}},checksRate:{id:"checksRate",label:"Checks passing",tech:"check pass rate",description:"Share of checks passing each second.",group:"Correctness",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},dropped:{id:"dropped",label:"Requests not sent",tech:"dropped iterations",description:"Requests a rate-mode run could not start each second.",group:"Over time",kinds:["bar","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},histogram:{id:"histogram",label:"Response time spread",tech:"latency histogram",description:"How many requests fell into each response-time band.",group:"Distribution",kinds:["histogram"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0},heatmap:{id:"heatmap",label:"Response time over time, by speed",tech:"latency heatmap",description:"Response-time bands over time; darker = more requests. Shows bimodal or drifting latency.",group:"Distribution",kinds:["heatmap"],size:{w:12,h:8},min:{w:4,h:5},compare:!1,recent:!0},percentiles:{id:"percentiles",label:"Response time distribution",tech:"min · p50 · p95 · p99 · max",description:"min, p50, p90, p95, p99, max over the whole run.",group:"Distribution",kinds:["ladder","table","bar"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},phases:{id:"phases",autoHeight:!0,label:"Where the time went",tech:"timing phases",description:"Average split of each request: DNS, connect, TLS, server, download.",group:"Distribution",kinds:["breakdown","table"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},concurrency:{id:"concurrency",label:"Load vs response time",tech:"VUs or RPS vs p95",description:"Each second as a dot: load against response time. Where the dots bend upward is the point the API starts to struggle.",group:"Distribution",kinds:["scatter"],size:{w:6,h:8},min:{w:3,h:5},compare:!0},targets:{id:"targets",autoHeight:!0,label:"Pass/fail goals",tech:"thresholds and checks",description:"Each target met or missed, and each check's pass rate.",group:"Correctness",kinds:["panel"],size:{w:6,h:7},min:{w:3,h:4},compare:!1},statusTable:{id:"statusTable",autoHeight:!0,label:"Response codes",tech:"HTTP status codes",description:"Count of every HTTP status code returned.",group:"Details",kinds:["table","bar"],size:{w:4,h:6},min:{w:3,h:4},compare:!0},config:{id:"config",autoHeight:!0,label:"Test settings",tech:"run configuration",description:"Method, URL, auth type, load shape, times, bytes.",group:"Details",kinds:["panel"],size:{w:12,h:5},min:{w:4,h:3},compare:!1}},v=Object.keys(b);function w(e,t,r,n,s={}){let i=b[t];return{id:e,metric:t,kind:i.kinds[0],x:r,y:n,w:i.size.w,h:i.size.h,options:i.defaults,...s}}let k=[{id:"builtin-overview",name:"Overview",scope:"run",builtIn:!0,widgets:[w("kpis","kpis",0,0),w("verdict","verdict",0,3),w("latency","latency",0,6),w("throughput","throughput",6,6),w("status","status",0,14),w("percentiles","percentiles",6,14,{h:8}),w("phases","phases",0,22),w("targets","targets",6,22),w("config","config",0,29)]},{id:"builtin-developer",name:"Developer",scope:"run",builtIn:!0,widgets:[w("latency","latency",0,0,{w:12,options:{percentiles:["p50","p90","p95","p99","max"],showTarget:!0}}),w("server","serverTime",0,8),w("phases","phases",6,8,{h:8}),w("histogram","histogram",0,16),w("status","status",6,16),w("heatmap","heatmap",0,24),w("targets","targets",0,32),w("codes","statusTable",6,32,{w:6,h:7})]},{id:"builtin-capacity",name:"Capacity",scope:"run",builtIn:!0,widgets:[w("kpis","kpis",0,0,{options:{kpis:["throughput","p95","errors","vus","dropped"]}}),w("concurrency","concurrency",0,3),w("throughput","throughput",6,3),w("latency","latency",0,11,{options:{percentiles:["p95","p99"],showTarget:!0}}),w("vus","vus",6,11,{h:8}),w("errors","errors",0,19),w("dropped","dropped",6,19)]},{id:"builtin-executive",name:"Executive",scope:"run",builtIn:!0,widgets:[w("verdict","verdict",0,0),w("kpis","kpis",0,3,{w:9,options:{kpis:["p95","errors","throughput","requests"]}}),w("apdex","apdex",9,3,{h:3}),w("latency","latency",0,6,{options:{percentiles:["p95"],showTarget:!0}}),w("targets","targets",6,6,{h:8})]},{id:"builtin-topics",name:"By topic",scope:"run",builtIn:!0,widgets:[w("verdict","verdict",0,0),w("h-speed","heading",0,3,{title:"Speed",options:{note:"How fast the API answers"}}),w("n-p95","number",0,5,{options:{kpis:["p95"]}}),w("n-p50","number",3,5,{options:{kpis:["p50"]}}),w("n-max","number",6,5,{options:{kpis:["max"]}}),w("n-ttfb","number",9,5,{options:{kpis:["ttfb"]}}),w("latency","latency",0,8,{options:{percentiles:["p50","p95","p99"],showTarget:!0}}),w("percentiles","percentiles",6,8),w("h-rel","heading",0,18,{title:"Reliability",options:{note:"Did it answer correctly, every time?"}}),w("n-errors","number",0,20,{options:{kpis:["errors"]}}),w("n-checks","number",3,20,{options:{kpis:["checks"]}}),w("status","status",6,20,{w:6}),w("targets","targets",0,23,{w:6}),w("h-load","heading",0,33,{title:"Load",options:{note:"How much traffic it handled"}}),w("n-rps","number",0,35,{options:{kpis:["throughput"]}}),w("n-peak","number",3,35,{options:{kpis:["peakRps"]}}),w("n-vus","number",6,35,{options:{kpis:["vus"]}}),w("n-total","number",9,35,{options:{kpis:["requests"]}}),w("throughput","throughput",0,38),w("concurrency","concurrency",6,38)]},{id:"builtin-compare",name:"Compare overview",scope:"compare",builtIn:!0,widgets:[w("kpis","kpis",0,0,{kind:"table",h:6,options:{kpis:["throughput","p95","p99","errors","requests"]}}),w("verdict","verdict",0,6,{h:7}),w("latency","latency",0,13,{options:{percentiles:["p95"],showTarget:!0}}),w("throughput","throughput",6,13),w("errors","errors",0,21,{h:7}),w("vus","vus",6,21,{h:7}),w("phases","phases",0,28,{w:12,kind:"table"})]}];function x(e){return k.find(t=>t.scope===e)}let $=(e,t,r)=>Math.min(r,Math.max(t,Math.round(e)));function S(e){if(!e||"object"!=typeof e||"string"!=typeof e.id||!e.id||"string"!=typeof e.name)return null;let t="compare"===e.scope?"compare":"run",r=new Set,n=[];for(let s of Array.isArray(e.widgets)?e.widgets:[]){let e=b[s.metric];if(!e||"compare"===t&&!e.compare)continue;let i="string"==typeof s.id&&s.id?s.id:`${e.id}-${n.length}`;for(;r.has(i);)i=`${i}-x`;r.add(i);let a=e.kinds.includes(s.kind)?s.kind:e.kinds[0],o=$(s.w??e.size.w,e.min.w,12);n.push({id:i,metric:e.id,kind:a,title:"string"==typeof s.title&&s.title.trim()?s.title.trim().slice(0,80):void 0,options:function(e,t){let r=t&&"object"==typeof t?t:{},n=(e,t,r)=>{let n=Array.isArray(e)?e.filter(e=>t.includes(e)):[];return n.length?n:r},s={};if(e.defaults?.percentiles&&(s.percentiles=n(r.percentiles,d,e.defaults.percentiles)),e.defaults?.kpis){let t=[...new Set(n(r.kpis,f,e.defaults.kpis))];s.kpis="number"===e.id?t.slice(0,1):t}return e.defaults?.note!==void 0&&(s.note="string"==typeof r.note?r.note.slice(0,200):""),e.defaults?.phases&&(s.phases=n(r.phases,g,e.defaults.phases)),e.defaults?.showTarget!==void 0&&(s.showTarget=r.showTarget??e.defaults.showTarget),Object.keys(s).length?s:void 0}(e,s.options),x:$(s.x??0,0,12-o),y:$(s.y??0,0,1e4),w:o,h:$(s.h??e.size.h,e.min.h,40)})}return{id:e.id,name:e.name.trim().slice(0,60)||"Untitled view",scope:t,builtIn:!0===e.builtIn,widgets:n}}function _(e){return e.title?e.title:"number"===e.metric?m[e.options?.kpis?.[0]??"p95"]:b[e.metric].label}function A(e){if(!e.title)return"number"===e.metric?y[e.options?.kpis?.[0]??"p95"]:b[e.metric].tech}function T(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}function O(e){return e}function E(e){return e}function M(){return e=>e}function j(e){}function N(e){throw Error("Unexpected value in exhaustive check")}function I(e){}function q(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function z(e,t="|"){return e.map(e=>eg(e)).join(t)}function C(e,t){return"bigint"==typeof t?t.toString():t}e.s(["W",0,k,"Z",0,{line:"Line",area:"Area",bar:"Bars","stacked-area":"Stacked area","stacked-bar":"Stacked bars",stat:"Numbers",table:"Table",histogram:"Histogram",heatmap:"Heatmap",ladder:"Percentile ladder",breakdown:"Breakdown bar",scatter:"Scatter",panel:"Panel"},"c",0,12,"B",0,36,"f",0,f,"O",0,m,"t",0,y,"U",0,b,"r",0,d,"T",0,h,"E",0,g,"J",0,{ttfb:"Server time (TTFB)",connect:"TCP connect",tls:"TLS handshake",blocked:"Waiting for a connection"},"g",0,x,"s",0,function(e){let t={latency:"latency",throughput:"throughput",status:"status",phases:"phase",percentiles:"percentiles",targets:"thresholds"},r=[];for(let n of T(e.widgets)){let e=t[n.metric];!e||r.some(t=>t.id===e)||r.push({id:e,w:n.w>=9?2:1,h:n.h>=12?2:1})}return r},"x",0,function(e){return v.map(e=>b[e]).filter(t=>"run"===e||t.compare)},"A",0,function(e,t,r){let n=T(e),s=n.findIndex(e=>e.id===t);if(s<0)return e;if("first"===r||"last"===r){let e=n[s],i=n.filter(e=>e.id!==t);if("first"===r)return[{...e,x:0,y:0},...i.map(t=>({...t,y:t.y+e.h}))];let a=i.reduce((e,t)=>Math.max(e,t.y+t.h),0);return[...i,{...e,x:0,y:a}]}let i="earlier"===r?s-1:s+1;if(i<0||i>=n.length)return e;let a=n[s],o=n[i];return e.map(e=>e.id===a.id?{...e,x:Math.min(o.x,12-e.w),y:o.y}:e.id===o.id?{...e,x:Math.min(a.x,12-e.w),y:a.y}:e)},"V",0,function(e,t){let r=b[e],n=t.reduce((e,t)=>Math.max(e,t.y+t.h),0),s=t.length+1,i=new Set(t.map(e=>e.id));for(;i.has(`${e}-${s}`);)s++;return{id:`${e}-${s}`,metric:e,kind:r.kinds[0],title:"heading"===e?"New section":void 0,x:0,y:n,w:r.size.w,h:r.size.h,options:r.defaults}},"R",0,S,"e",0,function(e){let t=e&&"object"==typeof e?e:{},r=(Array.isArray(t.views)?t.views:[]).map(S).filter(e=>!!e&&!e.builtIn&&!e.id.startsWith("builtin-")),n=[...k,...r],s=(e,t)=>"string"==typeof t&&n.some(r=>r.id===t&&r.scope===e)?t:x(e).id;return{version:1,defaults:{run:s("run",t.defaults?.run),compare:s("compare",t.defaults?.compare)},views:r}},"F",0,T,"u",0,function(e,t,r,n){return e.map(e=>{if(e.id!==t)return e;let s=b[e.metric],i=$(e.w+r,s.min.w,12);return{...e,w:i,h:$(e.h+n,s.min.h,40),x:Math.min(e.x,12-i)}})},"X",0,A,"L",0,_],86483);class P{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function R(e){return new P(e)}function L(e){return null==e}function U(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function F(e,t){let r=e/t,n=Math.round(r),s=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<s?0:r-n}let D=Symbol("evaluating");function B(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==D)return void 0===n&&(n=D,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function K(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Z(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function J(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function H(e){return J(e._zod.def)??e._zod.def.shape}function V(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return Z(this,t,e),e},enumerable:!0,configurable:!0})}function W(e,t,r){t in e?Z(e,t,r):e[t]=r}function G(e,t,r,n){let s=H(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(s,i);r.enumerable&&(r.get?V(e,i,()=>{let e=t._zod.def.shape[i];return n?n(e,i):e}):W(e,i,n?n(r.value,i):r.value))}}function X(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function Y(e){return X(e._zod.def)}function Q(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ee(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function et(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function er(e){return JSON.stringify(e)}function en(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let es="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ea=R(()=>{if(tr.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eo(e){if(!1===ei(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==ei(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function el(e){return eo(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function eu(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let ec=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},ep=new Set(["string","number","symbol"]),ed=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ef(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function em(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ey(e){let t;return new Proxy({},{get:(r,n,s)=>(t??(t=e()),Reflect.get(t,n,s)),set:(r,n,s,i)=>(t??(t=e()),Reflect.set(t,n,s,i)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,s)=>(t??(t=e()),Reflect.defineProperty(t,n,s))})}function eg(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function eb(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let ev={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ew={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ek(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return G(s,e,ex(e,t)),ef(e,X(r,{shape:s,checks:[]}))}function ex(e,t){let r=H(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function e$(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ex(e,t)),i={};return G(i,e,Reflect.ownKeys(H(e)).filter(e=>!s.has(e))),ef(e,X(r,{shape:i,checks:[]}))}function eS(e,t){if(!eo(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=H(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ef(e,X(e._zod.def,{shape:e_(e,t)}))}function e_(e,t){let r={};G(r,e,Reflect.ownKeys(H(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?V(r,e,()=>t[e]):W(r,e,n.value))}return r}function eA(e,t){if(!eo(t))throw Error("Invalid input to safeExtend: expected a plain object");return ef(e,X(e._zod.def,{shape:e_(e,t)}))}function eT(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(H(e))),G(r,t,Reflect.ownKeys(H(t)));let n=X(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ef(e,n)}function eO(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let i=r?new Set(ex(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(H(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),ef(t,X(t._zod.def,{shape:a,checks:[]}))}function eE(e,t,r){let n=r?new Set(ex(t,r)):void 0,s={};return G(s,t,Reflect.ownKeys(H(t)),(t,r)=>n&&!n.has(r)?t:new e({type:"nonoptional",innerType:t})),ef(t,X(t._zod.def,{shape:s}))}function eM(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ej(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function eN(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eI(e){return"string"==typeof e?e:e?.message}function eq(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,r])}return t}function ez(e,t,r){var n;for(let s=t;s<e.length;s++)(n=e[s]).schema??(n.schema=r)}function eC(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eI(e.inst?._zod.def?.error?.(e))??eI(s?.(e))??eI(t?.error?.(e))??eI(r.customError?.(e))??eI(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function eP(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let eR=/[\uD800-\uDBFF]/;function eL(e){let t=e.length;if(!eR.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function eU(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eF(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function eD(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eB(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function eK(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function eZ(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function eJ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eK(t+r)}function eH(e){return eZ(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eV(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function eW(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class eG{constructor(...e){}}function eX(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eY(this,t,r.bind(this))},set(e){eY(this,t,e)}})}(e,r,n.value)}}function eY(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function eQ(e,t,r){return eY(e,t,r,!1)}function e0(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eY(this,r,n(this))},set(e){eY(this,r,e)}})}return t}let e1=!1,e2={configurable:!0,get(){e1=!0}};function e5(e,r,n){let s=Object.getPrototypeOf(e._zod);if(r in s&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(s,r,{configurable:!0,get(){Object.defineProperty(this,r,e2);let e=e1;e1=!1;try{let t=n(this);return e1?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),e1=e1||e,t}catch(t){throw delete this[r],e1=e1||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}function e9(e,t,r,n){let s,i=t in(s=Object.getPrototypeOf(e))?void 0:s;i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,e),e.value=r(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:e})}})}let e6="~constantCatch";function e4(e){let t=()=>e;return t[e6]=!0,t}let e3={value:void 0,enumerable:!1},e8="captureStackTrace"in Error?Error:null;function e7(e,t,r,n){function s(e){this.def=e,this.constr=u,this.traits=new Set}s.prototype={};let i=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{e3.value=new s(a);try{Object.defineProperty(n,"_zod",e3)}finally{e3.value=void 0}}if(n._zod.traits.add(e),t(n,a),i){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,s=e;for(;s&&s!==t;)s=Object.getPrototypeOf(s);let a=s??e;i.has(a)||(i.add(a),eX(a,r))}let o=u.prototype;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(e in n||(n[e]=o[e].bind(n)))}let o=n?.Parent??Object;class l extends o{}function u(e){let t=n?.Parent?function(e){let t=e8;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return e8=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let s=globalThis.__zod_globalConfig?.postProcessor;return s&&s(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class te extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(sb=globalThis).__zod_globalConfig??(sb.__zod_globalConfig={});let tr=globalThis.__zod_globalConfig;function tn(e){return e&&Object.assign(tr,e),tr}class ts extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let ti="~memo",ta=[];function to(e){return null!==e&&"object"==typeof e}function tl(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let tu=new WeakMap,tc=[],tp={alloc(e,t,n){let s=r;if(!s)return n;r=void 0;let i={value:n,issues:null};return s.set(t.value,i),tc.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,s;let i;if("backward"!==r.direction&&(n=r,s=e.value,void 0!==(i=n[ti]?.backEdges)&&to(s)&&i.has(s)))throw new ts;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var t;let n,s,i,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(l,u)=>{let c;if(void 0===n){let r=function e(t,r,n){var s,i;let a=tu.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let o=0,l=t=>{if(2!==o&&t?._zod){let s=e(t,r,n);s>o&&(o=s)}},u=e=>{e>o&&(o=e)},c=t._zod.def;switch(c.type){case"object":{let t=J(c);u(t?((t,s)=>{let i=0;for(let a of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,a);if(s&&!o.enumerable)continue;let l=o.get?1:o.value?._zod?e(o.value,r,n):0;l>i&&(i=l)}return i})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let s=c._cachedInner??(n?t._zod.innerType:void 0);u(s?e(s,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),s=t,1!==(i=o)&&tu.set(s,2===i),i}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(l,u);2===r||a?n=!0:a=!0}let p=l.value;if(!to(p))return t(l,u);let d=u[ti];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[ti]=d),s===u)c=i;else{var h;let t;(t=(h=d).buckets.get(e))||(t=new WeakMap,h.buckets.set(e,t)),c=t,s=u,i=c}let f=c.get(p);if(f)return l.value=f.value,f.issues?f.issues.length&&l.issues.push(...tl(f.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),l;r=c;let m=tc.length,y=t(l,u);r=void 0;let g=tc.length>m?tc.pop():void 0;return y instanceof Promise?y.then(e=>(g&&(g.issues=e.issues.length?tl(e.issues):ta),e)):(g&&(g.issues=y.issues.length?tl(y.issues):ta),y)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};(sv=globalThis).__zod_globalRegistry??(sv.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let td=globalThis.__zod_globalRegistry,th=/^[cC][0-9a-z]{6,}$/,tf=/^[0-9a-z]+$/,tm=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ty=/^[0-9a-vA-V]{20}$/,tg=/^[A-Za-z0-9]{27}$/,tb=/^[a-zA-Z0-9_-]{21}$/;function tv(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let tw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tx=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,t$=tx(4),tS=tx(6),t_=tx(7),tA=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tT=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function tO(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let tE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tj=e=>{let t=eh(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tq=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tz=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tC=/^https?$/,tP=/^\+[1-9]\d{6,14}$/,tR=/^\d(?:[ -]?\d){11,18}$/,tL=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tU="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tF=RegExp(`^${tU}$`);function tD(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tB(e){return RegExp(`^${tD(e)}$`)}function tK(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${tD({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${tD({precision:e.precision})}`:r;return RegExp(`^${tU}T(?:${n})$`)}let tZ=/^[\s\S]{0,}$/,tJ=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tH=/^-?\d+n?$/,tV=/^-?\d+$/,tW=/^-?\d+(?:\.\d+)?$/,tG=/^(?:true|false)$/i,tX=/^null$/i,tY=/^undefined$/i,tQ=/^[^A-Z]*$/,t0=/^[^a-z]*$/;function t1(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function t2(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let t5=t1(22,"=="),t9=t2(22),t6=t1(27,"="),t4=t2(27),t3=t1(43,"="),t8=t2(43),t7=t1(64,""),re=t2(64),rt=t1(86,"=="),rr=t2(86);e.s(["anyString",0,tZ,"base64",0,tq,"base64url",0,tz,"bigint",0,tH,"boolean",0,tG,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,tN,"cidrv6",0,tI,"creditCard",0,tR,"cuid",0,th,"cuid2",0,tf,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,tF,"datetime",0,tK,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,tw,"e164",0,tP,"email",0,tA,"emoji",0,tO,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,tk,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,tC,"iban",0,tL,"idnEmail",0,tT,"integer",0,tV,"ipv4",0,tE,"ipv6",0,tM,"ksuid",0,tg,"lowercase",0,tQ,"mac",0,tj,"md5_base64",0,t5,"md5_base64url",0,t9,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,tb,"nanoidOfLength",0,tv,"null",0,tX,"number",0,tW,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,t6,"sha1_base64url",0,t4,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,t3,"sha256_base64url",0,t8,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,t7,"sha384_base64url",0,re,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,rt,"sha512_base64url",0,rr,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tJ,"time",0,tB,"ulid",0,tm,"undefined",0,tY,"unicodeEmail",0,tT,"uppercase",0,t0,"uuid",0,tx,"uuid4",0,t$,"uuid6",0,tS,"uuid7",0,t_,"xid",0,ty],79692);let rn=e7("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rs=e=>{let t=e.value;return!L(t)&&void 0!==t.size},ri=e=>{let t=e.value;return!L(t)&&void 0!==t.length},ra={number:"number",bigint:"bigint",object:"date"},ro=e7("$ZodCheckLessThan",(e,t)=>{rn.init(e,t);let r=ra[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ra[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=e7("$ZodCheckGreaterThan",(e,t)=>{rn.init(e,t);let r=ra[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ra[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ru=e7("$ZodCheckMultipleOf",(e,t)=>{rn.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0===F(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),rc=e7("$ZodCheckNumberFormat",(e,t)=>{rn.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,i]=ev[t.format];e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>i&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),rp=e7("$ZodCheckBigIntFormat",(e,t)=>{rn.init(e,t);let[r,n]=ew[t.format];e._zod.check=s=>{let i=s.value;i<r&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),rd=e7("$ZodCheckMaxSize",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:eP(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rh=e7("$ZodCheckMinSize",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:eP(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rf=e7("$ZodCheckSizeEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let i=s>t.size;r.issues.push({origin:eP(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rm=e7("$ZodCheckMaxLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>t.maximum?eL(n):s)<=t.maximum)return;let i=eU(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ry=e7("$ZodCheckMinLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>=t.minimum&&s<2*t.minimum?eL(n):s)>=t.minimum)return;let i=eU(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rg=e7("$ZodCheckLengthEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length,i="string"==typeof n&&s>=t.length&&s<=2*t.length?eL(n):s;if(i===t.length)return;let a=eU(n),o=i>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rb=e7("$ZodCheckStringFormat",(e,t)=>{var r,n;rn.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),rv=e7("$ZodCheckRegex",(e,t)=>{rb.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rw=e7("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tQ),rb.init(e,t)}),rk=e7("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=t0),rb.init(e,t)}),rx=e7("$ZodCheckIncludes",(e,t)=>{rn.init(e,t);let r=eh(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),r$=e7("$ZodCheckStartsWith",(e,t)=>{rn.init(e,t);let r=RegExp(`^${eh(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),rS=e7("$ZodCheckEndsWith",(e,t)=>{rn.init(e,t);let r=RegExp(`.*${eh(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function r_(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues))}(e,t)=>{let r;rn.init(e,t),eQ(e,Symbol.iterator,function*(){yield e}),e._zod.check=n=>{let s;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let i=n.value;for(let[e,t]of r){let r=t._zod.run({value:i[e],issues:[]},{});r instanceof Promise?(s??(s=[]),s.push(r.then(t=>r_(t,n,e)))):r_(r,n,e)}if(s)return Promise.all(s).then(()=>void 0)}},(e,t)=>{rn.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let rA=e7("$ZodCheckOverwrite",(e,t)=>{rn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rT{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
2
  ${t.join("\n")}
3
3
  };`)(...Object.values(this.closed))}}let rO={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,C,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},rE={value:void 0,enumerable:!1},rM=new WeakSet([Object.prototype,Error.prototype]),rj=(e,t)=>{e.name="$ZodError",rE.value=t,Object.defineProperty(e,"issues",rE),rE.value=void 0,Object.defineProperty(e,"message",rO);let r=Object.getPrototypeOf(e);rM.has(r)||(rM.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},rN=e7("$ZodError",rj),rI=e7("$ZodError",rj,void 0,{Parent:Error});function rq(e,t){return{callee:t?.callee??e,Err:t?.Err}}let rz=e=>{let t=(r,n,s,i)=>{let a=s?{...s,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new te;if(o.issues.length){let r=new(i?.Err??e)(o.issues.map(e=>eC(e,a,tn())));throw es(r,i?.callee??t),r}return o.value};return t},rC=rz(rI),rP=e=>{let t=async(r,n,s,i)=>{let a=s?{...s,async:!0}:{async:!0},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let r=new(i?.Err??e)(o.issues.map(e=>eC(e,a,tn())));throw es(r,i?.callee??t),r}return o.value};return t},rR=rP(rI),rL=e=>(t,r,n)=>{let s=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new te;return i.issues.length?rU(e,i.issues,s):{success:!0,data:i.value}};function rU(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>eC(e,r,tn()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let rF=e=>async(t,r,n)=>{let s=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?rU(e,i.issues,s):{success:!0,data:i.value}},rD=Symbol.for("zod.compile.invalid"),rB=Symbol.for("zod.compile.fallback"),rK=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},s=e._zod.run({value:t,issues:[]},n);return s instanceof Promise&&(s=await s),0===s.issues.length},rZ={major:4,minor:6,patch:7},rJ=e7("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rZ;let n=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of s)for(let r of t._zod.onattach)r(e);if(0===s.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let s;if(t.memo)return t;let i=eM(t);for(let a of r){if(a._zod.def.when){if(ej(t)||!a._zod.def.when(t))continue}else if(i)continue;let r=t.issues.length,o=a._zod.check(t);if(o instanceof Promise&&n?.async===!1)throw new te;if(s||o instanceof Promise)s=(s??Promise.resolve()).then(async()=>{await o,t.issues.length!==r&&(ez(t.issues,r,e),i||(i=eM(t,r)))});else{if(t.issues.length===r)continue;ez(t.issues,r,e),i||(i=eM(t,r))}}return s?s.then(()=>t):t},r=(r,n,i)=>{if(eM(r))return r.aborted=!0,r;let a=t(n,s,i);if(a instanceof Promise){if(!1===i.async)throw new te;return a.then(t=>e._zod.parse(t,i))}return e._zod.parse(a,i)};e._zod.run=(n,i)=>{if(i.skipChecks)return e._zod.parse(n,i);if("backward"===i.direction){let t=e._zod.parse({value:n.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,i)):r(t,n,i)}let a=e._zod.parse(n,i);if(a instanceof Promise){if(!1===i.async)throw new te;return a.then(e=>t(e,s,i))}return t(a,s,i)}}},{get"~standard"(){return eQ(this,"~standard",rW(this))},set"~standard"(e){eY(this,"~standard",e)}}),rH=(e,t)=>e.issues.length?{issues:e.issues.map(e=>eC(e,t,tn()))}:{value:e.value};async function rV(e,t){let r={async:!0};return rH(await e._zod.run({value:t,issues:[]},r),r)}function rW(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return rH(n,r)}catch(e){}return rV(e,t)},vendor:"zod",version:1}}let rG=e7("$ZodString",(e,t)=>{rJ.init(e,t),e._zod.pattern=t.pattern??tZ,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),rX=e7("$ZodStringFormat",(e,t)=>{rb.init(e,t),rG.init(e,t)}),rY=e7("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tk),rX.init(e,t)}),rQ=e7("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tx(e))}else t.pattern??(t.pattern=tx());rX.init(e,t)}),r0=e7("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tA),rX.init(e,t)});function r1(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let r2=/[\t\n\r]/g;function r5(e){return e.replace(r2,"")}let r9=e7("$ZodURL",(e,t)=>{rX.init(e,t),e._zod.check=r=>{try{var n,s;let i=r.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===tC.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(i,t):r1(i)||2;if(1===a)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===a)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===a){r.value=r5(i);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((s=t.protocol).lastIndex=0,!s.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?a.href:r5(i);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),r6=e7("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tO()),rX.init(e,t)}),r4=e7("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?tb:tv(t.length)),rX.init(e,t)}),r3=e7("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=th),rX.init(e,t)}),r8=e7("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tf),rX.init(e,t)}),r7=e7("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tm),rX.init(e,t)}),ne=e7("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ty),rX.init(e,t)}),nt=e7("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tg),rX.init(e,t)}),nr=e7("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tK(t)),rX.init(e,t)}),nn=e7("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tF),rX.init(e,t)}),ns=e7("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tB(t)),rX.init(e,t)}),ni=e7("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tw),rX.init(e,t)}),na=e7("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tE),rX.init(e,t)}),no=/^[0-9a-fA-F:.]+$/;function nl(e){return!!no.test(e)&&r1(`http://[${e}]`)}let nu=e7("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tM),rX.init(e,t),e._zod.check=r=>{nl(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),nc=((e,t)=>{t.pattern??(t.pattern=tj(t.delimiter)),rX.init(e,t)},e7("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tN),rX.init(e,t)})),np=e7("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tI),rX.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let s=Number(n);return`${s}`===n&&!(s<0)&&!(s>128)&&nl(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function nd(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let nh=/^[0-9a-zA-Z+/]*={0,2}$/,nf=e7("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=nh),rX.init(e,t),e._zod.check=r=>{nd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),nm=/^[A-Za-z0-9_-]*$/,ny=e7("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nm),rX.init(e,t),e._zod.check=r=>{!function(e){if(!nm.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return nd(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ng=e7("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tP),rX.init(e,t)}),nb=/[- ]/g,nv=((e,t)=>{t.pattern??(t.pattern=tR),rX.init(e,t),e._zod.check=r=>{var n;n=r.value,tR.test(n)&&function(e){let t=e.length,r=1,n=0;for(;t;){let s=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][s]:s}return n%10==0}(n.replace(nb,""))||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}},e7("$ZodJWT",(e,t)=>{rX.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let s=JSON.parse(atob(n));if("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}})),nw=((e,t)=>{rX.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},e7("$ZodNumber",(e,t)=>{rJ.init(e,t),e._zod.pattern=tW,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let s=r.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return r;let i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),r}})),nk=e7("$ZodNumberFormat",(e,t)=>{rc.init(e,t),nw.init(e,t)}),nx=e7("$ZodBoolean",(e,t)=>{rJ.init(e,t),e._zod.pattern=tG,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let s=r.value;return"boolean"==typeof s||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),n$=e7("$ZodBigInt",(e,t)=>{rJ.init(e,t),e._zod.pattern=tH,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),nS=((e,t)=>{rp.init(e,t),n$.init(e,t)},e7("$ZodUnknown",(e,t)=>{rJ.init(e,t),e._zod.parse=e=>e})),n_=e7("$ZodNever",(e,t)=>{rJ.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function nA(e,t){let r=eq(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(e=>e[0])),s=e._zod.parse;e._zod.parse=(r,i)=>{let a=t(r.value);if(a>n&&!i?.skipChecks&&i?.direction!=="backward"){for(let[t,n]of eq(e._zod.def.checks))if(a>t&&n._zod.def.when(r)){let t=r.issues.length;return n._zod.check(r),r.issues[t].continue=!1,ez(r.issues,t,e),r}}return s(r,i)}}(e,t)=>{rJ.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},(e,t)=>{rJ.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let s=r.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),r}};let nT=e=>Array.isArray(e)?e.length:-1,nO=e=>e instanceof Map?e.size:-1,nE=e=>e instanceof Set?e.size:-1;function nM(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues)),t.value[r]=e.value}let nj=e7("$ZodArray",(e,t)=>{rJ.init(e,t);let r=tr.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),s):Array(i.length);let a=[],o=s?.abortEarly;for(let e=0;e<i.length;e++){let r=i[e],l=t.element._zod.run({value:r,issues:[]},s);if(l instanceof Promise)a.push(l.then(t=>nM(t,n,e)));else if(nM(l,n,e),o&&0!==l.issues.length&&eM(l))break}return a.length?Promise.all(a).then(()=>n):n},nA(e,nT)});function nN(e,t,r,n,s,i){let a=r in n,o="optional"===i;if(a||!o||"optional"!==s){if(e.issues.length){if(void 0!==s&&o&&!a)return;t.issues.push(...eN(r,e.issues))}if(!a&&void 0===s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(a||"defaulted"===s&&!o)&&(t.value[r]=void 0):t.value[r]=e.value}}let nI=[];function nq(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:nI,s=n.length?[...t,...n]:t;for(let t of s)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let i=eb(e.shape);return{...e,allKeys:s,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function nz(e,t,r,n,s,i,a){let o=[],l=s.keySet,u=s.catchall._zod,c=u.def.type,p=u.optin,d=u.optout,h=0;for(let s in t){if(a&&r.issues.length!==h){if(eM(r,h))break;h=r.issues.length}if(l.has(s))continue;if("__proto__"===s){"never"===c&&o.push(s);continue}if("never"===c){o.push(s);continue}let i=u.run({value:t[s],issues:[]},n);i instanceof Promise?e.push(i.then(e=>nN(e,r,s,t,p,d))):nN(i,r,s,t,p,d)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let nC=e7("$ZodObject",(e,t)=>{let r;rJ.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),s=n?.get?n.get.raw:t.shape??{};if(s){let e=()=>{let r={...s};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=s,Object.defineProperty(t,"shape",{get:e})}let i=R(()=>nq(t));e5(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||Z(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let a=t.catchall,o=tr.memoizer;o?.attach(e),e._zod.parse=(t,n)=>{r??(r=i.value);let s=t.value;if(!ei(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value=o?o.alloc(e,t,{},n):{};let l=[],u=r.shape,c=n?.abortEarly,p=t.issues.length;for(let e of r.allKeys){if(c&&t.issues.length!==p){if(eM(t,p))break;p=t.issues.length}if("__proto__"===e)continue;let r=u[e],i=r._zod.optin,a=r._zod.optout,o=r._zod.run({value:s[e],issues:[]},n);o instanceof Promise?l.push(o.then(r=>nN(r,t,e,s,i,a))):nN(o,t,e,s,i,a)}return a?nz(l,s,t,n,i.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),nP=e7("$ZodObjectJIT",(e,t)=>{let r,n;nC.init(e,t);let s=e._zod.parse,i=R(()=>nq(t)),a=tr.memoizer,o=!tr.jitless,l=o&&ea.value,u=t.catchall;e._zod.parse=(c,p)=>{n??(n=i.value);let d=c.value;return ei(d)?o&&l&&p?.async===!1&&!0!==p.jitless?(r||(r=(t=>{let r=i.value,n=r.symbolKeys,s=new rT(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),o=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
4
4
  let ${e}_ab = false;
@@ -741,7 +741,7 @@ ${o}
741
741
  ${r}`:r;else if(n||e.directives.docStart||!s)e.commentBefore=r;else if(lW(s)&&!s.flow&&s.items.length>0){let e=s.items[0];lJ(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${r}
742
742
  ${t}`:r}else{let e=s.commentBefore;s.commentBefore=e?`${r}
743
743
  ${e}`:r}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:cW(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let t of e)yield*this.next(t);yield*this.end(t,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let s=cV(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:r,start:n,value:s,end:i},a){let o=new c_(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},u=cj(n,{indicator:"doc-start",next:s??i?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(o.directives.docStart=!0,s&&("block-map"===s.type||"block-seq"===s.type)&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=s?cJ(l,s,u,a):cH(l,u.end,n,null,u,a);let c=o.contents.range[2],p=cC(i,c,!1,a);return p.comment&&(o.comment=p.comment),o.range=[r,c,p.offset],o}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new cO(cV(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new cO(cV(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=cC(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
744
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new cO(cV(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new c_(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function cX(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function cY(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),s=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length),n))t.offset+=s;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{let n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}let cQ=Symbol("break visit"),c0=Symbol("skip children"),c1=Symbol("remove item");function c2(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,r,n){let s=n(r,t);if("symbol"==typeof s)return s;for(let i of["key","value"]){let a=r[i];if(a&&"items"in a){for(let r=0;r<a.items.length;++r){let s=e(Object.freeze(t.concat([[i,r]])),a.items[r],n);if("number"==typeof s)r=s-1;else{if(s===cQ)return cQ;s===c1&&(a.items.splice(r,1),r-=1)}}"function"==typeof s&&"key"===i&&(s=s(r,t))}}return"function"==typeof s?s(r,t):s}(Object.freeze([]),e,t)}function c5(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function c9(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=c9(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=c6(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=c6(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=c6(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function c6({start:e,key:t,sep:r,value:n}){let s="";for(let t of e)s+=t.source;if(t&&(s+=c9(t)),r)for(let e of r)s+=e.source;return n&&(s+=c9(n)),s}c2.BREAK=cQ,c2.SKIP=c0,c2.REMOVE=c1,c2.itemAtPath=(e,t)=>{let r=e;for(let[e,n]of t){let t=r?.[e];if(!t||!("items"in t))return;r=t.items[n]}return r},c2.parentCollection=(e,t)=>{let r=c2.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw Error("Parent collection not found")},e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","createScalarToken",0,function(e,t){let{implicitKey:r=!1,indent:n,inFlow:s=!1,offset:i=-1,type:a="PLAIN"}=t,o=uT({type:a,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:"\n"}];switch(o[0]){case"|":case">":{let e=o.indexOf("\n"),t=o.substring(0,e),r=o.substring(e+1)+"\n",s=[{type:"block-scalar-header",offset:i,indent:n,source:t}];return cX(s,l)||s.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:i,indent:n,props:s,source:r}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:o,end:l};default:return{type:"scalar",offset:i,indent:n,source:o,end:l}}},"isCollection",0,e=>!!e&&"items"in e,"isScalar",0,e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),"prettyToken",0,function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},"resolveAsScalar",0,function(e,t=!0,r){if(e){let n=(e,t,n)=>{let s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(r)r(s,t,n);else throw new cO([s,s+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return cF(e,t,n);case"block-scalar":return cU({options:{strict:t}},e,n)}}return null},"setScalarValue",0,function(e,t,r={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:i=!1,type:a}=r,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");a=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=uT({type:a,value:t},{implicitKey:s||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let r=t.indexOf("\n"),n=t.substring(0,r),s=t.substring(r+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=n,e.source=s}else{let{offset:t}=e,r="indent"in e?e.indent:-1,i=[{type:"block-scalar-header",offset:t,indent:r,source:n}];for(let t of(cX(i,"end"in e?e.end:void 0)||i.push({type:"newline",offset:-1,indent:r,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:r,props:i,source:s})}}(e,l);break;case'"':cY(e,l,"double-quoted-scalar");break;case"'":cY(e,l,"single-quoted-scalar");break;default:cY(e,l,"scalar")}},"stringify",0,e=>"type"in e?c9(e):c6(e),"tokenType",0,c5,"visit",0,c2],91723);var c4=e.i(91723);function c3(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let c8=new Set("0123456789ABCDEFabcdef"),c7=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pe=new Set(",[]{}"),pt=new Set(" ,[]{}\n\r "),pr=e=>!e||pt.has(e);class pn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;" "===t;)t=this.buffer[++r+e];if("\r"===t){let t=this.buffer[r+e+1];if("\n"===t||!t&&!this.atEnd)return e+r+1}return"\n"!==t&&!(r>=this.indentNext)&&(t||this.atEnd)?-1:e+r}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&c3(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,r=e.indexOf("#");for(;-1!==r;){let n=e[r-1];if(" "===n||" "===n){t=r-1;break}r=e.indexOf("#",r+1)}for(;;){let r=e[t-1];if(" "===r||" "===r)t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&c3(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!c3(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&c3(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(pr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==r&&r<this.indentNext&&"#"!==n[0]||0===r&&(n.startsWith("---")||n.startsWith("..."))&&c3(n[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let s=0;for(;","===n[s];)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[s+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(pr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||c3(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){let e=this.continueScalar(n+1);if(-1===e)break;n=r.indexOf("\n",e)}-1!==n&&(t=n-("\r"===r[n-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>c3(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,r=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":r+=1;break;case"\n":t=n,r=0;break;case"\r":{let e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);let s=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+r>s)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,r=this.pos-1,n=this.pos-1;for(;e=this.buffer[++n];)if(":"===e){let e=this.buffer[n+1];if(c3(e)||t&&pe.has(e))break;r=n}else if(c3(e)){let s=this.buffer[n+1];if("\r"===e&&("\n"===s?(n+=1,e="\n",s=this.buffer[n+1]):r=n),"#"===s||t&&pe.has(s))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&pe.has(e))break;r=n}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(r+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(pr),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(c3(r)||t&&pe.has(r)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!c3(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(c7.has(t))t=this.buffer[++e];else if("%"===t&&c8.has(this.buffer[e+1])&&c8.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,r=this.pos-1;do t=this.buffer[++r];while(" "===t||e&&" "===t)let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function ps(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function pi(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function pa(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function po(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function pl(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function pu(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function pc(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||ps(t.start,"explicit-key-ind")||ps(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,pa(t.value)?t.value.end?pu(t.value.end,t.sep):t.value.end=t.sep:pu(t.start,t.sep),delete t.sep)}class pp{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new pn,this.onNewLine=e}*parse(e,t=!1){for(let r of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=c5(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&pc(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let r=e.items[e.items.length-1];if(r.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=e.items[e.items.length-1];r.value?e.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=e.items[e.items.length-1];!r||r.value?e.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&-1===pi(r.start)&&(0===t.indent||r.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=r.start:e.items.push({start:r.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==pi(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,r=pl(po(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){pu(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,s=[];if(n&&t.sep&&!t.value){let r=[];for(let n=0;n<t.sep.length;++n){let s=t.sep[n];switch(s.type){case"newline":r.push(n);break;case"space":break;case"comment":s.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(s=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?n||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(pa(t.key)&&!ps(t.sep,"newline")){let e=pl(t.start),r=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:r,sep:n}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(ps(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=pl(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ps(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);n||t.value?(e.items.push({start:s,key:r,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(r):(Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!ps(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else r&&e.items.push({start:s});this.stack.push(n);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){pu(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ps(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let r=pl(po(t));pc(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=pl(po(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=pl(po(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}class pd{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let n=t+r>>1;this.lineStarts[n]<e?t=n+1:r=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function ph(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new pd||null,prettyErrors:t}}function pf(e,t={}){let{lineCounter:r,prettyErrors:n}=ph(t),s=new pp(r?.addNewLine),i=new cG(t),a=null;for(let t of i.compose(s.parse(e),!0,e.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new cO(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=t;return n&&r&&(a.errors.forEach(cM(e,r)),a.warnings.forEach(cM(e,r))),a}function pm(e,t,r){let n;"function"==typeof t?n=t:void 0===r&&t&&"object"==typeof t&&(r=t);let s=pf(e,r);if(!s)return null;if(s.warnings.forEach(e=>uM(s.options.logLevel,e)),s.errors.length>0)if("silent"!==s.options.logLevel)throw s.errors[0];else s.errors=[];return s.toJS(Object.assign({reviver:n},r))}e.s(["Alias",0,uo,"CST",0,c4,"Composer",0,cG,"Document",0,c_,"Lexer",0,pn,"LineCounter",0,pd,"Pair",0,uP,"Parser",0,pp,"Scalar",0,uu,"Schema",0,cS,"YAMLError",0,cT,"YAMLMap",0,uF,"YAMLParseError",0,cO,"YAMLSeq",0,uB,"YAMLWarning",0,cE,"isAlias",0,lB,"isCollection",0,lW,"isDocument",0,lK,"isMap",0,lZ,"isNode",0,lG,"isPair",0,lJ,"isScalar",0,lH,"isSeq",0,lV,"parse",0,pm,"parseAllDocuments",0,function(e,t={}){let{lineCounter:r,prettyErrors:n}=ph(t),s=new pp(r?.addNewLine),i=new cG(t),a=Array.from(i.compose(s.parse(e)));if(n&&r)for(let t of a)t.errors.forEach(cM(e,r)),t.warnings.forEach(cM(e,r));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())},"parseDocument",0,pf,"stringify",0,function(e,t,r){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t),"string"==typeof r&&(r=r.length),"number"==typeof r){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=r??t??{};if(!e)return}return lK(e)&&!n?e.toString(r):new c_(e,n,r).toString(r)},"visit",0,l1,"visitAsync",0,l5],32861),e.i(32861);let py=/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S+)(?:\s+HTTP\/[\d.]+)?\s*$/,pg=e=>e.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")||"Imported";function pb(e,t,r=""){let n=t.replace(/\s+$/,"");if(!n)return e;let s=/json/i.test(r)||/^\s*[{[]/.test(n);return{...e,bodyMode:s?"json":"text",bodyText:n}}function pv(e,t,r,n){let s=pI(t,e,r,n);return{...s.draft,headers:s.headers}}function pw(e,t){let r=pg(t),n=new Set,s=e=>n.add(e),i=[],a=[],o=e.replace(/\r\n?/g,"\n").split(/^###(.*)$/m),l=[{title:"",text:o[0]}];for(let e=1;e<o.length;e+=2)l.push({title:o[e].trim(),text:o[e+1]??""});for(let[e,{title:t,text:n}]of l.entries()){let o=n.split("\n"),l=t,u=0;for(;u<o.length;u++){let e=o[u].trim();if(!e)continue;let t=/^(?:#|\/\/)\s*@name\s+(.+)$/.exec(e);if(t){l=t[1].trim();continue}let r=/^@([\w.-]+)\s*=\s*(.*)$/.exec(e);if(r){i.push({key:r[1],value:r[2].trim(),secret:!1});continue}if(/^(#|\/\/)/.test(e)){l||(l=e.replace(/^(#|\/\/)\s*/,"").slice(0,120));continue}break}if(u>=o.length)continue;let c=o[u].trim(),p=py.exec(c)??(/^(https?:\/\/|\{\{)/.test(c)?["","GET",c.split(/\s+/)[0]]:null);if(!p){s(`Request ${e+1}: "${c.slice(0,60)}" isn't a request line — skipped`);continue}let d=p[1],h=p[2];for(u++;u<o.length&&/^\s+[?&]/.test(o[u]);)h+=o[u++].trim();let f=[];for(;u<o.length;u++){let e=o[u];if(!e.trim()){u++;break}if(/^\s*(#|\/\/)/.test(e))continue;let t=/^([^:\s][^:]*):\s*(.*)$/.exec(e.trim());t&&f.push({key:t[1].trim(),value:t[2].trim()})}let m=o.slice(u),y=m.findIndex(e=>/^\s*>\s/.test(e)||/^\s*<>\s/.test(e));y>=0&&s(`${l||`${d} ${h}`}: response handler scripts (> {% … %}) aren't imported — add checks on the Checks tab`);let g=(y>=0?m.slice(0,y):m).filter(e=>!/^\s*(#|\/\/)/.test(e));g.some(e=>/^\s*<\s+\S/.test(e))&&s(`${l||`${d} ${h}`}: a body read from a file (< path) — choose the file again in the Body tab`);let b=l||`${d} ${h}`,v=lc({...le(),method:d},h),w=f.find(e=>/^content-type$/i.test(e.key))?.value??"";if(v=pb(v,g.filter(e=>!/^\s*<\s+\S/.test(e)).join("\n"),w),a.push({collection:o2(r),name:(l||`${d} ${h.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120),request:pv(v,f,s,b)}),a.length>=2e3)break}if(!a.length)throw Error("No requests found — each request starts with a line like GET https://api.example.com/items");let u=i.length?[{name:r,variables:function(e){let t=new Map;for(let r of e)t.set(r.key,r);return[...t.values()]}(i)}]:[];return{kind:"http",title:r,requests:a,environments:u,warnings:[...n]}}let pk=e=>e.trim().replace(/^\$\.?/,"").replace(/\['([^']+)'\]/g,".$1").replace(/^\./,"")||"",px=e=>{let t=e.trim();if(/^".*"$/.test(t))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return t};function p$(e,t){let r=pg(t),n=new Set,s=e=>n.add(e),i=[],a=e.replace(/\r\n?/g,"\n").split("\n"),o=[],l=null,u="headers",c=null,p=!1,d="";for(let e of a){let t=e.replace(/\s+$/,"");if(p){/^```/.test(t.trim())?p=!1:l?.body.push(e);continue}if(/^\s*#/.test(t)){d=t.replace(/^\s*#\s*/,"").trim();continue}let r=py.exec(t.trim());if(r&&!t.startsWith(" ")){l={method:r[1],url:r[2],headers:[],sections:new Map,body:[],status:null,response:new Map,comment:d},d="",o.push(l),u="headers",c=null;continue}if(!l)continue;let n=/^HTTP(?:\/[\d.]+)?\s+(\d{3}|\*)/.exec(t.trim());if(n){l.status="*"===n[1]?null:n[1],u="response",c=null;continue}let s=/^\[(\w+)\]$/.exec(t.trim());if(s){c=s[1],("response"===u?l.response:l.sections).set(c,[]);continue}if(!t.trim()){"headers"===u&&!c&&l.headers.length&&(u="body");continue}if(c){("response"===u?l.response:l.sections).get(c).push(t.trim());continue}if("headers"===u){let e=/^([\w-]+):\s*(.*)$/.exec(t.trim());if(e){l.headers.push({key:e[1],value:e[2]});continue}u="body"}if("body"===u){if(/^```/.test(t.trim())){p=!0;continue}l.body.push(e)}}let h=(e=[])=>e.map(e=>/^([^:]+):\s*(.*)$/.exec(e)).filter(e=>!!e).map(e=>({key:e[1].trim(),value:px(e[2])}));for(let e of o){let t=e.comment||`${e.method} ${e.url}`,n=lc({...le(),method:e.method},e.url),a=h(e.sections.get("QueryStringParams")??e.sections.get("Query"));a.length&&(n={...n,params:[...n.params,...a]});let o=h(e.sections.get("BasicAuth"))[0];o&&(n={...n,authMode:"basic",username:o.key,password:o.value});let l=h(e.sections.get("FormParams")??e.sections.get("Form")),u=h(e.sections.get("MultipartFormData")??e.sections.get("Multipart"));if(l.length)n={...n,bodyMode:"form",formRows:l.map(e=>({...e,kind:"text",file:null}))};else if(u.length){let e=u.map(e=>/^file,/.test(e.value)?{key:e.key,value:"",kind:"file",file:null}:{...e,kind:"text",file:null});e.some(e=>"file"===e.kind)&&s(`${t}: choose the files for the form again in the Body tab`),n={...n,bodyMode:"multipart",formRows:e}}else{let r=e.body.join("\n").trim();/^file,/.test(r)?s(`${t}: a body read from a file — choose it again (Body → File)`):n=pb(n,r.replace(/^`([\s\S]*)`$/,"$1"),e.headers.find(e=>/^content-type$/i.test(e.key))?.value??"")}let c=[];e.status&&c.push({type:"status",expect:e.status});let p=0;for(let t of e.response.get("Asserts")??[]){let e=function(e){let t=/^(jsonpath|header|status|body|duration)(?:\s+("(?:[^"\\]|\\.)*"))?\s+(not\s+)?(==|!=|>=|<=|>|<|contains|startsWith|endsWith|matches|exists|isString|isNumber|isInteger|isFloat|isBoolean|isCollection|isList|isObject|count)\s*(.*)$/.exec(e.trim());if(!t)return null;let[,r,n="",s,i,a=""]=t,o=px(a);if("status"===r&&"=="===i&&!s)return{type:"status",expect:o};if("duration"===r&&("<"===i||"<="===i))return{type:"time",maxMs:Number(o)||1e3};if("body"===r&&"contains"===i)return{type:"body",op:s?"not_contains":"contains",value:o};if("body"===r&&"matches"===i)return{type:"body",op:"matches",value:o.replace(/^\/|\/$/g,"")};if("header"===r){let e=px(n);return"exists"===i?{type:"header",name:e,op:s?"not_exists":"exists",value:""}:"=="!==i||s?"contains"!==i||s?"matches"!==i||s?null:{type:"header",name:e,op:"matches",value:o.replace(/^\/|\/$/g,"")}:{type:"header",name:e,op:"contains",value:o}:{type:"header",name:e,op:"equals",value:o}}if("jsonpath"===r){let e=pk(px(n));if(!e)return null;if("exists"===i)return{type:"json",path:e,op:s?"not_exists":"exists",value:""};if("=="===i)return{type:"json",path:e,op:s?"not_equals":"equals",value:o};if("!="===i)return{type:"json",path:e,op:"not_equals",value:o};if("contains"===i&&!s)return{type:"json",path:e,op:"contains",value:o};if((">"===i||">="===i)&&!s)return{type:"json",path:e,op:"greater",value:">="===i?String(Number(o)-1e-9):o};if(("<"===i||"<="===i)&&!s)return{type:"json",path:e,op:"less",value:"<="===i?String(Number(o)+1e-9):o};if("matches"===i&&!s)return{type:"json",path:e,op:"matches",value:o.replace(/^\/|\/$/g,"")};if("count"===i&&!s)return{type:"json",path:e,op:"length",value:a.replace(/^==\s*/,"").trim()};let t={isString:"string",isNumber:"number",isInteger:"number",isFloat:"number",isBoolean:"boolean",isCollection:"array",isList:"array",isObject:"object"};if(t[i]&&!s)return{type:"json",path:e,op:"type",value:t[i]}}return null}(t);e?c.push(e):p++}p&&s(`${t}: ${p} assert${1===p?"":"s"} the app has no check for were left out`);let d=[];for(let r of e.response.get("Captures")??[]){let e=/^([A-Za-z_][\w]*)\s*:\s*(jsonpath|header)\s+("(?:[^"\\]|\\.)*")/.exec(r);e?d.push({name:e[1],from:"header"===e[2]?"header":"json",path:"header"===e[2]?px(e[3]):pk(px(e[3]))}):s(`${t}: a capture the app can't take ("${r.slice(0,50)}") was left out`)}n={...n,checks:c,saveValues:d};let f=(e.comment||`${e.method} ${e.url.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120);if(i.push({collection:o2(r),name:f,request:pv(n,e.headers,s,t)}),i.length>=2e3)break}if(!i.length)throw Error("No requests found in this Hurl file");return{kind:"hurl",title:r,requests:i,environments:[],warnings:[...n]}}function pS(e=""){return e.split("\n").map(e=>/^(~?)([^:]+):\s?(.*)$/.exec(e.trim())).filter(e=>!!e).map(e=>({key:e[2].trim(),value:e[3],enabled:!e[1]}))}function p_(e,t){let r=e.name,n=e.method.toUpperCase(),s=lc({...le(),method:o5.includes(n)?n:"GET"},e.url),i=e.params.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),a=new Set(s.params.map(e=>e.key)),o=i.filter(e=>!a.has(e.key));o.length&&(s={...s,params:[...s.params,...o]});let l=e.body;switch(e.bodyMode){case"json":s=pb(s,l.json??"","json");break;case"text":"json"!==(s=pb({...s},l.text??"","text/plain")).bodyMode||/^\s*[{[]/.test(l.text??"")||(s={...s,bodyMode:"text"});break;case"xml":l.xml&&(s={...s,bodyMode:"text",bodyText:l.xml});break;case"graphql":s={...s,bodyMode:"graphql",graphqlQuery:l.graphql?.query??"",graphqlVariables:l.graphql?.variables??""};break;case"formUrlEncoded":s={...s,bodyMode:"form",formRows:l.form.map(e=>({...e,kind:"text",file:null}))};break;case"multipartForm":l.multipart.some(e=>e.file)&&t(`${r}: choose the files for the form again in the Body tab`),s={...s,bodyMode:"multipart",formRows:l.multipart.map(e=>e.file?{key:e.key,value:"",kind:"file",file:null}:{key:e.key,value:e.value,kind:"text",file:null})}}let u=e.auth;"bearer"===u.mode?s={...s,authMode:"bearer",token:u.token??""}:"basic"===u.mode?s={...s,authMode:"basic",username:u.username??"",password:u.password??""}:"apikey"===u.mode?s={...s,authMode:"api_key",apiName:u.key||"X-API-Key",apiValue:u.value??"",apiIn:"queryparams"===u.placement?"query":"header"}:"none"===u.mode?s={...s,authMode:"none"}:u.mode&&"inherit"!==u.mode&&t(`${r}: ${u.mode} auth isn't imported from Bruno — set it on the Auth tab`);let c=[],p=0;for(let t of e.assertions.filter(e=>e.enabled)){let e=function(e,t){let r=/^(eq|neq|gt|gte|lt|lte|contains|notContains|isDefined|isUndefined|isNull|isString|isNumber|isBoolean|isArray|isJson|matches|length)\s*(.*)$/.exec(t.trim());if(!r)return null;let[,n,s=""]=r,i=px(s);if("res.status"===e&&"eq"===n)return{type:"status",expect:i};if("res.responseTime"===e&&("lt"===n||"lte"===n))return{type:"time",maxMs:Number(i)||1e3};let a=/^res\.headers?\[["']?([^"'\]]+)["']?\]$|^res\.headers?\.([\w-]+)$/.exec(e);if(a){let e=a[1]??a[2];return"isDefined"===n?{type:"header",name:e,op:"exists",value:""}:"eq"===n?{type:"header",name:e,op:"equals",value:i}:"contains"===n?{type:"header",name:e,op:"contains",value:i}:null}if("res.body"===e&&"contains"===n)return{type:"body",op:"contains",value:i};if("res.body"===e&&"isJson"===n)return{type:"body",op:"is_json",value:""};let o=/^res\.body\.?(.*)$/.exec(e)?.[1];if(!o)return null;switch(n){case"eq":return{type:"json",path:o,op:"equals",value:i};case"neq":return{type:"json",path:o,op:"not_equals",value:i};case"gt":case"gte":return{type:"json",path:o,op:"greater",value:"gte"===n?String(Number(i)-1e-9):i};case"lt":case"lte":return{type:"json",path:o,op:"less",value:"lte"===n?String(Number(i)+1e-9):i};case"contains":return{type:"json",path:o,op:"contains",value:i};case"isDefined":return{type:"json",path:o,op:"exists",value:""};case"isUndefined":return{type:"json",path:o,op:"not_exists",value:""};case"isString":case"isNumber":case"isBoolean":case"isArray":return{type:"json",path:o,op:"type",value:n.slice(2).toLowerCase()};case"matches":return{type:"json",path:o,op:"matches",value:i.replace(/^\/|\/$/g,"")};case"length":return{type:"json",path:o,op:"length",value:i};default:return null}}(t.name,t.value);e?c.push(e):p++}return p&&t(`${r}: ${p} assertion${1===p?"":"s"} the app has no check for were left out`),(e.scripts||e.tests)&&t(`${r}: Bruno scripts and tests (bru.*, res.*) aren't imported — the app's scripts use Postman's pm.* — re-create them as checks or pm.test`),pv(s={...s,checks:c,description:e.docs.trim().slice(0,5e4)},e.headers.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),t,r)}let pA=e=>"string"==typeof e?e:null==e?"":String(e),pT=e=>Array.isArray(e)?e:[];function pO(e,t=""){let r=function(e,t){let r=t.toLowerCase(),n=e.replace(/^/,"");if(r.endsWith(".hurl"))return p$(n,t);if(r.endsWith(".bru")||/^meta\s*\{\s*$/m.test(n))return function(e,t){let r=function(e){let t=new Map,r=e.replace(/\r\n?/g,"\n").split("\n");for(let e=0;e<r.length;e++){let n=/^([\w:-]+)\s*\{\s*$/.exec(r[e]);if(!n)continue;let s=[];for(e++;e<r.length&&"}"!==r[e];e++)s.push(r[e].replace(/^ {2}/,""));t.set(n[1],s.join("\n"))}return t}(e),n=Object.fromEntries(pS(r.get("meta")).map(e=>[e.key,e.value])),s=[...r.keys()].find(e=>{let t;return t=e.toUpperCase(),o5.includes(t)});if(!s){if(r.has("vars")||/^vars:secret\s*\[/m.test(e)){let n=pg(t),s=pS(r.get("vars")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,secret:!1})),i=/^vars:secret\s*\[([\s\S]*?)\]/m.exec(e)?.[1]?.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)??[];for(let e of i)s.push({key:e,value:"",secret:!0});return{kind:"bruno",title:"Bruno",requests:[],environments:[{name:n,variables:s}],warnings:i.length?[`${n}: fill in the secret values (${i.join(", ")}) under Environments — Bruno keeps them out of its files`]:[]}}if(r.has("meta")||r.has("headers")||[...r.keys()].some(e=>e.startsWith("auth")))return{kind:"bruno",title:"Bruno",requests:[],environments:[],warnings:[`${pg(t)}.bru: folder-wide headers and auth aren't imported — set them in the folder's settings (⋯ → Folder settings)`]};throw Error("No request found in this .bru file (it has no get { … }, post { … } block)")}let i=Object.fromEntries(pS(r.get(s)).map(e=>[e.key,e.value])),a=new Set,o=Object.fromEntries(pS(r.get(`auth:${i.auth??""}`)).map(e=>[e.key,e.value])),l={name:n.name||pg(t),method:s,url:i.url??"",headers:pS(r.get("headers")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),params:pS(r.get("params:query")??r.get("query")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),bodyMode:{json:"json",text:"text",xml:"xml",graphql:"graphql","form-urlencoded":"formUrlEncoded","multipart-form":"multipartForm"}[i.body??""]??"none",body:{json:r.get("body:json"),text:r.get("body:text"),xml:r.get("body:xml"),graphql:{query:r.get("body:graphql"),variables:r.get("body:graphql:vars")},form:pS(r.get("body:form-urlencoded")).filter(e=>e.enabled),multipart:pS(r.get("body:multipart-form")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,file:/^@file\(/.test(e.value)}))},auth:{mode:i.auth??"inherit",token:o.token,username:o.username,password:o.password,key:o.key,value:o.value,placement:o.placement},assertions:pS(r.get("assert")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),scripts:r.has("script:pre-request")||r.has("script:post-response"),tests:r.has("tests"),docs:r.get("docs")??""},u=p_(l,e=>a.add(e)),c="Bruno";return{kind:"bruno",title:c,requests:[{collection:o2(c),name:l.name.slice(0,120),request:u}],environments:[],warnings:[...a]}}(n,t);if(r.endsWith(".http")||r.endsWith(".rest"))return pw(n,t);let s=n.split(/\r?\n/).find(e=>e.trim()&&!/^\s*(#|\/\/)/.test(e))?.trim()??"";return/^[{[]/.test(s)?null:py.test(s)||/^@[\w.-]+\s*=/.test(s)||/^###/m.test(n)?/^HTTP(\/[\d.]+)?\s+(\d{3}|\*)\s*$/m.test(n)||/^\[(Asserts|Captures|QueryStringParams|FormParams|BasicAuth)\]\s*$/m.test(n)?p$(n,t):pw(n,t):null}(e,t);if(r)return r;let n=function(e,t){let r=e.replace(/^/,"").trim();if(!r)return null;if(r.startsWith("{")||r.startsWith("["))try{return JSON.parse(r)}catch(e){if(/\.json$/i.test(t))throw Error(`Not valid JSON: ${e instanceof Error?e.message:"parse error"}`)}try{return pm(r,{maxAliasCount:200})}catch(e){throw Error(`Not valid JSON or YAML: ${e instanceof Error?e.message.split("\n")[0]:"parse error"}`)}}(e,t);if(!n||"object"!=typeof n)throw Error("This file is empty or not JSON/YAML");let s=n.info;if("string"==typeof s?.schema&&/collection\/v2/.test(s.schema)||Array.isArray(n.item)&&s)return function(e){let t=pM((e.info??{}).name,"Imported collection").trim()||"Imported collection",r=[],n=new Set,s=e=>n.add(e),i=new Set,a=[],o=e=>o2([t,...e].map(e=>e.replace(/[\\/]/g," ")).join("/")),l=0,u=(e,t,r,n,i)=>{let u=o0(),c=pR(i,"prerequest").slice(0,1e5),p=pR(i,"test").slice(0,1e5);if((c||p)&&(u={...u,preScript:c,postScript:p},l++),t?.type&&"inherit"!==t.type){let e=pz({...le(),authMode:"inherit"},t,s,n);u={...u,auth:{authMode:e.authMode,oauth:e.oauth,oauth1:e.oauth1,aws:e.aws,jwt:e.jwt,domain:e.domain,token:e.token,username:e.username,password:e.password,apiName:e.apiName,apiValue:e.apiValue,apiIn:e.apiIn}}}let d=pj(r).map(e=>e).filter(e=>pM(e.key).trim()&&!e.disabled).map(e=>({key:pM(e.key).trim(),value:pM(e.value),secret:"secret"===e.type}));d.length&&(u={...u,variables:pF(d)});let h=pU(e.length?i.description:i.info?.description);h&&(u={...u,description:h}),o1(u)||a.push({path:o(e),settings:u})},c=(e,t)=>{for(let n of e){if(Array.isArray(n.item)){let e=[...t,pM(n.name,"Folder")];e.length>=6&&s(`${e.join(" › ")}: folders deeper than 6 levels were put in the folder above`),u(e,n.auth,n.variable,e.join(" › "),n),c(n.item,e);continue}if(r.length>=2e3)return void s("Only the first 2000 requests were imported");let e=pM(n.name,"Request"),a=[...t,e].join(" › "),p="string"==typeof n.request?{url:n.request}:n.request??{},d=pN(p.method);if(!d){s(`${a}: ${pM(p.method)} requests are not supported; skipped`);continue}let h=function(e){if("string"==typeof e)return e;let t=e??{};if("string"==typeof t.raw)return t.raw;let r=pM(t.protocol),n=Array.isArray(t.host)?t.host.map(e=>pM(e)).join("."):pM(t.host),s=Array.isArray(t.path)?t.path.map(e=>pM(e)).join("/"):pM(t.path),i=pj(t.query).filter(e=>!e.disabled).map(e=>`${pM(e.key)}=${pM(e.value)}`).join("&");return`${r?`${r}://`:""}${n}${s?`/${s}`:""}${i?`?${i}`:""}`}(p.url);for(let e of JSON.stringify(p).matchAll(/\{\{\s*(\$[A-Za-z]+)/g))pL.has(e[1].toLowerCase())||i.add(e[1]);let f=lc({...le(),method:d},h);!f.baseUrl&&h&&(f={...f,url:h}),f=pz({...f,authMode:"inherit"},p.auth,s,a);let m=pj(p.header).filter(e=>!e.disabled).map(e=>{let t=pU(e.description);return{key:pM(e.key),value:pM(e.value),...t?{description:t}:{}}}),y=new Map(pj(p.url?.query).flatMap(e=>{let t=pU(e.description);return t?[[pM(e.key),t]]:[]}));y.size&&(f={...f,params:f.params.map(e=>y.has(e.key)?{...e,description:y.get(e.key)}:e)});let g=pI(m,f,s,a);g=function(e,t,r,n,s){if(!t||t.disabled)return{draft:e,headers:r};let i=r.some(e=>/^content-type$/i.test(e.key));switch(t.mode){case"raw":{let n=pM(t.raw),s="json"===pM(t.options?.raw?.language)||r.some(e=>/^content-type$/i.test(e.key)&&/json/i.test(e.value))||/^\s*[{[]/.test(n);return{draft:{...e,bodyMode:s?"json":"text",bodyText:n},headers:r}}case"urlencoded":{let n=pj(t.urlencoded).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pM(e.key))}=${encodeURIComponent(pM(e.value))}`).join("&");return{draft:{...e,bodyMode:"text",bodyText:n},headers:i?r:[...r,{key:"Content-Type",value:"application/x-www-form-urlencoded"}]}}case"graphql":{let n=t.graphql??{},s="string"==typeof n.variables?n.variables:n.variables?JSON.stringify(n.variables,null,2):"";return{draft:{...e,bodyMode:"graphql",graphqlQuery:pM(n.query),graphqlVariables:s},headers:r.filter(e=>!/^content-type$/i.test(e.key))}}case"formdata":return{draft:pP(e,pj(t.formdata).filter(e=>!e.disabled).map(e=>"file"===e.type?pC(pM(e.key)):{key:pM(e.key),value:pM(e.value),kind:"text",file:null}),n,s),headers:r.filter(e=>!(/^content-type$/i.test(e.key)&&/multipart/i.test(e.value)))};case"file":return n(`${s}: the body is a file — choose it again in the Body tab (the file itself isn't in the export)`),{draft:{...e,bodyMode:"file",bodyFile:null},headers:r};default:return{draft:e,headers:r}}}(g.draft,p.body,g.headers,s,a);let b=pR(n,"prerequest").slice(0,1e5),v=pR(n,"test").slice(0,1e5);(b||v)&&l++,r.push({collection:o(t),name:e,request:{...g.draft,headers:g.headers,preScript:b,postScript:v,description:pU(p.description??n.description)}})}};return u([],e.auth,e.variable,t,e),c(pj(e.item),[]),l&&s(`Pre-request or test scripts came along on ${l} request${1===l?"":"s"} or folder${1===l?"":"s"} — they run as in Postman (Scripts tab, and Folder settings → Scripts)`),i.size&&s(`Postman dynamic values the app doesn't make: ${[...i].slice(0,8).map(e=>`{{${e}}}`).join(", ")} — they are sent as written`),{kind:"postman",title:t,requests:r,folders:a,environments:[],warnings:[...n]}}(n);if(Array.isArray(n.values)&&("environment"===n._postman_variable_scope||"string"==typeof n.name)){var i;let e;return{kind:"postman-environment",title:e=pM((i=n).name,"Imported environment").trim()||"Imported environment",requests:[],environments:[{name:e,variables:pF(pj(i.values).map(e=>e).filter(e=>pM(e.key).trim()&&!1!==e.enabled).map(e=>({key:pM(e.key).trim(),value:pM(e.value),secret:"secret"===e.type})))}],warnings:[]}}if(n.log&&"object"==typeof n.log&&Array.isArray(n.log.entries))return function(e,t){let r=e.log,n=t.replace(/\.har$/i,"").replace(/[_-]+/g," ").trim()||"Browser recording",s=[],i=new Set,a=e=>i.add(e),o=new Set,l=0,u=0;for(let e of pj(r.entries)){var c;let t=e.request??{},r=pM(t.url);if(!/^https?:\/\//i.test(r))continue;let i=pN(t.method);if(!i||"OPTIONS"===i)continue;let p=pM(e._resourceType),d=pM(e.response?.content?.mimeType);if(p&&!["xhr","fetch","document",""].includes(p)||pZ.test(r)||pJ.test(d)){l++;continue}let h=`${i} ${r}`;if(o.has(h))continue;if(o.add(h),s.length>=2e3){a("Only the first 2000 requests were imported");break}let f=new URL(r),m=`${i} ${f.pathname}`,y=lc({...le(),method:i},r),g=pj(t.headers).map(e=>({key:pM(e.name),value:pM(e.value)})).filter(e=>e.key&&!pH.test(e.key));g.some(e=>/^cookie$/i.test(e.key))&&u++;let b=pI(g.filter(e=>!/^cookie$/i.test(e.key)),y,a,m);y=b.draft;let v=t.postData;if(v&&("POST"===(c=i)||"PUT"===c||"PATCH"===c||"DELETE"===c)){let e=pM(v.mimeType),t=pM(v.text);if(/json/i.test(e))y={...y,bodyMode:"json",bodyText:t};else if(/multipart\/form-data/i.test(e)){let e=pj(v.params).map(e=>void 0!==e.fileName?pC(pM(e.name)):{key:pM(e.name),value:pM(e.value),kind:"text",file:null});e.length?y=pP(y,e,a,m):a(`${m}: the recording doesn't have the form's fields; the body was left out`)}else t&&(y={...y,bodyMode:"text",bodyText:t});!e||b.headers.some(e=>/^content-type$/i.test(e.key))||/multipart/i.test(e)||(b={...b,headers:[...b.headers,{key:"Content-Type",value:e.split(";")[0]}]})}s.push({collection:o2(`${n}/${f.host.replace(/:/g," ")}`),name:m.slice(0,120),request:{...y,headers:b.headers}})}if(!s.length)throw Error("No API calls found in this recording — record with DevTools open while you use the app, then Save all as HAR");return l&&a(`${l} page files (images, scripts, styles, fonts) were left out — only API calls are imported`),u&&a(`Cookies were left out of ${u} request${1===u?"":"s"} — send the login request first; the cookie jar keeps its session`),{kind:"har",title:n,requests:s,environments:[],warnings:[...i]}}(n,t);if("export"===n._type&&Array.isArray(n.resources)||"string"==typeof n.type&&n.type.startsWith("collection.insomnia.rest/"))return function(e){let t=new Set,r=e=>t.add(e),n=e=>pV(e,r,"Some values"),s="Insomnia collection",i=[],a=[];if("export"===e._type){let t=pj(e.resources).map(e=>e),r=t.find(e=>"workspace"===e._type);s=pM(r?.name,s)||s;let n=new Map;for(let e of t)"request_group"===e._type&&n.set(pM(e._id),{kind:"folder",name:pM(e.name,"Folder"),raw:e,children:[]}),"request"===e._type&&n.set(pM(e._id),{kind:"request",name:pM(e.name,"Request"),raw:e,children:[]});for(let e of t){let t=n.get(pM(e._id));if(!t)continue;let r=n.get(pM(e.parentId));r?r.children.push(t):i.push(t)}let o=t.find(e=>"environment"===e._type&&e.parentId===r?._id),l=t.filter(e=>"environment"===e._type&&o&&e.parentId===o._id),u=pW(o?.data);if(l.length)for(let e of l)a.push({name:pM(e.name,"Environment"),variables:pF([...u,...pW(e.data)])});else u.length&&a.push({name:`${s} (base)`,variables:u})}else{s=pM(e.name,s)||s;let t=e=>e.map(e=>Array.isArray(e.children)?{kind:"folder",name:pM(e.name,"Folder"),raw:e,children:t(e.children)}:{kind:"request",name:pM(e.name,"Request"),raw:e,children:[]});i=t(pj(e.collection));let r=e.environments;if(r){let e=pW(r.data),t=pj(r.subEnvironments).map(e=>e);if(t.length)for(let r of t)a.push({name:pM(r.name,"Environment"),variables:pF([...e,...pW(r.data)])});else e.length&&a.push({name:`${s} (base)`,variables:e})}}let o=[],l=[],u=o2(s),c=(e,t)=>{for(let s of e){if("folder"===s.kind){let e=[...t,s.name],i=o0();i={...i,auth:pG(i.auth,s.raw.authentication,r,e.join(" › "),n)};let a=pW(s.raw.environment);a.length&&(i={...i,variables:a}),pM(s.raw.description).trim()&&(i={...i,description:pM(s.raw.description).trim().slice(0,5e4)}),o1(i)||l.push({path:o2(`${u}/${e.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),settings:i}),c(s.children,e);continue}if(o.length>=2e3)return void r("Only the first 2000 requests were imported");let e=s.raw,i=[...t,s.name].join(" › "),a=pN(e.method);if(!a){r(`${i}: ${pM(e.method)} requests are not supported; skipped`);continue}let p=lc({...le(),method:a},pV(pM(e.url),r,i)),d=pj(e.parameters).filter(e=>!e.disabled).map(e=>({key:pM(e.name),value:n(pM(e.value))})).filter(e=>e.key);d.length&&(p={...p,params:[...p.params,...d]}),p=pG(p,e.authentication,r,i,n);let h=pI(pj(e.headers).filter(e=>!e.disabled).map(e=>({key:pM(e.name),value:n(pM(e.value))})),p,r,i);p=h.draft;let f=e.body??{},m=pM(f.mimeType);if("application/graphql"===m)try{let e=JSON.parse(pM(f.text,"{}"));p={...p,bodyMode:"graphql",graphqlQuery:n(pM(e.query)),graphqlVariables:e.variables?JSON.stringify(e.variables,null,2):""}}catch{r(`${i}: the GraphQL body could not be read`)}else if(/json/i.test(m))p={...p,bodyMode:"json",bodyText:n(pM(f.text))};else if("application/x-www-form-urlencoded"===m){let e=pj(f.params).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pM(e.name))}=${encodeURIComponent(n(pM(e.value)))}`).join("&");p={...p,bodyMode:"text",bodyText:e}}else"multipart/form-data"===m?p=pP(p,pj(f.params).filter(e=>!e.disabled).map(e=>"file"===e.type?pC(pM(e.name)):{key:pM(e.name),value:n(pM(e.value)),kind:"text",file:null}),r,i):pM(f.text)&&(p={...p,bodyMode:"text",bodyText:n(pM(f.text))});let y=!m||/graphql|multipart/.test(m)||h.headers.some(e=>/^content-type$/i.test(e.key))?h.headers:[...h.headers,{key:"Content-Type",value:m}];o.push({collection:o2(`${u}/${t.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),name:s.name.slice(0,120),request:{...p,headers:"graphql"===p.bodyMode?h.headers:y,description:pM(e.description).trim().slice(0,5e4)}})}};if(c(i,[]),!o.length)throw Error("No requests found in this Insomnia file");return{kind:"insomnia",title:s,requests:o,folders:l,environments:a,warnings:[...t]}}(n);if("string"==typeof n.openapi&&n.openapi.startsWith("3"))return pK(n,"openapi");if("2.0"===n.swagger)return pK(n,"swagger");if(Array.isArray(n.items)&&"string"==typeof n.name&&(void 0!==n.brunoConfig||"1"===n.version)&&pT(n.items).every(e=>"http"===e.type||"graphql"===e.type||"folder"===e.type||"http-request"===e.type||"graphql-request"===e.type))return function(e){let t=pA(e.name).trim()||"Bruno collection",r=new Set,n=e=>r.add(e),s=[],i=(e,r)=>{for(let a of e){if(s.length>=2e3)return;if("folder"===a.type){i(pT(a.items),[...r,pA(a.name).replace(/[\\/]/g," ")]);continue}let e=a.request??{},o=e.body??{},l=e.auth??{},u=pA(l.mode),c=l[u]??{},p=e.script??{},d={name:pA(a.name)||"Request",method:pA(e.method)||"GET",url:pA(e.url),headers:pT(e.headers).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),params:pT(e.params).filter(e=>"query"===pA(e.type||"query")).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),bodyMode:pA(o.mode)||"none",body:{json:pA(o.json),text:pA(o.text),xml:pA(o.xml),graphql:{query:pA(o.graphql?.query),variables:pA(o.graphql?.variables)},form:pT(o.formUrlEncoded).filter(e=>!1!==e.enabled).map(e=>({key:pA(e.name),value:pA(e.value)})),multipart:pT(o.multipartForm).filter(e=>!1!==e.enabled).map(e=>({key:pA(e.name),value:Array.isArray(e.value)?"":pA(e.value),file:"file"===e.type}))},auth:{mode:u,token:pA(c.token),username:pA(c.username),password:pA(c.password),key:pA(c.key),value:pA(c.value),placement:pA(c.placement)},assertions:pT(e.assertions).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),scripts:!!(pA(p.req).trim()||pA(p.res).trim()),tests:!!pA(e.tests).trim(),docs:pA(e.docs)};s.push({collection:o2([t,...r].join("/")),name:d.name.slice(0,120),request:p_(d,n)})}};if(i(pT(e.items),[]),!s.length)throw Error("This Bruno collection has no requests");let a=pT(e.environments).map(e=>({name:pA(e.name)||"Bruno",variables:pT(e.variables).filter(e=>!1!==e.enabled&&pA(e.name)).map(e=>({key:pA(e.name),value:e.secret?"":pA(e.value),secret:!!e.secret}))}));return pT(e.environments).some(e=>pT(e.variables).some(e=>e.secret))&&n("Secret environment values aren't in Bruno's export — fill them in under Environments"),{kind:"bruno",title:t,requests:s,environments:a,warnings:[...r]}}(n);if(n.format===lb&&Array.isArray(n.requests))return function(e){let t="string"==typeof e.name&&e.name.trim()||"Imported collection",r=[],n=new Map;for(let t of e.requests)"string"==typeof t?.ref&&"string"==typeof t.name&&n.set(t.ref,t.name);let s=[];for(let[i,a]of e.requests.entries()){if(!a||"string"!=typeof a.name||!a.request||"object"!=typeof a.request){r.push(`Request ${i+1} isn't a request — skipped`);continue}let e=la({...le(),...a.request,before:null}),o=a.runFirst&&n.has(a.runFirst.ref)?{ref:a.runFirst.ref,requestName:n.get(a.runFirst.ref),extract:Array.isArray(a.runFirst.extract)?a.runFirst.extract:[]}:void 0;a.runFirst&&!o&&r.push(`${a.name}: runs first "${a.runFirst.ref}", which isn't in the file`);let l="string"==typeof a.folder&&a.folder.trim()?`/${a.folder.trim()}`:"";s.push({collection:o2(`${t}${l}`),name:a.name.slice(0,120),request:e,...a.ref?{ref:a.ref}:{},...o?{runFirst:o}:{}})}let i=(e.variables??[]).filter(e=>"string"==typeof e?.key&&e.key.trim()).map(e=>({key:e.key,value:String(e.value??""),secret:!!e.secret}));return{kind:"apitestcenter",title:t,requests:s,environments:i.length?[{name:t,variables:i}]:[],warnings:r}}(n);if("string"==typeof n.openapi)throw Error(`OpenAPI ${n.openapi} is not supported yet — use 3.x or Swagger 2.0`);throw Error("Not a Postman collection or environment, an Insomnia export, a HAR recording, an OpenAPI/Swagger file, a Bruno collection, or an .http / Hurl file")}function pE(e){if(1===e.length)return pO(e[0].text,e[0].name);let t=[],r=[],n="";for(let s of e){if(/(^|[\\/])bruno\.json$/i.test(s.name)){try{let e=JSON.parse(s.text).name;"string"==typeof e&&e.trim()&&(n=e.trim().slice(0,60))}catch{}continue}try{t.push(pO(s.text,s.name))}catch(e){r.push(`${s.name}: ${e instanceof Error?e.message:"could not be read"}`)}}if(!t.length)throw Error(r.join("; ")||"No files");let s=new Set(t.map(e=>e.kind)),i=1===s.size&&s.has("bruno")?n||"Bruno":t[0].title;return{kind:1===s.size?t[0].kind:"several",title:i,requests:t.flatMap(e=>e.requests).slice(0,2e3),folders:t.flatMap(e=>e.folders??[]),environments:t.flatMap(e=>e.environments),warnings:[...r,...t.flatMap(e=>e.warnings)]}}let pM=(e,t="")=>"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):t,pj=e=>Array.isArray(e)?e:[],pN=e=>{let t=pM(e,"GET").toUpperCase();return o5.includes(t)?t:null};function pI(e,t,r,n){let s=[],i=t;for(let t of e){let e=t.key.trim();if(/^authorization$/i.test(e)){let e=/^bearer\s+(.+)$/i.exec(t.value.trim()),s=/^basic\s+(.+)$/i.exec(t.value.trim()),a="none"===i.authMode||"inherit"===i.authMode;if(e&&a)i={...i,authMode:"bearer",token:e[1]};else if(s&&a)try{let[e,...t]=atob(s[1]).split(":");i={...i,authMode:"basic",username:e??"",password:t.join(":")}}catch{r(`${n}: an Authorization header could not be read; set Auth by hand`)}else a&&r(`${n}: an Authorization header was dropped; set Auth by hand`);continue}if(/^cookie$/i.test(e)){r(`${n}: a Cookie header was left out — send the login request first; the cookie jar keeps its session`);continue}e&&s.push({key:e,value:t.value,...t.description?{description:t.description}:{}})}return{draft:i,headers:s}}function pq(e,t,r){let n=e[t],s=e=>"boolean"==typeof e||"number"==typeof e?String(e):pM(e);return Array.isArray(n)?s(n.find(e=>e.key===r)?.value):n&&"object"==typeof n?s(n[r]):""}function pz(e,t,r,n){if(!t||!t.type||"inherit"===t.type)return e;if("noauth"===t.type)return{...e,authMode:"none"};if("bearer"===t.type)return{...e,authMode:"bearer",token:pq(t,"bearer","token")};if("basic"===t.type)return{...e,authMode:"basic",username:pq(t,"basic","username"),password:pq(t,"basic","password")};if("apikey"===t.type)return{...e,authMode:"api_key",apiName:pq(t,"apikey","key")||"X-API-Key",apiValue:pq(t,"apikey","value"),apiIn:"query"===pq(t,"apikey","in")?"query":"header"};if("digest"===t.type)return{...e,authMode:"digest",username:pq(t,t.type,"username"),password:pq(t,t.type,"password")};if("ntlm"===t.type)return{...e,authMode:"ntlm",username:pq(t,t.type,"username"),password:pq(t,t.type,"password"),domain:pq(t,t.type,"domain")};if("awsv4"===t.type)return{...e,authMode:"aws_sigv4",aws:{accessKeyId:pq(t,t.type,"accessKey"),secretAccessKey:pq(t,t.type,"secretKey"),sessionToken:pq(t,t.type,"sessionToken"),region:pq(t,t.type,"region")||"us-east-1",service:pq(t,t.type,"service")||"execute-api"}};if("oauth1"===t.type){let r=pq(t,t.type,"signatureMethod").toUpperCase();return{...e,authMode:"oauth1",oauth1:{consumerKey:pq(t,t.type,"consumerKey"),consumerSecret:pq(t,t.type,"consumerSecret"),token:pq(t,t.type,"token"),tokenSecret:pq(t,t.type,"tokenSecret"),signatureMethod:"HMAC-SHA1"===r||"PLAINTEXT"===r?r:"HMAC-SHA256",realm:pq(t,t.type,"realm"),addTo:"false"===pq(t,t.type,"addParamsToHeader")?"query":"header"}}}if("jwt"===t.type){let r=pq(t,t.type,"algorithm").toUpperCase(),n=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"].includes(r)?r:"HS256";return{...e,authMode:"jwt",jwt:{...e.jwt,algorithm:n,secret:pq(t,t.type,"secret"),privateKey:pq(t,t.type,"privateKey"),payload:pq(t,t.type,"payload")||e.jwt.payload,prefix:pq(t,t.type,"headerPrefix")||"Bearer"}}}return r("oauth2"===t.type?`${n}: OAuth 2.0 settings were not imported — set the token URL and client under Auth → OAuth 2.0`:`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}function pC(e){return{key:e,value:"",kind:"file",file:null}}function pP(e,t,r,n){let s=t.filter(e=>"file"===e.kind).length;return s&&r(`${n}: choose the file${1===s?"":"s"} for the form again in the Body tab (files aren't in the export)`),{...e,bodyMode:"multipart",formRows:t}}function pR(e,t){return pj(e.event).map(e=>e).filter(e=>e.listen===t&&!e.disabled).map(e=>{let t=(e.script??{}).exec;return Array.isArray(t)?t.map(e=>pM(e)).join("\n"):pM(t)}).filter(e=>e.trim()).join("\n")}let pL=new Set(["$guid","$uuid","$randomuuid","$timestamp","$isotimestamp","$randomint","$randomemail","$randomfirstname","$randomlastname","$randomfullname","$randomboolean","$randomalphanumeric"]);function pU(e){return("string"==typeof e?e:e&&"object"==typeof e?pM(e.content):"").trim().slice(0,5e4)}function pF(e){let t=new Map;for(let r of e)/^[A-Za-z_][\w.-]*$/.test(r.key)&&t.set(r.key,r);return[...t.values()]}function pD(e,t,r=0){let n=t;for(let t=0;n&&"string"==typeof n.$ref&&t<20;t++){let t=n.$ref;if(!t.startsWith("#/"))return{};n=t.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")).reduce((e,t)=>e&&"object"==typeof e?e[t]:void 0,e)}return r>40?{}:n??{}}function pB(e,t,r=0,n=new Set){let s=pD(e,t);if(r>6||n.has(s))return null;if("example"in s)return s.example;if(Array.isArray(s.examples)&&s.examples.length)return s.examples[0];if("default"in s)return s.default;if(Array.isArray(s.enum)&&s.enum.length)return s.enum[0];let i=new Set(n).add(s),a=pj(s.allOf);if(a.length)return Object.assign({},...a.map(t=>pB(e,t,r+1,i)).filter(e=>e&&"object"==typeof e));let o=pj(s.oneOf).concat(pj(s.anyOf));if(o.length)return pB(e,o[0],r+1,i);let l=Array.isArray(s.type)?s.type.find(e=>"null"!==e):s.type;if("object"===l||s.properties){let t={};for(let[n,a]of Object.entries(s.properties??{}))t[n]=pB(e,a,r+1,i);return t}if("array"===l)return[pB(e,s.items,r+1,i)];if("integer"===l||"number"===l)return 0;if("boolean"===l)return!1;if("string"===l){let e=pM(s.format);return"date-time"===e?"2026-01-01T00:00:00Z":"date"===e?"2026-01-01":"email"===e?"user@example.com":"uuid"===e?"00000000-0000-0000-0000-000000000000":"string"}return null}function pK(e,t){let r=e.info??{},n=pM(r.title,"Imported API").trim()||"Imported API",s=new Set,i=e=>s.add(e),a=[],o=0,l=new Map,u=(e,t="",r=!1)=>{/^[A-Za-z_][\w.-]*$/.test(e)&&!l.has(e)&&l.set(e,{key:e,value:t,secret:r})},c=function(e,t){if("swagger"===t){let t=pM(e.host);if(!t)return null;let r=pj(e.schemes).includes("https")||!pj(e.schemes).length?"https":pM(pj(e.schemes)[0]);return`${r}://${t}${pM(e.basePath).replace(/\/$/,"")}`}let r=pj(e.servers)[0];if(!r)return null;let n=pM(r.url);for(let[e,t]of Object.entries(r.variables??{}))n=n.replace(`{${e}}`,pM(t.default));return n.replace(/\/$/,"")}(e,t);c&&/^https?:\/\//i.test(c)?u("baseUrl",c):(u("baseUrl","https://api.example.com"),i(c?`The server URL “${c}” is relative — set baseUrl in the “${n}” environment`:`No server URL in the file — set baseUrl in the “${n}” environment`));let p="swagger"===t?e.securityDefinitions:(e.components??{}).securitySchemes,d=(t,r)=>{let n=pj(t)[0],s=n?Object.keys(n)[0]:void 0,a=s?pD(e,p?.[s]):void 0;if(!a)return r;let o=pM(a.type),l=pM(a.scheme).toLowerCase();return"http"===o&&"bearer"===l||"oauth2"===o||"openIdConnect"===o?(u("token","",!0),"http"!==o&&i(`${o} sign-in is set up as a Bearer token — paste a token into {{token}}, or use Run first to fetch one`),{...r,authMode:"bearer",token:"{{token}}"}):"http"===o&&"basic"===l||"basic"===o?(u("username"),u("password","",!0),{...r,authMode:"basic",username:"{{username}}",password:"{{password}}"}):"apiKey"===o?"cookie"===a.in?(i("Cookie API keys are not supported; set Auth by hand"),r):(u("apiKey","",!0),{...r,authMode:"api_key",apiName:pM(a.name,"X-API-Key"),apiValue:"{{apiKey}}",apiIn:"query"===a.in?"query":"header"}):r};for(let[r,s]of Object.entries(e.paths??{})){let l=pD(e,s),c=pj(l.parameters);for(let[s,p]of Object.entries(l)){let l,h,f=pN(s);if(!f||"parameters"===s||"object"!=typeof p)continue;if(a.length>=2e3){i("Only the first 2000 operations were imported");break}let m=pM(pj(p.tags)[0]),y=pM(p.summary).trim()||pM(p.operationId).trim()||`${f} ${r}`,g=m?`${m} › ${y}`:y,b=[...c,...pj(p.parameters)].map(t=>pD(e,t)),v=r.replace(/\{([^}]+)\}/g,(t,r)=>{let n=r.replace(/[^\w.-]/g,"_"),s=b.find(e=>"path"===e.in&&e.name===r);return u(n,pM(s?.example??pD(e,s?.schema).example??"")),`{{${n}}}`}),w=b.filter(e=>"query"===e.in&&(e.required||"example"in e)).map(t=>({key:pM(t.name),value:pM(t.example??pB(e,t.schema)??""),...pM(t.description).trim()?{description:pM(t.description).trim()}:{}})),k=lc({...le(),method:f},`{{baseUrl}}${v}`);k={...k,url:`{{baseUrl}}${v}${w.length?`?${w.map(e=>`${e.key}=${e.value}`).join("&")}`:""}`,params:w};let x=pI(b.filter(e=>"header"===e.in).map(e=>({key:pM(e.name),value:pM(e.example??""),...pM(e.description).trim()?{description:pM(e.description).trim()}:{}})),k=d(p.security??e.security,k),i,g);k={...x.draft,headers:x.headers};let $=!0,S=!1;if("openapi"===t&&p.requestBody){let t=pD(e,p.requestBody).content??{},r=Object.keys(t).find(e=>/json/i.test(e))??Object.keys(t)[0];if(r){let n=t[r];if($=/json/i.test(r),l=n.schema,h=n.example??Object.values(n.examples??{})[0]?.value,!/json/i.test(r)){if(/x-www-form-urlencoded/i.test(r)&&!k.headers.some(e=>/^content-type$/i.test(e.key)))k={...k,headers:[...k.headers,{key:"Content-Type",value:r}]};else if(/multipart/i.test(r)){let t=Object.entries(pD(e,n.schema)?.properties??{}).map(([t,r])=>{let n=pD(e,r);return"binary"===n.format||"base64"===n.format||"array"===n.type&&pD(e,n.items)?.format==="binary"?pC(t):{key:t,value:void 0!==n.example?pM(n.example,JSON.stringify(n.example)):"",kind:"text",file:null}});k={...k,bodyMode:"multipart",formRows:t},S=!0}}}}else if("swagger"===t){let e=b.find(e=>"body"===e.in);e&&(l=e.schema)}if(!S&&(l||void 0!==h)&&"GET"!==f&&"HEAD"!==f){let t=h??pB(e,l);k=$?{...k,bodyMode:"json",bodyText:JSON.stringify(t??{},null,2)}:{...k,bodyMode:"text",bodyText:"object"==typeof t&&t?new URLSearchParams(Object.entries(t).map(([e,t])=>[e,pM(t)])).toString():pM(t)}}let _=Object.keys(p.responses??{}).find(e=>/^2\d\d$/.test(e)),A=[{type:"status",expect:_??"2xx"}],T=null;if(_){let r=pD(e,(p.responses??{})[_]),n=r.content??{},s=Object.keys(n).find(e=>/json/i.test(e)),i="swagger"===t?r.schema:s?n[s].schema:void 0,a=function(e,t,r){if(!t||"object"!=typeof t)return null;let n=new Map,s=(t,r)=>{if(!(r>60)&&t&&"object"==typeof t){if(Array.isArray(t))return t.forEach(e=>s(e,r+1));if("string"==typeof t.$ref&&t.$ref.startsWith("#/")&&!n.has(t.$ref)){let i=pD(e,{$ref:t.$ref});n.set(t.$ref,i),s(i,r+1)}for(let[e,n]of Object.entries(t))"$ref"!==e&&"example"!==e&&"examples"!==e&&s(n,r+1)}};s(t,0);let i=pD(e,t);if(!["type","properties","items","allOf","anyOf","oneOf","enum","required"].some(e=>e in i)||n.size>200)return null;let a={title:r,...t};for(let[e,t]of n){let r=e.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")),n=a;for(let e of r.slice(0,-1))n=n[e]??={};n[r[r.length-1]]=t}let o=JSON.stringify(a);return o.length<=2e5?o:null}(e,i,`${y} (${_})`);a&&(A.push({type:"schema",schema:a}),o++);let l=s?n[s]:void 0,u="swagger"===t?(r.examples??{})["application/json"]:l?.example??Object.values(l?.examples??{})[0]?.value,c=void 0!==u?u:i?pB(e,i):void 0;void 0!==c?T={status:Number(_),headers:[["Content-Type","application/json"]],body:JSON.stringify(c,null,2),delayMs:0}:"204"!==_&&Object.keys(n).length||(T={status:Number(_),headers:[],body:"",delayMs:0})}let O=[pM(p.summary).trim()&&pM(p.summary).trim()!==y?pM(p.summary).trim():"",pM(p.description).trim()].filter(Boolean).join("\n\n");a.push({collection:n,name:g,request:{...k,checks:A,mock:T,description:O.slice(0,5e4)}})}}a.length||i("The file has no operations under “paths”"),o&&i(`${o} request${1===o?" checks its answer":"s check their answers"} against the response schema in the file (Checks tab) — remove a check where the API differs from its documentation`);let h=pM(r.description).trim(),f=h?[{path:o2(n),settings:{...o0(),description:h.slice(0,5e4)}}]:[];return{kind:t,title:n,requests:a,folders:f,environments:[{name:n,variables:[...l.values()]}],warnings:[...s]}}let pZ=/\.(png|jpe?g|gif|svg|webp|avif|ico|bmp|css|js|mjs|map|woff2?|ttf|otf|eot|mp4|webm|mp3|wav|pdf)(\?|$)/i,pJ=/^(image|font|audio|video)\/|^text\/(css|javascript)|javascript/i,pH=/^(:|host$|content-length$|connection$|accept-encoding$|accept-language$|user-agent$|origin$|referer$|priority$|upgrade-insecure-requests$|cache-control$|pragma$|dnt$|sec-|te$)/i;function pV(e,t,r){return/\{%/.test(e)&&t(`${r}: Insomnia template tags ({% … %}) were kept as text — replace them with {{variables}} or Run first`),e.replace(/\{\{\s*_\.([\w.-]+)\s*\}\}/g,"{{$1}}")}function pW(e,t=""){if(!e||"object"!=typeof e||Array.isArray(e))return[];let r=[];for(let[n,s]of Object.entries(e)){let e=t?`${t}.${n}`:n;s&&"object"==typeof s&&!Array.isArray(s)?r.push(...pW(s,e)):/^[A-Za-z_][\w.-]*$/.test(e)&&r.push({key:e,value:"string"==typeof s?s:JSON.stringify(s),secret:!1})}return r}function pG(e,t,r,n,s){if(!t||!t.type||"none"===t.type||t.disabled)return t?.type==="none"?{...e,authMode:"none"}:e;let i=e=>s(pM(t[e]));switch(t.type){case"bearer":return{...e,authMode:"bearer",token:i("token")};case"basic":return{...e,authMode:"basic",username:i("username"),password:i("password")};case"digest":return{...e,authMode:"digest",username:i("username"),password:i("password")};case"ntlm":return{...e,authMode:"ntlm",username:i("username"),password:i("password")};case"apikey":return{...e,authMode:"api_key",apiName:i("key")||"X-API-Key",apiValue:i("value"),apiIn:"queryParams"===pM(t.addTo)?"query":"header"};case"iam":return{...e,authMode:"aws_sigv4",aws:{accessKeyId:i("accessKeyId"),secretAccessKey:i("secretAccessKey"),sessionToken:i("sessionToken"),region:i("region")||"us-east-1",service:i("service")||"execute-api"}};case"oauth1":{let s=pM(t.signatureMethod).toUpperCase();return s.startsWith("RSA")&&r(`${n}: OAuth 1.0 with ${s} isn't supported; set the signature method by hand`),{...e,authMode:"oauth1",oauth1:{consumerKey:i("consumerKey"),consumerSecret:i("consumerSecret"),token:i("tokenKey"),tokenSecret:i("tokenSecret"),signatureMethod:"HMAC-SHA1"===s||"PLAINTEXT"===s?s:"HMAC-SHA256",realm:i("realm"),addTo:"header"}}}case"oauth2":{let s=pM(t.grantType);return"implicit"===s&&r(`${n}: the OAuth 2.0 implicit grant is outdated and not supported — it was set to client credentials`),{...e,authMode:"oauth2",oauth:{...oZ(),grant:"password"===s||"authorization_code"===s?s:"client_credentials",tokenUrl:i("accessTokenUrl"),authUrl:i("authorizationUrl"),clientId:i("clientId"),clientSecret:i("clientSecret"),scope:i("scope"),username:i("username"),password:i("password"),redirectUri:i("redirectUrl")||oZ().redirectUri,pkce:!1!==t.usePkce}}}default:return r(`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}}let pX=[1,2,3,5,7.5,10,15,20,30,50,75,100,150,200,300,500,750,1e3,1500,2e3,3e3,5e3,1e4,1/0];function pY(e){let t=pX[e]??1/0,r=0===e?0:pX[e-1],n=e=>e>=1e3?`${e/1e3}s`:`${e}ms`;return 1/0===t?`> ${n(r)}`:`${n(r)}–${n(t)}`}function pQ(e){let t=Array(pX.length).fill(0),r=!1;for(let n of e)if(n){r=!0;for(let e=0;e<t.length;e++)t[e]+=n[e]??0}return r?t:null}function p0(e,t){let r=0,n=0,s=0;for(let i=0;i<e.length;i++){let a=e[i]??0;r+=a;let o=pX[i]??1/0;o<=t?n+=a:o<=4*t&&(s+=a)}return r?(n+s/2)/r:null}function p1(e){let t=Number(e);switch(t){case 0:return"no answer at all — a timeout, a refused connection, or a network problem";case 400:return"bad request — the API did not accept what was sent";case 401:return"not signed in — the token or password is missing or expired";case 403:return"forbidden — refused on purpose, often by a firewall that blocks heavy traffic";case 404:return"not found — the address is wrong";case 408:return"the server gave up waiting for the request";case 409:return"conflict — the request clashed with the current state of the data";case 413:return"the request body is too large";case 422:return"the API understood the request but rejected its content";case 429:return"too many requests — the server or its firewall is limiting how fast you can call it";case 500:return"server error — the API itself crashed or hit a bug";case 502:return"bad gateway — a proxy in front of the API could not reach it";case 503:return"unavailable — the API is overloaded or down";case 504:return"gateway timeout — a proxy in front of the API waited too long"}return t>=500?"server error":t>=400?"the request was refused":"unexpected response"}e.s(["M",0,pX,"G",0,p0,"B",0,pY,"p",0,pQ],47253);let p2=new Set(["429","403"]);function p5(e){let t=e.summary,r=t.http.failed.rate,n=Object.entries(t.http.status).filter(([e])=>"0"===e||Number(e)>=400),s=n.reduce((e,[,t])=>e+t,0),i=[...n].sort((e,t)=>t[1]-e[1])[0],a=i&&s?{code:i[0],count:i[1],share:i[1]/s,meaning:p1(i[0])}:null,o=n.filter(([e])=>p2.has(e)).reduce((e,[,t])=>e+t,0),l=e.buckets.filter(e=>e.rps>0||e.vus>0),u=function(e){for(let t=0;t<e.length;t++){let r=e.slice(t,t+3).filter(e=>e.rps>0);if(r.length&&r.every(e=>e.failedRate>=.5))return t}return -1}(l),c=u>=0?l[u]:null,p=c?{elapsedS:c.elapsedS,vus:Math.round(c.vus),rps:Math.round(c.rps)}:null,d=null;if(c){let e=Math.max(...l.slice(u).map(e=>e.vus)),t=l.findIndex((t,r)=>r>=u&&t.vus===e),r=l.slice(t+1).filter(e=>e.rps>0&&e.vus<=Math.max(1,.6*c.vus));if(r.length>=3){let e=r.slice(Math.floor(r.length/3));d=e.reduce((e,t)=>e+t.failedRate,0)/e.length<.1}}let h=c?l.slice(0,u).filter(e=>e.rps>0&&e.failedRate<.5):[],f=h.length?{vus:Math.round(Math.max(...h.map(e=>e.vus))),rps:Math.round(Math.max(...h.map(e=>e.rps)))}:null,m=null;if(t.latencyOkMs&&t.latencyOkMs.p95>0)m=t.latencyOkMs.p95;else{let e=pQ((c?h:l.filter(e=>e.failedRate<.5)).map(e=>e.hist));m=e?function(e){let t=e.reduce((e,t)=>e+t,0);if(!t)return null;let r=0;for(let n=0;n<e.length;n++)if((r+=e[n])/t>=.95){let e=pX[n];return Number.isFinite(e)?e:pX[pX.length-2]}return null}(e):null}return{failedRate:r,dominant:a,blocked:s>0&&o/s>=.5,timingsUnreliable:r>=.5,onset:p,recovered:d,lastHealthy:f,healthyP95Ms:m}}e.s(["R",0,p2,"F",0,p5,"Q",0,function(e){let t=function(e){let t=e.buckets.filter(e=>e.rps>0);if(t.length<2)return null;let r=t.map(e=>e.rps).sort((e,t)=>e-t),n=e=>Math.round(100*e)/100,s=e.summary.http.rps.avg||r.reduce((e,t)=>e+t,0)/e.buckets.length,i=e.buckets.filter(e=>e.vus>0);return{rps:{min:n(r[0]),max:n(r[r.length-1]),avg:n(s),p95:n(r[Math.min(r.length-1,Math.max(0,Math.ceil(.95*r.length)-1))])},vusAvg:i.length?n(i.reduce((e,t)=>e+t.vus,0)/i.length):e.summary.vus.avg}}(e);if(!t)return e;let{rps:r}=e.summary.http,n=r.min===r.max,s=e.summary.vus.avg<t.vusAvg/2;return n||s?{...e,summary:{...e.summary,http:{...e.summary.http,rps:n?t.rps:r},vus:{...e.summary.vus,avg:s?t.vusAvg:e.summary.vus.avg}}}:e},"j",0,p1],48191);let p9={errorWarn:.01,errorFail:.05,p95WarnMs:500,p95FailMs:2e3,stabilityWarn:1.5,stabilityFail:2.5};function p6(e){return e&&e.p95Ms>0&&e.errorRate>=0?{errorWarn:.5*e.errorRate,errorFail:e.errorRate,p95WarnMs:.8*e.p95Ms,p95FailMs:e.p95Ms,owned:!0}:{...p9,owned:!1}}function p4(e,t,r){let{buckets:n}=e;if(0===n.length)return 0;let s=Math.floor(n.length*t),i=Math.max(s+1,Math.ceil(n.length*r)),a=n.slice(s,i).map(e=>e.p95Ms).filter(e=>e>0);return 0===a.length?0:a.reduce((e,t)=>e+t,0)/a.length}function p3(e){let t,r=e.summary.http.status;return{failedRate:e.summary.http.failed.rate,p95:e.summary.latencyMs.p95,requests:e.summary.http.requests,bucketCount:e.buckets.length,earlyP95:p4(e,0,.33),lateP95:p4(e,.66,1),status5xx:Object.entries(r).filter(([e])=>Number(e)>=500).reduce((e,[,t])=>e+t,0),status0:r["0"]??0,checksPassed:e.summary.checks.reduce((e,t)=>e+t.passes,0),checksFailed:e.summary.checks.reduce((e,t)=>e+t.fails,0),dropped:e.summary.droppedIterations??0,topFailure:(t=Object.entries(r).filter(([e])=>"0"===e||Number(e)>=400).sort((e,t)=>t[1]-e[1])[0])?{code:t[0],count:t[1]}:null,blockedCount:Object.entries(r).filter(([e])=>p2.has(e)).reduce((e,[,t])=>e+t,0),status503:r["503"]??0,okP95:e.summary.latencyOkMs?.p95||null}}function p8(e,t={}){return p7(p3(e),t)}function p7(e,t={}){var r;let{failedRate:n,p95:s,requests:i,status5xx:a,status0:o}=e,l=p6(t.slo),u=l.owned?`your target: fail ≥ ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%`:"default: fail ≥ 5%",c=l.owned?`your target: warn ≥ ${(100*l.errorWarn).toFixed(l.errorWarn<.01?2:1)}%`:"default: warn ≥ 1%",p=Math.round(n*i),d=n>=l.errorFail&&(e.blockedCount??0)>=.5*p&&p>0,h=i>0&&n>=.5,f=e.topFailure,m=f&&p?` Mostly ${"0"===f.code?"no answer":f.code}: ${p1(f.code)}.`:"",y=l.owned?`your target: fail ≥ ${Math.round(l.p95FailMs)} ms`:"default: fail ≥ 2 s",g=l.owned?`your target: warn ≥ ${Math.round(l.p95WarnMs)} ms`:"default: warn ≥ 500 ms",b=0===i?{id:"errors",title:"Errors",level:"fail",summary:"No HTTP requests completed. The target may be unreachable, hanging, or blocked."}:n>=l.errorFail?{id:"errors",title:"Errors",level:"fail",summary:`${(100*n).toFixed(1)}% of requests failed (${u}).${m||" Clients would see this as broken."}`}:n>=l.errorWarn?{id:"errors",title:"Errors",level:"warn",summary:`${(100*n).toFixed(1)}% failed (${c}).${m||" Fine for a spike test; noisy for a smoke test."}`}:{id:"errors",title:"Errors",level:"pass",summary:`${(100*n).toFixed(2)}% failed. Under this load the API mostly answered.`},v=(()=>{if(h){let t=e.okP95;return{id:"latency",title:"Latency",level:null!=t&&t>=l.p95FailMs?"fail":"warn",summary:`Not meaningful here: ${(100*n).toFixed(0)}% of responses were errors, and errors come back fast.${null!=t?` Successful requests alone: p95 ${Math.round(t)} ms.`:""}`}}return s<=0&&0===i?{id:"latency",title:"Latency",level:"fail",summary:"No latency samples. Nothing to judge."}:s>=l.p95FailMs?{id:"latency",title:"Latency",level:"fail",summary:`p95 is ${Math.round(s)} ms (${y}). Most users would feel this as stuck.`}:s>=l.p95WarnMs?{id:"latency",title:"Latency",level:"warn",summary:`p95 is ${Math.round(s)} ms (${g}). OK for a heavy report API; slow for a ping/health check.`}:{id:"latency",title:"Latency",level:"pass",summary:`p95 is ${Math.round(s)} ms. 95% of calls were faster than that under this load.`}})(),w=e.earlyP95,k=e.lateP95,x=w>0?k/w:1,$=k-w>=Math.max(20,.1*l.p95WarnMs),S=h?{id:"stability",title:"Stability",level:"warn",summary:"Not judged: most responses were errors, so changes in response time describe the errors, not the API."}:e.bucketCount<6?{id:"stability",title:"Stability",level:"warn",summary:"Run was too short to judge whether latency stayed flat. Use Average (minutes) for a stability read."}:$&&x>=p9.stabilityFail?{id:"stability",title:"Stability",level:"fail",summary:`p95 grew ~${x.toFixed(1)}\xd7 from the first third to the last third. The API (or the generator) degraded as the test went on.`}:$&&x>=p9.stabilityWarn?{id:"stability",title:"Stability",level:"warn",summary:`p95 rose ~${x.toFixed(1)}\xd7 later in the run. Watch for warm-up, lock contention, or GC.`}:{id:"stability",title:"Stability",level:"pass",summary:"Latency did not blow up over time in this run. That is a healthy pattern."},_=e.dropped??0,A=d?{id:"capacity",title:"Capacity",level:"fail",summary:`Refused on purpose (${f&&p2.has(f.code)?f.code:"429/403"}): a rate limit or firewall stopped the load. This shows the limit you hit, not how much the API can take.`}:(e.status503??0)>=.5*p&&n>=l.errorFail?{id:"capacity",title:"Capacity",level:"fail",summary:"Mostly 503 (unavailable): the API, or something in front of it, was overloaded at this load."}:_>0&&_>=Math.max(1,(i+_)*.05)?{id:"capacity",title:"Capacity",level:"fail",summary:`${_.toLocaleString("en-US")} requests were never sent: this computer ran out of virtual users to hold the rate. Raise Max virtual users, or the API is too slow for this rate.`}:o>.1*i&&i>0?{id:"capacity",title:"Capacity",level:"fail",summary:"Many requests never got an HTTP status (network/timeout). Either the API or this machine’s generator is saturated."}:a>0&&a/Math.max(i,1)>=.02?{id:"capacity",title:"Capacity",level:"fail",summary:"Server 5xx responses appeared. The API is shedding load or crashing under these VUs."}:_>0?{id:"capacity",title:"Capacity",level:"warn",summary:`${_.toLocaleString("en-US")} requests were dropped because no virtual user was free. The rate you asked for was not fully held.`}:s>=l.p95WarnMs&&n<l.errorWarn?{id:"capacity",title:"Capacity",level:"warn",summary:"It still answers, but slowly. You are near a capacity cliff: raise VUs carefully or add think time."}:{id:"capacity",title:"Capacity",level:"pass",summary:"No clear saturation signal (timeouts / 5xx) at this VU level."},T=e.checksPassed??0,O=e.checksFailed??0,E=T+O,M=t.slo?.checksRate??.99,j=0===E?null:T/E<M?{id:"checks",title:"Checks",level:"fail",summary:`${(T/E*100).toFixed(1)}% of checks passed (needs ${(100*M).toFixed(+(M<1))}%). Responses arrived, but not all of them were correct.`}:O>0?{id:"checks",title:"Checks",level:"warn",summary:`${O.toLocaleString("en-US")} of ${E.toLocaleString("en-US")} checks failed — within your bar, but look at which ones.`}:{id:"checks",title:"Checks",level:"pass",summary:`All ${E.toLocaleString("en-US")} checks passed. Responses were correct, not just fast.`},N=[b,v,S,A,...j?[j]:[]],I=(r=N.map(e=>e.level)).includes("fail")?"fail":r.includes("warn")?"warn":"pass",q=d?"Blocked by a rate limit or firewall at this load — the results show that limit, not the API’s speed.":l.owned?"pass"===I?"Meets your performance targets under this load.":"warn"===I?"Close to your performance targets. Read the checks before you trust it in UAT.":"Misses your performance targets at this load.":"pass"===I?"Looks healthy under this load (built-in defaults — set your own under Goals).":"warn"===I?"Usable, with caveats. Read the lines below before you trust it in UAT.":"This run does not look production-ready at this load.";return{overall:I,headline:q,aspects:N,disclaimer:l.owned?`Your targets: errors < ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%, p95 < ${Math.round(l.p95FailMs)} ms. Stability and capacity use built-in rules.`:"Heuristics only (errors < 1%, p95 < 500 ms as a starting bar). Set your own thresholds when you know the API’s contract."}}function de(e,t){try{let r=new URL(t);return`${e.toUpperCase()} ${r.origin}${r.pathname.replace(/\/+$/,"")||"/"}`}catch{return`${e.toUpperCase()} ${t}`}}function dt(e,t){let r=(e,t)=>t>0?e/t-1:null;return{p95:r(e.p95,t.p95),rps:r(e.rps,t.rps),errorRate:t.errorRate>0?e.errorRate/t.errorRate-1:e.errorRate>0?null:0}}e.s(["s",0,p8,"F",0,p7,"X",0,function(e){let t=e.definition.load.stages;return t.length>0?t.reduce((e,t)=>e+a4(t.duration),0):3e4},"P",0,function(e,t){let r=p8(e,{slo:t}),n=e=>"pass"===e?"[PASS]":"warn"===e?"[WARN]":"[FAIL]",s=e.summary.http.rps.avg,i=s>=100?String(Math.round(s)):s>=10?s.toFixed(1):s.toFixed(2),a=["APITestCenter | load test result",`${n(r.overall)} ${r.overall.toUpperCase()}`,r.headline,"","Request",`${e.definition.method} ${e.definition.url}`,"","Results",`p95 ${Math.round(e.summary.latencyMs.p95)} ms`,`Errors ${(100*e.summary.http.failed.rate).toFixed(2)}%`,`Requests ${e.summary.http.requests.toLocaleString("en-US")}`,`Peak VUs ${e.summary.vus.max}`,`Avg rps ${i}`,"","Checks",...r.aspects.map(e=>`${n(e.level)} ${e.title} — ${e.summary}`),"","Please attach the HTML report (charts) and the Excel workbook (numbers).","Tokens are not included.","",r.disclaimer];return{subject:`API test ${r.overall.toUpperCase()}: ${e.testName}`,body:a.join("\n")}},"v",0,p6,"b",0,p3],2385),e.s(["L",0,dt,"U",0,de],94122);let dr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),dn=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:2)} s`:`${e>=100?Math.round(e):e>=10?e.toFixed(1):e.toFixed(2)} ms`,ds=e=>`${(100*e).toFixed(e>0&&e<.001?3:2)}%`,di={pass:{word:"PASS",mark:"✓",ink:"#137333",bg:"#e6f4ea",line:"#a8dab5"},warn:{word:"WARNING",mark:"!",ink:"#975300",bg:"#fef3e0",line:"#f5cf8b"},fail:{word:"FAIL",mark:"✕",ink:"#c62828",bg:"#fdecea",line:"#f3b0aa"}},da={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function dl(e){let t=Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3));return t>=60?`${Math.floor(t/60)} min ${t%60} s`:`${t} s`}function du(e,t){return null!=e&&Number.isFinite(e)?.005>Math.abs(e)?{text:"no change",ink:"#5c6778"}:{text:`${e>0?"▲":"▼"} ${Math.abs(100*e).toFixed(0)}%`,ink:(t?e>0:e<0)?"#c62828":"#137333"}:null}function dc(e){let t=new TextEncoder().encode(e),r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r).replace(/.{76}/g,"$&\r\n")}e.s(["H",0,function(e,t={}){let r,n=p8(e,{slo:t.slo??null}),s=di[n.overall],i=e.summary,a=t.appUrl??"https://apitestcenter.com",o=t.baseline?dt({p95:i.latencyMs.p95,rps:i.http.rps.avg,errorRate:i.http.failed.rate},t.baseline):null;i.checks.reduce((e,t)=>e+t.passes,0),i.checks.reduce((e,t)=>e+t.fails,0);let l=e.definition.load.executor.endsWith("arrival-rate"),u=new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}),c=[{label:"Response time",tech:"95% of requests (p95)",value:dn(i.latencyMs.p95),change:du(o?.p95??null,!0)},{label:"Requests per second",tech:"throughput",value:(r=i.http.rps.avg)>=100?String(Math.round(r)):r>=10?r.toFixed(1):r.toFixed(2),change:du(o?.rps??null,!1)},{label:"Failed requests",tech:"error rate",value:ds(i.http.failed.rate),change:du(o?.errorRate??null,!0)},{label:"Typical response",tech:"median (p50)",value:dn(i.latencyMs.median)},{label:"Slowest 1%",tech:"p99",value:dn(i.latencyMs.p99)},{label:l?"Users needed":"Simulated users",tech:"peak VUs",value:String(i.vus.max)}],p=[["Fastest",i.latencyMs.min],["Typical (p50)",i.latencyMs.median],["Most (p90)",i.latencyMs.p90],["95% (p95)",i.latencyMs.p95],["Slowest 1% (p99)",i.latencyMs.p99],["Slowest",i.latencyMs.max]],d=Math.max(...p.map(([,e])=>e),1),h="font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif",f=(e,t="")=>`<td style="${h};font-size:14px;color:#12151c;${t}">${e}</td>`,m=e=>`<tr><td style="${h};padding:22px 24px 8px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5c6778">${dr(e)}</td></tr>`,y=c.map(e=>`<td width="33%" valign="top" style="${h};padding:6px">
744
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new cO(cV(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new c_(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function cX(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function cY(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),s=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length),n))t.offset+=s;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{let n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}let cQ=Symbol("break visit"),c0=Symbol("skip children"),c1=Symbol("remove item");function c2(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,r,n){let s=n(r,t);if("symbol"==typeof s)return s;for(let i of["key","value"]){let a=r[i];if(a&&"items"in a){for(let r=0;r<a.items.length;++r){let s=e(Object.freeze(t.concat([[i,r]])),a.items[r],n);if("number"==typeof s)r=s-1;else{if(s===cQ)return cQ;s===c1&&(a.items.splice(r,1),r-=1)}}"function"==typeof s&&"key"===i&&(s=s(r,t))}}return"function"==typeof s?s(r,t):s}(Object.freeze([]),e,t)}function c5(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function c9(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=c9(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=c6(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=c6(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=c6(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function c6({start:e,key:t,sep:r,value:n}){let s="";for(let t of e)s+=t.source;if(t&&(s+=c9(t)),r)for(let e of r)s+=e.source;return n&&(s+=c9(n)),s}c2.BREAK=cQ,c2.SKIP=c0,c2.REMOVE=c1,c2.itemAtPath=(e,t)=>{let r=e;for(let[e,n]of t){let t=r?.[e];if(!t||!("items"in t))return;r=t.items[n]}return r},c2.parentCollection=(e,t)=>{let r=c2.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw Error("Parent collection not found")},e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","createScalarToken",0,function(e,t){let{implicitKey:r=!1,indent:n,inFlow:s=!1,offset:i=-1,type:a="PLAIN"}=t,o=uT({type:a,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:"\n"}];switch(o[0]){case"|":case">":{let e=o.indexOf("\n"),t=o.substring(0,e),r=o.substring(e+1)+"\n",s=[{type:"block-scalar-header",offset:i,indent:n,source:t}];return cX(s,l)||s.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:i,indent:n,props:s,source:r}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:o,end:l};default:return{type:"scalar",offset:i,indent:n,source:o,end:l}}},"isCollection",0,e=>!!e&&"items"in e,"isScalar",0,e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),"prettyToken",0,function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},"resolveAsScalar",0,function(e,t=!0,r){if(e){let n=(e,t,n)=>{let s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(r)r(s,t,n);else throw new cO([s,s+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return cF(e,t,n);case"block-scalar":return cU({options:{strict:t}},e,n)}}return null},"setScalarValue",0,function(e,t,r={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:i=!1,type:a}=r,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");a=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=uT({type:a,value:t},{implicitKey:s||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let r=t.indexOf("\n"),n=t.substring(0,r),s=t.substring(r+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=n,e.source=s}else{let{offset:t}=e,r="indent"in e?e.indent:-1,i=[{type:"block-scalar-header",offset:t,indent:r,source:n}];for(let t of(cX(i,"end"in e?e.end:void 0)||i.push({type:"newline",offset:-1,indent:r,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:r,props:i,source:s})}}(e,l);break;case'"':cY(e,l,"double-quoted-scalar");break;case"'":cY(e,l,"single-quoted-scalar");break;default:cY(e,l,"scalar")}},"stringify",0,e=>"type"in e?c9(e):c6(e),"tokenType",0,c5,"visit",0,c2],91723);var c4=e.i(91723);function c3(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let c8=new Set("0123456789ABCDEFabcdef"),c7=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pe=new Set(",[]{}"),pt=new Set(" ,[]{}\n\r "),pr=e=>!e||pt.has(e);class pn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;" "===t;)t=this.buffer[++r+e];if("\r"===t){let t=this.buffer[r+e+1];if("\n"===t||!t&&!this.atEnd)return e+r+1}return"\n"!==t&&!(r>=this.indentNext)&&(t||this.atEnd)?-1:e+r}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&c3(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,r=e.indexOf("#");for(;-1!==r;){let n=e[r-1];if(" "===n||" "===n){t=r-1;break}r=e.indexOf("#",r+1)}for(;;){let r=e[t-1];if(" "===r||" "===r)t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&c3(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!c3(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&c3(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(pr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==r&&r<this.indentNext&&"#"!==n[0]||0===r&&(n.startsWith("---")||n.startsWith("..."))&&c3(n[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let s=0;for(;","===n[s];)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[s+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(pr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||c3(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){let e=this.continueScalar(n+1);if(-1===e)break;n=r.indexOf("\n",e)}-1!==n&&(t=n-("\r"===r[n-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>c3(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,r=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":r+=1;break;case"\n":t=n,r=0;break;case"\r":{let e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);let s=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+r>s)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,r=this.pos-1,n=this.pos-1;for(;e=this.buffer[++n];)if(":"===e){let e=this.buffer[n+1];if(c3(e)||t&&pe.has(e))break;r=n}else if(c3(e)){let s=this.buffer[n+1];if("\r"===e&&("\n"===s?(n+=1,e="\n",s=this.buffer[n+1]):r=n),"#"===s||t&&pe.has(s))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&pe.has(e))break;r=n}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(r+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(pr),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(c3(r)||t&&pe.has(r)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!c3(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(c7.has(t))t=this.buffer[++e];else if("%"===t&&c8.has(this.buffer[e+1])&&c8.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,r=this.pos-1;do t=this.buffer[++r];while(" "===t||e&&" "===t)let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function ps(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function pi(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function pa(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function po(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function pl(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function pu(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function pc(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||ps(t.start,"explicit-key-ind")||ps(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,pa(t.value)?t.value.end?pu(t.value.end,t.sep):t.value.end=t.sep:pu(t.start,t.sep),delete t.sep)}class pp{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new pn,this.onNewLine=e}*parse(e,t=!1){for(let r of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=c5(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&pc(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let r=e.items[e.items.length-1];if(r.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=e.items[e.items.length-1];r.value?e.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=e.items[e.items.length-1];!r||r.value?e.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&-1===pi(r.start)&&(0===t.indent||r.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=r.start:e.items.push({start:r.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==pi(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,r=pl(po(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){pu(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,s=[];if(n&&t.sep&&!t.value){let r=[];for(let n=0;n<t.sep.length;++n){let s=t.sep[n];switch(s.type){case"newline":r.push(n);break;case"space":break;case"comment":s.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(s=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?n||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(pa(t.key)&&!ps(t.sep,"newline")){let e=pl(t.start),r=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:r,sep:n}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(ps(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=pl(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ps(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);n||t.value?(e.items.push({start:s,key:r,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(r):(Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!ps(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else r&&e.items.push({start:s});this.stack.push(n);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){pu(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ps(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let r=pl(po(t));pc(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=pl(po(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=pl(po(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}class pd{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let n=t+r>>1;this.lineStarts[n]<e?t=n+1:r=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function ph(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new pd||null,prettyErrors:t}}function pf(e,t={}){let{lineCounter:r,prettyErrors:n}=ph(t),s=new pp(r?.addNewLine),i=new cG(t),a=null;for(let t of i.compose(s.parse(e),!0,e.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new cO(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=t;return n&&r&&(a.errors.forEach(cM(e,r)),a.warnings.forEach(cM(e,r))),a}function pm(e,t,r){let n;"function"==typeof t?n=t:void 0===r&&t&&"object"==typeof t&&(r=t);let s=pf(e,r);if(!s)return null;if(s.warnings.forEach(e=>uM(s.options.logLevel,e)),s.errors.length>0)if("silent"!==s.options.logLevel)throw s.errors[0];else s.errors=[];return s.toJS(Object.assign({reviver:n},r))}e.s(["Alias",0,uo,"CST",0,c4,"Composer",0,cG,"Document",0,c_,"Lexer",0,pn,"LineCounter",0,pd,"Pair",0,uP,"Parser",0,pp,"Scalar",0,uu,"Schema",0,cS,"YAMLError",0,cT,"YAMLMap",0,uF,"YAMLParseError",0,cO,"YAMLSeq",0,uB,"YAMLWarning",0,cE,"isAlias",0,lB,"isCollection",0,lW,"isDocument",0,lK,"isMap",0,lZ,"isNode",0,lG,"isPair",0,lJ,"isScalar",0,lH,"isSeq",0,lV,"parse",0,pm,"parseAllDocuments",0,function(e,t={}){let{lineCounter:r,prettyErrors:n}=ph(t),s=new pp(r?.addNewLine),i=new cG(t),a=Array.from(i.compose(s.parse(e)));if(n&&r)for(let t of a)t.errors.forEach(cM(e,r)),t.warnings.forEach(cM(e,r));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())},"parseDocument",0,pf,"stringify",0,function(e,t,r){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t),"string"==typeof r&&(r=r.length),"number"==typeof r){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=r??t??{};if(!e)return}return lK(e)&&!n?e.toString(r):new c_(e,n,r).toString(r)},"visit",0,l1,"visitAsync",0,l5],32861),e.i(32861);let py=/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S+)(?:\s+HTTP\/[\d.]+)?\s*$/,pg=e=>e.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")||"Imported";function pb(e,t,r=""){let n=t.replace(/\s+$/,"");if(!n)return e;let s=/json/i.test(r)||/^\s*[{[]/.test(n);return{...e,bodyMode:s?"json":"text",bodyText:n}}function pv(e,t,r,n){let s=pI(t,e,r,n);return{...s.draft,headers:s.headers}}function pw(e,t){let r=pg(t),n=new Set,s=e=>n.add(e),i=[],a=[],o=e.replace(/\r\n?/g,"\n").split(/^###(.*)$/m),l=[{title:"",text:o[0]}];for(let e=1;e<o.length;e+=2)l.push({title:o[e].trim(),text:o[e+1]??""});for(let[e,{title:t,text:n}]of l.entries()){let o=n.split("\n"),l=t,u=0;for(;u<o.length;u++){let e=o[u].trim();if(!e)continue;let t=/^(?:#|\/\/)\s*@name\s+(.+)$/.exec(e);if(t){l=t[1].trim();continue}let r=/^@([\w.-]+)\s*=\s*(.*)$/.exec(e);if(r){i.push({key:r[1],value:r[2].trim(),secret:!1});continue}if(/^(#|\/\/)/.test(e)){l||(l=e.replace(/^(#|\/\/)\s*/,"").slice(0,120));continue}break}if(u>=o.length)continue;let c=o[u].trim(),p=py.exec(c)??(/^(https?:\/\/|\{\{)/.test(c)?["","GET",c.split(/\s+/)[0]]:null);if(!p){s(`Request ${e+1}: "${c.slice(0,60)}" isn't a request line — skipped`);continue}let d=p[1],h=p[2];for(u++;u<o.length&&/^\s+[?&]/.test(o[u]);)h+=o[u++].trim();let f=[];for(;u<o.length;u++){let e=o[u];if(!e.trim()){u++;break}if(/^\s*(#|\/\/)/.test(e))continue;let t=/^([^:\s][^:]*):\s*(.*)$/.exec(e.trim());t&&f.push({key:t[1].trim(),value:t[2].trim()})}let m=o.slice(u),y=m.findIndex(e=>/^\s*>\s/.test(e)||/^\s*<>\s/.test(e));y>=0&&s(`${l||`${d} ${h}`}: response handler scripts (> {% … %}) aren't imported — add checks on the Checks tab`);let g=(y>=0?m.slice(0,y):m).filter(e=>!/^\s*(#|\/\/)/.test(e));g.some(e=>/^\s*<\s+\S/.test(e))&&s(`${l||`${d} ${h}`}: a body read from a file (< path) — choose the file again in the Body tab`);let b=l||`${d} ${h}`,v=lc({...le(),method:d},h),w=f.find(e=>/^content-type$/i.test(e.key))?.value??"";if(v=pb(v,g.filter(e=>!/^\s*<\s+\S/.test(e)).join("\n"),w),a.push({collection:o2(r),name:(l||`${d} ${h.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120),request:pv(v,f,s,b)}),a.length>=2e3)break}if(!a.length)throw Error("No requests found — each request starts with a line like GET https://api.example.com/items");let u=i.length?[{name:r,variables:function(e){let t=new Map;for(let r of e)t.set(r.key,r);return[...t.values()]}(i)}]:[];return{kind:"http",title:r,requests:a,environments:u,warnings:[...n]}}let pk=e=>e.trim().replace(/^\$\.?/,"").replace(/\['([^']+)'\]/g,".$1").replace(/^\./,"")||"",px=e=>{let t=e.trim();if(/^".*"$/.test(t))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return t};function p$(e,t){let r=pg(t),n=new Set,s=e=>n.add(e),i=[],a=e.replace(/\r\n?/g,"\n").split("\n"),o=[],l=null,u="headers",c=null,p=!1,d="";for(let e of a){let t=e.replace(/\s+$/,"");if(p){/^```/.test(t.trim())?p=!1:l?.body.push(e);continue}if(/^\s*#/.test(t)){d=t.replace(/^\s*#\s*/,"").trim();continue}let r=py.exec(t.trim());if(r&&!t.startsWith(" ")){l={method:r[1],url:r[2],headers:[],sections:new Map,body:[],status:null,response:new Map,comment:d},d="",o.push(l),u="headers",c=null;continue}if(!l)continue;let n=/^HTTP(?:\/[\d.]+)?\s+(\d{3}|\*)/.exec(t.trim());if(n){l.status="*"===n[1]?null:n[1],u="response",c=null;continue}let s=/^\[(\w+)\]$/.exec(t.trim());if(s){c=s[1],("response"===u?l.response:l.sections).set(c,[]);continue}if(!t.trim()){"headers"===u&&!c&&l.headers.length&&(u="body");continue}if(c){("response"===u?l.response:l.sections).get(c).push(t.trim());continue}if("headers"===u){let e=/^([\w-]+):\s*(.*)$/.exec(t.trim());if(e){l.headers.push({key:e[1],value:e[2]});continue}u="body"}if("body"===u){if(/^```/.test(t.trim())){p=!0;continue}l.body.push(e)}}let h=(e=[])=>e.map(e=>/^([^:]+):\s*(.*)$/.exec(e)).filter(e=>!!e).map(e=>({key:e[1].trim(),value:px(e[2])}));for(let e of o){let t=e.comment||`${e.method} ${e.url}`,n=lc({...le(),method:e.method},e.url),a=h(e.sections.get("QueryStringParams")??e.sections.get("Query"));a.length&&(n={...n,params:[...n.params,...a]});let o=h(e.sections.get("BasicAuth"))[0];o&&(n={...n,authMode:"basic",username:o.key,password:o.value});let l=h(e.sections.get("FormParams")??e.sections.get("Form")),u=h(e.sections.get("MultipartFormData")??e.sections.get("Multipart"));if(l.length)n={...n,bodyMode:"form",formRows:l.map(e=>({...e,kind:"text",file:null}))};else if(u.length){let e=u.map(e=>/^file,/.test(e.value)?{key:e.key,value:"",kind:"file",file:null}:{...e,kind:"text",file:null});e.some(e=>"file"===e.kind)&&s(`${t}: choose the files for the form again in the Body tab`),n={...n,bodyMode:"multipart",formRows:e}}else{let r=e.body.join("\n").trim();/^file,/.test(r)?s(`${t}: a body read from a file — choose it again (Body → File)`):n=pb(n,r.replace(/^`([\s\S]*)`$/,"$1"),e.headers.find(e=>/^content-type$/i.test(e.key))?.value??"")}let c=[];e.status&&c.push({type:"status",expect:e.status});let p=0;for(let t of e.response.get("Asserts")??[]){let e=function(e){let t=/^(jsonpath|header|status|body|duration)(?:\s+("(?:[^"\\]|\\.)*"))?\s+(not\s+)?(==|!=|>=|<=|>|<|contains|startsWith|endsWith|matches|exists|isString|isNumber|isInteger|isFloat|isBoolean|isCollection|isList|isObject|count)\s*(.*)$/.exec(e.trim());if(!t)return null;let[,r,n="",s,i,a=""]=t,o=px(a);if("status"===r&&"=="===i&&!s)return{type:"status",expect:o};if("duration"===r&&("<"===i||"<="===i))return{type:"time",maxMs:Number(o)||1e3};if("body"===r&&"contains"===i)return{type:"body",op:s?"not_contains":"contains",value:o};if("body"===r&&"matches"===i)return{type:"body",op:"matches",value:o.replace(/^\/|\/$/g,"")};if("header"===r){let e=px(n);return"exists"===i?{type:"header",name:e,op:s?"not_exists":"exists",value:""}:"=="!==i||s?"contains"!==i||s?"matches"!==i||s?null:{type:"header",name:e,op:"matches",value:o.replace(/^\/|\/$/g,"")}:{type:"header",name:e,op:"contains",value:o}:{type:"header",name:e,op:"equals",value:o}}if("jsonpath"===r){let e=pk(px(n));if(!e)return null;if("exists"===i)return{type:"json",path:e,op:s?"not_exists":"exists",value:""};if("=="===i)return{type:"json",path:e,op:s?"not_equals":"equals",value:o};if("!="===i)return{type:"json",path:e,op:"not_equals",value:o};if("contains"===i&&!s)return{type:"json",path:e,op:"contains",value:o};if((">"===i||">="===i)&&!s)return{type:"json",path:e,op:"greater",value:">="===i?String(Number(o)-1e-9):o};if(("<"===i||"<="===i)&&!s)return{type:"json",path:e,op:"less",value:"<="===i?String(Number(o)+1e-9):o};if("matches"===i&&!s)return{type:"json",path:e,op:"matches",value:o.replace(/^\/|\/$/g,"")};if("count"===i&&!s)return{type:"json",path:e,op:"length",value:a.replace(/^==\s*/,"").trim()};let t={isString:"string",isNumber:"number",isInteger:"number",isFloat:"number",isBoolean:"boolean",isCollection:"array",isList:"array",isObject:"object"};if(t[i]&&!s)return{type:"json",path:e,op:"type",value:t[i]}}return null}(t);e?c.push(e):p++}p&&s(`${t}: ${p} assert${1===p?"":"s"} the app has no check for were left out`);let d=[];for(let r of e.response.get("Captures")??[]){let e=/^([A-Za-z_][\w]*)\s*:\s*(jsonpath|header)\s+("(?:[^"\\]|\\.)*")/.exec(r);e?d.push({name:e[1],from:"header"===e[2]?"header":"json",path:"header"===e[2]?px(e[3]):pk(px(e[3]))}):s(`${t}: a capture the app can't take ("${r.slice(0,50)}") was left out`)}n={...n,checks:c,saveValues:d};let f=(e.comment||`${e.method} ${e.url.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120);if(i.push({collection:o2(r),name:f,request:pv(n,e.headers,s,t)}),i.length>=2e3)break}if(!i.length)throw Error("No requests found in this Hurl file");return{kind:"hurl",title:r,requests:i,environments:[],warnings:[...n]}}function pS(e=""){return e.split("\n").map(e=>/^(~?)([^:]+):\s?(.*)$/.exec(e.trim())).filter(e=>!!e).map(e=>({key:e[2].trim(),value:e[3],enabled:!e[1]}))}function p_(e,t){let r=e.name,n=e.method.toUpperCase(),s=lc({...le(),method:o5.includes(n)?n:"GET"},e.url),i=e.params.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),a=new Set(s.params.map(e=>e.key)),o=i.filter(e=>!a.has(e.key));o.length&&(s={...s,params:[...s.params,...o]});let l=e.body;switch(e.bodyMode){case"json":s=pb(s,l.json??"","json");break;case"text":"json"!==(s=pb({...s},l.text??"","text/plain")).bodyMode||/^\s*[{[]/.test(l.text??"")||(s={...s,bodyMode:"text"});break;case"xml":l.xml&&(s={...s,bodyMode:"text",bodyText:l.xml});break;case"graphql":s={...s,bodyMode:"graphql",graphqlQuery:l.graphql?.query??"",graphqlVariables:l.graphql?.variables??""};break;case"formUrlEncoded":s={...s,bodyMode:"form",formRows:l.form.map(e=>({...e,kind:"text",file:null}))};break;case"multipartForm":l.multipart.some(e=>e.file)&&t(`${r}: choose the files for the form again in the Body tab`),s={...s,bodyMode:"multipart",formRows:l.multipart.map(e=>e.file?{key:e.key,value:"",kind:"file",file:null}:{key:e.key,value:e.value,kind:"text",file:null})}}let u=e.auth;"bearer"===u.mode?s={...s,authMode:"bearer",token:u.token??""}:"basic"===u.mode?s={...s,authMode:"basic",username:u.username??"",password:u.password??""}:"apikey"===u.mode?s={...s,authMode:"api_key",apiName:u.key||"X-API-Key",apiValue:u.value??"",apiIn:"queryparams"===u.placement?"query":"header"}:"none"===u.mode?s={...s,authMode:"none"}:u.mode&&"inherit"!==u.mode&&t(`${r}: ${u.mode} auth isn't imported from Bruno — set it on the Auth tab`);let c=[],p=0;for(let t of e.assertions.filter(e=>e.enabled)){let e=function(e,t){let r=/^(eq|neq|gt|gte|lt|lte|contains|notContains|isDefined|isUndefined|isNull|isString|isNumber|isBoolean|isArray|isJson|matches|length)\s*(.*)$/.exec(t.trim());if(!r)return null;let[,n,s=""]=r,i=px(s);if("res.status"===e&&"eq"===n)return{type:"status",expect:i};if("res.responseTime"===e&&("lt"===n||"lte"===n))return{type:"time",maxMs:Number(i)||1e3};let a=/^res\.headers?\[["']?([^"'\]]+)["']?\]$|^res\.headers?\.([\w-]+)$/.exec(e);if(a){let e=a[1]??a[2];return"isDefined"===n?{type:"header",name:e,op:"exists",value:""}:"eq"===n?{type:"header",name:e,op:"equals",value:i}:"contains"===n?{type:"header",name:e,op:"contains",value:i}:null}if("res.body"===e&&"contains"===n)return{type:"body",op:"contains",value:i};if("res.body"===e&&"isJson"===n)return{type:"body",op:"is_json",value:""};let o=/^res\.body\.?(.*)$/.exec(e)?.[1];if(!o)return null;switch(n){case"eq":return{type:"json",path:o,op:"equals",value:i};case"neq":return{type:"json",path:o,op:"not_equals",value:i};case"gt":case"gte":return{type:"json",path:o,op:"greater",value:"gte"===n?String(Number(i)-1e-9):i};case"lt":case"lte":return{type:"json",path:o,op:"less",value:"lte"===n?String(Number(i)+1e-9):i};case"contains":return{type:"json",path:o,op:"contains",value:i};case"isDefined":return{type:"json",path:o,op:"exists",value:""};case"isUndefined":return{type:"json",path:o,op:"not_exists",value:""};case"isString":case"isNumber":case"isBoolean":case"isArray":return{type:"json",path:o,op:"type",value:n.slice(2).toLowerCase()};case"matches":return{type:"json",path:o,op:"matches",value:i.replace(/^\/|\/$/g,"")};case"length":return{type:"json",path:o,op:"length",value:i};default:return null}}(t.name,t.value);e?c.push(e):p++}return p&&t(`${r}: ${p} assertion${1===p?"":"s"} the app has no check for were left out`),(e.scripts||e.tests)&&t(`${r}: Bruno scripts and tests (bru.*, res.*) aren't imported — the app's scripts use Postman's pm.* — re-create them as checks or pm.test`),pv(s={...s,checks:c,description:e.docs.trim().slice(0,5e4)},e.headers.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),t,r)}let pA=e=>"string"==typeof e?e:null==e?"":String(e),pT=e=>Array.isArray(e)?e:[];function pO(e,t=""){let r=function(e,t){let r=t.toLowerCase(),n=e.replace(/^/,"");if(r.endsWith(".hurl"))return p$(n,t);if(r.endsWith(".bru")||/^meta\s*\{\s*$/m.test(n))return function(e,t){let r=function(e){let t=new Map,r=e.replace(/\r\n?/g,"\n").split("\n");for(let e=0;e<r.length;e++){let n=/^([\w:-]+)\s*\{\s*$/.exec(r[e]);if(!n)continue;let s=[];for(e++;e<r.length&&"}"!==r[e];e++)s.push(r[e].replace(/^ {2}/,""));t.set(n[1],s.join("\n"))}return t}(e),n=Object.fromEntries(pS(r.get("meta")).map(e=>[e.key,e.value])),s=[...r.keys()].find(e=>{let t;return t=e.toUpperCase(),o5.includes(t)});if(!s){if(r.has("vars")||/^vars:secret\s*\[/m.test(e)){let n=pg(t),s=pS(r.get("vars")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,secret:!1})),i=/^vars:secret\s*\[([\s\S]*?)\]/m.exec(e)?.[1]?.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)??[];for(let e of i)s.push({key:e,value:"",secret:!0});return{kind:"bruno",title:"Bruno",requests:[],environments:[{name:n,variables:s}],warnings:i.length?[`${n}: fill in the secret values (${i.join(", ")}) under Environments — Bruno keeps them out of its files`]:[]}}if(r.has("meta")||r.has("headers")||[...r.keys()].some(e=>e.startsWith("auth")))return{kind:"bruno",title:"Bruno",requests:[],environments:[],warnings:[`${pg(t)}.bru: folder-wide headers and auth aren't imported — set them in the folder's settings (⋯ → Folder settings)`]};throw Error("No request found in this .bru file (it has no get { … }, post { … } block)")}let i=Object.fromEntries(pS(r.get(s)).map(e=>[e.key,e.value])),a=new Set,o=Object.fromEntries(pS(r.get(`auth:${i.auth??""}`)).map(e=>[e.key,e.value])),l={name:n.name||pg(t),method:s,url:i.url??"",headers:pS(r.get("headers")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),params:pS(r.get("params:query")??r.get("query")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),bodyMode:{json:"json",text:"text",xml:"xml",graphql:"graphql","form-urlencoded":"formUrlEncoded","multipart-form":"multipartForm"}[i.body??""]??"none",body:{json:r.get("body:json"),text:r.get("body:text"),xml:r.get("body:xml"),graphql:{query:r.get("body:graphql"),variables:r.get("body:graphql:vars")},form:pS(r.get("body:form-urlencoded")).filter(e=>e.enabled),multipart:pS(r.get("body:multipart-form")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,file:/^@file\(/.test(e.value)}))},auth:{mode:i.auth??"inherit",token:o.token,username:o.username,password:o.password,key:o.key,value:o.value,placement:o.placement},assertions:pS(r.get("assert")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),scripts:r.has("script:pre-request")||r.has("script:post-response"),tests:r.has("tests"),docs:r.get("docs")??""},u=p_(l,e=>a.add(e)),c="Bruno";return{kind:"bruno",title:c,requests:[{collection:o2(c),name:l.name.slice(0,120),request:u}],environments:[],warnings:[...a]}}(n,t);if(r.endsWith(".http")||r.endsWith(".rest"))return pw(n,t);let s=n.split(/\r?\n/).find(e=>e.trim()&&!/^\s*(#|\/\/)/.test(e))?.trim()??"";return/^[{[]/.test(s)?null:py.test(s)||/^@[\w.-]+\s*=/.test(s)||/^###/m.test(n)?/^HTTP(\/[\d.]+)?\s+(\d{3}|\*)\s*$/m.test(n)||/^\[(Asserts|Captures|QueryStringParams|FormParams|BasicAuth)\]\s*$/m.test(n)?p$(n,t):pw(n,t):null}(e,t);if(r)return r;let n=function(e,t){let r=e.replace(/^/,"").trim();if(!r)return null;if(r.startsWith("{")||r.startsWith("["))try{return JSON.parse(r)}catch(e){if(/\.json$/i.test(t))throw Error(`Not valid JSON: ${e instanceof Error?e.message:"parse error"}`)}try{return pm(r,{maxAliasCount:200})}catch(e){throw Error(`Not valid JSON or YAML: ${e instanceof Error?e.message.split("\n")[0]:"parse error"}`)}}(e,t);if(!n||"object"!=typeof n)throw Error("This file is empty or not JSON/YAML");let s=n.info;if("string"==typeof s?.schema&&/collection\/v2/.test(s.schema)||Array.isArray(n.item)&&s)return function(e){let t=pM((e.info??{}).name,"Imported collection").trim()||"Imported collection",r=[],n=new Set,s=e=>n.add(e),i=new Set,a=[],o=e=>o2([t,...e].map(e=>e.replace(/[\\/]/g," ")).join("/")),l=0,u=0,c=0,p=(e,t,r,n,i)=>{let u=o0(),c=pR(i,"prerequest").slice(0,1e5),p=pR(i,"test").slice(0,1e5);if((c||p)&&(u={...u,preScript:c,postScript:p},l++),t?.type&&"inherit"!==t.type){let e=pz({...le(),authMode:"inherit"},t,s,n);u={...u,auth:{authMode:e.authMode,oauth:e.oauth,oauth1:e.oauth1,aws:e.aws,jwt:e.jwt,domain:e.domain,token:e.token,username:e.username,password:e.password,apiName:e.apiName,apiValue:e.apiValue,apiIn:e.apiIn}}}let d=pj(r).map(e=>e).filter(e=>pM(e.key).trim()&&!e.disabled).map(e=>({key:pM(e.key).trim(),value:pM(e.value),secret:"secret"===e.type}));d.length&&(u={...u,variables:pF(d)});let h=pU(e.length?i.description:i.info?.description);h&&(u={...u,description:h}),o1(u)||a.push({path:o(e),settings:u})},d=(e,t)=>{for(let n of e){if(Array.isArray(n.item)){let e=[...t,pM(n.name,"Folder")];e.length>=6&&s(`${e.join(" › ")}: folders deeper than 6 levels were put in the folder above`),p(e,n.auth,n.variable,e.join(" › "),n),d(n.item,e);continue}if(r.length>=2e3)return void s("Only the first 2000 requests were imported");let e=pM(n.name,"Request"),a=[...t,e].join(" › "),h="string"==typeof n.request?{url:n.request}:n.request??{},f=pN(h.method);if(!f){s(`${a}: ${pM(h.method)} requests are not supported; skipped`);continue}let m=function(e){if("string"==typeof e)return e;let t=e??{};if("string"==typeof t.raw)return t.raw;let r=pM(t.protocol),n=Array.isArray(t.host)?t.host.map(e=>pM(e)).join("."):pM(t.host),s=Array.isArray(t.path)?t.path.map(e=>pM(e)).join("/"):pM(t.path),i=pj(t.query).filter(e=>!e.disabled).map(e=>`${pM(e.key)}=${pM(e.value)}`).join("&");return`${r?`${r}://`:""}${n}${s?`/${s}`:""}${i?`?${i}`:""}`}(h.url);for(let e of JSON.stringify(h).matchAll(/\{\{\s*(\$[A-Za-z]+)/g))pL.has(e[1].toLowerCase())||i.add(e[1]);let y=lc({...le(),method:f},m);!y.baseUrl&&m&&(y={...y,url:m}),y=pz({...y,authMode:"inherit"},h.auth,s,a);let g=pj(h.header).filter(e=>!e.disabled).map(e=>{let t=pU(e.description);return{key:pM(e.key),value:pM(e.value),...t?{description:t}:{}}}),b=new Map(pj(h.url?.query).flatMap(e=>{let t=pU(e.description);return t?[[pM(e.key),t]]:[]}));b.size&&(y={...y,params:y.params.map(e=>b.has(e.key)?{...e,description:b.get(e.key)}:e)});let v=pI(g,y,s,a);v=function(e,t,r,n,s){if(!t||t.disabled)return{draft:e,headers:r};let i=r.some(e=>/^content-type$/i.test(e.key));switch(t.mode){case"raw":{let n=pM(t.raw),s="json"===pM(t.options?.raw?.language)||r.some(e=>/^content-type$/i.test(e.key)&&/json/i.test(e.value))||/^\s*[{[]/.test(n);return{draft:{...e,bodyMode:s?"json":"text",bodyText:n},headers:r}}case"urlencoded":{let n=pj(t.urlencoded).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pM(e.key))}=${encodeURIComponent(pM(e.value))}`).join("&");return{draft:{...e,bodyMode:"text",bodyText:n},headers:i?r:[...r,{key:"Content-Type",value:"application/x-www-form-urlencoded"}]}}case"graphql":{let n=t.graphql??{},s="string"==typeof n.variables?n.variables:n.variables?JSON.stringify(n.variables,null,2):"";return{draft:{...e,bodyMode:"graphql",graphqlQuery:pM(n.query),graphqlVariables:s},headers:r.filter(e=>!/^content-type$/i.test(e.key))}}case"formdata":return{draft:pP(e,pj(t.formdata).filter(e=>!e.disabled).map(e=>"file"===e.type?pC(pM(e.key)):{key:pM(e.key),value:pM(e.value),kind:"text",file:null}),n,s),headers:r.filter(e=>!(/^content-type$/i.test(e.key)&&/multipart/i.test(e.value)))};case"file":return n(`${s}: the body is a file — choose it again in the Body tab (the file itself isn't in the export)`),{draft:{...e,bodyMode:"file",bodyFile:null},headers:r};default:return{draft:e,headers:r}}}(v.draft,h.body,v.headers,s,a);let w=pR(n,"prerequest").slice(0,1e5),k=pR(n,"test").slice(0,1e5);(w||k)&&l++;let x=function(e){let t=pj(e.response).map(e=>e).filter(e=>Number.isInteger(Number(e.code))),r=t.find(e=>Number(e.code)>=200&&300>Number(e.code))??t[0];if(!r)return{mock:null,count:0};let n=pj(r.header).flatMap(e=>{let{key:t,value:r,disabled:n}=e??{};return"string"==typeof t&&t.trim()&&!n?[[t,pM(r)]]:[]});return{mock:oR({status:Number(r.code),headers:n,body:pM(r.body),delayMs:0}),count:t.length}}(n);x.mock&&u++,x.count>1&&c++,r.push({collection:o(t),name:e,request:{...v.draft,headers:v.headers,preScript:w,postScript:k,mock:x.mock,description:pU(h.description??n.description)}})}};return p([],e.auth,e.variable,t,e),d(pj(e.item),[]),l&&s(`Pre-request or test scripts came along on ${l} request${1===l?"":"s"} or folder${1===l?"":"s"} — they run as in Postman (Scripts tab, and Folder settings → Scripts)`),u&&s(`Saved examples came along on ${u} request${1===u?"":"s"} as the Example tab (what the mock server answers)${c?`; ${c} had more than one, and only the first successful one was kept`:""}`),i.size&&s(`Postman dynamic values the app doesn't make: ${[...i].slice(0,8).map(e=>`{{${e}}}`).join(", ")} — they are sent as written`),{kind:"postman",title:t,requests:r,folders:a,environments:[],warnings:[...n]}}(n);if(Array.isArray(n.values)&&("environment"===n._postman_variable_scope||"string"==typeof n.name)){var i;let e;return{kind:"postman-environment",title:e=pM((i=n).name,"Imported environment").trim()||"Imported environment",requests:[],environments:[{name:e,variables:pF(pj(i.values).map(e=>e).filter(e=>pM(e.key).trim()&&!1!==e.enabled).map(e=>({key:pM(e.key).trim(),value:pM(e.value),secret:"secret"===e.type})))}],warnings:[]}}if(n.log&&"object"==typeof n.log&&Array.isArray(n.log.entries))return function(e,t){let r=e.log,n=t.replace(/\.har$/i,"").replace(/[_-]+/g," ").trim()||"Browser recording",s=[],i=new Set,a=e=>i.add(e),o=new Set,l=0,u=0;for(let e of pj(r.entries)){var c;let t=e.request??{},r=pM(t.url);if(!/^https?:\/\//i.test(r))continue;let i=pN(t.method);if(!i||"OPTIONS"===i)continue;let p=pM(e._resourceType),d=pM(e.response?.content?.mimeType);if(p&&!["xhr","fetch","document",""].includes(p)||pZ.test(r)||pJ.test(d)){l++;continue}let h=`${i} ${r}`;if(o.has(h))continue;if(o.add(h),s.length>=2e3){a("Only the first 2000 requests were imported");break}let f=new URL(r),m=`${i} ${f.pathname}`,y=lc({...le(),method:i},r),g=pj(t.headers).map(e=>({key:pM(e.name),value:pM(e.value)})).filter(e=>e.key&&!pH.test(e.key));g.some(e=>/^cookie$/i.test(e.key))&&u++;let b=pI(g.filter(e=>!/^cookie$/i.test(e.key)),y,a,m);y=b.draft;let v=t.postData;if(v&&("POST"===(c=i)||"PUT"===c||"PATCH"===c||"DELETE"===c)){let e=pM(v.mimeType),t=pM(v.text);if(/json/i.test(e))y={...y,bodyMode:"json",bodyText:t};else if(/multipart\/form-data/i.test(e)){let e=pj(v.params).map(e=>void 0!==e.fileName?pC(pM(e.name)):{key:pM(e.name),value:pM(e.value),kind:"text",file:null});e.length?y=pP(y,e,a,m):a(`${m}: the recording doesn't have the form's fields; the body was left out`)}else t&&(y={...y,bodyMode:"text",bodyText:t});!e||b.headers.some(e=>/^content-type$/i.test(e.key))||/multipart/i.test(e)||(b={...b,headers:[...b.headers,{key:"Content-Type",value:e.split(";")[0]}]})}s.push({collection:o2(`${n}/${f.host.replace(/:/g," ")}`),name:m.slice(0,120),request:{...y,headers:b.headers}})}if(!s.length)throw Error("No API calls found in this recording — record with DevTools open while you use the app, then Save all as HAR");return l&&a(`${l} page files (images, scripts, styles, fonts) were left out — only API calls are imported`),u&&a(`Cookies were left out of ${u} request${1===u?"":"s"} — send the login request first; the cookie jar keeps its session`),{kind:"har",title:n,requests:s,environments:[],warnings:[...i]}}(n,t);if("export"===n._type&&Array.isArray(n.resources)||"string"==typeof n.type&&n.type.startsWith("collection.insomnia.rest/"))return function(e){let t=new Set,r=e=>t.add(e),n=e=>pV(e,r,"Some values"),s="Insomnia collection",i=[],a=[];if("export"===e._type){let t=pj(e.resources).map(e=>e),r=t.find(e=>"workspace"===e._type);s=pM(r?.name,s)||s;let n=new Map;for(let e of t)"request_group"===e._type&&n.set(pM(e._id),{kind:"folder",name:pM(e.name,"Folder"),raw:e,children:[]}),"request"===e._type&&n.set(pM(e._id),{kind:"request",name:pM(e.name,"Request"),raw:e,children:[]});for(let e of t){let t=n.get(pM(e._id));if(!t)continue;let r=n.get(pM(e.parentId));r?r.children.push(t):i.push(t)}let o=t.find(e=>"environment"===e._type&&e.parentId===r?._id),l=t.filter(e=>"environment"===e._type&&o&&e.parentId===o._id),u=pW(o?.data);if(l.length)for(let e of l)a.push({name:pM(e.name,"Environment"),variables:pF([...u,...pW(e.data)])});else u.length&&a.push({name:`${s} (base)`,variables:u})}else{s=pM(e.name,s)||s;let t=e=>e.map(e=>Array.isArray(e.children)?{kind:"folder",name:pM(e.name,"Folder"),raw:e,children:t(e.children)}:{kind:"request",name:pM(e.name,"Request"),raw:e,children:[]});i=t(pj(e.collection));let r=e.environments;if(r){let e=pW(r.data),t=pj(r.subEnvironments).map(e=>e);if(t.length)for(let r of t)a.push({name:pM(r.name,"Environment"),variables:pF([...e,...pW(r.data)])});else e.length&&a.push({name:`${s} (base)`,variables:e})}}let o=[],l=[],u=o2(s),c=(e,t)=>{for(let s of e){if("folder"===s.kind){let e=[...t,s.name],i=o0();i={...i,auth:pG(i.auth,s.raw.authentication,r,e.join(" › "),n)};let a=pW(s.raw.environment);a.length&&(i={...i,variables:a}),pM(s.raw.description).trim()&&(i={...i,description:pM(s.raw.description).trim().slice(0,5e4)}),o1(i)||l.push({path:o2(`${u}/${e.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),settings:i}),c(s.children,e);continue}if(o.length>=2e3)return void r("Only the first 2000 requests were imported");let e=s.raw,i=[...t,s.name].join(" › "),a=pN(e.method);if(!a){r(`${i}: ${pM(e.method)} requests are not supported; skipped`);continue}let p=lc({...le(),method:a},pV(pM(e.url),r,i)),d=pj(e.parameters).filter(e=>!e.disabled).map(e=>({key:pM(e.name),value:n(pM(e.value))})).filter(e=>e.key);d.length&&(p={...p,params:[...p.params,...d]}),p=pG(p,e.authentication,r,i,n);let h=pI(pj(e.headers).filter(e=>!e.disabled).map(e=>({key:pM(e.name),value:n(pM(e.value))})),p,r,i);p=h.draft;let f=e.body??{},m=pM(f.mimeType);if("application/graphql"===m)try{let e=JSON.parse(pM(f.text,"{}"));p={...p,bodyMode:"graphql",graphqlQuery:n(pM(e.query)),graphqlVariables:e.variables?JSON.stringify(e.variables,null,2):""}}catch{r(`${i}: the GraphQL body could not be read`)}else if(/json/i.test(m))p={...p,bodyMode:"json",bodyText:n(pM(f.text))};else if("application/x-www-form-urlencoded"===m){let e=pj(f.params).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pM(e.name))}=${encodeURIComponent(n(pM(e.value)))}`).join("&");p={...p,bodyMode:"text",bodyText:e}}else"multipart/form-data"===m?p=pP(p,pj(f.params).filter(e=>!e.disabled).map(e=>"file"===e.type?pC(pM(e.name)):{key:pM(e.name),value:n(pM(e.value)),kind:"text",file:null}),r,i):pM(f.text)&&(p={...p,bodyMode:"text",bodyText:n(pM(f.text))});let y=!m||/graphql|multipart/.test(m)||h.headers.some(e=>/^content-type$/i.test(e.key))?h.headers:[...h.headers,{key:"Content-Type",value:m}];o.push({collection:o2(`${u}/${t.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),name:s.name.slice(0,120),request:{...p,headers:"graphql"===p.bodyMode?h.headers:y,description:pM(e.description).trim().slice(0,5e4)}})}};if(c(i,[]),!o.length)throw Error("No requests found in this Insomnia file");return{kind:"insomnia",title:s,requests:o,folders:l,environments:a,warnings:[...t]}}(n);if("string"==typeof n.openapi&&n.openapi.startsWith("3"))return pK(n,"openapi");if("2.0"===n.swagger)return pK(n,"swagger");if(Array.isArray(n.items)&&"string"==typeof n.name&&(void 0!==n.brunoConfig||"1"===n.version)&&pT(n.items).every(e=>"http"===e.type||"graphql"===e.type||"folder"===e.type||"http-request"===e.type||"graphql-request"===e.type))return function(e){let t=pA(e.name).trim()||"Bruno collection",r=new Set,n=e=>r.add(e),s=[],i=(e,r)=>{for(let a of e){if(s.length>=2e3)return;if("folder"===a.type){i(pT(a.items),[...r,pA(a.name).replace(/[\\/]/g," ")]);continue}let e=a.request??{},o=e.body??{},l=e.auth??{},u=pA(l.mode),c=l[u]??{},p=e.script??{},d={name:pA(a.name)||"Request",method:pA(e.method)||"GET",url:pA(e.url),headers:pT(e.headers).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),params:pT(e.params).filter(e=>"query"===pA(e.type||"query")).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),bodyMode:pA(o.mode)||"none",body:{json:pA(o.json),text:pA(o.text),xml:pA(o.xml),graphql:{query:pA(o.graphql?.query),variables:pA(o.graphql?.variables)},form:pT(o.formUrlEncoded).filter(e=>!1!==e.enabled).map(e=>({key:pA(e.name),value:pA(e.value)})),multipart:pT(o.multipartForm).filter(e=>!1!==e.enabled).map(e=>({key:pA(e.name),value:Array.isArray(e.value)?"":pA(e.value),file:"file"===e.type}))},auth:{mode:u,token:pA(c.token),username:pA(c.username),password:pA(c.password),key:pA(c.key),value:pA(c.value),placement:pA(c.placement)},assertions:pT(e.assertions).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),scripts:!!(pA(p.req).trim()||pA(p.res).trim()),tests:!!pA(e.tests).trim(),docs:pA(e.docs)};s.push({collection:o2([t,...r].join("/")),name:d.name.slice(0,120),request:p_(d,n)})}};if(i(pT(e.items),[]),!s.length)throw Error("This Bruno collection has no requests");let a=pT(e.environments).map(e=>({name:pA(e.name)||"Bruno",variables:pT(e.variables).filter(e=>!1!==e.enabled&&pA(e.name)).map(e=>({key:pA(e.name),value:e.secret?"":pA(e.value),secret:!!e.secret}))}));return pT(e.environments).some(e=>pT(e.variables).some(e=>e.secret))&&n("Secret environment values aren't in Bruno's export — fill them in under Environments"),{kind:"bruno",title:t,requests:s,environments:a,warnings:[...r]}}(n);if(n.format===lb&&Array.isArray(n.requests))return function(e){let t="string"==typeof e.name&&e.name.trim()||"Imported collection",r=[],n=new Map;for(let t of e.requests)"string"==typeof t?.ref&&"string"==typeof t.name&&n.set(t.ref,t.name);let s=[];for(let[i,a]of e.requests.entries()){if(!a||"string"!=typeof a.name||!a.request||"object"!=typeof a.request){r.push(`Request ${i+1} isn't a request — skipped`);continue}let e=la({...le(),...a.request,before:null}),o=a.runFirst&&n.has(a.runFirst.ref)?{ref:a.runFirst.ref,requestName:n.get(a.runFirst.ref),extract:Array.isArray(a.runFirst.extract)?a.runFirst.extract:[]}:void 0;a.runFirst&&!o&&r.push(`${a.name}: runs first "${a.runFirst.ref}", which isn't in the file`);let l="string"==typeof a.folder&&a.folder.trim()?`/${a.folder.trim()}`:"";s.push({collection:o2(`${t}${l}`),name:a.name.slice(0,120),request:e,...a.ref?{ref:a.ref}:{},...o?{runFirst:o}:{}})}let i=(e.variables??[]).filter(e=>"string"==typeof e?.key&&e.key.trim()).map(e=>({key:e.key,value:String(e.value??""),secret:!!e.secret}));return{kind:"apitestcenter",title:t,requests:s,environments:i.length?[{name:t,variables:i}]:[],warnings:r}}(n);if("string"==typeof n.openapi)throw Error(`OpenAPI ${n.openapi} is not supported yet — use 3.x or Swagger 2.0`);throw Error("Not a Postman collection or environment, an Insomnia export, a HAR recording, an OpenAPI/Swagger file, a Bruno collection, or an .http / Hurl file")}function pE(e){if(1===e.length)return pO(e[0].text,e[0].name);let t=[],r=[],n="";for(let s of e){if(/(^|[\\/])bruno\.json$/i.test(s.name)){try{let e=JSON.parse(s.text).name;"string"==typeof e&&e.trim()&&(n=e.trim().slice(0,60))}catch{}continue}try{t.push(pO(s.text,s.name))}catch(e){r.push(`${s.name}: ${e instanceof Error?e.message:"could not be read"}`)}}if(!t.length)throw Error(r.join("; ")||"No files");let s=new Set(t.map(e=>e.kind)),i=1===s.size&&s.has("bruno")?n||"Bruno":t[0].title;return{kind:1===s.size?t[0].kind:"several",title:i,requests:t.flatMap(e=>e.requests).slice(0,2e3),folders:t.flatMap(e=>e.folders??[]),environments:t.flatMap(e=>e.environments),warnings:[...r,...t.flatMap(e=>e.warnings)]}}let pM=(e,t="")=>"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):t,pj=e=>Array.isArray(e)?e:[],pN=e=>{let t=pM(e,"GET").toUpperCase();return o5.includes(t)?t:null};function pI(e,t,r,n){let s=[],i=t;for(let t of e){let e=t.key.trim();if(/^authorization$/i.test(e)){let e=/^bearer\s+(.+)$/i.exec(t.value.trim()),s=/^basic\s+(.+)$/i.exec(t.value.trim()),a="none"===i.authMode||"inherit"===i.authMode;if(e&&a)i={...i,authMode:"bearer",token:e[1]};else if(s&&a)try{let[e,...t]=atob(s[1]).split(":");i={...i,authMode:"basic",username:e??"",password:t.join(":")}}catch{r(`${n}: an Authorization header could not be read; set Auth by hand`)}else a&&r(`${n}: an Authorization header was dropped; set Auth by hand`);continue}if(/^cookie$/i.test(e)){r(`${n}: a Cookie header was left out — send the login request first; the cookie jar keeps its session`);continue}e&&s.push({key:e,value:t.value,...t.description?{description:t.description}:{}})}return{draft:i,headers:s}}function pq(e,t,r){let n=e[t],s=e=>"boolean"==typeof e||"number"==typeof e?String(e):pM(e);return Array.isArray(n)?s(n.find(e=>e.key===r)?.value):n&&"object"==typeof n?s(n[r]):""}function pz(e,t,r,n){if(!t||!t.type||"inherit"===t.type)return e;if("noauth"===t.type)return{...e,authMode:"none"};if("bearer"===t.type)return{...e,authMode:"bearer",token:pq(t,"bearer","token")};if("basic"===t.type)return{...e,authMode:"basic",username:pq(t,"basic","username"),password:pq(t,"basic","password")};if("apikey"===t.type)return{...e,authMode:"api_key",apiName:pq(t,"apikey","key")||"X-API-Key",apiValue:pq(t,"apikey","value"),apiIn:"query"===pq(t,"apikey","in")?"query":"header"};if("digest"===t.type)return{...e,authMode:"digest",username:pq(t,t.type,"username"),password:pq(t,t.type,"password")};if("ntlm"===t.type)return{...e,authMode:"ntlm",username:pq(t,t.type,"username"),password:pq(t,t.type,"password"),domain:pq(t,t.type,"domain")};if("awsv4"===t.type)return{...e,authMode:"aws_sigv4",aws:{accessKeyId:pq(t,t.type,"accessKey"),secretAccessKey:pq(t,t.type,"secretKey"),sessionToken:pq(t,t.type,"sessionToken"),region:pq(t,t.type,"region")||"us-east-1",service:pq(t,t.type,"service")||"execute-api"}};if("oauth1"===t.type){let r=pq(t,t.type,"signatureMethod").toUpperCase();return{...e,authMode:"oauth1",oauth1:{consumerKey:pq(t,t.type,"consumerKey"),consumerSecret:pq(t,t.type,"consumerSecret"),token:pq(t,t.type,"token"),tokenSecret:pq(t,t.type,"tokenSecret"),signatureMethod:"HMAC-SHA1"===r||"PLAINTEXT"===r?r:"HMAC-SHA256",realm:pq(t,t.type,"realm"),addTo:"false"===pq(t,t.type,"addParamsToHeader")?"query":"header"}}}if("jwt"===t.type){let r=pq(t,t.type,"algorithm").toUpperCase(),n=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"].includes(r)?r:"HS256";return{...e,authMode:"jwt",jwt:{...e.jwt,algorithm:n,secret:pq(t,t.type,"secret"),privateKey:pq(t,t.type,"privateKey"),payload:pq(t,t.type,"payload")||e.jwt.payload,prefix:pq(t,t.type,"headerPrefix")||"Bearer"}}}return r("oauth2"===t.type?`${n}: OAuth 2.0 settings were not imported — set the token URL and client under Auth → OAuth 2.0`:`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}function pC(e){return{key:e,value:"",kind:"file",file:null}}function pP(e,t,r,n){let s=t.filter(e=>"file"===e.kind).length;return s&&r(`${n}: choose the file${1===s?"":"s"} for the form again in the Body tab (files aren't in the export)`),{...e,bodyMode:"multipart",formRows:t}}function pR(e,t){return pj(e.event).map(e=>e).filter(e=>e.listen===t&&!e.disabled).map(e=>{let t=(e.script??{}).exec;return Array.isArray(t)?t.map(e=>pM(e)).join("\n"):pM(t)}).filter(e=>e.trim()).join("\n")}let pL=new Set(["$guid","$uuid","$randomuuid","$timestamp","$isotimestamp","$randomint","$randomemail","$randomfirstname","$randomlastname","$randomfullname","$randomboolean","$randomalphanumeric"]);function pU(e){return("string"==typeof e?e:e&&"object"==typeof e?pM(e.content):"").trim().slice(0,5e4)}function pF(e){let t=new Map;for(let r of e)/^[A-Za-z_][\w.-]*$/.test(r.key)&&t.set(r.key,r);return[...t.values()]}function pD(e,t,r=0){let n=t;for(let t=0;n&&"string"==typeof n.$ref&&t<20;t++){let t=n.$ref;if(!t.startsWith("#/"))return{};n=t.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")).reduce((e,t)=>e&&"object"==typeof e?e[t]:void 0,e)}return r>40?{}:n??{}}function pB(e,t,r=0,n=new Set){let s=pD(e,t);if(r>6||n.has(s))return null;if("example"in s)return s.example;if(Array.isArray(s.examples)&&s.examples.length)return s.examples[0];if("default"in s)return s.default;if(Array.isArray(s.enum)&&s.enum.length)return s.enum[0];let i=new Set(n).add(s),a=pj(s.allOf);if(a.length)return Object.assign({},...a.map(t=>pB(e,t,r+1,i)).filter(e=>e&&"object"==typeof e));let o=pj(s.oneOf).concat(pj(s.anyOf));if(o.length)return pB(e,o[0],r+1,i);let l=Array.isArray(s.type)?s.type.find(e=>"null"!==e):s.type;if("object"===l||s.properties){let t={};for(let[n,a]of Object.entries(s.properties??{}))t[n]=pB(e,a,r+1,i);return t}if("array"===l)return[pB(e,s.items,r+1,i)];if("integer"===l||"number"===l)return 0;if("boolean"===l)return!1;if("string"===l){let e=pM(s.format);return"date-time"===e?"2026-01-01T00:00:00Z":"date"===e?"2026-01-01":"email"===e?"user@example.com":"uuid"===e?"00000000-0000-0000-0000-000000000000":"string"}return null}function pK(e,t){let r=e.info??{},n=pM(r.title,"Imported API").trim()||"Imported API",s=new Set,i=e=>s.add(e),a=[],o=0,l=new Map,u=(e,t="",r=!1)=>{/^[A-Za-z_][\w.-]*$/.test(e)&&!l.has(e)&&l.set(e,{key:e,value:t,secret:r})},c=function(e,t){if("swagger"===t){let t=pM(e.host);if(!t)return null;let r=pj(e.schemes).includes("https")||!pj(e.schemes).length?"https":pM(pj(e.schemes)[0]);return`${r}://${t}${pM(e.basePath).replace(/\/$/,"")}`}let r=pj(e.servers)[0];if(!r)return null;let n=pM(r.url);for(let[e,t]of Object.entries(r.variables??{}))n=n.replace(`{${e}}`,pM(t.default));return n.replace(/\/$/,"")}(e,t);c&&/^https?:\/\//i.test(c)?u("baseUrl",c):(u("baseUrl","https://api.example.com"),i(c?`The server URL “${c}” is relative — set baseUrl in the “${n}” environment`:`No server URL in the file — set baseUrl in the “${n}” environment`));let p="swagger"===t?e.securityDefinitions:(e.components??{}).securitySchemes,d=(t,r)=>{let n=pj(t)[0],s=n?Object.keys(n)[0]:void 0,a=s?pD(e,p?.[s]):void 0;if(!a)return r;let o=pM(a.type),l=pM(a.scheme).toLowerCase();return"http"===o&&"bearer"===l||"oauth2"===o||"openIdConnect"===o?(u("token","",!0),"http"!==o&&i(`${o} sign-in is set up as a Bearer token — paste a token into {{token}}, or use Run first to fetch one`),{...r,authMode:"bearer",token:"{{token}}"}):"http"===o&&"basic"===l||"basic"===o?(u("username"),u("password","",!0),{...r,authMode:"basic",username:"{{username}}",password:"{{password}}"}):"apiKey"===o?"cookie"===a.in?(i("Cookie API keys are not supported; set Auth by hand"),r):(u("apiKey","",!0),{...r,authMode:"api_key",apiName:pM(a.name,"X-API-Key"),apiValue:"{{apiKey}}",apiIn:"query"===a.in?"query":"header"}):r};for(let[r,s]of Object.entries(e.paths??{})){let l=pD(e,s),c=pj(l.parameters);for(let[s,p]of Object.entries(l)){let l,h,f=pN(s);if(!f||"parameters"===s||"object"!=typeof p)continue;if(a.length>=2e3){i("Only the first 2000 operations were imported");break}let m=pM(pj(p.tags)[0]),y=pM(p.summary).trim()||pM(p.operationId).trim()||`${f} ${r}`,g=m?`${m} › ${y}`:y,b=[...c,...pj(p.parameters)].map(t=>pD(e,t)),v=r.replace(/\{([^}]+)\}/g,(t,r)=>{let n=r.replace(/[^\w.-]/g,"_"),s=b.find(e=>"path"===e.in&&e.name===r);return u(n,pM(s?.example??pD(e,s?.schema).example??"")),`{{${n}}}`}),w=b.filter(e=>"query"===e.in&&(e.required||"example"in e)).map(t=>({key:pM(t.name),value:pM(t.example??pB(e,t.schema)??""),...pM(t.description).trim()?{description:pM(t.description).trim()}:{}})),k=lc({...le(),method:f},`{{baseUrl}}${v}`);k={...k,url:`{{baseUrl}}${v}${w.length?`?${w.map(e=>`${e.key}=${e.value}`).join("&")}`:""}`,params:w};let x=pI(b.filter(e=>"header"===e.in).map(e=>({key:pM(e.name),value:pM(e.example??""),...pM(e.description).trim()?{description:pM(e.description).trim()}:{}})),k=d(p.security??e.security,k),i,g);k={...x.draft,headers:x.headers};let $=!0,S=!1;if("openapi"===t&&p.requestBody){let t=pD(e,p.requestBody).content??{},r=Object.keys(t).find(e=>/json/i.test(e))??Object.keys(t)[0];if(r){let n=t[r];if($=/json/i.test(r),l=n.schema,h=n.example??Object.values(n.examples??{})[0]?.value,!/json/i.test(r)){if(/x-www-form-urlencoded/i.test(r)&&!k.headers.some(e=>/^content-type$/i.test(e.key)))k={...k,headers:[...k.headers,{key:"Content-Type",value:r}]};else if(/multipart/i.test(r)){let t=Object.entries(pD(e,n.schema)?.properties??{}).map(([t,r])=>{let n=pD(e,r);return"binary"===n.format||"base64"===n.format||"array"===n.type&&pD(e,n.items)?.format==="binary"?pC(t):{key:t,value:void 0!==n.example?pM(n.example,JSON.stringify(n.example)):"",kind:"text",file:null}});k={...k,bodyMode:"multipart",formRows:t},S=!0}}}}else if("swagger"===t){let e=b.find(e=>"body"===e.in);e&&(l=e.schema)}if(!S&&(l||void 0!==h)&&"GET"!==f&&"HEAD"!==f){let t=h??pB(e,l);k=$?{...k,bodyMode:"json",bodyText:JSON.stringify(t??{},null,2)}:{...k,bodyMode:"text",bodyText:"object"==typeof t&&t?new URLSearchParams(Object.entries(t).map(([e,t])=>[e,pM(t)])).toString():pM(t)}}let _=Object.keys(p.responses??{}).find(e=>/^2\d\d$/.test(e)),A=[{type:"status",expect:_??"2xx"}],T=null;if(_){let r=pD(e,(p.responses??{})[_]),n=r.content??{},s=Object.keys(n).find(e=>/json/i.test(e)),i="swagger"===t?r.schema:s?n[s].schema:void 0,a=function(e,t,r){if(!t||"object"!=typeof t)return null;let n=new Map,s=(t,r)=>{if(!(r>60)&&t&&"object"==typeof t){if(Array.isArray(t))return t.forEach(e=>s(e,r+1));if("string"==typeof t.$ref&&t.$ref.startsWith("#/")&&!n.has(t.$ref)){let i=pD(e,{$ref:t.$ref});n.set(t.$ref,i),s(i,r+1)}for(let[e,n]of Object.entries(t))"$ref"!==e&&"example"!==e&&"examples"!==e&&s(n,r+1)}};s(t,0);let i=pD(e,t);if(!["type","properties","items","allOf","anyOf","oneOf","enum","required"].some(e=>e in i)||n.size>200)return null;let a={title:r,...t};for(let[e,t]of n){let r=e.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")),n=a;for(let e of r.slice(0,-1))n=n[e]??={};n[r[r.length-1]]=t}let o=JSON.stringify(a);return o.length<=2e5?o:null}(e,i,`${y} (${_})`);a&&(A.push({type:"schema",schema:a}),o++);let l=s?n[s]:void 0,u="swagger"===t?(r.examples??{})["application/json"]:l?.example??Object.values(l?.examples??{})[0]?.value,c=void 0!==u?u:i?pB(e,i):void 0;void 0!==c?T={status:Number(_),headers:[["Content-Type","application/json"]],body:JSON.stringify(c,null,2),delayMs:0}:"204"!==_&&Object.keys(n).length||(T={status:Number(_),headers:[],body:"",delayMs:0})}let O=[pM(p.summary).trim()&&pM(p.summary).trim()!==y?pM(p.summary).trim():"",pM(p.description).trim()].filter(Boolean).join("\n\n");a.push({collection:n,name:g,request:{...k,checks:A,mock:T,description:O.slice(0,5e4)}})}}a.length||i("The file has no operations under “paths”"),o&&i(`${o} request${1===o?" checks its answer":"s check their answers"} against the response schema in the file (Checks tab) — remove a check where the API differs from its documentation`);let h=pM(r.description).trim(),f=h?[{path:o2(n),settings:{...o0(),description:h.slice(0,5e4)}}]:[];return{kind:t,title:n,requests:a,folders:f,environments:[{name:n,variables:[...l.values()]}],warnings:[...s]}}let pZ=/\.(png|jpe?g|gif|svg|webp|avif|ico|bmp|css|js|mjs|map|woff2?|ttf|otf|eot|mp4|webm|mp3|wav|pdf)(\?|$)/i,pJ=/^(image|font|audio|video)\/|^text\/(css|javascript)|javascript/i,pH=/^(:|host$|content-length$|connection$|accept-encoding$|accept-language$|user-agent$|origin$|referer$|priority$|upgrade-insecure-requests$|cache-control$|pragma$|dnt$|sec-|te$)/i;function pV(e,t,r){return/\{%/.test(e)&&t(`${r}: Insomnia template tags ({% … %}) were kept as text — replace them with {{variables}} or Run first`),e.replace(/\{\{\s*_\.([\w.-]+)\s*\}\}/g,"{{$1}}")}function pW(e,t=""){if(!e||"object"!=typeof e||Array.isArray(e))return[];let r=[];for(let[n,s]of Object.entries(e)){let e=t?`${t}.${n}`:n;s&&"object"==typeof s&&!Array.isArray(s)?r.push(...pW(s,e)):/^[A-Za-z_][\w.-]*$/.test(e)&&r.push({key:e,value:"string"==typeof s?s:JSON.stringify(s),secret:!1})}return r}function pG(e,t,r,n,s){if(!t||!t.type||"none"===t.type||t.disabled)return t?.type==="none"?{...e,authMode:"none"}:e;let i=e=>s(pM(t[e]));switch(t.type){case"bearer":return{...e,authMode:"bearer",token:i("token")};case"basic":return{...e,authMode:"basic",username:i("username"),password:i("password")};case"digest":return{...e,authMode:"digest",username:i("username"),password:i("password")};case"ntlm":return{...e,authMode:"ntlm",username:i("username"),password:i("password")};case"apikey":return{...e,authMode:"api_key",apiName:i("key")||"X-API-Key",apiValue:i("value"),apiIn:"queryParams"===pM(t.addTo)?"query":"header"};case"iam":return{...e,authMode:"aws_sigv4",aws:{accessKeyId:i("accessKeyId"),secretAccessKey:i("secretAccessKey"),sessionToken:i("sessionToken"),region:i("region")||"us-east-1",service:i("service")||"execute-api"}};case"oauth1":{let s=pM(t.signatureMethod).toUpperCase();return s.startsWith("RSA")&&r(`${n}: OAuth 1.0 with ${s} isn't supported; set the signature method by hand`),{...e,authMode:"oauth1",oauth1:{consumerKey:i("consumerKey"),consumerSecret:i("consumerSecret"),token:i("tokenKey"),tokenSecret:i("tokenSecret"),signatureMethod:"HMAC-SHA1"===s||"PLAINTEXT"===s?s:"HMAC-SHA256",realm:i("realm"),addTo:"header"}}}case"oauth2":{let s=pM(t.grantType);return"implicit"===s&&r(`${n}: the OAuth 2.0 implicit grant is outdated and not supported — it was set to client credentials`),{...e,authMode:"oauth2",oauth:{...oZ(),grant:"password"===s||"authorization_code"===s?s:"client_credentials",tokenUrl:i("accessTokenUrl"),authUrl:i("authorizationUrl"),clientId:i("clientId"),clientSecret:i("clientSecret"),scope:i("scope"),username:i("username"),password:i("password"),redirectUri:i("redirectUrl")||oZ().redirectUri,pkce:!1!==t.usePkce}}}default:return r(`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}}let pX=[1,2,3,5,7.5,10,15,20,30,50,75,100,150,200,300,500,750,1e3,1500,2e3,3e3,5e3,1e4,1/0];function pY(e){let t=pX[e]??1/0,r=0===e?0:pX[e-1],n=e=>e>=1e3?`${e/1e3}s`:`${e}ms`;return 1/0===t?`> ${n(r)}`:`${n(r)}–${n(t)}`}function pQ(e){let t=Array(pX.length).fill(0),r=!1;for(let n of e)if(n){r=!0;for(let e=0;e<t.length;e++)t[e]+=n[e]??0}return r?t:null}function p0(e,t){let r=0,n=0,s=0;for(let i=0;i<e.length;i++){let a=e[i]??0;r+=a;let o=pX[i]??1/0;o<=t?n+=a:o<=4*t&&(s+=a)}return r?(n+s/2)/r:null}function p1(e){let t=Number(e);switch(t){case 0:return"no answer at all — a timeout, a refused connection, or a network problem";case 400:return"bad request — the API did not accept what was sent";case 401:return"not signed in — the token or password is missing or expired";case 403:return"forbidden — refused on purpose, often by a firewall that blocks heavy traffic";case 404:return"not found — the address is wrong";case 408:return"the server gave up waiting for the request";case 409:return"conflict — the request clashed with the current state of the data";case 413:return"the request body is too large";case 422:return"the API understood the request but rejected its content";case 429:return"too many requests — the server or its firewall is limiting how fast you can call it";case 500:return"server error — the API itself crashed or hit a bug";case 502:return"bad gateway — a proxy in front of the API could not reach it";case 503:return"unavailable — the API is overloaded or down";case 504:return"gateway timeout — a proxy in front of the API waited too long"}return t>=500?"server error":t>=400?"the request was refused":"unexpected response"}e.s(["M",0,pX,"G",0,p0,"B",0,pY,"p",0,pQ],47253);let p2=new Set(["429","403"]);function p5(e){let t=e.summary,r=t.http.failed.rate,n=Object.entries(t.http.status).filter(([e])=>"0"===e||Number(e)>=400),s=n.reduce((e,[,t])=>e+t,0),i=[...n].sort((e,t)=>t[1]-e[1])[0],a=i&&s?{code:i[0],count:i[1],share:i[1]/s,meaning:p1(i[0])}:null,o=n.filter(([e])=>p2.has(e)).reduce((e,[,t])=>e+t,0),l=e.buckets.filter(e=>e.rps>0||e.vus>0),u=function(e){for(let t=0;t<e.length;t++){let r=e.slice(t,t+3).filter(e=>e.rps>0);if(r.length&&r.every(e=>e.failedRate>=.5))return t}return -1}(l),c=u>=0?l[u]:null,p=c?{elapsedS:c.elapsedS,vus:Math.round(c.vus),rps:Math.round(c.rps)}:null,d=null;if(c){let e=Math.max(...l.slice(u).map(e=>e.vus)),t=l.findIndex((t,r)=>r>=u&&t.vus===e),r=l.slice(t+1).filter(e=>e.rps>0&&e.vus<=Math.max(1,.6*c.vus));if(r.length>=3){let e=r.slice(Math.floor(r.length/3));d=e.reduce((e,t)=>e+t.failedRate,0)/e.length<.1}}let h=c?l.slice(0,u).filter(e=>e.rps>0&&e.failedRate<.5):[],f=h.length?{vus:Math.round(Math.max(...h.map(e=>e.vus))),rps:Math.round(Math.max(...h.map(e=>e.rps)))}:null,m=null;if(t.latencyOkMs&&t.latencyOkMs.p95>0)m=t.latencyOkMs.p95;else{let e=pQ((c?h:l.filter(e=>e.failedRate<.5)).map(e=>e.hist));m=e?function(e){let t=e.reduce((e,t)=>e+t,0);if(!t)return null;let r=0;for(let n=0;n<e.length;n++)if((r+=e[n])/t>=.95){let e=pX[n];return Number.isFinite(e)?e:pX[pX.length-2]}return null}(e):null}return{failedRate:r,dominant:a,blocked:s>0&&o/s>=.5,timingsUnreliable:r>=.5,onset:p,recovered:d,lastHealthy:f,healthyP95Ms:m}}e.s(["R",0,p2,"F",0,p5,"Q",0,function(e){let t=function(e){let t=e.buckets.filter(e=>e.rps>0);if(t.length<2)return null;let r=t.map(e=>e.rps).sort((e,t)=>e-t),n=e=>Math.round(100*e)/100,s=e.summary.http.rps.avg||r.reduce((e,t)=>e+t,0)/e.buckets.length,i=e.buckets.filter(e=>e.vus>0);return{rps:{min:n(r[0]),max:n(r[r.length-1]),avg:n(s),p95:n(r[Math.min(r.length-1,Math.max(0,Math.ceil(.95*r.length)-1))])},vusAvg:i.length?n(i.reduce((e,t)=>e+t.vus,0)/i.length):e.summary.vus.avg}}(e);if(!t)return e;let{rps:r}=e.summary.http,n=r.min===r.max,s=e.summary.vus.avg<t.vusAvg/2;return n||s?{...e,summary:{...e.summary,http:{...e.summary.http,rps:n?t.rps:r},vus:{...e.summary.vus,avg:s?t.vusAvg:e.summary.vus.avg}}}:e},"j",0,p1],48191);let p9={errorWarn:.01,errorFail:.05,p95WarnMs:500,p95FailMs:2e3,stabilityWarn:1.5,stabilityFail:2.5};function p6(e){return e&&e.p95Ms>0&&e.errorRate>=0?{errorWarn:.5*e.errorRate,errorFail:e.errorRate,p95WarnMs:.8*e.p95Ms,p95FailMs:e.p95Ms,owned:!0}:{...p9,owned:!1}}function p4(e,t,r){let{buckets:n}=e;if(0===n.length)return 0;let s=Math.floor(n.length*t),i=Math.max(s+1,Math.ceil(n.length*r)),a=n.slice(s,i).map(e=>e.p95Ms).filter(e=>e>0);return 0===a.length?0:a.reduce((e,t)=>e+t,0)/a.length}function p3(e){let t,r=e.summary.http.status;return{failedRate:e.summary.http.failed.rate,p95:e.summary.latencyMs.p95,requests:e.summary.http.requests,bucketCount:e.buckets.length,earlyP95:p4(e,0,.33),lateP95:p4(e,.66,1),status5xx:Object.entries(r).filter(([e])=>Number(e)>=500).reduce((e,[,t])=>e+t,0),status0:r["0"]??0,checksPassed:e.summary.checks.reduce((e,t)=>e+t.passes,0),checksFailed:e.summary.checks.reduce((e,t)=>e+t.fails,0),dropped:e.summary.droppedIterations??0,topFailure:(t=Object.entries(r).filter(([e])=>"0"===e||Number(e)>=400).sort((e,t)=>t[1]-e[1])[0])?{code:t[0],count:t[1]}:null,blockedCount:Object.entries(r).filter(([e])=>p2.has(e)).reduce((e,[,t])=>e+t,0),status503:r["503"]??0,okP95:e.summary.latencyOkMs?.p95||null}}function p8(e,t={}){return p7(p3(e),t)}function p7(e,t={}){var r;let{failedRate:n,p95:s,requests:i,status5xx:a,status0:o}=e,l=p6(t.slo),u=l.owned?`your target: fail ≥ ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%`:"default: fail ≥ 5%",c=l.owned?`your target: warn ≥ ${(100*l.errorWarn).toFixed(l.errorWarn<.01?2:1)}%`:"default: warn ≥ 1%",p=Math.round(n*i),d=n>=l.errorFail&&(e.blockedCount??0)>=.5*p&&p>0,h=i>0&&n>=.5,f=e.topFailure,m=f&&p?` Mostly ${"0"===f.code?"no answer":f.code}: ${p1(f.code)}.`:"",y=l.owned?`your target: fail ≥ ${Math.round(l.p95FailMs)} ms`:"default: fail ≥ 2 s",g=l.owned?`your target: warn ≥ ${Math.round(l.p95WarnMs)} ms`:"default: warn ≥ 500 ms",b=0===i?{id:"errors",title:"Errors",level:"fail",summary:"No HTTP requests completed. The target may be unreachable, hanging, or blocked."}:n>=l.errorFail?{id:"errors",title:"Errors",level:"fail",summary:`${(100*n).toFixed(1)}% of requests failed (${u}).${m||" Clients would see this as broken."}`}:n>=l.errorWarn?{id:"errors",title:"Errors",level:"warn",summary:`${(100*n).toFixed(1)}% failed (${c}).${m||" Fine for a spike test; noisy for a smoke test."}`}:{id:"errors",title:"Errors",level:"pass",summary:`${(100*n).toFixed(2)}% failed. Under this load the API mostly answered.`},v=(()=>{if(h){let t=e.okP95;return{id:"latency",title:"Latency",level:null!=t&&t>=l.p95FailMs?"fail":"warn",summary:`Not meaningful here: ${(100*n).toFixed(0)}% of responses were errors, and errors come back fast.${null!=t?` Successful requests alone: p95 ${Math.round(t)} ms.`:""}`}}return s<=0&&0===i?{id:"latency",title:"Latency",level:"fail",summary:"No latency samples. Nothing to judge."}:s>=l.p95FailMs?{id:"latency",title:"Latency",level:"fail",summary:`p95 is ${Math.round(s)} ms (${y}). Most users would feel this as stuck.`}:s>=l.p95WarnMs?{id:"latency",title:"Latency",level:"warn",summary:`p95 is ${Math.round(s)} ms (${g}). OK for a heavy report API; slow for a ping/health check.`}:{id:"latency",title:"Latency",level:"pass",summary:`p95 is ${Math.round(s)} ms. 95% of calls were faster than that under this load.`}})(),w=e.earlyP95,k=e.lateP95,x=w>0?k/w:1,$=k-w>=Math.max(20,.1*l.p95WarnMs),S=h?{id:"stability",title:"Stability",level:"warn",summary:"Not judged: most responses were errors, so changes in response time describe the errors, not the API."}:e.bucketCount<6?{id:"stability",title:"Stability",level:"warn",summary:"Run was too short to judge whether latency stayed flat. Use Average (minutes) for a stability read."}:$&&x>=p9.stabilityFail?{id:"stability",title:"Stability",level:"fail",summary:`p95 grew ~${x.toFixed(1)}\xd7 from the first third to the last third. The API (or the generator) degraded as the test went on.`}:$&&x>=p9.stabilityWarn?{id:"stability",title:"Stability",level:"warn",summary:`p95 rose ~${x.toFixed(1)}\xd7 later in the run. Watch for warm-up, lock contention, or GC.`}:{id:"stability",title:"Stability",level:"pass",summary:"Latency did not blow up over time in this run. That is a healthy pattern."},_=e.dropped??0,A=d?{id:"capacity",title:"Capacity",level:"fail",summary:`Refused on purpose (${f&&p2.has(f.code)?f.code:"429/403"}): a rate limit or firewall stopped the load. This shows the limit you hit, not how much the API can take.`}:(e.status503??0)>=.5*p&&n>=l.errorFail?{id:"capacity",title:"Capacity",level:"fail",summary:"Mostly 503 (unavailable): the API, or something in front of it, was overloaded at this load."}:_>0&&_>=Math.max(1,(i+_)*.05)?{id:"capacity",title:"Capacity",level:"fail",summary:`${_.toLocaleString("en-US")} requests were never sent: this computer ran out of virtual users to hold the rate. Raise Max virtual users, or the API is too slow for this rate.`}:o>.1*i&&i>0?{id:"capacity",title:"Capacity",level:"fail",summary:"Many requests never got an HTTP status (network/timeout). Either the API or this machine’s generator is saturated."}:a>0&&a/Math.max(i,1)>=.02?{id:"capacity",title:"Capacity",level:"fail",summary:"Server 5xx responses appeared. The API is shedding load or crashing under these VUs."}:_>0?{id:"capacity",title:"Capacity",level:"warn",summary:`${_.toLocaleString("en-US")} requests were dropped because no virtual user was free. The rate you asked for was not fully held.`}:s>=l.p95WarnMs&&n<l.errorWarn?{id:"capacity",title:"Capacity",level:"warn",summary:"It still answers, but slowly. You are near a capacity cliff: raise VUs carefully or add think time."}:{id:"capacity",title:"Capacity",level:"pass",summary:"No clear saturation signal (timeouts / 5xx) at this VU level."},T=e.checksPassed??0,O=e.checksFailed??0,E=T+O,M=t.slo?.checksRate??.99,j=0===E?null:T/E<M?{id:"checks",title:"Checks",level:"fail",summary:`${(T/E*100).toFixed(1)}% of checks passed (needs ${(100*M).toFixed(+(M<1))}%). Responses arrived, but not all of them were correct.`}:O>0?{id:"checks",title:"Checks",level:"warn",summary:`${O.toLocaleString("en-US")} of ${E.toLocaleString("en-US")} checks failed — within your bar, but look at which ones.`}:{id:"checks",title:"Checks",level:"pass",summary:`All ${E.toLocaleString("en-US")} checks passed. Responses were correct, not just fast.`},N=[b,v,S,A,...j?[j]:[]],I=(r=N.map(e=>e.level)).includes("fail")?"fail":r.includes("warn")?"warn":"pass",q=d?"Blocked by a rate limit or firewall at this load — the results show that limit, not the API’s speed.":l.owned?"pass"===I?"Meets your performance targets under this load.":"warn"===I?"Close to your performance targets. Read the checks before you trust it in UAT.":"Misses your performance targets at this load.":"pass"===I?"Looks healthy under this load (built-in defaults — set your own under Goals).":"warn"===I?"Usable, with caveats. Read the lines below before you trust it in UAT.":"This run does not look production-ready at this load.";return{overall:I,headline:q,aspects:N,disclaimer:l.owned?`Your targets: errors < ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%, p95 < ${Math.round(l.p95FailMs)} ms. Stability and capacity use built-in rules.`:"Heuristics only (errors < 1%, p95 < 500 ms as a starting bar). Set your own thresholds when you know the API’s contract."}}function de(e,t){try{let r=new URL(t);return`${e.toUpperCase()} ${r.origin}${r.pathname.replace(/\/+$/,"")||"/"}`}catch{return`${e.toUpperCase()} ${t}`}}function dt(e,t){let r=(e,t)=>t>0?e/t-1:null;return{p95:r(e.p95,t.p95),rps:r(e.rps,t.rps),errorRate:t.errorRate>0?e.errorRate/t.errorRate-1:e.errorRate>0?null:0}}e.s(["s",0,p8,"F",0,p7,"X",0,function(e){let t=e.definition.load.stages;return t.length>0?t.reduce((e,t)=>e+a4(t.duration),0):3e4},"P",0,function(e,t){let r=p8(e,{slo:t}),n=e=>"pass"===e?"[PASS]":"warn"===e?"[WARN]":"[FAIL]",s=e.summary.http.rps.avg,i=s>=100?String(Math.round(s)):s>=10?s.toFixed(1):s.toFixed(2),a=["APITestCenter | load test result",`${n(r.overall)} ${r.overall.toUpperCase()}`,r.headline,"","Request",`${e.definition.method} ${e.definition.url}`,"","Results",`p95 ${Math.round(e.summary.latencyMs.p95)} ms`,`Errors ${(100*e.summary.http.failed.rate).toFixed(2)}%`,`Requests ${e.summary.http.requests.toLocaleString("en-US")}`,`Peak VUs ${e.summary.vus.max}`,`Avg rps ${i}`,"","Checks",...r.aspects.map(e=>`${n(e.level)} ${e.title} — ${e.summary}`),"","Please attach the HTML report (charts) and the Excel workbook (numbers).","Tokens are not included.","",r.disclaimer];return{subject:`API test ${r.overall.toUpperCase()}: ${e.testName}`,body:a.join("\n")}},"v",0,p6,"b",0,p3],2385),e.s(["L",0,dt,"U",0,de],94122);let dr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),dn=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:2)} s`:`${e>=100?Math.round(e):e>=10?e.toFixed(1):e.toFixed(2)} ms`,ds=e=>`${(100*e).toFixed(e>0&&e<.001?3:2)}%`,di={pass:{word:"PASS",mark:"✓",ink:"#137333",bg:"#e6f4ea",line:"#a8dab5"},warn:{word:"WARNING",mark:"!",ink:"#975300",bg:"#fef3e0",line:"#f5cf8b"},fail:{word:"FAIL",mark:"✕",ink:"#c62828",bg:"#fdecea",line:"#f3b0aa"}},da={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function dl(e){let t=Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3));return t>=60?`${Math.floor(t/60)} min ${t%60} s`:`${t} s`}function du(e,t){return null!=e&&Number.isFinite(e)?.005>Math.abs(e)?{text:"no change",ink:"#5c6778"}:{text:`${e>0?"▲":"▼"} ${Math.abs(100*e).toFixed(0)}%`,ink:(t?e>0:e<0)?"#c62828":"#137333"}:null}function dc(e){let t=new TextEncoder().encode(e),r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r).replace(/.{76}/g,"$&\r\n")}e.s(["H",0,function(e,t={}){let r,n=p8(e,{slo:t.slo??null}),s=di[n.overall],i=e.summary,a=t.appUrl??"https://apitestcenter.com",o=t.baseline?dt({p95:i.latencyMs.p95,rps:i.http.rps.avg,errorRate:i.http.failed.rate},t.baseline):null;i.checks.reduce((e,t)=>e+t.passes,0),i.checks.reduce((e,t)=>e+t.fails,0);let l=e.definition.load.executor.endsWith("arrival-rate"),u=new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}),c=[{label:"Response time",tech:"95% of requests (p95)",value:dn(i.latencyMs.p95),change:du(o?.p95??null,!0)},{label:"Requests per second",tech:"throughput",value:(r=i.http.rps.avg)>=100?String(Math.round(r)):r>=10?r.toFixed(1):r.toFixed(2),change:du(o?.rps??null,!1)},{label:"Failed requests",tech:"error rate",value:ds(i.http.failed.rate),change:du(o?.errorRate??null,!0)},{label:"Typical response",tech:"median (p50)",value:dn(i.latencyMs.median)},{label:"Slowest 1%",tech:"p99",value:dn(i.latencyMs.p99)},{label:l?"Users needed":"Simulated users",tech:"peak VUs",value:String(i.vus.max)}],p=[["Fastest",i.latencyMs.min],["Typical (p50)",i.latencyMs.median],["Most (p90)",i.latencyMs.p90],["95% (p95)",i.latencyMs.p95],["Slowest 1% (p99)",i.latencyMs.p99],["Slowest",i.latencyMs.max]],d=Math.max(...p.map(([,e])=>e),1),h="font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif",f=(e,t="")=>`<td style="${h};font-size:14px;color:#12151c;${t}">${e}</td>`,m=e=>`<tr><td style="${h};padding:22px 24px 8px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5c6778">${dr(e)}</td></tr>`,y=c.map(e=>`<td width="33%" valign="top" style="${h};padding:6px">
745
745
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9;border-radius:8px"><tr><td style="${h};padding:12px 14px">
746
746
  <div style="font-size:13px;color:#5c6778">${dr(e.label)}</div>
747
747
  <div style="font-size:11px;color:#8b97a8">${dr(e.tech)}</div>