@fern-api/java-dynamic-snippets 0.0.4 → 0.0.5

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 (73) hide show
  1. package/cjs/Config.cjs.map +1 -1
  2. package/cjs/DynamicSnippetsGenerator.cjs +18 -9
  3. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
  4. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  5. package/cjs/{DynamicSnippetsGeneratorContext-FbVOZ8Go.d.cts → DynamicSnippetsGeneratorContext-DGzYoCz3.d.cts} +11 -1
  6. package/cjs/EndpointSnippetGenerator.cjs +14 -11
  7. package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
  8. package/cjs/EndpointSnippetGenerator.d.cts +1 -1
  9. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +18 -9
  10. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
  11. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  12. package/cjs/context/DynamicTypeLiteralMapper.cjs +18 -9
  13. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -1
  14. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  15. package/cjs/context/DynamicTypeMapper.cjs +12 -9
  16. package/cjs/context/DynamicTypeMapper.cjs.map +1 -1
  17. package/cjs/context/DynamicTypeMapper.d.cts +1 -1
  18. package/cjs/context/FilePropertyMapper.cjs +14 -11
  19. package/cjs/context/FilePropertyMapper.cjs.map +1 -1
  20. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  21. package/cjs/index.cjs +20 -23
  22. package/cjs/index.cjs.map +1 -1
  23. package/cjs/index.d.cts +1 -1
  24. package/esm/Config.js +1 -1
  25. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  26. package/esm/DynamicSnippetsGenerator.js +1 -1
  27. package/esm/{DynamicSnippetsGeneratorContext-FbVOZ8Go.d.ts → DynamicSnippetsGeneratorContext-DGzYoCz3.d.ts} +11 -1
  28. package/esm/EndpointSnippetGenerator.d.ts +1 -1
  29. package/esm/EndpointSnippetGenerator.js +1 -1
  30. package/esm/chunk-2U3YQWRZ.js +12 -0
  31. package/esm/chunk-2U3YQWRZ.js.map +1 -0
  32. package/esm/chunk-3X524Y2I.js +23 -0
  33. package/esm/chunk-3X524Y2I.js.map +1 -0
  34. package/esm/chunk-5CTXVUPZ.js +8 -0
  35. package/esm/chunk-5CTXVUPZ.js.map +1 -0
  36. package/esm/{chunk-3LOINSB3.js → chunk-EOZMORS3.js} +2 -2
  37. package/esm/chunk-JFD4YVTW.js +15 -0
  38. package/esm/chunk-JFD4YVTW.js.map +1 -0
  39. package/esm/chunk-KQE3JYZ2.js +2 -0
  40. package/esm/chunk-KQE3JYZ2.js.map +1 -0
  41. package/esm/chunk-N3AIOPEV.js +2 -0
  42. package/esm/chunk-PBNDQMXA.js +2 -0
  43. package/esm/{chunk-PUPEW5QI.js.map → chunk-PBNDQMXA.js.map} +1 -1
  44. package/esm/{chunk-6YM2QG7U.js → chunk-QH22Z5KY.js} +2 -2
  45. package/esm/{chunk-JZBCQWQN.js → chunk-VYJE6STI.js} +2 -2
  46. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  47. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  48. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  49. package/esm/context/DynamicTypeLiteralMapper.js +1 -1
  50. package/esm/context/DynamicTypeMapper.d.ts +1 -1
  51. package/esm/context/DynamicTypeMapper.js +1 -1
  52. package/esm/context/FilePropertyMapper.d.ts +1 -1
  53. package/esm/context/FilePropertyMapper.js +1 -1
  54. package/esm/index.d.ts +1 -1
  55. package/esm/index.js +1 -13
  56. package/esm/index.js.map +1 -1
  57. package/package.json +1 -1
  58. package/esm/chunk-3JSOCWNQ.js +0 -20
  59. package/esm/chunk-3JSOCWNQ.js.map +0 -1
  60. package/esm/chunk-E6GFFTKW.js +0 -12
  61. package/esm/chunk-E6GFFTKW.js.map +0 -1
  62. package/esm/chunk-JZ2FDMYI.js +0 -15
  63. package/esm/chunk-JZ2FDMYI.js.map +0 -1
  64. package/esm/chunk-PUPEW5QI.js +0 -2
  65. package/esm/chunk-SQKACQJK.js +0 -2
  66. package/esm/chunk-SQKACQJK.js.map +0 -1
  67. package/esm/chunk-WBGWLNLI.js +0 -2
  68. package/esm/chunk-ZYVZJBJN.js +0 -2
  69. package/esm/chunk-ZYVZJBJN.js.map +0 -1
  70. /package/esm/{chunk-3LOINSB3.js.map → chunk-EOZMORS3.js.map} +0 -0
  71. /package/esm/{chunk-WBGWLNLI.js.map → chunk-N3AIOPEV.js.map} +0 -0
  72. /package/esm/{chunk-6YM2QG7U.js.map → chunk-QH22Z5KY.js.map} +0 -0
  73. /package/esm/{chunk-JZBCQWQN.js.map → chunk-VYJE6STI.js.map} +0 -0
