@fern-api/go-dynamic-snippets 0.0.16 → 0.0.18

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 (63) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +7 -7
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
  3. package/cjs/DynamicSnippetsGenerator.d.cts +3 -2
  4. package/cjs/{DynamicSnippetsGeneratorContext-BusKoNq4.d.cts → DynamicSnippetsGeneratorContext-D8VcLYKk.d.cts} +1 -0
  5. package/cjs/EndpointSnippetGenerator.cjs +4 -4
  6. package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
  7. package/cjs/EndpointSnippetGenerator.d.cts +7 -2
  8. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +8 -8
  9. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
  10. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  11. package/cjs/context/DynamicTypeInstantiationMapper.cjs +8 -8
  12. package/cjs/context/DynamicTypeInstantiationMapper.cjs.map +1 -1
  13. package/cjs/context/DynamicTypeInstantiationMapper.d.cts +1 -1
  14. package/cjs/context/DynamicTypeMapper.cjs +4 -4
  15. package/cjs/context/DynamicTypeMapper.cjs.map +1 -1
  16. package/cjs/context/DynamicTypeMapper.d.cts +1 -1
  17. package/cjs/context/FilePropertyMapper.cjs +6 -6
  18. package/cjs/context/FilePropertyMapper.cjs.map +1 -1
  19. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  20. package/cjs/index.cjs +7 -7
  21. package/cjs/index.cjs.map +1 -1
  22. package/cjs/index.d.cts +1 -1
  23. package/esm/DynamicSnippetsGenerator.d.ts +3 -2
  24. package/esm/DynamicSnippetsGenerator.js +1 -1
  25. package/esm/{DynamicSnippetsGeneratorContext-BusKoNq4.d.ts → DynamicSnippetsGeneratorContext-D8VcLYKk.d.ts} +1 -0
  26. package/esm/EndpointSnippetGenerator.d.ts +7 -2
  27. package/esm/EndpointSnippetGenerator.js +1 -1
  28. package/esm/chunk-3Z2URLHB.js +2 -0
  29. package/esm/chunk-3Z2URLHB.js.map +1 -0
  30. package/esm/{chunk-UZEM7EUP.js → chunk-B2A7QNZM.js} +2 -2
  31. package/esm/chunk-DVDVP26D.js +2 -0
  32. package/esm/chunk-DVDVP26D.js.map +1 -0
  33. package/esm/{chunk-GUJUKQKZ.js → chunk-JHIUGKJ4.js} +8 -8
  34. package/esm/chunk-JHIUGKJ4.js.map +1 -0
  35. package/esm/chunk-MYN2HZVH.js +2 -0
  36. package/esm/chunk-MYN2HZVH.js.map +1 -0
  37. package/esm/{chunk-2YRGTA73.js → chunk-SVPRIX53.js} +2 -2
  38. package/esm/chunk-TXVHHFW3.js +2 -0
  39. package/esm/chunk-TXVHHFW3.js.map +1 -0
  40. package/esm/{chunk-Q6YO7G6Y.js → chunk-ZNTXZ3YV.js} +2 -2
  41. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  42. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  43. package/esm/context/DynamicTypeInstantiationMapper.d.ts +1 -1
  44. package/esm/context/DynamicTypeInstantiationMapper.js +1 -1
  45. package/esm/context/DynamicTypeMapper.d.ts +1 -1
  46. package/esm/context/DynamicTypeMapper.js +1 -1
  47. package/esm/context/FilePropertyMapper.d.ts +1 -1
  48. package/esm/context/FilePropertyMapper.js +1 -1
  49. package/esm/index.d.ts +1 -1
  50. package/esm/index.js +1 -1
  51. package/package.json +1 -1
  52. package/esm/chunk-BI26DLZ5.js +0 -2
  53. package/esm/chunk-BI26DLZ5.js.map +0 -1
  54. package/esm/chunk-D6NMQKNQ.js +0 -2
  55. package/esm/chunk-D6NMQKNQ.js.map +0 -1
  56. package/esm/chunk-FD44EP2P.js +0 -2
  57. package/esm/chunk-FD44EP2P.js.map +0 -1
  58. package/esm/chunk-GUJUKQKZ.js.map +0 -1
  59. package/esm/chunk-VCNL2JWU.js +0 -2
  60. package/esm/chunk-VCNL2JWU.js.map +0 -1
  61. /package/esm/{chunk-UZEM7EUP.js.map → chunk-B2A7QNZM.js.map} +0 -0
  62. /package/esm/{chunk-2YRGTA73.js.map → chunk-SVPRIX53.js.map} +0 -0
  63. /package/esm/{chunk-Q6YO7G6Y.js.map → chunk-ZNTXZ3YV.js.map} +0 -0
@@ -1,4 +1,4 @@
1
1
  import '@fern-api/dynamic-ir-sdk';
2
2
  import '@fern-api/go-ast';
3
- export { b as DynamicTypeMapper } from '../DynamicSnippetsGeneratorContext-BusKoNq4.cjs';
3
+ export { b as DynamicTypeMapper } from '../DynamicSnippetsGeneratorContext-D8VcLYKk.cjs';
4
4
  import '@fern-api/browser-compatible-base-generator';
@@ -1,6 +1,6 @@
1
- "use strict";var de=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var xt=Object.prototype.hasOwnProperty;var yt=(r,t,e)=>t in r?de(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var Re=(r,t)=>()=>(r&&(t=r(r=0)),t);var $e=(r,t)=>{for(var e in t)de(r,e,{get:t[e],enumerable:!0})},gt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wt(t))!xt.call(r,i)&&i!==e&&de(r,i,{get:()=>t[i],enumerable:!(n=dt(t,i))||n.enumerable});return r};var Tt=r=>gt(de({},"__esModule",{value:!0}),r);var u=(r,t,e)=>yt(r,typeof t!="symbol"?t+"":t,e);function Ye(){throw new Error("setTimeout has not been defined")}function Oe(){throw new Error("clearTimeout has not been defined")}function We(r){if(Y===setTimeout)return setTimeout(r,0);if((Y===Ye||!Y)&&setTimeout)return Y=setTimeout,setTimeout(r,0);try{return Y(r,0)}catch(t){try{return Y.call(null,r,0)}catch(e){return Y.call(this,r,0)}}}function At(r){if(O===clearTimeout)return clearTimeout(r);if((O===Oe||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(r);try{return O(r)}catch(t){try{return O.call(null,r)}catch(e){return O.call(this,r)}}}function Nt(){!oe||!W||(oe=!1,W.length?B=W.concat(B):we=-1,B.length&&Ve())}function Ve(){if(!oe){var r=We(Nt);oe=!0;for(var t=B.length;t;){for(W=B,B=[];++we<t;)W&&W[we].run();we=-1,t=B.length}W=null,oe=!1,At(r)}}function Et(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];B.push(new Ge(r,t)),B.length===1&&!oe&&We(Ve)}function Ge(r,t){this.fun=r,this.array=t}function V(){}function Yt(r){throw new Error("process.binding is not supported")}function Ot(){return"/"}function Wt(r){throw new Error("process.chdir is not supported")}function Vt(){return 0}function jt(r){var t=Gt.call(ie)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function Ht(){var r=new Date,t=r-Jt;return t/1e3}var Y,O,B,oe,W,we,vt,It,kt,St,Rt,bt,_t,Lt,Ft,Pt,Bt,Ct,Ut,Mt,$t,Dt,ie,Gt,Jt,w,De,c=Re(()=>{"use strict";Y=Ye,O=Oe;typeof globalThis.setTimeout=="function"&&(Y=setTimeout);typeof globalThis.clearTimeout=="function"&&(O=clearTimeout);B=[],oe=!1,we=-1;Ge.prototype.run=function(){this.fun.apply(null,this.array)};vt="browser",It="browser",kt=!0,St={},Rt=[],bt="",_t={},Lt={},Ft={};Pt=V,Bt=V,Ct=V,Ut=V,Mt=V,$t=V,Dt=V;ie=globalThis.performance||{},Gt=ie.now||ie.mozNow||ie.msNow||ie.oNow||ie.webkitNow||function(){return new Date().getTime()};Jt=new Date;w={nextTick:Et,title:vt,browser:kt,env:St,argv:Rt,version:bt,versions:_t,on:Pt,addListener:Bt,once:Ct,off:Ut,removeListener:Mt,removeAllListeners:$t,emit:Dt,binding:Yt,cwd:Ot,chdir:Wt,umask:Vt,hrtime:jt,platform:It,release:Lt,config:Ft,uptime:Ht},De={};Object.keys(De).forEach(r=>{let t=r.split("."),e=w;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=De[r]:e=e[i]||(e[i]={})}})});function ze(){_e=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)R[t]=r[t],I[r.charCodeAt(t)]=t;I[45]=62,I[95]=63}function qt(r){_e||ze();var t,e,n,i,o,s,h=r.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[h-2]==="="?2:r[h-1]==="="?1:0,s=new zt(h*3/4-o),n=o>0?h-4:h;var l=0;for(t=0,e=0;t<n;t+=4,e+=3)i=I[r.charCodeAt(t)]<<18|I[r.charCodeAt(t+1)]<<12|I[r.charCodeAt(t+2)]<<6|I[r.charCodeAt(t+3)],s[l++]=i>>16&255,s[l++]=i>>8&255,s[l++]=i&255;return o===2?(i=I[r.charCodeAt(t)]<<2|I[r.charCodeAt(t+1)]>>4,s[l++]=i&255):o===1&&(i=I[r.charCodeAt(t)]<<10|I[r.charCodeAt(t+1)]<<4|I[r.charCodeAt(t+2)]>>2,s[l++]=i>>8&255,s[l++]=i&255),s}function Kt(r){return R[r>>18&63]+R[r>>12&63]+R[r>>6&63]+R[r&63]}function Zt(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16)+(r[o+1]<<8)+r[o+2],i.push(Kt(n));return i.join("")}function je(r){_e||ze();for(var t,e=r.length,n=e%3,i="",o=[],s=16383,h=0,l=e-n;h<l;h+=s)o.push(Zt(r,h,h+s>l?l:h+s));return n===1?(t=r[e-1],i+=R[t>>2],i+=R[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=R[t>>10],i+=R[t>>4&63],i+=R[t<<2&63],i+="="),o.push(i),o.join("")}function xe(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(r,t){if(xe()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Le(this,r)}return qe(this,r,t,e)}function qe(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?er(r,t,e,n):typeof t=="string"?Xt(r,t,e):tr(r,t)}function Ke(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 Qt(r,t,e,n){return Ke(t),t<=0?C(r,t):e!==void 0?typeof n=="string"?C(r,t).fill(e,n):C(r,t).fill(e):C(r,t)}function Le(r,t){if(Ke(t),r=C(r,t<0?0:Fe(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Xt(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Ze(t,e)|0;r=C(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function be(r,t){var e=t.length<0?0:Fe(t.length)|0;r=C(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function er(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=be(r,t),r}function tr(r,t){if(b(t)){var e=Fe(t.length)|0;return r=C(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Tr(t.length)?C(r,0):be(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return be(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Fe(r){if(r>=xe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xe().toString(16)+" bytes");return r|0}function b(r){return!!(r!=null&&r._isBuffer)}function Ze(r,t){if(b(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 e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ye(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return it(r).length;default:if(n)return ye(r).length;t=(""+t).toLowerCase(),n=!0}}function rr(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return lr(this,t,e);case"utf8":case"utf-8":return et(this,t,e);case"ascii":return fr(this,t,e);case"latin1":case"binary":return hr(this,t,e);case"base64":return ur(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function G(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function Qe(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,n)),b(t))return t.length===0?-1:Je(r,t,e,n,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Je(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Je(r,t,e,n,i){var o=1,s=r.length,h=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,h/=2,e/=2}function l(g,P){return o===1?g[P]:g.readUInt16BE(P*o)}var m;if(i){var d=-1;for(m=e;m<s;m++)if(l(r,m)===l(t,d===-1?0:m-d)){if(d===-1&&(d=m),m-d+1===h)return d*o}else d!==-1&&(m-=m-d),d=-1}else for(e+h>s&&(e=s-h),m=e;m>=0;m--){for(var x=!0,y=0;y<h;y++)if(l(r,m+y)!==l(t,y)){x=!1;break}if(x)return m}return-1}function nr(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var h=parseInt(t.substr(s*2,2),16);if(isNaN(h))return s;r[e+s]=h}return s}function ir(r,t,e,n){return Ae(ye(t,r.length-e),r,e,n)}function Xe(r,t,e,n){return Ae(yr(t),r,e,n)}function or(r,t,e,n){return Xe(r,t,e,n)}function sr(r,t,e,n){return Ae(it(t),r,e,n)}function ar(r,t,e,n){return Ae(gr(t,r.length-e),r,e,n)}function ur(r,t,e){return t===0&&e===r.length?je(r):je(r.slice(t,e))}function et(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],s=null,h=o>239?4:o>223?3:o>191?2:1;if(i+h<=e){var l,m,d,x;switch(h){case 1:o<128&&(s=o);break;case 2:l=r[i+1],(l&192)===128&&(x=(o&31)<<6|l&63,x>127&&(s=x));break;case 3:l=r[i+1],m=r[i+2],(l&192)===128&&(m&192)===128&&(x=(o&15)<<12|(l&63)<<6|m&63,x>2047&&(x<55296||x>57343)&&(s=x));break;case 4:l=r[i+1],m=r[i+2],d=r[i+3],(l&192)===128&&(m&192)===128&&(d&192)===128&&(x=(o&15)<<18|(l&63)<<12|(m&63)<<6|d&63,x>65535&&x<1114112&&(s=x))}}s===null?(s=65533,h=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=h}return cr(n)}function cr(r){var t=r.length;if(t<=He)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=He));return e}function fr(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function hr(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function lr(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=t;o<e;++o)i+=xr(r[o]);return i}function pr(r,t,e){for(var n=r.slice(t,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function T(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function v(r,t,e,n,i,o){if(!b(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function ge(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(r.length-e,2);i<o;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function Te(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(r.length-e,4);i<o;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function tt(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function rt(r,t,e,n,i){return i||tt(r,t,e,4,34028234663852886e22,-34028234663852886e22),st(r,t,e,n,23,4),e+4}function nt(r,t,e,n,i){return i||tt(r,t,e,8,17976931348623157e292,-17976931348623157e292),st(r,t,e,n,52,8),e+8}function dr(r){if(r=wr(r).replace(mr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function wr(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function xr(r){return r<16?"0"+r.toString(16):r.toString(16)}function ye(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],s=0;s<n;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function yr(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function gr(r,t){for(var e,n,i,o=[],s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function it(r){return qt(dr(r))}function Ae(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function Tr(r){return r!==r}function Ar(r){return r!=null&&(!!r._isBuffer||ot(r)||Nr(r))}function ot(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Nr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&ot(r.slice(0,0))}function Ne(r,t,e,n,i){var o,s,h=i*8-n-1,l=(1<<h)-1,m=l>>1,d=-7,x=e?i-1:0,y=e?-1:1,g=r[t+x];for(x+=y,o=g&(1<<-d)-1,g>>=-d,d+=h;d>0;o=o*256+r[t+x],x+=y,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+r[t+x],x+=y,d-=8);if(o===0)o=1-m;else{if(o===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-m}return(g?-1:1)*s*Math.pow(2,o-n)}function st(r,t,e,n,i,o){var s,h,l,m=o*8-i-1,d=(1<<m)-1,x=d>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,P=n?1:-1,me=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(h=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+x>=1?t+=y/l:t+=y*Math.pow(2,1-x),t*l>=2&&(s++,l/=2),s+x>=d?(h=0,s=d):s+x>=1?(h=(t*l-1)*Math.pow(2,i),s=s+x):(h=t*Math.pow(2,x-1)*Math.pow(2,i),s=0));i>=8;r[e+g]=h&255,g+=P,h/=256,i-=8);for(s=s<<i|h,m+=i;m>0;r[e+g]=s&255,g+=P,s/=256,m-=8);r[e+g-P]|=me*128}var R,I,zt,_e,He,mr,at=Re(()=>{"use strict";c();f();R=[],I=[],zt=typeof Uint8Array!="undefined"?Uint8Array:Array,_e=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return qe(null,r,t,e)};a.kMaxLength=xe();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return Qt(null,r,t,e)};a.allocUnsafe=function(r){return Le(null,r)};a.allocUnsafeSlow=function(r){return Le(null,r)};a.isBuffer=Ar;a.compare=function(t,e){if(!b(t)||!b(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(t){switch(String(t).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}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!b(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Ze;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)G(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)G(this,e,e+3),G(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)G(this,e,e+7),G(this,e+1,e+6),G(this,e+2,e+5),G(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?et(this,0,t):rr.apply(this,arguments)};a.prototype.equals=function(t){if(!b(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,n,i,o){if(!b(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,h=n-e,l=Math.min(s,h),m=this.slice(i,o),d=t.slice(e,n),x=0;x<l;++x)if(m[x]!==d[x]){s=m[x],h=d[x];break}return s<h?-1:h<s?1:0};a.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};a.prototype.indexOf=function(t,e,n){return Qe(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return Qe(this,t,e,n,!1)};a.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return nr(this,t,e,n);case"utf8":case"utf-8":return ir(this,t,e,n);case"ascii":return Xe(this,t,e,n);case"latin1":case"binary":return or(this,t,e,n);case"base64":return sr(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ar(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};He=4096;a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Ne(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Ne(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Ne(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Ne(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;v(this,t,e,n,o,0)}var s=1,h=0;for(this[e]=t&255;++h<n&&(s*=256);)this[e+h]=t/s&255;return e+n};a.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;v(this,t,e,n,o,0)}var s=n-1,h=1;for(this[e+s]=t&255;--s>=0&&(h*=256);)this[e+s]=t/h&255;return e+n};a.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ge(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ge(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Te(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Te(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);v(this,t,e,n,o-1,-o)}var s=0,h=1,l=0;for(this[e]=t&255;++s<n&&(h*=256);)t<0&&l===0&&this[e+s-1]!==0&&(l=1),this[e+s]=(t/h>>0)-l&255;return e+n};a.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);v(this,t,e,n,o-1,-o)}var s=n-1,h=1,l=0;for(this[e+s]=t&255;--s>=0&&(h*=256);)t<0&&l===0&&this[e+s+1]!==0&&(l=1),this[e+s]=(t/h>>0)-l&255;return e+n};a.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ge(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ge(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Te(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Te(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return rt(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return rt(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return nt(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return nt(this,t,e,!1,n)};a.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var o=i-n,s;if(this===t&&n<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};a.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<n;++s)this[s]=t;else{var h=b(t)?t:ye(new a(t,i).toString()),l=h.length;for(s=0;s<n-e;++s)this[s+e]=h[s%l]}return this};mr=/[^+\/0-9A-Za-z-_]/g});var f=Re(()=>{"use strict";at()});var rn={};$e(rn,{FilePropertyMapper:()=>Me});module.exports=Tt(rn);c();f();c();f();c();f();function j(r){throw new Error("Unexpected value: "+JSON.stringify(r))}c();f();c();f();c();f();c();f();c();f();c();f();var ut,ct,ae=(ct=(ut=w.env.FERN_STACK_TRACK)==null?void 0:ut.toLowerCase())!=null?ct:"",_=ae!==""&&ae!=="0"&&ae!=="false",Pe=["single","multiline","box"].includes(ae)?ae:"single";_&&(Error.stackTraceLimit=50);var Er=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),vr=new Set(["stacktrace"]);function ve({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,formatFilename:h=l=>l}={}){var m;if(!_)return[];n=[...n,...Er],e=[...e,...vr],i=[...i,"runInteractiveTask"];let l=!1;return((m=new Error().stack)!=null?m:"").split(`
1
+ "use strict";var de=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var xt=Object.prototype.hasOwnProperty;var yt=(r,t,e)=>t in r?de(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var Re=(r,t)=>()=>(r&&(t=r(r=0)),t);var $e=(r,t)=>{for(var e in t)de(r,e,{get:t[e],enumerable:!0})},gt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wt(t))!xt.call(r,i)&&i!==e&&de(r,i,{get:()=>t[i],enumerable:!(n=dt(t,i))||n.enumerable});return r};var Tt=r=>gt(de({},"__esModule",{value:!0}),r);var u=(r,t,e)=>yt(r,typeof t!="symbol"?t+"":t,e);function Ye(){throw new Error("setTimeout has not been defined")}function Oe(){throw new Error("clearTimeout has not been defined")}function We(r){if(Y===setTimeout)return setTimeout(r,0);if((Y===Ye||!Y)&&setTimeout)return Y=setTimeout,setTimeout(r,0);try{return Y(r,0)}catch(t){try{return Y.call(null,r,0)}catch(e){return Y.call(this,r,0)}}}function At(r){if(O===clearTimeout)return clearTimeout(r);if((O===Oe||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(r);try{return O(r)}catch(t){try{return O.call(null,r)}catch(e){return O.call(this,r)}}}function Nt(){!oe||!W||(oe=!1,W.length?B=W.concat(B):we=-1,B.length&&Ve())}function Ve(){if(!oe){var r=We(Nt);oe=!0;for(var t=B.length;t;){for(W=B,B=[];++we<t;)W&&W[we].run();we=-1,t=B.length}W=null,oe=!1,At(r)}}function Et(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];B.push(new Ge(r,t)),B.length===1&&!oe&&We(Ve)}function Ge(r,t){this.fun=r,this.array=t}function V(){}function Yt(r){throw new Error("process.binding is not supported")}function Ot(){return"/"}function Wt(r){throw new Error("process.chdir is not supported")}function Vt(){return 0}function jt(r){var t=Gt.call(ie)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function Ht(){var r=new Date,t=r-Jt;return t/1e3}var Y,O,B,oe,W,we,vt,It,kt,St,Rt,bt,_t,Lt,Ft,Pt,Bt,Ct,Ut,Mt,$t,Dt,ie,Gt,Jt,w,De,f=Re(()=>{"use strict";Y=Ye,O=Oe;typeof globalThis.setTimeout=="function"&&(Y=setTimeout);typeof globalThis.clearTimeout=="function"&&(O=clearTimeout);B=[],oe=!1,we=-1;Ge.prototype.run=function(){this.fun.apply(null,this.array)};vt="browser",It="browser",kt=!0,St={},Rt=[],bt="",_t={},Lt={},Ft={};Pt=V,Bt=V,Ct=V,Ut=V,Mt=V,$t=V,Dt=V;ie=globalThis.performance||{},Gt=ie.now||ie.mozNow||ie.msNow||ie.oNow||ie.webkitNow||function(){return new Date().getTime()};Jt=new Date;w={nextTick:Et,title:vt,browser:kt,env:St,argv:Rt,version:bt,versions:_t,on:Pt,addListener:Bt,once:Ct,off:Ut,removeListener:Mt,removeAllListeners:$t,emit:Dt,binding:Yt,cwd:Ot,chdir:Wt,umask:Vt,hrtime:jt,platform:It,release:Lt,config:Ft,uptime:Ht},De={};Object.keys(De).forEach(r=>{let t=r.split("."),e=w;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=De[r]:e=e[i]||(e[i]={})}})});function ze(){_e=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)R[t]=r[t],I[r.charCodeAt(t)]=t;I[45]=62,I[95]=63}function qt(r){_e||ze();var t,e,n,i,o,s,h=r.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[h-2]==="="?2:r[h-1]==="="?1:0,s=new zt(h*3/4-o),n=o>0?h-4:h;var l=0;for(t=0,e=0;t<n;t+=4,e+=3)i=I[r.charCodeAt(t)]<<18|I[r.charCodeAt(t+1)]<<12|I[r.charCodeAt(t+2)]<<6|I[r.charCodeAt(t+3)],s[l++]=i>>16&255,s[l++]=i>>8&255,s[l++]=i&255;return o===2?(i=I[r.charCodeAt(t)]<<2|I[r.charCodeAt(t+1)]>>4,s[l++]=i&255):o===1&&(i=I[r.charCodeAt(t)]<<10|I[r.charCodeAt(t+1)]<<4|I[r.charCodeAt(t+2)]>>2,s[l++]=i>>8&255,s[l++]=i&255),s}function Kt(r){return R[r>>18&63]+R[r>>12&63]+R[r>>6&63]+R[r&63]}function Zt(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16)+(r[o+1]<<8)+r[o+2],i.push(Kt(n));return i.join("")}function je(r){_e||ze();for(var t,e=r.length,n=e%3,i="",o=[],s=16383,h=0,l=e-n;h<l;h+=s)o.push(Zt(r,h,h+s>l?l:h+s));return n===1?(t=r[e-1],i+=R[t>>2],i+=R[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=R[t>>10],i+=R[t>>4&63],i+=R[t<<2&63],i+="="),o.push(i),o.join("")}function xe(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(r,t){if(xe()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Le(this,r)}return qe(this,r,t,e)}function qe(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?er(r,t,e,n):typeof t=="string"?Xt(r,t,e):tr(r,t)}function Ke(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 Qt(r,t,e,n){return Ke(t),t<=0?C(r,t):e!==void 0?typeof n=="string"?C(r,t).fill(e,n):C(r,t).fill(e):C(r,t)}function Le(r,t){if(Ke(t),r=C(r,t<0?0:Fe(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Xt(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Ze(t,e)|0;r=C(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function be(r,t){var e=t.length<0?0:Fe(t.length)|0;r=C(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function er(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=be(r,t),r}function tr(r,t){if(b(t)){var e=Fe(t.length)|0;return r=C(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Tr(t.length)?C(r,0):be(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return be(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Fe(r){if(r>=xe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xe().toString(16)+" bytes");return r|0}function b(r){return!!(r!=null&&r._isBuffer)}function Ze(r,t){if(b(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 e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ye(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return it(r).length;default:if(n)return ye(r).length;t=(""+t).toLowerCase(),n=!0}}function rr(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return lr(this,t,e);case"utf8":case"utf-8":return et(this,t,e);case"ascii":return cr(this,t,e);case"latin1":case"binary":return hr(this,t,e);case"base64":return ur(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function G(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function Qe(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,n)),b(t))return t.length===0?-1:Je(r,t,e,n,i);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Je(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Je(r,t,e,n,i){var o=1,s=r.length,h=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,h/=2,e/=2}function l(g,P){return o===1?g[P]:g.readUInt16BE(P*o)}var m;if(i){var d=-1;for(m=e;m<s;m++)if(l(r,m)===l(t,d===-1?0:m-d)){if(d===-1&&(d=m),m-d+1===h)return d*o}else d!==-1&&(m-=m-d),d=-1}else for(e+h>s&&(e=s-h),m=e;m>=0;m--){for(var x=!0,y=0;y<h;y++)if(l(r,m+y)!==l(t,y)){x=!1;break}if(x)return m}return-1}function nr(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var h=parseInt(t.substr(s*2,2),16);if(isNaN(h))return s;r[e+s]=h}return s}function ir(r,t,e,n){return Ae(ye(t,r.length-e),r,e,n)}function Xe(r,t,e,n){return Ae(yr(t),r,e,n)}function or(r,t,e,n){return Xe(r,t,e,n)}function sr(r,t,e,n){return Ae(it(t),r,e,n)}function ar(r,t,e,n){return Ae(gr(t,r.length-e),r,e,n)}function ur(r,t,e){return t===0&&e===r.length?je(r):je(r.slice(t,e))}function et(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],s=null,h=o>239?4:o>223?3:o>191?2:1;if(i+h<=e){var l,m,d,x;switch(h){case 1:o<128&&(s=o);break;case 2:l=r[i+1],(l&192)===128&&(x=(o&31)<<6|l&63,x>127&&(s=x));break;case 3:l=r[i+1],m=r[i+2],(l&192)===128&&(m&192)===128&&(x=(o&15)<<12|(l&63)<<6|m&63,x>2047&&(x<55296||x>57343)&&(s=x));break;case 4:l=r[i+1],m=r[i+2],d=r[i+3],(l&192)===128&&(m&192)===128&&(d&192)===128&&(x=(o&15)<<18|(l&63)<<12|(m&63)<<6|d&63,x>65535&&x<1114112&&(s=x))}}s===null?(s=65533,h=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=h}return fr(n)}function fr(r){var t=r.length;if(t<=He)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=He));return e}function cr(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function hr(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function lr(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=t;o<e;++o)i+=xr(r[o]);return i}function pr(r,t,e){for(var n=r.slice(t,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function T(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function v(r,t,e,n,i,o){if(!b(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function ge(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(r.length-e,2);i<o;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function Te(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(r.length-e,4);i<o;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function tt(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function rt(r,t,e,n,i){return i||tt(r,t,e,4,34028234663852886e22,-34028234663852886e22),st(r,t,e,n,23,4),e+4}function nt(r,t,e,n,i){return i||tt(r,t,e,8,17976931348623157e292,-17976931348623157e292),st(r,t,e,n,52,8),e+8}function dr(r){if(r=wr(r).replace(mr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function wr(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function xr(r){return r<16?"0"+r.toString(16):r.toString(16)}function ye(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],s=0;s<n;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function yr(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function gr(r,t){for(var e,n,i,o=[],s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function it(r){return qt(dr(r))}function Ae(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function Tr(r){return r!==r}function Ar(r){return r!=null&&(!!r._isBuffer||ot(r)||Nr(r))}function ot(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Nr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&ot(r.slice(0,0))}function Ne(r,t,e,n,i){var o,s,h=i*8-n-1,l=(1<<h)-1,m=l>>1,d=-7,x=e?i-1:0,y=e?-1:1,g=r[t+x];for(x+=y,o=g&(1<<-d)-1,g>>=-d,d+=h;d>0;o=o*256+r[t+x],x+=y,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+r[t+x],x+=y,d-=8);if(o===0)o=1-m;else{if(o===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-m}return(g?-1:1)*s*Math.pow(2,o-n)}function st(r,t,e,n,i,o){var s,h,l,m=o*8-i-1,d=(1<<m)-1,x=d>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,P=n?1:-1,me=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(h=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+x>=1?t+=y/l:t+=y*Math.pow(2,1-x),t*l>=2&&(s++,l/=2),s+x>=d?(h=0,s=d):s+x>=1?(h=(t*l-1)*Math.pow(2,i),s=s+x):(h=t*Math.pow(2,x-1)*Math.pow(2,i),s=0));i>=8;r[e+g]=h&255,g+=P,h/=256,i-=8);for(s=s<<i|h,m+=i;m>0;r[e+g]=s&255,g+=P,s/=256,m-=8);r[e+g-P]|=me*128}var R,I,zt,_e,He,mr,at=Re(()=>{"use strict";f();c();R=[],I=[],zt=typeof Uint8Array!="undefined"?Uint8Array:Array,_e=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return qe(null,r,t,e)};a.kMaxLength=xe();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return Qt(null,r,t,e)};a.allocUnsafe=function(r){return Le(null,r)};a.allocUnsafeSlow=function(r){return Le(null,r)};a.isBuffer=Ar;a.compare=function(t,e){if(!b(t)||!b(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(t){switch(String(t).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}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!b(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Ze;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)G(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)G(this,e,e+3),G(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)G(this,e,e+7),G(this,e+1,e+6),G(this,e+2,e+5),G(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?et(this,0,t):rr.apply(this,arguments)};a.prototype.equals=function(t){if(!b(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,n,i,o){if(!b(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,h=n-e,l=Math.min(s,h),m=this.slice(i,o),d=t.slice(e,n),x=0;x<l;++x)if(m[x]!==d[x]){s=m[x],h=d[x];break}return s<h?-1:h<s?1:0};a.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};a.prototype.indexOf=function(t,e,n){return Qe(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return Qe(this,t,e,n,!1)};a.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return nr(this,t,e,n);case"utf8":case"utf-8":return ir(this,t,e,n);case"ascii":return Xe(this,t,e,n);case"latin1":case"binary":return or(this,t,e,n);case"base64":return sr(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ar(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};He=4096;a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=a.prototype;else{var o=e-t;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+t]}return i};a.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return i};a.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=this[t],o=1,s=0;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||T(t,e,this.length);for(var i=e,o=1,s=this[t+--i];i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Ne(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Ne(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Ne(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Ne(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;v(this,t,e,n,o,0)}var s=1,h=0;for(this[e]=t&255;++h<n&&(s*=256);)this[e+h]=t/s&255;return e+n};a.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;v(this,t,e,n,o,0)}var s=n-1,h=1;for(this[e+s]=t&255;--s>=0&&(h*=256);)this[e+s]=t/h&255;return e+n};a.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ge(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ge(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Te(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Te(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);v(this,t,e,n,o-1,-o)}var s=0,h=1,l=0;for(this[e]=t&255;++s<n&&(h*=256);)t<0&&l===0&&this[e+s-1]!==0&&(l=1),this[e+s]=(t/h>>0)-l&255;return e+n};a.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);v(this,t,e,n,o-1,-o)}var s=n-1,h=1,l=0;for(this[e+s]=t&255;--s>=0&&(h*=256);)t<0&&l===0&&this[e+s+1]!==0&&(l=1),this[e+s]=(t/h>>0)-l&255;return e+n};a.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ge(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ge(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Te(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||v(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Te(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return rt(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return rt(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return nt(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return nt(this,t,e,!1,n)};a.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var o=i-n,s;if(this===t&&n<e&&e<i)for(s=o-1;s>=0;--s)t[s+e]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};a.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<n;++s)this[s]=t;else{var h=b(t)?t:ye(new a(t,i).toString()),l=h.length;for(s=0;s<n-e;++s)this[s+e]=h[s%l]}return this};mr=/[^+\/0-9A-Za-z-_]/g});var c=Re(()=>{"use strict";at()});var rn={};$e(rn,{FilePropertyMapper:()=>Me});module.exports=Tt(rn);f();c();f();c();f();c();function j(r){throw new Error("Unexpected value: "+JSON.stringify(r))}f();c();f();c();f();c();f();c();f();c();f();c();var ut,ft,ae=(ft=(ut=w.env.FERN_STACK_TRACK)==null?void 0:ut.toLowerCase())!=null?ft:"",_=ae!==""&&ae!=="0"&&ae!=="false",Pe=["single","multiline","box"].includes(ae)?ae:"single";_&&(Error.stackTraceLimit=50);var Er=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),vr=new Set(["stacktrace"]);function ve({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,formatFilename:h=l=>l}={}){var m;if(!_)return[];n=[...n,...Er],e=[...e,...vr],i=[...i,"runInteractiveTask"];let l=!1;return((m=new Error().stack)!=null?m:"").split(`
2
2
  `).map(d=>{let x=d.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(x&&x.length===5){let[,y,g,P,me]=x;if(!y||!g||!P||!me)return;if(l||i.some(mt=>y==null?void 0:y.includes(mt))){l=!0;return}switch(y){case"Object.<anonymous>":y="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":y=`${y.substring(y.indexOf(".")+1)}()=> { ... }`;break}return{fn:y,path:h(g),position:`${P}:${me}`}}}).filter(d=>{var x,y;return d&&!n.some(g=>d.fn.includes(g))&&!(o&&((x=d.path)!=null&&x.startsWith("node:")))&&!(s&&((y=d.path)!=null&&y.endsWith(".js")))&&!e.some(g=>d.path.includes(g))}).slice(t,t+r)}var Ee=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:n=[],filterFunctions:i=[],stopOn:o=[],filterNode:s=!0,filterJs:h=!0,multiline:l=!1,formatFilename:m=d=>d}={}){u(this,"maxFrames");u(this,"skip");u(this,"filterPaths");u(this,"filterFunctions");u(this,"stopOn");u(this,"filterNode");u(this,"filterJs");u(this,"multiline");u(this,"formatFilename");u(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=n,this.filterFunctions=i,this.stopOn=o,this.filterNode=s,this.filterJs=h,this.multiline=l,this.formatFilename=m}tag(t){let e=this.tracking.get(t)||new Set;ve({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(n=>e.add(n)),this.tracking.set(t,e)}trace(t){if(!_)return"";let e=this.tracking.get(t);return e?[...e].map(n=>`${this.multiline?`
3
- `:""}${n.fn} - ${n.path}:${n.position}`).join(""):""}frames(t){let e=this.tracking.get(t);return e?[...e]:[]}free(t){this.tracking.delete(t)}clear(){this.tracking=new WeakMap}},U;function ft({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,multiline:h=!1,formatFilename:l=m=>m}={}){_&&(U!=null||(U=new Ee({maxFrames:r,skip:t,filterPaths:e,filterFunctions:n,stopOn:i,filterNode:o,filterJs:s,multiline:h,formatFilename:l})))}function ht(r){U==null||U.tag(r)}function Be(r){var t;return(t=U==null?void 0:U.frames(r))!=null?t:[]}var J=class{constructor(){ht(this)}};c();f();var Ie=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},ue=class extends Ie{async format(t){return t}formatSync(t){return t}};c();f();c();f();c();f();var k=class extends J{constructor(e){super();u(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var Ir=4;ft({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var ce=class{constructor(){u(this,"lineBuffer",[]);u(this,"indentLevel",0);u(this,"hasWrittenAnything",!1);u(this,"lastCharacterIsSemicolon",!1);u(this,"lastCharacterIsNewline",!1);u(this,"nodeStackFrames",[])}get buffer(){return _&&this.nodeStackFrames.length>0&&this.writeInternal(`
3
+ `:""}${n.fn} - ${n.path}:${n.position}`).join(""):""}frames(t){let e=this.tracking.get(t);return e?[...e]:[]}free(t){this.tracking.delete(t)}clear(){this.tracking=new WeakMap}},U;function ct({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:o=!0,filterJs:s=!0,multiline:h=!1,formatFilename:l=m=>m}={}){_&&(U!=null||(U=new Ee({maxFrames:r,skip:t,filterPaths:e,filterFunctions:n,stopOn:i,filterNode:o,filterJs:s,multiline:h,formatFilename:l})))}function ht(r){U==null||U.tag(r)}function Be(r){var t;return(t=U==null?void 0:U.frames(r))!=null?t:[]}var J=class{constructor(){ht(this)}};f();c();var Ie=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},ue=class extends Ie{async format(t){return t}formatSync(t){return t}};f();c();f();c();f();c();var k=class extends J{constructor(e){super();u(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var Ir=4;ct({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var fe=class{constructor(){u(this,"lineBuffer",[]);u(this,"indentLevel",0);u(this,"hasWrittenAnything",!1);u(this,"lastCharacterIsSemicolon",!1);u(this,"lastCharacterIsNewline",!1);u(this,"nodeStackFrames",[])}get buffer(){return _&&this.nodeStackFrames.length>0&&this.writeInternal(`
4
4
  `),this.lineBuffer.join(`
5
5
  `)+(this.lastCharacterIsNewline?`
6
6
  `:"")}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
@@ -12,7 +12,7 @@ ${o}`);this.isAtStartOfLine()&&(s=o+s),n&&(s+=`
12
12
  `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
13
13
  `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&n(s)}}}toString(){return this.buffer}writeInternal(t){if(t.length===0)return;let e=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
14
14
  `),this.lastCharacterIsSemicolon=t.endsWith(";");let n=t.split(`
15
- `),i=_&&!this.shouldSkipTracking(n)&&this.lastCharacterIsNewline;e&&(this.lastLine=`${this.lastLine}${n.shift()||""}`),this.lastCharacterIsNewline&&n.pop(),this.lineBuffer.push(...n),i&&this.appendTrackingComment()}set lastLine(t){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=t:this.lineBuffer.push(t)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(t){return!1}formatStack(t,e=""){return t.map(n=>`${e?`(${e}) `:""} ${n.fn} - ${n.path} : ${n.position}`)}filterStack(t){return t.filter(e=>!e.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let t=[...this.formatStack(this.filterStack(ve({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,Pe){case"single":return this.singleLineTrackingComment(t);case"multiline":return this.multiLineTrackingComment(t);case"box":return this.boxTrackingComment(t)}}singleLineTrackingComment(t){this.lastLine=`${this.lastLine} // ${t.join(" ")}`}multiLineTrackingComment(t){this.lineBuffer.push(...t.map(e=>` // ${e}`))}boxTrackingComment(t){this.lineBuffer.push("/*",...t.map(e=>` ${e}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Ir}};c();f();c();f();function Ce(r,t){var n,i;let e=(n=r.split("/").pop())!=null?n:r;return t!=null&&t.stripExtension&&(i=e.split(".")[0])!=null?i:e}var kr=/[^0-9a-zA-Z_]/g,Sr=["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],H=class extends ce{constructor({packageName:e,rootImportPath:n,importPath:i,customConfig:o,formatter:s}){super();u(this,"packageName");u(this,"rootImportPath");u(this,"importPath");u(this,"customConfig");u(this,"formatter");u(this,"imports",{});this.packageName=e,this.rootImportPath=n,this.importPath=i,this.customConfig=o,this.formatter=s!=null?s:new ue}addImport(e){let n=this.imports[e];if(n!=null)return n;if(e===this.rootImportPath&&this.customConfig.packageName!=null)return this.imports[e]=this.customConfig.packageName,this.customConfig.packageName;let i=new Set(Object.values(this.imports)),o=e.split("/");for(let h=1;h<=o.length;h++){let l=o.slice(-h),m=this.getValidAlias(l.join(""));if(!i.has(m))return this.imports[e]=m,m}let s=this.getValidAlias(Ce(e));for(;i.has(s);)s="_"+s;return this.imports[e]=s,s}isValidAlias(e){return!Sr.includes(e)}getValidAlias(e){let n=e.split("-");if(n[0]==null)return e;let i=n.map(o=>o.replace(kr,"")).join("");return this.isValidAlias(i)?i:"_"+i}};var fe=class extends H{constructor({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){super({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
15
+ `),i=_&&!this.shouldSkipTracking(n)&&this.lastCharacterIsNewline;e&&(this.lastLine=`${this.lastLine}${n.shift()||""}`),this.lastCharacterIsNewline&&n.pop(),this.lineBuffer.push(...n),i&&this.appendTrackingComment()}set lastLine(t){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=t:this.lineBuffer.push(t)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(t){return!1}formatStack(t,e=""){return t.map(n=>`${e?`(${e}) `:""} ${n.fn} - ${n.path} : ${n.position}`)}filterStack(t){return t.filter(e=>!e.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let t=[...this.formatStack(this.filterStack(ve({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,Pe){case"single":return this.singleLineTrackingComment(t);case"multiline":return this.multiLineTrackingComment(t);case"box":return this.boxTrackingComment(t)}}singleLineTrackingComment(t){this.lastLine=`${this.lastLine} // ${t.join(" ")}`}multiLineTrackingComment(t){this.lineBuffer.push(...t.map(e=>` // ${e}`))}boxTrackingComment(t){this.lineBuffer.push("/*",...t.map(e=>` ${e}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Ir}};f();c();f();c();function Ce(r,t){var n,i;let e=(n=r.split("/").pop())!=null?n:r;return t!=null&&t.stripExtension&&(i=e.split(".")[0])!=null?i:e}var kr=/[^0-9a-zA-Z_]/g,Sr=["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],H=class extends fe{constructor({packageName:e,rootImportPath:n,importPath:i,customConfig:o,formatter:s}){super();u(this,"packageName");u(this,"rootImportPath");u(this,"importPath");u(this,"customConfig");u(this,"formatter");u(this,"imports",{});this.packageName=e,this.rootImportPath=n,this.importPath=i,this.customConfig=o,this.formatter=s!=null?s:new ue}addImport(e){let n=this.imports[e];if(n!=null)return n;if(e===this.rootImportPath&&this.customConfig.packageName!=null)return this.imports[e]=this.customConfig.packageName,this.customConfig.packageName;let i=new Set(Object.values(this.imports)),o=e.split("/");for(let h=1;h<=o.length;h++){let l=o.slice(-h),m=this.getValidAlias(l.join(""));if(!i.has(m))return this.imports[e]=m,m}let s=this.getValidAlias(Ce(e));for(;i.has(s);)s="_"+s;return this.imports[e]=s,s}isValidAlias(e){return!Sr.includes(e)}getValidAlias(e){let n=e.split("-");if(n[0]==null)return e;let i=n.map(o=>o.replace(kr,"")).join("");return this.isValidAlias(i)?i:"_"+i}};var ce=class extends H{constructor({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){super({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
16
16
  ${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
17
17
  ${t}`)}return t}getContent(){let t=`package ${this.packageName}
18
18
 
@@ -21,9 +21,9 @@ ${t}`)}return t}getContent(){let t=`package ${this.packageName}
21
21
  ${this.buffer}`:t+this.buffer}stringifyImports(){let t=Object.entries(this.imports).filter(([e,n])=>e!==this.importPath).map(([e,n])=>` ${n} "${e}"`).join(`
22
22
  `);return t?`import (
23
23
  ${t}
24
- )`:""}};var F={};$e(F,{Alias:()=>z,AstNode:()=>p,CodeBlock:()=>L,Enum:()=>q,Field:()=>K,File:()=>Z,Func:()=>Q,FuncInvocation:()=>S,IoReaderTypeReference:()=>Ue,Method:()=>D,MethodInvocation:()=>$,MultiNode:()=>he,Parameter:()=>X,Pointer:()=>ee,Selector:()=>te,Struct:()=>re,TimeTypeReference:()=>ke,Type:()=>pe,TypeDeclaration:()=>ne,TypeInstantiation:()=>N,TypeReference:()=>E,UuidTypeReference:()=>Se,Writer:()=>H,alias:()=>Dr,codeblock:()=>Yr,enum_:()=>Or,field:()=>Wr,file:()=>Vr,func:()=>Gr,identifier:()=>jr,invokeFunc:()=>Jr,invokeMethod:()=>Hr,method:()=>zr,parameter:()=>qr,pointer:()=>Kr,selector:()=>Zr,struct:()=>Qr,switch_:()=>Xr,typeDeclaration:()=>en,typeReference:()=>tn});c();f();c();f();c();f();c();f();c();f();var p=class extends J{async toStringAsync({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new fe({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toStringAsync()}toString({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new fe({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toString()}};var A=class extends p{constructor({docs:e}={}){super();u(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
25
- `).forEach(n=>{e.writeLine(`// ${n}`)})}};var z=class extends p{constructor({name:e,type:n,docs:i}){super();u(this,"name");u(this,"type");u(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new A({docs:this.docs})),e.write("type "),e.write(this.name),e.write(" = "),e.writeNode(this.type)}};c();f();var L=class extends p{constructor(e){super();u(this,"arg");this.arg=e}write(e){return new k(this.arg).write(e)}};c();f();c();f();var M=class extends p{constructor(e){super();u(this,"name");this.name=e}write(e){e.write(this.name)}};c();f();c();f();c();f();function se({writer:r,arguments_:t,multiline:e=!0}){let n=t.map(i=>i instanceof N&&N.isNop(i)?N.nil():i);if(n.length===0){r.write("()");return}if(e){Rr({writer:r,arguments_:n});return}br({writer:r,arguments_:n})}function Rr({writer:r,arguments_:t}){r.writeLine("("),r.indent();for(let e of t)e.write(r),r.writeLine(",");r.dedent(),r.write(")")}function br({writer:r,arguments_:t}){r.write("("),t.forEach((e,n)=>{n>0&&r.write(", "),e.write(r)}),r.write(")")}var S=class extends p{constructor({func:e,arguments_:n,multiline:i=!0}){super();u(this,"func");u(this,"arguments_");u(this,"multiline");this.func=e,this.arguments_=n,this.multiline=i}write(e){e.writeNode(this.func),se({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};c();f();c();f();function lt({writer:r,generics:t}){t.length!==0&&(r.write("["),t.forEach((e,n)=>{n>0&&r.write(", "),e!=null&&r.writeNode(e)}),r.write("]"))}var E=class extends p{constructor({name:e,importPath:n,generics:i}){super();u(this,"name");u(this,"importPath");u(this,"generics");this.name=e,this.importPath=n,this.generics=i}write(e){if(this.importPath==null||e.importPath===this.importPath){e.write(this.name);return}let n=e.addImport(this.importPath);e.write(`${n}.${this.name}`),this.generics!=null&&lt({writer:e,generics:this.generics})}};c();f();var $=class extends p{constructor({method:e,arguments_:n,on:i,multiline:o}){super();u(this,"on");u(this,"method");u(this,"arguments_");u(this,"multiline");this.on=i,this.method=e,this.arguments_=n,this.multiline=o}write(e){this.on.write(e),e.write("."),e.write(this.method),se({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};var _r=new Set(["bool","date","dateTime","float64","int","int64","string","uuid"]),pt=new Set(["any","bytes","map","slice"]),N=class r extends p{constructor(e){super();u(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"any":this.writeAny({writer:e,value:this.internalType.value});break;case"bool":e.write(this.internalType.value.toString());break;case"bytes":e.write(`[]byte("${this.internalType.value}")`);break;case"date":case"dateTime":e.writeNode(Pr({writer:e,type:this.internalType}));break;case"enum":e.writeNode(this.internalType.typeReference);break;case"float64":e.write(this.internalType.value.toString());break;case"int":case"int64":e.write(this.internalType.value.toString());break;case"map":this.writeMap({writer:e,map:this.internalType});break;case"nil":e.write("nil");break;case"nop":break;case"optional":this.writeOptional({writer:e,type:this.internalType.value});break;case"reference":e.writeNode(this.internalType.value);break;case"slice":this.writeSlice({writer:e,slice:this.internalType});break;case"string":e.write(this.internalType.value.includes('"')||this.internalType.value.includes(`
26
- `)?`\`${this.internalType.value}\``:`"${this.internalType.value}"`);break;case"struct":this.writeStruct({writer:e,struct:this.internalType});break;case"uuid":e.writeNode(Br({value:this.internalType.value}));break;default:j(this.internalType)}}static any(e){return new this({type:"any",value:e})}static bool(e){return new this({type:"bool",value:e})}static bytes(e){return new this({type:"bytes",value:e})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static enum(e){return new this({type:"enum",typeReference:e})}static float64(e){return new this({type:"float64",value:e})}static int(e){return new this({type:"int",value:e})}static int64(e){return new this({type:"int64",value:e})}static map({keyType:e,valueType:n,entries:i}){return new this({type:"map",keyType:e,valueType:n,entries:i})}static nil(){return new this({type:"nil"})}static nop(){return new this({type:"nop"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static slice({valueType:e,values:n}){return new this({type:"slice",valueType:e,values:n})}static string(e){return new this({type:"string",value:e})}static struct({typeReference:e,fields:n}){return new this({type:"struct",typeReference:e,fields:n})}static structPointer({typeReference:e,fields:n,generics:i}){return new this({type:"optional",value:new this({type:"struct",typeReference:e,fields:n,generics:i})})}static uuid(e){return new this({type:"uuid",value:e})}static isNop(e){return e.internalType.type==="optional"?this.isNop(e.internalType.value):e.internalType.type==="nop"}writeAny({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("nil");return}if(Array.isArray(n)){this.writeAnyArray({writer:e,value:n});return}this.writeAnyObject({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeAnyArray({writer:e,value:n}){if(e.write("[]any"),n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let i of n)e.writeNode(r.any(i)),e.writeLine(",");e.dedent(),e.write("}")}writeAnyObject({writer:e,value:n}){e.write("map[string]any");let i=Object.entries(n);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,s]of i)e.write(`"${o}": `),e.writeNode(r.any(s)),e.writeLine(",");e.dedent(),e.write("}")}writeMap({writer:e,map:n}){e.write("map["),e.writeNode(n.keyType),e.write("]"),e.writeNode(n.valueType);let i=Cr({entries:n.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.key.write(e),e.write(": "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeOptional({writer:e,type:n}){if(_r.has(n.internalType.type)){e.writeNode(Lr({writer:e,type:n}));return}if(pt.has(n.internalType.type)){n.write(e);return}if(n.internalType.type==="enum"){e.writeNode(new $({on:n.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),n.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||pt.has(e.internalType.type)}writeSlice({writer:e,slice:n}){e.write("[]"),e.writeNode(n.valueType);let i=Mr({values:n.values});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeStruct({writer:e,struct:n}){e.writeNode(n.typeReference),n.generics!=null&&(e.write("["),n.generics.forEach((o,s)=>{s>0&&e.write(", "),e.writeNode(o)}),e.write("]"));let i=Ur({fields:n.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}};function Lr({writer:r,type:t}){return new S({func:new E({name:Fr({type:t}),importPath:r.rootImportPath}),arguments_:[t]})}function Fr({type:r}){switch(r.internalType.type){case"bool":return"Bool";case"date":case"dateTime":return"Time";case"float64":return"Float64";case"int":return"Int";case"int64":return"Int64";case"string":return"String";case"uuid":return"UUID";default:return""}}function Pr({writer:r,type:t}){let e=t.type==="date"?"MustParseDate":"MustParseDateTime";return new S({func:new E({name:e,importPath:r.rootImportPath}),arguments_:[new L(`"${t.value}"`)]})}function Br({value:r}){return new S({func:new E({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new L(`"${r}"`)]})}function Cr({entries:r}){return r.filter(t=>!N.isNop(t.key)&&!N.isNop(t.value))}function Ur({fields:r}){return r.filter(t=>!N.isNop(t.value))}function Mr({values:r}){return r.filter(t=>!N.isNop(t))}var q=class r extends p{constructor({name:e,docs:n}){super();u(this,"name");u(this,"docs");u(this,"members",[]);u(this,"methods",[]);u(this,"constructor_");this.name=e,this.docs=n}addConstructor(e){this.constructor_=e}addMember(e){this.members.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeType({writer:e}),this.writeMembers({writer:e}),this.writeConstructor({writer:e}),this.writeMethods({writer:e})}writeType({writer:e}){e.writeNode(new A({docs:this.docs})),e.writeLine(`type ${this.name} string`)}writeMembers({writer:e}){if(this.members.length!==0){e.newLine(),e.writeLine("const ("),e.indent();for(let n of this.members)e.writeNode(new A({docs:n.docs})),e.writeNode(r.getMemberIdentifier({name:this.name,member:n})),e.write(" = "),e.writeNode(N.string(n.value)),e.newLine();e.dedent(),e.write(")")}}writeConstructor({writer:e}){this.constructor_!=null&&(e.newLine(),e.writeNode(this.constructor_))}writeMethods({writer:e}){e.newLine();for(let n of this.methods)e.newLine(),e.writeNode(n),e.newLine()}static getMemberIdentifier({name:e,member:n}){return new M(`${e}${n.name}`)}};c();f();var K=class extends p{constructor({name:e,type:n,docs:i,tags:o}){super();u(this,"name");u(this,"type");u(this,"docs");u(this,"tags",[]);this.name=e,this.type=n,this.docs=i,this.tags=o!=null?o:[]}addTags(...e){this.tags.push(...e)}write(e){e.writeNode(new A({docs:this.docs})),e.write(`${this.name} `),this.type.write(e),this.writeTags({writer:e})}writeTags({writer:e}){this.tags.length!==0&&(e.write(" `"),this.tags.forEach((n,i)=>{i>0&&e.write(" "),e.write(`${n.name}:"${n.value}"`)}),e.write("`"))}};c();f();var Z=class extends p{constructor({nodes:e}={nodes:[]}){super();u(this,"nodes");this.nodes=e!=null?e:[]}add(...e){this.nodes.push(...e)}write(e){for(let n of this.nodes)n.write(e)}};c();f();c();f();var D=class extends p{constructor({name:e,parameters:n,return_:i,body:o,docs:s,typeReference:h,multiline:l,receiver:m,pointerReceiver:d}){super();u(this,"parameters");u(this,"return_");u(this,"name");u(this,"body");u(this,"docs");u(this,"typeReference");u(this,"multiline");u(this,"receiver");u(this,"pointerReceiver");this.name=e,this.parameters=n,this.return_=i,this.body=o,this.docs=s,this.typeReference=h,this.multiline=l,this.receiver=m,this.pointerReceiver=d}write(e){var n;e.writeNode(new A({docs:this.docs})),e.write("func"),this.typeReference!=null&&this.writeReceiver({writer:e,typeReference:this.typeReference,receiver:this.receiver}),this.name!=null&&e.write(` ${this.name}`),se({writer:e,arguments_:this.parameters,multiline:this.multiline}),this.return_!=null&&(e.write(" "),this.return_.length>1&&e.write("("),this.return_.forEach((i,o)=>{o>0&&e.write(", "),e.writeNode(i)}),this.return_.length>1&&e.write(")")),e.writeLine("{"),e.indent(),(n=this.body)==null||n.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.write("}")}writeReceiver({writer:e,typeReference:n,receiver:i}){e.write(` (${this.getReceiverName({typeReference:n,receiver:i})} `),this.pointerReceiver&&e.write("*"),n.write(e),e.write(")")}getReceiverName({typeReference:e,receiver:n}){return n!=null?n:e.name.charAt(0).toLowerCase()}};var Q=class extends p{constructor({name:e,parameters:n,return_:i,body:o,docs:s,multiline:h}){super();u(this,"func");this.func=new D({name:e,parameters:n,return_:i,body:o,docs:s,multiline:h})}get parameters(){return this.func.parameters}get return_(){return this.func.return_}get name(){return this.func.name}get body(){return this.func.body}get docs(){return this.func.docs}write(e){e.writeNode(this.func)}};c();f();var he=class extends p{constructor({nodes:e}){super();u(this,"nodes");this.nodes=e}write(e){for(let n of this.nodes)e.newLine(),n.write(e),e.newLine()}};c();f();var X=class extends p{constructor({name:e,type:n,docs:i}){super();u(this,"name");u(this,"type");u(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new A({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};c();f();var ee=class extends p{constructor({node:e}){super();u(this,"node");this.node=e}write(e){e.write("*"),this.node.write(e)}};c();f();var te=class extends p{constructor({on:e,selector:n}){super();u(this,"on");u(this,"selector");this.on=e,this.selector=n}write(e){e.writeNode(this.on),e.write("."),e.writeNode(this.selector)}};c();f();var re=class extends p{constructor({name:e,embeds:n,fields:i,docs:o}){super();u(this,"name");u(this,"embeds",[]);u(this,"fields",[]);u(this,"docs");u(this,"methods",[]);u(this,"constructor_");this.name=e,this.docs=o,this.embeds=n!=null?n:[],this.fields=i!=null?i:[]}addConstructor(e){this.constructor_=e}addField(...e){this.fields.push(...e)}addMethod(...e){this.methods.push(...e)}write(e){this.writeType({writer:e}),this.constructor_!=null&&(e.newLine(),e.newLine(),this.writeConstructor({writer:e,constructor:this.constructor_})),this.writeMethods({writer:e})}writeType({writer:e}){if(e.writeNode(new A({docs:this.docs})),this.name!=null?e.write(`type ${this.name} struct {`):e.write("struct{"),this.embeds.length===0&&this.fields.length===0){e.writeLine("}");return}e.newLine(),e.indent();for(let o of this.embeds)e.writeNode(o),e.newLine();let n=this.fields.filter(o=>this.isExported(o));for(let o of n)e.writeNode(o),e.newLine();let i=this.fields.filter(o=>!this.isExported(o));n.length>0&&i.length>0&&e.newLine();for(let o of i)e.writeNode(o),e.newLine();e.dedent(),e.write("}")}writeConstructor({writer:e,constructor:n}){n.name!=null?e.write(`func ${n.name}(`):e.write(`func New${this.name}(`),n.parameters.forEach((i,o)=>{o>0&&e.write(", "),e.writeNode(i)}),e.write(`) *${this.name} {`),e.newLine(),e.indent(),e.writeNode(n.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeMethods({writer:e}){if(this.methods.length!==0){e.writeNewLineIfLastLineNot();for(let n of this.methods)e.newLine(),e.writeNode(n),e.newLine()}}isExported(e){let n=e.name.charAt(0);return n===n.toUpperCase()}};c();f();var le=class extends p{constructor({on:e,cases:n,default:i}){super();u(this,"on");u(this,"cases");u(this,"default");this.on=e,this.cases=n,this.default=i}write(e){let n=this.cases;this.default!=null&&n.push({on:new M("default"),body:this.default}),e.write("switch "),e.writeNode(this.on),e.writeLine("{"),e.indent();for(let i of n)e.write("case "),e.writeNode(i.on),e.writeLine(":"),e.indent(),e.writeNode(i.body),e.dedent(),e.writeNewLineIfLastLineNot();e.dedent(),e.write("}")}};c();f();var $r=new Set(["any","bytes","map","slice"]),pe=class r extends p{constructor(e){super();u(this,"internalType");this.internalType=e}write(e,{comment:n}={}){switch(this.internalType.type){case"any":e.write("any");break;case"bool":e.write("bool");break;case"bytes":e.write("[]byte");break;case"date":case"dateTime":e.writeNode(ke);break;case"error":e.write("error");break;case"float64":e.write("float64");break;case"int":e.write("int");break;case"int64":e.write("int64");break;case"map":{e.write("map["),this.internalType.keyType.write(e),e.write("]"),this.internalType.valueType.write(e);break}case"optional":{e.write("*"),this.internalType.value.write(e);break}case"reference":e.writeNode(this.internalType.value);break;case"slice":e.write("[]"),this.internalType.value.write(e);break;case"string":e.write("string");break;case"uuid":e.writeNode(Se);break;case"variadic":e.write("..."),this.internalType.value.write(e);break;default:j(this.internalType)}}isOptional(){return this.internalType.type==="optional"}isIterable(){return this.internalType.type==="slice"||this.internalType.type==="variadic"}iterableElement(){if(this.internalType.type==="slice"||this.internalType.type==="variadic")return this.internalType.value}underlying(){return this.internalType.type==="optional"?this.internalType.value:this}static any(){return new this({type:"any"})}static bool(){return new this({type:"bool"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static dereference(e){return e.internalType.type==="optional"?e.internalType.value:e}static error(){return new this({type:"error"})}static float64(){return new this({type:"float64"})}static int(){return new this({type:"int"})}static int64(){return new this({type:"int64"})}static map(e,n){return new this({type:"map",keyType:e,valueType:n})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static pointer(e){return r.optional(e)}static reference(e){return new this({type:"reference",value:e})}static slice(e){return new this({type:"slice",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static variadic(e){return this.isAlreadyVariadic(e)?e:new this({type:"variadic",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"||$r.has(e.internalType.type)}static isAlreadyVariadic(e){return e.internalType.type==="variadic"}},ke=new E({importPath:"time",name:"Time"}),Se=new E({importPath:"github.com/google/uuid",name:"UUID"}),Ue=new E({importPath:"io",name:"Reader"});c();f();var ne=class extends p{constructor({name:e,type:n,docs:i}){super();u(this,"name");u(this,"type");u(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new A({docs:this.docs})),e.write("type "),e.write(this.name),e.write(" "),e.writeNode(this.type)}};function Dr(r){return new z(r)}function Yr(r){return new L(r)}function Or(r){return new q(r)}function Wr(r){return new K(r)}function Vr(r={}){return new Z(r)}function Gr(r){return new Q(r)}function jr(r){return new M(r)}function Jr(r){return new S(r)}function Hr(r){return new $(r)}function zr(r){return new D(r)}function qr(r){return new X(r)}function Kr(r){return new ee(r)}function Zr(r){return new te(r)}function Qr(r={}){return new re(r)}function Xr(r){return new le(r)}function en(r){return new ne(r)}function tn(r){return new E(r)}var Me=class{constructor({context:t}){u(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let n={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let s of t.properties)switch(s.type){case"file":n.fileFields.push({name:this.context.getTypeName(s.name),value:this.getSingleFileProperty({property:s,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getTypeName(s.name),value:this.getArrayFileProperty({property:s,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getTypeName(s.name.name),value:this.getBodyProperty({property:s,record:i})});break;default:j(s)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e})||"";return F.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(n))}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return n==null?F.TypeInstantiation.nop():F.TypeInstantiation.slice({valueType:F.Type.reference(this.context.getIoReaderTypeReference()),values:n.map(i=>F.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(i)))})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?F.TypeInstantiation.nop():this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.typeReference,value:n})}};0&&(module.exports={FilePropertyMapper});
24
+ )`:""}};var F={};$e(F,{Alias:()=>z,AstNode:()=>p,CodeBlock:()=>L,Enum:()=>q,Field:()=>K,File:()=>Z,Func:()=>Q,FuncInvocation:()=>S,IoReaderTypeReference:()=>Ue,Method:()=>D,MethodInvocation:()=>$,MultiNode:()=>he,Parameter:()=>X,Pointer:()=>ee,Selector:()=>te,Struct:()=>re,TimeTypeReference:()=>ke,Type:()=>pe,TypeDeclaration:()=>ne,TypeInstantiation:()=>N,TypeReference:()=>E,UuidTypeReference:()=>Se,Writer:()=>H,alias:()=>Dr,codeblock:()=>Yr,enum_:()=>Or,field:()=>Wr,file:()=>Vr,func:()=>Gr,identifier:()=>jr,invokeFunc:()=>Jr,invokeMethod:()=>Hr,method:()=>zr,parameter:()=>qr,pointer:()=>Kr,selector:()=>Zr,struct:()=>Qr,switch_:()=>Xr,typeDeclaration:()=>en,typeReference:()=>tn});f();c();f();c();f();c();f();c();f();c();var p=class extends J{async toStringAsync({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new ce({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toStringAsync()}toString({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new ce({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toString()}};var A=class extends p{constructor({docs:e}={}){super();u(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
25
+ `).forEach(n=>{e.writeLine(`// ${n}`)})}};var z=class extends p{constructor({name:e,type:n,docs:i}){super();u(this,"name");u(this,"type");u(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new A({docs:this.docs})),e.write("type "),e.write(this.name),e.write(" = "),e.writeNode(this.type)}};f();c();var L=class extends p{constructor(e){super();u(this,"arg");this.arg=e}write(e){return new k(this.arg).write(e)}};f();c();f();c();var M=class extends p{constructor(e){super();u(this,"name");this.name=e}write(e){e.write(this.name)}};f();c();f();c();f();c();function se({writer:r,arguments_:t,multiline:e=!0}){let n=t.map(i=>i instanceof N&&N.isNop(i)?N.nil():i);if(n.length===0){r.write("()");return}if(e){Rr({writer:r,arguments_:n});return}br({writer:r,arguments_:n})}function Rr({writer:r,arguments_:t}){r.writeLine("("),r.indent();for(let e of t)e.write(r),r.writeLine(",");r.dedent(),r.write(")")}function br({writer:r,arguments_:t}){r.write("("),t.forEach((e,n)=>{n>0&&r.write(", "),e.write(r)}),r.write(")")}var S=class extends p{constructor({func:e,arguments_:n,multiline:i=!0}){super();u(this,"func");u(this,"arguments_");u(this,"multiline");this.func=e,this.arguments_=n,this.multiline=i}write(e){e.writeNode(this.func),se({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};f();c();f();c();function lt({writer:r,generics:t}){t.length!==0&&(r.write("["),t.forEach((e,n)=>{n>0&&r.write(", "),e!=null&&r.writeNode(e)}),r.write("]"))}var E=class extends p{constructor({name:e,importPath:n,generics:i}){super();u(this,"name");u(this,"importPath");u(this,"generics");this.name=e,this.importPath=n,this.generics=i}write(e){if(this.importPath==null||e.importPath===this.importPath){e.write(this.name);return}let n=e.addImport(this.importPath);e.write(`${n}.${this.name}`),this.generics!=null&&lt({writer:e,generics:this.generics})}};f();c();var $=class extends p{constructor({method:e,arguments_:n,on:i,multiline:o}){super();u(this,"on");u(this,"method");u(this,"arguments_");u(this,"multiline");this.on=i,this.method=e,this.arguments_=n,this.multiline=o}write(e){this.on.write(e),e.write("."),e.write(this.method),se({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};var _r=new Set(["bool","date","dateTime","float64","int","int64","string","uuid"]),pt=new Set(["any","bytes","map","slice"]),N=class r extends p{constructor(e){super();u(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"any":this.writeAny({writer:e,value:this.internalType.value});break;case"bool":e.write(this.internalType.value.toString());break;case"bytes":e.write(`[]byte("${this.internalType.value}")`);break;case"date":case"dateTime":e.writeNode(Pr({writer:e,type:this.internalType}));break;case"enum":e.writeNode(this.internalType.typeReference);break;case"float64":e.write(this.internalType.value.toString());break;case"int":case"int64":e.write(this.internalType.value.toString());break;case"map":this.writeMap({writer:e,map:this.internalType});break;case"nil":e.write("nil");break;case"nop":break;case"optional":this.writeOptional({writer:e,type:this.internalType.value});break;case"reference":e.writeNode(this.internalType.value);break;case"slice":this.writeSlice({writer:e,slice:this.internalType});break;case"string":e.write(this.internalType.value.includes('"')||this.internalType.value.includes(`
26
+ `)?`\`${this.internalType.value}\``:`"${this.internalType.value}"`);break;case"struct":this.writeStruct({writer:e,struct:this.internalType});break;case"uuid":e.writeNode(Br({value:this.internalType.value}));break;default:j(this.internalType)}}static any(e){return new this({type:"any",value:e})}static bool(e){return new this({type:"bool",value:e})}static bytes(e){return new this({type:"bytes",value:e})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static enum(e){return new this({type:"enum",typeReference:e})}static float64(e){return new this({type:"float64",value:e})}static int(e){return new this({type:"int",value:e})}static int64(e){return new this({type:"int64",value:e})}static map({keyType:e,valueType:n,entries:i}){return new this({type:"map",keyType:e,valueType:n,entries:i})}static nil(){return new this({type:"nil"})}static nop(){return new this({type:"nop"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static slice({valueType:e,values:n}){return new this({type:"slice",valueType:e,values:n})}static string(e){return new this({type:"string",value:e})}static struct({typeReference:e,fields:n}){return new this({type:"struct",typeReference:e,fields:n})}static structPointer({typeReference:e,fields:n,generics:i}){return new this({type:"optional",value:new this({type:"struct",typeReference:e,fields:n,generics:i})})}static uuid(e){return new this({type:"uuid",value:e})}static isNop(e){return e.internalType.type==="optional"?this.isNop(e.internalType.value):e.internalType.type==="nop"}writeAny({writer:e,value:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("nil");return}if(Array.isArray(n)){this.writeAnyArray({writer:e,value:n});return}this.writeAnyObject({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeAnyArray({writer:e,value:n}){if(e.write("[]any"),n.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let i of n)e.writeNode(r.any(i)),e.writeLine(",");e.dedent(),e.write("}")}writeAnyObject({writer:e,value:n}){e.write("map[string]any");let i=Object.entries(n);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[o,s]of i)e.write(`"${o}": `),e.writeNode(r.any(s)),e.writeLine(",");e.dedent(),e.write("}")}writeMap({writer:e,map:n}){e.write("map["),e.writeNode(n.keyType),e.write("]"),e.writeNode(n.valueType);let i=Cr({entries:n.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.key.write(e),e.write(": "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeOptional({writer:e,type:n}){if(_r.has(n.internalType.type)){e.writeNode(Lr({writer:e,type:n}));return}if(pt.has(n.internalType.type)){n.write(e);return}if(n.internalType.type==="enum"){e.writeNode(new $({on:n.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),n.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||pt.has(e.internalType.type)}writeSlice({writer:e,slice:n}){e.write("[]"),e.writeNode(n.valueType);let i=Mr({values:n.values});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeStruct({writer:e,struct:n}){e.writeNode(n.typeReference),n.generics!=null&&(e.write("["),n.generics.forEach((o,s)=>{s>0&&e.write(", "),e.writeNode(o)}),e.write("]"));let i=Ur({fields:n.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let o of i)e.write(`${o.name}: `),o.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}};function Lr({writer:r,type:t}){return new S({func:new E({name:Fr({type:t}),importPath:r.rootImportPath}),arguments_:[t]})}function Fr({type:r}){switch(r.internalType.type){case"bool":return"Bool";case"date":case"dateTime":return"Time";case"float64":return"Float64";case"int":return"Int";case"int64":return"Int64";case"string":return"String";case"uuid":return"UUID";default:return""}}function Pr({writer:r,type:t}){let e=t.type==="date"?"MustParseDate":"MustParseDateTime";return new S({func:new E({name:e,importPath:r.rootImportPath}),arguments_:[new L(`"${t.value}"`)]})}function Br({value:r}){return new S({func:new E({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new L(`"${r}"`)]})}function Cr({entries:r}){return r.filter(t=>!N.isNop(t.key)&&!N.isNop(t.value))}function Ur({fields:r}){return r.filter(t=>!N.isNop(t.value))}function Mr({values:r}){return r.filter(t=>!N.isNop(t))}var q=class r extends p{constructor({name:e,docs:n}){super();u(this,"name");u(this,"docs");u(this,"members",[]);u(this,"methods",[]);u(this,"constructor_");this.name=e,this.docs=n}addConstructor(e){this.constructor_=e}addMember(e){this.members.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeType({writer:e}),this.writeMembers({writer:e}),this.writeConstructor({writer:e}),this.writeMethods({writer:e})}writeType({writer:e}){e.writeNode(new A({docs:this.docs})),e.writeLine(`type ${this.name} string`)}writeMembers({writer:e}){if(this.members.length!==0){e.newLine(),e.writeLine("const ("),e.indent();for(let n of this.members)e.writeNode(new A({docs:n.docs})),e.writeNode(r.getMemberIdentifier({name:this.name,member:n})),e.write(" = "),e.writeNode(N.string(n.value)),e.newLine();e.dedent(),e.write(")")}}writeConstructor({writer:e}){this.constructor_!=null&&(e.newLine(),e.writeNode(this.constructor_))}writeMethods({writer:e}){e.newLine();for(let n of this.methods)e.newLine(),e.writeNode(n),e.newLine()}static getMemberIdentifier({name:e,member:n}){return new M(`${e}${n.name}`)}};f();c();var K=class extends p{constructor({name:e,type:n,docs:i,tags:o}){super();u(this,"name");u(this,"type");u(this,"docs");u(this,"tags",[]);this.name=e,this.type=n,this.docs=i,this.tags=o!=null?o:[]}addTags(...e){this.tags.push(...e)}write(e){e.writeNode(new A({docs:this.docs})),e.write(`${this.name} `),this.type.write(e),this.writeTags({writer:e})}writeTags({writer:e}){this.tags.length!==0&&(e.write(" `"),this.tags.forEach((n,i)=>{i>0&&e.write(" "),e.write(`${n.name}:"${n.value}"`)}),e.write("`"))}};f();c();var Z=class extends p{constructor({nodes:e}={nodes:[]}){super();u(this,"nodes");this.nodes=e!=null?e:[]}add(...e){this.nodes.push(...e)}write(e){for(let n of this.nodes)n.write(e)}};f();c();f();c();var D=class extends p{constructor({name:e,parameters:n,return_:i,body:o,docs:s,typeReference:h,multiline:l,receiver:m,pointerReceiver:d}){super();u(this,"parameters");u(this,"return_");u(this,"name");u(this,"body");u(this,"docs");u(this,"typeReference");u(this,"multiline");u(this,"receiver");u(this,"pointerReceiver");this.name=e,this.parameters=n,this.return_=i,this.body=o,this.docs=s,this.typeReference=h,this.multiline=l,this.receiver=m,this.pointerReceiver=d}write(e){var n;e.writeNode(new A({docs:this.docs})),e.write("func"),this.typeReference!=null&&this.writeReceiver({writer:e,typeReference:this.typeReference,receiver:this.receiver}),this.name!=null&&e.write(` ${this.name}`),se({writer:e,arguments_:this.parameters,multiline:this.multiline}),this.return_!=null&&(e.write(" "),this.return_.length>1&&e.write("("),this.return_.forEach((i,o)=>{o>0&&e.write(", "),e.writeNode(i)}),this.return_.length>1&&e.write(")")),e.writeLine("{"),e.indent(),(n=this.body)==null||n.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.write("}")}writeReceiver({writer:e,typeReference:n,receiver:i}){e.write(` (${this.getReceiverName({typeReference:n,receiver:i})} `),this.pointerReceiver&&e.write("*"),n.write(e),e.write(")")}getReceiverName({typeReference:e,receiver:n}){return n!=null?n:e.name.charAt(0).toLowerCase()}};var Q=class extends p{constructor({name:e,parameters:n,return_:i,body:o,docs:s,multiline:h}){super();u(this,"func");this.func=new D({name:e,parameters:n,return_:i,body:o,docs:s,multiline:h})}get parameters(){return this.func.parameters}get return_(){return this.func.return_}get name(){return this.func.name}get body(){return this.func.body}get docs(){return this.func.docs}write(e){e.writeNode(this.func)}};f();c();var he=class extends p{constructor({nodes:e}){super();u(this,"nodes");this.nodes=e}write(e){for(let n of this.nodes)e.newLine(),n.write(e),e.newLine()}};f();c();var X=class extends p{constructor({name:e,type:n,docs:i}){super();u(this,"name");u(this,"type");u(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new A({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};f();c();var ee=class extends p{constructor({node:e}){super();u(this,"node");this.node=e}write(e){e.write("*"),this.node.write(e)}};f();c();var te=class extends p{constructor({on:e,selector:n}){super();u(this,"on");u(this,"selector");this.on=e,this.selector=n}write(e){e.writeNode(this.on),e.write("."),e.writeNode(this.selector)}};f();c();var re=class extends p{constructor({name:e,embeds:n,fields:i,docs:o}){super();u(this,"name");u(this,"embeds",[]);u(this,"fields",[]);u(this,"docs");u(this,"methods",[]);u(this,"constructor_");this.name=e,this.docs=o,this.embeds=n!=null?n:[],this.fields=i!=null?i:[]}addConstructor(e){this.constructor_=e}addField(...e){this.fields.push(...e)}addMethod(...e){this.methods.push(...e)}write(e){this.writeType({writer:e}),this.constructor_!=null&&(e.newLine(),e.newLine(),this.writeConstructor({writer:e,constructor:this.constructor_})),this.writeMethods({writer:e})}writeType({writer:e}){if(e.writeNode(new A({docs:this.docs})),this.name!=null?e.write(`type ${this.name} struct {`):e.write("struct{"),this.embeds.length===0&&this.fields.length===0){e.writeLine("}");return}e.newLine(),e.indent();for(let o of this.embeds)e.writeNode(o),e.newLine();let n=this.fields.filter(o=>this.isExported(o));for(let o of n)e.writeNode(o),e.newLine();let i=this.fields.filter(o=>!this.isExported(o));n.length>0&&i.length>0&&e.newLine();for(let o of i)e.writeNode(o),e.newLine();e.dedent(),e.write("}")}writeConstructor({writer:e,constructor:n}){n.name!=null?e.write(`func ${n.name}(`):e.write(`func New${this.name}(`),n.parameters.forEach((i,o)=>{o>0&&e.write(", "),e.writeNode(i)}),e.write(`) *${this.name} {`),e.newLine(),e.indent(),e.writeNode(n.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeMethods({writer:e}){if(this.methods.length!==0){e.writeNewLineIfLastLineNot();for(let n of this.methods)e.newLine(),e.writeNode(n),e.newLine()}}isExported(e){let n=e.name.charAt(0);return n===n.toUpperCase()}};f();c();var le=class extends p{constructor({on:e,cases:n,default:i}){super();u(this,"on");u(this,"cases");u(this,"default");this.on=e,this.cases=n,this.default=i}write(e){let n=this.cases;this.default!=null&&n.push({on:new M("default"),body:this.default}),e.write("switch "),e.writeNode(this.on),e.writeLine("{"),e.indent();for(let i of n)e.write("case "),e.writeNode(i.on),e.writeLine(":"),e.indent(),e.writeNode(i.body),e.dedent(),e.writeNewLineIfLastLineNot();e.dedent(),e.write("}")}};f();c();var $r=new Set(["any","bytes","map","slice"]),pe=class r extends p{constructor(e){super();u(this,"internalType");this.internalType=e}write(e,{comment:n}={}){switch(this.internalType.type){case"any":e.write("any");break;case"bool":e.write("bool");break;case"bytes":e.write("[]byte");break;case"date":case"dateTime":e.writeNode(ke);break;case"error":e.write("error");break;case"float64":e.write("float64");break;case"int":e.write("int");break;case"int64":e.write("int64");break;case"map":{e.write("map["),this.internalType.keyType.write(e),e.write("]"),this.internalType.valueType.write(e);break}case"optional":{e.write("*"),this.internalType.value.write(e);break}case"reference":e.writeNode(this.internalType.value);break;case"slice":e.write("[]"),this.internalType.value.write(e);break;case"string":e.write("string");break;case"uuid":e.writeNode(Se);break;case"variadic":e.write("..."),this.internalType.value.write(e);break;default:j(this.internalType)}}isOptional(){return this.internalType.type==="optional"}isIterable(){return this.internalType.type==="slice"||this.internalType.type==="variadic"}iterableElement(){if(this.internalType.type==="slice"||this.internalType.type==="variadic")return this.internalType.value}underlying(){return this.internalType.type==="optional"?this.internalType.value:this}static any(){return new this({type:"any"})}static bool(){return new this({type:"bool"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static dereference(e){return e.internalType.type==="optional"?e.internalType.value:e}static error(){return new this({type:"error"})}static float64(){return new this({type:"float64"})}static int(){return new this({type:"int"})}static int64(){return new this({type:"int64"})}static map(e,n){return new this({type:"map",keyType:e,valueType:n})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static pointer(e){return r.optional(e)}static reference(e){return new this({type:"reference",value:e})}static slice(e){return new this({type:"slice",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static variadic(e){return this.isAlreadyVariadic(e)?e:new this({type:"variadic",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"||$r.has(e.internalType.type)}static isAlreadyVariadic(e){return e.internalType.type==="variadic"}},ke=new E({importPath:"time",name:"Time"}),Se=new E({importPath:"github.com/google/uuid",name:"UUID"}),Ue=new E({importPath:"io",name:"Reader"});f();c();var ne=class extends p{constructor({name:e,type:n,docs:i}){super();u(this,"name");u(this,"type");u(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new A({docs:this.docs})),e.write("type "),e.write(this.name),e.write(" "),e.writeNode(this.type)}};function Dr(r){return new z(r)}function Yr(r){return new L(r)}function Or(r){return new q(r)}function Wr(r){return new K(r)}function Vr(r={}){return new Z(r)}function Gr(r){return new Q(r)}function jr(r){return new M(r)}function Jr(r){return new S(r)}function Hr(r){return new $(r)}function zr(r){return new D(r)}function qr(r){return new X(r)}function Kr(r){return new ee(r)}function Zr(r){return new te(r)}function Qr(r={}){return new re(r)}function Xr(r){return new le(r)}function en(r){return new ne(r)}function tn(r){return new E(r)}var Me=class{constructor({context:t}){u(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let n={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let s of t.properties)switch(s.type){case"file":n.fileFields.push({name:this.context.getTypeName(s.name),value:this.getSingleFileProperty({property:s,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getTypeName(s.name),value:this.getArrayFileProperty({property:s,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getTypeName(s.name.name),value:this.getBodyProperty({property:s,record:i})});break;default:j(s)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e})||"";return F.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(n))}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return n==null?F.TypeInstantiation.nop():F.TypeInstantiation.slice({valueType:F.Type.reference(this.context.getIoReaderTypeReference()),values:n.map(i=>F.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(i)))})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?F.TypeInstantiation.nop():this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.typeReference,value:n})}};0&&(module.exports={FilePropertyMapper});
27
27
  /*! Bundled license information:
28
28
 
29
29
  @esbuild-plugins/node-globals-polyfill/Buffer.js: