@fern-api/php-dynamic-snippets 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +16 -15
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -0
  3. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  4. package/cjs/EndpointSnippetGenerator.cjs +27 -15
  5. package/cjs/EndpointSnippetGenerator.cjs.map +1 -0
  6. package/cjs/EndpointSnippetGenerator.d.cts +2 -0
  7. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +15 -14
  8. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -0
  9. package/cjs/context/DynamicTypeLiteralMapper.cjs +26 -14
  10. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -0
  11. package/cjs/context/FilePropertyMapper.cjs +26 -14
  12. package/cjs/context/FilePropertyMapper.cjs.map +1 -0
  13. package/cjs/index.cjs +28 -27
  14. package/cjs/index.cjs.map +1 -0
  15. package/cjs/index.d.cts +1 -1
  16. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  17. package/esm/DynamicSnippetsGenerator.js +2 -1
  18. package/esm/DynamicSnippetsGenerator.js.map +1 -0
  19. package/esm/EndpointSnippetGenerator.d.ts +2 -0
  20. package/esm/EndpointSnippetGenerator.js +2 -1
  21. package/esm/EndpointSnippetGenerator.js.map +1 -0
  22. package/esm/{chunk-KF5FVQY4.js → chunk-625QSFAH.js} +2 -1
  23. package/esm/chunk-625QSFAH.js.map +1 -0
  24. package/esm/chunk-7MI6WLZG.js +2 -0
  25. package/esm/chunk-7MI6WLZG.js.map +1 -0
  26. package/esm/chunk-BYNT7UJT.js +2 -0
  27. package/esm/chunk-BYNT7UJT.js.map +1 -0
  28. package/esm/chunk-J4Y3S6QS.js +40 -0
  29. package/esm/chunk-J4Y3S6QS.js.map +1 -0
  30. package/esm/{chunk-OBW623PQ.js → chunk-KU3OGJUU.js} +2 -1
  31. package/esm/chunk-KU3OGJUU.js.map +1 -0
  32. package/esm/chunk-YKXTGZL6.js +4 -0
  33. package/esm/chunk-YKXTGZL6.js.map +1 -0
  34. package/esm/chunk-ZYT6M32A.js +2 -0
  35. package/esm/chunk-ZYT6M32A.js.map +1 -0
  36. package/esm/context/DynamicSnippetsGeneratorContext.js +2 -1
  37. package/esm/context/DynamicSnippetsGeneratorContext.js.map +1 -0
  38. package/esm/context/DynamicTypeLiteralMapper.js +2 -1
  39. package/esm/context/DynamicTypeLiteralMapper.js.map +1 -0
  40. package/esm/context/FilePropertyMapper.js +2 -1
  41. package/esm/context/FilePropertyMapper.js.map +1 -0
  42. package/esm/index.d.ts +1 -1
  43. package/esm/index.js +12 -11
  44. package/esm/index.js.map +1 -0
  45. package/package.json +1 -1
  46. package/esm/chunk-4GDAMWPH.js +0 -1
  47. package/esm/chunk-LVYU2VDV.js +0 -28
  48. package/esm/chunk-MKUTGATJ.js +0 -1
  49. package/esm/chunk-RLJ7N42G.js +0 -3
  50. package/esm/chunk-TSABAZOR.js +0 -14
