nfets 0.0.43 → 0.0.44

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.
@@ -108,7 +108,7 @@ ${e.join(`
108
108
  `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===hi.BeforeDocElement&&(this.state=hi.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===hi.BeforeDocElement&&(this.state=hi.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!HB(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let h={prefix:a.prefix,namespace:a.namespaceURI};t.push(h),this.visibleNamespaces.Add(h),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let h={prefix:a.prefix,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}let u=null,c;(c=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=c[1]);let f=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let h=P9(e,u);if(h>1)f=!1;else if(h===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&f){let h={prefix:u,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(yhe);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];HB(s)||t.push(s)}t.sort(xhe),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,Mt.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===Mt.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===Mt.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===Mt.Attribute?n.push("&quot;"):i===" "&&t===Mt.Attribute?n.push("&#x9;"):i===`
109
109
  `&&t===Mt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case Mt.Text:case Mt.CDATA:case Mt.SignificantWhitespace:case Mt.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function yhe(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(yhe,"XmlDsigC14NTransformNamespacesComparer");function xhe(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(xhe,"XmlDsigC14NTransformAttributesComparer");function P9(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!HB(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===Mt.Element){let a=P9(s,e,t);if(s.nodeType===Mt.Element&&a)return++t+a}return t}o(P9,"IsNamespaceUsed");function HB(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===Mt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(HB,"IsNamespaceNode");var c2=class extends $i{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Mt.Element||n.nodeName===ge.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case ge.ElementNames.RSAPSSParams:s=wa;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};c2=Ke([Ft({localName:"Other"})],c2);var co=class extends $r{static{o(this,"SignatureMethod")}};Ke([kr({localName:ge.AttributeNames.Algorithm,required:!0,defaultValue:""}),ht("design:type",String)],co.prototype,"Algorithm",void 0);Ke([Wt({localName:ge.ElementNames.HMACOutputLength,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,converter:Jg}),ht("design:type",Number)],co.prototype,"HMACOutputLength",void 0);Ke([Wt({parser:c2,noRoot:!0,minOccurs:0}),ht("design:type",c2)],co.prototype,"Any",void 0);co=Ke([Ft({localName:ge.ElementNames.SignatureMethod})],co);var h0=class extends $r{static{o(this,"CanonicalizationMethod")}};Ke([kr({localName:ge.AttributeNames.Algorithm,required:!0,defaultValue:ge.DefaultCanonMethod}),ht("design:type",String)],h0.prototype,"Algorithm",void 0);h0=Ke([Ft({localName:ge.ElementNames.CanonicalizationMethod})],h0);var p0=class extends $r{static{o(this,"DataObject")}};Ke([kr({localName:ge.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],p0.prototype,"Id",void 0);Ke([kr({localName:ge.AttributeNames.MimeType,defaultValue:""}),ht("design:type",String)],p0.prototype,"MimeType",void 0);Ke([kr({localName:ge.AttributeNames.Encoding,defaultValue:""}),ht("design:type",String)],p0.prototype,"Encoding",void 0);p0=Ke([Ft({localName:ge.ElementNames.Object})],p0);var ax=class extends $i{static{o(this,"DataObjects")}};ax=Ke([Ft({localName:"xmldsig_objects",parser:p0})],ax);var fs=class extends $r{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new qe(Ie.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new qe(Ie.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Ke([kr({localName:ge.AttributeNames.Algorithm,defaultValue:""}),ht("design:type",String)],fs.prototype,"Algorithm",void 0);Ke([Wt({localName:ge.ElementNames.XPath,defaultValue:""}),ht("design:type",String)],fs.prototype,"XPath",void 0);fs=Ke([Ft({localName:ge.ElementNames.Transform})],fs);var hu=class extends fs{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=ge.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new qe(Ie.PARAM_REQUIRED,"innerXml");return wr.FromString(this.innerXml.textContent||"","base64")}};var lo=class extends fs{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new uo(!1,!1)}GetOutput(){if(!this.innerXml)throw new qe(Ie.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},fo=class extends lo{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new uo(!0,!1)}};var pu=class extends fs{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new qe(Ie.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)oi(e)&&e.localName===ge.ElementNames.Signature&&e.namespaceURI===ge.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var ho=class extends fs{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new uo(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new qe(Ie.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},po=class extends ho{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new uo(!0,!0)}};function k9(r){return r.parentNode?k9(r.parentNode):r}o(k9,"lookupParentNode");var d0=class extends fs{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=ge.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new qe(Ie.PARAM_REQUIRED,"innerXml");this.Filter(k9(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:Yp("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?Yp("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(f=>i.lookupNamespaceURI(f),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Ke([Wt({localName:ge.ElementNames.XPath,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,required:!0}),ht("design:type",String)],d0.prototype,"XPath",void 0);var m0=class extends $i{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case ge.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return Rh(t,pu);case ge.AlgorithmNamespaces.XmlDsigC14NTransform:return Rh(t,lo);case ge.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return Rh(t,fo);case ge.AlgorithmNamespaces.XmlDsigExcC14NTransform:return Rh(t,ho);case ge.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return Rh(t,po);case ge.AlgorithmNamespaces.XmlDsigBase64Transform:return Rh(t,hu);case ge.AlgorithmNamespaces.XmlDsigXPathTransform:return Rh(t,d0);default:try{let n=ox.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new qe(Ie.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};m0=Ke([Ft({localName:ge.ElementNames.Transforms,parser:fs})],m0);function Rh(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(Rh,"ChangeTransform");var mo=class extends $r{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new Gi,e&&(this.Uri=e)}};Ke([kr({defaultValue:""}),ht("design:type",String)],mo.prototype,"Id",void 0);Ke([kr({localName:ge.AttributeNames.URI}),ht("design:type",String)],mo.prototype,"Uri",void 0);Ke([kr({localName:ge.AttributeNames.Type,defaultValue:""}),ht("design:type",String)],mo.prototype,"Type",void 0);Ke([Wt({parser:m0}),ht("design:type",m0)],mo.prototype,"Transforms",void 0);Ke([Wt({required:!0,parser:Gi}),ht("design:type",Gi)],mo.prototype,"DigestMethod",void 0);Ke([Wt({required:!0,localName:ge.ElementNames.DigestValue,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,converter:Vi}),ht("design:type",Uint8Array)],mo.prototype,"DigestValue",void 0);mo=Ke([Ft({localName:ge.ElementNames.Reference}),ht("design:paramtypes",[String])],mo);var g0=class extends $i{static{o(this,"References")}};g0=Ke([Ft({localName:"References",parser:mo})],g0);var du=class extends $r{static{o(this,"SignedInfo")}};Ke([kr({localName:ge.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],du.prototype,"Id",void 0);Ke([Wt({parser:h0,required:!0}),ht("design:type",h0)],du.prototype,"CanonicalizationMethod",void 0);Ke([Wt({parser:co,required:!0}),ht("design:type",co)],du.prototype,"SignatureMethod",void 0);Ke([Wt({parser:g0,minOccurs:1,noRoot:!0}),ht("design:type",g0)],du.prototype,"References",void 0);du=Ke([Ft({localName:ge.ElementNames.SignedInfo})],du);var w0="http://www.w3.org/2001/04/xmldsig-more#",S0="ecdsa",Oh=class extends Fs{static{o(this,"EcdsaPublicKey")}};Ke([Wt({localName:ge.ElementNames.X,namespaceURI:w0,prefix:S0,required:!0,converter:Vi}),ht("design:type",Uint8Array)],Oh.prototype,"X",void 0);Ke([Wt({localName:ge.ElementNames.Y,namespaceURI:w0,prefix:S0,required:!0,converter:Vi}),ht("design:type",Uint8Array)],Oh.prototype,"Y",void 0);Oh=Ke([Ft({localName:ge.ElementNames.PublicKey,namespaceURI:w0,prefix:S0})],Oh);var v0=class extends Fs{static{o(this,"NamedCurve")}};Ke([kr({localName:ge.AttributeNames.URI,required:!0}),ht("design:type",String)],v0.prototype,"Uri",void 0);v0=Ke([Ft({localName:ge.ElementNames.NamedCurve,namespaceURI:w0,prefix:S0})],v0);var y0=class extends Fs{static{o(this,"DomainParameters")}};Ke([Wt({parser:v0}),ht("design:type",v0)],y0.prototype,"NamedCurve",void 0);y0=Ke([Ft({localName:ge.ElementNames.DomainParameters,namespaceURI:w0,prefix:S0})],y0);var x0=class extends fi{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=ge.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===lu.toUpperCase()}get NamedCurve(){return V9(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new qe(Ie.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await yn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Oh,this.PublicKey.X=wr.FromString(t.x||"","base64url"),this.PublicKey.Y=wr.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new y0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new v0),this.DomainParameters.NamedCurve.Uri=V9(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=wr.ToBase64Url(this.PublicKey.X),n=wr.ToBase64Url(this.PublicKey.Y),s=whe(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await yn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Ke([Wt({parser:y0}),ht("design:type",y0)],x0.prototype,"DomainParameters",void 0);Ke([Wt({parser:Oh,required:!0}),ht("design:type",Oh)],x0.prototype,"PublicKey",void 0);x0=Ke([Ft({localName:ge.ElementNames.ECDSAKeyValue,namespaceURI:w0,prefix:S0})],x0);function V9(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new qe(Ie.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(V9,"GetNamedCurveOid");function whe(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new qe(Ie.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(whe,"GetNamedCurveFromOid");var She=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},gl=new She;gl.set(ge.ElementNames.RSAKeyValue,l0);gl.set(ge.ElementNames.ECDSAKeyValue,x0);var l2=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=gl.get(e);if(!t)throw new qe(Ie.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ux=class extends fi{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of gl)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new qe(Ie.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new qe(Ie.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(oi(n))try{let s=n.localName,i=l2.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new qe(Ie.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ux=Ke([Ft({localName:ge.ElementNames.KeyValue}),ht("design:paramtypes",[fi])],ux);var Ehe={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},E0=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return yn.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===lu){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=Ehe[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Wr(this.raw.buffer);this.simpl=new ls({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var f2=class extends $r{static{o(this,"X509IssuerSerial")}};Ke([Wt({localName:ge.ElementNames.X509IssuerName,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,required:!0}),ht("design:type",String)],f2.prototype,"X509IssuerName",void 0);Ke([Wt({localName:ge.ElementNames.X509SerialNumber,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,required:!0}),ht("design:type",String)],f2.prototype,"X509SerialNumber",void 0);f2=Ke([Ft({localName:ge.ElementNames.X509IssuerSerial})],f2);var Ph;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Ph||(Ph={}));var b0=class extends fi{static{o(this,"KeyInfoX509Data")}constructor(e,t=Ph.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new E0(e));else if(e instanceof E0)switch(t){case Ph.None:case Ph.EndCertOnly:this.AddCertificate(e);break;case Ph.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Ph.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new qe(Ie.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new qe(Ie.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new qe(Ie.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new qe(Ie.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=wr.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509IssuerSerial),a=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509SKI);i.textContent=wr.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509Certificate);i.textContent=wr.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(ge.NamespaceURI,n+ge.ElementNames.X509CRL);s.textContent=wr.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(ge.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=$r.GetChild(s,ge.ElementNames.X509IssuerName,ge.NamespaceURI,!0),a=$r.GetChild(s,ge.ElementNames.X509SerialNumber,ge.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(ge.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=wr.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(ge.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(ge.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=wr.FromBase64(s.textContent);this.AddCertificate(new E0(i))}});let n=this.GetChild(ge.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=wr.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};b0=Ke([Ft({localName:ge.ElementNames.X509Data}),ht("design:paramtypes",[Object,Object])],b0);var cx=class extends fi{static{o(this,"SPKIData")}async importKey(e){let t=await yn.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await yn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Ke([Wt({localName:ge.ElementNames.SPKIexp,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,required:!0,converter:Vi}),ht("design:type",Object)],cx.prototype,"SPKIexp",void 0);cx=Ke([Ft({localName:ge.ElementNames.SPKIData})],cx);var kh=class extends $i{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Mt.Element)continue;let s=null;switch(n.localName){case ge.ElementNames.KeyValue:s=ux;break;case ge.ElementNames.X509Data:s=b0;break;case ge.ElementNames.SPKIData:s=cx;break;case ge.ElementNames.KeyName:case ge.ElementNames.RetrievalMethod:case ge.ElementNames.PGPData:case ge.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Ke([kr({localName:ge.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],kh.prototype,"Id",void 0);kh=Ke([Ft({localName:ge.ElementNames.KeyInfo})],kh);var vl=class extends $r{static{o(this,"Signature")}};Ke([kr({localName:ge.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],vl.prototype,"Id",void 0);Ke([Wt({parser:du,required:!0}),ht("design:type",du)],vl.prototype,"SignedInfo",void 0);Ke([Wt({localName:ge.ElementNames.SignatureValue,namespaceURI:ge.NamespaceURI,prefix:ge.DefaultPrefix,required:!0,converter:Vi,defaultValue:null}),ht("design:type",Object)],vl.prototype,"SignatureValue",void 0);Ke([Wt({parser:kh}),ht("design:type",kh)],vl.prototype,"KeyInfo",void 0);Ke([Wt({parser:ax,noRoot:!0}),ht("design:type",ax)],vl.prototype,"ObjectList",void 0);vl=Ke([Ft({localName:ge.ElementNames.Signature})],vl);var Ahe=class extends Map{static{o(this,"AlgorithmRegistry")}},dr=new Ahe;dr.set(n2,{type:"signature",algorithm:a0});dr.set(s2,{type:"signature",algorithm:o0});dr.set(i2,{type:"signature",algorithm:u0});dr.set(a2,{type:"signature",algorithm:c0});dr.set(n2,{type:"signature",algorithm:a0});dr.set(s2,{type:"signature",algorithm:o0});dr.set(i2,{type:"signature",algorithm:u0});dr.set(a2,{type:"signature",algorithm:c0});dr.set(qB,{type:"signature",algorithm:u2});dr.set(YA,{type:"signature",algorithm:t0});dr.set(QA,{type:"signature",algorithm:r0});dr.set(ZA,{type:"signature",algorithm:n0});dr.set(e2,{type:"signature",algorithm:s0});dr.set(YA.toUpperCase(),{type:"signature",algorithm:t0});dr.set(QA.toUpperCase(),{type:"signature",algorithm:r0});dr.set(ZA.toUpperCase(),{type:"signature",algorithm:n0});dr.set(e2.toUpperCase(),{type:"signature",algorithm:s0});dr.set(LB,{type:"signature",algorithm:rx});dr.set(VB,{type:"signature",algorithm:nx});dr.set(UB,{type:"signature",algorithm:sx});dr.set(jB,{type:"signature",algorithm:ix});dr.set(Ym,{type:"hash",algorithm:WA});dr.set(Qm,{type:"hash",algorithm:tx});dr.set(Zm,{type:"hash",algorithm:zA});dr.set(e0,{type:"hash",algorithm:JA});var Lh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of dr)if(n==="hash"&&t===e)return new s;throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of dr)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of dr)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of dr)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e.name)}};var Che=class extends Map{static{o(this,"TransformRegistry")}},mu=new Che;mu.set(ge.AlgorithmNamespaces.XmlDsigBase64Transform,hu);mu.set(ge.AlgorithmNamespaces.XmlDsigC14NTransform,lo);mu.set(ge.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,fo);mu.set(ge.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,pu);mu.set(ge.AlgorithmNamespaces.XmlDsigExcC14NTransform,ho);mu.set(ge.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,po);var ox=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new qe(Ie.PARAM_REQUIRED,"name");let t=mu.get(e);if(t)return new t;let n;switch(e){case ge.AlgorithmNamespaces.XmlDsigBase64Transform:n=new hu;break;case ge.AlgorithmNamespaces.XmlDsigC14NTransform:n=new lo;break;case ge.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new fo;break;case ge.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new pu;break;case ge.AlgorithmNamespaces.XmlDsigXPathTransform:throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e);case ge.AlgorithmNamespaces.XmlDsigXsltTransform:throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e);case ge.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new ho;break;case ge.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new po;break;case ge.AlgorithmNamespaces.XmlDecryptionTransform:throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e);default:throw new qe(Ie.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Lh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Lh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Lh.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),Lh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new co;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){dr.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){dr.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){gl.set(e,t)}static RegisterTransform(e,t){mu.set(e,t)}};var h2=Zx(OI(),1);var U9={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var j9={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var M9=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=Ihe){this.xml2js=e,rM({XMLSerializer:h2.default.XMLSerializer,DOMParser:h2.default.DOMParser,DOMImplementation:h2.default.DOMImplementation})}async validate(e,t){try{return await IU.validate(e,t),ri()}catch(n){return qu(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...j9,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...U9,...t}).buildObject(e))}digest(e,t,n=K0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=K0){let n=Li(this.clear(e));return new uo(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let s=Li(e).documentElement.getElementsByTagName(t).item(0);return s?this.clear(Za(s)):null}getFirstNode(e){let n=Li(e).documentElement.firstChild;return n?this.clear(Za(n)):null}getAttribute(e,t){return Li(e).documentElement.getAttribute(t)}appendNode(e,t){let n=Li(e),{documentElement:s}=Li(t);return n.documentElement.appendChild(s),this.clear(Za(n))}hash(e,t){return The.createHash(t).update(e,"utf8").digest().toString("base64")}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
110
110
  `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as _he}from"class-validator";var F9=o(r=>(e,t)=>{_he({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof np?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as q9}from"class-validator";var A0=Symbol("choice"),C0=o(r=>r==null||r==="","isEmpty"),VTe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(A0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(A0,i,e);for(let u of t)q9({name:"choice",target:e,propertyName:u,options:s,validator:{validate(c,f){let h=f.object,m=f.property,g=Reflect.getMetadata(A0,e);if(!g)return!0;let x=g.find(v=>v.properties.includes(m));if(!x||C0(c))return!0;for(let v of x.properties){if(v===m)continue;let S=h[v];if(!C0(S))return!1}for(let v of g)if(v!==x)for(let S of v.properties){let E=h[S];if(!C0(E))return!1}return!0},defaultMessage(c){let f=Reflect.getMetadata(A0,e);if(!f)return`${c.property} validation error`;let h=f.find(g=>g.properties.includes(c.property));if(!h)return`${c.property} validation error`;let m=c.object;for(let g of h.properties){let x=m[g];if(!C0(x)&&g!==c.property)return`${c.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of f)if(g!==h)for(let x of g.properties){let v=m[x];if(!C0(v))return`${c.property} cannot be set because ${x} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)q9({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(c,f){let h=f.object,m=Reflect.getMetadata(A0,e);if(!m)return!0;let g=m.find(x=>x.properties.includes(f.property));if(!g?.required)return!0;for(let x of g.properties){let v=h[x];if(!C0(v))return!0}return f.property!==g.properties[0]},defaultMessage(c){let f=Reflect.getMetadata(A0,e);if(!f)return"At least one property from a choice group must be provided";let h=f.find(m=>m.properties.includes(c.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as Dhe}from"class-transformer";var KTe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{F9(e)(t,n),Dhe(({value:s})=>np.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as Ohe}from"class-transformer";import{IsDateString as Phe}from"class-validator";import KB from"dayjs";import Bhe from"dayjs/plugin/utc.js";import Rhe from"dayjs/plugin/timezone.js";KB.extend(Bhe);KB.extend(Rhe);var H9=KB;var eIe=o((r={})=>(e,t)=>{Ohe(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?H9(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),Phe()(e,t)},"TransformDateString");var K9=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],c=n.reduce((v,S,E)=>v+S*a[E],0)%11,f=c===0||c===1?0:11-c,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,f].reduce((v,S,E)=>v+S*h[E],0)%11,x=g===0||g===1?0:11-g;return s===f&&i===x}};var $9=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var G9=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var X9=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],c=i;for(let m=0;m<8;m++)c+=parseInt(t[m],10)*u[m];let h=11-c%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var W9=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(S=>parseInt(S,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let S=0;S<i.length;S++)a+=n[S]*i[S];let u=a%s,c=s-u;(s===11&&u<=1||s===10&&u===0)&&(c=0);let h=(t.slice(0,t.length-2)+c.toString()).split("").map(S=>parseInt(S,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let S=0;S<m.length;S++)g+=h[S]*m[S];let x=g%s,v=s-x;return(s===11&&x<=1||s===10&&x===0)&&(v=0),v===n[t.length-2]&&c===n[t.length-1]}};var z9=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var J9=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let c=n.concat([u]),f=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)f+=c[m]*i[g];let h=11-f%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var Y9=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var Q9=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let c=0;c<8;c++)i+=parseInt(t[c],10)*s[c];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var Z9=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var eq=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let x=0;x<12;x++){let v=x%2===0?1:2,S=(parseInt(s[x])*v).toString();i+=S.split("").reduce((E,C)=>E+parseInt(C),0)}let u=Math.ceil(i/10)*10-i,c=n+u.toString(),f=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let x=0;x<12;x++)h+=parseInt(c[x])*f[x];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var tq=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var rq=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var nq=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var sq=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var iq=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let x=0;x<7;x++)i+=n[x]*s[x];let a=i%11,u=a===0||a===1?0:11-a,c=[...n,u],f=[9,8,7,6,5,4,3,2],h=0;for(let x=0;x<8;x++)h+=c[x]*f[x];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var aq=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var oq=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let c=[...n,u],f=0;for(let m=0;m<9;m++)f+=c[m]*i[m];let h=11-f%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var uq=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var cq=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let f=0;f<n.length;f++)i+=s[f]*n[f];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var lq=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let c=0;c<s.length;c++)i+=n[c]*s[c];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var fq=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var hq=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var pq=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var dq=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var mq=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],c=0;for(let h=0;h<11;h++)c+=n[h]*u[h];let f=c%11%10;return a===n[8]&&f===n[11]}};var gq=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let f=0;f<i.length;f++)a+=s[f]*i[f];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var p2=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
111
- `).reduce((i,a)=>{let[u,c]=a.split("=").map(f=>f.trim());return!u||!c?i:i.set(u,c)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[0].subarray(-4),c=u.subarray(-2);u[0]===48?c=u:u[1]===48&&(c=u.subarray(-3));let f=Buffer.concat([c,n,i[1]]),h=this.length(f),m=n.length,g=f.subarray(2+m,2+m+h),x=g.length-c.length-2;if(x<=0||x>g.length)return;let S=g.subarray(-x).toString("utf8");return S.substring(Buffer.from(S).findIndex((E,C)=>S.charCodeAt(C)>=32&&S.charCodeAt(C)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var yq=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new lw){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let s=Vh.default.asn1.fromDer(n.value.toString("binary")),i=Vh.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a,pkcs8ShroudedKeyBag:u}=Vh.default.pki.oids,c=i.getBags({bagType:a}),f=i.getBags({bagType:u}),h=c[a];if(!h?.length)return ti(new dn("Cannot read certificate"));let[{cert:m},...g]=h;if(!m)return ti(new dn("Issuer Certificate not found"));let x=f[u]?.[0].key;if(!x)return ti(new dn("Certificate Private Key not found"));let v=g.reduce((b,{cert:A})=>(A&&b.push(new N0.X509Certificate(Vh.default.pki.certificateToPem(A))),b),[]),S=Vh.default.pki.privateKeyToPem(x),E=Vh.default.pki.certificateToPem(m),C=N0.createPrivateKey(S),_=new N0.X509Certificate(E);return ri({ca:v,password:t,privateKey:C,certificate:_})}catch(t){return qu(t)}}async sign(e,t,n=Nu.SHA1){try{let i=N0.sign(n,Buffer.from(e),{key:t,padding:N0.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(ri(i))}catch(s){return Promise.resolve(qu(s))}}getCertificateInfo(e){return new p2().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new dn("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return ri(i);if(khe.isAbsolute(t)||vq.existsSync(t))return this.hitBufferOnCache(s,vq.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return qu(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return N0.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),ri(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var aDe={[Er.AC]:"America/Rio_Branco",[Er.AL]:"America/Maceio",[Er.AM]:"America/Manaus",[Er.AP]:"America/Belem",[Er.BA]:"America/Bahia",[Er.CE]:"America/Fortaleza",[Er.DF]:"America/Sao_Paulo",[Er.ES]:"America/Sao_Paulo",[Er.GO]:"America/Sao_Paulo",[Er.MA]:"America/Fortaleza",[Er.MG]:"America/Sao_Paulo",[Er.MS]:"America/Campo_Grande",[Er.MT]:"America/Cuiaba",[Er.PA]:"America/Belem",[Er.PB]:"America/Fortaleza",[Er.PE]:"America/Recife",[Er.PI]:"America/Fortaleza",[Er.PR]:"America/Sao_Paulo",[Er.RJ]:"America/Sao_Paulo",[Er.RN]:"America/Fortaleza",[Er.RO]:"America/Porto_Velho",[Er.RR]:"America/Boa_Vista",[Er.RS]:"America/Sao_Paulo",[Er.SC]:"America/Sao_Paulo",[Er.SE]:"America/Maceio",[Er.SP]:"America/Sao_Paulo",[Er.TO]:"America/Araguaina"};export{_C as a,gP as b,DC as c,Nu as d,BC as e,Er as f,Vhe as g,jhe as h,dn as i,vP as j,RC as k,Zh as l,ti as m,ri as n,yP as o,xP as p,$0 as q,dpe as r,mpe as s,tw as t,wP as u,SP as v,EP as w,Cpe as x,np as y,VP as z,lw as A,yq as B,v8 as C,x8 as D,N8 as E,wU as F,M9 as G,F9 as H,VTe as I,KTe as J,eIe as K,K9 as L,$9 as M,G9 as N,X9 as O,W9 as P,z9 as Q,J9 as R,Y9 as S,Q9 as T,Z9 as U,eq as V,tq as W,rq as X,nq as Y,sq as Z,iq as _,aq as $,oq as aa,uq as ba,cq as ca,lq as da,fq as ea,hq as fa,pq as ga,dq as ha,mq as ia,gq as ja,p2 as ka};
111
+ `).reduce((i,a)=>{let[u,c]=a.split("=").map(f=>f.trim());return!u||!c?i:i.set(u,c)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[0].subarray(-4),c=u.subarray(-2);u[0]===48?c=u:u[1]===48&&(c=u.subarray(-3));let f=Buffer.concat([c,n,i[1]]),h=this.length(f),m=n.length,g=f.subarray(2+m,2+m+h),x=g.length-c.length-2;if(x<=0||x>g.length)return;let S=g.subarray(-x).toString("utf8");return S.substring(Buffer.from(S).findIndex((E,C)=>S.charCodeAt(C)>=32&&S.charCodeAt(C)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var yq=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new lw){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let s=Vh.default.asn1.fromDer(n.value.toString("binary")),i=Vh.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a,pkcs8ShroudedKeyBag:u}=Vh.default.pki.oids,c=i.getBags({bagType:a}),f=i.getBags({bagType:u}),h=c[a];if(!h?.length)return ti(new dn("Cannot read certificate"));let[{cert:m},...g]=h;if(!m)return ti(new dn("Issuer Certificate not found"));let x=f[u]?.[0].key;if(!x)return ti(new dn("Certificate Private Key not found"));let v=g.reduce((b,{cert:A})=>(A&&b.push(new N0.X509Certificate(Vh.default.pki.certificateToPem(A))),b),[]),S=Vh.default.pki.privateKeyToPem(x),E=Vh.default.pki.certificateToPem(m),C=N0.createPrivateKey(S),_=new N0.X509Certificate(E);return ri({ca:v,password:t,privateKey:C,certificate:_})}catch(t){return qu(t)}}async sign(e,t,n=Nu.SHA1){try{let i=N0.sign(n,Buffer.from(e),{key:t,padding:N0.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(ri(i))}catch(s){return Promise.resolve(qu(s))}}getCertificateInfo(e){return new p2().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new dn("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return ri(i);if(khe.isAbsolute(t)||vq.existsSync(t))return this.hitBufferOnCache(s,vq.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return qu(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return N0.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),ri(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var aDe={[Er.AC]:"America/Rio_Branco",[Er.AL]:"America/Maceio",[Er.AM]:"America/Manaus",[Er.AP]:"America/Belem",[Er.BA]:"America/Bahia",[Er.CE]:"America/Fortaleza",[Er.DF]:"America/Sao_Paulo",[Er.ES]:"America/Sao_Paulo",[Er.GO]:"America/Sao_Paulo",[Er.MA]:"America/Fortaleza",[Er.MG]:"America/Sao_Paulo",[Er.MS]:"America/Campo_Grande",[Er.MT]:"America/Cuiaba",[Er.PA]:"America/Belem",[Er.PB]:"America/Fortaleza",[Er.PE]:"America/Recife",[Er.PI]:"America/Fortaleza",[Er.PR]:"America/Sao_Paulo",[Er.RJ]:"America/Sao_Paulo",[Er.RN]:"America/Fortaleza",[Er.RO]:"America/Porto_Velho",[Er.RR]:"America/Boa_Vista",[Er.RS]:"America/Sao_Paulo",[Er.SC]:"America/Sao_Paulo",[Er.SE]:"America/Maceio",[Er.SP]:"America/Sao_Paulo",[Er.TO]:"America/Araguaina"};export{_C as a,gP as b,DC as c,Nu as d,BC as e,Er as f,Vhe as g,jhe as h,dn as i,vP as j,RC as k,Zh as l,ti as m,ri as n,yP as o,xP as p,$0 as q,dpe as r,mpe as s,tw as t,wP as u,SP as v,EP as w,Cpe as x,np as y,VP as z,lw as A,yq as B,v8 as C,x8 as D,N8 as E,wU as F,M9 as G,F9 as H,VTe as I,KTe as J,eIe as K,K9 as L,$9 as M,G9 as N,X9 as O,W9 as P,z9 as Q,J9 as R,Y9 as S,Q9 as T,Z9 as U,eq as V,tq as W,rq as X,nq as Y,sq as Z,iq as _,aq as $,oq as aa,uq as ba,cq as ca,lq as da,fq as ea,hq as fa,pq as ga,dq as ha,mq as ia,gq as ja,p2 as ka};
112
112
  /*! Bundled license information:
113
113
 
114
114
  lodash/lodash.js:
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{B as Lp,C as ed,D as td,E as od,F as Bp,G as Up,I as H,J as f,K as Or,d as Dp,f as d,g as jp,h as S,i as nt,k as Yi,m as it,n as Y,o as Tp,p as Vp,u as Mp,v as uo,x as w,y as lo,z as _p}from"./chunk-J2UBGQ3N.mjs";import{a,e as kf,f as ls}from"./chunk-W6MRGYXP.mjs";var Ct=(function(t){return t.Normal="1",t.EPEC="4",t.SVCAN="6",t.SVCRS="7",t.OFFLINE="9",t})({});var xr=(function(t){return t.Cancelamento="110111",t})({});var rd={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21"},Ki=process.env.NFETS_NFE_SCHEMAS_DIR??"",qp=rd;var Zi=class{static{a(this,"AccessKeyBuilder")}compile(e){let o=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),r=(e.identification??"").padStart(14,"0"),s=e.mod.toString().padStart(2,"0"),p=e.serie.toString().padStart(3,"0"),y=e.nNF.toString().padStart(9,"0"),m=e.tpEmis.toString().padStart(1,"0"),v=(e.cNF??this.code()).toString().padStart(8,"0"),N=`${o}${n}${i}${r}${s}${p}${y}${m}${v}`;return`${N}${this.verifyingDigit(N)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,r,s,p,y,m,v,N,b,F,h]=n;return{cUF:r,year:s,month:p,identification:y,mod:m,serie:v,nNF:N,tpEmis:b,cNF:F,vd:h}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let o=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let s=0;s<8&&n>=0;s++){let p=parseInt(e[n]);i+=p*o[s],n--}let r=11-i%11;return r>9?0:r}};var ki=class{static{a(this,"DefaultDetBuilderAggregator")}builder;constructor(e){this.builder=e}prod(e){let o=lo.from(0);this.builder.increment(({ICMSTot:n})=>({ICMSTot:{vProd:lo.newOrZero(n?.vProd).add(e.vProd).toFixed(2),vFrete:lo.newOrZero(n?.vFrete).add(e.vFrete??o).toFixed(2),vSeg:lo.newOrZero(n?.vSeg).add(e.vSeg??o).toFixed(2),vDesc:lo.newOrZero(n?.vDesc).add(e.vDesc??o).toFixed(2),vOutro:lo.newOrZero(n?.vOutro).add(e.vOutro??o).toFixed(2)}}))}icms(e){}};var ea=class{static{a(this,"DefaultTotalBuilderAggregator")}builder;constructor(e){this.builder=e}aggregate(){let e=lo.from(0);this.builder.increment(({ICMSTot:o,ISSQNtot:n})=>({ICMSTot:{vNF:lo.newOrZero(o?.vProd).sub(o?.vDesc??e).sub(o?.vICMSDeson??e).add(o?.vST??e).add(o?.vFCPST??e).add(o?.vFrete??e).add(o?.vSeg??e).add(o?.vOutro??e).add(o?.vII??e).add(o?.vIPI??e).add(o?.vIPIDevol??e).add(n?.vServ??e).toFixed(2)}}))}};function vi(t,e){return a(function(){return t.apply(e,arguments)},"wrap")}a(vi,"bind");var{toString:nd}=Object.prototype,{getPrototypeOf:vs}=Object,{iterator:oa,toStringTag:Hp}=Symbol,ra=(t=>e=>{let o=nd.call(e);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Lt=a(t=>(t=t.toLowerCase(),e=>ra(e)===t),"kindOfTest"),na=a(t=>e=>typeof e===t,"typeOfTest"),{isArray:Rn}=Array,bn=na("undefined");function yi(t){return t!==null&&!bn(t)&&t.constructor!==null&&!bn(t.constructor)&&mt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}a(yi,"isBuffer");var $p=Lt("ArrayBuffer");function id(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&$p(t.buffer),e}a(id,"isArrayBufferView");var ad=na("string"),mt=na("function"),Jp=na("number"),gi=a(t=>t!==null&&typeof t=="object","isObject"),sd=a(t=>t===!0||t===!1,"isBoolean"),ta=a(t=>{if(ra(t)!=="object")return!1;let e=vs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Hp in t)&&!(oa in t)},"isPlainObject"),pd=a(t=>{if(!gi(t)||yi(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},"isEmptyObject"),cd=Lt("Date"),fd=Lt("File"),dd=Lt("Blob"),ud=Lt("FileList"),ld=a(t=>gi(t)&&mt(t.pipe),"isStream"),md=a(t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||mt(t.append)&&((e=ra(t))==="formdata"||e==="object"&&mt(t.toString)&&t.toString()==="[object FormData]"))},"isFormData"),vd=Lt("URLSearchParams"),[yd,gd,hd,Sd]=["ReadableStream","Request","Response","Headers"].map(Lt),Nd=a(t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function hi(t,e,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Rn(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(yi(t))return;let r=o?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,p;for(n=0;n<s;n++)p=r[n],e.call(null,t[p],p,t)}}a(hi,"forEach");function Gp(t,e){if(yi(t))return null;e=e.toLowerCase();let o=Object.keys(t),n=o.length,i;for(;n-- >0;)if(i=o[n],e===i.toLowerCase())return i;return null}a(Gp,"findKey");var Jr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wp=a(t=>!bn(t)&&t!==Jr,"isContextDefined");function ms(){let{caseless:t,skipUndefined:e}=Wp(this)&&this||{},o={},n=a((i,r)=>{let s=t&&Gp(o,r)||r;ta(o[s])&&ta(i)?o[s]=ms(o[s],i):ta(i)?o[s]=ms({},i):Rn(i)?o[s]=i.slice():(!e||!bn(i))&&(o[s]=i)},"assignValue");for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&hi(arguments[i],n);return o}a(ms,"merge");var Cd=a((t,e,o,{allOwnKeys:n}={})=>(hi(e,(i,r)=>{o&&mt(i)?t[r]=vi(i,o):t[r]=i},{allOwnKeys:n}),t),"extend"),bd=a(t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),"stripBOM"),Rd=a((t,e,o,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},"inherits"),Fd=a((t,e,o,n)=>{let i,r,s,p={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)s=i[r],(!n||n(s,t,e))&&!p[s]&&(e[s]=t[s],p[s]=!0);t=o!==!1&&vs(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},"toFlatObject"),Id=a((t,e,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=e.length;let n=t.indexOf(e,o);return n!==-1&&n===o},"endsWith"),zd=a(t=>{if(!t)return null;if(Rn(t))return t;let e=t.length;if(!Jp(e))return null;let o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},"toArray"),Od=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&vs(Uint8Array)),xd=a((t,e)=>{let n=(t&&t[oa]).call(t),i;for(;(i=n.next())&&!i.done;){let r=i.value;e.call(t,r[0],r[1])}},"forEachEntry"),Ad=a((t,e)=>{let o,n=[];for(;(o=t.exec(e))!==null;)n.push(o);return n},"matchAll"),wd=Lt("HTMLFormElement"),Ed=a(t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function(o,n,i){return n.toUpperCase()+i},"replacer")),"toCamelCase"),Qp=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),Pd=Lt("RegExp"),Xp=a((t,e)=>{let o=Object.getOwnPropertyDescriptors(t),n={};hi(o,(i,r)=>{let s;(s=e(i,r,t))!==!1&&(n[r]=s||i)}),Object.defineProperties(t,n)},"reduceDescriptors"),Dd=a(t=>{Xp(t,(e,o)=>{if(mt(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let n=t[o];if(mt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},"freezeMethods"),jd=a((t,e)=>{let o={},n=a(i=>{i.forEach(r=>{o[r]=!0})},"define");return Rn(t)?n(t):n(String(t).split(e)),o},"toObjectSet"),Td=a(()=>{},"noop"),Vd=a((t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,"toFiniteNumber");function Md(t){return!!(t&&mt(t.append)&&t[Hp]==="FormData"&&t[oa])}a(Md,"isSpecCompliantForm");var _d=a(t=>{let e=new Array(10),o=a((n,i)=>{if(gi(n)){if(e.indexOf(n)>=0)return;if(yi(n))return n;if(!("toJSON"in n)){e[i]=n;let r=Rn(n)?[]:{};return hi(n,(s,p)=>{let y=o(s,i+1);!bn(y)&&(r[p]=y)}),e[i]=void 0,r}}return n},"visit");return o(t,0)},"toJSONObject"),Ld=Lt("AsyncFunction"),Bd=a(t=>t&&(gi(t)||mt(t))&&mt(t.then)&&mt(t.catch),"isThenable"),Yp=((t,e)=>t?setImmediate:e?((o,n)=>(Jr.addEventListener("message",({source:i,data:r})=>{i===Jr&&r===o&&n.length&&n.shift()()},!1),i=>{n.push(i),Jr.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",mt(Jr.postMessage)),Ud=typeof queueMicrotask<"u"?queueMicrotask.bind(Jr):typeof process<"u"&&process.nextTick||Yp,qd=a(t=>t!=null&&mt(t[oa]),"isIterable"),c={isArray:Rn,isArrayBuffer:$p,isBuffer:yi,isFormData:md,isArrayBufferView:id,isString:ad,isNumber:Jp,isBoolean:sd,isObject:gi,isPlainObject:ta,isEmptyObject:pd,isReadableStream:yd,isRequest:gd,isResponse:hd,isHeaders:Sd,isUndefined:bn,isDate:cd,isFile:fd,isBlob:dd,isRegExp:Pd,isFunction:mt,isStream:ld,isURLSearchParams:vd,isTypedArray:Od,isFileList:ud,forEach:hi,merge:ms,extend:Cd,trim:Nd,stripBOM:bd,inherits:Rd,toFlatObject:Fd,kindOf:ra,kindOfTest:Lt,endsWith:Id,toArray:zd,forEachEntry:xd,matchAll:Ad,isHTMLForm:wd,hasOwnProperty:Qp,hasOwnProp:Qp,reduceDescriptors:Xp,freezeMethods:Dd,toObjectSet:jd,toCamelCase:Ed,noop:Td,toFiniteNumber:Vd,findKey:Gp,global:Jr,isContextDefined:Wp,isSpecCompliantForm:Md,toJSONObject:_d,isAsyncFn:Ld,isThenable:Bd,setImmediate:Yp,asap:Ud,isIterable:qd};function Fn(t,e,o,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}a(Fn,"AxiosError");c.inherits(Fn,Error,{toJSON:a(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var Kp=Fn.prototype,Zp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Zp[t]={value:t}});Object.defineProperties(Fn,Zp);Object.defineProperty(Kp,"isAxiosError",{value:!0});Fn.from=(t,e,o,n,i,r)=>{let s=Object.create(Kp);c.toFlatObject(t,s,a(function(v){return v!==Error.prototype},"filter"),m=>m!=="isAxiosError");let p=t&&t.message?t.message:"Error",y=e==null&&t?t.code:e;return Fn.call(s,p,y,o,n,i),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var R=Fn;var kp=ls(ed(),1),ia=kp.default;function ys(t){return c.isPlainObject(t)||c.isArray(t)}a(ys,"isVisitable");function tc(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}a(tc,"removeBrackets");function ec(t,e,o){return t?t.concat(e).map(a(function(i,r){return i=tc(i),!o&&r?"["+i+"]":i},"each")).join(o?".":""):e}a(ec,"renderKey");function Qd(t){return c.isArray(t)&&!t.some(ys)}a(Qd,"isFlatArray");var Hd=c.toFlatObject(c,{},null,a(function(e){return/^is[A-Z]/.test(e)},"filter"));function $d(t,e,o){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(ia||FormData),o=c.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,a(function(I,C){return!c.isUndefined(C[I])},"defined"));let n=o.metaTokens,i=o.visitor||v,r=o.dots,s=o.indexes,y=(o.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(i))throw new TypeError("visitor must be a function");function m(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(c.isBoolean(h))return h.toString();if(!y&&c.isBlob(h))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?y&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}a(m,"convertValue");function v(h,I,C){let Q=h;if(h&&!C&&typeof h=="object"){if(c.endsWith(I,"{}"))I=n?I:I.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&Qd(h)||(c.isFileList(h)||c.endsWith(I,"[]"))&&(Q=c.toArray(h)))return I=tc(I),Q.forEach(a(function(B,me){!(c.isUndefined(B)||B===null)&&e.append(s===!0?ec([I],me,r):s===null?I:I+"[]",m(B))},"each")),!1}return ys(h)?!0:(e.append(ec(C,I,r),m(h)),!1)}a(v,"defaultVisitor");let N=[],b=Object.assign(Hd,{defaultVisitor:v,convertValue:m,isVisitable:ys});function F(h,I){if(!c.isUndefined(h)){if(N.indexOf(h)!==-1)throw Error("Circular reference detected in "+I.join("."));N.push(h),c.forEach(h,a(function(Q,X){(!(c.isUndefined(Q)||Q===null)&&i.call(e,Q,c.isString(X)?X.trim():X,I,b))===!0&&F(Q,I?I.concat(X):[X])},"each")),N.pop()}}if(a(F,"build"),!c.isObject(t))throw new TypeError("data must be an object");return F(t),e}a($d,"toFormData");var Ar=$d;function oc(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,a(function(n){return e[n]},"replacer"))}a(oc,"encode");function rc(t,e){this._pairs=[],t&&Ar(t,this,e)}a(rc,"AxiosURLSearchParams");var nc=rc.prototype;nc.append=a(function(e,o){this._pairs.push([e,o])},"append");nc.toString=a(function(e){let o=e?function(n){return e.call(this,n,oc)}:oc;return this._pairs.map(a(function(i){return o(i[0])+"="+o(i[1])},"each"),"").join("&")},"toString");var ic=rc;function Jd(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}a(Jd,"encode");function Gr(t,e,o){if(!e)return t;let n=o&&o.encode||Jd;c.isFunction(o)&&(o={serialize:o});let i=o&&o.serialize,r;if(i?r=i(e,o):r=c.isURLSearchParams(e)?e.toString():new ic(e,o).toString(n),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}a(Gr,"buildURL");var Gd=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,o,n){return this.handlers.push({fulfilled:e,rejected:o,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,a(function(n){n!==null&&e(n)},"forEachHandler"))}},gs=Gd;var In={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Xd from"crypto";import Wd from"url";var ac=Wd.URLSearchParams;var hs="abcdefghijklmnopqrstuvwxyz",sc="0123456789",pc={DIGIT:sc,ALPHA:hs,ALPHA_DIGIT:hs+hs.toUpperCase()+sc},Yd=a((t=16,e=pc.ALPHA_DIGIT)=>{let o="",{length:n}=e,i=new Uint32Array(t);Xd.randomFillSync(i);for(let r=0;r<t;r++)o+=e[i[r]%n];return o},"generateString"),cc={isNode:!0,classes:{URLSearchParams:ac,FormData:ia,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:pc,generateString:Yd,protocols:["http","https","file","data"]};var Cs={};kf(Cs,{hasBrowserEnv:()=>Ns,hasStandardBrowserEnv:()=>Kd,hasStandardBrowserWebWorkerEnv:()=>Zd,navigator:()=>Ss,origin:()=>kd});var Ns=typeof window<"u"&&typeof document<"u",Ss=typeof navigator=="object"&&navigator||void 0,Kd=Ns&&(!Ss||["ReactNative","NativeScript","NS"].indexOf(Ss.product)<0),Zd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kd=Ns&&window.location.href||"http://localhost";var U={...Cs,...cc};function bs(t,e){return Ar(t,new U.classes.URLSearchParams,{visitor:a(function(o,n,i,r){return U.isNode&&c.isBuffer(o)?(this.append(n,o.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},"visitor"),...e})}a(bs,"toURLEncodedForm");function eu(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}a(eu,"parsePropPath");function tu(t){let e={},o=Object.keys(t),n,i=o.length,r;for(n=0;n<i;n++)r=o[n],e[r]=t[r];return e}a(tu,"arrayToObject");function ou(t){function e(o,n,i,r){let s=o[r++];if(s==="__proto__")return!0;let p=Number.isFinite(+s),y=r>=o.length;return s=!s&&c.isArray(i)?i.length:s,y?(c.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!p):((!i[s]||!c.isObject(i[s]))&&(i[s]=[]),e(o,n,i[s],r)&&c.isArray(i[s])&&(i[s]=tu(i[s])),!p)}if(a(e,"buildPath"),c.isFormData(t)&&c.isFunction(t.entries)){let o={};return c.forEachEntry(t,(n,i)=>{e(eu(n),i,o,0)}),o}return null}a(ou,"formDataToJSON");var aa=ou;function ru(t,e,o){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(o||JSON.stringify)(t)}a(ru,"stringifySafely");var Rs={transitional:In,adapter:["xhr","http","fetch"],transformRequest:[a(function(e,o){let n=o.getContentType()||"",i=n.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return i?JSON.stringify(aa(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let p;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return bs(e,this.formSerializer).toString();if((p=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){let y=this.env&&this.env.FormData;return Ar(p?{"files[]":e}:e,y&&new y,this.formSerializer)}}return r||i?(o.setContentType("application/json",!1),ru(e)):e},"transformRequest")],transformResponse:[a(function(e){let o=this.transitional||Rs.transitional,n=o&&o.forcedJSONParsing,i=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(n&&!this.responseType||i)){let s=!(o&&o.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(p){if(s)throw p.name==="SyntaxError"?R.from(p,R.ERR_BAD_RESPONSE,this,null,this.response):p}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:a(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{Rs.headers[t]={}});var zn=Rs;var nu=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fc=a((t=>{let e={},o,n,i;return t&&t.split(`
2
+ import{B as Lp,C as ed,D as td,E as od,F as Bp,G as Up,I as H,J as f,K as Or,d as Dp,f as d,g as jp,h as S,i as nt,k as Yi,m as it,n as Y,o as Tp,p as Vp,u as Mp,v as uo,x as w,y as lo,z as _p}from"./chunk-5WJRZEHZ.mjs";import{a,e as kf,f as ls}from"./chunk-W6MRGYXP.mjs";var Ct=(function(t){return t.Normal="1",t.EPEC="4",t.SVCAN="6",t.SVCRS="7",t.OFFLINE="9",t})({});var xr=(function(t){return t.Cancelamento="110111",t})({});var rd={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21"},Ki=process.env.NFETS_NFE_SCHEMAS_DIR??"",qp=rd;var Zi=class{static{a(this,"AccessKeyBuilder")}compile(e){let o=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),r=(e.identification??"").padStart(14,"0"),s=e.mod.toString().padStart(2,"0"),p=e.serie.toString().padStart(3,"0"),y=e.nNF.toString().padStart(9,"0"),m=e.tpEmis.toString().padStart(1,"0"),v=(e.cNF??this.code()).toString().padStart(8,"0"),N=`${o}${n}${i}${r}${s}${p}${y}${m}${v}`;return`${N}${this.verifyingDigit(N)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,r,s,p,y,m,v,N,b,F,h]=n;return{cUF:r,year:s,month:p,identification:y,mod:m,serie:v,nNF:N,tpEmis:b,cNF:F,vd:h}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let o=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let s=0;s<8&&n>=0;s++){let p=parseInt(e[n]);i+=p*o[s],n--}let r=11-i%11;return r>9?0:r}};var ki=class{static{a(this,"DefaultDetBuilderAggregator")}builder;constructor(e){this.builder=e}prod(e){let o=lo.from(0);this.builder.increment(({ICMSTot:n})=>({ICMSTot:{vProd:lo.newOrZero(n?.vProd).add(e.vProd).toFixed(2),vFrete:lo.newOrZero(n?.vFrete).add(e.vFrete??o).toFixed(2),vSeg:lo.newOrZero(n?.vSeg).add(e.vSeg??o).toFixed(2),vDesc:lo.newOrZero(n?.vDesc).add(e.vDesc??o).toFixed(2),vOutro:lo.newOrZero(n?.vOutro).add(e.vOutro??o).toFixed(2)}}))}icms(e){}};var ea=class{static{a(this,"DefaultTotalBuilderAggregator")}builder;constructor(e){this.builder=e}aggregate(){let e=lo.from(0);this.builder.increment(({ICMSTot:o,ISSQNtot:n})=>({ICMSTot:{vNF:lo.newOrZero(o?.vProd).sub(o?.vDesc??e).sub(o?.vICMSDeson??e).add(o?.vST??e).add(o?.vFCPST??e).add(o?.vFrete??e).add(o?.vSeg??e).add(o?.vOutro??e).add(o?.vII??e).add(o?.vIPI??e).add(o?.vIPIDevol??e).add(n?.vServ??e).toFixed(2)}}))}};function vi(t,e){return a(function(){return t.apply(e,arguments)},"wrap")}a(vi,"bind");var{toString:nd}=Object.prototype,{getPrototypeOf:vs}=Object,{iterator:oa,toStringTag:Hp}=Symbol,ra=(t=>e=>{let o=nd.call(e);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Lt=a(t=>(t=t.toLowerCase(),e=>ra(e)===t),"kindOfTest"),na=a(t=>e=>typeof e===t,"typeOfTest"),{isArray:Rn}=Array,bn=na("undefined");function yi(t){return t!==null&&!bn(t)&&t.constructor!==null&&!bn(t.constructor)&&mt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}a(yi,"isBuffer");var $p=Lt("ArrayBuffer");function id(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&$p(t.buffer),e}a(id,"isArrayBufferView");var ad=na("string"),mt=na("function"),Jp=na("number"),gi=a(t=>t!==null&&typeof t=="object","isObject"),sd=a(t=>t===!0||t===!1,"isBoolean"),ta=a(t=>{if(ra(t)!=="object")return!1;let e=vs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Hp in t)&&!(oa in t)},"isPlainObject"),pd=a(t=>{if(!gi(t)||yi(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},"isEmptyObject"),cd=Lt("Date"),fd=Lt("File"),dd=Lt("Blob"),ud=Lt("FileList"),ld=a(t=>gi(t)&&mt(t.pipe),"isStream"),md=a(t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||mt(t.append)&&((e=ra(t))==="formdata"||e==="object"&&mt(t.toString)&&t.toString()==="[object FormData]"))},"isFormData"),vd=Lt("URLSearchParams"),[yd,gd,hd,Sd]=["ReadableStream","Request","Response","Headers"].map(Lt),Nd=a(t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function hi(t,e,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Rn(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(yi(t))return;let r=o?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,p;for(n=0;n<s;n++)p=r[n],e.call(null,t[p],p,t)}}a(hi,"forEach");function Gp(t,e){if(yi(t))return null;e=e.toLowerCase();let o=Object.keys(t),n=o.length,i;for(;n-- >0;)if(i=o[n],e===i.toLowerCase())return i;return null}a(Gp,"findKey");var Jr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wp=a(t=>!bn(t)&&t!==Jr,"isContextDefined");function ms(){let{caseless:t,skipUndefined:e}=Wp(this)&&this||{},o={},n=a((i,r)=>{let s=t&&Gp(o,r)||r;ta(o[s])&&ta(i)?o[s]=ms(o[s],i):ta(i)?o[s]=ms({},i):Rn(i)?o[s]=i.slice():(!e||!bn(i))&&(o[s]=i)},"assignValue");for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&hi(arguments[i],n);return o}a(ms,"merge");var Cd=a((t,e,o,{allOwnKeys:n}={})=>(hi(e,(i,r)=>{o&&mt(i)?t[r]=vi(i,o):t[r]=i},{allOwnKeys:n}),t),"extend"),bd=a(t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),"stripBOM"),Rd=a((t,e,o,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},"inherits"),Fd=a((t,e,o,n)=>{let i,r,s,p={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)s=i[r],(!n||n(s,t,e))&&!p[s]&&(e[s]=t[s],p[s]=!0);t=o!==!1&&vs(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},"toFlatObject"),Id=a((t,e,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=e.length;let n=t.indexOf(e,o);return n!==-1&&n===o},"endsWith"),zd=a(t=>{if(!t)return null;if(Rn(t))return t;let e=t.length;if(!Jp(e))return null;let o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},"toArray"),Od=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&vs(Uint8Array)),xd=a((t,e)=>{let n=(t&&t[oa]).call(t),i;for(;(i=n.next())&&!i.done;){let r=i.value;e.call(t,r[0],r[1])}},"forEachEntry"),Ad=a((t,e)=>{let o,n=[];for(;(o=t.exec(e))!==null;)n.push(o);return n},"matchAll"),wd=Lt("HTMLFormElement"),Ed=a(t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function(o,n,i){return n.toUpperCase()+i},"replacer")),"toCamelCase"),Qp=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),Pd=Lt("RegExp"),Xp=a((t,e)=>{let o=Object.getOwnPropertyDescriptors(t),n={};hi(o,(i,r)=>{let s;(s=e(i,r,t))!==!1&&(n[r]=s||i)}),Object.defineProperties(t,n)},"reduceDescriptors"),Dd=a(t=>{Xp(t,(e,o)=>{if(mt(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let n=t[o];if(mt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},"freezeMethods"),jd=a((t,e)=>{let o={},n=a(i=>{i.forEach(r=>{o[r]=!0})},"define");return Rn(t)?n(t):n(String(t).split(e)),o},"toObjectSet"),Td=a(()=>{},"noop"),Vd=a((t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,"toFiniteNumber");function Md(t){return!!(t&&mt(t.append)&&t[Hp]==="FormData"&&t[oa])}a(Md,"isSpecCompliantForm");var _d=a(t=>{let e=new Array(10),o=a((n,i)=>{if(gi(n)){if(e.indexOf(n)>=0)return;if(yi(n))return n;if(!("toJSON"in n)){e[i]=n;let r=Rn(n)?[]:{};return hi(n,(s,p)=>{let y=o(s,i+1);!bn(y)&&(r[p]=y)}),e[i]=void 0,r}}return n},"visit");return o(t,0)},"toJSONObject"),Ld=Lt("AsyncFunction"),Bd=a(t=>t&&(gi(t)||mt(t))&&mt(t.then)&&mt(t.catch),"isThenable"),Yp=((t,e)=>t?setImmediate:e?((o,n)=>(Jr.addEventListener("message",({source:i,data:r})=>{i===Jr&&r===o&&n.length&&n.shift()()},!1),i=>{n.push(i),Jr.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",mt(Jr.postMessage)),Ud=typeof queueMicrotask<"u"?queueMicrotask.bind(Jr):typeof process<"u"&&process.nextTick||Yp,qd=a(t=>t!=null&&mt(t[oa]),"isIterable"),c={isArray:Rn,isArrayBuffer:$p,isBuffer:yi,isFormData:md,isArrayBufferView:id,isString:ad,isNumber:Jp,isBoolean:sd,isObject:gi,isPlainObject:ta,isEmptyObject:pd,isReadableStream:yd,isRequest:gd,isResponse:hd,isHeaders:Sd,isUndefined:bn,isDate:cd,isFile:fd,isBlob:dd,isRegExp:Pd,isFunction:mt,isStream:ld,isURLSearchParams:vd,isTypedArray:Od,isFileList:ud,forEach:hi,merge:ms,extend:Cd,trim:Nd,stripBOM:bd,inherits:Rd,toFlatObject:Fd,kindOf:ra,kindOfTest:Lt,endsWith:Id,toArray:zd,forEachEntry:xd,matchAll:Ad,isHTMLForm:wd,hasOwnProperty:Qp,hasOwnProp:Qp,reduceDescriptors:Xp,freezeMethods:Dd,toObjectSet:jd,toCamelCase:Ed,noop:Td,toFiniteNumber:Vd,findKey:Gp,global:Jr,isContextDefined:Wp,isSpecCompliantForm:Md,toJSONObject:_d,isAsyncFn:Ld,isThenable:Bd,setImmediate:Yp,asap:Ud,isIterable:qd};function Fn(t,e,o,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}a(Fn,"AxiosError");c.inherits(Fn,Error,{toJSON:a(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var Kp=Fn.prototype,Zp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Zp[t]={value:t}});Object.defineProperties(Fn,Zp);Object.defineProperty(Kp,"isAxiosError",{value:!0});Fn.from=(t,e,o,n,i,r)=>{let s=Object.create(Kp);c.toFlatObject(t,s,a(function(v){return v!==Error.prototype},"filter"),m=>m!=="isAxiosError");let p=t&&t.message?t.message:"Error",y=e==null&&t?t.code:e;return Fn.call(s,p,y,o,n,i),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var R=Fn;var kp=ls(ed(),1),ia=kp.default;function ys(t){return c.isPlainObject(t)||c.isArray(t)}a(ys,"isVisitable");function tc(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}a(tc,"removeBrackets");function ec(t,e,o){return t?t.concat(e).map(a(function(i,r){return i=tc(i),!o&&r?"["+i+"]":i},"each")).join(o?".":""):e}a(ec,"renderKey");function Qd(t){return c.isArray(t)&&!t.some(ys)}a(Qd,"isFlatArray");var Hd=c.toFlatObject(c,{},null,a(function(e){return/^is[A-Z]/.test(e)},"filter"));function $d(t,e,o){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(ia||FormData),o=c.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,a(function(I,C){return!c.isUndefined(C[I])},"defined"));let n=o.metaTokens,i=o.visitor||v,r=o.dots,s=o.indexes,y=(o.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(i))throw new TypeError("visitor must be a function");function m(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(c.isBoolean(h))return h.toString();if(!y&&c.isBlob(h))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?y&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}a(m,"convertValue");function v(h,I,C){let Q=h;if(h&&!C&&typeof h=="object"){if(c.endsWith(I,"{}"))I=n?I:I.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&Qd(h)||(c.isFileList(h)||c.endsWith(I,"[]"))&&(Q=c.toArray(h)))return I=tc(I),Q.forEach(a(function(B,me){!(c.isUndefined(B)||B===null)&&e.append(s===!0?ec([I],me,r):s===null?I:I+"[]",m(B))},"each")),!1}return ys(h)?!0:(e.append(ec(C,I,r),m(h)),!1)}a(v,"defaultVisitor");let N=[],b=Object.assign(Hd,{defaultVisitor:v,convertValue:m,isVisitable:ys});function F(h,I){if(!c.isUndefined(h)){if(N.indexOf(h)!==-1)throw Error("Circular reference detected in "+I.join("."));N.push(h),c.forEach(h,a(function(Q,X){(!(c.isUndefined(Q)||Q===null)&&i.call(e,Q,c.isString(X)?X.trim():X,I,b))===!0&&F(Q,I?I.concat(X):[X])},"each")),N.pop()}}if(a(F,"build"),!c.isObject(t))throw new TypeError("data must be an object");return F(t),e}a($d,"toFormData");var Ar=$d;function oc(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,a(function(n){return e[n]},"replacer"))}a(oc,"encode");function rc(t,e){this._pairs=[],t&&Ar(t,this,e)}a(rc,"AxiosURLSearchParams");var nc=rc.prototype;nc.append=a(function(e,o){this._pairs.push([e,o])},"append");nc.toString=a(function(e){let o=e?function(n){return e.call(this,n,oc)}:oc;return this._pairs.map(a(function(i){return o(i[0])+"="+o(i[1])},"each"),"").join("&")},"toString");var ic=rc;function Jd(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}a(Jd,"encode");function Gr(t,e,o){if(!e)return t;let n=o&&o.encode||Jd;c.isFunction(o)&&(o={serialize:o});let i=o&&o.serialize,r;if(i?r=i(e,o):r=c.isURLSearchParams(e)?e.toString():new ic(e,o).toString(n),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}a(Gr,"buildURL");var Gd=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,o,n){return this.handlers.push({fulfilled:e,rejected:o,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,a(function(n){n!==null&&e(n)},"forEachHandler"))}},gs=Gd;var In={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Xd from"crypto";import Wd from"url";var ac=Wd.URLSearchParams;var hs="abcdefghijklmnopqrstuvwxyz",sc="0123456789",pc={DIGIT:sc,ALPHA:hs,ALPHA_DIGIT:hs+hs.toUpperCase()+sc},Yd=a((t=16,e=pc.ALPHA_DIGIT)=>{let o="",{length:n}=e,i=new Uint32Array(t);Xd.randomFillSync(i);for(let r=0;r<t;r++)o+=e[i[r]%n];return o},"generateString"),cc={isNode:!0,classes:{URLSearchParams:ac,FormData:ia,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:pc,generateString:Yd,protocols:["http","https","file","data"]};var Cs={};kf(Cs,{hasBrowserEnv:()=>Ns,hasStandardBrowserEnv:()=>Kd,hasStandardBrowserWebWorkerEnv:()=>Zd,navigator:()=>Ss,origin:()=>kd});var Ns=typeof window<"u"&&typeof document<"u",Ss=typeof navigator=="object"&&navigator||void 0,Kd=Ns&&(!Ss||["ReactNative","NativeScript","NS"].indexOf(Ss.product)<0),Zd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kd=Ns&&window.location.href||"http://localhost";var U={...Cs,...cc};function bs(t,e){return Ar(t,new U.classes.URLSearchParams,{visitor:a(function(o,n,i,r){return U.isNode&&c.isBuffer(o)?(this.append(n,o.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},"visitor"),...e})}a(bs,"toURLEncodedForm");function eu(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}a(eu,"parsePropPath");function tu(t){let e={},o=Object.keys(t),n,i=o.length,r;for(n=0;n<i;n++)r=o[n],e[r]=t[r];return e}a(tu,"arrayToObject");function ou(t){function e(o,n,i,r){let s=o[r++];if(s==="__proto__")return!0;let p=Number.isFinite(+s),y=r>=o.length;return s=!s&&c.isArray(i)?i.length:s,y?(c.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!p):((!i[s]||!c.isObject(i[s]))&&(i[s]=[]),e(o,n,i[s],r)&&c.isArray(i[s])&&(i[s]=tu(i[s])),!p)}if(a(e,"buildPath"),c.isFormData(t)&&c.isFunction(t.entries)){let o={};return c.forEachEntry(t,(n,i)=>{e(eu(n),i,o,0)}),o}return null}a(ou,"formDataToJSON");var aa=ou;function ru(t,e,o){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(o||JSON.stringify)(t)}a(ru,"stringifySafely");var Rs={transitional:In,adapter:["xhr","http","fetch"],transformRequest:[a(function(e,o){let n=o.getContentType()||"",i=n.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return i?JSON.stringify(aa(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let p;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return bs(e,this.formSerializer).toString();if((p=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){let y=this.env&&this.env.FormData;return Ar(p?{"files[]":e}:e,y&&new y,this.formSerializer)}}return r||i?(o.setContentType("application/json",!1),ru(e)):e},"transformRequest")],transformResponse:[a(function(e){let o=this.transitional||Rs.transitional,n=o&&o.forcedJSONParsing,i=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(n&&!this.responseType||i)){let s=!(o&&o.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(p){if(s)throw p.name==="SyntaxError"?R.from(p,R.ERR_BAD_RESPONSE,this,null,this.response):p}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:a(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{Rs.headers[t]={}});var zn=Rs;var nu=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fc=a((t=>{let e={},o,n,i;return t&&t.split(`
3
3
  `).forEach(a(function(s){i=s.indexOf(":"),o=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!o||e[o]&&nu[o])&&(o==="set-cookie"?e[o]?e[o].push(n):e[o]=[n]:e[o]=e[o]?e[o]+", "+n:n)},"parser")),e}),"default");var dc=Symbol("internals");function Si(t){return t&&String(t).trim().toLowerCase()}a(Si,"normalizeHeader");function sa(t){return t===!1||t==null?t:c.isArray(t)?t.map(sa):String(t)}a(sa,"normalizeValue");function iu(t){let e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=o.exec(t);)e[n[1]]=n[2];return e}a(iu,"parseTokens");var au=a(t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()),"isValidHeaderName");function Fs(t,e,o,n,i){if(c.isFunction(n))return n.call(this,e,o);if(i&&(e=o),!!c.isString(e)){if(c.isString(n))return e.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(e)}}a(Fs,"matchHeaderValue");function su(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,o,n)=>o.toUpperCase()+n)}a(su,"formatHeader");function pu(t,e){let o=c.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+o,{value:a(function(i,r,s){return this[n].call(this,e,i,r,s)},"value"),configurable:!0})})}a(pu,"buildAccessors");var pa=class{static{a(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,o,n){let i=this;function r(p,y,m){let v=Si(y);if(!v)throw new Error("header name must be a non-empty string");let N=c.findKey(i,v);(!N||i[N]===void 0||m===!0||m===void 0&&i[N]!==!1)&&(i[N||y]=sa(p))}a(r,"setHeader");let s=a((p,y)=>c.forEach(p,(m,v)=>r(m,v,y)),"setHeaders");if(c.isPlainObject(e)||e instanceof this.constructor)s(e,o);else if(c.isString(e)&&(e=e.trim())&&!au(e))s(fc(e),o);else if(c.isObject(e)&&c.isIterable(e)){let p={},y,m;for(let v of e){if(!c.isArray(v))throw TypeError("Object iterator must return a key-value pair");p[m=v[0]]=(y=p[m])?c.isArray(y)?[...y,v[1]]:[y,v[1]]:v[1]}s(p,o)}else e!=null&&r(o,e,n);return this}get(e,o){if(e=Si(e),e){let n=c.findKey(this,e);if(n){let i=this[n];if(!o)return i;if(o===!0)return iu(i);if(c.isFunction(o))return o.call(this,i,n);if(c.isRegExp(o))return o.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,o){if(e=Si(e),e){let n=c.findKey(this,e);return!!(n&&this[n]!==void 0&&(!o||Fs(this,this[n],n,o)))}return!1}delete(e,o){let n=this,i=!1;function r(s){if(s=Si(s),s){let p=c.findKey(n,s);p&&(!o||Fs(n,n[p],p,o))&&(delete n[p],i=!0)}}return a(r,"deleteHeader"),c.isArray(e)?e.forEach(r):r(e),i}clear(e){let o=Object.keys(this),n=o.length,i=!1;for(;n--;){let r=o[n];(!e||Fs(this,this[r],r,e,!0))&&(delete this[r],i=!0)}return i}normalize(e){let o=this,n={};return c.forEach(this,(i,r)=>{let s=c.findKey(n,r);if(s){o[s]=sa(i),delete o[r];return}let p=e?su(r):String(r).trim();p!==r&&delete o[r],o[p]=sa(i),n[p]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let o=Object.create(null);return c.forEach(this,(n,i)=>{n!=null&&n!==!1&&(o[i]=e&&c.isArray(n)?n.join(", "):n)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,o])=>e+": "+o).join(`
4
4
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...o){let n=new this(e);return o.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[dc]=this[dc]={accessors:{}}).accessors,i=this.prototype;function r(s){let p=Si(s);n[p]||(pu(i,s),n[p]=!0)}return a(r,"defineAccessor"),c.isArray(e)?e.forEach(r):r(e),this}};pa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(pa.prototype,({value:t},e)=>{let o=e[0].toUpperCase()+e.slice(1);return{get:a(()=>t,"get"),set(n){this[o]=n}}});c.freezeMethods(pa);var de=pa;function Ni(t,e){let o=this||zn,n=e||o,i=de.from(n.headers),r=n.data;return c.forEach(t,a(function(p){r=p.call(o,r,i.normalize(),e?e.status:void 0)},"transform")),i.normalize(),r}a(Ni,"transformData");function Ci(t){return!!(t&&t.__CANCEL__)}a(Ci,"isCancel");function uc(t,e,o){R.call(this,t??"canceled",R.ERR_CANCELED,e,o),this.name="CanceledError"}a(uc,"CanceledError");c.inherits(uc,R,{__CANCEL__:!0});var bt=uc;function mo(t,e,o){let n=o.config.validateStatus;!o.status||!n||n(o.status)?t(o):e(new R("Request failed with status code "+o.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}a(mo,"settle");function Is(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}a(Is,"isAbsoluteURL");function zs(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}a(zs,"combineURLs");function Wr(t,e,o){let n=!Is(e);return t&&(n||o==!1)?zs(t,e):e}a(Wr,"buildFullPath");var Fc=ls(td(),1),Oc=ls(od(),1);import Iu from"http";import zu from"https";import Ic from"http2";import zc from"util";import Er from"zlib";var Xr="1.13.2";function bi(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}a(bi,"parseProtocol");var cu=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Os(t,e,o){let n=o&&o.Blob||U.classes.Blob,i=bi(t);if(e===void 0&&n&&(e=!0),i==="data"){t=i.length?t.slice(i.length+1):t;let r=cu.exec(t);if(!r)throw new R("Invalid URL",R.ERR_INVALID_URL);let s=r[1],p=r[2],y=r[3],m=Buffer.from(decodeURIComponent(y),p?"base64":"utf8");if(e){if(!n)throw new R("Blob is not supported",R.ERR_NOT_SUPPORT);return new n([m],{type:s})}return m}throw new R("Unsupported protocol "+i,R.ERR_NOT_SUPPORT)}a(Os,"fromDataURI");import wr from"stream";import fu from"stream";var xs=Symbol("internals"),du=class extends fu.Transform{static{a(this,"AxiosTransformStream")}constructor(e){e=c.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,i)=>!c.isUndefined(i[n])),super({readableHighWaterMark:e.chunkSize});let o=this[xs]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(o.isCaptured||(o.isCaptured=!0))})}_read(e){let o=this[xs];return o.onReadCallback&&o.onReadCallback(),super._read(e)}_transform(e,o,n){let i=this[xs],r=i.maxRate,s=this.readableHighWaterMark,p=i.timeWindow,y=1e3/p,m=r/y,v=i.minChunkSize!==!1?Math.max(i.minChunkSize,m*.01):0,N=a((F,h)=>{let I=Buffer.byteLength(F);i.bytesSeen+=I,i.bytes+=I,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(F)?process.nextTick(h):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(h)}},"pushChunk"),b=a((F,h)=>{let I=Buffer.byteLength(F),C=null,Q=s,X,B=0;if(r){let me=Date.now();(!i.ts||(B=me-i.ts)>=p)&&(i.ts=me,X=m-i.bytes,i.bytes=X<0?-X:0,B=0),X=m-i.bytes}if(r){if(X<=0)return setTimeout(()=>{h(null,F)},p-B);X<Q&&(Q=X)}Q&&I>Q&&I-Q>v&&(C=F.subarray(Q),F=F.subarray(0,Q)),N(F,C?()=>{process.nextTick(h,null,C)}:h)},"transformChunk");b(e,a(function F(h,I){if(h)return n(h);I?b(I,F):n(null)},"transformNextChunk"))}},As=du;import{EventEmitter as Ou}from"events";import lu from"util";import{Readable as mu}from"stream";var{asyncIterator:lc}=Symbol,uu=a(async function*(t){t.stream?yield*t.stream():t.arrayBuffer?yield await t.arrayBuffer():t[lc]?yield*t[lc]():yield t},"readBlob"),ca=uu;var vu=U.ALPHABET.ALPHA_DIGIT+"-_",Ri=typeof TextEncoder=="function"?new TextEncoder:new lu.TextEncoder,Yr=`\r
5
5
  `,yu=Ri.encode(Yr),gu=2,hu=class{static{a(this,"FormDataPart")}constructor(e,o){let{escapeName:n}=this.constructor,i=c.isString(o),r=`Content-Disposition: form-data; name="${n(e)}"${!i&&o.name?`; filename="${n(o.name)}"`:""}${Yr}`;i?o=Ri.encode(String(o).replace(/\r?\n|\r\n?/g,Yr)):r+=`Content-Type: ${o.type||"application/octet-stream"}${Yr}`,this.headers=Ri.encode(r+Yr),this.contentLength=i?o.byteLength:o.size,this.size=this.headers.byteLength+this.contentLength+gu,this.name=e,this.value=o}async*encode(){yield this.headers;let{value:e}=this;c.isTypedArray(e)?yield e:yield*ca(e),yield yu}static escapeName(e){return String(e).replace(/[\r\n"]/g,o=>({"\r":"%0D","\n":"%0A",'"':"%22"})[o])}},Su=a((t,e,o)=>{let{tag:n="form-data-boundary",size:i=25,boundary:r=n+"-"+U.generateString(i,vu)}=o||{};if(!c.isFormData(t))throw TypeError("FormData instance required");if(r.length<1||r.length>70)throw Error("boundary must be 10-70 characters long");let s=Ri.encode("--"+r+Yr),p=Ri.encode("--"+r+"--"+Yr),y=p.byteLength,m=Array.from(t.entries()).map(([N,b])=>{let F=new hu(N,b);return y+=F.size,F});y+=s.byteLength*m.length,y=c.toFiniteNumber(y);let v={"Content-Type":`multipart/form-data; boundary=${r}`};return Number.isFinite(y)&&(v["Content-Length"]=y),e&&e(v),mu.from((async function*(){for(let N of m)yield s,yield*N.encode();yield p})())},"formDataToStream"),mc=Su;import Nu from"stream";var Cu=class extends Nu.Transform{static{a(this,"ZlibHeaderTransformStream")}__transform(e,o,n){this.push(e),n()}_transform(e,o,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,o)}this.__transform(e,o,n)}},vc=Cu;var bu=a((t,e)=>c.isAsyncFn(t)?function(...o){let n=o.pop();t.apply(this,o).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(r){n(r)}},n)}:t,"callbackify"),yc=bu;function Ru(t,e){t=t||10;let o=new Array(t),n=new Array(t),i=0,r=0,s;return e=e!==void 0?e:1e3,a(function(y){let m=Date.now(),v=n[r];s||(s=m),o[i]=y,n[i]=m;let N=r,b=0;for(;N!==i;)b+=o[N++],N=N%t;if(i=(i+1)%t,i===r&&(r=(r+1)%t),m-s<e)return;let F=v&&m-v;return F?Math.round(b*1e3/F):void 0},"push")}a(Ru,"speedometer");var gc=Ru;function Fu(t,e){let o=0,n=1e3/e,i,r,s=a((m,v=Date.now())=>{o=v,i=null,r&&(clearTimeout(r),r=null),t(...m)},"invoke");return[a((...m)=>{let v=Date.now(),N=v-o;N>=n?s(m,v):(i=m,r||(r=setTimeout(()=>{r=null,s(i)},n-N)))},"throttled"),a(()=>i&&s(i),"flush")]}a(Fu,"throttle");var hc=Fu;var To=a((t,e,o=3)=>{let n=0,i=gc(50,250);return hc(r=>{let s=r.loaded,p=r.lengthComputable?r.total:void 0,y=s-n,m=i(y),v=s<=p;n=s;let N={loaded:s,total:p,progress:p?s/p:void 0,bytes:y,rate:m||void 0,estimated:m&&p&&v?(p-s)/m:void 0,event:r,lengthComputable:p!=null,[e?"download":"upload"]:!0};t(N)},o)},"progressEventReducer"),On=a((t,e)=>{let o=t!=null;return[n=>e[0]({lengthComputable:o,total:t,loaded:n}),e[1]]},"progressEventDecorator"),xn=a(t=>(...e)=>c.asap(()=>t(...e)),"asyncDecorator");function ws(t){if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;let e=t.indexOf(",");if(e<0)return 0;let o=t.slice(5,e),n=t.slice(e+1);if(/;base64/i.test(o)){let r=n.length,s=n.length;for(let b=0;b<s;b++)if(n.charCodeAt(b)===37&&b+2<s){let F=n.charCodeAt(b+1),h=n.charCodeAt(b+2);(F>=48&&F<=57||F>=65&&F<=70||F>=97&&F<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(r-=2,b+=2)}let p=0,y=s-1,m=a(b=>b>=2&&n.charCodeAt(b-2)===37&&n.charCodeAt(b-1)===51&&(n.charCodeAt(b)===68||n.charCodeAt(b)===100),"tailIsPct3D");y>=0&&(n.charCodeAt(y)===61?(p++,y--):m(y)&&(p++,y-=3)),p===1&&y>=0&&(n.charCodeAt(y)===61||m(y))&&p++;let N=Math.floor(r/4)*3-(p||0);return N>0?N:0}return Buffer.byteLength(n,"utf8")}a(ws,"estimateDataURLDecodedBytes");var Sc={flush:Er.constants.Z_SYNC_FLUSH,finishFlush:Er.constants.Z_SYNC_FLUSH},xu={flush:Er.constants.BROTLI_OPERATION_FLUSH,finishFlush:Er.constants.BROTLI_OPERATION_FLUSH},Nc=c.isFunction(Er.createBrotliDecompress),{http:Au,https:wu}=Oc.default,Eu=/https:?/,Cc=U.protocols.map(t=>t+":"),bc=a((t,[e,o])=>(t.on("end",o).on("error",o),e),"flushOnFinish"),Pu=class{static{a(this,"Http2Sessions")}constructor(){this.sessions=Object.create(null)}getSession(e,o){o=Object.assign({sessionTimeout:1e3},o);let n=this.sessions[e];if(n){let v=n.length;for(let N=0;N<v;N++){let[b,F]=n[N];if(!b.destroyed&&!b.closed&&zc.isDeepStrictEqual(F,o))return b}}let i=Ic.connect(e,o),r,s=a(()=>{if(r)return;r=!0;let v=n,N=v.length,b=N;for(;b--;)if(v[b][0]===i){N===1?delete this.sessions[e]:v.splice(b,1);return}},"removeSession"),p=i.request,{sessionTimeout:y}=o;if(y!=null){let v,N=0;i.request=function(){let b=p.apply(this,arguments);return N++,v&&(clearTimeout(v),v=null),b.once("close",()=>{--N||(v=setTimeout(()=>{v=null,s()},y))}),b}}i.once("close",s);let m=[i,o];return n?n.push(m):n=this.sessions[e]=[m],i}},Du=new Pu;function ju(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}a(ju,"dispatchBeforeRedirect");function xc(t,e,o){let n=e;if(!n&&n!==!1){let i=Fc.default.getProxyForUrl(o);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let r=Buffer.from(n.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+r}t.headers.host=t.hostname+(t.port?":"+t.port:"");let i=n.hostname||n.host;t.hostname=i,t.host=i,t.port=n.port,t.path=o,n.protocol&&(t.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}t.beforeRedirects.proxy=a(function(r){xc(r,e,r.href)},"beforeRedirect")}a(xc,"setProxy");var Tu=typeof process<"u"&&c.kindOf(process)==="process",Vu=a(t=>new Promise((e,o)=>{let n,i,r=a((y,m)=>{i||(i=!0,n&&n(y,m))},"done"),s=a(y=>{r(y),e(y)},"_resolve"),p=a(y=>{r(y,!0),o(y)},"_reject");t(s,p,y=>n=y).catch(p)}),"wrapAsync"),Mu=a(({address:t,family:e})=>{if(!c.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},"resolveFamily"),Rc=a((t,e)=>Mu(c.isObject(t)?t:{address:t,family:e}),"buildAddressEntry"),_u={request(t,e){let o=t.protocol+"//"+t.hostname+":"+(t.port||80),{http2Options:n,headers:i}=t,r=Du.getSession(o,n),{HTTP2_HEADER_SCHEME:s,HTTP2_HEADER_METHOD:p,HTTP2_HEADER_PATH:y,HTTP2_HEADER_STATUS:m}=Ic.constants,v={[s]:t.protocol.replace(":",""),[p]:t.method,[y]:t.path};c.forEach(i,(b,F)=>{F.charAt(0)!==":"&&(v[F]=b)});let N=r.request(v);return N.once("response",b=>{let F=N;b=Object.assign({},b);let h=b[m];delete b[m],F.headers=b,F.statusCode=+h,e(F)}),N}},Ac=Tu&&a(function(e){return Vu(a(async function(n,i,r){let{data:s,lookup:p,family:y,httpVersion:m=1,http2Options:v}=e,{responseType:N,responseEncoding:b}=e,F=e.method.toUpperCase(),h,I=!1,C;if(m=+m,Number.isNaN(m))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(m!==1&&m!==2)throw TypeError(`Unsupported protocol version '${m}'`);let Q=m===2;if(p){let D=yc(p,O=>c.isArray(O)?O:[O]);p=a((O,G,Nt)=>{D(O,G,(ye,_t,zr)=>{if(ye)return Nt(ye);let lt=c.isArray(_t)?_t.map(Xi=>Rc(Xi)):[Rc(_t,zr)];G.all?Nt(ye,lt):Nt(ye,lt[0].address,lt[0].family)})},"lookup")}let X=new Ou;function B(D){try{X.emit("abort",!D||D.type?new bt(null,e,C):D)}catch(O){console.warn("emit error",O)}}a(B,"abort"),X.once("abort",i);let me=a(()=>{e.cancelToken&&e.cancelToken.unsubscribe(B),e.signal&&e.signal.removeEventListener("abort",B),X.removeAllListeners()},"onFinished");(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(B),e.signal&&(e.signal.aborted?B():e.signal.addEventListener("abort",B))),r((D,O)=>{if(h=!0,O){I=!0,me();return}let{data:G}=D;if(G instanceof wr.Readable||G instanceof wr.Duplex){let Nt=wr.finished(G,()=>{Nt(),me()})}else me()});let dt=Wr(e.baseURL,e.url,e.allowAbsoluteUrls),ve=new URL(dt,U.hasBrowserEnv?U.origin:void 0),Ae=ve.protocol||Cc[0];if(Ae==="data:"){if(e.maxContentLength>-1){let O=String(e.url||dt||"");if(ws(O)>e.maxContentLength)return i(new R("maxContentLength size of "+e.maxContentLength+" exceeded",R.ERR_BAD_RESPONSE,e))}let D;if(F!=="GET")return mo(n,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{D=Os(e.url,N==="blob",{Blob:e.env&&e.env.Blob})}catch(O){throw R.from(O,R.ERR_BAD_REQUEST,e)}return N==="text"?(D=D.toString(b),(!b||b==="utf8")&&(D=c.stripBOM(D))):N==="stream"&&(D=wr.Readable.from(D)),mo(n,i,{data:D,status:200,statusText:"OK",headers:new de,config:e})}if(Cc.indexOf(Ae)===-1)return i(new R("Unsupported protocol "+Ae,R.ERR_BAD_REQUEST,e));let _e=de.from(e.headers).normalize();_e.set("User-Agent","axios/"+Xr,!1);let{onUploadProgress:Fr,onDownloadProgress:Nn}=e,$r=e.maxRate,Do,fo;if(c.isSpecCompliantForm(s)){let D=_e.getContentType(/boundary=([-_\w\d]{10,70})/i);s=mc(s,O=>{_e.set(O)},{tag:`axios-${Xr}-boundary`,boundary:D&&D[1]||void 0})}else if(c.isFormData(s)&&c.isFunction(s.getHeaders)){if(_e.set(s.getHeaders()),!_e.hasContentLength())try{let D=await zc.promisify(s.getLength).call(s);Number.isFinite(D)&&D>=0&&_e.setContentLength(D)}catch{}}else if(c.isBlob(s)||c.isFile(s))s.size&&_e.setContentType(s.type||"application/octet-stream"),_e.setContentLength(s.size||0),s=wr.Readable.from(ca(s));else if(s&&!c.isStream(s)){if(!Buffer.isBuffer(s))if(c.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(c.isString(s))s=Buffer.from(s,"utf-8");else return i(new R("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",R.ERR_BAD_REQUEST,e));if(_e.setContentLength(s.length,!1),e.maxBodyLength>-1&&s.length>e.maxBodyLength)return i(new R("Request body larger than maxBodyLength limit",R.ERR_BAD_REQUEST,e))}let jo=c.toFiniteNumber(_e.getContentLength());c.isArray($r)?(Do=$r[0],fo=$r[1]):Do=fo=$r,s&&(Fr||Do)&&(c.isStream(s)||(s=wr.Readable.from(s,{objectMode:!1})),s=wr.pipeline([s,new As({maxRate:c.toFiniteNumber(Do)})],c.noop),Fr&&s.on("progress",bc(s,On(jo,To(xn(Fr),!1,3)))));let Ir;if(e.auth){let D=e.auth.username||"",O=e.auth.password||"";Ir=D+":"+O}if(!Ir&&ve.username){let D=ve.username,O=ve.password;Ir=D+":"+O}Ir&&_e.delete("authorization");let St;try{St=Gr(ve.pathname+ve.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(D){let O=new Error(D.message);return O.config=e,O.url=e.url,O.exists=!0,i(O)}_e.set("Accept-Encoding","gzip, compress, deflate"+(Nc?", br":""),!1);let Le={path:St,method:F,headers:_e.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:Ir,protocol:Ae,family:y,beforeRedirect:ju,beforeRedirects:{},http2Options:v};!c.isUndefined(p)&&(Le.lookup=p),e.socketPath?Le.socketPath=e.socketPath:(Le.hostname=ve.hostname.startsWith("[")?ve.hostname.slice(1,-1):ve.hostname,Le.port=ve.port,xc(Le,e.proxy,Ae+"//"+ve.hostname+(ve.port?":"+ve.port:"")+Le.path));let ut,Cn=Eu.test(Le.protocol);if(Le.agent=Cn?e.httpsAgent:e.httpAgent,Q?ut=_u:e.transport?ut=e.transport:e.maxRedirects===0?ut=Cn?zu:Iu:(e.maxRedirects&&(Le.maxRedirects=e.maxRedirects),e.beforeRedirect&&(Le.beforeRedirects.config=e.beforeRedirect),ut=Cn?wu:Au),e.maxBodyLength>-1?Le.maxBodyLength=e.maxBodyLength:Le.maxBodyLength=1/0,e.insecureHTTPParser&&(Le.insecureHTTPParser=e.insecureHTTPParser),C=ut.request(Le,a(function(O){if(C.destroyed)return;let G=[O],Nt=c.toFiniteNumber(O.headers["content-length"]);if(Nn||fo){let lt=new As({maxRate:c.toFiniteNumber(fo)});Nn&&lt.on("progress",bc(lt,On(Nt,To(xn(Nn),!0,3)))),G.push(lt)}let ye=O,_t=O.req||C;if(e.decompress!==!1&&O.headers["content-encoding"])switch((F==="HEAD"||O.statusCode===204)&&delete O.headers["content-encoding"],(O.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":G.push(Er.createUnzip(Sc)),delete O.headers["content-encoding"];break;case"deflate":G.push(new vc),G.push(Er.createUnzip(Sc)),delete O.headers["content-encoding"];break;case"br":Nc&&(G.push(Er.createBrotliDecompress(xu)),delete O.headers["content-encoding"])}ye=G.length>1?wr.pipeline(G,c.noop):G[0];let zr={status:O.statusCode,statusText:O.statusMessage,headers:new de(O.headers),config:e,request:_t};if(N==="stream")zr.data=ye,mo(n,i,zr);else{let lt=[],Xi=0;ye.on("data",a(function(rt){lt.push(rt),Xi+=rt.length,e.maxContentLength>-1&&Xi>e.maxContentLength&&(I=!0,ye.destroy(),B(new R("maxContentLength size of "+e.maxContentLength+" exceeded",R.ERR_BAD_RESPONSE,e,_t)))},"handleStreamData")),ye.on("aborted",a(function(){if(I)return;let rt=new R("stream has been aborted",R.ERR_BAD_RESPONSE,e,_t);ye.destroy(rt),i(rt)},"handlerStreamAborted")),ye.on("error",a(function(rt){C.destroyed||i(R.from(rt,null,e,_t))},"handleStreamError")),ye.on("end",a(function(){try{let rt=lt.length===1?lt[0]:Buffer.concat(lt);N!=="arraybuffer"&&(rt=rt.toString(b),(!b||b==="utf8")&&(rt=c.stripBOM(rt))),zr.data=rt}catch(rt){return i(R.from(rt,null,e,zr.request,zr))}mo(n,i,zr)},"handleStreamEnd"))}X.once("abort",lt=>{ye.destroyed||(ye.emit("error",lt),ye.destroy())})},"handleResponse")),X.once("abort",D=>{C.close?C.close():C.destroy(D)}),C.on("error",a(function(O){i(R.from(O,null,e,C))},"handleRequestError")),C.on("socket",a(function(O){O.setKeepAlive(!0,1e3*60)},"handleRequestSocket")),e.timeout){let D=parseInt(e.timeout,10);if(Number.isNaN(D)){B(new R("error trying to parse `config.timeout` to int",R.ERR_BAD_OPTION_VALUE,e,C));return}C.setTimeout(D,a(function(){if(h)return;let G=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",Nt=e.transitional||In;e.timeoutErrorMessage&&(G=e.timeoutErrorMessage),B(new R(G,Nt.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,C))},"handleRequestTimeout"))}else C.setTimeout(0);if(c.isStream(s)){let D=!1,O=!1;s.on("end",()=>{D=!0}),s.once("error",G=>{O=!0,C.destroy(G)}),s.on("close",()=>{!D&&!O&&B(new bt("Request stream has been aborted",e,C))}),s.pipe(C)}else s&&C.write(s),C.end()},"dispatchHttpRequest"))},"httpAdapter");var wc=U.hasStandardBrowserEnv?((t,e)=>o=>(o=new URL(o,U.origin),t.protocol===o.protocol&&t.host===o.host&&(e||t.port===o.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0;var Ec=U.hasStandardBrowserEnv?{write(t,e,o,n,i,r,s){if(typeof document>"u")return;let p=[`${t}=${encodeURIComponent(e)}`];c.isNumber(o)&&p.push(`expires=${new Date(o).toUTCString()}`),c.isString(n)&&p.push(`path=${n}`),c.isString(i)&&p.push(`domain=${i}`),r===!0&&p.push("secure"),c.isString(s)&&p.push(`SameSite=${s}`),document.cookie=p.join("; ")},read(t){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};var Pc=a(t=>t instanceof de?{...t}:t,"headersToObject");function Bt(t,e){e=e||{};let o={};function n(m,v,N,b){return c.isPlainObject(m)&&c.isPlainObject(v)?c.merge.call({caseless:b},m,v):c.isPlainObject(v)?c.merge({},v):c.isArray(v)?v.slice():v}a(n,"getMergedValue");function i(m,v,N,b){if(c.isUndefined(v)){if(!c.isUndefined(m))return n(void 0,m,N,b)}else return n(m,v,N,b)}a(i,"mergeDeepProperties");function r(m,v){if(!c.isUndefined(v))return n(void 0,v)}a(r,"valueFromConfig2");function s(m,v){if(c.isUndefined(v)){if(!c.isUndefined(m))return n(void 0,m)}else return n(void 0,v)}a(s,"defaultToConfig2");function p(m,v,N){if(N in e)return n(m,v);if(N in t)return n(void 0,m)}a(p,"mergeDirectKeys");let y={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:p,headers:a((m,v,N)=>i(Pc(m),Pc(v),N,!0),"headers")};return c.forEach(Object.keys({...t,...e}),a(function(v){let N=y[v]||i,b=N(t[v],e[v],v);c.isUndefined(b)&&N!==p||(o[v]=b)},"computeConfigValue")),o}a(Bt,"mergeConfig");var fa=a((t=>{let e=Bt({},t),{data:o,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:s,auth:p}=e;if(e.headers=s=de.from(s),e.url=Gr(Wr(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),p&&s.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):""))),c.isFormData(o)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(o.getHeaders)){let y=o.getHeaders(),m=["content-type","content-length"];Object.entries(y).forEach(([v,N])=>{m.includes(v.toLowerCase())&&s.set(v,N)})}}if(U.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(e)),n||n!==!1&&wc(e.url))){let y=i&&r&&Ec.read(r);y&&s.set(i,y)}return e}),"default");var Lu=typeof XMLHttpRequest<"u",Dc=Lu&&function(t){return new Promise(a(function(o,n){let i=fa(t),r=i.data,s=de.from(i.headers).normalize(),{responseType:p,onUploadProgress:y,onDownloadProgress:m}=i,v,N,b,F,h;function I(){F&&F(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(v),i.signal&&i.signal.removeEventListener("abort",v)}a(I,"done");let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function Q(){if(!C)return;let B=de.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),dt={data:!p||p==="text"||p==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:B,config:t,request:C};mo(a(function(Ae){o(Ae),I()},"_resolve"),a(function(Ae){n(Ae),I()},"_reject"),dt),C=null}a(Q,"onloadend"),"onloadend"in C?C.onloadend=Q:C.onreadystatechange=a(function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(Q)},"handleLoad"),C.onabort=a(function(){C&&(n(new R("Request aborted",R.ECONNABORTED,t,C)),C=null)},"handleAbort"),C.onerror=a(function(me){let dt=me&&me.message?me.message:"Network Error",ve=new R(dt,R.ERR_NETWORK,t,C);ve.event=me||null,n(ve),C=null},"handleError"),C.ontimeout=a(function(){let me=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",dt=i.transitional||In;i.timeoutErrorMessage&&(me=i.timeoutErrorMessage),n(new R(me,dt.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,t,C)),C=null},"handleTimeout"),r===void 0&&s.setContentType(null),"setRequestHeader"in C&&c.forEach(s.toJSON(),a(function(me,dt){C.setRequestHeader(dt,me)},"setRequestHeader")),c.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),p&&p!=="json"&&(C.responseType=i.responseType),m&&([b,h]=To(m,!0),C.addEventListener("progress",b)),y&&C.upload&&([N,F]=To(y),C.upload.addEventListener("progress",N),C.upload.addEventListener("loadend",F)),(i.cancelToken||i.signal)&&(v=a(B=>{C&&(n(!B||B.type?new bt(null,t,C):B),C.abort(),C=null)},"onCanceled"),i.cancelToken&&i.cancelToken.subscribe(v),i.signal&&(i.signal.aborted?v():i.signal.addEventListener("abort",v)));let X=bi(i.url);if(X&&U.protocols.indexOf(X)===-1){n(new R("Unsupported protocol "+X+":",R.ERR_BAD_REQUEST,t));return}C.send(r||null)},"dispatchXhrRequest"))};var Bu=a((t,e)=>{let{length:o}=t=t?t.filter(Boolean):[];if(e||o){let n=new AbortController,i,r=a(function(m){if(!i){i=!0,p();let v=m instanceof Error?m:this.reason;n.abort(v instanceof R?v:new bt(v instanceof Error?v.message:v))}},"onabort"),s=e&&setTimeout(()=>{s=null,r(new R(`timeout ${e} of ms exceeded`,R.ETIMEDOUT))},e),p=a(()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(m=>{m.unsubscribe?m.unsubscribe(r):m.removeEventListener("abort",r)}),t=null)},"unsubscribe");t.forEach(m=>m.addEventListener("abort",r));let{signal:y}=n;return y.unsubscribe=()=>c.asap(p),y}},"composeSignals"),jc=Bu;var Uu=a(function*(t,e){let o=t.byteLength;if(!e||o<e){yield t;return}let n=0,i;for(;n<o;)i=n+e,yield t.slice(n,i),n=i},"streamChunk"),qu=a(async function*(t,e){for await(let o of Qu(t))yield*Uu(o,e)},"readBytes"),Qu=a(async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:o,value:n}=await e.read();if(o)break;yield n}}finally{await e.cancel()}},"readStream"),Es=a((t,e,o,n)=>{let i=qu(t,e),r=0,s,p=a(y=>{s||(s=!0,n&&n(y))},"_onFinish");return new ReadableStream({async pull(y){try{let{done:m,value:v}=await i.next();if(m){p(),y.close();return}let N=v.byteLength;if(o){let b=r+=N;o(b)}y.enqueue(new Uint8Array(v))}catch(m){throw p(m),m}},cancel(y){return p(y),i.return()}},{highWaterMark:2})},"trackStream");var Tc=64*1024,{isFunction:da}=c,Hu=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:Vc,TextEncoder:Mc}=c.global,_c=a((t,...e)=>{try{return!!t(...e)}catch{return!1}},"test"),$u=a(t=>{t=c.merge.call({skipUndefined:!0},Hu,t);let{fetch:e,Request:o,Response:n}=t,i=e?da(e):typeof fetch=="function",r=da(o),s=da(n);if(!i)return!1;let p=i&&da(Vc),y=i&&(typeof Mc=="function"?(h=>I=>h.encode(I))(new Mc):async h=>new Uint8Array(await new o(h).arrayBuffer())),m=r&&p&&_c(()=>{let h=!1,I=new o(U.origin,{body:new Vc,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!I}),v=s&&p&&_c(()=>c.isReadableStream(new n("").body)),N={stream:v&&(h=>h.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!N[h]&&(N[h]=(I,C)=>{let Q=I&&I[h];if(Q)return Q.call(I);throw new R(`Response type '${h}' is not supported`,R.ERR_NOT_SUPPORT,C)})});let b=a(async h=>{if(h==null)return 0;if(c.isBlob(h))return h.size;if(c.isSpecCompliantForm(h))return(await new o(U.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(c.isArrayBufferView(h)||c.isArrayBuffer(h))return h.byteLength;if(c.isURLSearchParams(h)&&(h=h+""),c.isString(h))return(await y(h)).byteLength},"getBodyLength"),F=a(async(h,I)=>{let C=c.toFiniteNumber(h.getContentLength());return C??b(I)},"resolveBodyLength");return async h=>{let{url:I,method:C,data:Q,signal:X,cancelToken:B,timeout:me,onDownloadProgress:dt,onUploadProgress:ve,responseType:Ae,headers:_e,withCredentials:Fr="same-origin",fetchOptions:Nn}=fa(h),$r=e||fetch;Ae=Ae?(Ae+"").toLowerCase():"text";let Do=jc([X,B&&B.toAbortSignal()],me),fo=null,jo=Do&&Do.unsubscribe&&(()=>{Do.unsubscribe()}),Ir;try{if(ve&&m&&C!=="get"&&C!=="head"&&(Ir=await F(_e,Q))!==0){let O=new o(I,{method:"POST",body:Q,duplex:"half"}),G;if(c.isFormData(Q)&&(G=O.headers.get("content-type"))&&_e.setContentType(G),O.body){let[Nt,ye]=On(Ir,To(xn(ve)));Q=Es(O.body,Tc,Nt,ye)}}c.isString(Fr)||(Fr=Fr?"include":"omit");let St=r&&"credentials"in o.prototype,Le={...Nn,signal:Do,method:C.toUpperCase(),headers:_e.normalize().toJSON(),body:Q,duplex:"half",credentials:St?Fr:void 0};fo=r&&new o(I,Le);let ut=await(r?$r(fo,Nn):$r(I,Le)),Cn=v&&(Ae==="stream"||Ae==="response");if(v&&(dt||Cn&&jo)){let O={};["status","statusText","headers"].forEach(_t=>{O[_t]=ut[_t]});let G=c.toFiniteNumber(ut.headers.get("content-length")),[Nt,ye]=dt&&On(G,To(xn(dt),!0))||[];ut=new n(Es(ut.body,Tc,Nt,()=>{ye&&ye(),jo&&jo()}),O)}Ae=Ae||"text";let D=await N[c.findKey(N,Ae)||"text"](ut,h);return!Cn&&jo&&jo(),await new Promise((O,G)=>{mo(O,G,{data:D,headers:de.from(ut.headers),status:ut.status,statusText:ut.statusText,config:h,request:fo})})}catch(St){throw jo&&jo(),St&&St.name==="TypeError"&&/Load failed|fetch/i.test(St.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,h,fo),{cause:St.cause||St}):R.from(St,St&&St.code,h,fo)}}},"factory"),Ju=new Map,Ps=a(t=>{let e=t&&t.env||{},{fetch:o,Request:n,Response:i}=e,r=[n,i,o],s=r.length,p=s,y,m,v=Ju;for(;p--;)y=r[p],m=v.get(y),m===void 0&&v.set(y,m=p?new Map:$u(e)),v=m;return m},"getFetch"),zh=Ps();var Ds={http:Ac,xhr:Dc,fetch:{get:Ps}};c.forEach(Ds,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var Lc=a(t=>`- ${t}`,"renderReason"),Wu=a(t=>c.isFunction(t)||t===null||t===!1,"isResolvedHandle");function Xu(t,e){t=c.isArray(t)?t:[t];let{length:o}=t,n,i,r={};for(let s=0;s<o;s++){n=t[s];let p;if(i=n,!Wu(n)&&(i=Ds[(p=String(n)).toLowerCase()],i===void 0))throw new R(`Unknown adapter '${p}'`);if(i&&(c.isFunction(i)||(i=i.get(e))))break;r[p||"#"+s]=i}if(!i){let s=Object.entries(r).map(([y,m])=>`adapter ${y} `+(m===!1?"is not supported by the environment":"is not available in the build")),p=o?s.length>1?`since :