@fern-api/go-dynamic-snippets 0.0.13 → 0.0.14
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/DynamicSnippetsGenerator.cjs +7 -7
- package/cjs/EndpointSnippetGenerator.cjs +6 -6
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +7 -7
- package/cjs/context/DynamicTypeInstantiationMapper.cjs +7 -7
- package/cjs/context/DynamicTypeMapper.cjs +7 -7
- package/cjs/context/FilePropertyMapper.cjs +4 -4
- package/cjs/index.cjs +8 -8
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/{chunk-IMHG3M62.js → chunk-5HP3T45N.js} +1 -1
- package/esm/chunk-D3UUM672.js +1 -0
- package/esm/{chunk-2GO4GGHE.js → chunk-I3VUX77R.js} +1 -1
- package/esm/{chunk-WXCSO57K.js → chunk-J745U74Q.js} +1 -1
- package/esm/chunk-SS6XZXHU.js +1 -0
- package/esm/{chunk-W5QUFHNP.js → chunk-TUE3DOHS.js} +7 -7
- package/esm/chunk-X7QP3WH3.js +1 -0
- package/esm/{chunk-IHGUMUOY.js → chunk-YAGEU3HO.js} +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeInstantiationMapper.js +1 -1
- package/esm/context/DynamicTypeMapper.js +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/esm/chunk-25QU7TNW.js +0 -1
- package/esm/chunk-45WV72IW.js +0 -1
- package/esm/chunk-P4OQRDWB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-YAGEU3HO.js";import"./chunk-X7QP3WH3.js";import"./chunk-5HP3T45N.js";import"./chunk-SS6XZXHU.js";import"./chunk-J745U74Q.js";import"./chunk-D3UUM672.js";import"./chunk-I3VUX77R.js";import"./chunk-TUE3DOHS.js";export{a as DynamicSnippetsGenerator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-X7QP3WH3.js";import"./chunk-J745U74Q.js";import"./chunk-TUE3DOHS.js";export{a as EndpointSnippetGenerator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-SS6XZXHU.js";import{c as a}from"./chunk-J745U74Q.js";import{a as m}from"./chunk-D3UUM672.js";import{a as s}from"./chunk-I3VUX77R.js";import{j as r,k as i,m as o,p,q as t}from"./chunk-TUE3DOHS.js";i();o();var u=class f extends a{constructor({ir:e,config:n}){super({ir:e,config:n});r(this,"ir");r(this,"customConfig");r(this,"dynamicTypeMapper");r(this,"dynamicTypeInstantiationMapper");r(this,"filePropertyMapper");r(this,"rootImportPath");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeMapper=new m({context:this}),this.dynamicTypeInstantiationMapper=new c({context:this}),this.filePropertyMapper=new s({context:this}),this.rootImportPath=p({config:n,customConfig:this.customConfig})}clone(){return new f({ir:this.ir,config:this.config})}getMethodName(e){return e.pascalCase.unsafeName}getTypeName(e){return e.pascalCase.unsafeName}getImportPath(e){let n=e.packagePath.map(g=>g.pascalCase.unsafeName.toLowerCase());return[this.rootImportPath,...n].join("/")}getContextTypeReference(){return t.typeReference({name:"Context",importPath:"context"})}getContextTodoFunctionInvocation(){return t.invokeFunc({func:t.typeReference({name:"TODO",importPath:"context"}),arguments_:[]})}getIoReaderTypeReference(){return t.typeReference({name:"Reader",importPath:"io"})}getNewStringsReaderFunctionInvocation(e){return t.invokeFunc({func:t.typeReference({name:"NewReader",importPath:"strings"}),arguments_:[t.TypeInstantiation.string(e)]})}getClientConstructorName(){var e;return((e=this.customConfig)==null?void 0:e.exportedClientName)!=null?`New${this.customConfig.exportedClientName}`:"NewClient"}getClientImportPath(){return`${this.rootImportPath}/client`}getOptionImportPath(){return`${this.rootImportPath}/option`}getGoTypeReferenceFromDeclaration({declaration:e}){return t.typeReference({name:e.name.pascalCase.unsafeName,importPath:this.getImportPath(e.fernFilepath)})}getEnvironmentTypeReferenceFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return this.getEnvironmentTypeReference(n)}getEnvironmentTypeReference(e){return t.typeReference({name:`Environments.${this.getTypeName(e)}`,importPath:this.rootImportPath})}};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as c,k as i,m as p,n,q as e}from"./chunk-TUE3DOHS.js";i();p();var a=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return e.Type.slice(this.convert({typeReference:t.typeReference}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return e.Type.map(this.convert({typeReference:t.typeReference.key}),this.convert({typeReference:t.typeReference.value}));case"named":{let r=this.context.resolveNamedType({typeId:t.typeReference.value});return r==null?this.convertUnknown():this.convertNamed({named:r})}case"optional":return e.Type.optional(this.convert({typeReference:t.typeReference.value}));case"nullable":return e.Type.optional(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return e.Type.slice(this.convert({typeReference:t.typeReference}));case"unknown":return this.convertUnknown();default:n(t.typeReference)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return e.Type.bool();case"string":return e.Type.string()}}convertNamed({named:t}){let r=e.Type.reference(e.typeReference({name:this.context.getTypeName(t.declaration.name),importPath:this.context.getImportPath(t.declaration.fernFilepath)}));switch(t.type){case"alias":case"enum":return r;case"discriminatedUnion":case"object":case"undiscriminatedUnion":return e.Type.pointer(r);default:n(t)}}convertUnknown(){return e.Type.any()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return e.Type.int();case"UINT":return e.Type.int();case"LONG":return e.Type.int64();case"UINT_64":return e.Type.int64();case"FLOAT":return e.Type.float64();case"DOUBLE":return e.Type.float64();case"BOOLEAN":return e.Type.bool();case"STRING":return e.Type.string();case"DATE":return e.Type.date();case"DATE_TIME":return e.Type.dateTime();case"UUID":return e.Type.uuid();case"BASE_64":return e.Type.bytes();case"BIG_INTEGER":return e.Type.string();default:n(t)}}};export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p,k as s,m as y,n as l,q as n}from"./chunk-
|
|
1
|
+
import{j as p,k as s,m as y,n as l,q as n}from"./chunk-TUE3DOHS.js";s();y();var c=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:o}){var a;let e={fileFields:[],bodyPropertyFields:[]},i=(a=this.context.getRecord(o))!=null?a:{};for(let r of t.properties)switch(r.type){case"file":e.fileFields.push({name:this.context.getTypeName(r.name),value:this.getSingleFileProperty({property:r,record:i})});break;case"fileArray":e.fileFields.push({name:this.context.getTypeName(r.name),value:this.getArrayFileProperty({property:r,record:i})});break;case"bodyProperty":e.bodyPropertyFields.push({name:this.context.getTypeName(r.name.name),value:this.getBodyProperty({property:r,record:i})});break;default:l(r)}return e}getSingleFileProperty({property:t,record:o}){let e=this.context.getSingleFileValue({property:t,record:o});return e==null?n.TypeInstantiation.nop():n.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(e))}getArrayFileProperty({property:t,record:o}){let e=this.context.getFileArrayValues({property:t,record:o});return e==null?n.TypeInstantiation.nop():n.TypeInstantiation.slice({valueType:n.Type.reference(this.context.getIoReaderTypeReference()),values:e.map(i=>n.TypeInstantiation.reference(this.context.getNewStringsReaderFunctionInvocation(i)))})}getBodyProperty({property:t,record:o}){let e=o[t.name.wireValue];return e==null?n.TypeInstantiation.nop():this.context.dynamicTypeInstantiationMapper.convert({typeReference:t.typeReference,value:e})}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P,b as T,c as
|
|
1
|
+
import{a as P,b as T,c as b,d as A,j as o,k as a,m as p,n as f,o as g}from"./chunk-TUE3DOHS.js";a();p();var E=class{constructor(e){o(this,"context");this.context=e}};a();p();var n={Critical:"CRITICAL",Warning:"WARNING"},y=class h{constructor(){o(this,"errors");o(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}};a();p();a();p();a();p();var v=class{constructor(){o(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 R=class{constructor({ir:e,config:r}){o(this,"config");o(this,"errors");o(this,"_ir");o(this,"httpEndpointReferenceParser");this._ir=e,this.config=r,this.errors=new y,this.httpEndpointReferenceParser=new v}associateQueryParametersByWireValue({parameters:e,values:r}){let t=[];for(let[i,s]of Object.entries(r)){this.errors.scope(i);try{let l=e.find(m=>m.name.wireValue===i);if(l==null)throw this.newParameterNotRecognizedError(i);let c=this.isListTypeReference(l.typeReference)&&!Array.isArray(s)?[s]:s;t.push({name:l.name,typeReference:l.typeReference,value:c})}finally{this.errors.unscope()}}return t}associateByWireValue({parameters:e,values:r,ignoreMissingParameters:t}){let i=[];for(let[s,l]of Object.entries(r)){this.errors.scope(s);try{let c=e.find(m=>m.name.wireValue===s);if(c==null){if(t)continue;this.errors.add({severity:n.Critical,message:this.newParameterNotRecognizedError(s).message});continue}i.push({name:c.name,typeReference:c.typeReference,value:l})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:e,record:r}){let t=r[e.wireValue];if(t!=null){if(typeof t!="string"){this.errors.add({severity:n.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:n.Critical,message:`Expected file array value to be an array of strings, got ${typeof t}`});return}let i=[];for(let s of t){if(typeof s!="string"){this.errors.add({severity:n.Critical,message:`Expected file array value to be an array of strings, got ${typeof s}`});return}i.push(s)}return i}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:n.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:n.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 i=e.discriminant.wireValue,s=t[i];if(s==null){this.errors.add({severity:n.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof s!="string"){this.errors.add({severity:n.Critical,message:`Expected discriminant value to be a string but got: ${typeof s}`});return}let l=e.types[s];if(l==null){this.errors.add({severity:n.Critical,message:`No type found for discriminant value "${s}"`});return}let x=t,{[i]:c}=x,m=A(x,[b(i)]);return{singleDiscriminatedUnionType:l,discriminantValue:l.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 i;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}):!((i=e.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:r}){var t,i;return r&&((i=(t=e.metadata)==null?void 0:t.includePathParameters)!=null?i:!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(i=>i.id===e);return t==null?void 0:t.name}case"multipleBaseUrls":{let t=r.environments.find(i=>i.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:n.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:n.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:n.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(g(t.urls));for(let s of g(e))i.has(s)&&i.delete(s);return i.size>0?(this.errors.add({severity:n.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${g(t.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:n.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:n.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:n.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}};a();p();var w=class{constructor(){o(this,"reporter");o(this,"snippet");o(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}"`)}};a();p();var S={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();p();export{E as a,n as b,R as c,w as d,S as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk-J745U74Q.js";import{j as p,k as l,m as d,n as s,q as i}from"./chunk-TUE3DOHS.js";l();d();var y=class{constructor({context:e}){p(this,"context");this.context=e}convert(e){if(e.value===null&&!this.context.isNullable(e.typeReference)&&this.context.errors.add({severity:c.Critical,message:"Expected non-null value, but got null"}),e.value==null)return i.TypeInstantiation.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return i.TypeInstantiation.nop();case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let n=this.context.resolveNamedType({typeId:e.typeReference.value});return n==null?i.TypeInstantiation.nop():this.convertNamed({named:n,value:e.value,as:e.as})}case"nullable":return i.TypeInstantiation.optional(this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as}));case"optional":return i.TypeInstantiation.optional(this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertList({list:e.typeReference.value,value:e.value});case"unknown":return this.convertUnknown({value:e.value});default:s(e.typeReference)}}convertList({list:e,value:n}){return Array.isArray(n)?i.TypeInstantiation.slice({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:n.map((r,t)=>{this.context.errors.scope({index:t});try{return this.convert({typeReference:e,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:c.Critical,message:`Expected array but got: ${typeof n}`}),i.TypeInstantiation.nop())}convertMap({map:e,value:n}){return typeof n!="object"||n==null?(this.context.errors.add({severity:c.Critical,message:`Expected object but got: ${n==null?"null":typeof n}`}),i.TypeInstantiation.nop()):i.TypeInstantiation.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(n).map(([r,t])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:e.key,value:r,as:"key"}),value:this.convert({typeReference:e.value,value:t})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:n,as:r}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:n,as:r});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:n});case"enum":return this.convertEnum({enum_:e,value:n});case"object":return this.convertObject({object_:e,value:n});case"undiscriminatedUnion":return this.convertUndicriminatedUnion({undicriminatedUnion:e,value:n});default:s(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:n}){let r=this.context.getGoTypeReferenceFromDeclaration({declaration:e.declaration}),t=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:n});if(t==null)return i.TypeInstantiation.nop();let a=t.singleDiscriminatedUnionType,o=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:a});switch(a.type){case"samePropertiesAsObject":{let u=this.context.resolveNamedType({typeId:a.typeId});return u==null?i.TypeInstantiation.nop():i.TypeInstantiation.structPointer({typeReference:r,fields:[{name:this.context.getTypeName(a.discriminantValue.name),value:this.convertNamed({named:u,value:t.value})},...o]})}case"singleProperty":{let u=this.context.getRecord(t.value);if(u==null)return i.TypeInstantiation.nop();try{return this.context.errors.scope(a.discriminantValue.wireValue),i.TypeInstantiation.structPointer({typeReference:r,fields:[{name:this.context.getTypeName(a.discriminantValue.name),value:this.convert({typeReference:a.typeReference,value:u[a.discriminantValue.wireValue]})},...o]})}finally{this.context.errors.unscope()}}case"noProperties":return i.TypeInstantiation.structPointer({typeReference:r,fields:[{name:this.context.getTypeName(t.discriminantValue.name),value:i.TypeInstantiation.string(a.discriminantValue.wireValue)},...o]});default:s(a)}}getBaseFields({discriminatedUnionTypeInstance:e,singleDiscriminatedUnionType:n}){var t,a;return this.context.associateByWireValue({parameters:(t=n.properties)!=null?t:[],values:(a=this.context.getRecord(e.value))!=null?a:{},ignoreMissingParameters:!0}).map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getTypeName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})}convertObject({object_:e,value:n}){var t;let r=this.context.associateByWireValue({parameters:e.properties,values:(t=this.context.getRecord(n))!=null?t:{}});return i.TypeInstantiation.structPointer({typeReference:i.typeReference({name:this.context.getTypeName(e.declaration.name),importPath:this.context.getImportPath(e.declaration.fernFilepath)}),fields:r.map(a=>{this.context.errors.scope(a.name.wireValue);try{return{name:this.context.getTypeName(a.name.name),value:this.convert(a)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:n}){let r=this.getEnumValueName({enum_:e,value:n});return r==null?i.TypeInstantiation.nop():i.TypeInstantiation.enum(i.typeReference({name:r,importPath:this.context.getImportPath(e.declaration.fernFilepath)}))}getEnumValueName({enum_:e,value:n}){if(typeof n!="string"){this.context.errors.add({severity:c.Critical,message:`Expected enum value string, got: ${typeof n}`});return}let r=e.values.find(t=>t.wireValue===n);if(r==null){this.context.errors.add({severity:c.Critical,message:`An enum value named "${n}" does not exist in this context`});return}return`${this.context.getTypeName(e.declaration.name)}${this.context.getTypeName(r.name)}`}convertUndicriminatedUnion({undicriminatedUnion:e,value:n}){let r=this.findMatchingUndiscriminatedUnionType({undicriminatedUnion:e,value:n});if(r==null)return i.TypeInstantiation.nop();let t=this.getUndiscriminatedUnionFieldName({typeReference:r.valueTypeReference});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.structPointer({typeReference:this.context.getGoTypeReferenceFromDeclaration({declaration:e.declaration}),fields:[{name:t,value:r.typeInstantiation}]})}findMatchingUndiscriminatedUnionType({undicriminatedUnion:e,value:n}){for(let r of e.types)try{let t=this.convert({typeReference:r,value:n});return{valueTypeReference:r,typeInstantiation:t}}catch(t){continue}this.context.errors.add({severity:c.Critical,message:`None of the types in the undicriminated union matched the given "${typeof n}" value`})}getUndiscriminatedUnionFieldName({typeReference:e}){switch(e.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:e});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:e.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:e});case"named":{let n=this.context.resolveNamedType({typeId:e.value});return n==null?void 0:this.context.getTypeName(n.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"nullable":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:e.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:e});case"unknown":return"Unknown";default:s(e)}}getUndiscriminatedUnionFieldNameForList({list:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e});if(n!=null)return`${n}List`}getUndiscriminatedUnionFieldNameForMap({map:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e.key});if(n==null)return;let r=this.getUndiscriminatedUnionFieldName({typeReference:e.value});if(r!=null)return`${n}${r}Map`}getUndiscriminatedUnionFieldNameForOptional({typeReference:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e});if(n!=null)return`${n}Optional`}getUndiscriminatedUnionFieldNameForSet({set:e}){let n=this.getUndiscriminatedUnionFieldName({typeReference:e});if(n!=null)return`${n}Set`}getUndiscriminatedUnionFieldNameForLiteral({literal:e}){switch(e.type){case"boolean":return e.value?"TrueLiteral":"FalseLiteral";case"string":return`${e.value}StringLiteral`;default:s(e)}}getUndiscriminatedUnionFieldNameForPrimitive({primitive:e}){switch(e){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:s(e)}}convertUnknown({value:e}){return i.TypeInstantiation.any(e)}convertPrimitive({primitive:e,value:n,as:r}){switch(e){case"INTEGER":case"UINT":{let t=this.getValueAsNumber({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.int(t)}case"LONG":case"UINT_64":{let t=this.getValueAsNumber({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.int64(t)}case"FLOAT":case"DOUBLE":{let t=this.getValueAsNumber({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.float64(t)}case"BOOLEAN":{let t=this.getValueAsBoolean({value:n,as:r});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.bool(t)}case"STRING":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.string(t)}case"DATE":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.date(t)}case"DATE_TIME":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.dateTime(t)}case"UUID":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.uuid(t)}case"BASE_64":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.bytes(t)}case"BIG_INTEGER":{let t=this.context.getValueAsString({value:n});return t==null?i.TypeInstantiation.nop():i.TypeInstantiation.string(t)}default:s(e)}}getValueAsNumber({value:e,as:n}){let r=n==="key"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:e,as:n}){let r=n==="key"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:r})}};export{y as a};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Ze=Object.create;var Q=Object.defineProperty,Qe=Object.defineProperties,Xe=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,et=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var le=(r,t,e)=>t in r?Q(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Cr=(r,t)=>{for(var e in t||(t={}))me.call(t,e)&&le(r,e,t[e]);if(ne)for(var e of ne(t))Ee.call(t,e)&&le(r,e,t[e]);return r},$r=(r,t)=>Qe(r,qe(t));var Fr=r=>typeof r=="symbol"?r:r+"",Or=(r,t)=>{var e={};for(var n in r)me.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&ne)for(var n of ne(r))t.indexOf(n)<0&&Ee.call(r,n)&&(e[n]=r[n]);return e};var we=(r,t)=>()=>(r&&(t=r(r=0)),t);var Wr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),tt=(r,t)=>{for(var e in t)Q(r,e,{get:t[e],enumerable:!0})},ve=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ke(t))!me.call(r,i)&&i!==e&&Q(r,i,{get:()=>t[i],enumerable:!(n=Xe(t,i))||n.enumerable});return r};var Vr=(r,t,e)=>(e=r!=null?Ze(et(r)):{},ve(t||!r||!r.__esModule?Q(e,"default",{value:r,enumerable:!0}):e,r)),Gr=r=>ve(Q({},"__esModule",{value:!0}),r);var h=(r,t,e)=>le(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 _e(r){if(B===setTimeout)return setTimeout(r,0);if((B===Ie||!B)&&setTimeout)return B=setTimeout,setTimeout(r,0);try{return B(r,0)}catch(t){try{return B.call(null,r,0)}catch(e){return B.call(this,r,0)}}}function rt(r){if(M===clearTimeout)return clearTimeout(r);if((M===Re||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(r);try{return M(r)}catch(t){try{return M.call(null,r)}catch(e){return M.call(this,r)}}}function nt(){!Z||!D||(Z=!1,D.length?P=D.concat(P):ie=-1,P.length&&ke())}function ke(){if(!Z){var r=_e(nt);Z=!0;for(var t=P.length;t;){for(D=P,P=[];++ie<t;)D&&D[ie].run();ie=-1,t=P.length}D=null,Z=!1,rt(r)}}function it(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];P.push(new Se(r,t)),P.length===1&&!Z&&_e(ke)}function Se(r,t){this.fun=r,this.array=t}function C(){}function At(r){throw new Error("process.binding is not supported")}function Et(){return"/"}function vt(r){throw new Error("process.chdir is not supported")}function Nt(){return 0}function Rt(r){var t=It.call(z)*.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 kt(){var r=new Date,t=r-_t;return t/1e3}var B,M,P,Z,D,ie,ot,st,at,ut,ft,ct,ht,pt,lt,mt,wt,dt,xt,yt,Tt,gt,z,It,_t,m,Ne,u=we(()=>{"use strict";B=Ie,M=Re;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);P=[],Z=!1,ie=-1;Se.prototype.run=function(){this.fun.apply(null,this.array)};ot="browser",st="browser",at=!0,ut={},ft=[],ct="",ht={},pt={},lt={};mt=C,wt=C,dt=C,xt=C,yt=C,Tt=C,gt=C;z=globalThis.performance||{},It=z.now||z.mozNow||z.msNow||z.oNow||z.webkitNow||function(){return new Date().getTime()};_t=new Date;m={nextTick:it,title:ot,browser:at,env:ut,argv:ft,version:ct,versions:ht,on:mt,addListener:wt,once:dt,off:xt,removeListener:yt,removeAllListeners:Tt,emit:gt,binding:At,cwd:Et,chdir:vt,umask:Nt,hrtime:Rt,platform:st,release:pt,config:lt,uptime:kt},Ne={};Object.keys(Ne).forEach(r=>{let t=r.split("."),e=m;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=Ne[r]:e=e[i]||(e[i]={})}})});function be(){xe=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)_[t]=r[t],E[r.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Pt(r){xe||be();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 St(c*3/4-o),n=o>0?c-4:c;var p=0;for(t=0,e=0;t<n;t+=4,e+=3)i=E[r.charCodeAt(t)]<<18|E[r.charCodeAt(t+1)]<<12|E[r.charCodeAt(t+2)]<<6|E[r.charCodeAt(t+3)],s[p++]=i>>16&255,s[p++]=i>>8&255,s[p++]=i&255;return o===2?(i=E[r.charCodeAt(t)]<<2|E[r.charCodeAt(t+1)]>>4,s[p++]=i&255):o===1&&(i=E[r.charCodeAt(t)]<<10|E[r.charCodeAt(t+1)]<<4|E[r.charCodeAt(t+2)]>>2,s[p++]=i>>8&255,s[p++]=i&255),s}function Ut(r){return _[r>>18&63]+_[r>>12&63]+_[r>>6&63]+_[r&63]}function Lt(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(Ut(n));return i.join("")}function Pe(r){xe||be();for(var t,e=r.length,n=e%3,i="",o=[],s=16383,c=0,p=e-n;c<p;c+=s)o.push(Lt(r,c,c+s>p?p:c+s));return n===1?(t=r[e-1],i+=_[t>>2],i+=_[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=_[t>>10],i+=_[t>>4&63],i+=_[t<<2&63],i+="="),o.push(i),o.join("")}function oe(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(r,t){if(oe()<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 ye(this,r)}return Be(this,r,t,e)}function Be(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"?Bt(r,t,e):Yt(r,t)}function Me(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 bt(r,t,e,n){return Me(t),t<=0?U(r,t):e!==void 0?typeof n=="string"?U(r,t).fill(e,n):U(r,t).fill(e):U(r,t)}function ye(r,t){if(Me(t),r=U(r,t<0?0:Te(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Bt(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=Ye(t,e)|0;r=U(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:Te(t.length)|0;r=U(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 Yt(r,t){if(k(t)){var e=Te(t.length)|0;return r=U(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||tr(t.length)?U(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 Te(r){if(r>=oe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe().toString(16)+" bytes");return r|0}function k(r){return!!(r!=null&&r._isBuffer)}function Ye(r,t){if(k(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 se(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ve(r).length;default:if(n)return se(r).length;t=(""+t).toLowerCase(),n=!0}}function Dt(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 jt(this,t,e);case"utf8":case"utf-8":return $e(this,t,e);case"ascii":return Ht(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 $(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function De(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)),k(t))return t.length===0?-1:Ue(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):Ue(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ue(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 p(A,j){return o===1?A[j]:A.readUInt16BE(j*o)}var w;if(i){var d=-1;for(w=e;w<s;w++)if(p(r,w)===p(t,d===-1?0:w-d)){if(d===-1&&(d=w),w-d+1===c)return d*o}else d!==-1&&(w-=w-d),d=-1}else for(e+c>s&&(e=s-c),w=e;w>=0;w--){for(var l=!0,I=0;I<c;I++)if(p(r,w+I)!==p(t,I)){l=!1;break}if(l)return w}return-1}function Ct(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 $t(r,t,e,n){return fe(se(t,r.length-e),r,e,n)}function Ce(r,t,e,n){return fe(Kt(t),r,e,n)}function Ft(r,t,e,n){return Ce(r,t,e,n)}function Ot(r,t,e,n){return fe(Ve(t),r,e,n)}function Wt(r,t,e,n){return fe(er(t,r.length-e),r,e,n)}function Vt(r,t,e){return t===0&&e===r.length?Pe(r):Pe(r.slice(t,e))}function $e(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 p,w,d,l;switch(c){case 1:o<128&&(s=o);break;case 2:p=r[i+1],(p&192)===128&&(l=(o&31)<<6|p&63,l>127&&(s=l));break;case 3:p=r[i+1],w=r[i+2],(p&192)===128&&(w&192)===128&&(l=(o&15)<<12|(p&63)<<6|w&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:p=r[i+1],w=r[i+2],d=r[i+3],(p&192)===128&&(w&192)===128&&(d&192)===128&&(l=(o&15)<<18|(p&63)<<12|(w&63)<<6|d&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 Gt(n)}function Gt(r){var t=r.length;if(t<=Le)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Le));return e}function Ht(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 jt(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+=qt(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 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 T(r,t,e,n,i,o){if(!k(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 ae(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 ue(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 Fe(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 Oe(r,t,e,n,i){return i||Fe(r,t,e,4,34028234663852886e22,-34028234663852886e22),He(r,t,e,n,23,4),e+4}function We(r,t,e,n,i){return i||Fe(r,t,e,8,17976931348623157e292,-17976931348623157e292),He(r,t,e,n,52,8),e+8}function Qt(r){if(r=Xt(r).replace(Zt,""),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 qt(r){return r<16?"0"+r.toString(16):r.toString(16)}function se(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 Kt(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function er(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 Ve(r){return Pt(Qt(r))}function fe(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function tr(r){return r!==r}function rr(r){return r!=null&&(!!r._isBuffer||Ge(r)||nr(r))}function Ge(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function nr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ge(r.slice(0,0))}function ce(r,t,e,n,i){var o,s,c=i*8-n-1,p=(1<<c)-1,w=p>>1,d=-7,l=e?i-1:0,I=e?-1:1,A=r[t+l];for(l+=I,o=A&(1<<-d)-1,A>>=-d,d+=c;d>0;o=o*256+r[t+l],l+=I,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+r[t+l],l+=I,d-=8);if(o===0)o=1-w;else{if(o===p)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-w}return(A?-1:1)*s*Math.pow(2,o-n)}function He(r,t,e,n,i,o){var s,c,p,w=o*8-i-1,d=(1<<w)-1,l=d>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,j=n?1:-1,ze=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=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-s))<1&&(s--,p*=2),s+l>=1?t+=I/p:t+=I*Math.pow(2,1-l),t*p>=2&&(s++,p/=2),s+l>=d?(c=0,s=d):s+l>=1?(c=(t*p-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+=j,c/=256,i-=8);for(s=s<<i|c,w+=i;w>0;r[e+A]=s&255,A+=j,s/=256,w-=8);r[e+A-j]|=ze*128}var _,E,St,xe,Le,Zt,Je=we(()=>{"use strict";u();f();_=[],E=[],St=typeof Uint8Array!="undefined"?Uint8Array:Array,xe=!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 Be(null,r,t,e)};a.kMaxLength=oe();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 bt(null,r,t,e)};a.allocUnsafe=function(r){return ye(null,r)};a.allocUnsafeSlow=function(r){return ye(null,r)};a.isBuffer=rr;a.compare=function(t,e){if(!k(t)||!k(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(!k(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Ye;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)$(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)$(this,e,e+3),$(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)$(this,e,e+7),$(this,e+1,e+6),$(this,e+2,e+5),$(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?$e(this,0,t):Dt.apply(this,arguments)};a.prototype.equals=function(t){if(!k(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(!k(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,p=Math.min(s,c),w=this.slice(i,o),d=t.slice(e,n),l=0;l<p;++l)if(w[l]!==d[l]){s=w[l],c=d[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 De(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return De(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 Ct(this,t,e,n);case"utf8":case"utf-8":return $t(this,t,e,n);case"ascii":return Ce(this,t,e,n);case"latin1":case"binary":return Ft(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)}};Le=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||y(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||y(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||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,n){t=t|0,e=e|0,n||y(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||y(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||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 n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,e){e||y(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||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),ce(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),ce(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),ce(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),ce(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;T(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;T(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||T(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||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ae(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ae(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(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);T(this,t,e,n,o-1,-o)}var s=0,c=1,p=0;for(this[e]=t&255;++s<n&&(c*=256);)t<0&&p===0&&this[e+s-1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&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);T(this,t,e,n,o-1,-o)}var s=n-1,c=1,p=0;for(this[e+s]=t&255;--s>=0&&(c*=256);)t<0&&p===0&&this[e+s+1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&255;return e+n};a.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||T(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||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ae(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ae(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return Oe(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return Oe(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return We(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return We(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=k(t)?t:se(new a(t,i).toString()),p=c.length;for(s=0;s<n-e;++s)this[s+e]=c[s%p]}return this};Zt=/[^+\/0-9A-Za-z-_]/g});var f=we(()=>{"use strict";Je()});u();f();function X(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();f();u();f();function ir(r){return Object.keys(r)}u();f();u();f();u();f();function q(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 or="sdk";function sr({config:r,customConfig:t}){let e=ur({config:r}),n=ar({config:r,customConfig:t});return e!=null?cr({importPath:n,majorVersion:e}):n}function ar({config:r,customConfig:t}){var e,n,i;return(i=(n=t==null?void 0:t.importPath)!=null?n:(e=t==null?void 0:t.module)==null?void 0:e.path)!=null?i:r.output.mode.type==="github"?hr(r.output.mode.repoUrl,"https://"):or}function ur({config:r}){let t=fr({config:r});if(!(t==null||t==="v0"||t==="v1"))return`${t}`}function fr({config:r}){let t=pr(r);if(t==null)return;let e=t.split(".");if(e[0]==null)return;let n=e[0];return n.startsWith("v")?n:`v${n}`}function cr({importPath:r,majorVersion:t}){return q(r)===t?r:`${r}/${t}`}function hr(r,t){return r.startsWith(t)?r.slice(t.length):r}function pr(r){var e;let t=(e=r==null?void 0:r.output)==null?void 0:e.mode;if(t!=null)return t.type==="github"||t.type==="publish"?t.version:void 0}var Ae={};tt(Ae,{AstNode:()=>x,CodeBlock:()=>S,Enum:()=>W,Field:()=>V,Func:()=>G,FuncInvocation:()=>R,Method:()=>L,MethodInvocation:()=>b,Parameter:()=>H,Struct:()=>J,Type:()=>re,TypeInstantiation:()=>N,TypeReference:()=>g,Writer:()=>O,codeblock:()=>kr,enum_:()=>Sr,field:()=>Pr,func:()=>Ur,invokeFunc:()=>Lr,invokeMethod:()=>br,method:()=>Br,parameter:()=>Mr,struct:()=>Yr,typeReference:()=>Dr});u();f();u();f();u();f();u();f();u();f();var F=class{};u();f();u();f();var Y=class extends F{constructor(e){super();h(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var lr=4,K=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(`
|
|
1
|
+
var Ze=Object.create;var Q=Object.defineProperty,Qe=Object.defineProperties,Xe=Object.getOwnPropertyDescriptor,qe=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,et=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var le=(r,t,e)=>t in r?Q(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Cr=(r,t)=>{for(var e in t||(t={}))me.call(t,e)&&le(r,e,t[e]);if(ne)for(var e of ne(t))Ee.call(t,e)&&le(r,e,t[e]);return r},$r=(r,t)=>Qe(r,qe(t));var Fr=r=>typeof r=="symbol"?r:r+"",Or=(r,t)=>{var e={};for(var n in r)me.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&ne)for(var n of ne(r))t.indexOf(n)<0&&Ee.call(r,n)&&(e[n]=r[n]);return e};var we=(r,t)=>()=>(r&&(t=r(r=0)),t);var Wr=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),tt=(r,t)=>{for(var e in t)Q(r,e,{get:t[e],enumerable:!0})},ve=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ke(t))!me.call(r,i)&&i!==e&&Q(r,i,{get:()=>t[i],enumerable:!(n=Xe(t,i))||n.enumerable});return r};var Vr=(r,t,e)=>(e=r!=null?Ze(et(r)):{},ve(t||!r||!r.__esModule?Q(e,"default",{value:r,enumerable:!0}):e,r)),Gr=r=>ve(Q({},"__esModule",{value:!0}),r);var h=(r,t,e)=>le(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 _e(r){if(B===setTimeout)return setTimeout(r,0);if((B===Ie||!B)&&setTimeout)return B=setTimeout,setTimeout(r,0);try{return B(r,0)}catch(t){try{return B.call(null,r,0)}catch(e){return B.call(this,r,0)}}}function rt(r){if(M===clearTimeout)return clearTimeout(r);if((M===Re||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(r);try{return M(r)}catch(t){try{return M.call(null,r)}catch(e){return M.call(this,r)}}}function nt(){!Z||!D||(Z=!1,D.length?P=D.concat(P):ie=-1,P.length&&ke())}function ke(){if(!Z){var r=_e(nt);Z=!0;for(var t=P.length;t;){for(D=P,P=[];++ie<t;)D&&D[ie].run();ie=-1,t=P.length}D=null,Z=!1,rt(r)}}function it(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];P.push(new Se(r,t)),P.length===1&&!Z&&_e(ke)}function Se(r,t){this.fun=r,this.array=t}function C(){}function At(r){throw new Error("process.binding is not supported")}function Et(){return"/"}function vt(r){throw new Error("process.chdir is not supported")}function Nt(){return 0}function Rt(r){var t=It.call(z)*.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 kt(){var r=new Date,t=r-_t;return t/1e3}var B,M,P,Z,D,ie,ot,st,at,ut,ft,ct,ht,pt,lt,mt,wt,dt,xt,yt,Tt,gt,z,It,_t,m,Ne,u=we(()=>{"use strict";B=Ie,M=Re;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);P=[],Z=!1,ie=-1;Se.prototype.run=function(){this.fun.apply(null,this.array)};ot="browser",st="browser",at=!0,ut={},ft=[],ct="",ht={},pt={},lt={};mt=C,wt=C,dt=C,xt=C,yt=C,Tt=C,gt=C;z=globalThis.performance||{},It=z.now||z.mozNow||z.msNow||z.oNow||z.webkitNow||function(){return new Date().getTime()};_t=new Date;m={nextTick:it,title:ot,browser:at,env:ut,argv:ft,version:ct,versions:ht,on:mt,addListener:wt,once:dt,off:xt,removeListener:yt,removeAllListeners:Tt,emit:gt,binding:At,cwd:Et,chdir:vt,umask:Nt,hrtime:Rt,platform:st,release:pt,config:lt,uptime:kt},Ne={};Object.keys(Ne).forEach(r=>{let t=r.split("."),e=m;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=Ne[r]:e=e[i]||(e[i]={})}})});function Le(){xe=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)_[t]=r[t],E[r.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Pt(r){xe||Le();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 St(c*3/4-o),n=o>0?c-4:c;var p=0;for(t=0,e=0;t<n;t+=4,e+=3)i=E[r.charCodeAt(t)]<<18|E[r.charCodeAt(t+1)]<<12|E[r.charCodeAt(t+2)]<<6|E[r.charCodeAt(t+3)],s[p++]=i>>16&255,s[p++]=i>>8&255,s[p++]=i&255;return o===2?(i=E[r.charCodeAt(t)]<<2|E[r.charCodeAt(t+1)]>>4,s[p++]=i&255):o===1&&(i=E[r.charCodeAt(t)]<<10|E[r.charCodeAt(t+1)]<<4|E[r.charCodeAt(t+2)]>>2,s[p++]=i>>8&255,s[p++]=i&255),s}function Ut(r){return _[r>>18&63]+_[r>>12&63]+_[r>>6&63]+_[r&63]}function bt(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(Ut(n));return i.join("")}function Pe(r){xe||Le();for(var t,e=r.length,n=e%3,i="",o=[],s=16383,c=0,p=e-n;c<p;c+=s)o.push(bt(r,c,c+s>p?p:c+s));return n===1?(t=r[e-1],i+=_[t>>2],i+=_[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=_[t>>10],i+=_[t>>4&63],i+=_[t<<2&63],i+="="),o.push(i),o.join("")}function oe(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(r,t){if(oe()<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 ye(this,r)}return Be(this,r,t,e)}function Be(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"?Bt(r,t,e):Yt(r,t)}function Me(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 Lt(r,t,e,n){return Me(t),t<=0?U(r,t):e!==void 0?typeof n=="string"?U(r,t).fill(e,n):U(r,t).fill(e):U(r,t)}function ye(r,t){if(Me(t),r=U(r,t<0?0:Te(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Bt(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=Ye(t,e)|0;r=U(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:Te(t.length)|0;r=U(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 Yt(r,t){if(k(t)){var e=Te(t.length)|0;return r=U(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||tr(t.length)?U(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 Te(r){if(r>=oe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe().toString(16)+" bytes");return r|0}function k(r){return!!(r!=null&&r._isBuffer)}function Ye(r,t){if(k(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 se(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Ve(r).length;default:if(n)return se(r).length;t=(""+t).toLowerCase(),n=!0}}function Dt(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 jt(this,t,e);case"utf8":case"utf-8":return $e(this,t,e);case"ascii":return Ht(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 $(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function De(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)),k(t))return t.length===0?-1:Ue(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):Ue(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Ue(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 p(A,j){return o===1?A[j]:A.readUInt16BE(j*o)}var w;if(i){var d=-1;for(w=e;w<s;w++)if(p(r,w)===p(t,d===-1?0:w-d)){if(d===-1&&(d=w),w-d+1===c)return d*o}else d!==-1&&(w-=w-d),d=-1}else for(e+c>s&&(e=s-c),w=e;w>=0;w--){for(var l=!0,I=0;I<c;I++)if(p(r,w+I)!==p(t,I)){l=!1;break}if(l)return w}return-1}function Ct(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 $t(r,t,e,n){return fe(se(t,r.length-e),r,e,n)}function Ce(r,t,e,n){return fe(Kt(t),r,e,n)}function Ft(r,t,e,n){return Ce(r,t,e,n)}function Ot(r,t,e,n){return fe(Ve(t),r,e,n)}function Wt(r,t,e,n){return fe(er(t,r.length-e),r,e,n)}function Vt(r,t,e){return t===0&&e===r.length?Pe(r):Pe(r.slice(t,e))}function $e(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 p,w,d,l;switch(c){case 1:o<128&&(s=o);break;case 2:p=r[i+1],(p&192)===128&&(l=(o&31)<<6|p&63,l>127&&(s=l));break;case 3:p=r[i+1],w=r[i+2],(p&192)===128&&(w&192)===128&&(l=(o&15)<<12|(p&63)<<6|w&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:p=r[i+1],w=r[i+2],d=r[i+3],(p&192)===128&&(w&192)===128&&(d&192)===128&&(l=(o&15)<<18|(p&63)<<12|(w&63)<<6|d&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 Gt(n)}function Gt(r){var t=r.length;if(t<=be)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=be));return e}function Ht(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 jt(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+=qt(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 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 T(r,t,e,n,i,o){if(!k(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 ae(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 ue(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 Fe(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 Oe(r,t,e,n,i){return i||Fe(r,t,e,4,34028234663852886e22,-34028234663852886e22),He(r,t,e,n,23,4),e+4}function We(r,t,e,n,i){return i||Fe(r,t,e,8,17976931348623157e292,-17976931348623157e292),He(r,t,e,n,52,8),e+8}function Qt(r){if(r=Xt(r).replace(Zt,""),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 qt(r){return r<16?"0"+r.toString(16):r.toString(16)}function se(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 Kt(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function er(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 Ve(r){return Pt(Qt(r))}function fe(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function tr(r){return r!==r}function rr(r){return r!=null&&(!!r._isBuffer||Ge(r)||nr(r))}function Ge(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function nr(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ge(r.slice(0,0))}function ce(r,t,e,n,i){var o,s,c=i*8-n-1,p=(1<<c)-1,w=p>>1,d=-7,l=e?i-1:0,I=e?-1:1,A=r[t+l];for(l+=I,o=A&(1<<-d)-1,A>>=-d,d+=c;d>0;o=o*256+r[t+l],l+=I,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+r[t+l],l+=I,d-=8);if(o===0)o=1-w;else{if(o===p)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-w}return(A?-1:1)*s*Math.pow(2,o-n)}function He(r,t,e,n,i,o){var s,c,p,w=o*8-i-1,d=(1<<w)-1,l=d>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,j=n?1:-1,ze=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=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-s))<1&&(s--,p*=2),s+l>=1?t+=I/p:t+=I*Math.pow(2,1-l),t*p>=2&&(s++,p/=2),s+l>=d?(c=0,s=d):s+l>=1?(c=(t*p-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+=j,c/=256,i-=8);for(s=s<<i|c,w+=i;w>0;r[e+A]=s&255,A+=j,s/=256,w-=8);r[e+A-j]|=ze*128}var _,E,St,xe,be,Zt,Je=we(()=>{"use strict";u();f();_=[],E=[],St=typeof Uint8Array!="undefined"?Uint8Array:Array,xe=!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 Be(null,r,t,e)};a.kMaxLength=oe();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 Lt(null,r,t,e)};a.allocUnsafe=function(r){return ye(null,r)};a.allocUnsafeSlow=function(r){return ye(null,r)};a.isBuffer=rr;a.compare=function(t,e){if(!k(t)||!k(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(!k(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};a.byteLength=Ye;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)$(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)$(this,e,e+3),$(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)$(this,e,e+7),$(this,e+1,e+6),$(this,e+2,e+5),$(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?$e(this,0,t):Dt.apply(this,arguments)};a.prototype.equals=function(t){if(!k(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(!k(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,p=Math.min(s,c),w=this.slice(i,o),d=t.slice(e,n),l=0;l<p;++l)if(w[l]!==d[l]){s=w[l],c=d[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 De(this,t,e,n,!0)};a.prototype.lastIndexOf=function(t,e,n){return De(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 Ct(this,t,e,n);case"utf8":case"utf-8":return $t(this,t,e,n);case"ascii":return Ce(this,t,e,n);case"latin1":case"binary":return Ft(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)}};be=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||y(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||y(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||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,n){t=t|0,e=e|0,n||y(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||y(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||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 n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(t,e){e||y(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||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),ce(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||y(t,4,this.length),ce(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||y(t,8,this.length),ce(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||y(t,8,this.length),ce(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;T(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;T(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||T(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||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ae(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ae(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(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);T(this,t,e,n,o-1,-o)}var s=0,c=1,p=0;for(this[e]=t&255;++s<n&&(c*=256);)t<0&&p===0&&this[e+s-1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&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);T(this,t,e,n,o-1,-o)}var s=n-1,c=1,p=0;for(this[e+s]=t&255;--s>=0&&(c*=256);)t<0&&p===0&&this[e+s+1]!==0&&(p=1),this[e+s]=(t/c>>0)-p&255;return e+n};a.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||T(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||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ae(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ae(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||T(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):ue(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,n){return Oe(this,t,e,!0,n)};a.prototype.writeFloatBE=function(t,e,n){return Oe(this,t,e,!1,n)};a.prototype.writeDoubleLE=function(t,e,n){return We(this,t,e,!0,n)};a.prototype.writeDoubleBE=function(t,e,n){return We(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=k(t)?t:se(new a(t,i).toString()),p=c.length;for(s=0;s<n-e;++s)this[s+e]=c[s%p]}return this};Zt=/[^+\/0-9A-Za-z-_]/g});var f=we(()=>{"use strict";Je()});u();f();function X(r){throw new Error("Unexpected value: "+JSON.stringify(r))}u();f();u();f();function ir(r){return Object.keys(r)}u();f();u();f();u();f();function q(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 or="sdk";function sr({config:r,customConfig:t}){let e=ur({config:r}),n=ar({config:r,customConfig:t});return e!=null?cr({importPath:n,majorVersion:e}):n}function ar({config:r,customConfig:t}){var e,n,i;return(i=(n=t==null?void 0:t.importPath)!=null?n:(e=t==null?void 0:t.module)==null?void 0:e.path)!=null?i:r.output.mode.type==="github"?hr(r.output.mode.repoUrl,"https://"):or}function ur({config:r}){let t=fr({config:r});if(!(t==null||t==="v0"||t==="v1"))return`${t}`}function fr({config:r}){let t=pr(r);if(t==null)return;let e=t.split(".");if(e[0]==null)return;let n=e[0];return n.startsWith("v")?n:`v${n}`}function cr({importPath:r,majorVersion:t}){return q(r)===t?r:`${r}/${t}`}function hr(r,t){return r.startsWith(t)?r.slice(t.length):r}function pr(r){var e;let t=(e=r==null?void 0:r.output)==null?void 0:e.mode;if(t!=null)return t.type==="github"||t.type==="publish"?t.version:void 0}var Ae={};tt(Ae,{AstNode:()=>x,CodeBlock:()=>S,Enum:()=>W,Field:()=>V,Func:()=>G,FuncInvocation:()=>R,Method:()=>b,MethodInvocation:()=>L,Parameter:()=>H,Struct:()=>J,Type:()=>re,TypeInstantiation:()=>N,TypeReference:()=>g,Writer:()=>O,codeblock:()=>kr,enum_:()=>Sr,field:()=>Pr,func:()=>Ur,invokeFunc:()=>br,invokeMethod:()=>Lr,method:()=>Br,parameter:()=>Mr,struct:()=>Yr,typeReference:()=>Dr});u();f();u();f();u();f();u();f();u();f();var F=class{};u();f();u();f();var Y=class extends F{constructor(e){super();h(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var lr=4,K=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
2
|
`),n=e?t.substring(0,t.length-1):t,i=this.getIndentString(),o=n.replaceAll(`
|
|
3
3
|
`,`
|
|
4
4
|
${i}`);this.isAtStartOfLine()&&(o=i+o),e&&(o+=`
|
|
5
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 Y(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new Y(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
|
-
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&n(s)}}}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*lr)}};u();f();var he=class{},ee=class extends he{async format(t){return t}formatSync(t){return t}};u();f();function ge(r){return(r==null?void 0:r.name)!=null}u();f();u();f();u();f();var mr=/[^0-9a-zA-Z_]/g,O=class extends K{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 ee}addImport(e){let n=this.imports[e];if(n!=null)return n;let i=this.getValidAlias(q(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(mr,"")}};var te=class extends O{constructor({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){super({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o})}async
|
|
9
|
-
${t}`)}return t}
|
|
7
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&n(s)}}}toString(){return this.buffer}writeInternal(t){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*lr)}};u();f();var he=class{},ee=class extends he{async format(t){return t}formatSync(t){return t}};u();f();function ge(r){return(r==null?void 0:r.name)!=null}u();f();u();f();u();f();var mr=/[^0-9a-zA-Z_]/g,O=class extends K{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 ee}addImport(e){let n=this.imports[e];if(n!=null)return n;let i=this.getValidAlias(q(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(mr,"")}};var te=class extends O{constructor({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){super({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
|
|
9
|
+
${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Go file: ${e}
|
|
10
10
|
${t}`)}return t}getContent(){let t=`package ${this.packageName}
|
|
11
11
|
|
|
12
12
|
`,e=this.stringifyImports();return e.length>0?`${t}${e}
|
|
@@ -14,9 +14,9 @@ ${t}`)}return t}getContent(){let t=`package ${this.packageName}
|
|
|
14
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 x=class extends F{async
|
|
18
|
-
`).forEach(n=>{e.writeLine(`// ${n}`)})}};var W=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 v({docs:this.docs})),e.write(`type ${this.name} string`)}};u();f();var V=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 v({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();f();u();f();var
|
|
19
|
-
`)?`\`${this.internalType.value}\``:`"${this.internalType.value}"`);break;case"struct":this.writeStruct({writer:e,struct:this.internalType});break;case"uuid":e.writeNode(Tr({value:this.internalType.value}));break;default:X(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=gr({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(wr.has(n.internalType.type)){e.writeNode(dr({writer:e,type:n}));return}if(je.has(n.internalType.type)){n.write(e);return}if(n.internalType.type==="enum"){e.writeNode(new
|
|
17
|
+
)`:""}};var x=class extends F{async toStringAsync({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new te({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toStringAsync()}toString({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o}){let s=new te({packageName:t,rootImportPath:e,importPath:n,customConfig:i,formatter:o});return this.write(s),s.toString()}};var S=class extends x{constructor(e){super();h(this,"arg");this.arg=e}write(e){return new Y(this.arg).write(e)}};u();f();u();f();var v=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 W=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 v({docs:this.docs})),e.write(`type ${this.name} string`)}};u();f();var V=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 v({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();f();u();f();var b=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 v({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 G=class extends x{constructor({name:e,parameters:n,return_:i,body:o,docs:s}){super();h(this,"func");this.func=new b({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();f();u();f();u();f();u();f();var g=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();f();var L=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),pe({writer:e,arguments_:this.arguments_})}};var wr=new Set(["bool","date","dateTime","float64","int","int64","string","uuid"]),je=new Set(["any","bytes","map","slice"]),N=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(yr({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(Tr({value:this.internalType.value}));break;default:X(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=gr({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(wr.has(n.internalType.type)){e.writeNode(dr({writer:e,type:n}));return}if(je.has(n.internalType.type)){n.write(e);return}if(n.internalType.type==="enum"){e.writeNode(new L({on:n.internalType.typeReference,method:"Ptr",arguments_:[]}));return}e.write("&"),n.write(e)}static isAlreadyOptional(e){return e.internalType.type==="optional"||je.has(e.internalType.type)}writeSlice({writer:e,slice:n}){e.write("[]"),e.writeNode(n.valueType);let i=Er({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=Ar({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 dr({writer:r,type:t}){return new R({func:new g({name:xr({type:t}),importPath:r.rootImportPath}),arguments_:[t]})}function xr({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 yr({writer:r,type:t}){let e=t instanceof Date?"MustParseDate":"MustParseDateTime";return new R({func:new g({name:e,importPath:r.rootImportPath}),arguments_:[new S(`"${t.value}"`)]})}function Tr({value:r}){return new R({func:new g({name:"MustParse",importPath:"github.com/google/uuid"}),arguments_:[new S(`"${r}"`)]})}function gr({entries:r}){return r.filter(t=>!N.isNop(t.key)&&!N.isNop(t.value))}function Ar({fields:r}){return r.filter(t=>!N.isNop(t.value))}function Er({values:r}){return r.filter(t=>!N.isNop(t))}function pe({writer:r,arguments_:t}){let e=Nr(t);if(e.length===0){r.write("()");return}r.writeLine("("),r.indent();for(let n of e)vr({writer:r,argument:n}),r.writeLine(",");r.dedent(),r.write(")")}function vr({writer:r,argument:t}){ge(t)?t.assignment.write(r):t.write(r)}function Nr(r){return r.filter(t=>!(t instanceof N&&N.isNop(t)))}var R=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),pe({writer:e,arguments_:this.arguments_})}};u();f();var H=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 v({docs:this.docs})),e.write(`${this.name} `),this.type.write(e)}};u();f();var J=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 v({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();f();var Ir=new Set(["any","bytes","map","slice"]),re=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(Rr);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(_r);break;default:X(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"||Ir.has(e.internalType.type)}},Rr=new g({importPath:"time",name:"Time"}),_r=new g({importPath:"github.com/google/uuid",name:"UUID"});function kr(r){return new S(r)}function Sr(r){return new W(r)}function Pr(r){return new V(r)}function Ur(r){return new G(r)}function br(r){return new R(r)}function Lr(r){return new L(r)}function Br(r){return new b(r)}function Mr(r){return new H(r)}function Yr(r){return new J(r)}function Dr(r){return new g(r)}u();f();export{Cr as a,$r as b,Fr as c,Or as d,we as e,Wr as f,tt as g,Vr as h,Gr as i,h as j,u as k,a as l,f as m,X as n,ir as o,sr as p,Ae as q};
|
|
20
20
|
/*! Bundled license information:
|
|
21
21
|
|
|
22
22
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as s,e as c}from"./chunk-J745U74Q.js";import{j as f,k as F,m as P,n as u,q as n}from"./chunk-TUE3DOHS.js";F();P();var v="example",x="fern",B="do",R="client",A=class{constructor({context:e,formatter:t}){f(this,"context");f(this,"formatter");this.context=e,this.formatter=t}async generateSnippet({endpoint:e,request:t}){var o;return await this.buildCodeBlock({endpoint:e,snippet:t}).toStringAsync({packageName:v,importPath:x,rootImportPath:this.context.rootImportPath,customConfig:(o=this.context.customConfig)!=null?o:{},formatter:this.formatter})}generateSnippetSync({endpoint:e,request:t}){var o;return this.buildCodeBlock({endpoint:e,snippet:t}).toString({packageName:v,importPath:x,rootImportPath:this.context.rootImportPath,customConfig:(o=this.context.customConfig)!=null?o:{},formatter:this.formatter})}buildCodeBlock({endpoint:e,snippet:t}){return n.func({name:B,parameters:[],return_:[],body:n.codeblock(r=>{r.writeNode(this.constructClient({endpoint:e,snippet:t})),r.writeLine(),r.writeNode(this.callMethod({endpoint:e,snippet:t}))})})}constructClient({endpoint:e,snippet:t}){return n.codeblock(r=>{r.write(`${R} := `),r.writeNode(this.getRootClientFuncInvocation(this.getConstructorArgs({endpoint:e,snippet:t})))})}callMethod({endpoint:e,snippet:t}){return n.invokeMethod({on:n.codeblock(R),method:this.getMethod({endpoint:e}),arguments_:[this.context.getContextTodoFunctionInvocation(),...this.getMethodArgs({endpoint:e,snippet:t})]})}getConstructorArgs({endpoint:e,snippet:t}){let r=[],o=this.getConstructorBaseUrlArg({baseUrl:t.baseURL,environment:t.environment});return o!=null&&r.push(o),e.auth!=null&&(t.auth!=null?r.push(this.getConstructorAuthArg({auth:e.auth,values:t.auth})):this.context.errors.add({severity:s.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`})),this.context.errors.scope(c.Headers),this.context.ir.headers!=null&&t.headers!=null&&r.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:t.headers})),this.context.errors.unscope(),r}getConstructorAuthArg({auth:e,values:t}){switch(e.type){case"basic":return t.type!=="basic"?(this.context.errors.add({severity:s.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),n.TypeInstantiation.nop()):this.getConstructorBasicAuthArg({auth:e,values:t});case"bearer":return t.type!=="bearer"?(this.context.errors.add({severity:s.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),n.TypeInstantiation.nop()):this.getConstructorBearerAuthArg({auth:e,values:t});case"header":return t.type!=="header"?(this.context.errors.add({severity:s.Critical,message:this.context.newAuthMismatchError({auth:e,values:t}).message}),n.TypeInstantiation.nop()):this.getConstructorHeaderAuthArg({auth:e,values:t});default:u(e)}}getConstructorBasicAuthArg({auth:e,values:t}){return n.codeblock(r=>{r.writeNode(n.invokeFunc({func:n.typeReference({name:"WithBasicAuth",importPath:this.context.getOptionImportPath()}),arguments_:[n.TypeInstantiation.string(t.username),n.TypeInstantiation.string(t.password)]}))})}getConstructorBaseUrlArg({baseUrl:e,environment:t}){let r=this.getBaseUrlArg({baseUrl:e,environment:t});if(r!=null)return n.codeblock(o=>{o.writeNode(n.invokeFunc({func:n.typeReference({name:"WithBaseURL",importPath:this.context.getOptionImportPath()}),arguments_:[r]}))})}getBaseUrlArg({baseUrl:e,environment:t}){if(e!=null&&t!=null){this.context.errors.add({severity:s.Critical,message:"Cannot specify both baseUrl and environment options"});return}if(e!=null)return n.TypeInstantiation.string(e);if(t!=null){if(this.context.isSingleEnvironmentID(t)){let r=this.context.getEnvironmentTypeReferenceFromID(t);if(r==null){this.context.errors.add({severity:s.Warning,message:`Environment ${JSON.stringify(t)} was not found`});return}return n.TypeInstantiation.reference(r)}this.context.isMultiEnvironmentValues(t)&&this.context.errors.add({severity:s.Warning,message:"The Go SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}}getConstructorBearerAuthArg({auth:e,values:t}){return n.codeblock(r=>{r.writeNode(n.invokeFunc({func:n.typeReference({name:`With${e.token.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[n.TypeInstantiation.string(t.token)]}))})}getConstructorHeaderAuthArg({auth:e,values:t}){return n.codeblock(r=>{r.writeNode(n.invokeFunc({func:n.typeReference({name:`With${e.header.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.header.typeReference,value:t.value})]}))})}getConstructorHeaderArgs({headers:e,values:t}){let r=[];for(let o of e){let i=this.getConstructorHeaderArg({header:o,value:t.value});i!=null&&r.push(i)}return r}getConstructorHeaderArg({header:e,value:t}){let r=this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.typeReference,value:t});if(!n.TypeInstantiation.isNop(r))return n.codeblock(o=>{o.writeNode(n.invokeFunc({func:n.typeReference({name:`With${e.name.name.pascalCase.unsafeName}`,importPath:this.context.getOptionImportPath()}),arguments_:[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:u(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:t}){let r=[];if(this.context.errors.scope(c.PathParameters),e.pathParameters!=null){let o=this.getPathParameters({namedParameters:e.pathParameters,snippet:t});r.push(...o.map(i=>i.value))}return this.context.errors.unscope(),this.context.errors.scope(c.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.dynamicTypeInstantiationMapper.convert({typeReference:e.value,value:t});default:u(e)}}getBytesBodyRequestArg({value:e}){return typeof e!="string"?(this.context.errors.add({severity:s.Critical,message:`Expected bytes value to be a string, got ${typeof e}`}),n.TypeInstantiation.nop()):n.TypeInstantiation.bytes(e)}getMethodArgsForInlinedRequest({request:e,snippet:t}){var l,y,p,h;let r=[],{inlinePathParameters:o,inlineFileProperties:i}={inlinePathParameters:(y=(l=this.context.customConfig)==null?void 0:l.inlinePathParameters)!=null?y:!1,inlineFileProperties:(h=(p=this.context.customConfig)==null?void 0:p.inlineFileProperties)!=null?h:!1};this.context.errors.scope(c.PathParameters);let a=[];e.pathParameters!=null&&a.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:t})),this.context.errors.unscope(),this.context.errors.scope(c.RequestBody);let g=this.getFilePropertyInfo({request:e,snippet:t});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:o})||r.push(...a.map(d=>d.value)),i||r.push(...g.fileFields.map(d=>d.value)),this.context.needsRequestParameter({request:e,inlinePathParameters:o,inlineFileProperties:i})&&r.push(this.getInlinedRequestArg({request:e,snippet:t,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:o})?a:[],filePropertyInfo:g})),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:o}){var p,h,d,I;this.context.errors.scope(c.QueryParameters);let a=this.context.associateQueryParametersByWireValue({parameters:(p=e.queryParameters)!=null?p:[],values:(h=t.queryParameters)!=null?h:{}}).map(m=>({name:m.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(m)}));this.context.errors.unscope(),this.context.errors.scope(c.Headers);let l=this.context.associateByWireValue({parameters:(d=e.headers)!=null?d:[],values:(I=t.headers)!=null?I:{}}).map(m=>({name:m.name.name.pascalCase.unsafeName,value:this.context.dynamicTypeInstantiationMapper.convert(m)}));this.context.errors.unscope(),this.context.errors.scope(c.RequestBody);let y=e.body!=null?this.getInlinedRequestBodyStructFields({body:e.body,value:t.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),n.TypeInstantiation.structPointer({typeReference:n.typeReference({name:this.context.getMethodName(e.declaration.name),importPath:this.context.getImportPath(e.declaration.fernFilepath)}),fields:[...r,...a,...l,...y]})}getInlinedRequestBodyStructFields({body:e,value:t,filePropertyInfo:r}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyStructFields({parameters:e.value,value:t});case"referenced":return[this.getReferencedRequestBodyPropertyStructField({body:e,value:t})];case"fileUpload":return this.getFileUploadRequestBodyStructFields({filePropertyInfo:r});default:u(e)}}getFileUploadRequestBodyStructFields({filePropertyInfo:e}){var t;return(t=this.context.customConfig)!=null&&t.inlineFileProperties?[...e.fileFields,...e.bodyPropertyFields]:e.bodyPropertyFields}getReferencedRequestBodyPropertyStructField({body:e,value:t}){return{name:this.context.getTypeName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeInstantiation({body:e.bodyType,value:t})}}getReferencedRequestBodyPropertyTypeInstantiation({body:e,value:t}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:t});case"typeReference":return this.context.dynamicTypeInstantiationMapper.convert({typeReference:e.value,value:t});default:u(e)}}getInlinedRequestBodyPropertyStructFields({parameters:e,value:t}){var i;let r=[],o=this.context.associateByWireValue({parameters:e,values:(i=this.context.getRecord(t))!=null?i:{}});for(let a of o)r.push({name:this.context.getTypeName(a.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(a)});return r}getPathParameters({namedParameters:e,snippet:t}){var i;let r=[],o=this.context.associateByWireValue({parameters:e,values:(i=t.pathParameters)!=null?i:{}});for(let a of o)r.push({name:this.context.getTypeName(a.name.name),value:this.context.dynamicTypeInstantiationMapper.convert(a)});return r}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(t=>this.context.getMethodName(t)).join(".")}.${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientFuncInvocation(e){return n.invokeFunc({func:n.typeReference({name:this.context.getClientConstructorName(),importPath:this.context.getClientImportPath()}),arguments_:e})}};export{A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-X7QP3WH3.js";import{a as h}from"./chunk-5HP3T45N.js";import{a as f,d as a}from"./chunk-J745U74Q.js";import{j as c,k as d,m}from"./chunk-TUE3DOHS.js";d();m();var y=class extends f{constructor({ir:n,config:r,formatter:t}){super(new h({ir:n,config:r}));c(this,"formatter");this.formatter=t}async generate(n){let r=this.context.resolveEndpointLocationOrThrow(n.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${n.endpoint.method} ${n.endpoint.path}"`);let t=new a;for(let i of r){let o=this.context.clone(),p=new s({context:o,formatter:this.formatter});try{let e=await p.generateSnippet({endpoint:i,request:n});if(o.errors.empty())return{snippet:e,errors:void 0};t.update({context:o,snippet:e})}catch(e){t.err==null&&(t.err=e)}}return t.getResponseOrThrow({endpoint:n.endpoint})}generateSync(n){let r=this.context.resolveEndpointLocationOrThrow(n.endpoint);if(r.length===0)throw new Error(`No endpoints found that match "${n.endpoint.method} ${n.endpoint.path}"`);let t=new a;for(let i of r){let o=this.context.clone(),p=new s({context:o,formatter:this.formatter});try{let e=p.generateSnippetSync({endpoint:i,request:n});if(o.errors.empty())return{snippet:e,errors:void 0};t.update({context:o,snippet:e})}catch(e){t.err==null&&(t.err=e)}}return t.getResponseOrThrow({endpoint:n.endpoint})}};export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-5HP3T45N.js";import"../chunk-SS6XZXHU.js";import"../chunk-J745U74Q.js";import"../chunk-D3UUM672.js";import"../chunk-I3VUX77R.js";import"../chunk-TUE3DOHS.js";export{a as DynamicSnippetsGeneratorContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-SS6XZXHU.js";import"../chunk-J745U74Q.js";import"../chunk-TUE3DOHS.js";export{a as DynamicTypeInstantiationMapper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-D3UUM672.js";import"../chunk-TUE3DOHS.js";export{a as DynamicTypeMapper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-I3VUX77R.js";import"../chunk-TUE3DOHS.js";export{a as FilePropertyMapper};
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Hi}from"./chunk-IHGUMUOY.js";import"./chunk-25QU7TNW.js";import"./chunk-IMHG3M62.js";import"./chunk-45WV72IW.js";import"./chunk-WXCSO57K.js";import"./chunk-P4OQRDWB.js";import"./chunk-2GO4GGHE.js";import{e as ne,f as y,g as ki,h as zi,i as ji,k as o,l as s,m as i}from"./chunk-W5QUFHNP.js";var ht=y((Jl,vt)=>{"use strict";o();i();var Ji="Function.prototype.bind called on incompatible ",Ki=Object.prototype.toString,Qi=Math.max,Yi="[object Function]",gt=function(r,t){for(var n=[],u=0;u<r.length;u+=1)n[u]=r[u];for(var a=0;a<t.length;a+=1)n[a+r.length]=t[a];return n},Xi=function(r,t){for(var n=[],u=t||0,a=0;u<r.length;u+=1,a+=1)n[a]=r[u];return n},Zi=function(e,r){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=r);return t};vt.exports=function(r){var t=this;if(typeof t!="function"||Ki.apply(t)!==Yi)throw new TypeError(Ji+t);for(var n=Xi(arguments,1),u,a=function(){if(this instanceof u){var v=t.apply(this,gt(n,arguments));return Object(v)===v?v:this}return t.apply(r,gt(n,arguments))},f=Qi(0,t.length-n.length),c=[],l=0;l<f;l++)c[l]="$"+l;if(u=Function("binder","return function ("+Zi(c,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var m=function(){};m.prototype=t.prototype,u.prototype=new m,m.prototype=null}return u}});var Or=y((Yl,dt)=>{"use strict";o();i();var Vi=ht();dt.exports=Function.prototype.bind||Vi});var St=y((Vl,mt)=>{"use strict";o();i();mt.exports=Error});var wt=y((ts,bt)=>{"use strict";o();i();bt.exports=EvalError});var Ot=y((is,At)=>{"use strict";o();i();At.exports=RangeError});var xt=y((fs,qt)=>{"use strict";o();i();qt.exports=ReferenceError});var oe=y((ps,$t)=>{"use strict";o();i();$t.exports=SyntaxError});var w=y((gs,Et)=>{"use strict";o();i();Et.exports=TypeError});var It=y((ds,Pt)=>{"use strict";o();i();Pt.exports=URIError});var ie=y((bs,Tt)=>{"use strict";o();i();Tt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var u=42;r[t]=u;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var a=Object.getOwnPropertySymbols(r);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,t);if(f.value!==u||f.enumerable!==!0)return!1}return!0}});var ae=y((Os,Rt)=>{"use strict";o();i();var Ft=typeof Symbol!="undefined"&&Symbol,ra=ie();Rt.exports=function(){return typeof Ft!="function"||typeof Symbol!="function"||typeof Ft("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ra()}});var Dt=y(($s,Nt)=>{"use strict";o();i();var ue={__proto__:null,foo:{}},ea=Object;Nt.exports=function(){return{__proto__:ue}.foo===ue.foo&&!(ue instanceof ea)}});var Bt=y((Is,_t)=>{"use strict";o();i();var ta=Function.prototype.call,na=Object.prototype.hasOwnProperty,oa=Or();_t.exports=oa.call(ta,na)});var E=y((Rs,Lt)=>{"use strict";o();i();var d,ia=St(),aa=wt(),ua=Ot(),fa=xt(),Z=oe(),X=w(),la=It(),Wt=Function,fe=function(e){try{return Wt('"use strict"; return ('+e+").constructor;")()}catch(r){}},G=Object.getOwnPropertyDescriptor;if(G)try{G({},"")}catch(e){G=null}var le=function(){throw new X},sa=G?function(){try{return arguments.callee,le}catch(e){try{return G(arguments,"callee").get}catch(r){return le}}}():le,Q=ae()(),pa=Dt()(),b=Object.getPrototypeOf||(pa?function(e){return e.__proto__}:null),Y={},ca=typeof Uint8Array=="undefined"||!b?d:b(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?d:ArrayBuffer,"%ArrayIteratorPrototype%":Q&&b?b([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":Y,"%AsyncGenerator%":Y,"%AsyncGeneratorFunction%":Y,"%AsyncIteratorPrototype%":Y,"%Atomics%":typeof Atomics=="undefined"?d:Atomics,"%BigInt%":typeof BigInt=="undefined"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ia,"%eval%":eval,"%EvalError%":aa,"%Float32Array%":typeof Float32Array=="undefined"?d:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?d:FinalizationRegistry,"%Function%":Wt,"%GeneratorFunction%":Y,"%Int8Array%":typeof Int8Array=="undefined"?d:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?d:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Q&&b?b(b([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map=="undefined"?d:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Q||!b?d:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?d:Promise,"%Proxy%":typeof Proxy=="undefined"?d:Proxy,"%RangeError%":ua,"%ReferenceError%":fa,"%Reflect%":typeof Reflect=="undefined"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?d:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Q||!b?d:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Q&&b?b(""[Symbol.iterator]()):d,"%Symbol%":Q?Symbol:d,"%SyntaxError%":Z,"%ThrowTypeError%":sa,"%TypedArray%":ca,"%TypeError%":X,"%Uint8Array%":typeof Uint8Array=="undefined"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?d:Uint32Array,"%URIError%":la,"%WeakMap%":typeof WeakMap=="undefined"?d:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?d:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?d:WeakSet};if(b)try{null.error}catch(e){Mt=b(b(e)),k["%Error.prototype%"]=Mt}var Mt,ya=function e(r){var t;if(r==="%AsyncFunction%")t=fe("async function () {}");else if(r==="%GeneratorFunction%")t=fe("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=fe("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var u=e("%AsyncGenerator%");u&&b&&(t=b(u.prototype))}return k[r]=t,t},Ct={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ar=Or(),qr=Bt(),ga=ar.call(Function.call,Array.prototype.concat),va=ar.call(Function.apply,Array.prototype.splice),Ut=ar.call(Function.call,String.prototype.replace),xr=ar.call(Function.call,String.prototype.slice),ha=ar.call(Function.call,RegExp.prototype.exec),da=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ma=/\\(\\)?/g,Sa=function(r){var t=xr(r,0,1),n=xr(r,-1);if(t==="%"&&n!=="%")throw new Z("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Z("invalid intrinsic syntax, expected opening `%`");var u=[];return Ut(r,da,function(a,f,c,l){u[u.length]=c?Ut(l,ma,"$1"):f||a}),u},ba=function(r,t){var n=r,u;if(qr(Ct,n)&&(u=Ct[n],n="%"+u[0]+"%"),qr(k,n)){var a=k[n];if(a===Y&&(a=ya(n)),typeof a=="undefined"&&!t)throw new X("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:u,name:n,value:a}}throw new Z("intrinsic "+r+" does not exist!")};Lt.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new X("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new X('"allowMissing" argument must be a boolean');if(ha(/^%?[^%]*%?$/,r)===null)throw new Z("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Sa(r),u=n.length>0?n[0]:"",a=ba("%"+u+"%",t),f=a.name,c=a.value,l=!1,m=a.alias;m&&(u=m[0],va(n,ga([0,1],m)));for(var v=1,h=!0;v<n.length;v+=1){var g=n[v],A=xr(g,0,1),x=xr(g,-1);if((A==='"'||A==="'"||A==="`"||x==='"'||x==="'"||x==="`")&&A!==x)throw new Z("property names with quotes must have matching quotes");if((g==="constructor"||!h)&&(l=!0),u+="."+g,f="%"+u+"%",qr(k,f))c=k[f];else if(c!=null){if(!(g in c)){if(!t)throw new X("base intrinsic for "+r+" exists, but the property is not available.");return}if(G&&v+1>=n.length){var S=G(c,g);h=!!S,h&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[g]}else h=qr(c,g),c=c[g];h&&!l&&(k[f]=c)}}return c}});var Er=y((_s,Gt)=>{"use strict";o();i();var wa=E(),$r=wa("%Object.defineProperty%",!0)||!1;if($r)try{$r({},"a",{value:1})}catch(e){$r=!1}Gt.exports=$r});var se=y((Cs,kt)=>{"use strict";o();i();var Aa=E(),Pr=Aa("%Object.getOwnPropertyDescriptor%",!0);if(Pr)try{Pr([],"length")}catch(e){Pr=null}kt.exports=Pr});var pe=y((Ls,Ht)=>{"use strict";o();i();var zt=Er(),Oa=oe(),V=w(),jt=se();Ht.exports=function(r,t,n){if(!r||typeof r!="object"&&typeof r!="function")throw new V("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new V("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new V("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new V("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new V("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new V("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!jt&&jt(r,t);if(zt)zt(r,t,{configurable:f===null&&l?l.configurable:!f,enumerable:u===null&&l?l.enumerable:!u,value:n,writable:a===null&&l?l.writable:!a});else if(c||!u&&!a&&!f)r[t]=n;else throw new Oa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ye=y((zs,Kt)=>{"use strict";o();i();var ce=Er(),Jt=function(){return!!ce};Jt.hasArrayLengthDefineBug=function(){if(!ce)return null;try{return ce([],"length",{value:1}).length!==1}catch(r){return!0}};Kt.exports=Jt});var Vt=y((Js,Zt)=>{"use strict";o();i();var qa=E(),Qt=pe(),xa=ye()(),Yt=se(),Xt=w(),$a=qa("%Math.floor%");Zt.exports=function(r,t){if(typeof r!="function")throw new Xt("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||$a(t)!==t)throw new Xt("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],u=!0,a=!0;if("length"in r&&Yt){var f=Yt(r,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(a=!1)}return(u||a||!n)&&(xa?Qt(r,"length",t,!0,!0):Qt(r,"length",t)),r}});var Fr=y((Ys,Ir)=>{"use strict";o();i();var ge=Or(),Tr=E(),Ea=Vt(),Pa=w(),tn=Tr("%Function.prototype.apply%"),nn=Tr("%Function.prototype.call%"),on=Tr("%Reflect.apply%",!0)||ge.call(nn,tn),rn=Er(),Ia=Tr("%Math.max%");Ir.exports=function(r){if(typeof r!="function")throw new Pa("a function is required");var t=on(ge,nn,arguments);return Ea(t,1+Ia(0,r.length-(arguments.length-1)),!0)};var en=function(){return on(ge,tn,arguments)};rn?rn(Ir.exports,"apply",{value:en}):Ir.exports.apply=en});var ve=y((Vs,un)=>{"use strict";o();i();var an=Object.prototype.toString;un.exports=function(r){var t=an.call(r),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&an.call(r.callee)==="[object Function]"),n}});var hn=y((tp,vn)=>{"use strict";o();i();var gn;Object.keys||(ur=Object.prototype.hasOwnProperty,he=Object.prototype.toString,fn=ve(),de=Object.prototype.propertyIsEnumerable,ln=!de.call({toString:null},"toString"),sn=de.call(function(){},"prototype"),fr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Rr=function(e){var r=e.constructor;return r&&r.prototype===e},pn={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},cn=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!pn["$"+e]&&ur.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Rr(window[e])}catch(r){return!0}}catch(r){return!0}return!1}(),yn=function(e){if(typeof window=="undefined"||!cn)return Rr(e);try{return Rr(e)}catch(r){return!1}},gn=function(r){var t=r!==null&&typeof r=="object",n=he.call(r)==="[object Function]",u=fn(r),a=t&&he.call(r)==="[object String]",f=[];if(!t&&!n&&!u)throw new TypeError("Object.keys called on a non-object");var c=sn&&n;if(a&&r.length>0&&!ur.call(r,0))for(var l=0;l<r.length;++l)f.push(String(l));if(u&&r.length>0)for(var m=0;m<r.length;++m)f.push(String(m));else for(var v in r)!(c&&v==="prototype")&&ur.call(r,v)&&f.push(String(v));if(ln)for(var h=yn(r),g=0;g<fr.length;++g)!(h&&fr[g]==="constructor")&&ur.call(r,fr[g])&&f.push(fr[g]);return f});var ur,he,fn,de,ln,sn,fr,Rr,pn,cn,yn;vn.exports=gn});var bn=y((ip,Sn)=>{"use strict";o();i();var Ta=Array.prototype.slice,Fa=ve(),dn=Object.keys,Nr=dn?function(r){return dn(r)}:hn(),mn=Object.keys;Nr.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(n){return Fa(n)?mn(Ta.call(n)):mn(n)})}else Object.keys=Nr;return Object.keys||Nr};Sn.exports=Nr});var lr=y((fp,qn)=>{"use strict";o();i();var Ra=bn(),Na=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Da=Object.prototype.toString,_a=Array.prototype.concat,wn=pe(),Ba=function(e){return typeof e=="function"&&Da.call(e)==="[object Function]"},An=ye()(),Ma=function(e,r,t,n){if(r in e){if(n===!0){if(e[r]===t)return}else if(!Ba(n)||!n())return}An?wn(e,r,t,!0):wn(e,r,t)},On=function(e,r){var t=arguments.length>2?arguments[2]:{},n=Ra(r);Na&&(n=_a.call(n,Object.getOwnPropertySymbols(r)));for(var u=0;u<n.length;u+=1)Ma(e,n[u],r[n[u]],t[n[u]])};On.supportsDescriptors=!!An;qn.exports=On});var P=y((pp,En)=>{"use strict";o();i();var xn=E(),$n=Fr(),Ca=$n(xn("String.prototype.indexOf"));En.exports=function(r,t){var n=xn(r,!!t);return typeof n=="function"&&Ca(r,".prototype.")>-1?$n(n):n}});var Tn=y((gp,In)=>{"use strict";o();i();var Ua=E(),Pn=Ua("%Array%"),Wa=!Pn.isArray&&P()("Object.prototype.toString");In.exports=Pn.isArray||function(r){return Wa(r)==="[object Array]"}});var me=y((dp,Fn)=>{"use strict";o();i();Fn.exports=Tn()});var Nn=y((bp,Rn)=>{"use strict";o();i();var La=E(),Ga=P(),ka=w(),za=me(),ja=La("%Reflect.apply%",!0)||Ga("Function.prototype.apply");Rn.exports=function(r,t){var n=arguments.length>2?arguments[2]:[];if(!za(n))throw new ka("Assertion failed: optional `argumentsList`, if provided, must be a List");return ja(r,t,n)}});function Dn(){throw new Error("setTimeout has not been defined")}function _n(){throw new Error("clearTimeout has not been defined")}function Bn(e){if(M===setTimeout)return setTimeout(e,0);if((M===Dn||!M)&&setTimeout)return M=setTimeout,setTimeout(e,0);try{return M(e,0)}catch(r){try{return M.call(null,e,0)}catch(t){return M.call(this,e,0)}}}function Ha(e){if(C===clearTimeout)return clearTimeout(e);if((C===_n||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(e);try{return C(e)}catch(r){try{return C.call(null,e)}catch(t){return C.call(this,e)}}}function Ja(){!er||!z||(er=!1,z.length?N=z.concat(N):Dr=-1,N.length&&Mn())}function Mn(){if(!er){var e=Bn(Ja);er=!0;for(var r=N.length;r;){for(z=N,N=[];++Dr<r;)z&&z[Dr].run();Dr=-1,r=N.length}z=null,er=!1,Ha(e)}}function Ka(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];N.push(new Cn(e,r)),N.length===1&&!er&&Bn(Mn)}function Cn(e,r){this.fun=e,this.array=r}function j(){}function pu(e){throw new Error("process.binding is not supported")}function cu(){return"/"}function yu(e){throw new Error("process.chdir is not supported")}function gu(){return 0}function hu(e){var r=vu.call(rr)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}function mu(){var e=new Date,r=e-du;return r/1e3}var M,C,N,er,z,Dr,Qa,Ya,Xa,Za,Va,ru,eu,tu,nu,ou,iu,au,uu,fu,lu,su,rr,vu,du,Su,sr,Un=ne(()=>{"use strict";o();i();M=Dn,C=_n;typeof globalThis.setTimeout=="function"&&(M=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);N=[],er=!1,Dr=-1;Cn.prototype.run=function(){this.fun.apply(null,this.array)};Qa="browser",Ya="browser",Xa=!0,Za={},Va=[],ru="",eu={},tu={},nu={};ou=j,iu=j,au=j,uu=j,fu=j,lu=j,su=j;rr=globalThis.performance||{},vu=rr.now||rr.mozNow||rr.msNow||rr.oNow||rr.webkitNow||function(){return new Date().getTime()};du=new Date;Su={nextTick:Ka,title:Qa,browser:Xa,env:Za,argv:Va,version:ru,versions:eu,on:ou,addListener:iu,once:au,off:uu,removeListener:fu,removeAllListeners:lu,emit:su,binding:pu,cwd:cu,chdir:yu,umask:gu,hrtime:hu,platform:Ya,release:tu,config:nu,uptime:mu},sr=Su});var Se,be,Wn=ne(()=>{"use strict";o();i();typeof Object.create=="function"?Se=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Se=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};be=Se});var Kn={};ki(Kn,{_extend:()=>Ie,debuglog:()=>Ln,default:()=>Iu,deprecate:()=>xe,format:()=>Cr,inherits:()=>be,inspect:()=>T,isArray:()=>$e,isBoolean:()=>Ur,isBuffer:()=>jn,isDate:()=>Mr,isError:()=>cr,isFunction:()=>yr,isNull:()=>gr,isNullOrUndefined:()=>Gn,isNumber:()=>Ee,isObject:()=>H,isPrimitive:()=>zn,isRegExp:()=>pr,isString:()=>vr,isSymbol:()=>kn,isUndefined:()=>I,log:()=>Hn});function Cr(e){if(!vr(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(T(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,u=n.length,a=String(e).replace(bu,function(c){if(c==="%%")return"%";if(t>=u)return c;switch(c){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(l){return"[Circular]"}default:return c}}),f=n[t];t<u;f=n[++t])gr(f)||!H(f)?a+=" "+f:a+=" "+T(f);return a}function xe(e,r){if(I(globalThis.process))return function(){return xe(e,r).apply(this,arguments)};if(sr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(sr.throwDeprecation)throw new Error(r);sr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}function Ln(e){if(I(we)&&(we=sr.env.NODE_DEBUG||""),e=e.toUpperCase(),!_r[e])if(new RegExp("\\b"+e+"\\b","i").test(we)){var r=0;_r[e]=function(){var t=Cr.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else _r[e]=function(){};return _r[e]}function T(e,r){var t={seen:[],stylize:Au};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Ur(r)?t.showHidden=r:r&&Ie(t,r),I(t.showHidden)&&(t.showHidden=!1),I(t.depth)&&(t.depth=2),I(t.colors)&&(t.colors=!1),I(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=wu),Br(t,e,t.depth)}function wu(e,r){var t=T.styles[r];return t?"\x1B["+T.colors[t][0]+"m"+e+"\x1B["+T.colors[t][1]+"m":e}function Au(e,r){return e}function Ou(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Br(e,r,t){if(e.customInspect&&r&&yr(r.inspect)&&r.inspect!==T&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return vr(n)||(n=Br(e,n,t)),n}var u=qu(e,r);if(u)return u;var a=Object.keys(r),f=Ou(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),cr(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Ae(r);if(a.length===0){if(yr(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(pr(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(Mr(r))return e.stylize(Date.prototype.toString.call(r),"date");if(cr(r))return Ae(r)}var l="",m=!1,v=["{","}"];if($e(r)&&(m=!0,v=["[","]"]),yr(r)){var h=r.name?": "+r.name:"";l=" [Function"+h+"]"}if(pr(r)&&(l=" "+RegExp.prototype.toString.call(r)),Mr(r)&&(l=" "+Date.prototype.toUTCString.call(r)),cr(r)&&(l=" "+Ae(r)),a.length===0&&(!m||r.length==0))return v[0]+l+v[1];if(t<0)return pr(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var g;return m?g=xu(e,r,t,f,a):g=a.map(function(A){return qe(e,r,t,f,A,m)}),e.seen.pop(),$u(g,l,v)}function qu(e,r){if(I(r))return e.stylize("undefined","undefined");if(vr(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(Ee(r))return e.stylize(""+r,"number");if(Ur(r))return e.stylize(""+r,"boolean");if(gr(r))return e.stylize("null","null")}function Ae(e){return"["+Error.prototype.toString.call(e)+"]"}function xu(e,r,t,n,u){for(var a=[],f=0,c=r.length;f<c;++f)Jn(r,String(f))?a.push(qe(e,r,t,n,String(f),!0)):a.push("");return u.forEach(function(l){l.match(/^\d+$/)||a.push(qe(e,r,t,n,l,!0))}),a}function qe(e,r,t,n,u,a){var f,c,l;if(l=Object.getOwnPropertyDescriptor(r,u)||{value:r[u]},l.get?l.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):l.set&&(c=e.stylize("[Setter]","special")),Jn(n,u)||(f="["+u+"]"),c||(e.seen.indexOf(l.value)<0?(gr(t)?c=Br(e,l.value,null):c=Br(e,l.value,t-1),c.indexOf(`
|
|
1
|
+
import{a as Hi}from"./chunk-YAGEU3HO.js";import"./chunk-X7QP3WH3.js";import"./chunk-5HP3T45N.js";import"./chunk-SS6XZXHU.js";import"./chunk-J745U74Q.js";import"./chunk-D3UUM672.js";import"./chunk-I3VUX77R.js";import{e as ne,f as y,g as ki,h as zi,i as ji,k as o,l as s,m as i}from"./chunk-TUE3DOHS.js";var ht=y((Jl,vt)=>{"use strict";o();i();var Ji="Function.prototype.bind called on incompatible ",Ki=Object.prototype.toString,Qi=Math.max,Yi="[object Function]",gt=function(r,t){for(var n=[],u=0;u<r.length;u+=1)n[u]=r[u];for(var a=0;a<t.length;a+=1)n[a+r.length]=t[a];return n},Xi=function(r,t){for(var n=[],u=t||0,a=0;u<r.length;u+=1,a+=1)n[a]=r[u];return n},Zi=function(e,r){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=r);return t};vt.exports=function(r){var t=this;if(typeof t!="function"||Ki.apply(t)!==Yi)throw new TypeError(Ji+t);for(var n=Xi(arguments,1),u,a=function(){if(this instanceof u){var v=t.apply(this,gt(n,arguments));return Object(v)===v?v:this}return t.apply(r,gt(n,arguments))},f=Qi(0,t.length-n.length),c=[],l=0;l<f;l++)c[l]="$"+l;if(u=Function("binder","return function ("+Zi(c,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var m=function(){};m.prototype=t.prototype,u.prototype=new m,m.prototype=null}return u}});var Or=y((Yl,dt)=>{"use strict";o();i();var Vi=ht();dt.exports=Function.prototype.bind||Vi});var St=y((Vl,mt)=>{"use strict";o();i();mt.exports=Error});var wt=y((ts,bt)=>{"use strict";o();i();bt.exports=EvalError});var Ot=y((is,At)=>{"use strict";o();i();At.exports=RangeError});var xt=y((fs,qt)=>{"use strict";o();i();qt.exports=ReferenceError});var oe=y((ps,$t)=>{"use strict";o();i();$t.exports=SyntaxError});var w=y((gs,Et)=>{"use strict";o();i();Et.exports=TypeError});var It=y((ds,Pt)=>{"use strict";o();i();Pt.exports=URIError});var ie=y((bs,Tt)=>{"use strict";o();i();Tt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var u=42;r[t]=u;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var a=Object.getOwnPropertySymbols(r);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,t);if(f.value!==u||f.enumerable!==!0)return!1}return!0}});var ae=y((Os,Rt)=>{"use strict";o();i();var Ft=typeof Symbol!="undefined"&&Symbol,ra=ie();Rt.exports=function(){return typeof Ft!="function"||typeof Symbol!="function"||typeof Ft("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ra()}});var Dt=y(($s,Nt)=>{"use strict";o();i();var ue={__proto__:null,foo:{}},ea=Object;Nt.exports=function(){return{__proto__:ue}.foo===ue.foo&&!(ue instanceof ea)}});var Bt=y((Is,_t)=>{"use strict";o();i();var ta=Function.prototype.call,na=Object.prototype.hasOwnProperty,oa=Or();_t.exports=oa.call(ta,na)});var E=y((Rs,Lt)=>{"use strict";o();i();var d,ia=St(),aa=wt(),ua=Ot(),fa=xt(),Z=oe(),X=w(),la=It(),Wt=Function,fe=function(e){try{return Wt('"use strict"; return ('+e+").constructor;")()}catch(r){}},G=Object.getOwnPropertyDescriptor;if(G)try{G({},"")}catch(e){G=null}var le=function(){throw new X},sa=G?function(){try{return arguments.callee,le}catch(e){try{return G(arguments,"callee").get}catch(r){return le}}}():le,Q=ae()(),pa=Dt()(),b=Object.getPrototypeOf||(pa?function(e){return e.__proto__}:null),Y={},ca=typeof Uint8Array=="undefined"||!b?d:b(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?d:ArrayBuffer,"%ArrayIteratorPrototype%":Q&&b?b([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":Y,"%AsyncGenerator%":Y,"%AsyncGeneratorFunction%":Y,"%AsyncIteratorPrototype%":Y,"%Atomics%":typeof Atomics=="undefined"?d:Atomics,"%BigInt%":typeof BigInt=="undefined"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ia,"%eval%":eval,"%EvalError%":aa,"%Float32Array%":typeof Float32Array=="undefined"?d:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?d:FinalizationRegistry,"%Function%":Wt,"%GeneratorFunction%":Y,"%Int8Array%":typeof Int8Array=="undefined"?d:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?d:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Q&&b?b(b([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map=="undefined"?d:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Q||!b?d:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?d:Promise,"%Proxy%":typeof Proxy=="undefined"?d:Proxy,"%RangeError%":ua,"%ReferenceError%":fa,"%Reflect%":typeof Reflect=="undefined"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?d:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Q||!b?d:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Q&&b?b(""[Symbol.iterator]()):d,"%Symbol%":Q?Symbol:d,"%SyntaxError%":Z,"%ThrowTypeError%":sa,"%TypedArray%":ca,"%TypeError%":X,"%Uint8Array%":typeof Uint8Array=="undefined"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?d:Uint32Array,"%URIError%":la,"%WeakMap%":typeof WeakMap=="undefined"?d:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?d:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?d:WeakSet};if(b)try{null.error}catch(e){Mt=b(b(e)),k["%Error.prototype%"]=Mt}var Mt,ya=function e(r){var t;if(r==="%AsyncFunction%")t=fe("async function () {}");else if(r==="%GeneratorFunction%")t=fe("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=fe("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var u=e("%AsyncGenerator%");u&&b&&(t=b(u.prototype))}return k[r]=t,t},Ct={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ar=Or(),qr=Bt(),ga=ar.call(Function.call,Array.prototype.concat),va=ar.call(Function.apply,Array.prototype.splice),Ut=ar.call(Function.call,String.prototype.replace),xr=ar.call(Function.call,String.prototype.slice),ha=ar.call(Function.call,RegExp.prototype.exec),da=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ma=/\\(\\)?/g,Sa=function(r){var t=xr(r,0,1),n=xr(r,-1);if(t==="%"&&n!=="%")throw new Z("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Z("invalid intrinsic syntax, expected opening `%`");var u=[];return Ut(r,da,function(a,f,c,l){u[u.length]=c?Ut(l,ma,"$1"):f||a}),u},ba=function(r,t){var n=r,u;if(qr(Ct,n)&&(u=Ct[n],n="%"+u[0]+"%"),qr(k,n)){var a=k[n];if(a===Y&&(a=ya(n)),typeof a=="undefined"&&!t)throw new X("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:u,name:n,value:a}}throw new Z("intrinsic "+r+" does not exist!")};Lt.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new X("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new X('"allowMissing" argument must be a boolean');if(ha(/^%?[^%]*%?$/,r)===null)throw new Z("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Sa(r),u=n.length>0?n[0]:"",a=ba("%"+u+"%",t),f=a.name,c=a.value,l=!1,m=a.alias;m&&(u=m[0],va(n,ga([0,1],m)));for(var v=1,h=!0;v<n.length;v+=1){var g=n[v],A=xr(g,0,1),x=xr(g,-1);if((A==='"'||A==="'"||A==="`"||x==='"'||x==="'"||x==="`")&&A!==x)throw new Z("property names with quotes must have matching quotes");if((g==="constructor"||!h)&&(l=!0),u+="."+g,f="%"+u+"%",qr(k,f))c=k[f];else if(c!=null){if(!(g in c)){if(!t)throw new X("base intrinsic for "+r+" exists, but the property is not available.");return}if(G&&v+1>=n.length){var S=G(c,g);h=!!S,h&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[g]}else h=qr(c,g),c=c[g];h&&!l&&(k[f]=c)}}return c}});var Er=y((_s,Gt)=>{"use strict";o();i();var wa=E(),$r=wa("%Object.defineProperty%",!0)||!1;if($r)try{$r({},"a",{value:1})}catch(e){$r=!1}Gt.exports=$r});var se=y((Cs,kt)=>{"use strict";o();i();var Aa=E(),Pr=Aa("%Object.getOwnPropertyDescriptor%",!0);if(Pr)try{Pr([],"length")}catch(e){Pr=null}kt.exports=Pr});var pe=y((Ls,Ht)=>{"use strict";o();i();var zt=Er(),Oa=oe(),V=w(),jt=se();Ht.exports=function(r,t,n){if(!r||typeof r!="object"&&typeof r!="function")throw new V("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new V("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new V("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new V("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new V("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new V("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!jt&&jt(r,t);if(zt)zt(r,t,{configurable:f===null&&l?l.configurable:!f,enumerable:u===null&&l?l.enumerable:!u,value:n,writable:a===null&&l?l.writable:!a});else if(c||!u&&!a&&!f)r[t]=n;else throw new Oa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ye=y((zs,Kt)=>{"use strict";o();i();var ce=Er(),Jt=function(){return!!ce};Jt.hasArrayLengthDefineBug=function(){if(!ce)return null;try{return ce([],"length",{value:1}).length!==1}catch(r){return!0}};Kt.exports=Jt});var Vt=y((Js,Zt)=>{"use strict";o();i();var qa=E(),Qt=pe(),xa=ye()(),Yt=se(),Xt=w(),$a=qa("%Math.floor%");Zt.exports=function(r,t){if(typeof r!="function")throw new Xt("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||$a(t)!==t)throw new Xt("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],u=!0,a=!0;if("length"in r&&Yt){var f=Yt(r,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(a=!1)}return(u||a||!n)&&(xa?Qt(r,"length",t,!0,!0):Qt(r,"length",t)),r}});var Fr=y((Ys,Ir)=>{"use strict";o();i();var ge=Or(),Tr=E(),Ea=Vt(),Pa=w(),tn=Tr("%Function.prototype.apply%"),nn=Tr("%Function.prototype.call%"),on=Tr("%Reflect.apply%",!0)||ge.call(nn,tn),rn=Er(),Ia=Tr("%Math.max%");Ir.exports=function(r){if(typeof r!="function")throw new Pa("a function is required");var t=on(ge,nn,arguments);return Ea(t,1+Ia(0,r.length-(arguments.length-1)),!0)};var en=function(){return on(ge,tn,arguments)};rn?rn(Ir.exports,"apply",{value:en}):Ir.exports.apply=en});var ve=y((Vs,un)=>{"use strict";o();i();var an=Object.prototype.toString;un.exports=function(r){var t=an.call(r),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&an.call(r.callee)==="[object Function]"),n}});var hn=y((tp,vn)=>{"use strict";o();i();var gn;Object.keys||(ur=Object.prototype.hasOwnProperty,he=Object.prototype.toString,fn=ve(),de=Object.prototype.propertyIsEnumerable,ln=!de.call({toString:null},"toString"),sn=de.call(function(){},"prototype"),fr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Rr=function(e){var r=e.constructor;return r&&r.prototype===e},pn={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},cn=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!pn["$"+e]&&ur.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Rr(window[e])}catch(r){return!0}}catch(r){return!0}return!1}(),yn=function(e){if(typeof window=="undefined"||!cn)return Rr(e);try{return Rr(e)}catch(r){return!1}},gn=function(r){var t=r!==null&&typeof r=="object",n=he.call(r)==="[object Function]",u=fn(r),a=t&&he.call(r)==="[object String]",f=[];if(!t&&!n&&!u)throw new TypeError("Object.keys called on a non-object");var c=sn&&n;if(a&&r.length>0&&!ur.call(r,0))for(var l=0;l<r.length;++l)f.push(String(l));if(u&&r.length>0)for(var m=0;m<r.length;++m)f.push(String(m));else for(var v in r)!(c&&v==="prototype")&&ur.call(r,v)&&f.push(String(v));if(ln)for(var h=yn(r),g=0;g<fr.length;++g)!(h&&fr[g]==="constructor")&&ur.call(r,fr[g])&&f.push(fr[g]);return f});var ur,he,fn,de,ln,sn,fr,Rr,pn,cn,yn;vn.exports=gn});var bn=y((ip,Sn)=>{"use strict";o();i();var Ta=Array.prototype.slice,Fa=ve(),dn=Object.keys,Nr=dn?function(r){return dn(r)}:hn(),mn=Object.keys;Nr.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(n){return Fa(n)?mn(Ta.call(n)):mn(n)})}else Object.keys=Nr;return Object.keys||Nr};Sn.exports=Nr});var lr=y((fp,qn)=>{"use strict";o();i();var Ra=bn(),Na=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Da=Object.prototype.toString,_a=Array.prototype.concat,wn=pe(),Ba=function(e){return typeof e=="function"&&Da.call(e)==="[object Function]"},An=ye()(),Ma=function(e,r,t,n){if(r in e){if(n===!0){if(e[r]===t)return}else if(!Ba(n)||!n())return}An?wn(e,r,t,!0):wn(e,r,t)},On=function(e,r){var t=arguments.length>2?arguments[2]:{},n=Ra(r);Na&&(n=_a.call(n,Object.getOwnPropertySymbols(r)));for(var u=0;u<n.length;u+=1)Ma(e,n[u],r[n[u]],t[n[u]])};On.supportsDescriptors=!!An;qn.exports=On});var P=y((pp,En)=>{"use strict";o();i();var xn=E(),$n=Fr(),Ca=$n(xn("String.prototype.indexOf"));En.exports=function(r,t){var n=xn(r,!!t);return typeof n=="function"&&Ca(r,".prototype.")>-1?$n(n):n}});var Tn=y((gp,In)=>{"use strict";o();i();var Ua=E(),Pn=Ua("%Array%"),Wa=!Pn.isArray&&P()("Object.prototype.toString");In.exports=Pn.isArray||function(r){return Wa(r)==="[object Array]"}});var me=y((dp,Fn)=>{"use strict";o();i();Fn.exports=Tn()});var Nn=y((bp,Rn)=>{"use strict";o();i();var La=E(),Ga=P(),ka=w(),za=me(),ja=La("%Reflect.apply%",!0)||Ga("Function.prototype.apply");Rn.exports=function(r,t){var n=arguments.length>2?arguments[2]:[];if(!za(n))throw new ka("Assertion failed: optional `argumentsList`, if provided, must be a List");return ja(r,t,n)}});function Dn(){throw new Error("setTimeout has not been defined")}function _n(){throw new Error("clearTimeout has not been defined")}function Bn(e){if(M===setTimeout)return setTimeout(e,0);if((M===Dn||!M)&&setTimeout)return M=setTimeout,setTimeout(e,0);try{return M(e,0)}catch(r){try{return M.call(null,e,0)}catch(t){return M.call(this,e,0)}}}function Ha(e){if(C===clearTimeout)return clearTimeout(e);if((C===_n||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(e);try{return C(e)}catch(r){try{return C.call(null,e)}catch(t){return C.call(this,e)}}}function Ja(){!er||!z||(er=!1,z.length?N=z.concat(N):Dr=-1,N.length&&Mn())}function Mn(){if(!er){var e=Bn(Ja);er=!0;for(var r=N.length;r;){for(z=N,N=[];++Dr<r;)z&&z[Dr].run();Dr=-1,r=N.length}z=null,er=!1,Ha(e)}}function Ka(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];N.push(new Cn(e,r)),N.length===1&&!er&&Bn(Mn)}function Cn(e,r){this.fun=e,this.array=r}function j(){}function pu(e){throw new Error("process.binding is not supported")}function cu(){return"/"}function yu(e){throw new Error("process.chdir is not supported")}function gu(){return 0}function hu(e){var r=vu.call(rr)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}function mu(){var e=new Date,r=e-du;return r/1e3}var M,C,N,er,z,Dr,Qa,Ya,Xa,Za,Va,ru,eu,tu,nu,ou,iu,au,uu,fu,lu,su,rr,vu,du,Su,sr,Un=ne(()=>{"use strict";o();i();M=Dn,C=_n;typeof globalThis.setTimeout=="function"&&(M=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);N=[],er=!1,Dr=-1;Cn.prototype.run=function(){this.fun.apply(null,this.array)};Qa="browser",Ya="browser",Xa=!0,Za={},Va=[],ru="",eu={},tu={},nu={};ou=j,iu=j,au=j,uu=j,fu=j,lu=j,su=j;rr=globalThis.performance||{},vu=rr.now||rr.mozNow||rr.msNow||rr.oNow||rr.webkitNow||function(){return new Date().getTime()};du=new Date;Su={nextTick:Ka,title:Qa,browser:Xa,env:Za,argv:Va,version:ru,versions:eu,on:ou,addListener:iu,once:au,off:uu,removeListener:fu,removeAllListeners:lu,emit:su,binding:pu,cwd:cu,chdir:yu,umask:gu,hrtime:hu,platform:Ya,release:tu,config:nu,uptime:mu},sr=Su});var Se,be,Wn=ne(()=>{"use strict";o();i();typeof Object.create=="function"?Se=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Se=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};be=Se});var Kn={};ki(Kn,{_extend:()=>Ie,debuglog:()=>Ln,default:()=>Iu,deprecate:()=>xe,format:()=>Cr,inherits:()=>be,inspect:()=>T,isArray:()=>$e,isBoolean:()=>Ur,isBuffer:()=>jn,isDate:()=>Mr,isError:()=>cr,isFunction:()=>yr,isNull:()=>gr,isNullOrUndefined:()=>Gn,isNumber:()=>Ee,isObject:()=>H,isPrimitive:()=>zn,isRegExp:()=>pr,isString:()=>vr,isSymbol:()=>kn,isUndefined:()=>I,log:()=>Hn});function Cr(e){if(!vr(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(T(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,u=n.length,a=String(e).replace(bu,function(c){if(c==="%%")return"%";if(t>=u)return c;switch(c){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(l){return"[Circular]"}default:return c}}),f=n[t];t<u;f=n[++t])gr(f)||!H(f)?a+=" "+f:a+=" "+T(f);return a}function xe(e,r){if(I(globalThis.process))return function(){return xe(e,r).apply(this,arguments)};if(sr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(sr.throwDeprecation)throw new Error(r);sr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}function Ln(e){if(I(we)&&(we=sr.env.NODE_DEBUG||""),e=e.toUpperCase(),!_r[e])if(new RegExp("\\b"+e+"\\b","i").test(we)){var r=0;_r[e]=function(){var t=Cr.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else _r[e]=function(){};return _r[e]}function T(e,r){var t={seen:[],stylize:Au};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Ur(r)?t.showHidden=r:r&&Ie(t,r),I(t.showHidden)&&(t.showHidden=!1),I(t.depth)&&(t.depth=2),I(t.colors)&&(t.colors=!1),I(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=wu),Br(t,e,t.depth)}function wu(e,r){var t=T.styles[r];return t?"\x1B["+T.colors[t][0]+"m"+e+"\x1B["+T.colors[t][1]+"m":e}function Au(e,r){return e}function Ou(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Br(e,r,t){if(e.customInspect&&r&&yr(r.inspect)&&r.inspect!==T&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return vr(n)||(n=Br(e,n,t)),n}var u=qu(e,r);if(u)return u;var a=Object.keys(r),f=Ou(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),cr(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Ae(r);if(a.length===0){if(yr(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(pr(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(Mr(r))return e.stylize(Date.prototype.toString.call(r),"date");if(cr(r))return Ae(r)}var l="",m=!1,v=["{","}"];if($e(r)&&(m=!0,v=["[","]"]),yr(r)){var h=r.name?": "+r.name:"";l=" [Function"+h+"]"}if(pr(r)&&(l=" "+RegExp.prototype.toString.call(r)),Mr(r)&&(l=" "+Date.prototype.toUTCString.call(r)),cr(r)&&(l=" "+Ae(r)),a.length===0&&(!m||r.length==0))return v[0]+l+v[1];if(t<0)return pr(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var g;return m?g=xu(e,r,t,f,a):g=a.map(function(A){return qe(e,r,t,f,A,m)}),e.seen.pop(),$u(g,l,v)}function qu(e,r){if(I(r))return e.stylize("undefined","undefined");if(vr(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(Ee(r))return e.stylize(""+r,"number");if(Ur(r))return e.stylize(""+r,"boolean");if(gr(r))return e.stylize("null","null")}function Ae(e){return"["+Error.prototype.toString.call(e)+"]"}function xu(e,r,t,n,u){for(var a=[],f=0,c=r.length;f<c;++f)Jn(r,String(f))?a.push(qe(e,r,t,n,String(f),!0)):a.push("");return u.forEach(function(l){l.match(/^\d+$/)||a.push(qe(e,r,t,n,l,!0))}),a}function qe(e,r,t,n,u,a){var f,c,l;if(l=Object.getOwnPropertyDescriptor(r,u)||{value:r[u]},l.get?l.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):l.set&&(c=e.stylize("[Setter]","special")),Jn(n,u)||(f="["+u+"]"),c||(e.seen.indexOf(l.value)<0?(gr(t)?c=Br(e,l.value,null):c=Br(e,l.value,t-1),c.indexOf(`
|
|
2
2
|
`)>-1&&(a?c=c.split(`
|
|
3
3
|
`).map(function(m){return" "+m}).join(`
|
|
4
4
|
`).substr(2):c=`
|