@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{a as V}from"./XKENZH7W.js";import{c as I,d as N,e as ue,h as G,j as _,k as me,v as B,w as H}from"./5F7XFPS7.js";import{a as ce,b as W,c as pe,d as fe}from"./44US4AGQ.js";import"./IHUHQ7PO.js";import{a as ae}from"./64G5RPLP.js";import{e as ie}from"./GKPSJEG5.js";import{Q as oe,R as v,c as y,k as O,ka as S,qa as J,va as se}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{mkdir as jt,writeFile as kt}from"node:fs/promises";import Rt from"node:path";import{performance as Jt}from"node:perf_hooks";var Be=/^[a-zA-Z][a-zA-Z0-9]*(?:[_\-.][a-zA-Z0-9]+)*$/,He=/^[0-9a-f-]{8,}$/i,ze=[["uuid",/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i],["date-time",/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/],["date",/^\d{4}-\d{2}-\d{2}$/],["email",/^[^\s@]+@[^\s@]+\.[^\s@]+$/],["uri",/^https?:\/\/\S+$/],["ipv4",/^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/]],x=new WeakMap;function z(e){return{formats:ze.filter(([,t])=>t.test(e)).map(([t])=>t),values:[e],count:1,overflow:!1}}function q(e,t){if(!e)return t;if(!t)return e;let n={formats:e.formats.filter(r=>t.formats.includes(r)),values:[],count:e.count+t.count,overflow:e.overflow||t.overflow};if(!n.overflow){let r=[...e.values];for(let s of t.values)r.includes(s)||r.push(s);r.length>10?n.overflow=!0:n.values=r}return n}function D(e,t){x.set(e,t)}function U(e){return x.get(e)}function F(e,t){let n=x.get(e);n&&x.set(t,n)}function De(e){return e.length<=30&&!He.test(e)&&Be.test(e)}function X(e,t){return e.formats.length>0?{format:e.formats[0]}:t&&!e.overflow&&e.count>=4&&e.values.length>0&&e.values.length<=5&&e.values.length*2<=e.count&&e.values.every(De)?{enum:[...e.values].sort()}:{}}function T(e){let t=x.get(e);if(t){let n=typeof e.type=="string"?[e.type]:e.type??[];n.includes("string")&&Object.assign(e,X(t,n.length===1))}for(let n of Object.values(e.properties??{}))T(n);e.additionalProperties&&T(e.additionalProperties),e.items&&T(e.items);for(let n of e.oneOf??[])T(n)}function de(e){for(let t of Object.values(e.paths))for(let n of Object.values(t)){for(let r of Object.values(n.requestBody?.content??{}))T(r.schema);for(let r of Object.values(n.responses))for(let s of Object.values(r.content??{}))T(s.schema)}for(let t of Object.values(e.components?.schemas??{}))T(t);return e}var Oe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Y=/^\d+$/,Ue=/^[0-9a-hjkmnp-tv-z]{26}$/i,Fe=/^[a-z][a-z0-9]*_(?=[0-9a-z]*\d)[0-9a-z]{10,}$/i,Le=/^[a-z](?=[a-z0-9]*\d)[a-z0-9]{23,24}$/,Q=new Set(ae),Ye=new Set(["get","head"]),le="application/x-www-form-urlencoded",he="multipart/form-data";function Ke(e){return e?Y.test(e)||Oe.test(e)||Ue.test(e)||Fe.test(e)||Le.test(e)?!0:/^[0-9a-f]{16,}$/i.test(e):!1}function ee(e){let t=e.split("/"),n=[],r=new Set;return{template:t.map((o,a)=>{if(!Ke(o))return o;let i=t[a-1],c=i?`${O(i,1)}Id`:"id",p=1;for(;r.has(c);)p+=1,c=i?`${O(i,1)}Id${p}`:`id${p}`;return r.add(c),n.push({name:c,value:o}),`{${c}}`}).join("/")||"/",params:n}}function $(e){if(e===null)return{type:"null"};if(Array.isArray(e)){if(e.length===0)return{type:"array"};let t=e.slice(0,20).map($);return{type:"array",items:E(t)}}switch(typeof e){case"string":{let t={type:"string"};return D(t,z(e)),t}case"boolean":return{type:"boolean"};case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"object":{let t=Object.entries(e);if(t.length>0&&(t.every(([a])=>Y.test(a))||t.every(([a])=>Oe.test(a))))return{type:"object",additionalProperties:E(t.map(([,a])=>$(a)))};let n={},r=[];for(let[o,a]of t)n[o]=$(a),r.push(o);let s={type:"object",properties:n};return r.length>0&&(s.required=r),s}default:return{}}}function E(e){if(e.length===0)return{};let[t,...n]=e,r=t;for(let s of n)r=L(r,s);return r}function ge(e){return Object.keys(e).length===0}function A(e){return e.additionalProperties?"map":e.type==="object"?"object":e.type==="array"?"array":"scalar"}function Z(e){return e.oneOf?e.oneOf.flatMap(Z):Array.isArray(e.type)?e.type.map(t=>{if(t==="object"){let r={type:"object"};return e.properties&&(r.properties=e.properties),e.required&&(r.required=e.required),e.additionalProperties&&(r.additionalProperties=e.additionalProperties),r}if(t==="array")return e.items?{type:"array",items:e.items}:{type:"array"};let n={type:t};return t==="string"&&F(e,n),n}):[e]}var We=.5,Xe=3;function ve(e,t){let n=Object.keys(e.properties??{}),r=Object.keys(t.properties??{});if(n.length===0||r.length===0)return 1;let s=new Set(r),o=n.filter(a=>s.has(a)).length;return o/(n.length+r.length-o)}function Ze(e,t){let n=A(e);if(n!==A(t))return!1;switch(n){case"scalar":return e.type===t.type||e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer";case"object":return ve(e,t)>=We;default:return!0}}function we(e,t){switch(A(e)){case"scalar":{if(e.type!==t.type)return{type:"number"};if(e.type==="string"){let n=q(U(e),U(t));if(n){let r={type:"string"};return D(r,n),r}}return e}case"map":return{type:"object",additionalProperties:L(e.additionalProperties??{},t.additionalProperties??{})};case"object":{let n={...e.properties??{}};for(let[a,i]of Object.entries(t.properties??{}))n[a]=n[a]?L(n[a],i):i;let r=new Set(t.required??[]),s=(e.required??[]).filter(a=>r.has(a)),o={type:"object",properties:n};return s.length>0&&(o.required=s),o}case"array":{if(!e.items||!t.items){let n=e.items??t.items;return n?{type:"array",items:n}:{type:"array"}}return{type:"array",items:L(e.items,t.items)}}}}function Qe(e){let t=[...e],n=()=>t.filter(r=>A(r)==="object").length;for(;n()>Xe;){let r=-1,s=-1,o=-1;for(let a=0;a<t.length;a++)if(A(t[a])==="object")for(let i=a+1;i<t.length;i++){if(A(t[i])!=="object")continue;let c=ve(t[a],t[i]);c>o&&(o=c,r=a,s=i)}t[r]=we(t[r],t[s]),t.splice(s,1)}return t}var et=["boolean","integer","number","string","null"];function tt(e){if(e.length===1)return e[0];let t=[],n=new Set,r;for(let i of e)A(i)==="scalar"&&typeof i.type=="string"?(n.add(i.type),i.type==="string"&&(r=q(r,U(i)))):t.push(i);let s=et.filter(i=>n.has(i)),o=i=>{let c={type:i};return(typeof i=="string"?i==="string":i.includes("string"))&&r&&D(c,r),c};if(t.length===0)return s.length===1?o(s[0]):o(s);if(t.length===1&&s.length===1&&s[0]==="null"&&typeof t[0].type=="string")return{...t[0],type:[t[0].type,"null"]};let a=[...t];return s.length===1?a.push(o(s[0])):s.length>1&&a.push(o(s)),{oneOf:a}}function L(e,t){if(ge(e)||ge(t))return{};let n=Z(e);for(let r of Z(t)){let s=n.findIndex(o=>Ze(o,r));s===-1?n.push(r):n[s]=we(n[s],r)}return tt(Qe(n))}function nt(e){if(!e)return;let t=e.trim();if(!(!t.startsWith("{")&&!t.startsWith("[")))try{return JSON.parse(t)}catch{return}}function rt(e,t){let n=t?.match(/boundary="?([^";,]+)"?/i)?.[1];if(!n)return;let r={};for(let s of e.split(`--${n}`)){let o=s.match(/^\r?\n([\s\S]*?)\r?\n\r?\n([\s\S]*)\r?\n$/);if(!o)continue;let[,a,i]=o,c=a.match(/\bname="([^"]*)"/i)?.[1];c!==void 0&&(r[c]=/\bfilename="/i.test(a)?{type:"string",format:"binary"}:$(i))}if(Object.keys(r).length!==0)return{type:"object",properties:r,required:Object.keys(r)}}function ye(e){let t=_(e.contentType);if(e.bodyJson!==void 0)return{mime:me(t)?t:"application/json",schema:$(e.bodyJson)};if(t===le&&e.bodyText){let r={};for(let[s,o]of new URLSearchParams(e.bodyText))r[s]=o;return Object.keys(r).length===0?void 0:{mime:le,schema:$(r)}}if(t===he&&e.bodyText){let r=rt(e.bodyText,e.contentType);return r?{mime:he,schema:r}:void 0}let n=nt(e.bodyText);if(n!==void 0)return{mime:"application/json",schema:$(n)}}function Se(e,t,n){let r=e.get(t);e.set(t,r?E([r,n]):n)}async function Pe(e){let t=await N(e.trafficPath);if(t.length===0)throw new Error("No traffic files found in the provided traffic path.");let n=B(e.server),r=new Map,s=new Set,o=0,a=0,i=p=>{let f=p.request.method.toLowerCase();if(!Q.has(f))return;let u=p.request.path||"/";if(n){let d=H(p.request,n);if(d===void 0)return;u=d}if(f==="query"&&e.openapiVersion==="3.1"){a+=1;return}!n&&p.request.host&&!ue(p.request.host)&&s.add(`${p.request.protocol}//${p.request.host}`);let{template:m,params:k}=ee(G(u)),P=`${f} ${m}`,l=r.get(P);l||(l={method:f,template:m,pathParams:new Map,queryParams:new Map,requestBodies:new Map,responses:new Map},r.set(P,l));for(let{name:d,value:g}of k){let h=l.pathParams.get(d);l.pathParams.set(d,{numeric:(h?.numeric??!0)&&Y.test(g),observations:q(h?.observations,z(g))})}for(let d of new Set(p.request.query.keys())){let g=p.request.query.getAll(d),h=l.queryParams.get(d),C=g.length>0&&g.every(R=>Y.test(R)),b=h?.observations;for(let R of g)b=q(b,z(R));l.queryParams.set(d,{numeric:(h?.numeric??!0)&&C,observations:b})}if(!Ye.has(f)){let d=ye(p.request);d&&Se(l.requestBodies,d.mime,d.schema)}if(p.response&&p.response.status>=100){let d=String(p.response.status),g=l.responses.get(d);g||(g={bodies:new Map},l.responses.set(d,g)),g.statusText??=p.response.statusText||void 0;let h=ye(p.response);h&&Se(g.bodies,h.mime,h.schema)}};for(let p of t){let f=await V(p,e.format);if(!f){S.warn(`Skipping traffic file with unrecognized format: ${p}
7
+ import{a as V}from"./2MF3MKAD.js";import{c as I,d as N,e as ue,h as G,j as _,k as me,v as B,w as H}from"./G7A4OE2M.js";import{a as ce,b as W,c as pe,d as fe}from"./I3YF3GEY.js";import"./MAACTVYP.js";import{a as ae}from"./64G5RPLP.js";import{e as ie}from"./YA5KTHFN.js";import{Q as oe,R as v,c as y,k as O,ka as S,qa as J,va as se}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{mkdir as jt,writeFile as kt}from"node:fs/promises";import Rt from"node:path";import{performance as Jt}from"node:perf_hooks";var Be=/^[a-zA-Z][a-zA-Z0-9]*(?:[_\-.][a-zA-Z0-9]+)*$/,He=/^[0-9a-f-]{8,}$/i,ze=[["uuid",/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i],["date-time",/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/],["date",/^\d{4}-\d{2}-\d{2}$/],["email",/^[^\s@]+@[^\s@]+\.[^\s@]+$/],["uri",/^https?:\/\/\S+$/],["ipv4",/^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/]],x=new WeakMap;function z(e){return{formats:ze.filter(([,t])=>t.test(e)).map(([t])=>t),values:[e],count:1,overflow:!1}}function q(e,t){if(!e)return t;if(!t)return e;let n={formats:e.formats.filter(r=>t.formats.includes(r)),values:[],count:e.count+t.count,overflow:e.overflow||t.overflow};if(!n.overflow){let r=[...e.values];for(let s of t.values)r.includes(s)||r.push(s);r.length>10?n.overflow=!0:n.values=r}return n}function D(e,t){x.set(e,t)}function U(e){return x.get(e)}function F(e,t){let n=x.get(e);n&&x.set(t,n)}function De(e){return e.length<=30&&!He.test(e)&&Be.test(e)}function X(e,t){return e.formats.length>0?{format:e.formats[0]}:t&&!e.overflow&&e.count>=4&&e.values.length>0&&e.values.length<=5&&e.values.length*2<=e.count&&e.values.every(De)?{enum:[...e.values].sort()}:{}}function T(e){let t=x.get(e);if(t){let n=typeof e.type=="string"?[e.type]:e.type??[];n.includes("string")&&Object.assign(e,X(t,n.length===1))}for(let n of Object.values(e.properties??{}))T(n);e.additionalProperties&&T(e.additionalProperties),e.items&&T(e.items);for(let n of e.oneOf??[])T(n)}function de(e){for(let t of Object.values(e.paths))for(let n of Object.values(t)){for(let r of Object.values(n.requestBody?.content??{}))T(r.schema);for(let r of Object.values(n.responses))for(let s of Object.values(r.content??{}))T(s.schema)}for(let t of Object.values(e.components?.schemas??{}))T(t);return e}var Oe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Y=/^\d+$/,Ue=/^[0-9a-hjkmnp-tv-z]{26}$/i,Fe=/^[a-z][a-z0-9]*_(?=[0-9a-z]*\d)[0-9a-z]{10,}$/i,Le=/^[a-z](?=[a-z0-9]*\d)[a-z0-9]{23,24}$/,Q=new Set(ae),Ye=new Set(["get","head"]),le="application/x-www-form-urlencoded",he="multipart/form-data";function Ke(e){return e?Y.test(e)||Oe.test(e)||Ue.test(e)||Fe.test(e)||Le.test(e)?!0:/^[0-9a-f]{16,}$/i.test(e):!1}function ee(e){let t=e.split("/"),n=[],r=new Set;return{template:t.map((o,a)=>{if(!Ke(o))return o;let i=t[a-1],c=i?`${O(i,1)}Id`:"id",p=1;for(;r.has(c);)p+=1,c=i?`${O(i,1)}Id${p}`:`id${p}`;return r.add(c),n.push({name:c,value:o}),`{${c}}`}).join("/")||"/",params:n}}function $(e){if(e===null)return{type:"null"};if(Array.isArray(e)){if(e.length===0)return{type:"array"};let t=e.slice(0,20).map($);return{type:"array",items:E(t)}}switch(typeof e){case"string":{let t={type:"string"};return D(t,z(e)),t}case"boolean":return{type:"boolean"};case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"object":{let t=Object.entries(e);if(t.length>0&&(t.every(([a])=>Y.test(a))||t.every(([a])=>Oe.test(a))))return{type:"object",additionalProperties:E(t.map(([,a])=>$(a)))};let n={},r=[];for(let[o,a]of t)n[o]=$(a),r.push(o);let s={type:"object",properties:n};return r.length>0&&(s.required=r),s}default:return{}}}function E(e){if(e.length===0)return{};let[t,...n]=e,r=t;for(let s of n)r=L(r,s);return r}function ge(e){return Object.keys(e).length===0}function A(e){return e.additionalProperties?"map":e.type==="object"?"object":e.type==="array"?"array":"scalar"}function Z(e){return e.oneOf?e.oneOf.flatMap(Z):Array.isArray(e.type)?e.type.map(t=>{if(t==="object"){let r={type:"object"};return e.properties&&(r.properties=e.properties),e.required&&(r.required=e.required),e.additionalProperties&&(r.additionalProperties=e.additionalProperties),r}if(t==="array")return e.items?{type:"array",items:e.items}:{type:"array"};let n={type:t};return t==="string"&&F(e,n),n}):[e]}var We=.5,Xe=3;function ve(e,t){let n=Object.keys(e.properties??{}),r=Object.keys(t.properties??{});if(n.length===0||r.length===0)return 1;let s=new Set(r),o=n.filter(a=>s.has(a)).length;return o/(n.length+r.length-o)}function Ze(e,t){let n=A(e);if(n!==A(t))return!1;switch(n){case"scalar":return e.type===t.type||e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer";case"object":return ve(e,t)>=We;default:return!0}}function we(e,t){switch(A(e)){case"scalar":{if(e.type!==t.type)return{type:"number"};if(e.type==="string"){let n=q(U(e),U(t));if(n){let r={type:"string"};return D(r,n),r}}return e}case"map":return{type:"object",additionalProperties:L(e.additionalProperties??{},t.additionalProperties??{})};case"object":{let n={...e.properties??{}};for(let[a,i]of Object.entries(t.properties??{}))n[a]=n[a]?L(n[a],i):i;let r=new Set(t.required??[]),s=(e.required??[]).filter(a=>r.has(a)),o={type:"object",properties:n};return s.length>0&&(o.required=s),o}case"array":{if(!e.items||!t.items){let n=e.items??t.items;return n?{type:"array",items:n}:{type:"array"}}return{type:"array",items:L(e.items,t.items)}}}}function Qe(e){let t=[...e],n=()=>t.filter(r=>A(r)==="object").length;for(;n()>Xe;){let r=-1,s=-1,o=-1;for(let a=0;a<t.length;a++)if(A(t[a])==="object")for(let i=a+1;i<t.length;i++){if(A(t[i])!=="object")continue;let c=ve(t[a],t[i]);c>o&&(o=c,r=a,s=i)}t[r]=we(t[r],t[s]),t.splice(s,1)}return t}var et=["boolean","integer","number","string","null"];function tt(e){if(e.length===1)return e[0];let t=[],n=new Set,r;for(let i of e)A(i)==="scalar"&&typeof i.type=="string"?(n.add(i.type),i.type==="string"&&(r=q(r,U(i)))):t.push(i);let s=et.filter(i=>n.has(i)),o=i=>{let c={type:i};return(typeof i=="string"?i==="string":i.includes("string"))&&r&&D(c,r),c};if(t.length===0)return s.length===1?o(s[0]):o(s);if(t.length===1&&s.length===1&&s[0]==="null"&&typeof t[0].type=="string")return{...t[0],type:[t[0].type,"null"]};let a=[...t];return s.length===1?a.push(o(s[0])):s.length>1&&a.push(o(s)),{oneOf:a}}function L(e,t){if(ge(e)||ge(t))return{};let n=Z(e);for(let r of Z(t)){let s=n.findIndex(o=>Ze(o,r));s===-1?n.push(r):n[s]=we(n[s],r)}return tt(Qe(n))}function nt(e){if(!e)return;let t=e.trim();if(!(!t.startsWith("{")&&!t.startsWith("[")))try{return JSON.parse(t)}catch{return}}function rt(e,t){let n=t?.match(/boundary="?([^";,]+)"?/i)?.[1];if(!n)return;let r={};for(let s of e.split(`--${n}`)){let o=s.match(/^\r?\n([\s\S]*?)\r?\n\r?\n([\s\S]*)\r?\n$/);if(!o)continue;let[,a,i]=o,c=a.match(/\bname="([^"]*)"/i)?.[1];c!==void 0&&(r[c]=/\bfilename="/i.test(a)?{type:"string",format:"binary"}:$(i))}if(Object.keys(r).length!==0)return{type:"object",properties:r,required:Object.keys(r)}}function ye(e){let t=_(e.contentType);if(e.bodyJson!==void 0)return{mime:me(t)?t:"application/json",schema:$(e.bodyJson)};if(t===le&&e.bodyText){let r={};for(let[s,o]of new URLSearchParams(e.bodyText))r[s]=o;return Object.keys(r).length===0?void 0:{mime:le,schema:$(r)}}if(t===he&&e.bodyText){let r=rt(e.bodyText,e.contentType);return r?{mime:he,schema:r}:void 0}let n=nt(e.bodyText);if(n!==void 0)return{mime:"application/json",schema:$(n)}}function Se(e,t,n){let r=e.get(t);e.set(t,r?E([r,n]):n)}async function Pe(e){let t=await N(e.trafficPath);if(t.length===0)throw new Error("No traffic files found in the provided traffic path.");let n=B(e.server),r=new Map,s=new Set,o=0,a=0,i=p=>{let f=p.request.method.toLowerCase();if(!Q.has(f))return;let u=p.request.path||"/";if(n){let d=H(p.request,n);if(d===void 0)return;u=d}if(f==="query"&&e.openapiVersion==="3.1"){a+=1;return}!n&&p.request.host&&!ue(p.request.host)&&s.add(`${p.request.protocol}//${p.request.host}`);let{template:m,params:k}=ee(G(u)),P=`${f} ${m}`,l=r.get(P);l||(l={method:f,template:m,pathParams:new Map,queryParams:new Map,requestBodies:new Map,responses:new Map},r.set(P,l));for(let{name:d,value:g}of k){let h=l.pathParams.get(d);l.pathParams.set(d,{numeric:(h?.numeric??!0)&&Y.test(g),observations:q(h?.observations,z(g))})}for(let d of new Set(p.request.query.keys())){let g=p.request.query.getAll(d),h=l.queryParams.get(d),C=g.length>0&&g.every(R=>Y.test(R)),b=h?.observations;for(let R of g)b=q(b,z(R));l.queryParams.set(d,{numeric:(h?.numeric??!0)&&C,observations:b})}if(!Ye.has(f)){let d=ye(p.request);d&&Se(l.requestBodies,d.mime,d.schema)}if(p.response&&p.response.status>=100){let d=String(p.response.status),g=l.responses.get(d);g||(g={bodies:new Map},l.responses.set(d,g)),g.statusText??=p.response.statusText||void 0;let h=ye(p.response);h&&Se(g.bodies,h.mime,h.schema)}};for(let p of t){let f=await V(p,e.format);if(!f){S.warn(`Skipping traffic file with unrecognized format: ${p}
8
8
  `);continue}o+=1;for await(let u of f.parse(p))i(u)}if(o===0)throw new J("No supported traffic files found to generate an OpenAPI description from.");if(r.size===0&&a>0)throw new J("All observed HTTP exchanges use the QUERY method, which OpenAPI 3.1 does not support. Use --openapi-version 3.2 to include them.");if(r.size===0)throw new J(n?`No HTTP exchanges in the traffic matched the server "${n}".`:"No HTTP exchanges were observed in the traffic. Cannot generate an OpenAPI description.");let c=n?[n]:Array.from(s).sort();return ot(r,e.openapiVersion,e.title??"Generated API",c)}function Te(e){return Object.values(e.paths).reduce((t,n)=>t+Object.keys(n).length,0)}function be(e,t){if(e.numeric)return{type:"integer"};let n={type:"string"};return e.observations&&Object.assign(n,X(e.observations,t)),n}function ot(e,t,n,r){let s={};for(let o of e.values()){let a=s[o.template]??={},i=[...Array.from(o.pathParams).map(([p,f])=>({name:p,in:"path",required:!0,schema:be(f,!1)})),...Array.from(o.queryParams).map(([p,f])=>({name:p,in:"query",required:!1,schema:be(f,!0)}))],c={operationId:st(o.method,o.template),responses:{}};if(i.length>0&&(c.parameters=i),o.requestBodies.size>0){let p={};for(let[f,u]of o.requestBodies)p[f]={schema:u};c.requestBody={content:p}}if(o.responses.size===0)c.responses.default={description:"Observed response"};else for(let[p,f]of o.responses){let u={description:f.statusText||"Observed response"};if(f.bodies.size>0){let m={};for(let[k,P]of f.bodies)m[k]={schema:P};u.content=m}c.responses[p]=u}a[o.method]=c}return{openapi:`${t}.0`,info:{title:n,version:"1.0.0"},...r.length>0?{servers:r.map(o=>({url:o}))}:{},paths:s}}function st(e,t){let n=t.split("/").filter(Boolean).map(r=>r.replace(/[{}]/g,"")).join("-");return`${e}-${n||"root"}`}function K(e,t){return`${e.toUpperCase()} ${t}`}function $e(e,t){let n;if(e.bodyJson!==void 0)try{n=JSON.stringify(e.bodyJson)}catch{n=void 0}if(n??=e.bodyText,!n)return;let r=n.trim();if(r)return r.length>t?`${r.slice(0,t)}\u2026[truncated]`:r}function Ae(e){if(!e)return"";let t=e.bodyJson;return t===void 0?e.bodyText?_(e.contentType)||"text":"":t===null?"null":Array.isArray(t)?`array<${t.length>0?je(t[0]):""}>`:je(t)}function je(e){return y(e)?Object.keys(e).sort().join(","):e===null?"null":typeof e}async function ke(e){let t=e.perGroup??2,n=e.perOperation??4,r=e.maxBodyChars??2e3,s=B(e.server),o=await N(e.trafficPath),a=new Map;for(let c of o){let p=await V(c,e.format);if(p)for await(let f of p.parse(c)){let u=f.request.method.toUpperCase();if(!Q.has(u.toLowerCase()))continue;let m=f.request.path||"/";if(s){let R=H(f.request,s);if(R===void 0)continue;m=R}let k=G(m),{template:P}=ee(k),l=f.response&&f.response.status>=100?f.response:void 0,d=l?.status,g=`${Ae(f.request)}\u2192${Ae(l)}`,h=a.get(K(u,P));h||(h=new Map,a.set(K(u,P),h));let C=`${d??""} ${g}`,b=h.get(C);b||(b=[],h.set(C,b)),!(b.length>=t)&&b.push({method:u,path:k,query:f.request.query.toString(),status:d,requestContentType:f.request.contentType,requestBody:$e(f.request,r),responseContentType:l?.contentType,responseBody:l?$e(l,r):void 0})}}let i=new Map;for(let[c,p]of a){let f=[];for(let u=0;u<t&&f.length<n;u++)for(let m of p.values()){if(f.length>=n)break;m[u]&&f.push(m[u])}i.set(c,f)}return i}var it=e=>`You are an expert API designer. You are given one operation from an OpenAPI ${e} description that was inferred mechanically from recorded HTTP traffic, the component schemas it references, and a sample of the real recorded HTTP exchanges for that operation. The inferred description is only a hypothesis: types are coarse, every observed property is marked required, and descriptions are missing. Alternative body shapes observed in the traffic appear as "oneOf" variants or type unions. Common string formats (uuid, date-time, date, email, uri, ipv4) and small closed enums are detected conservatively from the observed values.
9
9
 
10
10
  Refine the operation into the most accurate OpenAPI ${e} definition you can justify from the evidence, while staying conservative:
@@ -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 R}from"./TFPMT2XD.js";import{b as A,c as J,d as ie,e as W,f as ce,g as le,h as ue,i as me,j as fe}from"./QQ2PGWE6.js";import{a as te,b as se,c as x,d as b,e as v,f as j,g as L,h as P,j as O,k as N,l as re,n as oe}from"./D3C6XIMY.js";import{a as F}from"./WZXA5XPB.js";import{ka as ae}from"./4ZCKAKVF.js";var T=x.java,w=class extends te{constructor(){super(" ")}typeName(n){return b(n,{style:"pascal",reserved:T})}memberName(n){return b(n,{style:"camel",reserved:T})}identifier(n){return b(n,{style:"camel",reserved:T})}identifiers(n,s){return v(n,{style:"camel",reserved:T,taken:s})}string(n){let s='"';for(let a of n){let r=a.codePointAt(0);a==="\\"?s+="\\\\":a==='"'?s+='\\"':a===`
7
+ import{b as R}from"./TFPMT2XD.js";import{b as A,c as J,d as ie,e as W,f as ce,g as le,h as ue,i as me,j as fe}from"./BZTZIEWS.js";import{a as te,b as se,c as x,d as b,e as v,f as j,g as L,h as P,j as O,k as N,l as re,n as oe}from"./A65OW7M7.js";import{a as F}from"./WZXA5XPB.js";import{ka as ae}from"./X22IMAJK.js";var T=x.java,w=class extends te{constructor(){super(" ")}typeName(n){return b(n,{style:"pascal",reserved:T})}memberName(n){return b(n,{style:"camel",reserved:T})}identifier(n){return b(n,{style:"camel",reserved:T})}identifiers(n,s){return v(n,{style:"camel",reserved:T,taken:s})}string(n){let s='"';for(let a of n){let r=a.codePointAt(0);a==="\\"?s+="\\\\":a==='"'?s+='\\"':a===`
8
8
  `?s+="\\n":a==="\r"?s+="\\r":a===" "?s+="\\t":r<32||r===127?s+=`\\u${r.toString(16).padStart(4,"0")}`:r>=55296&&r<=57343?s+="\\uFFFD":s+=a}return s+'"'}literal(n){return n==null?"null":typeof n=="boolean"?String(n):typeof n=="number"?Number.isInteger(n)?`${n}L`:String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`java.util.List.of(${n.map(a=>this.literal(a)).join(", ")})`:`java.util.Map.of(${Object.entries(n).map(([a,r])=>`${this.string(a)}, ${this.literal(r)}`).join(", ")})`}comment(n){for(let s of de(n))this.line(s===""?"//":`// ${s}`);return this}doc(n,s){let a=de(s).map(r=>r.replaceAll("*/","*&#47;"));if(a.length===0)return this;if(a.length===1)return this.line(`/** ${n} \u2014 ${a[0]} */`);this.line("/**"),this.line(` * ${n} \u2014 ${a[0]}`);for(let r of a.slice(1))this.line(r===""?" *":` * ${r}`);return this.line(" */")}};function de(e){return re(e).map(n=>n.replaceAll("\\","\\u005c"))}var h=x.java,K=new w,$e=new Set([...[...R.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm,"").replace(/'(?:[^'\\]|\\.)'/g,"''").replace(/"(?:[^"\\]|\\.)*"/g,'""').matchAll(/\b[A-Z][A-Za-z0-9]*\b/g)].map(e=>e[0]),"Servers","Void"]);function g(e){let n=K.typeName(e);return $e.has(n)?`${n}Model`:n}function D(e){return K.memberName(e)}function c(e){return K.string(e)}function Q(e,n){let s=b(e,{style:"pascal",reserved:h});if($e.has(s))throw new F(`The output file name "${e}" gives the Java class the name "${s}", which the SDK already uses for one of its own types. Choose another --output name, for example "${e}-sdk.ts".`);let a=n.schemas.find(r=>g(r.name)===s);if(a!==void 0)throw new F(`The output file name "${e}" gives the Java class the same name as the "${a.name}" schema, which cannot nest inside it. Choose another --output name, for example "${e}-sdk.ts".`);return s}function z(e){let n=G(e);return n===""?"api":/^[0-9]/.test(n)?`_${n}`:h.has(n)||n==="java"?`${n}_`:n}function G(e){return se.pascal(e).toLowerCase()}var Se=["getClass","hashCode","equals","clone","toString","notify","notifyAll","wait","finalize"],pe=["","WithHeaders","Pages","Items"];function Z(e){let n=new Set(Se),s=new Map;for(let a of e.services.flatMap(r=>r.operations)){let r=b(a.name,{style:"camel",reserved:h}),t=r;for(let o=2;pe.some(i=>n.has(t+i));o++)t=`${r}${o}`;for(let o of pe)n.add(t+o);s.set(a.name,t)}return s}function we(e){return le(e).map(s=>s.kind==="literal"?c(s.value):D(s.name)).join(" + ")}function he(e,n){let s=n.servers??[];if(s.length===0)return;let a=new Set;e.line("/** The declared servers; the description's defaults are in each method's doc. */"),e.block("public static final class Servers {",()=>{s.forEach((r,t)=>{let o=b(r.description??`server${t+1}`,{style:"camel",reserved:h});a.has(o)&&(o=`${o}${t+1}`),a.add(o);let i=r.variables.map(u=>`String ${D(u.name)}`),l=r.variables.map(u=>`${D(u.name)} default: ${c(u.default)}`).join(", ");t>0&&e.blank(),e.doc(o,`The ${c(r.description??r.url)} base URL${l===""?".":` (${l}).`}`),e.block(`public static String ${o}(${i.join(", ")}) {`,()=>{e.line(`return ${we(r)};`)},"}")})},"}"),e.blank()}function C(e,n){let s=n.schemas.find(o=>o.name===e);if(s===void 0)return"other";let a=s.schema,r=N(a);if(r!==void 0&&(r.scalar==="string"||r.scalar==="integer"))return"enum";if((a.kind==="object"||a.kind==="intersection")&&L(a,n)!==void 0)return"record";let t=P(a,n);return t!==void 0&&t.cases.length>0&&t.cases.every(o=>C(o.schemaName,n)==="record")?"union":"other"}var ge={string:"String",integer:"Long",number:"Double",boolean:"Boolean"};function be(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function $(e,n,s="string"){let a=O(e);switch(a.kind){case"scalar":if(s==="Date"&&a.scalar==="string"){if(a.metadata?.format==="date-time")return"OffsetDateTime";if(a.metadata?.format==="date")return"LocalDate"}return ge[a.scalar];case"array":return`List<${$(a.items,n,s)}>`;case"record":return`Map<String, ${$(a.value,n,s)}>`;case"ref":{if(C(a.name,n)!=="other")return g(a.name);let t=j(a,n);return t===void 0?"Object":$(t,n,s)}case"enum":return ge[a.scalar];case"literal":return typeof a.value=="string"?"String":typeof a.value=="boolean"?"Boolean":"Double";case"omit":return $({kind:"ref",name:a.base},n,s);case"union":case"null":case"object":case"intersection":case"unknown":return"Object"}}function k(e,n,s,a,r=0){let t=O(e);switch(t.kind){case"scalar":return a==="Date"&&t.scalar==="string"&&be(t)?t.metadata?.format==="date"?`asLocalDate(${n})`:`asOffsetDateTime(${n})`:`${Y[t.scalar]}(${n})`;case"enum":return`${Y[t.scalar]}(${n})`;case"literal":return`${Y[typeof t.value=="string"?"string":typeof t.value=="boolean"?"boolean":"number"]}(${n})`;case"omit":return k({kind:"ref",name:t.base},n,s,a,r);case"ref":{let o=C(t.name,s);if(o==="record")return`${g(t.name)}.fromJson(${n})`;if(o==="enum"){let l=N(j(t,s)).scalar==="string"?"asString":"asLong";return`${g(t.name)}.fromWire(${l}(${n}))`}if(o==="union")return`parse${g(t.name)}(${n})`;let i=j(t,s);return i===void 0?void 0:k(i,n,s,a,r)}case"array":case"record":{let o=r===0?"item":`item${r+1}`,i=k(t.kind==="array"?t.items:t.value,o,s,a,r+1)??o;return`${t.kind==="array"?"asList":"asMap"}(${n}, ${o} -> ${i})`}case"union":case"null":case"object":case"intersection":case"unknown":return}}var Y={string:"asString",integer:"asLong",number:"asDouble",boolean:"asBoolean"},je=["data","json","toJson","fromJson","hashCode","equals","toString","getClass","wait","notify","notifyAll","clone","finalize"];function Ae(e,n){let s=[];for(let a of n.schemas){if(C(a.name,n)!=="union")continue;P(a.schema,n).cases.some(t=>t.schemaName===e)&&s.push(g(a.name))}return s}function Ee(e,n,s,a,r,t){let o=s.map(m=>m.writeOnly?{...m,required:!1}:m),i=v(o.map(m=>m.name),{style:"camel",reserved:h,taken:je}),l=g(n),u=["JsonValue",...Ae(n,a)];e.doc(l,t),e.block(`public record ${l}(`,()=>{o.forEach((m,f)=>{let d=f<o.length-1?",":"";e.line(`${$(m.schema,a,r)} ${i[f]}${d}`)})},`) implements ${u.join(", ")} {`),e.indent(()=>{e.block(`public static ${l} fromJson(Object json) {`,()=>{e.line("Map<String, Object> data = asObject(json);"),e.block("if (data == null) {",()=>{e.line("return null;")},"}"),e.block(`return new ${l}(`,()=>{o.forEach((m,f)=>{let d=`data.get(${c(m.name)})`,y=f<o.length-1?",":"";e.line(`${k(m.schema,d,a,r)??d}${y}`)})},");")},"}"),e.blank(),e.line("@Override"),e.block("public Map<String, Object> toJson() {",()=>{e.line("Map<String, Object> data = new LinkedHashMap<>();"),o.forEach((m,f)=>{let d=`data.put(${c(m.name)}, ${i[f]});`;m.required?e.line(d):e.block(`if (${i[f]} != null) {`,()=>{e.line(d)},"}")}),e.line("return data;")},"}")}),e.line("}"),e.blank()}function qe(e,n,s,a,r){let t=g(n),o=a==="string"?"String":"Long",i=N({kind:"enum",values:s,scalar:a}).memberNames;e.doc(t,r),e.block(`public enum ${t} implements WireValue {`,()=>{s.forEach((l,u)=>{let m=typeof l=="string"?c(l):`${l}L`;e.line(`${i[u]}(${m})${u<s.length-1?",":";"}`)}),e.blank(),e.line(`private final ${o} wire;`),e.blank(),e.block(`${t}(${o} wire) {`,()=>{e.line("this.wire = wire;")},"}"),e.blank(),e.line("@Override"),e.block(`public ${o} wire() {`,()=>{e.line("return wire;")},"}"),e.blank(),e.line("/** The member for a wire value; null for null, an exception for an unknown value. */"),e.block(`public static ${t} fromWire(${o} wire) {`,()=>{e.block("if (wire == null) {",()=>{e.line("return null;")},"}"),e.block(`for (${t} member : values()) {`,()=>{e.block("if (member.wire.equals(wire)) {",()=>{e.line("return member;")},"}")},"}"),e.line(`throw new IllegalArgumentException("Unknown ${t} value: " + wire);`)},"}")},"}"),e.blank()}function X(e,n,s="string"){for(let{name:a,schema:r}of n.schemas){let t=N(r);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){qe(e,a,t.values,t.scalar,r.description);continue}if(r.kind==="object"||r.kind==="intersection"){let i=L(r,n);if(i!==void 0){Ee(e,a,i.properties,n,s,i.description??r.description);continue}}let o=P(r,n);if(o!==void 0){let i=g(a),l=C(a,n)==="union",u=o.cases.map(m=>`${m.value} -> ${g(m.schemaName)}`).join(", ");e.doc(i,`A discriminated union on ${c(o.property)}: ${u}.`),l&&(e.line(`public sealed interface ${i} extends JsonValue {}`),e.blank()),e.block(`public static ${l?i:"Object"} parse${i}(Object json) {`,()=>{e.line("Map<String, Object> data = asObject(json);"),e.block("if (data == null) {",()=>{e.line("return null;")},"}"),e.block(`switch (String.valueOf(data.get(${c(o.property)}))) {`,()=>{for(let m of o.cases){let f={kind:"ref",name:m.schemaName},d=k(f,"data",n,s)??"data";e.line(`case ${c(m.value)}:`),e.indent(()=>e.line(`return ${d};`))}e.line("default:"),e.indent(()=>e.line(l?`throw new IllegalArgumentException("Unknown ${o.property} value: " + data.get(${c(o.property)}));`:"return data;"))},"}")},"}"),e.blank();continue}}}function Oe(e,n="string"){let s=new w;return X(s,e,n),s.toString()}function Ne(e,n){return`List.of(${ue(e,n).map(a=>`List.of(${a.map(t=>t.kind==="apiKey"?`new SecuritySpec(${c(t.scheme)}, "apiKey", ${c(t.name)}, ${c(t.in)})`:`SecuritySpec.of(${c(t.scheme)}, ${c(t.kind)})`).join(", ")})`).join(", ")})`}function Re(e){if(e===void 0)return"null";let n=s=>s===void 0?"null":c(s);return`new PaginationSpec(${[c(e.style),n(e.param),n(e.nextCursor),n(e.hasMore),n(e.nextLink),n(e.limitParam),n(e.items)].join(", ")})`}function I(e,n,s){return`new Operation(${c(e.specName??e.name)}, ${c(e.method.toUpperCase())}, ${c(e.path)}, ${Ne(e,n)}, ${Re(s)})`}function ee(e,n){let s=e.successResponseHeaders??[],a=v(s.map(t=>t.name),{style:"camel",reserved:h});return`new String[][] {${s.map((t,o)=>{let i=oe(t.schema,n);return`{${c(t.name)}, ${c(a[o])}, ${c(i)}}`}).join(", ")}}`}var Ce=["body","params","op","auth","query","url","spec","payload","response","data","headers","extraHeaders","pageParams","call","base","item","page","config"];function ye(e){return W(e)||e.requestBody!==void 0&&ce(e.requestBody.contentType)}function V(e,n,s){if(e.queryParams.length!==0)return v([`${n}Params`],{style:"pascal",reserved:h,taken:s.schemas.map(a=>g(a.name))})[0]}function U(e,n,s,a,r){let t=v(e.pathParams.map(f=>f.name),{style:"camel",reserved:h,taken:Ce}),o=v(e.queryParams.map(f=>f.name),{style:"camel",reserved:h}),i=e.pathParams.map((f,d)=>({java:t[d],wire:f.name})),l=e.queryParams.map((f,d)=>({java:o[d],wire:f.name,type:$(f.schema,s,r),isArray:j(O(f.schema),s)?.kind==="array"})),u=V(e,n,s),m=[...e.pathParams.map((f,d)=>`${$(f.schema,s,r)} ${t[d]}`),...a&&e.requestBody?[`${ye(e)?"Object":$(e.requestBody.schema,s,r)} body`]:[],...u===void 0?[]:[`${u} params`]];return{pathArgs:i,queryFields:l,paramsClass:u,signature:m}}function ve(e,n,s,a,r){let{queryFields:t,paramsClass:o}=U(n,s,a,!1,r);o!==void 0&&(e.line(`/** The query parameters of ${s}; an unset field is not sent. */`),e.block(`public static final class ${o} {`,()=>{for(let i of t)e.line(`public ${i.type} ${i.java};`);for(let i of t)e.blank(),e.block(`public ${o} ${i.java}(${i.type} ${i.java}) {`,()=>{e.line(`this.${i.java} = ${i.java};`),e.line("return this;")},"}")},"}"),e.blank())}function B(e,n,s){n.paramsClass!==void 0&&e.block("if (params != null) {",()=>{for(let a of n.queryFields)e.block(`if (params.${a.java} != null) {`,()=>{a.isArray?e.block(`for (Object item : params.${a.java}) {`,()=>{e.line(`addQuery(${s}, ${c(a.wire)}, item);`)},"}"):e.line(`addQuery(${s}, ${c(a.wire)}, params.${a.java});`)},"}")},"}")}function H(e){return`buildUrl(config.serverUrl, op.path(), pathParams(${e.pathArgs.map(({java:s,wire:a})=>`${c(a)}, textValue(${s})`).join(", ")}))`}function ne(e,n,s,a,r,t,o=!1){let i=U(n,s,a,!0,r),l=J(n),u=A(n),m=l===void 0&&u===void 0&&n.successResponses.some(S=>S.contentType!==""),f=u!==void 0?$(u,a,r):m?"byte[]":"void",d=o?`Envelope<${f==="void"?"Void":f}>`:l!==void 0?"Iterable<ServerSentEvent>":f,y=o?`${s}WithHeaders`:s;e.doc(y,o?`Like ${s}, returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`),e.block(`public ${d} ${y}(${i.signature.join(", ")}) {`,()=>{if(e.line(`Operation op = ${I(n,a,t)};`),l!==void 0){let E=l.schema!==void 0&&l.schema.kind!=="unknown";e.line("Map<String, List<String>> base = new LinkedHashMap<>();"),B(e,i,"base"),e.line(`String url = ${H(i)};`),e.block("return iterSse(extraHeaders -> {",()=>{e.line("ResolvedAuth auth = resolveAuth(op.security(), config.auth);"),e.line("Map<String, List<String>> query = cloneQuery(auth.query());"),e.line("query.putAll(base);"),e.line("Map<String, String> headers = new LinkedHashMap<>(auth.headers());"),e.line("headers.putAll(extraHeaders);"),e.line("return send(config, new RequestSpec(op.id(), op.method(), url).headers(headers).query(query));")},`}, ${E});`);return}if(e.line("ResolvedAuth auth = resolveAuth(op.security(), config.auth);"),e.line("Map<String, List<String>> query = auth.query();"),B(e,i,"query"),e.line(`String url = ${H(i)};`),e.line("RequestSpec spec = new RequestSpec(op.id(), op.method(), url).headers(auth.headers()).query(query);"),n.requestBody!==void 0){let E=c(n.requestBody.contentType),_=W(n)?"multipartBody(body)":ye(n)?`binaryBody(body, ${E})`:ie(n)?"multipartBody(body)":`jsonBody(body, ${E})`;e.line(`Body payload = ${_};`),e.line("spec.body(payload.body(), payload.contentType());")}e.line("HttpResponse<InputStream> response = send(config, spec);"),e.block("if (response.statusCode() >= 400) {",()=>{e.line("throw apiErrorFrom(response, url);")},"}");let S=m?"readBody(response)":u===void 0?void 0:k(u,"decodeJson(response)",a,r)??"decodeJson(response)";if(o){S===void 0?(e.line("readBody(response);"),e.line(`return new Envelope<>(null, readEnvelopeHeaders(response, ${ee(n,a)}), response.statusCode());`)):(e.line(`${f} data = ${S};`),e.line(`return new Envelope<>(data, readEnvelopeHeaders(response, ${ee(n,a)}), response.statusCode());`));return}if(S===void 0){e.line("readBody(response);");return}e.line(`return ${S};`)},"}"),e.blank()}function ke(e,n,s,a,r,t){let o=U(n,s,a,!1,r),i=A(n),l=i===void 0?"Object":$(i,a,r),u=me(i,t.items,a),m=u===void 0?"Object":$(u,a,r),f=i===void 0?"page":k(i,"page",a,r)??"page",d=u===void 0?"item":k(u,"item",a,r,1)??"item",y=()=>{e.line(`Operation op = ${I(n,a,t)};`),e.line("Map<String, List<String>> base = new LinkedHashMap<>();"),B(e,o,"base"),e.block("PageCall call = pageParams -> {",()=>{e.line("ResolvedAuth auth = resolveAuth(op.security(), config.auth);"),e.line("Map<String, List<String>> query = cloneQuery(auth.query());"),e.line("query.putAll(pageParams);"),e.line(`String url = ${H(o)};`),e.line("HttpResponse<InputStream> response = send(config, new RequestSpec(op.id(), op.method(), url).headers(auth.headers()).query(query));"),e.block("if (response.statusCode() >= 400) {",()=>{e.line("throw apiErrorFrom(response, url);")},"}"),e.line("return new PageResult(decodeJson(response), response);")},"};")};e.line(`/** ${s} response pages, following the pagination rule automatically. */`),e.block(`public Iterable<${l}> ${s}Pages(${o.signature.join(", ")}) {`,()=>{y(),e.line(`return mapIterable(iterPages(call, op.pagination(), base), page -> ${f});`)},"}"),e.blank(),e.line(`/** The items of every ${s} page. */`),e.block(`public Iterable<${m}> ${s}Items(${o.signature.join(", ")}) {`,()=>{y(),e.line(`return mapIterable(flattenItems(iterPages(call, op.pagination(), base), op.pagination().items()), item -> ${d});`)},"}"),e.blank()}function Pe(){return R.split(`
9
9
  `).filter(e=>e.startsWith("import "))}function Je(){let e=R.split(`
10
10
  `),n=e.findIndex(a=>a.startsWith("abstract class Runtime {")),s=e.lastIndexOf("}");return e.slice(n+1,s).map(a=>a.startsWith(" ")?a.slice(4):a)}var En=({model:e,output:n,banner:s,emit:a,pagination:r})=>{let t=new w,o=a.dateType??"string",i=Q(n.stem,e),l=z(e.title);l!==G(e.title)&&ae.warn(`generate-client: the API title ${JSON.stringify(e.title)} cannot be a Java package as is, so the java SDK uses package "${l}" \u2014 rename the API title in the description to choose another.
@@ -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 x,b as y,c as g,d}from"./HIMEF7J2.js";import{b as P,d as h,e as m}from"./4AXMK6B2.js";import{m as v}from"./D3C6XIMY.js";import{join as B}from"node:path";function b(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[I(n,t,r),...n.some(s=>M(s,r))?[j]:[],...n.filter(y).map(s=>F(s,t.queryKeyPrefix)),S(e,n,r,t.queryKeyPrefix,t.argsStyle),...E(n,r)].join(`
7
+ import{a as x,b as y,c as g,d}from"./HM7M6465.js";import{b as P,d as h,e as m}from"./ZXB5O6JQ.js";import{m as v}from"./A65OW7M7.js";import{join as B}from"node:path";function b(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[I(n,t,r),...n.some(s=>M(s,r))?[j]:[],...n.filter(y).map(s=>F(s,t.queryKeyPrefix)),S(e,n,r,t.queryKeyPrefix,t.argsStyle),...E(n,r)].join(`
8
8
  `)}function p(e,t){if(!y(e))return!1;let n=t.get(e.name);return n===void 0||n.spec.style==="link"?!1:n.spec.style!=="body-link"||e.queryParams.length>0}function M(e,t){return p(e,t)&&t.get(e.name)?.spec.style==="body-link"}var j=`/** The query parameters of a next-page link; a repeated key becomes an array. */
9
9
  const nextLinkQuery = (link: string) => {
10
10
  const query: Record<string, string | string[]> = {};
@@ -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 Ate,b as Ote}from"./VO775J6V.js";import{d as Rte}from"./D2BBHPMR.js";import{b as Ete,e as Tte}from"./GKPSJEG5.js";import{T as xte,X as wte,c as bte,ga as wP,ka as o1,la as Cte,ma as kte,qa as k2,ta as Ste,u as yte}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import{a as ru,b as vte,c as ar,d as Mqe,e as yl,f as Dqe}from"./RFWIIJFG.js";var Ute=ar(tn=>{"use strict";var SP=Symbol.for("react.transitional.element"),Fqe=Symbol.for("react.portal"),zqe=Symbol.for("react.fragment"),Bqe=Symbol.for("react.strict_mode"),Uqe=Symbol.for("react.profiler"),Hqe=Symbol.for("react.consumer"),Vqe=Symbol.for("react.context"),Wqe=Symbol.for("react.forward_ref"),Gqe=Symbol.for("react.suspense"),jqe=Symbol.for("react.memo"),Lte=Symbol.for("react.lazy"),Yqe=Symbol.for("react.activity"),Ite=Symbol.iterator;function qqe(i){return i===null||typeof i!="object"?null:(i=Ite&&i[Ite]||i["@@iterator"],typeof i=="function"?i:null)}var Mte={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dte=Object.assign,Fte={};function E2(i,s,u){this.props=i,this.context=s,this.refs=Fte,this.updater=u||Mte}E2.prototype.isReactComponent={};E2.prototype.setState=function(i,s){if(typeof i!="object"&&typeof i!="function"&&i!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,i,s,"setState")};E2.prototype.forceUpdate=function(i){this.updater.enqueueForceUpdate(this,i,"forceUpdate")};function zte(){}zte.prototype=E2.prototype;function EP(i,s,u){this.props=i,this.context=s,this.refs=Fte,this.updater=u||Mte}var TP=EP.prototype=new zte;TP.constructor=EP;Dte(TP,E2.prototype);TP.isPureReactComponent=!0;var _te=Array.isArray;function kP(){}var Yi={H:null,A:null,T:null,S:null},Bte=Object.prototype.hasOwnProperty;function AP(i,s,u){var h=u.ref;return{$$typeof:SP,type:i,key:s,ref:h!==void 0?h:null,props:u}}function Zqe(i,s){return AP(i.type,s,i.props)}function RP(i){return typeof i=="object"&&i!==null&&i.$$typeof===SP}function Kqe(i){var s={"=":"=0",":":"=2"};return"$"+i.replace(/[=:]/g,function(u){return s[u]})}var Pte=/\/+/g;function CP(i,s){return typeof i=="object"&&i!==null&&i.key!=null?Kqe(""+i.key):s.toString(36)}function Xqe(i){switch(i.status){case"fulfilled":return i.value;case"rejected":throw i.reason;default:switch(typeof i.status=="string"?i.then(kP,kP):(i.status="pending",i.then(function(s){i.status==="pending"&&(i.status="fulfilled",i.value=s)},function(s){i.status==="pending"&&(i.status="rejected",i.reason=s)})),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason}}throw i}function S2(i,s,u,h,m){var S=typeof i;(S==="undefined"||S==="boolean")&&(i=null);var v=!1;if(i===null)v=!0;else switch(S){case"bigint":case"string":case"number":v=!0;break;case"object":switch(i.$$typeof){case SP:case Fqe:v=!0;break;case Lte:return v=i._init,S2(v(i._payload),s,u,h,m)}}if(v)return m=m(i),v=h===""?"."+CP(i,0):h,_te(m)?(u="",v!=null&&(u=v.replace(Pte,"$&/")+"/"),S2(m,s,u,"",function(I){return I})):m!=null&&(RP(m)&&(m=Zqe(m,u+(m.key==null||i&&i.key===m.key?"":(""+m.key).replace(Pte,"$&/")+"/")+v)),s.push(m)),1;v=0;var N=h===""?".":h+":";if(_te(i))for(var O=0;O<i.length;O++)h=i[O],S=N+CP(h,O),v+=S2(h,s,u,S,m);else if(O=qqe(i),typeof O=="function")for(i=O.call(i),O=0;!(h=i.next()).done;)h=h.value,S=N+CP(h,O++),v+=S2(h,s,u,S,m);else if(S==="object"){if(typeof i.then=="function")return S2(Xqe(i),s,u,h,m);throw s=String(i),Error("Objects are not valid as a React child (found: "+(s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}return v}function s6(i,s,u){if(i==null)return i;var h=[],m=0;return S2(i,h,"","",function(S){return s.call(u,S,m++)}),h}function Jqe(i){if(i._status===-1){var s=i._result;s=s(),s.then(function(u){(i._status===0||i._status===-1)&&(i._status=1,i._result=u)},function(u){(i._status===0||i._status===-1)&&(i._status=2,i._result=u)}),i._status===-1&&(i._status=0,i._result=s)}if(i._status===1)return i._result.default;throw i._result}var Nte=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Qqe={map:s6,forEach:function(i,s,u){s6(i,function(){s.apply(this,arguments)},u)},count:function(i){var s=0;return s6(i,function(){s++}),s},toArray:function(i){return s6(i,function(s){return s})||[]},only:function(i){if(!RP(i))throw Error("React.Children.only expected to receive a single React element child.");return i}};tn.Activity=Yqe;tn.Children=Qqe;tn.Component=E2;tn.Fragment=zqe;tn.Profiler=Uqe;tn.PureComponent=EP;tn.StrictMode=Bqe;tn.Suspense=Gqe;tn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Yi;tn.__COMPILER_RUNTIME={__proto__:null,c:function(i){return Yi.H.useMemoCache(i)}};tn.cache=function(i){return function(){return i.apply(null,arguments)}};tn.cacheSignal=function(){return null};tn.cloneElement=function(i,s,u){if(i==null)throw Error("The argument must be a React element, but you passed "+i+".");var h=Dte({},i.props),m=i.key;if(s!=null)for(S in s.key!==void 0&&(m=""+s.key),s)!Bte.call(s,S)||S==="key"||S==="__self"||S==="__source"||S==="ref"&&s.ref===void 0||(h[S]=s[S]);var S=arguments.length-2;if(S===1)h.children=u;else if(1<S){for(var v=Array(S),N=0;N<S;N++)v[N]=arguments[N+2];h.children=v}return AP(i.type,m,h)};tn.createContext=function(i){return i={$$typeof:Vqe,_currentValue:i,_currentValue2:i,_threadCount:0,Provider:null,Consumer:null},i.Provider=i,i.Consumer={$$typeof:Hqe,_context:i},i};tn.createElement=function(i,s,u){var h,m={},S=null;if(s!=null)for(h in s.key!==void 0&&(S=""+s.key),s)Bte.call(s,h)&&h!=="key"&&h!=="__self"&&h!=="__source"&&(m[h]=s[h]);var v=arguments.length-2;if(v===1)m.children=u;else if(1<v){for(var N=Array(v),O=0;O<v;O++)N[O]=arguments[O+2];m.children=N}if(i&&i.defaultProps)for(h in v=i.defaultProps,v)m[h]===void 0&&(m[h]=v[h]);return AP(i,S,m)};tn.createRef=function(){return{current:null}};tn.forwardRef=function(i){return{$$typeof:Wqe,render:i}};tn.isValidElement=RP;tn.lazy=function(i){return{$$typeof:Lte,_payload:{_status:-1,_result:i},_init:Jqe}};tn.memo=function(i,s){return{$$typeof:jqe,type:i,compare:s===void 0?null:s}};tn.startTransition=function(i){var s=Yi.T,u={};Yi.T=u;try{var h=i(),m=Yi.S;m!==null&&m(u,h),typeof h=="object"&&h!==null&&typeof h.then=="function"&&h.then(kP,Nte)}catch(S){Nte(S)}finally{s!==null&&u.types!==null&&(s.types=u.types),Yi.T=s}};tn.unstable_useCacheRefresh=function(){return Yi.H.useCacheRefresh()};tn.use=function(i){return Yi.H.use(i)};tn.useActionState=function(i,s,u){return Yi.H.useActionState(i,s,u)};tn.useCallback=function(i,s){return Yi.H.useCallback(i,s)};tn.useContext=function(i){return Yi.H.useContext(i)};tn.useDebugValue=function(){};tn.useDeferredValue=function(i,s){return Yi.H.useDeferredValue(i,s)};tn.useEffect=function(i,s){return Yi.H.useEffect(i,s)};tn.useEffectEvent=function(i){return Yi.H.useEffectEvent(i)};tn.useId=function(){return Yi.H.useId()};tn.useImperativeHandle=function(i,s,u){return Yi.H.useImperativeHandle(i,s,u)};tn.useInsertionEffect=function(i,s){return Yi.H.useInsertionEffect(i,s)};tn.useLayoutEffect=function(i,s){return Yi.H.useLayoutEffect(i,s)};tn.useMemo=function(i,s){return Yi.H.useMemo(i,s)};tn.useOptimistic=function(i,s){return Yi.H.useOptimistic(i,s)};tn.useReducer=function(i,s,u){return Yi.H.useReducer(i,s,u)};tn.useRef=function(i){return Yi.H.useRef(i)};tn.useState=function(i){return Yi.H.useState(i)};tn.useSyncExternalStore=function(i,s,u){return Yi.H.useSyncExternalStore(i,s,u)};tn.useTransition=function(){return Yi.H.useTransition()};tn.version="19.2.7"});var Hte=ar((Jr,l6)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function i(ee,Ee){Object.defineProperty(h.prototype,ee,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Ee[0],Ee[1])}})}function s(ee){return ee===null||typeof ee!="object"?null:(ee=Nr&&ee[Nr]||ee["@@iterator"],typeof ee=="function"?ee:null)}function u(ee,Ee){ee=(ee=ee.constructor)&&(ee.displayName||ee.name)||"ReactClass";var tt=ee+"."+Ee;yn[tt]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Ee,ee),yn[tt]=!0)}function h(ee,Ee,tt){this.props=ee,this.context=Ee,this.refs=Pn,this.updater=tt||ur}function m(){}function S(ee,Ee,tt){this.props=ee,this.context=Ee,this.refs=Pn,this.updater=tt||ur}function v(){}function N(ee){return""+ee}function O(ee){try{N(ee);var Ee=!1}catch{Ee=!0}if(Ee){Ee=console;var tt=Ee.error,ht=typeof Symbol=="function"&&Symbol.toStringTag&&ee[Symbol.toStringTag]||ee.constructor.name||"Object";return tt.call(Ee,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ht),N(ee)}}function I(ee){if(ee==null)return null;if(typeof ee=="function")return ee.$$typeof===$n?null:ee.displayName||ee.name||null;if(typeof ee=="string")return ee;switch(ee){case _n:return"Fragment";case Me:return"Profiler";case cr:return"StrictMode";case Gt:return"Suspense";case Mt:return"SuspenseList";case hr:return"Activity"}if(typeof ee=="object")switch(typeof ee.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),ee.$$typeof){case kr:return"Portal";case wt:return ee.displayName||"Context";case nt:return(ee._context.displayName||"Context")+".Consumer";case or:var Ee=ee.render;return ee=ee.displayName,ee||(ee=Ee.displayName||Ee.name||"",ee=ee!==""?"ForwardRef("+ee+")":"ForwardRef"),ee;case yt:return Ee=ee.displayName||null,Ee!==null?Ee:I(ee.type)||"Memo";case er:Ee=ee._payload,ee=ee._init;try{return I(ee(Ee))}catch{}}return null}function H(ee){if(ee===_n)return"<>";if(typeof ee=="object"&&ee!==null&&ee.$$typeof===er)return"<...>";try{var Ee=I(ee);return Ee?"<"+Ee+">":"<...>"}catch{return"<...>"}}function M(){var ee=br.A;return ee===null?null:ee.getOwner()}function Y(){return Error("react-stack-top-frame")}function J(ee){if(lo.call(ee,"key")){var Ee=Object.getOwnPropertyDescriptor(ee,"key").get;if(Ee&&Ee.isReactWarning)return!1}return ee.key!==void 0}function we(ee,Ee){function tt(){Un||(Un=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Ee))}tt.isReactWarning=!0,Object.defineProperty(ee,"key",{get:tt,configurable:!0})}function ke(){var ee=I(this.type);return Eo[ee]||(Eo[ee]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),ee=this.props.ref,ee!==void 0?ee:null}function pe(ee,Ee,tt,ht,_t,qt){var Kt=tt.ref;return ee={$$typeof:lr,type:ee,key:Ee,props:tt,_owner:ht},(Kt!==void 0?Kt:null)!==null?Object.defineProperty(ee,"ref",{enumerable:!1,get:ke}):Object.defineProperty(ee,"ref",{enumerable:!1,value:null}),ee._store={},Object.defineProperty(ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(ee,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(ee,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:_t}),Object.defineProperty(ee,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:qt}),Object.freeze&&(Object.freeze(ee.props),Object.freeze(ee)),ee}function Fe(ee,Ee){return Ee=pe(ee.type,Ee,ee.props,ee._owner,ee._debugStack,ee._debugTask),ee._store&&(Ee._store.validated=ee._store.validated),Ee}function ze(ee){ft(ee)?ee._store&&(ee._store.validated=1):typeof ee=="object"&&ee!==null&&ee.$$typeof===er&&(ee._payload.status==="fulfilled"?ft(ee._payload.value)&&ee._payload.value._store&&(ee._payload.value._store.validated=1):ee._store&&(ee._store.validated=1))}function ft(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===lr}function St(ee){var Ee={"=":"=0",":":"=2"};return"$"+ee.replace(/[=:]/g,function(tt){return Ee[tt]})}function mt(ee,Ee){return typeof ee=="object"&&ee!==null&&ee.key!=null?(O(ee.key),St(""+ee.key)):Ee.toString(36)}function Ve(ee){switch(ee.status){case"fulfilled":return ee.value;case"rejected":throw ee.reason;default:switch(typeof ee.status=="string"?ee.then(v,v):(ee.status="pending",ee.then(function(Ee){ee.status==="pending"&&(ee.status="fulfilled",ee.value=Ee)},function(Ee){ee.status==="pending"&&(ee.status="rejected",ee.reason=Ee)})),ee.status){case"fulfilled":return ee.value;case"rejected":throw ee.reason}}throw ee}function Lt(ee,Ee,tt,ht,_t){var qt=typeof ee;(qt==="undefined"||qt==="boolean")&&(ee=null);var Kt=!1;if(ee===null)Kt=!0;else switch(qt){case"bigint":case"string":case"number":Kt=!0;break;case"object":switch(ee.$$typeof){case lr:case kr:Kt=!0;break;case er:return Kt=ee._init,Lt(Kt(ee._payload),Ee,tt,ht,_t)}}if(Kt){Kt=ee,_t=_t(Kt);var Pr=ht===""?"."+mt(Kt,0):ht;return xn(_t)?(tt="",Pr!=null&&(tt=Pr.replace(Bo,"$&/")+"/"),Lt(_t,Ee,tt,"",function(Dr){return Dr})):_t!=null&&(ft(_t)&&(_t.key!=null&&(Kt&&Kt.key===_t.key||O(_t.key)),tt=Fe(_t,tt+(_t.key==null||Kt&&Kt.key===_t.key?"":(""+_t.key).replace(Bo,"$&/")+"/")+Pr),ht!==""&&Kt!=null&&ft(Kt)&&Kt.key==null&&Kt._store&&!Kt._store.validated&&(tt._store.validated=2),_t=tt),Ee.push(_t)),1}if(Kt=0,Pr=ht===""?".":ht+":",xn(ee))for(var yr=0;yr<ee.length;yr++)ht=ee[yr],qt=Pr+mt(ht,yr),Kt+=Lt(ht,Ee,tt,qt,_t);else if(yr=s(ee),typeof yr=="function")for(yr===ee.entries&&(kn||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),kn=!0),ee=yr.call(ee),yr=0;!(ht=ee.next()).done;)ht=ht.value,qt=Pr+mt(ht,yr++),Kt+=Lt(ht,Ee,tt,qt,_t);else if(qt==="object"){if(typeof ee.then=="function")return Lt(Ve(ee),Ee,tt,ht,_t);throw Ee=String(ee),Error("Objects are not valid as a React child (found: "+(Ee==="[object Object]"?"object with keys {"+Object.keys(ee).join(", ")+"}":Ee)+"). If you meant to render a collection of children, use an array instead.")}return Kt}function It(ee,Ee,tt){if(ee==null)return ee;var ht=[],_t=0;return Lt(ee,ht,"","",function(qt){return Ee.call(tt,qt,_t++)}),ht}function Pt(ee){if(ee._status===-1){var Ee=ee._ioInfo;Ee!=null&&(Ee.start=Ee.end=performance.now()),Ee=ee._result;var tt=Ee();if(tt.then(function(_t){if(ee._status===0||ee._status===-1){ee._status=1,ee._result=_t;var qt=ee._ioInfo;qt!=null&&(qt.end=performance.now()),tt.status===void 0&&(tt.status="fulfilled",tt.value=_t)}},function(_t){if(ee._status===0||ee._status===-1){ee._status=2,ee._result=_t;var qt=ee._ioInfo;qt!=null&&(qt.end=performance.now()),tt.status===void 0&&(tt.status="rejected",tt.reason=_t)}}),Ee=ee._ioInfo,Ee!=null){Ee.value=tt;var ht=tt.displayName;typeof ht=="string"&&(Ee.name=ht)}ee._status===-1&&(ee._status=0,ee._result=tt)}if(ee._status===1)return Ee=ee._result,Ee===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
+ import{a as Ate,b as Ote}from"./I2JZXLJ6.js";import{d as Rte}from"./PTBPNZRZ.js";import{b as Ete,e as Tte}from"./YA5KTHFN.js";import{T as xte,X as wte,c as bte,ga as wP,ka as o1,la as Cte,ma as kte,qa as k2,ta as Ste,u as yte}from"./X22IMAJK.js";import"./6RTITFQA.js";import{a as ru,b as vte,c as ar,d as Mqe,e as yl,f as Dqe}from"./RFWIIJFG.js";var Ute=ar(tn=>{"use strict";var SP=Symbol.for("react.transitional.element"),Fqe=Symbol.for("react.portal"),zqe=Symbol.for("react.fragment"),Bqe=Symbol.for("react.strict_mode"),Uqe=Symbol.for("react.profiler"),Hqe=Symbol.for("react.consumer"),Vqe=Symbol.for("react.context"),Wqe=Symbol.for("react.forward_ref"),Gqe=Symbol.for("react.suspense"),jqe=Symbol.for("react.memo"),Lte=Symbol.for("react.lazy"),Yqe=Symbol.for("react.activity"),Ite=Symbol.iterator;function qqe(i){return i===null||typeof i!="object"?null:(i=Ite&&i[Ite]||i["@@iterator"],typeof i=="function"?i:null)}var Mte={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dte=Object.assign,Fte={};function E2(i,s,u){this.props=i,this.context=s,this.refs=Fte,this.updater=u||Mte}E2.prototype.isReactComponent={};E2.prototype.setState=function(i,s){if(typeof i!="object"&&typeof i!="function"&&i!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,i,s,"setState")};E2.prototype.forceUpdate=function(i){this.updater.enqueueForceUpdate(this,i,"forceUpdate")};function zte(){}zte.prototype=E2.prototype;function EP(i,s,u){this.props=i,this.context=s,this.refs=Fte,this.updater=u||Mte}var TP=EP.prototype=new zte;TP.constructor=EP;Dte(TP,E2.prototype);TP.isPureReactComponent=!0;var _te=Array.isArray;function kP(){}var Yi={H:null,A:null,T:null,S:null},Bte=Object.prototype.hasOwnProperty;function AP(i,s,u){var h=u.ref;return{$$typeof:SP,type:i,key:s,ref:h!==void 0?h:null,props:u}}function Zqe(i,s){return AP(i.type,s,i.props)}function RP(i){return typeof i=="object"&&i!==null&&i.$$typeof===SP}function Kqe(i){var s={"=":"=0",":":"=2"};return"$"+i.replace(/[=:]/g,function(u){return s[u]})}var Pte=/\/+/g;function CP(i,s){return typeof i=="object"&&i!==null&&i.key!=null?Kqe(""+i.key):s.toString(36)}function Xqe(i){switch(i.status){case"fulfilled":return i.value;case"rejected":throw i.reason;default:switch(typeof i.status=="string"?i.then(kP,kP):(i.status="pending",i.then(function(s){i.status==="pending"&&(i.status="fulfilled",i.value=s)},function(s){i.status==="pending"&&(i.status="rejected",i.reason=s)})),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason}}throw i}function S2(i,s,u,h,m){var S=typeof i;(S==="undefined"||S==="boolean")&&(i=null);var v=!1;if(i===null)v=!0;else switch(S){case"bigint":case"string":case"number":v=!0;break;case"object":switch(i.$$typeof){case SP:case Fqe:v=!0;break;case Lte:return v=i._init,S2(v(i._payload),s,u,h,m)}}if(v)return m=m(i),v=h===""?"."+CP(i,0):h,_te(m)?(u="",v!=null&&(u=v.replace(Pte,"$&/")+"/"),S2(m,s,u,"",function(I){return I})):m!=null&&(RP(m)&&(m=Zqe(m,u+(m.key==null||i&&i.key===m.key?"":(""+m.key).replace(Pte,"$&/")+"/")+v)),s.push(m)),1;v=0;var N=h===""?".":h+":";if(_te(i))for(var O=0;O<i.length;O++)h=i[O],S=N+CP(h,O),v+=S2(h,s,u,S,m);else if(O=qqe(i),typeof O=="function")for(i=O.call(i),O=0;!(h=i.next()).done;)h=h.value,S=N+CP(h,O++),v+=S2(h,s,u,S,m);else if(S==="object"){if(typeof i.then=="function")return S2(Xqe(i),s,u,h,m);throw s=String(i),Error("Objects are not valid as a React child (found: "+(s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}return v}function s6(i,s,u){if(i==null)return i;var h=[],m=0;return S2(i,h,"","",function(S){return s.call(u,S,m++)}),h}function Jqe(i){if(i._status===-1){var s=i._result;s=s(),s.then(function(u){(i._status===0||i._status===-1)&&(i._status=1,i._result=u)},function(u){(i._status===0||i._status===-1)&&(i._status=2,i._result=u)}),i._status===-1&&(i._status=0,i._result=s)}if(i._status===1)return i._result.default;throw i._result}var Nte=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Qqe={map:s6,forEach:function(i,s,u){s6(i,function(){s.apply(this,arguments)},u)},count:function(i){var s=0;return s6(i,function(){s++}),s},toArray:function(i){return s6(i,function(s){return s})||[]},only:function(i){if(!RP(i))throw Error("React.Children.only expected to receive a single React element child.");return i}};tn.Activity=Yqe;tn.Children=Qqe;tn.Component=E2;tn.Fragment=zqe;tn.Profiler=Uqe;tn.PureComponent=EP;tn.StrictMode=Bqe;tn.Suspense=Gqe;tn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Yi;tn.__COMPILER_RUNTIME={__proto__:null,c:function(i){return Yi.H.useMemoCache(i)}};tn.cache=function(i){return function(){return i.apply(null,arguments)}};tn.cacheSignal=function(){return null};tn.cloneElement=function(i,s,u){if(i==null)throw Error("The argument must be a React element, but you passed "+i+".");var h=Dte({},i.props),m=i.key;if(s!=null)for(S in s.key!==void 0&&(m=""+s.key),s)!Bte.call(s,S)||S==="key"||S==="__self"||S==="__source"||S==="ref"&&s.ref===void 0||(h[S]=s[S]);var S=arguments.length-2;if(S===1)h.children=u;else if(1<S){for(var v=Array(S),N=0;N<S;N++)v[N]=arguments[N+2];h.children=v}return AP(i.type,m,h)};tn.createContext=function(i){return i={$$typeof:Vqe,_currentValue:i,_currentValue2:i,_threadCount:0,Provider:null,Consumer:null},i.Provider=i,i.Consumer={$$typeof:Hqe,_context:i},i};tn.createElement=function(i,s,u){var h,m={},S=null;if(s!=null)for(h in s.key!==void 0&&(S=""+s.key),s)Bte.call(s,h)&&h!=="key"&&h!=="__self"&&h!=="__source"&&(m[h]=s[h]);var v=arguments.length-2;if(v===1)m.children=u;else if(1<v){for(var N=Array(v),O=0;O<v;O++)N[O]=arguments[O+2];m.children=N}if(i&&i.defaultProps)for(h in v=i.defaultProps,v)m[h]===void 0&&(m[h]=v[h]);return AP(i,S,m)};tn.createRef=function(){return{current:null}};tn.forwardRef=function(i){return{$$typeof:Wqe,render:i}};tn.isValidElement=RP;tn.lazy=function(i){return{$$typeof:Lte,_payload:{_status:-1,_result:i},_init:Jqe}};tn.memo=function(i,s){return{$$typeof:jqe,type:i,compare:s===void 0?null:s}};tn.startTransition=function(i){var s=Yi.T,u={};Yi.T=u;try{var h=i(),m=Yi.S;m!==null&&m(u,h),typeof h=="object"&&h!==null&&typeof h.then=="function"&&h.then(kP,Nte)}catch(S){Nte(S)}finally{s!==null&&u.types!==null&&(s.types=u.types),Yi.T=s}};tn.unstable_useCacheRefresh=function(){return Yi.H.useCacheRefresh()};tn.use=function(i){return Yi.H.use(i)};tn.useActionState=function(i,s,u){return Yi.H.useActionState(i,s,u)};tn.useCallback=function(i,s){return Yi.H.useCallback(i,s)};tn.useContext=function(i){return Yi.H.useContext(i)};tn.useDebugValue=function(){};tn.useDeferredValue=function(i,s){return Yi.H.useDeferredValue(i,s)};tn.useEffect=function(i,s){return Yi.H.useEffect(i,s)};tn.useEffectEvent=function(i){return Yi.H.useEffectEvent(i)};tn.useId=function(){return Yi.H.useId()};tn.useImperativeHandle=function(i,s,u){return Yi.H.useImperativeHandle(i,s,u)};tn.useInsertionEffect=function(i,s){return Yi.H.useInsertionEffect(i,s)};tn.useLayoutEffect=function(i,s){return Yi.H.useLayoutEffect(i,s)};tn.useMemo=function(i,s){return Yi.H.useMemo(i,s)};tn.useOptimistic=function(i,s){return Yi.H.useOptimistic(i,s)};tn.useReducer=function(i,s,u){return Yi.H.useReducer(i,s,u)};tn.useRef=function(i){return Yi.H.useRef(i)};tn.useState=function(i){return Yi.H.useState(i)};tn.useSyncExternalStore=function(i,s,u){return Yi.H.useSyncExternalStore(i,s,u)};tn.useTransition=function(){return Yi.H.useTransition()};tn.version="19.2.7"});var Hte=ar((Jr,l6)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function i(ee,Ee){Object.defineProperty(h.prototype,ee,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Ee[0],Ee[1])}})}function s(ee){return ee===null||typeof ee!="object"?null:(ee=Nr&&ee[Nr]||ee["@@iterator"],typeof ee=="function"?ee:null)}function u(ee,Ee){ee=(ee=ee.constructor)&&(ee.displayName||ee.name)||"ReactClass";var tt=ee+"."+Ee;yn[tt]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Ee,ee),yn[tt]=!0)}function h(ee,Ee,tt){this.props=ee,this.context=Ee,this.refs=Pn,this.updater=tt||ur}function m(){}function S(ee,Ee,tt){this.props=ee,this.context=Ee,this.refs=Pn,this.updater=tt||ur}function v(){}function N(ee){return""+ee}function O(ee){try{N(ee);var Ee=!1}catch{Ee=!0}if(Ee){Ee=console;var tt=Ee.error,ht=typeof Symbol=="function"&&Symbol.toStringTag&&ee[Symbol.toStringTag]||ee.constructor.name||"Object";return tt.call(Ee,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ht),N(ee)}}function I(ee){if(ee==null)return null;if(typeof ee=="function")return ee.$$typeof===$n?null:ee.displayName||ee.name||null;if(typeof ee=="string")return ee;switch(ee){case _n:return"Fragment";case Me:return"Profiler";case cr:return"StrictMode";case Gt:return"Suspense";case Mt:return"SuspenseList";case hr:return"Activity"}if(typeof ee=="object")switch(typeof ee.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),ee.$$typeof){case kr:return"Portal";case wt:return ee.displayName||"Context";case nt:return(ee._context.displayName||"Context")+".Consumer";case or:var Ee=ee.render;return ee=ee.displayName,ee||(ee=Ee.displayName||Ee.name||"",ee=ee!==""?"ForwardRef("+ee+")":"ForwardRef"),ee;case yt:return Ee=ee.displayName||null,Ee!==null?Ee:I(ee.type)||"Memo";case er:Ee=ee._payload,ee=ee._init;try{return I(ee(Ee))}catch{}}return null}function H(ee){if(ee===_n)return"<>";if(typeof ee=="object"&&ee!==null&&ee.$$typeof===er)return"<...>";try{var Ee=I(ee);return Ee?"<"+Ee+">":"<...>"}catch{return"<...>"}}function M(){var ee=br.A;return ee===null?null:ee.getOwner()}function Y(){return Error("react-stack-top-frame")}function J(ee){if(lo.call(ee,"key")){var Ee=Object.getOwnPropertyDescriptor(ee,"key").get;if(Ee&&Ee.isReactWarning)return!1}return ee.key!==void 0}function we(ee,Ee){function tt(){Un||(Un=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Ee))}tt.isReactWarning=!0,Object.defineProperty(ee,"key",{get:tt,configurable:!0})}function ke(){var ee=I(this.type);return Eo[ee]||(Eo[ee]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),ee=this.props.ref,ee!==void 0?ee:null}function pe(ee,Ee,tt,ht,_t,qt){var Kt=tt.ref;return ee={$$typeof:lr,type:ee,key:Ee,props:tt,_owner:ht},(Kt!==void 0?Kt:null)!==null?Object.defineProperty(ee,"ref",{enumerable:!1,get:ke}):Object.defineProperty(ee,"ref",{enumerable:!1,value:null}),ee._store={},Object.defineProperty(ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(ee,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(ee,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:_t}),Object.defineProperty(ee,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:qt}),Object.freeze&&(Object.freeze(ee.props),Object.freeze(ee)),ee}function Fe(ee,Ee){return Ee=pe(ee.type,Ee,ee.props,ee._owner,ee._debugStack,ee._debugTask),ee._store&&(Ee._store.validated=ee._store.validated),Ee}function ze(ee){ft(ee)?ee._store&&(ee._store.validated=1):typeof ee=="object"&&ee!==null&&ee.$$typeof===er&&(ee._payload.status==="fulfilled"?ft(ee._payload.value)&&ee._payload.value._store&&(ee._payload.value._store.validated=1):ee._store&&(ee._store.validated=1))}function ft(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===lr}function St(ee){var Ee={"=":"=0",":":"=2"};return"$"+ee.replace(/[=:]/g,function(tt){return Ee[tt]})}function mt(ee,Ee){return typeof ee=="object"&&ee!==null&&ee.key!=null?(O(ee.key),St(""+ee.key)):Ee.toString(36)}function Ve(ee){switch(ee.status){case"fulfilled":return ee.value;case"rejected":throw ee.reason;default:switch(typeof ee.status=="string"?ee.then(v,v):(ee.status="pending",ee.then(function(Ee){ee.status==="pending"&&(ee.status="fulfilled",ee.value=Ee)},function(Ee){ee.status==="pending"&&(ee.status="rejected",ee.reason=Ee)})),ee.status){case"fulfilled":return ee.value;case"rejected":throw ee.reason}}throw ee}function Lt(ee,Ee,tt,ht,_t){var qt=typeof ee;(qt==="undefined"||qt==="boolean")&&(ee=null);var Kt=!1;if(ee===null)Kt=!0;else switch(qt){case"bigint":case"string":case"number":Kt=!0;break;case"object":switch(ee.$$typeof){case lr:case kr:Kt=!0;break;case er:return Kt=ee._init,Lt(Kt(ee._payload),Ee,tt,ht,_t)}}if(Kt){Kt=ee,_t=_t(Kt);var Pr=ht===""?"."+mt(Kt,0):ht;return xn(_t)?(tt="",Pr!=null&&(tt=Pr.replace(Bo,"$&/")+"/"),Lt(_t,Ee,tt,"",function(Dr){return Dr})):_t!=null&&(ft(_t)&&(_t.key!=null&&(Kt&&Kt.key===_t.key||O(_t.key)),tt=Fe(_t,tt+(_t.key==null||Kt&&Kt.key===_t.key?"":(""+_t.key).replace(Bo,"$&/")+"/")+Pr),ht!==""&&Kt!=null&&ft(Kt)&&Kt.key==null&&Kt._store&&!Kt._store.validated&&(tt._store.validated=2),_t=tt),Ee.push(_t)),1}if(Kt=0,Pr=ht===""?".":ht+":",xn(ee))for(var yr=0;yr<ee.length;yr++)ht=ee[yr],qt=Pr+mt(ht,yr),Kt+=Lt(ht,Ee,tt,qt,_t);else if(yr=s(ee),typeof yr=="function")for(yr===ee.entries&&(kn||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),kn=!0),ee=yr.call(ee),yr=0;!(ht=ee.next()).done;)ht=ht.value,qt=Pr+mt(ht,yr++),Kt+=Lt(ht,Ee,tt,qt,_t);else if(qt==="object"){if(typeof ee.then=="function")return Lt(Ve(ee),Ee,tt,ht,_t);throw Ee=String(ee),Error("Objects are not valid as a React child (found: "+(Ee==="[object Object]"?"object with keys {"+Object.keys(ee).join(", ")+"}":Ee)+"). If you meant to render a collection of children, use an array instead.")}return Kt}function It(ee,Ee,tt){if(ee==null)return ee;var ht=[],_t=0;return Lt(ee,ht,"","",function(qt){return Ee.call(tt,qt,_t++)}),ht}function Pt(ee){if(ee._status===-1){var Ee=ee._ioInfo;Ee!=null&&(Ee.start=Ee.end=performance.now()),Ee=ee._result;var tt=Ee();if(tt.then(function(_t){if(ee._status===0||ee._status===-1){ee._status=1,ee._result=_t;var qt=ee._ioInfo;qt!=null&&(qt.end=performance.now()),tt.status===void 0&&(tt.status="fulfilled",tt.value=_t)}},function(_t){if(ee._status===0||ee._status===-1){ee._status=2,ee._result=_t;var qt=ee._ioInfo;qt!=null&&(qt.end=performance.now()),tt.status===void 0&&(tt.status="rejected",tt.reason=_t)}}),Ee=ee._ioInfo,Ee!=null){Ee.value=tt;var ht=tt.displayName;typeof ht=="string"&&(Ee.name=ht)}ee._status===-1&&(ee._status=0,ee._result=tt)}if(ee._status===1)return Ee=ee._result,Ee===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
8
8
 
9
9
  Your code should look like:
10
10
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -4,5 +4,5 @@ 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 p,b as a}from"./FM7Y6KMP.js";import{h as c,m as l}from"./TVUYXOSQ.js";import"./KFQC57GK.js";import{ka as i,qa as n}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function w({argv:e,config:s,version:f}){let[r,o,...g]=e.project.split("/");if(!r||!o||g.length>0)throw new n(`Specify the project as \`<organization>/<project>\`, for example \`acme/developer-portal\`. Got: \`${e.project}\`.`);let t=c(s,e.residency),m=l(t,r,o),d=p(t,f);i.info(`Cloning ${r}/${o} from ${t}
7
+ import{a as p,b as a}from"./XTI7EXWX.js";import{h as c,m as l}from"./FLQQ3VRQ.js";import"./KFQC57GK.js";import{ka as i,qa as n}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function w({argv:e,config:s,version:f}){let[r,o,...g]=e.project.split("/");if(!r||!o||g.length>0)throw new n(`Specify the project as \`<organization>/<project>\`, for example \`acme/developer-portal\`. Got: \`${e.project}\`.`);let t=c(s,e.residency),m=l(t,r,o),d=p(t,f);i.info(`Cloning ${r}/${o} from ${t}
8
8
  `);let{code:j}=await a(["clone",...d.flatMap(C=>["--config",C]),"--",m,e.directory??o]);if(j!==0)throw new n("git clone failed.")}export{w as handleProjectClone};
@@ -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,g}from"./RC4LK3ZS.js";import"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
7
+ import{a,b,c,d,e,f,g}from"./WEPGHS5R.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
@@ -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{a as X}from"./KFQC57GK.js";import{Ca as J,j as z,k as O,n as G,o as V,qa as g,va as Y}from"./4ZCKAKVF.js";import{e as W}from"./RFWIIJFG.js";var te=W(X(),1);var C=W(X(),1);function Z(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function K(o){let t=process.env.NO_PROXY||process.env.no_proxy;if(!t)return!1;let e=t.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(e.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return e.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var Q=async(o,{timeout:t,...e}={})=>{let r=Z(),s=r&&!K(o),n;s?n=new C.ProxyAgent({uri:r}):t&&(n=new C.Agent({connect:{timeout:t}}));try{return await(0,C.fetch)(o,{signal:t?AbortSignal.timeout(t):void 0,...e,dispatcher:n})}catch(i){throw await n?.destroy(),i}};var fe=/^[\x21-\x7e]+( [\x21-\x7e]+)*$/;function ee(){let o=process.env.REDOCLY_ENVIRONMENT?.trim();return o&&fe.test(o)?o:void 0}var u=class extends Error{status;constructor(t,e){super(t),this.status=e}},h=class{command;version;sunsetWarnings=[];constructor(t,e="2.0"){this.command=t,this.version=e}async request(t,e){let r=ee(),s={...e.headers,"user-agent":`redocly-cli/${this.version} ${this.command}${r?` ${r}`:""}`};try{let n=await Q(t,{...e,headers:s});return this.collectSunsetWarning(n),n}catch(n){let i=n.cause??n,a=`Failed to fetch. Caused by ${i.message||i.name}.`;throw typeof i.code=="string"&&(a+=` Code: ${i.code}`),new Error(a)}}collectSunsetWarning(t){let e=this.getSunsetDate(t);if(!e)return;let r=new Date(e);e>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(t){let{headers:e}=t;if(!e)return;let r=e.get("sunset")||e.get("Sunset");if(r)return Date.parse(r)}},P=class{client;domain;authHeaders;constructor(t,e,r){this.client=t,this.domain=e,this.authHeaders=r}projectUrl(t,e){return`${this.domain}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}`}async fetchJson(t,e,r){try{let s=await this.client.request(t,{...e,headers:{"Content-Type":"application/json",...this.authHeaders}});return await this.getParsedResponse(s)}catch(s){let n=`${r}. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}async getParsedResponse(t){let e=await t.json();if(t.ok)return e;throw new u(`${e.title||t.statusText||"Unknown error"}.`,t.status)}},k=class extends P{async find(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",...this.authHeaders}});return r.status===404?void 0:await this.getParsedResponse(r)}catch(r){let s=`Failed to fetch project. ${r.message}`;throw r instanceof u?new u(s,r.status):new Error(s)}}},D=class extends P{async getDefaultBranch(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/sources`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",...this.authHeaders}}),s=await this.getParsedResponse(r),[n]=s.data;if(!n)throw new Error("Project source not found.");return n.branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof u?new u(s,r.status):new Error(s)}}async upsert(t,e,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/remotes`,{timeout:6e3,method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}async push(t,e,r,s){let n=new te.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let a=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await me(i.stream)]);n.append(`files[${i.path}]`,a,i.path)}r.isMainBranch&&n.append("isMainBranch","true"),r.replace&&n.append("replace","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes`,{method:"POST",headers:{...this.authHeaders},body:n});return await this.getParsedResponse(i)}catch(i){let a=`Failed to push. ${i.message}`;throw i instanceof u?new u(a,i.status):new Error(a)}}async getPush({organizationId:t,projectId:e,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes/${r}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",...this.authHeaders}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}},F=class extends P{create(t,e,r){return this.fetchJson(`${this.projectUrl(t,e)}/pull-requests`,{method:"POST",body:JSON.stringify(r)},"Failed to open a pull request")}async findLatest(t,e,r){let s=new URLSearchParams({branchName:r,limit:"1"}),{data:n}=await this.fetchJson(`${this.projectUrl(t,e)}/pull-requests?${s}`,{method:"GET",timeout:6e3},"Failed to get the pull request");return n[0]}listChecks(t,e,r){return this.fetchJson(`${this.projectUrl(t,e)}/pull-requests/${encodeURIComponent(r)}/checks`,{method:"GET",timeout:6e3},"Failed to get the checks")}},j=class extends P{async findLatestByCommit(t,e,r){let s=new URLSearchParams({limit:"1",filter:`commitHash:${r}`}),{data:n}=await this.fetchJson(`${this.projectUrl(t,e)}/builds?${s}`,{method:"GET",timeout:6e3},"Failed to get the build");return n[0]}},y=class{apiClient;projects;remotes;constructor({domain:t,apiKey:e,command:r,version:s}){this.apiClient=new h(r,s);let n={Authorization:`Bearer ${e}`};this.projects=new k(this.apiClient,t,n),this.remotes=new D(this.apiClient,t,n)}getSunsetWarning(){return re(this.apiClient.sunsetWarnings)}};function re(o){let[t]=[...o].sort((e,r)=>e.isSunsetExpired!==r.isSunsetExpired?e.isSunsetExpired?-1:1:e.sunsetDate>r.sunsetDate?1:-1);return t}async function me(o){let t=[];for await(let e of o)t.push(e);return Buffer.concat(t)}function ge(){if(process.env.REDOCLY_AUTHORIZATION)return process.env.REDOCLY_AUTHORIZATION;throw new Error("No api key provided, please use environment variable REDOCLY_AUTHORIZATION.")}var we=/^http:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/,E={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function ye(){return process.env.REDOCLY_DOMAIN||E.us}var ne=ve((o,t)=>{try{let e=t||o?.resolvedConfig.residency;return Te(e)?E[e]:e?new URL(e).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:E.us}catch{throw new $}});function S(o){try{ne(void 0,o)}catch{return!1}return!0}function ve(o){return(...t)=>{let e=o(...t);if(!e.startsWith("https://")&&!we.test(e))throw new $;return e}}var $=class extends Error{constructor(){super("Invalid Reunite URL")}};function Te(o){return typeof o=="string"&&o in E}import{Buffer as L}from"node:buffer";import A from"node:crypto";import{mkdirSync as Re,existsSync as oe,writeFileSync as Ce,readFileSync as Pe,rmSync as xe}from"node:fs";import{homedir as Ue}from"node:os";import ie from"node:path";import*as se from"node:child_process";var v=class{baseUrl;apiClient;clientName="redocly-cli";constructor(t,e){this.baseUrl=t,this.apiClient=new h("login",e)}async run(t){let e=await this.getDeviceCode();t?.({verificationUri:e.verificationUri,verificationUriComplete:e.verificationUriComplete,userCode:e.userCode}),this.openBrowser(e.verificationUriComplete);let r=await this.pollingAccessToken(e.deviceCode,e.interval,e.expiresIn);return this.withResidency(r)}openBrowser(t){if(!/^https?:\/\//.test(t))return;let[e,r]=process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:process.platform==="darwin"?["open",[t]]:["xdg-open",[t]];se.spawn(e,r,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}async verifyToken(t){try{return!!(await this.sendRequest("/session","GET",void 0,{Cookie:`accessToken=${t};`})).user}catch{return!1}}async verifyApiKey(t){try{return!!(await this.sendRequest("/api-keys-verify","POST",{apiKey:t})).success}catch{return!1}}async refreshToken(t){let e=await this.sendRequest("/device-rotate-token","POST",{grant_type:"refresh_token",client_name:this.clientName,refresh_token:t});if(!e.access_token)throw new Error("Failed to refresh token");return this.withResidency({access_token:e.access_token,refresh_token:e.refresh_token,expires_in:e.expires_in})}async pollingAccessToken(t,e,r){return new Promise((s,n)=>{let i=setInterval(async()=>{let c=await this.getAccessToken(t);c.access_token&&(clearInterval(i),clearTimeout(a),s(c)),c.error&&c.error!=="authorization_pending"&&(clearInterval(i),clearTimeout(a),n(c.error_description))},e*1e3),a=setTimeout(async()=>{clearInterval(i),clearTimeout(a),n("Authorization has expired. Please try again.")},r*1e3)})}async getAccessToken(t){return await this.sendRequest("/device-token","POST",{client_name:this.clientName,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})}async getDeviceCode(){let{device_code:t,user_code:e,verification_uri:r,verification_uri_complete:s,interval:n=10,expires_in:i=300}=await this.sendRequest("/device-authorize","POST",{client_name:this.clientName});return{deviceCode:t,userCode:e,verificationUri:r,verificationUriComplete:s,interval:n,expiresIn:i}}async sendRequest(t,e="GET",r=void 0,s={}){let n=`${this.baseUrl}/api${t}`,i=await this.apiClient.request(n,{body:r&&JSON.stringify(r),method:e,headers:{"Content-Type":"application/json",...s},timeout:6e3});return i.status===204?{success:!0}:await i.json()}withResidency(t){return{...t,residency:this.baseUrl}}};var Ee="4618dbc9-8aed-4e27-aaf0-225f4603e5a4",ae="aes-256-cbc",H=class{version;credentialsFolderPath;credentialsFilePath;credentialsFileName;key;iv;constructor(t){this.version=t;let e=Ue();this.credentialsFolderPath=ie.join(e,".redocly"),this.credentialsFileName="credentials",this.credentialsFilePath=ie.join(this.credentialsFolderPath,this.credentialsFileName),this.key=A.createHash("sha256").update(`${this.credentialsFolderPath}${Ee}`).digest(),this.iv=A.createHash("md5").update(this.credentialsFolderPath).digest(),Re(this.credentialsFolderPath,{recursive:!0})}async login(t,e){let s=await new v(t,this.version).run(e);if(!s)throw new Error("Failed to login. No credentials received.");await this.saveCredentials(s)}async logout(){try{this.removeCredentials()}catch{}}async isAuthorized(t,e){return e?new v(t,this.version).verifyApiKey(e):!!await this.getAccessToken(t)}getAccessToken=async t=>{let e=new v(t,this.version),r=await this.readCredentials();if(!r||!S(t)||r.residency&&r.residency!==t)return null;if(await e.verifyToken(r.access_token))return r.access_token;try{let n=await e.refreshToken(r.refresh_token);return await this.saveCredentials(n),n.access_token}catch{return null}};async saveCredentials(t){try{let e=this.encryptCredentials(t);Ce(this.credentialsFilePath,e,"utf8")}catch(e){throw new Error(`Failed to save credentials: ${e.message}`)}}async readCredentials(){if(!oe(this.credentialsFilePath))return null;try{let t=Pe(this.credentialsFilePath,"utf8");return this.decryptCredentials(t)}catch{return null}}async removeCredentials(){oe(this.credentialsFilePath)&&xe(this.credentialsFilePath)}encryptCredentials(t){let e=A.createCipheriv(ae,this.key,this.iv);return L.concat([e.update(JSON.stringify(t),"utf8"),e.final()]).toString("hex")}decryptCredentials(t){let e=A.createDecipheriv(ae,this.key,this.iv),r=L.concat([e.update(L.from(t,"hex")),e.final()]);return JSON.parse(r.toString("utf8"))}};var $e=/^(https?:\/\/[^/]+)\/api\/orgs\/([^/]+)\/projects\/([^/]+)\/git\/?$/;function Se(o,t,e){return`${o}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}/git`}function _e(o){let[,t,e,r]=o.match($e)??[];if(!(!t||!e||!r||!S(t)))return{reuniteUrl:t,organization:decodeURIComponent(e),project:decodeURIComponent(r)}}async function Ie({branch:o,title:t,description:e,base:r,draft:s,...n}){let{pullRequests:i}=ce(n,"project pr create");return i.create(n.organization,n.project,{branchName:o,title:t,description:e,targetBranchName:r,isDraft:s})}async function Fe({branch:o,...t}){let{pullRequests:e,builds:r}=ce(t,"project pr status"),{organization:s,project:n}=t,i=await e.findLatest(s,n,o);if(!i)return;let[a,c]=await Promise.all([e.listChecks(s,n,i.id),i.headCommitHash?r.findLatestByCommit(s,n,i.headCommitHash):void 0]);return{pullRequest:i,checks:a,previewUrl:c?.deploymentStatus==="SUCCESS"?c.url:void 0}}function ce({reuniteUrl:o,accessToken:t,version:e},r){let s=new h(r,e),n={Cookie:`accessToken=${t}`};return{pullRequests:new F(s,o,n),builds:new j(s,o,n)}}import*as T from"node:fs";import*as p from"node:path";var je=/\/orgs\/([^/]+)\/projects\//,Ae=[401,403];async function x(o,{organization:t,project:e,onSlugDeprecated:r}){let s=await Ne(o,t,e);if(!s)return{organizationId:t,projectId:e};let n={organizationId:Oe(s.uri),projectId:s.id};return(n.organizationId!==t||n.projectId!==e)&&r?.(n),n}async function Ne(o,t,e){try{let r=await o.projects.find(t,e);if(!r)throw new u(`Project "${e}" was not found in organization "${t}". Use the IDs from the organization and project settings in Reunite.`,404);return r}catch(r){if(r instanceof u&&Ae.includes(r.status))return;throw r}}function Oe(o){let t=o.match(je)?.[1];if(!t)throw new Error(`Could not read the organization ID from the project URI "${o}".`);return t}async function ke({domain:o,apiKey:t,organization:e,project:r,mountPath:s,files:n,defaultBranch:i,commit:a,version:c,replace:_,onUploadStart:I,onSunsetWarning:R,onSlugDeprecated:N}){let f=new y({domain:o,apiKey:t,command:"push",version:c});try{let{organizationId:d,projectId:l}=await x(f,{organization:e,project:r,onSlugDeprecated:N}),b=await f.remotes.getDefaultBranch(d,l),m=await f.remotes.upsert(d,l,{mountBranchName:b,mountPath:s});I?.(m);let{id:U}=await f.remotes.push(d,l,{remoteId:m.id,commit:a,isMainBranch:i===a.branchName,replace:_},n.map(M=>({path:G(M.name),stream:T.createReadStream(M.path)})));return{pushId:U,organizationId:d,projectId:l}}finally{let d=f.getSunsetWarning();d&&R?.(d)}}function De(o,t){let e={};for(let s of o)if(T.statSync(s).isDirectory()){let n=s;ue(n,[]).forEach(a=>r(a,n))}else r(s,p.dirname(s));function r(s,n){let i=p.relative(n,s);e[i]&&t?.(e[i],s),e[i]=s}return Object.entries(e).map(([s,n])=>({name:s,path:p.resolve(n)}))}function ue(o,t){let e=T.readdirSync(o);for(let r of e){let s=p.join(o,r);T.statSync(s).isDirectory()?t=ue(s,t):t.push(s)}return t}async function le({operation:o,condition:t,onConditionNotMet:e,startTime:r=Date.now(),retryTimeoutMs:s=6e5,retryIntervalMs:n=5e3}){async function i(){let a=await o();if(t(a))return a;if(Date.now()-r>s)throw new Error("Timeout exceeded.");return await e?.(a),await z(n),i()}return i()}var Le=1200,He=5e3,qe=["pending","running"];async function Be(o){let t=de(o);try{let e=await x(t,o);return await pe(t,e,o.pushId)}finally{he(t,o)}}async function be({buildType:o,maxExecutionTime:t=Le,retryIntervalMs:e=He,startTime:r=Date.now(),onRetry:s,...n}){let i=de(n);try{let a=await x(i,n);return await le({operation:()=>pe(i,a,n.pushId),condition:c=>!qe.includes(c.status[o].deploy.status),onConditionNotMet:s,startTime:r,retryTimeoutMs:t*1e3,retryIntervalMs:e})}finally{he(i,n)}}function de({domain:o,apiKey:t,version:e}){return new y({domain:o,apiKey:t,command:"push-status",version:e})}function he(o,{onSunsetWarning:t}){let e=o.getSunsetWarning();e&&t?.(e)}function pe(o,{organizationId:t,projectId:e},r){return o.remotes.getPush({organizationId:t,projectId:e,pushId:r})}async function Me({projectUrl:o,auth:t,isApiKey:e=!1,onDebug:r}){let s=We(o);if(!s)throw new g(`Invalid project URL format: ${o}`);try{let n=await ze({...s,auth:t,isApiKey:e,onDebug:r}),i=n.config.scorecardClassic||n.config.scorecard;if(!i)throw new Error("No scorecard configuration found.");let a=n.config.pluginsUrl,c=a?await Ge(a,r):void 0;return{scorecard:i,plugins:c,pluginsUrl:a}}catch(n){throw new g(n instanceof Error?n.message:String(n))}}function We(o){let t=new URL(o),e=t.pathname.match(/\/org\/(?<orgSlug>[^/]+)\/project\/(?<projectSlug>[^/]+)/);if(!e?.groups)return;let{orgSlug:r,projectSlug:s}=e.groups;return{residency:t.origin,orgSlug:r,projectSlug:s}}async function ze({residency:o,orgSlug:t,projectSlug:e,auth:r,isApiKey:s,onDebug:n}){let i=new URL(`${o}/api/orgs/${t}/projects/${e}`),a=await fetch(i,{headers:Ve(r,s)});if(n?.(`Project fetch response status: ${a.status}`),a.status===401||a.status===403)throw n?.(`Authentication failed with status ${a.status}.`),n?.("Check that your credentials are valid and have the necessary permissions."),new Error(`Unauthorized access to project: ${e}. Please check your credentials.`);if(a.status!==200)throw new Error(`Failed to fetch project: ${e}. Status: ${a.status}`);return n?.("Successfully received project configuration."),a.json()}async function Ge(o,t){t?.(`Fetching plugins from: ${o}`);try{let e=await fetch(o);if(t?.(`Plugins fetch response status: ${e.status}`),e.status!==200){t?.("Failed to fetch plugins");return}return e.text()}catch(e){t?.(`Error fetching plugins: ${e instanceof Error?e.message:String(e)}`);return}}function Ve(o,t){return t?{Authorization:`Bearer ${o}`}:{Cookie:`accessToken=${o}`}}async function q(o,t,e=[],r=[],s){let n={};for(let i of e){let a={[i.name]:{root:o,rules:t}},c=await Y({apis:a,...i,plugins:r},{configPath:s});n[i.name]=c.forAlias(i.name)}return n}function B(o,t){if(o){for(let e of o)if(Object.entries(e.where?.metadata||{}).every(([s,n])=>Ye(s,n,t)))return e}}function Ye(o,t,e){if(t.match(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}Z)?\/(\d{4}-\d{2}-\d{2})?$/)){if(!e[o])return!1;let[r,s]=t.split("/"),n=new Date(e[o]);return!(n<new Date(r)||s&&n>new Date(s))}else if(t.match(/^\/.*\//)){if(!e[o])return!1;try{return V(t).test(e[o])}catch{throw new g(`Invalid regex in scorecard target "${o}": ${t}`)}}return e[o]===t}import{pathToFileURL as Je}from"node:url";async function Xe(o,t){if(!o)return[];let e=Je(t??process.cwd()).href+"/",r=o.replaceAll("__redocly_dirname",`"${e}"`);return(await import(`data:text/javascript;base64,${btoa(r)}`)).default.map(i=>i())}var Ze=".redocly.com";function Ke(o){try{return new URL(o).hostname.toLowerCase().endsWith(Ze)}catch{return!1}}async function Qe({apiPath:o,document:t,externalRefResolver:e,scorecardConfig:r,configPath:s,plugins:n=[],targetLevel:i,metadata:a={},onDebug:c}){let _=[],I=new Map,R=r.levels||[];if(i&&!R.some(l=>l.name===i))throw new g(`Target level "${i}" not found in the scorecard configuration levels.
7
+ import{a as X}from"./KFQC57GK.js";import{Ca as J,j as z,k as O,n as G,o as V,qa as g,va as Y}from"./X22IMAJK.js";import{e as W}from"./RFWIIJFG.js";var te=W(X(),1);var C=W(X(),1);function Z(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function K(o){let t=process.env.NO_PROXY||process.env.no_proxy;if(!t)return!1;let e=t.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(e.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return e.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var Q=async(o,{timeout:t,...e}={})=>{let r=Z(),s=r&&!K(o),n;s?n=new C.ProxyAgent({uri:r}):t&&(n=new C.Agent({connect:{timeout:t}}));try{return await(0,C.fetch)(o,{signal:t?AbortSignal.timeout(t):void 0,...e,dispatcher:n})}catch(i){throw await n?.destroy(),i}};var fe=/^[\x21-\x7e]+( [\x21-\x7e]+)*$/;function ee(){let o=process.env.REDOCLY_ENVIRONMENT?.trim();return o&&fe.test(o)?o:void 0}var u=class extends Error{status;constructor(t,e){super(t),this.status=e}},h=class{command;version;sunsetWarnings=[];constructor(t,e="2.0"){this.command=t,this.version=e}async request(t,e){let r=ee(),s={...e.headers,"user-agent":`redocly-cli/${this.version} ${this.command}${r?` ${r}`:""}`};try{let n=await Q(t,{...e,headers:s});return this.collectSunsetWarning(n),n}catch(n){let i=n.cause??n,a=`Failed to fetch. Caused by ${i.message||i.name}.`;throw typeof i.code=="string"&&(a+=` Code: ${i.code}`),new Error(a)}}collectSunsetWarning(t){let e=this.getSunsetDate(t);if(!e)return;let r=new Date(e);e>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(t){let{headers:e}=t;if(!e)return;let r=e.get("sunset")||e.get("Sunset");if(r)return Date.parse(r)}},P=class{client;domain;authHeaders;constructor(t,e,r){this.client=t,this.domain=e,this.authHeaders=r}projectUrl(t,e){return`${this.domain}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}`}async fetchJson(t,e,r){try{let s=await this.client.request(t,{...e,headers:{"Content-Type":"application/json",...this.authHeaders}});return await this.getParsedResponse(s)}catch(s){let n=`${r}. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}async getParsedResponse(t){let e=await t.json();if(t.ok)return e;throw new u(`${e.title||t.statusText||"Unknown error"}.`,t.status)}},k=class extends P{async find(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",...this.authHeaders}});return r.status===404?void 0:await this.getParsedResponse(r)}catch(r){let s=`Failed to fetch project. ${r.message}`;throw r instanceof u?new u(s,r.status):new Error(s)}}},D=class extends P{async getDefaultBranch(t,e){try{let r=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/sources`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",...this.authHeaders}}),s=await this.getParsedResponse(r),[n]=s.data;if(!n)throw new Error("Project source not found.");return n.branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof u?new u(s,r.status):new Error(s)}}async upsert(t,e,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/remotes`,{timeout:6e3,method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}async push(t,e,r,s){let n=new te.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let a=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await me(i.stream)]);n.append(`files[${i.path}]`,a,i.path)}r.isMainBranch&&n.append("isMainBranch","true"),r.replace&&n.append("replace","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes`,{method:"POST",headers:{...this.authHeaders},body:n});return await this.getParsedResponse(i)}catch(i){let a=`Failed to push. ${i.message}`;throw i instanceof u?new u(a,i.status):new Error(a)}}async getPush({organizationId:t,projectId:e,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${t}/projects/${e}/pushes/${r}`,{timeout:6e3,method:"GET",headers:{"Content-Type":"application/json",...this.authHeaders}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof u?new u(n,s.status):new Error(n)}}},F=class extends P{create(t,e,r){return this.fetchJson(`${this.projectUrl(t,e)}/pull-requests`,{method:"POST",body:JSON.stringify(r)},"Failed to open a pull request")}async findLatest(t,e,r){let s=new URLSearchParams({branchName:r,limit:"1"}),{data:n}=await this.fetchJson(`${this.projectUrl(t,e)}/pull-requests?${s}`,{method:"GET",timeout:6e3},"Failed to get the pull request");return n[0]}listChecks(t,e,r){return this.fetchJson(`${this.projectUrl(t,e)}/pull-requests/${encodeURIComponent(r)}/checks`,{method:"GET",timeout:6e3},"Failed to get the checks")}},j=class extends P{async findLatestByCommit(t,e,r){let s=new URLSearchParams({limit:"1",filter:`commitHash:${r}`}),{data:n}=await this.fetchJson(`${this.projectUrl(t,e)}/builds?${s}`,{method:"GET",timeout:6e3},"Failed to get the build");return n[0]}},y=class{apiClient;projects;remotes;constructor({domain:t,apiKey:e,command:r,version:s}){this.apiClient=new h(r,s);let n={Authorization:`Bearer ${e}`};this.projects=new k(this.apiClient,t,n),this.remotes=new D(this.apiClient,t,n)}getSunsetWarning(){return re(this.apiClient.sunsetWarnings)}};function re(o){let[t]=[...o].sort((e,r)=>e.isSunsetExpired!==r.isSunsetExpired?e.isSunsetExpired?-1:1:e.sunsetDate>r.sunsetDate?1:-1);return t}async function me(o){let t=[];for await(let e of o)t.push(e);return Buffer.concat(t)}function ge(){if(process.env.REDOCLY_AUTHORIZATION)return process.env.REDOCLY_AUTHORIZATION;throw new Error("No api key provided, please use environment variable REDOCLY_AUTHORIZATION.")}var we=/^http:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/,E={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function ye(){return process.env.REDOCLY_DOMAIN||E.us}var ne=ve((o,t)=>{try{let e=t||o?.resolvedConfig.residency;return Te(e)?E[e]:e?new URL(e).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:E.us}catch{throw new $}});function S(o){try{ne(void 0,o)}catch{return!1}return!0}function ve(o){return(...t)=>{let e=o(...t);if(!e.startsWith("https://")&&!we.test(e))throw new $;return e}}var $=class extends Error{constructor(){super("Invalid Reunite URL")}};function Te(o){return typeof o=="string"&&o in E}import{Buffer as L}from"node:buffer";import A from"node:crypto";import{mkdirSync as Re,existsSync as oe,writeFileSync as Ce,readFileSync as Pe,rmSync as xe}from"node:fs";import{homedir as Ue}from"node:os";import ie from"node:path";import*as se from"node:child_process";var v=class{baseUrl;apiClient;clientName="redocly-cli";constructor(t,e){this.baseUrl=t,this.apiClient=new h("login",e)}async run(t){let e=await this.getDeviceCode();t?.({verificationUri:e.verificationUri,verificationUriComplete:e.verificationUriComplete,userCode:e.userCode}),this.openBrowser(e.verificationUriComplete);let r=await this.pollingAccessToken(e.deviceCode,e.interval,e.expiresIn);return this.withResidency(r)}openBrowser(t){if(!/^https?:\/\//.test(t))return;let[e,r]=process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:process.platform==="darwin"?["open",[t]]:["xdg-open",[t]];se.spawn(e,r,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}async verifyToken(t){try{return!!(await this.sendRequest("/session","GET",void 0,{Cookie:`accessToken=${t};`})).user}catch{return!1}}async verifyApiKey(t){try{return!!(await this.sendRequest("/api-keys-verify","POST",{apiKey:t})).success}catch{return!1}}async refreshToken(t){let e=await this.sendRequest("/device-rotate-token","POST",{grant_type:"refresh_token",client_name:this.clientName,refresh_token:t});if(!e.access_token)throw new Error("Failed to refresh token");return this.withResidency({access_token:e.access_token,refresh_token:e.refresh_token,expires_in:e.expires_in})}async pollingAccessToken(t,e,r){return new Promise((s,n)=>{let i=setInterval(async()=>{let c=await this.getAccessToken(t);c.access_token&&(clearInterval(i),clearTimeout(a),s(c)),c.error&&c.error!=="authorization_pending"&&(clearInterval(i),clearTimeout(a),n(c.error_description))},e*1e3),a=setTimeout(async()=>{clearInterval(i),clearTimeout(a),n("Authorization has expired. Please try again.")},r*1e3)})}async getAccessToken(t){return await this.sendRequest("/device-token","POST",{client_name:this.clientName,device_code:t,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})}async getDeviceCode(){let{device_code:t,user_code:e,verification_uri:r,verification_uri_complete:s,interval:n=10,expires_in:i=300}=await this.sendRequest("/device-authorize","POST",{client_name:this.clientName});return{deviceCode:t,userCode:e,verificationUri:r,verificationUriComplete:s,interval:n,expiresIn:i}}async sendRequest(t,e="GET",r=void 0,s={}){let n=`${this.baseUrl}/api${t}`,i=await this.apiClient.request(n,{body:r&&JSON.stringify(r),method:e,headers:{"Content-Type":"application/json",...s},timeout:6e3});return i.status===204?{success:!0}:await i.json()}withResidency(t){return{...t,residency:this.baseUrl}}};var Ee="4618dbc9-8aed-4e27-aaf0-225f4603e5a4",ae="aes-256-cbc",H=class{version;credentialsFolderPath;credentialsFilePath;credentialsFileName;key;iv;constructor(t){this.version=t;let e=Ue();this.credentialsFolderPath=ie.join(e,".redocly"),this.credentialsFileName="credentials",this.credentialsFilePath=ie.join(this.credentialsFolderPath,this.credentialsFileName),this.key=A.createHash("sha256").update(`${this.credentialsFolderPath}${Ee}`).digest(),this.iv=A.createHash("md5").update(this.credentialsFolderPath).digest(),Re(this.credentialsFolderPath,{recursive:!0})}async login(t,e){let s=await new v(t,this.version).run(e);if(!s)throw new Error("Failed to login. No credentials received.");await this.saveCredentials(s)}async logout(){try{this.removeCredentials()}catch{}}async isAuthorized(t,e){return e?new v(t,this.version).verifyApiKey(e):!!await this.getAccessToken(t)}getAccessToken=async t=>{let e=new v(t,this.version),r=await this.readCredentials();if(!r||!S(t)||r.residency&&r.residency!==t)return null;if(await e.verifyToken(r.access_token))return r.access_token;try{let n=await e.refreshToken(r.refresh_token);return await this.saveCredentials(n),n.access_token}catch{return null}};async saveCredentials(t){try{let e=this.encryptCredentials(t);Ce(this.credentialsFilePath,e,"utf8")}catch(e){throw new Error(`Failed to save credentials: ${e.message}`)}}async readCredentials(){if(!oe(this.credentialsFilePath))return null;try{let t=Pe(this.credentialsFilePath,"utf8");return this.decryptCredentials(t)}catch{return null}}async removeCredentials(){oe(this.credentialsFilePath)&&xe(this.credentialsFilePath)}encryptCredentials(t){let e=A.createCipheriv(ae,this.key,this.iv);return L.concat([e.update(JSON.stringify(t),"utf8"),e.final()]).toString("hex")}decryptCredentials(t){let e=A.createDecipheriv(ae,this.key,this.iv),r=L.concat([e.update(L.from(t,"hex")),e.final()]);return JSON.parse(r.toString("utf8"))}};var $e=/^(https?:\/\/[^/]+)\/api\/orgs\/([^/]+)\/projects\/([^/]+)\/git\/?$/;function Se(o,t,e){return`${o}/api/orgs/${encodeURIComponent(t)}/projects/${encodeURIComponent(e)}/git`}function _e(o){let[,t,e,r]=o.match($e)??[];if(!(!t||!e||!r||!S(t)))return{reuniteUrl:t,organization:decodeURIComponent(e),project:decodeURIComponent(r)}}async function Ie({branch:o,title:t,description:e,base:r,draft:s,...n}){let{pullRequests:i}=ce(n,"project pr create");return i.create(n.organization,n.project,{branchName:o,title:t,description:e,targetBranchName:r,isDraft:s})}async function Fe({branch:o,...t}){let{pullRequests:e,builds:r}=ce(t,"project pr status"),{organization:s,project:n}=t,i=await e.findLatest(s,n,o);if(!i)return;let[a,c]=await Promise.all([e.listChecks(s,n,i.id),i.headCommitHash?r.findLatestByCommit(s,n,i.headCommitHash):void 0]);return{pullRequest:i,checks:a,previewUrl:c?.deploymentStatus==="SUCCESS"?c.url:void 0}}function ce({reuniteUrl:o,accessToken:t,version:e},r){let s=new h(r,e),n={Cookie:`accessToken=${t}`};return{pullRequests:new F(s,o,n),builds:new j(s,o,n)}}import*as T from"node:fs";import*as p from"node:path";var je=/\/orgs\/([^/]+)\/projects\//,Ae=[401,403];async function x(o,{organization:t,project:e,onSlugDeprecated:r}){let s=await Ne(o,t,e);if(!s)return{organizationId:t,projectId:e};let n={organizationId:Oe(s.uri),projectId:s.id};return(n.organizationId!==t||n.projectId!==e)&&r?.(n),n}async function Ne(o,t,e){try{let r=await o.projects.find(t,e);if(!r)throw new u(`Project "${e}" was not found in organization "${t}". Use the IDs from the organization and project settings in Reunite.`,404);return r}catch(r){if(r instanceof u&&Ae.includes(r.status))return;throw r}}function Oe(o){let t=o.match(je)?.[1];if(!t)throw new Error(`Could not read the organization ID from the project URI "${o}".`);return t}async function ke({domain:o,apiKey:t,organization:e,project:r,mountPath:s,files:n,defaultBranch:i,commit:a,version:c,replace:_,onUploadStart:I,onSunsetWarning:R,onSlugDeprecated:N}){let f=new y({domain:o,apiKey:t,command:"push",version:c});try{let{organizationId:d,projectId:l}=await x(f,{organization:e,project:r,onSlugDeprecated:N}),b=await f.remotes.getDefaultBranch(d,l),m=await f.remotes.upsert(d,l,{mountBranchName:b,mountPath:s});I?.(m);let{id:U}=await f.remotes.push(d,l,{remoteId:m.id,commit:a,isMainBranch:i===a.branchName,replace:_},n.map(M=>({path:G(M.name),stream:T.createReadStream(M.path)})));return{pushId:U,organizationId:d,projectId:l}}finally{let d=f.getSunsetWarning();d&&R?.(d)}}function De(o,t){let e={};for(let s of o)if(T.statSync(s).isDirectory()){let n=s;ue(n,[]).forEach(a=>r(a,n))}else r(s,p.dirname(s));function r(s,n){let i=p.relative(n,s);e[i]&&t?.(e[i],s),e[i]=s}return Object.entries(e).map(([s,n])=>({name:s,path:p.resolve(n)}))}function ue(o,t){let e=T.readdirSync(o);for(let r of e){let s=p.join(o,r);T.statSync(s).isDirectory()?t=ue(s,t):t.push(s)}return t}async function le({operation:o,condition:t,onConditionNotMet:e,startTime:r=Date.now(),retryTimeoutMs:s=6e5,retryIntervalMs:n=5e3}){async function i(){let a=await o();if(t(a))return a;if(Date.now()-r>s)throw new Error("Timeout exceeded.");return await e?.(a),await z(n),i()}return i()}var Le=1200,He=5e3,qe=["pending","running"];async function Be(o){let t=de(o);try{let e=await x(t,o);return await pe(t,e,o.pushId)}finally{he(t,o)}}async function be({buildType:o,maxExecutionTime:t=Le,retryIntervalMs:e=He,startTime:r=Date.now(),onRetry:s,...n}){let i=de(n);try{let a=await x(i,n);return await le({operation:()=>pe(i,a,n.pushId),condition:c=>!qe.includes(c.status[o].deploy.status),onConditionNotMet:s,startTime:r,retryTimeoutMs:t*1e3,retryIntervalMs:e})}finally{he(i,n)}}function de({domain:o,apiKey:t,version:e}){return new y({domain:o,apiKey:t,command:"push-status",version:e})}function he(o,{onSunsetWarning:t}){let e=o.getSunsetWarning();e&&t?.(e)}function pe(o,{organizationId:t,projectId:e},r){return o.remotes.getPush({organizationId:t,projectId:e,pushId:r})}async function Me({projectUrl:o,auth:t,isApiKey:e=!1,onDebug:r}){let s=We(o);if(!s)throw new g(`Invalid project URL format: ${o}`);try{let n=await ze({...s,auth:t,isApiKey:e,onDebug:r}),i=n.config.scorecardClassic||n.config.scorecard;if(!i)throw new Error("No scorecard configuration found.");let a=n.config.pluginsUrl,c=a?await Ge(a,r):void 0;return{scorecard:i,plugins:c,pluginsUrl:a}}catch(n){throw new g(n instanceof Error?n.message:String(n))}}function We(o){let t=new URL(o),e=t.pathname.match(/\/org\/(?<orgSlug>[^/]+)\/project\/(?<projectSlug>[^/]+)/);if(!e?.groups)return;let{orgSlug:r,projectSlug:s}=e.groups;return{residency:t.origin,orgSlug:r,projectSlug:s}}async function ze({residency:o,orgSlug:t,projectSlug:e,auth:r,isApiKey:s,onDebug:n}){let i=new URL(`${o}/api/orgs/${t}/projects/${e}`),a=await fetch(i,{headers:Ve(r,s)});if(n?.(`Project fetch response status: ${a.status}`),a.status===401||a.status===403)throw n?.(`Authentication failed with status ${a.status}.`),n?.("Check that your credentials are valid and have the necessary permissions."),new Error(`Unauthorized access to project: ${e}. Please check your credentials.`);if(a.status!==200)throw new Error(`Failed to fetch project: ${e}. Status: ${a.status}`);return n?.("Successfully received project configuration."),a.json()}async function Ge(o,t){t?.(`Fetching plugins from: ${o}`);try{let e=await fetch(o);if(t?.(`Plugins fetch response status: ${e.status}`),e.status!==200){t?.("Failed to fetch plugins");return}return e.text()}catch(e){t?.(`Error fetching plugins: ${e instanceof Error?e.message:String(e)}`);return}}function Ve(o,t){return t?{Authorization:`Bearer ${o}`}:{Cookie:`accessToken=${o}`}}async function q(o,t,e=[],r=[],s){let n={};for(let i of e){let a={[i.name]:{root:o,rules:t}},c=await Y({apis:a,...i,plugins:r},{configPath:s});n[i.name]=c.forAlias(i.name)}return n}function B(o,t){if(o){for(let e of o)if(Object.entries(e.where?.metadata||{}).every(([s,n])=>Ye(s,n,t)))return e}}function Ye(o,t,e){if(t.match(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}Z)?\/(\d{4}-\d{2}-\d{2})?$/)){if(!e[o])return!1;let[r,s]=t.split("/"),n=new Date(e[o]);return!(n<new Date(r)||s&&n>new Date(s))}else if(t.match(/^\/.*\//)){if(!e[o])return!1;try{return V(t).test(e[o])}catch{throw new g(`Invalid regex in scorecard target "${o}": ${t}`)}}return e[o]===t}import{pathToFileURL as Je}from"node:url";async function Xe(o,t){if(!o)return[];let e=Je(t??process.cwd()).href+"/",r=o.replaceAll("__redocly_dirname",`"${e}"`);return(await import(`data:text/javascript;base64,${btoa(r)}`)).default.map(i=>i())}var Ze=".redocly.com";function Ke(o){try{return new URL(o).hostname.toLowerCase().endsWith(Ze)}catch{return!1}}async function Qe({apiPath:o,document:t,externalRefResolver:e,scorecardConfig:r,configPath:s,plugins:n=[],targetLevel:i,metadata:a={},onDebug:c}){let _=[],I=new Map,R=r.levels||[];if(i&&!R.some(l=>l.name===i))throw new g(`Target level "${i}" not found in the scorecard configuration levels.
8
8
  `);let N=B(r.targets,a)?.rules,f=await q(o,N,R,n,s||"");for(let l of R){c?.(`
9
9
  Validating level: "${l.name}"`),n.length>0&&c?.(`Using ${n.length} ${O("plugin",n.length)} for this level.`),c?.("Linting document against level rules...");let m=(await J({document:t,externalRefResolver:e,config:f[l.name]})).filter(({ignored:U})=>!U).map(U=>({...U,scorecardLevel:l.name}));c?.(`Found ${m.length} ${O("problem",m.length)} for level "${l.name}".`),I.set(l.name,m),_.push(...m)}let d=et(I,R,i);return{problems:_,achievedLevel:d,targetLevelAchieved:i?d===i:!0}}function et(o,t,e){let r=null;for(let s of t){if((o.get(s.name)||[]).some(a=>a.severity==="error"))return r||"Non Conformant";if(r=s.name,e&&s.name===e)return s.name}return r||"Non Conformant"}export{u as a,h as b,y as c,re as d,ge as e,E as f,ye as g,ne as h,S as i,$ as j,v as k,H as l,Se as m,_e as n,Ie as o,Fe as p,x as q,ke as r,De as s,Be as t,be as u,Me as v,q as w,B as x,Xe as y,Ke as z,Qe 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{i as c,l as a}from"./TVUYXOSQ.js";import"./KFQC57GK.js";import{ka as s}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function g({operation:i,input:r,version:n}){let t=await l(r),e=`${t.protocol}://${t.host}`;if(i!=="get"||!c(e))return"";let o=process.env.REDOCLY_AUTHORIZATION||await new a(n).getAccessToken(e);return o?`username=redocly
7
+ import{i as c,l as a}from"./FLQQ3VRQ.js";import"./KFQC57GK.js";import{ka as s}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function g({operation:i,input:r,version:n}){let t=await l(r),e=`${t.protocol}://${t.host}`;if(i!=="get"||!c(e))return"";let o=process.env.REDOCLY_AUTHORIZATION||await new a(n).getAccessToken(e);return o?`username=redocly
8
8
  password=${o}
9
9
  `:(s.error(`You are not logged in to ${e}. Run \`redocly login --residency ${e}\` or set the REDOCLY_AUTHORIZATION environment variable.
10
10
  `),`quit=1
@@ -4,5 +4,5 @@ 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,qa as H}from"./4ZCKAKVF.js";import{existsSync as J}from"node:fs";import{open as L,readdir as T,stat as B}from"node:fs/promises";import x from"node:path";var I=new Set([".yaml",".yml",".json"]);async function V(e){let n=[];async function t(r){let o=await T(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=x.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&I.has(x.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function Q(e,n=4096){let t=await L(e,"r");try{let r=Buffer.allocUnsafe(n),{bytesRead:o}=await t.read(r,0,n,0);return r.toString("utf8",0,o)}finally{await t.close()}}function Z(e){return x.resolve(process.cwd(),e)}async function v(e){if(!J(e))throw new H(`Traffic file or folder not found: ${e}`);let n=await B(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await T(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=x.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var z="drift.local",q=`http://${z}`;function l(e){return e===z}var F=new Set(["accept","accept-charset","accept-encoding","accept-language","authorization","baggage","cache-control","cdn-loop","cookie","connection","content-length","content-type","dpr","dnt","downlink","ect","forwarded","host","if-match","if-modified-since","if-none-match","if-range","if-unmodified-since","origin","pragma","priority","range","referer","sec-fetch-dest","sec-fetch-mode","sec-fetch-site","sec-fetch-user","sec-gpc","sentry-trace","te","traceparent","tracestate","upgrade","upgrade-insecure-requests","user-agent","via","x-client-trace-id","x-cloud-trace-context","x-correlation-id","x-http-method-override","x-hub-signature","x-hub-signature-256","x-method-override","x-real-ip","x-request-id","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-forwarded-proto"]),j=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],C=`
7
+ import{c,qa as H}from"./X22IMAJK.js";import{existsSync as J}from"node:fs";import{open as L,readdir as T,stat as B}from"node:fs/promises";import x from"node:path";var I=new Set([".yaml",".yml",".json"]);async function V(e){let n=[];async function t(r){let o=await T(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=x.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&I.has(x.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function Q(e,n=4096){let t=await L(e,"r");try{let r=Buffer.allocUnsafe(n),{bytesRead:o}=await t.read(r,0,n,0);return r.toString("utf8",0,o)}finally{await t.close()}}function Z(e){return x.resolve(process.cwd(),e)}async function v(e){if(!J(e))throw new H(`Traffic file or folder not found: ${e}`);let n=await B(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await T(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=x.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var z="drift.local",q=`http://${z}`;function l(e){return e===z}var F=new Set(["accept","accept-charset","accept-encoding","accept-language","authorization","baggage","cache-control","cdn-loop","cookie","connection","content-length","content-type","dpr","dnt","downlink","ect","forwarded","host","if-match","if-modified-since","if-none-match","if-range","if-unmodified-since","origin","pragma","priority","range","referer","sec-fetch-dest","sec-fetch-mode","sec-fetch-site","sec-fetch-user","sec-gpc","sentry-trace","te","traceparent","tracestate","upgrade","upgrade-insecure-requests","user-agent","via","x-client-trace-id","x-cloud-trace-context","x-correlation-id","x-http-method-override","x-hub-signature","x-hub-signature-256","x-method-override","x-real-ip","x-request-id","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-forwarded-proto"]),j=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],C=`
8
8
  `;function te(e){return e.split(C)}function S(e,n,t){let r=n.toLowerCase(),o=e[r];if(o===void 0){e[r]=t;return}e[r]=r==="set-cookie"?`${o}${C}${t}`:`${o},${t}`}function w(e){if(!c(e)&&!Array.isArray(e))return{};let n={};if(Array.isArray(e)){for(let t of e){if(!c(t))continue;let{name:r,value:o}=t;typeof r=="string"&&o!==void 0&&S(n,r,String(o))}return n}for(let[t,r]of Object.entries(e))if(r!=null){if(Array.isArray(r)){for(let o of r)S(n,t,String(o));continue}S(n,t,String(r))}return n}function m(e){try{return new URL(e)}catch{return new URL(e,q)}}function N(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function re(e){let n=[],t=0,r=e.startsWith("/")?e:`/${e}`,s=N(r).split("/").map(i=>{if(!i)return"";let a=[...i.matchAll(/\{([^}]+)\}/g)],h=n.length,f="",p=0,u=0;for(let[y,d]of a.entries()){let R=i.slice(u,d.index);f+=b(R),p+=R.length,n.push(d[1]),u=d.index+d[0].length;let E=a[y+1];if(!E){f+="([^/]+)";continue}let A=i.slice(u,E.index);f+=A?`((?:(?!${b(A)})[^/])+)`:"([^/])"}let g=i.slice(u);return f+=b(g),p+=g.length,n.length===h?t+=2:p>0&&(t+=1),f}).join("/");return{regex:new RegExp(`^${s||"/"}$`),params:n,score:t}}function k(e,n){if(n&&O(e))try{return JSON.parse(n)}catch{return}}function $(e){return e?e.split(";")[0]?.trim().toLowerCase()??"":""}function O(e){let n=$(e);return n==="application/json"||n.endsWith("+json")}function oe(e,n){let t=$(n);if(!t)return e["application/json"]??e["*/*"];if(e[t]!==void 0)return e[t];let[r,o]=t.split("/");if(r&&o){let s=`${r}/*`;if(e[s]!==void 0)return e[s]}return e["*/*"]}function ie(e){let n=new Set,t=[];for(let r of e){let o=r.trim().toLowerCase();o.length!==0&&(o.endsWith("*")?t.push(o.slice(0,-1)):n.add(o))}return{names:n,prefixes:t}}function se(e,n){let t=e.toLowerCase();return t.startsWith(":")||F.has(t)||j.some(r=>t.startsWith(r))?!0:n?n.names.has(t)||n.prefixes.some(r=>t.startsWith(r)):!1}import{createReadStream as W}from"node:fs";import{readFile as D}from"node:fs/promises";import{createInterface as _}from"node:readline";function M(e){if(e!=null){if(typeof e=="string")return e;if(Buffer.isBuffer(e))return e.toString("utf8");if(c(e)||Array.isArray(e))try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function ge(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let n=Number(e);if(Number.isFinite(n))return n}}function P(e,n){if(e!=null){if(n==="base64"&&typeof e=="string")try{return Buffer.from(e,"base64").toString("utf8")}catch{return e}return M(e)}}function le(e,n,t){let r=e.method?.toUpperCase(),o=e.url;if(!r||!o)return null;let s=w(e.requestHeaders),i=m(o);if(l(i.host)&&s.host)try{i=new URL(`${i.protocol}//${s.host}${i.pathname}${i.search}`)}catch{i=m(o)}let a=e.requestContentType??s["content-type"],h=P(e.requestBody),f={method:r,url:i.toString(),path:i.pathname,query:i.searchParams,protocol:i.protocol,protocolKnown:e.schemeKnown??/^https?:\/\//i.test(o),host:l(i.host)?void 0:i.host||void 0,headers:s,contentType:a,bodyText:h,bodyJson:k(a,h)},p,u=e.responseStatus;if(u!==void 0){let g=w(e.responseHeaders),y=e.responseContentType??g["content-type"],d=P(e.responseBody);p={status:u,statusText:e.responseStatusText,headers:g,contentType:y,bodyText:d,bodyJson:k(y,d)}}return{index:n,source:t,startedAt:e.startedAt,request:f,response:p,raw:e.raw}}async function*me(e){let n=W(e,{encoding:"utf8"}),t=_({input:n,crlfDelay:1/0});for await(let r of t){let o=r.trim();if(o)try{let s=JSON.parse(o);c(s)&&(yield s)}catch{}}}async function*he(e,n){let t=await D(e,"utf8"),r=JSON.parse(t);if(n)for(let o of n.split("."))r=c(r)?r[o]:void 0;if(Array.isArray(r))for(let o of r)c(o)&&(yield o)}function ye(e){return w(e)["content-type"]}function Se(e){return e?.replace(/\/+$/,"")||void 0}function U(e,n){if(!n||n==="/")return e||"/";if(e===n)return"/";if(e.startsWith(`${n}/`))return e.slice(n.length)||"/"}function be(e,n){if(n.startsWith("/"))return U(e.path,n);let t=m(n.includes("://")?n:`http://${n}`);if(!(l(t.host)||e.host!==void 0&&e.host.toLowerCase()!==t.host))return U(e.path,N(t.pathname))}export{V as a,Q as b,Z as c,v as d,l as e,te as f,m as g,N as h,re as i,$ as j,O as k,oe as l,ie as m,se as n,M as o,ge as p,P as q,le as r,me as s,he as t,ye as u,Se as v,be as w};
@@ -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}from"./NDECHUWV.js";import"./IHUHQ7PO.js";import"./TVUYXOSQ.js";import"./KFQC57GK.js";import"./GKPSJEG5.js";import"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as DeploymentError,b as handlePushStatus,c as handleReuniteError,d as printSlugDeprecation,e as printSunsetWarning};
7
+ import{a,b,c,d,e}from"./542GVIYM.js";import"./MAACTVYP.js";import"./FLQQ3VRQ.js";import"./KFQC57GK.js";import"./YA5KTHFN.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{a as DeploymentError,b as handlePushStatus,c as handleReuniteError,d as printSlugDeprecation,e as printSunsetWarning};
@@ -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 G}from"./TFPMT2XD.js";import{b as j,c as N,d as Q,e as O,f as Z,g as Y,h as X,i as ee,j as ne}from"./QQ2PGWE6.js";import{a as F,b as W,c as L,d as x,e as _,g as A,h as U,i as z,j as K,k as J,l as D,n as V}from"./D3C6XIMY.js";import{a as H}from"./WZXA5XPB.js";var B=L.go,P=class extends F{constructor(){super(" ")}typeName(t){return d(t)}memberName(t){return d(t)}identifier(t){return x(t,{style:"camel",reserved:B})}identifiers(t,n){let r=new Set(n??[]);return t.map(o=>{let a=d(o),s=a;for(let l=2;r.has(s);l++)s=`${a}${l}`;return r.add(s),s})}packageName(t){let n=t.toLowerCase().replace(/[^a-z0-9]/g,"");return n===""||/^[0-9]/.test(n)?"client":n}string(t){let n='"';for(let r of t){let o=r.codePointAt(0);r==="\\"?n+="\\\\":r==='"'?n+='\\"':r===`
7
+ import{a as G}from"./TFPMT2XD.js";import{b as j,c as N,d as Q,e as O,f as Z,g as Y,h as X,i as ee,j as ne}from"./BZTZIEWS.js";import{a as F,b as W,c as L,d as x,e as _,g as A,h as U,i as z,j as K,k as J,l as D,n as V}from"./A65OW7M7.js";import{a as H}from"./WZXA5XPB.js";var B=L.go,P=class extends F{constructor(){super(" ")}typeName(t){return d(t)}memberName(t){return d(t)}identifier(t){return x(t,{style:"camel",reserved:B})}identifiers(t,n){let r=new Set(n??[]);return t.map(o=>{let a=d(o),s=a;for(let l=2;r.has(s);l++)s=`${a}${l}`;return r.add(s),s})}packageName(t){let n=t.toLowerCase().replace(/[^a-z0-9]/g,"");return n===""||/^[0-9]/.test(n)?"client":n}string(t){let n='"';for(let r of t){let o=r.codePointAt(0);r==="\\"?n+="\\\\":r==='"'?n+='\\"':r===`
8
8
  `?n+="\\n":r==="\r"?n+="\\r":r===" "?n+="\\t":o<32||o===127?n+=`\\x${o.toString(16).padStart(2,"0")}`:o>=55296&&o<=57343?n+="\\uFFFD":n+=r}return n+'"'}literal(t){return t==null?"nil":typeof t=="boolean"||typeof t=="number"?String(t):typeof t=="string"?this.string(t):Array.isArray(t)?`[]any{${t.map(r=>this.literal(r)).join(", ")}}`:`map[string]any{${Object.entries(t).map(([r,o])=>`${this.string(r)}: ${this.literal(o)}`).join(", ")}}`}comment(t){for(let n of D(t))this.line(n===""?"//":`// ${n}`);return this}doc(t,n){let r=D(n);if(r.length===0)return this;this.line(`// ${t} \u2014 ${r[0]}`);let o=!1;for(let a of r.slice(1)){if(a===""){o||this.line("//"),o=!0;continue}this.line(`// ${a}`),o=!1}return this}layout(t){return ue(fe(t))}toString(){return this.layout(super.toString())}};function d(e){let t=x(e,{style:"pascal",reserved:B});return t.startsWith("_")?`N${t.slice(1)}`:t}function ue(e){return`${e.replace(/\n{3,}/g,`
9
9
 
10
10
  `).trimEnd()}
@@ -4,5 +4,5 @@ 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{l as t}from"./TVUYXOSQ.js";import"./KFQC57GK.js";import{ka as o}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
7
+ import{l as t}from"./FLQQ3VRQ.js";import"./KFQC57GK.js";import{ka as o}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
8
8
  `)}export{i as handleLogout};
@@ -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"./BY22HEXP.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 swrGenerator};
7
+ import{a}from"./RQPH22PV.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 swrGenerator};
@@ -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{ea as e,ka as t}from"./4ZCKAKVF.js";function r({verificationUri:o,userCode:n}){t.output(`Attempting to automatically open the SSO authorization page in your default browser.
7
+ import{ea as e,ka as t}from"./X22IMAJK.js";function r({verificationUri:o,userCode:n}){t.output(`Attempting to automatically open the SSO authorization page in your default browser.
8
8
  `),t.output(`If the browser does not open or you wish to use a different device to authorize this request, open the following URL:
9
9
 
10
10
  `),t.output(e(o)),t.output(`
@@ -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{a}from"./76AJ5P4Y.js";import{ka as p}from"./4ZCKAKVF.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
7
+ import{a}from"./4QC7OVHI.js";import{ka as p}from"./X22IMAJK.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
8
8
  `);let i=new Set(t.schemas.map(e=>e.name)),o=n.filter(e=>e.sse===void 0&&m(e,i));return o.length>0&&p.warn(`generate-client: ${r} skipped ${o.length} operation(s) whose variables type name collides with a schema \u2014 rename the schema or the operation: ${o.map(e=>e.name).join(", ")}.
9
9
  `),n.filter(e=>e.sse===void 0&&!m(e,i))}function m(t,r){let n=a(t);return n.hasInputs&&r.has(n.variablesTypeName)}function x(t){return t.method==="get"||t.method==="head"}function u(t){return a(t).hasInputs}function f(t){return a(t).variablesTypeName}function $(t,r,n){let s=[];return a(t).hasInputs?s.push(r):n&&s.push("{}"),n&&s.push("{ ...init, envelope: undefined }"),`${t.name}(${s.join(", ")})`}function v(t,r,n){let s=t.map(e=>e.name).sort(),i=t.filter(u).map(f).sort();return n&&i.push("RequestOptions"),`import { ${[...s,...i.map(e=>`type ${e}`)].join(", ")} } from ${JSON.stringify(r)};`}export{g as a,x as b,u as c,f as d,$ as e,v as f};
@@ -4,5 +4,5 @@ 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 C,e as P,g as L,h as v,i as R,k as V}from"./D2BBHPMR.js";import{u as S}from"./GKPSJEG5.js";import{c as m,da as u,la as k,u as I}from"./4ZCKAKVF.js";var _=" ",z=" ";function _e(e){let t=Math.max(...e.map(o=>S(o).length)),n=t+z.length*2,r=_+u("\u2551"+" ".repeat(n)+"\u2551");return["",_+u("\u2554"+"\u2550".repeat(n)+"\u2557"),r,...e.map(o=>{let i=" ".repeat(t-S(o).length);return`${_}${u("\u2551")}${z}${o}${i}${z}${u("\u2551")}`}),r,_+u("\u255A"+"\u2550".repeat(n)+"\u255D"),"",""].join(`
8
- `)}import{execSync as ne}from"node:child_process";import*as p from"node:fs";import{existsSync as re,writeFileSync as oe,readFileSync as M}from"node:fs";import*as $ from"node:os";import{tmpdir as U}from"node:os";import{dirname as J,join as A}from"node:path";async function F(e=L){try{let{fetchWithTimeout:t}=await import("./QXBSAWH3.js");return await t(P,{timeout:e}),!0}catch{return!1}}var y="***";function be(e){return process.env.REDOCLY_TELEMETRY!=="off"&&e?.resolvedConfig.telemetry!=="off"}async function Oe({config:e,argv:t,exit_code:n,execution_time:r,spec_version:o,spec_keyword:i,spec_full_version:s,respect_x_security_auth_types:c,respect_source_description_types:f,respect_criterion_object_types:N,lint_rules_with_errors:T,lint_rules_with_warnings:b,lint_rules_with_ignored_problems:O,generate_client:a,eject_generator:l,bundle:G}){try{if(!t||!await F(1e3))return;let{_:[h],$0:pe,...D}=t,{RedoclyOAuthClient:K,getReuniteUrl:H}=await import("./IO7M7MGV.js"),q=new K(C),Q=H(e,D.residency),Z=await q.isAuthorized(Q),g=de();g||(g=`ann_${V()}`,ue(g));let E=k(o),X=[{id:h,object:"command",uri:`urn:redocly:cli:command:${h}`,logged_in:Z?"yes":"no",command:h,...ae(D,process.argv.slice(2)),node_version:process.version,npm_version:le(),version:C,exit_code:n,execution_time:r,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof e?.document?.parsed>"u"?"no":"yes",spec_version:o,spec_keyword:i,spec_full_version:s,respect_x_security_auth_types:E==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:E==="arazzo1"&&f?.length?JSON.stringify(f):void 0,respect_criterion_object_types:E==="arazzo1"&&N?.length?JSON.stringify(N):void 0,lint_rules_with_errors:T?.length?JSON.stringify(T):void 0,lint_rules_with_warnings:b?.length?JSON.stringify(b):void 0,lint_rules_with_ignored_problems:O?.length?JSON.stringify(O):void 0,generate_client_builtin_generators:a?.generate_client_builtin_generators?.length?JSON.stringify(a.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:a?.generate_client_custom_generators_count,generate_client_toolkit_imports:a?.generate_client_toolkit_imports?.length?JSON.stringify(a.generate_client_toolkit_imports):void 0,generate_client_error_category:a?.generate_client_error_category,generate_client_ejected_generators:a?.generate_client_ejected_generators?.length?JSON.stringify(a.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:a?.generate_client_composed_apis_count,eject_generator_action:l?.eject_generator_action,eject_generator_name:l?.eject_generator_name,eject_generator_outcome:l?.eject_generator_outcome,eject_generator_conflicts:l?.eject_generator_conflicts,eject_generator_from_version:l?.eject_generator_from_version,eject_generator_to_version:l?.eject_generator_to_version,bundle_overlays_count:G?.bundle_overlays_count}],ee=R.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:$.platform(),actor:{id:g,object:"user",uri:""},category:"product",data:X}),{otelTelemetry:te}=await import("./NNBSSORJ.js");te.send(ee)}catch{}}function De(e,t){for(let n of e.sourceDescriptions??[])n.type&&t.add(n.type)}function Ie(e,t){for(let n of e.workflows??[]){d(n.successActions,t),d(n.failureActions,t);for(let r of n.steps??[])W(r.successCriteria,t),d(r.onSuccess,t),d(r.onFailure,t)}d(Object.values(e.components?.successActions??{}),t),d(Object.values(e.components?.failureActions??{}),t)}function d(e,t){for(let n of e??[])W(n.criteria,t)}function W(e,t){for(let n of e??[]){let r=ie(n);r&&t.add(r)}}function ie(e){let t=e.type;return typeof t=="string"?t:t?.type||(e.condition?"simple":void 0)}function ke(e,t){for(let n of e.workflows??[]){for(let r of n["x-security"]??[]){let o=r.scheme;if(o?.type){let i=o.type==="http"?o.scheme:o.type;i&&t.add(i)}}for(let r of n.steps??[])for(let o of r["x-security"]??[]){let i=o.scheme;if(i?.type){let c=i.type==="http"?i.scheme:i.type;c&&t.add(c)}let s=o.schemeName;s&&t.add(s)}}}function se(e){return p.existsSync(e)&&p.statSync(e).isFile()}function ce(e){return p.existsSync(e)&&p.statSync(e).isDirectory()}function w(e){return e&&(I(e)?e.split("://")[0]+"://url":se(e)?e.replace(/.+\.([^.]+)$/,(t,n)=>"file-"+n):ce(e)?"folder":e)}function j(e,t,n){let r=Array.isArray(t)?t:[t];for(let o of r)o.length>1&&(e=e.replaceAll(o,n));return e}function Y(e,t){let n={};for(let[r,o]of Object.entries(e))t.includes(r)?n[r]=y:m(o)?n[r]=Y(o,t):n[r]=o;return n}function x(e,t,n=[]){if(Array.isArray(e))return e.forEach(r=>x(r,t,n)),n;if(m(e))for(let[r,o]of Object.entries(e))t.includes(r)&&typeof o=="string"?n.push(o):(m(o)||Array.isArray(o))&&x(o,t,n);return n}function ae(e,t){let n=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],r=t.join(" "),o={};for(let[i,s]of Object.entries(e))if(n.includes(i))o[i]=y,r=j(r,s,y);else if(typeof s=="string"){let c=w(s);o[i]=c,r=j(r,s,c)}else if(Array.isArray(s)){o[i]=s.map(w);for(let c of s){let f=w(c);r.includes(c)&&(r=r.replaceAll(c,f))}}else if(m(s)){let c=x(s,n);for(let f of c)r=j(r,f,y);o[i]=Y(s,n)}else o[i]=s;return{arguments:JSON.stringify(o),raw_input:r}}var fe=process.platform==="win32"?A(J(process.execPath),"node_modules","npm","package.json"):A(J(process.execPath),"..","lib","node_modules","npm","package.json");function le(){try{return JSON.parse(M(fe,"utf8")).version}catch{}try{return ne("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var ue=e=>{if(!(process.env.CI||!e))try{let n=A(U(),v);oe(n,e)}catch{}},de=()=>{if(!process.env.CI)try{let t=A(U(),v);return re(t)?M(t).toString().trim():void 0}catch{return}};export{_e as a,be as b,Oe as c,De as d,Ie as e,ke as f};
7
+ import{a as C,e as P,g as L,h as v,i as R,k as V}from"./PTBPNZRZ.js";import{u as S}from"./YA5KTHFN.js";import{c as m,da as u,la as k,u as I}from"./X22IMAJK.js";var _=" ",z=" ";function _e(e){let t=Math.max(...e.map(o=>S(o).length)),n=t+z.length*2,r=_+u("\u2551"+" ".repeat(n)+"\u2551");return["",_+u("\u2554"+"\u2550".repeat(n)+"\u2557"),r,...e.map(o=>{let i=" ".repeat(t-S(o).length);return`${_}${u("\u2551")}${z}${o}${i}${z}${u("\u2551")}`}),r,_+u("\u255A"+"\u2550".repeat(n)+"\u255D"),"",""].join(`
8
+ `)}import{execSync as ne}from"node:child_process";import*as p from"node:fs";import{existsSync as re,writeFileSync as oe,readFileSync as M}from"node:fs";import*as $ from"node:os";import{tmpdir as U}from"node:os";import{dirname as J,join as A}from"node:path";async function F(e=L){try{let{fetchWithTimeout:t}=await import("./QXBSAWH3.js");return await t(P,{timeout:e}),!0}catch{return!1}}var y="***";function be(e){return process.env.REDOCLY_TELEMETRY!=="off"&&e?.resolvedConfig.telemetry!=="off"}async function Oe({config:e,argv:t,exit_code:n,execution_time:r,spec_version:o,spec_keyword:i,spec_full_version:s,respect_x_security_auth_types:c,respect_source_description_types:f,respect_criterion_object_types:N,lint_rules_with_errors:T,lint_rules_with_warnings:b,lint_rules_with_ignored_problems:O,generate_client:a,eject_generator:l,bundle:G}){try{if(!t||!await F(1e3))return;let{_:[h],$0:pe,...D}=t,{RedoclyOAuthClient:K,getReuniteUrl:H}=await import("./WTJ3S4D7.js"),q=new K(C),Q=H(e,D.residency),Z=await q.isAuthorized(Q),g=de();g||(g=`ann_${V()}`,ue(g));let E=k(o),X=[{id:h,object:"command",uri:`urn:redocly:cli:command:${h}`,logged_in:Z?"yes":"no",command:h,...ae(D,process.argv.slice(2)),node_version:process.version,npm_version:le(),version:C,exit_code:n,execution_time:r,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof e?.document?.parsed>"u"?"no":"yes",spec_version:o,spec_keyword:i,spec_full_version:s,respect_x_security_auth_types:E==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:E==="arazzo1"&&f?.length?JSON.stringify(f):void 0,respect_criterion_object_types:E==="arazzo1"&&N?.length?JSON.stringify(N):void 0,lint_rules_with_errors:T?.length?JSON.stringify(T):void 0,lint_rules_with_warnings:b?.length?JSON.stringify(b):void 0,lint_rules_with_ignored_problems:O?.length?JSON.stringify(O):void 0,generate_client_builtin_generators:a?.generate_client_builtin_generators?.length?JSON.stringify(a.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:a?.generate_client_custom_generators_count,generate_client_toolkit_imports:a?.generate_client_toolkit_imports?.length?JSON.stringify(a.generate_client_toolkit_imports):void 0,generate_client_error_category:a?.generate_client_error_category,generate_client_ejected_generators:a?.generate_client_ejected_generators?.length?JSON.stringify(a.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:a?.generate_client_composed_apis_count,eject_generator_action:l?.eject_generator_action,eject_generator_name:l?.eject_generator_name,eject_generator_outcome:l?.eject_generator_outcome,eject_generator_conflicts:l?.eject_generator_conflicts,eject_generator_from_version:l?.eject_generator_from_version,eject_generator_to_version:l?.eject_generator_to_version,bundle_overlays_count:G?.bundle_overlays_count}],ee=R.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:$.platform(),actor:{id:g,object:"user",uri:""},category:"product",data:X}),{otelTelemetry:te}=await import("./MTKICX4T.js");te.send(ee)}catch{}}function De(e,t){for(let n of e.sourceDescriptions??[])n.type&&t.add(n.type)}function Ie(e,t){for(let n of e.workflows??[]){d(n.successActions,t),d(n.failureActions,t);for(let r of n.steps??[])W(r.successCriteria,t),d(r.onSuccess,t),d(r.onFailure,t)}d(Object.values(e.components?.successActions??{}),t),d(Object.values(e.components?.failureActions??{}),t)}function d(e,t){for(let n of e??[])W(n.criteria,t)}function W(e,t){for(let n of e??[]){let r=ie(n);r&&t.add(r)}}function ie(e){let t=e.type;return typeof t=="string"?t:t?.type||(e.condition?"simple":void 0)}function ke(e,t){for(let n of e.workflows??[]){for(let r of n["x-security"]??[]){let o=r.scheme;if(o?.type){let i=o.type==="http"?o.scheme:o.type;i&&t.add(i)}}for(let r of n.steps??[])for(let o of r["x-security"]??[]){let i=o.scheme;if(i?.type){let c=i.type==="http"?i.scheme:i.type;c&&t.add(c)}let s=o.schemeName;s&&t.add(s)}}}function se(e){return p.existsSync(e)&&p.statSync(e).isFile()}function ce(e){return p.existsSync(e)&&p.statSync(e).isDirectory()}function w(e){return e&&(I(e)?e.split("://")[0]+"://url":se(e)?e.replace(/.+\.([^.]+)$/,(t,n)=>"file-"+n):ce(e)?"folder":e)}function j(e,t,n){let r=Array.isArray(t)?t:[t];for(let o of r)o.length>1&&(e=e.replaceAll(o,n));return e}function Y(e,t){let n={};for(let[r,o]of Object.entries(e))t.includes(r)?n[r]=y:m(o)?n[r]=Y(o,t):n[r]=o;return n}function x(e,t,n=[]){if(Array.isArray(e))return e.forEach(r=>x(r,t,n)),n;if(m(e))for(let[r,o]of Object.entries(e))t.includes(r)&&typeof o=="string"?n.push(o):(m(o)||Array.isArray(o))&&x(o,t,n);return n}function ae(e,t){let n=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],r=t.join(" "),o={};for(let[i,s]of Object.entries(e))if(n.includes(i))o[i]=y,r=j(r,s,y);else if(typeof s=="string"){let c=w(s);o[i]=c,r=j(r,s,c)}else if(Array.isArray(s)){o[i]=s.map(w);for(let c of s){let f=w(c);r.includes(c)&&(r=r.replaceAll(c,f))}}else if(m(s)){let c=x(s,n);for(let f of c)r=j(r,f,y);o[i]=Y(s,n)}else o[i]=s;return{arguments:JSON.stringify(o),raw_input:r}}var fe=process.platform==="win32"?A(J(process.execPath),"node_modules","npm","package.json"):A(J(process.execPath),"..","lib","node_modules","npm","package.json");function le(){try{return JSON.parse(M(fe,"utf8")).version}catch{}try{return ne("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var ue=e=>{if(!(process.env.CI||!e))try{let n=A(U(),v);oe(n,e)}catch{}},de=()=>{if(!process.env.CI)try{let t=A(U(),v);return re(t)?M(t).toString().trim():void 0}catch{return}};export{_e as a,be as b,Oe as c,De as d,Ie as e,ke as f};
@@ -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 $,b as y,c as I}from"./IHUHQ7PO.js";import{e as P}from"./GKPSJEG5.js";import{Ba as x,ka as h}from"./4ZCKAKVF.js";function F(t){let e=t.trim(),n=e.match(/^```(?:ya?ml|json)?\s*\n([\s\S]*?)\n```$/);return n?n[1]:e}async function M(t,e){let r=(await x({source:t,config:e})).filter(o=>o.severity==="error");if(r.length>0){let o=r.slice(0,5).map(s=>`${s.ruleId}: ${s.message}`).join("; ");throw new Error(`the result has ${r.length} validation problem(s): ${o}`)}}import{spawn as v}from"node:child_process";import{mkdtemp as R}from"node:fs/promises";import{tmpdir as S}from"node:os";import L from"node:path";var E=3e5,m=class extends Error{},C;function A(){return C??=R(L.join(S(),"redocly-ai-")),C}async function w(t,e,n,r){let o=await A();return new Promise((s,u)=>{let i=v(t,e,{stdio:["pipe","pipe","pipe"],cwd:o,env:{...process.env,...r}}),l="",f="",g=!1,d=setTimeout(()=>{g=!0,i.kill("SIGKILL")},E);i.stdout.on("data",c=>{l+=c.toString()}),i.stderr.on("data",c=>{f+=c.toString()}),i.on("error",c=>{if(clearTimeout(d),c.code==="ENOENT"){u(new m(`Could not find the "${t}" CLI on PATH. Is it installed?`));return}u(c)}),i.on("close",c=>{if(clearTimeout(d),g){u(new Error(`The "${t}" CLI did not respond within ${E/1e3} seconds.`));return}s({stdout:l,stderr:f,code:c})}),i.stdin.on("error",()=>{}),i.stdin.end(n)})}async function b(t){let e=["-p","--output-format","text","--tools","","--strict-mcp-config","--setting-sources","","--no-session-persistence","--append-system-prompt",t.system];t.model&&e.push("--model",t.model);let{stdout:n,stderr:r,code:o}=await w("claude",e,t.user,{CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"});if(o!==0)throw new Error(`claude CLI exited with code ${o}: ${r.trim()||n.trim()}`);if(!n.trim())throw new Error("claude CLI returned no output.");return{text:n}}async function _(t){let e=["exec","--skip-git-repo-check","--sandbox","read-only","-c","mcp_servers={}","-c","project_doc_max_bytes=0"];t.model&&e.push("--model",t.model),e.push("-");let n=`${t.system}
7
+ import{a as $,b as y,c as I}from"./MAACTVYP.js";import{e as P}from"./YA5KTHFN.js";import{Ba as x,ka as h}from"./X22IMAJK.js";function F(t){let e=t.trim(),n=e.match(/^```(?:ya?ml|json)?\s*\n([\s\S]*?)\n```$/);return n?n[1]:e}async function M(t,e){let r=(await x({source:t,config:e})).filter(o=>o.severity==="error");if(r.length>0){let o=r.slice(0,5).map(s=>`${s.ruleId}: ${s.message}`).join("; ");throw new Error(`the result has ${r.length} validation problem(s): ${o}`)}}import{spawn as v}from"node:child_process";import{mkdtemp as R}from"node:fs/promises";import{tmpdir as S}from"node:os";import L from"node:path";var E=3e5,m=class extends Error{},C;function A(){return C??=R(L.join(S(),"redocly-ai-")),C}async function w(t,e,n,r){let o=await A();return new Promise((s,u)=>{let i=v(t,e,{stdio:["pipe","pipe","pipe"],cwd:o,env:{...process.env,...r}}),l="",f="",g=!1,d=setTimeout(()=>{g=!0,i.kill("SIGKILL")},E);i.stdout.on("data",c=>{l+=c.toString()}),i.stderr.on("data",c=>{f+=c.toString()}),i.on("error",c=>{if(clearTimeout(d),c.code==="ENOENT"){u(new m(`Could not find the "${t}" CLI on PATH. Is it installed?`));return}u(c)}),i.on("close",c=>{if(clearTimeout(d),g){u(new Error(`The "${t}" CLI did not respond within ${E/1e3} seconds.`));return}s({stdout:l,stderr:f,code:c})}),i.stdin.on("error",()=>{}),i.stdin.end(n)})}async function b(t){let e=["-p","--output-format","text","--tools","","--strict-mcp-config","--setting-sources","","--no-session-persistence","--append-system-prompt",t.system];t.model&&e.push("--model",t.model);let{stdout:n,stderr:r,code:o}=await w("claude",e,t.user,{CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"});if(o!==0)throw new Error(`claude CLI exited with code ${o}: ${r.trim()||n.trim()}`);if(!n.trim())throw new Error("claude CLI returned no output.");return{text:n}}async function _(t){let e=["exec","--skip-git-repo-check","--sandbox","read-only","-c","mcp_servers={}","-c","project_doc_max_bytes=0"];t.model&&e.push("--model",t.model),e.push("-");let n=`${t.system}
8
8
 
9
9
  ${t.user}`,{stdout:r,stderr:o,code:s}=await w("codex",e,n);if(s!==0)throw new Error(`codex CLI exited with code ${s}: ${o.trim()||r.trim()}`);if(!r.trim())throw new Error("codex CLI returned no output.");return{text:r}}async function k(t){let e=["-p","--output-format","text","--trust"];t.model&&e.push("--model",t.model);let n=`${t.system}
10
10
 
@@ -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{c as r}from"./4ZCKAKVF.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="operations";function e(o,n){if(r(o)){n(o);for(let t of Object.keys(o))e(o[t],n)}else if(Array.isArray(o))for(let t of o)e(t,n)}function S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};
7
+ import{c as r}from"./X22IMAJK.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="operations";function e(o,n){if(r(o)){n(o);for(let t of Object.keys(o))e(o[t],n)}else if(Array.isArray(o))for(let t of o)e(t,n)}function S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};
@@ -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}from"./GW4PLLFM.js";import"./TFPMT2XD.js";import"./QQ2PGWE6.js";import"./D3C6XIMY.js";import"./WZXA5XPB.js";import"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
7
+ import{a,b,c,d,e}from"./GGHLD27S.js";import"./TFPMT2XD.js";import"./BZTZIEWS.js";import"./A65OW7M7.js";import"./WZXA5XPB.js";import"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
@@ -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 o,c as n}from"./HBUZKWXC.js";import{ka as t}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{spawn as m}from"node:child_process";var j=async({argv:e})=>{t.info(`
7
+ import{a as o,c as n}from"./HBUZKWXC.js";import{ka as t}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{spawn as m}from"node:child_process";var j=async({argv:e})=>{t.info(`
8
8
  Launching eject using NPX.
9
9
 
10
10
  `);let{npxExecutableName:c,sanitize:r,shell:i}=n(),p=r(e.path,o),a=r(e["project-dir"],o);m(c,["-y","@redocly/realm","eject",`${e.type}`,p,`-d=${a}`,e.force?`--force=${e.force}`:""],{stdio:"inherit",shell:i}).on("error",s=>{throw t.info(`Eject launch failed: ${s.message}`),new Error("Eject launch failed.")})};export{j as handleEject};
@@ -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 k,f as v}from"./GKPSJEG5.js";import{A as p,N as A,O as S,P as y,X as f,Y as w,fa as d,ja as l,ka as n,ma as x,na as h,oa as O,p as u,qa as g,ta as b}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as F}from"perf_hooks";function I(o){let t=Object.fromEntries(Object.entries(o).map(([s,{metric:e,total:r,counts:a}])=>[s,{metric:e,total:r,counts:a}]));n.output(JSON.stringify(t,null,2))}function P(o){let t=`| Feature | Count |
7
+ import{b as k,f as v}from"./YA5KTHFN.js";import{A as p,N as A,O as S,P as y,X as f,Y as w,fa as d,ja as l,ka as n,ma as x,na as h,oa as O,p as u,qa as g,ta as b}from"./X22IMAJK.js";import"./6RTITFQA.js";import"./RFWIIJFG.js";import{performance as F}from"perf_hooks";function I(o){let t=Object.fromEntries(Object.entries(o).map(([s,{metric:e,total:r,counts:a}])=>[s,{metric:e,total:r,counts:a}]));n.output(JSON.stringify(t,null,2))}function P(o){let t=`| Feature | Count |
8
8
  | --- | --- |
9
9
  `,s=[];for(let{metric:e,total:r,counts:a}of Object.values(o)){t+=`| ${e} | ${r} |
10
10
  `;let c=Object.entries(a??{});c.length&&s.push(`
@@ -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 T,b as O,c as A,d as E}from"./Q5WCA45H.js";import{c as m,k as C,r as $}from"./5F7XFPS7.js";import{a as q}from"./KFQC57GK.js";import{c as H,ka as u,qa as y,ra as R}from"./4ZCKAKVF.js";import"./6RTITFQA.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as N}from"node:fs";import{appendFile as V,mkdir as _,rm as j,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
7
+ import{a as T,b as O,c as A,d as E}from"./6LZX65VY.js";import{c as m,k as C,r as $}from"./G7A4OE2M.js";import{a as q}from"./KFQC57GK.js";import{c as H,ka as u,qa as y,ra as R}from"./X22IMAJK.js";import"./6RTITFQA.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as N}from"node:fs";import{appendFile as V,mkdir as _,rm as j,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
8
8
  `,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await j(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await V(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await _(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
9
9
  "log": {
10
10
  "version": "1.2",