@@ -1,28 +0,0 @@
1
- var ht=Object.create;var ae=Object.defineProperty,lt=Object.defineProperties,pt=Object.getOwnPropertyDescriptor,mt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols,wt=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var Ne=(r,t,e)=>t in r?ae(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,pe=(r,t)=>{for(var e in t||(t={}))ve.call(t,e)&&Ne(r,e,t[e]);if(le)for(var e of le(t))Se.call(t,e)&&Ne(r,e,t[e]);return r},me=(r,t)=>lt(r,mt(t));var Hr=r=>typeof r=="symbol"?r:r+"",Qr=(r,t)=>{var e={};for(var i in r)ve.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&le)for(var i of le(r))t.indexOf(i)<0&&Se.call(r,i)&&(e[i]=r[i]);return e};var Le=(r,t)=>()=>(r&&(t=r(r=0)),t);var jr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),xt=(r,t)=>{for(var e in t)ae(r,e,{get:t[e],enumerable:!0})},be=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of dt(t))!ve.call(r,n)&&n!==e&&ae(r,n,{get:()=>t[n],enumerable:!(i=pt(t,n))||i.enumerable});return r};var Xr=(r,t,e)=>(e=r!=null?ht(wt(r)):{},be(t||!r||!r.__esModule?ae(e,"default",{value:r,enumerable:!0}):e,r)),Zr=r=>be(ae({},"__esModule",{value:!0}),r);var f=(r,t,e)=>Ne(r,typeof t!="symbol"?t+"":t,e);function Ue(){throw new Error("setTimeout has not been defined")}function Pe(){throw new Error("clearTimeout has not been defined")}function Me(r){if(O===setTimeout)return setTimeout(r,0);if((O===Ue||!O)&&setTimeout)return O=setTimeout,setTimeout(r,0);try{return O(r,0)}catch(t){try{return O.call(null,r,0)}catch(e){return O.call(this,r,0)}}}function yt(r){if(Y===clearTimeout)return clearTimeout(r);if((Y===Pe||!Y)&&clearTimeout)return Y=clearTimeout,clearTimeout(r);try{return Y(r)}catch(t){try{return Y.call(null,r)}catch(e){return Y.call(this,r)}}}function gt(){!ne||!q||(ne=!1,q.length?b=q.concat(b):de=-1,b.length&&De())}function De(){if(!ne){var r=Me(gt);ne=!0;for(var t=b.length;t;){for(q=b,b=[];++de<t;)q&&q[de].run();de=-1,t=b.length}q=null,ne=!1,yt(r)}}function Tt(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];b.push(new $e(r,t)),b.length===1&&!ne&&Me(De)}function $e(r,t){this.fun=r,this.array=t}function G(){}function Dt(r){throw new Error("process.binding is not supported")}function $t(){return"/"}function Ot(r){throw new Error("process.chdir is not supported")}function Yt(){return 0}function Wt(r){var t=Ft.call(ie)*.001,e=Math.floor(t),i=Math.floor(t%1*1e9);return r&&(e=e-r[0],i=i-r[1],i<0&&(e--,i+=1e9)),[e,i]}function zt(){var r=new Date,t=r-Vt;return t/1e3}var O,Y,b,ne,q,de,At,Et,Nt,vt,Lt,It,_t,Rt,kt,Ct,St,bt,Bt,Ut,Pt,Mt,ie,Ft,Vt,d,Be,u=Le(()=>{"use strict";O=Ue,Y=Pe;typeof globalThis.setTimeout=="function"&&(O=setTimeout);typeof globalThis.clearTimeout=="function"&&(Y=clearTimeout);b=[],ne=!1,de=-1;$e.prototype.run=function(){this.fun.apply(null,this.array)};At="browser",Et="browser",Nt=!0,vt={},Lt=[],It="",_t={},Rt={},kt={};Ct=G,St=G,bt=G,Bt=G,Ut=G,Pt=G,Mt=G;ie=globalThis.performance||{},Ft=ie.now||ie.mozNow||ie.msNow||ie.oNow||ie.webkitNow||function(){return new Date().getTime()};Vt=new Date;d={nextTick:Tt,title:At,browser:Nt,env:vt,argv:Lt,version:It,versions:_t,on:Ct,addListener:St,once:bt,off:Bt,removeListener:Ut,removeAllListeners:Pt,emit:Mt,binding:Dt,cwd:$t,chdir:Ot,umask:Yt,hrtime:Wt,platform:Et,release:Rt,config:kt,uptime:zt},Be={};Object.keys(Be).forEach(r=>{let t=r.split("."),e=d;for(let i=0;i<t.length;i++){let n=t[i];i===t.length-1?e[n]=Be[r]:e=e[n]||(e[n]={})}})});function We(){_e=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)_[t]=r[t],v[r.charCodeAt(t)]=t;v[45]=62,v[95]=63}function Gt(r){_e||We();var t,e,i,n,s,o,c=r.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=r[c-2]==="="?2:r[c-1]==="="?1:0,o=new qt(c*3/4-s),i=s>0?c-4:c;var l=0;for(t=0,e=0;t<i;t+=4,e+=3)n=v[r.charCodeAt(t)]<<18|v[r.charCodeAt(t+1)]<<12|v[r.charCodeAt(t+2)]<<6|v[r.charCodeAt(t+3)],o[l++]=n>>16&255,o[l++]=n>>8&255,o[l++]=n&255;return s===2?(n=v[r.charCodeAt(t)]<<2|v[r.charCodeAt(t+1)]>>4,o[l++]=n&255):s===1&&(n=v[r.charCodeAt(t)]<<10|v[r.charCodeAt(t+1)]<<4|v[r.charCodeAt(t+2)]>>2,o[l++]=n>>8&255,o[l++]=n&255),o}function Jt(r){return _[r>>18&63]+_[r>>12&63]+_[r>>6&63]+_[r&63]}function Ht(r,t,e){for(var i,n=[],s=t;s<e;s+=3)i=(r[s]<<16)+(r[s+1]<<8)+r[s+2],n.push(Jt(i));return n.join("")}function Oe(r){_e||We();for(var t,e=r.length,i=e%3,n="",s=[],o=16383,c=0,l=e-i;c<l;c+=o)s.push(Ht(r,c,c+o>l?l:c+o));return i===1?(t=r[e-1],n+=_[t>>2],n+=_[t<<4&63],n+="=="):i===2&&(t=(r[e-2]<<8)+r[e-1],n+=_[t>>10],n+=_[t>>4&63],n+=_[t<<2&63],n+="="),s.push(n),s.join("")}function we(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(r,t){if(we()<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 Re(this,r)}return Ve(this,r,t,e)}function Ve(r,t,e,i){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Xt(r,t,e,i):typeof t=="string"?jt(r,t,e):Zt(r,t)}function ze(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Qt(r,t,e,i){return ze(t),t<=0?B(r,t):e!==void 0?typeof i=="string"?B(r,t).fill(e,i):B(r,t).fill(e):B(r,t)}function Re(r,t){if(ze(t),r=B(r,t<0?0:ke(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function jt(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=qe(t,e)|0;r=B(r,i);var n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}function Ie(r,t){var e=t.length<0?0:ke(t.length)|0;r=B(r,e);for(var i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Xt(r,t,e,i){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?t=new Uint8Array(t):i===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,i),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=Ie(r,t),r}function Zt(r,t){if(R(t)){var e=ke(t.length)|0;return r=B(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"||xr(t.length)?B(r,0):Ie(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ie(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ke(r){if(r>=we())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+we().toString(16)+" bytes");return r|0}function R(r){return!!(r!=null&&r._isBuffer)}function qe(r,t){if(R(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 i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return xe(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ze(r).length;default:if(i)return xe(r).length;t=(""+t).toLowerCase(),i=!0}}function Kt(r,t,e){var i=!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 cr(this,t,e);case"utf8":case"utf-8":return He(this,t,e);case"ascii":return ar(this,t,e);case"latin1":case"binary":return fr(this,t,e);case"base64":return sr(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,t,e);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}function J(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function Ge(r,t,e,i,n){if(r.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(n)return-1;e=r.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,i)),R(t))return t.length===0?-1:Ye(r,t,e,i,n);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ye(r,[t],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Ye(r,t,e,i,n){var s=1,o=r.length,c=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||t.length<2)return-1;s=2,o/=2,c/=2,e/=2}function l(E,re){return s===1?E[re]:E.readUInt16BE(re*s)}var m;if(n){var w=-1;for(m=e;m<o;m++)if(l(r,m)===l(t,w===-1?0:m-w)){if(w===-1&&(w=m),m-w+1===c)return w*s}else w!==-1&&(m-=m-w),w=-1}else for(e+c>o&&(e=o-c),m=e;m>=0;m--){for(var x=!0,L=0;L<c;L++)if(l(r,m+L)!==l(t,L)){x=!1;break}if(x)return m}return-1}function er(r,t,e,i){e=Number(e)||0;var n=r.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o<i;++o){var c=parseInt(t.substr(o*2,2),16);if(isNaN(c))return o;r[e+o]=c}return o}function tr(r,t,e,i){return Te(xe(t,r.length-e),r,e,i)}function Je(r,t,e,i){return Te(dr(t),r,e,i)}function rr(r,t,e,i){return Je(r,t,e,i)}function ir(r,t,e,i){return Te(Ze(t),r,e,i)}function nr(r,t,e,i){return Te(wr(t,r.length-e),r,e,i)}function sr(r,t,e){return t===0&&e===r.length?Oe(r):Oe(r.slice(t,e))}function He(r,t,e){e=Math.min(r.length,e);for(var i=[],n=t;n<e;){var s=r[n],o=null,c=s>239?4:s>223?3:s>191?2:1;if(n+c<=e){var l,m,w,x;switch(c){case 1:s<128&&(o=s);break;case 2:l=r[n+1],(l&192)===128&&(x=(s&31)<<6|l&63,x>127&&(o=x));break;case 3:l=r[n+1],m=r[n+2],(l&192)===128&&(m&192)===128&&(x=(s&15)<<12|(l&63)<<6|m&63,x>2047&&(x<55296||x>57343)&&(o=x));break;case 4:l=r[n+1],m=r[n+2],w=r[n+3],(l&192)===128&&(m&192)===128&&(w&192)===128&&(x=(s&15)<<18|(l&63)<<12|(m&63)<<6|w&63,x>65535&&x<1114112&&(o=x))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=c}return or(i)}function or(r){var t=r.length;if(t<=Fe)return String.fromCharCode.apply(String,r);for(var e="",i=0;i<t;)e+=String.fromCharCode.apply(String,r.slice(i,i+=Fe));return e}function ar(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]&127);return i}function fr(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]);return i}function cr(r,t,e){var i=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>i)&&(e=i);for(var n="",s=t;s<e;++s)n+=mr(r[s]);return n}function ur(r,t,e){for(var i=r.slice(t,e),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}function y(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 A(r,t,e,i,n,s){if(!R(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(e+i>r.length)throw new RangeError("Index out of range")}function ye(r,t,e,i){t<0&&(t=65535+t+1);for(var n=0,s=Math.min(r.length-e,2);n<s;++n)r[e+n]=(t&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}function ge(r,t,e,i){t<0&&(t=4294967295+t+1);for(var n=0,s=Math.min(r.length-e,4);n<s;++n)r[e+n]=t>>>(i?n:3-n)*8&255}function Qe(r,t,e,i,n,s){if(e+i>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function je(r,t,e,i,n){return n||Qe(r,t,e,4,34028234663852886e22,-34028234663852886e22),et(r,t,e,i,23,4),e+4}function Xe(r,t,e,i,n){return n||Qe(r,t,e,8,17976931348623157e292,-17976931348623157e292),et(r,t,e,i,52,8),e+8}function lr(r){if(r=pr(r).replace(hr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function pr(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function mr(r){return r<16?"0"+r.toString(16):r.toString(16)}function xe(r,t){t=t||1/0;for(var e,i=r.length,n=null,s=[],o=0;o<i;++o){if(e=r.charCodeAt(o),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return s}function dr(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function wr(r,t){for(var e,i,n,s=[],o=0;o<r.length&&!((t-=2)<0);++o)e=r.charCodeAt(o),i=e>>8,n=e%256,s.push(n),s.push(i);return s}function Ze(r){return Gt(lr(r))}function Te(r,t,e,i){for(var n=0;n<i&&!(n+e>=t.length||n>=r.length);++n)t[n+e]=r[n];return n}function xr(r){return r!==r}function yr(r){return r!=null&&(!!r._isBuffer||Ke(r)||gr(r))}function Ke(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function gr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ke(r.slice(0,0))}function Ae(r,t,e,i,n){var s,o,c=n*8-i-1,l=(1<<c)-1,m=l>>1,w=-7,x=e?n-1:0,L=e?-1:1,E=r[t+x];for(x+=L,s=E&(1<<-w)-1,E>>=-w,w+=c;w>0;s=s*256+r[t+x],x+=L,w-=8);for(o=s&(1<<-w)-1,s>>=-w,w+=i;w>0;o=o*256+r[t+x],x+=L,w-=8);if(s===0)s=1-m;else{if(s===l)return o?NaN:(E?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-m}return(E?-1:1)*o*Math.pow(2,s-i)}function et(r,t,e,i,n,s){var o,c,l,m=s*8-n-1,w=(1<<m)-1,x=w>>1,L=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=i?0:s-1,re=i?1:-1,ut=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,o=w):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+x>=1?t+=L/l:t+=L*Math.pow(2,1-x),t*l>=2&&(o++,l/=2),o+x>=w?(c=0,o=w):o+x>=1?(c=(t*l-1)*Math.pow(2,n),o=o+x):(c=t*Math.pow(2,x-1)*Math.pow(2,n),o=0));n>=8;r[e+E]=c&255,E+=re,c/=256,n-=8);for(o=o<<n|c,m+=n;m>0;r[e+E]=o&255,E+=re,o/=256,m-=8);r[e+E-re]|=ut*128}var _,v,qt,_e,Fe,hr,tt=Le(()=>{"use strict";u();h();_=[],v=[],qt=typeof Uint8Array!="undefined"?Uint8Array:Array,_e=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return Ve(null,r,t,e)};a.kMaxLength=we();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return Qt(null,r,t,e)};a.allocUnsafe=function(r){return Re(null,r)};a.allocUnsafeSlow=function(r){return Re(null,r)};a.isBuffer=yr;a.compare=function(t,e){if(!R(t)||!R(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,s=0,o=Math.min(i,n);s<o;++s)if(t[s]!==e[s]){i=t[s],n=e[s];break}return i<n?-1:n<i?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 i;if(e===void 0)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=a.allocUnsafe(e),s=0;for(i=0;i<t.length;++i){var o=t[i];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};a.byteLength=qe;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)J(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)J(this,e,e+3),J(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)J(this,e,e+7),J(this,e+1,e+6),J(this,e+2,e+5),J(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?He(this,0,t):Kt.apply(this,arguments)};a.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,i,n,s){if(!R(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=t?t.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),e<0||i>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&e>=i)return 0;if(n>=s)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,s>>>=0,this===t)return 0;for(var o=s-n,c=i-e,l=Math.min(o,c),m=this.slice(n,s),w=t.slice(e,i),x=0;x<l;++x)if(m[x]!==w[x]){o=m[x],c=w[x];break}return o<c?-1:c<o?1:0};a.prototype.includes=function(t,e,i){return this.indexOf(t,e,i)!==-1};a.prototype.indexOf=function(t,e,i){return Ge(this,t,e,i,!0)};a.prototype.lastIndexOf=function(t,e,i){return Ge(this,t,e,i,!1)};a.prototype.write=function(t,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-e;if((i===void 0||i>s)&&(i=s),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return er(this,t,e,i);case"utf8":case"utf-8":return tr(this,t,e,i);case"ascii":return Je(this,t,e,i);case"latin1":case"binary":return rr(this,t,e,i);case"base64":return ir(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nr(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Fe=4096;a.prototype.slice=function(t,e){var i=this.length;t=~~t,e=e===void 0?i:~~e,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<t&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var s=e-t;n=new a(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+t]}return n};a.prototype.readUIntLE=function(t,e,i){t=t|0,e=e|0,i||y(t,e,this.length);for(var n=this[t],s=1,o=0;++o<e&&(s*=256);)n+=this[t+o]*s;return n};a.prototype.readUIntBE=function(t,e,i){t=t|0,e=e|0,i||y(t,e,this.length);for(var n=this[t+--e],s=1;e>0&&(s*=256);)n+=this[t+--e]*s;return n};a.prototype.readUInt8=function(t,e){return e||y(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||y(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||y(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||y(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||y(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,i){t=t|0,e=e|0,i||y(t,e,this.length);for(var n=this[t],s=1,o=0;++o<e&&(s*=256);)n+=this[t+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(t,e,i){t=t|0,e=e|0,i||y(t,e,this.length);for(var n=e,s=1,o=this[t+--n];n>0&&(s*=256);)o+=this[t+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*e)),o};a.prototype.readInt8=function(t,e){return e||y(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||y(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(t,e){e||y(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(t,e){return e||y(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||y(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||y(t,4,this.length),Ae(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),Ae(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),Ae(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),Ae(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var s=Math.pow(2,8*i)-1;A(this,t,e,i,s,0)}var o=1,c=0;for(this[e]=t&255;++c<i&&(o*=256);)this[e+c]=t/o&255;return e+i};a.prototype.writeUIntBE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var s=Math.pow(2,8*i)-1;A(this,t,e,i,s,0)}var o=i-1,c=1;for(this[e+o]=t&255;--o>=0&&(c*=256);)this[e+o]=t/c&255;return e+i};a.prototype.writeUInt8=function(t,e,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ye(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,i){return t=+t,e=e|0,i||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ye(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,i){return t=+t,e=e|0,i||A(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):ge(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,i){return t=+t,e=e|0,i||A(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):ge(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e=e|0,!n){var s=Math.pow(2,8*i-1);A(this,t,e,i,s-1,-s)}var o=0,c=1,l=0;for(this[e]=t&255;++o<i&&(c*=256);)t<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(t/c>>0)-l&255;return e+i};a.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e=e|0,!n){var s=Math.pow(2,8*i-1);A(this,t,e,i,s-1,-s)}var o=i-1,c=1,l=0;for(this[e+o]=t&255;--o>=0&&(c*=256);)t<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(t/c>>0)-l&255;return e+i};a.prototype.writeInt8=function(t,e,i){return t=+t,e=e|0,i||A(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,i){return t=+t,e=e|0,i||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ye(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,i){return t=+t,e=e|0,i||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ye(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,i){return t=+t,e=e|0,i||A(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):ge(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,i){return t=+t,e=e|0,i||A(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):ge(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,i){return je(this,t,e,!0,i)};a.prototype.writeFloatBE=function(t,e,i){return je(this,t,e,!1,i)};a.prototype.writeDoubleLE=function(t,e,i){return Xe(this,t,e,!0,i)};a.prototype.writeDoubleBE=function(t,e,i){return Xe(this,t,e,!1,i)};a.prototype.copy=function(t,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var s=n-i,o;if(this===t&&i<e&&e<n)for(o=s-1;o>=0;--o)t[o+e]=this[o+i];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)t[o+e]=this[o+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+s),e);return s};a.prototype.fill=function(t,e,i,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<i;++o)this[o]=t;else{var c=R(t)?t:xe(new a(t,n).toString()),l=c.length;for(o=0;o<i-e;++o)this[o+e]=c[o%l]}return this};hr=/[^+\/0-9A-Za-z-_]/g});var h=Le(()=>{"use strict";tt()});u();h();function se(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();h();u();h();function Tr(r){return Object.keys(r)}var he={};xt(he,{Access:()=>F,Array:()=>H,AstNode:()=>p,Attribute:()=>Q,Class:()=>P,ClassInstantiation:()=>S,ClassReference:()=>g,CodeBlock:()=>T,DataClass:()=>X,Enum:()=>Z,Field:()=>K,Map:()=>ee,Method:()=>D,MethodInvocation:()=>$,Parameter:()=>M,Trait:()=>j,Type:()=>I,TypeLiteral:()=>z,Writer:()=>C,array:()=>kr,assignVariable:()=>Vr,attribute:()=>Cr,classReference:()=>Br,class_:()=>Sr,codeblock:()=>te,dataClass:()=>Ur,enum_:()=>Pr,field:()=>Mr,instantiateClass:()=>ct,invokeMethod:()=>Dr,map:()=>Or,mergeArrays:()=>Gr,method:()=>Yr,parameter:()=>Fr,string:()=>qr,ternary:()=>Wr,this_:()=>Jr,throwException:()=>$r,trait:()=>br,variable:()=>zr});u();h();u();h();u();h();var U=class{};u();h();u();h();var k=class extends U{constructor(e){super();f(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var Ar=4,fe=class{constructor(){f(this,"buffer","");f(this,"indentLevel",0);f(this,"hasWrittenAnything",!1);f(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
2
- `),i=e?t.substring(0,t.length-1):t,n=this.getIndentString(),s=i.replaceAll(`
3
- `,`
4
- ${n}`);this.isAtStartOfLine()&&(s=n+s),e&&(s+=`
5
- `),this.writeInternal(s)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new k(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new k(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new k(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new k(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",i,n="}"){let s=t.filter(o=>o!==void 0).join(" ");s?this.write(`${s} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),i(),this.dedent()}finally{this.write(n!=null?n:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
- `)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:i}){if(t.length>0){let n=t[0];n!=null&&i(n);for(let s=1;s<t.length;s++){this.write(e);let o=t[s];o!=null&&i(o)}}}toString(){return this.buffer}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*Ar)}};u();h();function Ce(r){return(r==null?void 0:r.name)!=null}u();h();var ce=class extends U{constructor({condition:e,true_:i,false_:n}){super();f(this,"condition");f(this,"true_");f(this,"false_");this.condition=e,this.true_=i,this.false_=n}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};u();h();u();h();var F={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};u();h();u();h();u();h();u();h();var ue="",rt="self",it="static";function nt(r){return{namespace:r.substring(0,r.lastIndexOf("\\")),name:r.substring(r.lastIndexOf("\\")+1)}}var C=class extends fe{constructor({namespace:e,rootNamespace:i,customConfig:n}){super();f(this,"namespace");f(this,"rootNamespace");f(this,"customConfig");f(this,"references",{});this.namespace=e,this.rootNamespace=i,this.customConfig=n}addReference(e){var o,c;if(e.namespace==null)return;if(Object.keys(this.references).filter(l=>{let m=nt(l);return m.namespace!==e.namespace&&m.name===e.name}).length>0){e.requireFullyQualified();return}let n=e.namespace===ue?e.name:`${e.namespace}\\${e.name}`;((c=(o=this.references)[n])!=null?c:o[n]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,i=this.stringifyImports();return i.length>0?`${e}
9
-
10
- ${i}
11
-
12
- ${this.buffer}`:e+`
13
-
14
- `+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(i=>nt(i).namespace!==this.namespace).map(i=>`use ${i};`).join(`
15
- `)}};var p=class extends U{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:i,customConfig:n}=t,s=new C({namespace:e,rootNamespace:i,customConfig:n});return this.write(s),s.toString()}async toStringAsync({namespace:t,rootNamespace:e,customConfig:i}){let n=new C({namespace:t,rootNamespace:e,customConfig:i});return this.write(n),n.toString()}};var H=class extends p{constructor({entries:e}){super();f(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((i,n)=>{n>0&&e.write(", "),i.write(e)}),e.write("]")}};u();h();var Q=class extends p{constructor(e){var i;super();f(this,"reference");f(this,"arguments");this.reference=e.reference,this.arguments=(i=e.arguments)!=null?i:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((i,n)=>{n>0&&e.write(","),typeof i=="string"?e.write(i):i.write(e)}),e.write(")"))}};u();h();u();h();var g=class extends p{constructor({name:e,namespace:i,generics:n}){super();f(this,"name");f(this,"namespace");f(this,"generics");f(this,"fullyQualified");this.name=e,this.namespace=i,this.generics=n,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let i=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${i}`)}};u();h();u();h();function W(r){return r.startsWith("$")?r:`$${r}`}var N=class extends p{constructor({docs:e}={}){super();f(this,"docs");f(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(me(pe({},e),{name:e.name!=null?W(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
16
- `).forEach(i=>{e.writeLine(` * ${i}`)}),this.tags.length>0&&e.writeLine(" *"));for(let i of this.tags)this.writeTag({writer:e,tag:i});e.writeLine(" */")}writeTag({writer:e,tag:i}){let n=i.docs!=null?i.docs.split(`
17
- `):void 0;n!=null&&n.length>1&&(n.forEach(s=>{e.writeLine(` * ${s}`)}),e.writeLine(" *")),e.write(` * @${i.tagType} `),i.type.write(e,{comment:!0}),i.name!=null&&e.write(` ${i.name}`),n!=null&&n.length===1&&e.write(` ${n[0]}`),e.newLine()}};u();h();function V(r){return Er(r,[F.Public,F.PublicReadonly,F.Protected,F.Private])}function Er(r,t){return t.reduce((e,i)=>[...e,...r.filter(n=>n.access===i)],[])}var P=class extends p{constructor({name:e,namespace:i,abstract:n,docs:s,parentClassReference:o,traits:c}){super();f(this,"name");f(this,"namespace");f(this,"abstract");f(this,"docs");f(this,"parentClassReference");f(this,"traits");f(this,"fields",[]);f(this,"methods",[]);f(this,"constructor_");this.name=e,this.namespace=i,this.abstract=n!=null?n:!1,this.docs=s,this.parentClassReference=o,this.traits=c!=null?c:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addMethods(e){this.methods.push(...e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new g({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((i,n)=>{n>0&&e.write(","),e.writeNode(i)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:V(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:V(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:i}){var n;this.writeConstructorComment({writer:e,constructor:i}),i.access!=null&&e.write(`${i.access} `),e.write("function __construct("),e.indent(),i.parameters.forEach((s,o)=>{o===0&&e.newLine(),s.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(n=i.body)==null||n.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:i}){if(i.parameters.length===0)return;let n=new N;for(let s of i.parameters)n.addTag(s.getCommentTag());n.write(e)}writeFields({writer:e,fields:i}){i.filter(n=>!n.inherited).forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:i}){i.forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}};u();h();var j=class extends p{constructor({name:e,namespace:i,docs:n,traits:s}){super();f(this,"name");f(this,"namespace");f(this,"docs");f(this,"traits");f(this,"fields",[]);f(this,"methods",[]);this.name=e,this.namespace=i,this.docs=n,this.traits=s!=null?s:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((i,n)=>{n>0&&e.write(","),e.writeNode(i)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:V(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:V(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let i=new N({docs:this.docs});for(let n of this.fields)i.addTag({tagType:"property",type:n.type,name:n.name});i.write(e)}writeFields({writer:e,fields:i}){i.forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:i}){i.forEach((n,s)=>{s>0&&e.newLine(),n.write(e),e.writeNewLineIfLastLineNot()})}};u();h();u();h();function oe({writer:r,arguments_:t,multiline:e}){if(t.length===0){r.write("()");return}if(e){Nr({writer:r,arguments_:t});return}vr({writer:r,arguments_:t})}function Nr({writer:r,arguments_:t}){r.writeLine("("),r.indent();for(let e of t)st({writer:r,argument:e,writeCompact:!1}),r.writeLine(",");r.dedent(),r.write(")")}function vr({writer:r,arguments_:t}){r.write("("),t.forEach((e,i)=>{i>0&&r.write(", "),st({writer:r,argument:e,writeCompact:!0})}),r.write(")")}function st({writer:r,argument:t,writeCompact:e}){Ce(t)?(t.docs&&(e?r.write(`/* ${t.docs} */ `):r.writeLine(`/* ${t.docs} */`)),r.write(`${t.name}: `),r.writeNodeOrString(t.assignment)):t.write(r)}var S=class extends p{constructor({classReference:e,arguments_:i,multiline:n}){super();f(this,"classReference");f(this,"arguments_");f(this,"multiline");this.classReference=e,this.arguments_=i,this.multiline=n!=null?n:!1}write(e){e.write("new "),e.writeNode(this.classReference),oe({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};u();h();var T=class extends p{constructor(e){super();f(this,"arg");this.arg=e}write(e){return new k(this.arg).write(e)}};u();h();u();h();u();h();var M=class extends p{constructor({name:e,type:i,docs:n,initializer:s,access:o,readonly_:c}){super();f(this,"name");f(this,"type");f(this,"docs");f(this,"initializer");f(this,"access");f(this,"readonly_");this.name=W(e),this.type=i,this.docs=n,this.initializer=s,this.access=o,this.readonly_=c!=null?c:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};u();h();var I=class r extends p{constructor(e){super();f(this,"internalType");this.internalType=e}write(e,{comment:i}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(ot),e.write("DateTime");break;case"dateTime":e.addReference(ot),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!i){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:i}),e.write(">");break;case"map":{if(!i){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:i}),e.write(", "),this.internalType.valueType.write(e,{comment:i}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!i){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");let n=this.internalType.entries.filter(c=>!c.valueType.isOptional()),s=this.internalType.entries.filter(c=>c.valueType.isOptional()),o=[...n,...s];for(let c of o)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:c,comment:i}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((n,s)=>{s>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:n,comment:i})}),e.write("}");break}case"union":{let n=this.getUniqueTypes({types:this.internalType.types,comment:i,writer:e}),s=n.filter(o=>o.underlyingType().internalType.type==="mixed").length>0;if(s&&!i){e.write("mixed");break}n.length>0&&i?(e.writeLine("("),n.forEach((o,c)=>{c>0?e.write(" * |"):e.write(" * "),s&&(o=o.underlyingType()),o.write(e,{comment:i}),e.writeLine(),c++}),e.write(" * )")):n.forEach((o,c)=>{c>0&&e.write("|"),s&&(o=o.underlyingType()),o.write(e,{comment:i}),c++});break}case"optional":{let n=this.internalType.value.internalType.type==="mixed",s=this.internalType.value.internalType.type==="union";!s&&!n&&e.write("?"),this.internalType.value.write(e,{comment:i}),s&&(e.write("|"),e.writeNode(r.null()));break}case"reference":if(i){e.writeNode(this.internalType.value);let n=this.internalType.value.generics;n&&n.length>0&&(e.write("<"),n.forEach((s,o)=>{o>0&&e.write(", "),s.write(e,{comment:i})}),e.write(">"))}else e.writeNode(this.internalType.value);break;case"enumString":i?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;default:se(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:r.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}getClassReference(){switch(this.internalType.type){case"date":case"dateTime":return new g({name:"DateTime",namespace:ue});case"enumString":case"reference":return this.internalType.value;case"int":case"string":case"bool":case"float":case"object":case"map":case"array":case"null":case"mixed":case"optional":case"typeDict":case"union":throw new Error("Cannot get class reference for "+this.internalType.type);default:se(this.internalType)}}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,i){return new this({type:"map",keyType:e,valueType:i})}static typeDict(e,{multiline:i}={}){return new this({type:"typeDict",entries:e,multiline:i})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:i,comment:n}){e.write(i.key),i.optional&&e.write("?"),e.write(": "),i.valueType.write(e,{comment:n})}getUniqueTypes({writer:e,types:i,comment:n}){let s=new Set;return i.filter(o=>{let c=o.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig,comment:n});return s.has(c)?!1:(s.add(c),!0)})}toString({namespace:e,rootNamespace:i,customConfig:n,comment:s}){let o=new C({namespace:e,rootNamespace:i,customConfig:n});return this.write(o,{comment:s!=null?s:!1}),o.toString()}},ot=new g({namespace:ue,name:"DateTime"});u();h();function at(r){return r.startsWith("$")?r.slice(1):r}var ft="values",X=class extends p{constructor({name:e,namespace:i,abstract:n,docs:s,parentClassReference:o,traits:c}){super();f(this,"name");f(this,"namespace");f(this,"class_");this.name=e,this.namespace=i,this.class_=new P({name:e,namespace:i,abstract:n,docs:s,parentClassReference:o,traits:c})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let i=V(this.class_.fields).map(n=>me(pe({},n),{name:at(n.name)}));i.length>0&&this.class_.addConstructor({access:"public",parameters:this.getConstructorParameters({orderedFields:i}),body:he.codeblock(n=>{for(let s of i)n.write(`$this->${s.name} = $${ft}['${s.name}']`),s.type.isOptional()&&n.write(" ?? null"),n.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new M({name:ft,type:I.typeDict(e.map(i=>({key:i.name,valueType:i.type,optional:i.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new T("[]"):void 0})]}};u();h();u();h();var D=class extends p{constructor({name:e,access:i,parameters:n,throws:s,return_:o,body:c,docs:l,classReference:m,static_:w}){super();f(this,"name");f(this,"access");f(this,"parameters");f(this,"throws");f(this,"return_");f(this,"body");f(this,"docs");f(this,"classReference");f(this,"static_");this.name=e,this.access=i,this.parameters=n,this.throws=s!=null?s:[],this.return_=o,this.body=c,this.docs=l,this.classReference=m,this.static_=w!=null?w:!1}write(e){var o;this.writeComment(e),e.write(`${this.access}${this.static_?" static":""} function ${this.name}(`);let i=this.parameters.filter(c=>!c.type.isOptional()),n=this.parameters.filter(c=>c.type.isOptional());[...i,...n].forEach((c,l)=>{l>0&&e.write(", "),c.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(o=this.body)==null||o.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let i=new N({docs:this.docs});for(let n of this.parameters)i.addTag({tagType:"param",type:n.type,name:n.name,docs:n.docs});this.return_!=null&&this.return_!==rt&&this.return_!==it&&i.addTag({tagType:"return",type:this.return_});for(let n of this.throws)i.addTag({tagType:"throws",type:I.reference(n)});e.writeNode(i)}};var Z=class extends p{constructor({name:e,namespace:i,backing:n,docs:s,serializable:o}){super();f(this,"name");f(this,"namespace");f(this,"backing");f(this,"docs");f(this,"members",[]);f(this,"serializable");this.name=e,this.namespace=i,this.backing=n,this.docs=s,this.serializable=o!=null?o:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new g({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let i of this.members)e.write(`case ${i.name}`),i.value!=null&&(typeof i.value=="string"?e.write(` = "${i.value}"`):e.write(` = ${i.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new D({name:"jsonSerialize",return_:I.string(),access:"public",parameters:[],body:new T("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new N({docs:this.docs}).write(e)}};u();h();var K=class extends p{constructor({name:e,type:i,access:n,readonly_:s,initializer:o,docs:c,inlineDocs:l,attributes:m,inherited:w}){super();f(this,"name");f(this,"type");f(this,"access");f(this,"readonly_");f(this,"initializer");f(this,"docs");f(this,"inlineDocs");f(this,"attributes");f(this,"inherited");this.name=W(e),this.type=i,this.access=n,this.readonly_=s!=null?s:!1,this.initializer=o,this.docs=c,this.inlineDocs=l,this.attributes=m!=null?m:[],this.inherited=w!=null?w:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let i=new N;i.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),i.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((i,n)=>{n>0&&e.write(", "),i.write(e)}),e.writeLine("]"))}};u();h();var ee=class extends p{constructor({entries:e,multiline:i}){super();f(this,"entries");f(this,"multiline");this.entries=e!=null?e:[],this.multiline=i!=null?i:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:i,value:n}of this.entries)i.write(e),e.write(" => "),n.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[i,{key:n,value:s}]of this.entries.entries())i>0&&e.write(", "),n.write(e),e.write(" => "),s.write(e);e.write("]")}};u();h();var $=class extends p{constructor({method:e,arguments_:i,static_:n,multiline:s,on:o}){super();f(this,"method");f(this,"arguments_");f(this,"multiline");f(this,"static_");f(this,"on");this.method=e,this.arguments_=i,this.static_=n!=null?n:!1,this.multiline=s!=null?s:!1,this.on=o}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),oe({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};u();h();u();h();var z=class r extends p{constructor(e){super();f(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(Ir({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Lr({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
18
- `)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}e.write(`'${this.internalType.value.replaceAll("'","\\'")}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:se(this.internalType)}}isClass(){return this.internalType.type==="class"}asClassOrThrow(){if(this.isClass())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a class")}writeStringWithHeredoc({writer:e,value:i}){e.writeLine("<<<EOT"),e.writeNoIndent(i),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:i}){e.writeNode(new S({classReference:i.reference,arguments_:[r.map({entries:i.fields.map(n=>({key:r.string(n.name),value:n.value}))})]}))}writeList({writer:e,list:i}){let n=Rr({values:i.values});if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of n)s.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:i}){let n=_r({entries:i.entries});if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of n)s.key.write(e),e.write(" => "),s.value.write(e),e.writeLine(",");e.dedent(),e.write("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:i}){return new this({type:"class",reference:e,fields:i})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:i}){switch(typeof i){case"boolean":e.write(i.toString());return;case"string":e.write(i.includes('"')?`\`${i}\``:`"${i}"`);return;case"number":e.write(i.toString());return;case"object":if(i==null){e.write("null");return}if(Array.isArray(i)){this.writeUnknownArray({writer:e,value:i});return}this.writeUnknownMap({writer:e,value:i});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof i}`)}}writeUnknownArray({writer:e,value:i}){if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let n of i)e.writeNode(r.unknown(n)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:i}){let n=Object.entries(i);if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[s,o]of n)e.write(`'${s}' => `),e.writeNode(r.unknown(o)),e.writeLine(",");e.dedent(),e.write("]")}};function Lr({writer:r,value:t}){return new S({classReference:new g({name:"DateTime",namespace:""}),arguments_:[new T(`'${t}'`)]})}function Ir({writer:r,value:t}){return new $({on:new g({name:"File",namespace:`${r.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new T(`"${t}"`)]})}function _r({entries:r}){return r.filter(t=>!z.isNop(t.key)&&!z.isNop(t.value))}function Rr({values:r}){return r.filter(t=>!z.isNop(t))}u();h();var Ee=class extends p{constructor(e){super();f(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),oe({writer:e,arguments_:this.arrays.map(i=>te(n=>{if(typeof i=="string"||i instanceof p){n.writeNodeOrString(i);return}n.writeNodeOrString(i.ref),i.fallback&&(n.write(" ?? "),n.writeNodeOrString(i.fallback))}))})}};function kr(r){return new H(r)}function Cr(r){return new Q(r)}function Sr(r){return new P(r)}function br(r){return new j(r)}function Br(r){return new g(r)}function te(r){return new T(r)}function Ur(r){return new X(r)}function Pr(r){return new Z(r)}function Mr(r){return new K(r)}function ct(r){return new S(r)}function Dr(r){return new $(r)}function $r(r){return te(t=>{t.write("throw "),t.writeNode(ct(r))})}function Or(r){return new ee(r)}function Yr(r){return new D(r)}function Fr(r){return new M(r)}function Wr(r){return new ce(r)}function Vr(r,t){return te(e=>{e.writeNodeOrString(r),e.write(" = "),e.writeNodeOrString(t)})}function zr(r){return te(W(r))}function qr(r){return te(`"${r}"`)}function Gr(...r){return new Ee(r)}function Jr(){return new T(r=>{r.write("$this")})}export{pe as a,me as b,Hr as c,Qr as d,Le as e,jr as f,xt as g,Xr as h,Zr as i,f as j,u as k,a as l,h as m,se as n,Tr as o,he as p};
19
- /*! Bundled license information:
20
-
21
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
22
- (*!
23
- * The buffer module from node.js, for the browser.
24
- *
25
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
26
- * @license MIT
27
- *)
28
- */
@@ -1 +0,0 @@
1
- import{a as P,b as T,c as S,d as b,j as a,k as p,m as l,n as f,o as E}from"./chunk-LVYU2VDV.js";p();l();p();l();var y=class{constructor(){a(this,"reporter");a(this,"snippet");a(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:e,snippet:r}){(this.reporter==null||this.reporter.size()>e.errors.size())&&(this.reporter=e.errors.clone(),this.snippet=r)}getResponseOrThrow({endpoint:e}){var r;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(r=this.err)!=null?r:new Error(`Failed to generate snippet for endpoint "${e.method} ${e.path}"`)}};var R=class{constructor(e){a(this,"context");this.context=e}async generate(e){let r=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let t=new y;for(let n of r){let i=this.context.clone(),u=this.createSnippetGenerator(i);try{let o=await u.generateSnippet({endpoint:n,request:e});if(i.errors.empty())return{snippet:o,errors:void 0};t.update({context:i,snippet:o})}catch(o){t.err==null&&(t.err=o)}}return t.getResponseOrThrow({endpoint:e.endpoint})}generateSync(e){let r=this.context.resolveEndpointLocationOrThrow(e.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${e.endpoint.method} ${e.endpoint.path}"`);let t=new y;for(let n of r){let i=this.context.clone(),u=this.createSnippetGenerator(i);try{let o=u.generateSnippetSync({endpoint:n,request:e});if(i.errors.empty())return{snippet:o,errors:void 0};t.update({context:i,snippet:o})}catch(o){t.err==null&&(t.err=o)}}return t.getResponseOrThrow({endpoint:e.endpoint})}};p();l();var s={Critical:"CRITICAL",Warning:"WARNING"},g=class h{constructor(){a(this,"errors");a(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(T(P({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(r=>r.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new h;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let r=[];for(let t of e){if(typeof t=="string"){r.push(t);continue}r[r.length-1]+=`[${t.index}]`}return r}};p();l();p();l();p();l();var v=class{constructor(){a(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let t=e.match(this.REFERENCE_REGEX);if(!(t==null||t[1]==null||t[2]==null))return{method:t[1],path:t[2]}}};var w=class{constructor({ir:e,config:r}){a(this,"config");a(this,"errors");a(this,"_ir");a(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.errors=new g,this.httpEndpointReferenceParser=new v}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[n,i]of Object.entries(r)){this.errors.scope(n);try{let u=e.find(m=>m.name.wireValue===n);if(u==null)throw this.newParameterNotRecognizedError(n);let o=this.isListTypeReference(u.typeReference)&&!Array.isArray(i)?[i]:i;t.push({name:u.name,typeReference:u.typeReference,value:o})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let n=[];for(let[i,u]of Object.entries(r)){this.errors.scope(i);try{let o=e.find(m=>m.name.wireValue===i);if(o==null){if(t)continue;this.errors.add({severity:s.Critical,message:this.newParameterNotRecognizedError(i).message});continue}n.push({name:o.name,typeReference:o.typeReference,value:u})}finally{this.errors.unscope()}}return n}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:s.Critical,message:`Expected file value to be a string, got ${typeof t}`});return}return t}}getFileArrayValues({property:e,record:r}){let t=r[e.wireValue];if(t==null)return;if(!Array.isArray(t)){this.errors.add({severity:s.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let n=[];for(let i of t){if(typeof i!="string"){this.errors.add({severity:s.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}n.push(i)}return n}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:s.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let r=this._ir.types[e];if(r==null){this.errors.add({severity:s.Critical,message:`Type identified by "${e}" could not be found`});return}return r}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:r}){let t=this.getRecord(r);if(t==null)return;let n=e.discriminant.wireValue,i=t[n];if(i==null){this.errors.add({severity:s.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof i!="string"){this.errors.add({severity:s.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let u=e.types[i];if(u==null){this.errors.add({severity:s.Critical,message:`No type found for discriminant value "${i}"`});return}let x=t,{[n]:o}=x,m=b(x,[S(n)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.discriminantValue,value:m}}resolveEndpointOrThrow(e){let r=this.httpEndpointReferenceParser.tryParse(e);if(r==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(r)}resolveEndpointLocationOrThrow(e){let r=[];for(let t of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:t,parsedEndpoint:e})&&r.push(t);if(r.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return r}needsRequestParameter({request:e,inlinePathParameters:r,inlineFileProperties:t}){var n;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:r})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:t}):!((n=e.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,n;return r&&((n=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:f(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(n=>n.id===e);return t==null?void 0:t.name}default:f(r)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:s.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let r=this._ir.environments.environments;switch(r.type){case"singleBaseUrl":return this.errors.add({severity:s.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let t=r.environments[0];if(t==null)return this.errors.add({severity:s.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(E(t.urls));for(let i of E(e))n.has(i)&&n.delete(i);return n.size>0?(this.errors.add({severity:s.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${E(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:s.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:s.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:s.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});return r==null?!1:r.type==="alias"?this.isNullable(r.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:r}){return new Error(`Expected auth type ${e.type}, got ${r.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:r}){return new Error(`Expected ${e}, got ${typeof r}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:r}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r});default:f(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:r}){return this.fileUploadHasBodyProperties({fileUpload:e})||r&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:f(r)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(r=>{switch(r.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:f(r)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:r}){return e.location.method===r.method&&e.location.path===r.path}};p();l();var A={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};p();l();export{R as a,s as b,w as c,A as d};
@@ -1,3 +0,0 @@
1
- import{b as o,d as p}from"./chunk-MKUTGATJ.js";import{j as P,k as v,m as x,n as c,p as s}from"./chunk-LVYU2VDV.js";v();x();var I="$client",l="Example",R=`<?php
2
-
3
- `,A=class{constructor({context:e}){P(this,"context");this.context=e}async generateSnippet({endpoint:e,request:t}){var n;let r=this.buildCodeBlock({endpoint:e,snippet:t});return R+await r.toStringAsync({namespace:l,rootNamespace:l,customConfig:(n=this.context.customConfig)!=null?n:{}})}generateSnippetSync({endpoint:e,request:t}){var n;let r=this.buildCodeBlock({endpoint:e,snippet:t});return R+r.toString({namespace:l,rootNamespace:l,customConfig:(n=this.context.customConfig)!=null?n:{}})}buildCodeBlock({endpoint:e,snippet:t}){return s.codeblock(r=>{r.writeNodeStatement(this.constructClient({endpoint:e,snippet:t})),r.writeNodeStatement(this.callMethod({endpoint:e,snippet:t}))})}constructClient({endpoint:e,snippet:t}){return s.codeblock(r=>{r.write(`${I} = `),r.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){return s.invokeMethod({on:s.codeblock(I),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:t}),multiline:!0})}getConstructorArgs({endpoint:e,snippet:t}){let r=[];e.auth!=null&&(t.auth!=null?r.push(...this.getConstructorAuthArgs({auth:e.auth,values:t.auth})):this.context.errors.add({severity:o.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let n=[],a=this.getConstructorBaseUrlArgs({baseUrl:t.baseURL,environment:t.environment});return a.length>0&&n.push(...a),this.context.errors.scope(p.Headers),this.context.ir.headers!=null&&t.headers!=null&&n.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),n.length===0?r:[...r,{name:"options",assignment:s.TypeLiteral.map({entries:n.map(i=>({key:s.TypeLiteral.string(i.name),value:i.value}))})}]}getConstructorAuthArgs({auth:e,values:t}){switch(e.type){case"basic":return t.type!=="basic"?(this.context.errors.add({severity:o.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorBasicAuthArgs({auth:e,values:t});case"bearer":return t.type!=="bearer"?(this.context.errors.add({severity:o.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorBearerAuthArgs({auth:e,values:t});case"header":return t.type!=="header"?(this.context.errors.add({severity:o.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),[]):this.getConstructorHeaderAuthArgs({auth:e,values:t});default:c(e)}}getConstructorBasicAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.username),assignment:s.TypeLiteral.string(t.username)},{name:this.context.getPropertyName(e.password),assignment:s.TypeLiteral.string(t.password)}]}getConstructorBaseUrlArgs({baseUrl:e,environment:t}){let r=this.getBaseUrlArg({baseUrl:e,environment:t});return s.TypeLiteral.isNop(r)?[]:[{name:"baseUrl",value:r}]}getBaseUrlArg({baseUrl:e,environment:t}){if(e!=null&&t!=null)return this.context.errors.add({severity:o.Critical,message:"Cannot specify both baseUrl and environment options"}),s.TypeLiteral.nop();if(e!=null)return s.TypeLiteral.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let r=this.context.getEnvironmentClassAccessFromID(t);return r==null?(this.context.errors.add({severity:o.Warning,message:`Environment ${JSON.stringify(t)} was not found`}),s.TypeLiteral.nop()):s.TypeLiteral.reference(s.codeblock(n=>{n.writeNode(r),n.write("->value")}))}this.context.isMultiEnvironmentValues(t)&&this.context.errors.add({severity:o.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return s.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.token),assignment:s.TypeLiteral.string(t.token)}]}getConstructorHeaderAuthArgs({auth:e,values:t}){return[{name:this.context.getPropertyName(e.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:t.value})}]}getConstructorHeaderArgs({headers:e,values:t}){let r=[];for(let n of e){let a=this.getConstructorHeaderArg({header:n,value:t.value});a!=null&&r.push({name:this.context.getPropertyName(n.name.name),value:a})}return r}getConstructorHeaderArg({header:e,value:t}){let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:t});if(!s.TypeLiteral.isNop(r))return r}getMethodArgs({endpoint:e,snippet:t}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:t});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:t});default:c(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){let r=[];if(this.context.errors.scope(p.PathParameters),e.pathParameters!=null){let n=this.getPathParameters({namedParameters:e.pathParameters,snippet:t});r.push(...n.map(a=>a.value))}return this.context.errors.unscope(),this.context.errors.scope(p.RequestBody),e.body!=null&&r.push(this.getBodyRequestArg({body:e.body,value:t.requestBody})),this.context.errors.unscope(),r}getBodyRequestArg({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t});default:c(e)}}getBytesBodyRequestArg({value:e}){return this.context.errors.add({severity:o.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),s.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:e,snippet:t}){var h,u;let r=[],n=(u=(h=this.context.customConfig)==null?void 0:h.inlinePathParameters)!=null?u:!1;this.context.errors.scope(p.PathParameters);let a=[];e.pathParameters!=null&&a.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(p.RequestBody);let i=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:n})||r.push(...a.map(m=>m.value)),this.context.needsRequestParameter({request:e,inlinePathParameters:n,inlineFileProperties:!0})&&r.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:n})?a:[],filePropertyInfo:i})),r}getFilePropertyInfo({request:e,snippet:t}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:t.requestBody})}getInlinedRequestArg({request:e,snippet:t,pathParameterFields:r,filePropertyInfo:n}){var y,g,f,F;this.context.errors.scope(p.QueryParameters);let i=this.context.associateQueryParametersByWireValue({parameters:(y=e.queryParameters)!=null?y:[],values:(g=t.queryParameters)!=null?g:{}}).map(d=>({name:this.context.getPropertyName(d.name.name),value:this.context.dynamicTypeLiteralMapper.convert(d)}));this.context.errors.unscope(),this.context.errors.scope(p.Headers);let u=this.context.associateByWireValue({parameters:(f=e.headers)!=null?f:[],values:(F=t.headers)!=null?F:{}}).map(d=>({name:this.context.getPropertyName(d.name.name),value:this.context.dynamicTypeLiteralMapper.convert(d)}));this.context.errors.unscope(),this.context.errors.scope(p.RequestBody);let m=e.body!=null?this.getInlinedRequestBodyConstructorFields({body:e.body,value:t.requestBody,filePropertyInfo:n}):[];return this.context.errors.unscope(),s.TypeLiteral.class_({reference:s.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getRequestNamespace(e.declaration.fernFilepath)}),fields:[...r,...i,...u,...m]})}getInlinedRequestBodyConstructorFields({body:e,value:t,filePropertyInfo:r}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:r});default:c(e)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:e,value:t}){return{name:this.context.getPropertyName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:t});default:c(e)}}getInlinedRequestBodyPropertyConstructorFields({parameters:e,value:t}){var a;let r=[],n=this.context.associateByWireValue({parameters:e,values:(a=this.context.getRecord(t))!=null?a:{}});for(let i of n)r.push({name:this.context.getPropertyName(i.name.name),value:this.context.dynamicTypeLiteralMapper.convert(i)});return r}getPathParameters({namedParameters:e,snippet:t}){var a;let r=[],n=this.context.associateByWireValue({parameters:e,values:(a=t.pathParameters)!=null?a:{}});for(let i of n)r.push({name:this.context.getPropertyName(i.name.name),value:this.context.dynamicTypeLiteralMapper.convert(i)});return r}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getPropertyName(t)).join("->")}->${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientClassInstantiation(e){return s.instantiateClass({classReference:s.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:e,multiline:!0})}};export{A as a};
@@ -1,14 +0,0 @@
1
- import{a as S}from"./chunk-KF5FVQY4.js";import{c as R}from"./chunk-MKUTGATJ.js";import{a as A}from"./chunk-OBW623PQ.js";import{j as n,k as r,m as t,p as g}from"./chunk-LVYU2VDV.js";r();t();r();t();r();t();r();t();r();t();r();t();r();t();var ve=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,N=ve;var Ie=typeof self=="object"&&self&&self.Object===Object&&self,Oe=N||Ie||Function("return this")(),v=Oe;var Ee=v.Symbol,l=Ee;r();t();var I=Object.prototype,Te=I.hasOwnProperty,je=I.toString,c=l?l.toStringTag:void 0;function Me(e){var a=Te.call(e,c),o=e[c];try{e[c]=void 0;var u=!0}catch(d){}var f=je.call(e);return u&&(a?e[c]=o:delete e[c]),f}var O=Me;r();t();var we=Object.prototype,We=we.toString;function Fe(e){return We.call(e)}var E=Fe;var Le="[object Null]",ke="[object Undefined]",T=l?l.toStringTag:void 0;function Ue(e){return e==null?e===void 0?ke:Le:T&&T in Object(e)?O(e):E(e)}var j=Ue;r();t();function Pe(e){return e!=null&&typeof e=="object"}var M=Pe;var ze="[object Symbol]";function Be(e){return typeof e=="symbol"||M(e)&&j(e)==ze}var w=Be;r();t();r();t();function De(e,a){for(var o=-1,u=e==null?0:e.length,f=Array(u);++o<u;)f[o]=a(e[o],o,e);return f}var W=De;r();t();var Ze=Array.isArray,F=Ze;var qe=1/0,L=l?l.prototype:void 0,k=L?L.toString:void 0;function U(e){if(typeof e=="string")return e;if(F(e))return W(e,U)+"";if(w(e))return k?k.call(e):"";var a=e+"";return a=="0"&&1/e==-qe?"-0":a}var P=U;r();t();function Ge(e){return e==null?"":P(e)}var m=Ge;r();t();r();t();r();t();r();t();r();t();r();t();function He(e,a,o){var u=-1,f=e.length;a<0&&(a=-a>f?0:f+a),o=o>f?f:o,o<0&&(o+=f),f=a>o?0:o-a>>>0,a>>>=0;for(var d=Array(f);++u<f;)d[u]=e[u+a];return d}var z=He;function Ve(e,a,o){var u=e.length;return o=o===void 0?u:o,!a&&o>=u?e:z(e,a,o)}var B=Ve;r();t();var Je="\\ud800-\\udfff",_e="\\u0300-\\u036f",$e="\\ufe20-\\ufe2f",Ke="\\u20d0-\\u20ff",Ye=_e+$e+Ke,Qe="\\ufe0e\\ufe0f",Xe="\\u200d",er=RegExp("["+Xe+Je+Ye+Qe+"]");function rr(e){return er.test(e)}var b=rr;r();t();r();t();function tr(e){return e.split("")}var D=tr;r();t();var Z="\\ud800-\\udfff",or="\\u0300-\\u036f",ar="\\ufe20-\\ufe2f",fr="\\u20d0-\\u20ff",ur=or+ar+fr,sr="\\ufe0e\\ufe0f",pr="["+Z+"]",y="["+ur+"]",C="\\ud83c[\\udffb-\\udfff]",lr="(?:"+y+"|"+C+")",q="[^"+Z+"]",G="(?:\\ud83c[\\udde6-\\uddff]){2}",H="[\\ud800-\\udbff][\\udc00-\\udfff]",dr="\\u200d",V=lr+"?",J="["+sr+"]?",mr="(?:"+dr+"(?:"+[q,G,H].join("|")+")"+J+V+")*",nr=J+V+mr,ir="(?:"+[q+y+"?",y,G,H,pr].join("|")+")",xr=RegExp(C+"(?="+C+")|"+ir+nr,"g");function cr(e){return e.match(xr)||[]}var _=cr;function gr(e){return b(e)?_(e):D(e)}var $=gr;function br(e){return function(a){a=m(a);var o=b(a)?$(a):void 0,u=o?o[0]:a.charAt(0),f=o?B(o,1).join(""):a.slice(1);return u[e]()+f}}var K=br;var hr=K("toUpperCase"),i=hr;function yr(e){return i(m(e).toLowerCase())}var Y=yr;r();t();r();t();function Cr(e,a,o,u){var f=-1,d=e==null?0:e.length;for(u&&d&&(o=e[++f]);++f<d;)o=a(o,e[f],f,e);return o}var Q=Cr;r();t();r();t();r();t();function Rr(e){return function(a){return e==null?void 0:e[a]}}var X=Rr;var Sr={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Ar=X(Sr),ee=Ar;var Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vr="\\u0300-\\u036f",Ir="\\ufe20-\\ufe2f",Or="\\u20d0-\\u20ff",Er=vr+Ir+Or,Tr="["+Er+"]",jr=RegExp(Tr,"g");function Mr(e){return e=m(e),e&&e.replace(Nr,ee).replace(jr,"")}var re=Mr;r();t();r();t();var wr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Wr(e){return e.match(wr)||[]}var te=Wr;r();t();var Fr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Lr(e){return Fr.test(e)}var oe=Lr;r();t();var pe="\\ud800-\\udfff",kr="\\u0300-\\u036f",Ur="\\ufe20-\\ufe2f",Pr="\\u20d0-\\u20ff",zr=kr+Ur+Pr,le="\\u2700-\\u27bf",de="a-z\\xdf-\\xf6\\xf8-\\xff",Br="\\xac\\xb1\\xd7\\xf7",Dr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zr="\\u2000-\\u206f",qr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",me="A-Z\\xc0-\\xd6\\xd8-\\xde",Gr="\\ufe0e\\ufe0f",ne=Br+Dr+Zr+qr,ie="['\u2019]",ae="["+ne+"]",Hr="["+zr+"]",xe="\\d+",Vr="["+le+"]",ce="["+de+"]",ge="[^"+pe+ne+xe+le+de+me+"]",Jr="\\ud83c[\\udffb-\\udfff]",_r="(?:"+Hr+"|"+Jr+")",$r="[^"+pe+"]",be="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",x="["+me+"]",Kr="\\u200d",fe="(?:"+ce+"|"+ge+")",Yr="(?:"+x+"|"+ge+")",ue="(?:"+ie+"(?:d|ll|m|re|s|t|ve))?",se="(?:"+ie+"(?:D|LL|M|RE|S|T|VE))?",ye=_r+"?",Ce="["+Gr+"]?",Qr="(?:"+Kr+"(?:"+[$r,be,he].join("|")+")"+Ce+ye+")*",Xr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",et="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rt=Ce+ye+Qr,tt="(?:"+[Vr,be,he].join("|")+")"+rt,ot=RegExp([x+"?"+ce+"+"+ue+"(?="+[ae,x,"$"].join("|")+")",Yr+"+"+se+"(?="+[ae,x+fe,"$"].join("|")+")",x+"?"+fe+"+"+ue,x+"+"+se,et,Xr,xe,tt].join("|"),"g");function at(e){return e.match(ot)||[]}var Re=at;function ft(e,a,o){return e=m(e),a=o?void 0:a,a===void 0?oe(e)?Re(e):te(e):e.match(a)||[]}var Se=ft;var ut="['\u2019]",st=RegExp(ut,"g");function pt(e){return function(a){return Q(Se(re(a).replace(st,"")),e,"")}}var Ae=pt;var lt=Ae(function(e,a,o){return a=a.toLowerCase(),e+(o?Y(a):a)}),h=lt;var dt=["use","clone","list"],mt="Requests",nt="Types",Ne=class e extends R{constructor({ir:o,config:u}){var f;super({ir:o,config:u});n(this,"ir");n(this,"customConfig");n(this,"dynamicTypeLiteralMapper");n(this,"filePropertyMapper");n(this,"rootNamespace");this.ir=o,this.customConfig=u.customConfig!=null?u.customConfig:void 0,this.dynamicTypeLiteralMapper=new S({context:this}),this.filePropertyMapper=new A({context:this}),this.rootNamespace=it({organization:u.organization,namespaceOverride:(f=this.customConfig)==null?void 0:f.namespace})}clone(){return new e({ir:this.ir,config:this.config})}getParameterName(o){return this.prependUnderscoreIfNeeded(o.camelCase.unsafeName)}getPropertyName(o){return this.prependUnderscoreIfNeeded(o.camelCase.unsafeName)}getMethodName(o){let u=o.camelCase.unsafeName;return dt.includes(u)?u:o.camelCase.safeName}getClassName(o){return o.pascalCase.safeName}getRootClientClassName(){var o,u,f;return((o=this.customConfig)==null?void 0:o.clientName)!=null?this.customConfig.clientName:((u=this.customConfig)==null?void 0:u["client-class-name"])!=null?(f=this.customConfig)==null?void 0:f["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return g.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(o){return this.getNamespace(o,mt)}getTypesNamespace(o){return this.getNamespace(o,nt)}getNamespace(o,u){let f=o.allParts.map(d=>d.pascalCase.safeName);return f=u!=null?[...f,u]:f,[this.rootNamespace,...f].join("\\")}getEnvironmentClassAccessFromID(o){let u=this.resolveEnvironmentName(o);if(u!=null)return g.codeblock(f=>{f.writeNode(this.getEnvironmentClassReference(u)),f.write("::"),f.write(this.getClassName(u))})}getEnvironmentClassReference(o){return g.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(o){return/^[a-zA-Z_]/.test(o)?o:`_${o}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${i(h(this.config.organization))}`}};function it({organization:e,namespaceOverride:a}){return a!=null?a:`${i(h(e))}`}export{Ne as a};
2
- /*! Bundled license information:
3
-
4
- lodash-es/lodash.js:
5
- (**
6
- * @license
7
- * Lodash (Custom Build) <https://lodash.com/>
8
- * Build: `lodash modularize exports="es" -o ./`
9
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
10
- * Released under MIT license <https://lodash.com/license>
11
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
- *)
14
- */