package/cjs/index.cjs CHANGED
@@ -1,34 +1,31 @@
1
- "use strict";var ff=Object.create;var Wt=Object.defineProperty,pf=Object.defineProperties,df=Object.getOwnPropertyDescriptor,mf=Object.getOwnPropertyDescriptors,hf=Object.getOwnPropertyNames,Ar=Object.getOwnPropertySymbols,yf=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable;var Ln=(r,e,t)=>e in r?Wt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,h=(r,e)=>{for(var t in e||(e={}))Un.call(e,t)&&Ln(r,t,e[t]);if(Ar)for(var t of Ar(e))li.call(e,t)&&Ln(r,t,e[t]);return r},A=(r,e)=>pf(r,mf(e));var ci=r=>typeof r=="symbol"?r:r+"",fi=(r,e)=>{var t={};for(var n in r)Un.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&Ar)for(var n of Ar(r))e.indexOf(n)<0&&li.call(r,n)&&(t[n]=r[n]);return t};var xt=(r,e)=>()=>(r&&(e=r(r=0)),e);var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Rr=(r,e)=>{for(var t in e)Wt(r,t,{get:e[t],enumerable:!0})},pi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of hf(e))!Un.call(r,a)&&a!==t&&Wt(r,a,{get:()=>e[a],enumerable:!(n=df(e,a))||n.enumerable});return r};var gf=(r,e,t)=>(t=r!=null?ff(yf(r)):{},pi(e||!r||!r.__esModule?Wt(t,"default",{value:r,enumerable:!0}):t,r)),di=r=>pi(Wt({},"__esModule",{value:!0}),r);var w=(r,e,t)=>Ln(r,typeof e!="symbol"?e+"":e,t);function hi(){throw new Error("setTimeout has not been defined")}function yi(){throw new Error("clearTimeout has not been defined")}function gi(r){if(Re===setTimeout)return setTimeout(r,0);if((Re===hi||!Re)&&setTimeout)return Re=setTimeout,setTimeout(r,0);try{return Re(r,0)}catch(e){try{return Re.call(null,r,0)}catch(t){return Re.call(this,r,0)}}}function vf(r){if(ke===clearTimeout)return clearTimeout(r);if((ke===yi||!ke)&&clearTimeout)return ke=clearTimeout,clearTimeout(r);try{return ke(r)}catch(e){try{return ke.call(null,r)}catch(t){return ke.call(this,r)}}}function xf(){!bt||!Me||(bt=!1,Me.length?he=Me.concat(he):kr=-1,he.length&&vi())}function vi(){if(!bt){var r=gi(xf);bt=!0;for(var e=he.length;e;){for(Me=he,he=[];++kr<e;)Me&&Me[kr].run();kr=-1,e=he.length}Me=null,bt=!1,vf(r)}}function wf(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];he.push(new xi(r,e)),he.length===1&&!bt&&gi(vi)}function xi(r,e){this.fun=r,this.array=e}function je(){}function Bf(r){throw new Error("process.binding is not supported")}function Mf(){return"/"}function jf(r){throw new Error("process.chdir is not supported")}function $f(){return 0}function Df(r){var e=qf.call(wt)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}function Wf(){var r=new Date,e=r-Vf;return e/1e3}var Re,ke,he,bt,Me,kr,bf,Tf,_f,Sf,Af,Rf,kf,Nf,If,Ef,Pf,Cf,Of,Ff,Lf,Uf,wt,qf,Vf,p,mi,s=xt(()=>{"use strict";Re=hi,ke=yi;typeof globalThis.setTimeout=="function"&&(Re=setTimeout);typeof globalThis.clearTimeout=="function"&&(ke=clearTimeout);he=[],bt=!1,kr=-1;xi.prototype.run=function(){this.fun.apply(null,this.array)};bf="browser",Tf="browser",_f=!0,Sf={},Af=[],Rf="",kf={},Nf={},If={};Ef=je,Pf=je,Cf=je,Of=je,Ff=je,Lf=je,Uf=je;wt=globalThis.performance||{},qf=wt.now||wt.mozNow||wt.msNow||wt.oNow||wt.webkitNow||function(){return new Date().getTime()};Vf=new Date;p={nextTick:wf,title:bf,browser:_f,env:Sf,argv:Af,version:Rf,versions:kf,on:Ef,addListener:Pf,once:Cf,off:Of,removeListener:Ff,removeAllListeners:Lf,emit:Uf,binding:Bf,cwd:Mf,chdir:jf,umask:$f,hrtime:Df,platform:Tf,release:Nf,config:If,uptime:Wf},mi={};Object.keys(mi).forEach(r=>{let e=r.split("."),t=p;for(let n=0;n<e.length;n++){let a=e[n];n===e.length-1?t[a]=mi[r]:t=t[a]||(t[a]={})}})});function _i(){Mn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)ae[e]=r[e],K[r.charCodeAt(e)]=e;K[45]=62,K[95]=63}function Gf(r){Mn||_i();var e,t,n,a,i,o,l=r.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=r[l-2]==="="?2:r[l-1]==="="?1:0,o=new zf(l*3/4-i),n=i>0?l-4:l;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)a=K[r.charCodeAt(e)]<<18|K[r.charCodeAt(e+1)]<<12|K[r.charCodeAt(e+2)]<<6|K[r.charCodeAt(e+3)],o[f++]=a>>16&255,o[f++]=a>>8&255,o[f++]=a&255;return i===2?(a=K[r.charCodeAt(e)]<<2|K[r.charCodeAt(e+1)]>>4,o[f++]=a&255):i===1&&(a=K[r.charCodeAt(e)]<<10|K[r.charCodeAt(e+1)]<<4|K[r.charCodeAt(e+2)]>>2,o[f++]=a>>8&255,o[f++]=a&255),o}function Zf(r){return ae[r>>18&63]+ae[r>>12&63]+ae[r>>6&63]+ae[r&63]}function Hf(r,e,t){for(var n,a=[],i=e;i<t;i+=3)n=(r[i]<<16)+(r[i+1]<<8)+r[i+2],a.push(Zf(n));return a.join("")}function wi(r){Mn||_i();for(var e,t=r.length,n=t%3,a="",i=[],o=16383,l=0,f=t-n;l<f;l+=o)i.push(Hf(r,l,l+o>f?f:l+o));return n===1?(e=r[t-1],a+=ae[e>>2],a+=ae[e<<4&63],a+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],a+=ae[e>>10],a+=ae[e>>4&63],a+=ae[e<<2&63],a+="="),i.push(a),i.join("")}function Nr(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ye(r,e){if(Nr()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=c.prototype):(r===null&&(r=new c(e)),r.length=e),r}function c(r,e,t){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return jn(this,r)}return Si(this,r,e,t)}function Si(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?Kf(r,e,t,n):typeof e=="string"?Jf(r,e,t):Xf(r,e)}function Ai(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Yf(r,e,t,n){return Ai(e),e<=0?ye(r,e):t!==void 0?typeof n=="string"?ye(r,e).fill(t,n):ye(r,e).fill(t):ye(r,e)}function jn(r,e){if(Ai(e),r=ye(r,e<0?0:$n(e)|0),!c.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}function Jf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=Ri(e,t)|0;r=ye(r,n);var a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function Bn(r,e){var t=e.length<0?0:$n(e.length)|0;r=ye(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Kf(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),c.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=c.prototype):r=Bn(r,e),r}function Xf(r,e){if(ie(e)){var t=$n(e.length)|0;return r=ye(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||gp(e.length)?ye(r,0):Bn(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Bn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function $n(r){if(r>=Nr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Nr().toString(16)+" bytes");return r|0}function ie(r){return!!(r!=null&&r._isBuffer)}function Ri(r,e){if(ie(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Ir(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Oi(r).length;default:if(n)return Ir(r).length;e=(""+e).toLowerCase(),n=!0}}function Qf(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return lp(this,e,t);case"utf8":case"utf-8":return Ii(this,e,t);case"ascii":return sp(this,e,t);case"latin1":case"binary":return up(this,e,t);case"base64":return ip(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cp(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function $e(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function ki(r,e,t,n,a){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(a)return-1;t=r.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof e=="string"&&(e=c.from(e,n)),ie(e))return e.length===0?-1:bi(r,e,t,n,a);if(typeof e=="number")return e=e&255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):bi(r,[e],t,n,a);throw new TypeError("val must be string, number or Buffer")}function bi(r,e,t,n,a){var i=1,o=r.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,o/=2,l/=2,t/=2}function f(E,B){return i===1?E[B]:E.readUInt16BE(B*i)}var d;if(a){var y=-1;for(d=t;d<o;d++)if(f(r,d)===f(e,y===-1?0:d-y)){if(y===-1&&(y=d),d-y+1===l)return y*i}else y!==-1&&(d-=d-y),y=-1}else for(t+l>o&&(t=o-l),d=t;d>=0;d--){for(var g=!0,_=0;_<l;_++)if(f(r,d+_)!==f(e,_)){g=!1;break}if(g)return d}return-1}function ep(r,e,t,n){t=Number(t)||0;var a=r.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o<n;++o){var l=parseInt(e.substr(o*2,2),16);if(isNaN(l))return o;r[t+o]=l}return o}function tp(r,e,t,n){return Cr(Ir(e,r.length-t),r,t,n)}function Ni(r,e,t,n){return Cr(hp(e),r,t,n)}function rp(r,e,t,n){return Ni(r,e,t,n)}function np(r,e,t,n){return Cr(Oi(e),r,t,n)}function ap(r,e,t,n){return Cr(yp(e,r.length-t),r,t,n)}function ip(r,e,t){return e===0&&t===r.length?wi(r):wi(r.slice(e,t))}function Ii(r,e,t){t=Math.min(r.length,t);for(var n=[],a=e;a<t;){var i=r[a],o=null,l=i>239?4:i>223?3:i>191?2:1;if(a+l<=t){var f,d,y,g;switch(l){case 1:i<128&&(o=i);break;case 2:f=r[a+1],(f&192)===128&&(g=(i&31)<<6|f&63,g>127&&(o=g));break;case 3:f=r[a+1],d=r[a+2],(f&192)===128&&(d&192)===128&&(g=(i&15)<<12|(f&63)<<6|d&63,g>2047&&(g<55296||g>57343)&&(o=g));break;case 4:f=r[a+1],d=r[a+2],y=r[a+3],(f&192)===128&&(d&192)===128&&(y&192)===128&&(g=(i&15)<<18|(f&63)<<12|(d&63)<<6|y&63,g>65535&&g<1114112&&(o=g))}}o===null?(o=65533,l=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),a+=l}return op(n)}function op(r){var e=r.length;if(e<=Ti)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ti));return t}function sp(r,e,t){var n="";t=Math.min(r.length,t);for(var a=e;a<t;++a)n+=String.fromCharCode(r[a]&127);return n}function up(r,e,t){var n="";t=Math.min(r.length,t);for(var a=e;a<t;++a)n+=String.fromCharCode(r[a]);return n}function lp(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var a="",i=e;i<t;++i)a+=mp(r[i]);return a}function cp(r,e,t){for(var n=r.slice(e,t),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+n[i+1]*256);return a}function $(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}function G(r,e,t,n,a,i){if(!ie(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}function Er(r,e,t,n){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(r.length-t,2);a<i;++a)r[t+a]=(e&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}function Pr(r,e,t,n){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(r.length-t,4);a<i;++a)r[t+a]=e>>>(n?a:3-a)*8&255}function Ei(r,e,t,n,a,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Pi(r,e,t,n,a){return a||Ei(r,e,t,4,34028234663852886e22,-34028234663852886e22),Li(r,e,t,n,23,4),t+4}function Ci(r,e,t,n,a){return a||Ei(r,e,t,8,17976931348623157e292,-17976931348623157e292),Li(r,e,t,n,52,8),t+8}function pp(r){if(r=dp(r).replace(fp,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function dp(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function mp(r){return r<16?"0"+r.toString(16):r.toString(16)}function Ir(r,e){e=e||1/0;for(var t,n=r.length,a=null,i=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!a){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function hp(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function yp(r,e){for(var t,n,a,i=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,a=t%256,i.push(a),i.push(n);return i}function Oi(r){return Gf(pp(r))}function Cr(r,e,t,n){for(var a=0;a<n&&!(a+t>=e.length||a>=r.length);++a)e[a+t]=r[a];return a}function gp(r){return r!==r}function vp(r){return r!=null&&(!!r._isBuffer||Fi(r)||xp(r))}function Fi(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function xp(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Fi(r.slice(0,0))}function Or(r,e,t,n,a){var i,o,l=a*8-n-1,f=(1<<l)-1,d=f>>1,y=-7,g=t?a-1:0,_=t?-1:1,E=r[e+g];for(g+=_,i=E&(1<<-y)-1,E>>=-y,y+=l;y>0;i=i*256+r[e+g],g+=_,y-=8);for(o=i&(1<<-y)-1,i>>=-y,y+=n;y>0;o=o*256+r[e+g],g+=_,y-=8);if(i===0)i=1-d;else{if(i===f)return o?NaN:(E?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-d}return(E?-1:1)*o*Math.pow(2,i-n)}function Li(r,e,t,n,a,i){var o,l,f,d=i*8-a-1,y=(1<<d)-1,g=y>>1,_=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:i-1,B=n?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=y):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+g>=1?e+=_/f:e+=_*Math.pow(2,1-g),e*f>=2&&(o++,f/=2),o+g>=y?(l=0,o=y):o+g>=1?(l=(e*f-1)*Math.pow(2,a),o=o+g):(l=e*Math.pow(2,g-1)*Math.pow(2,a),o=0));a>=8;r[t+E]=l&255,E+=B,l/=256,a-=8);for(o=o<<a|l,d+=a;d>0;r[t+E]=o&255,E+=B,o/=256,d-=8);r[t+E-B]|=j*128}var ae,K,zf,Mn,Ti,fp,Ui=xt(()=>{"use strict";s();u();ae=[],K=[],zf=typeof Uint8Array!="undefined"?Uint8Array:Array,Mn=!1;c.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;c.poolSize=8192;c._augment=function(r){return r.__proto__=c.prototype,r};c.from=function(r,e,t){return Si(null,r,e,t)};c.kMaxLength=Nr();c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&c[Symbol.species]);c.alloc=function(r,e,t){return Yf(null,r,e,t)};c.allocUnsafe=function(r){return jn(null,r)};c.allocUnsafeSlow=function(r){return jn(null,r)};c.isBuffer=vp;c.compare=function(e,t){if(!ie(e)||!ie(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,a=t.length,i=0,o=Math.min(n,a);i<o;++i)if(e[i]!==t[i]){n=e[i],a=t[i];break}return n<a?-1:a<n?1:0};c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return c.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var a=c.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!ie(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(a,i),i+=o.length}return a};c.byteLength=Ri;c.prototype._isBuffer=!0;c.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$e(this,t,t+1);return this};c.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$e(this,t,t+3),$e(this,t+1,t+2);return this};c.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$e(this,t,t+7),$e(this,t+1,t+6),$e(this,t+2,t+5),$e(this,t+3,t+4);return this};c.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Ii(this,0,e):Qf.apply(this,arguments)};c.prototype.equals=function(e){if(!ie(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:c.compare(this,e)===0};c.prototype.compare=function(e,t,n,a,i){if(!ie(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),t<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=n)return 0;if(a>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,i>>>=0,this===e)return 0;for(var o=i-a,l=n-t,f=Math.min(o,l),d=this.slice(a,i),y=e.slice(t,n),g=0;g<f;++g)if(d[g]!==y[g]){o=d[g],l=y[g];break}return o<l?-1:l<o?1:0};c.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};c.prototype.indexOf=function(e,t,n){return ki(this,e,t,n,!0)};c.prototype.lastIndexOf=function(e,t,n){return ki(this,e,t,n,!1)};c.prototype.write=function(e,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var o=!1;;)switch(a){case"hex":return ep(this,e,t,n);case"utf8":case"utf-8":return tp(this,e,t,n);case"ascii":return Ni(this,e,t,n);case"latin1":case"binary":return rp(this,e,t,n);case"base64":return np(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ap(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),o=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ti=4096;c.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var a;if(c.TYPED_ARRAY_SUPPORT)a=this.subarray(e,t),a.__proto__=c.prototype;else{var i=t-e;a=new c(i,void 0);for(var o=0;o<i;++o)a[o]=this[o+e]}return a};c.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||$(e,t,this.length);for(var a=this[e],i=1,o=0;++o<t&&(i*=256);)a+=this[e+o]*i;return a};c.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||$(e,t,this.length);for(var a=this[e+--t],i=1;t>0&&(i*=256);)a+=this[e+--t]*i;return a};c.prototype.readUInt8=function(e,t){return t||$(e,1,this.length),this[e]};c.prototype.readUInt16LE=function(e,t){return t||$(e,2,this.length),this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function(e,t){return t||$(e,2,this.length),this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function(e,t){return t||$(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function(e,t){return t||$(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||$(e,t,this.length);for(var a=this[e],i=1,o=0;++o<t&&(i*=256);)a+=this[e+o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a};c.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||$(e,t,this.length);for(var a=t,i=1,o=this[e+--a];a>0&&(i*=256);)o+=this[e+--a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};c.prototype.readInt8=function(e,t){return t||$(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};c.prototype.readInt16LE=function(e,t){t||$(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(e,t){t||$(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(e,t){return t||$(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function(e,t){return t||$(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function(e,t){return t||$(e,4,this.length),Or(this,e,!0,23,4)};c.prototype.readFloatBE=function(e,t){return t||$(e,4,this.length),Or(this,e,!1,23,4)};c.prototype.readDoubleLE=function(e,t){return t||$(e,8,this.length),Or(this,e,!0,52,8)};c.prototype.readDoubleBE=function(e,t){return t||$(e,8,this.length),Or(this,e,!1,52,8)};c.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t=t|0,n=n|0,!a){var i=Math.pow(2,8*n)-1;G(this,e,t,n,i,0)}var o=1,l=0;for(this[t]=e&255;++l<n&&(o*=256);)this[t+l]=e/o&255;return t+n};c.prototype.writeUIntBE=function(e,t,n,a){if(e=+e,t=t|0,n=n|0,!a){var i=Math.pow(2,8*n)-1;G(this,e,t,n,i,0)}var o=n-1,l=1;for(this[t+o]=e&255;--o>=0&&(l*=256);)this[t+o]=e/l&255;return t+n};c.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Er(this,e,t,!0),t+2};c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Er(this,e,t,!1),t+2};c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Pr(this,e,t,!0),t+4};c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Pr(this,e,t,!1),t+4};c.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*n-1);G(this,e,t,n,i-1,-i)}var o=0,l=1,f=0;for(this[t]=e&255;++o<n&&(l*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/l>>0)-f&255;return t+n};c.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*n-1);G(this,e,t,n,i-1,-i)}var o=n-1,l=1,f=0;for(this[t+o]=e&255;--o>=0&&(l*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/l>>0)-f&255;return t+n};c.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};c.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Er(this,e,t,!0),t+2};c.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Er(this,e,t,!1),t+2};c.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Pr(this,e,t,!0),t+4};c.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Pr(this,e,t,!1),t+4};c.prototype.writeFloatLE=function(e,t,n){return Pi(this,e,t,!0,n)};c.prototype.writeFloatBE=function(e,t,n){return Pi(this,e,t,!1,n)};c.prototype.writeDoubleLE=function(e,t,n){return Ci(this,e,t,!0,n)};c.prototype.writeDoubleBE=function(e,t,n){return Ci(this,e,t,!1,n)};c.prototype.copy=function(e,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-n&&(a=e.length-t+n);var i=a-n,o;if(this===e&&n<t&&t<a)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i};c.prototype.fill=function(e,t,n,a){if(typeof e=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!c.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var l=ie(e)?e:Ir(new c(e,a).toString()),f=l.length;for(o=0;o<n-t;++o)this[o+t]=l[o%f]}return this};fp=/[^+\/0-9A-Za-z-_]/g});var u=xt(()=>{"use strict";Ui()});var qn=x((w0,Bi)=>{"use strict";s();u();Bi.exports=Object});var ji=x((_0,Mi)=>{"use strict";s();u();Mi.exports=Error});var qi=x((R0,$i)=>{"use strict";s();u();$i.exports=EvalError});var Vi=x((I0,Di)=>{"use strict";s();u();Di.exports=RangeError});var zi=x((C0,Wi)=>{"use strict";s();u();Wi.exports=ReferenceError});var Dn=x((L0,Gi)=>{"use strict";s();u();Gi.exports=SyntaxError});var q=x((M0,Zi)=>{"use strict";s();u();Zi.exports=TypeError});var Yi=x((q0,Hi)=>{"use strict";s();u();Hi.exports=URIError});var Vn=x((W0,Ji)=>{"use strict";s();u();Ji.exports=Math.abs});var Wn=x((Z0,Ki)=>{"use strict";s();u();Ki.exports=Math.floor});var Qi=x((J0,Xi)=>{"use strict";s();u();Xi.exports=Math.max});var zn=x((Q0,eo)=>{"use strict";s();u();eo.exports=Math.min});var ro=x((rw,to)=>{"use strict";s();u();to.exports=Math.pow});var ao=x((iw,no)=>{"use strict";s();u();no.exports=Math.round});var Fr=x((uw,io)=>{"use strict";s();u();io.exports=Number.isNaN||function(e){return e!==e}});var so=x((fw,oo)=>{"use strict";s();u();var wp=Fr();oo.exports=function(e){return wp(e)||e===0?e:e<0?-1:1}});var lo=x((mw,uo)=>{"use strict";s();u();uo.exports=Object.getOwnPropertyDescriptor});var Tt=x((gw,co)=>{"use strict";s();u();var Lr=lo();if(Lr)try{Lr([],"length")}catch(r){Lr=null}co.exports=Lr});var zt=x((ww,fo)=>{"use strict";s();u();var Ur=Object.defineProperty||!1;if(Ur)try{Ur({},"a",{value:1})}catch(r){Ur=!1}fo.exports=Ur});var Gn=x((_w,po)=>{"use strict";s();u();po.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(var i in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==a||l.enumerable!==!0)return!1}return!0}});var Zn=x((Rw,ho)=>{"use strict";s();u();var mo=typeof Symbol!="undefined"&&Symbol,bp=Gn();ho.exports=function(){return typeof mo!="function"||typeof Symbol!="function"||typeof mo("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:bp()}});var Hn=x((Iw,yo)=>{"use strict";s();u();yo.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var Yn=x((Cw,go)=>{"use strict";s();u();var Tp=qn();go.exports=Tp.getPrototypeOf||null});var wo=x((Lw,xo)=>{"use strict";s();u();var _p="Function.prototype.bind called on incompatible ",Sp=Object.prototype.toString,Ap=Math.max,Rp="[object Function]",vo=function(e,t){for(var n=[],a=0;a<e.length;a+=1)n[a]=e[a];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},kp=function(e,t){for(var n=[],a=t||0,i=0;a<e.length;a+=1,i+=1)n[i]=e[a];return n},Np=function(r,e){for(var t="",n=0;n<r.length;n+=1)t+=r[n],n+1<r.length&&(t+=e);return t};xo.exports=function(e){var t=this;if(typeof t!="function"||Sp.apply(t)!==Rp)throw new TypeError(_p+t);for(var n=kp(arguments,1),a,i=function(){if(this instanceof a){var y=t.apply(this,vo(n,arguments));return Object(y)===y?y:this}return t.apply(e,vo(n,arguments))},o=Ap(0,t.length-n.length),l=[],f=0;f<o;f++)l[f]="$"+f;if(a=Function("binder","return function ("+Np(l,",")+"){ return binder.apply(this,arguments); }")(i),t.prototype){var d=function(){};d.prototype=t.prototype,a.prototype=new d,d.prototype=null}return a}});var _t=x((Mw,bo)=>{"use strict";s();u();var Ip=wo();bo.exports=Function.prototype.bind||Ip});var Br=x((qw,To)=>{"use strict";s();u();To.exports=Function.prototype.call});var Mr=x((Ww,_o)=>{"use strict";s();u();_o.exports=Function.prototype.apply});var Ao=x((Zw,So)=>{"use strict";s();u();So.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var Jn=x((Jw,Ro)=>{"use strict";s();u();var Ep=_t(),Pp=Mr(),Cp=Br(),Op=Ao();Ro.exports=Op||Ep.call(Cp,Pp)});var jr=x((Qw,ko)=>{"use strict";s();u();var Fp=_t(),Lp=q(),Up=Br(),Bp=Jn();ko.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new Lp("a function is required");return Bp(Fp,Up,e)}});var Oo=x((rb,Co)=>{"use strict";s();u();var Mp=jr(),No=Tt(),Eo;try{Eo=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var Kn=!!Eo&&No&&No(Object.prototype,"__proto__"),Po=Object,Io=Po.getPrototypeOf;Co.exports=Kn&&typeof Kn.get=="function"?Mp([Kn.get]):typeof Io=="function"?function(e){return Io(e==null?e:Po(e))}:!1});var Mo=x((ib,Bo)=>{"use strict";s();u();var Fo=Hn(),Lo=Yn(),Uo=Oo();Bo.exports=Fo?function(e){return Fo(e)}:Lo?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return Lo(e)}:Uo?function(e){return Uo(e)}:null});var Xn=x((ub,jo)=>{"use strict";s();u();var jp=Function.prototype.call,$p=Object.prototype.hasOwnProperty,qp=_t();jo.exports=qp.call(jp,$p)});var oe=x((fb,zo)=>{"use strict";s();u();var P,Dp=qn(),Vp=ji(),Wp=qi(),zp=Vi(),Gp=zi(),kt=Dn(),Rt=q(),Zp=Yi(),Hp=Vn(),Yp=Wn(),Jp=Qi(),Kp=zn(),Xp=ro(),Qp=ao(),ed=so(),Vo=Function,Qn=function(r){try{return Vo('"use strict"; return ('+r+").constructor;")()}catch(e){}},Gt=Tt(),td=zt(),ea=function(){throw new Rt},rd=Gt?(function(){try{return arguments.callee,ea}catch(r){try{return Gt(arguments,"callee").get}catch(e){return ea}}})():ea,St=Zn()(),D=Mo(),nd=Yn(),ad=Hn(),Wo=Mr(),Zt=Br(),At={},id=typeof Uint8Array=="undefined"||!D?P:D(Uint8Array),qe={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?P:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?P:ArrayBuffer,"%ArrayIteratorPrototype%":St&&D?D([][Symbol.iterator]()):P,"%AsyncFromSyncIteratorPrototype%":P,"%AsyncFunction%":At,"%AsyncGenerator%":At,"%AsyncGeneratorFunction%":At,"%AsyncIteratorPrototype%":At,"%Atomics%":typeof Atomics=="undefined"?P:Atomics,"%BigInt%":typeof BigInt=="undefined"?P:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?P:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?P:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?P:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Vp,"%eval%":eval,"%EvalError%":Wp,"%Float16Array%":typeof Float16Array=="undefined"?P:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?P:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?P:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?P:FinalizationRegistry,"%Function%":Vo,"%GeneratorFunction%":At,"%Int8Array%":typeof Int8Array=="undefined"?P:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?P:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?P:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":St&&D?D(D([][Symbol.iterator]())):P,"%JSON%":typeof JSON=="object"?JSON:P,"%Map%":typeof Map=="undefined"?P:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!St||!D?P:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Dp,"%Object.getOwnPropertyDescriptor%":Gt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?P:Promise,"%Proxy%":typeof Proxy=="undefined"?P:Proxy,"%RangeError%":zp,"%ReferenceError%":Gp,"%Reflect%":typeof Reflect=="undefined"?P:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?P:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!St||!D?P:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?P:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":St&&D?D(""[Symbol.iterator]()):P,"%Symbol%":St?Symbol:P,"%SyntaxError%":kt,"%ThrowTypeError%":rd,"%TypedArray%":id,"%TypeError%":Rt,"%Uint8Array%":typeof Uint8Array=="undefined"?P:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?P:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?P:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?P:Uint32Array,"%URIError%":Zp,"%WeakMap%":typeof WeakMap=="undefined"?P:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?P:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?P:WeakSet,"%Function.prototype.call%":Zt,"%Function.prototype.apply%":Wo,"%Object.defineProperty%":td,"%Object.getPrototypeOf%":nd,"%Math.abs%":Hp,"%Math.floor%":Yp,"%Math.max%":Jp,"%Math.min%":Kp,"%Math.pow%":Xp,"%Math.round%":Qp,"%Math.sign%":ed,"%Reflect.getPrototypeOf%":ad};if(D)try{null.error}catch(r){$o=D(D(r)),qe["%Error.prototype%"]=$o}var $o,od=function r(e){var t;if(e==="%AsyncFunction%")t=Qn("async function () {}");else if(e==="%GeneratorFunction%")t=Qn("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Qn("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&D&&(t=D(a.prototype))}return qe[e]=t,t},qo={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ht=_t(),$r=Xn(),sd=Ht.call(Zt,Array.prototype.concat),ud=Ht.call(Wo,Array.prototype.splice),Do=Ht.call(Zt,String.prototype.replace),qr=Ht.call(Zt,String.prototype.slice),ld=Ht.call(Zt,RegExp.prototype.exec),cd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fd=/\\(\\)?/g,pd=function(e){var t=qr(e,0,1),n=qr(e,-1);if(t==="%"&&n!=="%")throw new kt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new kt("invalid intrinsic syntax, expected opening `%`");var a=[];return Do(e,cd,function(i,o,l,f){a[a.length]=l?Do(f,fd,"$1"):o||i}),a},dd=function(e,t){var n=e,a;if($r(qo,n)&&(a=qo[n],n="%"+a[0]+"%"),$r(qe,n)){var i=qe[n];if(i===At&&(i=od(n)),typeof i=="undefined"&&!t)throw new Rt("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:i}}throw new kt("intrinsic "+e+" does not exist!")};zo.exports=function(e,t){if(typeof e!="string"||e.length===0)throw new Rt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Rt('"allowMissing" argument must be a boolean');if(ld(/^%?[^%]*%?$/,e)===null)throw new kt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=pd(e),a=n.length>0?n[0]:"",i=dd("%"+a+"%",t),o=i.name,l=i.value,f=!1,d=i.alias;d&&(a=d[0],ud(n,sd([0,1],d)));for(var y=1,g=!0;y<n.length;y+=1){var _=n[y],E=qr(_,0,1),B=qr(_,-1);if((E==='"'||E==="'"||E==="`"||B==='"'||B==="'"||B==="`")&&E!==B)throw new kt("property names with quotes must have matching quotes");if((_==="constructor"||!g)&&(f=!0),a+="."+_,o="%"+a+"%",$r(qe,o))l=qe[o];else if(l!=null){if(!(_ in l)){if(!t)throw new Rt("base intrinsic for "+e+" exists, but the property is not available.");return}if(Gt&&y+1>=n.length){var j=Gt(l,_);g=!!j,g&&"get"in j&&!("originalValue"in j.get)?l=j.get:l=l[_]}else g=$r(l,_),l=l[_];g&&!f&&(qe[o]=l)}}return l}});var Dr=x((mb,Ho)=>{"use strict";s();u();var Go=zt(),md=Dn(),Nt=q(),Zo=Tt();Ho.exports=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Nt("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Nt("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Nt("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Nt("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Nt("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Nt("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!Zo&&Zo(e,t);if(Go)Go(e,t,{configurable:o===null&&f?f.configurable:!o,enumerable:a===null&&f?f.enumerable:!a,value:n,writable:i===null&&f?f.writable:!i});else if(l||!a&&!i&&!o)e[t]=n;else throw new md("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Vr=x((gb,Jo)=>{"use strict";s();u();var ta=zt(),Yo=function(){return!!ta};Yo.hasArrayLengthDefineBug=function(){if(!ta)return null;try{return ta([],"length",{value:1}).length!==1}catch(e){return!0}};Jo.exports=Yo});var ts=x((wb,es)=>{"use strict";s();u();var hd=oe(),Ko=Dr(),yd=Vr()(),Xo=Tt(),Qo=q(),gd=hd("%Math.floor%");es.exports=function(e,t){if(typeof e!="function")throw new Qo("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||gd(t)!==t)throw new Qo("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,i=!0;if("length"in e&&Xo){var o=Xo(e,"length");o&&!o.configurable&&(a=!1),o&&!o.writable&&(i=!1)}return(a||i||!n)&&(yd?Ko(e,"length",t,!0,!0):Ko(e,"length",t)),e}});var ns=x((_b,rs)=>{"use strict";s();u();var vd=_t(),xd=Mr(),wd=Jn();rs.exports=function(){return wd(vd,xd,arguments)}});var zr=x((Rb,Wr)=>{"use strict";s();u();var bd=ts(),as=zt(),Td=jr(),is=ns();Wr.exports=function(e){var t=Td(arguments),n=e.length-(arguments.length-1);return bd(t,1+(n>0?n:0),!0)};as?as(Wr.exports,"apply",{value:is}):Wr.exports.apply=is});var ra=x((Ib,ss)=>{"use strict";s();u();var os=Object.prototype.toString;ss.exports=function(e){var t=os.call(e),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&os.call(e.callee)==="[object Function]"),n}});var ys=x((Cb,hs)=>{"use strict";s();u();var ms;Object.keys||(Yt=Object.prototype.hasOwnProperty,na=Object.prototype.toString,us=ra(),aa=Object.prototype.propertyIsEnumerable,ls=!aa.call({toString:null},"toString"),cs=aa.call(function(){},"prototype"),Jt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Gr=function(r){var e=r.constructor;return e&&e.prototype===r},fs={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ps=(function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!fs["$"+r]&&Yt.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Gr(window[r])}catch(e){return!0}}catch(e){return!0}return!1})(),ds=function(r){if(typeof window=="undefined"||!ps)return Gr(r);try{return Gr(r)}catch(e){return!1}},ms=function(e){var t=e!==null&&typeof e=="object",n=na.call(e)==="[object Function]",a=us(e),i=t&&na.call(e)==="[object String]",o=[];if(!t&&!n&&!a)throw new TypeError("Object.keys called on a non-object");var l=cs&&n;if(i&&e.length>0&&!Yt.call(e,0))for(var f=0;f<e.length;++f)o.push(String(f));if(a&&e.length>0)for(var d=0;d<e.length;++d)o.push(String(d));else for(var y in e)!(l&&y==="prototype")&&Yt.call(e,y)&&o.push(String(y));if(ls)for(var g=ds(e),_=0;_<Jt.length;++_)!(g&&Jt[_]==="constructor")&&Yt.call(e,Jt[_])&&o.push(Jt[_]);return o});var Yt,na,us,aa,ls,cs,Jt,Gr,fs,ps,ds;hs.exports=ms});var ws=x((Lb,xs)=>{"use strict";s();u();var _d=Array.prototype.slice,Sd=ra(),gs=Object.keys,Zr=gs?function(e){return gs(e)}:ys(),vs=Object.keys;Zr.shim=function(){if(Object.keys){var e=(function(){var t=Object.keys(arguments);return t&&t.length===arguments.length})(1,2);e||(Object.keys=function(n){return Sd(n)?vs(_d.call(n)):vs(n)})}else Object.keys=Zr;return Object.keys||Zr};xs.exports=Zr});var Hr=x((Mb,Ss)=>{"use strict";s();u();var Ad=ws(),Rd=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",kd=Object.prototype.toString,Nd=Array.prototype.concat,bs=Dr(),Id=function(r){return typeof r=="function"&&kd.call(r)==="[object Function]"},Ts=Vr()(),Ed=function(r,e,t,n){if(e in r){if(n===!0){if(r[e]===t)return}else if(!Id(n)||!n())return}Ts?bs(r,e,t,!0):bs(r,e,t)},_s=function(r,e){var t=arguments.length>2?arguments[2]:{},n=Ad(e);Rd&&(n=Nd.call(n,Object.getOwnPropertySymbols(e)));for(var a=0;a<n.length;a+=1)Ed(r,n[a],e[n[a]],t[n[a]])};_s.supportsDescriptors=!!Ts;Ss.exports=_s});var se=x((qb,ks)=>{"use strict";s();u();var As=oe(),Rs=jr(),Pd=Rs([As("%String.prototype.indexOf%")]);ks.exports=function(e,t){var n=As(e,!!t);return typeof n=="function"&&Pd(e,".prototype.")>-1?Rs([n]):n}});var Es=x((Wb,Is)=>{"use strict";s();u();var Cd=oe(),Ns=Cd("%Array%"),Od=!Ns.isArray&&se()("Object.prototype.toString");Is.exports=Ns.isArray||function(e){return Od(e)==="[object Array]"}});var ia=x((Zb,Ps)=>{"use strict";s();u();Ps.exports=Es()});var Os=x((Jb,Cs)=>{"use strict";s();u();var Fd=oe(),Ld=se(),Ud=q(),Bd=ia(),Md=Fd("%Reflect.apply%",!0)||Ld("Function.prototype.apply");Cs.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!Bd(n))throw new Ud("Assertion failed: optional `argumentsList`, if provided, must be a List");return Md(e,t,n)}});function Fs(){throw new Error("setTimeout has not been defined")}function Ls(){throw new Error("clearTimeout has not been defined")}function Us(r){if(Ne===setTimeout)return setTimeout(r,0);if((Ne===Fs||!Ne)&&setTimeout)return Ne=setTimeout,setTimeout(r,0);try{return Ne(r,0)}catch(e){try{return Ne.call(null,r,0)}catch(t){return Ne.call(this,r,0)}}}function jd(r){if(Ie===clearTimeout)return clearTimeout(r);if((Ie===Ls||!Ie)&&clearTimeout)return Ie=clearTimeout,clearTimeout(r);try{return Ie(r)}catch(e){try{return Ie.call(null,r)}catch(t){return Ie.call(this,r)}}}function $d(){!Et||!De||(Et=!1,De.length?ge=De.concat(ge):Yr=-1,ge.length&&Bs())}function Bs(){if(!Et){var r=Us($d);Et=!0;for(var e=ge.length;e;){for(De=ge,ge=[];++Yr<e;)De&&De[Yr].run();Yr=-1,e=ge.length}De=null,Et=!1,jd(r)}}function qd(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ge.push(new Ms(r,e)),ge.length===1&&!Et&&Us(Bs)}function Ms(r,e){this.fun=r,this.array=e}function Ve(){}function am(r){throw new Error("process.binding is not supported")}function im(){return"/"}function om(r){throw new Error("process.chdir is not supported")}function sm(){return 0}function lm(r){var e=um.call(It)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}function fm(){var r=new Date,e=r-cm;return e/1e3}var Ne,Ie,ge,Et,De,Yr,Dd,Vd,Wd,zd,Gd,Zd,Hd,Yd,Jd,Kd,Xd,Qd,em,tm,rm,nm,It,um,cm,pm,Kt,js=xt(()=>{"use strict";s();u();Ne=Fs,Ie=Ls;typeof globalThis.setTimeout=="function"&&(Ne=setTimeout);typeof globalThis.clearTimeout=="function"&&(Ie=clearTimeout);ge=[],Et=!1,Yr=-1;Ms.prototype.run=function(){this.fun.apply(null,this.array)};Dd="browser",Vd="browser",Wd=!0,zd={},Gd=[],Zd="",Hd={},Yd={},Jd={};Kd=Ve,Xd=Ve,Qd=Ve,em=Ve,tm=Ve,rm=Ve,nm=Ve;It=globalThis.performance||{},um=It.now||It.mozNow||It.msNow||It.oNow||It.webkitNow||function(){return new Date().getTime()};cm=new Date;pm={nextTick:qd,title:Dd,browser:Wd,env:zd,argv:Gd,version:Zd,versions:Hd,on:Kd,addListener:Xd,once:Qd,off:em,removeListener:tm,removeAllListeners:rm,emit:nm,binding:am,cwd:im,chdir:om,umask:sm,hrtime:lm,platform:Vd,release:Yd,config:Jd,uptime:fm},Kt=pm});var oa,sa,$s=xt(()=>{"use strict";s();u();typeof Object.create=="function"?oa=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:oa=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};sa=oa});var Hs={};Rr(Hs,{_extend:()=>ya,debuglog:()=>qs,default:()=>Tm,deprecate:()=>pa,format:()=>Qr,inherits:()=>sa,inspect:()=>le,isArray:()=>da,isBoolean:()=>en,isBuffer:()=>zs,isDate:()=>Xr,isError:()=>Qt,isFunction:()=>er,isNull:()=>tr,isNullOrUndefined:()=>Ds,isNumber:()=>ma,isObject:()=>We,isPrimitive:()=>Ws,isRegExp:()=>Xt,isString:()=>rr,isSymbol:()=>Vs,isUndefined:()=>ue,log:()=>Gs});function Qr(r){if(!rr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(le(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,a=n.length,i=String(r).replace(dm,function(l){if(l==="%%")return"%";if(t>=a)return l;switch(l){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(f){return"[Circular]"}default:return l}}),o=n[t];t<a;o=n[++t])tr(o)||!We(o)?i+=" "+o:i+=" "+le(o);return i}function pa(r,e){if(ue(globalThis.process))return function(){return pa(r,e).apply(this,arguments)};if(Kt.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Kt.throwDeprecation)throw new Error(e);Kt.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}function qs(r){if(ue(ua)&&(ua=Kt.env.NODE_DEBUG||""),r=r.toUpperCase(),!Jr[r])if(new RegExp("\\b"+r+"\\b","i").test(ua)){var e=0;Jr[r]=function(){var t=Qr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else Jr[r]=function(){};return Jr[r]}function le(r,e){var t={seen:[],stylize:hm};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),en(e)?t.showHidden=e:e&&ya(t,e),ue(t.showHidden)&&(t.showHidden=!1),ue(t.depth)&&(t.depth=2),ue(t.colors)&&(t.colors=!1),ue(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=mm),Kr(t,r,t.depth)}function mm(r,e){var t=le.styles[e];return t?"\x1B["+le.colors[t][0]+"m"+r+"\x1B["+le.colors[t][1]+"m":r}function hm(r,e){return r}function ym(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function Kr(r,e,t){if(r.customInspect&&e&&er(e.inspect)&&e.inspect!==le&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return rr(n)||(n=Kr(r,n,t)),n}var a=gm(r,e);if(a)return a;var i=Object.keys(e),o=ym(i);if(r.showHidden&&(i=Object.getOwnPropertyNames(e)),Qt(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return la(e);if(i.length===0){if(er(e)){var l=e.name?": "+e.name:"";return r.stylize("[Function"+l+"]","special")}if(Xt(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Xr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(Qt(e))return la(e)}var f="",d=!1,y=["{","}"];if(da(e)&&(d=!0,y=["[","]"]),er(e)){var g=e.name?": "+e.name:"";f=" [Function"+g+"]"}if(Xt(e)&&(f=" "+RegExp.prototype.toString.call(e)),Xr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Qt(e)&&(f=" "+la(e)),i.length===0&&(!d||e.length==0))return y[0]+f+y[1];if(t<0)return Xt(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var _;return d?_=vm(r,e,t,o,i):_=i.map(function(E){return fa(r,e,t,o,E,d)}),r.seen.pop(),xm(_,f,y)}function gm(r,e){if(ue(e))return r.stylize("undefined","undefined");if(rr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(ma(e))return r.stylize(""+e,"number");if(en(e))return r.stylize(""+e,"boolean");if(tr(e))return r.stylize("null","null")}function la(r){return"["+Error.prototype.toString.call(r)+"]"}function vm(r,e,t,n,a){for(var i=[],o=0,l=e.length;o<l;++o)Zs(e,String(o))?i.push(fa(r,e,t,n,String(o),!0)):i.push("");return a.forEach(function(f){f.match(/^\d+$/)||i.push(fa(r,e,t,n,f,!0))}),i}function fa(r,e,t,n,a,i){var o,l,f;if(f=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]},f.get?f.set?l=r.stylize("[Getter/Setter]","special"):l=r.stylize("[Getter]","special"):f.set&&(l=r.stylize("[Setter]","special")),Zs(n,a)||(o="["+a+"]"),l||(r.seen.indexOf(f.value)<0?(tr(t)?l=Kr(r,f.value,null):l=Kr(r,f.value,t-1),l.indexOf(`
2
- `)>-1&&(i?l=l.split(`
3
- `).map(function(d){return" "+d}).join(`
4
- `).substr(2):l=`
5
- `+l.split(`
6
- `).map(function(d){return" "+d}).join(`
7
- `))):l=r.stylize("[Circular]","special")),ue(o)){if(i&&a.match(/^\d+$/))return l;o=JSON.stringify(""+a),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+l}function xm(r,e,t){var n=0,a=r.reduce(function(i,o){return n++,o.indexOf(`
8
- `)>=0&&n++,i+o.replace(/\u001b\[\d\d?m/g,"").length+1},0);return a>60?t[0]+(e===""?"":e+`
9
- `)+" "+r.join(`,
10
- `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function da(r){return Array.isArray(r)}function en(r){return typeof r=="boolean"}function tr(r){return r===null}function Ds(r){return r==null}function ma(r){return typeof r=="number"}function rr(r){return typeof r=="string"}function Vs(r){return typeof r=="symbol"}function ue(r){return r===void 0}function Xt(r){return We(r)&&ha(r)==="[object RegExp]"}function We(r){return typeof r=="object"&&r!==null}function Xr(r){return We(r)&&ha(r)==="[object Date]"}function Qt(r){return We(r)&&(ha(r)==="[object Error]"||r instanceof Error)}function er(r){return typeof r=="function"}function Ws(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r=="undefined"}function zs(r){return c.isBuffer(r)}function ha(r){return Object.prototype.toString.call(r)}function ca(r){return r<10?"0"+r.toString(10):r.toString(10)}function bm(){var r=new Date,e=[ca(r.getHours()),ca(r.getMinutes()),ca(r.getSeconds())].join(":");return[r.getDate(),wm[r.getMonth()],e].join(" ")}function Gs(){console.log("%s - %s",bm(),Qr.apply(null,arguments))}function ya(r,e){if(!e||!We(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Zs(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var dm,Jr,ua,wm,Tm,Ys=xt(()=>{"use strict";s();u();js();$s();dm=/%[sdj%]/g;Jr={};le.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};le.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};wm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Tm={inherits:sa,_extend:ya,log:Gs,isBuffer:zs,isPrimitive:Ws,isFunction:er,isError:Qt,isDate:Xr,isObject:We,isRegExp:Xt,isUndefined:ue,isSymbol:Vs,isString:rr,isNumber:ma,isNullOrUndefined:Ds,isNull:tr,isBoolean:en,isArray:da,inspect:le,deprecate:pa,format:Qr,debuglog:qs}});var Js=x((lT,tn)=>{"use strict";s();u();var ze=(Ys(),di(Hs));if(ze&&ze.default){tn.exports=ze.default;for(let r in ze)tn.exports[r]=ze[r]}else ze&&(tn.exports=ze)});var Xs=x((pT,Ks)=>{"use strict";s();u();Ks.exports=Js().inspect});var sr=x((hT,vu)=>{"use strict";s();u();var Ra=typeof Map=="function"&&Map.prototype,ga=Object.getOwnPropertyDescriptor&&Ra?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,nn=Ra&&ga&&typeof ga.get=="function"?ga.get:null,Qs=Ra&&Map.prototype.forEach,ka=typeof Set=="function"&&Set.prototype,va=Object.getOwnPropertyDescriptor&&ka?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,an=ka&&va&&typeof va.get=="function"?va.get:null,eu=ka&&Set.prototype.forEach,_m=typeof WeakMap=="function"&&WeakMap.prototype,ar=_m?WeakMap.prototype.has:null,Sm=typeof WeakSet=="function"&&WeakSet.prototype,ir=Sm?WeakSet.prototype.has:null,Am=typeof WeakRef=="function"&&WeakRef.prototype,tu=Am?WeakRef.prototype.deref:null,Rm=Boolean.prototype.valueOf,km=Object.prototype.toString,Nm=Function.prototype.toString,Im=String.prototype.match,Na=String.prototype.slice,Ee=String.prototype.replace,Em=String.prototype.toUpperCase,ru=String.prototype.toLowerCase,fu=RegExp.prototype.test,nu=Array.prototype.concat,ce=Array.prototype.join,Pm=Array.prototype.slice,au=Math.floor,ba=typeof BigInt=="function"?BigInt.prototype.valueOf:null,xa=Object.getOwnPropertySymbols,Ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="object",or=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Pt||!0)?Symbol.toStringTag:null,pu=Object.prototype.propertyIsEnumerable,iu=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ou(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||fu.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-au(-r):au(r);if(n!==r){var a=String(n),i=Na.call(e,a.length+1);return Ee.call(a,t,"$&_")+"."+Ee.call(Ee.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(e,t,"$&_")}var _a=Xs(),su=_a.custom,uu=hu(su)?su:null,du={__proto__:null,double:'"',single:"'"},Cm={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};vu.exports=function r(e,t,n,a){var i=t||{};if(ve(i,"quoteStyle")&&!ve(du,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=ve(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ve(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ve(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return gu(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return l?ou(e,f):f}if(typeof e=="bigint"){var d=String(e)+"n";return l?ou(e,d):d}var y=typeof i.depth=="undefined"?5:i.depth;if(typeof n=="undefined"&&(n=0),n>=y&&y>0&&typeof e=="object")return Sa(e)?"[Array]":"[Object]";var g=Jm(i,n);if(typeof a=="undefined")a=[];else if(yu(a,e)>=0)return"[Circular]";function _(vt,Sr,cf){if(Sr&&(a=Pm.call(a),a.push(Sr)),cf){var ui={depth:i.depth};return ve(i,"quoteStyle")&&(ui.quoteStyle=i.quoteStyle),r(vt,ui,n+1,a)}return r(vt,i,n+1,a)}if(typeof e=="function"&&!lu(e)){var E=qm(e),B=rn(e,_);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(B.length>0?" { "+ce.call(B,", ")+" }":"")}if(hu(e)){var j=Pt?Ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ta.call(e);return typeof e=="object"&&!Pt?nr(j):j}if(Zm(e)){for(var z="<"+ru.call(String(e.nodeName)),J=e.attributes||[],me=0;me<J.length;me++)z+=" "+J[me].name+"="+mu(Om(J[me].value),"double",i);return z+=">",e.childNodes&&e.childNodes.length&&(z+="..."),z+="</"+ru.call(String(e.nodeName))+">",z}if(Sa(e)){if(e.length===0)return"[]";var Be=rn(e,_);return g&&!Ym(Be)?"["+Aa(Be,g)+"]":"[ "+ce.call(Be,", ")+" ]"}if(Lm(e)){var Vt=rn(e,_);return!("cause"in Error.prototype)&&"cause"in e&&!pu.call(e,"cause")?"{ ["+String(e)+"] "+ce.call(nu.call("[cause]: "+_(e.cause),Vt),", ")+" }":Vt.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ce.call(Vt,", ")+" }"}if(typeof e=="object"&&o){if(uu&&typeof e[uu]=="function"&&_a)return _a(e,{depth:y-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Dm(e)){var _r=[];return Qs&&Qs.call(e,function(vt,Sr){_r.push(_(Sr,e,!0)+" => "+_(vt,e))}),cu("Map",nn.call(e),_r,g)}if(zm(e)){var ii=[];return eu&&eu.call(e,function(vt){ii.push(_(vt,e))}),cu("Set",an.call(e),ii,g)}if(Vm(e))return wa("WeakMap");if(Gm(e))return wa("WeakSet");if(Wm(e))return wa("WeakRef");if(Bm(e))return nr(_(Number(e)));if(jm(e))return nr(_(ba.call(e)));if(Mm(e))return nr(Rm.call(e));if(Um(e))return nr(_(String(e)));if(typeof window!="undefined"&&e===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&e===globalThis||typeof globalThis!="undefined"&&e===globalThis)return"{ [object globalThis] }";if(!Fm(e)&&!lu(e)){var Cn=rn(e,_),oi=iu?iu(e)===Object.prototype:e instanceof Object||e.constructor===Object,On=e instanceof Object?"":"null prototype",si=!oi&&or&&Object(e)===e&&or in e?Na.call(Pe(e),8,-1):On?"Object":"",lf=oi||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Fn=lf+(si||On?"["+ce.call(nu.call([],si||[],On||[]),": ")+"] ":"");return Cn.length===0?Fn+"{}":g?Fn+"{"+Aa(Cn,g)+"}":Fn+"{ "+ce.call(Cn,", ")+" }"}return String(e)};function mu(r,e,t){var n=t.quoteStyle||e,a=du[n];return a+r+a}function Om(r){return Ee.call(String(r),/"/g,"&quot;")}function Ge(r){return!or||!(typeof r=="object"&&(or in r||typeof r[or]!="undefined"))}function Sa(r){return Pe(r)==="[object Array]"&&Ge(r)}function Fm(r){return Pe(r)==="[object Date]"&&Ge(r)}function lu(r){return Pe(r)==="[object RegExp]"&&Ge(r)}function Lm(r){return Pe(r)==="[object Error]"&&Ge(r)}function Um(r){return Pe(r)==="[object String]"&&Ge(r)}function Bm(r){return Pe(r)==="[object Number]"&&Ge(r)}function Mm(r){return Pe(r)==="[object Boolean]"&&Ge(r)}function hu(r){if(Pt)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Ta)return!1;try{return Ta.call(r),!0}catch(e){}return!1}function jm(r){if(!r||typeof r!="object"||!ba)return!1;try{return ba.call(r),!0}catch(e){}return!1}var $m=Object.prototype.hasOwnProperty||function(r){return r in this};function ve(r,e){return $m.call(r,e)}function Pe(r){return km.call(r)}function qm(r){if(r.name)return r.name;var e=Im.call(Nm.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function yu(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Dm(r){if(!nn||!r||typeof r!="object")return!1;try{nn.call(r);try{an.call(r)}catch(e){return!0}return r instanceof Map}catch(e){}return!1}function Vm(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{ir.call(r,ir)}catch(e){return!0}return r instanceof WeakMap}catch(e){}return!1}function Wm(r){if(!tu||!r||typeof r!="object")return!1;try{return tu.call(r),!0}catch(e){}return!1}function zm(r){if(!an||!r||typeof r!="object")return!1;try{an.call(r);try{nn.call(r)}catch(e){return!0}return r instanceof Set}catch(e){}return!1}function Gm(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{ar.call(r,ar)}catch(e){return!0}return r instanceof WeakSet}catch(e){}return!1}function Zm(r){return!r||typeof r!="object"?!1:typeof HTMLElement!="undefined"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function gu(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return gu(Na.call(r,0,e.maxStringLength),e)+n}var a=Cm[e.quoteStyle||"single"];a.lastIndex=0;var i=Ee.call(Ee.call(r,a,"\\$1"),/[\x00-\x1f]/g,Hm);return mu(i,"single",e)}function Hm(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Em.call(e.toString(16))}function nr(r){return"Object("+r+")"}function wa(r){return r+" { ? }"}function cu(r,e,t,n){var a=n?Aa(t,n):ce.call(t,", ");return r+" ("+e+") {"+a+"}"}function Ym(r){for(var e=0;e<r.length;e++)if(yu(r[e],`
11
- `)>=0)return!1;return!0}function Jm(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=ce.call(Array(r.indent+1)," ");else return null;return{base:t,prev:ce.call(Array(e+1),t)}}function Aa(r,e){if(r.length===0)return"";var t=`
12
- `+e.prev+e.base;return t+ce.call(r,","+t)+`
13
- `+e.prev}function rn(r,e){var t=Sa(r),n=[];if(t){n.length=r.length;for(var a=0;a<r.length;a++)n[a]=ve(r,a)?e(r[a],r):""}var i=typeof xa=="function"?xa(r):[],o;if(Pt){o={};for(var l=0;l<i.length;l++)o["$"+i[l]]=i[l]}for(var f in r)ve(r,f)&&(t&&String(Number(f))===f&&f<r.length||Pt&&o["$"+f]instanceof Symbol||(fu.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof xa=="function")for(var d=0;d<i.length;d++)pu.call(r,i[d])&&n.push("["+e(i[d])+"]: "+e(r[i[d]],r));return n}});var on=x((vT,xu)=>{"use strict";s();u();xu.exports=function(e){return typeof e=="string"||typeof e=="symbol"}});var bu=x((bT,wu)=>{"use strict";s();u();var Km=q(),Xm=sr(),Qm=on();wu.exports=function(e,t){if(!Qm(t))throw new Km("Assertion failed: P is not a Property Key, got "+Xm(t));return e[t]}});var Au=x((ST,Su)=>{"use strict";s();u();var _u=Function.prototype.toString,Ct=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ea,sn;if(typeof Ct=="function"&&typeof Object.defineProperty=="function")try{Ea=Object.defineProperty({},"length",{get:function(){throw sn}}),sn={},Ct(function(){throw 42},null,Ea)}catch(r){r!==sn&&(Ct=null)}else Ct=null;var eh=/^\s*class\b/,Pa=function(e){try{var t=_u.call(e);return eh.test(t)}catch(n){return!1}},Ia=function(e){try{return Pa(e)?!1:(_u.call(e),!0)}catch(t){return!1}},un=Object.prototype.toString,th="[object Object]",rh="[object Function]",nh="[object GeneratorFunction]",ah="[object HTMLAllCollection]",ih="[object HTML document.all class]",oh="[object HTMLCollection]",sh=typeof Symbol=="function"&&!!Symbol.toStringTag,uh=!(0 in[,]),Ca=function(){return!1};typeof document=="object"&&(Tu=document.all,un.call(Tu)===un.call(document.all)&&(Ca=function(e){if((uh||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var t=un.call(e);return(t===ah||t===ih||t===oh||t===th)&&e("")==null}catch(n){}return!1}));var Tu;Su.exports=Ct?function(e){if(Ca(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Ct(e,null,Ea)}catch(t){if(t!==sn)return!1}return!Pa(e)&&Ia(e)}:function(e){if(Ca(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(sh)return Ia(e);if(Pa(e))return!1;var t=un.call(e);return t!==rh&&t!==nh&&!/^\[object HTML/.test(t)?!1:Ia(e)}});var Oa=x((kT,Ru)=>{"use strict";s();u();Ru.exports=Au()});var Eu=x((ET,Iu)=>{"use strict";s();u();var ku=q(),lh=bu(),ch=Oa(),fh=on(),Nu=sr();Iu.exports=function(e,t){if(!fh(t))throw new ku("Assertion failed: P is not a Property Key");var n=lh(e,t);if(n!=null){if(!ch(n))throw new ku(Nu(t)+" is not a function: "+Nu(n));return n}}});var Cu=x((OT,Pu)=>{"use strict";s();u();var ph=Fr();Pu.exports=function(e){return(typeof e=="number"||typeof e=="bigint")&&!ph(e)&&e!==1/0&&e!==-1/0}});var ln=x((UT,Ou)=>{"use strict";s();u();var dh=Vn(),mh=Wn(),hh=Fr(),yh=Cu();Ou.exports=function(e){if(typeof e!="number"||hh(e)||!yh(e))return!1;var t=dh(e);return mh(t)===t}});var Fa=x((jT,Fu)=>{"use strict";s();u();Fu.exports=function(e){return!!e&&(typeof e=="function"||typeof e=="object")}});var Uu=x((DT,Lu)=>{"use strict";s();u();var gh=Gn();Lu.exports=function(){return gh()&&!!Symbol.toStringTag}});var Ma=x((zT,qu)=>{"use strict";s();u();var Bu=se(),vh=Uu()(),xh=Xn(),wh=Tt(),Ba;vh?(Mu=Bu("RegExp.prototype.exec"),La={},cn=function(){throw La},Ua={toString:cn,valueOf:cn},typeof Symbol.toPrimitive=="symbol"&&(Ua[Symbol.toPrimitive]=cn),Ba=function(e){if(!e||typeof e!="object")return!1;var t=wh(e,"lastIndex"),n=t&&xh(t,"value");if(!n)return!1;try{Mu(e,Ua)}catch(a){return a===La}}):(ju=Bu("Object.prototype.toString"),$u="[object RegExp]",Ba=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:ju(e)===$u});var Mu,La,cn,Ua,ju,$u;qu.exports=Ba});var ja=x((HT,Du)=>{"use strict";s();u();var bh=se(),Th=Ma(),_h=bh("RegExp.prototype.exec"),Sh=q();Du.exports=function(e){if(!Th(e))throw new Sh("`regex` must be a RegExp");return function(n){return _h(e,n)!==null}}});var zu=x((KT,Wu)=>{"use strict";s();u();var Vu=q(),Ah=sr(),Rh=on(),kh=Fa();Wu.exports=function(e,t){if(!kh(e))throw new Vu("Assertion failed: Type(O) is not Object");if(!Rh(t))throw new Vu("Assertion failed: P is not a Property Key, got "+Ah(t));return e[t]}});var Zu=x((e_,Gu)=>{"use strict";s();u();Gu.exports=zn()});var qa=x((n_,Hu)=>{"use strict";s();u();var Nh=se(),$a=q(),Ih=ln(),Eh=Nh("String.prototype.slice");Hu.exports=function(e,t,n){if(typeof e!="string")throw new $a("Assertion failed: `string` must be a String");if(typeof t!="string")throw new $a("Assertion failed: `searchValue` must be a String");if(!Ih(n)||n<0)throw new $a("Assertion failed: `fromIndex` must be a non-negative integer");var a=e.length;if(t===""&&n<=a)return n;for(var i=t.length,o=n;o<=a-i;o+=1){var l=Eh(e,o,o+i);if(l===t)return o}return"NOT-FOUND"}});var fn=x((o_,Yu)=>{"use strict";s();u();var Ph=q();Yu.exports=function(e){if(e==null)throw new Ph(arguments.length>0&&arguments[1]||"Cannot call method on "+e);return e}});var Ku=x((l_,Ju)=>{"use strict";s();u();var Ch=oe(),Oh=Ch("%String%"),Fh=q();Ju.exports=function(e){if(typeof e=="symbol")throw new Fh("Cannot convert a Symbol value to a string");return Oh(e)}});var Da=x((p_,el)=>{"use strict";s();u();var Lh=fn(),Uh=Ku(),Bh=se(),Xu=Bh("String.prototype.replace"),Qu=/^\s$/.test("\u180E"),Mh=Qu?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,jh=Qu?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;el.exports=function(){var e=Uh(Lh(this));return Xu(Xu(e,Mh,""),jh,"")}});var Va=x((h_,rl)=>{"use strict";s();u();var $h=Da(),tl="\u200B",Ot="\u180E";rl.exports=function(){return String.prototype.trim&&tl.trim()===tl&&Ot.trim()===Ot&&("_"+Ot).trim()==="_"+Ot&&(Ot+"_").trim()===Ot+"_"?String.prototype.trim:$h}});var il=x((v_,al)=>{"use strict";s();u();var qh=Vr()(),nl=Dr(),Dh=Va();al.exports=function(){var e=Dh();return String.prototype.trim!==e&&(qh?nl(String.prototype,"trim",e,!0):nl(String.prototype,"trim",e)),e}});var ll=x((b_,ul)=>{"use strict";s();u();var Vh=zr(),Wh=Hr(),zh=fn(),Gh=Da(),ol=Va(),Zh=il(),Hh=Vh(ol()),sl=function(e){return zh(e),Hh(e)};Wh(sl,{getPolyfill:ol,implementation:Gh,shim:Zh});ul.exports=sl});var ml=x((S_,dl)=>{"use strict";s();u();var pl=oe(),Yh=pl("%RegExp%"),Jh=q(),cl=pl("%parseInt%"),Kh=se(),pn=ja(),fl=Kh("String.prototype.slice"),Xh=pn(/^0b[01]+$/i),Qh=pn(/^0o[0-7]+$/i),ey=pn(/^[-+]0x[0-9a-f]+$/i),ty=["\x85","\u200B","\uFFFE"].join(""),ry=new Yh("["+ty+"]","g"),ny=pn(ry),ay=ll();dl.exports=function r(e){if(typeof e!="string")throw new Jh("Assertion failed: `argument` is not a String");if(Xh(e))return+cl(fl(e,2),2);if(Qh(e))return+cl(fl(e,2),8);if(ny(e)||ey(e))return NaN;var t=ay(e);return t!==e?r(t):+e}});var gl=x((k_,yl)=>{"use strict";s();u();var iy=q(),hl=ln(),oy=se(),sy=oy("String.prototype.slice");yl.exports=function(e,t,n){if(typeof e!="string"||!hl(t)||arguments.length>2&&!hl(n))throw new iy("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return sy(e,t,arguments.length>2?n:e.length)}});var Wa=x((E_,vl)=>{"use strict";s();u();var uy=oe(),ly=uy("%String%"),cy=q();vl.exports=function(e){if(typeof e=="symbol")throw new cy("Cannot convert a Symbol value to a string");return ly(e)}});var wl=x((O_,xl)=>{"use strict";s();u();xl.exports=function(e,t){for(var n=0;n<e.length;n+=1)if(!t(e[n],n,e))return!1;return!0}});var Tl=x((U_,bl)=>{"use strict";s();u();var fy=se()("String.prototype.slice");bl.exports=function(e,t){return e===t?!0:e.length>t.length?!1:fy(t,0,e.length)===e}});var Sl=x((j_,_l)=>{"use strict";s();u();_l.exports=function(e){return typeof e=="string"||typeof e=="undefined"}});var Il=x((D_,Nl)=>{"use strict";s();u();var xe=q(),za=sr(),py=ln(),Al=Fa(),kl=ja(),dy=zu(),my=ia(),hy=Zu(),yy=qa(),Rl=ml(),we=gl(),gy=Wa(),vy=wl(),ur=Tl(),xy=Sl(),wy=kl(/^\$[0-9]/),by=kl(/^\$[0-9][0-9]/);Nl.exports=function(e,t,n,a,i,o){if(typeof e!="string")throw new xe("Assertion failed: `matched` must be a String");if(typeof t!="string")throw new xe("Assertion failed: `str` must be a String");if(!py(n)||n<0)throw new xe("Assertion failed: `position` must be a nonnegative integer, got "+za(n));if(!my(a)||!vy(a,xy))throw new xe("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+za(a));if(typeof i!="undefined"&&!Al(i))throw new xe("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof o!="string")throw new xe("Assertion failed: `replacementTemplate` must be a String");var l=t.length;if(n>l)throw new xe("Assertion failed: position > stringLength, got "+za(n));for(var f=o,d="";f!=="";){var y,g,_;if(ur("$$",f))y="$$",g="$";else if(ur("$`",f))y="$`",g=we(t,0,n);else if(ur("$&",f))y="$&",g=e;else if(ur("$'",f)){y="$'";var E=e.length,B=n+E;g=we(t,hy(B,l))}else if(wy(f)){var j=by(f)?2:1,z=we(f,1,1+j),J=Rl(z);if(J<0||J>99)throw new xe("Assertion failed: `index` must be >= 0 and <= 99");var me=a.length;J>me&&j===2&&(j=1,z=we(z,0,1),J=Rl(z)),y=we(f,0,1+j),1<=J&&J<=me?(_=a[J-1],typeof _=="undefined"?g="":g=_):g=y}else if(ur("$<",f)){var Be=yy(f,">",0);if(!(Be>-1)||typeof i=="undefined")y="$<",g=y;else{y=we(f,0,Be+1);var Vt=we(f,2,Be);if(!Al(i))throw new xe("Assertion failed: Type(namedCaptures) is not Object");_=dy(i,Vt),typeof _=="undefined"?g="":g=gy(_)}}else y=we(f,0,1),g=y;var _r=y.length;f=we(f,_r),d+=g}return d}});var Ol=x((z_,Cl)=>{"use strict";s();u();var El=oe(),Pl=zr(),Ty=Pl(El("String.prototype.indexOf"));Cl.exports=function(e,t){var n=El(e,!!t);return typeof n=="function"&&Ty(e,".prototype.")>-1?Pl(n):n}});var Za=x((H_,Bl)=>{"use strict";s();u();var Fl=Os(),_y=Eu(),Sy=Il(),Ay=Oa(),Ry=fn(),dn=Wa(),Ll=qa(),ky=oe(),mn=Ol(),Ny=Zn()(),Iy=Ma(),Ey=ky("%Math.max%"),Ul=q(),Py=mn("Array.prototype.push"),Ga=mn("String.prototype.slice"),Cy=mn("String.prototype.indexOf"),Oy=mn("String.prototype.replace");Bl.exports=function(e,t){var n=Ry(this),a=Iy(e);if(a&&Cy(Ga(e,e.source.length+2),"g")===-1)throw new Ul("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(Ny&&Symbol.replace){if(e!=null){var i=_y(e,Symbol.replace);if(typeof i!="undefined")return Fl(i,e,[n,t])}}else if(a)return Oy(n,e,t);var o=dn(n),l=dn(e),f=Ay(t);f||(t=dn(t));for(var d=l.length,y=Ey(1,d),g=[],_=Ll(o,l,0);_!=="NOT-FOUND";)Py(g,_),_=Ll(o,l,_+y);for(var E=0,B="",j=0;j<g.length;j+=1){var z;if(f)z=dn(Fl(t,void 0,[l,g[j],o]));else{if(typeof t!="string")throw new Ul("Assertion failed: `replaceValue` should be a string at this point");var J=[];z=Sy(l,o,g[j],J,void 0,t)}var me=Ga(o,E,g[j]);B+=me+z,E=g[j]+d}return E<o.length&&(B+=Ga(o,E)),B}});var Ha=x((K_,Ml)=>{"use strict";s();u();var Fy=Za();Ml.exports=function(){return String.prototype.replaceAll||Fy}});var $l=x((eS,jl)=>{"use strict";s();u();var Ly=Hr(),Uy=Ha();jl.exports=function(){var e=Uy();return Ly(String.prototype,{replaceAll:e},{replaceAll:function(){return String.prototype.replaceAll!==e}}),e}});var Wl=x((nS,Vl)=>{"use strict";s();u();var By=zr(),My=Hr(),ql=Za(),jy=Ha(),$y=$l(),Dl=By(ql);My(Dl,{getPolyfill:jy,implementation:ql,shim:$y});Vl.exports=Dl});var p0={};Rr(p0,{DynamicSnippetsGenerator:()=>Pn});module.exports=di(p0);s();u();var aP=gf(Wl(),1);s();u();s();u();s();u();function O(r){throw new Error("Unexpected value: "+JSON.stringify(r))}s();u();s();u();s();u();s();u();s();u();s();u();var qy=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,zl=qy;var Dy=typeof self=="object"&&self&&self.Object===Object&&self,Vy=zl||Dy||Function("return this")(),Gl=Vy;var Wy=Gl.Symbol,be=Wy;s();u();var Zl=Object.prototype,zy=Zl.hasOwnProperty,Gy=Zl.toString,lr=be?be.toStringTag:void 0;function Zy(r){var e=zy.call(r,lr),t=r[lr];try{r[lr]=void 0;var n=!0}catch(i){}var a=Gy.call(r);return n&&(e?r[lr]=t:delete r[lr]),a}var Hl=Zy;s();u();var Hy=Object.prototype,Yy=Hy.toString;function Jy(r){return Yy.call(r)}var Yl=Jy;var Ky="[object Null]",Xy="[object Undefined]",Jl=be?be.toStringTag:void 0;function Qy(r){return r==null?r===void 0?Xy:Ky:Jl&&Jl in Object(r)?Hl(r):Yl(r)}var Kl=Qy;s();u();function eg(r){return r!=null&&typeof r=="object"}var Xl=eg;var tg="[object Symbol]";function rg(r){return typeof r=="symbol"||Xl(r)&&Kl(r)==tg}var Ql=rg;s();u();s();u();function ng(r,e){for(var t=-1,n=r==null?0:r.length,a=Array(n);++t<n;)a[t]=e(r[t],t,r);return a}var ec=ng;s();u();var ag=Array.isArray,tc=ag;var ig=1/0,rc=be?be.prototype:void 0,nc=rc?rc.toString:void 0;function ac(r){if(typeof r=="string")return r;if(tc(r))return ec(r,ac)+"";if(Ql(r))return nc?nc.call(r):"";var e=r+"";return e=="0"&&1/r==-ig?"-0":e}var ic=ac;s();u();function og(r){return r==null?"":ic(r)}var Ce=og;s();u();s();u();s();u();s();u();s();u();s();u();function sg(r,e,t){var n=-1,a=r.length;e<0&&(e=-e>a?0:a+e),t=t>a?a:t,t<0&&(t+=a),a=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(a);++n<a;)i[n]=r[n+e];return i}var oc=sg;function ug(r,e,t){var n=r.length;return t=t===void 0?n:t,!e&&t>=n?r:oc(r,e,t)}var sc=ug;s();u();var lg="\\ud800-\\udfff",cg="\\u0300-\\u036f",fg="\\ufe20-\\ufe2f",pg="\\u20d0-\\u20ff",dg=cg+fg+pg,mg="\\ufe0e\\ufe0f",hg="\\u200d",yg=RegExp("["+hg+lg+dg+mg+"]");function gg(r){return yg.test(r)}var hn=gg;s();u();s();u();function vg(r){return r.split("")}var uc=vg;s();u();var lc="\\ud800-\\udfff",xg="\\u0300-\\u036f",wg="\\ufe20-\\ufe2f",bg="\\u20d0-\\u20ff",Tg=xg+wg+bg,_g="\\ufe0e\\ufe0f",Sg="["+lc+"]",Ya="["+Tg+"]",Ja="\\ud83c[\\udffb-\\udfff]",Ag="(?:"+Ya+"|"+Ja+")",cc="[^"+lc+"]",fc="(?:\\ud83c[\\udde6-\\uddff]){2}",pc="[\\ud800-\\udbff][\\udc00-\\udfff]",Rg="\\u200d",dc=Ag+"?",mc="["+_g+"]?",kg="(?:"+Rg+"(?:"+[cc,fc,pc].join("|")+")"+mc+dc+")*",Ng=mc+dc+kg,Ig="(?:"+[cc+Ya+"?",Ya,fc,pc,Sg].join("|")+")",Eg=RegExp(Ja+"(?="+Ja+")|"+Ig+Ng,"g");function Pg(r){return r.match(Eg)||[]}var hc=Pg;function Cg(r){return hn(r)?hc(r):uc(r)}var yc=Cg;function Og(r){return function(e){e=Ce(e);var t=hn(e)?yc(e):void 0,n=t?t[0]:e.charAt(0),a=t?sc(t,1).join(""):e.slice(1);return n[r]()+a}}var gc=Og;var Fg=gc("toUpperCase"),vc=Fg;function Lg(r){return vc(Ce(r).toLowerCase())}var xc=Lg;s();u();s();u();function Ug(r,e,t,n){var a=-1,i=r==null?0:r.length;for(n&&i&&(t=r[++a]);++a<i;)t=e(t,r[a],a,r);return t}var wc=Ug;s();u();s();u();s();u();function Bg(r){return function(e){return r==null?void 0:r[e]}}var bc=Bg;var Mg={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jg=bc(Mg),Tc=jg;var $g=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qg="\\u0300-\\u036f",Dg="\\ufe20-\\ufe2f",Vg="\\u20d0-\\u20ff",Wg=qg+Dg+Vg,zg="["+Wg+"]",Gg=RegExp(zg,"g");function Zg(r){return r=Ce(r),r&&r.replace($g,Tc).replace(Gg,"")}var _c=Zg;s();u();s();u();var Hg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Yg(r){return r.match(Hg)||[]}var Sc=Yg;s();u();var Jg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Kg(r){return Jg.test(r)}var Ac=Kg;s();u();var Ec="\\ud800-\\udfff",Xg="\\u0300-\\u036f",Qg="\\ufe20-\\ufe2f",ev="\\u20d0-\\u20ff",tv=Xg+Qg+ev,Pc="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",rv="\\xac\\xb1\\xd7\\xf7",nv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",av="\\u2000-\\u206f",iv=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oc="A-Z\\xc0-\\xd6\\xd8-\\xde",ov="\\ufe0e\\ufe0f",Fc=rv+nv+av+iv,Lc="['\u2019]",Rc="["+Fc+"]",sv="["+tv+"]",Uc="\\d+",uv="["+Pc+"]",Bc="["+Cc+"]",Mc="[^"+Ec+Fc+Uc+Pc+Cc+Oc+"]",lv="\\ud83c[\\udffb-\\udfff]",cv="(?:"+sv+"|"+lv+")",fv="[^"+Ec+"]",jc="(?:\\ud83c[\\udde6-\\uddff]){2}",$c="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Oc+"]",pv="\\u200d",kc="(?:"+Bc+"|"+Mc+")",dv="(?:"+Ft+"|"+Mc+")",Nc="(?:"+Lc+"(?:d|ll|m|re|s|t|ve))?",Ic="(?:"+Lc+"(?:D|LL|M|RE|S|T|VE))?",qc=cv+"?",Dc="["+ov+"]?",mv="(?:"+pv+"(?:"+[fv,jc,$c].join("|")+")"+Dc+qc+")*",hv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gv=Dc+qc+mv,vv="(?:"+[uv,jc,$c].join("|")+")"+gv,xv=RegExp([Ft+"?"+Bc+"+"+Nc+"(?="+[Rc,Ft,"$"].join("|")+")",dv+"+"+Ic+"(?="+[Rc,Ft+kc,"$"].join("|")+")",Ft+"?"+kc+"+"+Nc,Ft+"+"+Ic,yv,hv,Uc,vv].join("|"),"g");function wv(r){return r.match(xv)||[]}var Vc=wv;function bv(r,e,t){return r=Ce(r),e=t?void 0:e,e===void 0?Ac(r)?Vc(r):Sc(r):r.match(e)||[]}var Wc=bv;var Tv="['\u2019]",_v=RegExp(Tv,"g");function Sv(r){return function(e){return wc(Wc(_c(e).replace(_v,"")),r,"")}}var zc=Sv;var Av=zc(function(r,e,t){return e=e.toLowerCase(),r+(t?xc(e):e)}),Ka=Av;s();u();function cr(r){return Object.keys(r)}s();u();s();u();var Ze=class{};s();u();var yn=class{formatMultiple(e){return Promise.all(e.map(t=>this.format(t)))}formatMultipleSync(e){return e.map(t=>this.formatSync(t))}},fr=class extends yn{async format(e){return e}formatSync(e){return e}};s();u();s();u();var te=class extends Ze{constructor(t){super();w(this,"value");this.value=t}write(t){typeof this.value=="string"?t.write(this.value):typeof this.value=="function"?this.value(t):this.value.write(t)}};var Rv=4,Gc=!!p.env.FERN_STACK_TRACK;Gc&&(Error.stackTraceLimit=50);var pr=class{constructor(){w(this,"buffer","");w(this,"indentLevel",0);w(this,"hasWrittenAnything",!1);w(this,"lastCharacterIsSemicolon",!1);w(this,"lastCharacterIsNewline",!1)}write(...e){for(let t of e)if(t!=null)if(typeof t=="string"){let n=t.length>0&&t.endsWith(`
14
- `),a=n?t.substring(0,t.length-1):t,i=this.getIndentString(),o=a.replaceAll(`
1
+ "use strict";var Tt=Object.defineProperty,fa=Object.defineProperties,pa=Object.getOwnPropertyDescriptor,da=Object.getOwnPropertyDescriptors,ma=Object.getOwnPropertyNames,bt=Object.getOwnPropertySymbols;var Jt=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable;var Ht=(n,e,t)=>e in n?Tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,m=(n,e)=>{for(var t in e||(e={}))Jt.call(e,t)&&Ht(n,t,e[t]);if(bt)for(var t of bt(e))xr.call(e,t)&&Ht(n,t,e[t]);return n},_=(n,e)=>fa(n,da(e));var vr=n=>typeof n=="symbol"?n:n+"",wr=(n,e)=>{var t={};for(var r in n)Jt.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&bt)for(var r of bt(n))e.indexOf(r)<0&&xr.call(n,r)&&(t[r]=n[r]);return t};var Kt=(n,e)=>()=>(n&&(e=n(n=0)),e);var Qt=(n,e)=>{for(var t in e)Tt(n,t,{get:e[t],enumerable:!0})},ha=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ma(e))!Jt.call(n,a)&&a!==t&&Tt(n,a,{get:()=>e[a],enumerable:!(r=pa(e,a))||r.enumerable});return n};var ya=n=>ha(Tt({},"__esModule",{value:!0}),n);var g=(n,e,t)=>Ht(n,typeof e!="symbol"?e+"":e,t);function Tr(){throw new Error("setTimeout has not been defined")}function _r(){throw new Error("clearTimeout has not been defined")}function kr(n){if(pe===setTimeout)return setTimeout(n,0);if((pe===Tr||!pe)&&setTimeout)return pe=setTimeout,setTimeout(n,0);try{return pe(n,0)}catch(e){try{return pe.call(null,n,0)}catch(t){return pe.call(this,n,0)}}}function ga(n){if(de===clearTimeout)return clearTimeout(n);if((de===_r||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(n);try{return de(n)}catch(e){try{return de.call(null,n)}catch(t){return de.call(this,n)}}}function xa(){!He||!we||(He=!1,we.length?ae=we.concat(ae):_t=-1,ae.length&&Rr())}function Rr(){if(!He){var n=kr(xa);He=!0;for(var e=ae.length;e;){for(we=ae,ae=[];++_t<e;)we&&we[_t].run();_t=-1,e=ae.length}we=null,He=!1,ga(n)}}function va(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ae.push(new Nr(n,e)),ae.length===1&&!He&&kr(Rr)}function Nr(n,e){this.fun=n,this.array=e}function be(){}function Ba(n){throw new Error("process.binding is not supported")}function Ua(){return"/"}function ja(n){throw new Error("process.chdir is not supported")}function Ma(){return 0}function $a(n){var e=Da.call(Ye)*.001,t=Math.floor(e),r=Math.floor(e%1*1e9);return n&&(t=t-n[0],r=r-n[1],r<0&&(t--,r+=1e9)),[t,r]}function qa(){var n=new Date,e=n-Va;return e/1e3}var pe,de,ae,He,we,_t,wa,ba,Ta,_a,ka,Ra,Na,Ia,Aa,Sa,Ea,Ca,Pa,La,Fa,Oa,Ye,Da,Va,x,br,c=Kt(()=>{"use strict";pe=Tr,de=_r;typeof globalThis.setTimeout=="function"&&(pe=setTimeout);typeof globalThis.clearTimeout=="function"&&(de=clearTimeout);ae=[],He=!1,_t=-1;Nr.prototype.run=function(){this.fun.apply(null,this.array)};wa="browser",ba="browser",Ta=!0,_a={},ka=[],Ra="",Na={},Ia={},Aa={};Sa=be,Ea=be,Ca=be,Pa=be,La=be,Fa=be,Oa=be;Ye=globalThis.performance||{},Da=Ye.now||Ye.mozNow||Ye.msNow||Ye.oNow||Ye.webkitNow||function(){return new Date().getTime()};Va=new Date;x={nextTick:va,title:wa,browser:Ta,env:_a,argv:ka,version:Ra,versions:Na,on:Sa,addListener:Ea,once:Ca,off:Pa,removeListener:La,removeAllListeners:Fa,emit:Oa,binding:Ba,cwd:Ua,chdir:ja,umask:Ma,hrtime:$a,platform:ba,release:Ia,config:Aa,uptime:qa},br={};Object.keys(br).forEach(n=>{let e=n.split("."),t=x;for(let r=0;r<e.length;r++){let a=e[r];r===e.length-1?t[a]=br[n]:t=t[a]||(t[a]={})}})});function Er(){er=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=n.length;e<t;++e)Q[e]=n[e],W[n.charCodeAt(e)]=e;W[45]=62,W[95]=63}function za(n){er||Er();var e,t,r,a,i,s,o=n.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=n[o-2]==="="?2:n[o-1]==="="?1:0,s=new Wa(o*3/4-i),r=i>0?o-4:o;var f=0;for(e=0,t=0;e<r;e+=4,t+=3)a=W[n.charCodeAt(e)]<<18|W[n.charCodeAt(e+1)]<<12|W[n.charCodeAt(e+2)]<<6|W[n.charCodeAt(e+3)],s[f++]=a>>16&255,s[f++]=a>>8&255,s[f++]=a&255;return i===2?(a=W[n.charCodeAt(e)]<<2|W[n.charCodeAt(e+1)]>>4,s[f++]=a&255):i===1&&(a=W[n.charCodeAt(e)]<<10|W[n.charCodeAt(e+1)]<<4|W[n.charCodeAt(e+2)]>>2,s[f++]=a>>8&255,s[f++]=a&255),s}function Za(n){return Q[n>>18&63]+Q[n>>12&63]+Q[n>>6&63]+Q[n&63]}function Ga(n,e,t){for(var r,a=[],i=e;i<t;i+=3)r=(n[i]<<16)+(n[i+1]<<8)+n[i+2],a.push(Za(r));return a.join("")}function Ir(n){er||Er();for(var e,t=n.length,r=t%3,a="",i=[],s=16383,o=0,f=t-r;o<f;o+=s)i.push(Ga(n,o,o+s>f?f:o+s));return r===1?(e=n[t-1],a+=Q[e>>2],a+=Q[e<<4&63],a+="=="):r===2&&(e=(n[t-2]<<8)+n[t-1],a+=Q[e>>10],a+=Q[e>>4&63],a+=Q[e<<2&63],a+="="),i.push(a),i.join("")}function kt(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ie(n,e){if(kt()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(e),n.__proto__=u.prototype):(n===null&&(n=new u(e)),n.length=e),n}function u(n,e,t){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(n,e,t);if(typeof n=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return tr(this,n)}return Cr(this,n,e,t)}function Cr(n,e,t,r){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?Ja(n,e,t,r):typeof e=="string"?Ha(n,e,t):Ka(n,e)}function Pr(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function Ya(n,e,t,r){return Pr(e),e<=0?ie(n,e):t!==void 0?typeof r=="string"?ie(n,e).fill(t,r):ie(n,e).fill(t):ie(n,e)}function tr(n,e){if(Pr(e),n=ie(n,e<0?0:rr(e)|0),!u.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)n[t]=0;return n}function Ha(n,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=Lr(e,t)|0;n=ie(n,r);var a=n.write(e,t);return a!==r&&(n=n.slice(0,a)),n}function Xt(n,e){var t=e.length<0?0:rr(e.length)|0;n=ie(n,t);for(var r=0;r<t;r+=1)n[r]=e[r]&255;return n}function Ja(n,e,t,r){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))throw new RangeError("'length' is out of bounds");return t===void 0&&r===void 0?e=new Uint8Array(e):r===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,r),u.TYPED_ARRAY_SUPPORT?(n=e,n.__proto__=u.prototype):n=Xt(n,e),n}function Ka(n,e){if(X(e)){var t=rr(e.length)|0;return n=ie(n,t),n.length===0||e.copy(n,0,0,t),n}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||yi(e.length)?ie(n,0):Xt(n,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Xt(n,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function rr(n){if(n>=kt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kt().toString(16)+" bytes");return n|0}function X(n){return!!(n!=null&&n._isBuffer)}function Lr(n,e){if(X(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var t=n.length;if(t===0)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Rt(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Dr(n).length;default:if(r)return Rt(n).length;e=(""+e).toLowerCase(),r=!0}}function Qa(n,e,t){var r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(n||(n="utf8");;)switch(n){case"hex":return ui(this,e,t);case"utf8":case"utf-8":return Br(this,e,t);case"ascii":return si(this,e,t);case"latin1":case"binary":return oi(this,e,t);case"base64":return ai(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ci(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function Te(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function Fr(n,e,t,r,a){if(n.length===0)return-1;if(typeof t=="string"?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(a)return-1;t=n.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof e=="string"&&(e=u.from(e,r)),X(e))return e.length===0?-1:Ar(n,e,t,r,a);if(typeof e=="number")return e=e&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):Ar(n,[e],t,r,a);throw new TypeError("val must be string, number or Buffer")}function Ar(n,e,t,r,a){var i=1,s=n.length,o=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||e.length<2)return-1;i=2,s/=2,o/=2,t/=2}function f(F,q){return i===1?F[q]:F.readUInt16BE(q*i)}var d;if(a){var h=-1;for(d=t;d<s;d++)if(f(n,d)===f(e,h===-1?0:d-h)){if(h===-1&&(h=d),d-h+1===o)return h*i}else h!==-1&&(d-=d-h),h=-1}else for(t+o>s&&(t=s-o),d=t;d>=0;d--){for(var b=!0,C=0;C<o;C++)if(f(n,d+C)!==f(e,C)){b=!1;break}if(b)return d}return-1}function Xa(n,e,t,r){t=Number(t)||0;var a=n.length-t;r?(r=Number(r),r>a&&(r=a)):r=a;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var o=parseInt(e.substr(s*2,2),16);if(isNaN(o))return s;n[t+s]=o}return s}function ei(n,e,t,r){return At(Rt(e,n.length-t),n,t,r)}function Or(n,e,t,r){return At(mi(e),n,t,r)}function ti(n,e,t,r){return Or(n,e,t,r)}function ri(n,e,t,r){return At(Dr(e),n,t,r)}function ni(n,e,t,r){return At(hi(e,n.length-t),n,t,r)}function ai(n,e,t){return e===0&&t===n.length?Ir(n):Ir(n.slice(e,t))}function Br(n,e,t){t=Math.min(n.length,t);for(var r=[],a=e;a<t;){var i=n[a],s=null,o=i>239?4:i>223?3:i>191?2:1;if(a+o<=t){var f,d,h,b;switch(o){case 1:i<128&&(s=i);break;case 2:f=n[a+1],(f&192)===128&&(b=(i&31)<<6|f&63,b>127&&(s=b));break;case 3:f=n[a+1],d=n[a+2],(f&192)===128&&(d&192)===128&&(b=(i&15)<<12|(f&63)<<6|d&63,b>2047&&(b<55296||b>57343)&&(s=b));break;case 4:f=n[a+1],d=n[a+2],h=n[a+3],(f&192)===128&&(d&192)===128&&(h&192)===128&&(b=(i&15)<<18|(f&63)<<12|(d&63)<<6|h&63,b>65535&&b<1114112&&(s=b))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),a+=o}return ii(r)}function ii(n){var e=n.length;if(e<=Sr)return String.fromCharCode.apply(String,n);for(var t="",r=0;r<e;)t+=String.fromCharCode.apply(String,n.slice(r,r+=Sr));return t}function si(n,e,t){var r="";t=Math.min(n.length,t);for(var a=e;a<t;++a)r+=String.fromCharCode(n[a]&127);return r}function oi(n,e,t){var r="";t=Math.min(n.length,t);for(var a=e;a<t;++a)r+=String.fromCharCode(n[a]);return r}function ui(n,e,t){var r=n.length;(!e||e<0)&&(e=0),(!t||t<0||t>r)&&(t=r);for(var a="",i=e;i<t;++i)a+=di(n[i]);return a}function ci(n,e,t){for(var r=n.slice(e,t),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+r[i+1]*256);return a}function B(n,e,t){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+e>t)throw new RangeError("Trying to access beyond buffer length")}function M(n,e,t,r,a,i){if(!X(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(t+r>n.length)throw new RangeError("Index out of range")}function Nt(n,e,t,r){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(n.length-t,2);a<i;++a)n[t+a]=(e&255<<8*(r?a:1-a))>>>(r?a:1-a)*8}function It(n,e,t,r){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(n.length-t,4);a<i;++a)n[t+a]=e>>>(r?a:3-a)*8&255}function Ur(n,e,t,r,a,i){if(t+r>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function jr(n,e,t,r,a){return a||Ur(n,e,t,4,34028234663852886e22,-34028234663852886e22),Vr(n,e,t,r,23,4),t+4}function Mr(n,e,t,r,a){return a||Ur(n,e,t,8,17976931348623157e292,-17976931348623157e292),Vr(n,e,t,r,52,8),t+8}function fi(n){if(n=pi(n).replace(li,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function pi(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function di(n){return n<16?"0"+n.toString(16):n.toString(16)}function Rt(n,e){e=e||1/0;for(var t,r=n.length,a=null,i=[],s=0;s<r;++s){if(t=n.charCodeAt(s),t>55295&&t<57344){if(!a){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function mi(n){for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t)&255);return e}function hi(n,e){for(var t,r,a,i=[],s=0;s<n.length&&!((e-=2)<0);++s)t=n.charCodeAt(s),r=t>>8,a=t%256,i.push(a),i.push(r);return i}function Dr(n){return za(fi(n))}function At(n,e,t,r){for(var a=0;a<r&&!(a+t>=e.length||a>=n.length);++a)e[a+t]=n[a];return a}function yi(n){return n!==n}function gi(n){return n!=null&&(!!n._isBuffer||$r(n)||xi(n))}function $r(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function xi(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&$r(n.slice(0,0))}function St(n,e,t,r,a){var i,s,o=a*8-r-1,f=(1<<o)-1,d=f>>1,h=-7,b=t?a-1:0,C=t?-1:1,F=n[e+b];for(b+=C,i=F&(1<<-h)-1,F>>=-h,h+=o;h>0;i=i*256+n[e+b],b+=C,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=r;h>0;s=s*256+n[e+b],b+=C,h-=8);if(i===0)i=1-d;else{if(i===f)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-d}return(F?-1:1)*s*Math.pow(2,i-r)}function Vr(n,e,t,r,a,i){var s,o,f,d=i*8-a-1,h=(1<<d)-1,b=h>>1,C=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=r?0:i-1,q=r?1:-1,ve=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+b>=1?e+=C/f:e+=C*Math.pow(2,1-b),e*f>=2&&(s++,f/=2),s+b>=h?(o=0,s=h):s+b>=1?(o=(e*f-1)*Math.pow(2,a),s=s+b):(o=e*Math.pow(2,b-1)*Math.pow(2,a),s=0));a>=8;n[t+F]=o&255,F+=q,o/=256,a-=8);for(s=s<<a|o,d+=a;d>0;n[t+F]=s&255,F+=q,s/=256,d-=8);n[t+F-q]|=ve*128}var Q,W,Wa,er,Sr,li,qr=Kt(()=>{"use strict";c();l();Q=[],W=[],Wa=typeof Uint8Array!="undefined"?Uint8Array:Array,er=!1;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;u.poolSize=8192;u._augment=function(n){return n.__proto__=u.prototype,n};u.from=function(n,e,t){return Cr(null,n,e,t)};u.kMaxLength=kt();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]);u.alloc=function(n,e,t){return Ya(null,n,e,t)};u.allocUnsafe=function(n){return tr(null,n)};u.allocUnsafeSlow=function(n){return tr(null,n)};u.isBuffer=gi;u.compare=function(e,t){if(!X(e)||!X(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,a=t.length,i=0,s=Math.min(r,a);i<s;++i)if(e[i]!==t[i]){r=e[i],a=t[i];break}return r<a?-1:a<r?1:0};u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var a=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!X(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(a,i),i+=s.length}return a};u.byteLength=Lr;u.prototype._isBuffer=!0;u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Te(this,t,t+1);return this};u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Te(this,t,t+3),Te(this,t+1,t+2);return this};u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Te(this,t,t+7),Te(this,t+1,t+6),Te(this,t+2,t+5),Te(this,t+3,t+4);return this};u.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Br(this,0,e):Qa.apply(this,arguments)};u.prototype.equals=function(e){if(!X(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0};u.prototype.compare=function(e,t,r,a,i){if(!X(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),t<0||r>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=r)return 0;if(a>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,i>>>=0,this===e)return 0;for(var s=i-a,o=r-t,f=Math.min(s,o),d=this.slice(a,i),h=e.slice(t,r),b=0;b<f;++b)if(d[b]!==h[b]){s=d[b],o=h[b];break}return s<o?-1:o<s?1:0};u.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};u.prototype.indexOf=function(e,t,r){return Fr(this,e,t,r,!0)};u.prototype.lastIndexOf=function(e,t,r){return Fr(this,e,t,r,!1)};u.prototype.write=function(e,t,r,a){if(t===void 0)a="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")a=t,r=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(r)?(r=r|0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return Xa(this,e,t,r);case"utf8":case"utf-8":return ei(this,e,t,r);case"ascii":return Or(this,e,t,r);case"latin1":case"binary":return ti(this,e,t,r);case"base64":return ri(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ni(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Sr=4096;u.prototype.slice=function(e,t){var r=this.length;e=~~e,t=t===void 0?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);var a;if(u.TYPED_ARRAY_SUPPORT)a=this.subarray(e,t),a.__proto__=u.prototype;else{var i=t-e;a=new u(i,void 0);for(var s=0;s<i;++s)a[s]=this[s+e]}return a};u.prototype.readUIntLE=function(e,t,r){e=e|0,t=t|0,r||B(e,t,this.length);for(var a=this[e],i=1,s=0;++s<t&&(i*=256);)a+=this[e+s]*i;return a};u.prototype.readUIntBE=function(e,t,r){e=e|0,t=t|0,r||B(e,t,this.length);for(var a=this[e+--t],i=1;t>0&&(i*=256);)a+=this[e+--t]*i;return a};u.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]};u.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8};u.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]};u.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};u.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};u.prototype.readIntLE=function(e,t,r){e=e|0,t=t|0,r||B(e,t,this.length);for(var a=this[e],i=1,s=0;++s<t&&(i*=256);)a+=this[e+s]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a};u.prototype.readIntBE=function(e,t,r){e=e|0,t=t|0,r||B(e,t,this.length);for(var a=t,i=1,s=this[e+--a];a>0&&(i*=256);)s+=this[e+--a]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};u.prototype.readInt8=function(e,t){return t||B(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};u.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};u.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};u.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};u.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};u.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),St(this,e,!0,23,4)};u.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),St(this,e,!1,23,4)};u.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),St(this,e,!0,52,8)};u.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),St(this,e,!1,52,8)};u.prototype.writeUIntLE=function(e,t,r,a){if(e=+e,t=t|0,r=r|0,!a){var i=Math.pow(2,8*r)-1;M(this,e,t,r,i,0)}var s=1,o=0;for(this[t]=e&255;++o<r&&(s*=256);)this[t+o]=e/s&255;return t+r};u.prototype.writeUIntBE=function(e,t,r,a){if(e=+e,t=t|0,r=r|0,!a){var i=Math.pow(2,8*r)-1;M(this,e,t,r,i,0)}var s=r-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+r};u.prototype.writeUInt8=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Nt(this,e,t,!0),t+2};u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Nt(this,e,t,!1),t+2};u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):It(this,e,t,!0),t+4};u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):It(this,e,t,!1),t+4};u.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var s=0,o=1,f=0;for(this[t]=e&255;++s<r&&(o*=256);)e<0&&f===0&&this[t+s-1]!==0&&(f=1),this[t+s]=(e/o>>0)-f&255;return t+r};u.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var s=r-1,o=1,f=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&f===0&&this[t+s+1]!==0&&(f=1),this[t+s]=(e/o>>0)-f&255;return t+r};u.prototype.writeInt8=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};u.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Nt(this,e,t,!0),t+2};u.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Nt(this,e,t,!1),t+2};u.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):It(this,e,t,!0),t+4};u.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t|0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):It(this,e,t,!1),t+4};u.prototype.writeFloatLE=function(e,t,r){return jr(this,e,t,!0,r)};u.prototype.writeFloatBE=function(e,t,r){return jr(this,e,t,!1,r)};u.prototype.writeDoubleLE=function(e,t,r){return Mr(this,e,t,!0,r)};u.prototype.writeDoubleBE=function(e,t,r){return Mr(this,e,t,!1,r)};u.prototype.copy=function(e,t,r,a){if(r||(r=0),!a&&a!==0&&(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<r&&(a=r),a===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var i=a-r,s;if(this===e&&r<t&&t<a)for(s=i-1;s>=0;--s)e[s+t]=this[s+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<i;++s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i};u.prototype.fill=function(e,t,r,a){if(typeof e=="string"){if(typeof t=="string"?(a=t,t=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!u.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t=t>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<r;++s)this[s]=e;else{var o=X(e)?e:Rt(new u(e,a).toString()),f=o.length;for(s=0;s<r-t;++s)this[s+t]=o[s%f]}return this};li=/[^+\/0-9A-Za-z-_]/g});var l=Kt(()=>{"use strict";qr()});var Gu={};Qt(Gu,{DynamicSnippetsGenerator:()=>Yt});module.exports=ya(Gu);c();l();c();l();c();l();c();l();function S(n){throw new Error("Unexpected value: "+JSON.stringify(n))}c();l();c();l();c();l();c();l();c();l();c();l();var vi=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Wr=vi;var wi=typeof self=="object"&&self&&self.Object===Object&&self,bi=Wr||wi||Function("return this")(),zr=bi;var Ti=zr.Symbol,se=Ti;c();l();var Zr=Object.prototype,_i=Zr.hasOwnProperty,ki=Zr.toString,it=se?se.toStringTag:void 0;function Ri(n){var e=_i.call(n,it),t=n[it];try{n[it]=void 0;var r=!0}catch(i){}var a=ki.call(n);return r&&(e?n[it]=t:delete n[it]),a}var Gr=Ri;c();l();var Ni=Object.prototype,Ii=Ni.toString;function Ai(n){return Ii.call(n)}var Yr=Ai;var Si="[object Null]",Ei="[object Undefined]",Hr=se?se.toStringTag:void 0;function Ci(n){return n==null?n===void 0?Ei:Si:Hr&&Hr in Object(n)?Gr(n):Yr(n)}var Jr=Ci;c();l();function Pi(n){return n!=null&&typeof n=="object"}var Kr=Pi;var Li="[object Symbol]";function Fi(n){return typeof n=="symbol"||Kr(n)&&Jr(n)==Li}var Qr=Fi;c();l();c();l();function Oi(n,e){for(var t=-1,r=n==null?0:n.length,a=Array(r);++t<r;)a[t]=e(n[t],t,n);return a}var Xr=Oi;c();l();var Bi=Array.isArray,en=Bi;var Ui=1/0,tn=se?se.prototype:void 0,rn=tn?tn.toString:void 0;function nn(n){if(typeof n=="string")return n;if(en(n))return Xr(n,nn)+"";if(Qr(n))return rn?rn.call(n):"";var e=n+"";return e=="0"&&1/n==-Ui?"-0":e}var an=nn;c();l();function ji(n){return n==null?"":an(n)}var me=ji;c();l();c();l();c();l();c();l();c();l();c();l();function Mi(n,e,t){var r=-1,a=n.length;e<0&&(e=-e>a?0:a+e),t=t>a?a:t,t<0&&(t+=a),a=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(a);++r<a;)i[r]=n[r+e];return i}var sn=Mi;function Di(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:sn(n,e,t)}var on=Di;c();l();var $i="\\ud800-\\udfff",Vi="\\u0300-\\u036f",qi="\\ufe20-\\ufe2f",Wi="\\u20d0-\\u20ff",zi=Vi+qi+Wi,Zi="\\ufe0e\\ufe0f",Gi="\\u200d",Yi=RegExp("["+Gi+$i+zi+Zi+"]");function Hi(n){return Yi.test(n)}var Et=Hi;c();l();c();l();function Ji(n){return n.split("")}var un=Ji;c();l();var cn="\\ud800-\\udfff",Ki="\\u0300-\\u036f",Qi="\\ufe20-\\ufe2f",Xi="\\u20d0-\\u20ff",es=Ki+Qi+Xi,ts="\\ufe0e\\ufe0f",rs="["+cn+"]",nr="["+es+"]",ar="\\ud83c[\\udffb-\\udfff]",ns="(?:"+nr+"|"+ar+")",ln="[^"+cn+"]",fn="(?:\\ud83c[\\udde6-\\uddff]){2}",pn="[\\ud800-\\udbff][\\udc00-\\udfff]",as="\\u200d",dn=ns+"?",mn="["+ts+"]?",is="(?:"+as+"(?:"+[ln,fn,pn].join("|")+")"+mn+dn+")*",ss=mn+dn+is,os="(?:"+[ln+nr+"?",nr,fn,pn,rs].join("|")+")",us=RegExp(ar+"(?="+ar+")|"+os+ss,"g");function cs(n){return n.match(us)||[]}var hn=cs;function ls(n){return Et(n)?hn(n):un(n)}var yn=ls;function fs(n){return function(e){e=me(e);var t=Et(e)?yn(e):void 0,r=t?t[0]:e.charAt(0),a=t?on(t,1).join(""):e.slice(1);return r[n]()+a}}var gn=fs;var ps=gn("toUpperCase"),xn=ps;function ds(n){return xn(me(n).toLowerCase())}var vn=ds;c();l();c();l();function ms(n,e,t,r){var a=-1,i=n==null?0:n.length;for(r&&i&&(t=n[++a]);++a<i;)t=e(t,n[a],a,n);return t}var wn=ms;c();l();c();l();c();l();function hs(n){return function(e){return n==null?void 0:n[e]}}var bn=hs;var ys={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},gs=bn(ys),Tn=gs;var xs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vs="\\u0300-\\u036f",ws="\\ufe20-\\ufe2f",bs="\\u20d0-\\u20ff",Ts=vs+ws+bs,_s="["+Ts+"]",ks=RegExp(_s,"g");function Rs(n){return n=me(n),n&&n.replace(xs,Tn).replace(ks,"")}var _n=Rs;c();l();c();l();var Ns=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Is(n){return n.match(Ns)||[]}var kn=Is;c();l();var As=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ss(n){return As.test(n)}var Rn=Ss;c();l();var En="\\ud800-\\udfff",Es="\\u0300-\\u036f",Cs="\\ufe20-\\ufe2f",Ps="\\u20d0-\\u20ff",Ls=Es+Cs+Ps,Cn="\\u2700-\\u27bf",Pn="a-z\\xdf-\\xf6\\xf8-\\xff",Fs="\\xac\\xb1\\xd7\\xf7",Os="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bs="\\u2000-\\u206f",Us=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ln="A-Z\\xc0-\\xd6\\xd8-\\xde",js="\\ufe0e\\ufe0f",Fn=Fs+Os+Bs+Us,On="['\u2019]",Nn="["+Fn+"]",Ms="["+Ls+"]",Bn="\\d+",Ds="["+Cn+"]",Un="["+Pn+"]",jn="[^"+En+Fn+Bn+Cn+Pn+Ln+"]",$s="\\ud83c[\\udffb-\\udfff]",Vs="(?:"+Ms+"|"+$s+")",qs="[^"+En+"]",Mn="(?:\\ud83c[\\udde6-\\uddff]){2}",Dn="[\\ud800-\\udbff][\\udc00-\\udfff]",Je="["+Ln+"]",Ws="\\u200d",In="(?:"+Un+"|"+jn+")",zs="(?:"+Je+"|"+jn+")",An="(?:"+On+"(?:d|ll|m|re|s|t|ve))?",Sn="(?:"+On+"(?:D|LL|M|RE|S|T|VE))?",$n=Vs+"?",Vn="["+js+"]?",Zs="(?:"+Ws+"(?:"+[qs,Mn,Dn].join("|")+")"+Vn+$n+")*",Gs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ys="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hs=Vn+$n+Zs,Js="(?:"+[Ds,Mn,Dn].join("|")+")"+Hs,Ks=RegExp([Je+"?"+Un+"+"+An+"(?="+[Nn,Je,"$"].join("|")+")",zs+"+"+Sn+"(?="+[Nn,Je+In,"$"].join("|")+")",Je+"?"+In+"+"+An,Je+"+"+Sn,Ys,Gs,Bn,Js].join("|"),"g");function Qs(n){return n.match(Ks)||[]}var qn=Qs;function Xs(n,e,t){return n=me(n),e=t?void 0:e,e===void 0?Rn(n)?qn(n):kn(n):n.match(e)||[]}var Wn=Xs;var eo="['\u2019]",to=RegExp(eo,"g");function ro(n){return function(e){return wn(Wn(_n(e).replace(to,"")),n,"")}}var zn=ro;var no=zn(function(n,e,t){return e=e.toLowerCase(),n+(t?vn(e):e)}),ir=no;c();l();function st(n){return Object.keys(n)}c();l();c();l();c();l();var Zn,Gn,ot=(Gn=(Zn=x.env.FERN_STACK_TRACK)==null?void 0:Zn.toLowerCase())!=null?Gn:"",ee=ot!==""&&ot!=="0"&&ot!=="false",sr=["single","multiline","box"].includes(ot)?ot:"single";ee&&(Error.stackTraceLimit=50);var ao=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),io=new Set(["stacktrace"]);function Pt({maxFrames:n=50,skip:e=0,filterPaths:t=[],filterFunctions:r=[],stopOn:a=[],filterNode:i=!0,filterJs:s=!0,formatFilename:o=f=>f}={}){var d;if(!ee)return[];r=[...r,...ao],t=[...t,...io],a=[...a,"runInteractiveTask"];let f=!1;return((d=new Error().stack)!=null?d:"").split(`
2
+ `).map(h=>{let b=h.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(b&&b.length===5){let[,C,F,q,ve]=b;if(!C||!F||!q||!ve)return;if(f||a.some(wt=>C==null?void 0:C.includes(wt))){f=!0;return}switch(C){case"Object.<anonymous>":C="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":C=`${C.substring(C.indexOf(".")+1)}()=> { ... }`;break}return{fn:C,path:o(F),position:`${q}:${ve}`}}}).filter(h=>{var b,C;return h&&!r.some(F=>h.fn.includes(F))&&!(i&&((b=h.path)!=null&&b.startsWith("node:")))&&!(s&&((C=h.path)!=null&&C.endsWith(".js")))&&!t.some(F=>h.path.includes(F))}).slice(e,e+n)}var Ct=class{constructor({maxFrames:e=50,skip:t=0,filterPaths:r=[],filterFunctions:a=[],stopOn:i=[],filterNode:s=!0,filterJs:o=!0,multiline:f=!1,formatFilename:d=h=>h}={}){g(this,"maxFrames");g(this,"skip");g(this,"filterPaths");g(this,"filterFunctions");g(this,"stopOn");g(this,"filterNode");g(this,"filterJs");g(this,"multiline");g(this,"formatFilename");g(this,"tracking",new WeakMap);this.maxFrames=e,this.skip=t,this.filterPaths=r,this.filterFunctions=a,this.stopOn=i,this.filterNode=s,this.filterJs=o,this.multiline=f,this.formatFilename=d}tag(e){let t=this.tracking.get(e)||new Set;Pt({maxFrames:this.maxFrames,skip:this.skip,filterPaths:this.filterPaths,filterFunctions:this.filterFunctions,stopOn:this.stopOn,filterNode:this.filterNode,filterJs:this.filterJs,formatFilename:this.formatFilename}).forEach(r=>t.add(r)),this.tracking.set(e,t)}trace(e){if(!ee)return"";let t=this.tracking.get(e);return t?[...t].map(r=>`${this.multiline?`
3
+ `:""}${r.fn} - ${r.path}:${r.position}`).join(""):""}frames(e){let t=this.tracking.get(e);return t?[...t]:[]}free(e){this.tracking.delete(e)}clear(){this.tracking=new WeakMap}},oe;function Yn({maxFrames:n=50,skip:e=0,filterPaths:t=[],filterFunctions:r=[],stopOn:a=[],filterNode:i=!0,filterJs:s=!0,multiline:o=!1,formatFilename:f=d=>d}={}){ee&&(oe!=null||(oe=new Ct({maxFrames:n,skip:e,filterPaths:t,filterFunctions:r,stopOn:a,filterNode:i,filterJs:s,multiline:o,formatFilename:f})))}function Hn(n){oe==null||oe.tag(n)}function or(n){var e;return(e=oe==null?void 0:oe.frames(n))!=null?e:[]}var _e=class{constructor(){Hn(this)}};c();l();var Lt=class{formatMultiple(e){return Promise.all(e.map(t=>this.format(t)))}formatMultipleSync(e){return e.map(t=>this.formatSync(t))}},ut=class extends Lt{async format(e){return e}formatSync(e){return e}};c();l();c();l();c();l();var J=class extends _e{constructor(t){super();g(this,"value");this.value=t}write(t){typeof this.value=="string"?t.write(this.value):typeof this.value=="function"?this.value(t):this.value.write(t)}};var so=4;Yn({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var ct=class{constructor(){g(this,"lineBuffer",[]);g(this,"indentLevel",0);g(this,"hasWrittenAnything",!1);g(this,"lastCharacterIsSemicolon",!1);g(this,"lastCharacterIsNewline",!1);g(this,"nodeStackFrames",[])}get buffer(){return ee&&this.nodeStackFrames.length>0&&this.writeInternal(`
4
+ `),this.lineBuffer.join(`
5
+ `)+(this.lastCharacterIsNewline?`
6
+ `:"")}write(...e){for(let t of e)if(t!=null)if(typeof t=="string"){let r=t.length>0&&t.endsWith(`
7
+ `),a=r?t.substring(0,t.length-1):t,i=this.getIndentString(),s=a.replaceAll(`
15
8
  `,`
16
- ${i}`);this.isAtStartOfLine()&&(o=i+o),n&&(o+=`
17
- `),this.writeInternal(o)}else this.writeNode(t)}writeStatement(...e){this.write(...e),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(e){let t=this.indentLevel;this.indentLevel=0,this.write(e),this.indentLevel=t}writeNode(e){e.write(this)}writeNodeOrString(e){if(typeof e=="string"){this.write(e);return}this.writeNode(e)}writeNodeStatement(e){e.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(e){new te(e).write(this),e.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(e,t){new te(e).write(this),this.write(" (",t,")"),this.pushScope()}controlFlowWithoutStatement(e){new te(e).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(e,t){this.dedent(),this.write("} "),new te(e).write(this),this.write(" (",t,")"),this.pushScope()}alternativeControlFlow(e){this.dedent(),this.write("} "),new te(e).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(e=!0){this.dedent(),this.writeNewLineIfLastLineNot(),e?this.writeLine("}"):this.write("}")}writeLine(e=""){this.write(e),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
9
+ ${i}`);this.isAtStartOfLine()&&(s=i+s),r&&(s+=`
10
+ `),this.writeInternal(s)}else this.writeNode(t)}writeStatement(...e){this.write(...e),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(e){let t=this.indentLevel;this.indentLevel=0,this.write(e),this.indentLevel=t}writeNode(e){ee&&this.nodeStackFrames.push(...or(e)),e.write(this),ee&&sr!=="single"&&this.writeInternal(`
11
+ `)}writeNodeOrString(e){if(typeof e=="string"){this.write(e);return}this.writeNode(e)}writeNodeStatement(e){this.writeNode(e),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(e){new J(e).write(this),e.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(e,t){new J(e).write(this),this.write(" (",t,")"),this.pushScope()}controlFlowWithoutStatement(e){new J(e).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(e,t){this.dedent(),this.write("} "),new J(e).write(this),this.write(" (",t,")"),this.pushScope()}alternativeControlFlow(e){this.dedent(),this.write("} "),new J(e).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(e=!0){this.dedent(),this.writeNewLineIfLastLineNot(),e?this.writeLine("}"):this.write("}")}writeLine(...e){this.write(...e.length===0?[""]:e),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
18
12
  `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
19
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:e,delimiter:t,writeFunction:n}){if(e.length>0){let a=e[0];a!=null&&n(a);for(let i=1;i<e.length;i++){this.write(t);let o=e[i];o!=null&&n(o)}}}toString(){return this.buffer}writeInternal(e){if(e.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=e.endsWith(`
20
- `),this.lastCharacterIsSemicolon=e.endsWith(";")),this.buffer+=e,Gc&&this.buffer.endsWith(`
21
- `)&&!this.buffer.endsWith(`"""
22
- `)){let t=this.stacktrace(15).map(n=>`${n.fn} - ${n.path}:${n.position}`).join(" ");t&&(this.buffer=this.buffer.slice(0,-1),this.buffer+=`//@@ ${t}
23
- `)}return this.buffer}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Rv}stacktrace(e=50){var n;let t=!1;return((n=new Error().stack)!=null?n:"").split(`
24
- `).map(a=>{var o;let i=a.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(i&&i.length===5){let[,l,f,d,y]=i;if(t||l!=null&&l.includes("runInteractiveTask")){t=!0;return}switch(l){case"Object.<anonymous>":l="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":l=`${l.substring(l.indexOf(".")+1)}()=> { ... }`;break}return{fn:l,path:(o=f==null?void 0:f.replace(/^.*?fern.*?\//,""))!=null?o:"",position:`${d}:${y}`}}}).filter(a=>{var i,o,l,f,d,y,g;return a&&!((i=a.path)!=null&&i.startsWith("node:"))&&!((o=a.path)!=null&&o.endsWith(".js"))&&!((l=a.path)!=null&&l.includes("AbstractWriter"))&&!((f=a.fn)!=null&&f.includes("stacktrace"))&&!((d=a.fn)!=null&&d.includes("stackLine"))&&!((y=a.fn)!=null&&y.includes("SdkGeneratorCLI"))&&!((g=a.fn)!=null&&g.includes("runCli"))}).slice(0,e)}};s();u();function Xa(r){return(r==null?void 0:r.name)!=null}s();u();s();u();s();u();var dr=class{constructor(){w(this,"reporter");w(this,"snippet");w(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:t}){this.shouldUpdate({snippet:t,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=t)}getResponseOrThrow({endpoint:e}){var t;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(t=this.err)!=null?t:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:t}){var n,a;return this.reporter==null||this.reporter.size()>0&&t.size()===0?!0:e.length>((a=(n=this.snippet)==null?void 0:n.length)!=null?a:0)}};var mr=class{constructor(e){w(this,"context");this.context=e}async generate(e,t={}){let n=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let a=new dr;for(let i of n){let o=this.context.clone(),l=this.createSnippetGenerator(o);try{let f=await l.generateSnippet({endpoint:i,request:e,options:t});if(o.errors.empty())return{snippet:f,errors:void 0};a.update({context:o,snippet:f})}catch(f){a.err==null&&(a.err=f)}}return a.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,t={}){let n=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let a=new dr;for(let i of n){let o=this.context.clone(),l=this.createSnippetGenerator(o);try{let f=l.generateSnippetSync({endpoint:i,request:e,options:t});if(o.errors.empty())return{snippet:f,errors:void 0};a.update({context:o,snippet:f})}catch(f){a.err==null&&(a.err=f)}}return a.getResponseOrThrow({endpoint:e.endpoint})}};s();u();s();u();s();u();var hr=class{constructor(){w(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let n=e.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};s();u();var F={Critical:"CRITICAL",Warning:"WARNING"},yr=class r{constructor(){w(this,"errors");w(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(A(h({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(t=>t.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new r;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let t=[];for(let n of e){if(typeof n=="string"){t.push(n);continue}t[t.length-1]+=`[${n.index}]`}return t}};var gr=class{constructor({ir:e,config:t,options:n={}}){w(this,"config");w(this,"options");w(this,"errors");w(this,"_ir");w(this,"httpEndpointReferenceParser");this._ir=e,this.config=t,this.options=n,this.errors=new yr,this.httpEndpointReferenceParser=new hr}associateQueryParametersByWireValue({parameters:e,values:t}){let n=[];for(let[a,i]of Object.entries(t)){this.errors.scope(a);try{let o=e.find(f=>f.name.wireValue===a);if(o==null)throw this.newParameterNotRecognizedError(a);let l=this.isListTypeReference(o.typeReference)&&!Array.isArray(i)?[i]:i;n.push({name:o.name,typeReference:o.typeReference,value:l})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:e,values:t}){let n=[];for(let a of e){this.errors.scope(a.name.wireValue);try{let i=t[a.name.wireValue];if(i==null)if(a.typeReference.type==="primitive"&&a.typeReference.value==="STRING")i=`<${a.name.wireValue}>`;else{this.errors.add({severity:F.Critical,message:this.newParameterNotRecognizedError(a.name.wireValue).message});continue}n.push({name:a.name,typeReference:a.typeReference,value:i})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:e,values:t,ignoreMissingParameters:n}){let a=[];for(let[i,o]of Object.entries(t)){this.errors.scope(i);try{let l=e.find(f=>f.name.wireValue===i);if(l==null){if(n)continue;this.errors.add({severity:F.Critical,message:this.newParameterNotRecognizedError(i).message});continue}a.push({name:l.name,typeReference:l.typeReference,value:o})}finally{this.errors.unscope()}}return a}getExampleObjectProperties({parameters:e,snippetObject:t}){let n=typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{},a=[];for(let i of e){let o=n[i.name.wireValue];o==null?i.typeReference.type==="nullable"&&a.push({name:i.name,typeReference:i.typeReference,value:null}):a.push({name:i.name,typeReference:i.typeReference,value:o})}return a}getSingleFileValue({property:e,record:t}){let n=t[e.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:F.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:e,record:t}){let n=t[e.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:F.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let a=[];for(let i of n){if(typeof i!="string"){this.errors.add({severity:F.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}a.push(i)}return a}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:F.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let t=this._ir.types[e];if(t==null){this.errors.add({severity:F.Critical,message:`Type identified by "${e}" could not be found`});return}return t}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t}){let n=this.getRecord(t);if(n==null)return;let a=e.discriminant.wireValue,i=n[a];if(i==null){this.errors.add({severity:F.Critical,message:this.newParameterNotRecognizedError(a).message});return}if(typeof i!="string"){this.errors.add({severity:F.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let o=e.types[i];if(o==null){this.errors.add({severity:F.Critical,message:`No type found for discriminant value "${i}"`});return}let d=n,{[a]:l}=d,f=fi(d,[ci(a)]);return{singleDiscriminatedUnionType:o,discriminantValue:o.discriminantValue,value:f}}resolveEndpointOrThrow(e){let t=this.httpEndpointReferenceParser.tryParse(e);if(t==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(t)}resolveEndpointLocation(e){let t=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:e})&&t.push(n);return t}resolveEndpointLocationOrThrow(e){let t=this.resolveEndpointLocation(e);if(t.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return t}needsRequestParameter({request:e,inlinePathParameters:t,inlineFileProperties:n}){var a;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:t})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:n}):!((a=e.metadata)!=null&&a.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:t}){var n,a;return t&&((a=(n=e.metadata)==null?void 0:n.includePathParameters)!=null?a:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:O(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":{let n=t.environments.find(a=>a.id===e);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=t.environments.find(a=>a.id===e);return n==null?void 0:n.name}default:O(t)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:F.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":return this.errors.add({severity:F.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=t.environments[0];if(n==null)return this.errors.add({severity:F.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let a=new Set(cr(n.urls));for(let i of cr(e))a.has(i)&&a.delete(i);return a.size>0?(this.errors.add({severity:F.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${cr(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:F.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:F.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:F.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:t}){return new Error(`Expected auth type ${e.type}, got ${t.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:t}){return new Error(`Expected ${e}, got ${typeof t}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:t}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t});default:O(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t}){return this.fileUploadHasBodyProperties({fileUpload:e})||t&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:O(t)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:O(t)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:t}){return e.location.method===t.method&&e.location.path===t.path}};s();u();var He;(function(r){r.Concise="concise",r.Full="full"})(He||(He={}));s();u();var re={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};s();u();s();u();s();u();s();u();var Ye=class extends pr{constructor({packageName:t,customConfig:n,formatter:a}){super();w(this,"packageName");w(this,"customConfig");w(this,"formatter");w(this,"imports",new Set);this.packageName=t,this.customConfig=n,this.formatter=a!=null?a:new fr}addImport(t){this.imports.add(t)}getImports(){return new Set(this.imports)}};var vr=class extends Ye{constructor({packageName:e,customConfig:t,formatter:n}){super({packageName:e,customConfig:t,formatter:n})}async toStringAsync(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.format(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
13
+ `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:e,delimiter:t,writeFunction:r}){if(e.length>0){let a=e[0];a!=null&&r(a);for(let i=1;i<e.length;i++){this.write(t);let s=e[i];s!=null&&r(s)}}}toString(){return this.buffer}writeInternal(e){if(e.length===0)return;let t=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=e.endsWith(`
14
+ `),this.lastCharacterIsSemicolon=e.endsWith(";");let r=e.split(`
15
+ `),a=ee&&!this.shouldSkipTracking(r)&&this.lastCharacterIsNewline;t&&(this.lastLine=`${this.lastLine}${r.shift()||""}`),this.lastCharacterIsNewline&&r.pop(),this.lineBuffer.push(...r),a&&this.appendTrackingComment()}set lastLine(e){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=e:this.lineBuffer.push(e)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(e){return!1}formatStack(e,t=""){return e.map(r=>`${t?`(${t}) `:""} ${r.fn} - ${r.path} : ${r.position}`)}filterStack(e){return e.filter(t=>!t.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let e=[...this.formatStack(this.filterStack(Pt({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,sr){case"single":return this.singleLineTrackingComment(e);case"multiline":return this.multiLineTrackingComment(e);case"box":return this.boxTrackingComment(e)}}singleLineTrackingComment(e){this.lastLine=`${this.lastLine} // ${e.join(" ")}`}multiLineTrackingComment(e){this.lineBuffer.push(...e.map(t=>` // ${t}`))}boxTrackingComment(e){this.lineBuffer.push("/*",...e.map(t=>` ${t}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return so}};c();l();function ur(n){return(n==null?void 0:n.name)!=null&&(n==null?void 0:n.assignment)!=null}c();l();c();l();c();l();var lt=class{constructor(){g(this,"reporter");g(this,"snippet");g(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:t}){this.shouldUpdate({snippet:t,reporter:e.errors})&&(this.reporter=e.errors.clone(),this.snippet=t)}getResponseOrThrow({endpoint:e}){var t;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(t=this.err)!=null?t:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}shouldUpdate({snippet:e,reporter:t}){var r,a;return this.reporter==null||this.reporter.size()>0&&t.size()===0?!0:e.length>((a=(r=this.snippet)==null?void 0:r.length)!=null?a:0)}};var ft=class{constructor(e){g(this,"context");this.context=e}async generate(e,t={}){let r=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let a=new lt;for(let i of r){let s=this.context.clone(),o=this.createSnippetGenerator(s);try{let f=await o.generateSnippet({endpoint:i,request:e,options:t});if(s.errors.empty())return{snippet:f,errors:void 0};a.update({context:s,snippet:f})}catch(f){a.err==null&&(a.err=f)}}return a.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e,t={}){let r=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let a=new lt;for(let i of r){let s=this.context.clone(),o=this.createSnippetGenerator(s);try{let f=o.generateSnippetSync({endpoint:i,request:e,options:t});if(s.errors.empty())return{snippet:f,errors:void 0};a.update({context:s,snippet:f})}catch(f){a.err==null&&(a.err=f)}}return a.getResponseOrThrow({endpoint:e.endpoint})}};c();l();c();l();c();l();var pt=class{constructor(){g(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let r=e.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};c();l();var E={Critical:"CRITICAL",Warning:"WARNING"},dt=class n{constructor(){g(this,"errors");g(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(_(m({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(t=>t.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new n;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let t=[];for(let r of e){if(typeof r=="string"){t.push(r);continue}t[t.length-1]+=`[${r.index}]`}return t}};var mt=class{constructor({ir:e,config:t,options:r={}}){g(this,"config");g(this,"options");g(this,"errors");g(this,"_ir");g(this,"httpEndpointReferenceParser");this._ir=e,this.config=t,this.options=r,this.errors=new dt,this.httpEndpointReferenceParser=new pt}associateQueryParametersByWireValue({parameters:e,values:t}){let r=[];for(let[a,i]of Object.entries(t)){this.errors.scope(a);try{let s=e.find(f=>f.name.wireValue===a);if(s==null)throw this.newParameterNotRecognizedError(a);let o=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;r.push({name:s.name,typeReference:s.typeReference,value:o})}finally{this.errors.unscope()}}return r}associateByWireValueOrDefault({parameters:e,values:t}){let r=[];for(let a of e){this.errors.scope(a.name.wireValue);try{let i=t[a.name.wireValue];if(i==null)if(a.typeReference.type==="primitive"&&a.typeReference.value==="STRING")i=`<${a.name.wireValue}>`;else{this.errors.add({severity:E.Critical,message:this.newParameterNotRecognizedError(a.name.wireValue).message});continue}r.push({name:a.name,typeReference:a.typeReference,value:i})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:e,values:t,ignoreMissingParameters:r}){let a=[];for(let[i,s]of Object.entries(t)){this.errors.scope(i);try{let o=e.find(f=>f.name.wireValue===i);if(o==null){if(r)continue;this.errors.add({severity:E.Critical,message:this.newParameterNotRecognizedError(i).message});continue}a.push({name:o.name,typeReference:o.typeReference,value:s})}finally{this.errors.unscope()}}return a}getExampleObjectProperties({parameters:e,snippetObject:t}){let r=typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{},a=[];for(let i of e){let s=r[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&a.push({name:i.name,typeReference:i.typeReference,value:null}):a.push({name:i.name,typeReference:i.typeReference,value:s})}return a}getSingleFileValue({property:e,record:t}){let r=t[e.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:E.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:e,record:t}){let r=t[e.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:E.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let a=[];for(let i of r){if(typeof i!="string"){this.errors.add({severity:E.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}a.push(i)}return a}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:E.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let t=this._ir.types[e];if(t==null){this.errors.add({severity:E.Critical,message:`Type identified by "${e}" could not be found`});return}return t}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t}){let r=this.getRecord(t);if(r==null)return;let a=e.discriminant.wireValue,i=r[a];if(i==null){this.errors.add({severity:E.Critical,message:this.newParameterNotRecognizedError(a).message});return}if(typeof i!="string"){this.errors.add({severity:E.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:E.Critical,message:`No type found for discriminant value "${i}"`});return}let d=r,{[a]:o}=d,f=wr(d,[vr(a)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:f}}resolveEndpointOrThrow(e){let t=this.httpEndpointReferenceParser.tryParse(e);if(t==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(t)}resolveEndpointLocation(e){let t=[];for(let r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:e})&&t.push(r);return t}resolveEndpointLocationOrThrow(e){let t=this.resolveEndpointLocation(e);if(t.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return t}needsRequestParameter({request:e,inlinePathParameters:t,inlineFileProperties:r}){var a;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:t})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:r}):!((a=e.metadata)!=null&&a.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:t}){var r,a;return t&&((a=(r=e.metadata)==null?void 0:r.includePathParameters)!=null?a:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:S(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":{let r=t.environments.find(a=>a.id===e);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=t.environments.find(a=>a.id===e);return r==null?void 0:r.name}default:S(t)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:E.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":return this.errors.add({severity:E.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let r=t.environments[0];if(r==null)return this.errors.add({severity:E.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let a=new Set(st(r.urls));for(let i of st(e))a.has(i)&&a.delete(i);return a.size>0?(this.errors.add({severity:E.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${st(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:E.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:E.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:E.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:t}){return new Error(`Expected auth type ${e.type}, got ${t.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:t}){return new Error(`Expected ${e}, got ${typeof t}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:t}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t});default:S(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t}){return this.fileUploadHasBodyProperties({fileUpload:e})||t&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:S(t)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:S(t)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:t}){return e.location.method===t.method&&e.location.path===t.path}};c();l();var ke;(function(n){n.Concise="concise",n.Full="full"})(ke||(ke={}));c();l();var z={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};c();l();c();l();c();l();c();l();var Re=class extends ct{constructor({packageName:t,customConfig:r,formatter:a}){super();g(this,"packageName");g(this,"customConfig");g(this,"formatter");g(this,"imports",new Set);this.packageName=t,this.customConfig=r,this.formatter=a!=null?a:new ut}addImport(t){this.imports.add(t)}getImports(){return new Set(this.imports)}};var ht=class extends Re{constructor({packageName:e,customConfig:t,formatter:r}){super({packageName:e,customConfig:t,formatter:r})}async toStringAsync(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.format(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
25
16
  ${e}`)}return e}toString(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
26
17
  ${e}`)}return e}getContent(){let e=`package ${this.packageName};
27
18
 
28
19
  `,t=this.stringifyImports();return t.length>0?`${e}${t}
29
20
 
30
21
  ${this.buffer}`:e+this.buffer}stringifyImports(){return Array.from(this.imports).filter(e=>e!==this.packageName).map(e=>`import ${e};`).sort().join(`
31
- `)}};s();u();s();u();var L={};Rr(L,{BRAND:()=>Xv,DIRTY:()=>Je,EMPTY_PATH:()=>Ev,INVALID:()=>R,NEVER:()=>Ux,OK:()=>W,ParseStatus:()=>V,Schema:()=>I,ZodAny:()=>Le,ZodArray:()=>Ae,ZodBigInt:()=>Xe,ZodBoolean:()=>Qe,ZodBranded:()=>wr,ZodCatch:()=>ct,ZodDate:()=>et,ZodDefault:()=>lt,ZodDiscriminatedUnion:()=>xn,ZodEffects:()=>ee,ZodEnum:()=>st,ZodError:()=>Z,ZodFirstPartyTypeKind:()=>k,ZodFunction:()=>bn,ZodIntersection:()=>at,ZodIssueCode:()=>v,ZodLazy:()=>it,ZodLiteral:()=>ot,ZodMap:()=>$t,ZodNaN:()=>Dt,ZodNativeEnum:()=>ut,ZodNever:()=>ne,ZodNull:()=>rt,ZodNullable:()=>de,ZodNumber:()=>Ke,ZodObject:()=>H,ZodOptional:()=>X,ZodParsedType:()=>T,ZodPipeline:()=>br,ZodPromise:()=>Ue,ZodReadonly:()=>ft,ZodRecord:()=>wn,ZodSchema:()=>I,ZodSet:()=>qt,ZodString:()=>Fe,ZodSymbol:()=>Mt,ZodTransformer:()=>ee,ZodTuple:()=>pe,ZodType:()=>I,ZodUndefined:()=>tt,ZodUnion:()=>nt,ZodUnknown:()=>Se,ZodVoid:()=>jt,addIssueToContext:()=>b,any:()=>sx,array:()=>fx,bigint:()=>rx,boolean:()=>nf,coerce:()=>Lx,custom:()=>ef,date:()=>nx,datetimeRegex:()=>Xc,defaultErrorMap:()=>Te,discriminatedUnion:()=>hx,effect:()=>kx,enum:()=>Sx,function:()=>bx,getErrorMap:()=>Lt,getParsedType:()=>fe,instanceof:()=>ex,intersection:()=>yx,isAborted:()=>gn,isAsync:()=>Ut,isDirty:()=>vn,isValid:()=>Oe,late:()=>Qv,lazy:()=>Tx,literal:()=>_x,makeIssue:()=>xr,map:()=>xx,nan:()=>tx,nativeEnum:()=>Ax,never:()=>lx,null:()=>ox,nullable:()=>Ix,number:()=>rf,object:()=>px,objectUtil:()=>Qa,oboolean:()=>Fx,onumber:()=>Ox,optional:()=>Nx,ostring:()=>Cx,pipeline:()=>Px,preprocess:()=>Ex,promise:()=>Rx,quotelessJson:()=>kv,record:()=>vx,set:()=>wx,setErrorMap:()=>Iv,strictObject:()=>dx,string:()=>tf,symbol:()=>ax,transformer:()=>kx,tuple:()=>gx,undefined:()=>ix,union:()=>mx,unknown:()=>ux,util:()=>C,void:()=>cx});s();u();s();u();s();u();s();u();s();u();var C;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{let i={};for(let o of a)i[o]=o;return i},r.getValidEnumValues=a=>{let i=r.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(let l of i)o[l]=a[l];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},r.find=(a,i)=>{for(let o of a)if(i(o))return o},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(C||(C={}));var Qa;(function(r){r.mergeShapes=(e,t)=>h(h({},e),t)})(Qa||(Qa={}));var T=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fe=r=>{switch(typeof r){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(r)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":return Array.isArray(r)?T.array:r===null?T.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?T.promise:typeof Map!="undefined"&&r instanceof Map?T.map:typeof Set!="undefined"&&r instanceof Set?T.set:typeof Date!="undefined"&&r instanceof Date?T.date:T.object;default:return T.unknown}};var v=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kv=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),Z=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let l=n,f=0;for(;f<o.path.length;){let d=o.path[f];f===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(o))):l[d]=l[d]||{_errors:[]},l=l[d],f++}}};return a(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Z.create=r=>new Z(r);var Nv=(r,e)=>{let t;switch(r.code){case v.invalid_type:r.received===T.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case v.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,C.jsonStringifyReplacer)}`;break;case v.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(r.keys,", ")}`;break;case v.invalid_union:t="Invalid input";break;case v.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(r.options)}`;break;case v.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(r.options)}, received '${r.received}'`;break;case v.invalid_arguments:t="Invalid function arguments";break;case v.invalid_return_type:t="Invalid function return type";break;case v.invalid_date:t="Invalid date";break;case v.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:C.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case v.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case v.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case v.custom:t="Invalid input";break;case v.invalid_intersection_types:t="Intersection results could not be merged";break;case v.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case v.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(r)}return{message:t}},Te=Nv;var Zc=Te;function Iv(r){Zc=r}function Lt(){return Zc}s();u();var xr=r=>{let{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],o=A(h({},a),{path:i});if(a.message!==void 0)return A(h({},a),{path:i,message:a.message});let l="",f=n.filter(d=>!!d).slice().reverse();for(let d of f)l=d(o,{data:e,defaultError:l}).message;return A(h({},a),{path:i,message:l})},Ev=[];function b(r,e){let t=Lt(),n=xr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Te?void 0:Te].filter(a=>!!a)});r.common.issues.push(n)}var V=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let a of t){if(a.status==="aborted")return R;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let a of t){let i=await a.key,o=await a.value;n.push({key:i,value:o})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let a of t){let{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return R;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value!="undefined"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}},R=Object.freeze({status:"aborted"}),Je=r=>({status:"dirty",value:r}),W=r=>({status:"valid",value:r}),gn=r=>r.status==="aborted",vn=r=>r.status==="dirty",Oe=r=>r.status==="valid",Ut=r=>typeof Promise!="undefined"&&r instanceof Promise;s();u();s();u();var S;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(S||(S={}));var Q=class{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Hc=(r,e)=>{if(Oe(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Z(r.common.issues);return this._error=t,this._error}}};function N(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{var d,y;let{message:f}=r;return o.code==="invalid_enum_value"?{message:f!=null?f:l.defaultError}:typeof l.data=="undefined"?{message:(d=f!=null?f:n)!=null?d:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(y=f!=null?f:t)!=null?y:l.defaultError}},description:a}}var I=class{get description(){return this._def.description}_getType(e){return fe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:fe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new V,ctx:{common:e.parent.common,data:e.data,parsedType:fe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ut(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!=null?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Hc(n,a)}"~validate"(e){var n,a;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:t});return Oe(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Oe(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Ut(a)?a:Promise.resolve(a));return Hc(n,i)}refine(e,t){let n=a=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let o=e(a),l=()=>i.addIssue(h({code:v.custom},n(a)));return typeof Promise!="undefined"&&o instanceof Promise?o.then(f=>f?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new ee({schema:this,typeName:k.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return X.create(this,this._def)}nullable(){return de.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ae.create(this)}promise(){return Ue.create(this,this._def)}or(e){return nt.create([this,e],this._def)}and(e){return at.create(this,e,this._def)}transform(e){return new ee(A(h({},N(this._def)),{schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new lt(A(h({},N(this._def)),{innerType:this,defaultValue:t,typeName:k.ZodDefault}))}brand(){return new wr(h({typeName:k.ZodBranded,type:this},N(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new ct(A(h({},N(this._def)),{innerType:this,catchValue:t,typeName:k.ZodCatch}))}describe(e){let t=this.constructor;return new t(A(h({},this._def),{description:e}))}pipe(e){return br.create(this,e)}readonly(){return ft.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Pv=/^c[^\s-]{8,}$/i,Cv=/^[0-9a-z]+$/,Ov=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Fv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Lv=/^[a-z0-9_-]{21}$/i,Uv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Bv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Mv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ei,$v=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Dv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jc="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Gv=new RegExp(`^${Jc}$`);function Kc(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Zv(r){return new RegExp(`^${Kc(r)}$`)}function Xc(r){let e=`${Jc}T${Kc(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Hv(r,e){return!!((e==="v4"||!e)&&$v.test(r)||(e==="v6"||!e)&&Dv.test(r))}function Yv(r,e){if(!Uv.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch(t){return!1}}function Jv(r,e){return!!((e==="v4"||!e)&&qv.test(r)||(e==="v6"||!e)&&Vv.test(r))}var Fe=class r extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==T.string){let i=this._getOrReturnCtx(e);return b(i,{code:v.invalid_type,expected:T.string,received:i.parsedType}),R}let n=new V,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:v.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:v.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?b(a,{code:v.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&b(a,{code:v.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Mv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"email",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ei||(ei=new RegExp(jv,"u")),ei.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"emoji",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Fv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"uuid",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Lv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"nanoid",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Pv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cuid",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Cv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cuid2",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Ov.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"ulid",code:v.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(o){a=this._getOrReturnCtx(e,a),b(a,{validation:"url",code:v.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"regex",code:v.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),b(a,{code:v.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),b(a,{code:v.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),b(a,{code:v.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Xc(i).test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{code:v.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?Gv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{code:v.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Zv(i).test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{code:v.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Bv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"duration",code:v.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Hv(e.data,i.version)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"ip",code:v.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Yv(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"jwt",code:v.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Jv(e.data,i.version)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"cidr",code:v.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Wv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"base64",code:v.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?zv.test(e.data)||(a=this._getOrReturnCtx(e,a),b(a,{validation:"base64url",code:v.invalid_string,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),h({validation:t,code:v.invalid_string},S.errToObj(n)))}_addCheck(e){return new r(A(h({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(h({kind:"email"},S.errToObj(e)))}url(e){return this._addCheck(h({kind:"url"},S.errToObj(e)))}emoji(e){return this._addCheck(h({kind:"emoji"},S.errToObj(e)))}uuid(e){return this._addCheck(h({kind:"uuid"},S.errToObj(e)))}nanoid(e){return this._addCheck(h({kind:"nanoid"},S.errToObj(e)))}cuid(e){return this._addCheck(h({kind:"cuid"},S.errToObj(e)))}cuid2(e){return this._addCheck(h({kind:"cuid2"},S.errToObj(e)))}ulid(e){return this._addCheck(h({kind:"ulid"},S.errToObj(e)))}base64(e){return this._addCheck(h({kind:"base64"},S.errToObj(e)))}base64url(e){return this._addCheck(h({kind:"base64url"},S.errToObj(e)))}jwt(e){return this._addCheck(h({kind:"jwt"},S.errToObj(e)))}ip(e){return this._addCheck(h({kind:"ip"},S.errToObj(e)))}cidr(e){return this._addCheck(h({kind:"cidr"},S.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(h({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},S.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(h({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},S.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(h({kind:"duration"},S.errToObj(e)))}regex(e,t){return this._addCheck(h({kind:"regex",regex:e},S.errToObj(t)))}includes(e,t){return this._addCheck(h({kind:"includes",value:e,position:t==null?void 0:t.position},S.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(h({kind:"startsWith",value:e},S.errToObj(t)))}endsWith(e,t){return this._addCheck(h({kind:"endsWith",value:e},S.errToObj(t)))}min(e,t){return this._addCheck(h({kind:"min",value:e},S.errToObj(t)))}max(e,t){return this._addCheck(h({kind:"max",value:e},S.errToObj(t)))}length(e,t){return this._addCheck(h({kind:"length",value:e},S.errToObj(t)))}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new r(A(h({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(A(h({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(A(h({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Fe.create=r=>{var e;return new Fe(h({checks:[],typeName:k.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},N(r)))};function Kv(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}var Ke=class r extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==T.number){let i=this._getOrReturnCtx(e);return b(i,{code:v.invalid_type,expected:T.number,received:i.parsedType}),R}let n,a=new V;for(let i of this._def.checks)i.kind==="int"?C.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:v.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:v.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:v.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Kv(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),b(n,{code:v.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:v.not_finite,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,a){return new r(A(h({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(a)}]}))}_addCheck(e){return new r(A(h({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Ke.create=r=>new Ke(h({checks:[],typeName:k.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},N(r)));var Xe=class r extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==T.bigint)return this._getInvalidInput(e);let n,a=new V;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:v.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:v.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),b(n,{code:v.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return b(t,{code:v.invalid_type,expected:T.bigint,received:t.parsedType}),R}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,a){return new r(A(h({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(a)}]}))}_addCheck(e){return new r(A(h({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Xe.create=r=>{var e;return new Xe(h({checks:[],typeName:k.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},N(r)))};var Qe=class extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==T.boolean){let n=this._getOrReturnCtx(e);return b(n,{code:v.invalid_type,expected:T.boolean,received:n.parsedType}),R}return W(e.data)}};Qe.create=r=>new Qe(h({typeName:k.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},N(r)));var et=class r extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==T.date){let i=this._getOrReturnCtx(e);return b(i,{code:v.invalid_type,expected:T.date,received:i.parsedType}),R}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return b(i,{code:v.invalid_date}),R}let n=new V,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:v.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),b(a,{code:v.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):C.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r(A(h({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};et.create=r=>new et(h({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:k.ZodDate},N(r)));var Mt=class extends I{_parse(e){if(this._getType(e)!==T.symbol){let n=this._getOrReturnCtx(e);return b(n,{code:v.invalid_type,expected:T.symbol,received:n.parsedType}),R}return W(e.data)}};Mt.create=r=>new Mt(h({typeName:k.ZodSymbol},N(r)));var tt=class extends I{_parse(e){if(this._getType(e)!==T.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:v.invalid_type,expected:T.undefined,received:n.parsedType}),R}return W(e.data)}};tt.create=r=>new tt(h({typeName:k.ZodUndefined},N(r)));var rt=class extends I{_parse(e){if(this._getType(e)!==T.null){let n=this._getOrReturnCtx(e);return b(n,{code:v.invalid_type,expected:T.null,received:n.parsedType}),R}return W(e.data)}};rt.create=r=>new rt(h({typeName:k.ZodNull},N(r)));var Le=class extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return W(e.data)}};Le.create=r=>new Le(h({typeName:k.ZodAny},N(r)));var Se=class extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return W(e.data)}};Se.create=r=>new Se(h({typeName:k.ZodUnknown},N(r)));var ne=class extends I{_parse(e){let t=this._getOrReturnCtx(e);return b(t,{code:v.invalid_type,expected:T.never,received:t.parsedType}),R}};ne.create=r=>new ne(h({typeName:k.ZodNever},N(r)));var jt=class extends I{_parse(e){if(this._getType(e)!==T.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:v.invalid_type,expected:T.void,received:n.parsedType}),R}return W(e.data)}};jt.create=r=>new jt(h({typeName:k.ZodVoid},N(r)));var Ae=class r extends I{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==T.array)return b(t,{code:v.invalid_type,expected:T.array,received:t.parsedType}),R;if(a.exactLength!==null){let o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&(b(t,{code:o?v.too_big:v.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(b(t,{code:v.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(b(t,{code:v.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>a.type._parseAsync(new Q(t,o,t.path,l)))).then(o=>V.mergeArray(n,o));let i=[...t.data].map((o,l)=>a.type._parseSync(new Q(t,o,t.path,l)));return V.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new r(A(h({},this._def),{minLength:{value:e,message:S.toString(t)}}))}max(e,t){return new r(A(h({},this._def),{maxLength:{value:e,message:S.toString(t)}}))}length(e,t){return new r(A(h({},this._def),{exactLength:{value:e,message:S.toString(t)}}))}nonempty(e){return this.min(1,e)}};Ae.create=(r,e)=>new Ae(h({type:r,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray},N(e)));function Bt(r){if(r instanceof H){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=X.create(Bt(n))}return new H(A(h({},r._def),{shape:()=>e}))}else return r instanceof Ae?new Ae(A(h({},r._def),{type:Bt(r.element)})):r instanceof X?X.create(Bt(r.unwrap())):r instanceof de?de.create(Bt(r.unwrap())):r instanceof pe?pe.create(r.items.map(e=>Bt(e))):r}var H=class r extends I{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==T.object){let d=this._getOrReturnCtx(e);return b(d,{code:v.invalid_type,expected:T.object,received:d.parsedType}),R}let{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ne&&this._def.unknownKeys==="strip"))for(let d in a.data)o.includes(d)||l.push(d);let f=[];for(let d of o){let y=i[d],g=a.data[d];f.push({key:{status:"valid",value:d},value:y._parse(new Q(a,g,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof ne){let d=this._def.unknownKeys;if(d==="passthrough")for(let y of l)f.push({key:{status:"valid",value:y},value:{status:"valid",value:a.data[y]}});else if(d==="strict")l.length>0&&(b(a,{code:v.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let y of l){let g=a.data[y];f.push({key:{status:"valid",value:y},value:d._parse(new Q(a,g,a.path,y)),alwaysSet:y in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let y of f){let g=await y.key,_=await y.value;d.push({key:g,value:_,alwaysSet:y.alwaysSet})}return d}).then(d=>V.mergeObjectSync(n,d)):V.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new r(h(A(h({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,o,l,f;let a=(l=(o=(i=this._def).errorMap)==null?void 0:o.call(i,t,n).message)!=null?l:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=S.errToObj(e).message)!=null?f:a}:{message:a}}}:{}))}strip(){return new r(A(h({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(A(h({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new r(A(h({},this._def),{shape:()=>h(h({},this._def.shape()),e)}))}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>h(h({},this._def.shape()),e._def.shape()),typeName:k.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r(A(h({},this._def),{catchall:e}))}pick(e){let t={};for(let n of C.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r(A(h({},this._def),{shape:()=>t}))}omit(e){let t={};for(let n of C.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r(A(h({},this._def),{shape:()=>t}))}deepPartial(){return Bt(this)}partial(e){let t={};for(let n of C.objectKeys(this.shape)){let a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new r(A(h({},this._def),{shape:()=>t}))}required(e){let t={};for(let n of C.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof X;)i=i._def.innerType;t[n]=i}return new r(A(h({},this._def),{shape:()=>t}))}keyof(){return Qc(C.objectKeys(this.shape))}};H.create=(r,e)=>new H(h({shape:()=>r,unknownKeys:"strip",catchall:ne.create(),typeName:k.ZodObject},N(e)));H.strictCreate=(r,e)=>new H(h({shape:()=>r,unknownKeys:"strict",catchall:ne.create(),typeName:k.ZodObject},N(e)));H.lazycreate=(r,e)=>new H(h({shape:r,unknownKeys:"strip",catchall:ne.create(),typeName:k.ZodObject},N(e)));var nt=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;let o=i.map(l=>new Z(l.ctx.common.issues));return b(t,{code:v.invalid_union,unionErrors:o}),R}if(t.common.async)return Promise.all(n.map(async i=>{let o=A(h({},t),{common:A(h({},t.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let i,o=[];for(let f of n){let d=A(h({},t),{common:A(h({},t.common),{issues:[]}),parent:null}),y=f._parseSync({data:t.data,path:t.path,parent:d});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let l=o.map(f=>new Z(f));return b(t,{code:v.invalid_union,unionErrors:l}),R}}get options(){return this._def.options}};nt.create=(r,e)=>new nt(h({options:r,typeName:k.ZodUnion},N(e)));var _e=r=>r instanceof it?_e(r.schema):r instanceof ee?_e(r.innerType()):r instanceof ot?[r.value]:r instanceof st?r.options:r instanceof ut?C.objectValues(r.enum):r instanceof lt?_e(r._def.innerType):r instanceof tt?[void 0]:r instanceof rt?[null]:r instanceof X?[void 0,..._e(r.unwrap())]:r instanceof de?[null,..._e(r.unwrap())]:r instanceof wr||r instanceof ft?_e(r.unwrap()):r instanceof ct?_e(r._def.innerType):[],xn=class r extends I{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.object)return b(t,{code:v.invalid_type,expected:T.object,received:t.parsedType}),R;let n=this.discriminator,a=t.data[n],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(b(t,{code:v.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),R)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let a=new Map;for(let i of t){let o=_e(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,i)}}return new r(h({typeName:k.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a},N(n)))}};function ti(r,e){let t=fe(r),n=fe(e);if(r===e)return{valid:!0,data:r};if(t===T.object&&n===T.object){let a=C.objectKeys(e),i=C.objectKeys(r).filter(l=>a.indexOf(l)!==-1),o=h(h({},r),e);for(let l of i){let f=ti(r[l],e[l]);if(!f.valid)return{valid:!1};o[l]=f.data}return{valid:!0,data:o}}else if(t===T.array&&n===T.array){if(r.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<r.length;i++){let o=r[i],l=e[i],f=ti(o,l);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===T.date&&n===T.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var at=class extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(gn(i)||gn(o))return R;let l=ti(i.value,o.value);return l.valid?((vn(i)||vn(o))&&t.dirty(),{status:t.value,value:l.data}):(b(n,{code:v.invalid_intersection_types}),R)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};at.create=(r,e,t)=>new at(h({left:r,right:e,typeName:k.ZodIntersection},N(t)));var pe=class r extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==T.array)return b(n,{code:v.invalid_type,expected:T.array,received:n.parsedType}),R;if(n.data.length<this._def.items.length)return b(n,{code:v.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:v.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...n.data].map((o,l)=>{let f=this._def.items[l]||this._def.rest;return f?f._parse(new Q(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>V.mergeArray(t,o)):V.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r(A(h({},this._def),{rest:e}))}};pe.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pe(h({items:r,typeName:k.ZodTuple,rest:null},N(e)))};var wn=class r extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==T.object)return b(n,{code:v.invalid_type,expected:T.object,received:n.parsedType}),R;let a=[],i=this._def.keyType,o=this._def.valueType;for(let l in n.data)a.push({key:i._parse(new Q(n,l,n.path,l)),value:o._parse(new Q(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?V.mergeObjectAsync(t,a):V.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof I?new r(h({keyType:e,valueType:t,typeName:k.ZodRecord},N(n))):new r(h({keyType:Fe.create(),valueType:e,typeName:k.ZodRecord},N(t)))}},$t=class extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==T.map)return b(n,{code:v.invalid_type,expected:T.map,received:n.parsedType}),R;let a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,f],d)=>({key:a._parse(new Q(n,l,n.path,[d,"key"])),value:i._parse(new Q(n,f,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let f of o){let d=await f.key,y=await f.value;if(d.status==="aborted"||y.status==="aborted")return R;(d.status==="dirty"||y.status==="dirty")&&t.dirty(),l.set(d.value,y.value)}return{status:t.value,value:l}})}else{let l=new Map;for(let f of o){let d=f.key,y=f.value;if(d.status==="aborted"||y.status==="aborted")return R;(d.status==="dirty"||y.status==="dirty")&&t.dirty(),l.set(d.value,y.value)}return{status:t.value,value:l}}}};$t.create=(r,e,t)=>new $t(h({valueType:e,keyType:r,typeName:k.ZodMap},N(t)));var qt=class r extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==T.set)return b(n,{code:v.invalid_type,expected:T.set,received:n.parsedType}),R;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(b(n,{code:v.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(b(n,{code:v.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function o(f){let d=new Set;for(let y of f){if(y.status==="aborted")return R;y.status==="dirty"&&t.dirty(),d.add(y.value)}return{status:t.value,value:d}}let l=[...n.data.values()].map((f,d)=>i._parse(new Q(n,f,n.path,d)));return n.common.async?Promise.all(l).then(f=>o(f)):o(l)}min(e,t){return new r(A(h({},this._def),{minSize:{value:e,message:S.toString(t)}}))}max(e,t){return new r(A(h({},this._def),{maxSize:{value:e,message:S.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};qt.create=(r,e)=>new qt(h({valueType:r,minSize:null,maxSize:null,typeName:k.ZodSet},N(e)));var bn=class r extends I{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.function)return b(t,{code:v.invalid_type,expected:T.function,received:t.parsedType}),R;function n(l,f){return xr({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lt(),Te].filter(d=>!!d),issueData:{code:v.invalid_arguments,argumentsError:f}})}function a(l,f){return xr({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lt(),Te].filter(d=>!!d),issueData:{code:v.invalid_return_type,returnTypeError:f}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Ue){let l=this;return W(async function(...f){let d=new Z([]),y=await l._def.args.parseAsync(f,i).catch(E=>{throw d.addIssue(n(f,E)),d}),g=await Reflect.apply(o,this,y);return await l._def.returns._def.type.parseAsync(g,i).catch(E=>{throw d.addIssue(a(g,E)),d})})}else{let l=this;return W(function(...f){let d=l._def.args.safeParse(f,i);if(!d.success)throw new Z([n(f,d.error)]);let y=Reflect.apply(o,this,d.data),g=l._def.returns.safeParse(y,i);if(!g.success)throw new Z([a(y,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r(A(h({},this._def),{args:pe.create(e).rest(Se.create())}))}returns(e){return new r(A(h({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r(h({args:e||pe.create([]).rest(Se.create()),returns:t||Se.create(),typeName:k.ZodFunction},N(n)))}},it=class extends I{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};it.create=(r,e)=>new it(h({getter:r,typeName:k.ZodLazy},N(e)));var ot=class extends I{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return b(t,{received:t.data,code:v.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:e.data}}get value(){return this._def.value}};ot.create=(r,e)=>new ot(h({value:r,typeName:k.ZodLiteral},N(e)));function Qc(r,e){return new st(h({values:r,typeName:k.ZodEnum},N(e)))}var st=class r extends I{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return b(t,{expected:C.joinValues(n),received:t.parsedType,code:v.invalid_type}),R}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return b(t,{received:t.data,code:v.invalid_enum_value,options:n}),R}return W(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,h(h({},this._def),t))}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),h(h({},this._def),t))}};st.create=Qc;var ut=class extends I{_parse(e){let t=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==T.string&&n.parsedType!==T.number){let a=C.objectValues(t);return b(n,{expected:C.joinValues(a),received:n.parsedType,code:v.invalid_type}),R}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=C.objectValues(t);return b(n,{received:n.data,code:v.invalid_enum_value,options:a}),R}return W(e.data)}get enum(){return this._def.values}};ut.create=(r,e)=>new ut(h({values:r,typeName:k.ZodNativeEnum},N(e)));var Ue=class extends I{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==T.promise&&t.common.async===!1)return b(t,{code:v.invalid_type,expected:T.promise,received:t.parsedType}),R;let n=t.parsedType===T.promise?t.data:Promise.resolve(t.data);return W(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ue.create=(r,e)=>new Ue(h({type:r,typeName:k.ZodPromise},N(e)));var ee=class extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{b(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return R;let f=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return f.status==="aborted"?R:f.status==="dirty"?Je(f.value):t.value==="dirty"?Je(f.value):f});{if(t.value==="aborted")return R;let l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?R:l.status==="dirty"?Je(l.value):t.value==="dirty"?Je(l.value):l}}if(a.type==="refinement"){let o=l=>{let f=a.refinement(l,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?R:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?R:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Oe(o))return R;let l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Oe(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:t.value,value:l})):R);C.assertNever(a)}};ee.create=(r,e,t)=>new ee(h({schema:r,typeName:k.ZodEffects,effect:e},N(t)));ee.createWithPreprocess=(r,e,t)=>new ee(h({schema:e,effect:{type:"preprocess",transform:r},typeName:k.ZodEffects},N(t)));var X=class extends I{_parse(e){return this._getType(e)===T.undefined?W(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};X.create=(r,e)=>new X(h({innerType:r,typeName:k.ZodOptional},N(e)));var de=class extends I{_parse(e){return this._getType(e)===T.null?W(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};de.create=(r,e)=>new de(h({innerType:r,typeName:k.ZodNullable},N(e)));var lt=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===T.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};lt.create=(r,e)=>new lt(h({innerType:r,typeName:k.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},N(e)));var ct=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=A(h({},t),{common:A(h({},t.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:h({},n)});return Ut(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ct.create=(r,e)=>new ct(h({innerType:r,typeName:k.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},N(e)));var Dt=class extends I{_parse(e){if(this._getType(e)!==T.nan){let n=this._getOrReturnCtx(e);return b(n,{code:v.invalid_type,expected:T.nan,received:n.parsedType}),R}return{status:"valid",value:e.data}}};Dt.create=r=>new Dt(h({typeName:k.ZodNaN},N(r)));var Xv=Symbol("zod_brand"),wr=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},br=class r extends I{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?R:i.status==="dirty"?(t.dirty(),Je(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?R:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:k.ZodPipeline})}},ft=class extends I{_parse(e){let t=this._def.innerType._parse(e),n=a=>(Oe(a)&&(a.value=Object.freeze(a.value)),a);return Ut(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}};ft.create=(r,e)=>new ft(h({innerType:r,typeName:k.ZodReadonly},N(e)));function Yc(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function ef(r,e={},t){return r?Le.create().superRefine((n,a)=>{var o,l;let i=r(n);if(i instanceof Promise)return i.then(f=>{var d,y;if(!f){let g=Yc(e,n),_=(y=(d=g.fatal)!=null?d:t)!=null?y:!0;a.addIssue(A(h({code:"custom"},g),{fatal:_}))}});if(!i){let f=Yc(e,n),d=(l=(o=f.fatal)!=null?o:t)!=null?l:!0;a.addIssue(A(h({code:"custom"},f),{fatal:d}))}}):Le.create()}var Qv={object:H.lazycreate},k;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(k||(k={}));var ex=(r,e={message:`Input not instance of ${r.name}`})=>ef(t=>t instanceof r,e),tf=Fe.create,rf=Ke.create,tx=Dt.create,rx=Xe.create,nf=Qe.create,nx=et.create,ax=Mt.create,ix=tt.create,ox=rt.create,sx=Le.create,ux=Se.create,lx=ne.create,cx=jt.create,fx=Ae.create,px=H.create,dx=H.strictCreate,mx=nt.create,hx=xn.create,yx=at.create,gx=pe.create,vx=wn.create,xx=$t.create,wx=qt.create,bx=bn.create,Tx=it.create,_x=ot.create,Sx=st.create,Ax=ut.create,Rx=Ue.create,kx=ee.create,Nx=X.create,Ix=de.create,Ex=ee.createWithPreprocess,Px=br.create,Cx=()=>tf().optional(),Ox=()=>rf().optional(),Fx=()=>nf().optional(),Lx={string:(r=>Fe.create(A(h({},r),{coerce:!0}))),number:(r=>Ke.create(A(h({},r),{coerce:!0}))),boolean:(r=>Qe.create(A(h({},r),{coerce:!0}))),bigint:(r=>Xe.create(A(h({},r),{coerce:!0}))),date:(r=>et.create(A(h({},r),{coerce:!0})))};var Ux=R;s();u();var af=L.strictObject({title:L.string(),content:L.string()});var ri=L.object({"base-api-exception-class-name":L.string().optional(),"base-exception-class-name":L.string().optional(),"client-class-name":L.string().optional(),"inline-file-properties":L.boolean().optional(),"inline-path-parameters":L.boolean().optional(),"package-layout":L.enum(["flat","nested"]).optional(),"package-prefix":L.string().optional(),"custom-dependencies":L.array(L.string()).optional(),"disable-required-property-builder-checks":L.boolean().optional(),"enable-forward-compatible-enums":L.boolean().optional(),"enable-inline-types":L.boolean().optional(),"enable-public-constructors":L.boolean().optional(),"generate-unknown-as-json-node":L.boolean().optional(),"json-include":L.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":L.boolean().optional(),"use-default-request-parameter-values":L.boolean().optional(),"enable-wire-tests":L.boolean().default(!0),"custom-readme-sections":L.array(af).optional(),"wrapped-aliases":L.boolean().optional()});var m={};Rr(m,{Access:()=>ni,AstNode:()=>M,Class:()=>pt,ClassInstantiation:()=>dt,ClassReference:()=>U,CodeBlock:()=>mt,Method:()=>ht,MethodInvocation:()=>yt,Parameter:()=>gt,Type:()=>Tr,TypeLiteral:()=>Y,Writer:()=>Ye,classReference:()=>r0,class_:()=>t0,codeblock:()=>e0,instantiateClass:()=>n0,invokeMethod:()=>a0,method:()=>i0,parameter:()=>o0});s();u();s();u();s();u();var ni={Public:"public",Protected:"protected",Private:"private"};s();u();s();u();var M=class extends Ze{async toStringAsync({packageName:e,customConfig:t,formatter:n}){let a=new vr({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toStringAsync()}toString({packageName:e,customConfig:t,formatter:n}){let a=new vr({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toString()}};var pt=class extends M{constructor({name:t,access:n}){super();w(this,"name");w(this,"access");w(this,"methods",[]);this.name=t,this.access=n}write(t){if(t.write(`${this.access} class ${this.name}`),this.isEmpty()){t.writeLine(" {}");return}t.writeLine(" {"),t.indent();for(let n of this.methods)t.writeNode(n),t.newLine();t.dedent(),t.write("}")}addMethod(t){this.methods.push(t)}isEmpty(){return this.methods.length===0}};s();u();s();u();s();u();s();u();var U=class extends M{constructor({name:t,packageName:n,fullyQualified:a}){super();w(this,"name");w(this,"packageName");w(this,"fullyQualified");this.name=t,this.packageName=n,this.fullyQualified=a!=null?a:!1}write(t){if(t.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){t.write(`${this.packageName}.${this.name}`);return}t.write(this.name)}};s();u();var Tr=class extends M{constructor(t){super();w(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"array":t.writeNode(this.internalType.value),t.write("[]");break;case"bigInteger":t.writeNode(Bx);break;case"boolean":t.write("Boolean");break;case"bytes":t.write("byte[]");break;case"date":t.write("String");break;case"dateTime":t.writeNode($x);break;case"double":t.write("Double");break;case"float":t.write("Float");break;case"generic":t.writeNode(this.internalType.value),t.write("<");for(let[n,a]of this.internalType.parameters.entries())t.writeNode(a),n<this.internalType.parameters.length-1&&t.write(", ");t.write(">");break;case"inputStream":t.writeNode(Vx);break;case"integer":t.write("Integer");break;case"iterable":this.writeIterable({writer:t,iterable:this.internalType});break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write("Long");break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"object":{t.write("Object");break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write("String");break;case"uuid":t.writeNode(Dx);break;case"void":t.write("Void");break;default:O(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(t){return new this({type:"array",value:t})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(t){return new this({type:"list",value:t})}static long(){return new this({type:"long"})}static map(t,n){return new this({type:"map",keyType:t,valueType:n})}static object(){return new this({type:"object"})}static optional(t){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t})}static reference(t){return new this({type:"reference",value:t})}static generic(t,n){return new this({type:"generic",value:t,parameters:n})}static set(t){return new this({type:"set",value:t})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(t){return new this({type:"iterable",value:t})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:t,list:n}){t.writeNode(Mx),t.write("<"),n.value.write(t),t.write(">")}writeMap({writer:t,map:n}){t.writeNode(jx),t.write("<"),n.keyType.write(t),t.write(", "),n.valueType.write(t),t.write(">")}writeOptional({writer:t,optional:n}){t.writeNode(Tn),t.write("<"),n.value.write(t),t.write(">")}writeIterable({writer:t,iterable:n}){t.writeNode(Tn),t.write("<"),n.value.write(t),t.write(">")}writeSet({writer:t,set:n}){t.writeNode(qx),t.write("<"),n.value.write(t),t.write(">")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},_n=new U({name:"Arrays",packageName:"java.util"}),Bx=new U({name:"BigInteger",packageName:"java.math"}),jN=new U({name:"HashMap",packageName:"java.util"}),Mx=new U({name:"List",packageName:"java.util"}),jx=new U({name:"Map",packageName:"java.util"}),$x=new U({name:"OffsetDateTime",packageName:"java.time"}),Tn=new U({name:"Optional",packageName:"java.util"}),qx=new U({name:"Set",packageName:"java.util"}),Dx=new U({name:"UUID",packageName:"java.util"}),Vx=new U({name:"InputStream",packageName:"java.io"});var Y=class r extends M{constructor(t){super();w(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:t,bigInteger:this.internalType});break;case"boolean":t.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:t,builder:this.internalType});break;case"bytes":t.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:t,class_:this.internalType});break}case"date":t.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:t,dateTime:this.internalType});break;case"double":{let n=this.internalType.value.toString();!n.includes(".")&&!n.includes("e")&&!n.includes("E")?t.write(`${n}.0`):t.write(n);break}case"enum":this.writeEnum({writer:t,enum_:this.internalType});break;case"float":t.write(`${this.internalType.value}f`);break;case"integer":t.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"raw":{this.internalType.value instanceof M?t.writeNode(this.internalType.value):t.write(this.internalType.value);break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:t,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:t,uuid:this.internalType});break;case"nop":break;default:O(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(t){return new this({type:"bigInteger",value:t})}static boolean(t){return new this({type:"boolean",value:t})}static builder({classReference:t,parameters:n}){return new this({type:"builder",classReference:t,parameters:n})}static bytes(t){return new this({type:"bytes",value:t})}static class_({reference:t,parameters:n}){return new this({type:"class",reference:t,parameters:n})}static date(t){return new this({type:"date",value:t})}static dateTime(t){return new this({type:"dateTime",value:t})}static double(t){return new this({type:"double",value:t})}static enum_({classReference:t,value:n}){return new this({type:"enum",classReference:t,value:n})}static float(t){return new this({type:"float",value:t})}static integer(t){return new this({type:"integer",value:t})}static list({valueType:t,values:n,isParameter:a}){return new this({type:"list",valueType:t,values:n,isParameter:a})}static long(t){return new this({type:"long",value:t})}static map({keyType:t,valueType:n,entries:a}){return new this({type:"map",keyType:t,valueType:n,entries:a})}static optional({value:t,useOf:n}){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t,useOf:n})}static raw(t){return new this({type:"raw",value:t})}static reference(t){return new this({type:"reference",value:t})}static set({valueType:t,values:n}){return new this({type:"set",valueType:t,values:n})}static string(t){return new this({type:"string",value:t})}static unknown(t){return new this({type:"unknown",value:t})}static uuid(t){return new this({type:"uuid",value:t})}static nop(){return new this({type:"nop"})}static isNop(t){return t.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:O(this.internalType)}}writeBigInteger({writer:t,bigInteger:n}){t.write("new "),t.writeNode(m.instantiateClass({classReference:Wx,arguments_:[r.string(n.value)]}))}writeBuilder({writer:t,builder:n}){t.writeNode(n.classReference),t.writeNewLineIfLastLineNot(),t.indent(),this.writeBuilderParameters({writer:t,parameters:this.orderBuilderParameters(Yx({parameters:n.parameters}))}),t.dedent()}writeBuilderParameters({writer:t,parameters:n}){t.writeLine(".builder()");for(let a of n)t.write(`.${a.name}(`),a.value.shouldWriteInLine()||t.newLine(),t.indent(),t.writeNode(a.value),t.dedent(),a.value.shouldWriteInLine()||t.newLine(),t.writeLine(")");t.writeNewLineIfLastLineNot(),t.write(".build()")}orderBuilderParameters(t){return t.sort((n,a)=>n.value.isOptional()&&!a.value.isOptional()?1:!n.value.isOptional()&&a.value.isOptional()?-1:0)}writeClass({writer:t,class_:n}){let a=Hx({parameters:n.parameters});t.writeNode(m.instantiateClass({classReference:n.reference,arguments_:a.map(i=>i.value)}))}writeDateTime({writer:t,dateTime:n}){t.writeNode(m.invokeMethod({on:Gx,method:"parse",arguments_:[r.string(n.value)]}))}writeEnum({writer:t,enum_:n}){t.writeNode(n.classReference),t.write("."+n.value)}writeList({writer:t,list:n}){this.writeIterable({writer:t,iterable:n})}writeMap({writer:t,map:n}){let a=Jx({entries:n.entries});if(a.length===0){t.write("new "),t.writeNode(Sn),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(Sn),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.writeLine(">() {{"),t.indent();for(let i of a)t.write("put("),t.writeNode(i.key),t.write(", "),t.writeNode(i.value),t.writeLine(");");t.dedent(),t.write("}}")}writeOptional({writer:t,optional:n}){if(!n.useOf){t.writeNode(n.value);return}t.writeNode(m.invokeMethod({on:Tn,method:"of",arguments_:[n.value]}))}writeSet({writer:t,set:n}){this.writeIterable({writer:t,iterable:n})}writeIterable({writer:t,iterable:n}){let a=n.type==="list"?ai:zx,i=Kx({values:n.values});if(n.type==="list"&&n.isParameter&&i.length>0){t.writeNode(m.invokeMethod({on:_n,method:"asList",arguments_:i}));return}if(i.length===0){t.write(`new ${a.name}<`),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(a),t.write("<"),t.writeNode(n.valueType),t.writeLine(">("),t.indent(),t.writeNode(m.invokeMethod({on:_n,method:"asList",arguments_:i})),t.writeNewLineIfLastLineNot(),t.dedent(),t.write(")")}writeUnknown({writer:t,value:n}){switch(typeof n){case"boolean":t.write(n.toString());return;case"string":t.write(`"${this.escapeString(n)}"`);return;case"number":t.write(n.toString());return;case"object":if(n==null){t.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:t,value:n});return}this.writeUnknownMap({writer:t,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:t,value:n}){if(n.length===0){t.write("new "),t.writeNode(ai),t.write("<Object>()");return}t.write("new "),t.writeNode(ai),t.write("<Object>("),t.writeNode(m.invokeMethod({on:_n,method:"asList",arguments_:n.map(a=>r.unknown(a))})),t.write(")")}writeUnknownMap({writer:t,value:n}){let a=Object.entries(n);if(a.length===0){t.write("new "),t.writeNode(Sn),t.write("<String, Object>()");return}t.writeLine("new "),t.writeNode(Sn),t.write("<String, Object>() {{"),t.indent();for(let[i,o]of a)t.write(`put("${i}", `),t.writeNode(r.unknown(o)),t.writeLine(");");t.dedent(),t.write("}}")}writeUUID({writer:t,uuid:n}){t.writeNode(m.invokeMethod({on:Zx,method:"fromString",arguments_:[r.string(n.value)]}))}escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},ai=new U({name:"ArrayList",packageName:"java.util"}),Wx=new U({name:"BigInteger",packageName:"java.math"}),Sn=new U({name:"HashMap",packageName:"java.util"}),zx=new U({name:"HashSet",packageName:"java.util"}),YN=new U({name:"List",packageName:"java.util"}),JN=new U({name:"Map",packageName:"java.util"}),Gx=new U({name:"OffsetDateTime",packageName:"java.time"}),KN=new U({name:"Set",packageName:"java.util"}),Zx=new U({name:"UUID",packageName:"java.util"});function Hx({parameters:r}){return r.filter(e=>!Y.isNop(e.value))}function Yx({parameters:r}){return r.filter(e=>!Y.isNop(e.value))}function Jx({entries:r}){return r.filter(e=>!Y.isNop(e.key)&&!Y.isNop(e.value))}function Kx({values:r}){return r.filter(e=>!Y.isNop(e))}function An({writer:r,arguments_:e}){let t=Qx(e);if(t.length===0){r.write("()");return}if(t.some(a=>a instanceof Y&&!a.shouldWriteInLine())){Xx({writer:r,arguments_:t});return}r.write("("),t.forEach((a,i)=>{i>0&&r.write(", "),of({writer:r,argument:a})}),r.write(")")}function Xx({writer:r,arguments_:e}){r.writeLine("("),r.indent(),e.forEach((t,n)=>{n>0&&r.writeLine(","),of({writer:r,argument:t})}),r.dedent(),e.length>0&&r.newLine(),r.write(")")}function of({writer:r,argument:e}){Xa(e)?r.writeNodeOrString(e.assignment):e.write(r)}function Qx(r){return r.filter(e=>!(e instanceof Y&&Y.isNop(e)))}var dt=class extends M{constructor({classReference:t,arguments_:n}){super();w(this,"classReference");w(this,"arguments_");this.classReference=t,this.arguments_=n}write(t){t.writeNode(this.classReference),An({writer:t,arguments_:this.arguments_})}};s();u();var mt=class extends M{constructor(t){super();w(this,"arg");this.arg=t}write(t){return new te(this.arg).write(t)}};s();u();var ht=class extends M{constructor({name:t,access:n,parameters:a,body:i,static_:o,return_:l}){super();w(this,"name");w(this,"access");w(this,"parameters");w(this,"body");w(this,"return_");w(this,"static_");this.name=t,this.access=n,this.parameters=a,this.body=i,this.return_=l,this.static_=o!=null?o:!1}write(t){if(t.write(`${this.access} `),this.static_&&t.write("static "),this.return_!=null?t.writeNode(this.return_):t.write("void"),t.write(` ${this.name}`),this.parameters.length===0)t.write("()");else if(this.parameters.length===1){if(t.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);t.writeNode(this.parameters[0]),t.write(")")}else t.writeLine("("),t.indent(),this.parameters.forEach((n,a)=>{a>0&&t.writeLine(", "),t.writeNode(n)}),t.dedent(),t.write(")");if(this.body==null){t.write(";");return}t.writeLine(" {"),t.indent(),t.writeNode(this.body),t.writeNewLineIfLastLineNot(),t.dedent(),t.write("}")}};s();u();var yt=class extends M{constructor({method:t,arguments_:n,on:a}){super();w(this,"on");w(this,"method");w(this,"arguments_");this.on=a,this.method=t,this.arguments_=n}write(t){this.on.write(t),t.write("."),t.write(this.method),An({writer:t,arguments_:this.arguments_})}};s();u();var gt=class extends M{constructor({name:t,type:n}){super();w(this,"name");w(this,"type");this.name=t,this.type=n}write(t){t.writeNode(this.type),t.write(` ${this.name}`)}};function e0(r){return new mt(r)}function t0(r){return new pt(r)}function r0(r){return new U(r)}function n0(r){return new dt(r)}function a0(r){return new yt(r)}function i0(r){return new ht(r)}function o0(r){return new gt(r)}s();u();var Rn=class{constructor({context:e}){w(this,"context");this.context=e}isNopTypeLiteral(e){var n;return((n=e.internalType)==null?void 0:n.type)==="nop"}wrapInOptionalIfNotNop(e,t=!1){return this.isNopTypeLiteral(e)?e:m.TypeLiteral.optional({value:e,useOf:t})}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:F.Critical,message:"Expected non-null value, but got null"}),m.TypeLiteral.nop());if(e.value===void 0)return m.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return this.convertLiteral({literal:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?m.TypeLiteral.nop():this.convertNamed({named:t,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion})}case"nullable":case"optional":{if(e.value===void 0||typeof e.value=="object"&&e.value!==null&&Object.keys(e.value).length===0&&e.typeReference.value.type==="named")return m.TypeLiteral.reference(m.invokeMethod({on:m.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(e.typeReference.value.type==="list"){let a=this.convertList({list:e.typeReference.value.value,value:e.value});return this.wrapInOptionalIfNotNop(a,!0)}let t=this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion}),n=e.as==="mapValue"||e.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(t,n)}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value});case"unknown":return this.convertUnknown({value:e.value});default:O(e.typeReference)}}convertList({list:e,value:t}){if(!Array.isArray(t))return this.context.errors.add({severity:F.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop();let n=e.type==="optional"||e.type==="nullable";return m.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((a,i)=>{this.context.errors.scope({index:i});try{if(n){let o=this.convert({typeReference:e.value,value:a});return this.wrapInOptionalIfNotNop(o,!0)}return this.convert({typeReference:e,value:a})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:e,value:t}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.string(n)}default:O(e)}}convertSet({set:e,value:t}){return Array.isArray(t)?m.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((n,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:F.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop())}convertMap({map:e,value:t}){return typeof t!="object"||t==null?(this.context.errors.add({severity:F.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),m.TypeLiteral.nop()):m.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(t).map(([n,a])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:e.key,value:n,as:"mapKey"}),value:this.convert({typeReference:e.value,value:a,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:t,as:n,inUndiscriminatedUnion:a}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:n,inUndiscriminatedUnion:a});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:O(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let n=this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(a==null)return m.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:i.typeId});return o==null?m.TypeLiteral.nop():m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:o,value:a.value})]}))}case"singleProperty":{let o=this.context.getRecord(a.value);if(o==null)return m.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:o[i.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:O(i)}}convertObject({object_:e,value:t,as:n}){var i;let a=this.context.associateByWireValue({parameters:e.properties,values:(i=this.context.getRecord(t))!=null?i:{}});return m.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),parameters:a.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:n})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:t}){let n=this.getEnumValueName({enum_:e,value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),value:n})}getEnumValueName({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:F.Critical,message:`Expected enum value string, got: ${typeof t}`});return}let n=e.values.find(a=>a.wireValue===t);if(n==null){this.context.errors.add({severity:F.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return this.context.getEnumName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return n==null?m.TypeLiteral.nop():this.context.isPrimitive(n.valueTypeReference)?m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]})):m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){for(let n of e.types)try{let a=this.convert({typeReference:n,value:t,inUndiscriminatedUnion:!0});return{valueTypeReference:n,typeInstantiation:a}}catch(a){continue}this.context.errors.add({severity:F.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value`})}getUndiscriminatedUnionFieldName({typeReference:e}){switch(e.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:e});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:e.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:e});case"named":{let t=this.context.resolveNamedType({typeId:e.value});return t==null?void 0:this.context.getClassName(t.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:e});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:e.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:e});case"unknown":return"Unknown";default:O(e)}}getUndiscriminatedUnionFieldNameForList({list:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`ListOf${t}`}getUndiscriminatedUnionFieldNameForMap({map:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e.key});if(t==null)return;let n=this.getUndiscriminatedUnionFieldName({typeReference:e.value});if(n!=null)return`MapOf${t}To${n}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Optional${t}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Nullable${t}`}getUndiscriminatedUnionFieldNameForSet({set:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`SetOf${t}`}getUndiscriminatedUnionFieldNameForLiteral({literal:e}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:e}){switch(e){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":return"Float";case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":return"BigInteger";case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:O(e)}}convertUnknown({value:e}){return m.TypeLiteral.unknown(e)}convertPrimitive({primitive:e,value:t,as:n}){switch(e){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.bigInteger(a)}default:O(e)}}getValueAsNumber({value:e,as:t}){let n=t==="mapKey"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:t}){let n=t==="mapKey"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:n})}};s();u();var kn=class{constructor({context:e}){w(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return m.Type.list(this.convert({typeReference:e.typeReference}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return m.Type.map(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?this.convertUnknown():this.convertNamed({named:t})}case"optional":case"nullable":return m.Type.optional(this.convert({typeReference:e.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return m.Type.set(this.convert({typeReference:e.typeReference}));case"unknown":return this.convertUnknown();default:O(e.typeReference)}}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return m.Type.reference(m.classReference({name:this.context.getClassName(e.declaration.name),packageName:this.context.getTypesPackageName(e.declaration.fernFilepath)}));default:O(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return m.Type.boolean();case"string":return m.Type.string()}}convertUnknown(){return m.Type.object()}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return m.Type.integer();case"UINT":return m.Type.integer();case"LONG":return m.Type.long();case"UINT_64":return m.Type.long();case"FLOAT":return m.Type.float();case"DOUBLE":return m.Type.double();case"BOOLEAN":return m.Type.boolean();case"STRING":return m.Type.string();case"DATE":return m.Type.date();case"DATE_TIME":return m.Type.dateTime();case"UUID":return m.Type.uuid();case"BASE_64":return m.Type.bytes();case"BIG_INTEGER":return m.Type.bigInteger();default:O(e)}}};s();u();var Nn=class{constructor({context:e}){w(this,"context");this.context=e}getFilePropertyInfo({body:e,value:t}){var i;let n={fileFields:[],bodyPropertyFields:[]},a=(i=this.context.getRecord(t))!=null?i:{};for(let o of e.properties)switch(o.type){case"file":n.fileFields.push({name:this.context.getMethodName(o.name),value:this.getSingleFileProperty({property:o,record:a})});break;case"fileArray":n.fileFields.push({name:this.context.getMethodName(o.name),value:this.getArrayFileProperty({property:o,record:a})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getMethodName(o.name.name),value:this.getBodyProperty({property:o,record:a})});break;default:O(o)}return n}getSingleFileProperty({property:e,record:t}){let n=this.context.getSingleFileValue({property:e,record:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.reference(this.context.getFileStreamFromString(n))}getArrayFileProperty({property:e,record:t}){let n=this.context.getFileArrayValues({property:e,record:t});if(n==null)return m.TypeLiteral.nop();for(let a of n)return m.TypeLiteral.reference(this.context.getFileStreamFromString(a));return m.TypeLiteral.nop()}getBodyProperty({property:e,record:t}){let n=t[e.name.wireValue];return n==null?m.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:n})}};var s0=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),In=class r extends gr{constructor({ir:t,config:n,options:a}){var i;super({ir:t,config:n,options:a});w(this,"ir");w(this,"customConfig");w(this,"dynamicTypeMapper");w(this,"dynamicTypeLiteralMapper");w(this,"filePropertyMapper");this.ir=t,this.customConfig=ri.parse((i=n.customConfig)!=null?i:{}),this.dynamicTypeMapper=new kn({context:this}),this.dynamicTypeLiteralMapper=new Rn({context:this}),this.filePropertyMapper=new Nn({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getClassName(t){return this.getName(t.pascalCase.safeName)}getEnumName(t){return this.getName(t.screamingSnakeCase.safeName)}getPropertyName(t){return this.getName(t.camelCase.safeName)}getMethodName(t){return this.getName(t.camelCase.safeName)}getRootClientClassReference(){return m.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["client-class-name"])!=null?n:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(t){let n=this.resolveEnvironmentName(t);if(n!=null)return m.codeblock(a=>{a.writeNode(this.getEnvironmentClassReference()),a.write("."),a.write(this.getEnumName(n))})}getEnvironmentClassReference(){return m.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:t}){return m.classReference({name:t.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(t.fernFilepath)})}getNullableClassReference(){return m.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return m.TypeLiteral.reference(m.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getFileStreamFromString(t){return m.TypeLiteral.reference(m.codeblock(n=>{n.write("new "),n.writeNode(this.getFileStreamClassReference()),n.write("("),n.writeNode(this.getByteArrayInputStreamClassReference()),n.write("("),n.writeNode(m.TypeLiteral.string(t)),n.write(".getBytes("),n.writeNode(this.getStandardCharsetsClassReference()),n.write(".UTF_8)))")}))}getFileStreamClassReference(){return m.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return m.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return m.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(t){switch(t.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(t.value);case"named":{let n=this.resolveNamedType({typeId:t.value});if(n==null)return!1;switch(n.type){case"alias":return this.isPrimitive(n.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:O(n)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:O(t)}}getRootPackageName(){let t=this.getPackagePrefixTokens();return this.joinPackageTokens(t)}getCorePackageName(){let t=this.getPackagePrefixTokens();return t.push("core"),this.joinPackageTokens(t)}getTypesPackageName(t){return this.getResourcesPackage(t,"types")}getRequestsPackageName(t){return this.getPackageLayout()==="flat"?this.getTypesPackageName(t):this.getResourcesPackage(t,"requests")}getResourcesPackage(t,n){let a=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":t!=null&&a.push(...t.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:t!=null&&t.allParts.length>0&&a.push("resources"),t!=null&&a.push(...t.allParts.map(i=>this.getPackageNameSegment(i)))}return n!=null&&a.push(n),this.joinPackageTokens(a)}getPackageName(t,n){let a=this.getPackageNameSegments(t);return a=n!=null?[...a,n]:a,[...this.getPackagePrefixTokens(),...a].join(".")}getPackageLayout(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["package-layout"])!=null?n:"nested"}shouldInlinePathParameters(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["inline-path-parameters"])!=null?n:!1}shouldInlineFileProperties(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["inline-file-properties"])!=null?n:!1}getPackageNameSegments(t){return t.packagePath.map(n=>this.getPackageNameSegment(n))}getPackageNameSegment(t){return t.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var n;if(((n=this.customConfig)==null?void 0:n["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let t=[];return t.push("com"),t.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),t.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),t}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return Ka(this.config.workspaceName)}startsWithNumber(t){return/^\d/.test(t)}splitOnNonAlphaNumericChar(t){return t.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(t){return t.replace(/-([a-z])/g,(n,a)=>a.toUpperCase()).replace(/^[a-z]/,n=>n.toUpperCase())}joinPackageTokens(t){return t.map(a=>this.startsWithNumber(a)?"_"+a:a).join(".")}getName(t){return this.isReservedName(t)?"_"+t:t}isReservedName(t){return s0.has(t)}};s();u();var sf="com.example.usage",u0="Example",l0="main",c0="args",uf="client",f0={type:"primitive",value:"STRING"},En=class{constructor({context:e,formatter:t}){w(this,"context");w(this,"formatter");this.context=e,this.formatter=t}async generateSnippet({endpoint:e,request:t,options:n}){var o;let a=this.getConfig(n);return await this.buildCodeBlock({endpoint:e,snippet:t,options:n}).toStringAsync({packageName:(o=a.fullStylePackageName)!=null?o:sf,customConfig:this.context.customConfig,formatter:this.formatter})}generateSnippetSync({endpoint:e,request:t,options:n}){var o;let a=this.getConfig(n);return this.buildCodeBlock({endpoint:e,snippet:t,options:n}).toString({packageName:(o=a.fullStylePackageName)!=null?o:sf,customConfig:this.context.customConfig,formatter:this.formatter})}buildCodeBlock({endpoint:e,snippet:t,options:n}){let a=m.codeblock(o=>{o.writeNodeStatement(this.constructClient({endpoint:e,snippet:t})),o.newLine(),o.writeNodeStatement(this.callMethod({endpoint:e,snippet:t}))}),i=this.getStyle(n);switch(i){case He.Concise:return a;case He.Full:return this.buildFullCodeBlock({body:a,options:n});default:O(i)}}constructClient({endpoint:e,snippet:t}){return m.codeblock(n=>{n.writeNode(this.context.getRootClientClassReference()),n.write(` ${uf} = `),n.writeNode(m.TypeLiteral.builder({classReference:this.context.getRootClientClassReference(),parameters:this.getRootClientBuilderArgs({endpoint:e,snippet:t})}))})}buildFullCodeBlock({body:e,options:t}){var o;let n=this.getConfig(t),a=m.class_({name:(o=n.fullStyleClassName)!=null?o:u0,access:m.Access.Public}),i=m.parameter({name:c0,type:m.Type.array(m.Type.string())});return a.addMethod(m.method({name:l0,access:m.Access.Public,static_:!0,parameters:[i],body:e})),a}getRootClientBuilderArgs({endpoint:e,snippet:t}){var l,f;let n=[];e.auth!=null&&(t.auth!=null?n.push(...this.getRootClientAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:F.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let a=this.getRootClientBaseUrlArg({baseUrl:t.baseURL,environment:t.environment});a!=null&&n.push(a),this.context.errors.scope(re.Headers),this.context.ir.headers!=null&&t.headers!=null&&n.push(...this.getRootClientHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope();let i=new Set;if([...(l=this.context.ir.pathParameters)!=null?l:[],...(f=e.request.pathParameters)!=null?f:[]].forEach(d=>{d.variable!=null&&i.add(d.variable)}),this.context.ir.variables!=null&&this.context.ir.variables.length>0){for(let d of this.context.ir.variables)if(i.has(d.id)){let y=d.name.camelCase.unsafeName;n.push({name:y,value:m.TypeLiteral.string(`YOUR_${d.name.screamingSnakeCase.unsafeName}`)})}}return n}getRootClientBaseUrlArg({baseUrl:e,environment:t}){var n;if(e!=null&&t!=null){this.context.errors.add({severity:F.Critical,message:"Cannot specify both baseUrl and environment options"});return}if(e!=null){if(((n=this.context.ir.environments)==null?void 0:n.environments.type)==="multipleBaseUrls"){this.context.errors.add({severity:F.Critical,message:"The Java SDK doesn't support a baseUrl when multiple URL environments are configured"});return}return{name:"url",value:m.TypeLiteral.string(e)}}if(t!=null){if(this.context.isSingleEnvironmentID(t)){let a=this.context.getEnvironmentTypeReferenceFromID(t);if(a==null){this.context.errors.add({severity:F.Warning,message:`Environment ${JSON.stringify(t)} was not found`});return}return{name:"environment",value:m.TypeLiteral.reference(a)}}if(this.context.isMultiEnvironmentValues(t))return this.context.validateMultiEnvironmentUrlValues(t)?{name:"environment",value:m.TypeLiteral.reference(m.instantiateClass({classReference:this.context.getEnvironmentClassReference(),arguments_:Object.values(t).map(a=>this.context.dynamicTypeLiteralMapper.convert({typeReference:f0,value:a}))}))}:void 0}}getRootClientAuthArgs({auth:e,values:t}){if(t.type!==e.type)return this.addError(this.context.newAuthMismatchError({auth:e,values:t}).message),[];switch(e.type){case"basic":return t.type==="basic"?this.getRootClientBasicAuthArgs({auth:e,values:t}):[];case"bearer":return t.type==="bearer"?this.getRootClientBearerAuthArgs({auth:e,values:t}):[];case"header":return t.type==="header"?this.getRootClientHeaderAuthArgs({auth:e,values:t}):[];case"oauth":return t.type==="oauth"?this.getRootClientOAuthArgs({auth:e,values:t}):[];case"inferred":return this.addWarning("The Java SDK Generator does not support Inferred auth scheme yet"),[];default:O(e)}}addError(e){this.context.errors.add({severity:F.Critical,message:e})}addWarning(e){this.context.errors.add({severity:F.Warning,message:e})}getRootClientBasicAuthArgs({auth:e,values:t}){return[{name:"credentials",value:m.TypeLiteral.raw(`"${t.username}", "${t.password}"`)}]}getRootClientBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getMethodName(e.token),value:m.TypeLiteral.string(t.token)}]}getRootClientHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getMethodName(e.header.name.name),value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value})}]}getRootClientOAuthArgs({auth:e,values:t}){return[{name:this.context.getMethodName(e.clientId),value:m.TypeLiteral.string(t.clientId)},{name:this.context.getMethodName(e.clientSecret),value:m.TypeLiteral.string(t.clientSecret)}]}getRootClientHeaderArgs({headers:e,values:t}){let n=[];for(let a of e){let i=this.getRootClientHeaderArg({header:a,value:t.value});i!=null&&n.push({name:this.context.getMethodName(a.name.name),value:i})}return n}getRootClientHeaderArg({header:e,value:t}){let n=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:t});if(!m.TypeLiteral.isNop(n))return n}callMethod({endpoint:e,snippet:t}){return m.invokeMethod({on:m.codeblock(uf),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t})})}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:O(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){var l,f;let n=[];this.context.errors.scope(re.PathParameters);let i=[...(l=this.context.ir.pathParameters)!=null?l:[],...(f=e.pathParameters)!=null?f:[]].filter(d=>d.variable==null);i.length>0&&n.push(...this.getPathParameters({namedParameters:i,snippet:t}).map(d=>d.value)),this.context.errors.unscope(),this.context.errors.scope(re.RequestBody),e.body!=null&&n.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope();let o=this.getRequestOptionsArg({request:e,snippet:t});return o!=null&&n.push(o),n}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return e.value.type==="optional"?t==null?m.TypeLiteral.reference(m.invokeMethod({on:m.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]})):m.TypeLiteral.optional({value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value.value,value:t}),useOf:!0}):this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t});default:O(e)}}getBytesBodyRequestArg({value:e}){return typeof e!="string"?(this.context.errors.add({severity:F.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),m.TypeLiteral.nop()):m.TypeLiteral.bytes(e)}getMethodArgsForInlinedRequest({request:e,snippet:t}){var y,g;let n=[],{inlinePathParameters:a,inlineFileProperties:i}={inlinePathParameters:this.context.shouldInlinePathParameters(),inlineFileProperties:this.context.shouldInlineFileProperties()};this.context.errors.scope(re.PathParameters);let o=[],f=[...(y=this.context.ir.pathParameters)!=null?y:[],...(g=e.pathParameters)!=null?g:[]].filter(_=>_.variable==null);f.length>0&&o.push(...this.getPathParameters({namedParameters:f,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(re.RequestBody);let d=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:a})||n.push(...o.map(_=>_.value)),i||n.push(...d.fileFields.map(_=>_.value)),n.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:a})?o:[],filePropertyInfo:d})),n}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:n,filePropertyInfo:a}){var y,g,_,E;this.context.errors.scope(re.QueryParameters);let o=this.context.associateQueryParametersByWireValue({parameters:(y=e.queryParameters)!=null?y:[],values:(g=t.queryParameters)!=null?g:{}}).map(B=>({name:this.context.getMethodName(B.name.name),value:this.context.dynamicTypeLiteralMapper.convert(B)}));this.context.errors.unscope(),this.context.errors.scope(re.Headers);let f=this.context.associateByWireValue({parameters:(_=e.headers)!=null?_:[],values:(E=t.headers)!=null?E:{}}).map(B=>({name:this.context.getMethodName(B.name.name),value:this.context.dynamicTypeLiteralMapper.convert(B)}));this.context.errors.unscope(),this.context.errors.scope(re.RequestBody);let d=e.body!=null?this.getInlinedRequestBodyBuilderParameters({body:e.body,value:t.requestBody,filePropertyInfo:a}):[];return this.context.errors.unscope(),m.TypeLiteral.builder({classReference:m.classReference({name:this.context.getClassName(e.declaration.name),packageName:this.context.getRequestsPackageName(e.declaration.fernFilepath)}),parameters:[...n,...f,...o,...d]})}getRequestOptionsArg({request:e,snippet:t}){var f,d,y;let n="headers"in e?(f=e.headers)!=null?f:[]:[];if(n.length===0||Object.keys((d=t.headers)!=null?d:{}).length===0)return;this.context.errors.scope(re.Headers);let a=this.context.associateByWireValue({parameters:n,values:(y=t.headers)!=null?y:{}});if(this.context.errors.unscope(),a.length===0)return;let i=m.classReference({name:"RequestOptions",packageName:this.context.getCorePackageName()}),o=m.invokeMethod({on:i,method:"builder",arguments_:[]});for(let g of a)o=m.invokeMethod({on:o,method:"addHeader",arguments_:[m.TypeLiteral.string(g.name.wireValue),this.context.dynamicTypeLiteralMapper.convert(g)]});let l=m.invokeMethod({on:o,method:"build",arguments_:[]});return m.TypeLiteral.reference(l)}getInlinedRequestBodyBuilderParameters({body:e,value:t,filePropertyInfo:n}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyBuilderParameters({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyBuilderParameter({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyBuilderParameters({filePropertyInfo:n});default:O(e)}}getFileUploadRequestBodyBuilderParameters({filePropertyInfo:e}){return this.context.shouldInlineFileProperties()?[...e.fileFields,...e.bodyPropertyFields]:e.bodyPropertyFields}getReferencedRequestBodyPropertyBuilderParameter({body:e,value:t}){return{name:this.context.getMethodName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t});default:O(e)}}getInlinedRequestBodyPropertyBuilderParameters({parameters:e,value:t}){var i;let n=[],a=this.context.associateByWireValue({parameters:e,values:(i=this.context.getRecord(t))!=null?i:{}});for(let o of a)n.push({name:this.context.getMethodName(o.name.name),value:this.context.dynamicTypeLiteralMapper.convert(o)});return n}getPathParameters({namedParameters:e,snippet:t}){var i;let n=[],a=this.context.associateByWireValue({parameters:e,values:(i=t.pathParameters)!=null?i:{}});for(let o of a)n.push({name:this.context.getMethodName(o.name.name),value:this.context.dynamicTypeLiteralMapper.convert(o)});return n}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>`${this.context.getMethodName(t)}()`).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getStyle(e){var t,n;return(n=(t=e.style)!=null?t:this.context.options.style)!=null?n:He.Full}getConfig(e){var t,n;return(n=(t=e.config)!=null?t:this.context.options.config)!=null?n:{}}};var Pn=class extends mr{constructor({ir:t,config:n,options:a={}}){super(new In({ir:t,config:n,options:a}));w(this,"formatter")}async generate(t,n={}){return super.generate(t,n)}generateSync(t,n={}){return super.generateSync(t,n)}createSnippetGenerator(t){return new En({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
22
+ `)}};c();l();c();l();var P={};Qt(P,{BRAND:()=>Lo,DIRTY:()=>Ne,EMPTY_PATH:()=>lo,INVALID:()=>k,NEVER:()=>gu,OK:()=>j,ParseStatus:()=>U,Schema:()=>I,ZodAny:()=>ge,ZodArray:()=>fe,ZodBigInt:()=>Ae,ZodBoolean:()=>Se,ZodBranded:()=>gt,ZodCatch:()=>De,ZodDate:()=>Ee,ZodDefault:()=>Me,ZodDiscriminatedUnion:()=>Bt,ZodEffects:()=>Y,ZodEnum:()=>Ue,ZodError:()=>D,ZodFirstPartyTypeKind:()=>R,ZodFunction:()=>jt,ZodIntersection:()=>Fe,ZodIssueCode:()=>y,ZodLazy:()=>Oe,ZodLiteral:()=>Be,ZodMap:()=>rt,ZodNaN:()=>at,ZodNativeEnum:()=>je,ZodNever:()=>K,ZodNull:()=>Pe,ZodNullable:()=>ne,ZodNumber:()=>Ie,ZodObject:()=>$,ZodOptional:()=>Z,ZodParsedType:()=>w,ZodPipeline:()=>xt,ZodPromise:()=>xe,ZodReadonly:()=>$e,ZodRecord:()=>Ut,ZodSchema:()=>I,ZodSet:()=>nt,ZodString:()=>ye,ZodSymbol:()=>et,ZodTransformer:()=>Y,ZodTuple:()=>re,ZodType:()=>I,ZodUndefined:()=>Ce,ZodUnion:()=>Le,ZodUnknown:()=>le,ZodVoid:()=>tt,addIssueToContext:()=>v,any:()=>Vo,array:()=>Zo,bigint:()=>Uo,boolean:()=>sa,coerce:()=>yu,custom:()=>na,date:()=>jo,datetimeRegex:()=>ta,defaultErrorMap:()=>ue,discriminatedUnion:()=>Jo,effect:()=>uu,enum:()=>iu,function:()=>ru,getErrorMap:()=>Ke,getParsedType:()=>te,instanceof:()=>Oo,intersection:()=>Ko,isAborted:()=>Ft,isAsync:()=>Qe,isDirty:()=>Ot,isValid:()=>he,late:()=>Fo,lazy:()=>nu,literal:()=>au,makeIssue:()=>yt,map:()=>eu,nan:()=>Bo,nativeEnum:()=>su,never:()=>Wo,null:()=>$o,nullable:()=>lu,number:()=>ia,object:()=>Go,objectUtil:()=>cr,oboolean:()=>hu,onumber:()=>mu,optional:()=>cu,ostring:()=>du,pipeline:()=>pu,preprocess:()=>fu,promise:()=>ou,quotelessJson:()=>oo,record:()=>Xo,set:()=>tu,setErrorMap:()=>co,strictObject:()=>Yo,string:()=>aa,symbol:()=>Mo,transformer:()=>uu,tuple:()=>Qo,undefined:()=>Do,union:()=>Ho,unknown:()=>qo,util:()=>A,void:()=>zo});c();l();c();l();c();l();c();l();c();l();var A;(function(n){n.assertEqual=a=>{};function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{let i={};for(let s of a)i[s]=s;return i},n.getValidEnumValues=a=>{let i=n.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(let o of i)s[o]=a[o];return n.objectValues(s)},n.objectValues=a=>n.objectKeys(a).map(function(i){return a[i]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},n.find=(a,i)=>{for(let s of a)if(i(s))return s},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}n.joinValues=r,n.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(A||(A={}));var cr;(function(n){n.mergeShapes=(e,t)=>m(m({},e),t)})(cr||(cr={}));var w=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),te=n=>{switch(typeof n){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(n)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(n)?w.array:n===null?w.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?w.promise:typeof Map!="undefined"&&n instanceof Map?w.map:typeof Set!="undefined"&&n instanceof Set?w.set:typeof Date!="undefined"&&n instanceof Date?w.date:w.object;default:return w.unknown}};var y=A.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),oo=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),D=class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},r={_errors:[]},a=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)r._errors.push(t(s));else{let o=r,f=0;for(;f<s.path.length;){let d=s.path[f];f===s.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(s))):o[d]=o[d]||{_errors:[]},o=o[d],f++}}};return a(this),r}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};D.create=n=>new D(n);var uo=(n,e)=>{let t;switch(n.code){case y.invalid_type:n.received===w.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case y.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,A.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:t=`Unrecognized key(s) in object: ${A.joinValues(n.keys,", ")}`;break;case y.invalid_union:t="Invalid input";break;case y.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${A.joinValues(n.options)}`;break;case y.invalid_enum_value:t=`Invalid enum value. Expected ${A.joinValues(n.options)}, received '${n.received}'`;break;case y.invalid_arguments:t="Invalid function arguments";break;case y.invalid_return_type:t="Invalid function return type";break;case y.invalid_date:t="Invalid date";break;case y.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:A.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case y.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case y.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case y.custom:t="Invalid input";break;case y.invalid_intersection_types:t="Intersection results could not be merged";break;case y.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case y.not_finite:t="Number must be finite";break;default:t=e.defaultError,A.assertNever(n)}return{message:t}},ue=uo;var Jn=ue;function co(n){Jn=n}function Ke(){return Jn}c();l();var yt=n=>{let{data:e,path:t,errorMaps:r,issueData:a}=n,i=[...t,...a.path||[]],s=_(m({},a),{path:i});if(a.message!==void 0)return _(m({},a),{path:i,message:a.message});let o="",f=r.filter(d=>!!d).slice().reverse();for(let d of f)o=d(s,{data:e,defaultError:o}).message;return _(m({},a),{path:i,message:o})},lo=[];function v(n,e){let t=Ke(),r=yt({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===ue?void 0:ue].filter(a=>!!a)});n.common.issues.push(r)}var U=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if(a.status==="aborted")return k;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let a of t){let i=await a.key,s=await a.value;r.push({key:i,value:s})}return n.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return k;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||a.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}},k=Object.freeze({status:"aborted"}),Ne=n=>({status:"dirty",value:n}),j=n=>({status:"valid",value:n}),Ft=n=>n.status==="aborted",Ot=n=>n.status==="dirty",he=n=>n.status==="valid",Qe=n=>typeof Promise!="undefined"&&n instanceof Promise;c();l();c();l();var T;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(T||(T={}));var G=class{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Kn=(n,e)=>{if(he(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new D(n.common.issues);return this._error=t,this._error}}};function N(n){if(!n)return{};let{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{var d,h;let{message:f}=n;return s.code==="invalid_enum_value"?{message:f!=null?f:o.defaultError}:typeof o.data=="undefined"?{message:(d=f!=null?f:r)!=null?d:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(h=f!=null?f:t)!=null?h:o.defaultError}},description:a}}var I=class{get description(){return this._def.description}_getType(e){return te(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new U,ctx:{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Qe(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var i;let r={common:{issues:[],async:(i=t==null?void 0:t.async)!=null?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:te(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Kn(r,a)}"~validate"(e){var r,a;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:te(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:t});return he(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>he(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:te(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(Qe(a)?a:Promise.resolve(a));return Kn(r,i)}refine(e,t){let r=a=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let s=e(a),o=()=>i.addIssue(m({code:y.custom},r(a)));return typeof Promise!="undefined"&&s instanceof Promise?s.then(f=>f?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new Y({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Z.create(this,this._def)}nullable(){return ne.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return xe.create(this,this._def)}or(e){return Le.create([this,e],this._def)}and(e){return Fe.create(this,e,this._def)}transform(e){return new Y(_(m({},N(this._def)),{schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new Me(_(m({},N(this._def)),{innerType:this,defaultValue:t,typeName:R.ZodDefault}))}brand(){return new gt(m({typeName:R.ZodBranded,type:this},N(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new De(_(m({},N(this._def)),{innerType:this,catchValue:t,typeName:R.ZodCatch}))}describe(e){let t=this.constructor;return new t(_(m({},this._def),{description:e}))}pipe(e){return xt.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fo=/^c[^\s-]{8,}$/i,po=/^[0-9a-z]+$/,mo=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ho=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yo=/^[a-z0-9_-]{21}$/i,go=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lr,bo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,To=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_o=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ko=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ro=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,No=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Xn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Io=new RegExp(`^${Xn}$`);function ea(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);let t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Ao(n){return new RegExp(`^${ea(n)}$`)}function ta(n){let e=`${Xn}T${ea(n)}`,t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function So(n,e){return!!((e==="v4"||!e)&&bo.test(n)||(e==="v6"||!e)&&_o.test(n))}function Eo(n,e){if(!go.test(n))return!1;try{let[t]=n.split(".");if(!t)return!1;let r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch(t){return!1}}function Co(n,e){return!!((e==="v4"||!e)&&To.test(n)||(e==="v6"||!e)&&ko.test(n))}var ye=class n extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let i=this._getOrReturnCtx(e);return v(i,{code:y.invalid_type,expected:w.string,received:i.parsedType}),k}let r=new U,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?v(a,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&v(a,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")vo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")lr||(lr=new RegExp(wo,"u")),lr.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")ho.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")yo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")fo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")po.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")mo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:y.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:y.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:y.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:y.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:y.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:y.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?ta(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:y.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Io.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:y.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Ao(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:y.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?xo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?So(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Eo(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Co(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Ro.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:y.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?No.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:y.invalid_string,message:i.message}),r.dirty()):A.assertNever(i);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),m({validation:t,code:y.invalid_string},T.errToObj(r)))}_addCheck(e){return new n(_(m({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(m({kind:"email"},T.errToObj(e)))}url(e){return this._addCheck(m({kind:"url"},T.errToObj(e)))}emoji(e){return this._addCheck(m({kind:"emoji"},T.errToObj(e)))}uuid(e){return this._addCheck(m({kind:"uuid"},T.errToObj(e)))}nanoid(e){return this._addCheck(m({kind:"nanoid"},T.errToObj(e)))}cuid(e){return this._addCheck(m({kind:"cuid"},T.errToObj(e)))}cuid2(e){return this._addCheck(m({kind:"cuid2"},T.errToObj(e)))}ulid(e){return this._addCheck(m({kind:"ulid"},T.errToObj(e)))}base64(e){return this._addCheck(m({kind:"base64"},T.errToObj(e)))}base64url(e){return this._addCheck(m({kind:"base64url"},T.errToObj(e)))}jwt(e){return this._addCheck(m({kind:"jwt"},T.errToObj(e)))}ip(e){return this._addCheck(m({kind:"ip"},T.errToObj(e)))}cidr(e){return this._addCheck(m({kind:"cidr"},T.errToObj(e)))}datetime(e){var t,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(m({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(r=e==null?void 0:e.local)!=null?r:!1},T.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(m({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},T.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(m({kind:"duration"},T.errToObj(e)))}regex(e,t){return this._addCheck(m({kind:"regex",regex:e},T.errToObj(t)))}includes(e,t){return this._addCheck(m({kind:"includes",value:e,position:t==null?void 0:t.position},T.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(m({kind:"startsWith",value:e},T.errToObj(t)))}endsWith(e,t){return this._addCheck(m({kind:"endsWith",value:e},T.errToObj(t)))}min(e,t){return this._addCheck(m({kind:"min",value:e},T.errToObj(t)))}max(e,t){return this._addCheck(m({kind:"max",value:e},T.errToObj(t)))}length(e,t){return this._addCheck(m({kind:"length",value:e},T.errToObj(t)))}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new n(_(m({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new n(_(m({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new n(_(m({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ye.create=n=>{var e;return new ye(m({checks:[],typeName:R.ZodString,coerce:(e=n==null?void 0:n.coerce)!=null?e:!1},N(n)))};function Po(n,e){let t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,i=Number.parseInt(n.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}var Ie=class n extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let i=this._getOrReturnCtx(e);return v(i,{code:y.invalid_type,expected:w.number,received:i.parsedType}),k}let r,a=new U;for(let i of this._def.checks)i.kind==="int"?A.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{code:y.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),v(r,{code:y.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),v(r,{code:y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Po(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),v(r,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),v(r,{code:y.not_finite,message:i.message}),a.dirty()):A.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,r,a){return new n(_(m({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:T.toString(a)}]}))}_addCheck(e){return new n(_(m({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&A.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Ie.create=n=>new Ie(m({checks:[],typeName:R.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1},N(n)));var Ae=class n extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let r,a=new U;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),v(r,{code:y.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),v(r,{code:y.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),v(r,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):A.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return v(t,{code:y.invalid_type,expected:w.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,r,a){return new n(_(m({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:T.toString(a)}]}))}_addCheck(e){return new n(_(m({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Ae.create=n=>{var e;return new Ae(m({checks:[],typeName:R.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!=null?e:!1},N(n)))};var Se=class extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let r=this._getOrReturnCtx(e);return v(r,{code:y.invalid_type,expected:w.boolean,received:r.parsedType}),k}return j(e.data)}};Se.create=n=>new Se(m({typeName:R.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1},N(n)));var Ee=class n extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let i=this._getOrReturnCtx(e);return v(i,{code:y.invalid_type,expected:w.date,received:i.parsedType}),k}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return v(i,{code:y.invalid_date}),k}let r=new U,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:y.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):A.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n(_(m({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Ee.create=n=>new Ee(m({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:R.ZodDate},N(n)));var et=class extends I{_parse(e){if(this._getType(e)!==w.symbol){let r=this._getOrReturnCtx(e);return v(r,{code:y.invalid_type,expected:w.symbol,received:r.parsedType}),k}return j(e.data)}};et.create=n=>new et(m({typeName:R.ZodSymbol},N(n)));var Ce=class extends I{_parse(e){if(this._getType(e)!==w.undefined){let r=this._getOrReturnCtx(e);return v(r,{code:y.invalid_type,expected:w.undefined,received:r.parsedType}),k}return j(e.data)}};Ce.create=n=>new Ce(m({typeName:R.ZodUndefined},N(n)));var Pe=class extends I{_parse(e){if(this._getType(e)!==w.null){let r=this._getOrReturnCtx(e);return v(r,{code:y.invalid_type,expected:w.null,received:r.parsedType}),k}return j(e.data)}};Pe.create=n=>new Pe(m({typeName:R.ZodNull},N(n)));var ge=class extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}};ge.create=n=>new ge(m({typeName:R.ZodAny},N(n)));var le=class extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}};le.create=n=>new le(m({typeName:R.ZodUnknown},N(n)));var K=class extends I{_parse(e){let t=this._getOrReturnCtx(e);return v(t,{code:y.invalid_type,expected:w.never,received:t.parsedType}),k}};K.create=n=>new K(m({typeName:R.ZodNever},N(n)));var tt=class extends I{_parse(e){if(this._getType(e)!==w.undefined){let r=this._getOrReturnCtx(e);return v(r,{code:y.invalid_type,expected:w.void,received:r.parsedType}),k}return j(e.data)}};tt.create=n=>new tt(m({typeName:R.ZodVoid},N(n)));var fe=class n extends I{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==w.array)return v(t,{code:y.invalid_type,expected:w.array,received:t.parsedType}),k;if(a.exactLength!==null){let s=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(s||o)&&(v(t,{code:s?y.too_big:y.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(v(t,{code:y.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(v(t,{code:y.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>a.type._parseAsync(new G(t,s,t.path,o)))).then(s=>U.mergeArray(r,s));let i=[...t.data].map((s,o)=>a.type._parseSync(new G(t,s,t.path,o)));return U.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new n(_(m({},this._def),{minLength:{value:e,message:T.toString(t)}}))}max(e,t){return new n(_(m({},this._def),{maxLength:{value:e,message:T.toString(t)}}))}length(e,t){return new n(_(m({},this._def),{exactLength:{value:e,message:T.toString(t)}}))}nonempty(e){return this.min(1,e)}};fe.create=(n,e)=>new fe(m({type:n,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray},N(e)));function Xe(n){if(n instanceof $){let e={};for(let t in n.shape){let r=n.shape[t];e[t]=Z.create(Xe(r))}return new $(_(m({},n._def),{shape:()=>e}))}else return n instanceof fe?new fe(_(m({},n._def),{type:Xe(n.element)})):n instanceof Z?Z.create(Xe(n.unwrap())):n instanceof ne?ne.create(Xe(n.unwrap())):n instanceof re?re.create(n.items.map(e=>Xe(e))):n}var $=class n extends I{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=A.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==w.object){let d=this._getOrReturnCtx(e);return v(d,{code:y.invalid_type,expected:w.object,received:d.parsedType}),k}let{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(let d in a.data)s.includes(d)||o.push(d);let f=[];for(let d of s){let h=i[d],b=a.data[d];f.push({key:{status:"valid",value:d},value:h._parse(new G(a,b,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof K){let d=this._def.unknownKeys;if(d==="passthrough")for(let h of o)f.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(d==="strict")o.length>0&&(v(a,{code:y.unrecognized_keys,keys:o}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let h of o){let b=a.data[h];f.push({key:{status:"valid",value:h},value:d._parse(new G(a,b,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let h of f){let b=await h.key,C=await h.value;d.push({key:b,value:C,alwaysSet:h.alwaysSet})}return d}).then(d=>U.mergeObjectSync(r,d)):U.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new n(m(_(m({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,r)=>{var i,s,o,f;let a=(o=(s=(i=this._def).errorMap)==null?void 0:s.call(i,t,r).message)!=null?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(f=T.errToObj(e).message)!=null?f:a}:{message:a}}}:{}))}strip(){return new n(_(m({},this._def),{unknownKeys:"strip"}))}passthrough(){return new n(_(m({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new n(_(m({},this._def),{shape:()=>m(m({},this._def.shape()),e)}))}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>m(m({},this._def.shape()),e._def.shape()),typeName:R.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new n(_(m({},this._def),{catchall:e}))}pick(e){let t={};for(let r of A.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new n(_(m({},this._def),{shape:()=>t}))}omit(e){let t={};for(let r of A.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new n(_(m({},this._def),{shape:()=>t}))}deepPartial(){return Xe(this)}partial(e){let t={};for(let r of A.objectKeys(this.shape)){let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new n(_(m({},this._def),{shape:()=>t}))}required(e){let t={};for(let r of A.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Z;)i=i._def.innerType;t[r]=i}return new n(_(m({},this._def),{shape:()=>t}))}keyof(){return ra(A.objectKeys(this.shape))}};$.create=(n,e)=>new $(m({shape:()=>n,unknownKeys:"strip",catchall:K.create(),typeName:R.ZodObject},N(e)));$.strictCreate=(n,e)=>new $(m({shape:()=>n,unknownKeys:"strict",catchall:K.create(),typeName:R.ZodObject},N(e)));$.lazycreate=(n,e)=>new $(m({shape:n,unknownKeys:"strip",catchall:K.create(),typeName:R.ZodObject},N(e)));var Le=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function a(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(o=>new D(o.ctx.common.issues));return v(t,{code:y.invalid_union,unionErrors:s}),k}if(t.common.async)return Promise.all(r.map(async i=>{let s=_(m({},t),{common:_(m({},t.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(a);{let i,s=[];for(let f of r){let d=_(m({},t),{common:_(m({},t.common),{issues:[]}),parent:null}),h=f._parseSync({data:t.data,path:t.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map(f=>new D(f));return v(t,{code:y.invalid_union,unionErrors:o}),k}}get options(){return this._def.options}};Le.create=(n,e)=>new Le(m({options:n,typeName:R.ZodUnion},N(e)));var ce=n=>n instanceof Oe?ce(n.schema):n instanceof Y?ce(n.innerType()):n instanceof Be?[n.value]:n instanceof Ue?n.options:n instanceof je?A.objectValues(n.enum):n instanceof Me?ce(n._def.innerType):n instanceof Ce?[void 0]:n instanceof Pe?[null]:n instanceof Z?[void 0,...ce(n.unwrap())]:n instanceof ne?[null,...ce(n.unwrap())]:n instanceof gt||n instanceof $e?ce(n.unwrap()):n instanceof De?ce(n._def.innerType):[],Bt=class n extends I{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return v(t,{code:y.invalid_type,expected:w.object,received:t.parsedType}),k;let r=this.discriminator,a=t.data[r],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let a=new Map;for(let i of t){let s=ce(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,i)}}return new n(m({typeName:R.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a},N(r)))}};function fr(n,e){let t=te(n),r=te(e);if(n===e)return{valid:!0,data:n};if(t===w.object&&r===w.object){let a=A.objectKeys(e),i=A.objectKeys(n).filter(o=>a.indexOf(o)!==-1),s=m(m({},n),e);for(let o of i){let f=fr(n[o],e[o]);if(!f.valid)return{valid:!1};s[o]=f.data}return{valid:!0,data:s}}else if(t===w.array&&r===w.array){if(n.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<n.length;i++){let s=n[i],o=e[i],f=fr(s,o);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===w.date&&r===w.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var Fe=class extends I{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=(i,s)=>{if(Ft(i)||Ft(s))return k;let o=fr(i.value,s.value);return o.valid?((Ot(i)||Ot(s))&&t.dirty(),{status:t.value,value:o.data}):(v(r,{code:y.invalid_intersection_types}),k)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Fe.create=(n,e,t)=>new Fe(m({left:n,right:e,typeName:R.ZodIntersection},N(t)));var re=class n extends I{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.array)return v(r,{code:y.invalid_type,expected:w.array,received:r.parsedType}),k;if(r.data.length<this._def.items.length)return v(r,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&r.data.length>this._def.items.length&&(v(r,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...r.data].map((s,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new G(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>U.mergeArray(t,s)):U.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new n(_(m({},this._def),{rest:e}))}};re.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new re(m({items:n,typeName:R.ZodTuple,rest:null},N(e)))};var Ut=class n extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.object)return v(r,{code:y.invalid_type,expected:w.object,received:r.parsedType}),k;let a=[],i=this._def.keyType,s=this._def.valueType;for(let o in r.data)a.push({key:i._parse(new G(r,o,r.path,o)),value:s._parse(new G(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?U.mergeObjectAsync(t,a):U.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof I?new n(m({keyType:e,valueType:t,typeName:R.ZodRecord},N(r))):new n(m({keyType:ye.create(),valueType:e,typeName:R.ZodRecord},N(t)))}},rt=class extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.map)return v(r,{code:y.invalid_type,expected:w.map,received:r.parsedType}),k;let a=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([o,f],d)=>({key:a._parse(new G(r,o,r.path,[d,"key"])),value:i._parse(new G(r,f,r.path,[d,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of s){let d=await f.key,h=await f.value;if(d.status==="aborted"||h.status==="aborted")return k;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),o.set(d.value,h.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let f of s){let d=f.key,h=f.value;if(d.status==="aborted"||h.status==="aborted")return k;(d.status==="dirty"||h.status==="dirty")&&t.dirty(),o.set(d.value,h.value)}return{status:t.value,value:o}}}};rt.create=(n,e,t)=>new rt(m({valueType:e,keyType:n,typeName:R.ZodMap},N(t)));var nt=class n extends I{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==w.set)return v(r,{code:y.invalid_type,expected:w.set,received:r.parsedType}),k;let a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(v(r,{code:y.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(v(r,{code:y.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function s(f){let d=new Set;for(let h of f){if(h.status==="aborted")return k;h.status==="dirty"&&t.dirty(),d.add(h.value)}return{status:t.value,value:d}}let o=[...r.data.values()].map((f,d)=>i._parse(new G(r,f,r.path,d)));return r.common.async?Promise.all(o).then(f=>s(f)):s(o)}min(e,t){return new n(_(m({},this._def),{minSize:{value:e,message:T.toString(t)}}))}max(e,t){return new n(_(m({},this._def),{maxSize:{value:e,message:T.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};nt.create=(n,e)=>new nt(m({valueType:n,minSize:null,maxSize:null,typeName:R.ZodSet},N(e)));var jt=class n extends I{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return v(t,{code:y.invalid_type,expected:w.function,received:t.parsedType}),k;function r(o,f){return yt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ke(),ue].filter(d=>!!d),issueData:{code:y.invalid_arguments,argumentsError:f}})}function a(o,f){return yt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ke(),ue].filter(d=>!!d),issueData:{code:y.invalid_return_type,returnTypeError:f}})}let i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof xe){let o=this;return j(async function(...f){let d=new D([]),h=await o._def.args.parseAsync(f,i).catch(F=>{throw d.addIssue(r(f,F)),d}),b=await Reflect.apply(s,this,h);return await o._def.returns._def.type.parseAsync(b,i).catch(F=>{throw d.addIssue(a(b,F)),d})})}else{let o=this;return j(function(...f){let d=o._def.args.safeParse(f,i);if(!d.success)throw new D([r(f,d.error)]);let h=Reflect.apply(s,this,d.data),b=o._def.returns.safeParse(h,i);if(!b.success)throw new D([a(h,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n(_(m({},this._def),{args:re.create(e).rest(le.create())}))}returns(e){return new n(_(m({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new n(m({args:e||re.create([]).rest(le.create()),returns:t||le.create(),typeName:R.ZodFunction},N(r)))}},Oe=class extends I{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Oe.create=(n,e)=>new Oe(m({getter:n,typeName:R.ZodLazy},N(e)));var Be=class extends I{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:y.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}};Be.create=(n,e)=>new Be(m({value:n,typeName:R.ZodLiteral},N(e)));function ra(n,e){return new Ue(m({values:n,typeName:R.ZodEnum},N(e)))}var Ue=class n extends I{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return v(t,{expected:A.joinValues(r),received:t.parsedType,code:y.invalid_type}),k}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return v(t,{received:t.data,code:y.invalid_enum_value,options:r}),k}return j(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return n.create(e,m(m({},this._def),t))}exclude(e,t=this._def){return n.create(this.options.filter(r=>!e.includes(r)),m(m({},this._def),t))}};Ue.create=ra;var je=class extends I{_parse(e){let t=A.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==w.string&&r.parsedType!==w.number){let a=A.objectValues(t);return v(r,{expected:A.joinValues(a),received:r.parsedType,code:y.invalid_type}),k}if(this._cache||(this._cache=new Set(A.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=A.objectValues(t);return v(r,{received:r.data,code:y.invalid_enum_value,options:a}),k}return j(e.data)}get enum(){return this._def.values}};je.create=(n,e)=>new je(m({values:n,typeName:R.ZodNativeEnum},N(e)));var xe=class extends I{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return v(t,{code:y.invalid_type,expected:w.promise,received:t.parsedType}),k;let r=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return j(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};xe.create=(n,e)=>new xe(m({type:n,typeName:R.ZodPromise},N(e)));var Y=class extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{v(r,s),s.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let s=a.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return k;let f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?k:f.status==="dirty"?Ne(f.value):t.value==="dirty"?Ne(f.value):f});{if(t.value==="aborted")return k;let o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?k:o.status==="dirty"?Ne(o.value):t.value==="dirty"?Ne(o.value):o}}if(a.type==="refinement"){let s=o=>{let f=a.refinement(o,i);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!he(s))return k;let o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>he(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:t.value,value:o})):k);A.assertNever(a)}};Y.create=(n,e,t)=>new Y(m({schema:n,typeName:R.ZodEffects,effect:e},N(t)));Y.createWithPreprocess=(n,e,t)=>new Y(m({schema:e,effect:{type:"preprocess",transform:n},typeName:R.ZodEffects},N(t)));var Z=class extends I{_parse(e){return this._getType(e)===w.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(n,e)=>new Z(m({innerType:n,typeName:R.ZodOptional},N(e)));var ne=class extends I{_parse(e){return this._getType(e)===w.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ne.create=(n,e)=>new ne(m({innerType:n,typeName:R.ZodNullable},N(e)));var Me=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===w.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Me.create=(n,e)=>new Me(m({innerType:n,typeName:R.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},N(e)));var De=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),r=_(m({},t),{common:_(m({},t.common),{issues:[]})}),a=this._def.innerType._parse({data:r.data,path:r.path,parent:m({},r)});return Qe(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new D(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};De.create=(n,e)=>new De(m({innerType:n,typeName:R.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},N(e)));var at=class extends I{_parse(e){if(this._getType(e)!==w.nan){let r=this._getOrReturnCtx(e);return v(r,{code:y.invalid_type,expected:w.nan,received:r.parsedType}),k}return{status:"valid",value:e.data}}};at.create=n=>new at(m({typeName:R.ZodNaN},N(n)));var Lo=Symbol("zod_brand"),gt=class extends I{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},xt=class n extends I{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?k:i.status==="dirty"?(t.dirty(),Ne(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?k:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new n({in:e,out:t,typeName:R.ZodPipeline})}},$e=class extends I{_parse(e){let t=this._def.innerType._parse(e),r=a=>(he(a)&&(a.value=Object.freeze(a.value)),a);return Qe(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}};$e.create=(n,e)=>new $e(m({innerType:n,typeName:R.ZodReadonly},N(e)));function Qn(n,e){let t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function na(n,e={},t){return n?ge.create().superRefine((r,a)=>{var s,o;let i=n(r);if(i instanceof Promise)return i.then(f=>{var d,h;if(!f){let b=Qn(e,r),C=(h=(d=b.fatal)!=null?d:t)!=null?h:!0;a.addIssue(_(m({code:"custom"},b),{fatal:C}))}});if(!i){let f=Qn(e,r),d=(o=(s=f.fatal)!=null?s:t)!=null?o:!0;a.addIssue(_(m({code:"custom"},f),{fatal:d}))}}):ge.create()}var Fo={object:$.lazycreate},R;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(R||(R={}));var Oo=(n,e={message:`Input not instance of ${n.name}`})=>na(t=>t instanceof n,e),aa=ye.create,ia=Ie.create,Bo=at.create,Uo=Ae.create,sa=Se.create,jo=Ee.create,Mo=et.create,Do=Ce.create,$o=Pe.create,Vo=ge.create,qo=le.create,Wo=K.create,zo=tt.create,Zo=fe.create,Go=$.create,Yo=$.strictCreate,Ho=Le.create,Jo=Bt.create,Ko=Fe.create,Qo=re.create,Xo=Ut.create,eu=rt.create,tu=nt.create,ru=jt.create,nu=Oe.create,au=Be.create,iu=Ue.create,su=je.create,ou=xe.create,uu=Y.create,cu=Z.create,lu=ne.create,fu=Y.createWithPreprocess,pu=xt.create,du=()=>aa().optional(),mu=()=>ia().optional(),hu=()=>sa().optional(),yu={string:(n=>ye.create(_(m({},n),{coerce:!0}))),number:(n=>Ie.create(_(m({},n),{coerce:!0}))),boolean:(n=>Se.create(_(m({},n),{coerce:!0}))),bigint:(n=>Ae.create(_(m({},n),{coerce:!0}))),date:(n=>Ee.create(_(m({},n),{coerce:!0})))};var gu=k;c();l();var oa=P.strictObject({title:P.string(),content:P.string()});var pr=P.object({"base-api-exception-class-name":P.string().optional(),"base-exception-class-name":P.string().optional(),"client-class-name":P.string().optional(),"inline-file-properties":P.boolean().optional(),"inline-path-parameters":P.boolean().optional(),"package-layout":P.enum(["flat","nested"]).optional(),"package-prefix":P.string().optional(),"custom-dependencies":P.array(P.string()).optional(),"disable-required-property-builder-checks":P.boolean().optional(),"enable-forward-compatible-enums":P.boolean().optional(),"enable-inline-types":P.boolean().optional(),"enable-public-constructors":P.boolean().optional(),"generate-unknown-as-json-node":P.boolean().optional(),"json-include":P.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":P.boolean().optional(),"use-default-request-parameter-values":P.boolean().optional(),"enable-wire-tests":P.boolean().default(!1),"collapse-optional-nullable":P.boolean().optional(),"custom-readme-sections":P.array(oa).optional(),"custom-pager-name":P.string().optional(),"wrapped-aliases":P.boolean().optional()});var p={};Qt(p,{Access:()=>dr,AstNode:()=>O,Class:()=>Ve,ClassInstantiation:()=>qe,ClassReference:()=>L,CodeBlock:()=>We,Method:()=>ze,MethodInvocation:()=>Ze,Parameter:()=>Ge,Type:()=>vt,TypeLiteral:()=>V,Writer:()=>Re,classReference:()=>Uu,class_:()=>Bu,codeblock:()=>Ou,instantiateClass:()=>ju,invokeMethod:()=>Mu,method:()=>Du,parameter:()=>$u});c();l();c();l();c();l();var dr={Public:"public",Protected:"protected",Private:"private"};c();l();c();l();var O=class extends _e{async toStringAsync({packageName:e,customConfig:t,formatter:r}){let a=new ht({packageName:e,customConfig:t,formatter:r});return this.write(a),a.toStringAsync()}toString({packageName:e,customConfig:t,formatter:r}){let a=new ht({packageName:e,customConfig:t,formatter:r});return this.write(a),a.toString()}};var Ve=class extends O{constructor({name:t,access:r}){super();g(this,"name");g(this,"access");g(this,"methods",[]);this.name=t,this.access=r}write(t){if(t.write(`${this.access} class ${this.name}`),this.isEmpty()){t.writeLine(" {}");return}t.writeLine(" {"),t.indent();for(let r of this.methods)t.writeNode(r),t.newLine();t.dedent(),t.write("}")}addMethod(t){this.methods.push(t)}isEmpty(){return this.methods.length===0}};c();l();c();l();c();l();c();l();var L=class extends O{constructor({name:t,packageName:r,fullyQualified:a}){super();g(this,"name");g(this,"packageName");g(this,"fullyQualified");this.name=t,this.packageName=r,this.fullyQualified=a!=null?a:!1}write(t){if(t.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){t.write(`${this.packageName}.${this.name}`);return}t.write(this.name)}};c();l();var vt=class extends O{constructor(t){super();g(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"array":t.writeNode(this.internalType.value),t.write("[]");break;case"bigInteger":t.writeNode(xu);break;case"boolean":t.write("Boolean");break;case"bytes":t.write("byte[]");break;case"date":t.write("String");break;case"dateTime":t.writeNode(bu);break;case"double":t.write("Double");break;case"float":t.write("Float");break;case"generic":t.writeNode(this.internalType.value),t.write("<");for(let[r,a]of this.internalType.parameters.entries())t.writeNode(a),r<this.internalType.parameters.length-1&&t.write(", ");t.write(">");break;case"inputStream":t.writeNode(ku);break;case"integer":t.write("Integer");break;case"iterable":this.writeIterable({writer:t,iterable:this.internalType});break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write("Long");break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"object":{t.write("Object");break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write("String");break;case"uuid":t.writeNode(_u);break;case"void":t.write("Void");break;default:S(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(t){return new this({type:"array",value:t})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(t){return new this({type:"list",value:t})}static long(){return new this({type:"long"})}static map(t,r){return new this({type:"map",keyType:t,valueType:r})}static object(){return new this({type:"object"})}static optional(t){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t})}static reference(t){return new this({type:"reference",value:t})}static generic(t,r){return new this({type:"generic",value:t,parameters:r})}static set(t){return new this({type:"set",value:t})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(t){return new this({type:"iterable",value:t})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:t,list:r}){t.writeNode(vu),t.write("<"),r.value.write(t),t.write(">")}writeMap({writer:t,map:r}){t.writeNode(wu),t.write("<"),r.keyType.write(t),t.write(", "),r.valueType.write(t),t.write(">")}writeOptional({writer:t,optional:r}){t.writeNode(Mt),t.write("<"),r.value.write(t),t.write(">")}writeIterable({writer:t,iterable:r}){t.writeNode(Mt),t.write("<"),r.value.write(t),t.write(">")}writeSet({writer:t,set:r}){t.writeNode(Tu),t.write("<"),r.value.write(t),t.write(">")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},Dt=new L({name:"Arrays",packageName:"java.util"}),xu=new L({name:"BigInteger",packageName:"java.math"}),Xm=new L({name:"HashMap",packageName:"java.util"}),vu=new L({name:"List",packageName:"java.util"}),wu=new L({name:"Map",packageName:"java.util"}),bu=new L({name:"OffsetDateTime",packageName:"java.time"}),Mt=new L({name:"Optional",packageName:"java.util"}),Tu=new L({name:"Set",packageName:"java.util"}),_u=new L({name:"UUID",packageName:"java.util"}),ku=new L({name:"InputStream",packageName:"java.io"});var V=class n extends O{constructor(t){super();g(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:t,bigInteger:this.internalType});break;case"boolean":t.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:t,builder:this.internalType});break;case"bytes":t.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:t,class_:this.internalType});break}case"date":t.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:t,dateTime:this.internalType});break;case"double":{let r=this.internalType.value.toString();!r.includes(".")&&!r.includes("e")&&!r.includes("E")?t.write(`${r}.0`):t.write(r);break}case"enum":this.writeEnum({writer:t,enum_:this.internalType});break;case"float":t.write(`${this.internalType.value}f`);break;case"integer":t.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"raw":{this.internalType.value instanceof O?t.writeNode(this.internalType.value):t.write(this.internalType.value);break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:t,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:t,uuid:this.internalType});break;case"nop":break;default:S(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(t){return new this({type:"bigInteger",value:t})}static boolean(t){return new this({type:"boolean",value:t})}static builder({classReference:t,parameters:r}){return new this({type:"builder",classReference:t,parameters:r})}static bytes(t){return new this({type:"bytes",value:t})}static class_({reference:t,parameters:r}){return new this({type:"class",reference:t,parameters:r})}static date(t){return new this({type:"date",value:t})}static dateTime(t){return new this({type:"dateTime",value:t})}static double(t){return new this({type:"double",value:t})}static enum_({classReference:t,value:r}){return new this({type:"enum",classReference:t,value:r})}static float(t){return new this({type:"float",value:t})}static integer(t){return new this({type:"integer",value:t})}static list({valueType:t,values:r,isParameter:a}){return new this({type:"list",valueType:t,values:r,isParameter:a})}static long(t){return new this({type:"long",value:t})}static map({keyType:t,valueType:r,entries:a}){return new this({type:"map",keyType:t,valueType:r,entries:a})}static optional({value:t,useOf:r}){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t,useOf:r})}static raw(t){return new this({type:"raw",value:t})}static reference(t){return new this({type:"reference",value:t})}static set({valueType:t,values:r}){return new this({type:"set",valueType:t,values:r})}static string(t){return new this({type:"string",value:t})}static unknown(t){return new this({type:"unknown",value:t})}static uuid(t){return new this({type:"uuid",value:t})}static nop(){return new this({type:"nop"})}static isNop(t){return t.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:S(this.internalType)}}writeBigInteger({writer:t,bigInteger:r}){t.write("new "),t.writeNode(p.instantiateClass({classReference:Ru,arguments_:[n.string(r.value)]}))}writeBuilder({writer:t,builder:r}){t.writeNode(r.classReference),t.writeNewLineIfLastLineNot(),t.indent(),this.writeBuilderParameters({writer:t,parameters:this.orderBuilderParameters(Eu({parameters:r.parameters}))}),t.dedent()}writeBuilderParameters({writer:t,parameters:r}){t.writeLine(".builder()");for(let a of r)t.write(`.${a.name}(`),a.value.shouldWriteInLine()||t.newLine(),t.indent(),t.writeNode(a.value),t.dedent(),a.value.shouldWriteInLine()||t.newLine(),t.writeLine(")");t.writeNewLineIfLastLineNot(),t.write(".build()")}orderBuilderParameters(t){return t.some(a=>!a.value.isOptional()&&!this.isCollection(a.value))?t.sort((a,i)=>{let s=this.isNonRequired(a.value),o=this.isNonRequired(i.value);return s&&!o?1:!s&&o?-1:0}):t.sort((a,i)=>{let s=a.value.isOptional(),o=i.value.isOptional();return s&&!o?1:!s&&o?-1:0})}isCollection(t){let r=t.internalType.type;return r==="list"||r==="set"||r==="map"}isNonRequired(t){return t.isOptional()||this.isCollection(t)}writeClass({writer:t,class_:r}){let a=Su({parameters:r.parameters});t.writeNode(p.instantiateClass({classReference:r.reference,arguments_:a.map(i=>i.value)}))}writeDateTime({writer:t,dateTime:r}){t.writeNode(p.invokeMethod({on:Iu,method:"parse",arguments_:[n.string(r.value)]}))}writeEnum({writer:t,enum_:r}){t.writeNode(r.classReference),t.write("."+r.value)}writeList({writer:t,list:r}){this.writeIterable({writer:t,iterable:r})}writeMap({writer:t,map:r}){let a=Cu({entries:r.entries});if(a.length===0){t.write("new "),t.writeNode($t),t.write("<"),t.writeNode(r.keyType),t.write(", "),t.writeNode(r.valueType),t.write(">()");return}t.write("new "),t.writeNode($t),t.write("<"),t.writeNode(r.keyType),t.write(", "),t.writeNode(r.valueType),t.writeLine(">() {{"),t.indent();for(let i of a)t.write("put("),t.writeNode(i.key),t.write(", "),t.writeNode(i.value),t.writeLine(");");t.dedent(),t.write("}}")}writeOptional({writer:t,optional:r}){if(!r.useOf){t.writeNode(r.value);return}t.writeNode(p.invokeMethod({on:Mt,method:"of",arguments_:[r.value]}))}writeSet({writer:t,set:r}){this.writeIterable({writer:t,iterable:r})}writeIterable({writer:t,iterable:r}){let a=r.type==="list"?mr:Nu,i=Pu({values:r.values});if(r.type==="list"&&r.isParameter&&i.length>0){t.writeNode(p.invokeMethod({on:Dt,method:"asList",arguments_:i}));return}if(i.length===0){t.write(`new ${a.name}<`),t.writeNode(r.valueType),t.write(">()");return}t.write("new "),t.writeNode(a),t.write("<"),t.writeNode(r.valueType),t.writeLine(">("),t.indent(),t.writeNode(p.invokeMethod({on:Dt,method:"asList",arguments_:i})),t.writeNewLineIfLastLineNot(),t.dedent(),t.write(")")}writeUnknown({writer:t,value:r}){switch(typeof r){case"boolean":t.write(r.toString());return;case"string":t.write(`"${this.escapeString(r)}"`);return;case"number":t.write(r.toString());return;case"object":if(r==null){t.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:t,value:r});return}this.writeUnknownMap({writer:t,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:t,value:r}){if(r.length===0){t.write("new "),t.writeNode(mr),t.write("<Object>()");return}t.write("new "),t.writeNode(mr),t.write("<Object>("),t.writeNode(p.invokeMethod({on:Dt,method:"asList",arguments_:r.map(a=>n.unknown(a))})),t.write(")")}writeUnknownMap({writer:t,value:r}){let a=Object.entries(r);if(a.length===0){t.write("new "),t.writeNode($t),t.write("<String, Object>()");return}t.writeLine("new "),t.writeNode($t),t.write("<String, Object>() {{"),t.indent();for(let[i,s]of a)t.write(`put("${i}", `),t.writeNode(n.unknown(s)),t.writeLine(");");t.dedent(),t.write("}}")}writeUUID({writer:t,uuid:r}){t.writeNode(p.invokeMethod({on:Au,method:"fromString",arguments_:[n.string(r.value)]}))}escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},mr=new L({name:"ArrayList",packageName:"java.util"}),Ru=new L({name:"BigInteger",packageName:"java.math"}),$t=new L({name:"HashMap",packageName:"java.util"}),Nu=new L({name:"HashSet",packageName:"java.util"}),ch=new L({name:"List",packageName:"java.util"}),lh=new L({name:"Map",packageName:"java.util"}),Iu=new L({name:"OffsetDateTime",packageName:"java.time"}),fh=new L({name:"Set",packageName:"java.util"}),Au=new L({name:"UUID",packageName:"java.util"});function Su({parameters:n}){return n.filter(e=>!V.isNop(e.value))}function Eu({parameters:n}){return n.filter(e=>!V.isNop(e.value))}function Cu({entries:n}){return n.filter(e=>!V.isNop(e.key)&&!V.isNop(e.value))}function Pu({values:n}){return n.filter(e=>!V.isNop(e))}function Vt({writer:n,arguments_:e}){let t=Fu(e);if(t.length===0){n.write("()");return}if(t.some(a=>a instanceof V&&!a.shouldWriteInLine())){Lu({writer:n,arguments_:t});return}n.write("("),t.forEach((a,i)=>{i>0&&n.write(", "),ua({writer:n,argument:a})}),n.write(")")}function Lu({writer:n,arguments_:e}){n.writeLine("("),n.indent(),e.forEach((t,r)=>{r>0&&n.writeLine(","),ua({writer:n,argument:t})}),n.dedent(),e.length>0&&n.newLine(),n.write(")")}function ua({writer:n,argument:e}){ur(e)?n.writeNodeOrString(e.assignment):e.write(n)}function Fu(n){return n.filter(e=>!(e instanceof V&&V.isNop(e)))}var qe=class extends O{constructor({classReference:t,arguments_:r}){super();g(this,"classReference");g(this,"arguments_");this.classReference=t,this.arguments_=r}write(t){t.writeNode(this.classReference),Vt({writer:t,arguments_:this.arguments_})}};c();l();var We=class extends O{constructor(t){super();g(this,"arg");this.arg=t}write(t){return new J(this.arg).write(t)}};c();l();var ze=class extends O{constructor({name:t,access:r,parameters:a,body:i,static_:s,return_:o}){super();g(this,"name");g(this,"access");g(this,"parameters");g(this,"body");g(this,"return_");g(this,"static_");this.name=t,this.access=r,this.parameters=a,this.body=i,this.return_=o,this.static_=s!=null?s:!1}write(t){if(t.write(`${this.access} `),this.static_&&t.write("static "),this.return_!=null?t.writeNode(this.return_):t.write("void"),t.write(` ${this.name}`),this.parameters.length===0)t.write("()");else if(this.parameters.length===1){if(t.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);t.writeNode(this.parameters[0]),t.write(")")}else t.writeLine("("),t.indent(),this.parameters.forEach((r,a)=>{a>0&&t.writeLine(", "),t.writeNode(r)}),t.dedent(),t.write(")");if(this.body==null){t.write(";");return}t.writeLine(" {"),t.indent(),t.writeNode(this.body),t.writeNewLineIfLastLineNot(),t.dedent(),t.write("}")}};c();l();var Ze=class extends O{constructor({method:t,arguments_:r,on:a}){super();g(this,"on");g(this,"method");g(this,"arguments_");this.on=a,this.method=t,this.arguments_=r}write(t){this.on.write(t),t.write("."),t.write(this.method),Vt({writer:t,arguments_:this.arguments_})}};c();l();var Ge=class extends O{constructor({name:t,type:r}){super();g(this,"name");g(this,"type");this.name=t,this.type=r}write(t){t.writeNode(this.type),t.write(` ${this.name}`)}};function Ou(n){return new We(n)}function Bu(n){return new Ve(n)}function Uu(n){return new L(n)}function ju(n){return new qe(n)}function Mu(n){return new Ze(n)}function Du(n){return new ze(n)}function $u(n){return new Ge(n)}c();l();var qt=class{constructor({context:e}){g(this,"context");this.context=e}isNopTypeLiteral(e){var r;return((r=e.internalType)==null?void 0:r.type)==="nop"}wrapInOptionalIfNotNop(e,t=!1){return this.isNopTypeLiteral(e)?e:p.TypeLiteral.optional({value:e,useOf:t})}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:E.Critical,message:"Expected non-null value, but got null"}),p.TypeLiteral.nop());if(e.value===void 0)return p.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value,as:e.as});case"literal":return this.convertLiteral({literal:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value,as:e.as});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?p.TypeLiteral.nop():this.convertNamed({named:t,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion})}case"nullable":case"optional":{if(e.value===void 0||typeof e.value=="object"&&e.value!==null&&Object.keys(e.value).length===0&&e.typeReference.value.type==="named")return p.TypeLiteral.reference(p.invokeMethod({on:p.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(e.typeReference.value.type==="list"){let a=this.convertList({list:e.typeReference.value.value,value:e.value});return this.wrapInOptionalIfNotNop(a,!0)}let t=this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion}),r=e.as==="mapValue"||e.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(t,r)}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value,as:e.as});case"unknown":return this.convertUnknown({value:e.value});default:S(e.typeReference)}}convertList({list:e,value:t,as:r}){if(!Array.isArray(t))return this.context.errors.add({severity:E.Critical,message:`Expected array but got: ${typeof t}`}),p.TypeLiteral.nop();let a=e.type==="optional"||e.type==="nullable";return p.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((i,s)=>{this.context.errors.scope({index:s});try{if(a){let o=this.convert({typeReference:e.value,value:i,as:r});return this.wrapInOptionalIfNotNop(o,!0)}return this.convert({typeReference:e,value:i,as:r})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:e,value:t}){switch(e.type){case"boolean":{let r=this.context.getValueAsBoolean({value:t});return r==null?p.TypeLiteral.nop():p.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:t});return r==null?p.TypeLiteral.nop():p.TypeLiteral.string(r)}default:S(e)}}convertSet({set:e,value:t,as:r}){return Array.isArray(t)?p.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((a,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:e,value:a,as:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:E.Critical,message:`Expected array but got: ${typeof t}`}),p.TypeLiteral.nop())}convertMap({map:e,value:t,as:r}){return typeof t!="object"||t==null?(this.context.errors.add({severity:E.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),p.TypeLiteral.nop()):p.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(t).map(([a,i])=>{this.context.errors.scope(a);try{return{key:this.convert({typeReference:e.key,value:a,as:"mapKey"}),value:this.convert({typeReference:e.value,value:i,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:t,as:r,inUndiscriminatedUnion:a}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:r,inUndiscriminatedUnion:a});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t,as:r});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:S(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let r=this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(a==null)return p.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let s=this.context.resolveNamedType({typeId:i.typeId});return s==null?p.TypeLiteral.nop():p.TypeLiteral.reference(p.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:s,value:a.value})]}))}case"singleProperty":{let s=this.context.getRecord(a.value);if(s==null)return p.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),p.TypeLiteral.reference(p.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:s[i.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return p.TypeLiteral.reference(p.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:S(i)}}convertObject({object_:e,value:t,as:r}){var s;let a=this.context.associateByWireValue({parameters:e.properties,values:(s=this.context.getRecord(t))!=null?s:{}}),i=r==="request"?a.filter(o=>!this.context.isDirectLiteral(o.typeReference)):a;return p.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),parameters:i.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:r})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:t}){let r=this.getEnumValueName({enum_:e,value:t});return r==null?p.TypeLiteral.nop():p.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),value:r})}getEnumValueName({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:E.Critical,message:`Expected enum value string, got: ${typeof t}`});return}let r=e.values.find(a=>a.wireValue===t);if(r==null){this.context.errors.add({severity:E.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return this.context.getEnumName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return r==null?p.TypeLiteral.nop():this.context.isPrimitive(r.valueTypeReference)?p.TypeLiteral.reference(p.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[r.typeInstantiation]})):p.TypeLiteral.reference(p.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[r.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){var o;let r=[],a=[];for(let f of e.types)try{r.push(JSON.stringify(f));let d=this.convert({typeReference:f,value:t,inUndiscriminatedUnion:!0});return{valueTypeReference:f,typeInstantiation:d}}catch(d){a.push(`Type ${JSON.stringify(f)}: ${d instanceof Error?d.message:String(d)}`);continue}this.context.errors.add({severity:E.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value. Tried ${r.length} variants. Errors: ${a.join("; ")}`});let i=(o=e.declaration.name)!=null?o:"UnknownUnion",s=a.map((f,d)=>` ${d+1}. ${f}`).join(`
23
+ `);throw new Error(`Failed to match undiscriminated union "${i}" for ${typeof t} value.
24
+ Value: ${JSON.stringify(t)}
25
+ Attempted ${r.length} variants:
26
+ ${s}
27
+
28
+ This prevents invalid snippet code generation that would cause formatter errors.`)}getUndiscriminatedUnionFieldName({typeReference:e}){switch(e.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:e});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:e.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:e});case"named":{let t=this.context.resolveNamedType({typeId:e.value});return t==null?void 0:this.context.getClassName(t.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:e});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:e.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:e});case"unknown":return"Unknown";default:S(e)}}getUndiscriminatedUnionFieldNameForList({list:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`ListOf${t}`}getUndiscriminatedUnionFieldNameForMap({map:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e.key});if(t==null)return;let r=this.getUndiscriminatedUnionFieldName({typeReference:e.value});if(r!=null)return`MapOf${t}To${r}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Optional${t}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Nullable${t}`}getUndiscriminatedUnionFieldNameForSet({set:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`SetOf${t}`}getUndiscriminatedUnionFieldNameForLiteral({literal:e}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:e}){switch(e){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":return"Float";case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":return"BigInteger";case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:S(e)}}convertUnknown({value:e}){return p.TypeLiteral.unknown(e)}convertPrimitive({primitive:e,value:t,as:r}){switch(e){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:t,as:r});return a==null?p.TypeLiteral.nop():p.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:t,as:r});return a==null?p.TypeLiteral.nop():p.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:t,as:r});return a==null?p.TypeLiteral.nop():p.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:t,as:r});return a==null?p.TypeLiteral.nop():p.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:t,as:r});return a==null?p.TypeLiteral.nop():p.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:t});return a==null?p.TypeLiteral.nop():p.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:t});return a==null?p.TypeLiteral.nop():p.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:t});return a==null?p.TypeLiteral.nop():p.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:t});return a==null?p.TypeLiteral.nop():p.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:t});return a==null?p.TypeLiteral.nop():p.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:t});return a==null?p.TypeLiteral.nop():p.TypeLiteral.bigInteger(a)}default:S(e)}}getValueAsNumber({value:e,as:t}){let r=t==="mapKey"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:e,as:t}){let r=t==="mapKey"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:r})}};c();l();var Wt=class{constructor({context:e}){g(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return p.Type.list(this.convert({typeReference:e.typeReference}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return p.Type.map(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?this.convertUnknown():this.convertNamed({named:t})}case"optional":case"nullable":return p.Type.optional(this.convert({typeReference:e.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return p.Type.set(this.convert({typeReference:e.typeReference}));case"unknown":return this.convertUnknown();default:S(e.typeReference)}}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return p.Type.reference(p.classReference({name:this.context.getClassName(e.declaration.name),packageName:this.context.getTypesPackageName(e.declaration.fernFilepath)}));default:S(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return p.Type.boolean();case"string":return p.Type.string()}}convertUnknown(){return p.Type.object()}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return p.Type.integer();case"UINT":return p.Type.integer();case"LONG":return p.Type.long();case"UINT_64":return p.Type.long();case"FLOAT":return p.Type.float();case"DOUBLE":return p.Type.double();case"BOOLEAN":return p.Type.boolean();case"STRING":return p.Type.string();case"DATE":return p.Type.date();case"DATE_TIME":return p.Type.dateTime();case"UUID":return p.Type.uuid();case"BASE_64":return p.Type.bytes();case"BIG_INTEGER":return p.Type.bigInteger();default:S(e)}}};c();l();var zt=class{constructor({context:e}){g(this,"context");this.context=e}getFilePropertyInfo({body:e,value:t}){var i;let r={fileFields:[],bodyPropertyFields:[]},a=(i=this.context.getRecord(t))!=null?i:{};for(let s of e.properties)switch(s.type){case"file":r.fileFields.push({name:this.context.getMethodName(s.name),value:this.getSingleFileProperty({property:s,record:a})});break;case"fileArray":r.fileFields.push({name:this.context.getMethodName(s.name),value:this.getArrayFileProperty({property:s,record:a})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getMethodName(s.name.name),value:this.getBodyProperty({property:s,record:a})});break;default:S(s)}return r}getSingleFileProperty({property:e,record:t}){let r=this.context.getSingleFileValue({property:e,record:t});return r==null?p.TypeLiteral.nop():p.TypeLiteral.reference(this.context.getFileStreamFromString(r))}getArrayFileProperty({property:e,record:t}){let r=this.context.getFileArrayValues({property:e,record:t});if(r==null)return p.TypeLiteral.nop();for(let a of r)return p.TypeLiteral.reference(this.context.getFileStreamFromString(a));return p.TypeLiteral.nop()}getBodyProperty({property:e,record:t}){let r=t[e.name.wireValue];return r==null?p.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:r})}};var Vu=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),Zt=class n extends mt{constructor({ir:t,config:r,options:a}){var i;super({ir:t,config:r,options:a});g(this,"ir");g(this,"customConfig");g(this,"dynamicTypeMapper");g(this,"dynamicTypeLiteralMapper");g(this,"filePropertyMapper");this.ir=t,this.customConfig=pr.parse((i=r.customConfig)!=null?i:{}),this.dynamicTypeMapper=new Wt({context:this}),this.dynamicTypeLiteralMapper=new qt({context:this}),this.filePropertyMapper=new zt({context:this})}clone(){return new n({ir:this.ir,config:this.config,options:this.options})}getClassName(t){return this.getName(t.pascalCase.safeName)}getEnumName(t){return this.getName(t.screamingSnakeCase.safeName)}getPropertyName(t){return this.getName(t.camelCase.safeName)}getMethodName(t){return this.getName(t.camelCase.safeName)}getRootClientClassReference(){return p.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var t,r;return(r=(t=this.customConfig)==null?void 0:t["client-class-name"])!=null?r:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(t){let r=this.resolveEnvironmentName(t);if(r!=null)return p.codeblock(a=>{a.writeNode(this.getEnvironmentClassReference()),a.write("."),a.write(this.getEnumName(r))})}getEnvironmentClassReference(){return p.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:t}){return p.classReference({name:t.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(t.fernFilepath)})}getNullableClassReference(){return p.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return p.TypeLiteral.reference(p.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getFileStreamFromString(t){return p.TypeLiteral.reference(p.codeblock(r=>{r.write("new "),r.writeNode(this.getFileStreamClassReference()),r.write("("),r.writeNode(this.getByteArrayInputStreamClassReference()),r.write("("),r.writeNode(p.TypeLiteral.string(t)),r.write(".getBytes("),r.writeNode(this.getStandardCharsetsClassReference()),r.write(".UTF_8)))")}))}getFileStreamClassReference(){return p.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return p.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return p.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(t){switch(t.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(t.value);case"named":{let r=this.resolveNamedType({typeId:t.value});if(r==null)return!1;switch(r.type){case"alias":return this.isPrimitive(r.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:S(r)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:S(t)}}isDirectLiteral(t){return t.type==="literal"}sortTypeInstancesByRequiredFirst(t,r){let a=new Map;r.forEach((o,f)=>{a.set(o.name.wireValue,f)});let i=[],s=[];for(let o of t)this.isOptional(o.typeReference)?s.push(o):i.push(o);return i.sort((o,f)=>{var d,h;return((d=a.get(o.name.wireValue))!=null?d:0)-((h=a.get(f.name.wireValue))!=null?h:0)}),[...i,...s]}getRootPackageName(){let t=this.getPackagePrefixTokens();return this.joinPackageTokens(t)}getCorePackageName(){let t=this.getPackagePrefixTokens();return t.push("core"),this.joinPackageTokens(t)}getTypesPackageName(t){return this.getResourcesPackage(t,"types")}getRequestsPackageName(t){return this.getPackageLayout()==="flat"?this.getTypesPackageName(t):this.getResourcesPackage(t,"requests")}getResourcesPackage(t,r){let a=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":t!=null&&a.push(...t.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:t!=null&&t.allParts.length>0&&a.push("resources"),t!=null&&a.push(...t.allParts.map(i=>this.getPackageNameSegment(i)))}return r!=null&&a.push(r),this.joinPackageTokens(a)}getPackageName(t,r){let a=this.getPackageNameSegments(t);return a=r!=null?[...a,r]:a,[...this.getPackagePrefixTokens(),...a].join(".")}getPackageLayout(){var t,r;return(r=(t=this.customConfig)==null?void 0:t["package-layout"])!=null?r:"nested"}shouldInlinePathParameters(){var t,r;return(r=(t=this.customConfig)==null?void 0:t["inline-path-parameters"])!=null?r:!1}shouldInlineFileProperties(){var t,r;return(r=(t=this.customConfig)==null?void 0:t["inline-file-properties"])!=null?r:!1}getPackageNameSegments(t){return t.packagePath.map(r=>this.getPackageNameSegment(r))}getPackageNameSegment(t){return t.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var r;if(((r=this.customConfig)==null?void 0:r["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let t=[];return t.push("com"),t.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),t.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),t}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return ir(this.config.workspaceName)}startsWithNumber(t){return/^\d/.test(t)}splitOnNonAlphaNumericChar(t){return t.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(t){return t.replace(/-([a-z])/g,(r,a)=>a.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}joinPackageTokens(t){return t.map(a=>this.startsWithNumber(a)?"_"+a:a).join(".")}getName(t){return this.isReservedName(t)?"_"+t:t}isReservedName(t){return Vu.has(t)}};c();l();var ca="com.example.usage",qu="Example",Wu="main",zu="args",la="client",Zu={type:"primitive",value:"STRING"},Gt=class{constructor({context:e,formatter:t}){g(this,"context");g(this,"formatter");this.context=e,this.formatter=t}async generateSnippet({endpoint:e,request:t,options:r}){var s;let a=this.getConfig(r);return await this.buildCodeBlock({endpoint:e,snippet:t,options:r}).toStringAsync({packageName:(s=a.fullStylePackageName)!=null?s:ca,customConfig:this.context.customConfig,formatter:this.formatter})}generateSnippetSync({endpoint:e,request:t,options:r}){var s;let a=this.getConfig(r);return this.buildCodeBlock({endpoint:e,snippet:t,options:r}).toString({packageName:(s=a.fullStylePackageName)!=null?s:ca,customConfig:this.context.customConfig,formatter:this.formatter})}buildCodeBlock({endpoint:e,snippet:t,options:r}){let a=p.codeblock(s=>{s.writeNodeStatement(this.constructClient({endpoint:e,snippet:t})),s.newLine(),s.writeNodeStatement(this.callMethod({endpoint:e,snippet:t}))}),i=this.getStyle(r);switch(i){case ke.Concise:return a;case ke.Full:return this.buildFullCodeBlock({body:a,options:r});default:S(i)}}constructClient({endpoint:e,snippet:t}){return p.codeblock(r=>{r.writeNode(this.context.getRootClientClassReference()),r.write(` ${la} = `),r.writeNode(p.TypeLiteral.builder({classReference:this.context.getRootClientClassReference(),parameters:this.getRootClientBuilderArgs({endpoint:e,snippet:t})}))})}buildFullCodeBlock({body:e,options:t}){var s;let r=this.getConfig(t),a=p.class_({name:(s=r.fullStyleClassName)!=null?s:qu,access:p.Access.Public}),i=p.parameter({name:zu,type:p.Type.array(p.Type.string())});return a.addMethod(p.method({name:Wu,access:p.Access.Public,static_:!0,parameters:[i],body:e})),a}getRootClientBuilderArgs({endpoint:e,snippet:t}){var o,f;let r=[];e.auth!=null&&(t.auth!=null?r.push(...this.getRootClientAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:E.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let a=this.getRootClientBaseUrlArg({baseUrl:t.baseURL,environment:t.environment});a!=null&&r.push(a),this.context.errors.scope(z.Headers),this.context.ir.headers!=null&&t.headers!=null&&r.push(...this.getRootClientHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope();let i=new Set;if([...(o=this.context.ir.pathParameters)!=null?o:[],...(f=e.request.pathParameters)!=null?f:[]].forEach(d=>{d.variable!=null&&i.add(d.variable)}),this.context.ir.variables!=null&&this.context.ir.variables.length>0){for(let d of this.context.ir.variables)if(i.has(d.id)){let h=d.name.camelCase.unsafeName;r.push({name:h,value:p.TypeLiteral.string(`YOUR_${d.name.screamingSnakeCase.unsafeName}`)})}}if(this.context.errors.scope(z.PathParameters),this.context.ir.pathParameters!=null&&this.context.ir.pathParameters.length>0){let d=this.context.ir.pathParameters.filter(h=>h.variable==null);d.length>0&&r.push(...this.getPathParameters({namedParameters:d,snippet:t}))}return this.context.errors.unscope(),r}getRootClientBaseUrlArg({baseUrl:e,environment:t}){var r;if(e!=null&&t!=null){this.context.errors.add({severity:E.Critical,message:"Cannot specify both baseUrl and environment options"});return}if(e!=null){if(((r=this.context.ir.environments)==null?void 0:r.environments.type)==="multipleBaseUrls"){this.context.errors.add({severity:E.Critical,message:"The Java SDK doesn't support a baseUrl when multiple URL environments are configured"});return}return{name:"url",value:p.TypeLiteral.string(e)}}if(t!=null){if(this.context.isSingleEnvironmentID(t)){let a=this.context.getEnvironmentTypeReferenceFromID(t);if(a==null){this.context.errors.add({severity:E.Warning,message:`Environment ${JSON.stringify(t)} was not found`});return}return{name:"environment",value:p.TypeLiteral.reference(a)}}if(this.context.isMultiEnvironmentValues(t))return this.context.validateMultiEnvironmentUrlValues(t)?{name:"environment",value:p.TypeLiteral.reference(p.instantiateClass({classReference:this.context.getEnvironmentClassReference(),arguments_:Object.values(t).map(a=>this.context.dynamicTypeLiteralMapper.convert({typeReference:Zu,value:a}))}))}:void 0}}getRootClientAuthArgs({auth:e,values:t}){if(t.type!==e.type)return this.addError(this.context.newAuthMismatchError({auth:e,values:t}).message),[];switch(e.type){case"basic":return t.type==="basic"?this.getRootClientBasicAuthArgs({auth:e,values:t}):[];case"bearer":return t.type==="bearer"?this.getRootClientBearerAuthArgs({auth:e,values:t}):[];case"header":return t.type==="header"?this.getRootClientHeaderAuthArgs({auth:e,values:t}):[];case"oauth":return t.type==="oauth"?this.getRootClientOAuthArgs({auth:e,values:t}):[];case"inferred":return this.addWarning("The Java SDK Generator does not support Inferred auth scheme yet"),[];default:S(e)}}addError(e){this.context.errors.add({severity:E.Critical,message:e})}addWarning(e){this.context.errors.add({severity:E.Warning,message:e})}getRootClientBasicAuthArgs({auth:e,values:t}){return[{name:"credentials",value:p.TypeLiteral.raw(`"${t.username}", "${t.password}"`)}]}getRootClientBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getMethodName(e.token),value:p.TypeLiteral.string(t.token)}]}getRootClientHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getMethodName(e.header.name.name),value:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value})}]}getRootClientOAuthArgs({auth:e,values:t}){return[{name:this.context.getMethodName(e.clientId),value:p.TypeLiteral.string(t.clientId)},{name:this.context.getMethodName(e.clientSecret),value:p.TypeLiteral.string(t.clientSecret)}]}getRootClientHeaderArgs({headers:e,values:t}){let r=[];for(let a of e){let i=this.getRootClientHeaderArg({header:a,value:t.value});i!=null&&r.push({name:this.context.getMethodName(a.name.name),value:i})}return r}getRootClientHeaderArg({header:e,value:t}){let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:t});if(!p.TypeLiteral.isNop(r))return r}callMethod({endpoint:e,snippet:t}){return p.invokeMethod({on:p.codeblock(la),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t})})}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:S(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){var s;let r=[];this.context.errors.scope(z.PathParameters);let a=((s=e.pathParameters)!=null?s:[]).filter(o=>o.variable==null);a.length>0&&r.push(...this.getPathParameters({namedParameters:a,snippet:t}).map(o=>o.value)),this.context.errors.unscope(),this.context.errors.scope(z.RequestBody),e.body!=null&&r.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope();let i=this.getRequestOptionsArg({request:e,snippet:t});return i!=null&&r.push(i),r}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":{if(e.value.type==="optional"){if(t==null)return p.TypeLiteral.reference(p.invokeMethod({on:p.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value.value,value:t,as:"request"});return r.toString({packageName:"com.example",customConfig:this.context.customConfig}).includes("Optional.empty()")?r:p.TypeLiteral.optional({value:r,useOf:!0})}return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t,as:"request"})}default:S(e)}}getBytesBodyRequestArg({value:e}){return e==null?p.TypeLiteral.bytes(""):typeof e!="string"?(this.context.errors.add({severity:E.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),p.TypeLiteral.nop()):p.TypeLiteral.bytes(e)}getMethodArgsForInlinedRequest({request:e,snippet:t}){var d;let r=[],{inlinePathParameters:a,inlineFileProperties:i}={inlinePathParameters:this.context.shouldInlinePathParameters(),inlineFileProperties:this.context.shouldInlineFileProperties()};this.context.errors.scope(z.PathParameters);let s=[],o=((d=e.pathParameters)!=null?d:[]).filter(h=>h.variable==null);o.length>0&&s.push(...this.getPathParameters({namedParameters:o,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(z.RequestBody);let f=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:a})||r.push(...s.map(h=>h.value)),i||r.push(...f.fileFields.map(h=>h.value)),r.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:a})?s:[],filePropertyInfo:f})),r}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:r,filePropertyInfo:a}){var q,ve,wt,hr,yr,gr;this.context.errors.scope(z.QueryParameters);let s=this.context.associateQueryParametersByWireValue({parameters:(q=e.queryParameters)!=null?q:[],values:(ve=t.queryParameters)!=null?ve:{}}).filter(H=>!this.context.isDirectLiteral(H.typeReference)),f=this.context.sortTypeInstancesByRequiredFirst(s,(wt=e.queryParameters)!=null?wt:[]).map(H=>({name:this.context.getMethodName(H.name.name),value:this.context.dynamicTypeLiteralMapper.convert({typeReference:H.typeReference,value:H.value,as:"request"})}));this.context.errors.unscope(),this.context.errors.scope(z.Headers);let h=this.context.associateByWireValue({parameters:(hr=e.headers)!=null?hr:[],values:(yr=t.headers)!=null?yr:{}}).filter(H=>!this.context.isDirectLiteral(H.typeReference)),C=this.context.sortTypeInstancesByRequiredFirst(h,(gr=e.headers)!=null?gr:[]).map(H=>({name:this.context.getMethodName(H.name.name),value:this.context.dynamicTypeLiteralMapper.convert({typeReference:H.typeReference,value:H.value,as:"request"})}));this.context.errors.unscope(),this.context.errors.scope(z.RequestBody);let F=e.body!=null?this.getInlinedRequestBodyBuilderParameters({body:e.body,value:t.requestBody,filePropertyInfo:a}):[];return this.context.errors.unscope(),p.TypeLiteral.builder({classReference:p.classReference({name:this.context.getClassName(e.declaration.name),packageName:this.context.getRequestsPackageName(e.declaration.fernFilepath)}),parameters:[...r,...C,...f,...F]})}getRequestOptionsArg({request:e,snippet:t}){var f,d,h;let r="headers"in e?(f=e.headers)!=null?f:[]:[];if(r.length===0||Object.keys((d=t.headers)!=null?d:{}).length===0)return;this.context.errors.scope(z.Headers);let a=this.context.associateByWireValue({parameters:r,values:(h=t.headers)!=null?h:{}});if(this.context.errors.unscope(),a.length===0)return;let i=p.classReference({name:"RequestOptions",packageName:this.context.getCorePackageName()}),s=p.invokeMethod({on:i,method:"builder",arguments_:[]});for(let b of a)s=p.invokeMethod({on:s,method:"addHeader",arguments_:[p.TypeLiteral.string(b.name.wireValue),this.context.dynamicTypeLiteralMapper.convert(b)]});let o=p.invokeMethod({on:s,method:"build",arguments_:[]});return p.TypeLiteral.reference(o)}getInlinedRequestBodyBuilderParameters({body:e,value:t,filePropertyInfo:r}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyBuilderParameters({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyBuilderParameter({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyBuilderParameters({filePropertyInfo:r});default:S(e)}}getFileUploadRequestBodyBuilderParameters({filePropertyInfo:e}){return this.context.shouldInlineFileProperties()?[...e.fileFields,...e.bodyPropertyFields]:e.bodyPropertyFields}getReferencedRequestBodyPropertyBuilderParameter({body:e,value:t}){return{name:this.context.getMethodName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t,as:"request"});default:S(e)}}getInlinedRequestBodyPropertyBuilderParameters({parameters:e,value:t}){var s;let a=this.context.associateByWireValue({parameters:e,values:(s=this.context.getRecord(t))!=null?s:{}}).filter(o=>!this.context.isDirectLiteral(o.typeReference));return this.context.sortTypeInstancesByRequiredFirst(a,e).map(o=>({name:this.context.getMethodName(o.name.name),value:this.context.dynamicTypeLiteralMapper.convert({typeReference:o.typeReference,value:o.value,as:"request"})}))}getPathParameters({namedParameters:e,snippet:t}){var i;let r=[],a=this.context.associateByWireValue({parameters:e,values:(i=t.pathParameters)!=null?i:{}});for(let s of a)r.push({name:this.context.getMethodName(s.name.name),value:this.context.dynamicTypeLiteralMapper.convert(s)});return r}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>`${this.context.getMethodName(t)}()`).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getStyle(e){var t,r;return(r=(t=e.style)!=null?t:this.context.options.style)!=null?r:ke.Full}getConfig(e){var t,r;return(r=(t=e.config)!=null?t:this.context.options.config)!=null?r:{}}};var Yt=class extends ft{constructor({ir:t,config:r,options:a={}}){super(new Zt({ir:t,config:r,options:a}));g(this,"formatter")}async generate(t,r={}){return super.generate(t,r)}generateSync(t,r={}){return super.generateSync(t,r)}createSnippetGenerator(t){return new Gt({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
32
29
  /*! Bundled license information:
33
30
 
34
31
  @esbuild-plugins/node-globals-polyfill/Buffer.js: