@fern-api/go-dynamic-snippets 0.0.10 → 0.0.11
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.
- package/cjs/DiscriminatedUnionTypeInstance.cjs +11 -1
- package/cjs/DynamicSnippetsGenerator.cjs +18 -8
- package/cjs/EndpointSnippetGenerator.cjs +19 -9
- package/cjs/Result.cjs +11 -1
- package/cjs/Scope.cjs +11 -1
- package/cjs/TypeInstance.cjs +11 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +18 -8
- package/cjs/context/DynamicTypeInstantiationMapper.cjs +25 -15
- package/cjs/context/DynamicTypeMapper.cjs +18 -8
- package/cjs/context/ErrorReporter.cjs +11 -1
- package/cjs/context/FilePropertyMapper.cjs +25 -15
- package/cjs/index.cjs +30 -8
- package/esm/DiscriminatedUnionTypeInstance.js +1 -0
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/Result.js +1 -1
- package/esm/Scope.js +1 -1
- package/esm/TypeInstance.js +1 -0
- package/esm/chunk-2AZXIWKY.js +11 -0
- package/esm/chunk-5TA7XQOD.js +1 -0
- package/esm/chunk-775WBLQ5.js +1 -0
- package/esm/chunk-E5FOYV6P.js +19 -0
- package/esm/chunk-I3J7ADQS.js +1 -0
- package/esm/chunk-IIKN6XQS.js +1 -0
- package/esm/chunk-LLE63BZO.js +1 -0
- package/esm/chunk-SUV3YIZ5.js +1 -0
- package/esm/chunk-VLNKANS2.js +1 -0
- package/esm/chunk-ZI6CAI2V.js +1 -0
- package/esm/chunk-ZXKMRXFM.js +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeInstantiationMapper.js +1 -1
- package/esm/context/DynamicTypeMapper.js +1 -1
- package/esm/context/ErrorReporter.js +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.js +13 -1
- package/package.json +2 -5
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var ee=(n,t,e)=>t in n?L(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var H=(n,t)=>{for(var e in t)L(n,e,{get:t[e],enumerable:!0})},te=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!X.call(n,i)&&i!==e&&L(n,i,{get:()=>t[i],enumerable:!(r=z(t,i))||r.enumerable});return n};var re=n=>te(L({},"__esModule",{value:!0}),n);var o=(n,t,e)=>ee(n,typeof t!="symbol"?t+"":t,e);var ke={};H(ke,{EndpointSnippetGenerator:()=>_});module.exports=re(ke);function k(n){throw new Error("Unexpected value: "+JSON.stringify(n))}var w=class{};var x=class extends w{constructor(e){super();o(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var ne=4,F=class{constructor(){o(this,"buffer","");o(this,"indentLevel",0);o(this,"hasWrittenAnything",!1);o(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
-
`),
|
|
1
|
+
"use strict";var ie=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var et=(r,t,e)=>t in r?ie(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var me=(r,t)=>()=>(r&&(t=r(r=0)),t);var ve=(r,t)=>{for(var e in t)ie(r,e,{get:t[e],enumerable:!0})},tt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xe(t))!je.call(r,i)&&i!==e&&ie(r,i,{get:()=>t[i],enumerable:!(n=Ze(t,i))||n.enumerable});return r};var rt=r=>tt(ie({},"__esModule",{value:!0}),r);var h=(r,t,e)=>et(r,typeof t!="symbol"?t+"":t,e);function Ie(){throw new Error("setTimeout has not been defined")}function Re(){throw new Error("clearTimeout has not been defined")}function Pe(r){if(U===setTimeout)return setTimeout(r,0);if((U===Ie||!U)&&setTimeout)return U=setTimeout,setTimeout(r,0);try{return U(r,0)}catch(t){try{return U.call(null,r,0)}catch(e){return U.call(this,r,0)}}}function nt(r){if(L===clearTimeout)return clearTimeout(r);if((L===Re||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(r);try{return L(r)}catch(t){try{return L.call(null,r)}catch(e){return L.call(this,r)}}}function it(){!Z||!Y||(Z=!1,Y.length?k=Y.concat(k):oe=-1,k.length&&Se())}function Se(){if(!Z){var r=Pe(it);Z=!0;for(var t=k.length;t;){for(Y=k,k=[];++oe<t;)Y&&Y[oe].run();oe=-1,t=k.length}Y=null,Z=!1,nt(r)}}function ot(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];k.push(new Ne(r,t)),k.length===1&&!Z&&Pe(Se)}function Ne(r,t){this.fun=r,this.array=t}function $(){}function vt(r){throw new Error("process.binding is not supported")}function Et(){return"/"}function It(r){throw new Error("process.chdir is not supported")}function Rt(){return 0}function St(r){var t=Pt.call(K)*.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 Bt(){var r=new Date,t=r-Nt;return t/1e3}var U,L,k,Z,Y,oe,st,at,ut,pt,ct,ht,ft,lt,mt,dt,yt,wt,xt,gt,At,Tt,K,Pt,Nt,d,Ee,u=me(()=>{"use strict";U=Ie,L=Re;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(L=clearTimeout);k=[],Z=!1,oe=-1;Ne.prototype.run=function(){this.fun.apply(null,this.array)};st="browser",at="browser",ut=!0,pt={},ct=[],ht="",ft={},lt={},mt={};dt=$,yt=$,wt=$,xt=$,gt=$,At=$,Tt=$;K=globalThis.performance||{},Pt=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};Nt=new Date;d={nextTick:ot,title:st,browser:ut,env:pt,argv:ct,version:ht,versions:ft,on:dt,addListener:yt,once:wt,off:xt,removeListener:gt,removeAllListeners:At,emit:Tt,binding:vt,cwd:Et,chdir:It,umask:Rt,hrtime:St,platform:at,release:lt,config:mt,uptime:Bt},Ee={};Object.keys(Ee).forEach(r=>{let t=r.split("."),e=d;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=Ee[r]:e=e[i]||(e[i]={})}})});function ke(){ye=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)B[t]=r[t],R[r.charCodeAt(t)]=t;R[45]=62,R[95]=63}function _t(r){ye||ke();var t,e,n,i,o,s,c=r.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[c-2]==="="?2:r[c-1]==="="?1:0,s=new bt(c*3/4-o),n=o>0?c-4:c;var f=0;for(t=0,e=0;t<n;t+=4,e+=3)i=R[r.charCodeAt(t)]<<18|R[r.charCodeAt(t+1)]<<12|R[r.charCodeAt(t+2)]<<6|R[r.charCodeAt(t+3)],s[f++]=i>>16&255,s[f++]=i>>8&255,s[f++]=i&255;return o===2?(i=R[r.charCodeAt(t)]<<2|R[r.charCodeAt(t+1)]>>4,s[f++]=i&255):o===1&&(i=R[r.charCodeAt(t)]<<10|R[r.charCodeAt(t+1)]<<4|R[r.charCodeAt(t+2)]>>2,s[f++]=i>>8&255,s[f++]=i&255),s}function kt(r){return B[r>>18&63]+B[r>>12&63]+B[r>>6&63]+B[r&63]}function Ct(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 Be(r){ye||ke();for(var t,e=r.length,n=e%3,i="",o=[],s=16383,c=0,f=e-n;c<f;c+=s)o.push(Ct(r,c,c+s>f?f:c+s));return n===1?(t=r[e-1],i+=B[t>>2],i+=B[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=B[t>>10],i+=B[t>>4&63],i+=B[t<<2&63],i+="="),o.push(i),o.join("")}function se(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(r,t){if(se()<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 we(this,r)}return Ce(this,r,t,e)}function Ce(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?Mt(r,t,e,n):typeof t=="string"?Dt(r,t,e):Ut(r,t)}function Fe(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 Ft(r,t,e,n){return Fe(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 we(r,t){if(Fe(t),r=C(r,t<0?0:xe(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Dt(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=De(t,e)|0;r=C(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function de(r,t){var e=t.length<0?0:xe(t.length)|0;r=C(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Mt(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=de(r,t),r}function Ut(r,t){if(b(t)){var e=xe(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"||rr(t.length)?C(r,0):de(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return de(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function xe(r){if(r>=se())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+se().toString(16)+" bytes");return r|0}function b(r){return!!(r!=null&&r._isBuffer)}function De(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 ae(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Oe(r).length;default:if(n)return ae(r).length;t=(""+t).toLowerCase(),n=!0}}function Lt(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 Qt(this,t,e);case"utf8":case"utf-8":return Le(this,t,e);case"ascii":return Gt(this,t,e);case"latin1":case"binary":return Jt(this,t,e);case"base64":return Vt(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zt(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function O(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function Me(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:be(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):be(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function be(r,t,e,n,i){var o=1,s=r.length,c=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,c/=2,e/=2}function f(A,I){return o===1?A[I]:A.readUInt16BE(I*o)}var y;if(i){var m=-1;for(y=e;y<s;y++)if(f(r,y)===f(t,m===-1?0:y-m)){if(m===-1&&(m=y),y-m+1===c)return m*o}else m!==-1&&(y-=y-m),m=-1}else for(e+c>s&&(e=s-c),y=e;y>=0;y--){for(var l=!0,T=0;T<c;T++)if(f(r,y+T)!==f(t,T)){l=!1;break}if(l)return y}return-1}function qt(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 c=parseInt(t.substr(s*2,2),16);if(isNaN(c))return s;r[e+s]=c}return s}function Yt(r,t,e,n){return ce(ae(t,r.length-e),r,e,n)}function Ue(r,t,e,n){return ce(er(t),r,e,n)}function $t(r,t,e,n){return Ue(r,t,e,n)}function Ot(r,t,e,n){return ce(Oe(t),r,e,n)}function Wt(r,t,e,n){return ce(tr(t,r.length-e),r,e,n)}function Vt(r,t,e){return t===0&&e===r.length?Be(r):Be(r.slice(t,e))}function Le(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var f,y,m,l;switch(c){case 1:o<128&&(s=o);break;case 2:f=r[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(s=l));break;case 3:f=r[i+1],y=r[i+2],(f&192)===128&&(y&192)===128&&(l=(o&15)<<12|(f&63)<<6|y&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:f=r[i+1],y=r[i+2],m=r[i+3],(f&192)===128&&(y&192)===128&&(m&192)===128&&(l=(o&15)<<18|(f&63)<<12|(y&63)<<6|m&63,l>65535&&l<1114112&&(s=l))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return Ht(n)}function Ht(r){var t=r.length;if(t<=_e)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=_e));return e}function Gt(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 Jt(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 Qt(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+=jt(r[o]);return i}function zt(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 g(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 ue(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 pe(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 qe(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 Ye(r,t,e,n,i){return i||qe(r,t,e,4,34028234663852886e22,-34028234663852886e22),Ve(r,t,e,n,23,4),e+4}function $e(r,t,e,n,i){return i||qe(r,t,e,8,17976931348623157e292,-17976931348623157e292),Ve(r,t,e,n,52,8),e+8}function Zt(r){if(r=Xt(r).replace(Kt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Xt(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function jt(r){return r<16?"0"+r.toString(16):r.toString(16)}function ae(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 er(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function tr(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 Oe(r){return _t(Zt(r))}function ce(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 rr(r){return r!==r}function nr(r){return r!=null&&(!!r._isBuffer||We(r)||ir(r))}function We(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function ir(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&We(r.slice(0,0))}function he(r,t,e,n,i){var o,s,c=i*8-n-1,f=(1<<c)-1,y=f>>1,m=-7,l=e?i-1:0,T=e?-1:1,A=r[t+l];for(l+=T,o=A&(1<<-m)-1,A>>=-m,m+=c;m>0;o=o*256+r[t+l],l+=T,m-=8);for(s=o&(1<<-m)-1,o>>=-m,m+=n;m>0;s=s*256+r[t+l],l+=T,m-=8);if(o===0)o=1-y;else{if(o===f)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-y}return(A?-1:1)*s*Math.pow(2,o-n)}function Ve(r,t,e,n,i,o){var s,c,f,y=o*8-i-1,m=(1<<y)-1,l=m>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,I=n?1:-1,Ke=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,s=m):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+l>=1?t+=T/f:t+=T*Math.pow(2,1-l),t*f>=2&&(s++,f/=2),s+l>=m?(c=0,s=m):s+l>=1?(c=(t*f-1)*Math.pow(2,i),s=s+l):(c=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;r[e+A]=c&255,A+=I,c/=256,i-=8);for(s=s<<i|c,y+=i;y>0;r[e+A]=s&255,A+=I,s/=256,y-=8);r[e+A-I]|=Ke*128}var B,R,bt,ye,_e,Kt,He=me(()=>{"use strict";u();p();B=[],R=[],bt=typeof Uint8Array!="undefined"?Uint8Array:Array,ye=!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 Ce(null,r,t,e)};a.kMaxLength=se();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 Ft(null,r,t,e)};a.allocUnsafe=function(r){return we(null,r)};a.allocUnsafeSlow=function(r){return we(null,r)};a.isBuffer=nr;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=De;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)O(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)O(this,e,e+3),O(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)O(this,e,e+7),O(this,e+1,e+6),O(this,e+2,e+5),O(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?Le(this,0,t):Lt.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,c=n-e,f=Math.min(s,c),y=this.slice(i,o),m=t.slice(e,n),l=0;l<f;++l)if(y[l]!==m[l]){s=y[l],c=m[l];break}return s<c?-1:c<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 Me(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return Me(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 qt(this,t,e,n);case"utf8":case"utf-8":return Yt(this,t,e,n);case"ascii":return Ue(this,t,e,n);case"latin1":case"binary":return $t(this,t,e,n);case"base64":return Ot(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt(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)}};_e=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||g(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||g(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||g(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||g(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||g(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||g(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||g(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||g(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||g(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||g(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||g(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||g(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||g(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||g(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||g(t,4,this.length),he(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||g(t,4,this.length),he(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||g(t,8,this.length),he(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||g(t,8,this.length),he(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,c=0;for(this[e]=t&255;++c<n&&(s*=256);)this[e+c]=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,c=1;for(this[e+s]=t&255;--s>=0&&(c*=256);)this[e+s]=t/c&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):ue(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):ue(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):pe(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):pe(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,c=1,f=0;for(this[e]=t&255;++s<n&&(c*=256);)t<0&&f===0&&this[e+s-1]!==0&&(f=1),this[e+s]=(t/c>>0)-f&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,c=1,f=0;for(this[e+s]=t&255;--s>=0&&(c*=256);)t<0&&f===0&&this[e+s+1]!==0&&(f=1),this[e+s]=(t/c>>0)-f&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):ue(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):ue(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):pe(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):pe(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return Ye(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return Ye(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return $e(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return $e(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 c=b(t)?t:ae(new a(t,i).toString()),f=c.length;for(s=0;s<n-e;++s)this[s+e]=c[s%f]}return this};Kt=/[^+\/0-9A-Za-z-_]/g});var p=me(()=>{"use strict";He()});var _r={};ve(_r,{EndpointSnippetGenerator:()=>Te});module.exports=rt(_r);u();p();u();p();u();p();u();p();function j(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();p();u();p();var W=class{};u();p();u();p();var q=class extends W{constructor(e){super();h(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var or=4,ee=class{constructor(){h(this,"buffer","");h(this,"indentLevel",0);h(this,"hasWrittenAnything",!1);h(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
+
`),n=e?t.substring(0,t.length-1):t,i=this.getIndentString(),o=n.replaceAll(`
|
|
3
3
|
`,`
|
|
4
|
-
${i}`);this.isAtStartOfLine()&&(
|
|
5
|
-
`),this.writeInternal(
|
|
4
|
+
${i}`);this.isAtStartOfLine()&&(o=i+o),e&&(o+=`
|
|
5
|
+
`),this.writeInternal(o)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new q(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new q(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}openBlock(t,e="{",n,i="}"){let o=t.filter(s=>s!==void 0).join(" ");o?this.write(`${o} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),n(),this.dedent()}finally{this.write(i!=null?i:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
6
|
`)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
7
|
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
8
|
-
`)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*
|
|
8
|
+
`)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*or)}};u();p();var fe=class{},te=class extends fe{async format(t){return t}formatSync(t){return t}};u();p();function ge(r){return(r==null?void 0:r.name)!=null}u();p();u();p();u();p();u();p();u();p();u();p();u();p();function Ae(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 sr=/[^0-9a-zA-Z_]/g,V=class extends ee{constructor({packageName:e,rootImportPath:n,importPath:i,customConfig:o,formatter:s}){super();h(this,"packageName");h(this,"rootImportPath");h(this,"importPath");h(this,"customConfig");h(this,"formatter");h(this,"imports",{});this.packageName=e,this.rootImportPath=n,this.importPath=i,this.customConfig=o,this.formatter=s!=null?s:new te}addImport(e){let n=this.imports[e];if(n!=null)return n;let i=this.getValidAlias(Ae(e));for(;i in this.imports;)i="_"+i;return this.imports[e]=i,i}getValidAlias(e){let n=e.split("-");return n[0]==null?e:n[0].replace(sr,"")}};var re=class extends V{constructor({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){super({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o})}async toString(){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}
|
|
9
9
|
${t}`)}return t}toStringSync(){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}
|
|
10
10
|
${t}`)}return t}getContent(){let t=`package ${this.packageName}
|
|
11
11
|
|
|
12
12
|
`,e=this.stringifyImports();return e.length>0?`${t}${e}
|
|
13
13
|
|
|
14
|
-
${this.buffer}`:t+this.buffer}stringifyImports(){let t=Object.entries(this.imports).filter(([e,
|
|
14
|
+
${this.buffer}`:t+this.buffer}stringifyImports(){let t=Object.entries(this.imports).filter(([e,n])=>e!==this.importPath).map(([e,n])=>` ${n} "${e}"`).join(`
|
|
15
15
|
`);return t?`import (
|
|
16
16
|
${t}
|
|
17
|
-
)`:""}};var
|
|
18
|
-
`).forEach(
|
|
19
|
-
`)?`\`${this.internalType.value}\``:`"${this.internalType.value}"`);break;case"struct":this.writeStruct({writer:e,struct:this.internalType});break;case"uuid":e.writeNode(ce({value:this.internalType.value}));break;default:k(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:r,entries:i}){return new this({type:"map",keyType:e,valueType:r,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:r}){return new this({type:"slice",valueType:e,values:r})}static string(e){return new this({type:"string",value:e})}static struct({typeReference:e,fields:r}){return new this({type:"struct",typeReference:e,fields:r})}static structPointer({typeReference:e,fields:r}){return new this({type:"optional",value:new this({type:"struct",typeReference:e,fields:r})})}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:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(r.includes('"')?`\`${r}\``:`"${r}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("nil");return}if(Array.isArray(r)){this.writeAnyArray({writer:e,value:r});return}this.writeAnyObject({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeAnyArray({writer:e,value:r}){if(e.write("[]interface{}"),r.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let i of r)e.writeNode(n.any(i)),e.writeLine(",");e.dedent(),e.write("}")}writeAnyObject({writer:e,value:r}){e.write("map[string]interface{}");let i=Object.entries(r);if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let[s,c]of i)e.write(`"${s}": `),e.writeNode(n.any(c)),e.writeLine(",");e.dedent(),e.write("}")}writeMap({writer:e,map:r}){e.write("map["),e.writeNode(r.keyType),e.write("]"),e.writeNode(r.valueType);let i=ue({entries:r.entries});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let s of i)s.key.write(e),e.write(": "),s.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeOptional({writer:e,type:r}){if(oe.has(r.internalType.type)){e.writeNode(se({writer:e,type:r}));return}if(U.has(r.internalType.type)){r.write(e);return}if(r.internalType.type==="enum"){e.writeNode(new f({on:r.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),r.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||U.has(e.internalType.type)}writeSlice({writer:e,slice:r}){e.write("[]"),e.writeNode(r.valueType);let i=me({values:r.values});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let s of i)s.write(e),e.writeLine(",");e.dedent(),e.write("}")}writeStruct({writer:e,struct:r}){e.writeNode(r.typeReference);let i=he({fields:r.fields});if(i.length===0){e.write("{}");return}e.writeLine("{"),e.indent();for(let s of i)e.write(`${s.name}: `),s.value.write(e),e.writeLine(",");e.dedent(),e.write("}")}};function se({writer:n,type:t}){return new d({func:new u({name:ae({type:t}),importPath:n.rootImportPath}),arguments_:[t]})}function ae({type:n}){switch(n.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 pe({writer:n,type:t}){let e=t instanceof Date?"MustParseDate":"MustParseDateTime";return new d({func:new u({name:e,importPath:n.rootImportPath}),arguments_:[new l(`"${t.value}"`)]})}function ce({value:n}){return new d({func:new u({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new l(`"${n}"`)]})}function ue({entries:n}){return n.filter(t=>!m.isNop(t.key)&&!m.isNop(t.value))}function he({fields:n}){return n.filter(t=>!m.isNop(t.value))}function me({values:n}){return n.filter(t=>!m.isNop(t))}function q({writer:n,arguments_:t}){let e=le(t);if(e.length===0){n.write("()");return}n.writeLine("("),n.indent();for(let r of e)de({writer:n,argument:r}),n.writeLine(",");n.dedent(),n.write(")")}function de({writer:n,argument:t}){M(t)?t.assignment.write(n):t.write(n)}function le(n){return n.filter(t=>!(t instanceof m&&m.isNop(t)))}var d=class extends p{constructor({func:e,arguments_:r}){super();o(this,"func");o(this,"arguments_");this.func=e,this.arguments_=r}write(e){e.writeNode(this.func),q({writer:e,arguments_:this.arguments_})}};var S=class extends p{constructor({name:e,type:r,docs:i}){super();o(this,"name");o(this,"type");o(this,"docs");this.name=e,this.type=r,this.docs=i}write(e){e.writeNode(new h({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};var b=class extends p{constructor({name:e,importPath:r,docs:i}){super();o(this,"name");o(this,"importPath");o(this,"docs");o(this,"fields",[]);o(this,"methods",[]);this.name=e,this.importPath=r,this.docs=i}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){if(e.writeNode(new h({docs:this.docs})),e.write(`type ${this.name} struct {`),this.fields.length>0)e.writeLine("}");else{e.newLine(),e.indent();for(let r of this.fields)e.writeNode(r),e.newLine();e.dedent(),e.writeLine("}")}(this.constructor!=null||this.methods.length>0)&&e.newLine();for(let r of this.methods)e.writeNode(r),e.newLine()}};var ye=new Set(["any","bytes","map","slice"]),C=class n extends p{constructor(e){super();o(this,"internalType");this.internalType=e}write(e,{comment:r}={}){switch(this.internalType.type){case"any":e.write("interface{}");break;case"bool":e.write("bool");break;case"bytes":e.write("[]byte");break;case"date":case"dateTime":e.writeNode(fe);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(ge);break;default:k(this.internalType)}}isOptional(){return this.internalType.type==="optional"}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 float64(){return new this({type:"float64"})}static int(){return new this({type:"int"})}static int64(){return new this({type:"int64"})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static pointer(e){return n.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 isAlreadyOptional(e){return e.internalType.type==="optional"||ye.has(e.internalType.type)}},fe=new u({importPath:"time",name:"Time"}),ge=new u({importPath:"github.com/google/uuid",name:"UUID"});var a={};H(a,{AstNode:()=>p,CodeBlock:()=>l,Enum:()=>N,Field:()=>A,Func:()=>P,FuncInvocation:()=>d,Method:()=>y,MethodInvocation:()=>f,Parameter:()=>S,Struct:()=>b,Type:()=>C,TypeInstantiation:()=>m,TypeReference:()=>u,Writer:()=>v,codeblock:()=>xe,enum_:()=>we,field:()=>ve,func:()=>Ne,invokeFunc:()=>Ae,invokeMethod:()=>Pe,method:()=>Se,parameter:()=>be,struct:()=>Te,typeReference:()=>Ie});function xe(n){return new l(n)}function we(n){return new N(n)}function ve(n){return new A(n)}function Ne(n){return new P(n)}function Ae(n){return new d(n)}function Pe(n){return new f(n)}function Se(n){return new y(n)}function be(n){return new S(n)}function Te(n){return new b(n)}function Ie(n){return new u(n)}var I={Critical:"CRITICAL",Warning:"WARNING"};var g={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};var j="example",Y="fern",Re="do",J="client",_=class{constructor({context:t,formatter:e}){o(this,"context");o(this,"formatter");this.context=t,this.formatter=e}async generateSnippet({endpoint:t,request:e}){var i;return await this.buildCodeBlock({endpoint:t,snippet:e}).toString({packageName:j,importPath:Y,rootImportPath:this.context.rootImportPath,customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}generateSnippetSync({endpoint:t,request:e}){var i;return this.buildCodeBlock({endpoint:t,snippet:e}).toStringSync({packageName:j,importPath:Y,rootImportPath:this.context.rootImportPath,customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}buildCodeBlock({endpoint:t,snippet:e}){return a.func({name:Re,parameters:[],return_:[],body:a.codeblock(r=>{r.writeNode(this.constructClient({endpoint:t,snippet:e})),r.writeLine(),r.writeNode(this.callMethod({endpoint:t,snippet:e}))})})}constructClient({endpoint:t,snippet:e}){return a.codeblock(r=>{r.write(`${J} := `),r.writeNode(this.getRootClientFuncInvocation(this.getConstructorArgs({endpoint:t,snippet:e})))})}callMethod({endpoint:t,snippet:e}){return a.invokeMethod({on:a.codeblock(J),method:this.getMethod({endpoint:t}),arguments_:[this.context.getContextTodoFunctionInvocation(),...this.getMethodArgs({endpoint:t,snippet:e})]})}getConstructorArgs({endpoint:t,snippet:e}){let r=[];return t.auth!=null&&(e.auth!=null?r.push(this.getConstructorAuthArg({auth:t.auth,values:e.auth})):this.context.errors.add({severity:I.Warning,message:`Auth with ${t.auth.type} configuration is required for this endpoint`})),this.context.errors.scope(g.Headers),this.context.ir.headers!=null&&e.headers!=null&&r.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope(),r}getConstructorAuthArg({auth:t,values:e}){switch(t.type){case"basic":return e.type!=="basic"?(this.context.errors.add({severity:I.Critical,message:this.newAuthMismatchError({auth:t,values:e}).message}),a.TypeInstantiation.nop()):this.getConstructorBasicAuthArg({auth:t,values:e});case"bearer":return e.type!=="bearer"?(this.context.errors.add({severity:I.Critical,message:this.newAuthMismatchError({auth:t,values:e}).message}),a.TypeInstantiation.nop()):this.getConstructorBearerAuthArg({auth:t,values:e});case"header":return e.type!=="header"?(this.context.errors.add({severity:I.Critical,message:this.newAuthMismatchError({auth:t,values:e}).message}),a.TypeInstantiation.nop()):this.getConstructorHeaderAuthArg({auth:t,values:e})}}getConstructorBasicAuthArg({auth:t,values:e}){return a.codeblock(r=>{r.writeNode(a.invokeFunc({func:a.typeReference({name:"WithBasicAuth",importPath:this.context.getOptionImportPath()}),arguments_:[a.TypeInstantiation.string(e.username),a.TypeInstantiation.string(e.password)]}))})}getConstructorBearerAuthArg({auth:t,values:e}){return a.codeblock(r=>{r.writeNode(a.invokeFunc({func:a.typeReference({name:`With${t.token.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[a.TypeInstantiation.string(e.token)]}))})}getConstructorHeaderAuthArg({auth:t,values:e}){return a.codeblock(r=>{r.writeNode(a.invokeFunc({func:a.typeReference({name:`With${t.header.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.header.typeReference,value:e.value})]}))})}getConstructorHeaderArgs({headers:t,values:e}){let r=[];for(let i of t){let s=this.getConstructorHeaderArg({header:i,value:e.value});s!=null&&r.push(s)}return r}getConstructorHeaderArg({header:t,value:e}){let r=this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.typeReference,value:e});if(!a.TypeInstantiation.isNop(r))return a.codeblock(i=>{i.writeNode(a.invokeFunc({func:a.typeReference({name:`With${t.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[r]}))})}getMethodArgs({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e})}}getMethodArgsForBodyRequest({request:t,snippet:e}){let r=[];if(this.context.errors.scope(g.PathParameters),t.pathParameters!=null){let i=this.getPathParameters({namedParameters:t.pathParameters,snippet:e});r.push(...i.map(s=>s.value))}return this.context.errors.unscope(),this.context.errors.scope(g.RequestBody),t.body!=null&&r.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),r}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.value,value:e})}}getBytesBodyRequestArg({value:t}){return typeof t!="string"?(this.context.errors.add({severity:I.Critical,message:`Expected bytes value to be a string, got ${typeof t}`}),a.TypeInstantiation.nop()):a.TypeInstantiation.bytes(t)}getMethodArgsForInlinedRequest({request:t,snippet:e}){var c;let r=[];this.context.errors.scope(g.PathParameters);let i=[];t.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:t.pathParameters,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(g.RequestBody);let s=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:t})||r.push(...i.map(T=>T.value)),(c=this.context.customConfig)!=null&&c.inlineFileProperties||r.push(...s.fileFields.map(T=>T.value)),this.context.needsRequestParameter({request:t})&&r.push(this.getInlinedRequestArg({request:t,snippet:e,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:t})?i:[],filePropertyInfo:s})),r}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,pathParameterFields:r,filePropertyInfo:i}){var O,W,V,G;this.context.errors.scope(g.QueryParameters);let c=this.context.associateQueryParametersByWireValue({parameters:(O=t.queryParameters)!=null?O:[],values:(W=e.queryParameters)!=null?W:{}}).map(R=>({name:R.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(R)}));this.context.errors.unscope(),this.context.errors.scope(g.Headers);let K=this.context.associateByWireValue({parameters:(V=t.headers)!=null?V:[],values:(G=e.headers)!=null?G:{}}).map(R=>({name:R.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(R)}));this.context.errors.unscope(),this.context.errors.scope(g.RequestBody);let Q=t.body!=null?this.getInlinedRequestBodyStructFields({body:t.body,value:e.requestBody,filePropertyInfo:i}):[];return this.context.errors.unscope(),a.TypeInstantiation.structPointer({typeReference:a.typeReference({name:this.context.getMethodName(t.declaration.name),importPath:this.context.getImportPath(t.declaration.fernFilepath)}),fields:[...r,...c,...K,...Q]})}getInlinedRequestBodyStructFields({body:t,value:e,filePropertyInfo:r}){switch(t.type){case"properties":return this.getInlinedRequestBodyPropertyStructFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyStructField({body:t,value:e})];case"fileUpload":return this.getFileUploadRequestBodyStructFields({filePropertyInfo:r})}}getFileUploadRequestBodyStructFields({filePropertyInfo:t}){var e;return(e=this.context.customConfig)!=null&&e.inlineFileProperties?[...t.fileFields,...t.bodyPropertyFields]:t.bodyPropertyFields}getReferencedRequestBodyPropertyStructField({body:t,value:e}){return{name:this.context.getTypeName(t.bodyKey),value:this.getReferencedRequestBodyPropertyTypeInstantiation({body:t.bodyType,value:e})}}getReferencedRequestBodyPropertyTypeInstantiation({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.value,value:e})}}getInlinedRequestBodyPropertyStructFields({parameters:t,value:e}){var s;let r=[],i=this.context.associateByWireValue({parameters:t,values:(s=this.context.getRecord(e))!=null?s:{}});for(let c of i)r.push({name:this.context.getTypeName(c.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(c)});return r}getPathParameters({namedParameters:t,snippet:e}){var s;let r=[],i=this.context.associateByWireValue({parameters:t,values:(s=e.pathParameters)!=null?s:{}});for(let c of i)r.push({name:this.context.getTypeName(c.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(c)});return r}getMethod({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${t.declaration.fernFilepath.allParts.map(e=>this.context.getMethodName(e)).join(".")}.${this.context.getMethodName(t.declaration.name)}`:this.context.getMethodName(t.declaration.name)}getRootClientFuncInvocation(t){return a.invokeFunc({func:a.typeReference({name:this.context.getClientConstructorName(),importPath:this.context.getClientImportPath()}),arguments_:t})}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}};0&&(module.exports={EndpointSnippetGenerator});
|
|
17
|
+
)`:""}};var x=class extends W{async toString({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new re({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toString()}toStringSync({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new re({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toStringSync()}};var _=class extends x{constructor(e){super();h(this,"arg");this.arg=e}write(e){return new q(this.arg).write(e)}};u();p();u();p();var P=class extends x{constructor({docs:e}={}){super();h(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
18
|
+
`).forEach(n=>{e.writeLine(`// ${n}`)})}};var H=class extends x{constructor({name:e,docs:n}){super();h(this,"name");h(this,"docs");h(this,"members",[]);this.name=e,this.docs=n}addMember(e){this.members.push(e)}write(e){e.writeNode(new P({docs:this.docs})),e.write(`type ${this.name} string`)}};u();p();var G=class extends x{constructor({name:e,type:n,docs:i}){super();h(this,"name");h(this,"type");h(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new P({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();p();u();p();var F=class extends x{constructor({name:e,parameters:n,return_:i,body:o,docs:s,typeReference:c}){super();h(this,"name");h(this,"parameters");h(this,"return_");h(this,"body");h(this,"docs");h(this,"typeReference");this.name=e,this.parameters=n,this.return_=i,this.body=o,this.docs=s,this.typeReference=c}write(e){var n;if(e.writeNode(new P({docs:this.docs})),e.write("func "),this.typeReference!=null&&this.writeReceiver({writer:e,typeReference:this.typeReference}),e.write(`${this.name}`),this.parameters.length===0)e.write("() ");else{e.writeLine("(");for(let i of this.parameters)e.writeNode(i),e.writeLine(",");e.write(")")}this.return_!=null&&(e.write("("),this.return_.forEach((i,o)=>{o>0&&e.write(", "),e.writeNode(i)}),e.write(")")),e.writeLine(" {"),e.indent(),(n=this.body)==null||n.write(e),e.dedent(),e.writeNewLineIfLastLineNot(),e.writeLine("}")}writeReceiver({writer:e,typeReference:n}){e.write(`(${this.getReceiverName(n.name)} `),n.write(e),e.write(") ")}getReceiverName(e){return e.charAt(0).toLowerCase()}};var J=class extends x{constructor({name:e,parameters:n,return_:i,body:o,docs:s}){super();h(this,"func");this.func=new F({name:e,parameters:n,return_:i,body:o,docs:s})}get name(){return this.func.name}get parameters(){return this.func.parameters}get return_(){return this.func.return_}get body(){return this.func.body}get docs(){return this.func.docs}write(e){e.writeNode(this.func)}};u();p();u();p();u();p();u();p();var E=class extends x{constructor({name:e,importPath:n}){super();h(this,"name");h(this,"importPath");this.name=e,this.importPath=n}write(e){if(e.importPath===this.importPath){e.write(this.name);return}let n=e.addImport(this.importPath);e.write(`${n}.${this.name}`)}};u();p();var D=class extends x{constructor({method:e,arguments_:n,on:i}){super();h(this,"on");h(this,"method");h(this,"arguments_");this.on=i,this.method=e,this.arguments_=n}write(e){this.on.write(e),e.write("."),e.write(this.method),le({writer:e,arguments_:this.arguments_})}};var ar=new Set(["bool","date","dateTime","float64","int","int64","string","uuid"]),Ge=new Set(["any","bytes","map","slice"]),S=class r extends x{constructor(e){super();h(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(cr({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(`
|
|
19
|
+
`)?`\`${this.internalType.value}\``:`"${this.internalType.value}"`);break;case"struct":this.writeStruct({writer:e,struct:this.internalType});break;case"uuid":e.writeNode(hr({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}){return new this({type:"optional",value:new this({type:"struct",typeReference:e,fields:n})})}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("[]interface{}"),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]interface{}");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=fr({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(ar.has(n.internalType.type)){e.writeNode(ur({writer:e,type:n}));return}if(Ge.has(n.internalType.type)){n.write(e);return}if(n.internalType.type==="enum"){e.writeNode(new D({on:n.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),n.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||Ge.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);let i=lr({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 ur({writer:r,type:t}){return new N({func:new E({name:pr({type:t}),importPath:r.rootImportPath}),arguments_:[t]})}function pr({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 cr({writer:r,type:t}){let e=t instanceof Date?"MustParseDate":"MustParseDateTime";return new N({func:new E({name:e,importPath:r.rootImportPath}),arguments_:[new _(`"${t.value}"`)]})}function hr({value:r}){return new N({func:new E({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new _(`"${r}"`)]})}function fr({entries:r}){return r.filter(t=>!S.isNop(t.key)&&!S.isNop(t.value))}function lr({fields:r}){return r.filter(t=>!S.isNop(t.value))}function mr({values:r}){return r.filter(t=>!S.isNop(t))}function le({writer:r,arguments_:t}){let e=yr(t);if(e.length===0){r.write("()");return}r.writeLine("("),r.indent();for(let n of e)dr({writer:r,argument:n}),r.writeLine(",");r.dedent(),r.write(")")}function dr({writer:r,argument:t}){ge(t)?t.assignment.write(r):t.write(r)}function yr(r){return r.filter(t=>!(t instanceof S&&S.isNop(t)))}var N=class extends x{constructor({func:e,arguments_:n}){super();h(this,"func");h(this,"arguments_");this.func=e,this.arguments_=n}write(e){e.writeNode(this.func),le({writer:e,arguments_:this.arguments_})}};u();p();var Q=class extends x{constructor({name:e,type:n,docs:i}){super();h(this,"name");h(this,"type");h(this,"docs");this.name=e,this.type=n,this.docs=i}write(e){e.writeNode(new P({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();p();var z=class extends x{constructor({name:e,importPath:n,docs:i}){super();h(this,"name");h(this,"importPath");h(this,"docs");h(this,"fields",[]);h(this,"methods",[]);this.name=e,this.importPath=n,this.docs=i}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){if(e.writeNode(new P({docs:this.docs})),e.write(`type ${this.name} struct {`),this.fields.length>0)e.writeLine("}");else{e.newLine(),e.indent();for(let n of this.fields)e.writeNode(n),e.newLine();e.dedent(),e.writeLine("}")}(this.constructor!=null||this.methods.length>0)&&e.newLine();for(let n of this.methods)e.writeNode(n),e.newLine()}};u();p();var wr=new Set(["any","bytes","map","slice"]),ne=class r extends x{constructor(e){super();h(this,"internalType");this.internalType=e}write(e,{comment:n}={}){switch(this.internalType.type){case"any":e.write("interface{}");break;case"bool":e.write("bool");break;case"bytes":e.write("[]byte");break;case"date":case"dateTime":e.writeNode(xr);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(gr);break;default:j(this.internalType)}}isOptional(){return this.internalType.type==="optional"}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 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 isAlreadyOptional(e){return e.internalType.type==="optional"||wr.has(e.internalType.type)}},xr=new E({importPath:"time",name:"Time"}),gr=new E({importPath:"github.com/google/uuid",name:"UUID"});var w={};ve(w,{AstNode:()=>x,CodeBlock:()=>_,Enum:()=>H,Field:()=>G,Func:()=>J,FuncInvocation:()=>N,Method:()=>F,MethodInvocation:()=>D,Parameter:()=>Q,Struct:()=>z,Type:()=>ne,TypeInstantiation:()=>S,TypeReference:()=>E,Writer:()=>V,codeblock:()=>Ar,enum_:()=>Tr,field:()=>vr,func:()=>Er,invokeFunc:()=>Ir,invokeMethod:()=>Rr,method:()=>Pr,parameter:()=>Sr,struct:()=>Nr,typeReference:()=>Br});u();p();function Ar(r){return new _(r)}function Tr(r){return new H(r)}function vr(r){return new G(r)}function Er(r){return new J(r)}function Ir(r){return new N(r)}function Rr(r){return new D(r)}function Pr(r){return new F(r)}function Sr(r){return new Q(r)}function Nr(r){return new z(r)}function Br(r){return new E(r)}u();p();var X={Critical:"CRITICAL",Warning:"WARNING"};u();p();var M={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};var Je="example",Qe="fern",br="do",ze="client",Te=class{constructor({context:t,formatter:e}){h(this,"context");h(this,"formatter");this.context=t,this.formatter=e}async generateSnippet({endpoint:t,request:e}){var i;return await this.buildCodeBlock({endpoint:t,snippet:e}).toString({packageName:Je,importPath:Qe,rootImportPath:this.context.rootImportPath,customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}generateSnippetSync({endpoint:t,request:e}){var i;return this.buildCodeBlock({endpoint:t,snippet:e}).toStringSync({packageName:Je,importPath:Qe,rootImportPath:this.context.rootImportPath,customConfig:(i=this.context.customConfig)!=null?i:{},formatter:this.formatter})}buildCodeBlock({endpoint:t,snippet:e}){return w.func({name:br,parameters:[],return_:[],body:w.codeblock(n=>{n.writeNode(this.constructClient({endpoint:t,snippet:e})),n.writeLine(),n.writeNode(this.callMethod({endpoint:t,snippet:e}))})})}constructClient({endpoint:t,snippet:e}){return w.codeblock(n=>{n.write(`${ze} := `),n.writeNode(this.getRootClientFuncInvocation(this.getConstructorArgs({endpoint:t,snippet:e})))})}callMethod({endpoint:t,snippet:e}){return w.invokeMethod({on:w.codeblock(ze),method:this.getMethod({endpoint:t}),arguments_:[this.context.getContextTodoFunctionInvocation(),...this.getMethodArgs({endpoint:t,snippet:e})]})}getConstructorArgs({endpoint:t,snippet:e}){let n=[];return t.auth!=null&&(e.auth!=null?n.push(this.getConstructorAuthArg({auth:t.auth,values:e.auth})):this.context.errors.add({severity:X.Warning,message:`Auth with ${t.auth.type} configuration is required for this endpoint`})),this.context.errors.scope(M.Headers),this.context.ir.headers!=null&&e.headers!=null&&n.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope(),n}getConstructorAuthArg({auth:t,values:e}){switch(t.type){case"basic":return e.type!=="basic"?(this.context.errors.add({severity:X.Critical,message:this.newAuthMismatchError({auth:t,values:e}).message}),w.TypeInstantiation.nop()):this.getConstructorBasicAuthArg({auth:t,values:e});case"bearer":return e.type!=="bearer"?(this.context.errors.add({severity:X.Critical,message:this.newAuthMismatchError({auth:t,values:e}).message}),w.TypeInstantiation.nop()):this.getConstructorBearerAuthArg({auth:t,values:e});case"header":return e.type!=="header"?(this.context.errors.add({severity:X.Critical,message:this.newAuthMismatchError({auth:t,values:e}).message}),w.TypeInstantiation.nop()):this.getConstructorHeaderAuthArg({auth:t,values:e})}}getConstructorBasicAuthArg({auth:t,values:e}){return w.codeblock(n=>{n.writeNode(w.invokeFunc({func:w.typeReference({name:"WithBasicAuth",importPath:this.context.getOptionImportPath()}),arguments_:[w.TypeInstantiation.string(e.username),w.TypeInstantiation.string(e.password)]}))})}getConstructorBearerAuthArg({auth:t,values:e}){return w.codeblock(n=>{n.writeNode(w.invokeFunc({func:w.typeReference({name:`With${t.token.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[w.TypeInstantiation.string(e.token)]}))})}getConstructorHeaderAuthArg({auth:t,values:e}){return w.codeblock(n=>{n.writeNode(w.invokeFunc({func:w.typeReference({name:`With${t.header.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.header.typeReference,value:e.value})]}))})}getConstructorHeaderArgs({headers:t,values:e}){let n=[];for(let i of t){let o=this.getConstructorHeaderArg({header:i,value:e.value});o!=null&&n.push(o)}return n}getConstructorHeaderArg({header:t,value:e}){let n=this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.typeReference,value:e});if(!w.TypeInstantiation.isNop(n))return w.codeblock(i=>{i.writeNode(w.invokeFunc({func:w.typeReference({name:`With${t.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[n]}))})}getMethodArgs({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e})}}getMethodArgsForBodyRequest({request:t,snippet:e}){let n=[];if(this.context.errors.scope(M.PathParameters),t.pathParameters!=null){let i=this.getPathParameters({namedParameters:t.pathParameters,snippet:e});n.push(...i.map(o=>o.value))}return this.context.errors.unscope(),this.context.errors.scope(M.RequestBody),t.body!=null&&n.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.value,value:e})}}getBytesBodyRequestArg({value:t}){return typeof t!="string"?(this.context.errors.add({severity:X.Critical,message:`Expected bytes value to be a string, got ${typeof t}`}),w.TypeInstantiation.nop()):w.TypeInstantiation.bytes(t)}getMethodArgsForInlinedRequest({request:t,snippet:e}){var s;let n=[];this.context.errors.scope(M.PathParameters);let i=[];t.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:t.pathParameters,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(M.RequestBody);let o=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:t})||n.push(...i.map(c=>c.value)),(s=this.context.customConfig)!=null&&s.inlineFileProperties||n.push(...o.fileFields.map(c=>c.value)),this.context.needsRequestParameter({request:t})&&n.push(this.getInlinedRequestArg({request:t,snippet:e,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:t})?i:[],filePropertyInfo:o})),n}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,pathParameterFields:n,filePropertyInfo:i}){var m,l,T,A;this.context.errors.scope(M.QueryParameters);let s=this.context.associateQueryParametersByWireValue({parameters:(m=t.queryParameters)!=null?m:[],values:(l=e.queryParameters)!=null?l:{}}).map(I=>({name:I.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(I)}));this.context.errors.unscope(),this.context.errors.scope(M.Headers);let f=this.context.associateByWireValue({parameters:(T=t.headers)!=null?T:[],values:(A=e.headers)!=null?A:{}}).map(I=>({name:I.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(I)}));this.context.errors.unscope(),this.context.errors.scope(M.RequestBody);let y=t.body!=null?this.getInlinedRequestBodyStructFields({body:t.body,value:e.requestBody,filePropertyInfo:i}):[];return this.context.errors.unscope(),w.TypeInstantiation.structPointer({typeReference:w.typeReference({name:this.context.getMethodName(t.declaration.name),importPath:this.context.getImportPath(t.declaration.fernFilepath)}),fields:[...n,...s,...f,...y]})}getInlinedRequestBodyStructFields({body:t,value:e,filePropertyInfo:n}){switch(t.type){case"properties":return this.getInlinedRequestBodyPropertyStructFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyStructField({body:t,value:e})];case"fileUpload":return this.getFileUploadRequestBodyStructFields({filePropertyInfo:n})}}getFileUploadRequestBodyStructFields({filePropertyInfo:t}){var e;return(e=this.context.customConfig)!=null&&e.inlineFileProperties?[...t.fileFields,...t.bodyPropertyFields]:t.bodyPropertyFields}getReferencedRequestBodyPropertyStructField({body:t,value:e}){return{name:this.context.getTypeName(t.bodyKey),value:this.getReferencedRequestBodyPropertyTypeInstantiation({body:t.bodyType,value:e})}}getReferencedRequestBodyPropertyTypeInstantiation({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.value,value:e})}}getInlinedRequestBodyPropertyStructFields({parameters:t,value:e}){var o;let n=[],i=this.context.associateByWireValue({parameters:t,values:(o=this.context.getRecord(e))!=null?o:{}});for(let s of i)n.push({name:this.context.getTypeName(s.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(s)});return n}getPathParameters({namedParameters:t,snippet:e}){var o;let n=[],i=this.context.associateByWireValue({parameters:t,values:(o=e.pathParameters)!=null?o:{}});for(let s of i)n.push({name:this.context.getTypeName(s.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(s)});return n}getMethod({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${t.declaration.fernFilepath.allParts.map(e=>this.context.getMethodName(e)).join(".")}.${this.context.getMethodName(t.declaration.name)}`:this.context.getMethodName(t.declaration.name)}getRootClientFuncInvocation(t){return w.invokeFunc({func:w.typeReference({name:this.context.getClientConstructorName(),importPath:this.context.getClientImportPath()}),arguments_:t})}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}};0&&(module.exports={EndpointSnippetGenerator});
|
|
20
|
+
/*! Bundled license information:
|
|
21
|
+
|
|
22
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
23
|
+
(*!
|
|
24
|
+
* The buffer module from node.js, for the browser.
|
|
25
|
+
*
|
|
26
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
27
|
+
* @license MIT
|
|
28
|
+
*)
|
|
29
|
+
*/
|
package/cjs/Result.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var u=(e,r,t)=>r in e?n(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var a=(e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})},l=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of c(r))!h.call(e,i)&&i!==t&&n(e,i,{get:()=>r[i],enumerable:!(s=d(r,i))||s.enumerable});return e};var m=e=>l(n({},"__esModule",{value:!0}),e);var p=(e,r,t)=>u(e,typeof r!="symbol"?r+"":r,t);var f={};a(f,{Result:()=>o});module.exports=m(f);var o=class{constructor(){p(this,"reporter");p(this,"snippet");p(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:r,snippet:t}){(this.reporter==null||this.reporter.size()>r.errors.size())&&(this.reporter=r.errors.clone(),this.snippet=t)}getResponseOrThrow({endpoint:r}){var t;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(t=this.err)!=null?t:new Error(`Failed to generate snippet for endpoint "${r.method} ${r.path}"`)}};0&&(module.exports={Result});
|
|
1
|
+
"use strict";var Y=Object.defineProperty;var wr=Object.getOwnPropertyDescriptor;var xr=Object.getOwnPropertyNames;var Er=Object.prototype.hasOwnProperty;var mr=(n,r,i)=>r in n?Y(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var Ar=(n,r)=>{for(var i in r)Y(n,i,{get:r[i],enumerable:!0})},yr=(n,r,i,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of xr(r))!Er.call(n,t)&&t!==i&&Y(n,t,{get:()=>r[t],enumerable:!(e=wr(r,t))||e.enumerable});return n};var gr=n=>yr(Y({},"__esModule",{value:!0}),n);var P=(n,r,i)=>mr(n,typeof r!="symbol"?r+"":r,i);var _i={};Ar(_i,{Result:()=>V});module.exports=gr(_i);function Q(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}var R=Q,_=X;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function $(n){if(R===setTimeout)return setTimeout(n,0);if((R===Q||!R)&&setTimeout)return R=setTimeout,setTimeout(n,0);try{return R(n,0)}catch(r){try{return R.call(null,n,0)}catch(i){return R.call(this,n,0)}}}function Tr(n){if(_===clearTimeout)return clearTimeout(n);if((_===X||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(n);try{return _(n)}catch(r){try{return _.call(null,n)}catch(i){return _.call(this,n)}}}var g=[],S=!1,d,D=-1;function Rr(){!S||!d||(S=!1,d.length?g=d.concat(g):D=-1,g.length&&q())}function q(){if(!S){var n=$(Rr);S=!0;for(var r=g.length;r;){for(d=g,g=[];++D<r;)d&&d[D].run();D=-1,r=g.length}d=null,S=!1,Tr(n)}}function _r(n){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];g.push(new Z(n,r)),g.length===1&&!S&&$(q)}function Z(n,r){this.fun=n,this.array=r}Z.prototype.run=function(){this.fun.apply(null,this.array)};var dr="browser",vr="browser",Ir=!0,Ur={},Br=[],Sr="",Yr={},Pr={},Dr={};function v(){}var Mr=v,Cr=v,kr=v,Nr=v,Lr=v,Fr=v,Wr=v;function zr(n){throw new Error("process.binding is not supported")}function Gr(){return"/"}function Hr(n){throw new Error("process.chdir is not supported")}function Or(){return 0}var B=globalThis.performance||{},Vr=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return new Date().getTime()};function Jr(n){var r=Vr.call(B)*.001,i=Math.floor(r),e=Math.floor(r%1*1e9);return n&&(i=i-n[0],e=e-n[1],e<0&&(i--,e+=1e9)),[i,e]}var Qr=new Date;function Xr(){var n=new Date,r=n-Qr;return r/1e3}var W={nextTick:_r,title:dr,browser:Ir,env:Ur,argv:Br,version:Sr,versions:Yr,on:Mr,addListener:Cr,once:kr,off:Nr,removeListener:Lr,removeAllListeners:Fr,emit:Wr,binding:zr,cwd:Gr,chdir:Hr,umask:Or,hrtime:Jr,platform:vr,release:Pr,config:Dr,uptime:Xr},J={};Object.keys(J).forEach(n=>{let r=n.split("."),i=W;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?i[t]=J[n]:i=i[t]||(i[t]={})}});var A=[],E=[],$r=typeof Uint8Array!="undefined"?Uint8Array:Array,G=!1;function rr(){G=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=n.length;r<i;++r)A[r]=n[r],E[n.charCodeAt(r)]=r;E[45]=62,E[95]=63}function qr(n){G||rr();var r,i,e,t,o,f,h=n.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[h-2]==="="?2:n[h-1]==="="?1:0,f=new $r(h*3/4-o),e=o>0?h-4:h;var a=0;for(r=0,i=0;r<e;r+=4,i+=3)t=E[n.charCodeAt(r)]<<18|E[n.charCodeAt(r+1)]<<12|E[n.charCodeAt(r+2)]<<6|E[n.charCodeAt(r+3)],f[a++]=t>>16&255,f[a++]=t>>8&255,f[a++]=t&255;return o===2?(t=E[n.charCodeAt(r)]<<2|E[n.charCodeAt(r+1)]>>4,f[a++]=t&255):o===1&&(t=E[n.charCodeAt(r)]<<10|E[n.charCodeAt(r+1)]<<4|E[n.charCodeAt(r+2)]>>2,f[a++]=t>>8&255,f[a++]=t&255),f}function Zr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}function Kr(n,r,i){for(var e,t=[],o=r;o<i;o+=3)e=(n[o]<<16)+(n[o+1]<<8)+n[o+2],t.push(Zr(e));return t.join("")}function K(n){G||rr();for(var r,i=n.length,e=i%3,t="",o=[],f=16383,h=0,a=i-e;h<a;h+=f)o.push(Kr(n,h,h+f>a?a:h+f));return e===1?(r=n[i-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(n[i-2]<<8)+n[i-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),o.push(t),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function M(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(n,r){if(M()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(r),n.__proto__=u.prototype):(n===null&&(n=new u(r)),n.length=r),n}function u(n,r,i){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(n,r,i);if(typeof n=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,n)}return ir(this,n,r,i)}u.poolSize=8192;u._augment=function(n){return n.__proto__=u.prototype,n};function ir(n,r,i,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?ri(n,r,i,e):typeof r=="string"?jr(n,r,i):ii(n,r)}u.from=function(n,r,i){return ir(null,n,r,i)};u.kMaxLength=M();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]);function nr(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function br(n,r,i,e){return nr(r),r<=0?T(n,r):i!==void 0?typeof e=="string"?T(n,r).fill(i,e):T(n,r).fill(i):T(n,r)}u.alloc=function(n,r,i){return br(null,n,r,i)};function H(n,r){if(nr(r),n=T(n,r<0?0:O(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)n[i]=0;return n}u.allocUnsafe=function(n){return H(null,n)};u.allocUnsafeSlow=function(n){return H(null,n)};function jr(n,r,i){if((typeof i!="string"||i==="")&&(i="utf8"),!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=er(r,i)|0;n=T(n,e);var t=n.write(r,i);return t!==e&&(n=n.slice(0,t)),n}function z(n,r){var i=r.length<0?0:O(r.length)|0;n=T(n,i);for(var e=0;e<i;e+=1)n[e]=r[e]&255;return n}function ri(n,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");return i===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,i):r=new Uint8Array(r,i,e),u.TYPED_ARRAY_SUPPORT?(n=r,n.__proto__=u.prototype):n=z(n,r),n}function ii(n,r){if(y(r)){var i=O(r.length)|0;return n=T(n,i),n.length===0||r.copy(n,0,0,i),n}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||gi(r.length)?T(n,0):z(n,r);if(r.type==="Buffer"&&Array.isArray(r.data))return z(n,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function O(n){if(n>=M())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M().toString(16)+" bytes");return n|0}u.isBuffer=Ti;function y(n){return!!(n!=null&&n._isBuffer)}u.compare=function(r,i){if(!y(r)||!y(i))throw new TypeError("Arguments must be Buffers");if(r===i)return 0;for(var e=r.length,t=i.length,o=0,f=Math.min(e,t);o<f;++o)if(r[o]!==i[o]){e=r[o],t=i[o];break}return e<t?-1:t<e?1:0};u.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(r,i){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var e;if(i===void 0)for(i=0,e=0;e<r.length;++e)i+=r[e].length;var t=u.allocUnsafe(i),o=0;for(e=0;e<r.length;++e){var f=r[e];if(!y(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(t,o),o+=f.length}return t};function er(n,r){if(y(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var i=n.length;if(i===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return C(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return cr(n).length;default:if(e)return C(n).length;r=(""+r).toLowerCase(),e=!0}}u.byteLength=er;function ni(n,r,i){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,r>>>=0,i<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return si(this,r,i);case"utf8":case"utf-8":return fr(this,r,i);case"ascii":return ci(this,r,i);case"latin1":case"binary":return pi(this,r,i);case"base64":return hi(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return li(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),e=!0}}u.prototype._isBuffer=!0;function I(n,r,i){var e=n[r];n[r]=n[i],n[i]=e}u.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<r;i+=2)I(this,i,i+1);return this};u.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<r;i+=4)I(this,i,i+3),I(this,i+1,i+2);return this};u.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<r;i+=8)I(this,i,i+7),I(this,i+1,i+6),I(this,i+2,i+5),I(this,i+3,i+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?fr(this,0,r):ni.apply(this,arguments)};u.prototype.equals=function(r){if(!y(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,i,e,t,o){if(!y(r))throw new TypeError("Argument must be a Buffer");if(i===void 0&&(i=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),o===void 0&&(o=this.length),i<0||e>r.length||t<0||o>this.length)throw new RangeError("out of range index");if(t>=o&&i>=e)return 0;if(t>=o)return-1;if(i>=e)return 1;if(i>>>=0,e>>>=0,t>>>=0,o>>>=0,this===r)return 0;for(var f=o-t,h=e-i,a=Math.min(f,h),p=this.slice(t,o),s=r.slice(i,e),c=0;c<a;++c)if(p[c]!==s[c]){f=p[c],h=s[c];break}return f<h?-1:h<f?1:0};function tr(n,r,i,e,t){if(n.length===0)return-1;if(typeof i=="string"?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=t?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(t)return-1;i=n.length-1}else if(i<0)if(t)i=0;else return-1;if(typeof r=="string"&&(r=u.from(r,e)),y(r))return r.length===0?-1:b(n,r,i,e,t);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(n,r,i):Uint8Array.prototype.lastIndexOf.call(n,r,i):b(n,[r],i,e,t);throw new TypeError("val must be string, number or Buffer")}function b(n,r,i,e,t){var o=1,f=n.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(n.length<2||r.length<2)return-1;o=2,f/=2,h/=2,i/=2}function a(x,U){return o===1?x[U]:x.readUInt16BE(U*o)}var p;if(t){var s=-1;for(p=i;p<f;p++)if(a(n,p)===a(r,s===-1?0:p-s)){if(s===-1&&(s=p),p-s+1===h)return s*o}else s!==-1&&(p-=p-s),s=-1}else for(i+h>f&&(i=f-h),p=i;p>=0;p--){for(var c=!0,m=0;m<h;m++)if(a(n,p+m)!==a(r,m)){c=!1;break}if(c)return p}return-1}u.prototype.includes=function(r,i,e){return this.indexOf(r,i,e)!==-1};u.prototype.indexOf=function(r,i,e){return tr(this,r,i,e,!0)};u.prototype.lastIndexOf=function(r,i,e){return tr(this,r,i,e,!1)};function ei(n,r,i,e){i=Number(i)||0;var t=n.length-i;e?(e=Number(e),e>t&&(e=t)):e=t;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");e>o/2&&(e=o/2);for(var f=0;f<e;++f){var h=parseInt(r.substr(f*2,2),16);if(isNaN(h))return f;n[i+f]=h}return f}function ti(n,r,i,e){return L(C(r,n.length-i),n,i,e)}function or(n,r,i,e){return L(Ai(r),n,i,e)}function oi(n,r,i,e){return or(n,r,i,e)}function fi(n,r,i,e){return L(cr(r),n,i,e)}function ui(n,r,i,e){return L(yi(r,n.length-i),n,i,e)}u.prototype.write=function(r,i,e,t){if(i===void 0)t="utf8",e=this.length,i=0;else if(e===void 0&&typeof i=="string")t=i,e=this.length,i=0;else if(isFinite(i))i=i|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-i;if((e===void 0||e>o)&&(e=o),r.length>0&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var f=!1;;)switch(t){case"hex":return ei(this,r,i,e);case"utf8":case"utf-8":return ti(this,r,i,e);case"ascii":return or(this,r,i,e);case"latin1":case"binary":return oi(this,r,i,e);case"base64":return fi(this,r,i,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ui(this,r,i,e);default:if(f)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),f=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function hi(n,r,i){return r===0&&i===n.length?K(n):K(n.slice(r,i))}function fr(n,r,i){i=Math.min(n.length,i);for(var e=[],t=r;t<i;){var o=n[t],f=null,h=o>239?4:o>223?3:o>191?2:1;if(t+h<=i){var a,p,s,c;switch(h){case 1:o<128&&(f=o);break;case 2:a=n[t+1],(a&192)===128&&(c=(o&31)<<6|a&63,c>127&&(f=c));break;case 3:a=n[t+1],p=n[t+2],(a&192)===128&&(p&192)===128&&(c=(o&15)<<12|(a&63)<<6|p&63,c>2047&&(c<55296||c>57343)&&(f=c));break;case 4:a=n[t+1],p=n[t+2],s=n[t+3],(a&192)===128&&(p&192)===128&&(s&192)===128&&(c=(o&15)<<18|(a&63)<<12|(p&63)<<6|s&63,c>65535&&c<1114112&&(f=c))}}f===null?(f=65533,h=1):f>65535&&(f-=65536,e.push(f>>>10&1023|55296),f=56320|f&1023),e.push(f),t+=h}return ai(e)}var j=4096;function ai(n){var r=n.length;if(r<=j)return String.fromCharCode.apply(String,n);for(var i="",e=0;e<r;)i+=String.fromCharCode.apply(String,n.slice(e,e+=j));return i}function ci(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]&127);return e}function pi(n,r,i){var e="";i=Math.min(n.length,i);for(var t=r;t<i;++t)e+=String.fromCharCode(n[t]);return e}function si(n,r,i){var e=n.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var t="",o=r;o<i;++o)t+=mi(n[o]);return t}function li(n,r,i){for(var e=n.slice(r,i),t="",o=0;o<e.length;o+=2)t+=String.fromCharCode(e[o]+e[o+1]*256);return t}u.prototype.slice=function(r,i){var e=this.length;r=~~r,i=i===void 0?e:~~i,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),i<0?(i+=e,i<0&&(i=0)):i>e&&(i=e),i<r&&(i=r);var t;if(u.TYPED_ARRAY_SUPPORT)t=this.subarray(r,i),t.__proto__=u.prototype;else{var o=i-r;t=new u(o,void 0);for(var f=0;f<o;++f)t[f]=this[f+r]}return t};function l(n,r,i){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>i)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,i,e){r=r|0,i=i|0,e||l(r,i,this.length);for(var t=this[r],o=1,f=0;++f<i&&(o*=256);)t+=this[r+f]*o;return t};u.prototype.readUIntBE=function(r,i,e){r=r|0,i=i|0,e||l(r,i,this.length);for(var t=this[r+--i],o=1;i>0&&(o*=256);)t+=this[r+--i]*o;return t};u.prototype.readUInt8=function(r,i){return i||l(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,i){return i||l(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,i){return i||l(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,i){return i||l(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,i){return i||l(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,i,e){r=r|0,i=i|0,e||l(r,i,this.length);for(var t=this[r],o=1,f=0;++f<i&&(o*=256);)t+=this[r+f]*o;return o*=128,t>=o&&(t-=Math.pow(2,8*i)),t};u.prototype.readIntBE=function(r,i,e){r=r|0,i=i|0,e||l(r,i,this.length);for(var t=i,o=1,f=this[r+--t];t>0&&(o*=256);)f+=this[r+--t]*o;return o*=128,f>=o&&(f-=Math.pow(2,8*i)),f};u.prototype.readInt8=function(r,i){return i||l(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,i){i||l(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};u.prototype.readInt16BE=function(r,i){i||l(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};u.prototype.readInt32LE=function(r,i){return i||l(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,i){return i||l(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,i){return i||l(r,4,this.length),F(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,i){return i||l(r,4,this.length),F(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,i){return i||l(r,8,this.length),F(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,i){return i||l(r,8,this.length),F(this,r,!1,52,8)};function w(n,r,i,e,t,o){if(!y(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<o)throw new RangeError('"value" argument is out of bounds');if(i+e>n.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;w(this,r,i,e,o,0)}var f=1,h=0;for(this[i]=r&255;++h<e&&(f*=256);)this[i+h]=r/f&255;return i+e};u.prototype.writeUIntBE=function(r,i,e,t){if(r=+r,i=i|0,e=e|0,!t){var o=Math.pow(2,8*e)-1;w(this,r,i,e,o,0)}var f=e-1,h=1;for(this[i+f]=r&255;--f>=0&&(h*=256);)this[i+f]=r/h&255;return i+e};u.prototype.writeUInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[i]=r&255,i+1};function k(n,r,i,e){r<0&&(r=65535+r+1);for(var t=0,o=Math.min(n.length-i,2);t<o;++t)n[i+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}u.prototype.writeUInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):k(this,r,i,!0),i+2};u.prototype.writeUInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):k(this,r,i,!1),i+2};function N(n,r,i,e){r<0&&(r=4294967295+r+1);for(var t=0,o=Math.min(n.length-i,4);t<o;++t)n[i+t]=r>>>(e?t:3-t)*8&255}u.prototype.writeUInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[i+3]=r>>>24,this[i+2]=r>>>16,this[i+1]=r>>>8,this[i]=r&255):N(this,r,i,!0),i+4};u.prototype.writeUInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):N(this,r,i,!1),i+4};u.prototype.writeIntLE=function(r,i,e,t){if(r=+r,i=i|0,!t){var o=Math.pow(2,8*e-1);w(this,r,i,e,o-1,-o)}var f=0,h=1,a=0;for(this[i]=r&255;++f<e&&(h*=256);)r<0&&a===0&&this[i+f-1]!==0&&(a=1),this[i+f]=(r/h>>0)-a&255;return i+e};u.prototype.writeIntBE=function(r,i,e,t){if(r=+r,i=i|0,!t){var o=Math.pow(2,8*e-1);w(this,r,i,e,o-1,-o)}var f=e-1,h=1,a=0;for(this[i+f]=r&255;--f>=0&&(h*=256);)r<0&&a===0&&this[i+f+1]!==0&&(a=1),this[i+f]=(r/h>>0)-a&255;return i+e};u.prototype.writeInt8=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[i]=r&255,i+1};u.prototype.writeInt16LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8):k(this,r,i,!0),i+2};u.prototype.writeInt16BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[i]=r>>>8,this[i+1]=r&255):k(this,r,i,!1),i+2};u.prototype.writeInt32LE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[i]=r&255,this[i+1]=r>>>8,this[i+2]=r>>>16,this[i+3]=r>>>24):N(this,r,i,!0),i+4};u.prototype.writeInt32BE=function(r,i,e){return r=+r,i=i|0,e||w(this,r,i,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[i]=r>>>24,this[i+1]=r>>>16,this[i+2]=r>>>8,this[i+3]=r&255):N(this,r,i,!1),i+4};function ur(n,r,i,e,t,o){if(i+e>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function hr(n,r,i,e,t){return t||ur(n,r,i,4,34028234663852886e22,-34028234663852886e22),sr(n,r,i,e,23,4),i+4}u.prototype.writeFloatLE=function(r,i,e){return hr(this,r,i,!0,e)};u.prototype.writeFloatBE=function(r,i,e){return hr(this,r,i,!1,e)};function ar(n,r,i,e,t){return t||ur(n,r,i,8,17976931348623157e292,-17976931348623157e292),sr(n,r,i,e,52,8),i+8}u.prototype.writeDoubleLE=function(r,i,e){return ar(this,r,i,!0,e)};u.prototype.writeDoubleBE=function(r,i,e){return ar(this,r,i,!1,e)};u.prototype.copy=function(r,i,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),i>=r.length&&(i=r.length),i||(i=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-i<t-e&&(t=r.length-i+e);var o=t-e,f;if(this===r&&e<i&&i<t)for(f=o-1;f>=0;--f)r[f+i]=this[f+e];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(f=0;f<o;++f)r[f+i]=this[f+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+o),i);return o};u.prototype.fill=function(r,i,e,t){if(typeof r=="string"){if(typeof i=="string"?(t=i,i=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(e<=i)return this;i=i>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var f;if(typeof r=="number")for(f=i;f<e;++f)this[f]=r;else{var h=y(r)?r:C(new u(r,t).toString()),a=h.length;for(f=0;f<e-i;++f)this[f+i]=h[f%a]}return this};var wi=/[^+\/0-9A-Za-z-_]/g;function xi(n){if(n=Ei(n).replace(wi,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function Ei(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function mi(n){return n<16?"0"+n.toString(16):n.toString(16)}function C(n,r){r=r||1/0;for(var i,e=n.length,t=null,o=[],f=0;f<e;++f){if(i=n.charCodeAt(f),i>55295&&i<57344){if(!t){if(i>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(f+1===e){(r-=3)>-1&&o.push(239,191,189);continue}t=i;continue}if(i<56320){(r-=3)>-1&&o.push(239,191,189),t=i;continue}i=(t-55296<<10|i-56320)+65536}else t&&(r-=3)>-1&&o.push(239,191,189);if(t=null,i<128){if((r-=1)<0)break;o.push(i)}else if(i<2048){if((r-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((r-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((r-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}function Ai(n){for(var r=[],i=0;i<n.length;++i)r.push(n.charCodeAt(i)&255);return r}function yi(n,r){for(var i,e,t,o=[],f=0;f<n.length&&!((r-=2)<0);++f)i=n.charCodeAt(f),e=i>>8,t=i%256,o.push(t),o.push(e);return o}function cr(n){return qr(xi(n))}function L(n,r,i,e){for(var t=0;t<e&&!(t+i>=r.length||t>=n.length);++t)r[t+i]=n[t];return t}function gi(n){return n!==n}function Ti(n){return n!=null&&(!!n._isBuffer||pr(n)||Ri(n))}function pr(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Ri(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&pr(n.slice(0,0))}function F(n,r,i,e,t){var o,f,h=t*8-e-1,a=(1<<h)-1,p=a>>1,s=-7,c=i?t-1:0,m=i?-1:1,x=n[r+c];for(c+=m,o=x&(1<<-s)-1,x>>=-s,s+=h;s>0;o=o*256+n[r+c],c+=m,s-=8);for(f=o&(1<<-s)-1,o>>=-s,s+=e;s>0;f=f*256+n[r+c],c+=m,s-=8);if(o===0)o=1-p;else{if(o===a)return f?NaN:(x?-1:1)*(1/0);f=f+Math.pow(2,e),o=o-p}return(x?-1:1)*f*Math.pow(2,o-e)}function sr(n,r,i,e,t,o){var f,h,a,p=o*8-t-1,s=(1<<p)-1,c=s>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:o-1,U=e?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,f=s):(f=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-f))<1&&(f--,a*=2),f+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(f++,a/=2),f+c>=s?(h=0,f=s):f+c>=1?(h=(r*a-1)*Math.pow(2,t),f=f+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),f=0));t>=8;n[i+x]=h&255,x+=U,h/=256,t-=8);for(f=f<<t|h,p+=t;p>0;n[i+x]=f&255,x+=U,f/=256,p-=8);n[i+x-U]|=lr*128}var V=class{constructor(){P(this,"reporter");P(this,"snippet");P(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:r,snippet:i}){(this.reporter==null||this.reporter.size()>r.errors.size())&&(this.reporter=r.errors.clone(),this.snippet=i)}getResponseOrThrow({endpoint:r}){var i;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(i=this.err)!=null?i:new Error(`Failed to generate snippet for endpoint "${r.method} ${r.path}"`)}};0&&(module.exports={Result});
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
package/cjs/Scope.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var P=(r,e)=>{for(var a in e)o(r,a,{get:e[a],enumerable:!0})},d=(r,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of y(e))!c.call(r,t)&&t!==a&&o(r,t,{get:()=>e[t],enumerable:!(s=p(e,t))||s.enumerable});return r};var m=r=>d(o({},"__esModule",{value:!0}),r);var S={};P(S,{Scope:()=>u});module.exports=m(S);var u={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};0&&(module.exports={Scope});
|
|
1
|
+
"use strict";var L=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var wr=Object.prototype.hasOwnProperty;var xr=(i,r)=>{for(var n in r)L(i,n,{get:r[n],enumerable:!0})},Er=(i,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of sr(r))!wr.call(i,t)&&t!==n&&L(i,t,{get:()=>r[t],enumerable:!(e=lr(r,t))||e.enumerable});return i};var mr=i=>Er(L({},"__esModule",{value:!0}),i);var Rn={};xr(Rn,{Scope:()=>Tn});module.exports=mr(Rn);function z(){throw new Error("setTimeout has not been defined")}function G(){throw new Error("clearTimeout has not been defined")}var R=z,_=G;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function J(i){if(R===setTimeout)return setTimeout(i,0);if((R===z||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch(r){try{return R.call(null,i,0)}catch(n){return R.call(this,i,0)}}}function Ar(i){if(_===clearTimeout)return clearTimeout(i);if((_===G||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch(r){try{return _.call(null,i)}catch(n){return _.call(this,i)}}}var g=[],S=!1,I,P=-1;function yr(){!S||!I||(S=!1,I.length?g=I.concat(g):P=-1,g.length&&O())}function O(){if(!S){var i=J(yr);S=!0;for(var r=g.length;r;){for(I=g,g=[];++P<r;)I&&I[P].run();P=-1,r=g.length}I=null,S=!1,Ar(i)}}function gr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];g.push(new X(i,r)),g.length===1&&!S&&J(O)}function X(i,r){this.fun=i,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var Tr="browser",Rr="browser",_r=!0,Ir={},vr=[],Ur="",Br={},dr={},Sr={};function v(){}var Pr=v,Yr=v,Mr=v,Dr=v,Cr=v,kr=v,Nr=v;function Lr(i){throw new Error("process.binding is not supported")}function Fr(){return"/"}function Wr(i){throw new Error("process.chdir is not supported")}function qr(){return 0}var d=globalThis.performance||{},Hr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function Qr(i){var r=Hr.call(d)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Vr=new Date;function zr(){var i=new Date,r=i-Vr;return r/1e3}var F={nextTick:gr,title:Tr,browser:_r,env:Ir,argv:vr,version:Ur,versions:Br,on:Pr,addListener:Yr,once:Mr,off:Dr,removeListener:Cr,removeAllListeners:kr,emit:Nr,binding:Lr,cwd:Fr,chdir:Wr,umask:qr,hrtime:Qr,platform:Rr,release:dr,config:Sr,uptime:zr},V={};Object.keys(V).forEach(i=>{let r=i.split("."),n=F;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=V[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Gr=typeof Uint8Array!="undefined"?Uint8Array:Array,q=!1;function b(){q=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Jr(i){q||b();var r,n,e,t,f,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Gr(a*3/4-f),e=f>0?a-4:a;var h=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[h++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Or(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Xr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Or(e));return t.join("")}function Z(i){q||b();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,a=0,h=n-e;a<h;a+=u)f.push(Xr(i,a,a+u>h?h:a+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Y(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(Y()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return H(this,i)}return j(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function j(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?$r(i,r,n,e):typeof r=="string"?Kr(i,r,n):br(i,r)}o.from=function(i,r,n){return j(null,i,r,n)};o.kMaxLength=Y();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&o[Symbol.species]);function rr(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Zr(i,r,n,e){return rr(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return Zr(null,i,r,n)};function H(i,r){if(rr(r),i=T(i,r<0?0:Q(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return H(null,i)};o.allocUnsafeSlow=function(i){return H(null,i)};function Kr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=nr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function W(i,r){var n=r.length<0?0:Q(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function $r(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=W(i,r),i}function br(i,r){if(y(r)){var n=Q(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||An(r.length)?T(i,0):W(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return W(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Q(i){if(i>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return i|0}o.isBuffer=yn;function y(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!y(r)||!y(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).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}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!y(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function nr(i,r){if(y(i))return i.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return ar(i).length;default:if(e)return M(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=nr;function jr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return cn(this,r,n);case"utf8":case"utf-8":return tr(this,r,n);case"ascii":return an(this,r,n);case"latin1":case"binary":return hn(this,r,n);case"base64":return un(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)U(this,n,n+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?tr(this,0,r):jr.apply(this,arguments)};o.prototype.equals=function(r){if(!y(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!y(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,a=e-n,h=Math.min(u,a),p=this.slice(t,f),l=r.slice(n,e),c=0;c<h;++c)if(p[c]!==l[c]){u=p[c],a=l[c];break}return u<a?-1:a<u?1:0};function ir(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),y(r))return r.length===0?-1:K(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):K(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function K(i,r,n,e,t){var f=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,a/=2,n/=2}function h(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var p;if(t){var l=-1;for(p=n;p<u;p++)if(h(i,p)===h(r,l===-1?0:p-l)){if(l===-1&&(l=p),p-l+1===a)return l*f}else l!==-1&&(p-=p-l),l=-1}else for(n+a>u&&(n=u-a),p=n;p>=0;p--){for(var c=!0,m=0;m<a;m++)if(h(i,p+m)!==h(r,m)){c=!1;break}if(c)return p}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return ir(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return ir(this,r,n,e,!1)};function rn(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function nn(i,r,n,e){return k(M(r,i.length-n),i,n,e)}function er(i,r,n,e){return k(En(r),i,n,e)}function en(i,r,n,e){return er(i,r,n,e)}function tn(i,r,n,e){return k(ar(r),i,n,e)}function fn(i,r,n,e){return k(mn(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return rn(this,r,n,e);case"utf8":case"utf-8":return nn(this,r,n,e);case"ascii":return er(this,r,n,e);case"latin1":case"binary":return en(this,r,n,e);case"base64":return tn(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function un(i,r,n){return r===0&&n===i.length?Z(i):Z(i.slice(r,n))}function tr(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,a=f>239?4:f>223?3:f>191?2:1;if(t+a<=n){var h,p,l,c;switch(a){case 1:f<128&&(u=f);break;case 2:h=i[t+1],(h&192)===128&&(c=(f&31)<<6|h&63,c>127&&(u=c));break;case 3:h=i[t+1],p=i[t+2],(h&192)===128&&(p&192)===128&&(c=(f&15)<<12|(h&63)<<6|p&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=i[t+1],p=i[t+2],l=i[t+3],(h&192)===128&&(p&192)===128&&(l&192)===128&&(c=(f&15)<<18|(h&63)<<12|(p&63)<<6|l&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return on(e)}var $=4096;function on(i){var r=i.length;if(r<=$)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=$));return n}function an(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function hn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function cn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=xn(i[f]);return t}function pn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!y(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function D(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};function C(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):C(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,a=1,h=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&h===0&&this[n+u-1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,a=1,h=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[n+u+1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):C(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};function fr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ur(i,r,n,e,t){return t||fr(i,r,n,4,34028234663852886e22,-34028234663852886e22),cr(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return ur(this,r,n,!1,e)};function or(i,r,n,e,t){return t||fr(i,r,n,8,17976931348623157e292,-17976931348623157e292),cr(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return or(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return or(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=y(r)?r:M(new o(r,t).toString()),h=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%h]}return this};var ln=/[^+\/0-9A-Za-z-_]/g;function sn(i){if(i=wn(i).replace(ln,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function wn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function xn(i){return i<16?"0"+i.toString(16):i.toString(16)}function M(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function En(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function mn(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function ar(i){return Jr(sn(i))}function k(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function An(i){return i!==i}function yn(i){return i!=null&&(!!i._isBuffer||hr(i)||gn(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function gn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function N(i,r,n,e,t){var f,u,a=t*8-e-1,h=(1<<a)-1,p=h>>1,l=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-l)-1,x>>=-l,l+=a;l>0;f=f*256+i[r+c],c+=m,l-=8);for(u=f&(1<<-l)-1,f>>=-l,l+=e;l>0;u=u*256+i[r+c],c+=m,l-=8);if(f===0)f=1-p;else{if(f===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-p}return(x?-1:1)*u*Math.pow(2,f-e)}function cr(i,r,n,e,t,f){var u,a,h,p=f*8-t-1,l=(1<<p)-1,c=l>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=a&255,x+=B,a/=256,t-=8);for(u=u<<t|a,p+=t;p>0;i[n+x]=u&255,x+=B,u/=256,p-=8);i[n+x-B]|=pr*128}var Tn={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};0&&(module.exports={Scope});
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|
package/cjs/TypeInstance.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var y=(n,e,m,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!t.call(n,a)&&a!==m&&p(n,a,{get:()=>e[a],enumerable:!(i=r(e,a))||i.enumerable});return n};var f=n=>y(p({},"__esModule",{value:!0}),n);var o={};module.exports=f(o);
|
|
1
|
+
"use strict";var z=Object.defineProperty;var pr=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var wr=Object.prototype.hasOwnProperty;var xr=(i,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of sr(r))!wr.call(i,t)&&t!==n&&z(i,t,{get:()=>r[t],enumerable:!(e=pr(r,t))||e.enumerable});return i};var Er=i=>xr(z({},"__esModule",{value:!0}),i);var gn={};module.exports=Er(gn);function J(){throw new Error("setTimeout has not been defined")}function O(){throw new Error("clearTimeout has not been defined")}var R=J,_=O;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function Q(i){if(R===setTimeout)return setTimeout(i,0);if((R===J||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch(r){try{return R.call(null,i,0)}catch(n){return R.call(this,i,0)}}}function mr(i){if(_===clearTimeout)return clearTimeout(i);if((_===O||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch(r){try{return _.call(null,i)}catch(n){return _.call(this,i)}}}var g=[],S=!1,I,Y=-1;function Ar(){!S||!I||(S=!1,I.length?g=I.concat(g):Y=-1,g.length&&X())}function X(){if(!S){var i=Q(Ar);S=!0;for(var r=g.length;r;){for(I=g,g=[];++Y<r;)I&&I[Y].run();Y=-1,r=g.length}I=null,S=!1,mr(i)}}function yr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];g.push(new q(i,r)),g.length===1&&!S&&Q(X)}function q(i,r){this.fun=i,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var gr="browser",Tr="browser",Rr=!0,_r={},Ir=[],vr="",Ur={},Br={},dr={};function v(){}var Sr=v,Yr=v,Pr=v,Dr=v,Mr=v,Cr=v,kr=v;function Nr(i){throw new Error("process.binding is not supported")}function Lr(){return"/"}function Fr(i){throw new Error("process.chdir is not supported")}function Wr(){return 0}var d=globalThis.performance||{},Vr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function Hr(i){var r=Vr.call(d)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var zr=new Date;function Gr(){var i=new Date,r=i-zr;return r/1e3}var L={nextTick:yr,title:gr,browser:Rr,env:_r,argv:Ir,version:vr,versions:Ur,on:Sr,addListener:Yr,once:Pr,off:Dr,removeListener:Mr,removeAllListeners:Cr,emit:kr,binding:Nr,cwd:Lr,chdir:Fr,umask:Wr,hrtime:Hr,platform:Tr,release:Br,config:dr,uptime:Gr},G={};Object.keys(G).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=G[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Jr=typeof Uint8Array!="undefined"?Uint8Array:Array,W=!1;function b(){W=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Or(i){W||b();var r,n,e,t,f,u,a=i.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[a-2]==="="?2:i[a-1]==="="?1:0,u=new Jr(a*3/4-f),e=f>0?a-4:a;var h=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[h++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=t&255),u}function Qr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Xr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Qr(e));return t.join("")}function Z(i){W||b();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,a=0,h=n-e;a<h;a+=u)f.push(Xr(i,a,a+u>h?h:a+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return V(this,i)}return j(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function j(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&r instanceof ArrayBuffer?Kr(i,r,n,e):typeof r=="string"?Zr(i,r,n):$r(i,r)}o.from=function(i,r,n){return j(null,i,r,n)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&o[Symbol.species]);function rr(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function qr(i,r,n,e){return rr(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return qr(null,i,r,n)};function V(i,r){if(rr(r),i=T(i,r<0?0:H(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return V(null,i)};o.allocUnsafeSlow=function(i){return V(null,i)};function Zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=nr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:H(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Kr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=F(i,r),i}function $r(i,r){if(y(r)){var n=H(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer!="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||mn(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(i){if(i>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return i|0}o.isBuffer=An;function y(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!y(r)||!y(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.isEncoding=function(r){switch(String(r).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}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!y(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function nr(i,r){if(y(i))return i.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return D(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return ar(i).length;default:if(e)return D(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=nr;function br(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return hn(this,r,n);case"utf8":case"utf-8":return tr(this,r,n);case"ascii":return on(this,r,n);case"latin1":case"binary":return an(this,r,n);case"base64":return fn(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<r;n+=2)U(this,n,n+1);return this};o.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};o.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?tr(this,0,r):br.apply(this,arguments)};o.prototype.equals=function(r){if(!y(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!y(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,a=e-n,h=Math.min(u,a),l=this.slice(t,f),p=r.slice(n,e),c=0;c<h;++c)if(l[c]!==p[c]){u=l[c],a=p[c];break}return u<a?-1:a<u?1:0};function ir(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),y(r))return r.length===0?-1:K(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):K(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function K(i,r,n,e,t){var f=1,u=i.length,a=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,a/=2,n/=2}function h(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=n;l<u;l++)if(h(i,l)===h(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===a)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(n+a>u&&(n=u-a),l=n;l>=0;l--){for(var c=!0,m=0;m<a;m++)if(h(i,l+m)!==h(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return ir(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return ir(this,r,n,e,!1)};function jr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var a=parseInt(r.substr(u*2,2),16);if(isNaN(a))return u;i[n+u]=a}return u}function rn(i,r,n,e){return k(D(r,i.length-n),i,n,e)}function er(i,r,n,e){return k(xn(r),i,n,e)}function nn(i,r,n,e){return er(i,r,n,e)}function en(i,r,n,e){return k(ar(r),i,n,e)}function tn(i,r,n,e){return k(En(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return jr(this,r,n,e);case"utf8":case"utf-8":return rn(this,r,n,e);case"ascii":return er(this,r,n,e);case"latin1":case"binary":return nn(this,r,n,e);case"base64":return en(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fn(i,r,n){return r===0&&n===i.length?Z(i):Z(i.slice(r,n))}function tr(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,a=f>239?4:f>223?3:f>191?2:1;if(t+a<=n){var h,l,p,c;switch(a){case 1:f<128&&(u=f);break;case 2:h=i[t+1],(h&192)===128&&(c=(f&31)<<6|h&63,c>127&&(u=c));break;case 3:h=i[t+1],l=i[t+2],(h&192)===128&&(l&192)===128&&(c=(f&15)<<12|(h&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:h=i[t+1],l=i[t+2],p=i[t+3],(h&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(h&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,a=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=a}return un(e)}var $=4096;function un(i){var r=i.length;if(r<=$)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=$));return n}function on(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function an(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function hn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=wn(i[f]);return t}function cn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!y(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,a=0;for(this[n]=r&255;++a<e&&(u*=256);)this[n+a]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,a=1;for(this[n+u]=r&255;--u>=0&&(a*=256);)this[n+u]=r/a&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function M(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};function C(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):C(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,a=1,h=0;for(this[n]=r&255;++u<e&&(a*=256);)r<0&&h===0&&this[n+u-1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,a=1,h=0;for(this[n+u]=r&255;--u>=0&&(a*=256);)r<0&&h===0&&this[n+u+1]!==0&&(h=1),this[n+u]=(r/a>>0)-h&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):C(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};function fr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ur(i,r,n,e,t){return t||fr(i,r,n,4,34028234663852886e22,-34028234663852886e22),cr(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return ur(this,r,n,!1,e)};function or(i,r,n,e,t){return t||fr(i,r,n,8,17976931348623157e292,-17976931348623157e292),cr(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return or(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return or(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var a=y(r)?r:D(new o(r,t).toString()),h=a.length;for(u=0;u<e-n;++u)this[u+n]=a[u%h]}return this};var ln=/[^+\/0-9A-Za-z-_]/g;function pn(i){if(i=sn(i).replace(ln,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function sn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function wn(i){return i<16?"0"+i.toString(16):i.toString(16)}function D(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function xn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function En(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function ar(i){return Or(pn(i))}function k(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function mn(i){return i!==i}function An(i){return i!=null&&(!!i._isBuffer||hr(i)||yn(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function yn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function N(i,r,n,e,t){var f,u,a=t*8-e-1,h=(1<<a)-1,l=h>>1,p=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=a;p>0;f=f*256+i[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+i[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===h)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function cr(i,r,n,e,t,f){var u,a,h,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+c>=1?r+=m/h:r+=m*Math.pow(2,1-c),r*h>=2&&(u++,h/=2),u+c>=p?(a=0,u=p):u+c>=1?(a=(r*h-1)*Math.pow(2,t),u=u+c):(a=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=a&255,x+=B,a/=256,t-=8);for(u=u<<t|a,l+=t;l>0;i[n+x]=u&255,x+=B,u/=256,l-=8);i[n+x-B]|=lr*128}
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
5
|
+
(*!
|
|
6
|
+
* The buffer module from node.js, for the browser.
|
|
7
|
+
*
|
|
8
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
9
|
+
* @license MIT
|
|
10
|
+
*)
|
|
11
|
+
*/
|