@redocly/cli 2.72.0 → 2.72.1

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 (140) hide show
  1. package/lib/chunks/{K6HV4EJS.js → 2AW4F6ZZ.js} +1 -1
  2. package/lib/chunks/{XKENZH7W.js → 2MF3MKAD.js} +1 -1
  3. package/lib/chunks/{6234PJEZ.js → 3FA5W77S.js} +1 -1
  4. package/lib/chunks/{ZSQF6YOF.js → 3FVHXIZN.js} +1 -1
  5. package/lib/chunks/{SPIFPTTE.js → 3N53VPSU.js} +1 -1
  6. package/lib/chunks/{FJBULQ4P.js → 3N73A66H.js} +1 -1
  7. package/lib/chunks/{IKSSZYHA.js → 3WOXO2JS.js} +1 -1
  8. package/lib/chunks/{E6QTRG6I.js → 4A5R4H5W.js} +1 -1
  9. package/lib/chunks/{RL2EIWFM.js → 4LTPQZBP.js} +1 -1
  10. package/lib/chunks/{76AJ5P4Y.js → 4QC7OVHI.js} +1 -1
  11. package/lib/chunks/{NDECHUWV.js → 542GVIYM.js} +1 -1
  12. package/lib/chunks/{EHMG7I34.js → 5JF6EUWW.js} +1 -1
  13. package/lib/chunks/{QGKTPGO7.js → 5MZU5MHZ.js} +1 -1
  14. package/lib/chunks/{HXOTKK2E.js → 5UPBGRBZ.js} +1 -1
  15. package/lib/chunks/{Q5WCA45H.js → 6LZX65VY.js} +1 -1
  16. package/lib/chunks/{FLL7MTDS.js → 6Y6B2SKE.js} +1 -1
  17. package/lib/chunks/{SUQ7ZWYJ.js → 765BYRQR.js} +1 -1
  18. package/lib/chunks/{A7XJ7Y3N.js → 7NZS5HXU.js} +1 -1
  19. package/lib/chunks/{D3C6XIMY.js → A65OW7M7.js} +2 -2
  20. package/lib/chunks/{EVCSNWMN.js → ARUYNQHA.js} +1 -1
  21. package/lib/chunks/{UFDBFVRI.js → BWGBTYNU.js} +1 -1
  22. package/lib/chunks/{QQ2PGWE6.js → BZTZIEWS.js} +2 -2
  23. package/lib/chunks/{RQMFL6Q4.js → CBFNHKDJ.js} +1 -1
  24. package/lib/chunks/{KVXVR5Y4.js → CYCPHJNX.js} +1 -1
  25. package/lib/chunks/{WKBXTA7Y.js → DSBDKSRR.js} +1 -1
  26. package/lib/chunks/{AB4FYNJN.js → E2CEKR6N.js} +1 -1
  27. package/lib/chunks/{JZV7EL4R.js → EMWHLZB6.js} +1 -1
  28. package/lib/chunks/{DNDYWJHC.js → ENIFTFYK.js} +1 -1
  29. package/lib/chunks/{BTLP7Z6A.js → ETJMQLWJ.js} +1 -1
  30. package/lib/chunks/{OLAN2CVV.js → EU5WR2O3.js} +1 -1
  31. package/lib/chunks/{TVUYXOSQ.js → FLQQ3VRQ.js} +1 -1
  32. package/lib/chunks/{42X6IAVM.js → FZZACVYL.js} +1 -1
  33. package/lib/chunks/{5F7XFPS7.js → G7A4OE2M.js} +1 -1
  34. package/lib/chunks/{IFGXTL5P.js → GCAL2PYM.js} +1 -1
  35. package/lib/chunks/{GW4PLLFM.js → GGHLD27S.js} +1 -1
  36. package/lib/chunks/{HJ5KS42K.js → GMPHU6KM.js} +1 -1
  37. package/lib/chunks/{UH4Q6U6X.js → GWBLS542.js} +1 -1
  38. package/lib/chunks/{OQRUWVII.js → GXILNSWK.js} +1 -1
  39. package/lib/chunks/{HIMEF7J2.js → HM7M6465.js} +1 -1
  40. package/lib/chunks/{VO775J6V.js → I2JZXLJ6.js} +2 -2
  41. package/lib/chunks/{44US4AGQ.js → I3YF3GEY.js} +1 -1
  42. package/lib/chunks/{WRGAJXOK.js → IIQW437Z.js} +1 -1
  43. package/lib/chunks/{62SOICN7.js → IM4YIUUN.js} +1 -1
  44. package/lib/chunks/{UKVHQIBO.js → JDMRVD45.js} +1 -1
  45. package/lib/chunks/{BL2KWYMY.js → KIFXQTTL.js} +1 -1
  46. package/lib/chunks/{GMMFZFKJ.js → L4VSY42B.js} +1 -1
  47. package/lib/chunks/{MO6NEDYO.js → LH3ONQEX.js} +1 -1
  48. package/lib/chunks/{VF2YOZ3U.js → LUNR7GV4.js} +1 -1
  49. package/lib/chunks/{J3TXBQDL.js → LY5MGNMA.js} +1 -1
  50. package/lib/chunks/{IHUHQ7PO.js → MAACTVYP.js} +1 -1
  51. package/lib/chunks/{NNBSSORJ.js → MTKICX4T.js} +1 -1
  52. package/lib/chunks/{LTJXST6M.js → NMAWU5S4.js} +1 -1
  53. package/lib/chunks/{IMNPDC6N.js → PJHQKG7X.js} +1 -1
  54. package/lib/chunks/{D2BBHPMR.js → PTBPNZRZ.js} +1 -1
  55. package/lib/chunks/{FRC2YJS4.js → PUZ5QSL3.js} +1 -1
  56. package/lib/chunks/{7HTKK26B.js → PW2XFZOB.js} +1 -1
  57. package/lib/chunks/{ZYHLWT2C.js → QAT3DPT3.js} +1 -1
  58. package/lib/chunks/{YB52VXMW.js → R67IVFZH.js} +1 -1
  59. package/lib/chunks/{QYBWIG5Y.js → RA4FAJM3.js} +1 -1
  60. package/lib/chunks/{2DXUH2SS.js → RF5LL2UZ.js} +1 -1
  61. package/lib/chunks/{BY22HEXP.js → RQPH22PV.js} +1 -1
  62. package/lib/chunks/{IJYEZR53.js → S43EG4DB.js} +1 -1
  63. package/lib/chunks/{OOKU5T7P.js → S7VIXBKD.js} +1 -1
  64. package/lib/chunks/{BXMYSHQY.js → U56BQ2BR.js} +2 -2
  65. package/lib/chunks/{6XDKNFYM.js → UOTHMCTM.js} +3 -3
  66. package/lib/chunks/{FMMOQ6SE.js → VHZJNDWE.js} +2 -2
  67. package/lib/chunks/{6JFL6L56.js → VOYPXV3Z.js} +1 -1
  68. package/lib/chunks/{EL6MGCYE.js → VS4MTPCM.js} +1 -1
  69. package/lib/chunks/{RC4LK3ZS.js → WEPGHS5R.js} +1 -1
  70. package/lib/chunks/{L4HVZOFP.js → WRKMMY3F.js} +1 -1
  71. package/lib/chunks/{IO7M7MGV.js → WTJ3S4D7.js} +1 -1
  72. package/lib/chunks/{4ZCKAKVF.js → X22IMAJK.js} +70 -70
  73. package/lib/chunks/{GHJGHHQP.js → X3FFOCXC.js} +1 -1
  74. package/lib/chunks/{FM7Y6KMP.js → XTI7EXWX.js} +1 -1
  75. package/lib/chunks/{GKPSJEG5.js → YA5KTHFN.js} +1 -1
  76. package/lib/chunks/{L5AG5NJZ.js → YA6D5EUI.js} +1 -1
  77. package/lib/chunks/{NFGCHP5P.js → ZFET6WME.js} +1 -1
  78. package/lib/chunks/{4AXMK6B2.js → ZXB5O6JQ.js} +1 -1
  79. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  80. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  81. package/lib/eject-assets/generators/cli/index.ts +2 -2
  82. package/lib/eject-assets/generators/cli/render.ts +1 -1
  83. package/lib/eject-assets/generators/go/client.ts +1 -1
  84. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  85. package/lib/eject-assets/generators/go/index.ts +2 -2
  86. package/lib/eject-assets/generators/go/models.ts +1 -1
  87. package/lib/eject-assets/generators/go/naming.ts +1 -1
  88. package/lib/eject-assets/generators/go/operations.ts +1 -1
  89. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  90. package/lib/eject-assets/generators/go/types.ts +1 -1
  91. package/lib/eject-assets/generators/java/client.ts +1 -1
  92. package/lib/eject-assets/generators/java/descriptor.ts +1 -1
  93. package/lib/eject-assets/generators/java/index.ts +2 -2
  94. package/lib/eject-assets/generators/java/models.ts +1 -1
  95. package/lib/eject-assets/generators/java/naming.ts +1 -1
  96. package/lib/eject-assets/generators/java/operations.ts +1 -1
  97. package/lib/eject-assets/generators/java/pagination.ts +1 -1
  98. package/lib/eject-assets/generators/java/types.ts +1 -1
  99. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  100. package/lib/eject-assets/generators/mock/index.ts +2 -2
  101. package/lib/eject-assets/generators/mock/render.ts +1 -1
  102. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  103. package/lib/eject-assets/generators/mock/values.ts +1 -1
  104. package/lib/eject-assets/generators/php/client.ts +1 -1
  105. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  106. package/lib/eject-assets/generators/php/index.ts +2 -2
  107. package/lib/eject-assets/generators/php/models.ts +1 -1
  108. package/lib/eject-assets/generators/php/naming.ts +1 -1
  109. package/lib/eject-assets/generators/php/operations.ts +1 -1
  110. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  111. package/lib/eject-assets/generators/php/types.ts +1 -1
  112. package/lib/eject-assets/generators/python/client.ts +1 -1
  113. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  114. package/lib/eject-assets/generators/python/index.ts +2 -2
  115. package/lib/eject-assets/generators/python/models.ts +1 -1
  116. package/lib/eject-assets/generators/python/naming.ts +1 -1
  117. package/lib/eject-assets/generators/python/operations.ts +1 -1
  118. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  119. package/lib/eject-assets/generators/python/types.ts +1 -1
  120. package/lib/eject-assets/generators/swr/index.ts +2 -2
  121. package/lib/eject-assets/generators/swr/render.ts +1 -1
  122. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  123. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  124. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  125. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  126. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  127. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  128. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  129. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  130. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  131. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  132. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  133. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  134. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  135. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  136. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  137. package/lib/eject-assets/generators/zod/index.ts +2 -2
  138. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  139. package/lib/index.js +4 -4
  140. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{e as g,h as p,k as $}from"./4AXMK6B2.js";import{o as h}from"./D3C6XIMY.js";import{join as R}from"node:path";var a=" ";function m(e){return`${$(e)}Schema`}var y=new Map;function u(e,r=y,t=""){return j(w(e,r,t),e)}function w(e,r,t){switch(e.kind){case"scalar":return z(e.scalar,e.metadata);case"object":return b(e.properties,r,t);case"array":return`z.array(${u(e.items,r,t)})`;case"record":return`z.record(z.string(), ${u(e.value,r,t)})`;case"ref":return`z.lazy(() => ${m(e.name)})`;case"literal":return`z.literal(${p(e.value)})`;case"enum":return q(e.values);case"union":return k(e.members,r,t);case"intersection":return e.members.map(n=>u(n,r,t)).reduce((n,o)=>`${n}.and(${o})`);case"null":return"z.null()";case"unknown":return"z.unknown()";case"omit":return E(e.base,e.keys,r,t)}}function z(e,r){switch(e){case"string":return r?.format==="binary"?"z.instanceof(Blob)":"z.string()";case"integer":return"z.number().int()";case"number":return"z.number()";case"boolean":return"z.boolean()"}}function c(e){return g(e)===e?e:JSON.stringify(e)}function b(e,r,t){if(e.length===0)return"z.object({})";let n=t+a;return`z.object({
7
+ import{e as g,h as p,k as $}from"./ZXB5O6JQ.js";import{o as h}from"./A65OW7M7.js";import{join as R}from"node:path";var a=" ";function m(e){return`${$(e)}Schema`}var y=new Map;function u(e,r=y,t=""){return j(w(e,r,t),e)}function w(e,r,t){switch(e.kind){case"scalar":return z(e.scalar,e.metadata);case"object":return b(e.properties,r,t);case"array":return`z.array(${u(e.items,r,t)})`;case"record":return`z.record(z.string(), ${u(e.value,r,t)})`;case"ref":return`z.lazy(() => ${m(e.name)})`;case"literal":return`z.literal(${p(e.value)})`;case"enum":return q(e.values);case"union":return k(e.members,r,t);case"intersection":return e.members.map(n=>u(n,r,t)).reduce((n,o)=>`${n}.and(${o})`);case"null":return"z.null()";case"unknown":return"z.unknown()";case"omit":return E(e.base,e.keys,r,t)}}function z(e,r){switch(e){case"string":return r?.format==="binary"?"z.instanceof(Blob)":"z.string()";case"integer":return"z.number().int()";case"number":return"z.number()";case"boolean":return"z.boolean()"}}function c(e){return g(e)===e?e:JSON.stringify(e)}function b(e,r,t){if(e.length===0)return"z.object({})";let n=t+a;return`z.object({
8
8
  ${e.map((s,i)=>{let d=u(s.schema,r,n),l=s.required?d:`${d}.optional()`,x=i===e.length-1?"":",";return`${n}${c(s.name)}: ${l}${x}`}).join(`
9
9
  `)}
10
10
  ${t}})`}function q(e){return e.every(r=>typeof r=="string")?`z.enum([${e.map(r=>JSON.stringify(r)).join(", ")}])`:`z.union([${e.map(r=>`z.literal(${p(r)})`).join(", ")}])`}function k(e,r,t){let n=e.map(o=>u(o,r,t));return n.length===1?n[0]:`z.union([${n.join(", ")}])`}function E(e,r,t,n){let o=t.get(e);if(o&&o.kind!=="object")return u(f(o,r,t,new Set([e])),t,n);let s=r.map(i=>`${c(i)}: true`).join(", ");return`${m(e)}.omit({ ${s} })`}function f(e,r,t,n){switch(e.kind){case"object":return{...e,properties:e.properties.filter(o=>!r.includes(o.name))};case"union":case"intersection":return{...e,members:e.members.map(o=>f(o,r,t,n))};case"ref":{if(n.has(e.name))return e;let o=t.get(e.name);if(!o)return e;if(o.kind==="object"){let s=r.filter(i=>o.properties.some(d=>d.name===i));return s.length>0?{kind:"omit",base:e.name,keys:s}:e}return f(o,r,t,new Set([...n,e.name]))}default:return e}}function j(e,r){let t=r.metadata;if(!t)return e;let n=e;return r.kind==="scalar"&&r.scalar==="string"&&(t.minLength!==void 0&&(n=`${n}.min(${t.minLength})`),t.maxLength!==void 0&&(n=`${n}.max(${t.maxLength})`),t.pattern!==void 0&&(n=`${n}.regex(new RegExp(${JSON.stringify(t.pattern)}))`)),r.kind==="scalar"&&(r.scalar==="number"||r.scalar==="integer")&&(t.minimum!==void 0&&(n=`${n}.min(${t.minimum})`),t.maximum!==void 0&&(n=`${n}.max(${t.maximum})`),t.exclusiveMinimum!==void 0&&(n=`${n}.gt(${t.exclusiveMinimum})`),t.exclusiveMaximum!==void 0&&(n=`${n}.lt(${t.exclusiveMaximum})`)),r.kind==="array"&&(t.minItems!==void 0&&(n=`${n}.min(${t.minItems})`),t.maxItems!==void 0&&(n=`${n}.max(${t.maxItems})`)),n}function Z(e,r){let t=[];for(let n of h(e.services)){if(n.sse!==void 0)continue;let o=n.requestBody,s=o&&o.contentType.toLowerCase().includes("json")?u(o.schema,r,a):void 0,i=n.successResponses.find(l=>l.contentType.toLowerCase().includes("json")),d=i?u(i.schema,r,a):void 0;!s&&!d||t.push({name:n.specName??n.name,request:s,response:d})}return t}function I(e){let r=e.flatMap(n=>[`${a}${c(n.name)}: {`,...n.request?[`${a}${a}request: z.ZodType;`]:[],...n.response?[`${a}${a}response: z.ZodType;`]:[],`${a}};`]),t=e.map((n,o)=>{let s=[...n.request?[`request: ${n.request}`]:[],...n.response?[`response: ${n.response}`]:[]].join(", "),i=o===e.length-1?"":",";return`${a}${c(n.name)}: { ${s} }${i}`});return["/**"," * Request/response validators by operationId \u2014 powers `zodValidation`, or import one directly."," */","export const operationSchemas: {",...r,"} = {",...t,"};"].join(`
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as m,j as C,o as a,p,q as T,r as l,s as h,t as f,u as d}from"./5F7XFPS7.js";import{c as g}from"./4ZCKAKVF.js";import A from"node:path";function L(e,n){if(C(e)!=="application/x-www-form-urlencoded"||!Array.isArray(n))return;let o=new URLSearchParams;for(let s of n){if(!g(s))continue;let t=a(s.name);t!==void 0&&o.append(t,a(s.value)??"")}return o.size>0?o.toString():void 0}function K(e,n,o){let s=e?.request,t=e?.response;if(!s)return null;let r=s?.postData,i=a(r?.mimeType),u=r?.text??L(i,r?.params),c=a(r?.encoding),y=t?.content?.text,S=a(t?.content?.encoding),q=p(t?.status);return l({method:a(s?.method),url:a(s?.url),requestHeaders:s?.headers,requestBody:T(u,c),requestContentType:i,responseStatus:q===0?void 0:q,responseStatusText:a(t?.statusText),responseHeaders:t?.headers,responseBody:T(y,S),responseContentType:a(t?.content?.mimeType),startedAt:a(e?.startedDateTime),raw:e},n,o)}var b=class{id="har";canParse(n,o){if(A.extname(n).toLowerCase()===".har")return!0;let t=o.toLowerCase();return t.includes('"log"')&&t.includes('"entries"')}async*parse(n){let o=0;for await(let s of f(n,"log.entries")){let t=K(s,o,n);t&&(yield t),o+=1}}};import $ from"node:path";function H(e){let n=a(e.url??e.uri);if(n)return{url:n};let o=a(e.host??e.headers?.host),s=a(e.path??e.request_uri),t=a(e.scheme??e.forwarded_proto);return o&&s?{url:`${t??"http"}://${o}${s}`,schemeKnown:!!t}:{url:s,schemeKnown:!!t}}function z(e,n,o){let s=e?.request??e?.req??e?.http?.request;if(!s)return null;let t=e?.response??e?.res??e?.http?.response,r=t?.body??t?.raw_body??t?.payload??t?.data,i=s?.body??s?.raw_body??s?.payload??s?.data,{url:u,schemeKnown:c}=H(s);return l({method:a(s?.method??s?.http_method),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:i,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode),responseHeaders:t?.headers,responseBody:r,responseContentType:d(t?.headers),startedAt:a(e?.started_at??e?.startedAt??e?.timestamp),raw:e},n,o)}var x=class{id="kong";canParse(n,o){if($.extname(n).toLowerCase()===".kong")return!0;let t=o.toLowerCase();return t.includes('"latencies"')||t.includes('"request"')&&t.includes('"response"')&&t.includes('"route"')}async*parse(n){let o=(await m(n,16)).trim().slice(0,1),s=0;if(o==="["){for await(let t of f(n)){let r=z(t,s,n);r&&(yield r),s+=1}return}for await(let t of h(n)){let r=z(t,s,n);r&&(yield r),s+=1}}};import R from"node:path";function U(e){return e?.request??e?.req??e?.httpRequest??e?.http?.request??e}function I(e){return e?.response??e?.res??e?.httpResponse??e?.http?.response}function O(e,n){let o=a(n?.url??n?.uri??n?.requestUrl??e?.url);if(o)return{url:o};let s=a(n?.host??n?.headers?.host??e?.host),t=a(n?.path??e?.path??n?.pathname),r=a(n?.scheme??e?.scheme);return s&&t?{url:`${r??"http"}://${s}${t}`,schemeKnown:!!r}:{url:t,schemeKnown:!!r}}function k(e,n,o){let s=U(e),t=I(e),r=s?.body??s?.bodyText??s?.payload??s?.data??s?.rawBody,i=t?.body??t?.bodyText??t?.payload??t?.data??t?.rawBody,{url:u,schemeKnown:c}=O(e,s);return l({method:a(s?.method??s?.httpMethod??e?.method??e?.httpMethod),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:r,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode??e?.status??e?.statusCode),responseHeaders:t?.headers,responseBody:i,responseContentType:d(t?.headers),startedAt:a(e?.startedAt??e?.timestamp??e?.time),raw:e},n,o)}var w=class{id="ndjson";canParse(n,o){let s=R.extname(n).toLowerCase();if(s===".ndjson"||s===".jsonl"||s===".jsonlines")return!0;let t=o.lastIndexOf(`
7
+ import{b as m,j as C,o as a,p,q as T,r as l,s as h,t as f,u as d}from"./G7A4OE2M.js";import{c as g}from"./X22IMAJK.js";import A from"node:path";function L(e,n){if(C(e)!=="application/x-www-form-urlencoded"||!Array.isArray(n))return;let o=new URLSearchParams;for(let s of n){if(!g(s))continue;let t=a(s.name);t!==void 0&&o.append(t,a(s.value)??"")}return o.size>0?o.toString():void 0}function K(e,n,o){let s=e?.request,t=e?.response;if(!s)return null;let r=s?.postData,i=a(r?.mimeType),u=r?.text??L(i,r?.params),c=a(r?.encoding),y=t?.content?.text,S=a(t?.content?.encoding),q=p(t?.status);return l({method:a(s?.method),url:a(s?.url),requestHeaders:s?.headers,requestBody:T(u,c),requestContentType:i,responseStatus:q===0?void 0:q,responseStatusText:a(t?.statusText),responseHeaders:t?.headers,responseBody:T(y,S),responseContentType:a(t?.content?.mimeType),startedAt:a(e?.startedDateTime),raw:e},n,o)}var b=class{id="har";canParse(n,o){if(A.extname(n).toLowerCase()===".har")return!0;let t=o.toLowerCase();return t.includes('"log"')&&t.includes('"entries"')}async*parse(n){let o=0;for await(let s of f(n,"log.entries")){let t=K(s,o,n);t&&(yield t),o+=1}}};import $ from"node:path";function H(e){let n=a(e.url??e.uri);if(n)return{url:n};let o=a(e.host??e.headers?.host),s=a(e.path??e.request_uri),t=a(e.scheme??e.forwarded_proto);return o&&s?{url:`${t??"http"}://${o}${s}`,schemeKnown:!!t}:{url:s,schemeKnown:!!t}}function z(e,n,o){let s=e?.request??e?.req??e?.http?.request;if(!s)return null;let t=e?.response??e?.res??e?.http?.response,r=t?.body??t?.raw_body??t?.payload??t?.data,i=s?.body??s?.raw_body??s?.payload??s?.data,{url:u,schemeKnown:c}=H(s);return l({method:a(s?.method??s?.http_method),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:i,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode),responseHeaders:t?.headers,responseBody:r,responseContentType:d(t?.headers),startedAt:a(e?.started_at??e?.startedAt??e?.timestamp),raw:e},n,o)}var x=class{id="kong";canParse(n,o){if($.extname(n).toLowerCase()===".kong")return!0;let t=o.toLowerCase();return t.includes('"latencies"')||t.includes('"request"')&&t.includes('"response"')&&t.includes('"route"')}async*parse(n){let o=(await m(n,16)).trim().slice(0,1),s=0;if(o==="["){for await(let t of f(n)){let r=z(t,s,n);r&&(yield r),s+=1}return}for await(let t of h(n)){let r=z(t,s,n);r&&(yield r),s+=1}}};import R from"node:path";function U(e){return e?.request??e?.req??e?.httpRequest??e?.http?.request??e}function I(e){return e?.response??e?.res??e?.httpResponse??e?.http?.response}function O(e,n){let o=a(n?.url??n?.uri??n?.requestUrl??e?.url);if(o)return{url:o};let s=a(n?.host??n?.headers?.host??e?.host),t=a(n?.path??e?.path??n?.pathname),r=a(n?.scheme??e?.scheme);return s&&t?{url:`${r??"http"}://${s}${t}`,schemeKnown:!!r}:{url:t,schemeKnown:!!r}}function k(e,n,o){let s=U(e),t=I(e),r=s?.body??s?.bodyText??s?.payload??s?.data??s?.rawBody,i=t?.body??t?.bodyText??t?.payload??t?.data??t?.rawBody,{url:u,schemeKnown:c}=O(e,s);return l({method:a(s?.method??s?.httpMethod??e?.method??e?.httpMethod),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:r,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode??e?.status??e?.statusCode),responseHeaders:t?.headers,responseBody:i,responseContentType:d(t?.headers),startedAt:a(e?.startedAt??e?.timestamp??e?.time),raw:e},n,o)}var w=class{id="ndjson";canParse(n,o){let s=R.extname(n).toLowerCase();if(s===".ndjson"||s===".jsonl"||s===".jsonlines")return!0;let t=o.lastIndexOf(`
8
8
  `),i=(t===-1?o:o.slice(0,t)).split(`
9
9
  `).map(u=>u.trim()).find(Boolean);if(!i?.startsWith("{")||!i.endsWith("}"))return!1;try{return JSON.parse(i),!0}catch{return!1}}async*parse(n){let o=0;for await(let s of h(n)){let t=k(s,o,n);t&&(yield t),o+=1}}};import J from"node:path";function P(e){if(!e)return{};let n=e.trim().split(/\s+/);return n.length<2?{}:{method:n[0],path:n[1],protocol:n[2]}}function W(e,n){let o=a(n?.url??n?.request_uri??n?.uri??e?.url??e?.request_url??e?.absolute_uri),s=P(a(e?.request??n?.request_line)),t=a(n?.request_uri??n?.uri??n?.path??e?.request_uri??e?.uri)??s.path;if(o?.startsWith("http://")||o?.startsWith("https://"))return{url:o};let r=a(n?.host??n?.headers?.host??e?.host??e?.http_host??e?.server_name??e?.vhost),i=a(e?.scheme??n?.scheme??e?.request_scheme),u=!!i;if(r&&(o||t)){let c=i??"http",y=o??t;return y?.startsWith("/")?{url:`${c}://${r}${y}`,schemeKnown:u}:{url:`${c}://${r}/${y}`,schemeKnown:u}}return{url:o??t,schemeKnown:u}}function E(e,n,o){let s=g(e?.request)?e.request:e,t=g(e?.response)?e.response:void 0,r=P(a(e?.request)),i=a(s?.method??s?.request_method??e?.request_method??e?.method)??r.method,{url:u,schemeKnown:c}=W(e,s);return l({method:i,url:u,schemeKnown:c,requestHeaders:s?.headers??s?.request_headers??e?.request_headers??e?.headers,requestBody:s?.body??s?.request_body??e?.request_body??e?.body,requestContentType:d(s?.headers??s?.request_headers??e?.request_headers),responseStatus:p(t?.status??t?.status_code??e?.status??e?.status_code??e?.response_status),responseHeaders:t?.headers??t?.response_headers??e?.response_headers??e?.headers_out,responseBody:t?.body??t?.response_body??e?.response_body,responseContentType:d(t?.headers??t?.response_headers??e?.response_headers),startedAt:a(e?.time_iso8601??e?.timestamp??e?.time??e?.time_local??e?.["@timestamp"]),raw:e},n,o)}async function*j(e){if((await m(e,16)).trim().slice(0,1)==="["){yield*f(e);return}for await(let o of h(e))yield o}var N=class{id="nginx-json";canParse(n,o){let s=J.extname(n).toLowerCase(),t=n.toLowerCase();if(s===".ndjson"&&t.includes("nginx"))return!0;let r=o.toLowerCase();return r.includes('"request_uri"')||r.includes('"time_iso8601"')||r.includes('"upstream_response_time"')||r.includes('"remote_addr"')}async*parse(n){let o=0;for await(let s of j(n)){let t=E(s,o,n);t&&(yield t),o+=1}}},_=class{id="apache-json";canParse(n,o){let s=J.extname(n).toLowerCase(),t=n.toLowerCase();if(s===".ndjson"&&t.includes("apache"))return!0;let r=o.toLowerCase();return r.includes('"request_method"')||r.includes('"request_uri"')||r.includes('"vhost"')||r.includes('"response_status"')}async*parse(n){let o=0;for await(let s of j(n)){let t=E(s,o,n);t&&(yield t),o+=1}}};var B=[new b,new x,new N,new _,new w];async function le(e,n){if(n!=="auto"){let s=B.find(t=>t.id===n);if(!s)throw new Error(`Unsupported parser format: ${n}`);return s}let o=await m(e);return B.find(s=>s.canParse(e,o))}export{le as a};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as A,c as F,d as S,e as l}from"./NDECHUWV.js";import"./IHUHQ7PO.js";import{e as $,g as x,r as I,s as P}from"./TVUYXOSQ.js";import"./KFQC57GK.js";import{f as p}from"./GKPSJEG5.js";import{ca as w,k as u,ka as n}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function O({argv:t,config:o,version:c}){let h=performance.now(),j=Date.now(),{organization:g,project:d,"mount-path":z,verbose:D}=t,f=t.domain||x(),e,r,y,b,s=[];try{let i=$();if(e=P(t.files,(a,T)=>{n.warn(`File ${a} is overwritten by ${T}
7
+ import{b as A,c as F,d as S,e as l}from"./542GVIYM.js";import"./MAACTVYP.js";import{e as $,g as x,r as I,s as P}from"./FLQQ3VRQ.js";import"./KFQC57GK.js";import{f as p}from"./YA5KTHFN.js";import{ca as w,k as u,ka as n}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function O({argv:t,config:o,version:c}){let h=performance.now(),j=Date.now(),{organization:g,project:d,"mount-path":z,verbose:D}=t,f=t.domain||x(),e,r,y,b,s=[];try{let i=$();if(e=P(t.files,(a,T)=>{n.warn(`File ${a} is overwritten by ${T}
8
8
  `)}),!e.length)return p("push",h,"No files to upload");let m=await I({domain:f,apiKey:i,organization:g,project:d,mountPath:z,files:e,defaultBranch:t["default-branch"],commit:{message:t.message,branchName:t.branch,sha:t["commit-sha"],url:t["commit-url"],createdAt:t["created-at"],namespace:t.namespace,repository:t.repository,author:U(t.author)},version:c,replace:t.replace,onUploadStart:a=>{n.info(`Uploading to ${a.mountPath} ${e.length} ${u("file",e.length)}:
9
9
  `)},onSunsetWarning:a=>s.push(a),onSlugDeprecated:S});r=m.pushId,y=m.organizationId,b=m.projectId}catch(i){l("push",s),F("\u2717 File upload failed.",i)}for(let i of e)n.info(w(`\u2713 ${i.name}
10
10
  `));return n.info(`
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./JZV7EL4R.js";import"./HIMEF7J2.js";import"./76AJ5P4Y.js";import"./QQ2PGWE6.js";import"./4AXMK6B2.js";import"./D3C6XIMY.js";import"./WZXA5XPB.js";import"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
7
+ import{a}from"./EMWHLZB6.js";import"./HM7M6465.js";import"./4QC7OVHI.js";import"./BZTZIEWS.js";import"./ZXB5O6JQ.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as s}from"./HBUZKWXC.js";import{a as n,b as p}from"./LRRSU5UY.js";import{ka as e}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{spawn as g}from"node:child_process";import{existsSync as l,readFileSync as w}from"node:fs";import P from"node:path";var S=async({argv:r})=>{let{plan:o,port:i}=r,c=r["project-dir"];r.product&&e.warn(`The --product option is deprecated. It still picks the product package; without it, the preview uses the package listed in package.json, or ${n.framework} by default.
7
+ import{c as s}from"./HBUZKWXC.js";import{a as n,b as p}from"./LRRSU5UY.js";import{ka as e}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{spawn as g}from"node:child_process";import{existsSync as l,readFileSync as w}from"node:fs";import P from"node:path";var S=async({argv:r})=>{let{plan:o,port:i}=r,c=r["project-dir"];r.product&&e.warn(`The --product option is deprecated. It still picks the product package; without it, the preview uses the package listed in package.json, or ${n.framework} by default.
8
8
  `);let t=r.product||j(c);if(!h(t))throw e.info(`Invalid product ${t}.`),new Error("Project preview launch failed.");let a=p[t],d=n[t];e.info(`
9
9
  Launching preview of ${a} ${o} using NPX.
10
10
 
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as D}from"./GKPSJEG5.js";import{A as x,X as C,Y as j,ka as $,ma as k,na as M,oa as S,p as F,qa as b,u as R}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{relative as I,resolve as U}from"node:path";var A=20;async function B({argv:o,config:t,collectSpecData:r}){let[{path:s}]=await D([o.api],t),n=new C(t.resolve),e=await n.resolveDocument(null,s,!0);r?.(e);let i=k(e.parsed),d=F(t.extendTypes(x(i),i),t),p=new Map,u=({source:l,pointer:c},f,N)=>{let v=`${l.absoluteRef}${c}`,y=p.get(v);if(!y){p.set(v,{absoluteRef:l.absoluteRef,pointer:c,types:[f],resolvesTo:N});return}y.types.includes(f)||y.types.push(f),y.resolvesTo||(y.resolvesTo=N)},m={any:{enter(l,{location:c,type:f}){u(c,f.name)}},ref(l,{location:c,type:f},N){u(c,f.name,N.location)}},h={problems:[],specVersion:i,config:t,visitorsData:{}},a=await j({rootDocument:e,rootType:d.Root,externalRefResolver:n});if(S({document:e,rootType:d.Root,normalizedVisitors:M([{severity:"warn",ruleId:"inspect-node-types",visitor:m}],d),resolvedRefMap:a,ctx:h}),o.pointer){let l=W(p,o.pointer,e.source.absoluteRef);o.parents?L(w(p,l,e.source.absoluteRef)):$.output(`${l.types.join(`
7
+ import{b as D}from"./YA5KTHFN.js";import{A as x,X as C,Y as j,ka as $,ma as k,na as M,oa as S,p as F,qa as b,u as R}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{relative as I,resolve as U}from"node:path";var A=20;async function B({argv:o,config:t,collectSpecData:r}){let[{path:s}]=await D([o.api],t),n=new C(t.resolve),e=await n.resolveDocument(null,s,!0);r?.(e);let i=k(e.parsed),d=F(t.extendTypes(x(i),i),t),p=new Map,u=({source:l,pointer:c},f,N)=>{let v=`${l.absoluteRef}${c}`,y=p.get(v);if(!y){p.set(v,{absoluteRef:l.absoluteRef,pointer:c,types:[f],resolvesTo:N});return}y.types.includes(f)||y.types.push(f),y.resolvesTo||(y.resolvesTo=N)},m={any:{enter(l,{location:c,type:f}){u(c,f.name)}},ref(l,{location:c,type:f},N){u(c,f.name,N.location)}},h={problems:[],specVersion:i,config:t,visitorsData:{}},a=await j({rootDocument:e,rootType:d.Root,externalRefResolver:n});if(S({document:e,rootType:d.Root,normalizedVisitors:M([{severity:"warn",ruleId:"inspect-node-types",visitor:m}],d),resolvedRefMap:a,ctx:h}),o.pointer){let l=W(p,o.pointer,e.source.absoluteRef);o.parents?L(w(p,l,e.source.absoluteRef)):$.output(`${l.types.join(`
8
8
  `)}
9
9
  `);return}let g=[...p.values()];if(o.summary)V(g);else if(o.type){let l=o.type,c=g.filter(({types:f})=>f.includes(l));if(c.length===0)throw new b(`No nodes of type '${l}'. Run the command with --summary to see the types used in this description.`);o.parents?L(c.flatMap(f=>w(p,f,e.source.absoluteRef)),l):E(c)}else E(g)}function w(o,t,r,s=new Set){let n=`${t.absoluteRef}${t.pointer}`;if(s.has(n))return[[t]];s.add(n);let e=[],i=t.pointer.split("/");for(let p=1;p<i.length;p++){let u=p===1?"#/":i.slice(0,p).join("/");if(u===t.pointer)continue;let m=o.get(`${t.absoluteRef}${u}`);m&&e.push(m)}e.push(t);let d=[];e[0].absoluteRef===r&&e[0].pointer==="#/"&&d.push(e);for(let[p,u]of e.entries()){let m=[...o.values()].filter(a=>a.resolvesTo?.source.absoluteRef===u.absoluteRef&&a.resolvesTo.pointer===u.pointer),h=e.slice(p+1);for(let a of m)d.push(...w(o,a,r,s).map(g=>[...g,...h]))}return d.length?d:[e]}function L(o,t){let r=new Set(o.map(s=>s.map(({types:n})=>t&&n.includes(t)?t:n.join(", ")).join(" \u2192 ")));for(let s of r)$.output(`${s}
10
10
  `)}function W(o,t,r){let[s,n]=t.split("#"),e=s?R(s)?s:U(process.cwd(),s):r,i=o.get(`${e}#${n||"/"}`);if(!i)throw new b(`No node at ${t}. ${z(o,e,`#${n||"/"}`,s)??`Check the pointer, and make sure the file is referenced from ${T(r)}.`}`);return i}function z(o,t,r,s){let n=r.split("/");for(let e=n.length-1;e>=1;e--){let i=e===1?"#/":n.slice(0,e).join("/"),d=o.get(`${t}${i}`);if(!d)continue;let p=n[e].toLowerCase(),u=e===1?"#/":`${i}/`,m=[...o.values()].filter(c=>c.absoluteRef===t&&c.pointer.startsWith(u)&&!c.pointer.slice(u.length).includes("/")),h=m.filter(c=>c.pointer.slice(u.length).toLowerCase().includes(p)),a=(h.length?h:m).map(c=>` ${s}${c.pointer}`),g=a.length-A;g>0&&(a.length=A,a.push(` \u2026and ${g} more`));let l=`The closest node is ${d.types.join(", ")} at ${s}${i}.`;return a.length?`${l} Did you mean:
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./HXOTKK2E.js";import"./QQ2PGWE6.js";import"./4AXMK6B2.js";import"./D3C6XIMY.js";import"./WZXA5XPB.js";import"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as mockGenerator};
7
+ import{a}from"./5UPBGRBZ.js";import"./BZTZIEWS.js";import"./ZXB5O6JQ.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as mockGenerator};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e,f}from"./RQMFL6Q4.js";import"./TFPMT2XD.js";import"./QQ2PGWE6.js";import"./D3C6XIMY.js";import"./WZXA5XPB.js";import"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{f as pythonDocs,d as pythonGenerator,c as pythonOptions,e as pythonSample,a as pythonType,b as renderPythonModels};
7
+ import{a,b,c,d,e,f}from"./CBFNHKDJ.js";import"./TFPMT2XD.js";import"./BZTZIEWS.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{f as pythonDocs,d as pythonGenerator,c as pythonOptions,e as pythonSample,a as pythonType,b as renderPythonModels};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{Q as wi,R as zi,Z as rf,_ as nf,c as Te,da as eo,ea as to,ia as Cr,ka as xe,qa as we,ra as bi}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import{a as De,c as ce,d as Qn,e as Or}from"./RFWIIJFG.js";var ud=ce((r$,cd)=>{cd.exports=ad;ad.sync=H_;var sd=De("fs");function B_(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function id(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:B_(t,r)}function ad(e,t,r){sd.stat(e,function(n,o){r(n,n?!1:id(o,e,t))})}function H_(e,t){return id(sd.statSync(e),e,t)}});var md=ce((n$,fd)=>{fd.exports=pd;pd.sync=J_;var ld=De("fs");function pd(e,t,r){ld.stat(e,function(n,o){r(n,n?!1:dd(o,t))})}function J_(e,t){return dd(ld.statSync(e),t)}function dd(e,t){return e.isFile()&&W_(e,t)}function W_(e,t){var r=e.mode,n=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&o===i||r&a&&n===s||r&l&&s===0;return d}});var gd=ce((s$,hd)=>{var o$=De("fs"),Jn;process.platform==="win32"||global.TESTING_WINDOWS?Jn=ud():Jn=md();hd.exports=ai;ai.sync=K_;function ai(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){ai(e,t||{},function(s,i){s?o(s):n(i)})})}Jn(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function K_(e,t){try{return Jn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vd=ce((i$,bd)=>{var Nt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_d=De("path"),G_=Nt?";":":",yd=gd(),xd=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wd=(e,t)=>{let r=t.colon||G_,n=e.match(/\//)||Nt&&e.match(/\\/)?[""]:[...Nt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Nt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Nt?o.split(r):[""];return Nt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},zd=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:s}=wd(e,t),i=[],a=u=>new Promise((l,d)=>{if(u===n.length)return t.all&&i.length?l(i):d(xd(e));let f=n[u],m=/^".*"$/.test(f)?f.slice(1,-1):f,h=_d.join(m,e),_=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;l(c(_,u,0))}),c=(u,l,d)=>new Promise((f,m)=>{if(d===o.length)return f(a(l+1));let h=o[d];yd(u+h,{pathExt:s},(_,x)=>{if(!_&&x)if(t.all)i.push(u+h);else return f(u+h);return f(c(u,l,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},X_=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=wd(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=_d.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<n.length;d++){let f=l+n[d];try{if(yd.sync(f,{pathExt:o}))if(t.all)s.push(f);else return f}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw xd(e)};bd.exports=zd;zd.sync=X_});var kd=ce((a$,ci)=>{"use strict";var Sd=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ci.exports=Sd;ci.exports.default=Sd});var Rd=ce((c$,Td)=>{"use strict";var $d=De("path"),Y_=vd(),Q_=kd();function Pd(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Y_.sync(e.command,{path:r[Q_({env:r})],pathExt:t?$d.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=$d.resolve(o?e.options.cwd:"",i)),i}function ey(e){return Pd(e)||Pd(e,!0)}Td.exports=ey});var Ed=ce((u$,li)=>{"use strict";var ui=/([()\][%!^"`<>&|;, *?])/g;function ty(e){return e=e.replace(ui,"^$1"),e}function ry(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ui,"^$1"),t&&(e=e.replace(ui,"^$1")),e}li.exports.command=ty;li.exports.argument=ry});var Cd=ce((l$,Od)=>{"use strict";Od.exports=/^#!(.*)/});var Ad=ce((p$,Id)=>{"use strict";var ny=Cd();Id.exports=(e="")=>{let t=e.match(ny);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Nd=ce((d$,Zd)=>{"use strict";var pi=De("fs"),oy=Ad();function sy(e){let r=Buffer.alloc(150),n;try{n=pi.openSync(e,"r"),pi.readSync(n,r,0,150,0),pi.closeSync(n)}catch{}return oy(r.toString())}Zd.exports=sy});var Ld=ce((f$,Dd)=>{"use strict";var iy=De("path"),Md=Rd(),jd=Ed(),ay=Nd(),cy=process.platform==="win32",uy=/\.(?:com|exe)$/i,ly=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function py(e){e.file=Md(e);let t=e.file&&ay(e.file);return t?(e.args.unshift(e.file),e.command=t,Md(e)):e.file}function dy(e){if(!cy)return e;let t=py(e),r=!uy.test(t);if(e.options.forceShell||r){let n=ly.test(t);e.command=iy.normalize(e.command),e.command=jd.command(e.command),e.args=e.args.map(s=>jd.argument(s,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function fy(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:dy(n)}Dd.exports=fy});var Fd=ce((m$,qd)=>{"use strict";var di=process.platform==="win32";function fi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function my(e,t){if(!di)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let s=Ud(o,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function Ud(e,t){return di&&e===1&&!t.file?fi(t.original,"spawn"):null}function hy(e,t){return di&&e===1&&!t.file?fi(t.original,"spawnSync"):null}qd.exports={hookChildProcess:my,verifyENOENT:Ud,verifyENOENTSync:hy,notFoundError:fi}});var Hd=ce((h$,Mt)=>{"use strict";var Vd=De("child_process"),mi=Ld(),hi=Fd();function Bd(e,t,r){let n=mi(e,t,r),o=Vd.spawn(n.command,n.args,n.options);return hi.hookChildProcess(o,n),o}function gy(e,t,r){let n=mi(e,t,r),o=Vd.spawnSync(n.command,n.args,n.options);return o.error=o.error||hi.verifyENOENTSync(o.status,n),o}Mt.exports=Bd;Mt.exports.spawn=Bd;Mt.exports.sync=gy;Mt.exports._parse=mi;Mt.exports._enoent=hi});var Yd=ce(_i=>{"use strict";var Kd=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,by=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Gd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,vy=/\\([\u000b\u0020-\u00ff])/g,Sy=/([\\"])/g,Xd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;_i.format=ky;_i.parse=$y;function ky(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Xd.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var o,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(o=s[i],!Gd.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Ty(t[o])}return n}function $y(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Py(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!Xd.test(n))throw new TypeError("invalid media type");var o=new Ry(n.toLowerCase());if(r!==-1){var s,i,a;for(Kd.lastIndex=r;i=Kd.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(vy,"$1"))),o.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return o}function Py(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function Ty(e){var t=String(e);if(Gd.test(t))return t;if(t.length>0&&!by.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(Sy,"\\$1")+'"'}function Ry(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as Zy,mkdirSync as Ny,readFileSync as My,writeFileSync as jy}from"node:fs";import{dirname as Dy}from"node:path";import{isDeepStrictEqual as Lt}from"node:util";function Dt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])Te(r)&&t.set(r.name,r);return t}function Ir(e,t,r){let n=Dt(t);return e.map(o=>{let s=n.get(o.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...o,...i}})}function of(e,t){let r=Dt(t);return Ir(e,t,["tags","security"]).map(n=>{if(!n.arguments)return n;let o=r.get(n.name)?.arguments;return{...n,arguments:Ir(n.arguments,o,["example"])}})}function ro(e,t,r){let n=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},o=Te(n["x-mcp"])?n["x-mcp"]:{},s={...o};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>Te(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=Ir(t.tools,o.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=of(t.prompts,o.prompts):delete s.prompts,t.capabilities?.resources?s.resources=Ir(t.resources,o.resources,["tags","security"]):delete s.resources,n["x-mcp"]=s,n}function sf(e,t){let r=Dt(e),n=Dt(t),o=[...n.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!n.has(c)),i=[...n.keys()].filter(c=>r.has(c)&&!Lt(r.get(c),n.get(c))),a=[];return o.length>0&&a.push(`added: ${o.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function vi(e,t){if(Lt(e,t))return[];let r=Te(e["x-mcp"])?e["x-mcp"]:{},n=Te(t["x-mcp"])?t["x-mcp"]:{},o=[];for(let s of["tools","prompts","resources"]){let i=sf(r[s],n[s]);i&&o.push(`${s} - ${i}`)}return Lt(r.protocolVersion,n.protocolVersion)||o.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${n.protocolVersion}`),Lt(r.capabilities,n.capabilities)||o.push("capabilities changed"),Lt(r.servers,n.servers)||o.push("servers - the MCP server URL is not listed"),o.length===0&&o.push("x-mcp changed"),o}var P={};Qn(P,{BIGINT_FORMAT_RANGES:()=>Mr,CONSTANT_CATCH:()=>Zi,Class:()=>so,NUMBER_FORMAT_RANGES:()=>qt,aborted:()=>ze,allowsEval:()=>lo,assert:()=>pf,assertEqual:()=>af,assertIs:()=>uf,assertNever:()=>lf,assertNotEqual:()=>cf,assignProp:()=>fe,attachSchema:()=>Ft,base64ToUint8Array:()=>Ii,base64urlToUint8Array:()=>Ef,cached:()=>dt,captureStackTrace:()=>Zr,cleanEnum:()=>Rf,cleanRegex:()=>Ut,clone:()=>ge,cloneDef:()=>mf,codePointLength:()=>Vt,constantCatch:()=>Ni,createTransparentProxy:()=>wf,defineLazy:()=>$i,defineLazyInternal:()=>I,derived:()=>Af,esc:()=>co,escapeRegex:()=>Oe,explicitlyAborted:()=>mo,extend:()=>vf,finalizeIssue:()=>be,floatSafeRemainder:()=>ao,getElementAtPath:()=>hf,getEnumValues:()=>lt,getLengthableOrigin:()=>Bt,getParsedType:()=>xf,getSizableOrigin:()=>Ci,hexToUint8Array:()=>Cf,hide:()=>Lr,installLazyProp:()=>jf,isObject:()=>Xe,isPlainObject:()=>qe,issue:()=>mt,joinValues:()=>Ar,jsonStringifyReplacer:()=>pt,members:()=>go,merge:()=>kf,mergeDefs:()=>Ee,normalizeParams:()=>S,nullish:()=>io,numKeys:()=>yf,objectClone:()=>df,omit:()=>bf,optionalKeys:()=>fo,own:()=>Ue,parsedType:()=>ho,partial:()=>$f,pick:()=>zf,prefixIssues:()=>Ce,primitiveTypes:()=>Ei,promiseAllObject:()=>gf,propertyKeyTypes:()=>po,randomString:()=>_f,rawShape:()=>ft,required:()=>Pf,safeExtend:()=>Sf,shallowClone:()=>Ri,sizeCaps:()=>Dr,slugify:()=>uo,stringifyPrimitive:()=>Nr,toZod:()=>ki,uint8ArrayToBase64:()=>Ai,uint8ArrayToBase64url:()=>Of,uint8ArrayToHex:()=>If,unwrapMessage:()=>ut});function af(e){return e}function cf(e){return e}function ki(){return e=>e}function uf(e){}function lf(e){throw new Error("Unexpected value in exhaustive check")}function pf(e){}function lt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ar(e,t="|"){return e.map(r=>Nr(r)).join(t)}function pt(e,t){return typeof t=="bigint"?t.toString():t}var oo=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function dt(e){return new oo(e)}function io(e){return e==null}function Ut(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ao(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Si=Symbol("evaluating");function $i(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Si)return n===void 0&&(n=Si,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function df(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function fe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ft(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Re(e){return ft(e._zod.def)??e._zod.def.shape}function Pi(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return fe(this,t,n),n},enumerable:!0,configurable:!0})}function Ti(e,t,r){t in e?fe(e,t,r):e[t]=r}function Ge(e,t,r,n){let o=Re(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Pi(e,s,()=>{let a=t._zod.def.shape[s];return n?n(a,s):a}):Ti(e,s,n?n(i.value,s):i.value))}}function ff(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Pi(e,r,()=>t[r]):Ti(e,r,n.value))}}function Ee(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function mf(e){return Ee(e._zod.def)}function hf(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function gf(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function _f(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function co(e){return JSON.stringify(e)}function uo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Zr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var lo=dt(()=>{if(ue.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function qe(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ri(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yf(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var xf=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":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},po=new Set(["string","number","symbol"]),Ei=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wf(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Nr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fo(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Mr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Ge(s,e,jr(e,t)),ge(e,Ee(r,{shape:s,checks:[]}))}function jr(e,t){let r=Re(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function bf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(jr(e,t)),i={};return Ge(i,e,Reflect.ownKeys(Re(e)).filter(a=>!s.has(a))),ge(e,Ee(r,{shape:i,checks:[]}))}function vf(e,t){if(!qe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Re(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function Oi(e,t){let r={};return Ge(r,e,Reflect.ownKeys(Re(e))),ff(r,t),r}function Sf(e,t){if(!qe(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function kf(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Ge(r,e,Reflect.ownKeys(Re(e))),Ge(r,t,Reflect.ownKeys(Re(t)));let n=Ee(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,n)}function $f(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(jr(t,r)):void 0,c={};return Ge(c,t,Reflect.ownKeys(Re(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ge(t,Ee(t._zod.def,{shape:c,checks:[]}))}function Pf(e,t,r){let n=r?new Set(jr(t,r)):void 0,o={};return Ge(o,t,Reflect.ownKeys(Re(t)),(s,i)=>n&&!n.has(i)?s:new e({type:"nonoptional",innerType:s})),ge(t,Ee(t._zod.def,{shape:o}))}function ze(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ut(e){return typeof e=="string"?e:e?.message}function Dr(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Ft(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function be(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.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:ut(e.inst?._zod.def?.error?.(e))??ut(s?.(e))??ut(t?.error?.(e))??ut(r.customError?.(e))??ut(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function Ci(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Tf=/[\uD800-\uDBFF]/;function Vt(e){let t=e.length;if(!Tf.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Bt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ho(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function mt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Rf(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ii(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Ai(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ef(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ii(t+r)}function Of(e){return Ai(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function If(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var so=class{constructor(...t){}};function go(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Zf(e,r,n.value)}}function Ue(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Lr(e,t,r){return Ue(e,t,r,!1)}function Af(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ue(this,r,n(this))},set(o){Ue(this,r,o)}})}return t}function Zf(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ue(this,t,r.bind(this))},set(n){Ue(this,t,n)}})}function Nf(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var no,Le=!1,Mf={configurable:!0,get(){Le=!0}};function I(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&no!==e._zod){no=void 0;return}no=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Mf);let o=Le;Le=!1;try{let s=r(this);return Le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),Le=Le||o,s}catch(s){throw delete this[t],Le=Le||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function jf(e,t,r,n){let o=Nf(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var Zi="~constantCatch";function Ni(e){let t=()=>e;return t[Zi]=!0,t}var Mi,yo=Object.freeze({status:"aborted"}),_o={value:void 0,enumerable:!1},ji="captureStackTrace"in Error?Error:null;function Df(e){let t=ji;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return ji=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function g(e,t,r,n){let o={};function s(f){this.def=f,this.constr=d,this.traits=new Set}s.prototype=o;let i=r,a=i&&new WeakSet;function c(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{_o.value=new s(m);try{Object.defineProperty(f,"_zod",_o)}finally{_o.value=void 0}}if(f._zod.traits.add(e),t(f,m),a){let _=Object.getPrototypeOf(f),x=f._zod.constr.prototype,$=_;for(;$&&$!==x;)$=Object.getPrototypeOf($);let R=$??_;a.has(R)||(a.add(R),go(R,i))}let h=d.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in f||(f[_]=h[_].bind(f)))}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=n?.Parent?Df(l):this;c(m,f);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(m),m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ht=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mi=globalThis).__zod_globalConfig??(Mi.__zod_globalConfig={});var ue=globalThis.__zod_globalConfig;function le(e){return e&&Object.assign(ue,e),ue}function Lf(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pt,2)),e.message}function Uf(e){this._zod.message=e}var qf={get:Lf,set:Uf,enumerable:!0,configurable:!0},wo={value:void 0,enumerable:!1},Di=new WeakSet([Object.prototype,Error.prototype]),Li=(e,t)=>{e.name="$ZodError",wo.value=t,Object.defineProperty(e,"issues",wo),wo.value=void 0,Object.defineProperty(e,"message",qf);let r=Object.getPrototypeOf(e);Di.has(r)||(Di.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Ui=g("$ZodError",Li),qi=g("$ZodError",Li,void 0,{Parent:Error});function Ff(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function zo(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Ff(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function bo(e,t=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(i)),c=f,u++}}}};return n(e),r}function Ur(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qr=e=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ve;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Fr=e=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Ht=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ve;return s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}},vo=Ht(qi);function Fi(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>be(o,r,le()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var Vr=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}};var Bf=Symbol.for("zod.compile.invalid"),Hf=Symbol.for("zod.compile.fallback"),Br=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Bf)return!0;if(n.definite===!0&&r===void 0)return!1}return Jf(e,t,r)});function Jf(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,s;if(o?(n[Hf]=!0,s=o({value:t,issues:[]},n)):s=e._zod.run({value:t,issues:[]},n),s instanceof Promise)throw new ve;return s.issues.length===0}var Hr=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Vi=e=>{let t=qr(e),r=(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ur(r,i))};return r};var Bi=e=>{let t=qr(e),r=(n,o,s,i)=>t(n,o,s,Ur(r,i));return r};var Hi=e=>{let t=Fr(e),r=async(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ur(r,i))};return r};var Ji=e=>{let t=Fr(e),r=async(n,o,s,i)=>await t(n,o,s,Ur(r,i));return r};var Wi=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ht(e)(t,r,o)};var Ki=e=>(t,r,n)=>Ht(e)(t,r,n);var Gi=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Vr(e)(t,r,o)};var Xi=e=>async(t,r,n)=>Vr(e)(t,r,n);var Yi=/^[cC][0-9a-z]{6,}$/,Qi=/^[0-9a-z]+$/,ea=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ta=/^[0-9a-vA-V]{20}$/,ra=/^[A-Za-z0-9]{27}$/,na=/^[a-zA-Z0-9_-]{21}$/;function oa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var sa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ia=/^([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})$/,ko=e=>e?new 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)$/;var aa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wf="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ca(){return new RegExp(Wf,"u")}var ua=/^(?:(?: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])$/,la=/^(([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}|:))$/;var pa=/^((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])$/,da=/^(([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])$/,fa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ma=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var ha=/^https?$/,ga=/^\+[1-9]\d{6,14}$/;var _a="(?:(?:\\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])))";function Kf(e){return new RegExp(`^${e}$`)}var ya=Kf(_a);function So(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xa(e){return new RegExp(`^${So(e)}$`)}function wa(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${So({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${So({precision:e.precision})}`:r;return new RegExp(`^${_a}T(?:${n})$`)}var za=/^[\s\S]{0,}$/;var ba=/^-?\d+n?$/,$o=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,va=/^(?:true|false)$/i,Sa=/^null$/i;var ka=/^[^A-Z]*$/,$a=/^[^a-z]*$/;var Q=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Po=e=>{let t=e.value;return!io(t)&&t.length!==void 0},Jr={number:"number",bigint:"bigint",object:"date"},To=g("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ro=g("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=g("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ao(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ta=g("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=qt[t.format];e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,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}):i.issues.push({input:a,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});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ra=g("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Vt(o):s)<=t.maximum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ea=g("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Vt(o):s)>=t.minimum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oa=g("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Vt(o):s;if(i===t.length)return;let a=Bt(o),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wt=g("$ZodCheckStringFormat",(e,t)=>{var r,n;Q.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ca=g("$ZodCheckRegex",(e,t)=>{Wt.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})}}),Ia=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ka),Wt.init(e,t)}),Aa=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$a),Wt.init(e,t)}),Za=g("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Oe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Na=g("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Oe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ma=g("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Oe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var ja=g("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Wr=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
7
+ import{Q as wi,R as zi,Z as rf,_ as nf,c as Te,da as eo,ea as to,ia as Cr,ka as xe,qa as we,ra as bi}from"./X22IMAJK.js";import"./6RTITFQA.js";import{a as De,c as ce,d as Qn,e as Or}from"./RFWIIJFG.js";var ud=ce((r$,cd)=>{cd.exports=ad;ad.sync=H_;var sd=De("fs");function B_(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function id(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:B_(t,r)}function ad(e,t,r){sd.stat(e,function(n,o){r(n,n?!1:id(o,e,t))})}function H_(e,t){return id(sd.statSync(e),e,t)}});var md=ce((n$,fd)=>{fd.exports=pd;pd.sync=J_;var ld=De("fs");function pd(e,t,r){ld.stat(e,function(n,o){r(n,n?!1:dd(o,t))})}function J_(e,t){return dd(ld.statSync(e),t)}function dd(e,t){return e.isFile()&&W_(e,t)}function W_(e,t){var r=e.mode,n=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&o===i||r&a&&n===s||r&l&&s===0;return d}});var gd=ce((s$,hd)=>{var o$=De("fs"),Jn;process.platform==="win32"||global.TESTING_WINDOWS?Jn=ud():Jn=md();hd.exports=ai;ai.sync=K_;function ai(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){ai(e,t||{},function(s,i){s?o(s):n(i)})})}Jn(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function K_(e,t){try{return Jn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vd=ce((i$,bd)=>{var Nt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_d=De("path"),G_=Nt?";":":",yd=gd(),xd=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wd=(e,t)=>{let r=t.colon||G_,n=e.match(/\//)||Nt&&e.match(/\\/)?[""]:[...Nt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Nt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Nt?o.split(r):[""];return Nt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},zd=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:s}=wd(e,t),i=[],a=u=>new Promise((l,d)=>{if(u===n.length)return t.all&&i.length?l(i):d(xd(e));let f=n[u],m=/^".*"$/.test(f)?f.slice(1,-1):f,h=_d.join(m,e),_=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;l(c(_,u,0))}),c=(u,l,d)=>new Promise((f,m)=>{if(d===o.length)return f(a(l+1));let h=o[d];yd(u+h,{pathExt:s},(_,x)=>{if(!_&&x)if(t.all)i.push(u+h);else return f(u+h);return f(c(u,l,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},X_=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=wd(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=_d.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<n.length;d++){let f=l+n[d];try{if(yd.sync(f,{pathExt:o}))if(t.all)s.push(f);else return f}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw xd(e)};bd.exports=zd;zd.sync=X_});var kd=ce((a$,ci)=>{"use strict";var Sd=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ci.exports=Sd;ci.exports.default=Sd});var Rd=ce((c$,Td)=>{"use strict";var $d=De("path"),Y_=vd(),Q_=kd();function Pd(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Y_.sync(e.command,{path:r[Q_({env:r})],pathExt:t?$d.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=$d.resolve(o?e.options.cwd:"",i)),i}function ey(e){return Pd(e)||Pd(e,!0)}Td.exports=ey});var Ed=ce((u$,li)=>{"use strict";var ui=/([()\][%!^"`<>&|;, *?])/g;function ty(e){return e=e.replace(ui,"^$1"),e}function ry(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ui,"^$1"),t&&(e=e.replace(ui,"^$1")),e}li.exports.command=ty;li.exports.argument=ry});var Cd=ce((l$,Od)=>{"use strict";Od.exports=/^#!(.*)/});var Ad=ce((p$,Id)=>{"use strict";var ny=Cd();Id.exports=(e="")=>{let t=e.match(ny);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Nd=ce((d$,Zd)=>{"use strict";var pi=De("fs"),oy=Ad();function sy(e){let r=Buffer.alloc(150),n;try{n=pi.openSync(e,"r"),pi.readSync(n,r,0,150,0),pi.closeSync(n)}catch{}return oy(r.toString())}Zd.exports=sy});var Ld=ce((f$,Dd)=>{"use strict";var iy=De("path"),Md=Rd(),jd=Ed(),ay=Nd(),cy=process.platform==="win32",uy=/\.(?:com|exe)$/i,ly=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function py(e){e.file=Md(e);let t=e.file&&ay(e.file);return t?(e.args.unshift(e.file),e.command=t,Md(e)):e.file}function dy(e){if(!cy)return e;let t=py(e),r=!uy.test(t);if(e.options.forceShell||r){let n=ly.test(t);e.command=iy.normalize(e.command),e.command=jd.command(e.command),e.args=e.args.map(s=>jd.argument(s,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function fy(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:dy(n)}Dd.exports=fy});var Fd=ce((m$,qd)=>{"use strict";var di=process.platform==="win32";function fi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function my(e,t){if(!di)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let s=Ud(o,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function Ud(e,t){return di&&e===1&&!t.file?fi(t.original,"spawn"):null}function hy(e,t){return di&&e===1&&!t.file?fi(t.original,"spawnSync"):null}qd.exports={hookChildProcess:my,verifyENOENT:Ud,verifyENOENTSync:hy,notFoundError:fi}});var Hd=ce((h$,Mt)=>{"use strict";var Vd=De("child_process"),mi=Ld(),hi=Fd();function Bd(e,t,r){let n=mi(e,t,r),o=Vd.spawn(n.command,n.args,n.options);return hi.hookChildProcess(o,n),o}function gy(e,t,r){let n=mi(e,t,r),o=Vd.spawnSync(n.command,n.args,n.options);return o.error=o.error||hi.verifyENOENTSync(o.status,n),o}Mt.exports=Bd;Mt.exports.spawn=Bd;Mt.exports.sync=gy;Mt.exports._parse=mi;Mt.exports._enoent=hi});var Yd=ce(_i=>{"use strict";var Kd=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,by=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Gd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,vy=/\\([\u000b\u0020-\u00ff])/g,Sy=/([\\"])/g,Xd=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;_i.format=ky;_i.parse=$y;function ky(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Xd.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var o,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(o=s[i],!Gd.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Ty(t[o])}return n}function $y(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Py(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!Xd.test(n))throw new TypeError("invalid media type");var o=new Ry(n.toLowerCase());if(r!==-1){var s,i,a;for(Kd.lastIndex=r;i=Kd.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(vy,"$1"))),o.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return o}function Py(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function Ty(e){var t=String(e);if(Gd.test(t))return t;if(t.length>0&&!by.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(Sy,"\\$1")+'"'}function Ry(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as Zy,mkdirSync as Ny,readFileSync as My,writeFileSync as jy}from"node:fs";import{dirname as Dy}from"node:path";import{isDeepStrictEqual as Lt}from"node:util";function Dt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])Te(r)&&t.set(r.name,r);return t}function Ir(e,t,r){let n=Dt(t);return e.map(o=>{let s=n.get(o.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...o,...i}})}function of(e,t){let r=Dt(t);return Ir(e,t,["tags","security"]).map(n=>{if(!n.arguments)return n;let o=r.get(n.name)?.arguments;return{...n,arguments:Ir(n.arguments,o,["example"])}})}function ro(e,t,r){let n=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},o=Te(n["x-mcp"])?n["x-mcp"]:{},s={...o};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>Te(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=Ir(t.tools,o.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=of(t.prompts,o.prompts):delete s.prompts,t.capabilities?.resources?s.resources=Ir(t.resources,o.resources,["tags","security"]):delete s.resources,n["x-mcp"]=s,n}function sf(e,t){let r=Dt(e),n=Dt(t),o=[...n.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!n.has(c)),i=[...n.keys()].filter(c=>r.has(c)&&!Lt(r.get(c),n.get(c))),a=[];return o.length>0&&a.push(`added: ${o.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function vi(e,t){if(Lt(e,t))return[];let r=Te(e["x-mcp"])?e["x-mcp"]:{},n=Te(t["x-mcp"])?t["x-mcp"]:{},o=[];for(let s of["tools","prompts","resources"]){let i=sf(r[s],n[s]);i&&o.push(`${s} - ${i}`)}return Lt(r.protocolVersion,n.protocolVersion)||o.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${n.protocolVersion}`),Lt(r.capabilities,n.capabilities)||o.push("capabilities changed"),Lt(r.servers,n.servers)||o.push("servers - the MCP server URL is not listed"),o.length===0&&o.push("x-mcp changed"),o}var P={};Qn(P,{BIGINT_FORMAT_RANGES:()=>Mr,CONSTANT_CATCH:()=>Zi,Class:()=>so,NUMBER_FORMAT_RANGES:()=>qt,aborted:()=>ze,allowsEval:()=>lo,assert:()=>pf,assertEqual:()=>af,assertIs:()=>uf,assertNever:()=>lf,assertNotEqual:()=>cf,assignProp:()=>fe,attachSchema:()=>Ft,base64ToUint8Array:()=>Ii,base64urlToUint8Array:()=>Ef,cached:()=>dt,captureStackTrace:()=>Zr,cleanEnum:()=>Rf,cleanRegex:()=>Ut,clone:()=>ge,cloneDef:()=>mf,codePointLength:()=>Vt,constantCatch:()=>Ni,createTransparentProxy:()=>wf,defineLazy:()=>$i,defineLazyInternal:()=>I,derived:()=>Af,esc:()=>co,escapeRegex:()=>Oe,explicitlyAborted:()=>mo,extend:()=>vf,finalizeIssue:()=>be,floatSafeRemainder:()=>ao,getElementAtPath:()=>hf,getEnumValues:()=>lt,getLengthableOrigin:()=>Bt,getParsedType:()=>xf,getSizableOrigin:()=>Ci,hexToUint8Array:()=>Cf,hide:()=>Lr,installLazyProp:()=>jf,isObject:()=>Xe,isPlainObject:()=>qe,issue:()=>mt,joinValues:()=>Ar,jsonStringifyReplacer:()=>pt,members:()=>go,merge:()=>kf,mergeDefs:()=>Ee,normalizeParams:()=>S,nullish:()=>io,numKeys:()=>yf,objectClone:()=>df,omit:()=>bf,optionalKeys:()=>fo,own:()=>Ue,parsedType:()=>ho,partial:()=>$f,pick:()=>zf,prefixIssues:()=>Ce,primitiveTypes:()=>Ei,promiseAllObject:()=>gf,propertyKeyTypes:()=>po,randomString:()=>_f,rawShape:()=>ft,required:()=>Pf,safeExtend:()=>Sf,shallowClone:()=>Ri,sizeCaps:()=>Dr,slugify:()=>uo,stringifyPrimitive:()=>Nr,toZod:()=>ki,uint8ArrayToBase64:()=>Ai,uint8ArrayToBase64url:()=>Of,uint8ArrayToHex:()=>If,unwrapMessage:()=>ut});function af(e){return e}function cf(e){return e}function ki(){return e=>e}function uf(e){}function lf(e){throw new Error("Unexpected value in exhaustive check")}function pf(e){}function lt(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ar(e,t="|"){return e.map(r=>Nr(r)).join(t)}function pt(e,t){return typeof t=="bigint"?t.toString():t}var oo=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function dt(e){return new oo(e)}function io(e){return e==null}function Ut(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ao(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Si=Symbol("evaluating");function $i(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Si)return n===void 0&&(n=Si,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function df(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function fe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ft(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Re(e){return ft(e._zod.def)??e._zod.def.shape}function Pi(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return fe(this,t,n),n},enumerable:!0,configurable:!0})}function Ti(e,t,r){t in e?fe(e,t,r):e[t]=r}function Ge(e,t,r,n){let o=Re(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Pi(e,s,()=>{let a=t._zod.def.shape[s];return n?n(a,s):a}):Ti(e,s,n?n(i.value,s):i.value))}}function ff(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Pi(e,r,()=>t[r]):Ti(e,r,n.value))}}function Ee(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function mf(e){return Ee(e._zod.def)}function hf(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function gf(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function _f(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function co(e){return JSON.stringify(e)}function uo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Zr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var lo=dt(()=>{if(ue.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function qe(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ri(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yf(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var xf=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":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},po=new Set(["string","number","symbol"]),Ei=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wf(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Nr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fo(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Mr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Ge(s,e,jr(e,t)),ge(e,Ee(r,{shape:s,checks:[]}))}function jr(e,t){let r=Re(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function bf(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(jr(e,t)),i={};return Ge(i,e,Reflect.ownKeys(Re(e)).filter(a=>!s.has(a))),ge(e,Ee(r,{shape:i,checks:[]}))}function vf(e,t){if(!qe(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Re(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function Oi(e,t){let r={};return Ge(r,e,Reflect.ownKeys(Re(e))),ff(r,t),r}function Sf(e,t){if(!qe(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,Ee(e._zod.def,{shape:Oi(e,t)}))}function kf(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Ge(r,e,Reflect.ownKeys(Re(e))),Ge(r,t,Reflect.ownKeys(Re(t)));let n=Ee(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,n)}function $f(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(jr(t,r)):void 0,c={};return Ge(c,t,Reflect.ownKeys(Re(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ge(t,Ee(t._zod.def,{shape:c,checks:[]}))}function Pf(e,t,r){let n=r?new Set(jr(t,r)):void 0,o={};return Ge(o,t,Reflect.ownKeys(Re(t)),(s,i)=>n&&!n.has(i)?s:new e({type:"nonoptional",innerType:s})),ge(t,Ee(t._zod.def,{shape:o}))}function ze(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function mo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ut(e){return typeof e=="string"?e:e?.message}function Dr(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Ft(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function be(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.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:ut(e.inst?._zod.def?.error?.(e))??ut(s?.(e))??ut(t?.error?.(e))??ut(r.customError?.(e))??ut(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function Ci(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Tf=/[\uD800-\uDBFF]/;function Vt(e){let t=e.length;if(!Tf.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Bt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ho(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function mt(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Rf(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ii(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Ai(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ef(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ii(t+r)}function Of(e){return Ai(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Cf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function If(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var so=class{constructor(...t){}};function go(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Zf(e,r,n.value)}}function Ue(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Lr(e,t,r){return Ue(e,t,r,!1)}function Af(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ue(this,r,n(this))},set(o){Ue(this,r,o)}})}return t}function Zf(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ue(this,t,r.bind(this))},set(n){Ue(this,t,n)}})}function Nf(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var no,Le=!1,Mf={configurable:!0,get(){Le=!0}};function I(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&no!==e._zod){no=void 0;return}no=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Mf);let o=Le;Le=!1;try{let s=r(this);return Le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),Le=Le||o,s}catch(s){throw delete this[t],Le=Le||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function jf(e,t,r,n){let o=Nf(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var Zi="~constantCatch";function Ni(e){let t=()=>e;return t[Zi]=!0,t}var Mi,yo=Object.freeze({status:"aborted"}),_o={value:void 0,enumerable:!1},ji="captureStackTrace"in Error?Error:null;function Df(e){let t=ji;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return ji=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function g(e,t,r,n){let o={};function s(f){this.def=f,this.constr=d,this.traits=new Set}s.prototype=o;let i=r,a=i&&new WeakSet;function c(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{_o.value=new s(m);try{Object.defineProperty(f,"_zod",_o)}finally{_o.value=void 0}}if(f._zod.traits.add(e),t(f,m),a){let _=Object.getPrototypeOf(f),x=f._zod.constr.prototype,$=_;for(;$&&$!==x;)$=Object.getPrototypeOf($);let R=$??_;a.has(R)||(a.add(R),go(R,i))}let h=d.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in f||(f[_]=h[_].bind(f)))}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let m=n?.Parent?Df(l):this;c(m,f);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(m),m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ht=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mi=globalThis).__zod_globalConfig??(Mi.__zod_globalConfig={});var ue=globalThis.__zod_globalConfig;function le(e){return e&&Object.assign(ue,e),ue}function Lf(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pt,2)),e.message}function Uf(e){this._zod.message=e}var qf={get:Lf,set:Uf,enumerable:!0,configurable:!0},wo={value:void 0,enumerable:!1},Di=new WeakSet([Object.prototype,Error.prototype]),Li=(e,t)=>{e.name="$ZodError",wo.value=t,Object.defineProperty(e,"issues",wo),wo.value=void 0,Object.defineProperty(e,"message",qf);let r=Object.getPrototypeOf(e);Di.has(r)||(Di.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Ui=g("$ZodError",Li),qi=g("$ZodError",Li,void 0,{Parent:Error});function Ff(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function zo(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Ff(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function bo(e,t=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(i)),c=f,u++}}}};return n(e),r}function Ur(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qr=e=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ve;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Fr=e=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>be(u,i,le())));throw Zr(c,s?.callee??t),c}return a.value};return t};var Ht=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ve;return s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}},vo=Ht(qi);function Fi(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>be(o,r,le()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var Vr=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Fi(e,s.issues,o):{success:!0,data:s.value}};var Bf=Symbol.for("zod.compile.invalid"),Hf=Symbol.for("zod.compile.fallback"),Br=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Bf)return!0;if(n.definite===!0&&r===void 0)return!1}return Jf(e,t,r)});function Jf(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,s;if(o?(n[Hf]=!0,s=o({value:t,issues:[]},n)):s=e._zod.run({value:t,issues:[]},n),s instanceof Promise)throw new ve;return s.issues.length===0}var Hr=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Vi=e=>{let t=qr(e),r=(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,a,Ur(r,i))};return r};var Bi=e=>{let t=qr(e),r=(n,o,s,i)=>t(n,o,s,Ur(r,i));return r};var Hi=e=>{let t=Fr(e),r=async(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Ur(r,i))};return r};var Ji=e=>{let t=Fr(e),r=async(n,o,s,i)=>await t(n,o,s,Ur(r,i));return r};var Wi=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ht(e)(t,r,o)};var Ki=e=>(t,r,n)=>Ht(e)(t,r,n);var Gi=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Vr(e)(t,r,o)};var Xi=e=>async(t,r,n)=>Vr(e)(t,r,n);var Yi=/^[cC][0-9a-z]{6,}$/,Qi=/^[0-9a-z]+$/,ea=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ta=/^[0-9a-vA-V]{20}$/,ra=/^[A-Za-z0-9]{27}$/,na=/^[a-zA-Z0-9_-]{21}$/;function oa(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var sa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ia=/^([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})$/,ko=e=>e?new 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)$/;var aa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wf="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ca(){return new RegExp(Wf,"u")}var ua=/^(?:(?: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])$/,la=/^(([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}|:))$/;var pa=/^((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])$/,da=/^(([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])$/,fa=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ma=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var ha=/^https?$/,ga=/^\+[1-9]\d{6,14}$/;var _a="(?:(?:\\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])))";function Kf(e){return new RegExp(`^${e}$`)}var ya=Kf(_a);function So(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xa(e){return new RegExp(`^${So(e)}$`)}function wa(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${So({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${So({precision:e.precision})}`:r;return new RegExp(`^${_a}T(?:${n})$`)}var za=/^[\s\S]{0,}$/;var ba=/^-?\d+n?$/,$o=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,va=/^(?:true|false)$/i,Sa=/^null$/i;var ka=/^[^A-Z]*$/,$a=/^[^a-z]*$/;var Q=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Po=e=>{let t=e.value;return!io(t)&&t.length!==void 0},Jr={number:"number",bigint:"bigint",object:"date"},To=g("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ro=g("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=Jr[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:Jr[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=g("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ao(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ta=g("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=qt[t.format];e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,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}):i.issues.push({input:a,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});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ra=g("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Vt(o):s)<=t.maximum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ea=g("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Vt(o):s)>=t.minimum)return;let a=Bt(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Oa=g("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=Po),e._zod.check=n=>{let o=n.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Vt(o):s;if(i===t.length)return;let a=Bt(o),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wt=g("$ZodCheckStringFormat",(e,t)=>{var r,n;Q.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ca=g("$ZodCheckRegex",(e,t)=>{Wt.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})}}),Ia=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ka),Wt.init(e,t)}),Aa=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$a),Wt.init(e,t)}),Za=g("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Oe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Na=g("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Oe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ma=g("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Oe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var ja=g("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Wr=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
8
8
  `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
9
9
  ${r.join(`
10
10
  `)}
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{f as k}from"./QQ2PGWE6.js";import{a as x,e as P,f as v,i as H,j as C,k as p,l as M}from"./4AXMK6B2.js";import{n as N,o as B}from"./D3C6XIMY.js";function y(e){let t=new Map(e.pathParams.map(r=>[r.name,r])),n=[];for(let r of e.path.matchAll(/\{([^{}]+)\}/g)){let s=t.get(r[1]);s!==void 0&&n.push(s)}return n}function I(e){let t=y(e),n=e.queryParams.length>0,r=!!e.requestBody,s=e.headerParams.length>0,o=e.cookieParams.length>0;return{hasQuery:n,hasBody:r,hasHeaders:s,hasCookies:o,hasInputs:t.length>0||n||r||s||o,varsRequired:t.length>0||e.queryParams.some(a=>a.required)||(e.requestBody?.required??!1)||e.headerParams.some(a=>a.required)||e.cookieParams.some(a=>a.required),variablesTypeName:`${p(e.name)}Variables`}}var E=" ";function $(e,t,n){let r=C(e,t);return r===void 0?[]:[`${n}/**`,...H(r).split(`
7
+ import{f as k}from"./BZTZIEWS.js";import{a as x,e as P,f as v,i as H,j as C,k as p,l as M}from"./ZXB5O6JQ.js";import{n as N,o as B}from"./A65OW7M7.js";function y(e){let t=new Map(e.pathParams.map(r=>[r.name,r])),n=[];for(let r of e.path.matchAll(/\{([^{}]+)\}/g)){let s=t.get(r[1]);s!==void 0&&n.push(s)}return n}function I(e){let t=y(e),n=e.queryParams.length>0,r=!!e.requestBody,s=e.headerParams.length>0,o=e.cookieParams.length>0;return{hasQuery:n,hasBody:r,hasHeaders:s,hasCookies:o,hasInputs:t.length>0||n||r||s||o,varsRequired:t.length>0||e.queryParams.some(a=>a.required)||(e.requestBody?.required??!1)||e.headerParams.some(a=>a.required)||e.cookieParams.some(a=>a.required),variablesTypeName:`${p(e.name)}Variables`}}var E=" ";function $(e,t,n){let r=C(e,t);return r===void 0?[]:[`${n}/**`,...H(r).split(`
8
8
  `).map(s=>`${n} * ${s}`.replace(/ +$/,"")),`${n} */`]}function O(e){return typeof e=="string"?JSON.stringify(e):String(e)}function F(e,t,n){switch(e){case"string":return t?.format==="binary"?"Blob":n==="Date"&&(t?.format==="date-time"||t?.format==="date")?"Date":"string";case"number":case"integer":return"number";case"boolean":return"boolean"}}function j(e){return e.kind==="union"||e.kind==="intersection"||e.kind==="enum"&&e.values.length>1}function c(e,t="string",n=""){switch(e.kind){case"scalar":return F(e.scalar,e.metadata,t);case"ref":return e.name;case"literal":return O(e.value);case"enum":return e.values.map(O).join(" | ");case"null":return"null";case"unknown":return"unknown";case"array":{let r=c(e.items,t,n);return j(e.items)?`(${r})[]`:`${r}[]`}case"record":return`Record<string, ${c(e.value,t,n)}>`;case"object":{if(e.properties.length===0)return"{}";let r=n+E;return`{
9
9
  ${e.properties.flatMap(o=>K(o,t,r)).join(`
10
10
  `)}
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as F}from"./IHUHQ7PO.js";import{a as b,d as A,e as E,g as O,t as B,u as h}from"./TVUYXOSQ.js";import{f as I}from"./GKPSJEG5.js";import{ba as v,ca as j,da as u,fa as c,ga as d,ka as a,l,qa as m}from"./4ZCKAKVF.js";var y=class extends Error{};async function Z({argv:t,version:e}){let n=performance.now(),o=new F,{organization:s,project:p,pushId:w,wait:g}=t,U=t.domain||O(),S=t["continue-on-deploy-failures"]||!1,M=t["start-time"]||Date.now(),R=[],f={organization:s,project:p};try{let $=E(),P={domain:U,apiKey:$,...f,pushId:w,version:e,onSunsetWarning:i=>R.push(i),onSlugDeprecated:i=>{K(i),f={organization:i.organizationId,project:i.projectId}}},D={...P,maxExecutionTime:t["max-execution-time"],retryIntervalMs:t["retry-interval"]?t["retry-interval"]*1e3:void 0,startTime:M},x=i=>T=>{let{status:C,url:N}=T.status[i].deploy;o.start(L({status:C,url:N,buildType:i,wait:g}))},r=g?await h({...D,buildType:"preview",onRetry:x("preview")}):await B(P);return W({buildType:"preview",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.preview.scorecard),g&&r.isMainBranch&&r.status.preview.deploy.status==="success"&&(r=await h({...D,...f,buildType:"production",onRetry:x("production")})),r.isMainBranch&&(W({buildType:"production",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.production.scorecard)),V({organization:s,project:p,pushId:w,startedAt:n}),{preview:r.status.preview,production:r.isMainBranch?r.status.production:null,commit:r.commit}}catch($){o.stop(),k("\u2717 Failed to get push status.",$)}finally{o.stop(),H("push-status",R)}}function k(t,e){throw e instanceof y?new m(e.message):e instanceof b?new m(`${t} Reason: ${e.message} (status: ${e.status})
7
+ import{a as F}from"./MAACTVYP.js";import{a as b,d as A,e as E,g as O,t as B,u as h}from"./FLQQ3VRQ.js";import{f as I}from"./YA5KTHFN.js";import{ba as v,ca as j,da as u,fa as c,ga as d,ka as a,l,qa as m}from"./X22IMAJK.js";var y=class extends Error{};async function Z({argv:t,version:e}){let n=performance.now(),o=new F,{organization:s,project:p,pushId:w,wait:g}=t,U=t.domain||O(),S=t["continue-on-deploy-failures"]||!1,M=t["start-time"]||Date.now(),R=[],f={organization:s,project:p};try{let $=E(),P={domain:U,apiKey:$,...f,pushId:w,version:e,onSunsetWarning:i=>R.push(i),onSlugDeprecated:i=>{K(i),f={organization:i.organizationId,project:i.projectId}}},D={...P,maxExecutionTime:t["max-execution-time"],retryIntervalMs:t["retry-interval"]?t["retry-interval"]*1e3:void 0,startTime:M},x=i=>T=>{let{status:C,url:N}=T.status[i].deploy;o.start(L({status:C,url:N,buildType:i,wait:g}))},r=g?await h({...D,buildType:"preview",onRetry:x("preview")}):await B(P);return W({buildType:"preview",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.preview.scorecard),g&&r.isMainBranch&&r.status.preview.deploy.status==="success"&&(r=await h({...D,...f,buildType:"production",onRetry:x("production")})),r.isMainBranch&&(W({buildType:"production",spinner:o,push:r,continueOnDeployFailures:S}),z(r.status.production.scorecard)),V({organization:s,project:p,pushId:w,startedAt:n}),{preview:r.status.preview,production:r.isMainBranch?r.status.production:null,commit:r.commit}}catch($){o.stop(),k("\u2717 Failed to get push status.",$)}finally{o.stop(),H("push-status",R)}}function k(t,e){throw e instanceof y?new m(e.message):e instanceof b?new m(`${t} Reason: ${e.message} (status: ${e.status})
8
8
  `):new m(`${t} Reason: ${e.message}
9
9
  `)}function K({organizationId:t,projectId:e}){a.warn(`Organization and project slugs are deprecated. Use the ids instead: --organization ${t} --project ${e}
10
10
  `)}function H(t,e){let n=A(e);if(!n)return;let o='Update to the latest version by running "npm install @redocly/cli@latest".';n.isSunsetExpired?a.error(`The "${t}" command is not compatible with your version of Redocly CLI. ${o}
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as xe,f as Pe}from"./GKPSJEG5.js";import{$ as b,A as ue,X as le,Y as he,ba as fe,c as L,ca as de,da as j,f as ie,fa as ye,ga as U,ha as A,ka as k,la as Se,ma as ge,na as Q,oa as K,p as ae,q as pe,qa as Ce,r as ce,ta as be,v as me}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as mt}from"perf_hooks";var D={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Oe=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function B(e){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),t=Math.floor(r.length/2);return r.length%2!==0?r[t]:(r[t-1]+r[t])/2}function He(e,r,t=D){let{thresholds:o,weights:n}=t,s=x(1-e.parameterCount/(o.maxParamsGood*2)),a=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth)/(o.maxDepthGood*2),c=De(e,n.anyOfPenaltyMultiplier)/(o.maxPolymorphismGood*3),h=x(1-a-c),u=(e.operationDescriptionPresent?1:0)+e.paramsWithDescription+e.schemaPropertiesWithDescription,f=1+e.parameterCount+e.totalSchemaProperties,$=f>0?x(u/f):1,O=e.totalSchemaProperties>0?x(e.constraintCount/e.totalSchemaProperties):1,y=(e.requestExamplePresent?1:0)+(e.responseExamplePresent?1:0),g=(e.requestBodyPresent?1:0)+1,M=x(y/g),T=e.totalErrorResponses>0?x(e.structuredErrorResponseCount/e.totalErrorResponses):1,I=x(1-r/(o.maxDependencyDepthGood*2)),l=x(1-e.ambiguousIdentifierCount/Math.max(o.maxAmbiguousGood+3,1)),m=De(e,n.anyOfPenaltyMultiplier),d=m===0?1:e.hasDiscriminator?x(1-m/(o.maxPolymorphismGood*4)):x(1-m/(o.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:h,documentationQuality:$,constraintClarity:O,exampleCoverage:M,errorClarity:T,dependencyClarity:I,identifierClarity:l,polymorphismClarity:d}}function ze(e,r=D){let t=r.weights,o=e.parameterSimplicity*t.parameterSimplicity+e.schemaSimplicity*t.schemaSimplicity+e.documentationQuality*t.documentationQuality+e.constraintClarity*t.constraintClarity+e.exampleCoverage*t.exampleCoverage+e.errorClarity*t.errorClarity+e.dependencyClarity*t.dependencyClarity+e.identifierClarity*t.identifierClarity+e.polymorphismClarity*t.polymorphismClarity;return $e(x(o)*100)}function Re(e,r,t=D){let o=new Map;for(let[n,s]of e.operations){let i=r.get(n)??0,a=He(s,i,t);o.set(n,{agentReadiness:ze(a,t),subscores:a})}return o}function Me(e,r=D){return x(1-e/r.thresholds.maxOperationsForDiscoverability)}function ve(e,r,t=D){if(e.size===0)return{agentReadiness:100};let o=[];for(let i of e.values())o.push(i.agentReadiness);let n=t.weights.discoverabilityWeight,s=r*100;return{agentReadiness:$e(B(o)*(1-n)+s*n)}}function J(e,r,t){return e-r+r*t}function De(e,r){return J(e.polymorphismCount,e.anyOfCount,r)}function x(e){return Math.max(0,Math.min(1,e))}function Ee(e){let r=e.size||1,t={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let o of e.values())t.parameterSimplicity+=o.subscores.parameterSimplicity,t.schemaSimplicity+=o.subscores.schemaSimplicity,t.documentationQuality+=o.subscores.documentationQuality,t.constraintClarity+=o.subscores.constraintClarity,t.exampleCoverage+=o.subscores.exampleCoverage,t.errorClarity+=o.subscores.errorClarity,t.dependencyClarity+=o.subscores.dependencyClarity,t.identifierClarity+=o.subscores.identifierClarity,t.polymorphismClarity+=o.subscores.polymorphismClarity;return t.parameterSimplicity/=r,t.schemaSimplicity/=r,t.documentationQuality/=r,t.constraintClarity/=r,t.exampleCoverage/=r,t.errorClarity/=r,t.dependencyClarity/=r,t.identifierClarity/=r,t.polymorphismClarity/=r,t}function $e(e){return Math.round(e*10)/10}function we(e,r,t){let o=Math.max(1,e);return r/o+t/o}function Qe(e,r){return r.totalSchemaProperties>e.totalSchemaProperties?!0:r.totalSchemaProperties<e.totalSchemaProperties?!1:we(r.totalSchemaProperties,r.schemaPropertiesWithDescription,r.constraintCount)>we(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)}var Ke=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Y(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function Ie(e){Object.assign(e,Y())}function Le(e){return{ref:{enter(r){typeof r?.$ref=="string"&&(e.refsUsed.push(r.$ref),e.pendingRef=r.$ref)}},Schema:{enter(r,t){e.depth++,e.maxDepth=Math.max(e.maxDepth,e.depth);let o=0;for(let i of Ke)r[i]!==void 0&&(e.constraintCount++,o++);r.discriminator?.propertyName&&(e.hasDiscriminator=!0);let n={};for(let i of["oneOf","anyOf","allOf"]){let a=r[i];Array.isArray(a)&&(e.polymorphismCount+=a.length,i==="anyOf"&&(e.anyOfCount+=a.length),n[i]=a.length)}let s=[];if(L(r.properties)){let i=Object.entries(r.properties);e.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let h=c&&"$ref"in c&&c.$ref?t.resolve(c)?.node??c:c;h?.description&&e.schemaPropertiesWithDescription++,(h?.example!==void 0||h?.examples)&&(e.hasPropertyExamples=!0),h?.readOnly||e.writableTopLevelFields++}}e.debugEntries!==null&&e.debugEntries.push({ref:e.pendingRef,depth:e.depth,propertyNames:s,polymorphism:Object.keys(n).length>0?n:{},constraintCount:o}),e.pendingRef=null},leave(){e.depth--}}}}function qe(e,r,t){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:e,anyOfPenaltyMultiplier:r,debugOperationId:t,debugLogs:[]}}function Je(e,r,t){return{path:e,method:r,operationId:t.operationId,operationDescriptionPresent:!!t.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ye(e){let{inRequestBody:r,inResponse:t,currentResponseCode:o,errorStructuredCounted:n,maxEffectivePolymorphism:s,...i}=e;return i}function We(e){return{RequestBody:{enter(){e.current&&(e.current.requestBodyPresent=!0,e.current.inRequestBody=!0)},leave(){e.current&&(e.current.inRequestBody=!1)}},Response:{enter(r,t){let o=e.current;if(!o)return;let n=String(t.key);o.inResponse=!0,o.currentResponseCode=n,o.errorStructuredCounted=!1,Te(n)&&(o.totalErrorResponses++,!r.content&&r.description&&(o.structuredErrorResponseCount++,o.errorStructuredCounted=!0))},leave(){e.current&&(e.current.inResponse=!1)}},MediaType:{enter(r){let t=e.current;if(t&&(Ze(r)&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inResponse&&Te(t.currentResponseCode)&&!t.errorStructuredCounted&&(t.structuredErrorResponseCount++,t.errorStructuredCounted=!0),r.schema)){let o=!!e.debugOperationId&&(t.operationId===e.debugOperationId||`${t.method.toUpperCase()} ${t.path}`===e.debugOperationId),n=e.walkSchema(r.schema,o);Qe(t,n)&&(t.totalSchemaProperties=n.totalSchemaProperties,t.schemaPropertiesWithDescription=n.schemaPropertiesWithDescription,t.constraintCount=n.constraintCount);let s=J(n.polymorphismCount,n.anyOfCount,e.anyOfPenaltyMultiplier);s>t.maxEffectivePolymorphism&&(t.maxEffectivePolymorphism=s,t.polymorphismCount=n.polymorphismCount,t.anyOfCount=n.anyOfCount),n.hasDiscriminator&&(t.hasDiscriminator=!0);for(let i of n.refsUsed)t.refsUsed.add(i);if(n.hasPropertyExamples&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inRequestBody&&(t.maxRequestSchemaDepth=Math.max(t.maxRequestSchemaDepth,n.maxDepth),t.topLevelWritableFieldCount=Math.max(t.topLevelWritableFieldCount,n.writableTopLevelFields)),t.inResponse&&(t.maxResponseSchemaDepth=Math.max(t.maxResponseSchemaDepth,n.maxDepth)),o&&n.debugEntries){let i=t.inRequestBody?"REQUEST BODY":`RESPONSE ${t.currentResponseCode}`;e.debugLogs.push({context:i,entries:n.debugEntries,totalProperties:n.totalSchemaProperties,totalPolymorphism:n.polymorphismCount,totalConstraints:n.constraintCount,maxDepth:n.maxDepth})}}}},Paths:{PathItem:{enter(r,t){e.currentPath=String(t.key),e.pathLevelParams=r.parameters??[]},Operation:{enter(r,t){let o=String(t.key),n=Je(e.currentPath,o,r);e.current=n;let s=Xe(e.pathLevelParams,r.parameters??[],t.resolve);for(let i of s.values())n.parameterCount++,i.required&&n.requiredParameterCount++,i.description&&n.paramsWithDescription++,et(i)&&n.ambiguousIdentifierCount++},leave(r){let t=e.current;if(!t)return;let o=r.operationId??`${t.method.toUpperCase()} ${t.path}`;e.operations.set(o,Ye(t)),e.current=null}}}}}}function Ue(e){return{operationCount:e.operations.size,operations:e.operations}}function Ae(e,r){return r(e).node}function Xe(e,r,t){let o=new Map;for(let n of e){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}for(let n of r){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}return o}function Ze(e){return e.example!==void 0||ie(e.examples)}function et(e){if(e.description)return!1;let r=(e.name??"").toLowerCase();return Oe.has(r)}function Te(e){if(e==="default"||/^4xx$/i.test(e)||/^5xx$/i.test(e))return!0;let r=parseInt(e,10);return r>=400&&r<600}function tt(e,r){if(!r.startsWith("#/"))return;let t=e;for(let o of r.slice(2).split("/"))t=t?.[ce(o)];return t}function ke({document:e,types:r,resolvedRefMap:t,ctx:o,debugOperationId:n,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??D.weights.anyOfPenaltyMultiplier,a=Y(),c=Le(a),h=Q([{severity:"warn",ruleId:"score-schema",visitor:c}],r),u=(l,m)=>{Ie(a),m&&(a.debugEntries=[]),K({document:{...e,parsed:l},rootType:r.Schema,normalizedVisitors:h,resolvedRefMap:t,ctx:o});let{depth:d,pendingRef:w,debugEntries:_,...N}=a;return{...N,refsUsed:[...a.refsUsed],debugEntries:m?a.debugEntries??void 0:void 0}},f=new Map,$=new WeakSet,O={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(l,m){return{maxDepth:Math.max(l.maxDepth,m.maxDepth),polymorphismCount:l.polymorphismCount+m.polymorphismCount,anyOfCount:l.anyOfCount+m.anyOfCount,hasDiscriminator:l.hasDiscriminator||m.hasDiscriminator,totalSchemaProperties:l.totalSchemaProperties+m.totalSchemaProperties,schemaPropertiesWithDescription:l.schemaPropertiesWithDescription+m.schemaPropertiesWithDescription,constraintCount:l.constraintCount+m.constraintCount,hasPropertyExamples:l.hasPropertyExamples||m.hasPropertyExamples,writableTopLevelFields:l.writableTopLevelFields+m.writableTopLevelFields,refsUsed:[...l.refsUsed,...m.refsUsed],debugEntries:l.debugEntries||m.debugEntries?[...l.debugEntries??[],...m.debugEntries??[]]:void 0}}let g=(l,m=!1)=>{let d=l,w=pe(l)?l.$ref:void 0;if(w){if(!m){let S=f.get(w);if(S)return S}d=tt(e.parsed,w)??l}if(L(d)&&$.has(d))return{...O};L(d)&&$.add(d);let _=d?.oneOf,N=d?.anyOf,Z=Array.isArray(_)&&_.length>1,ee=Array.isArray(N)&&N.length>1,G=Z||ee,te=Array.isArray(d?.allOf)&&d.allOf.length>0,V=d?.discriminator,q=!G&&L(V?.mapping)?Object.values(V.mapping).filter(S=>typeof S=="string"&&me(S)).map(S=>({$ref:S})):null,re=Array.isArray(q)&&q.length>0,C;if(G||te||re){let S={...d},F=null,oe=P=>{F=F?y(F,P):P},ne=(P,v)=>{let E=g(v[0],m);for(let z=1;z<v.length;z++){let se=g(v[z],m);se.totalSchemaProperties>E.totalSchemaProperties&&(E=se)}return{...E,polymorphismCount:E.polymorphismCount+v.length,anyOfCount:E.anyOfCount+(P==="anyOf"?v.length:0),hasDiscriminator:E.hasDiscriminator||!!V}};G&&delete S.discriminator,Z&&(delete S.oneOf,oe(ne("oneOf",_))),ee&&(delete S.anyOf,oe(ne("anyOf",N)));let H=null;if(re){delete S.discriminator;let P=g(q[0],m);for(let v=1;v<q.length;v++){let E=g(q[v],m);E.totalSchemaProperties>P.totalSchemaProperties&&(P=E)}H={...P,polymorphismCount:P.polymorphismCount+q.length,hasDiscriminator:!0}}let W=null;if(te){delete S.allOf,W={...O};for(let P of d.allOf)W=y(W,g(P,m));W.polymorphismCount+=d.allOf.length}C=u(S,m),W&&(C=y(C,W)),F&&(C=y(C,F)),H&&(C=y(C,H)),w&&(C={...C,refsUsed:[w,...C.refsUsed]})}else C=u(l,m);return L(d)&&$.delete(d),w&&!m&&f.set(w,C),C},M=qe(g,i,n),T=We(M),I=Q([{severity:"warn",ruleId:"score",visitor:T}],r);return K({document:e,rootType:r.Root,normalizedVisitors:I,resolvedRefMap:t,ctx:o}),{metrics:Ue(M),debugLogs:M.debugLogs}}function Ne(e){let r=new Map;for(let[n,s]of e)for(let i of s.refsUsed){let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(n)}let t=new Map;for(let n of e.keys())t.set(n,new Set);for(let n of r.values()){if(n.size<2)continue;let s=Array.from(n);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)t.get(s[i]).add(s[a]),t.get(s[a]).add(s[i])}let o=new Map;for(let n of e.keys()){let s=rt(n,t);o.set(n,s)}return o}function rt(e,r){let t=new Set([e]),o=[e],n=0;for(;o.length>0;){let s=[];for(let i of o)for(let a of r.get(i)??[])t.has(a)||(t.add(a),s.push(a));s.length>0&&n++,o=s}return n}function Fe(e){let r={agentReadiness:e.agentReadiness,discoverability:Math.round(e.discoverability*100),subscores:e.subscores,rawMetrics:{operationCount:e.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(e.rawMetrics.operations.entries()).map(([t,o])=>{let{refsUsed:n,...s}=o;return[t,s]}))},operationScores:Object.fromEntries(e.operationScores),dependencyDepths:Object.fromEntries(e.dependencyDepths),hotspots:e.hotspots};k.output(JSON.stringify(r,null,2))}function je(e,r=!1){ot(e),nt(e),it(e),r&&at(e),pt(e)}function _e(e){return e>=80?de:e>=50?j:fe}function Be(e){return _e(e)(b(e.toFixed(1)))}function p(e){k.output(e+`
7
+ import{b as xe,f as Pe}from"./YA5KTHFN.js";import{$ as b,A as ue,X as le,Y as he,ba as fe,c as L,ca as de,da as j,f as ie,fa as ye,ga as U,ha as A,ka as k,la as Se,ma as ge,na as Q,oa as K,p as ae,q as pe,qa as Ce,r as ce,ta as be,v as me}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as mt}from"perf_hooks";var D={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Oe=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function B(e){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),t=Math.floor(r.length/2);return r.length%2!==0?r[t]:(r[t-1]+r[t])/2}function He(e,r,t=D){let{thresholds:o,weights:n}=t,s=x(1-e.parameterCount/(o.maxParamsGood*2)),a=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth)/(o.maxDepthGood*2),c=De(e,n.anyOfPenaltyMultiplier)/(o.maxPolymorphismGood*3),h=x(1-a-c),u=(e.operationDescriptionPresent?1:0)+e.paramsWithDescription+e.schemaPropertiesWithDescription,f=1+e.parameterCount+e.totalSchemaProperties,$=f>0?x(u/f):1,O=e.totalSchemaProperties>0?x(e.constraintCount/e.totalSchemaProperties):1,y=(e.requestExamplePresent?1:0)+(e.responseExamplePresent?1:0),g=(e.requestBodyPresent?1:0)+1,M=x(y/g),T=e.totalErrorResponses>0?x(e.structuredErrorResponseCount/e.totalErrorResponses):1,I=x(1-r/(o.maxDependencyDepthGood*2)),l=x(1-e.ambiguousIdentifierCount/Math.max(o.maxAmbiguousGood+3,1)),m=De(e,n.anyOfPenaltyMultiplier),d=m===0?1:e.hasDiscriminator?x(1-m/(o.maxPolymorphismGood*4)):x(1-m/(o.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:h,documentationQuality:$,constraintClarity:O,exampleCoverage:M,errorClarity:T,dependencyClarity:I,identifierClarity:l,polymorphismClarity:d}}function ze(e,r=D){let t=r.weights,o=e.parameterSimplicity*t.parameterSimplicity+e.schemaSimplicity*t.schemaSimplicity+e.documentationQuality*t.documentationQuality+e.constraintClarity*t.constraintClarity+e.exampleCoverage*t.exampleCoverage+e.errorClarity*t.errorClarity+e.dependencyClarity*t.dependencyClarity+e.identifierClarity*t.identifierClarity+e.polymorphismClarity*t.polymorphismClarity;return $e(x(o)*100)}function Re(e,r,t=D){let o=new Map;for(let[n,s]of e.operations){let i=r.get(n)??0,a=He(s,i,t);o.set(n,{agentReadiness:ze(a,t),subscores:a})}return o}function Me(e,r=D){return x(1-e/r.thresholds.maxOperationsForDiscoverability)}function ve(e,r,t=D){if(e.size===0)return{agentReadiness:100};let o=[];for(let i of e.values())o.push(i.agentReadiness);let n=t.weights.discoverabilityWeight,s=r*100;return{agentReadiness:$e(B(o)*(1-n)+s*n)}}function J(e,r,t){return e-r+r*t}function De(e,r){return J(e.polymorphismCount,e.anyOfCount,r)}function x(e){return Math.max(0,Math.min(1,e))}function Ee(e){let r=e.size||1,t={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let o of e.values())t.parameterSimplicity+=o.subscores.parameterSimplicity,t.schemaSimplicity+=o.subscores.schemaSimplicity,t.documentationQuality+=o.subscores.documentationQuality,t.constraintClarity+=o.subscores.constraintClarity,t.exampleCoverage+=o.subscores.exampleCoverage,t.errorClarity+=o.subscores.errorClarity,t.dependencyClarity+=o.subscores.dependencyClarity,t.identifierClarity+=o.subscores.identifierClarity,t.polymorphismClarity+=o.subscores.polymorphismClarity;return t.parameterSimplicity/=r,t.schemaSimplicity/=r,t.documentationQuality/=r,t.constraintClarity/=r,t.exampleCoverage/=r,t.errorClarity/=r,t.dependencyClarity/=r,t.identifierClarity/=r,t.polymorphismClarity/=r,t}function $e(e){return Math.round(e*10)/10}function we(e,r,t){let o=Math.max(1,e);return r/o+t/o}function Qe(e,r){return r.totalSchemaProperties>e.totalSchemaProperties?!0:r.totalSchemaProperties<e.totalSchemaProperties?!1:we(r.totalSchemaProperties,r.schemaPropertiesWithDescription,r.constraintCount)>we(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)}var Ke=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Y(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function Ie(e){Object.assign(e,Y())}function Le(e){return{ref:{enter(r){typeof r?.$ref=="string"&&(e.refsUsed.push(r.$ref),e.pendingRef=r.$ref)}},Schema:{enter(r,t){e.depth++,e.maxDepth=Math.max(e.maxDepth,e.depth);let o=0;for(let i of Ke)r[i]!==void 0&&(e.constraintCount++,o++);r.discriminator?.propertyName&&(e.hasDiscriminator=!0);let n={};for(let i of["oneOf","anyOf","allOf"]){let a=r[i];Array.isArray(a)&&(e.polymorphismCount+=a.length,i==="anyOf"&&(e.anyOfCount+=a.length),n[i]=a.length)}let s=[];if(L(r.properties)){let i=Object.entries(r.properties);e.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let h=c&&"$ref"in c&&c.$ref?t.resolve(c)?.node??c:c;h?.description&&e.schemaPropertiesWithDescription++,(h?.example!==void 0||h?.examples)&&(e.hasPropertyExamples=!0),h?.readOnly||e.writableTopLevelFields++}}e.debugEntries!==null&&e.debugEntries.push({ref:e.pendingRef,depth:e.depth,propertyNames:s,polymorphism:Object.keys(n).length>0?n:{},constraintCount:o}),e.pendingRef=null},leave(){e.depth--}}}}function qe(e,r,t){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:e,anyOfPenaltyMultiplier:r,debugOperationId:t,debugLogs:[]}}function Je(e,r,t){return{path:e,method:r,operationId:t.operationId,operationDescriptionPresent:!!t.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ye(e){let{inRequestBody:r,inResponse:t,currentResponseCode:o,errorStructuredCounted:n,maxEffectivePolymorphism:s,...i}=e;return i}function We(e){return{RequestBody:{enter(){e.current&&(e.current.requestBodyPresent=!0,e.current.inRequestBody=!0)},leave(){e.current&&(e.current.inRequestBody=!1)}},Response:{enter(r,t){let o=e.current;if(!o)return;let n=String(t.key);o.inResponse=!0,o.currentResponseCode=n,o.errorStructuredCounted=!1,Te(n)&&(o.totalErrorResponses++,!r.content&&r.description&&(o.structuredErrorResponseCount++,o.errorStructuredCounted=!0))},leave(){e.current&&(e.current.inResponse=!1)}},MediaType:{enter(r){let t=e.current;if(t&&(Ze(r)&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inResponse&&Te(t.currentResponseCode)&&!t.errorStructuredCounted&&(t.structuredErrorResponseCount++,t.errorStructuredCounted=!0),r.schema)){let o=!!e.debugOperationId&&(t.operationId===e.debugOperationId||`${t.method.toUpperCase()} ${t.path}`===e.debugOperationId),n=e.walkSchema(r.schema,o);Qe(t,n)&&(t.totalSchemaProperties=n.totalSchemaProperties,t.schemaPropertiesWithDescription=n.schemaPropertiesWithDescription,t.constraintCount=n.constraintCount);let s=J(n.polymorphismCount,n.anyOfCount,e.anyOfPenaltyMultiplier);s>t.maxEffectivePolymorphism&&(t.maxEffectivePolymorphism=s,t.polymorphismCount=n.polymorphismCount,t.anyOfCount=n.anyOfCount),n.hasDiscriminator&&(t.hasDiscriminator=!0);for(let i of n.refsUsed)t.refsUsed.add(i);if(n.hasPropertyExamples&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inRequestBody&&(t.maxRequestSchemaDepth=Math.max(t.maxRequestSchemaDepth,n.maxDepth),t.topLevelWritableFieldCount=Math.max(t.topLevelWritableFieldCount,n.writableTopLevelFields)),t.inResponse&&(t.maxResponseSchemaDepth=Math.max(t.maxResponseSchemaDepth,n.maxDepth)),o&&n.debugEntries){let i=t.inRequestBody?"REQUEST BODY":`RESPONSE ${t.currentResponseCode}`;e.debugLogs.push({context:i,entries:n.debugEntries,totalProperties:n.totalSchemaProperties,totalPolymorphism:n.polymorphismCount,totalConstraints:n.constraintCount,maxDepth:n.maxDepth})}}}},Paths:{PathItem:{enter(r,t){e.currentPath=String(t.key),e.pathLevelParams=r.parameters??[]},Operation:{enter(r,t){let o=String(t.key),n=Je(e.currentPath,o,r);e.current=n;let s=Xe(e.pathLevelParams,r.parameters??[],t.resolve);for(let i of s.values())n.parameterCount++,i.required&&n.requiredParameterCount++,i.description&&n.paramsWithDescription++,et(i)&&n.ambiguousIdentifierCount++},leave(r){let t=e.current;if(!t)return;let o=r.operationId??`${t.method.toUpperCase()} ${t.path}`;e.operations.set(o,Ye(t)),e.current=null}}}}}}function Ue(e){return{operationCount:e.operations.size,operations:e.operations}}function Ae(e,r){return r(e).node}function Xe(e,r,t){let o=new Map;for(let n of e){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}for(let n of r){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}return o}function Ze(e){return e.example!==void 0||ie(e.examples)}function et(e){if(e.description)return!1;let r=(e.name??"").toLowerCase();return Oe.has(r)}function Te(e){if(e==="default"||/^4xx$/i.test(e)||/^5xx$/i.test(e))return!0;let r=parseInt(e,10);return r>=400&&r<600}function tt(e,r){if(!r.startsWith("#/"))return;let t=e;for(let o of r.slice(2).split("/"))t=t?.[ce(o)];return t}function ke({document:e,types:r,resolvedRefMap:t,ctx:o,debugOperationId:n,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??D.weights.anyOfPenaltyMultiplier,a=Y(),c=Le(a),h=Q([{severity:"warn",ruleId:"score-schema",visitor:c}],r),u=(l,m)=>{Ie(a),m&&(a.debugEntries=[]),K({document:{...e,parsed:l},rootType:r.Schema,normalizedVisitors:h,resolvedRefMap:t,ctx:o});let{depth:d,pendingRef:w,debugEntries:_,...N}=a;return{...N,refsUsed:[...a.refsUsed],debugEntries:m?a.debugEntries??void 0:void 0}},f=new Map,$=new WeakSet,O={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(l,m){return{maxDepth:Math.max(l.maxDepth,m.maxDepth),polymorphismCount:l.polymorphismCount+m.polymorphismCount,anyOfCount:l.anyOfCount+m.anyOfCount,hasDiscriminator:l.hasDiscriminator||m.hasDiscriminator,totalSchemaProperties:l.totalSchemaProperties+m.totalSchemaProperties,schemaPropertiesWithDescription:l.schemaPropertiesWithDescription+m.schemaPropertiesWithDescription,constraintCount:l.constraintCount+m.constraintCount,hasPropertyExamples:l.hasPropertyExamples||m.hasPropertyExamples,writableTopLevelFields:l.writableTopLevelFields+m.writableTopLevelFields,refsUsed:[...l.refsUsed,...m.refsUsed],debugEntries:l.debugEntries||m.debugEntries?[...l.debugEntries??[],...m.debugEntries??[]]:void 0}}let g=(l,m=!1)=>{let d=l,w=pe(l)?l.$ref:void 0;if(w){if(!m){let S=f.get(w);if(S)return S}d=tt(e.parsed,w)??l}if(L(d)&&$.has(d))return{...O};L(d)&&$.add(d);let _=d?.oneOf,N=d?.anyOf,Z=Array.isArray(_)&&_.length>1,ee=Array.isArray(N)&&N.length>1,G=Z||ee,te=Array.isArray(d?.allOf)&&d.allOf.length>0,V=d?.discriminator,q=!G&&L(V?.mapping)?Object.values(V.mapping).filter(S=>typeof S=="string"&&me(S)).map(S=>({$ref:S})):null,re=Array.isArray(q)&&q.length>0,C;if(G||te||re){let S={...d},F=null,oe=P=>{F=F?y(F,P):P},ne=(P,v)=>{let E=g(v[0],m);for(let z=1;z<v.length;z++){let se=g(v[z],m);se.totalSchemaProperties>E.totalSchemaProperties&&(E=se)}return{...E,polymorphismCount:E.polymorphismCount+v.length,anyOfCount:E.anyOfCount+(P==="anyOf"?v.length:0),hasDiscriminator:E.hasDiscriminator||!!V}};G&&delete S.discriminator,Z&&(delete S.oneOf,oe(ne("oneOf",_))),ee&&(delete S.anyOf,oe(ne("anyOf",N)));let H=null;if(re){delete S.discriminator;let P=g(q[0],m);for(let v=1;v<q.length;v++){let E=g(q[v],m);E.totalSchemaProperties>P.totalSchemaProperties&&(P=E)}H={...P,polymorphismCount:P.polymorphismCount+q.length,hasDiscriminator:!0}}let W=null;if(te){delete S.allOf,W={...O};for(let P of d.allOf)W=y(W,g(P,m));W.polymorphismCount+=d.allOf.length}C=u(S,m),W&&(C=y(C,W)),F&&(C=y(C,F)),H&&(C=y(C,H)),w&&(C={...C,refsUsed:[w,...C.refsUsed]})}else C=u(l,m);return L(d)&&$.delete(d),w&&!m&&f.set(w,C),C},M=qe(g,i,n),T=We(M),I=Q([{severity:"warn",ruleId:"score",visitor:T}],r);return K({document:e,rootType:r.Root,normalizedVisitors:I,resolvedRefMap:t,ctx:o}),{metrics:Ue(M),debugLogs:M.debugLogs}}function Ne(e){let r=new Map;for(let[n,s]of e)for(let i of s.refsUsed){let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(n)}let t=new Map;for(let n of e.keys())t.set(n,new Set);for(let n of r.values()){if(n.size<2)continue;let s=Array.from(n);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)t.get(s[i]).add(s[a]),t.get(s[a]).add(s[i])}let o=new Map;for(let n of e.keys()){let s=rt(n,t);o.set(n,s)}return o}function rt(e,r){let t=new Set([e]),o=[e],n=0;for(;o.length>0;){let s=[];for(let i of o)for(let a of r.get(i)??[])t.has(a)||(t.add(a),s.push(a));s.length>0&&n++,o=s}return n}function Fe(e){let r={agentReadiness:e.agentReadiness,discoverability:Math.round(e.discoverability*100),subscores:e.subscores,rawMetrics:{operationCount:e.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(e.rawMetrics.operations.entries()).map(([t,o])=>{let{refsUsed:n,...s}=o;return[t,s]}))},operationScores:Object.fromEntries(e.operationScores),dependencyDepths:Object.fromEntries(e.dependencyDepths),hotspots:e.hotspots};k.output(JSON.stringify(r,null,2))}function je(e,r=!1){ot(e),nt(e),it(e),r&&at(e),pt(e)}function _e(e){return e>=80?de:e>=50?j:fe}function Be(e){return _e(e)(b(e.toFixed(1)))}function p(e){k.output(e+`
8
8
  `)}function ot(e){p(""),p(b(A(" Scores"))),p(""),p(` Agent Readiness: ${Be(e.agentReadiness)}/100`),p("")}function nt(e){p(b(A(" Subscores"))),p("");let r=e.subscores;R("Parameter Simplicity",r.parameterSimplicity),R("Schema Simplicity",r.schemaSimplicity),R("Documentation Quality",r.documentationQuality),R("Constraint Clarity",r.constraintClarity),R("Example Coverage",r.exampleCoverage),R("Error Clarity",r.errorClarity),R("Dependency Clarity",r.dependencyClarity),R("Identifier Clarity",r.identifierClarity),R("Polymorphism Clarity",r.polymorphismClarity),R("Discoverability",e.discoverability),p("")}function R(e,r){let t=Math.round(r*100),o=st(r);p(` ${e.padEnd(24)} ${o} ${_e(t)(t+"%")}`)}function st(e){let t=Math.round(e*20);return U("["+"\u2588".repeat(t)+"\u2591".repeat(20-t)+"]")}function it(e){if(p(b(A(" Raw Metrics Summary"))),p(""),p(` Total operations: ${e.rawMetrics.operationCount}`),e.rawMetrics.operationCount===0){p("");return}let r=[],t=[],o=[],n=[],s=0,i=0,a=0;for(let u of e.rawMetrics.operations.values())r.push(u.parameterCount),t.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),o.push(u.polymorphismCount),n.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=e.rawMetrics.operationCount;function h(u,f){let O=(f.reduce((T,I)=>T+I,0)/c).toFixed(1),y=B(f).toFixed(1),g=Math.min(...f),M=Math.max(...f);p(` ${u.padEnd(26)} avg ${O.padStart(6)} median ${y.padStart(6)} min ${String(g).padStart(5)} max ${String(M).padStart(5)}`)}h("Parameters/operation:",r),h("Schema depth:",t),h("Polymorphism/operation:",o),h("Properties/operation:",n),p(` Operations with request examples: ${s}/${c} (${X(s,c)})`),p(` Operations with response examples: ${i}/${c} (${X(i,c)})`),p(` Operations with description: ${a}/${c} (${X(a,c)})`),p("")}function X(e,r){return r>0?`${Math.round(e/r*100)}%`:"N/A"}function at(e){p(b(A(" Per-Operation Metrics"))),p("");let r=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);p(U(r)),p(U(" "+"\u2500".repeat(r.length-2)));let t=[...e.rawMetrics.operations.entries()].sort(([,o],[,n])=>n.totalSchemaProperties-o.totalSchemaProperties);for(let[,o]of t){let n=(o.operationId??`${o.method.toUpperCase()} ${o.path}`).slice(0,48),s=Math.max(o.maxRequestSchemaDepth,o.maxResponseSchemaDepth),i=" "+n.padEnd(50)+String(o.totalSchemaProperties).padStart(7)+String(o.polymorphismCount).padStart(7)+String(s).padStart(7)+String(o.parameterCount).padStart(8)+String(o.constraintCount).padStart(8);p(i)}p("")}function Ge(e,r){if(p(""),p(b(A(` Debug: ${e} schema breakdown`))),p(""),r.length===0){p(j(` No schemas found for operation "${e}".`)),p(j(' Make sure the value matches an operationId or "METHOD /path" exactly.')),p("");return}for(let t of r){p(b(U(` ${t.context}`))),p(U(" "+"\u2500".repeat(70)));let o=new Map;for(let s of t.entries){let i=s.ref??`(inline depth ${s.depth})`,a=o.get(i);if(a){a.count++,a.totalProps+=s.propertyNames.length;for(let c of s.propertyNames)a.propNames.includes(c)||a.propNames.push(c)}else o.set(i,{count:1,totalProps:s.propertyNames.length,propNames:[...s.propertyNames]})}for(let s of t.entries){let i=s.ref??"(inline)",a=" ".repeat(Math.min(s.depth,6)),c=s.propertyNames.length,h=` ${a}${i}`;c>0&&(h+=` (${c} properties)`);let u=[];if(s.polymorphism.oneOf&&u.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&u.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&u.push(`allOf:${s.polymorphism.allOf}`),u.length>0&&(h+=` [${u.join(", ")}]`),s.constraintCount>0&&(h+=` {${s.constraintCount} constraints}`),p(h),c>0&&c<=20)p(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let f=s.propertyNames.slice(0,15).join(", ");p(` ${a} properties: ${f}, ... +${c-15} more`)}}p(""),p(` Totals: ${t.totalProperties} properties, ${t.totalPolymorphism} polymorphism items, ${t.totalConstraints} constraints, max depth ${t.maxDepth}`);let n=[...o.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(n.length>0){p(""),p(b(" Top schemas by property count:"));for(let[s,i]of n)p(` ${s}: ${i.totalProps} properties`)}p("")}}function pt(e){if(e.hotspots.length===0){p(b(A(" No hotspot operations found."))),p("");return}p(b(A(` Top ${e.hotspots.length} Hotspot Operations`))),p("");for(let r of e.hotspots){let t=r.operationId?`${r.method.toUpperCase()} ${r.path} (${r.operationId})`:`${r.method.toUpperCase()} ${r.path}`;p(b(` ${t}`)),p(` Agent Readiness: ${Be(r.agentReadinessScore)}`);for(let o of r.reasons)p(j(` - ${o}`));p("")}}function Ve(e,r,t,o=D){let n=[];for(let[s,i]of r){let a=e.operations.get(s);if(!a)continue;let c=ct(a,t.get(s)??0,o);c.length!==0&&n.push({path:a.path,method:a.method,operationId:a.operationId,agentReadinessScore:i.agentReadiness,reasons:c})}return n.sort((s,i)=>s.reasons.length!==i.reasons.length?i.reasons.length-s.reasons.length:s.agentReadinessScore-i.agentReadinessScore),n.slice(0,o.hotspotLimit)}function ct(e,r,t){let{thresholds:o}=t,n=[];e.parameterCount>o.maxParamsGood&&n.push(`High parameter count (${e.parameterCount})`);let s=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth);s>o.maxDepthGood&&n.push(`Deep schema nesting (depth ${s})`),e.anyOfCount>0&&!e.hasDiscriminator?n.push(`Polymorphism (anyOf) without discriminator (${e.anyOfCount} anyOf)`):e.polymorphismCount>o.maxPolymorphismGood&&n.push(`High polymorphism count (${e.polymorphismCount})`);let i=e.requestBodyPresent&&!e.requestExamplePresent,a=!e.responseExamplePresent;return i&&a?n.push("Missing request and response examples"):i?n.push("Missing request body examples"):a&&n.push("Missing response examples"),e.totalErrorResponses>0&&e.structuredErrorResponseCount===0&&n.push("No structured error responses (4xx/5xx)"),e.operationDescriptionPresent||n.push("Missing operation description"),e.parameterCount>0&&e.paramsWithDescription===0&&n.push("No parameter descriptions"),r>o.maxDependencyDepthGood&&n.push(`High dependency depth (${r})`),e.ambiguousIdentifierCount>o.maxAmbiguousGood&&n.push(`Ambiguous identifiers (${e.ambiguousIdentifierCount})`),n}async function Vt({argv:e,config:r,collectSpecData:t}){let[{path:o}]=await xe(e.api?[e.api]:[],r),n=new le(r.resolve),{bundle:s}=await be({config:r,ref:o});t?.(s);let i=ge(s.parsed);if(Se(i)!=="oas3")throw new Ce(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=mt.now(),c=ae(r.extendTypes(ue(i),i),r),h=await he({rootDocument:s,rootType:c.Root,externalRefResolver:n}),u=e["debug-operation-id"],{metrics:f,debugLogs:$}=ke({document:s,types:c,resolvedRefMap:h,ctx:{problems:[],specVersion:i,config:r,visitorsData:{}},debugOperationId:u}),O=Ne(f.operations),y=Re(f,O),g=Me(f.operationCount),{agentReadiness:M}=ve(y,g),T=Ve(f,y,O),I={agentReadiness:M,discoverability:g,subscores:Ee(y),rawMetrics:f,hotspots:T,operationScores:y,dependencyDepths:O};ut(I,o,a,e.format,!!e["operation-details"],u?{operationId:u,logs:$}:void 0)}function ut(e,r,t,o,n,s){k.info(`Document: ${ye(r)} score:
9
9
  `),o==="json"?Fe(e):je(e,n),s&&Ge(s.operationId,s.logs),Pe("score",t,r)}export{Vt as handleScore};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as G}from"./TFPMT2XD.js";import{b as A,c as U,d as L,e as F,f as re,g as ie,h as se,i as ae,j as oe}from"./QQ2PGWE6.js";import{a as ee,c as T,d as h,e as v,f as N,g as D,h as _,i as ne,j,k as I,l as W,n as te}from"./D3C6XIMY.js";var M=T.php,x=class extends ee{constructor(){super(" ")}typeName(n){return h(n,{style:"pascal",reserved:M})}memberName(n){return h(n,{style:"camel",reserved:M})}identifier(n){return h(n,{style:"camel",reserved:M})}identifiers(n,s){return v(n,{style:"camel",reserved:M,taken:s})}string(n){return`'${n.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}literal(n){return n==null?"null":typeof n=="boolean"||typeof n=="number"?String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`[${n.map(r=>this.literal(r)).join(", ")}]`:`[${Object.entries(n).map(([r,i])=>`${this.string(r)} => ${this.literal(i)}`).join(", ")}]`}comment(n){for(let s of W(n))this.line(s===""?"//":`// ${s}`);return this}doc(n,s,r=[]){let i=W(s);if(i.length===0&&r.length===0)return this;let t=i.length===0?n:`${n} \u2014 ${i.join(" ")}`;if(r.length===0)return this.line(`/** ${t} */`);this.line("/**"),this.line(` * ${t}`),this.line(" *");for(let o of r)this.line(` * ${o}`);return this.line(" */")}};var y=T.php,K=new x;function g(e){return K.typeName(e)}function k(e){return K.memberName(e)}function c(e){return K.string(e)}function ce(e){return h(e.name,{style:"camel",reserved:y})}function J(e){let n=e.services.flatMap(r=>r.operations),s=v(n.map(r=>r.name),{style:"camel",reserved:y});return new Map(n.map((r,i)=>[r.name,s[i]]))}function ye(e){return ie(e).map(s=>s.kind==="literal"?c(s.value):`$${k(s.name)}`).join(" . ")}function le(e,n){let s=n.servers??[];if(s.length===0)return;let r=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{s.forEach((i,t)=>{let o=h(i.description??`server${t+1}`,{style:"camel",reserved:y});r.has(o)&&(o=`${o}${t+1}`),r.add(o);let u=i.variables.map(a=>`string $${k(a.name)} = ${c(a.default)}`);t>0&&e.blank(),e.line(`public static function ${o}(${u.join(", ")}): string`),e.block("{",()=>{e.line(`return ${ye(i)};`)},"}")})},"}"),e.blank()}function V(e,n){let s=se(e,n).map(r=>`[${r.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${c(t.scheme)}, 'name' => ${c(t.name)}, 'in' => ${c(t.in)}]`:`['kind' => ${c(t.kind)}, 'scheme' => ${c(t.scheme)}]`).join(", ")}]`);if(s.length!==0)return`[${s.join(", ")}]`}function O(e,n){return V(e,n)===void 0?"[]":"$op['security']"}function ue(e){return`[${[`'style' => ${c(e.style)}`,...e.param!==void 0?[`'param' => ${c(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${c(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${c(e.hasMore)}`]:[],...e.nextLink!==void 0?[`'nextLink' => ${c(e.nextLink)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${c(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${c(e.items)}`]:[]].join(", ")}]`}function $e(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(i=>{let t=h(i.name,{style:"camel",reserved:y}),o=2;for(;s.has(t);)t=`${h(i.name,{style:"camel",reserved:y})}_${o++}`;s.add(t);let u=te(i.schema,n);return`[${c(i.name)}, ${c(t)}, ${c(u)}]`}).join(", ")}]`}function C(e,n){let s=n.schemas.find(t=>t.name===e);if(s===void 0)return"other";let r=s.schema,i=I(r);return i!==void 0&&(i.scalar==="string"||i.scalar==="integer")?"enum":(r.kind==="object"||r.kind==="intersection")&&D(r,n)!==void 0?"class":"other"}function p(e,n,s="string"){if(ne(e)){let r=p(j(e),n,s);return E(r)}switch(e.kind){case"scalar":return s==="Date"&&e.scalar==="string"&&z(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let r=C(e.name,n);if(r==="class"||r==="enum")return g(e.name);let i=N(e,n);if(i===void 0)return"mixed";let t=p(i,n,s);if(!(_(i,n)!==void 0)||t==="mixed"||t.split("|").includes("array"))return t;let u=t.startsWith("?")||t.endsWith("|null"),a=t.startsWith("?")?t.slice(1):t.replace(/\|null$/,"");return u?E(`${a}|array`):`${a}|array`}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return g(e.base);case"union":return ge(e.members,n,s);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function z(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function E(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function ge(e,n,s){let r=[];for(let i of e){if(i.kind==="null")continue;let t=p(i,n,s);if(t==="mixed")return"mixed";let o=t.startsWith("?")?t.slice(1):t;r.includes(o)||r.push(o),t.startsWith("?")&&!r.includes("null")&&r.push("null")}return r.length===0?"mixed":r.join("|")}function Q(e,n,s){if(e===void 0)return;let r=j(e);if(r.kind==="ref"){let t=N(r,n);return C(r.name,n)==="other"?Q(t,n,s):void 0}if(r.kind!=="array")return;let i=p(r.items,n,s);return i==="mixed"?void 0:i}function de(e,n){let s=n.schemas.find(r=>r.name===e);return s!==void 0&&_(s.schema,n)!==void 0}function P(e,n,s,r){let i=j(e);if(r==="Date"&&i.kind==="scalar"&&i.scalar==="string"&&z(i))return`new \\DateTimeImmutable(${n})`;if(i.kind==="omit")return P({kind:"ref",name:i.base},n,s,r);if(i.kind==="ref"){let t=C(i.name,s);if(t==="class")return`${g(i.name)}::fromArray(${n})`;if(t==="enum")return`${g(i.name)}::from(${n})`;if(de(i.name,s))return`unmarshal${g(i.name)}(${n})`;let o=N(i,s);return o===void 0?void 0:P(o,n,s,r)}if(i.kind==="array"){let t=P(i.items,"$item",s,r);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(i.kind==="record"){let t=P(i.value,"$item",s,r);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function H(e,n,s,r="string"){let i=j(e);if(r==="Date"&&i.kind==="scalar"&&i.scalar==="string"){if(i.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(i.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(i.kind==="omit")return H({kind:"ref",name:i.base},n,s,r);if(i.kind==="ref"){let t=C(i.name,s);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if(de(i.name,s))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let o=N(i,s);return o===void 0?void 0:H(o,n,s,r)}if(i.kind==="array"||i.kind==="record"){let t=i.kind==="array"?i.items:i.value,o=H(t,"$item",s,r);return o===void 0?void 0:`array_map(static fn ($item) => ${o}, ${n})`}}function be(e,n,s,r,i,t){let o=s.map(a=>a.writeOnly?{...a,required:!1}:a),u=[...o.filter(a=>a.required),...o.filter(a=>!a.required)];e.doc(g(n),t),e.line(`final class ${g(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let a of u){let l=p(a.schema,r,i);if(a.required)e.line(`public ${l} $${k(a.name)},`);else{let $=E(l);e.line(`public ${$} $${k(a.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let a of u){let l=`$data[${c(a.name)}]`,$=P(a.schema,l,r,i),f=k(a.name);a.required?e.line(`${f}: ${$??l},`):$===void 0?e.line(`${f}: ${l} ?? null,`):e.line(`${f}: isset(${l}) ? ${$} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let a of u){let l=`$this->${k(a.name)}`,$=H(a.schema,l,r,i)??l;a.required?e.line(`$data[${c(a.name)}] = ${$};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${c(a.name)}] = ${$};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function Y(e,n="string"){let s=new x;for(let{name:r,schema:i}of e.schemas){let t=I(i);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let u=t.scalar==="string"?"string":"int";s.doc(g(r),i.description),s.line(`enum ${g(r)}: ${u}`),s.block("{",()=>{let a=v(t.values.map(l=>String(l)),{style:"pascal",reserved:y});t.values.forEach((l,$)=>{let f=typeof l=="string"?c(l):String(l);s.line(`case ${a[$]} = ${f};`)})},"}"),s.blank();continue}if(i.kind==="object"||i.kind==="intersection"){let u=D(i,e);if(u!==void 0){be(s,r,u.properties,e,n,u.description??i.description);continue}}let o=_(i,e);if(o!==void 0){let u=g(r),a=o.cases.map(l=>`${l.value} -> ${g(l.schemaName)}`).join(", ");s.line(`/** ${u} is a discriminated union (${c(o.property)}): ${a}. */`),s.line(`function unmarshal${u}(array $data): mixed`),s.block("{",()=>{s.block(`return match ($data[${c(o.property)}] ?? null) {`,()=>{for(let l of o.cases){let $={kind:"ref",name:l.schemaName},f=P($,"$data",e,n)??"$data";s.line(`${c(l.value)} => ${f},`)}s.line("default => $data,")},"};")},"}"),s.blank();continue}}return s.toString()}var fe=new Set(["post","put","patch"]),ke=["body","headers","idempotencyKey"];function me(e){return F(e)||e.requestBody!==void 0&&re(e.requestBody.contentType)}function X(e,n,s,r){let i=v([...e.pathParams,...e.queryParams].map(a=>a.name),{style:"camel",reserved:y,taken:ke}),t=e.pathParams.map((a,l)=>({php:i[l],wire:a.name,type:p(a.schema,n,r)})),o=e.queryParams.map((a,l)=>{let $=i[e.pathParams.length+l];return{php:$,wire:a.name,type:p(a.schema,n,r),value:H(a.schema,`$${$}`,n,r)??`$${$}`}}),u=[...t.map(({php:a,type:l})=>`${l} $${a}`),...s&&e.requestBody?[`${me(e)?"mixed":L(e)?"array":p(e.requestBody.schema,n,r)} $body`]:[],...o.map(({php:a,type:l})=>`${E(l)} $${a} = null`),"?array $headers = null",...s&&fe.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:o,signature:u}}function Pe(e,n,s,r){e.line(`$op = self::OPERATIONS[${c(n.specName??n.name)}];`),e.line(`[$authHeaders, $query, $cookies] = resolveAuth(${O(n,s)}, $this->config->auth);`);for(let{php:t,wire:o,value:u}of r.queryArgs)e.block(`if ($${t} !== null) {`,()=>{e.line(`$query[${c(o)}] = ${u};`)},"}");let i=r.pathArgs.map(({php:t,wire:o})=>`${c(o)} => $${t}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${i}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function Z(e,n,s,r,i,t=!1){let o=X(n,r,!0,i),u=U(n),a=A(n),l=u===void 0&&a===void 0&&n.successResponses.some(b=>b.contentType!==""),$=t?"Envelope":u!==void 0?"\\Generator":a!==void 0?p(a,r,i):l?"string":"void",f=t?`${s}WithHeaders`:s,q=t?void 0:Q(a,r,i);e.doc(f,t?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,q===void 0?[]:[`@return ${q.includes("|")?`(${q})`:q}[]`]),e.line(`public function ${f}(${o.signature.join(", ")}): ${$}`),e.block("{",()=>{if(Pe(e,n,r,o),u!==void 0){let m=u.schema!==void 0&&u.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${m?"true":"false"});`);return}let b=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(F(n))e.line("[$contentType, $encoded] = multipartBody($body);"),b.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody&&me(n))b.push("'body' => binaryBody($body)",`'contentType' => ${c(n.requestBody.contentType)}`);else if(n.requestBody&&L(n))e.line("[$contentType, $encoded] = toMultipart($body);"),b.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let m=H(n.requestBody.schema,"$body",r,i)??"$body";e.line(`$payload = json_encode(${m});`),b.push("'body' => $payload",`'contentType' => ${c(n.requestBody.contentType)}`)}fe.has(n.method.toLowerCase())&&n.requestBody&&b.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${b.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let d=l?"$response['body']":(a===void 0?void 0:P(a,"decodeJson($response)",r,i))??"decodeJson($response)";if(t){e.line(`$data = ${d};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${$e(n,r)}), status: $response['status']);`);return}if(l){e.line("return $response['body'];");return}if($==="void"){e.line("decodeJson($response);");return}e.line(`return ${d};`)},"}"),e.blank()}function pe(e,n,s,r,i,t,o,u,a){let l=X(n,r,!1,i),$=s,f=()=>{e.line(`$op = self::OPERATIONS[${c(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:m,wire:S,value:w}of l.queryArgs)e.block(`if ($${m} !== null) {`,()=>{e.line(`$base[${c(S)}] = ${w};`)},"}");let d=l.pathArgs.map(({php:m,wire:S})=>`${c(S)} => $${m}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line(`[$authHeaders, $authQuery, $cookies] = resolveAuth(${O(n,r)}, $this->config->auth);`),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${d}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},q=p(A(n)??{kind:"unknown"},r,i),b=q==="mixed"?"mixed":q;e.line("/**"),e.line(` * ${$} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${b}>`),e.line(" */"),e.line(`public function ${$}Pages(${l.signature.join(", ")}): \\Generator`),e.block("{",()=>{f(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${$} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${a}>`),e.line(" */"),e.line(`public function ${$}Items(${l.signature.join(", ")}): \\Generator`),e.block("{",()=>{f(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${c(u??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${o??"$item"};`)},"}")},"}")},"}"),e.blank()}function Se(e){let n=e.split(`
7
+ import{c as G}from"./TFPMT2XD.js";import{b as A,c as U,d as L,e as F,f as re,g as ie,h as se,i as ae,j as oe}from"./BZTZIEWS.js";import{a as ee,c as T,d as h,e as v,f as N,g as D,h as _,i as ne,j,k as I,l as W,n as te}from"./A65OW7M7.js";var M=T.php,x=class extends ee{constructor(){super(" ")}typeName(n){return h(n,{style:"pascal",reserved:M})}memberName(n){return h(n,{style:"camel",reserved:M})}identifier(n){return h(n,{style:"camel",reserved:M})}identifiers(n,s){return v(n,{style:"camel",reserved:M,taken:s})}string(n){return`'${n.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}literal(n){return n==null?"null":typeof n=="boolean"||typeof n=="number"?String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`[${n.map(r=>this.literal(r)).join(", ")}]`:`[${Object.entries(n).map(([r,i])=>`${this.string(r)} => ${this.literal(i)}`).join(", ")}]`}comment(n){for(let s of W(n))this.line(s===""?"//":`// ${s}`);return this}doc(n,s,r=[]){let i=W(s);if(i.length===0&&r.length===0)return this;let t=i.length===0?n:`${n} \u2014 ${i.join(" ")}`;if(r.length===0)return this.line(`/** ${t} */`);this.line("/**"),this.line(` * ${t}`),this.line(" *");for(let o of r)this.line(` * ${o}`);return this.line(" */")}};var y=T.php,K=new x;function g(e){return K.typeName(e)}function k(e){return K.memberName(e)}function c(e){return K.string(e)}function ce(e){return h(e.name,{style:"camel",reserved:y})}function J(e){let n=e.services.flatMap(r=>r.operations),s=v(n.map(r=>r.name),{style:"camel",reserved:y});return new Map(n.map((r,i)=>[r.name,s[i]]))}function ye(e){return ie(e).map(s=>s.kind==="literal"?c(s.value):`$${k(s.name)}`).join(" . ")}function le(e,n){let s=n.servers??[];if(s.length===0)return;let r=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{s.forEach((i,t)=>{let o=h(i.description??`server${t+1}`,{style:"camel",reserved:y});r.has(o)&&(o=`${o}${t+1}`),r.add(o);let u=i.variables.map(a=>`string $${k(a.name)} = ${c(a.default)}`);t>0&&e.blank(),e.line(`public static function ${o}(${u.join(", ")}): string`),e.block("{",()=>{e.line(`return ${ye(i)};`)},"}")})},"}"),e.blank()}function V(e,n){let s=se(e,n).map(r=>`[${r.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${c(t.scheme)}, 'name' => ${c(t.name)}, 'in' => ${c(t.in)}]`:`['kind' => ${c(t.kind)}, 'scheme' => ${c(t.scheme)}]`).join(", ")}]`);if(s.length!==0)return`[${s.join(", ")}]`}function O(e,n){return V(e,n)===void 0?"[]":"$op['security']"}function ue(e){return`[${[`'style' => ${c(e.style)}`,...e.param!==void 0?[`'param' => ${c(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${c(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${c(e.hasMore)}`]:[],...e.nextLink!==void 0?[`'nextLink' => ${c(e.nextLink)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${c(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${c(e.items)}`]:[]].join(", ")}]`}function $e(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(i=>{let t=h(i.name,{style:"camel",reserved:y}),o=2;for(;s.has(t);)t=`${h(i.name,{style:"camel",reserved:y})}_${o++}`;s.add(t);let u=te(i.schema,n);return`[${c(i.name)}, ${c(t)}, ${c(u)}]`}).join(", ")}]`}function C(e,n){let s=n.schemas.find(t=>t.name===e);if(s===void 0)return"other";let r=s.schema,i=I(r);return i!==void 0&&(i.scalar==="string"||i.scalar==="integer")?"enum":(r.kind==="object"||r.kind==="intersection")&&D(r,n)!==void 0?"class":"other"}function p(e,n,s="string"){if(ne(e)){let r=p(j(e),n,s);return E(r)}switch(e.kind){case"scalar":return s==="Date"&&e.scalar==="string"&&z(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let r=C(e.name,n);if(r==="class"||r==="enum")return g(e.name);let i=N(e,n);if(i===void 0)return"mixed";let t=p(i,n,s);if(!(_(i,n)!==void 0)||t==="mixed"||t.split("|").includes("array"))return t;let u=t.startsWith("?")||t.endsWith("|null"),a=t.startsWith("?")?t.slice(1):t.replace(/\|null$/,"");return u?E(`${a}|array`):`${a}|array`}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return g(e.base);case"union":return ge(e.members,n,s);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function z(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function E(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function ge(e,n,s){let r=[];for(let i of e){if(i.kind==="null")continue;let t=p(i,n,s);if(t==="mixed")return"mixed";let o=t.startsWith("?")?t.slice(1):t;r.includes(o)||r.push(o),t.startsWith("?")&&!r.includes("null")&&r.push("null")}return r.length===0?"mixed":r.join("|")}function Q(e,n,s){if(e===void 0)return;let r=j(e);if(r.kind==="ref"){let t=N(r,n);return C(r.name,n)==="other"?Q(t,n,s):void 0}if(r.kind!=="array")return;let i=p(r.items,n,s);return i==="mixed"?void 0:i}function de(e,n){let s=n.schemas.find(r=>r.name===e);return s!==void 0&&_(s.schema,n)!==void 0}function P(e,n,s,r){let i=j(e);if(r==="Date"&&i.kind==="scalar"&&i.scalar==="string"&&z(i))return`new \\DateTimeImmutable(${n})`;if(i.kind==="omit")return P({kind:"ref",name:i.base},n,s,r);if(i.kind==="ref"){let t=C(i.name,s);if(t==="class")return`${g(i.name)}::fromArray(${n})`;if(t==="enum")return`${g(i.name)}::from(${n})`;if(de(i.name,s))return`unmarshal${g(i.name)}(${n})`;let o=N(i,s);return o===void 0?void 0:P(o,n,s,r)}if(i.kind==="array"){let t=P(i.items,"$item",s,r);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(i.kind==="record"){let t=P(i.value,"$item",s,r);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function H(e,n,s,r="string"){let i=j(e);if(r==="Date"&&i.kind==="scalar"&&i.scalar==="string"){if(i.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(i.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(i.kind==="omit")return H({kind:"ref",name:i.base},n,s,r);if(i.kind==="ref"){let t=C(i.name,s);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if(de(i.name,s))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let o=N(i,s);return o===void 0?void 0:H(o,n,s,r)}if(i.kind==="array"||i.kind==="record"){let t=i.kind==="array"?i.items:i.value,o=H(t,"$item",s,r);return o===void 0?void 0:`array_map(static fn ($item) => ${o}, ${n})`}}function be(e,n,s,r,i,t){let o=s.map(a=>a.writeOnly?{...a,required:!1}:a),u=[...o.filter(a=>a.required),...o.filter(a=>!a.required)];e.doc(g(n),t),e.line(`final class ${g(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let a of u){let l=p(a.schema,r,i);if(a.required)e.line(`public ${l} $${k(a.name)},`);else{let $=E(l);e.line(`public ${$} $${k(a.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let a of u){let l=`$data[${c(a.name)}]`,$=P(a.schema,l,r,i),f=k(a.name);a.required?e.line(`${f}: ${$??l},`):$===void 0?e.line(`${f}: ${l} ?? null,`):e.line(`${f}: isset(${l}) ? ${$} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let a of u){let l=`$this->${k(a.name)}`,$=H(a.schema,l,r,i)??l;a.required?e.line(`$data[${c(a.name)}] = ${$};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${c(a.name)}] = ${$};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function Y(e,n="string"){let s=new x;for(let{name:r,schema:i}of e.schemas){let t=I(i);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let u=t.scalar==="string"?"string":"int";s.doc(g(r),i.description),s.line(`enum ${g(r)}: ${u}`),s.block("{",()=>{let a=v(t.values.map(l=>String(l)),{style:"pascal",reserved:y});t.values.forEach((l,$)=>{let f=typeof l=="string"?c(l):String(l);s.line(`case ${a[$]} = ${f};`)})},"}"),s.blank();continue}if(i.kind==="object"||i.kind==="intersection"){let u=D(i,e);if(u!==void 0){be(s,r,u.properties,e,n,u.description??i.description);continue}}let o=_(i,e);if(o!==void 0){let u=g(r),a=o.cases.map(l=>`${l.value} -> ${g(l.schemaName)}`).join(", ");s.line(`/** ${u} is a discriminated union (${c(o.property)}): ${a}. */`),s.line(`function unmarshal${u}(array $data): mixed`),s.block("{",()=>{s.block(`return match ($data[${c(o.property)}] ?? null) {`,()=>{for(let l of o.cases){let $={kind:"ref",name:l.schemaName},f=P($,"$data",e,n)??"$data";s.line(`${c(l.value)} => ${f},`)}s.line("default => $data,")},"};")},"}"),s.blank();continue}}return s.toString()}var fe=new Set(["post","put","patch"]),ke=["body","headers","idempotencyKey"];function me(e){return F(e)||e.requestBody!==void 0&&re(e.requestBody.contentType)}function X(e,n,s,r){let i=v([...e.pathParams,...e.queryParams].map(a=>a.name),{style:"camel",reserved:y,taken:ke}),t=e.pathParams.map((a,l)=>({php:i[l],wire:a.name,type:p(a.schema,n,r)})),o=e.queryParams.map((a,l)=>{let $=i[e.pathParams.length+l];return{php:$,wire:a.name,type:p(a.schema,n,r),value:H(a.schema,`$${$}`,n,r)??`$${$}`}}),u=[...t.map(({php:a,type:l})=>`${l} $${a}`),...s&&e.requestBody?[`${me(e)?"mixed":L(e)?"array":p(e.requestBody.schema,n,r)} $body`]:[],...o.map(({php:a,type:l})=>`${E(l)} $${a} = null`),"?array $headers = null",...s&&fe.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:o,signature:u}}function Pe(e,n,s,r){e.line(`$op = self::OPERATIONS[${c(n.specName??n.name)}];`),e.line(`[$authHeaders, $query, $cookies] = resolveAuth(${O(n,s)}, $this->config->auth);`);for(let{php:t,wire:o,value:u}of r.queryArgs)e.block(`if ($${t} !== null) {`,()=>{e.line(`$query[${c(o)}] = ${u};`)},"}");let i=r.pathArgs.map(({php:t,wire:o})=>`${c(o)} => $${t}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${i}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function Z(e,n,s,r,i,t=!1){let o=X(n,r,!0,i),u=U(n),a=A(n),l=u===void 0&&a===void 0&&n.successResponses.some(b=>b.contentType!==""),$=t?"Envelope":u!==void 0?"\\Generator":a!==void 0?p(a,r,i):l?"string":"void",f=t?`${s}WithHeaders`:s,q=t?void 0:Q(a,r,i);e.doc(f,t?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,q===void 0?[]:[`@return ${q.includes("|")?`(${q})`:q}[]`]),e.line(`public function ${f}(${o.signature.join(", ")}): ${$}`),e.block("{",()=>{if(Pe(e,n,r,o),u!==void 0){let m=u.schema!==void 0&&u.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${m?"true":"false"});`);return}let b=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(F(n))e.line("[$contentType, $encoded] = multipartBody($body);"),b.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody&&me(n))b.push("'body' => binaryBody($body)",`'contentType' => ${c(n.requestBody.contentType)}`);else if(n.requestBody&&L(n))e.line("[$contentType, $encoded] = toMultipart($body);"),b.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let m=H(n.requestBody.schema,"$body",r,i)??"$body";e.line(`$payload = json_encode(${m});`),b.push("'body' => $payload",`'contentType' => ${c(n.requestBody.contentType)}`)}fe.has(n.method.toLowerCase())&&n.requestBody&&b.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${b.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let d=l?"$response['body']":(a===void 0?void 0:P(a,"decodeJson($response)",r,i))??"decodeJson($response)";if(t){e.line(`$data = ${d};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${$e(n,r)}), status: $response['status']);`);return}if(l){e.line("return $response['body'];");return}if($==="void"){e.line("decodeJson($response);");return}e.line(`return ${d};`)},"}"),e.blank()}function pe(e,n,s,r,i,t,o,u,a){let l=X(n,r,!1,i),$=s,f=()=>{e.line(`$op = self::OPERATIONS[${c(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:m,wire:S,value:w}of l.queryArgs)e.block(`if ($${m} !== null) {`,()=>{e.line(`$base[${c(S)}] = ${w};`)},"}");let d=l.pathArgs.map(({php:m,wire:S})=>`${c(S)} => $${m}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line(`[$authHeaders, $authQuery, $cookies] = resolveAuth(${O(n,r)}, $this->config->auth);`),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${d}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},q=p(A(n)??{kind:"unknown"},r,i),b=q==="mixed"?"mixed":q;e.line("/**"),e.line(` * ${$} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${b}>`),e.line(" */"),e.line(`public function ${$}Pages(${l.signature.join(", ")}): \\Generator`),e.block("{",()=>{f(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${$} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${a}>`),e.line(" */"),e.line(`public function ${$}Items(${l.signature.join(", ")}): \\Generator`),e.block("{",()=>{f(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${c(u??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${o??"$item"};`)},"}")},"}")},"}"),e.blank()}function Se(e){let n=e.split(`
8
8
  `),s=0;for(let r=0;r<n.length;r++)if(n[r].trim().startsWith("namespace ")){s=r+1;break}return n.slice(s).join(`
9
9
  `).trim()}var mn=({model:e,output:n,banner:s,emit:r,pagination:i})=>{let t=new x,o=r.dateType??"string",u=h(e.title,{style:"pascal",reserved:y});t.line("<?php"),t.blank(),t.line(`// Code generated by @redocly/client-generator (php) from ${c(e.title)} ${e.version}. DO NOT EDIT.`),t.line("// Regenerate with `redocly generate-client`. PHP >= 8.1, curl extension \u2014 zero Composer dependencies."),t.blank(),t.line("declare(strict_types=1);"),t.blank(),t.line(`namespace ${u};`),t.blank(),t.line(Y(e,o)),le(t,e),r.runtime==="module"?(t.line("// \u2500\u2500\u2500 Runtime (a real file beside this one, written by the same run) \u2500\u2500\u2500"),t.line("require_once __DIR__ . '/runtime.php';"),t.blank()):(t.line("// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator php runtime) \u2500\u2500\u2500"),t.line(Se(G)),t.blank());let a=e.services.flatMap(d=>d.operations),l=J(e),$=new Map;for(let d of a){let m=i?.get(d.name)?.spec;m!==void 0&&$.set(d.name,m)}t.doc("Client",`Client for ${e.title} (${e.version}).`),t.line("class Client"),t.block("{",()=>{t.block("public const OPERATIONS = [",()=>{for(let d of a){let m=d.specName??d.name,S=V(d,e),w=$.get(d.name),B=[`'id' => ${c(m)}`,`'method' => ${c(d.method.toUpperCase())}`,`'path' => ${c(d.path)}`,...S!==void 0?[`'security' => ${S}`]:[],...w!==void 0?[`'pagination' => ${ue(w)}`]:[]];t.line(`${c(m)} => [${B.join(", ")}],`)}},"];"),t.blank(),t.line("public function __construct(private Config $config)"),t.block("{",()=>{t.block("if ($this->config->serverUrl === '') {",()=>{t.line(`$this->config->serverUrl = ${c(r.serverUrl??e.serverUrl??"")};`)},"}")},"}"),t.blank();for(let d of a){let m=l.get(d.name);Z(t,d,m,e,o),U(d)===void 0&&(d.successResponseHeaders?.length??0)>0&&Z(t,d,m,e,o,!0);let S=$.get(d.name);if(S===void 0)continue;let w=A(d),B=w===void 0?void 0:P(w,"$page",e,o),R=ae(w,S.items,e),he=R===void 0?void 0:P(R,"$item",e,o);pe(t,d,m,e,o,B,he,S.items,R===void 0?"mixed":p(R,e,o))}},"}");let f={path:n.path.replace(/\.[^.\\/]+$/,".php"),content:t.toString()};if(r.runtime!=="module")return[f];let q=s.map(d=>`// ${d}`).join(`
10
10
  `),b=G.replace(/^namespace .*$/m,`namespace ${u};`).replace(/^<\?php\n/,`<?php