@redocly/cli 2.53.2 → 2.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +1 -1
  2. package/lib/chunks/{T376AHHQ.js → 23QBFBKB.js} +1 -1
  3. package/lib/chunks/{IMWIJK4I.js → 2MBZI3W3.js} +2 -1
  4. package/lib/chunks/2TLIBL23.js +8 -0
  5. package/lib/chunks/{Q3LFOSXJ.js → 3BQA72CL.js} +1 -1
  6. package/lib/chunks/{FKRGYVXD.js → 3JLKV64R.js} +1 -1
  7. package/lib/chunks/3RDMQ5CQ.js +13 -0
  8. package/lib/chunks/{4BCUUE3J.js → 4563NK6K.js} +1 -1
  9. package/lib/chunks/{7GYVSRCX.js → 5U5KA4QB.js} +1 -1
  10. package/lib/chunks/7IULUVWX.js +13 -0
  11. package/lib/chunks/AHGQ4BNI.js +30 -0
  12. package/lib/chunks/ALXOGCUM.js +8 -0
  13. package/lib/chunks/AM6FT7EB.js +9 -0
  14. package/lib/chunks/{53VK4LV5.js → B2NEPS53.js} +485 -473
  15. package/lib/chunks/{HY6IF56V.js → BV3FDR6T.js} +1 -1
  16. package/lib/chunks/{LGWICMQK.js → C22B72S6.js} +1 -1
  17. package/lib/chunks/{6ER74AF4.js → CI4NGJ3I.js} +3 -3
  18. package/lib/chunks/{JA4LTWW3.js → CR75HYUP.js} +1 -1
  19. package/lib/chunks/{BVF3GEBD.js → DZ3BIL7B.js} +1 -1
  20. package/lib/chunks/{EFVXVP5M.js → ELMWD5XU.js} +1 -1
  21. package/lib/chunks/{NU76FSGR.js → EQF3XONE.js} +1 -1
  22. package/lib/chunks/{RGJTOYYC.js → EVZXABWY.js} +1 -1
  23. package/lib/chunks/{R2EWSE4Z.js → FFUSN7JK.js} +1 -1
  24. package/lib/chunks/FOLQQTQP.js +19 -0
  25. package/lib/chunks/{CXNOQVEB.js → FTDJMTRX.js} +1 -1
  26. package/lib/chunks/{HE2DJR6Y.js → FTTM5CU5.js} +1 -1
  27. package/lib/chunks/{BNWXU2OA.js → FUCJM4CG.js} +1 -1
  28. package/lib/chunks/{Z57CXIHX.js → G2C7YJ5D.js} +1 -1
  29. package/lib/chunks/{YLZS72LY.js → G6ES3GTP.js} +1 -1
  30. package/lib/chunks/{RD64AQAZ.js → GV5K7EMH.js} +1 -1
  31. package/lib/chunks/H4XURXR7.js +47 -0
  32. package/lib/chunks/{GM5FQCWY.js → IW2J6X26.js} +4 -4
  33. package/lib/chunks/{RI6WFA4F.js → KEF4233Y.js} +6 -6
  34. package/lib/chunks/{LUCPX66E.js → KIVK5WD5.js} +1 -1
  35. package/lib/chunks/{NPD4SXEI.js → L24E6ZRY.js} +4 -4
  36. package/lib/chunks/LLGJ3YMR.js +85 -0
  37. package/lib/chunks/{UZQGV3C7.js → MLHMLZ6D.js} +2 -2
  38. package/lib/chunks/QZBHV7SD.js +7 -0
  39. package/lib/chunks/{UWKKXZOE.js → RW2ESAIF.js} +80 -80
  40. package/lib/chunks/{QJ4W6N5P.js → RZ4WANMS.js} +1 -1
  41. package/lib/chunks/{3BIPHQGZ.js → SGZ5GYE3.js} +1 -1
  42. package/lib/chunks/{KQUR5LDF.js → SK6F5TET.js} +1 -1
  43. package/lib/chunks/{ZBW2UTL4.js → T5U6O5KC.js} +1 -1
  44. package/lib/chunks/TZMWTSOQ.js +7 -0
  45. package/lib/chunks/{WEAET3FR.js → UIQNT772.js} +1 -1
  46. package/lib/chunks/{DQLEE5LL.js → VFDSXLTV.js} +1 -1
  47. package/lib/chunks/VTKYS75A.js +13 -0
  48. package/lib/chunks/XRZ5NMQ5.js +13 -0
  49. package/lib/chunks/Y6E4JAM3.js +16 -0
  50. package/lib/chunks/{GJKYTFLY.js → YDSFHQXH.js} +3 -3
  51. package/lib/chunks/{I4EFNEXU.js → YZIILRDN.js} +1 -1
  52. package/lib/chunks/{BSAURQIG.js → ZBHEZTGU.js} +1 -1
  53. package/lib/chunks/ZBK7SJHM.js +7 -0
  54. package/lib/chunks/ZDQDZTQ7.js +7 -0
  55. package/lib/chunks/{FPOO3NKZ.js → ZLOWCBYN.js} +1 -1
  56. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  57. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  58. package/lib/eject-assets/generators/cli/index.ts +2 -2
  59. package/lib/eject-assets/generators/cli/render.ts +1 -1
  60. package/lib/eject-assets/generators/go/client.ts +1 -1
  61. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  62. package/lib/eject-assets/generators/go/index.ts +2 -2
  63. package/lib/eject-assets/generators/go/models.ts +1 -1
  64. package/lib/eject-assets/generators/go/naming.ts +1 -1
  65. package/lib/eject-assets/generators/go/operations.ts +1 -1
  66. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  67. package/lib/eject-assets/generators/go/types.ts +1 -1
  68. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  69. package/lib/eject-assets/generators/mock/index.ts +2 -2
  70. package/lib/eject-assets/generators/mock/render.ts +1 -1
  71. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  72. package/lib/eject-assets/generators/mock/values.ts +1 -1
  73. package/lib/eject-assets/generators/php/client.ts +1 -1
  74. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  75. package/lib/eject-assets/generators/php/index.ts +2 -2
  76. package/lib/eject-assets/generators/php/models.ts +1 -1
  77. package/lib/eject-assets/generators/php/naming.ts +1 -1
  78. package/lib/eject-assets/generators/php/operations.ts +1 -1
  79. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  80. package/lib/eject-assets/generators/php/types.ts +1 -1
  81. package/lib/eject-assets/generators/python/client.ts +1 -1
  82. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  83. package/lib/eject-assets/generators/python/index.ts +2 -2
  84. package/lib/eject-assets/generators/python/models.ts +1 -1
  85. package/lib/eject-assets/generators/python/naming.ts +1 -1
  86. package/lib/eject-assets/generators/python/operations.ts +1 -1
  87. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  88. package/lib/eject-assets/generators/python/types.ts +1 -1
  89. package/lib/eject-assets/generators/swr/index.ts +2 -2
  90. package/lib/eject-assets/generators/swr/render.ts +1 -1
  91. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  92. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  93. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  94. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  95. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  96. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  97. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  98. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  99. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  100. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  101. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  102. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  103. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  104. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  105. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  106. package/lib/eject-assets/generators/zod/index.ts +2 -2
  107. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  108. package/lib/index.js +157 -276
  109. package/package.json +1 -1
  110. package/lib/chunks/32XCOMOR.js +0 -7
  111. package/lib/chunks/6LHYZTIP.js +0 -48
  112. package/lib/chunks/KXHIHQWX.js +0 -13
  113. package/lib/chunks/OFAMJNQ6.js +0 -7
  114. package/lib/chunks/P26PQ2RU.js +0 -7
  115. package/lib/chunks/R6Q6FO6R.js +0 -14
  116. package/lib/chunks/RS5PUOTT.js +0 -18
  117. package/lib/chunks/SCWHIBJL.js +0 -22
  118. package/lib/chunks/SP5G6SN2.js +0 -7
  119. package/lib/chunks/T226COGJ.js +0 -19
  120. package/lib/chunks/WV7XOOFD.js +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/cli",
3
- "version": "2.53.2",
3
+ "version": "2.54.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{a as R,c as f}from"./RFWIIJFG.js";var a=f((M,O)=>{"use strict";O.exports=(e,s=process.argv)=>{let i=e.startsWith("-")?"":e.length===1?"-":"--",o=s.indexOf(i+e),l=s.indexOf("--");return o!==-1&&(l===-1||o<l)}});var I=f((_,p)=>{"use strict";var E=R("os"),C=R("tty"),t=a(),{env:r}=process,n;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?n=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(n=1);"FORCE_COLOR"in r&&(r.FORCE_COLOR==="true"?n=1:r.FORCE_COLOR==="false"?n=0:n=r.FORCE_COLOR.length===0?1:Math.min(parseInt(r.FORCE_COLOR,10),3));function u(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e,s){if(n===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(e&&!s&&n===void 0)return 0;let i=n||0;if(r.TERM==="dumb")return i;if(process.platform==="win32"){let o=E.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in r)||r.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if(r.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in r){let o=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:i}function T(e){let s=c(e,e&&e.isTTY);return u(s)}p.exports={supportsColor:T,stdout:u(c(!0,C.isatty(1))),stderr:u(c(!0,C.isatty(2)))}});export{I as a};
@@ -1,48 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{a as Re,b as z}from"./IMWIJK4I.js";import{B as xe,C as Xt,D as Ee,G as Ae,N as ke,O as kt,P as J,Q as q,U as Q,W as x,_ as Ct,ca as Ce,d as ve,e as Zt,f as Se,fa as Qt,ga as Ot,ia as Oe,l as N,la as Te,ma as Fe,s as ot}from"./UWKKXZOE.js";import{performance as rn}from"perf_hooks";function je(t){return t?._?.[0]??""}import{fileURLToPath as Zs}from"node:url";import{posix as er,win32 as le}from"node:path";import{fileURLToPath as ir}from"node:url";import{lstatSync as sr,readdir as rr,readdirSync as nr,readlinkSync as or,realpathSync as hr}from"fs";import*as ar from"node:fs";import{lstat as lr,readdir as cr,readlink as pr,realpath as ur}from"node:fs/promises";import{EventEmitter as ue}from"node:events";import mi from"node:stream";import{StringDecoder as fr}from"node:string_decoder";var ti=(t,e,i)=>{let s=t instanceof RegExp?Pe(t,i):t,r=e instanceof RegExp?Pe(e,i):e,n=s!==null&&r!=null&&qi(s,r,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+r.length)}},Pe=(t,e)=>{let i=e.match(t);return i?i[0]:null},qi=(t,e,i)=>{let s,r,n,o,h,a=i.indexOf(t),l=i.indexOf(e,a+1),p=a;if(a>=0&&l>0){if(t===e)return[a,l];for(s=[],n=i.length;p>=0&&!h;){if(p===a)s.push(p),a=i.indexOf(t,p+1);else if(s.length===1){let c=s.pop();c!==void 0&&(h=[c,l])}else r=s.pop(),r!==void 0&&r<n&&(n=r,o=l),l=i.indexOf(e,p+1);p=a<l&&a>=0?a:l}s.length&&o!==void 0&&(h=[n,o])}return h},ei="\0SLASH"+Math.random()+"\0",ii="\0OPEN"+Math.random()+"\0",ce="\0CLOSE"+Math.random()+"\0",si="\0COMMA"+Math.random()+"\0",ri="\0PERIOD"+Math.random()+"\0",Ki=new RegExp(ei,"g"),Zi=new RegExp(ii,"g"),Xi=new RegExp(ce,"g"),Qi=new RegExp(si,"g"),ts=new RegExp(ri,"g"),es=/\\\\/g,is=/\\{/g,ss=/\\}/g,rs=/\\,/g,ns=/\\./g,os=1e5;function te(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function hs(t){return t.replace(es,ei).replace(is,ii).replace(ss,ce).replace(rs,si).replace(ns,ri)}function as(t){return t.replace(Ki,"\\").replace(Zi,"{").replace(Xi,"}").replace(Qi,",").replace(ts,".")}function ni(t){if(!t)return[""];let e=[],i=ti("{","}",t);if(!i)return t.split(",");let{pre:s,body:r,post:n}=i,o=s.split(",");o[o.length-1]+="{"+r+"}";let h=ni(n);return n.length&&(o[o.length-1]+=h.shift(),o.push.apply(o,h)),e.push.apply(e,o),e}function ls(t,e={}){if(!t)return[];let{max:i=os}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),wt(hs(t),i,!0).map(as)}function cs(t){return"{"+t+"}"}function ps(t){return/^-?0\d/.test(t)}function us(t,e){return t<=e}function fs(t,e){return t>=e}function wt(t,e,i){let s=[],r=ti("{","}",t);if(!r)return[t];let n=r.pre,o=r.post.length?wt(r.post,e,!1):[""];if(/\$$/.test(r.pre))for(let h=0;h<o.length&&h<e;h++){let a=n+"{"+r.body+"}"+o[h];s.push(a)}else{let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=h||a,p=r.body.indexOf(",")>=0;if(!l&&!p)return r.post.match(/,(?!,).*\}/)?(t=r.pre+"{"+r.body+ce+r.post,wt(t,e,!0)):[t];let c;if(l)c=r.body.split(/\.\./);else if(c=ni(r.body),c.length===1&&c[0]!==void 0&&(c=wt(c[0],e,!1).map(cs),c.length===1))return o.map(u=>r.pre+c[0]+u);let f;if(l&&c[0]!==void 0&&c[1]!==void 0){let u=te(c[0]),d=te(c[1]),g=Math.max(c[0].length,c[1].length),w=c.length===3&&c[2]!==void 0?Math.abs(te(c[2])):1,m=us;d<u&&(w*=-1,m=fs);let y=c.some(ps);f=[];for(let b=u;m(b,d);b+=w){let v;if(a)v=String.fromCharCode(b),v==="\\"&&(v="");else if(v=String(b),y){let S=g-v.length;if(S>0){let Y=new Array(S+1).join("0");b<0?v="-"+Y+v.slice(1):v=Y+v}}f.push(v)}}else{f=[];for(let u=0;u<c.length;u++)f.push.apply(f,wt(c[u],e,!1))}for(let u=0;u<f.length;u++)for(let d=0;d<o.length&&s.length<e;d++){let g=n+f[u]+o[d];(!i||l||g)&&s.push(g)}}return s}var Nt=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},ds={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},pt=t=>t.replace(/[[\]\\-]/g,"\\$&"),gs=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),De=t=>t.join(""),ms=(t,e)=>{let i=e;if(t.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=i+1,o=!1,h=!1,a=!1,l=!1,p=i,c="";t:for(;n<t.length;){let d=t.charAt(n);if((d==="!"||d==="^")&&n===i+1){l=!0,n++;continue}if(d==="]"&&o&&!a){p=n+1;break}if(o=!0,d==="\\"&&!a){a=!0,n++;continue}if(d==="["&&!a){for(let[g,[w,m,y]]of Object.entries(ds))if(t.startsWith(g,n)){if(c)return["$.",!1,t.length-i,!0];n+=g.length,y?r.push(w):s.push(w),h=h||m;continue t}}if(a=!1,c){d>c?s.push(pt(c)+"-"+pt(d)):d===c&&s.push(pt(d)),c="",n++;continue}if(t.startsWith("-]",n+1)){s.push(pt(d+"-")),n+=2;continue}if(t.startsWith("-",n+1)){c=d,n+=2;continue}s.push(pt(d)),n++}if(p<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,t.length-i,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let d=s[0].length===2?s[0].slice(-1):s[0];return[gs(d),!1,p-i,!1]}let f="["+(l?"^":"")+De(s)+"]",u="["+(l?"":"^")+De(r)+"]";return[s.length&&r.length?"("+f+"|"+u+")":s.length?f:u,h,p-i,!0]},lt=(t,{windowsPathsNoEscape:e=!1,magicalBraces:i=!0}={})=>i?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),ws=new Set(["!","?","+","*","@"]),$e=t=>ws.has(t),ys="(?!(?:^|/)\\.\\.?(?:$|/))",Tt="(?!\\.)",bs=new Set(["[","."]),vs=new Set(["..","."]),Ss=new Set("().*{}+?[]^$\\!"),xs=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),pe="[^/]",Me=pe+"*?",Le=pe+"+?",oi=class D{type;#t;#i;#n=!1;#r=[];#o;#v;#w;#c=!1;#h;#u;#p=!1;constructor(e,i,s={}){this.type=e,e&&(this.#i=!0),this.#o=i,this.#t=this.#o?this.#o.#t:this,this.#h=this.#t===this?s:this.#t.#h,this.#w=this.#t===this?[]:this.#t.#w,e==="!"&&!this.#t.#c&&this.#w.push(this),this.#v=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#a(){if(this!==this.#t)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#w.pop();){if(e.type!=="!")continue;let i=e,s=i.#o;for(;s;){for(let r=i.#v+1;!s.type&&r<s.#r.length;r++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#r[r])}i=s,s=i.#o}}return this}push(...e){for(let i of e)if(i!==""){if(typeof i!="string"&&!(i instanceof D&&i.#o===this))throw new Error("invalid part: "+i);this.#r.push(i)}}toJSON(){let e=this.type===null?this.#r.slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...this.#r.map(i=>i.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#c&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let i=0;i<this.#v;i++){let s=e.#r[i];if(!(s instanceof D&&s.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let i=new D(this.type,e);for(let s of this.#r)i.copyIn(s);return i}static#s(e,i,s,r){let n=!1,o=!1,h=-1,a=!1;if(i.type===null){let u=s,d="";for(;u<e.length;){let g=e.charAt(u++);if(n||g==="\\"){n=!n,d+=g;continue}if(o){u===h+1?(g==="^"||g==="!")&&(a=!0):g==="]"&&!(u===h+2&&a)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,h=u,a=!1,d+=g;continue}if(!r.noext&&$e(g)&&e.charAt(u)==="("){i.push(d),d="";let w=new D(g,i);u=D.#s(e,w,u,r),i.push(w);continue}d+=g}return i.push(d),u}let l=s+1,p=new D(null,i),c=[],f="";for(;l<e.length;){let u=e.charAt(l++);if(n||u==="\\"){n=!n,f+=u;continue}if(o){l===h+1?(u==="^"||u==="!")&&(a=!0):u==="]"&&!(l===h+2&&a)&&(o=!1),f+=u;continue}else if(u==="["){o=!0,h=l,a=!1,f+=u;continue}if($e(u)&&e.charAt(l)==="("){p.push(f),f="";let d=new D(u,p);p.push(d),l=D.#s(e,d,l,r);continue}if(u==="|"){p.push(f),f="",c.push(p),p=new D(null,i);continue}if(u===")")return f===""&&i.#r.length===0&&(i.#p=!0),p.push(f),f="",i.push(...c,p),l;f+=u}return i.type=null,i.#i=void 0,i.#r=[e.substring(s-1)],l}static fromGlob(e,i={}){let s=new D(null,void 0,i);return D.#s(e,s,0,i),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[i,s,r,n]=this.toRegExpSource();if(!(r||this.#i||this.#h.nocase&&!this.#h.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let o=(this.#h.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:e})}get options(){return this.#h}toRegExpSource(e){let i=e??!!this.#h.dot;if(this.#t===this&&this.#a(),!this.type){let a=this.isStart()&&this.isEnd()&&!this.#r.some(f=>typeof f!="string"),l=this.#r.map(f=>{let[u,d,g,w]=typeof f=="string"?D.#S(f,this.#i,a):f.toRegExpSource(e);return this.#i=this.#i||g,this.#n=this.#n||w,u}).join(""),p="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&vs.has(this.#r[0]))){let f=bs,u=i&&f.has(l.charAt(0))||l.startsWith("\\.")&&f.has(l.charAt(2))||l.startsWith("\\.\\.")&&f.has(l.charAt(4)),d=!i&&!e&&f.has(l.charAt(0));p=u?ys:d?Tt:""}let c="";return this.isEnd()&&this.#t.#c&&this.#o?.type==="!"&&(c="(?:$|\\/)"),[p+l+c,lt(l),this.#i=!!this.#i,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#f(i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let a=this.toString();return this.#r=[a],this.type=null,this.#i=void 0,[a,lt(this.toString()),!1,!1]}let o=!s||e||i||!Tt?"":this.#f(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let h="";if(this.type==="!"&&this.#p)h=(this.isStart()&&!i?Tt:"")+Le;else{let a=this.type==="!"?"))"+(this.isStart()&&!i&&!e?Tt:"")+Me+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=r+n+a}return[h,lt(n),this.#i=!!this.#i,this.#n]}#f(e){return this.#r.map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,r,n,o]=i.toRegExpSource(e);return this.#n=this.#n||o,s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#S(e,i,s=!1){let r=!1,n="",o=!1,h=!1;for(let a=0;a<e.length;a++){let l=e.charAt(a);if(r){r=!1,n+=(Ss.has(l)?"\\":"")+l;continue}if(l==="*"){if(h)continue;h=!0,n+=s&&/^[*]+$/.test(e)?Le:Me,i=!0;continue}else h=!1;if(l==="\\"){a===e.length-1?n+="\\\\":r=!0;continue}if(l==="["){let[p,c,f,u]=ms(e,a);if(f){n+=p,o=o||c,a+=f-1,i=i||u;continue}}if(l==="?"){n+=pe,i=!0;continue}n+=xs(l)}return[n,lt(e),!!i,o]}},hi=(t,{windowsPathsNoEscape:e=!1,magicalBraces:i=!1}={})=>i?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),R=(t,e,i={})=>(Nt(e),!i.nocomment&&e.charAt(0)==="#"?!1:new X(e,i).match(t)),Es=/^\*+([^+@!?\*\[\(]*)$/,As=t=>e=>!e.startsWith(".")&&e.endsWith(t),ks=t=>e=>e.endsWith(t),Cs=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Os=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Ts=/^\*+\.\*+$/,Fs=t=>!t.startsWith(".")&&t.includes("."),Rs=t=>t!=="."&&t!==".."&&t.includes("."),js=/^\.\*+$/,Ps=t=>t!=="."&&t!==".."&&t.startsWith("."),Ds=/^\*+$/,$s=t=>t.length!==0&&!t.startsWith("."),Ms=t=>t.length!==0&&t!=="."&&t!=="..",Ls=/^\?+([^+@!?\*\[\(]*)?$/,Ws=([t,e=""])=>{let i=ai([t]);return e?(e=e.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(e)):i},Ns=([t,e=""])=>{let i=li([t]);return e?(e=e.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(e)):i},zs=([t,e=""])=>{let i=li([t]);return e?s=>i(s)&&s.endsWith(e):i},_s=([t,e=""])=>{let i=ai([t]);return e?s=>i(s)&&s.endsWith(e):i},ai=([t])=>{let e=t.length;return i=>i.length===e&&!i.startsWith(".")},li=([t])=>{let e=t.length;return i=>i.length===e&&i!=="."&&i!==".."},ci=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",We={win32:{sep:"\\"},posix:{sep:"/"}},Bs=ci==="win32"?We.win32.sep:We.posix.sep;R.sep=Bs;var F=Symbol("globstar **");R.GLOBSTAR=F;var Is="[^/]",Us=Is+"*?",Gs="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Hs="(?:(?!(?:\\/|^)\\.).)*?",Vs=(t,e={})=>i=>R(i,t,e);R.filter=Vs;var $=(t,e={})=>Object.assign({},t,e),Ys=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return R;let e=R;return Object.assign((i,s,r={})=>e(i,s,$(t,r)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,$(t,s))}static defaults(i){return e.defaults($(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,r={}){super(i,s,$(t,r))}static fromGlob(i,s={}){return e.AST.fromGlob(i,$(t,s))}},unescape:(i,s={})=>e.unescape(i,$(t,s)),escape:(i,s={})=>e.escape(i,$(t,s)),filter:(i,s={})=>e.filter(i,$(t,s)),defaults:i=>e.defaults($(t,i)),makeRe:(i,s={})=>e.makeRe(i,$(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,$(t,s)),match:(i,s,r={})=>e.match(i,s,$(t,r)),sep:e.sep,GLOBSTAR:F})};R.defaults=Ys;var pi=(t,e={})=>(Nt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:ls(t,{max:e.braceExpandMax}));R.braceExpand=pi;var Js=(t,e={})=>new X(t,e).makeRe();R.makeRe=Js;var qs=(t,e,i={})=>{let s=new X(e,i);return t=t.filter(r=>s.match(r)),s.options.nonull&&!t.length&&t.push(e),t};R.match=qs;var Ne=/[?*]|[+@!]\(.*?\)|\[|\]/,Ks=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),X=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){Nt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||ci,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((r,n,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=r[0]===""&&r[1]===""&&(r[2]==="?"||!Ne.test(r[2]))&&!Ne.test(r[3]),a=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(l=>this.parse(l))];if(a)return[r[0],...r.slice(1).map(l=>this.parse(l))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,s),this.set=s.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let n=this.set[r];n[0]===""&&n[1]===""&&this.globParts[r][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let s=0;s<t[i].length;s++)t[i][s]==="**"&&(t[i][s]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let i=-1;for(;(i=e.indexOf("**",i+1))!==-1;){let s=i;for(;e[s+1]==="**";)s++;s!==i&&e.splice(i,s-i)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,s)=>{let r=i[i.length-1];return s==="**"&&r==="**"?i:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(s),i)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){let r=t[s];s===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let s=t[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(e=!0,t.splice(i-1,2),i-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let i of t){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let n=s;for(;i[n+1]==="**";)n++;n>s&&i.splice(s+1,n-s);let o=i[s+1],h=i[s+2],a=i[s+3];if(o!==".."||!h||h==="."||h===".."||!a||a==="."||a==="..")continue;e=!0,i.splice(s,1);let l=i.slice(0);l[s]="**",t.push(l),s--}if(!this.preserveMultipleSlashes){for(let n=1;n<i.length-1;n++){let o=i[n];n===1&&o===""&&i[0]===""||(o==="."||o==="")&&(e=!0,i.splice(n,1),n--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){let n=i[r-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=!0;let o=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...o),i.length===0&&i.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let i=e+1;i<t.length;i++){let s=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(s){t[e]=[],t[i]=s;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=!1){let s=0,r=0,n=[],o="";for(;s<t.length&&r<e.length;)if(t[s]===e[r])n.push(o==="b"?e[r]:t[s]),s++,r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])n.push(t[s]),s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])n.push(e[r]),r++;else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(o==="b")return!1;o="a",n.push(t[s]),s++,r++}else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(o==="a")return!1;o="b",n.push(e[r]),s++,r++}else return!1;return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e}matchOne(t,e,i=!1){let s=this.options;if(this.isWindows){let d=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),g=!d&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),w=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),m=!w&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),y=g?3:d?0:void 0,b=m?3:w?0:void 0;if(typeof y=="number"&&typeof b=="number"){let[v,S]=[t[y],e[b]];v.toLowerCase()===S.toLowerCase()&&(e[b]=v,b>y?e=e.slice(b):y>b&&(t=t.slice(y)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,o=0,h=t.length,a=e.length;n<h&&o<a;n++,o++){this.debug("matchOne loop");var l=e[o],p=t[n];if(this.debug(e,l,p),l===!1)return!1;if(l===F){this.debug("GLOBSTAR",[e,l,p]);var c=n,f=o+1;if(f===a){for(this.debug("** at the end");n<h;n++)if(t[n]==="."||t[n]===".."||!s.dot&&t[n].charAt(0)===".")return!1;return!0}for(;c<h;){var u=t[c];if(this.debug(`
8
- globstar while`,t,c,e,f,u),this.matchOne(t.slice(c),e.slice(f),i))return this.debug("globstar found match!",c,h,u),!0;if(u==="."||u===".."||!s.dot&&u.charAt(0)==="."){this.debug("dot detected!",t,c,e,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(i&&(this.debug(`
9
- >>> no match, partial?`,t,c,e,f),c===h))}let d;if(typeof l=="string"?(d=p===l,this.debug("string match",l,p,d)):(d=l.test(p),this.debug("pattern match",l,p,d)),!d)return!1}if(n===h&&o===a)return!0;if(n===h)return i;if(o===a)return n===h-1&&t[n]==="";throw new Error("wtf?")}braceExpand(){return pi(this.pattern,this.options)}parse(t){Nt(t);let e=this.options;if(t==="**")return F;if(t==="")return"";let i,s=null;(i=t.match(Ds))?s=e.dot?Ms:$s:(i=t.match(Es))?s=(e.nocase?e.dot?Os:Cs:e.dot?ks:As)(i[1]):(i=t.match(Ls))?s=(e.nocase?e.dot?Ns:Ws:e.dot?zs:_s)(i):(i=t.match(Ts))?s=e.dot?Rs:Fs:(i=t.match(js))&&(s=Ps);let r=oi.fromGlob(t,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,i=e.noglobstar?Us:e.dot?Gs:Hs,s=new Set(e.nocase?["i"]:[]),r=t.map(h=>{let a=h.map(p=>{if(p instanceof RegExp)for(let c of p.flags.split(""))s.add(c);return typeof p=="string"?Ks(p):p===F?F:p._src});a.forEach((p,c)=>{let f=a[c+1],u=a[c-1];p!==F||u===F||(u===void 0?f!==void 0&&f!==F?a[c+1]="(?:\\/|"+i+"\\/)?"+f:a[c]=i:f===void 0?a[c-1]=u+"(?:\\/|\\/"+i+")?":f!==F&&(a[c-1]=u+"(?:\\/|\\/"+i+"\\/)"+f,a[c+1]=F))});let l=a.filter(p=>p!==F);if(this.partial&&l.length>=1){let p=[];for(let c=1;c<=l.length;c++)p.push(l.slice(0,c).join("/"));return"(?:"+p.join("|")+")"}return l.join("/")}).join("|"),[n,o]=t.length>1?["(?:",")"]:["",""];r="^"+n+r+o+"$",this.partial&&(r="^(?:\\/|"+n+r.slice(1,-1)+o+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let s=this.slashSplit(t);this.debug(this.pattern,"split",s);let r=this.set;this.debug(this.pattern,"set",r);let n=s[s.length-1];if(!n)for(let o=s.length-2;!n&&o>=0;o--)n=s[o];for(let o=0;o<r.length;o++){let h=r[o],a=s;if(i.matchBase&&h.length===1&&(a=[n]),this.matchOne(a,h,e))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return R.defaults(t).Minimatch}};R.AST=oi;R.Minimatch=X;R.escape=hi;R.unescape=lt;var Xs=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ui=new Set,ae=typeof process=="object"&&process?process:{},fi=(t,e,i,s)=>{typeof ae.emitWarning=="function"?ae.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)},zt=globalThis.AbortController,ze=globalThis.AbortSignal;if(typeof zt>"u"){ze=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},zt=class{constructor(){e()}signal=new ze;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let t=ae.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,fi("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Qs=t=>!ui.has(t),Z=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),di=t=>Z(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Lt:null:null,Lt=class extends Array{constructor(t){super(t),this.fill(0)}},tr=class yt{heap;length;static#t=!1;static create(e){let i=di(e);if(!i)return[];yt.#t=!0;let s=new yt(e,i);return yt.#t=!1,s}constructor(e,i){if(!yt.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},It=class gi{#t;#i;#n;#r;#o;#v;#w;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#h;#u;#p;#a;#s;#f;#S;#b;#d;#T;#g;#A;#k;#m;#y;#x;#C;#e;#$;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#m,autopurgeTimers:e.#y,sizes:e.#A,keyMap:e.#p,keyList:e.#a,valList:e.#s,next:e.#f,prev:e.#S,get head(){return e.#b},get tail(){return e.#d},free:e.#T,isBackgroundFetch:i=>e.#l(i),backgroundFetch:(i,s,r,n)=>e.#I(i,s,r,n),moveToTail:i=>e.#L(i),indexes:i=>e.#R(i),rindexes:i=>e.#j(i),isStale:i=>e.#E(i)}}get max(){return this.#t}get maxSize(){return this.#i}get calculatedSize(){return this.#u}get size(){return this.#h}get fetchMethod(){return this.#v}get memoMethod(){return this.#w}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#o}constructor(e){let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:p,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:u,maxSize:d=0,maxEntrySize:g=0,sizeCalculation:w,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:Y,ignoreFetchAbort:st,perf:rt}=e;if(rt!==void 0&&typeof rt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=rt??Xs,i!==0&&!Z(i))throw new TypeError("max option must be a nonnegative integer");let nt=i?di(i):Array;if(!nt)throw new Error("invalid max value: "+i);if(this.#t=i,this.#i=d,this.maxEntrySize=g||this.#i,this.sizeCalculation=w,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=y,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#v=m,this.#C=!!m,this.#p=new Map,this.#a=new Array(i).fill(void 0),this.#s=new Array(i).fill(void 0),this.#f=new nt(i),this.#S=new nt(i),this.#b=0,this.#d=0,this.#T=tr.create(i),this.#h=0,this.#u=0,typeof l=="function"&&(this.#n=l),typeof p=="function"&&(this.#r=p),typeof c=="function"?(this.#o=c,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#x=!!this.#n,this.#$=!!this.#r,this.#e=!!this.#o,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!Y,this.ignoreFetchAbort=!!st,this.maxEntrySize!==0){if(this.#i!==0&&!Z(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!Z(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=Z(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Z(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#i===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#i){let Kt="LRU_CACHE_UNBOUNDED";Qs(Kt)&&(ui.add(Kt),fi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Kt,gi))}}getRemainingTTL(e){return this.#p.has(e)?1/0:0}#P(){let e=new Lt(this.#t),i=new Lt(this.#t);this.#m=e,this.#k=i;let s=this.ttlAutopurge?new Array(this.#t):void 0;this.#y=s,this.#N=(o,h,a=this.#c.now())=>{if(i[o]=h!==0?a:0,e[o]=h,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),h!==0&&s){let l=setTimeout(()=>{this.#E(o)&&this.#F(this.#a[o],"expire")},h+1);l.unref&&l.unref(),s[o]=l}},this.#O=o=>{i[o]=e[o]!==0?this.#c.now():0},this.#D=(o,h)=>{if(e[h]){let a=e[h],l=i[h];if(!a||!l)return;o.ttl=a,o.start=l,o.now=r||n();let p=o.now-l;o.remainingTTL=a-p}};let r=0,n=()=>{let o=this.#c.now();if(this.ttlResolution>0){r=o;let h=setTimeout(()=>r=0,this.ttlResolution);h.unref&&h.unref()}return o};this.getRemainingTTL=o=>{let h=this.#p.get(o);if(h===void 0)return 0;let a=e[h],l=i[h];if(!a||!l)return 1/0;let p=(r||n())-l;return a-p},this.#E=o=>{let h=i[o],a=e[o];return!!a&&!!h&&(r||n())-h>a}}#O=()=>{};#D=()=>{};#N=()=>{};#E=()=>!1;#G(){let e=new Lt(this.#t);this.#u=0,this.#A=e,this.#W=i=>{this.#u-=e[i],e[i]=0},this.#z=(i,s,r,n)=>{if(this.#l(s))return 0;if(!Z(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!Z(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#M=(i,s,r)=>{if(e[i]=s,this.#i){let n=this.#i-e[i];for(;this.#u>n;)this.#B(!0)}this.#u+=e[i],r&&(r.entrySize=s,r.totalCalculatedSize=this.#u)}}#W=e=>{};#M=(e,i,s)=>{};#z=(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#R({allowStale:e=this.allowStale}={}){if(this.#h)for(let i=this.#d;!(!this.#_(i)||((e||!this.#E(i))&&(yield i),i===this.#b));)i=this.#S[i]}*#j({allowStale:e=this.allowStale}={}){if(this.#h)for(let i=this.#b;!(!this.#_(i)||((e||!this.#E(i))&&(yield i),i===this.#d));)i=this.#f[i]}#_(e){return e!==void 0&&this.#p.get(this.#a[e])===e}*entries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#a[e]!==void 0&&!this.#l(this.#s[e])&&(yield[this.#a[e],this.#s[e]])}*rentries(){for(let e of this.#j())this.#s[e]!==void 0&&this.#a[e]!==void 0&&!this.#l(this.#s[e])&&(yield[this.#a[e],this.#s[e]])}*keys(){for(let e of this.#R()){let i=this.#a[e];i!==void 0&&!this.#l(this.#s[e])&&(yield i)}}*rkeys(){for(let e of this.#j()){let i=this.#a[e];i!==void 0&&!this.#l(this.#s[e])&&(yield i)}}*values(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#l(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#j())this.#s[e]!==void 0&&!this.#l(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,i={}){for(let s of this.#R()){let r=this.#s[s],n=this.#l(r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,this.#a[s],this))return this.get(this.#a[s],i)}}forEach(e,i=this){for(let s of this.#R()){let r=this.#s[s],n=this.#l(r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,this.#a[s],this)}}rforEach(e,i=this){for(let s of this.#j()){let r=this.#s[s],n=this.#l(r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,this.#a[s],this)}}purgeStale(){let e=!1;for(let i of this.#j({allowStale:!0}))this.#E(i)&&(this.#F(this.#a[i],"expire"),e=!0);return e}info(e){let i=this.#p.get(e);if(i===void 0)return;let s=this.#s[i],r=this.#l(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#m&&this.#k){let o=this.#m[i],h=this.#k[i];if(o&&h){let a=o-(this.#c.now()-h);n.ttl=a,n.start=Date.now()}}return this.#A&&(n.size=this.#A[i]),n}dump(){let e=[];for(let i of this.#R({allowStale:!0})){let s=this.#a[i],r=this.#s[i],n=this.#l(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#m&&this.#k){o.ttl=this.#m[i];let h=this.#c.now()-this.#k[i];o.start=Math.floor(Date.now()-h)}this.#A&&(o.size=this.#A[i]),e.unshift([s,o])}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=this.#c.now()-r}this.set(i,s.value,s)}}set(e,i,s={}){if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,p=this.#z(e,i,s.size||0,h);if(this.maxEntrySize&&p>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#F(e,"set"),this;let c=this.#h===0?void 0:this.#p.get(e);if(c===void 0)c=this.#h===0?this.#d:this.#T.length!==0?this.#T.pop():this.#h===this.#t?this.#B(!1):this.#h,this.#a[c]=e,this.#s[c]=i,this.#p.set(e,c),this.#f[this.#d]=c,this.#S[c]=this.#d,this.#d=c,this.#h++,this.#M(c,p,a),a&&(a.set="add"),l=!1,this.#$&&this.#r?.(i,e,"add");else{this.#L(c);let f=this.#s[c];if(i!==f){if(this.#C&&this.#l(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=f;u!==void 0&&!o&&(this.#x&&this.#n?.(u,e,"set"),this.#e&&this.#g?.push([u,e,"set"]))}else o||(this.#x&&this.#n?.(f,e,"set"),this.#e&&this.#g?.push([f,e,"set"]));if(this.#W(c),this.#M(c,p,a),this.#s[c]=i,a){a.set="replace";let u=f&&this.#l(f)?f.__staleWhileFetching:f;u!==void 0&&(a.oldValue=u)}}else a&&(a.set="update");this.#$&&this.onInsert?.(i,e,i===f?"update":"replace")}if(r!==0&&!this.#m&&this.#P(),this.#m&&(l||this.#N(c,r,n),a&&this.#D(a,c)),!o&&this.#e&&this.#g){let f=this.#g,u;for(;u=f?.shift();)this.#o?.(...u)}return this}pop(){try{for(;this.#h;){let e=this.#s[this.#b];if(this.#B(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#e&&this.#g){let e=this.#g,i;for(;i=e?.shift();)this.#o?.(...i)}}}#B(e){let i=this.#b,s=this.#a[i],r=this.#s[i];return this.#C&&this.#l(r)?r.__abortController.abort(new Error("evicted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(r,s,"evict"),this.#e&&this.#g?.push([r,s,"evict"])),this.#W(i),this.#y?.[i]&&(clearTimeout(this.#y[i]),this.#y[i]=void 0),e&&(this.#a[i]=void 0,this.#s[i]=void 0,this.#T.push(i)),this.#h===1?(this.#b=this.#d=0,this.#T.length=0):this.#b=this.#f[i],this.#p.delete(s),this.#h--,i}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=this.#p.get(e);if(n!==void 0){let o=this.#s[n];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#E(n))r&&(r.has="stale",this.#D(r,n));else return s&&this.#O(n),r&&(r.has="hit",this.#D(r,n)),!0}else r&&(r.has="miss");return!1}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=this.#p.get(e);if(r===void 0||!s&&this.#E(r))return;let n=this.#s[r];return this.#l(n)?n.__staleWhileFetching:n}#I(e,i,s,r){let n=i===void 0?void 0:this.#s[i];if(this.#l(n))return n;let o=new zt,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:r},l=(g,w=!1)=>{let{aborted:m}=o.signal,y=s.ignoreFetchAbort&&g!==void 0,b=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&g!==void 0);if(s.status&&(m&&!w?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!y&&!w)return c(o.signal.reason,b);let v=u,S=this.#s[i];return(S===u||y&&w&&S===void 0)&&(g===void 0?v.__staleWhileFetching!==void 0?this.#s[i]=v.__staleWhileFetching:this.#F(e,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(e,g,a.options))),g},p=g=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=g),c(g,!1)),c=(g,w)=>{let{aborted:m}=o.signal,y=m&&s.allowStaleOnFetchAbort,b=y||s.allowStaleOnFetchRejection,v=b||s.noDeleteOnFetchRejection,S=u;if(this.#s[i]===u&&(!v||!w&&S.__staleWhileFetching===void 0?this.#F(e,"fetch"):y||(this.#s[i]=S.__staleWhileFetching)),b)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw g},f=(g,w)=>{let m=this.#v?.(e,n,a);m&&m instanceof Promise&&m.then(y=>g(y===void 0?void 0:y),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(g(void 0),s.allowStaleOnFetchAbort&&(g=y=>l(y,!0)))})};s.status&&(s.status.fetchDispatched=!0);let u=new Promise(f).then(l,p),d=Object.assign(u,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,d,{...a.options,status:void 0}),i=this.#p.get(e)):this.#s[i]=d,d}#l(e){if(!this.#C)return!1;let i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof zt}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:p=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:g,forceRefresh:w=!1,status:m,signal:y}=i;if(!this.#C)return m&&(m.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:m});let b={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:p,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:d,ignoreFetchAbort:u,status:m,signal:y},v=this.#p.get(e);if(v===void 0){m&&(m.fetch="miss");let S=this.#I(e,v,b,g);return S.__returned=S}else{let S=this.#s[v];if(this.#l(S)){let nt=s&&S.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",nt&&(m.returnedStale=!0)),nt?S.__staleWhileFetching:S.__returned=S}let Y=this.#E(v);if(!w&&!Y)return m&&(m.fetch="hit"),this.#L(v),r&&this.#O(v),m&&this.#D(m,v),S;let st=this.#I(e,v,b,g),rt=st.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=Y?"stale":"refresh",rt&&Y&&(m.returnedStale=!0)),rt?st.__staleWhileFetching:st.__returned=st}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=this.#w;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,h=this.get(e,o);if(!n&&h!==void 0)return h;let a=s(e,h,{options:o,context:r});return this.set(e,a,o),a}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,h=this.#p.get(e);if(h!==void 0){let a=this.#s[h],l=this.#l(a);return o&&this.#D(o,h),this.#E(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?a.__staleWhileFetching:void 0):(n||this.#F(e,"expire"),o&&s&&(o.returnedStale=!0),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#L(h),r&&this.#O(h),a))}else o&&(o.get="miss")}#U(e,i){this.#S[i]=e,this.#f[e]=i}#L(e){e!==this.#d&&(e===this.#b?this.#b=this.#f[e]:this.#U(this.#S[e],this.#f[e]),this.#U(this.#d,e),this.#d=e)}delete(e){return this.#F(e,"delete")}#F(e,i){let s=!1;if(this.#h!==0){let r=this.#p.get(e);if(r!==void 0)if(this.#y?.[r]&&(clearTimeout(this.#y?.[r]),this.#y[r]=void 0),s=!0,this.#h===1)this.#H(i);else{this.#W(r);let n=this.#s[r];if(this.#l(n)?n.__abortController.abort(new Error("deleted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(n,e,i),this.#e&&this.#g?.push([n,e,i])),this.#p.delete(e),this.#a[r]=void 0,this.#s[r]=void 0,r===this.#d)this.#d=this.#S[r];else if(r===this.#b)this.#b=this.#f[r];else{let o=this.#S[r];this.#f[o]=this.#f[r];let h=this.#f[r];this.#S[h]=this.#S[r]}this.#h--,this.#T.push(r)}}if(this.#e&&this.#g?.length){let r=this.#g,n;for(;n=r?.shift();)this.#o?.(...n)}return s}clear(){return this.#H("delete")}#H(e){for(let i of this.#j({allowStale:!0})){let s=this.#s[i];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else{let r=this.#a[i];this.#x&&this.#n?.(s,r,e),this.#e&&this.#g?.push([s,r,e])}}if(this.#p.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#m&&this.#k){this.#m.fill(0),this.#k.fill(0);for(let i of this.#y??[])i!==void 0&&clearTimeout(i);this.#y?.fill(void 0)}if(this.#A&&this.#A.fill(0),this.#b=0,this.#d=0,this.#T.length=0,this.#u=0,this.#h=0,this.#e&&this.#g){let i=this.#g,s;for(;s=i?.shift();)this.#o?.(...s)}}},_e=typeof process=="object"&&process?process:{stdout:null,stderr:null},dr=t=>!!t&&typeof t=="object"&&(t instanceof _t||t instanceof mi||gr(t)||mr(t)),gr=t=>!!t&&typeof t=="object"&&t instanceof ue&&typeof t.pipe=="function"&&t.pipe!==mi.Writable.prototype.pipe,mr=t=>!!t&&typeof t=="object"&&t instanceof ue&&typeof t.write=="function"&&typeof t.end=="function",G=Symbol("EOF"),H=Symbol("maybeEmitEnd"),K=Symbol("emittedEnd"),Ft=Symbol("emittingEnd"),ut=Symbol("emittedError"),Rt=Symbol("closed"),Be=Symbol("read"),jt=Symbol("flush"),Ie=Symbol("flushChunk"),_=Symbol("encoding"),ht=Symbol("decoder"),A=Symbol("flowing"),ft=Symbol("paused"),at=Symbol("resume"),k=Symbol("buffer"),T=Symbol("pipes"),C=Symbol("bufferLength"),ee=Symbol("bufferPush"),Pt=Symbol("bufferShift"),O=Symbol("objectMode"),E=Symbol("destroyed"),ie=Symbol("error"),se=Symbol("emitData"),Ue=Symbol("emitEnd"),re=Symbol("emitEnd2"),I=Symbol("async"),ne=Symbol("abort"),Dt=Symbol("aborted"),dt=Symbol("signal"),tt=Symbol("dataListeners"),P=Symbol("discarded"),gt=t=>Promise.resolve().then(t),wr=t=>t(),yr=t=>t==="end"||t==="finish"||t==="prefinish",br=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,vr=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),wi=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[at](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Sr=class extends wi{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=s=>e.emit("error",s),t.on("error",this.proxyErrors)}},xr=t=>!!t.objectMode,Er=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",_t=class extends ue{[A]=!1;[ft]=!1;[T]=[];[k]=[];[O];[_];[I];[ht];[G]=!1;[K]=!1;[Ft]=!1;[Rt]=!1;[ut]=null;[C]=0;[E]=!1;[dt];[Dt]=!1;[tt]=0;[P]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");xr(e)?(this[O]=!0,this[_]=null):Er(e)?(this[_]=e.encoding,this[O]=!1):(this[O]=!1,this[_]=null),this[I]=!!e.async,this[ht]=this[_]?new fr(this[_]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[T]});let{signal:i}=e;i&&(this[dt]=i,i.aborted?this[ne]():i.addEventListener("abort",()=>this[ne]()))}get bufferLength(){return this[C]}get encoding(){return this[_]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[O]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[I]}set async(t){this[I]=this[I]||!!t}[ne](){this[Dt]=!0,this.emit("abort",this[dt]?.reason),this.destroy(this[dt]?.reason)}get aborted(){return this[Dt]}set aborted(t){}write(t,e,i){if(this[Dt])return!1;if(this[G])throw new Error("write after end");if(this[E])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(i=e,e="utf8"),e||(e="utf8");let s=this[I]?gt:wr;if(!this[O]&&!Buffer.isBuffer(t)){if(vr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(br(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[O]?(this[A]&&this[C]!==0&&this[jt](!0),this[A]?this.emit("data",t):this[ee](t),this[C]!==0&&this.emit("readable"),i&&s(i),this[A]):t.length?(typeof t=="string"&&!(e===this[_]&&!this[ht]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[_]&&(t=this[ht].write(t)),this[A]&&this[C]!==0&&this[jt](!0),this[A]?this.emit("data",t):this[ee](t),this[C]!==0&&this.emit("readable"),i&&s(i),this[A]):(this[C]!==0&&this.emit("readable"),i&&s(i),this[A])}read(t){if(this[E])return null;if(this[P]=!1,this[C]===0||t===0||t&&t>this[C])return this[H](),null;this[O]&&(t=null),this[k].length>1&&!this[O]&&(this[k]=[this[_]?this[k].join(""):Buffer.concat(this[k],this[C])]);let e=this[Be](t||null,this[k][0]);return this[H](),e}[Be](t,e){if(this[O])this[Pt]();else{let i=e;t===i.length||t===null?this[Pt]():typeof i=="string"?(this[k][0]=i.slice(t),e=i.slice(0,t),this[C]-=t):(this[k][0]=i.subarray(t),e=i.subarray(0,t),this[C]-=t)}return this.emit("data",e),!this[k].length&&!this[G]&&this.emit("drain"),e}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e="utf8"),t!==void 0&&this.write(t,e),i&&this.once("end",i),this[G]=!0,this.writable=!1,(this[A]||!this[ft])&&this[H](),this}[at](){this[E]||(!this[tt]&&!this[T].length&&(this[P]=!0),this[ft]=!1,this[A]=!0,this.emit("resume"),this[k].length?this[jt]():this[G]?this[H]():this.emit("drain"))}resume(){return this[at]()}pause(){this[A]=!1,this[ft]=!0,this[P]=!1}get destroyed(){return this[E]}get flowing(){return this[A]}get paused(){return this[ft]}[ee](t){this[O]?this[C]+=1:this[C]+=t.length,this[k].push(t)}[Pt](){return this[O]?this[C]-=1:this[C]-=this[k][0].length,this[k].shift()}[jt](t=!1){do;while(this[Ie](this[Pt]())&&this[k].length);!t&&!this[k].length&&!this[G]&&this.emit("drain")}[Ie](t){return this.emit("data",t),this[A]}pipe(t,e){if(this[E])return t;this[P]=!1;let i=this[K];return e=e||{},t===_e.stdout||t===_e.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[T].push(e.proxyErrors?new Sr(this,t,e):new wi(this,t,e)),this[I]?gt(()=>this[at]()):this[at]()),t}unpipe(t){let e=this[T].find(i=>i.dest===t);e&&(this[T].length===1?(this[A]&&this[tt]===0&&(this[A]=!1),this[T]=[]):this[T].splice(this[T].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let i=super.on(t,e);if(t==="data")this[P]=!1,this[tt]++,!this[T].length&&!this[A]&&this[at]();else if(t==="readable"&&this[C]!==0)super.emit("readable");else if(yr(t)&&this[K])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[ut]){let s=e;this[I]?gt(()=>s.call(this,this[ut])):s.call(this,this[ut])}return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return t==="data"&&(this[tt]=this.listeners("data").length,this[tt]===0&&!this[P]&&!this[T].length&&(this[A]=!1)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[tt]=0,!this[P]&&!this[T].length&&(this[A]=!1)),e}get emittedEnd(){return this[K]}[H](){!this[Ft]&&!this[K]&&!this[E]&&this[k].length===0&&this[G]&&(this[Ft]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Rt]&&this.emit("close"),this[Ft]=!1)}emit(t,...e){let i=e[0];if(t!=="error"&&t!=="close"&&t!==E&&this[E])return!1;if(t==="data")return!this[O]&&!i?!1:this[I]?(gt(()=>this[se](i)),!0):this[se](i);if(t==="end")return this[Ue]();if(t==="close"){if(this[Rt]=!0,!this[K]&&!this[E])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(t==="error"){this[ut]=i,super.emit(ie,i);let r=!this[dt]||this.listeners("error").length?super.emit("error",i):!1;return this[H](),r}else if(t==="resume"){let r=super.emit("resume");return this[H](),r}else if(t==="finish"||t==="prefinish"){let r=super.emit(t);return this.removeAllListeners(t),r}let s=super.emit(t,...e);return this[H](),s}[se](t){for(let i of this[T])i.dest.write(t)===!1&&this.pause();let e=this[P]?!1:super.emit("data",t);return this[H](),e}[Ue](){return this[K]?!1:(this[K]=!0,this.readable=!1,this[I]?(gt(()=>this[re]()),!0):this[re]())}[re](){if(this[ht]){let e=this[ht].end();if(e){for(let i of this[T])i.dest.write(e);this[P]||super.emit("data",e)}}for(let e of this[T])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[O]||(t.dataLength=0);let e=this.promise();return this.on("data",i=>{t.push(i),this[O]||(t.dataLength+=i.length)}),await e,t}async concat(){if(this[O])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[_]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(E,()=>e(new Error("stream destroyed"))),this.on("error",i=>e(i)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[P]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[G])return e();let s,r,n=l=>{this.off("data",o),this.off("end",h),this.off(E,a),e(),r(l)},o=l=>{this.off("error",n),this.off("end",h),this.off(E,a),this.pause(),s({value:l,done:!!this[G]})},h=()=>{this.off("error",n),this.off("data",o),this.off(E,a),e(),s({done:!0,value:void 0})},a=()=>n(new Error("stream destroyed"));return new Promise((l,p)=>{r=p,s=l,this.once(E,a),this.once("error",n),this.once("end",h),this.once("data",o)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[P]=!1;let t=!1,e=()=>(this.pause(),this.off(ie,e),this.off(E,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let s=this.read();return s===null?e():{done:!1,value:s}};return this.once("end",e),this.once(ie,e),this.once(E,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[E])return t?this.emit("error",t):this.emit(E),this;this[E]=!0,this[P]=!0,this[k].length=0,this[C]=0;let e=this;return typeof e.close=="function"&&!this[Rt]&&e.close(),t?this.emit("error",t):this.emit(E),this}static get isStream(){return dr}},Ar=hr.native,bt={lstatSync:sr,readdir:rr,readdirSync:nr,readlinkSync:or,realpathSync:Ar,promises:{lstat:lr,readdir:cr,readlink:pr,realpath:ur}},yi=t=>!t||t===bt||t===ar?bt:{...bt,...t,promises:{...bt.promises,...t.promises||{}}},bi=/^\\\\\?\\([a-z]:)\\?$/i,kr=t=>t.replace(/\//g,"\\").replace(bi,"$1\\"),Cr=/[\\\/]/,L=0,vi=1,Si=2,U=4,xi=6,Ei=8,et=10,Ai=12,M=15,mt=~M,oe=16,Ge=32,vt=64,B=128,$t=256,Wt=512,He=vt|B|Wt,Or=1023,he=t=>t.isFile()?Ei:t.isDirectory()?U:t.isSymbolicLink()?et:t.isCharacterDevice()?Si:t.isBlockDevice()?xi:t.isSocket()?Ai:t.isFIFO()?vi:L,Ve=new It({max:2**12}),St=t=>{let e=Ve.get(t);if(e)return e;let i=t.normalize("NFKD");return Ve.set(t,i),i},Ye=new It({max:2**12}),Mt=t=>{let e=Ye.get(t);if(e)return e;let i=St(t.toLowerCase());return Ye.set(t,i),i},Je=class extends It{constructor(){super({max:256})}},Tr=class extends It{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},ki=Symbol("PathScurry setAsCwd"),j=class{name;root;roots;parent;nocase;isCWD=!1;#t;#i;get dev(){return this.#i}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#w;get rdev(){return this.#w}#c;get blksize(){return this.#c}#h;get ino(){return this.#h}#u;get size(){return this.#u}#p;get blocks(){return this.#p}#a;get atimeMs(){return this.#a}#s;get mtimeMs(){return this.#s}#f;get ctimeMs(){return this.#f}#S;get birthtimeMs(){return this.#S}#b;get atime(){return this.#b}#d;get mtime(){return this.#d}#T;get ctime(){return this.#T}#g;get birthtime(){return this.#g}#A;#k;#m;#y;#x;#C;#e;#$;#P;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L,i,s,r,n,o){this.name=t,this.#A=r?Mt(t):St(t),this.#e=e&Or,this.nocase=r,this.roots=s,this.root=i||this,this.#$=n,this.#m=o.fullpath,this.#x=o.relative,this.#C=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=yi(o.fs)}depth(){return this.#k!==void 0?this.#k:this.parent?this.#k=this.parent.depth()+1:this.#k=0}childrenCache(){return this.#$}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#D(i):this.#D(i)}#D(t){let e=this;for(let i of t)e=e.child(i);return e}children(){let t=this.#$.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#$.set(this,e),this.#e&=~oe,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let i=this.children(),s=this.nocase?Mt(t):St(t);for(let h of i)if(h.#A===s)return h;let r=this.parent?this.sep:"",n=this.#m?this.#m+r+t:void 0,o=this.newChild(t,L,{...e,parent:this,fullpath:n});return this.canReaddir()||(o.#e|=B),i.push(o),o}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let t=this.name,e=this.parent;if(!e)return this.#x=this.name;let i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let t=this.name,e=this.parent;if(!e)return this.#C=this.fullpathPosix();let i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(this.#m!==void 0)return this.#m;let t=this.name,e=this.parent;if(!e)return this.#m=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#m=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#y=`//?/${s}`:this.#y=s}let t=this.parent,e=t.fullpathPosix(),i=e+(!e||!t.parent?"":"/")+this.name;return this.#y=i}isUnknown(){return(this.#e&M)===L}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#e&M)===Ei}isDirectory(){return(this.#e&M)===U}isCharacterDevice(){return(this.#e&M)===Si}isBlockDevice(){return(this.#e&M)===xi}isFIFO(){return(this.#e&M)===vi}isSocket(){return(this.#e&M)===Ai}isSymbolicLink(){return(this.#e&et)===et}lstatCached(){return this.#e&Ge?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#O}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let t=this.#e&M;return!(t!==L&&t!==et||this.#e&$t||this.#e&B)}calledReaddir(){return!!(this.#e&oe)}isENOENT(){return!!(this.#e&B)}isNamed(t){return this.nocase?this.#A===Mt(t):this.#A===St(t)}async readlink(){let t=this.#P;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(e);if(i)return this.#P=i}catch(e){this.#j(e.code);return}}readlinkSync(){let t=this.#P;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(e);if(i)return this.#P=i}catch(e){this.#j(e.code);return}}#N(t){this.#e|=oe;for(let e=t.provisional;e<t.length;e++){let i=t[e];i&&i.#E()}}#E(){this.#e&B||(this.#e=(this.#e|B)&mt,this.#G())}#G(){let t=this.children();t.provisional=0;for(let e of t)e.#E()}#W(){this.#e|=Wt,this.#M()}#M(){if(this.#e&vt)return;let t=this.#e;(t&M)===U&&(t&=mt),this.#e=t|vt,this.#G()}#z(t=""){t==="ENOTDIR"||t==="EPERM"?this.#M():t==="ENOENT"?this.#E():this.children().provisional=0}#R(t=""){t==="ENOTDIR"?this.parent.#M():t==="ENOENT"&&this.#E()}#j(t=""){let e=this.#e;e|=$t,t==="ENOENT"&&(e|=B),(t==="EINVAL"||t==="UNKNOWN")&&(e&=mt),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#M()}#_(t,e){return this.#I(t,e)||this.#B(t,e)}#B(t,e){let i=he(t),s=this.newChild(t.name,i,{parent:this}),r=s.#e&M;return r!==U&&r!==et&&r!==L&&(s.#e|=vt),e.unshift(s),e.provisional++,s}#I(t,e){for(let i=e.provisional;i<e.length;i++){let s=e[i];if((this.nocase?Mt(t.name):St(t.name))===s.#A)return this.#l(t,s,i,e)}}#l(t,e,i,s){let r=e.name;return e.#e=e.#e&mt|he(t),r!==t.name&&(e.name=t.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(e)),s.provisional++,e}async lstat(){if((this.#e&B)===0)try{return this.#U(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#R(t.code)}}lstatSync(){if((this.#e&B)===0)try{return this.#U(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#R(t.code)}}#U(t){let{atime:e,atimeMs:i,birthtime:s,birthtimeMs:r,blksize:n,blocks:o,ctime:h,ctimeMs:a,dev:l,gid:p,ino:c,mode:f,mtime:u,mtimeMs:d,nlink:g,rdev:w,size:m,uid:y}=t;this.#b=e,this.#a=i,this.#g=s,this.#S=r,this.#c=n,this.#p=o,this.#T=h,this.#f=a,this.#i=l,this.#v=p,this.#h=c,this.#n=f,this.#d=u,this.#s=d,this.#r=g,this.#w=w,this.#u=m,this.#o=y;let b=he(t);this.#e=this.#e&mt|b|Ge,b!==L&&b!==U&&b!==et&&(this.#e|=vt)}#L=[];#F=!1;#H(t){this.#F=!1;let e=this.#L.slice();this.#L.length=0,e.forEach(i=>i(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let i=this.children();if(this.calledReaddir()){let r=i.slice(0,i.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#L.push(t),this.#F)return;this.#F=!0;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:!0},(r,n)=>{if(r)this.#z(r.code),i.provisional=0;else{for(let o of n)this.#_(o,i);this.#N(i)}this.#H(i.slice(0,i.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#V)await this.#V;else{let i=()=>{};this.#V=new Promise(s=>i=s);try{for(let s of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#_(s,t);this.#N(t)}catch(s){this.#z(s.code),t.provisional=0}this.#V=void 0,i()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let i of this.#t.readdirSync(e,{withFileTypes:!0}))this.#_(i,t);this.#N(t)}catch(i){this.#z(i.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&He)return!1;let t=M&this.#e;return t===L||t===U||t===et}shouldWalk(t,e){return(this.#e&U)===U&&!(this.#e&He)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#O)return this.#O;if(!((Wt|$t|B)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#O=this.resolve(t)}catch{this.#W()}}realpathSync(){if(this.#O)return this.#O;if(!((Wt|$t|B)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#O=this.resolve(t)}catch{this.#W()}}[ki](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),i=[],s=this;for(;s&&s.parent;)e.add(s),s.#x=i.join(this.sep),s.#C=i.join("/"),s=s.parent,i.push("..");for(s=t;s&&s.parent&&!e.has(s);)s.#x=void 0,s.#C=void 0,s=s.parent}},Ci=class Oi extends j{sep="\\";splitSep=Cr;constructor(e,i=L,s,r,n,o,h){super(e,i,s,r,n,o,h)}newChild(e,i=L,s={}){return new Oi(e,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(e){return le.parse(e).root}getRoot(e){if(e=kr(e.toUpperCase()),e===this.root.name)return this.root;for(let[i,s]of Object.entries(this.roots))if(this.sameRoot(e,i))return this.roots[e]=s;return this.roots[e]=new fe(e,this).root}sameRoot(e,i=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(bi,"$1\\"),e===i}},Ti=class Fi extends j{splitSep="/";sep="/";constructor(e,i=L,s,r,n,o,h){super(e,i,s,r,n,o,h)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,i=L,s={}){return new Fi(e,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Ri=class{root;rootPath;roots;cwd;#t;#i;#n;nocase;#r;constructor(t=process.cwd(),e,i,{nocase:s,childrenCacheSize:r=16*1024,fs:n=bt}={}){this.#r=yi(n),(t instanceof URL||t.startsWith("file://"))&&(t=ir(t));let o=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new Je,this.#i=new Je,this.#n=new Tr(r);let h=o.substring(this.rootPath.length).split(i);if(h.length===1&&!h[0]&&h.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let a=this.root,l=h.length-1,p=e.sep,c=this.rootPath,f=!1;for(let u of h){let d=l--;a=a.child(u,{relative:new Array(d).fill("..").join(p),relativePosix:new Array(d).fill("..").join("/"),fullpath:c+=(f?"":p)+u}),f=!0}this.cwd=a}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let r=t.length-1;r>=0;r--){let n=t[r];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let i=this.#t.get(e);if(i!==void 0)return i;let s=this.cwd.resolve(e).fullpath();return this.#t.set(e,s),s}resolvePosix(...t){let e="";for(let r=t.length-1;r>=0;r--){let n=t[r];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let i=this.#i.get(e);if(i!==void 0)return i;let s=this.cwd.resolve(e).fullpathPosix();return this.#i.set(e,s),s}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i}=e;if(t.canReaddir()){let s=await t.readdir();return i?s:s.map(r=>r.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i=!0}=e;return t.canReaddir()?i?t.readdirSync():t.readdirSync().map(s=>s.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t.withFileTypes,t=this.cwd);let i=await t.readlink();return e?i:i?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t.withFileTypes,t=this.cwd);let i=t.readlinkSync();return e?i:i?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t.withFileTypes,t=this.cwd);let i=await t.realpath();return e?i:i?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t.withFileTypes,t=this.cwd);let i=t.realpathSync();return e?i:i?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:r,walkFilter:n}=e,o=[];(!r||r(t))&&o.push(i?t:t.fullpath());let h=new Set,a=(p,c)=>{h.add(p),p.readdirCB((f,u)=>{if(f)return c(f);let d=u.length;if(!d)return c();let g=()=>{--d===0&&c()};for(let w of u)(!r||r(w))&&o.push(i?w:w.fullpath()),s&&w.isSymbolicLink()?w.realpath().then(m=>m?.isUnknown()?m.lstat():m).then(m=>m?.shouldWalk(h,n)?a(m,g):g()):w.shouldWalk(h,n)?a(w,g):g()},!0)},l=t;return new Promise((p,c)=>{a(l,f=>{if(f)return c(f);p(o)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:r,walkFilter:n}=e,o=[];(!r||r(t))&&o.push(i?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let p of l){(!r||r(p))&&o.push(i?p:p.fullpath());let c=p;if(p.isSymbolicLink()){if(!(s&&(c=p.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(h,n)&&h.add(c)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:r,walkFilter:n}=e;(!r||r(t))&&(yield i?t:t.fullpath());let o=new Set([t]);for(let h of o){let a=h.readdirSync();for(let l of a){(!r||r(l))&&(yield i?l:l.fullpath());let p=l;if(l.isSymbolicLink()){if(!(s&&(p=l.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(o,n)&&o.add(p)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:r,walkFilter:n}=e,o=new _t({objectMode:!0});(!r||r(t))&&o.write(i?t:t.fullpath());let h=new Set,a=[t],l=0,p=()=>{let c=!1;for(;!c;){let f=a.shift();if(!f){l===0&&o.end();return}l++,h.add(f);let u=(g,w,m=!1)=>{if(g)return o.emit("error",g);if(s&&!m){let y=[];for(let b of w)b.isSymbolicLink()&&y.push(b.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(y.length){Promise.all(y).then(()=>u(null,w,!0));return}}for(let y of w)y&&(!r||r(y))&&(o.write(i?y:y.fullpath())||(c=!0));l--;for(let y of w){let b=y.realpathCached()||y;b.shouldWalk(h,n)&&a.push(b)}c&&!o.flowing?o.once("drain",p):d||p()},d=!0;f.readdirCB(u,!0),d=!1}};return p(),o}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof j||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:r,walkFilter:n}=e,o=new _t({objectMode:!0}),h=new Set;(!r||r(t))&&o.write(i?t:t.fullpath());let a=[t],l=0,p=()=>{let c=!1;for(;!c;){let f=a.shift();if(!f){l===0&&o.end();return}l++,h.add(f);let u=f.readdirSync();for(let d of u)(!r||r(d))&&(o.write(i?d:d.fullpath())||(c=!0));l--;for(let d of u){let g=d;if(d.isSymbolicLink()){if(!(s&&(g=d.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(h,n)&&a.push(g)}}c&&!o.flowing&&o.once("drain",p)};return p(),o}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[ki](e)}},fe=class extends Ri{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:i=!0}=e;super(t,le,"\\",{...e,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(t){return le.parse(t).root.toUpperCase()}newRoot(t){return new Ci(this.rootPath,U,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},de=class extends Ri{sep="/";constructor(t=process.cwd(),e={}){let{nocase:i=!1}=e;super(t,er,"/",{...e,nocase:i}),this.nocase=i}parseRootPath(t){return"/"}newRoot(t){return new Ti(this.rootPath,U,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},ji=class extends de{constructor(t=process.cwd(),e={}){let{nocase:i=!0}=e;super(t,{...e,nocase:i})}},dn=process.platform==="win32"?Ci:Ti,Fr=process.platform==="win32"?fe:process.platform==="darwin"?ji:de,Rr=t=>t.length>=1,jr=t=>t.length>=1,Pr=Symbol.for("nodejs.util.inspect.custom"),Pi=class Di{#t;#i;#n;length;#r;#o;#v;#w;#c;#h;#u=!0;constructor(e,i,s,r){if(!Rr(e))throw new TypeError("empty pattern list");if(!jr(i))throw new TypeError("empty glob list");if(i.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#i=i,this.#n=s,this.#r=r,this.#n===0){if(this.isUNC()){let[n,o,h,a,...l]=this.#t,[p,c,f,u,...d]=this.#i;l[0]===""&&(l.shift(),d.shift());let g=[n,o,h,a,""].join("/"),w=[p,c,f,u,""].join("/");this.#t=[g,...l],this.#i=[w,...d],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#i;o[0]===""&&(o.shift(),a.shift());let l=n+"/",p=h+"/";this.#t=[l,...o],this.#i=[p,...a],this.length=this.#t.length}}}[Pr](){return"Pattern <"+this.#i.slice(this.#n).join("/")+">"}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===F}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#v=this.#v||(this.#n===0?this.isAbsolute()?this.#i[0]+this.#i.slice(1).join("/"):this.#i.join("/"):this.#i.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new Di(this.#t,this.#i,this.#n+1,this.#r),this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o.#w=this.#w,this.#o):this.#o=null}isUNC(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#w!==void 0?this.#w:this.#w=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#h!==void 0?this.#h:this.#h=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}},Dr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qe=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:i,noext:s,noglobstar:r,platform:n=Dr}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:i,noext:s,noglobstar:r,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(let o of t)this.add(o)}add(t){let e=new X(t,this.mmopts);for(let i=0;i<e.set.length;i++){let s=e.set[i],r=e.globParts[i];if(!s||!r)throw new Error("invalid pattern object");for(;s[0]==="."&&r[0]===".";)s.shift(),r.shift();let n=new Pi(s,r,0,this.platform),o=new X(n.globString(),this.mmopts),h=r[r.length-1]==="**",a=n.isAbsolute();a?this.absolute.push(o):this.relative.push(o),h&&(a?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(t){let e=t.fullpath(),i=`${e}/`,s=t.relative()||".",r=`${s}/`;for(let n of this.relative)if(n.match(s)||n.match(r))return!0;for(let n of this.absolute)if(n.match(e)||n.match(i))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return!0;for(let s of this.absoluteChildren)if(s.match(e))return!0;return!1}},$r=class $i{store;constructor(e=new Map){this.store=e}copy(){return new $i(new Map(this.store))}hasWalked(e,i){return this.store.get(e.fullpath())?.has(i.globString())}storeWalked(e,i){let s=e.fullpath(),r=this.store.get(s);r?r.add(i.globString()):this.store.set(s,new Set([i.globString()]))}},Mr=class{store=new Map;add(t,e,i){let s=(e?2:0)|(i?1:0),r=this.store.get(t);this.store.set(t,r===void 0?s:s&r)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Lr=class{store=new Map;add(t,e){if(!t.canReaddir())return;let i=this.store.get(t);i?i.find(s=>s.globString()===e.globString())||i.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Ke=class Mi{hasWalkedCache;matches=new Mr;subwalks=new Lr;patterns;follow;dot;opts;constructor(e,i){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=i?i.copy():new $r}processPatterns(e,i){this.patterns=i;let s=i.map(r=>[e,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let c=n.rest();if(c)n=c;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let a,l,p=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)r=r.resolve(a),n=l,p=!0;if(a=n.pattern(),l=n.rest(),p){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof a=="string"){let c=a===".."||a===""||a===".";this.matches.add(r.resolve(a),h,c);continue}else if(a===F){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let c=l?.pattern(),f=l?.rest();if(!l||(c===""||c===".")&&!f)this.matches.add(r,h,c===""||c===".");else if(c===".."){let u=r.parent||r;f?this.hasWalkedCache.hasWalked(u,f)||this.subwalks.add(u,f):this.matches.add(u,h,!0)}}else a instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Mi(this.opts,this.hasWalkedCache)}filterEntries(e,i){let s=this.subwalks.get(e),r=this.child();for(let n of i)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===F?r.testGlobstar(n,o,l,h):a instanceof RegExp?r.testRegExp(n,a,l,h):r.testString(n,a,l,h)}return r}testGlobstar(e,i,s,r){if((this.dot||!e.name.startsWith("."))&&(i.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,i):e.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(e,s):i.markFollowGlobstar()&&this.subwalks.add(e,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,s.rest(),r);else if(n===".."){let o=e.parent||e;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(e,n,s.rest(),r)}}testRegExp(e,i,s,r){i.test(e.name)&&(s?this.subwalks.add(e,s):this.matches.add(e,r,!1))}testString(e,i,s,r){e.isNamed(i)&&(s?this.subwalks.add(e,s):this.matches.add(e,r,!1))}},Wr=(t,e)=>typeof t=="string"?new qe([t],e):Array.isArray(t)?new qe(t,e):t,Li=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#i;#n;signal;maxDepth;includeChildMatches;constructor(t,e,i){if(this.patterns=t,this.path=e,this.opts=i,this.#n=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#i=Wr(i.ignore??[],i),!this.includeChildMatches&&typeof this.#i.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#r(t){return this.seen.has(t)||!!this.#i?.ignored?.(t)}#o(t){return!!this.#i?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||await t.realpath(),!i)return;t=i}let s=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let r=await s.realpath();r&&(r.isUnknown()||this.opts.stat)&&await r.lstat()}return this.matchCheckTest(s,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#r(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||t.realpathSync(),!i)return;t=i}let s=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let r=s.realpathSync();r&&(r?.isUnknown()||this.opts.stat)&&r.lstatSync()}return this.matchCheckTest(s,e)}matchFinish(t,e){if(this.#r(t))return;if(!this.includeChildMatches&&this.#i?.add){let r=`${t.relativePosix()}/**`;this.#i.add(r)}let i=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let s=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(i){let r=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(r+s)}else{let r=this.opts.posix?t.relativePosix():t.relative(),n=this.opts.dotRelative&&!r.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(r?n+r+s:"."+s)}}async match(t,e,i){let s=await this.matchCheck(t,i);s&&this.matchFinish(s,e)}matchSync(t,e,i){let s=this.matchCheckSync(t,i);s&&this.matchFinish(s,e)}walkCB(t,e,i){this.signal?.aborted&&i(),this.walkCB2(t,e,new Ke(this.opts),i)}walkCB2(t,e,i,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(t,e,i,s));return}i.processPatterns(t,e);let r=1,n=()=>{--r===0&&s()};for(let[o,h,a]of i.matches.entries())this.#r(o)||(r++,this.match(o,h,a).then(()=>n()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;r++;let h=o.readdirCached();o.calledReaddir()?this.walkCB3(o,h,i,n):o.readdirCB((a,l)=>this.walkCB3(o,l,i,n),!0)}n()}walkCB3(t,e,i,s){i=i.filterEntries(t,e);let r=1,n=()=>{--r===0&&s()};for(let[o,h,a]of i.matches.entries())this.#r(o)||(r++,this.match(o,h,a).then(()=>n()));for(let[o,h]of i.subwalks.entries())r++,this.walkCB2(o,h,i.child(),n);n()}walkCBSync(t,e,i){this.signal?.aborted&&i(),this.walkCB2Sync(t,e,new Ke(this.opts),i)}walkCB2Sync(t,e,i,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,i,s));return}i.processPatterns(t,e);let r=1,n=()=>{--r===0&&s()};for(let[o,h,a]of i.matches.entries())this.#r(o)||this.matchSync(o,h,a);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;r++;let h=o.readdirSync();this.walkCB3Sync(o,h,i,n)}n()}walkCB3Sync(t,e,i,s){i=i.filterEntries(t,e);let r=1,n=()=>{--r===0&&s()};for(let[o,h,a]of i.matches.entries())this.#r(o)||this.matchSync(o,h,a);for(let[o,h]of i.subwalks.entries())r++,this.walkCB2Sync(o,h,i.child(),n);n()}},Ze=class extends Li{matches=new Set;constructor(t,e,i){super(t,e,i)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Xe=class extends Li{results;constructor(t,e,i){super(t,e,i),this.results=new _t({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},Nr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",it=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=Zs(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=t,this.platform=e.platform||Nr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=e.platform==="win32"?fe:e.platform==="darwin"?ji:e.platform?de:Fr;this.scurry=new h(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(h=>new X(h,s)),[n,o]=r.reduce((h,a)=>(h[0].push(...a.set),h[1].push(...a.globParts),h),[[],[]]);this.patterns=n.map((h,a)=>{let l=o[a];if(!l)throw new Error("invalid pattern object");return new Pi(h,l,0,this.platform)})}async walk(){return[...await new Ze(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Ze(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Xe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Xe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},ge=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let i of t)if(new X(i,e).hasMagic())return!0;return!1};function Ut(t,e={}){return new it(t,e).streamSync()}function Wi(t,e={}){return new it(t,e).stream()}function Ni(t,e={}){return new it(t,e).walkSync()}async function Qe(t,e={}){return new it(t,e).walk()}function Gt(t,e={}){return new it(t,e).iterateSync()}function zi(t,e={}){return new it(t,e).iterate()}var zr=Ut,_r=Object.assign(Wi,{sync:Ut}),Br=Gt,Ir=Object.assign(zi,{sync:Gt}),Ur=Object.assign(Ni,{stream:Ut,iterate:Gt}),Bt=Object.assign(Qe,{glob:Qe,globSync:Ni,sync:Ur,globStream:Wi,stream:_r,globStreamSync:Ut,streamSync:zr,globIterate:zi,iterate:Ir,globIterateSync:Gt,iterateSync:Br,Glob:it,hasMagic:ge,escape:hi,unescape:lt});Bt.glob=Bt;import*as W from"node:fs";import{basename as _i,dirname as Et,extname as xt,join as Bi,resolve as ct,relative as Gr}from"node:path";import*as V from"node:process";import{performance as Hr}from"perf_hooks";var Ht=["json","yaml","yml"];async function Gi(t,e){let s=!Zt(t)&&Se(e.resolvedConfig.apis)?Yr(e):await Jr(t,e),r=s.filter(({path:n})=>!Vr(n));if(Zt(r)){for(let{path:n}of r)x.warn(`
10
- ${At(n)} ${ke(`does not exist or is invalid.
11
-
12
- `)}`);z("Please provide a valid path.")}return s.length===0&&z("No APIs were provided. Specify an API via the command argument or define one in your config."),s}function Yt(t){return t.configPath?Et(t.configPath):V.cwd()}function Vr(t){if(!t.trim()){z("Path cannot be empty.");return}return W.existsSync(t)||ot(t)?t:void 0}function Yr(t){return Object.entries(t.resolvedConfig.apis||{}).map(([e,{root:i,output:s}])=>({path:ot(i)?i:ct(Yt(t),i),alias:e,output:s&&ct(Yt(t),s)}))}function Ii(t,e){let i=Yt(t),s=t.resolvedConfig.apis?.[e];return s?{path:ot(s.root)?s.root:ct(i,s.root),alias:e,output:s.output&&ct(i,s.output)}:{path:e,alias:Object.entries(t.resolvedConfig.apis||{}).find(([r,n])=>ct(i,n.root)===ct(e))?.[0]??void 0}}async function Jr(t,e){return(await Promise.all(t.map(async i=>ge(i)&&!ot(i)?(await Bt(i,{cwd:Yt(e)})).map(n=>Ii(e,n)):Ii(e,i)))).flat()}function me(t){return V.env.NODE_ENV==="test"?"<test>ms":`${Math.ceil(Hr.now()-t)}ms`}function Jn(t,e,i){let s=me(e);x.info(Q(`
13
- ${i}: ${t} processed in ${s}
14
-
15
- `))}function qn(t,e){return t==="/"?e:t.replaceAll("~1","/").replaceAll("~0","~").replace(/^\//,"").replaceAll("/",e)}function Kn(t){return t.replace(/#/g,"_sharp").replace(/\//,"_").replace(/\s/g,"")}function Zn(t){return{php:".php","c#":".cs",shell:".sh",curl:".sh",bash:".sh",javascript:".js",js:".js",python:".py",c:".c","c++":".cpp",coffeescript:".litcoffee",dart:".dart",elixir:".ex",go:".go",groovy:".groovy",java:".java",kotlin:".kt","objective-c":".m",perl:".pl",powershell:".ps1",ruby:".rb",rust:".rs",scala:".sc",swift:".swift",typescript:".ts",tsx:".tsx","visual basic":".vb","c/al":".al"}[t.toLowerCase()]??""}var Jt=class t extends Error{constructor(i){super(i.message);this.originalError=i;Object.setPrototypeOf(this,t.prototype)}originalError};function Xn(t,e,i){if(e==="json")try{return JSON.stringify(t,null,2)}catch(s){throw s.message.indexOf("circular")>-1?new Jt(s):s}else return Xt(t,{noRefs:!i,lineWidth:-1})}function Qn(t,e){W.mkdirSync(Et(t),{recursive:!0}),W.writeFileSync(t,e)}function to(t){return xe(W.readFileSync(t,"utf-8"),{filename:t})}function eo(t,e,i){if(Zr(e)==="json"){Kr(t,e);return}qr(t,e,i)}function qr(t,e,i=!1){let s=Xt(t,{noRefs:i});if(V.env.NODE_ENV==="test"){x.info(s);return}W.mkdirSync(Et(e),{recursive:!0}),W.writeFileSync(e,s)}function Kr(t,e){let i=JSON.stringify(t,null,2);if(V.env.NODE_ENV==="test"){x.info(i);return}W.mkdirSync(Et(e),{recursive:!0}),W.writeFileSync(e,i)}function Zr(t){let e=t.split(".").pop();return Ht.includes(e)?e:(x.warn(`Unsupported file extension: ${e}. Using yaml.
16
- `),"yaml")}function we(t,e){switch(t.constructor){case Fe:throw t;case Ae:z(`Failed to resolve API description at ${e}:
17
-
18
- - ${t.message}`);break;case Ee:z(`Failed to parse API description at ${e}:
19
-
20
- - ${t.message}`);break;case Jt:{z(`Detected circular reference which can't be converted to JSON.
21
- Try to use ${q("yaml")} output or remove ${q("--dereferenced")}.`);break}case SyntaxError:z(`Syntax error: ${t.message} ${t.stack?.split(`
22
-
23
- `)?.[0]}`);break;case Ct:z(t.message);break;default:z(`Something went wrong when processing ${e}:
24
-
25
- - ${t.message}`)}}function Hi(t,e){let i=t.ignored?J(`${t.ignored} ${N("problem is",t.ignored)} explicitly ignored.
26
-
27
- `):"";t.errors>0?x.error(`\u274C Validation failed with ${t.errors} ${N("error",t.errors)}${t.warnings>0?` and ${t.warnings} ${N("warning",t.warnings)}`:""}.
28
- ${i}`):t.warnings>0?(x.info(kt(`Woohoo! Your API ${N("description is",e)} valid. \u{1F389}
29
- `)),x.warn(`You have ${t.warnings} ${N("warning",t.warnings)}.
30
- ${i}`)):x.info(kt(`Woohoo! Your API ${N("description is",e)} valid. \u{1F389}
31
- ${i}`)),t.errors>0&&x.info(Q("run `redocly lint --generate-ignore-file` to add all problems to the ignore file.\n")),x.info(`
32
- `)}function Vi(t,e){t.errors>0?x.error(`\u274C Your config has ${t.errors} ${N("error",t.errors)}.
33
- `):t.warnings>0?x.warn(`\u26A0\uFE0F Your config has ${t.warnings} ${N("warning",t.warnings)}.
34
- `):e==="check-config"&&x.info(kt(`\u2705 Your config is valid.
35
- `))}function io({entrypoint:t,output:e,argvOutput:i,ext:s,entries:r}){let n=e||i;if(!n)return{ext:s||"yaml"};if(r>1&&i){if(s=s||xt(t).substring(1),!Ht.includes(s))throw new Error(`Invalid file extension: ${s}.`);n=Bi(i,_i(t,xt(t)))+"."+s}else{if(s=s||xt(n).substring(1)||xt(t).substring(1),!Ht.includes(s))throw new Error(`Invalid file extension: ${s}.`);n=Bi(Et(n),_i(n,xt(n)))+"."+s}return{outputFile:n,ext:s}}function Yi(t){let{preprocessors:e,rules:i,decorators:s}=t.getUnusedRules();i.length&&x.warn(`[WARNING] Unused rules found in ${q(t.configPath||"")}: ${i.join(", ")}.
36
- `),e.length&&x.warn(`[WARNING] Unused preprocessors found in ${q(t.configPath||"")}: ${e.join(", ")}.
37
- `),s.length&&x.warn(`[WARNING] Unused decorators found in ${q(t.configPath||"")}: ${s.join(", ")}.
38
- `),(i.length||e.length)&&x.warn(`Check the spelling and verify the added plugin prefix.
39
- `)}async function so(t,e){try{let i=await Ce({configPath:t.config,customExtends:t.extends});return await Ui(t,e,i),i}catch(i){we(i,"")}}function Xr(t){return t.asyncapi?.startsWith("2")}var Qr=["swagger","info","host","basePath","schemes","consumes","produces","security","tags","externalDocs","paths","definitions","parameters","responses","securityDefinitions"],tn=["openapi","info","jsonSchemaDialect","servers","security","tags","externalDocs","paths","webhooks","x-webhooks","components"],en=["asyncapi","id","info","externalDocs","tags","defaultContentType","servers","channels","components"],sn=["asyncapi","info","defaultContentType","servers","channels","operations","components"];function ro(t){return"asyncapi"in t?Xr(t)?Vt(t,en):Vt(t,sn):"swagger"in t?Vt(t,Qr):Vt(t,tn)}function Vt(t,e){let i={};for(let s of e)t.hasOwnProperty(s)&&(i[s]=t[s]);return Object.assign(i,t)}function Ji(t){let e={...t.oas2,...t.oas3_0,...t.oas3_1,...t.oas3_2,...t.async2,...t.async3,...t.arazzo1,...t.overlay1,...t.openrpc1,...t.graphql};ve(e)&&z("\u26A0\uFE0F No rules were configured. Learn how to configure rules: https://redocly.com/docs/cli/rules/")}function ye(t){return t.replace(/\x1b\[\d+m/g,"")}function At(t){return ot(t)?t:Gr(V.cwd(),t)}function no(t){return t?.length>0?t[0].toUpperCase()+t.slice(1):t}async function fo({argv:t,config:e,version:i,collectSpecData:s,collectResults:r}){let n=await Gi(t.apis,e),o={errors:0,warnings:0,ignored:0},h=0,a=t.format==="checkstyle"||t.format==="junit",l=[];for(let{path:p,alias:c}of n)try{let f=rn.now(),u=e.forAlias(c);Ji(u.rules),u.skipRules(t["skip-rule"]),u.skipPreprocessors(t["skip-preprocessor"]),typeof e.document?.parsed>"u"&&!t.extends&&x.info(`No configurations were provided -- using built in ${q("recommended")} configuration by default.
40
-
41
- `),c===void 0?x.info(Q(`validating ${At(p)}...
42
- `)):x.info(Q(`validating ${At(p)} using lint rules for api '${c}'...
43
- `));let d=await Oe({ref:p,config:u,collectSpecData:s});r?.(d);let g=Qt(d);if(o.errors+=g.errors,o.warnings+=g.warnings,o.ignored+=g.ignored,t["generate-ignore-file"]){e.clearIgnoreForRef(p);for(let m of d)e.addIgnore(m),h++}else a?l.push(...d):Ot(d,{format:t.format,maxProblems:t["max-problems"],totals:g,version:i,command:"lint"});let w=me(f);x.info(Q(`${At(p)}: validated in ${w}
44
-
45
- `))}catch(f){we(f,p)}if(a&&!t["generate-ignore-file"]&&Ot(l,{format:t.format,maxProblems:t["max-problems"],totals:o,version:i,command:"lint"}),t["generate-ignore-file"]?(e.saveIgnore(),x.info(`Explicitly ignored ${h} ${N("problem",h)}.
46
-
47
- `)):Hi(o,n.length),Yi(e),!(o.errors===0||t["generate-ignore-file"]))throw new Re("Lint failed.")}async function Ui(t,e,i){if(t["lint-config"]==="off"||i.document===void 0||t.format==="json"||t.format==="junit"||t.format==="checkstyle")return;let s=t?je(t):void 0,r=await Te({config:i,severity:t["lint-config"]||"warn"}),n=Qt(r);if(Ot(r,{format:t.format,maxProblems:t["max-problems"],totals:n,version:e,command:"check-config"}),Vi(n,s),n.errors>0)throw new Ct}var qt=" ",be=" ";function yo(t){let e=Math.max(...t.map(r=>ye(r).length)),i=e+be.length*2,s=qt+J("\u2551"+" ".repeat(i)+"\u2551");return["",qt+J("\u2554"+"\u2550".repeat(i)+"\u2557"),s,...t.map(r=>{let n=" ".repeat(e-ye(r).length);return`${qt}${J("\u2551")}${be}${r}${n}${be}${J("\u2551")}`}),s,qt+J("\u255A"+"\u2550".repeat(i)+"\u255D"),"",""].join(`
48
- `)}export{fo as a,Ht as b,Gi as c,Ii as d,me as e,Jn as f,qn as g,Kn as h,Zn as i,Xn as j,Qn as k,to as l,eo as m,Zr as n,we as o,io as p,Yi as q,so as r,ro as s,At as t,no as u,yo as v};
@@ -1,13 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{a as yt,c as At}from"./RFWIIJFG.js";var Ft=At((Ie,Vt)=>{var Ae=Object.prototype.hasOwnProperty,Te=Object.prototype.toString;Vt.exports=function(D,tt,T){if(Te.call(tt)!=="[object Function]")throw new TypeError("iterator must be a function");var R=D.length;if(R===+R)for(var w=0;w<R;w++)tt.call(T,D[w],w,D);else for(var M in D)Ae.call(D,M)&&tt.call(T,D[M],M,D)}});var je=At((De,Ut)=>{"use strict";var Ce=Ft();Ut.exports=Q;function Q(et,D,tt){if(arguments.length===3)return Q.set(et,D,tt);if(arguments.length===2)return Q.get(et,D);var T=Q.bind(Q,et);for(var R in Q)Q.hasOwnProperty(R)&&(T[R]=Q[R].bind(T,et));return T}Q.get=function(D,tt){for(var T=Array.isArray(tt)?tt:Q.parse(tt),R=0;R<T.length;++R){var w=T[R];if(!(typeof D=="object"&&w in D))throw new Error("Invalid reference token: "+w);D=D[w]}return D};Q.set=function(D,tt,T){var R=Array.isArray(tt)?tt:Q.parse(tt),w=R[0];if(R.length===0)throw Error("Can not set the root object");for(var M=0;M<R.length-1;++M){var h=R[M];typeof h!="string"&&typeof h!="number"&&(h=String(h)),!(h==="__proto__"||h==="constructor"||h==="prototype")&&(h==="-"&&Array.isArray(D)&&(h=D.length),w=R[M+1],h in D||(w.match(/^(\d+|-)$/)?D[h]=[]:D[h]={}),D=D[h])}return w==="-"&&Array.isArray(D)&&(w=D.length),D[w]=T,this};Q.remove=function(et,D){var tt=Array.isArray(D)?D:Q.parse(D),T=tt[tt.length-1];if(T===void 0)throw new Error('Invalid JSON pointer for remove: "'+D+'"');var R=Q.get(et,tt.slice(0,-1));if(Array.isArray(R)){var w=+T;if(T===""&&isNaN(w))throw new Error('Invalid array index: "'+T+'"');Array.prototype.splice.call(R,w,1)}else delete R[T]};Q.dict=function(D,tt){var T={};return Q.walk(D,function(R,w){T[w]=R},tt),T};Q.walk=function(D,tt,T){var R=[];T=T||function(w){var M=Object.prototype.toString.call(w);return M==="[object Object]"||M==="[object Array]"},(function w(M){Ce(M,function(h,_){R.push(String(_)),T(h)?w(h):tt(h,Q.compile(R)),R.pop()})})(D)};Q.has=function(D,tt){try{Q.get(D,tt)}catch{return!1}return!0};Q.escape=function(D){return D.toString().replace(/~/g,"~0").replace(/\//g,"~1")};Q.unescape=function(D){return D.replace(/~1/g,"/").replace(/~0/g,"~")};Q.parse=function(D){if(D==="")return[];if(D.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+D);return D.substring(1).split(/\//).map(Q.unescape)};Q.compile=function(D){return D.length===0?"":"/"+D.map(Q.escape).join("/")}});var Me=At((Bt,Tt)=>{(function(et){if(typeof Bt=="object"&&typeof Tt<"u")Tt.exports=et();else if(typeof define=="function"&&define.amd)define([],et);else{var D;typeof window<"u"?D=window:typeof global<"u"?D=global:typeof self<"u"?D=self:D=this,D.OpenAPISampler=et()}})(function(){var et,D,tt;return(function(){function T(R,w,M){function h(N,I){if(!w[N]){if(!R[N]){var C=typeof yt=="function"&&yt;if(!I&&C)return C(N,!0);if(_)return _(N,!0);var $=new Error("Cannot find module '"+N+"'");throw $.code="MODULE_NOT_FOUND",$}var l=w[N]={exports:{}};R[N][0].call(l.exports,function(c){var v=R[N][1][c];return h(v||c)},l,l.exports,T,R,w,M)}return w[N].exports}for(var _=typeof yt=="function"&&yt,y=0;y<M.length;y++)h(M[y]);return h}return T})()({1:[function(T,R,w){(()=>{"use strict";var M={d:(r,t)=>{for(var e in t)M.o(t,e)&&!M.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:t[e]})},o:(r,t)=>Object.prototype.hasOwnProperty.call(r,t),r:r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},h={};M.r(h),M.d(h,{XMLBuilder:()=>Pe,XMLParser:()=>ye,XMLValidator:()=>_e});let _=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",y=new RegExp("^["+_+"]["+_+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function N(r,t){let e=[],i=t.exec(r);for(;i;){let n=[];n.startIndex=t.lastIndex-i[0].length;let o=i.length;for(let u=0;u<o;u++)n.push(i[u]);e.push(n),i=t.exec(r)}return e}let I=function(r){return y.exec(r)!=null},C=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],$=["__proto__","constructor","prototype"],l={allowBooleanAttributes:!1,unpairedTags:[]};function c(r,t){t=Object.assign({},l,t);let e=[],i=!1,n=!1;r[0]==="\uFEFF"&&(r=r.substr(1));for(let o=0;o<r.length;o++)if(r[o]==="<"&&r[o+1]==="?"){if(o+=2,o=P(r,o),o.err)return o}else{if(r[o]!=="<"){if(v(r[o]))continue;return m("InvalidChar","char '"+r[o]+"' is not expected.",b(r,o))}{let u=o;if(o++,r[o]==="!"){o=E(r,o);continue}{let s=!1;r[o]==="/"&&(s=!0,o++);let d="";for(;o<r.length&&r[o]!==">"&&r[o]!==" "&&r[o]!==" "&&r[o]!==`
8
- `&&r[o]!=="\r";o++)d+=r[o];if(d=d.trim(),d[d.length-1]==="/"&&(d=d.substring(0,d.length-1),o--),!x(d)){let O;return O=d.trim().length===0?"Invalid space after '<'.":"Tag '"+d+"' is an invalid name.",m("InvalidTag",O,b(r,o))}let p=W(r,o);if(p===!1)return m("InvalidAttr","Attributes for '"+d+"' have open quote.",b(r,o));let g=p.value;if(o=p.index,g[g.length-1]==="/"){let O=o-g.length;g=g.substring(0,g.length-1);let j=Y(g,t);if(j!==!0)return m(j.err.code,j.err.msg,b(r,O+j.err.line));i=!0}else if(s){if(!p.tagClosed)return m("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",b(r,o));if(g.trim().length>0)return m("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",b(r,u));if(e.length===0)return m("InvalidTag","Closing tag '"+d+"' has not been opened.",b(r,u));{let O=e.pop();if(d!==O.tagName){let j=b(r,O.tagStartPos);return m("InvalidTag","Expected closing tag '"+O.tagName+"' (opened in line "+j.line+", col "+j.col+") instead of closing tag '"+d+"'.",b(r,u))}e.length==0&&(n=!0)}}else{let O=Y(g,t);if(O!==!0)return m(O.err.code,O.err.msg,b(r,o-g.length+O.err.line));if(n===!0)return m("InvalidXml","Multiple possible root nodes found.",b(r,o));t.unpairedTags.indexOf(d)!==-1||e.push({tagName:d,tagStartPos:u}),i=!0}for(o++;o<r.length;o++)if(r[o]==="<"){if(r[o+1]==="!"){o++,o=E(r,o);continue}if(r[o+1]!=="?")break;if(o=P(r,++o),o.err)return o}else if(r[o]==="&"){let O=f(r,o);if(O==-1)return m("InvalidChar","char '&' is not expected.",b(r,o));o=O}else if(n===!0&&!v(r[o]))return m("InvalidXml","Extra text at the end",b(r,o));r[o]==="<"&&o--}}}return i?e.length==1?m("InvalidTag","Unclosed tag '"+e[0].tagName+"'.",b(r,e[0].tagStartPos)):!(e.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(e.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}function v(r){return r===" "||r===" "||r===`
9
- `||r==="\r"}function P(r,t){let e=t;for(;t<r.length;t++)if(r[t]=="?"||r[t]==" "){let i=r.substr(e,t-e);if(t>5&&i==="xml")return m("InvalidXml","XML declaration allowed only at the start of the document.",b(r,t));if(r[t]=="?"&&r[t+1]==">"){t++;break}continue}return t}function E(r,t){if(r.length>t+5&&r[t+1]==="-"&&r[t+2]==="-"){for(t+=3;t<r.length;t++)if(r[t]==="-"&&r[t+1]==="-"&&r[t+2]===">"){t+=2;break}}else if(r.length>t+8&&r[t+1]==="D"&&r[t+2]==="O"&&r[t+3]==="C"&&r[t+4]==="T"&&r[t+5]==="Y"&&r[t+6]==="P"&&r[t+7]==="E"){let e=1;for(t+=8;t<r.length;t++)if(r[t]==="<")e++;else if(r[t]===">"&&(e--,e===0))break}else if(r.length>t+9&&r[t+1]==="["&&r[t+2]==="C"&&r[t+3]==="D"&&r[t+4]==="A"&&r[t+5]==="T"&&r[t+6]==="A"&&r[t+7]==="["){for(t+=8;t<r.length;t++)if(r[t]==="]"&&r[t+1]==="]"&&r[t+2]===">"){t+=2;break}}return t}let F='"',q="'";function W(r,t){let e="",i="",n=!1;for(;t<r.length;t++){if(r[t]===F||r[t]===q)i===""?i=r[t]:i!==r[t]||(i="");else if(r[t]===">"&&i===""){n=!0;break}e+=r[t]}return i===""&&{value:e,index:t,tagClosed:n}}let U=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Y(r,t){let e=N(r,U),i={};for(let n=0;n<e.length;n++){if(e[n][1].length===0)return m("InvalidAttr","Attribute '"+e[n][2]+"' has no space in starting.",A(e[n]));if(e[n][3]!==void 0&&e[n][4]===void 0)return m("InvalidAttr","Attribute '"+e[n][2]+"' is without value.",A(e[n]));if(e[n][3]===void 0&&!t.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+e[n][2]+"' is not allowed.",A(e[n]));let o=e[n][2];if(!a(o))return m("InvalidAttr","Attribute '"+o+"' is an invalid name.",A(e[n]));if(Object.prototype.hasOwnProperty.call(i,o))return m("InvalidAttr","Attribute '"+o+"' is repeated.",A(e[n]));i[o]=1}return!0}function f(r,t){if(r[++t]===";")return-1;if(r[t]==="#")return(function(i,n){let o=/\d/;for(i[n]==="x"&&(n++,o=/[\da-fA-F]/);n<i.length;n++){if(i[n]===";")return n;if(!i[n].match(o))break}return-1})(r,++t);let e=0;for(;t<r.length;t++,e++)if(!(r[t].match(/\w/)&&e<20)){if(r[t]===";")break;return-1}return t}function m(r,t,e){return{err:{code:r,msg:t,line:e.line||e,col:e.col}}}function a(r){return I(r)}function x(r){return I(r)}function b(r,t){let e=r.substring(0,t).split(/\r?\n/);return{line:e.length,col:e[e.length-1].length+1}}function A(r){return r.startIndex+r[1].length}let G=r=>C.includes(r)?"__"+r:r,Z={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,t){return t},attributeValueProcessor:function(r,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,t,e){return r},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:G};function J(r,t){if(typeof r!="string")return;let e=r.toLowerCase();if(C.some(i=>e===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`);if($.some(i=>e===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${t}: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`)}function S(r,t){return typeof r=="boolean"?{enabled:r,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof r=="object"&&r!==null?{enabled:r.enabled!==!1,maxEntitySize:Math.max(1,r.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,r.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,r.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,r.maxExpandedLength??1e5),maxEntityCount:Math.max(1,r.maxEntityCount??1e3),allowedTags:r.allowedTags??null,tagFilter:r.tagFilter??null,appliesTo:r.appliesTo??"all"}:S(!0)}let B=function(r){let t=Object.assign({},Z,r),e=[{value:t.attributeNamePrefix,name:"attributeNamePrefix"},{value:t.attributesGroupName,name:"attributesGroupName"},{value:t.textNodeName,name:"textNodeName"},{value:t.cdataPropName,name:"cdataPropName"},{value:t.commentPropName,name:"commentPropName"}];for(let{value:i,name:n}of e)i&&J(i,n);return t.onDangerousProperty===null&&(t.onDangerousProperty=G),t.processEntities=S(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(i=>typeof i=="string"&&i.startsWith("*.")?".."+i.substring(2):i)),t},X;X=typeof Symbol!="function"?"@@xmlMetadata":Symbol("XML Node Metadata");class H{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),e!==void 0&&(this.child[this.child.length-1][X]={startIndex:e})}static getMetaDataSymbol(){return X}}class z{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){let i=Object.create(null),n=0;if(t[e+3]!=="O"||t[e+4]!=="C"||t[e+5]!=="T"||t[e+6]!=="Y"||t[e+7]!=="P"||t[e+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let o=1,u=!1,s=!1,d="";for(;e<t.length;e++)if(t[e]!=="<"||s)if(t[e]===">"){if(s?t[e-1]==="-"&&t[e-2]==="-"&&(s=!1,o--):o--,o===0)break}else t[e]==="["?u=!0:d+=t[e];else{if(u&&nt(t,"!ENTITY",e)){let p,g;if(e+=7,[p,g,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),g.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&n>=this.options.maxEntityCount)throw new Error(`Entity count (${n+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);i[p]=g,n++}}else if(u&&nt(t,"!ELEMENT",e)){e+=8;let{index:p}=this.readElementExp(t,e+1);e=p}else if(u&&nt(t,"!ATTLIST",e))e+=8;else if(u&&nt(t,"!NOTATION",e)){e+=9;let{index:p}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=p}else{if(!nt(t,"!--",e))throw new Error("Invalid DOCTYPE");s=!0}o++,d=""}if(o!==0)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}}readEntityExp(t,e){let i=e=K(t,e);for(;e<t.length&&!/\s/.test(t[e])&&t[e]!=='"'&&t[e]!=="'";)e++;let n=t.substring(i,e);if(lt(n),e=K(t,e),!this.suppressValidationErr){if(t.substring(e,e+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[e]==="%")throw new Error("Parameter entities are not supported")}let o="";if([e,o]=this.readIdentifierVal(t,e,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&o.length>this.options.maxEntitySize)throw new Error(`Entity "${n}" size (${o.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,o,--e]}readNotationExp(t,e){let i=e=K(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.substring(i,e);!this.suppressValidationErr&&lt(n),e=K(t,e);let o=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);e+=o.length,e=K(t,e);let u=null,s=null;if(o==="PUBLIC")[e,u]=this.readIdentifierVal(t,e,"publicIdentifier"),t[e=K(t,e)]!=='"'&&t[e]!=="'"||([e,s]=this.readIdentifierVal(t,e,"systemIdentifier"));else if(o==="SYSTEM"&&([e,s]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!s))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:u,systemIdentifier:s,index:--e}}readIdentifierVal(t,e,i){let n="",o=t[e];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);let u=++e;for(;e<t.length&&t[e]!==o;)e++;if(n=t.substring(u,e),t[e]!==o)throw new Error(`Unterminated ${i} value`);return[++e,n]}readElementExp(t,e){let i=e=K(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.substring(i,e);if(!this.suppressValidationErr&&!I(n))throw new Error(`Invalid element name: "${n}"`);let o="";if(t[e=K(t,e)]==="E"&&nt(t,"MPTY",e))e+=4;else if(t[e]==="A"&&nt(t,"NY",e))e+=2;else if(t[e]==="("){let u=++e;for(;e<t.length&&t[e]!==")";)e++;if(o=t.substring(u,e),t[e]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:n,contentModel:o.trim(),index:e}}readAttlistExp(t,e){let i=e=K(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let n=t.substring(i,e);for(lt(n),i=e=K(t,e);e<t.length&&!/\s/.test(t[e]);)e++;let o=t.substring(i,e);if(!lt(o))throw new Error(`Invalid attribute name: "${o}"`);e=K(t,e);let u="";if(t.substring(e,e+8).toUpperCase()==="NOTATION"){if(u="NOTATION",t[e=K(t,e+=8)]!=="(")throw new Error(`Expected '(', found "${t[e]}"`);e++;let d=[];for(;e<t.length&&t[e]!==")";){let p=e;for(;e<t.length&&t[e]!=="|"&&t[e]!==")";)e++;let g=t.substring(p,e);if(g=g.trim(),!lt(g))throw new Error(`Invalid notation name: "${g}"`);d.push(g),t[e]==="|"&&(e++,e=K(t,e))}if(t[e]!==")")throw new Error("Unterminated list of notations");e++,u+=" ("+d.join("|")+")"}else{let d=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;u+=t.substring(d,e);let p=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!p.includes(u.toUpperCase()))throw new Error(`Invalid attribute type: "${u}"`)}e=K(t,e);let s="";return t.substring(e,e+8).toUpperCase()==="#REQUIRED"?(s="#REQUIRED",e+=8):t.substring(e,e+7).toUpperCase()==="#IMPLIED"?(s="#IMPLIED",e+=7):[e,s]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:n,attributeName:o,attributeType:u,defaultValue:s,index:e}}}let K=(r,t)=>{for(;t<r.length&&/\s/.test(r[t]);)t++;return t};function nt(r,t,e){for(let i=0;i<t.length;i++)if(t[i]!==r[e+i+1])return!1;return!0}function lt(r){if(I(r))return r;throw new Error(`Invalid entity name ${r}`)}let ht=/^[-+]?0x[a-fA-F0-9]+$/,ct=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Gt={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"},Wt=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class Xt{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){let t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){let t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){let e=this._matcher.path;if(e.length!==0)return e[e.length-1].values?.[t]}hasAttr(t){let e=this._matcher.path;if(e.length===0)return!1;let i=e[e.length-1];return i.values!==void 0&&t in i.values}getPosition(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].position??0}getCounter(){let t=this._matcher.path;return t.length===0?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class vt{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Xt(this)}push(t,e=null,i=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let n=this.path.length;this.siblingStacks[n]||(this.siblingStacks[n]=new Map);let o=this.siblingStacks[n],u=i?`${i}:${t}`:t,s=o.get(u)||0,d=0;for(let g of o.values())d+=g;o.set(u,s+1);let p={tag:t,position:d,counter:s};i!=null&&(p.namespace=i),e!=null&&(p.values=e),this.path.push(p)}pop(){if(this.path.length===0)return;this._pathStringCache=null;let t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){let e=this.path[this.path.length-1];t!=null&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(this.path.length!==0)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(this.path.length===0)return!1;let e=this.path[this.path.length-1];return e.values!==void 0&&t in e.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){let i=t||this.separator;if(i===this.separator&&e===!0){if(this._pathStringCache!==null)return this._pathStringCache;let n=this.path.map(o=>o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(i);return this._pathStringCache=n,n}return this.path.map(n=>e&&n.namespace?`${n.namespace}:${n.tag}`:n.tag).join(i)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){let e=t.segments;return e.length!==0&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,i=t.length-1;for(;i>=0&&e>=0;){let n=t[i];if(n.type==="deep-wildcard"){if(i--,i<0)return!0;let o=t[i],u=!1;for(let s=e;s>=0;s--)if(this._matchSegment(o,this.path[s],s===this.path.length-1)){e=s-1,i--,u=!0;break}if(!u)return!1}else{if(!this._matchSegment(n,this.path[e],e===this.path.length-1))return!1;e--,i--}}return i<0}_matchSegment(t,e,i){if(t.tag!=="*"&&t.tag!==e.tag||t.namespace!==void 0&&t.namespace!=="*"&&t.namespace!==e.namespace||t.attrName!==void 0&&(!i||!e.values||!(t.attrName in e.values)||t.attrValue!==void 0&&String(e.values[t.attrName])!==String(t.attrValue)))return!1;if(t.position!==void 0){if(!i)return!1;let n=e.counter??0;if(t.position==="first"&&n!==0||t.position==="odd"&&n%2!=1||t.position==="even"&&n%2!=0||t.position==="nth"&&n!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(e=>({...e})),this.siblingStacks=t.siblingStacks.map(e=>new Map(e))}readOnly(){return this._view}}class mt{constructor(t,e={},i){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=i,this._hasDeepWildcard=this.segments.some(n=>n.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(n=>n.attrName!==void 0),this._hasPositionSelector=this.segments.some(n=>n.position!==void 0)}_parse(t){let e=[],i=0,n="";for(;i<t.length;)t[i]===this.separator?i+1<t.length&&t[i+1]===this.separator?(n.trim()&&(e.push(this._parseSegment(n.trim())),n=""),e.push({type:"deep-wildcard"}),i+=2):(n.trim()&&e.push(this._parseSegment(n.trim())),n="",i++):(n+=t[i],i++);return n.trim()&&e.push(this._parseSegment(n.trim())),e}_parseSegment(t){let e={type:"tag"},i=null,n=t,o=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(o&&(n=o[1]+o[3],o[2])){let g=o[2].slice(1,-1);g&&(i=g)}let u,s,d=n;if(n.includes("::")){let g=n.indexOf("::");if(u=n.substring(0,g).trim(),d=n.substring(g+2).trim(),!u)throw new Error(`Invalid namespace in pattern: ${t}`)}let p=null;if(d.includes(":")){let g=d.lastIndexOf(":"),O=d.substring(0,g).trim(),j=d.substring(g+1).trim();["first","last","odd","even"].includes(j)||/^nth\(\d+\)$/.test(j)?(s=O,p=j):s=d}else s=d;if(!s)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=s,u&&(e.namespace=u),i)if(i.includes("=")){let g=i.indexOf("=");e.attrName=i.substring(0,g).trim(),e.attrValue=i.substring(g+1).trim()}else e.attrName=i.trim();if(p){let g=p.match(/^nth\((\d+)\)$/);g?(e.position="nth",e.positionValue=parseInt(g[1],10)):e.position=p}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class qt{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;let e=t.length,i=t.segments[t.segments.length-1],n=i?.tag;if(n&&n!=="*"){let o=`${e}:${n}`;this._byDepthAndTag.has(o)||this._byDepthAndTag.set(o,[]),this._byDepthAndTag.get(o).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(let e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return this.findMatch(t)!==null}findMatch(t){let e=t.getDepth(),i=`${e}:${t.getCurrentTag()}`,n=this._byDepthAndTag.get(i);if(n){for(let u=0;u<n.length;u++)if(t.matches(n[u]))return n[u]}let o=this._wildcardByDepth.get(e);if(o){for(let u=0;u<o.length;u++)if(t.matches(o[u]))return o[u]}for(let u=0;u<this._deepWildcards.length;u++)if(t.matches(this._deepWildcards[u]))return this._deepWildcards[u];return null}}let Yt={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",euro:"\u20AC",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"},Ct={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Kt={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"},zt=new Set("!?\\\\/[]$%{}^&*()<>|+");function jt(r){if(r[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${r}"`);for(let t of r)if(zt.has(t))throw new Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${r}"`);return r}function xt(...r){let t=Object.create(null);for(let e of r)if(e)for(let i of Object.keys(e)){let n=e[i];if(typeof n=="string")t[i]=n;else if(n&&typeof n=="object"&&n.val!==void 0){let o=n.val;typeof o=="string"&&(t[i]=o)}}return t}let dt="external",bt="base",Nt="all",at=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Jt=new Set([9,10,13]);class Zt{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof t.postCheck=="function"?t.postCheck:n=>n,this._limitTiers=(e=this._limit.applyLimitsTo??dt)&&e!==dt?e===Nt?new Set([Nt]):e===bt?new Set([bt]):Array.isArray(e)?new Set(e):new Set([dt]):new Set([dt]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=xt(Ct,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);let i=(function(n){if(!n)return{xmlVersion:1,onLevel:at.allow,nullLevel:at.remove};let o=n.xmlVersion===1.1?1.1:1,u=at[n.onNCR]??at.allow,s=at[n.nullNCR]??at.remove;return{xmlVersion:o,onLevel:u,nullLevel:Math.max(s,at.remove)}})(t.ncr);this._ncrXmlVersion=i.xmlVersion,this._ncrOnLevel=i.onLevel,this._ncrNullLevel=i.nullLevel}setExternalEntities(t){if(t)for(let e of Object.keys(t))jt(e);this._externalMap=xt(t)}addExternalEntity(t,e){jt(t),typeof e=="string"&&e.indexOf("&")===-1&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=xt(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=t===1.1?1.1:1}decode(t){if(typeof t!="string"||t.length===0)return t;let e=t,i=[],n=t.length,o=0,u=0,s=this._maxTotalExpansions>0,d=this._maxExpandedLength>0,p=s||d;for(;u<n;){if(t.charCodeAt(u)!==38){u++;continue}let O=u+1;for(;O<n&&t.charCodeAt(O)!==59&&O-u<=32;)O++;if(O>=n||t.charCodeAt(O)!==59){u++;continue}let j=t.slice(u+1,O);if(j.length===0){u++;continue}let L,k;if(this._removeSet.has(j))L="",k===void 0&&(k=dt);else{if(this._leaveSet.has(j)){u++;continue}if(j.charCodeAt(0)===35){let V=this._resolveNCR(j);if(V===void 0){u++;continue}L=V,k=bt}else{let V=this._resolveName(j);L=V?.value,k=V?.tier}}if(L!==void 0){if(u>o&&i.push(t.slice(o,u)),i.push(L),o=O+1,u=o,p&&this._tierCounts(k)){if(s&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(d){let V=L.length-(j.length+2);if(V>0&&(this._expandedLength+=V,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else u++}o<n&&i.push(t.slice(o));let g=i.length===0?t:i.join("");return this._postCheck(g,e)}_tierCounts(t){return!!this._limitTiers.has(Nt)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:dt}:t in this._externalMap?{value:this._externalMap[t],tier:dt}:t in this._baseMap?{value:this._baseMap[t],tier:bt}:void 0}_classifyNCR(t){return t===0?this._ncrNullLevel:t>=55296&&t<=57343||this._ncrXmlVersion===1&&t>=1&&t<=31&&!Jt.has(t)?at.remove:-1}_applyNCRAction(t,e,i){switch(t){case at.allow:return String.fromCodePoint(i);case at.remove:return"";case at.leave:return;case at.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${i.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(i)}}_resolveNCR(t){let e=t.charCodeAt(1),i;if(i=e===120||e===88?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(i)||i<0||i>1114111)return;let n=this._classifyNCR(i);if(!this._numericAllowed&&n<at.remove)return;let o=n===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,n);return this._applyNCRAction(o,t,i)}}function Ht(r,t){if(!r)return{};let e=t.attributesGroupName?r[t.attributesGroupName]:r;if(!e)return{};let i={};for(let n in e)n.startsWith(t.attributeNamePrefix)?i[n.substring(t.attributeNamePrefix.length)]=e[n]:i[n]=e[n];return i}function Qt(r){if(!r||typeof r!="string")return;let t=r.indexOf(":");if(t!==-1&&t>0){let e=r.substring(0,t);if(e!=="xmlns")return e}}class te{constructor(t){var e;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=oe,this.parseTextData=ee,this.resolveNameSpace=re,this.buildAttributesMap=ie,this.isItStopNode=ue,this.replaceEntitiesValue=ae,this.readStopNodeData=ce,this.saveTextToParentTag=le,this.addChild=se,this.ignoreAttributesFn=typeof(e=this.options.ignoreAttributes)=="function"?e:Array.isArray(e)?o=>{for(let u of e)if(typeof u=="string"&&o===u||u instanceof RegExp&&u.test(o))return!0}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0;let i={...Ct};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?i=this.options.htmlEntities:this.options.htmlEntities===!0&&(i={...Kt,...Yt}),this.entityDecoder=new Zt({namedEntities:i,numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new vt,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new qt;let n=this.options.stopNodes;if(n&&n.length>0){for(let o=0;o<n.length;o++){let u=n[o];typeof u=="string"?this.stopNodeExpressionsSet.add(new mt(u)):u instanceof mt&&this.stopNodeExpressionsSet.add(u)}this.stopNodeExpressionsSet.seal()}}}function ee(r,t,e,i,n,o,u){let s=this.options;if(r!==void 0&&(s.trimValues&&!i&&(r=r.trim()),r.length>0)){u||(r=this.replaceEntitiesValue(r,t,e));let d=s.jPath?e.toString():e,p=s.tagValueProcessor(t,r,d,n,o);return p==null?r:typeof p!=typeof r||p!==r?p:s.trimValues||r.trim()===r?Mt(r,s.parseTagValue,s.numberParseOptions):r}}function re(r){if(this.options.removeNSPrefix){let t=r.split(":"),e=r.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(r=e+t[1])}return r}let ne=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function ie(r,t,e,i=!1){let n=this.options;if(i===!0||n.ignoreAttributes!==!0&&typeof r=="string"){let o=N(r,ne),u=o.length,s={},d=new Array(u),p=!1,g={};for(let L=0;L<u;L++){let k=this.resolveNameSpace(o[L][1]),V=o[L][4];if(k.length&&V!==void 0){let rt=V;n.trimValues&&(rt=rt.trim()),rt=this.replaceEntitiesValue(rt,e,this.readonlyMatcher),d[L]=rt,g[k]=rt,p=!0}}p&&typeof t=="object"&&t.updateCurrent&&t.updateCurrent(g);let O=n.jPath?t.toString():this.readonlyMatcher,j=!1;for(let L=0;L<u;L++){let k=this.resolveNameSpace(o[L][1]);if(this.ignoreAttributesFn(k,O))continue;let V=n.attributeNamePrefix+k;if(k.length)if(n.transformAttributeName&&(V=n.transformAttributeName(V)),V=It(V,n),o[L][4]!==void 0){let rt=d[L],it=n.attributeValueProcessor(k,rt,O);s[V]=it==null?rt:typeof it!=typeof rt||it!==rt?it:Mt(rt,n.parseAttributeValue,n.numberParseOptions),j=!0}else n.allowBooleanAttributes&&(s[V]=!0,j=!0)}if(!j)return;if(n.attributesGroupName){let L={};return L[n.attributesGroupName]=s,L}return s}}let oe=function(r){r=r.replace(/\r\n?/g,`
10
- `);let t=new H("!xml"),e=t,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let n=this.options,o=new z(n.processEntities),u=r.length;for(let s=0;s<u;s++)if(r[s]==="<"){let d=r.charCodeAt(s+1);if(d===47){let p=gt(r,">",s,"Closing Tag is not closed."),g=r.substring(s+2,p).trim();if(n.removeNSPrefix){let j=g.indexOf(":");j!==-1&&(g=g.substr(j+1))}g=Ot(n.transformTagName,g,"",n).tagName,e&&(i=this.saveTextToParentTag(i,e,this.readonlyMatcher));let O=this.matcher.getCurrentTag();if(g&&n.unpairedTagsSet.has(g))throw new Error(`Unpaired tag can not be used as closing tag: </${g}>`);O&&n.unpairedTagsSet.has(O)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,e=this.tagsNodeStack.pop(),i="",s=p}else if(d===63){let p=wt(r,s,!1,"?>");if(!p)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,e,this.readonlyMatcher);let g=this.buildAttributesMap(p.tagExp,this.matcher,p.tagName,!0);if(g){let O=g[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(O)||1)}if(!(n.ignoreDeclaration&&p.tagName==="?xml"||n.ignorePiTags)){let O=new H(p.tagName);O.add(n.textNodeName,""),p.tagName!==p.tagExp&&p.attrExpPresent&&n.ignoreAttributes!==!0&&(O[":@"]=g),this.addChild(e,O,this.readonlyMatcher,s)}s=p.closeIndex+1}else if(d===33&&r.charCodeAt(s+2)===45&&r.charCodeAt(s+3)===45){let p=gt(r,"-->",s+4,"Comment is not closed.");if(n.commentPropName){let g=r.substring(s+4,p-2);i=this.saveTextToParentTag(i,e,this.readonlyMatcher),e.add(n.commentPropName,[{[n.textNodeName]:g}])}s=p}else if(d===33&&r.charCodeAt(s+2)===68){let p=o.readDocType(r,s);this.entityDecoder.addInputEntities(p.entities),s=p.i}else if(d===33&&r.charCodeAt(s+2)===91){let p=gt(r,"]]>",s,"CDATA is not closed.")-2,g=r.substring(s+9,p);i=this.saveTextToParentTag(i,e,this.readonlyMatcher);let O=this.parseTextData(g,e.tagname,this.readonlyMatcher,!0,!1,!0,!0);O==null&&(O=""),n.cdataPropName?e.add(n.cdataPropName,[{[n.textNodeName]:g}]):e.add(n.textNodeName,O),s=p+2}else{let p=wt(r,s,n.removeNSPrefix);if(!p){let st=r.substring(Math.max(0,s-50),Math.min(u,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${st}"`)}let g=p.tagName,O=p.rawTagName,j=p.tagExp,L=p.attrExpPresent,k=p.closeIndex;if({tagName:g,tagExp:j}=Ot(n.transformTagName,g,j,n),n.strictReservedNames&&(g===n.commentPropName||g===n.cdataPropName||g===n.textNodeName||g===n.attributesGroupName))throw new Error(`Invalid tag name: ${g}`);e&&i&&e.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,e,this.readonlyMatcher,!1));let V=e;V&&n.unpairedTagsSet.has(V.tagname)&&(e=this.tagsNodeStack.pop(),this.matcher.pop());let rt=!1;j.length>0&&j.lastIndexOf("/")===j.length-1&&(rt=!0,g[g.length-1]==="/"?(g=g.substr(0,g.length-1),j=g):j=j.substr(0,j.length-1),L=g!==j);let it,ot=null,ft={};it=Qt(O),g!==t.tagname&&this.matcher.push(g,{},it),g!==j&&L&&(ot=this.buildAttributesMap(j,this.matcher,g),ot&&(ft=Ht(ot,n))),g!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let pt=s;if(this.isCurrentNodeStopNode){let st="";if(rt)s=p.closeIndex;else if(n.unpairedTagsSet.has(g))s=p.closeIndex;else{let _t=this.readStopNodeData(r,O,k+1);if(!_t)throw new Error(`Unexpected end of ${O}`);s=_t.i,st=_t.tagContent}let Pt=new H(g);ot&&(Pt[":@"]=ot),Pt.add(n.textNodeName,st),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(e,Pt,this.readonlyMatcher,pt)}else{if(rt){({tagName:g,tagExp:j}=Ot(n.transformTagName,g,j,n));let st=new H(g);ot&&(st[":@"]=ot),this.addChild(e,st,this.readonlyMatcher,pt),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(n.unpairedTagsSet.has(g)){let st=new H(g);ot&&(st[":@"]=ot),this.addChild(e,st,this.readonlyMatcher,pt),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=p.closeIndex;continue}{let st=new H(g);if(this.tagsNodeStack.length>n.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(e),ot&&(st[":@"]=ot),this.addChild(e,st,this.readonlyMatcher,pt),e=st}}i="",s=k}}}else i+=r[s];return t.child};function se(r,t,e,i){this.options.captureMetaData||(i=void 0);let n=this.options.jPath?e.toString():e,o=this.options.updateTag(t.tagname,n,t[":@"]);o===!1||(typeof o=="string"&&(t.tagname=o),r.addChild(t,i))}function ae(r,t,e){let i=this.options.processEntities;if(!i||!i.enabled)return r;if(i.allowedTags){let n=this.options.jPath?e.toString():e;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(t):i.allowedTags(t,n)))return r}if(i.tagFilter){let n=this.options.jPath?e.toString():e;if(!i.tagFilter(t,n))return r}return this.entityDecoder.decode(r)}function le(r,t,e,i){return r&&(i===void 0&&(i=t.child.length===0),(r=this.parseTextData(r,t.tagname,e,!1,!!t[":@"]&&Object.keys(t[":@"]).length!==0,i))!==void 0&&r!==""&&t.add(this.options.textNodeName,r),r=""),r}function ue(){return this.stopNodeExpressionsSet.size!==0&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function gt(r,t,e,i){let n=r.indexOf(t,e);if(n===-1)throw new Error(i);return n+t.length-1}function pe(r,t,e,i){let n=r.indexOf(t,e);if(n===-1)throw new Error(i);return n}function wt(r,t,e,i=">"){let n=(function(O,j,L=">"){let k=0,V=[],rt=O.length,it=L.charCodeAt(0),ot=L.length>1?L.charCodeAt(1):-1;for(let ft=j;ft<rt;ft++){let pt=O.charCodeAt(ft);if(k)pt===k&&(k=0);else if(pt===34||pt===39)k=pt;else if(pt===it){if(ot===-1)return{data:String.fromCharCode(...V),index:ft};if(O.charCodeAt(ft+1)===ot)return{data:String.fromCharCode(...V),index:ft}}else if(pt===9){V.push(32);continue}V.push(pt)}})(r,t+1,i);if(!n)return;let o=n.data,u=n.index,s=o.search(/\s/),d=o,p=!0;s!==-1&&(d=o.substring(0,s),o=o.substring(s+1).trimStart());let g=d;if(e){let O=d.indexOf(":");O!==-1&&(d=d.substr(O+1),p=d!==n.data.substr(O+1))}return{tagName:d,tagExp:o,closeIndex:u,attrExpPresent:p,rawTagName:g}}function ce(r,t,e){let i=e,n=1,o=r.length;for(;e<o;e++)if(r[e]==="<"){let u=r.charCodeAt(e+1);if(u===47){let s=pe(r,">",e,`${t} is not closed`);if(r.substring(e+2,s).trim()===t&&(n--,n===0))return{tagContent:r.substring(i,e),i:s};e=s}else if(u===63)e=gt(r,"?>",e+1,"StopNode is not closed.");else if(u===33&&r.charCodeAt(e+2)===45&&r.charCodeAt(e+3)===45)e=gt(r,"-->",e+3,"StopNode is not closed.");else if(u===33&&r.charCodeAt(e+2)===91)e=gt(r,"]]>",e,"StopNode is not closed.")-2;else{let s=wt(r,e,">");s&&((s&&s.tagName)===t&&s.tagExp[s.tagExp.length-1]!=="/"&&n++,e=s.closeIndex)}}}function Mt(r,t,e){if(t&&typeof r=="string"){let i=r.trim();return i==="true"||i!=="false"&&(function(n,o={}){if(o=Object.assign({},Gt,o),!n||typeof n!="string")return n;let u=n.trim();if(u.length===0||o.skipLike!==void 0&&o.skipLike.test(u))return n;if(u==="0")return 0;if(o.hex&&ht.test(u))return(function(d){if(parseInt)return parseInt(d,16);if(Number.parseInt)return Number.parseInt(d,16);if(window&&window.parseInt)return window.parseInt(d,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")})(u);if(isFinite(u)){if(u.includes("e")||u.includes("E"))return(function(d,p,g){if(!g.eNotation)return d;let O=p.match(Wt);if(O){let j=O[1]||"",L=O[3].indexOf("e")===-1?"E":"e",k=O[2],V=j?d[k.length+1]===L:d[k.length]===L;return k.length>1&&V?d:(k.length!==1||!O[3].startsWith(`.${L}`)&&O[3][0]!==L)&&k.length>0?g.leadingZeros&&!V?(p=(O[1]||"")+O[3],Number(p)):d:Number(p)}return d})(n,u,o);{let d=ct.exec(u);if(d){let p=d[1]||"",g=d[2],O=((s=d[3])&&s.indexOf(".")!==-1&&((s=s.replace(/0+$/,""))==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substring(0,s.length-1))),s),j=p?n[g.length+1]===".":n[g.length]===".";if(!o.leadingZeros&&(g.length>1||g.length===1&&!j))return n;{let L=Number(u),k=String(L);if(L===0)return L;if(k.search(/[eE]/)!==-1)return o.eNotation?L:n;if(u.indexOf(".")!==-1)return k==="0"||k===O||k===`${p}${O}`?L:n;let V=g?O:u;return g?V===k||p+V===k?L:n:V===k||V===p+k?L:n}}return n}}var s;return(function(d,p,g){let O=p===1/0;switch(g.infinity.toLowerCase()){case"null":return null;case"infinity":return p;case"string":return O?"Infinity":"-Infinity";default:return d}})(n,Number(u),o)})(r,e)}return r!==void 0?r:""}function Ot(r,t,e,i){if(r){let n=r(t);e===t&&(e=n),t=n}return{tagName:t=It(t,i),tagExp:e}}function It(r,t){if($.includes(r))throw new Error(`[SECURITY] Invalid name: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`);return C.includes(r)?t.onDangerousProperty(r):r}let Et=H.getMetaDataSymbol();function fe(r,t){if(!r||typeof r!="object")return{};if(!t)return r;let e={};for(let i in r)i.startsWith(t)?e[i.substring(t.length)]=r[i]:e[i]=r[i];return e}function he(r,t,e,i){return Dt(r,t,e,i)}function Dt(r,t,e,i){let n,o={};for(let u=0;u<r.length;u++){let s=r[u],d=de(s);if(d!==void 0&&d!==t.textNodeName){let p=fe(s[":@"]||{},t.attributeNamePrefix);e.push(d,p)}if(d===t.textNodeName)n===void 0?n=s[d]:n+=""+s[d];else{if(d===void 0)continue;if(s[d]){let p=Dt(s[d],t,e,i),g=ge(p,t);if(s[":@"]?me(p,s[":@"],i,t):Object.keys(p).length!==1||p[t.textNodeName]===void 0||t.alwaysCreateTextNode?Object.keys(p).length===0&&(t.alwaysCreateTextNode?p[t.textNodeName]="":p=""):p=p[t.textNodeName],s[Et]!==void 0&&typeof p=="object"&&p!==null&&(p[Et]=s[Et]),o[d]!==void 0&&Object.prototype.hasOwnProperty.call(o,d))Array.isArray(o[d])||(o[d]=[o[d]]),o[d].push(p);else{let O=t.jPath?i.toString():i;t.isArray(d,O,g)?o[d]=[p]:o[d]=p}d!==void 0&&d!==t.textNodeName&&e.pop()}}}return typeof n=="string"?n.length>0&&(o[t.textNodeName]=n):n!==void 0&&(o[t.textNodeName]=n),o}function de(r){let t=Object.keys(r);for(let e=0;e<t.length;e++){let i=t[e];if(i!==":@")return i}}function me(r,t,e,i){if(t){let n=Object.keys(t),o=n.length;for(let u=0;u<o;u++){let s=n[u],d=s.startsWith(i.attributeNamePrefix)?s.substring(i.attributeNamePrefix.length):s,p=i.jPath?e.toString()+"."+d:e;i.isArray(s,p,!0,!0)?r[s]=[t[s]]:r[s]=t[s]}}}function ge(r,t){let{textNodeName:e}=t,i=Object.keys(r).length;return i===0||!(i!==1||!r[e]&&typeof r[e]!="boolean"&&r[e]!==0)}class ye{constructor(t){this.externalEntities={},this.options=B(t)}parse(t,e){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(e){e===!0&&(e={});let o=c(t,e);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let i=new te(this.options);i.entityDecoder.setExternalEntities(this.externalEntities);let n=i.parseXml(t);return this.options.preserveOrder||n===void 0?n:he(n,this.options,i.matcher,i.readonlyMatcher)}addEntity(t,e){if(e.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(e==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return H.getMetaDataSymbol()}}function be(r,t){let e="";t.format&&t.indentBy.length>0&&(e=`
11
- `);let i=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let n=0;n<t.stopNodes.length;n++){let o=t.stopNodes[n];typeof o=="string"?i.push(new mt(o)):o instanceof mt&&i.push(o)}return $t(r,t,e,new vt,i)}function $t(r,t,e,i,n){let o="",u=!1;if(t.maxNestedTags&&i.getDepth()>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(r)){if(r!=null){let s=r.toString();return s=St(s,t),s}return""}for(let s=0;s<r.length;s++){let d=r[s],p=kt(d);if(p===void 0)continue;let g=ve(d[":@"],t);i.push(p,g);let O=Ne(i,n);if(p===t.textNodeName){let V=d[p];O||(V=t.tagValueProcessor(p,V),V=St(V,t)),u&&(o+=e),o+=V,u=!1,i.pop();continue}if(p===t.cdataPropName){u&&(o+=e);let V=d[p][0][t.textNodeName];o+=`<![CDATA[${String(V).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`,u=!1,i.pop();continue}if(p===t.commentPropName){let V=d[p][0][t.textNodeName];o+=e+`<!--${String(V).replace(/--/g,"- -").replace(/-$/,"- ")}-->`,u=!0,i.pop();continue}if(p[0]==="?"){let V=Rt(d[":@"],t,O),rt=p==="?xml"?"":e,it=d[p][0][t.textNodeName];it=it.length!==0?" "+it:"",o+=rt+`<${p}${it}${V}?>`,u=!0,i.pop();continue}let j=e;j!==""&&(j+=t.indentBy);let L=e+`<${p}${Rt(d[":@"],t,O)}`,k;k=O?Lt(d[p],t):$t(d[p],t,j,i,n),t.unpairedTags.indexOf(p)!==-1?t.suppressUnpairedNode?o+=L+">":o+=L+"/>":k&&k.length!==0||!t.suppressEmptyNode?k&&k.endsWith(">")?o+=L+`>${k}${e}</${p}>`:(o+=L+">",k&&e!==""&&(k.includes("/>")||k.includes("</"))?o+=e+t.indentBy+k+e:o+=k,o+=`</${p}>`):o+=L+"/>",u=!0,i.pop()}return o}function ve(r,t){if(!r||t.ignoreAttributes)return null;let e={},i=!1;for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n.startsWith(t.attributeNamePrefix)?n.substr(t.attributeNamePrefix.length):n]=r[n],i=!0);return i?e:null}function Lt(r,t){if(!Array.isArray(r))return r!=null?r.toString():"";let e="";for(let i=0;i<r.length;i++){let n=r[i],o=kt(n);if(o===t.textNodeName)e+=n[o];else if(o===t.cdataPropName)e+=n[o][0][t.textNodeName];else if(o===t.commentPropName)e+=n[o][0][t.textNodeName];else{if(o&&o[0]==="?")continue;if(o){let u=xe(n[":@"],t),s=Lt(n[o],t);s&&s.length!==0?e+=`<${o}${u}>${s}</${o}>`:e+=`<${o}${u}/>`}}}return e}function xe(r,t){let e="";if(r&&!t.ignoreAttributes)for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let n=r[i];n===!0&&t.suppressBooleanAttributes?e+=` ${i.substr(t.attributeNamePrefix.length)}`:e+=` ${i.substr(t.attributeNamePrefix.length)}="${n}"`}return e}function kt(r){let t=Object.keys(r);for(let e=0;e<t.length;e++){let i=t[e];if(Object.prototype.hasOwnProperty.call(r,i)&&i!==":@")return i}}function Rt(r,t,e){let i="";if(r&&!t.ignoreAttributes)for(let n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;let o;e?o=r[n]:(o=t.attributeValueProcessor(n,r[n]),o=St(o,t)),o===!0&&t.suppressBooleanAttributes?i+=` ${n.substr(t.attributeNamePrefix.length)}`:i+=` ${n.substr(t.attributeNamePrefix.length)}="${o}"`}return i}function Ne(r,t){if(!t||t.length===0)return!1;for(let e=0;e<t.length;e++)if(r.matches(t[e]))return!0;return!1}function St(r,t){if(r&&r.length>0&&t.processEntities)for(let e=0;e<t.entities.length;e++){let i=t.entities[e];r=r.replace(i.regex,i.val)}return r}let we={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,t){return t},attributeValueProcessor:function(r,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function ut(r){if(this.options=Object.assign({},we,r),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e=="string"&&e.startsWith("*.")?".."+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e<this.options.stopNodes.length;e++){let i=this.options.stopNodes[e];typeof i=="string"?this.stopNodeExpressions.push(new mt(i)):i instanceof mt&&this.stopNodeExpressions.push(i)}var t;this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=typeof(t=this.options.ignoreAttributes)=="function"?t:Array.isArray(t)?e=>{for(let i of t)if(typeof i=="string"&&e===i||i instanceof RegExp&&i.test(e))return!0}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Se),this.processTextOrObjNode=Oe,this.options.format?(this.indentate=Ee,this.tagEndChar=`>
12
- `,this.newLine=`
13
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Oe(r,t,e,i){let n=this.extractAttributes(r);if(i.push(t,n),this.checkStopNode(i)){let u=this.buildRawContent(r),s=this.buildAttributesForStopNode(r);return i.pop(),this.buildObjectNode(u,t,s,e)}let o=this.j2x(r,e+1,i);return i.pop(),r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],t,o.attrStr,e,i):this.buildObjectNode(o.val,t,o.attrStr,e)}function Ee(r){return this.options.indentBy.repeat(r)}function Se(r){return!(!r.startsWith(this.options.attributeNamePrefix)||r===this.options.textNodeName)&&r.substr(this.attrPrefixLen)}ut.prototype.build=function(r){if(this.options.preserveOrder)return be(r,this.options);{Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r});let t=new vt;return this.j2x(r,0,t).val}},ut.prototype.j2x=function(r,t,e){let i="",n="";if(this.options.maxNestedTags&&e.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");let o=this.options.jPath?e.toString():e,u=this.checkStopNode(e);for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s))if(r[s]===void 0)this.isAttribute(s)&&(n+="");else if(r[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?n+="":s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(r[s]instanceof Date)n+=this.buildTextValNode(r[s],s,"",t,e);else if(typeof r[s]!="object"){let d=this.isAttribute(s);if(d&&!this.ignoreAttributesFn(d,o))i+=this.buildAttrPairStr(d,""+r[s],u);else if(!d)if(s===this.options.textNodeName){let p=this.options.tagValueProcessor(s,""+r[s]);n+=this.replaceEntitiesValue(p)}else{e.push(s);let p=this.checkStopNode(e);if(e.pop(),p){let g=""+r[s];n+=g===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+g+"</"+s+this.tagEndChar}else n+=this.buildTextValNode(r[s],s,"",t,e)}}else if(Array.isArray(r[s])){let d=r[s].length,p="",g="";for(let O=0;O<d;O++){let j=r[s][O];if(j!==void 0)if(j===null)s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(typeof j=="object")if(this.options.oneListGroup){e.push(s);let L=this.j2x(j,t+1,e);e.pop(),p+=L.val,this.options.attributesGroupName&&j.hasOwnProperty(this.options.attributesGroupName)&&(g+=L.attrStr)}else p+=this.processTextOrObjNode(j,s,t,e);else if(this.options.oneListGroup){let L=this.options.tagValueProcessor(s,j);L=this.replaceEntitiesValue(L),p+=L}else{e.push(s);let L=this.checkStopNode(e);if(e.pop(),L){let k=""+j;p+=k===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+k+"</"+s+this.tagEndChar}else p+=this.buildTextValNode(j,s,"",t,e)}}this.options.oneListGroup&&(p=this.buildObjectNode(p,s,g,t)),n+=p}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let d=Object.keys(r[s]),p=d.length;for(let g=0;g<p;g++)i+=this.buildAttrPairStr(d[g],""+r[s][d[g]],u)}else n+=this.processTextOrObjNode(r[s],s,t,e);return{attrStr:i,val:n}},ut.prototype.buildAttrPairStr=function(r,t,e){return e||(t=this.options.attributeValueProcessor(r,""+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t==="true"?" "+r:" "+r+'="'+t+'"'},ut.prototype.extractAttributes=function(r){if(!r||typeof r!="object")return null;let t={},e=!1;if(this.options.attributesGroupName&&r[this.options.attributesGroupName]){let i=r[this.options.attributesGroupName];for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n]=i[n],e=!0)}else for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let n=this.isAttribute(i);n&&(t[n]=r[i],e=!0)}return e?t:null},ut.prototype.buildRawContent=function(r){if(typeof r=="string")return r;if(typeof r!="object"||r===null)return String(r);if(r[this.options.textNodeName]!==void 0)return r[this.options.textNodeName];let t="";for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||this.isAttribute(e)||this.options.attributesGroupName&&e===this.options.attributesGroupName)continue;let i=r[e];if(e===this.options.textNodeName)t+=i;else if(Array.isArray(i)){for(let n of i)if(typeof n=="string"||typeof n=="number")t+=`<${e}>${n}</${e}>`;else if(typeof n=="object"&&n!==null){let o=this.buildRawContent(n),u=this.buildAttributesForStopNode(n);t+=o===""?`<${e}${u}/>`:`<${e}${u}>${o}</${e}>`}}else if(typeof i=="object"&&i!==null){let n=this.buildRawContent(i),o=this.buildAttributesForStopNode(i);t+=n===""?`<${e}${o}/>`:`<${e}${o}>${n}</${e}>`}else t+=`<${e}>${i}</${e}>`}return t},ut.prototype.buildAttributesForStopNode=function(r){if(!r||typeof r!="object")return"";let t="";if(this.options.attributesGroupName&&r[this.options.attributesGroupName]){let e=r[this.options.attributesGroupName];for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let n=i.startsWith(this.options.attributeNamePrefix)?i.substring(this.options.attributeNamePrefix.length):i,o=e[i];o===!0&&this.options.suppressBooleanAttributes?t+=" "+n:t+=" "+n+'="'+o+'"'}}else for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let i=this.isAttribute(e);if(i){let n=r[e];n===!0&&this.options.suppressBooleanAttributes?t+=" "+i:t+=" "+i+'="'+n+'"'}}return t},ut.prototype.buildObjectNode=function(r,t,e,i){if(r==="")return t[0]==="?"?this.indentate(i)+"<"+t+e+"?"+this.tagEndChar:this.indentate(i)+"<"+t+e+this.closeTag(t)+this.tagEndChar;{let n="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",n=""),!e&&e!==""||r.indexOf("<")!==-1?this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(i)+`<!--${r}-->`+this.newLine:this.indentate(i)+"<"+t+e+o+this.tagEndChar+r+this.indentate(i)+n:this.indentate(i)+"<"+t+e+o+">"+r+n}},ut.prototype.closeTag=function(r){let t="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${r}`,t},ut.prototype.checkStopNode=function(r){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(r.matches(this.stopNodeExpressions[t]))return!0;return!1},ut.prototype.buildTextValNode=function(r,t,e,i,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let o=String(r).replace(/\]\]>/g,"]]]]><![CDATA[>");return this.indentate(i)+`<![CDATA[${o}]]>`+this.newLine}if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let o=String(r).replace(/--/g,"- -").replace(/-$/,"- ");return this.indentate(i)+`<!--${o}-->`+this.newLine}if(t[0]==="?")return this.indentate(i)+"<"+t+e+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,r);return o=this.replaceEntitiesValue(o),o===""?this.indentate(i)+"<"+t+e+this.closeTag(t)+this.tagEndChar:this.indentate(i)+"<"+t+e+">"+o+"</"+t+this.tagEndChar}},ut.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let e=this.options.entities[t];r=r.replace(e.regex,e.val)}return r};let Pe=ut,_e={validate:c};R.exports=h})()},{}],2:[function(T,R,w){var M=Object.prototype.hasOwnProperty,h=Object.prototype.toString;R.exports=function(y,N,I){if(h.call(N)!=="[object Function]")throw new TypeError("iterator must be a function");var C=y.length;if(C===+C)for(var $=0;$<C;$++)N.call(I,y[$],$,y);else for(var l in y)M.call(y,l)&&N.call(I,y[l],l,y)}},{}],3:[function(T,R,w){"use strict";var M=T("foreach");R.exports=h;function h(_,y,N){if(arguments.length===3)return h.set(_,y,N);if(arguments.length===2)return h.get(_,y);var I=h.bind(h,_);for(var C in h)h.hasOwnProperty(C)&&(I[C]=h[C].bind(I,_));return I}h.get=function(y,N){for(var I=Array.isArray(N)?N:h.parse(N),C=0;C<I.length;++C){var $=I[C];if(!(typeof y=="object"&&$ in y))throw new Error("Invalid reference token: "+$);y=y[$]}return y},h.set=function(y,N,I){var C=Array.isArray(N)?N:h.parse(N),$=C[0];if(C.length===0)throw Error("Can not set the root object");for(var l=0;l<C.length-1;++l){var c=C[l];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(y)&&(c=y.length),$=C[l+1],c in y||($.match(/^(\d+|-)$/)?y[c]=[]:y[c]={}),y=y[c])}return $==="-"&&Array.isArray(y)&&($=y.length),y[$]=I,this},h.remove=function(_,y){var N=Array.isArray(y)?y:h.parse(y),I=N[N.length-1];if(I===void 0)throw new Error('Invalid JSON pointer for remove: "'+y+'"');var C=h.get(_,N.slice(0,-1));if(Array.isArray(C)){var $=+I;if(I===""&&isNaN($))throw new Error('Invalid array index: "'+I+'"');Array.prototype.splice.call(C,$,1)}else delete C[I]},h.dict=function(y,N){var I={};return h.walk(y,function(C,$){I[$]=C},N),I},h.walk=function(y,N,I){var C=[];I=I||function($){var l=Object.prototype.toString.call($);return l==="[object Object]"||l==="[object Array]"},(function $(l){M(l,function(c,v){C.push(String(v)),I(c)?$(c):N(c,h.compile(C)),C.pop()})})(y)},h.has=function(y,N){try{h.get(y,N)}catch{return!1}return!0},h.escape=function(y){return y.toString().replace(/~/g,"~0").replace(/\//g,"~1")},h.unescape=function(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")},h.parse=function(y){if(y==="")return[];if(y.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+y);return y.substring(1).split(/\//).map(h.unescape)},h.compile=function(y){return y.length===0?"":"/"+y.map(h.escape).join("/")}},{foreach:2}],4:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.allOfSample=$;var M=T("./traverse"),h=T("./utils");function _(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?_(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):_(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=I(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function I(l){var c=C(l,"string");return typeof c=="symbol"?c:c+""}function C(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l,c,v,P,E){let F=(0,M.traverse)(l,v,P),q=[];for(let W of c){let{type:U,readOnly:Y,writeOnly:f,value:m}=(0,M.traverse)(y({type:F.type},W),v,P,y(y({},E),{},{isAllOfChild:!0}));F.type&&U&&U!==F.type&&(console.warn("allOf: schemas with different types can't be merged"),F.type=U),F.type=F.type||U,F.readOnly=F.readOnly||Y,F.writeOnly=F.writeOnly||f,m!=null&&q.push(m)}if(F.type==="object"){F.value=(0,h.mergeDeep)(F.value||{},...q.filter(W=>typeof W=="object"));for(let W in F.value)F.value[W]===h.SKIP_SYMBOL&&delete F.value[W];return F}else{F.type==="array"&&(v.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));let W=q[q.length-1];return F.value=W??F.value,F}}},{"./traverse":14,"./utils":15}],5:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.inferType=h;let M={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function h(_){if(_.type!==void 0)return Array.isArray(_.type)?_.type.length===0?null:_.type[0]:_.type;let y=Object.keys(M);for(var N=0;N<y.length;N++){let I=y[N],C=M[I];if(_[I]!==void 0)return C}return null}},{}],6:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w._registerSampler=l,w._samplers=void 0,Object.defineProperty(w,"inferType",{enumerable:!0,get:function(){return y.inferType}}),w.sample=$;var M=T("./traverse"),h=T("./samplers/index"),_=T("fast-xml-parser"),y=T("./infer"),N=w._samplers={};let I={skipReadOnly:!1,maxSampleDepth:15};function C(c,v){if(!c)throw new Error("Unknown format output for building XML.");if(Array.isArray(c)||Object.keys(c).length>1){var P;c={[(v==null||(P=v.xml)===null||P===void 0?void 0:P.name)||"root"]:c}}return new _.XMLBuilder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(c)}function $(c,v,P){let E=Object.assign({},I,v);(0,M.clearCache)();let F=(0,M.traverse)(c,E,P).value;return E?.format==="xml"?C(F,c):F}function l(c,v){N[c]=v}l("array",h.sampleArray),l("boolean",h.sampleBoolean),l("integer",h.sampleNumber),l("number",h.sampleNumber),l("object",h.sampleObject),l("string",h.sampleString)},{"./infer":5,"./samplers/index":9,"./traverse":14,"fast-xml-parser":1}],7:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleArray=$;var M=T("../traverse"),h=T("../utils");function _(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?_(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):_(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=I(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function I(l){var c=C(l,"string");return typeof c=="symbol"?c:c+""}function C(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,P=arguments.length>3?arguments[3]:void 0,E=P&&P.depth||1,F=Math.min(l.maxItems!=null?l.maxItems:1/0,l.minItems||1),q=l.prefixItems||l.items||l.contains;Array.isArray(q)&&(F=Math.max(F,q.length));let W=f=>Array.isArray(q)?q[f]||{}:q||{},U=[];if(!q)return U;for(let f=0;f<F;f++){let m=W(f),{value:a}=(0,M.traverse)(m,c,v,{depth:E+1});if(c?.format==="xml"){let{value:x,propertyName:b}=(0,h.applyXMLAttributes)({value:a},m,P);if(b){var Y;(Y=U)!==null&&Y!==void 0&&Y[b]||(U=y(y({},U),{},{[b]:[]})),U[b].push(x)}else U=y(y({},U),x)}else U.push(a)}if(c?.format==="xml"&&E===1){let{value:f,propertyName:m}=(0,h.applyXMLAttributes)({value:null},l,P);m&&(f?U=Array.isArray(U)?{[m]:y(y({},f),U.map(a=>({"#text":y({},a)})))}:{[m]:y(y({},U),f)}:U={[m]:U})}return U}},{"../traverse":14,"../utils":15}],8:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleBoolean=M;function M(h){return!0}},{}],9:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),Object.defineProperty(w,"sampleArray",{enumerable:!0,get:function(){return M.sampleArray}}),Object.defineProperty(w,"sampleBoolean",{enumerable:!0,get:function(){return h.sampleBoolean}}),Object.defineProperty(w,"sampleNumber",{enumerable:!0,get:function(){return _.sampleNumber}}),Object.defineProperty(w,"sampleObject",{enumerable:!0,get:function(){return y.sampleObject}}),Object.defineProperty(w,"sampleString",{enumerable:!0,get:function(){return N.sampleString}});var M=T("./array"),h=T("./boolean"),_=T("./number"),y=T("./object"),N=T("./string")},{"./array":7,"./boolean":8,"./number":10,"./object":11,"./string":13}],10:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleNumber=M;function M(h){let _=0;if(h.type==="number"&&(h.format==="float"||h.format==="double")&&(_=.1),typeof h.exclusiveMinimum=="boolean"||typeof h.exclusiveMaximum=="boolean"){if(Number.isFinite(h.maximum)&&Number.isFinite(h.minimum))return _=h.exclusiveMinimum?Math.floor(h.minimum)+1:h.minimum,(h.exclusiveMaximum&&_>=h.maximum||!h.exclusiveMaximum&&_>h.maximum)&&(_=(h.maximum+h.minimum)/2),_;if(Number.isFinite(h.minimum))return h.exclusiveMinimum?Math.floor(h.minimum)+1:h.minimum;if(Number.isFinite(h.maximum))return h.exclusiveMaximum?h.maximum>0?0:Math.floor(h.maximum)-1:h.maximum>0?0:h.maximum}else{if(Number.isFinite(h.minimum))return h.minimum;Number.isFinite(h.exclusiveMinimum)?(_=Math.floor(h.exclusiveMinimum)+1,_===h.exclusiveMaximum&&(_=(_+Math.floor(h.exclusiveMaximum)-1)/2)):Number.isFinite(h.exclusiveMaximum)?_=Math.floor(h.exclusiveMaximum)-1:Number.isFinite(h.maximum)&&(_=h.maximum)}return _}},{}],11:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleObject=$;var M=T("../traverse"),h=T("../utils");function _(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?_(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):_(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=I(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function I(l){var c=C(l,"string");return typeof c=="symbol"?c:c+""}function C(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,P=arguments.length>3?arguments[3]:void 0,E={},F=P&&P.depth||1;if(l&&typeof l.properties=="object"){let q=Array.isArray(l.required)?l.required:[],W={};for(let U of q)W[U]=!0;Object.keys(l.properties).forEach(U=>{if(c.skipNonRequired&&!W.hasOwnProperty(U))return;let Y=(0,M.traverse)(l.properties[U],c,v,{propertyName:U,depth:F+1});if(c.skipReadOnly&&Y.readOnly){P!=null&&P.isAllOfChild&&(E[U]=h.SKIP_SYMBOL);return}if(c.skipWriteOnly&&Y.writeOnly){P!=null&&P.isAllOfChild&&(E[U]=h.SKIP_SYMBOL);return}if(c?.format==="xml"){let{propertyName:f,value:m}=(0,h.applyXMLAttributes)(Y,l.properties[U],{propertyName:U});f?E[f]=m:m!==null&&typeof m=="object"&&(E=y(y({},E),m))}else E[U]=Y.value})}if(l&&typeof l.additionalProperties=="object"){let q=l.additionalProperties["x-additionalPropertiesName"]||"property";E["".concat(String(q),"1")]=(0,M.traverse)(l.additionalProperties,c,v,{depth:F+1}).value,E["".concat(String(q),"2")]=(0,M.traverse)(l.additionalProperties,c,v,{depth:F+1}).value}if(l&&typeof l.properties=="object"&&l.maxProperties!==void 0&&Object.keys(E).length>l.maxProperties){let q={},W=0;(Array.isArray(l.required)?l.required:[]).forEach(Y=>{E[Y]!==void 0&&(q[Y]=E[Y],W++)}),Object.keys(E).forEach(Y=>{W<l.maxProperties&&!q.hasOwnProperty(Y)&&(q[Y]=E[Y],W++)}),E=q}return E}},{"../traverse":14,"../utils":15}],12:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.regexSample=y;function M(){return!0}function h(N,I){return N}function _(N,I,C){let $=1;if(N)switch(N){case"?":{$=M()?0:1;break}case"*":{$=h(0,8);break}case"+":{$=h(1,8);break}default:throw new Error("Unknown quantifier symbol provided.")}else I!=null&&C!=null?$=h(parseInt(I),parseInt(C)):I!=null&&C==null&&($=parseInt(I));return $}function y(N){let I=!1;if(N instanceof RegExp){var C,$;I=N.flags.includes("i"),N=N.toString(),N=(C=($=N.match(/\/(.+?)\//))===null||$===void 0?void 0:$[1])!==null&&C!==void 0?C:""}N=N.replace(/^(\^)?(.*?)(\$)?$/,"$2");let l,c,v,P=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,E=N.match(P);for(;E!=null;){let Y=E[2],f=E[3],m=E[4];v=_(m,Y,f),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(P)}let F=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,q=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(E=N.match(q);E!=null;){let Y=E[1]==="^",f=E[2]==="-",m=E[4],a=E[5],x=E[6],b=[],A=E[3],G=A.match(F);for(f&&b.push(45);G!=null;){if(G[0].indexOf("-")===-1)I&&isNaN(Number(G[0]))?(b.push(G[0].toUpperCase().charCodeAt(0)),b.push(G[0].toLowerCase().charCodeAt(0))):b.push(G[0].charCodeAt(0));else{let J=G[0].split("-").map(S=>S.charCodeAt(0));if(l=J[0],c=J[1],l>c)throw new Error("Character range provided is out of order.");for(let S=l;S<=c;S++)if(I&&isNaN(Number(String.fromCharCode(S)))){let B=String.fromCharCode(S);b.push(B.toUpperCase().charCodeAt(0)),b.push(B.toLowerCase().charCodeAt(0))}else b.push(S)}A=A.substring(G[0].length),G=A.match(F)}if(v=_(x,m,a),Y){let J=-1;for(let S=48;S<=57;S++){if(J=b.indexOf(S),J>-1){b.splice(J,1);continue}b.push(S)}for(let S=65;S<=90;S++){if(J=b.indexOf(S),J>-1){b.splice(J,1);continue}b.push(S)}for(let S=97;S<=122;S++){if(J=b.indexOf(S),J>-1){b.splice(J,1);continue}b.push(S)}}let Z=Array.from({length:v},()=>String.fromCharCode(b[h(0,b.length-1)])).join("");N=N.slice(0,E.index)+Z+N.slice(E.index+E[0].length),E=N.match(q)}let W=/(.)\{(\d+)\,(\d+)\}/;for(E=N.match(W);E!=null;){if(l=parseInt(E[2]),c=parseInt(E[3]),l>c)throw new Error("Numbers out of order in {} quantifier.");v=h(l,c),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(W)}let U=/(.)\{(\d+)\}/;for(E=N.match(U);E!=null;)v=parseInt(E[2]),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(U);return N}},{}],13:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleString=J;var M=T("../utils"),h=_(T("./string-regex"));function _(S,B){if(typeof WeakMap=="function")var X=new WeakMap,H=new WeakMap;return(_=function(z,K){if(!K&&z&&z.__esModule)return z;var nt,lt,ht={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return ht;if(nt=K?H:X){if(nt.has(z))return nt.get(z);nt.set(z,ht)}for(let ct in z)ct!=="default"&&{}.hasOwnProperty.call(z,ct)&&((lt=(nt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,ct))&&(lt.get||lt.set)?nt(ht,ct,lt):ht[ct]=z[ct]);return ht})(S,B)}let y="qwerty!@#$%^123456";function N(){return"user@example.com"}function I(){return"\u043F\u043E\u0448\u0442\u0430@\u0443\u043A\u0440.\u043D\u0435\u0442"}function C(S,B){let X="pa$$word";return S>X.length&&(X+="_",X+=(0,M.ensureMinLength)(y,S-X.length).substring(0,S-X.length)),X}function $(S){let{min:B,max:X,omitTime:H,omitDate:z}=S,K=(0,M.toRFCDateTime)(new Date("2019-08-24T14:15:22.123Z"),H,z,!1);return K.length<B&&console.warn("Using minLength = ".concat(B,' is incorrect with format "date-time"')),X&&K.length>X&&console.warn("Using maxLength = ".concat(X,' is incorrect with format "date-time"')),K}function l(S,B){return $({min:S,max:B,omitTime:!1,omitDate:!1})}function c(S,B){return $({min:S,max:B,omitTime:!0,omitDate:!1})}function v(S,B){return $({min:S,max:B,omitTime:!1,omitDate:!0}).slice(1)}function P(S,B,X,H){let z=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(H&&z)return h.regexSample(H);let K=(0,M.ensureMinLength)("string",S);return B&&K.length>B&&(K=K.substring(0,B)),K}function E(){return"192.168.0.1"}function F(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function q(){return"example.com"}function W(){return"\u043F\u0440\u0438\u043A\u043B\u0430\u0434.\u0443\u043A\u0440"}function U(){return"http://example.com"}function Y(){return"../dictionary"}function f(){return"http://example.com/{endpoint}"}function m(){return"http://example.com/entity/1"}function a(){return"/entity/1"}function x(S,B,X){return(0,M.uuid)(X||"id")}function b(){return"/json/pointer"}function A(){return"1/relative/json/pointer"}function G(){return"/regex/"}let Z={email:N,"idn-email":I,password:C,"date-time":l,date:c,time:v,ipv4:E,ipv6:F,hostname:q,"idn-hostname":W,iri:m,"iri-reference":a,uri:U,"uri-reference":Y,"uri-template":f,uuid:x,default:P,"json-pointer":b,"relative-json-pointer":A,regex:G};function J(S,B,X,H){let z=S.format||"default",K=Z[z]||P,nt=H&&H.propertyName;return K(S.minLength||0,S.maxLength,nt,S.pattern,B?.enablePatterns)}},{"../utils":15,"./string-regex":12}],14:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.clearCache=U,w.traverse=m;var M=T("./openapi-sampler"),h=T("./allOf"),_=T("./infer"),y=T("./utils"),N=C(T("json-pointer"));let I=["if","then"];function C(a){return a&&a.__esModule?a:{default:a}}function $(a,x){if(a==null)return{};var b,A,G=l(a,x);if(Object.getOwnPropertySymbols){var Z=Object.getOwnPropertySymbols(a);for(A=0;A<Z.length;A++)b=Z[A],x.indexOf(b)===-1&&{}.propertyIsEnumerable.call(a,b)&&(G[b]=a[b])}return G}function l(a,x){if(a==null)return{};var b={};for(var A in a)if({}.hasOwnProperty.call(a,A)){if(x.indexOf(A)!==-1)continue;b[A]=a[A]}return b}function c(a,x){var b=Object.keys(a);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(a);x&&(A=A.filter(function(G){return Object.getOwnPropertyDescriptor(a,G).enumerable})),b.push.apply(b,A)}return b}function v(a){for(var x=1;x<arguments.length;x++){var b=arguments[x]!=null?arguments[x]:{};x%2?c(Object(b),!0).forEach(function(A){P(a,A,b[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):c(Object(b)).forEach(function(A){Object.defineProperty(a,A,Object.getOwnPropertyDescriptor(b,A))})}return a}function P(a,x,b){return(x=E(x))in a?Object.defineProperty(a,x,{value:b,enumerable:!0,configurable:!0,writable:!0}):a[x]=b,a}function E(a){var x=F(a,"string");return typeof x=="symbol"?x:x+""}function F(a,x){if(typeof a!="object"||!a)return a;var b=a[Symbol.toPrimitive];if(b!==void 0){var A=b.call(a,x||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(a)}let q={},W=[];function U(){q={},W=[]}function Y(a){let x;return a.const!==void 0?x=a.const:a.examples!==void 0&&a.examples.length?x=a.examples[0]:a.enum!==void 0&&a.enum.length?x=a.enum[0]:a.default!==void 0&&(x=a.default),x}function f(a){let x=Y(a);if(x!==void 0)return{value:x,readOnly:a.readOnly,writeOnly:a.writeOnly,type:null}}function m(a,x,b,A){if(A){if(W.includes(a))return(0,y.getResultForCircular)((0,_.inferType)(a));W.push(a)}if(A&&A.depth>x.maxSampleDepth)return(0,y.popSchemaStack)(W,A),(0,y.getResultForCircular)((0,_.inferType)(a));if(a.$ref){if(!b)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let S=decodeURIComponent(a.$ref);S.startsWith("#")&&(S=S.substring(1));let B=N.default.get(b,S),X;if(q[S]!==!0){q[S]=!0;let H=m(B,x,b,A);if(x.format==="xml"){let z=S.split("/").pop(),K=v(v({},A),{},{propertyName:A?.propertyName||z}),{propertyName:nt,value:lt}=(0,y.applyXMLAttributes)(H,B,K);X=v(v({},H),{},{value:{[nt||"root"]:lt}})}else X=H;q[S]=!1}else{let H=(0,_.inferType)(B);X=(0,y.getResultForCircular)(H)}return(0,y.popSchemaStack)(W,A),X}if(a.example!==void 0)return(0,y.popSchemaStack)(W,A),{value:a.example,readOnly:a.readOnly,writeOnly:a.writeOnly,type:a.type};if(a.allOf!==void 0)return(0,y.popSchemaStack)(W,A),f(a)||(0,h.allOfSample)(v(v({},a),{},{allOf:void 0}),a.allOf,x,b,A);if(a.oneOf&&a.oneOf.length){a.anyOf&&(x.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),(0,y.popSchemaStack)(W,A);let S=Object.assign({readOnly:a.readOnly,writeOnly:a.writeOnly},a.oneOf[0]);return J(a,S)}if(a.anyOf&&a.anyOf.length){(0,y.popSchemaStack)(W,A);let S=Object.assign({readOnly:a.readOnly,writeOnly:a.writeOnly},a.anyOf[0]);return J(a,S)}if(a.if&&a.then){(0,y.popSchemaStack)(W,A);let{if:S,then:B}=a,X=$(a,I);return m((0,y.mergeDeep)(X,S,B),x,b,A)}let G=Y(a),Z=null;if(G===void 0){G=null,Z=a.type,Array.isArray(Z)&&a.type.length>0&&(Z=a.type[0]),Z||(Z=(0,_.inferType)(a));let S=M._samplers[Z];S&&(G=S(a,x,b,A))}return(0,y.popSchemaStack)(W,A),{value:G,readOnly:a.readOnly,writeOnly:a.writeOnly,type:Z};function J(S,B){let X=f(S);if(X!==void 0)return X;let H=m(v(v({},S),{},{oneOf:void 0,anyOf:void 0}),x,b,A),z=m(B,x,b,A);if(typeof H.value=="object"&&typeof z.value=="object"){let K=(0,y.mergeDeep)(H.value,z.value);return v(v({},z),{},{value:K})}return z}}},{"./allOf":4,"./infer":5,"./openapi-sampler":6,"./utils":15,"json-pointer":3}],15:[function(T,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.SKIP_SYMBOL=void 0,w.applyXMLAttributes=W,w.ensureMinLength=l,w.getResultForCircular=P,w.getXMLAttributes=F,w.mergeDeep=c,w.popSchemaStack=E,w.toRFCDateTime=$,w.uuid=v;function M(f,m){var a=Object.keys(f);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(f);m&&(x=x.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),a.push.apply(a,x)}return a}function h(f){for(var m=1;m<arguments.length;m++){var a=arguments[m]!=null?arguments[m]:{};m%2?M(Object(a),!0).forEach(function(x){_(f,x,a[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(a)):M(Object(a)).forEach(function(x){Object.defineProperty(f,x,Object.getOwnPropertyDescriptor(a,x))})}return f}function _(f,m,a){return(m=y(m))in f?Object.defineProperty(f,m,{value:a,enumerable:!0,configurable:!0,writable:!0}):f[m]=a,f}function y(f){var m=N(f,"string");return typeof m=="symbol"?m:m+""}function N(f,m){if(typeof f!="object"||!f)return f;var a=f[Symbol.toPrimitive];if(a!==void 0){var x=a.call(f,m||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(f)}let I=w.SKIP_SYMBOL=Symbol("skip");function C(f){return f<10?"0"+f:f}function $(f,m,a,x){var b=a?"":f.getUTCFullYear()+"-"+C(f.getUTCMonth()+1)+"-"+C(f.getUTCDate());return m||(b+="T"+C(f.getUTCHours())+":"+C(f.getUTCMinutes())+":"+C(f.getUTCSeconds())+(x?"."+(f.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),b}function l(f,m){return m>f.length?f.repeat(Math.trunc(m/f.length)+1).substring(0,m):f}function c(){let f=b=>b&&typeof b=="object";for(var m=arguments.length,a=new Array(m),x=0;x<m;x++)a[x]=arguments[x];return a.reduce((b,A)=>(Object.keys(A||{}).forEach(G=>{let Z=b[G],J=A[G];f(Z)&&f(J)?b[G]=c(Z,J):b[G]=J}),b),Array.isArray(a[a.length-1])?[]:{})}function v(f){var m=U(f),a=Y(m,m,m,m),x="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,b=>{var A=a()*16%16|0;return(b=="x"?A:A&3|8).toString(16)});return x}function P(f){return{value:f==="object"?{}:f==="array"?[]:void 0}}function E(f,m){m&&f.pop()}function F(f){var m,a,x,b,A,G,Z;return{name:(f==null||(m=f.xml)===null||m===void 0?void 0:m.name)||"",prefix:(f==null||(a=f.xml)===null||a===void 0?void 0:a.prefix)||"",namespace:(f==null||(x=f.xml)===null||x===void 0?void 0:x.namespace)||null,attribute:(b=f==null||(A=f.xml)===null||A===void 0?void 0:A.attribute)!==null&&b!==void 0?b:!1,wrapped:(G=f==null||(Z=f.xml)===null||Z===void 0?void 0:Z.wrapped)!==null&&G!==void 0?G:!1}}function q(f){let m=f?.xml;return m!=null&&m.nodeType?m.nodeType:m?.attribute===!0?"attribute":m?.wrapped===!0&&f?.type==="array"?"element":f!=null&&f.$ref||f!=null&&f.$dynamicRef||f?.type==="array"||f!=null&&f.oneOf||f!=null&&f.anyOf||f!=null&&f.allOf?"none":"element"}function W(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{value:x}=f,{propertyName:b}=a,{name:A,prefix:G,namespace:Z}=F(m),J=q(m),S=A||b?"".concat(G?G+":":"").concat(A||b):null,B=typeof x=="object"?Array.isArray(x)?[...x]:h({},x):x;switch(J){case"attribute":S&&(S="$".concat(S));break;case"text":S="#text";break;case"cdata":S="#cdata";break;case"none":if(m.type==="array"){if(S=null,m.example!==void 0){var X;S=((X=m.items)===null||X===void 0||(X=X.xml)===null||X===void 0?void 0:X.name)||S}}else S=null;break;default:m.type==="array"&&Array.isArray(B)&&(B={[S]:[...B]});break}return Z&&J!=="text"&&J!=="cdata"&&J!=="none"&&(typeof B=="object"?B["$xmlns".concat(G?":"+G:"")]=Z:B={["$xmlns".concat(G?":"+G:"")]:Z,"#text":B}),{propertyName:S,value:B}}function U(f){var m=0;if(f.length==0)return m;for(var a=0;a<f.length;a++){var x=f.charCodeAt(a);m=(m<<5)-m+x,m=m&m}return m}function Y(f,m,a,x){return function(){f|=0,m|=0,a|=0,x|=0;var b=f-(m<<27|m>>>5)|0;return f=m^(a<<17|a>>>15),m=a+x|0,a=x+b|0,x=f+b|0,(x>>>0)/4294967296}}},{}]},{},[6])(6)})});export{je as a,Me as b};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{a as Q,c as ee,e as te}from"./RFWIIJFG.js";var G=ee((w,x)=>{(function(e,t){typeof w=="object"&&typeof x<"u"?t(w):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.ULID={}))})(w,(function(e){"use strict";function t(r){let c=new Error(r);return c.source="ulid",c}let n="0123456789ABCDEFGHJKMNPQRSTVWXYZ",o=n.length,i=Math.pow(2,48)-1,s=10,u=16;function v(r,c,a){return c>r.length-1?r:r.substr(0,c)+a+r.substr(c+1)}function p(r){let c,a=r.length,d,l,b=o-1;for(;!c&&a-->=0;){if(d=r[a],l=n.indexOf(d),l===-1)throw t("incorrectly encoded string");if(l===b){r=v(r,a,n[0]);continue}c=v(r,a,n[l+1])}if(typeof c=="string")return c;throw t("cannot increment this string")}function f(r){let c=Math.floor(r()*o);return c===o&&(c=o-1),n.charAt(c)}function m(r,c){if(isNaN(r))throw new Error(r+" must be a number");if(r>i)throw t("cannot encode time greater than "+i);if(r<0)throw t("time must be positive");if(Number.isInteger(Number(r))===!1)throw t("time must be an integer");let a,d="";for(;c>0;c--)a=r%o,d=n.charAt(a)+d,r=(r-a)/o;return d}function g(r,c){let a="";for(;r>0;r--)a=f(c)+a;return a}function E(r){if(r.length!==s+u)throw t("malformed ulid");var c=r.substr(0,s).split("").reverse().reduce((a,d,l)=>{let b=n.indexOf(d);if(b===-1)throw t("invalid character found: "+d);return a+=b*Math.pow(o,l)},0);if(c>i)throw t("malformed ulid, timestamp too large");return c}function I(r=!1,c){c||(c=typeof window<"u"?window:null);let a=c&&(c.crypto||c.msCrypto);if(a)return()=>{let d=new Uint8Array(1);return a.getRandomValues(d),d[0]/255};try{let d=Q("crypto");return()=>d.randomBytes(1).readUInt8()/255}catch{}if(r){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw t("secure crypto unusable, insecure Math.random not allowed")}function j(r){return r||(r=I()),function(a){return isNaN(a)&&(a=Date.now()),m(a,s)+g(u,r)}}function C(r){r||(r=I());let c=0,a;return function(l){if(isNaN(l)&&(l=Date.now()),l<=c){let N=a=p(a);return m(c,s)+N}c=l;let b=a=g(u,r);return m(l,s)+b}}let R=j();e.decodeTime=E,e.detectPrng=I,e.encodeRandom=g,e.encodeTime=m,e.factory=j,e.incrementBase32=p,e.monotonicFactory=C,e.randomChar=f,e.replaceCharAt=v,e.ulid=R}))});var S=te(G(),1),ne=Object.defineProperty,oe=(e,t)=>{for(var n in t)ne(e,n,{get:t[n],enumerable:!0})},re={};oe(re,{CLOUD_EVENT_STANDARD_KEYS:()=>k,mapToCloudEvent:()=>ie});var k=["id","specversion","object","datacontenttype","type","time","origin","env","category","signal","source","subject","subjects","data","actor","requestId","clientIp","organizationId","organizationSlug","projectId","projectSlug","osPlatform","userAgent","sessionId"];function ie(e){let{type:t,data:n,actor:o,requestId:i,clientIp:s,origin:u,env:v,source:p,organizationId:f,organizationSlug:m,projectId:g,projectSlug:E,category:I="product",signal:j="log",osPlatform:C,userAgent:R,sessionId:r}=e,c=!!(n&&Array.isArray(n)),a=o?{id:o.id??`ann_${(0,S.ulid)()}`,object:o.object??"user",uri:o.uri??""}:null,d=`evt_${(0,S.ulid)()}`.toLowerCase(),l=new Date,b=p??a?.uri??null,N={...f!==void 0&&{organizationId:f},...m!==void 0&&{organizationSlug:m},...g!==void 0&&{projectId:g},...E!==void 0&&{projectSlug:E}},$={specversion:"1.0",object:"event",datacontenttype:"application/json; charset=utf-8",origin:u,env:v,category:I,signal:j,osPlatform:C,userAgent:R,clientIp:s,sessionId:r};if(c){let _=n,J=_.map(Z=>({id:Z.id??"",object:Z.object??"",uri:Z.uri??""})),Y=_[0]?.id??null;Object.assign($,{...N,id:d,type:t,time:l,source:b,actor:a,subject:Y,subjects:J,data:_,requestId:i??""})}else{let _=(Array.isArray(n)?n[0]:n)?.id??null;Object.assign($,{...N,id:d,type:t,time:l,source:b,actor:a,subject:_,requestId:i??"",data:n,...p!=null&&{request:{source:p}}})}return $}function U(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function O(e){return e!=null}function L(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function B(e,t,n,o=!0,i){let s=i?.length?new Set(i):null;for(let[u,v]of Object.entries(e))if(!s?.has(u)&&v!==void 0){let p=o?U(u):u;n[`${t}${p}`]=v}}function A(e,t,n,o){let i=o?.currentDepth??0,s=o?.useSnakeCase??!0,u=o?.maxNestingLevels??3,v=t.endsWith(".")?t.slice(0,-1):t;for(let[p,f]of Object.entries(e)){if(!O(f))continue;let m=s?U(p):p,g=`${v}.${m}`;typeof f=="object"&&!Array.isArray(f)?i<u&&A(f,g,n,{currentDepth:i+1,useSnakeCase:s,maxNestingLevels:u}):L(f)&&(n[g]=f)}}var V="context",F=[V];function X(e){let t={updated:[],notUpdated:[]};for(let n of e){if(!n||typeof n!="object")continue;let o=n.object;if(typeof o!="string")continue;let i=n,s=t.notUpdated.find(u=>u.object===o);s?(t.updated=[s,i],t.notUpdated=t.notUpdated.filter(u=>u.object!==o)):t.updated.some(u=>u.object===o)||t.notUpdated.push(i)}return t}function D(e,t,n){let o=n?`${n}.`:"",i=t===""?"":`${U(t)}.`;return`${e}.${o}${i}`}function W(e,t){let n=e[V];return n==="before"||n==="after"?n:t===0?"after":"before"}function P(e){let{[V]:t,...n}=e;return n}function z(e){return e.endsWith(".")?e:`${e}.`}function ce(e,t,n){let o=t instanceof Date?t.toISOString():new Date(t).toISOString();return{"cloudevents.event_id":e.id,"cloudevents.event_type":e.type,"cloudevents.event_source":e.source??void 0,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype??"application/json; charset=utf-8","cloudevents.event_time":o,"cloudevents.event_subject":e.subject??"","cloudevents.event_version":n?.version,"cloudevents.event_origin":e.origin??n?.serviceName,"cloudevents.event_env":e.env,"cloudevents.event_client_ip":e.clientIp,"cloudevents.event_object":e.object||"event","cloudevents.event_category":e.category,"cloudevents.event_signal":e.signal,"cloudevents.event_actor.id":e.actor?.id??void 0,"cloudevents.event_actor.object":e.actor?.object??void 0,"cloudevents.event_actor.uri":e.actor?.uri??void 0,"cloudevents.event_organization_id":e.organizationId,"cloudevents.event_organization_slug":e.organizationSlug,"cloudevents.event_project_id":e.projectId,"cloudevents.event_project_slug":e.projectSlug,"cloudevents.event_request_id":e.requestId,"cloudevents.event_os_platform":e.osPlatform,"cloudevents.event_user_agent":e.userAgent,"cloudevents.event_session_id":e.sessionId}}function _e(e,t,n){let o=e.data,i={...ce(e,t,n)};return ae(o,i),fe(e,i),pe(e,i),i}function ae(e,t){!e||typeof e!="object"||(Array.isArray(e)?se(e,t):le(e,t))}function se(e,t){e.some(n=>n&&typeof n=="object"&&typeof n.object=="string")?ue(e,t):de(e,t)}function ue(e,t){let n=X(e);n.updated.forEach((o,i)=>{let s=D("cloudevents.event_data",o.object,W(o,i));A(P(o),z(s),t)}),n.notUpdated.forEach(o=>{let i=D("cloudevents.event_data",o.object,void 0);A(P(o),z(i),t)})}function de(e,t){for(let n of e)!n||typeof n!="object"||A(n,"cloudevents.event_data.",t)}function le(e,t){for(let[n,o]of Object.entries(e)){if(!O(o))continue;let i=U(n);if(typeof o=="object"&&!Array.isArray(o))for(let[s,u]of Object.entries(o))O(u)&&L(u)&&(t[`cloudevents.event_data.${i}.${s}`]=u);else L(o)&&(t[`cloudevents.event_data.${i}`]=o)}}function fe(e,t){if(!e.subjects||!Array.isArray(e.subjects))return;let n=X(e.subjects);n.updated.forEach((o,i)=>{let s=D("cloudevents.event_subjects",o.object,W(o,i));B(o,s,t,!1,F)}),n.notUpdated.forEach(o=>{let i=D("cloudevents.event_subjects",o.object,void 0);B(o,i,t,!1,F)})}function pe(e,t){for(let[n,o]of Object.entries(e))if(!(k.includes(n)||o===void 0))if(o instanceof Object)for(let[i,s]of Object.entries(o))s!==void 0&&(t[`cloudevents.${n}.${i}`]=s);else t[`cloudevents.${n}`]=o}import T from"node:crypto";var H="0123456789ABCDEFGHJKMNPQRSTVWXYZ",M=32;var ve=16,K=10,q=0xffffffffffff;var h;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(h||(h={}));var y=class extends Error{constructor(t,n){super(`${n} (${t})`),this.name="ULIDError",this.code=t}};function me(e){let t=Math.floor(e()*M)%M;return H.charAt(t)}function ge(e){let t=be(),n=t&&(t.crypto||t.msCrypto)||(typeof T<"u"?T:null);if(typeof n?.getRandomValues=="function")return()=>{let o=new Uint8Array(1);return n.getRandomValues(o),o[0]/256};if(typeof n?.randomBytes=="function")return()=>n.randomBytes(1).readUInt8()/256;if(T?.randomBytes)return()=>T.randomBytes(1).readUInt8()/256;throw new y(h.PRNGDetectFailure,"Failed to find a reliable PRNG")}function be(){return Ie()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function he(e,t){let n="";for(;e>0;e--)n=me(t)+n;return n}function ye(e,t=K){if(isNaN(e))throw new y(h.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>q)throw new y(h.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${q}: ${e}`);if(e<0)throw new y(h.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new y(h.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,o="";for(let i=t;i>0;i--)n=e%M,o=H.charAt(n)+o,e=(e-n)/M;return o}function Ie(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Ne(e,t){let n=t||ge(),o=!e||isNaN(e)?Date.now():e;return ye(o,K)+he(ve,n)}export{re as a,_e as b,Ne as c};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- var o="https://otel.cloud.redocly.com",t=process.env.OTEL_TRACES_URL||`${o}/v1/traces`,c=6e3,e="redocly-cli-anonymous-id";export{o as a,t as b,c,e as d};