nfets 0.0.27 → 0.0.35

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.
@@ -86,7 +86,7 @@ Actual: `+O.attribValue);else{var Ge=O.tag,Re=O.tags[O.tags.length-1]||O;Ge.ns==
86
86
 
87
87
  \r Response Body: `+m.data))},a,u)):(aU("Reading file: %s",r),Woe.readFile(r,"utf8",(f,h)=>{f?s(f):(c=new sb(h,r,n),i[r]=c,c.WSDL_CACHE=i,c.onReady(s))})),c}o(cU,"open_wsdl")});var fU=Z(lU=>{"use strict";Object.defineProperty(lU,"__esModule",{value:!0})});var mU=Z(Ot=>{"use strict";var hU=Ot&&Ot.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tue=Ot&&Ot.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),rue=Ot&&Ot.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&hU(t,e,n[s]);return tue(t,e),t}})(),nue=Ot&&Ot.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&hU(e,r,t)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WSDL=Ot.passwordDigest=Ot.Server=Ot.WSSecurityCertWithToken=Ot.WSSecurityPlusCert=Ot.WSSecurityCert=Ot.WSSecurity=Ot.NTLMSecurity=Ot.ClientSSLSecurityPFX=Ot.ClientSSLSecurity=Ot.BearerSecurity=Ot.BasicAuthSecurity=Ot.HttpClient=Ot.Client=Ot.security=void 0;Ot.createClient=dU;Ot.createClientAsync=mue;Ot.listen=gue;var sue=rI(),iue=rue(VI()),aue=UI(),oue=Zu(),pU=t_();Ot.security=iue;var uue=rI();Object.defineProperty(Ot,"Client",{enumerable:!0,get:o(function(){return uue.Client},"get")});var cue=ES();Object.defineProperty(Ot,"HttpClient",{enumerable:!0,get:o(function(){return cue.HttpClient},"get")});var ko=VI();Object.defineProperty(Ot,"BasicAuthSecurity",{enumerable:!0,get:o(function(){return ko.BasicAuthSecurity},"get")});Object.defineProperty(Ot,"BearerSecurity",{enumerable:!0,get:o(function(){return ko.BearerSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurity",{enumerable:!0,get:o(function(){return ko.ClientSSLSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurityPFX",{enumerable:!0,get:o(function(){return ko.ClientSSLSecurityPFX},"get")});Object.defineProperty(Ot,"NTLMSecurity",{enumerable:!0,get:o(function(){return ko.NTLMSecurity},"get")});Object.defineProperty(Ot,"WSSecurity",{enumerable:!0,get:o(function(){return ko.WSSecurity},"get")});Object.defineProperty(Ot,"WSSecurityCert",{enumerable:!0,get:o(function(){return ko.WSSecurityCert},"get")});Object.defineProperty(Ot,"WSSecurityPlusCert",{enumerable:!0,get:o(function(){return ko.WSSecurityPlusCert},"get")});Object.defineProperty(Ot,"WSSecurityCertWithToken",{enumerable:!0,get:o(function(){return ko.WSSecurityCertWithToken},"get")});var lue=UI();Object.defineProperty(Ot,"Server",{enumerable:!0,get:o(function(){return lue.Server},"get")});var fue=Zu();Object.defineProperty(Ot,"passwordDigest",{enumerable:!0,get:o(function(){return fue.passwordDigest},"get")});nue(fU(),Ot);var hue=t_();Object.defineProperty(Ot,"WSDL",{enumerable:!0,get:o(function(){return hue.WSDL},"get")});function pue(r,e,t,n){e.has(r)?process.nextTick(()=>{n(null,e.get(r))}):t((s,i)=>{if(s)return n(s);e.set(r,i),n(null,i)})}o(pue,"getFromCache");function due(r,e,t){typeof e=="function"&&(t=e,e={});let n=o(s=>{(0,pU.open_wsdl)(r,e,s)},"openWsdl");if(e.disableCache===!0)n(t);else{let s;e.wsdlCache?s=e.wsdlCache:s=oue.wsdlCacheSingleton,pue(r,s,n,t)}}o(due,"_requestWSDL");function dU(r,e,t,n){let s=n,i,a;typeof e=="function"?(i=e,s=t,a={}):typeof t=="function"&&(a=e,i=t,s=n),s=a.endpoint||s,due(r,a,(u,c)=>{i(u,c&&new sue.Client(c,s,a))})}o(dU,"createClient");function mue(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,s)=>{dU(r,e,(i,a)=>{i&&s(i),n(a)},t)})}o(mue,"createClientAsync");function gue(r,e,t,n,s){let i,a,u="";typeof e=="object"&&!(e instanceof RegExp)?(i=e,a=i.path,t=i.services,n=i.xml,u=i.uri):(a=e,i={path:e,services:t,callback:s});let c=new pU.WSDL(n||t,u,i);return new aue.Server(r,a,t,c,i)}o(gue,"listen")});var ab=Z(n_=>{"use strict";(function(){n_.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
88
88
  `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(n_)});var Ya=Z((NU,uc)=>{"use strict";(function(){var r,e,t,n,s,i,a,u=[].slice,c={}.hasOwnProperty;r=o(function(){var f,h,m,g,x,v;if(v=arguments[0],x=2<=arguments.length?u.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(f=0,m=x.length;f<m;f++)if(g=x[f],g!=null)for(h in g)c.call(g,h)&&(v[h]=g[h]);return v},"assign"),s=o(function(f){return!!f&&Object.prototype.toString.call(f)==="[object Function]"},"isFunction"),i=o(function(f){var h;return!!f&&((h=typeof f)=="function"||h==="object")},"isObject"),t=o(function(f){return s(Array.isArray)?Array.isArray(f):Object.prototype.toString.call(f)==="[object Array]"},"isArray"),n=o(function(f){var h;if(t(f))return!f.length;for(h in f)if(c.call(f,h))return!1;return!0},"isEmpty"),a=o(function(f){var h,m;return i(f)&&(m=Object.getPrototypeOf(f))&&(h=m.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),e=o(function(f){return s(f.valueOf)?f.valueOf():f},"getValue"),uc.exports.assign=r,uc.exports.isFunction=s,uc.exports.isObject=i,uc.exports.isArray=t,uc.exports.isEmpty=n,uc.exports.isPlainObject=a,uc.exports.getValue=e}).call(NU)});var s_=Z((TU,IU)=>{"use strict";(function(){var r;IU.exports=r=(function(){function e(){}return o(e,"XMLDOMImplementation"),e.prototype.hasFeature=function(t,n){return!0},e.prototype.createDocumentType=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(TU)});var DU=Z((_U,BU)=>{"use strict";(function(){var r;BU.exports=r=(function(){function e(){}return o(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(_U)});var OU=Z((RU,PU)=>{"use strict";(function(){var r;PU.exports=r=(function(){function e(t){this.arr=t||[]}return o(e,"XMLDOMStringList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.arr.length},"get")}),e.prototype.item=function(t){return this.arr[t]||null},e.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},e})()}).call(RU)});var VU=Z((kU,LU)=>{"use strict";(function(){var r,e,t;e=DU(),t=OU(),LU.exports=r=(function(){function n(){var s;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=s=Object.create(this.defaultParams)}return o(n,"XMLDOMConfiguration"),Object.defineProperty(n.prototype,"parameterNames",{get:o(function(){return new t(Object.keys(this.defaultParams))},"get")}),n.prototype.getParameter=function(s){return this.params.hasOwnProperty(s)?this.params[s]:null},n.prototype.canSetParameter=function(s,i){return!0},n.prototype.setParameter=function(s,i){return i!=null?this.params[s]=i:delete this.params[s]},n})()}).call(kU)});var cn=Z((UU,jU)=>{"use strict";(function(){jU.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(UU)});var i_=Z((MU,FU)=>{"use strict";(function(){var r,e,t;r=cn(),t=ai(),FU.exports=e=(function(){function n(s,i,a){if(this.parent=s,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),i==null)throw new Error("Missing attribute name. "+this.debugInfo(i));this.name=this.stringify.name(i),this.value=this.stringify.attValue(a),this.type=r.Attribute,this.isId=!1,this.schemaTypeInfo=null}return o(n,"XMLAttribute"),Object.defineProperty(n.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(n.prototype,"ownerElement",{get:o(function(){return this.parent},"get")}),Object.defineProperty(n.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(s){return this.value=s||""},"set")}),Object.defineProperty(n.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(n.prototype,"specified",{get:o(function(){return!0},"get")}),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(s){return this.options.writer.attribute(this,this.options.writer.filterOptions(s))},n.prototype.debugInfo=function(s){return s=s||this.name,s==null?"parent: <"+this.parent.name+">":"attribute: {"+s+"}, parent: <"+this.parent.name+">"},n.prototype.isEqualNode=function(s){return!(s.namespaceURI!==this.namespaceURI||s.prefix!==this.prefix||s.localName!==this.localName||s.value!==this.value)},n})()}).call(MU)});var ob=Z((qU,HU)=>{"use strict";(function(){var r;HU.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNamedNodeMap"),Object.defineProperty(e.prototype,"length",{get:o(function(){return Object.keys(this.nodes).length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(t){return this.nodes[t]},e.prototype.setNamedItem=function(t){var n;return n=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,n||null},e.prototype.removeNamedItem=function(t){var n;return n=this.nodes[t],delete this.nodes[t],n||null},e.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},e.prototype.getNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(qU)});var ub=Z((KU,$U)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f=o(function(m,g){for(var x in g)h.call(g,x)&&(m[x]=g[x]);function v(){this.constructor=m}return o(v,"ctor"),v.prototype=g.prototype,m.prototype=new v,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;c=Ya(),u=c.isObject,a=c.isFunction,i=c.getValue,s=ai(),r=cn(),e=i_(),n=ob(),$U.exports=t=(function(m){f(g,m);function g(x,v,w){var S,A,T,b;if(g.__super__.constructor.call(this,x),v==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(v),this.type=r.Element,this.attribs={},this.schemaTypeInfo=null,w!=null&&this.attribute(w),x.type===r.Document&&(this.isRoot=!0,this.documentObject=x,x.rootObject=this,x.children)){for(b=x.children,A=0,T=b.length;A<T;A++)if(S=b[A],S.type===r.DocType){S.name=this.name;break}}}return o(g,"XMLElement"),Object.defineProperty(g.prototype,"tagName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"id",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"className",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"classList",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"attributes",{get:o(function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap},"get")}),g.prototype.clone=function(){var x,v,w,S;w=Object.create(this),w.isRoot&&(w.documentObject=null),w.attribs={},S=this.attribs;for(v in S)h.call(S,v)&&(x=S[v],w.attribs[v]=x.clone());return w.children=[],this.children.forEach(function(A){var T;return T=A.clone(),T.parent=w,w.children.push(T)}),w},g.prototype.attribute=function(x,v){var w,S;if(x!=null&&(x=i(x)),u(x))for(w in x)h.call(x,w)&&(S=x[w],this.attribute(w,S));else a(v)&&(v=v.apply()),this.options.keepNullAttributes&&v==null?this.attribs[x]=new e(this,x,""):v!=null&&(this.attribs[x]=new e(this,x,v));return this},g.prototype.removeAttribute=function(x){var v,w,S;if(x==null)throw new Error("Missing attribute name. "+this.debugInfo());if(x=i(x),Array.isArray(x))for(w=0,S=x.length;w<S;w++)v=x[w],delete this.attribs[v];else delete this.attribs[x];return this},g.prototype.toString=function(x){return this.options.writer.element(this,this.options.writer.filterOptions(x))},g.prototype.att=function(x,v){return this.attribute(x,v)},g.prototype.a=function(x,v){return this.attribute(x,v)},g.prototype.getAttribute=function(x){return this.attribs.hasOwnProperty(x)?this.attribs[x].value:null},g.prototype.setAttribute=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(x){return this.attribs.hasOwnProperty(x)?this.attribs[x]:null},g.prototype.setAttributeNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(x,v,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(x){return this.attribs.hasOwnProperty(x)},g.prototype.hasAttributeNS=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(x,v){return this.attribs.hasOwnProperty(x)?this.attribs[x].isId:v},g.prototype.setIdAttributeNS=function(x,v,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(x){var v,w,S;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(x)||x.namespaceURI!==this.namespaceURI||x.prefix!==this.prefix||x.localName!==this.localName||x.attribs.length!==this.attribs.length)return!1;for(v=w=0,S=this.attribs.length-1;0<=S?w<=S:w>=S;v=0<=S?++w:--w)if(!this.attribs[v].isEqualNode(x.attribs[v]))return!1;return!0},g})(s)}).call(KU)});var Gg=Z((GU,XU)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=ai(),XU.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a),this.value=""}return o(i,"XMLCharacterData"),Object.defineProperty(i.prototype,"data",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),Object.defineProperty(i.prototype,"length",{get:o(function(){return this.value.length},"get")}),Object.defineProperty(i.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.insertData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(a,u,c){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(a){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.data!==this.data)},i})(e)}).call(GU)});var cb=Z((WU,zU)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=cn(),t=Gg(),zU.exports=e=(function(i){n(a,i);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=r.CData,this.value=this.stringify.cdata(c)}return o(a,"XMLCData"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.cdata(this,this.options.writer.filterOptions(u))},a})(t)}).call(WU)});var lb=Z((JU,YU)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=cn(),e=Gg(),YU.exports=t=(function(i){n(a,i);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=r.Comment,this.value=this.stringify.comment(c)}return o(a,"XMLComment"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.comment(this,this.options.writer.filterOptions(u))},a})(e)}).call(JU)});var fb=Z((QU,ZU)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var c in u)i.call(u,c)&&(a[c]=u[c]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Ya().isObject,t=ai(),r=cn(),ZU.exports=e=(function(a){s(u,a);function u(c,f,h,m){var g;u.__super__.constructor.call(this,c),n(f)&&(g=f,f=g.version,h=g.encoding,m=g.standalone),f||(f="1.0"),this.type=r.Declaration,this.version=this.stringify.xmlVersion(f),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return o(u,"XMLDeclaration"),u.prototype.toString=function(c){return this.options.writer.declaration(this,this.options.writer.filterOptions(c))},u})(t)}).call(QU)});var hb=Z((ej,tj)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=ai(),r=cn(),tj.exports=e=(function(i){n(a,i);function a(u,c,f,h,m,g){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(f==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(c));if(!h)throw new Error("Missing DTD attribute type. "+this.debugInfo(c));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(c));if(m.indexOf("#")!==0&&(m="#"+m),!m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(c));if(g&&!m.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(c));this.elementName=this.stringify.name(c),this.type=r.AttributeDeclaration,this.attributeName=this.stringify.name(f),this.attributeType=this.stringify.dtdAttType(h),g&&(this.defaultValue=this.stringify.dtdAttDefault(g)),this.defaultValueType=m}return o(a,"XMLDTDAttList"),a.prototype.toString=function(u){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(u))},a})(t)}).call(ej)});var pb=Z((rj,nj)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var c in u)i.call(u,c)&&(a[c]=u[c]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Ya().isObject,t=ai(),r=cn(),nj.exports=e=(function(a){s(u,a);function u(c,f,h,m){if(u.__super__.constructor.call(this,c),h==null)throw new Error("Missing DTD entity name. "+this.debugInfo(h));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(h));if(this.pe=!!f,this.name=this.stringify.name(h),this.type=r.EntityDeclaration,!n(m))this.value=this.stringify.dtdEntityValue(m),this.internal=!0;else{if(!m.pubID&&!m.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(h));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(h));if(this.internal=!1,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.sysID)),m.nData!=null&&(this.nData=this.stringify.dtdNData(m.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(h))}}return o(u,"XMLDTDEntity"),Object.defineProperty(u.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(u.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(u.prototype,"notationName",{get:o(function(){return this.nData||null},"get")}),Object.defineProperty(u.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlVersion",{get:o(function(){return null},"get")}),u.prototype.toString=function(c){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(c))},u})(t)}).call(rj)});var db=Z((sj,ij)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=ai(),r=cn(),ij.exports=e=(function(i){n(a,i);function a(u,c,f){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing DTD element name. "+this.debugInfo());f||(f="(#PCDATA)"),Array.isArray(f)&&(f="("+f.join(",")+")"),this.name=this.stringify.name(c),this.type=r.ElementDeclaration,this.value=this.stringify.dtdElementValue(f)}return o(a,"XMLDTDElement"),a.prototype.toString=function(u){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(u))},a})(t)}).call(sj)});var mb=Z((aj,oj)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=ai(),r=cn(),oj.exports=e=(function(i){n(a,i);function a(u,c,f){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing DTD notation name. "+this.debugInfo(c));if(!f.pubID&&!f.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(c));this.name=this.stringify.name(c),this.type=r.NotationDeclaration,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID))}return o(a,"XMLDTDNotation"),Object.defineProperty(a.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(a.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),a.prototype.toString=function(u){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(u))},a})(t)}).call(aj)});var gb=Z((uj,cj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f=o(function(m,g){for(var x in g)h.call(g,x)&&(m[x]=g[x]);function v(){this.constructor=m}return o(v,"ctor"),v.prototype=g.prototype,m.prototype=new v,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;c=Ya().isObject,u=ai(),r=cn(),e=hb(),n=pb(),t=db(),s=mb(),a=ob(),cj.exports=i=(function(m){f(g,m);function g(x,v,w){var S,A,T,b,E,C;if(g.__super__.constructor.call(this,x),this.type=r.DocType,x.children){for(b=x.children,A=0,T=b.length;A<T;A++)if(S=b[A],S.type===r.Element){this.name=S.name;break}}this.documentObject=x,c(v)&&(E=v,v=E.pubID,w=E.sysID),w==null&&(C=[v,w],w=C[0],v=C[1]),v!=null&&(this.pubID=this.stringify.dtdPubID(v)),w!=null&&(this.sysID=this.stringify.dtdSysID(w))}return o(g,"XMLDocType"),Object.defineProperty(g.prototype,"entities",{get:o(function(){var x,v,w,S,A;for(S={},A=this.children,v=0,w=A.length;v<w;v++)x=A[v],x.type===r.EntityDeclaration&&!x.pe&&(S[x.name]=x);return new a(S)},"get")}),Object.defineProperty(g.prototype,"notations",{get:o(function(){var x,v,w,S,A;for(S={},A=this.children,v=0,w=A.length;v<w;v++)x=A[v],x.type===r.NotationDeclaration&&(S[x.name]=x);return new a(S)},"get")}),Object.defineProperty(g.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(g.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(g.prototype,"internalSubset",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),g.prototype.element=function(x,v){var w;return w=new t(this,x,v),this.children.push(w),this},g.prototype.attList=function(x,v,w,S,A){var T;return T=new e(this,x,v,w,S,A),this.children.push(T),this},g.prototype.entity=function(x,v){var w;return w=new n(this,!1,x,v),this.children.push(w),this},g.prototype.pEntity=function(x,v){var w;return w=new n(this,!0,x,v),this.children.push(w),this},g.prototype.notation=function(x,v){var w;return w=new s(this,x,v),this.children.push(w),this},g.prototype.toString=function(x){return this.options.writer.docType(this,this.options.writer.filterOptions(x))},g.prototype.ele=function(x,v){return this.element(x,v)},g.prototype.att=function(x,v,w,S,A){return this.attList(x,v,w,S,A)},g.prototype.ent=function(x,v){return this.entity(x,v)},g.prototype.pent=function(x,v){return this.pEntity(x,v)},g.prototype.not=function(x,v){return this.notation(x,v)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(x){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(x)||x.name!==this.name||x.publicId!==this.publicId||x.systemId!==this.systemId)},g})(u)}).call(uj)});var vb=Z((lj,fj)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=cn(),e=ai(),fj.exports=t=(function(i){n(a,i);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=r.Raw,this.value=this.stringify.raw(c)}return o(a,"XMLRaw"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.raw(this,this.options.writer.filterOptions(u))},a})(e)}).call(lj)});var yb=Z((hj,pj)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=cn(),e=Gg(),pj.exports=t=(function(i){n(a,i);function a(u,c){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=r.Text,this.value=this.stringify.text(c)}return o(a,"XMLText"),Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(a.prototype,"wholeText",{get:o(function(){var u,c,f;for(f="",c=this.previousSibling;c;)f=c.data+f,c=c.previousSibling;for(f+=this.data,u=this.nextSibling;u;)f=f+u.data,u=u.nextSibling;return f},"get")}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.text(this,this.options.writer.filterOptions(u))},a.prototype.splitText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a})(e)}).call(hj)});var xb=Z((dj,mj)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=cn(),e=Gg(),mj.exports=t=(function(i){n(a,i);function a(u,c,f){if(a.__super__.constructor.call(this,u),c==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=r.ProcessingInstruction,this.target=this.stringify.insTarget(c),this.name=this.target,f&&(this.value=this.stringify.insValue(f))}return o(a,"XMLProcessingInstruction"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(u))},a.prototype.isEqualNode=function(u){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.target!==this.target)},a})(e)}).call(dj)});var a_=Z((gj,vj)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function c(){this.constructor=i}return o(c,"ctor"),c.prototype=a.prototype,i.prototype=new c,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=ai(),r=cn(),vj.exports=e=(function(i){n(a,i);function a(u){a.__super__.constructor.call(this,u),this.type=r.Dummy}return o(a,"XMLDummy"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return""},a})(t)}).call(gj)});var wj=Z((yj,xj)=>{"use strict";(function(){var r;xj.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNodeList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.nodes.length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(t){return this.nodes[t]||null},e})()}).call(yj)});var Ej=Z((Sj,bj)=>{"use strict";(function(){bj.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(Sj)});var ai=Z((Aj,Cj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f,h,m,g,x,v,w,S,A,T,b={}.hasOwnProperty;T=Ya(),A=T.isObject,S=T.isFunction,w=T.isEmpty,v=T.getValue,u=null,t=null,n=null,s=null,i=null,g=null,x=null,m=null,a=null,e=null,h=null,c=null,r=null,Cj.exports=f=(function(){function E(C){this.parent=C,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=ub(),t=cb(),n=lb(),s=fb(),i=gb(),g=vb(),x=yb(),m=xb(),a=a_(),e=cn(),h=wj(),c=ob(),r=Ej())}return o(E,"XMLNode"),Object.defineProperty(E.prototype,"nodeName",{get:o(function(){return this.name},"get")}),Object.defineProperty(E.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(E.prototype,"nodeValue",{get:o(function(){return this.value},"get")}),Object.defineProperty(E.prototype,"parentNode",{get:o(function(){return this.parent},"get")}),Object.defineProperty(E.prototype,"childNodes",{get:o(function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new h(this.children)),this.childNodeList},"get")}),Object.defineProperty(E.prototype,"firstChild",{get:o(function(){return this.children[0]||null},"get")}),Object.defineProperty(E.prototype,"lastChild",{get:o(function(){return this.children[this.children.length-1]||null},"get")}),Object.defineProperty(E.prototype,"previousSibling",{get:o(function(){var C;return C=this.parent.children.indexOf(this),this.parent.children[C-1]||null},"get")}),Object.defineProperty(E.prototype,"nextSibling",{get:o(function(){var C;return C=this.parent.children.indexOf(this),this.parent.children[C+1]||null},"get")}),Object.defineProperty(E.prototype,"ownerDocument",{get:o(function(){return this.document()||null},"get")}),Object.defineProperty(E.prototype,"textContent",{get:o(function(){var C,_,F,R,q;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(q="",R=this.children,_=0,F=R.length;_<F;_++)C=R[_],C.textContent&&(q+=C.textContent);return q}else return null},"get"),set:o(function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},"set")}),E.prototype.setParent=function(C){var _,F,R,q,H;for(this.parent=C,C&&(this.options=C.options,this.stringify=C.stringify),q=this.children,H=[],F=0,R=q.length;F<R;F++)_=q[F],H.push(_.setParent(this));return H},E.prototype.element=function(C,_,F){var R,q,H,K,X,pe,le,ue,ee,he,we;if(pe=null,_===null&&F==null&&(ee=[{},null],_=ee[0],F=ee[1]),_==null&&(_={}),_=v(_),A(_)||(he=[_,F],F=he[0],_=he[1]),C!=null&&(C=v(C)),Array.isArray(C))for(H=0,le=C.length;H<le;H++)q=C[H],pe=this.element(q);else if(S(C))pe=this.element(C.apply());else if(A(C)){for(X in C)if(b.call(C,X))if(we=C[X],S(we)&&(we=we.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&X.indexOf(this.stringify.convertAttKey)===0)pe=this.attribute(X.substr(this.stringify.convertAttKey.length),we);else if(!this.options.separateArrayItems&&Array.isArray(we)&&w(we))pe=this.dummy();else if(A(we)&&w(we))pe=this.element(X);else if(!this.options.keepNullNodes&&we==null)pe=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(we))for(K=0,ue=we.length;K<ue;K++)q=we[K],R={},R[X]=q,pe=this.element(R);else A(we)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&X.indexOf(this.stringify.convertTextKey)===0?pe=this.element(we):(pe=this.element(X),pe.element(we)):pe=this.element(X,we)}else!this.options.keepNullNodes&&F===null?pe=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&C.indexOf(this.stringify.convertTextKey)===0?pe=this.text(F):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&C.indexOf(this.stringify.convertCDataKey)===0?pe=this.cdata(F):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&C.indexOf(this.stringify.convertCommentKey)===0?pe=this.comment(F):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&C.indexOf(this.stringify.convertRawKey)===0?pe=this.raw(F):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&C.indexOf(this.stringify.convertPIKey)===0?pe=this.instruction(C.substr(this.stringify.convertPIKey.length),F):pe=this.node(C,_,F);if(pe==null)throw new Error("Could not create any elements with: "+C+". "+this.debugInfo());return pe},E.prototype.insertBefore=function(C,_,F){var R,q,H,K,X;if(C?.type)return H=C,K=_,H.setParent(this),K?(q=children.indexOf(K),X=children.splice(q),children.push(H),Array.prototype.push.apply(children,X)):children.push(H),H;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(C));return q=this.parent.children.indexOf(this),X=this.parent.children.splice(q),R=this.parent.element(C,_,F),Array.prototype.push.apply(this.parent.children,X),R},E.prototype.insertAfter=function(C,_,F){var R,q,H;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(C));return q=this.parent.children.indexOf(this),H=this.parent.children.splice(q+1),R=this.parent.element(C,_,F),Array.prototype.push.apply(this.parent.children,H),R},E.prototype.remove=function(){var C,_;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return C=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[C,C-C+1].concat(_=[])),this.parent},E.prototype.node=function(C,_,F){var R,q;return C!=null&&(C=v(C)),_||(_={}),_=v(_),A(_)||(q=[_,F],F=q[0],_=q[1]),R=new u(this,C,_),F!=null&&R.text(F),this.children.push(R),R},E.prototype.text=function(C){var _;return A(C)&&this.element(C),_=new x(this,C),this.children.push(_),this},E.prototype.cdata=function(C){var _;return _=new t(this,C),this.children.push(_),this},E.prototype.comment=function(C){var _;return _=new n(this,C),this.children.push(_),this},E.prototype.commentBefore=function(C){var _,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F),_=this.parent.comment(C),Array.prototype.push.apply(this.parent.children,R),this},E.prototype.commentAfter=function(C){var _,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F+1),_=this.parent.comment(C),Array.prototype.push.apply(this.parent.children,R),this},E.prototype.raw=function(C){var _;return _=new g(this,C),this.children.push(_),this},E.prototype.dummy=function(){var C;return C=new a(this),C},E.prototype.instruction=function(C,_){var F,R,q,H,K;if(C!=null&&(C=v(C)),_!=null&&(_=v(_)),Array.isArray(C))for(H=0,K=C.length;H<K;H++)F=C[H],this.instruction(F);else if(A(C))for(F in C)b.call(C,F)&&(R=C[F],this.instruction(F,R));else S(_)&&(_=_.apply()),q=new m(this,C,_),this.children.push(q);return this},E.prototype.instructionBefore=function(C,_){var F,R,q;return R=this.parent.children.indexOf(this),q=this.parent.children.splice(R),F=this.parent.instruction(C,_),Array.prototype.push.apply(this.parent.children,q),this},E.prototype.instructionAfter=function(C,_){var F,R,q;return R=this.parent.children.indexOf(this),q=this.parent.children.splice(R+1),F=this.parent.instruction(C,_),Array.prototype.push.apply(this.parent.children,q),this},E.prototype.declaration=function(C,_,F){var R,q;return R=this.document(),q=new s(R,C,_,F),R.children.length===0?R.children.unshift(q):R.children[0].type===e.Declaration?R.children[0]=q:R.children.unshift(q),R.root()||R},E.prototype.dtd=function(C,_){var F,R,q,H,K,X,pe,le,ue,ee;for(R=this.document(),q=new i(R,C,_),ue=R.children,H=K=0,pe=ue.length;K<pe;H=++K)if(F=ue[H],F.type===e.DocType)return R.children[H]=q,q;for(ee=R.children,H=X=0,le=ee.length;X<le;H=++X)if(F=ee[H],F.isRoot)return R.children.splice(H,0,q),q;return R.children.push(q),q},E.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},E.prototype.root=function(){var C;for(C=this;C;){if(C.type===e.Document)return C.rootObject;if(C.isRoot)return C;C=C.parent}},E.prototype.document=function(){var C;for(C=this;C;){if(C.type===e.Document)return C;C=C.parent}},E.prototype.end=function(C){return this.document().end(C)},E.prototype.prev=function(){var C;if(C=this.parent.children.indexOf(this),C<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[C-1]},E.prototype.next=function(){var C;if(C=this.parent.children.indexOf(this),C===-1||C===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[C+1]},E.prototype.importDocument=function(C){var _;return _=C.root().clone(),_.parent=this,_.isRoot=!1,this.children.push(_),this},E.prototype.debugInfo=function(C){var _,F;return C=C||this.name,C==null&&!((_=this.parent)!=null&&_.name)?"":C==null?"parent: <"+this.parent.name+">":(F=this.parent)!=null&&F.name?"node: <"+C+">, parent: <"+this.parent.name+">":"node: <"+C+">"},E.prototype.ele=function(C,_,F){return this.element(C,_,F)},E.prototype.nod=function(C,_,F){return this.node(C,_,F)},E.prototype.txt=function(C){return this.text(C)},E.prototype.dat=function(C){return this.cdata(C)},E.prototype.com=function(C){return this.comment(C)},E.prototype.ins=function(C,_){return this.instruction(C,_)},E.prototype.doc=function(){return this.document()},E.prototype.dec=function(C,_,F){return this.declaration(C,_,F)},E.prototype.e=function(C,_,F){return this.element(C,_,F)},E.prototype.n=function(C,_,F){return this.node(C,_,F)},E.prototype.t=function(C){return this.text(C)},E.prototype.d=function(C){return this.cdata(C)},E.prototype.c=function(C){return this.comment(C)},E.prototype.r=function(C){return this.raw(C)},E.prototype.i=function(C,_){return this.instruction(C,_)},E.prototype.u=function(){return this.up()},E.prototype.importXMLBuilder=function(C){return this.importDocument(C)},E.prototype.replaceChild=function(C,_){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeChild=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.appendChild=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.hasChildNodes=function(){return this.children.length!==0},E.prototype.cloneNode=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isSupported=function(C,_){return!0},E.prototype.hasAttributes=function(){return this.attribs.length!==0},E.prototype.compareDocumentPosition=function(C){var _,F;return _=this,_===C?0:this.document()!==C.document()?(F=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?F|=r.Preceding:F|=r.Following,F):_.isAncestor(C)?r.Contains|r.Preceding:_.isDescendant(C)?r.Contains|r.Following:_.isPreceding(C)?r.Preceding:r.Following},E.prototype.isSameNode=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupPrefix=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isDefaultNamespace=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupNamespaceURI=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isEqualNode=function(C){var _,F,R;if(C.nodeType!==this.nodeType||C.children.length!==this.children.length)return!1;for(_=F=0,R=this.children.length-1;0<=R?F<=R:F>=R;_=0<=R?++F:--F)if(!this.children[_].isEqualNode(C.children[_]))return!1;return!0},E.prototype.getFeature=function(C,_){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setUserData=function(C,_,F){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getUserData=function(C){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.contains=function(C){return C?C===this||this.isDescendant(C):!1},E.prototype.isDescendant=function(C){var _,F,R,q,H;for(H=this.children,R=0,q=H.length;R<q;R++)if(_=H[R],C===_||(F=_.isDescendant(C),F))return!0;return!1},E.prototype.isAncestor=function(C){return C.isDescendant(this)},E.prototype.isPreceding=function(C){var _,F;return _=this.treePosition(C),F=this.treePosition(this),_===-1||F===-1?!1:_<F},E.prototype.isFollowing=function(C){var _,F;return _=this.treePosition(C),F=this.treePosition(this),_===-1||F===-1?!1:_>F},E.prototype.treePosition=function(C){var _,F;return F=0,_=!1,this.foreachTreeNode(this.document(),function(R){if(F++,!_&&R===C)return _=!0}),_?F:-1},E.prototype.foreachTreeNode=function(C,_){var F,R,q,H,K;for(C||(C=this.document()),H=C.children,R=0,q=H.length;R<q;R++){if(F=H[R],K=_(F))return K;if(K=this.foreachTreeNode(F,_),K)return K}},E})()}).call(Aj)});var o_=Z((Nj,Tj)=>{"use strict";(function(){var r,e=o(function(n,s){return function(){return n.apply(s,arguments)}},"bind"),t={}.hasOwnProperty;Tj.exports=r=(function(){function n(s){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var i,a,u;s||(s={}),this.options=s,this.options.version||(this.options.version="1.0"),a=s.stringify||{};for(i in a)t.call(a,i)&&(u=a[i],this[i]=u)}return o(n,"XMLStringifier"),n.prototype.name=function(s){return this.options.noValidation?s:this.assertLegalName(""+s||"")},n.prototype.text=function(s){return this.options.noValidation?s:this.assertLegalChar(this.textEscape(""+s||""))},n.prototype.cdata=function(s){return this.options.noValidation?s:(s=""+s||"",s=s.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(s))},n.prototype.comment=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+s);return this.assertLegalChar(s)},n.prototype.raw=function(s){return this.options.noValidation?s:""+s||""},n.prototype.attValue=function(s){return this.options.noValidation?s:this.assertLegalChar(this.attEscape(s=""+s||""))},n.prototype.insTarget=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.insValue=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/\?>/))throw new Error("Invalid processing instruction value: "+s);return this.assertLegalChar(s)},n.prototype.xmlVersion=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+s);return s},n.prototype.xmlEncoding=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+s);return this.assertLegalChar(s)},n.prototype.xmlStandalone=function(s){return this.options.noValidation?s:s?"yes":"no"},n.prototype.dtdPubID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdSysID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdElementValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttType=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttDefault=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdEntityValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdNData=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(s){var i,a;if(this.options.noValidation)return s;if(i="",this.options.version==="1.0"){if(i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i))throw new Error("Invalid character in string: "+s+" at index "+a.index)}else if(this.options.version==="1.1"&&(i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i)))throw new Error("Invalid character in string: "+s+" at index "+a.index);return s},n.prototype.assertLegalName=function(s){var i;if(this.options.noValidation)return s;if(this.assertLegalChar(s),i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!s.match(i))throw new Error("Invalid character in name");return s},n.prototype.textEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},n.prototype.attEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},n})()}).call(Nj)});var Xg=Z((Ij,_j)=>{"use strict";(function(){_j.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(Ij)});var u_=Z((Bj,Dj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f,h,m,g,x,v,w,S,A={}.hasOwnProperty;S=Ya().assign,r=cn(),c=fb(),f=gb(),t=cb(),n=lb(),m=ub(),x=vb(),v=yb(),g=xb(),h=a_(),s=hb(),i=db(),a=pb(),u=mb(),e=Xg(),Dj.exports=w=(function(){function T(b){var E,C,_;b||(b={}),this.options=b,C=b.writer||{};for(E in C)A.call(C,E)&&(_=C[E],this["_"+E]=this[E],this[E]=_)}return o(T,"XMLWriterBase"),T.prototype.filterOptions=function(b){var E,C,_,F,R,q,H,K;return b||(b={}),b=S({},this.options,b),E={writer:this},E.pretty=b.pretty||!1,E.allowEmpty=b.allowEmpty||!1,E.indent=(C=b.indent)!=null?C:" ",E.newline=(_=b.newline)!=null?_:`
89
- `,E.offset=(F=b.offset)!=null?F:0,E.dontPrettyTextNodes=(R=(q=b.dontPrettyTextNodes)!=null?q:b.dontprettytextnodes)!=null?R:0,E.spaceBeforeSlash=(H=(K=b.spaceBeforeSlash)!=null?K:b.spacebeforeslash)!=null?H:"",E.spaceBeforeSlash===!0&&(E.spaceBeforeSlash=" "),E.suppressPrettyCount=0,E.user={},E.state=e.None,E},T.prototype.indent=function(b,E,C){var _;return!E.pretty||E.suppressPrettyCount?"":E.pretty&&(_=(C||0)+E.offset+1,_>0)?new Array(_).join(E.indent):""},T.prototype.endline=function(b,E,C){return!E.pretty||E.suppressPrettyCount?"":E.newline},T.prototype.attribute=function(b,E,C){var _;return this.openAttribute(b,E,C),_=" "+b.name+'="'+b.value+'"',this.closeAttribute(b,E,C),_},T.prototype.cdata=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<![CDATA[",E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+="]]>"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.comment=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!-- ",E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+=" -->"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.declaration=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<?xml",E.state=e.InsideTag,_+=' version="'+b.version+'"',b.encoding!=null&&(_+=' encoding="'+b.encoding+'"'),b.standalone!=null&&(_+=' standalone="'+b.standalone+'"'),E.state=e.CloseTag,_+=E.spaceBeforeSlash+"?>",_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.docType=function(b,E,C){var _,F,R,q,H;if(C||(C=0),this.openNode(b,E,C),E.state=e.OpenTag,q=this.indent(b,E,C),q+="<!DOCTYPE "+b.root().name,b.pubID&&b.sysID?q+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(q+=' SYSTEM "'+b.sysID+'"'),b.children.length>0){for(q+=" [",q+=this.endline(b,E,C),E.state=e.InsideTag,H=b.children,F=0,R=H.length;F<R;F++)_=H[F],q+=this.writeChildNode(_,E,C+1);E.state=e.CloseTag,q+="]"}return E.state=e.CloseTag,q+=E.spaceBeforeSlash+">",q+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),q},T.prototype.element=function(b,E,C){var _,F,R,q,H,K,X,pe,le,ue,ee,he,we,Ke;C||(C=0),ue=!1,ee="",this.openNode(b,E,C),E.state=e.OpenTag,ee+=this.indent(b,E,C)+"<"+b.name,he=b.attribs;for(le in he)A.call(he,le)&&(_=he[le],ee+=this.attribute(_,E,C));if(R=b.children.length,q=R===0?null:b.children[0],R===0||b.children.every(function(Ae){return(Ae.type===r.Text||Ae.type===r.Raw)&&Ae.value===""}))E.allowEmpty?(ee+=">",E.state=e.CloseTag,ee+="</"+b.name+">"+this.endline(b,E,C)):(E.state=e.CloseTag,ee+=E.spaceBeforeSlash+"/>"+this.endline(b,E,C));else if(E.pretty&&R===1&&(q.type===r.Text||q.type===r.Raw)&&q.value!=null)ee+=">",E.state=e.InsideTag,E.suppressPrettyCount++,ue=!0,ee+=this.writeChildNode(q,E,C+1),E.suppressPrettyCount--,ue=!1,E.state=e.CloseTag,ee+="</"+b.name+">"+this.endline(b,E,C);else{if(E.dontPrettyTextNodes){for(we=b.children,H=0,X=we.length;H<X;H++)if(F=we[H],(F.type===r.Text||F.type===r.Raw)&&F.value!=null){E.suppressPrettyCount++,ue=!0;break}}for(ee+=">"+this.endline(b,E,C),E.state=e.InsideTag,Ke=b.children,K=0,pe=Ke.length;K<pe;K++)F=Ke[K],ee+=this.writeChildNode(F,E,C+1);E.state=e.CloseTag,ee+=this.indent(b,E,C)+"</"+b.name+">",ue&&E.suppressPrettyCount--,ee+=this.endline(b,E,C),E.state=e.None}return this.closeNode(b,E,C),ee},T.prototype.writeChildNode=function(b,E,C){switch(b.type){case r.CData:return this.cdata(b,E,C);case r.Comment:return this.comment(b,E,C);case r.Element:return this.element(b,E,C);case r.Raw:return this.raw(b,E,C);case r.Text:return this.text(b,E,C);case r.ProcessingInstruction:return this.processingInstruction(b,E,C);case r.Dummy:return"";case r.Declaration:return this.declaration(b,E,C);case r.DocType:return this.docType(b,E,C);case r.AttributeDeclaration:return this.dtdAttList(b,E,C);case r.ElementDeclaration:return this.dtdElement(b,E,C);case r.EntityDeclaration:return this.dtdEntity(b,E,C);case r.NotationDeclaration:return this.dtdNotation(b,E,C);default:throw new Error("Unknown XML node type: "+b.constructor.name)}},T.prototype.processingInstruction=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<?",E.state=e.InsideTag,_+=b.target,b.value&&(_+=" "+b.value),E.state=e.CloseTag,_+=E.spaceBeforeSlash+"?>",_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.raw=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C),E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.text=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C),E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdAttList=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!ATTLIST",E.state=e.InsideTag,_+=" "+b.elementName+" "+b.attributeName+" "+b.attributeType,b.defaultValueType!=="#DEFAULT"&&(_+=" "+b.defaultValueType),b.defaultValue&&(_+=' "'+b.defaultValue+'"'),E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdElement=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!ELEMENT",E.state=e.InsideTag,_+=" "+b.name+" "+b.value,E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdEntity=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!ENTITY",E.state=e.InsideTag,b.pe&&(_+=" %"),_+=" "+b.name,b.value?_+=' "'+b.value+'"':(b.pubID&&b.sysID?_+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(_+=' SYSTEM "'+b.sysID+'"'),b.nData&&(_+=" NDATA "+b.nData)),E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdNotation=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!NOTATION",E.state=e.InsideTag,_+=" "+b.name,b.pubID&&b.sysID?_+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.pubID?_+=' PUBLIC "'+b.pubID+'"':b.sysID&&(_+=' SYSTEM "'+b.sysID+'"'),E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.openNode=function(b,E,C){},T.prototype.closeNode=function(b,E,C){},T.prototype.openAttribute=function(b,E,C){},T.prototype.closeAttribute=function(b,E,C){},T})()}).call(Bj)});var wb=Z((Rj,Pj)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=u_(),Pj.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a)}return o(i,"XMLStringWriter"),i.prototype.document=function(a,u){var c,f,h,m,g;for(u=this.filterOptions(u),m="",g=a.children,f=0,h=g.length;f<h;f++)c=g[f],m+=this.writeChildNode(c,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},i})(e)}).call(Rj)});var c_=Z((Oj,kj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c=o(function(h,m){for(var g in m)f.call(m,g)&&(h[g]=m[g]);function x(){this.constructor=h}return o(x,"ctor"),x.prototype=m.prototype,h.prototype=new x,h.__super__=m.prototype,h},"extend"),f={}.hasOwnProperty;u=Ya().isPlainObject,t=s_(),e=VU(),s=ai(),r=cn(),a=o_(),i=wb(),kj.exports=n=(function(h){c(m,h);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new i),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,x,v,w;for(w=this.children,x=0,v=w.length;x<v;x++)if(g=w[x],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var x;return x={},g?u(g)&&(x=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(x))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(s)}).call(Oj)});var Uj=Z((Lj,Vj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f,h,m,g,x,v,w,S,A,T,b,E,C,_,F,R={}.hasOwnProperty;F=Ya(),C=F.isObject,E=F.isFunction,_=F.isPlainObject,b=F.getValue,r=cn(),m=c_(),x=ub(),n=cb(),s=lb(),w=vb(),T=yb(),v=xb(),f=fb(),h=gb(),i=hb(),u=pb(),a=db(),c=mb(),t=i_(),A=o_(),S=wb(),e=Xg(),Vj.exports=g=(function(){function q(H,K,X){var pe;this.name="?xml",this.type=r.Document,H||(H={}),pe={},H.writer?_(H.writer)&&(pe=H.writer,H.writer=new S):H.writer=new S,this.options=H,this.writer=H.writer,this.writerOptions=this.writer.filterOptions(pe),this.stringify=new A(H),this.onDataCallback=K||function(){},this.onEndCallback=X||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(q,"XMLDocumentCB"),q.prototype.createChildNode=function(H){var K,X,pe,le,ue,ee,he,we;switch(H.type){case r.CData:this.cdata(H.value);break;case r.Comment:this.comment(H.value);break;case r.Element:pe={},he=H.attribs;for(X in he)R.call(he,X)&&(K=he[X],pe[X]=K.value);this.node(H.name,pe);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(H.value);break;case r.Text:this.text(H.value);break;case r.ProcessingInstruction:this.instruction(H.target,H.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+H.constructor.name)}for(we=H.children,ue=0,ee=we.length;ue<ee;ue++)le=we[ue],this.createChildNode(le),le.type===r.Element&&this.up();return this},q.prototype.dummy=function(){return this},q.prototype.node=function(H,K,X){var pe;if(H==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(H));return this.openCurrent(),H=b(H),K==null&&(K={}),K=b(K),C(K)||(pe=[K,X],X=pe[0],K=pe[1]),this.currentNode=new x(this,H,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,X!=null&&this.text(X),this},q.prototype.element=function(H,K,X){var pe,le,ue,ee,he,we;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(H)||C(H)||E(H))for(ee=this.options.noValidation,this.options.noValidation=!0,we=new m(this.options).element("TEMP_ROOT"),we.element(H),this.options.noValidation=ee,he=we.children,le=0,ue=he.length;le<ue;le++)pe=he[le],this.createChildNode(pe),pe.type===r.Element&&this.up();else this.node(H,K,X);return this},q.prototype.attribute=function(H,K){var X,pe;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(H));if(H!=null&&(H=b(H)),C(H))for(X in H)R.call(H,X)&&(pe=H[X],this.attribute(X,pe));else E(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[H]=new t(this,H,""):K!=null&&(this.currentNode.attribs[H]=new t(this,H,K));return this},q.prototype.text=function(H){var K;return this.openCurrent(),K=new T(this,H),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.cdata=function(H){var K;return this.openCurrent(),K=new n(this,H),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.comment=function(H){var K;return this.openCurrent(),K=new s(this,H),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.raw=function(H){var K;return this.openCurrent(),K=new w(this,H),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.instruction=function(H,K){var X,pe,le,ue,ee;if(this.openCurrent(),H!=null&&(H=b(H)),K!=null&&(K=b(K)),Array.isArray(H))for(X=0,ue=H.length;X<ue;X++)pe=H[X],this.instruction(pe);else if(C(H))for(pe in H)R.call(H,pe)&&(le=H[pe],this.instruction(pe,le));else E(K)&&(K=K.apply()),ee=new v(this,H,K),this.onData(this.writer.processingInstruction(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},q.prototype.declaration=function(H,K,X){var pe;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return pe=new f(this,H,K,X),this.onData(this.writer.declaration(pe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.doctype=function(H,K,X){if(this.openCurrent(),H==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new h(this,K,X),this.currentNode.rootNodeName=H,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},q.prototype.dtdElement=function(H,K){var X;return this.openCurrent(),X=new a(this,H,K),this.onData(this.writer.dtdElement(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.attList=function(H,K,X,pe,le){var ue;return this.openCurrent(),ue=new i(this,H,K,X,pe,le),this.onData(this.writer.dtdAttList(ue,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.entity=function(H,K){var X;return this.openCurrent(),X=new u(this,!1,H,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.pEntity=function(H,K){var X;return this.openCurrent(),X=new u(this,!0,H,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.notation=function(H,K){var X;return this.openCurrent(),X=new c(this,H,K),this.onData(this.writer.dtdNotation(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},q.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},q.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},q.prototype.openNode=function(H){var K,X,pe,le;if(!H.isOpen){if(!this.root&&this.currentLevel===0&&H.type===r.Element&&(this.root=H),X="",H.type===r.Element){this.writerOptions.state=e.OpenTag,X=this.writer.indent(H,this.writerOptions,this.currentLevel)+"<"+H.name,le=H.attribs;for(pe in le)R.call(le,pe)&&(K=le[pe],X+=this.writer.attribute(K,this.writerOptions,this.currentLevel));X+=(H.children?">":"/>")+this.writer.endline(H,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,X=this.writer.indent(H,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+H.rootNodeName,H.pubID&&H.sysID?X+=' PUBLIC "'+H.pubID+'" "'+H.sysID+'"':H.sysID&&(X+=' SYSTEM "'+H.sysID+'"'),H.children?(X+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,X+=">"),X+=this.writer.endline(H,this.writerOptions,this.currentLevel);return this.onData(X,this.currentLevel),H.isOpen=!0}},q.prototype.closeNode=function(H){var K;if(!H.isClosed)return K="",this.writerOptions.state=e.CloseTag,H.type===r.Element?K=this.writer.indent(H,this.writerOptions,this.currentLevel)+"</"+H.name+">"+this.writer.endline(H,this.writerOptions,this.currentLevel):K=this.writer.indent(H,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(H,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),H.isClosed=!0},q.prototype.onData=function(H,K){return this.documentStarted=!0,this.onDataCallback(H,K+1)},q.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},q.prototype.debugInfo=function(H){return H==null?"":"node: <"+H+">"},q.prototype.ele=function(){return this.element.apply(this,arguments)},q.prototype.nod=function(H,K,X){return this.node(H,K,X)},q.prototype.txt=function(H){return this.text(H)},q.prototype.dat=function(H){return this.cdata(H)},q.prototype.com=function(H){return this.comment(H)},q.prototype.ins=function(H,K){return this.instruction(H,K)},q.prototype.dec=function(H,K,X){return this.declaration(H,K,X)},q.prototype.dtd=function(H,K,X){return this.doctype(H,K,X)},q.prototype.e=function(H,K,X){return this.element(H,K,X)},q.prototype.n=function(H,K,X){return this.node(H,K,X)},q.prototype.t=function(H){return this.text(H)},q.prototype.d=function(H){return this.cdata(H)},q.prototype.c=function(H){return this.comment(H)},q.prototype.r=function(H){return this.raw(H)},q.prototype.i=function(H,K){return this.instruction(H,K)},q.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},q.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},q.prototype.ent=function(H,K){return this.entity(H,K)},q.prototype.pent=function(H,K){return this.pEntity(H,K)},q.prototype.not=function(H,K){return this.notation(H,K)},q})()}).call(Lj)});var Fj=Z((jj,Mj)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var c in u)i.call(u,c)&&(a[c]=u[c]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;r=cn(),n=u_(),e=Xg(),Mj.exports=t=(function(a){s(u,a);function u(c,f){this.stream=c,u.__super__.constructor.call(this,f)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(c,f,h){return c.isLastRootNode&&f.state===e.CloseTag?"":u.__super__.endline.call(this,c,f,h)},u.prototype.document=function(c,f){var h,m,g,x,v,w,S,A,T;for(S=c.children,m=g=0,v=S.length;g<v;m=++g)h=S[m],h.isLastRootNode=m===c.children.length-1;for(f=this.filterOptions(f),A=c.children,T=[],x=0,w=A.length;x<w;x++)h=A[x],T.push(this.writeChildNode(h,f,0));return T},u.prototype.attribute=function(c,f,h){return this.stream.write(u.__super__.attribute.call(this,c,f,h))},u.prototype.cdata=function(c,f,h){return this.stream.write(u.__super__.cdata.call(this,c,f,h))},u.prototype.comment=function(c,f,h){return this.stream.write(u.__super__.comment.call(this,c,f,h))},u.prototype.declaration=function(c,f,h){return this.stream.write(u.__super__.declaration.call(this,c,f,h))},u.prototype.docType=function(c,f,h){var m,g,x,v;if(h||(h=0),this.openNode(c,f,h),f.state=e.OpenTag,this.stream.write(this.indent(c,f,h)),this.stream.write("<!DOCTYPE "+c.root().name),c.pubID&&c.sysID?this.stream.write(' PUBLIC "'+c.pubID+'" "'+c.sysID+'"'):c.sysID&&this.stream.write(' SYSTEM "'+c.sysID+'"'),c.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(c,f,h)),f.state=e.InsideTag,v=c.children,g=0,x=v.length;g<x;g++)m=v[g],this.writeChildNode(m,f,h+1);f.state=e.CloseTag,this.stream.write("]")}return f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+">"),this.stream.write(this.endline(c,f,h)),f.state=e.None,this.closeNode(c,f,h)},u.prototype.element=function(c,f,h){var m,g,x,v,w,S,A,T,b,E;h||(h=0),this.openNode(c,f,h),f.state=e.OpenTag,this.stream.write(this.indent(c,f,h)+"<"+c.name),b=c.attribs;for(A in b)i.call(b,A)&&(m=b[A],this.attribute(m,f,h));if(x=c.children.length,v=x===0?null:c.children[0],x===0||c.children.every(function(C){return(C.type===r.Text||C.type===r.Raw)&&C.value===""}))f.allowEmpty?(this.stream.write(">"),f.state=e.CloseTag,this.stream.write("</"+c.name+">")):(f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>"));else if(f.pretty&&x===1&&(v.type===r.Text||v.type===r.Raw)&&v.value!=null)this.stream.write(">"),f.state=e.InsideTag,f.suppressPrettyCount++,T=!0,this.writeChildNode(v,f,h+1),f.suppressPrettyCount--,T=!1,f.state=e.CloseTag,this.stream.write("</"+c.name+">");else{for(this.stream.write(">"+this.endline(c,f,h)),f.state=e.InsideTag,E=c.children,w=0,S=E.length;w<S;w++)g=E[w],this.writeChildNode(g,f,h+1);f.state=e.CloseTag,this.stream.write(this.indent(c,f,h)+"</"+c.name+">")}return this.stream.write(this.endline(c,f,h)),f.state=e.None,this.closeNode(c,f,h)},u.prototype.processingInstruction=function(c,f,h){return this.stream.write(u.__super__.processingInstruction.call(this,c,f,h))},u.prototype.raw=function(c,f,h){return this.stream.write(u.__super__.raw.call(this,c,f,h))},u.prototype.text=function(c,f,h){return this.stream.write(u.__super__.text.call(this,c,f,h))},u.prototype.dtdAttList=function(c,f,h){return this.stream.write(u.__super__.dtdAttList.call(this,c,f,h))},u.prototype.dtdElement=function(c,f,h){return this.stream.write(u.__super__.dtdElement.call(this,c,f,h))},u.prototype.dtdEntity=function(c,f,h){return this.stream.write(u.__super__.dtdEntity.call(this,c,f,h))},u.prototype.dtdNotation=function(c,f,h){return this.stream.write(u.__super__.dtdNotation.call(this,c,f,h))},u})(n)}).call(jj)});var Hj=Z((qj,cc)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f;f=Ya(),u=f.assign,c=f.isFunction,t=s_(),n=c_(),s=Uj(),a=wb(),i=Fj(),r=cn(),e=Xg(),cc.exports.create=function(h,m,g,x){var v,w;if(h==null)throw new Error("Root element needs a name.");return x=u({},m,g,x),v=new n(x),w=v.element(h),x.headless||(v.declaration(x),(x.pubID!=null||x.sysID!=null)&&v.dtd(x)),w},cc.exports.begin=function(h,m,g){var x;return c(h)&&(x=[h,m],m=x[0],g=x[1],h={}),m?new s(h,m,g):new n(h)},cc.exports.stringWriter=function(h){return new a(h)},cc.exports.streamWriter=function(h,m){return new i(h,m)},cc.exports.implementation=new t,cc.exports.nodeType=r,cc.exports.writerState=e}).call(qj)});var Kj=Z(l_=>{"use strict";(function(){"use strict";var r,e,t,n,s,i={}.hasOwnProperty;r=Hj(),e=ab().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),s=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),l_.Builder=(function(){function a(u){var c,f,h;this.options={},f=e["0.2"];for(c in f)i.call(f,c)&&(h=f[c],this.options[c]=h);for(c in u)i.call(u,c)&&(h=u[c],this.options[c]=h)}return o(a,"Builder"),a.prototype.buildObject=function(u){var c,f,h,m,g;return c=this.options.attrkey,f=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,h=(function(x){return function(v,w){var S,A,T,b,E,C;if(typeof w!="object")x.options.cdata&&n(w)?v.raw(s(w)):v.txt(w);else if(Array.isArray(w)){for(b in w)if(i.call(w,b)){A=w[b];for(E in A)T=A[E],v=h(v.ele(E),T).up()}}else for(E in w)if(i.call(w,E))if(A=w[E],E===c){if(typeof A=="object")for(S in A)C=A[S],v=v.att(S,C)}else if(E===f)x.options.cdata&&n(A)?v=v.raw(s(A)):v=v.txt(A);else if(Array.isArray(A))for(b in A)i.call(A,b)&&(T=A[b],typeof T=="string"?x.options.cdata&&n(T)?v=v.ele(E).raw(s(T)).up():v=v.ele(E,T).up():v=h(v.ele(E),T).up());else typeof A=="object"?v=h(v.ele(E),A).up():typeof A=="string"&&x.options.cdata&&n(A)?v=v.ele(E).raw(s(A)).up():(A==null&&(A=""),v=v.ele(E,A.toString()).up());return v}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),h(m,u).end(this.options.renderOpts)},a})()}).call(l_)});var $j=Z(f_=>{"use strict";(function(){"use strict";f_.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(f_)});var h_=Z(zl=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),zl.normalize=function(e){return e.toLowerCase()},zl.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},zl.stripPrefix=function(e){return e.replace(r,"")},zl.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},zl.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(zl)});var Gj=Z(Lo=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,u,c,f=o(function(g,x){return function(){return g.apply(x,arguments)}},"bind"),h=o(function(g,x){for(var v in x)m.call(x,v)&&(g[v]=x[v]);function w(){this.constructor=g}return o(w,"ctor"),w.prototype=x.prototype,g.prototype=new w,g.__super__=x.prototype,g},"extend"),m={}.hasOwnProperty;u=jI(),n=Xe("events"),r=$j(),a=h_(),c=Xe("timers").setImmediate,e=ab().defaults,s=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),i=o(function(g,x,v){var w,S,A;for(w=0,S=g.length;w<S;w++)A=g[w],x=A(x,v);return x},"processItem"),t=o(function(g,x,v){var w;return w=Object.create(null),w.value=v,w.writable=!0,w.enumerable=!0,w.configurable=!0,Object.defineProperty(g,x,w)},"defineProperty"),Lo.Parser=(function(g){h(x,g);function x(v){this.parseStringPromise=f(this.parseStringPromise,this),this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this);var w,S,A;if(!(this instanceof Lo.Parser))return new Lo.Parser(v);this.options={},S=e["0.2"];for(w in S)m.call(S,w)&&(A=S[w],this.options[w]=A);for(w in v)m.call(v,w)&&(A=v[w],this.options[w]=A);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return o(x,"Parser"),x.prototype.processAsync=function(){var v,w;try{return this.remaining.length<=this.options.chunkSize?(v=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(v),this.saxParser.close()):(v=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(v),c(this.processAsync))}catch(S){if(w=S,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(w)}},x.prototype.assignOrPush=function(v,w,S){return w in v?(v[w]instanceof Array||t(v,w,[v[w]]),v[w].push(S)):this.options.explicitArray?t(v,w,[S]):t(v,w,S)},x.prototype.reset=function(){var v,w,S,A;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(T){return function(b){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",b)}})(this),this.saxParser.onend=(function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,A=[],v=this.options.attrkey,w=this.options.charkey,this.saxParser.onopentag=(function(T){return function(b){var E,C,_,F,R;if(_={},_[w]="",!T.options.ignoreAttrs){R=b.attributes;for(E in R)m.call(R,E)&&(!(v in _)&&!T.options.mergeAttrs&&(_[v]={}),C=T.options.attrValueProcessors?i(T.options.attrValueProcessors,b.attributes[E],E):b.attributes[E],F=T.options.attrNameProcessors?i(T.options.attrNameProcessors,E):E,T.options.mergeAttrs?T.assignOrPush(_,F,C):t(_[v],F,C))}return _["#name"]=T.options.tagNameProcessors?i(T.options.tagNameProcessors,b.name):b.name,T.options.xmlns&&(_[T.options.xmlnskey]={uri:b.uri,local:b.local}),A.push(_)}})(this),this.saxParser.onclosetag=(function(T){return function(){var b,E,C,_,F,R,q,H,K,X;if(R=A.pop(),F=R["#name"],(!T.options.explicitChildren||!T.options.preserveChildrenOrder)&&delete R["#name"],R.cdata===!0&&(b=R.cdata,delete R.cdata),K=A[A.length-1],R[w].match(/^\s*$/)&&!b?(E=R[w],delete R[w]):(T.options.trim&&(R[w]=R[w].trim()),T.options.normalize&&(R[w]=R[w].replace(/\s{2,}/g," ").trim()),R[w]=T.options.valueProcessors?i(T.options.valueProcessors,R[w],F):R[w],Object.keys(R).length===1&&w in R&&!T.EXPLICIT_CHARKEY&&(R=R[w])),s(R)&&(typeof T.options.emptyTag=="function"?R=T.options.emptyTag():R=T.options.emptyTag!==""?T.options.emptyTag:E),T.options.validator!=null&&(X="/"+(function(){var pe,le,ue;for(ue=[],pe=0,le=A.length;pe<le;pe++)_=A[pe],ue.push(_["#name"]);return ue})().concat(F).join("/"),(function(){var pe;try{return R=T.options.validator(X,K&&K[F],R)}catch(le){return pe=le,T.emit("error",pe)}})()),T.options.explicitChildren&&!T.options.mergeAttrs&&typeof R=="object"){if(!T.options.preserveChildrenOrder)_={},T.options.attrkey in R&&(_[T.options.attrkey]=R[T.options.attrkey],delete R[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in R&&(_[T.options.charkey]=R[T.options.charkey],delete R[T.options.charkey]),Object.getOwnPropertyNames(R).length>0&&(_[T.options.childkey]=R),R=_;else if(K){K[T.options.childkey]=K[T.options.childkey]||[],q={};for(C in R)m.call(R,C)&&t(q,C,R[C]);K[T.options.childkey].push(q),delete R["#name"],Object.keys(R).length===1&&w in R&&!T.EXPLICIT_CHARKEY&&(R=R[w])}}return A.length>0?T.assignOrPush(K,F,R):(T.options.explicitRoot&&(H=R,R={},t(R,F,H)),T.resultObject=R,T.saxParser.ended=!0,T.emit("end",T.resultObject))}})(this),S=(function(T){return function(b){var E,C;if(C=A[A.length-1],C)return C[w]+=b,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||b.replace(/\\n/g,"").trim()!=="")&&(C[T.options.childkey]=C[T.options.childkey]||[],E={"#name":"__text__"},E[w]=b,T.options.normalize&&(E[w]=E[w].replace(/\s{2,}/g," ").trim()),C[T.options.childkey].push(E)),C}})(this),this.saxParser.ontext=S,this.saxParser.oncdata=(function(T){return function(b){var E;if(E=S(b),E)return E.cdata=!0}})(this)},x.prototype.parseString=function(v,w){var S;w!=null&&typeof w=="function"&&(this.on("end",function(A){return this.reset(),w(null,A)}),this.on("error",function(A){return this.reset(),w(A)}));try{return v=v.toString(),v.trim()===""?(this.emit("end",null),!0):(v=r.stripBOM(v),this.options.async?(this.remaining=v,c(this.processAsync),this.saxParser):this.saxParser.write(v).close())}catch(A){if(S=A,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw S}else return this.emit("error",S),this.saxParser.errThrown=!0}},x.prototype.parseStringPromise=function(v){return new Promise((function(w){return function(S,A){return w.parseString(v,function(T,b){return T?A(T):S(b)})}})(this))},x})(n),Lo.parseString=function(g,x,v){var w,S,A;return v!=null?(typeof v=="function"&&(w=v),typeof x=="object"&&(S=x)):(typeof x=="function"&&(w=x),S={}),A=new Lo.Parser(S),A.parseString(g,w)},Lo.parseStringPromise=function(g,x){var v,w;return typeof x=="object"&&(v=x),w=new Lo.Parser(v),w.parseStringPromise(g)}}).call(Lo)});var Xj=Z(Vo=>{"use strict";(function(){"use strict";var r,e,t,n,s=o(function(a,u){for(var c in u)i.call(u,c)&&(a[c]=u[c]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;e=ab(),r=Kj(),t=Gj(),n=h_(),Vo.defaults=e.defaults,Vo.processors=n,Vo.ValidationError=(function(a){s(u,a);function u(c){this.message=c}return o(u,"ValidationError"),u})(Error),Vo.Builder=r.Builder,Vo.Parser=t.Parser,Vo.parseString=t.parseString,Vo.parseStringPromise=t.parseStringPromise}).call(Vo)});var I2="http://www.w3.org/2000/09/xmldsig#",dO="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",_2=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),Cu=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),B2=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var br={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},_he=Object.keys(br);var Dhe={Production:"1",Homolog:"2"};var pn=class extends Error{static{o(this,"NFeTsError")}};var mO=class extends pn{static{o(this,"ValidationError")}};var D2=o(r=>{throw new pn("Didn't expect to get here")},"unreachable");var K0={includeComments:!1,exclusive:!0};var Zh=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Cu.SHA1,s=K0){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:I2},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:dO}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:I2},...e},{rootName:"SignedInfo"}),this.canonical);return await this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case Cu.SHA256:return B2.SHA256;case Cu.SHA1:return B2.SHA1;default:return D2(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Cu.SHA256:return _2.RSA_SHA256;case Cu.SHA1:return _2.RSA_SHA1;default:return D2(this.algorithm)}}};var R2=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},ew=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},ti=o(r=>new R2(r),"left"),ri=o(r=>r===void 0?new ew(void 0):new ew(r),"right");var gO=class extends Zh{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n;if(!e[s])return ti(new pn(`Node ${String(s)} not found`));let c=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),f=this.signedInfo(c,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=e;return m.Signature=this.assemble(f,h.value,u),ri(m)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...u}=s??{};return{$:{xmlns:n,...u},...i}}};var vO=class extends Zh{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n,c=this.toolkit.getNode(e,s);if(!c)return ti(new pn(`Node ${s} not found`));let f=this.signedInfo(c,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=await this.toolkit.build(this.assemble(f,h.value,u),{rootName:"Signature"});return ri(this.toolkit.appendNode(e,m))}};import"reflect-metadata";var $0="__SkipValidation__",ape=o(()=>(r,e)=>{Reflect.defineMetadata($0,!0,r,e.toString())},"SkipValidation"),ope=o(()=>r=>{Reflect.defineMetadata($0,!0,r)},"SkipAllValidations");import{plainToInstance as IW}from"class-transformer";var tw=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&tw(t)},"clearEmptyValues"),yO=o((r,e,t={})=>{let n=IW(e,r);return t.clearEmptyValues&&tw(n),n},"plainToInstance");import"reflect-metadata";import{validateSync as _W}from"class-validator";var xO="__ValidateErrors__",wO=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(wO(n.children,e?`${e}.${n.property}`:n.property));let s=Object.values(n.constraints??{}).map(i=>e?`${e}.${i}`:i).join(", ");return s?t.concat(s):t},[]),"mapConstraintsToErrors"),vpe=o(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata($0,this.constructor);if(Reflect.getMetadata($0,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[c,...f]=i,h=yO(c,r),m=_W(h,{whitelist:!0});if(tw(h),m.length){let g=Reflect.getMetadata(xO,this)??[];Reflect.defineMetadata(xO,g.concat(wO(m,s?.name)),this)}return s?.apply(this,[h,...f])}},"Validates");var ep=9e15,_u=1e9,P2="0123456789abcdef",sw="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",iw="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",O2={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ep,maxE:ep,crypto:!1},AO,Ao,_t=!0,ow="[DecimalError] ",Iu=ow+"Invalid argument: ",CO=ow+"Precision limit exceeded",NO=ow+"crypto unavailable",TO="[object Decimal]",ns=Math.floor,Sn=Math.pow,BW=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,DW=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,RW=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,IO=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qi=1e7,bt=7,PW=9007199254740991,OW=sw.length-1,k2=iw.length-1,Pe={toStringTag:TO};Pe.absoluteValue=Pe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),gt(r)};Pe.ceil=function(){return gt(new this.constructor(this),this.e+1,2)};Pe.clampedTo=Pe.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(Iu+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Pe.comparedTo=Pe.cmp=function(r){var e,t,n,s,i=this,a=i.d,u=(r=new i.constructor(r)).d,c=i.s,f=r.s;if(!a||!u)return!c||!f?NaN:c!==f?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-f:0;if(c!==f)return c;if(i.e!==r.e)return i.e>r.e^c<0?1:-1;for(n=a.length,s=u.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return n===s?0:n>s^c<0?1:-1};Pe.cosine=Pe.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+bt,n.rounding=1,t=kW(n,PO(n,t)),n.precision=r,n.rounding=e,gt(Ao==2||Ao==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Pe.cubeRoot=Pe.cbrt=function(){var r,e,t,n,s,i,a,u,c,f,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(_t=!1,i=h.s*Sn(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=Fn(h.d),r=h.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Sn(t,1/3),r=ns((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=h.s):n=new m(i.toString()),a=(r=m.precision)+3;;)if(u=n,c=u.times(u).times(u),f=c.plus(h),n=Tr(f.plus(h).times(u),f.plus(c),a+2,1),Fn(u.d).slice(0,a)===(t=Fn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(gt(u,r+1,0),u.times(u).times(u).eq(h))){n=u;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(gt(n,r+1,1),e=!n.times(n).times(n).eq(h));break}return _t=!0,gt(n,r,m.rounding,e)};Pe.decimalPlaces=Pe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-ns(this.e/bt))*bt,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Pe.dividedBy=Pe.div=function(r){return Tr(this,new this.constructor(r))};Pe.dividedToIntegerBy=Pe.divToInt=function(r){var e=this,t=e.constructor;return gt(Tr(e,new t(r),0,1,1),t.precision,t.rounding)};Pe.equals=Pe.eq=function(r){return this.cmp(r)===0};Pe.floor=function(){return gt(new this.constructor(this),this.e+1,3)};Pe.greaterThan=Pe.gt=function(r){return this.cmp(r)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(r){var e=this.cmp(r);return e==1||e===0};Pe.hyperbolicCosine=Pe.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/cw(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=tp(a,1,i.times(e),new a(1),!0);for(var c,f=r,h=new a(8);f--;)c=i.times(i),i=u.minus(c.times(h.minus(c.times(h))));return gt(i,a.precision=t,a.rounding=n,!0)};Pe.hyperbolicSine=Pe.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=tp(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/cw(5,r)),s=tp(i,2,s,s,!0);for(var a,u=new i(5),c=new i(16),f=new i(20);r--;)a=s.times(s),s=s.times(u.plus(a.times(c.times(a).plus(f))))}return i.precision=e,i.rounding=t,gt(s,e,t,!0)};Pe.hyperbolicTangent=Pe.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,Tr(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Pe.inverseCosine=Pe.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?Na(e,n,s):new e(0):new e(NaN):r.isZero()?Na(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};Pe.inverseHyperbolicCosine=Pe.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,_t=!1,t=t.times(t).minus(1).sqrt().plus(t),_t=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Pe.inverseHyperbolicSine=Pe.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,_t=!1,t=t.times(t).plus(1).sqrt().plus(t),_t=!0,n.precision=r,n.rounding=e,t.ln())};Pe.inverseHyperbolicTangent=Pe.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?gt(new i(s),r,e,!0):(i.precision=t=n-s.e,s=Tr(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};Pe.inverseSine=Pe.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=Na(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};Pe.inverseTangent=Pe.atan=function(){var r,e,t,n,s,i,a,u,c,f=this,h=f.constructor,m=h.precision,g=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&m+4<=k2)return a=Na(h,m+4,g).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(m+4<=k2)return a=Na(h,m+4,g).times(.5),a.s=f.s,a}for(h.precision=u=m+10,h.rounding=1,t=Math.min(28,u/bt+2|0),r=t;r;--r)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(_t=!1,e=Math.ceil(u/bt),n=1,c=f.times(f),a=new h(f),s=f;r!==-1;)if(s=s.times(c),i=a.minus(s.div(n+=2)),s=s.times(c),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),_t=!0,gt(a,h.precision=m,h.rounding=g,!0)};Pe.isFinite=function(){return!!this.d};Pe.isInteger=Pe.isInt=function(){return!!this.d&&ns(this.e/bt)>this.d.length-2};Pe.isNaN=function(){return!this.s};Pe.isNegative=Pe.isNeg=function(){return this.s<0};Pe.isPositive=Pe.isPos=function(){return this.s>0};Pe.isZero=function(){return!!this.d&&this.d[0]===0};Pe.lessThan=Pe.lt=function(r){return this.cmp(r)<0};Pe.lessThanOrEqualTo=Pe.lte=function(r){return this.cmp(r)<1};Pe.logarithm=Pe.log=function(r){var e,t,n,s,i,a,u,c,f=this,h=f.constructor,m=h.precision,g=h.rounding,x=5;if(r==null)r=new h(10),e=!0;else{if(r=new h(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new h(NaN);e=r.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new h(t&&!t[0]?-1/0:f.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(_t=!1,u=m+x,a=Tu(f,u),n=e?aw(h,u+10):Tu(r,u),c=Tr(a,n,u,1),G0(c.d,s=m,g))do if(u+=10,a=Tu(f,u),n=e?aw(h,u+10):Tu(r,u),c=Tr(a,n,u,1),!i){+Fn(c.d).slice(s+1,s+15)+1==1e14&&(c=gt(c,m+1,0));break}while(G0(c.d,s+=10,g));return _t=!0,gt(c,m,g)};Pe.minus=Pe.sub=function(r){var e,t,n,s,i,a,u,c,f,h,m,g,x=this,v=x.constructor;if(r=new v(r),!x.d||!r.d)return!x.s||!r.s?r=new v(NaN):x.d?r.s=-r.s:r=new v(r.d||x.s!==r.s?x:NaN),r;if(x.s!=r.s)return r.s=-r.s,x.plus(r);if(f=x.d,g=r.d,u=v.precision,c=v.rounding,!f[0]||!g[0]){if(g[0])r.s=-r.s;else if(f[0])r=new v(x);else return new v(c===3?-0:0);return _t?gt(r,u,c):r}if(t=ns(r.e/bt),h=ns(x.e/bt),f=f.slice(),i=h-t,i){for(m=i<0,m?(e=f,i=-i,a=g.length):(e=g,t=h,a=f.length),n=Math.max(Math.ceil(u/bt),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=f.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(f[n]!=g[n]){m=f[n]<g[n];break}i=0}for(m&&(e=f,f=g,g=e,r.s=-r.s),a=f.length,n=g.length-a;n>0;--n)f[a++]=0;for(n=g.length;n>i;){if(f[--n]<g[n]){for(s=n;s&&f[--s]===0;)f[s]=Qi-1;--f[s],f[n]+=Qi}f[n]-=g[n]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(r.d=f,r.e=uw(f,t),_t?gt(r,u,c):r):new v(c===3?-0:0)};Pe.modulo=Pe.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?gt(new n(t),n.precision,n.rounding):(_t=!1,n.modulo==9?(e=Tr(t,r.abs(),0,3,1),e.s*=r.s):e=Tr(t,r,0,n.modulo,1),e=e.times(r),_t=!0,t.minus(e))};Pe.naturalExponential=Pe.exp=function(){return L2(this)};Pe.naturalLogarithm=Pe.ln=function(){return Tu(this)};Pe.negated=Pe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,gt(r)};Pe.plus=Pe.add=function(r){var e,t,n,s,i,a,u,c,f,h,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(f=m.d,h=r.d,u=g.precision,c=g.rounding,!f[0]||!h[0])return h[0]||(r=new g(m)),_t?gt(r,u,c):r;if(i=ns(m.e/bt),n=ns(r.e/bt),f=f.slice(),s=i-n,s){for(s<0?(t=f,s=-s,a=h.length):(t=h,n=i,a=f.length),i=Math.ceil(u/bt),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=f.length,s=h.length,a-s<0&&(s=a,t=h,h=f,f=t),e=0;s;)e=(f[--s]=f[s]+h[s]+e)/Qi|0,f[s]%=Qi;for(e&&(f.unshift(e),++n),a=f.length;f[--a]==0;)f.pop();return r.d=f,r.e=uw(f,n),_t?gt(r,u,c):r};Pe.precision=Pe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(Iu+r);return t.d?(e=_O(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Pe.round=function(){var r=this,e=r.constructor;return gt(new e(r),r.e+1,e.rounding)};Pe.sine=Pe.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+bt,n.rounding=1,t=VW(n,PO(n,t)),n.precision=r,n.rounding=e,gt(Ao>2?t.neg():t,r,e,!0)):new n(NaN)};Pe.squareRoot=Pe.sqrt=function(){var r,e,t,n,s,i,a=this,u=a.d,c=a.e,f=a.s,h=a.constructor;if(f!==1||!u||!u[0])return new h(!f||f<0&&(!u||u[0])?NaN:u?a:1/0);for(_t=!1,f=Math.sqrt(+a),f==0||f==1/0?(e=Fn(u),(e.length+c)%2==0&&(e+="0"),f=Math.sqrt(e),c=ns((c+1)/2)-(c<0||c%2),f==1/0?e="5e"+c:(e=f.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new h(e)):n=new h(f.toString()),t=(c=h.precision)+3;;)if(i=n,n=i.plus(Tr(a,i,t+2,1)).times(.5),Fn(i.d).slice(0,t)===(e=Fn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(gt(i,c+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(gt(n,c+1,1),r=!n.times(n).eq(a));break}return _t=!0,gt(n,c,h.rounding,r)};Pe.tangent=Pe.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=Tr(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,gt(Ao==2||Ao==4?t.neg():t,r,e,!0)):new n(NaN)};Pe.times=Pe.mul=function(r){var e,t,n,s,i,a,u,c,f,h=this,m=h.constructor,g=h.d,x=(r=new m(r)).d;if(r.s*=h.s,!g||!g[0]||!x||!x[0])return new m(!r.s||g&&!g[0]&&!x||x&&!x[0]&&!g?NaN:!g||!x?r.s/0:r.s*0);for(t=ns(h.e/bt)+ns(r.e/bt),c=g.length,f=x.length,c<f&&(i=g,g=x,x=i,a=c,c=f,f=a),i=[],a=c+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(e=0,s=c+n;s>n;)u=i[s]+x[n]*g[s-n-1]+e,i[s--]=u%Qi|0,e=u/Qi|0;i[s]=(i[s]+e)%Qi|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=uw(i,t),_t?gt(r,m.precision,m.rounding):r};Pe.toBinary=function(r,e){return V2(this,2,r,e)};Pe.toDecimalPlaces=Pe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Is(r,0,_u),e===void 0?e=n.rounding:Is(e,0,8),gt(t,r+t.e+1,e))};Pe.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Ta(n,!0):(Is(r,0,_u),e===void 0?e=s.rounding:Is(e,0,8),n=gt(new s(n),r+1,e),t=Ta(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=Ta(s):(Is(r,0,_u),e===void 0?e=i.rounding:Is(e,0,8),n=gt(new i(s),r+s.e+1,e),t=Ta(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Pe.toFraction=function(r){var e,t,n,s,i,a,u,c,f,h,m,g,x=this,v=x.d,w=x.constructor;if(!v)return new w(x);if(f=t=new w(1),n=c=new w(0),e=new w(n),i=e.e=_O(v)-x.e-1,a=i%bt,e.d[0]=Sn(10,a<0?bt+a:a),r==null)r=i>0?e:f;else{if(u=new w(r),!u.isInt()||u.lt(f))throw Error(Iu+u);r=u.gt(e)?i>0?e:f:u}for(_t=!1,u=new w(Fn(v)),h=w.precision,w.precision=i=v.length*bt*2;m=Tr(u,e,0,1,1),s=t.plus(m.times(n)),s.cmp(r)!=1;)t=n,n=s,s=f,f=c.plus(m.times(s)),c=s,s=e,e=u.minus(m.times(s)),u=s;return s=Tr(r.minus(t),n,0,1,1),c=c.plus(s.times(f)),t=t.plus(s.times(n)),c.s=f.s=x.s,g=Tr(f,n,i,1).minus(x).abs().cmp(Tr(c,t,i,1).minus(x).abs())<1?[f,n]:[c,t],w.precision=h,_t=!0,g};Pe.toHexadecimal=Pe.toHex=function(r,e){return V2(this,16,r,e)};Pe.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Is(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(_t=!1,t=Tr(t,r,0,e,1).times(r),_t=!0,gt(t)):(r.s=t.s,t=r),t};Pe.toNumber=function(){return+this};Pe.toOctal=function(r,e){return V2(this,8,r,e)};Pe.toPower=Pe.pow=function(r){var e,t,n,s,i,a,u=this,c=u.constructor,f=+(r=new c(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new c(Sn(+u,f));if(u=new c(u),u.eq(1))return u;if(n=c.precision,i=c.rounding,r.eq(1))return gt(u,n,i);if(e=ns(r.e/bt),e>=r.d.length-1&&(t=f<0?-f:f)<=PW)return s=BO(c,u,t,n),r.s<0?new c(1).div(s):gt(s,n,i);if(a=u.s,a<0){if(e<r.d.length-1)return new c(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=Sn(+u,f),e=t==0||!isFinite(t)?ns(f*(Math.log("0."+Fn(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):(_t=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),s=L2(r.times(Tu(u,n+t)),n),s.d&&(s=gt(s,n+5,1),G0(s.d,n,i)&&(e=n+10,s=gt(L2(r.times(Tu(u,e+t)),e),e+5,1),+Fn(s.d).slice(n+1,n+15)+1==1e14&&(s=gt(s,n+1,0)))),s.s=a,_t=!0,c.rounding=i,gt(s,n,i))};Pe.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Ta(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(Is(r,1,_u),e===void 0?e=s.rounding:Is(e,0,8),n=gt(new s(n),r,e),t=Ta(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toSignificantDigits=Pe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Is(r,1,_u),e===void 0?e=n.rounding:Is(e,0,8)),gt(new n(t),r,e)};Pe.toString=function(){var r=this,e=r.constructor,t=Ta(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Pe.truncated=Pe.trunc=function(){return gt(new this.constructor(this),this.e+1,1)};Pe.valueOf=Pe.toJSON=function(){var r=this,e=r.constructor,t=Ta(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Fn(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=bt-n.length,t&&(i+=Nu(t)),i+=n;a=r[e],n=a+"",t=bt-n.length,t&&(i+=Nu(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}o(Fn,"digitsToString");function Is(r,e,t){if(r!==~~r||r<e||r>t)throw Error(Iu+r)}o(Is,"checkInt32");function G0(r,e,t,n){var s,i,a,u;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=bt,s=0):(s=Math.ceil((e+1)/bt),e%=bt),i=Sn(10,bt-e),u=r[s]%i|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(r[s+1]/i/100|0)==Sn(10,e-2)-1||(u==i/2||u==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==i||!n&&t>3&&u+1==i/2)&&(r[s+1]/i/1e3|0)==Sn(10,e-3)-1,a}o(G0,"checkRoundingDigits");function rw(r,e,t){for(var n,s=[0],i,a=0,u=r.length;a<u;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=P2.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}o(rw,"convertBase");function kW(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/cw(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=tp(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(kW,"cosine");var Tr=(function(){function r(n,s,i){var a,u=0,c=n.length;for(n=n.slice();c--;)a=n[c]*s+u,n[c]=a%i|0,u=a/i|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,s,i,a){var u,c;if(i!=a)c=i>a?1:-1;else for(u=c=0;u<i;u++)if(n[u]!=s[u]){c=n[u]>s[u]?1:-1;break}return c}o(e,"compare");function t(n,s,i,a){for(var u=0;i--;)n[i]-=u,u=n[i]<s[i]?1:0,n[i]=u*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,s,i,a,u,c){var f,h,m,g,x,v,w,S,A,T,b,E,C,_,F,R,q,H,K,X,pe=n.constructor,le=n.s==s.s?1:-1,ue=n.d,ee=s.d;if(!ue||!ue[0]||!ee||!ee[0])return new pe(!n.s||!s.s||(ue?ee&&ue[0]==ee[0]:!ee)?NaN:ue&&ue[0]==0||!ee?le*0:le/0);for(c?(x=1,h=n.e-s.e):(c=Qi,x=bt,h=ns(n.e/x)-ns(s.e/x)),K=ee.length,q=ue.length,A=new pe(le),T=A.d=[],m=0;ee[m]==(ue[m]||0);m++);if(ee[m]>(ue[m]||0)&&h--,i==null?(_=i=pe.precision,a=pe.rounding):u?_=i+(n.e-s.e)+1:_=i,_<0)T.push(1),v=!0;else{if(_=_/x+2|0,m=0,K==1){for(g=0,ee=ee[0],_++;(m<q||g)&&_--;m++)F=g*c+(ue[m]||0),T[m]=F/ee|0,g=F%ee|0;v=g||m<q}else{for(g=c/(ee[0]+1)|0,g>1&&(ee=r(ee,g,c),ue=r(ue,g,c),K=ee.length,q=ue.length),R=K,b=ue.slice(0,K),E=b.length;E<K;)b[E++]=0;X=ee.slice(),X.unshift(0),H=ee[0],ee[1]>=c/2&&++H;do g=0,f=e(ee,b,K,E),f<0?(C=b[0],K!=E&&(C=C*c+(b[1]||0)),g=C/H|0,g>1?(g>=c&&(g=c-1),w=r(ee,g,c),S=w.length,E=b.length,f=e(w,b,S,E),f==1&&(g--,t(w,K<S?X:ee,S,c))):(g==0&&(f=g=1),w=ee.slice()),S=w.length,S<E&&w.unshift(0),t(b,w,E,c),f==-1&&(E=b.length,f=e(ee,b,K,E),f<1&&(g++,t(b,K<E?X:ee,E,c))),E=b.length):f===0&&(g++,b=[0]),T[m++]=g,f&&b[0]?b[E++]=ue[R]||0:(b=[ue[R]],E=1);while((R++<q||b[0]!==void 0)&&_--);v=b[0]!==void 0}T[0]||T.shift()}if(x==1)A.e=h,AO=v;else{for(m=1,g=T[0];g>=10;g/=10)m++;A.e=m+h*x-1,gt(A,u?i+A.e+1:i,a,v)}return A}})();function gt(r,e,t,n){var s,i,a,u,c,f,h,m,g,x=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(s=1,u=m[0];u>=10;u/=10)s++;if(i=e-s,i<0)i+=bt,a=e,h=m[g=0],c=h/Sn(10,s-a-1)%10|0;else if(g=Math.ceil((i+1)/bt),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);h=c=0,s=1,i%=bt,a=i-bt+1}else break e;else{for(h=u=m[g],s=1;u>=10;u/=10)s++;i%=bt,a=i-bt+s,c=a<0?0:h/Sn(10,s-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?h:h%Sn(10,s-a-1)),f=t<4?(c||n)&&(t==0||t==(r.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(i>0?a>0?h/Sn(10,s-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,f?(e-=r.e+1,m[0]=Sn(10,(bt-e%bt)%bt),r.e=-e||0):m[0]=r.e=0,r;if(i==0?(m.length=g,u=1,g--):(m.length=g+1,u=Sn(10,bt-i),m[g]=a>0?(h/Sn(10,s-a)%Sn(10,a)|0)*u:0),f)for(;;)if(g==0){for(i=1,a=m[0];a>=10;a/=10)i++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(r.e++,m[0]==Qi&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Qi)break;m[g--]=0,u=1}for(i=m.length;m[--i]===0;)m.pop()}return _t&&(r.e>x.maxE?(r.d=null,r.e=NaN):r.e<x.minE&&(r.e=0,r.d=[0])),r}o(gt,"finalise");function Ta(r,e,t){if(!r.isFinite())return RO(r);var n,s=r.e,i=Fn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+Nu(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+Nu(-s-1)+i,t&&(n=t-a)>0&&(i+=Nu(n))):s>=a?(i+=Nu(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+Nu(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=Nu(n))),i}o(Ta,"finiteToString");function uw(r,e){var t=r[0];for(e*=bt;t>=10;t/=10)e++;return e}o(uw,"getBase10Exponent");function aw(r,e,t){if(e>OW)throw _t=!0,t&&(r.precision=t),Error(CO);return gt(new r(sw),e,1,!0)}o(aw,"getLn10");function Na(r,e,t){if(e>k2)throw Error(CO);return gt(new r(iw),e,t,!0)}o(Na,"getPi");function _O(r){var e=r.length-1,t=e*bt+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(_O,"getPrecision");function Nu(r){for(var e="";r--;)e+="0";return e}o(Nu,"getZeroString");function BO(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/bt+4);for(_t=!1;;){if(t%2&&(i=i.times(e),bO(i.d,a)&&(s=!0)),t=ns(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),bO(e.d,a)}return _t=!0,i}o(BO,"intPow");function SO(r){return r.d[r.d.length-1]&1}o(SO,"isOdd");function DO(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}o(DO,"maxOrMin");function L2(r,e){var t,n,s,i,a,u,c,f=0,h=0,m=0,g=r.constructor,x=g.rounding,v=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(_t=!1,c=v):c=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(Sn(2,m))/Math.LN10*2+5|0,c+=n,t=i=a=new g(1),g.precision=c;;){if(i=gt(i.times(r),c,1),t=t.times(++h),u=a.plus(Tr(i,t,c,1)),Fn(u.d).slice(0,c)===Fn(a.d).slice(0,c)){for(s=m;s--;)a=gt(a.times(a),c,1);if(e==null)if(f<3&&G0(a.d,c-n,x,f))g.precision=c+=10,t=i=u=new g(1),h=0,f++;else return gt(a,g.precision=v,x,_t=!0);else return g.precision=v,a}a=u}}o(L2,"naturalExponential");function Tu(r,e){var t,n,s,i,a,u,c,f,h,m,g,x=1,v=10,w=r,S=w.d,A=w.constructor,T=A.rounding,b=A.precision;if(w.s<0||!S||!S[0]||!w.e&&S[0]==1&&S.length==1)return new A(S&&!S[0]?-1/0:w.s!=1?NaN:S?0:w);if(e==null?(_t=!1,h=b):h=e,A.precision=h+=v,t=Fn(S),n=t.charAt(0),Math.abs(i=w.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)w=w.times(r),t=Fn(w.d),n=t.charAt(0),x++;i=w.e,n>1?(w=new A("0."+t),i++):w=new A(n+"."+t.slice(1))}else return f=aw(A,h+2,b).times(i+""),w=Tu(new A(n+"."+t.slice(1)),h-v).plus(f),A.precision=b,e==null?gt(w,b,T,_t=!0):w;for(m=w,c=a=w=Tr(w.minus(1),w.plus(1),h,1),g=gt(w.times(w),h,1),s=3;;){if(a=gt(a.times(g),h,1),f=c.plus(Tr(a,new A(s),h,1)),Fn(f.d).slice(0,h)===Fn(c.d).slice(0,h))if(c=c.times(2),i!==0&&(c=c.plus(aw(A,h+2,b).times(i+""))),c=Tr(c,new A(x),h,1),e==null)if(G0(c.d,h-v,T,u))A.precision=h+=v,f=a=w=Tr(m.minus(1),m.plus(1),h,1),g=gt(w.times(w),h,1),s=u=1;else return gt(c,A.precision=b,T,_t=!0);else return A.precision=b,c;c=f,s+=2}}o(Tu,"naturalLogarithm");function RO(r){return String(r.s*r.s/0)}o(RO,"nonFiniteToString");function nw(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%bt,t<0&&(n+=bt),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=bt;n<s;)r.d.push(+e.slice(n,n+=bt));e=e.slice(n),n=bt-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),_t&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(nw,"parseDecimal");function LW(r,e){var t,n,s,i,a,u,c,f,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),IO.test(e))return nw(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(DW.test(e))t=16,e=e.toLowerCase();else if(BW.test(e))t=2;else if(RW.test(e))t=8;else throw Error(Iu+e);for(i=e.search(/p/i),i>0?(c=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,i=u-i,s=BO(n,new n(t),i,i*2)),f=rw(e,t,Qi),h=f.length-1,i=h;f[i]===0;--i)f.pop();return i<0?new n(r.s*0):(r.e=uw(f,h),r.d=f,_t=!1,a&&(r=Tr(r,s,u*4)),c&&(r=r.times(Math.abs(c)<54?Sn(2,c):rp.pow(2,c))),_t=!0,r)}o(LW,"parseOther");function VW(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:tp(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/cw(5,t)),e=tp(r,2,e,e);for(var s,i=new r(5),a=new r(16),u=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(u))));return e}o(VW,"sine");function tp(r,e,t,n,s){var i,a,u,c,f=1,h=r.precision,m=Math.ceil(h/bt);for(_t=!1,c=t.times(t),u=new r(n);;){if(a=Tr(u.times(c),new r(e++*e++),h,1),u=s?n.plus(a):n.minus(a),n=Tr(a.times(c),new r(e++*e++),h,1),a=u.plus(n),a.d[m]!==void 0){for(i=m;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=n,n=a,a=i,f++}return _t=!0,a.d.length=m+1,a}o(tp,"taylorSeries");function cw(r,e){for(var t=r;--e;)t*=r;return t}o(cw,"tinyPow");function PO(r,e){var t,n=e.s<0,s=Na(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return Ao=n?4:1,e;if(t=e.divToInt(s),t.isZero())Ao=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return Ao=SO(t)?n?2:3:n?4:1,e;Ao=SO(t)?n?1:4:n?3:2}return e.minus(s).abs()}o(PO,"toLessThanHalfPi");function V2(r,e,t,n){var s,i,a,u,c,f,h,m,g,x=r.constructor,v=t!==void 0;if(v?(Is(t,1,_u),n===void 0?n=x.rounding:Is(n,0,8)):(t=x.precision,n=x.rounding),!r.isFinite())h=RO(r);else{for(h=Ta(r),a=h.indexOf("."),v?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(h=h.replace(".",""),g=new x(1),g.e=h.length-a,g.d=rw(Ta(g),10,s),g.e=g.d.length),m=rw(h,10,s),i=c=m.length;m[--c]==0;)m.pop();if(!m[0])h=v?"0p+0":"0";else{if(a<0?i--:(r=new x(r),r.d=m,r.e=i,r=Tr(r,g,t,n,0,s),m=r.d,i=r.e,f=AO),a=m[t],u=s/2,f=f||m[t+1]!==void 0,f=n<4?(a!==void 0||f)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||f||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,f)for(;++m[--t]>s-1;)m[t]=0,t||(++i,m.unshift(1));for(c=m.length;!m[c-1];--c);for(a=0,h="";a<c;a++)h+=P2.charAt(m[a]);if(v){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)h+="0";for(m=rw(h,s,e),c=m.length;!m[c-1];--c);for(a=1,h="1.";a<c;a++)h+=P2.charAt(m[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>c)for(i-=c;i--;)h+="0";else i<c&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return r.s<0?"-"+h:h}o(V2,"toStringBinary");function bO(r,e){if(r.length>e)return r.length=e,!0}o(bO,"truncate");function UW(r){return new this(r).abs()}o(UW,"abs");function jW(r){return new this(r).acos()}o(jW,"acos");function MW(r){return new this(r).acosh()}o(MW,"acosh");function FW(r,e){return new this(r).plus(e)}o(FW,"add");function qW(r){return new this(r).asin()}o(qW,"asin");function HW(r){return new this(r).asinh()}o(HW,"asinh");function KW(r){return new this(r).atan()}o(KW,"atan");function $W(r){return new this(r).atanh()}o($W,"atanh");function GW(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=Na(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?Na(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=Na(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(Tr(r,e,i,1)),e=Na(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(Tr(r,e,i,1)),t}o(GW,"atan2");function XW(r){return new this(r).cbrt()}o(XW,"cbrt");function WW(r){return gt(r=new this(r),r.e+1,2)}o(WW,"ceil");function zW(r,e,t){return new this(r).clamp(e,t)}o(zW,"clamp");function JW(r){if(!r||typeof r!="object")throw Error(ow+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,_u,"rounding",0,8,"toExpNeg",-ep,0,"toExpPos",0,ep,"maxE",0,ep,"minE",-ep,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=O2[t]),(n=r[t])!==void 0)if(ns(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(Iu+t+": "+n);if(t="crypto",s&&(this[t]=O2[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(NO);else this[t]=!1;else throw Error(Iu+t+": "+n);return this}o(JW,"config");function YW(r){return new this(r).cos()}o(YW,"cos");function QW(r){return new this(r).cosh()}o(QW,"cosh");function OO(r){var e,t,n;function s(i){var a,u,c,f=this;if(!(f instanceof s))return new s(i);if(f.constructor=s,EO(i)){f.s=i.s,_t?!i.d||i.e>s.maxE?(f.e=NaN,f.d=null):i.e<s.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(c=typeof i,c==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;_t?a>s.maxE?(f.e=NaN,f.d=null):a<s.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[i]):(f.e=a,f.d=[i]);return}if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return nw(f,i.toString())}if(c==="string")return(u=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(u===43&&(i=i.slice(1)),f.s=1),IO.test(i)?nw(f,i):LW(f,i);if(c==="bigint")return i<0?(i=-i,f.s=-1):f.s=1,nw(f,i.toString());throw Error(Iu+i)}if(o(s,"Decimal"),s.prototype=Pe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=JW,s.clone=OO,s.isDecimal=EO,s.abs=UW,s.acos=jW,s.acosh=MW,s.add=FW,s.asin=qW,s.asinh=HW,s.atan=KW,s.atanh=$W,s.atan2=GW,s.cbrt=XW,s.ceil=WW,s.clamp=zW,s.cos=YW,s.cosh=QW,s.div=ZW,s.exp=ez,s.floor=tz,s.hypot=rz,s.ln=nz,s.log=sz,s.log10=az,s.log2=iz,s.max=oz,s.min=uz,s.mod=cz,s.mul=lz,s.pow=fz,s.random=hz,s.round=pz,s.sign=dz,s.sin=mz,s.sinh=gz,s.sqrt=vz,s.sub=yz,s.sum=xz,s.tan=wz,s.tanh=Sz,s.trunc=bz,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}o(OO,"clone");function ZW(r,e){return new this(r).div(e)}o(ZW,"div");function ez(r){return new this(r).exp()}o(ez,"exp");function tz(r){return gt(r=new this(r),r.e+1,3)}o(tz,"floor");function rz(){var r,e,t=new this(0);for(_t=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return _t=!0,new this(1/0);t=e}return _t=!0,t.sqrt()}o(rz,"hypot");function EO(r){return r instanceof rp||r&&r.toStringTag===TO||!1}o(EO,"isDecimalInstance");function nz(r){return new this(r).ln()}o(nz,"ln");function sz(r,e){return new this(r).log(e)}o(sz,"log");function iz(r){return new this(r).log(2)}o(iz,"log2");function az(r){return new this(r).log(10)}o(az,"log10");function oz(){return DO(this,arguments,-1)}o(oz,"max");function uz(){return DO(this,arguments,1)}o(uz,"min");function cz(r,e){return new this(r).mod(e)}o(cz,"mod");function lz(r,e){return new this(r).mul(e)}o(lz,"mul");function fz(r,e){return new this(r).pow(e)}o(fz,"pow");function hz(r){var e,t,n,s,i=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Is(r,1,_u),n=Math.ceil(r/bt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(s%1e7),i+=4);i=n/4}else throw Error(NO);else for(;i<n;)u[i++]=Math.random()*1e7|0;for(n=u[--i],r%=bt,n&&r&&(s=Sn(10,bt-r),u[i]=(n/s|0)*s);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=bt)u.shift();for(n=1,s=u[0];s>=10;s/=10)n++;n<bt&&(t-=bt-n)}return a.e=t,a.d=u,a}o(hz,"random");function pz(r){return gt(r=new this(r),r.e+1,this.rounding)}o(pz,"round");function dz(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(dz,"sign");function mz(r){return new this(r).sin()}o(mz,"sin");function gz(r){return new this(r).sinh()}o(gz,"sinh");function vz(r){return new this(r).sqrt()}o(vz,"sqrt");function yz(r,e){return new this(r).sub(e)}o(yz,"sub");function xz(){var r=0,e=arguments,t=new this(e[r]);for(_t=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return _t=!0,gt(t,this.precision,this.rounding)}o(xz,"sum");function wz(r){return new this(r).tan()}o(wz,"tan");function Sz(r){return new this(r).tanh()}o(Sz,"tanh");function bz(r){return gt(r=new this(r),r.e+1,1)}o(bz,"trunc");Pe[Symbol.for("nodejs.util.inspect.custom")]=Pe.toString;Pe[Symbol.toStringTag]="Decimal";var rp=Pe.constructor=OO(O2);sw=new rp(sw);iw=new rp(iw);var np=class r extends rp{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var kO=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var Ez=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),Bu=o(r=>typeof r=="string"?ti(new pn(r)):r instanceof Error?ti(new pn(r.message,{cause:r.cause})):Ez(r)?ti(new pn(r.message)):ti(new pn("unexpected error")),"leftFromError");var lw=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var Vh=Zx(Yk(),1);import pq from"fs";import The from"path";import N0 from"crypto";import"reflect-metadata";var yU=Zx(mU(),1);import{constants as vue}from"crypto";import{Agent as gU}from"https";var vU=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:vue.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new gU({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return new gU({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,yU.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{httpsAgent:t});return ri(c)}catch(t){return Bu(t)}}};import{arch as Sue,platform as bue}from"os";import{join as Kg,dirname as r_,resolve as Eue}from"path";import{existsSync as ib}from"fs";import{resolve as wU}from"path";import{createRequire as xU}from"module";import{fileURLToPath as yue,pathToFileURL as xue}from"url";var wue=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Jp,SU=o(()=>{if(Jp!==void 0)return Jp;if(wue){Jp=void 0;return}try{Jp=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Jp=void 0}return Jp},"getImportMetaUrl"),bU=o(()=>{if(typeof Xe<"u")return Xe;let r=SU();if(r)return xU(r);let e=xue(wU(process.cwd(),"package.json")).href;return xU(e)},"getRequireFn"),EU=o(()=>{if(typeof __filename<"u")return __filename;let r=SU();return r?yue(r):wU(process.cwd())},"getCurrentFile");var $g=o(r=>bU()(r),"exportRequireModule"),AU=o(r=>{if(r=`${r}-${bue()}-${Sue()}.node`,process.env.NFETS_ADDONS_DIR)return $g(Kg(process.env.NFETS_ADDONS_DIR,r));let e=EU(),t=Eue(e,"../../../../"),n=Kg(t,"build","addons",r);if(ib(n))return $g(n);let s=e;for(let i=0;i<5;i++){let a=Kg(s,"build","addons",r);if(ib(a))return $g(a);let u=r_(s);if(u===s)break;s=u}s=e;for(let i=0;i<5;i++){let a=Kg(s,"build","Release",r);if(ib(a))return $g(a);let u=r_(s);if(u===s)break;s=u}s=e;for(let i=0;i<5;i++){let a=Kg(s,"node_modules","nfets","build","addons",r);if(ib(a))return $g(a);let u=r_(s);if(u===s)break;s=u}throw new Error(`Addon ${r} not found`)},"addon");var Aue=AU("xml_validator"),CU=Aue;var whe=Zx(Xj(),1);import xhe from"crypto";var Wj="application/xml";var Ut;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ut||(Ut={}));function Cue(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(Cue,"SelectNodesEx");function Nue(r,e){let t=Yp("xpath").select;return t(e,r)}o(Nue,"SelectNodesNode");var zj=typeof self<"u"?Cue:Nue;function Li(r){r=r.replace(/\r\n/g,`
89
+ `,E.offset=(F=b.offset)!=null?F:0,E.dontPrettyTextNodes=(R=(q=b.dontPrettyTextNodes)!=null?q:b.dontprettytextnodes)!=null?R:0,E.spaceBeforeSlash=(H=(K=b.spaceBeforeSlash)!=null?K:b.spacebeforeslash)!=null?H:"",E.spaceBeforeSlash===!0&&(E.spaceBeforeSlash=" "),E.suppressPrettyCount=0,E.user={},E.state=e.None,E},T.prototype.indent=function(b,E,C){var _;return!E.pretty||E.suppressPrettyCount?"":E.pretty&&(_=(C||0)+E.offset+1,_>0)?new Array(_).join(E.indent):""},T.prototype.endline=function(b,E,C){return!E.pretty||E.suppressPrettyCount?"":E.newline},T.prototype.attribute=function(b,E,C){var _;return this.openAttribute(b,E,C),_=" "+b.name+'="'+b.value+'"',this.closeAttribute(b,E,C),_},T.prototype.cdata=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<![CDATA[",E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+="]]>"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.comment=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!-- ",E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+=" -->"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.declaration=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<?xml",E.state=e.InsideTag,_+=' version="'+b.version+'"',b.encoding!=null&&(_+=' encoding="'+b.encoding+'"'),b.standalone!=null&&(_+=' standalone="'+b.standalone+'"'),E.state=e.CloseTag,_+=E.spaceBeforeSlash+"?>",_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.docType=function(b,E,C){var _,F,R,q,H;if(C||(C=0),this.openNode(b,E,C),E.state=e.OpenTag,q=this.indent(b,E,C),q+="<!DOCTYPE "+b.root().name,b.pubID&&b.sysID?q+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(q+=' SYSTEM "'+b.sysID+'"'),b.children.length>0){for(q+=" [",q+=this.endline(b,E,C),E.state=e.InsideTag,H=b.children,F=0,R=H.length;F<R;F++)_=H[F],q+=this.writeChildNode(_,E,C+1);E.state=e.CloseTag,q+="]"}return E.state=e.CloseTag,q+=E.spaceBeforeSlash+">",q+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),q},T.prototype.element=function(b,E,C){var _,F,R,q,H,K,X,pe,le,ue,ee,he,we,Ke;C||(C=0),ue=!1,ee="",this.openNode(b,E,C),E.state=e.OpenTag,ee+=this.indent(b,E,C)+"<"+b.name,he=b.attribs;for(le in he)A.call(he,le)&&(_=he[le],ee+=this.attribute(_,E,C));if(R=b.children.length,q=R===0?null:b.children[0],R===0||b.children.every(function(Ae){return(Ae.type===r.Text||Ae.type===r.Raw)&&Ae.value===""}))E.allowEmpty?(ee+=">",E.state=e.CloseTag,ee+="</"+b.name+">"+this.endline(b,E,C)):(E.state=e.CloseTag,ee+=E.spaceBeforeSlash+"/>"+this.endline(b,E,C));else if(E.pretty&&R===1&&(q.type===r.Text||q.type===r.Raw)&&q.value!=null)ee+=">",E.state=e.InsideTag,E.suppressPrettyCount++,ue=!0,ee+=this.writeChildNode(q,E,C+1),E.suppressPrettyCount--,ue=!1,E.state=e.CloseTag,ee+="</"+b.name+">"+this.endline(b,E,C);else{if(E.dontPrettyTextNodes){for(we=b.children,H=0,X=we.length;H<X;H++)if(F=we[H],(F.type===r.Text||F.type===r.Raw)&&F.value!=null){E.suppressPrettyCount++,ue=!0;break}}for(ee+=">"+this.endline(b,E,C),E.state=e.InsideTag,Ke=b.children,K=0,pe=Ke.length;K<pe;K++)F=Ke[K],ee+=this.writeChildNode(F,E,C+1);E.state=e.CloseTag,ee+=this.indent(b,E,C)+"</"+b.name+">",ue&&E.suppressPrettyCount--,ee+=this.endline(b,E,C),E.state=e.None}return this.closeNode(b,E,C),ee},T.prototype.writeChildNode=function(b,E,C){switch(b.type){case r.CData:return this.cdata(b,E,C);case r.Comment:return this.comment(b,E,C);case r.Element:return this.element(b,E,C);case r.Raw:return this.raw(b,E,C);case r.Text:return this.text(b,E,C);case r.ProcessingInstruction:return this.processingInstruction(b,E,C);case r.Dummy:return"";case r.Declaration:return this.declaration(b,E,C);case r.DocType:return this.docType(b,E,C);case r.AttributeDeclaration:return this.dtdAttList(b,E,C);case r.ElementDeclaration:return this.dtdElement(b,E,C);case r.EntityDeclaration:return this.dtdEntity(b,E,C);case r.NotationDeclaration:return this.dtdNotation(b,E,C);default:throw new Error("Unknown XML node type: "+b.constructor.name)}},T.prototype.processingInstruction=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<?",E.state=e.InsideTag,_+=b.target,b.value&&(_+=" "+b.value),E.state=e.CloseTag,_+=E.spaceBeforeSlash+"?>",_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.raw=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C),E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.text=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C),E.state=e.InsideTag,_+=b.value,E.state=e.CloseTag,_+=this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdAttList=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!ATTLIST",E.state=e.InsideTag,_+=" "+b.elementName+" "+b.attributeName+" "+b.attributeType,b.defaultValueType!=="#DEFAULT"&&(_+=" "+b.defaultValueType),b.defaultValue&&(_+=' "'+b.defaultValue+'"'),E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdElement=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!ELEMENT",E.state=e.InsideTag,_+=" "+b.name+" "+b.value,E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdEntity=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!ENTITY",E.state=e.InsideTag,b.pe&&(_+=" %"),_+=" "+b.name,b.value?_+=' "'+b.value+'"':(b.pubID&&b.sysID?_+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.sysID&&(_+=' SYSTEM "'+b.sysID+'"'),b.nData&&(_+=" NDATA "+b.nData)),E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.dtdNotation=function(b,E,C){var _;return this.openNode(b,E,C),E.state=e.OpenTag,_=this.indent(b,E,C)+"<!NOTATION",E.state=e.InsideTag,_+=" "+b.name,b.pubID&&b.sysID?_+=' PUBLIC "'+b.pubID+'" "'+b.sysID+'"':b.pubID?_+=' PUBLIC "'+b.pubID+'"':b.sysID&&(_+=' SYSTEM "'+b.sysID+'"'),E.state=e.CloseTag,_+=E.spaceBeforeSlash+">"+this.endline(b,E,C),E.state=e.None,this.closeNode(b,E,C),_},T.prototype.openNode=function(b,E,C){},T.prototype.closeNode=function(b,E,C){},T.prototype.openAttribute=function(b,E,C){},T.prototype.closeAttribute=function(b,E,C){},T})()}).call(Bj)});var wb=Z((Rj,Pj)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=u_(),Pj.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a)}return o(i,"XMLStringWriter"),i.prototype.document=function(a,u){var c,f,h,m,g;for(u=this.filterOptions(u),m="",g=a.children,f=0,h=g.length;f<h;f++)c=g[f],m+=this.writeChildNode(c,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},i})(e)}).call(Rj)});var c_=Z((Oj,kj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c=o(function(h,m){for(var g in m)f.call(m,g)&&(h[g]=m[g]);function x(){this.constructor=h}return o(x,"ctor"),x.prototype=m.prototype,h.prototype=new x,h.__super__=m.prototype,h},"extend"),f={}.hasOwnProperty;u=Ya().isPlainObject,t=s_(),e=VU(),s=ai(),r=cn(),a=o_(),i=wb(),kj.exports=n=(function(h){c(m,h);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new i),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,x,v,w;for(w=this.children,x=0,v=w.length;x<v;x++)if(g=w[x],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var x;return x={},g?u(g)&&(x=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(x))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,x,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(s)}).call(Oj)});var Uj=Z((Lj,Vj)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f,h,m,g,x,v,w,S,A,T,b,E,C,_,F,R={}.hasOwnProperty;F=Ya(),C=F.isObject,E=F.isFunction,_=F.isPlainObject,b=F.getValue,r=cn(),m=c_(),x=ub(),n=cb(),s=lb(),w=vb(),T=yb(),v=xb(),f=fb(),h=gb(),i=hb(),u=pb(),a=db(),c=mb(),t=i_(),A=o_(),S=wb(),e=Xg(),Vj.exports=g=(function(){function q(H,K,X){var pe;this.name="?xml",this.type=r.Document,H||(H={}),pe={},H.writer?_(H.writer)&&(pe=H.writer,H.writer=new S):H.writer=new S,this.options=H,this.writer=H.writer,this.writerOptions=this.writer.filterOptions(pe),this.stringify=new A(H),this.onDataCallback=K||function(){},this.onEndCallback=X||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(q,"XMLDocumentCB"),q.prototype.createChildNode=function(H){var K,X,pe,le,ue,ee,he,we;switch(H.type){case r.CData:this.cdata(H.value);break;case r.Comment:this.comment(H.value);break;case r.Element:pe={},he=H.attribs;for(X in he)R.call(he,X)&&(K=he[X],pe[X]=K.value);this.node(H.name,pe);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(H.value);break;case r.Text:this.text(H.value);break;case r.ProcessingInstruction:this.instruction(H.target,H.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+H.constructor.name)}for(we=H.children,ue=0,ee=we.length;ue<ee;ue++)le=we[ue],this.createChildNode(le),le.type===r.Element&&this.up();return this},q.prototype.dummy=function(){return this},q.prototype.node=function(H,K,X){var pe;if(H==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(H));return this.openCurrent(),H=b(H),K==null&&(K={}),K=b(K),C(K)||(pe=[K,X],X=pe[0],K=pe[1]),this.currentNode=new x(this,H,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,X!=null&&this.text(X),this},q.prototype.element=function(H,K,X){var pe,le,ue,ee,he,we;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(H)||C(H)||E(H))for(ee=this.options.noValidation,this.options.noValidation=!0,we=new m(this.options).element("TEMP_ROOT"),we.element(H),this.options.noValidation=ee,he=we.children,le=0,ue=he.length;le<ue;le++)pe=he[le],this.createChildNode(pe),pe.type===r.Element&&this.up();else this.node(H,K,X);return this},q.prototype.attribute=function(H,K){var X,pe;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(H));if(H!=null&&(H=b(H)),C(H))for(X in H)R.call(H,X)&&(pe=H[X],this.attribute(X,pe));else E(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[H]=new t(this,H,""):K!=null&&(this.currentNode.attribs[H]=new t(this,H,K));return this},q.prototype.text=function(H){var K;return this.openCurrent(),K=new T(this,H),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.cdata=function(H){var K;return this.openCurrent(),K=new n(this,H),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.comment=function(H){var K;return this.openCurrent(),K=new s(this,H),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.raw=function(H){var K;return this.openCurrent(),K=new w(this,H),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.instruction=function(H,K){var X,pe,le,ue,ee;if(this.openCurrent(),H!=null&&(H=b(H)),K!=null&&(K=b(K)),Array.isArray(H))for(X=0,ue=H.length;X<ue;X++)pe=H[X],this.instruction(pe);else if(C(H))for(pe in H)R.call(H,pe)&&(le=H[pe],this.instruction(pe,le));else E(K)&&(K=K.apply()),ee=new v(this,H,K),this.onData(this.writer.processingInstruction(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},q.prototype.declaration=function(H,K,X){var pe;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return pe=new f(this,H,K,X),this.onData(this.writer.declaration(pe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.doctype=function(H,K,X){if(this.openCurrent(),H==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new h(this,K,X),this.currentNode.rootNodeName=H,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},q.prototype.dtdElement=function(H,K){var X;return this.openCurrent(),X=new a(this,H,K),this.onData(this.writer.dtdElement(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.attList=function(H,K,X,pe,le){var ue;return this.openCurrent(),ue=new i(this,H,K,X,pe,le),this.onData(this.writer.dtdAttList(ue,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.entity=function(H,K){var X;return this.openCurrent(),X=new u(this,!1,H,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.pEntity=function(H,K){var X;return this.openCurrent(),X=new u(this,!0,H,K),this.onData(this.writer.dtdEntity(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.notation=function(H,K){var X;return this.openCurrent(),X=new c(this,H,K),this.onData(this.writer.dtdNotation(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},q.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},q.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},q.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},q.prototype.openNode=function(H){var K,X,pe,le;if(!H.isOpen){if(!this.root&&this.currentLevel===0&&H.type===r.Element&&(this.root=H),X="",H.type===r.Element){this.writerOptions.state=e.OpenTag,X=this.writer.indent(H,this.writerOptions,this.currentLevel)+"<"+H.name,le=H.attribs;for(pe in le)R.call(le,pe)&&(K=le[pe],X+=this.writer.attribute(K,this.writerOptions,this.currentLevel));X+=(H.children?">":"/>")+this.writer.endline(H,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,X=this.writer.indent(H,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+H.rootNodeName,H.pubID&&H.sysID?X+=' PUBLIC "'+H.pubID+'" "'+H.sysID+'"':H.sysID&&(X+=' SYSTEM "'+H.sysID+'"'),H.children?(X+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,X+=">"),X+=this.writer.endline(H,this.writerOptions,this.currentLevel);return this.onData(X,this.currentLevel),H.isOpen=!0}},q.prototype.closeNode=function(H){var K;if(!H.isClosed)return K="",this.writerOptions.state=e.CloseTag,H.type===r.Element?K=this.writer.indent(H,this.writerOptions,this.currentLevel)+"</"+H.name+">"+this.writer.endline(H,this.writerOptions,this.currentLevel):K=this.writer.indent(H,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(H,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),H.isClosed=!0},q.prototype.onData=function(H,K){return this.documentStarted=!0,this.onDataCallback(H,K+1)},q.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},q.prototype.debugInfo=function(H){return H==null?"":"node: <"+H+">"},q.prototype.ele=function(){return this.element.apply(this,arguments)},q.prototype.nod=function(H,K,X){return this.node(H,K,X)},q.prototype.txt=function(H){return this.text(H)},q.prototype.dat=function(H){return this.cdata(H)},q.prototype.com=function(H){return this.comment(H)},q.prototype.ins=function(H,K){return this.instruction(H,K)},q.prototype.dec=function(H,K,X){return this.declaration(H,K,X)},q.prototype.dtd=function(H,K,X){return this.doctype(H,K,X)},q.prototype.e=function(H,K,X){return this.element(H,K,X)},q.prototype.n=function(H,K,X){return this.node(H,K,X)},q.prototype.t=function(H){return this.text(H)},q.prototype.d=function(H){return this.cdata(H)},q.prototype.c=function(H){return this.comment(H)},q.prototype.r=function(H){return this.raw(H)},q.prototype.i=function(H,K){return this.instruction(H,K)},q.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},q.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},q.prototype.ent=function(H,K){return this.entity(H,K)},q.prototype.pent=function(H,K){return this.pEntity(H,K)},q.prototype.not=function(H,K){return this.notation(H,K)},q})()}).call(Lj)});var Fj=Z((jj,Mj)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var c in u)i.call(u,c)&&(a[c]=u[c]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;r=cn(),n=u_(),e=Xg(),Mj.exports=t=(function(a){s(u,a);function u(c,f){this.stream=c,u.__super__.constructor.call(this,f)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(c,f,h){return c.isLastRootNode&&f.state===e.CloseTag?"":u.__super__.endline.call(this,c,f,h)},u.prototype.document=function(c,f){var h,m,g,x,v,w,S,A,T;for(S=c.children,m=g=0,v=S.length;g<v;m=++g)h=S[m],h.isLastRootNode=m===c.children.length-1;for(f=this.filterOptions(f),A=c.children,T=[],x=0,w=A.length;x<w;x++)h=A[x],T.push(this.writeChildNode(h,f,0));return T},u.prototype.attribute=function(c,f,h){return this.stream.write(u.__super__.attribute.call(this,c,f,h))},u.prototype.cdata=function(c,f,h){return this.stream.write(u.__super__.cdata.call(this,c,f,h))},u.prototype.comment=function(c,f,h){return this.stream.write(u.__super__.comment.call(this,c,f,h))},u.prototype.declaration=function(c,f,h){return this.stream.write(u.__super__.declaration.call(this,c,f,h))},u.prototype.docType=function(c,f,h){var m,g,x,v;if(h||(h=0),this.openNode(c,f,h),f.state=e.OpenTag,this.stream.write(this.indent(c,f,h)),this.stream.write("<!DOCTYPE "+c.root().name),c.pubID&&c.sysID?this.stream.write(' PUBLIC "'+c.pubID+'" "'+c.sysID+'"'):c.sysID&&this.stream.write(' SYSTEM "'+c.sysID+'"'),c.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(c,f,h)),f.state=e.InsideTag,v=c.children,g=0,x=v.length;g<x;g++)m=v[g],this.writeChildNode(m,f,h+1);f.state=e.CloseTag,this.stream.write("]")}return f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+">"),this.stream.write(this.endline(c,f,h)),f.state=e.None,this.closeNode(c,f,h)},u.prototype.element=function(c,f,h){var m,g,x,v,w,S,A,T,b,E;h||(h=0),this.openNode(c,f,h),f.state=e.OpenTag,this.stream.write(this.indent(c,f,h)+"<"+c.name),b=c.attribs;for(A in b)i.call(b,A)&&(m=b[A],this.attribute(m,f,h));if(x=c.children.length,v=x===0?null:c.children[0],x===0||c.children.every(function(C){return(C.type===r.Text||C.type===r.Raw)&&C.value===""}))f.allowEmpty?(this.stream.write(">"),f.state=e.CloseTag,this.stream.write("</"+c.name+">")):(f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>"));else if(f.pretty&&x===1&&(v.type===r.Text||v.type===r.Raw)&&v.value!=null)this.stream.write(">"),f.state=e.InsideTag,f.suppressPrettyCount++,T=!0,this.writeChildNode(v,f,h+1),f.suppressPrettyCount--,T=!1,f.state=e.CloseTag,this.stream.write("</"+c.name+">");else{for(this.stream.write(">"+this.endline(c,f,h)),f.state=e.InsideTag,E=c.children,w=0,S=E.length;w<S;w++)g=E[w],this.writeChildNode(g,f,h+1);f.state=e.CloseTag,this.stream.write(this.indent(c,f,h)+"</"+c.name+">")}return this.stream.write(this.endline(c,f,h)),f.state=e.None,this.closeNode(c,f,h)},u.prototype.processingInstruction=function(c,f,h){return this.stream.write(u.__super__.processingInstruction.call(this,c,f,h))},u.prototype.raw=function(c,f,h){return this.stream.write(u.__super__.raw.call(this,c,f,h))},u.prototype.text=function(c,f,h){return this.stream.write(u.__super__.text.call(this,c,f,h))},u.prototype.dtdAttList=function(c,f,h){return this.stream.write(u.__super__.dtdAttList.call(this,c,f,h))},u.prototype.dtdElement=function(c,f,h){return this.stream.write(u.__super__.dtdElement.call(this,c,f,h))},u.prototype.dtdEntity=function(c,f,h){return this.stream.write(u.__super__.dtdEntity.call(this,c,f,h))},u.prototype.dtdNotation=function(c,f,h){return this.stream.write(u.__super__.dtdNotation.call(this,c,f,h))},u})(n)}).call(jj)});var Hj=Z((qj,cc)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,c,f;f=Ya(),u=f.assign,c=f.isFunction,t=s_(),n=c_(),s=Uj(),a=wb(),i=Fj(),r=cn(),e=Xg(),cc.exports.create=function(h,m,g,x){var v,w;if(h==null)throw new Error("Root element needs a name.");return x=u({},m,g,x),v=new n(x),w=v.element(h),x.headless||(v.declaration(x),(x.pubID!=null||x.sysID!=null)&&v.dtd(x)),w},cc.exports.begin=function(h,m,g){var x;return c(h)&&(x=[h,m],m=x[0],g=x[1],h={}),m?new s(h,m,g):new n(h)},cc.exports.stringWriter=function(h){return new a(h)},cc.exports.streamWriter=function(h,m){return new i(h,m)},cc.exports.implementation=new t,cc.exports.nodeType=r,cc.exports.writerState=e}).call(qj)});var Kj=Z(l_=>{"use strict";(function(){"use strict";var r,e,t,n,s,i={}.hasOwnProperty;r=Hj(),e=ab().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),s=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),l_.Builder=(function(){function a(u){var c,f,h;this.options={},f=e["0.2"];for(c in f)i.call(f,c)&&(h=f[c],this.options[c]=h);for(c in u)i.call(u,c)&&(h=u[c],this.options[c]=h)}return o(a,"Builder"),a.prototype.buildObject=function(u){var c,f,h,m,g;return c=this.options.attrkey,f=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,h=(function(x){return function(v,w){var S,A,T,b,E,C;if(typeof w!="object")x.options.cdata&&n(w)?v.raw(s(w)):v.txt(w);else if(Array.isArray(w)){for(b in w)if(i.call(w,b)){A=w[b];for(E in A)T=A[E],v=h(v.ele(E),T).up()}}else for(E in w)if(i.call(w,E))if(A=w[E],E===c){if(typeof A=="object")for(S in A)C=A[S],v=v.att(S,C)}else if(E===f)x.options.cdata&&n(A)?v=v.raw(s(A)):v=v.txt(A);else if(Array.isArray(A))for(b in A)i.call(A,b)&&(T=A[b],typeof T=="string"?x.options.cdata&&n(T)?v=v.ele(E).raw(s(T)).up():v=v.ele(E,T).up():v=h(v.ele(E),T).up());else typeof A=="object"?v=h(v.ele(E),A).up():typeof A=="string"&&x.options.cdata&&n(A)?v=v.ele(E).raw(s(A)).up():(A==null&&(A=""),v=v.ele(E,A.toString()).up());return v}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),h(m,u).end(this.options.renderOpts)},a})()}).call(l_)});var $j=Z(f_=>{"use strict";(function(){"use strict";f_.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(f_)});var h_=Z(zl=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),zl.normalize=function(e){return e.toLowerCase()},zl.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},zl.stripPrefix=function(e){return e.replace(r,"")},zl.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},zl.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(zl)});var Gj=Z(Lo=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,u,c,f=o(function(g,x){return function(){return g.apply(x,arguments)}},"bind"),h=o(function(g,x){for(var v in x)m.call(x,v)&&(g[v]=x[v]);function w(){this.constructor=g}return o(w,"ctor"),w.prototype=x.prototype,g.prototype=new w,g.__super__=x.prototype,g},"extend"),m={}.hasOwnProperty;u=jI(),n=Xe("events"),r=$j(),a=h_(),c=Xe("timers").setImmediate,e=ab().defaults,s=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),i=o(function(g,x,v){var w,S,A;for(w=0,S=g.length;w<S;w++)A=g[w],x=A(x,v);return x},"processItem"),t=o(function(g,x,v){var w;return w=Object.create(null),w.value=v,w.writable=!0,w.enumerable=!0,w.configurable=!0,Object.defineProperty(g,x,w)},"defineProperty"),Lo.Parser=(function(g){h(x,g);function x(v){this.parseStringPromise=f(this.parseStringPromise,this),this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this);var w,S,A;if(!(this instanceof Lo.Parser))return new Lo.Parser(v);this.options={},S=e["0.2"];for(w in S)m.call(S,w)&&(A=S[w],this.options[w]=A);for(w in v)m.call(v,w)&&(A=v[w],this.options[w]=A);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return o(x,"Parser"),x.prototype.processAsync=function(){var v,w;try{return this.remaining.length<=this.options.chunkSize?(v=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(v),this.saxParser.close()):(v=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(v),c(this.processAsync))}catch(S){if(w=S,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(w)}},x.prototype.assignOrPush=function(v,w,S){return w in v?(v[w]instanceof Array||t(v,w,[v[w]]),v[w].push(S)):this.options.explicitArray?t(v,w,[S]):t(v,w,S)},x.prototype.reset=function(){var v,w,S,A;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(T){return function(b){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",b)}})(this),this.saxParser.onend=(function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,A=[],v=this.options.attrkey,w=this.options.charkey,this.saxParser.onopentag=(function(T){return function(b){var E,C,_,F,R;if(_={},_[w]="",!T.options.ignoreAttrs){R=b.attributes;for(E in R)m.call(R,E)&&(!(v in _)&&!T.options.mergeAttrs&&(_[v]={}),C=T.options.attrValueProcessors?i(T.options.attrValueProcessors,b.attributes[E],E):b.attributes[E],F=T.options.attrNameProcessors?i(T.options.attrNameProcessors,E):E,T.options.mergeAttrs?T.assignOrPush(_,F,C):t(_[v],F,C))}return _["#name"]=T.options.tagNameProcessors?i(T.options.tagNameProcessors,b.name):b.name,T.options.xmlns&&(_[T.options.xmlnskey]={uri:b.uri,local:b.local}),A.push(_)}})(this),this.saxParser.onclosetag=(function(T){return function(){var b,E,C,_,F,R,q,H,K,X;if(R=A.pop(),F=R["#name"],(!T.options.explicitChildren||!T.options.preserveChildrenOrder)&&delete R["#name"],R.cdata===!0&&(b=R.cdata,delete R.cdata),K=A[A.length-1],R[w].match(/^\s*$/)&&!b?(E=R[w],delete R[w]):(T.options.trim&&(R[w]=R[w].trim()),T.options.normalize&&(R[w]=R[w].replace(/\s{2,}/g," ").trim()),R[w]=T.options.valueProcessors?i(T.options.valueProcessors,R[w],F):R[w],Object.keys(R).length===1&&w in R&&!T.EXPLICIT_CHARKEY&&(R=R[w])),s(R)&&(typeof T.options.emptyTag=="function"?R=T.options.emptyTag():R=T.options.emptyTag!==""?T.options.emptyTag:E),T.options.validator!=null&&(X="/"+(function(){var pe,le,ue;for(ue=[],pe=0,le=A.length;pe<le;pe++)_=A[pe],ue.push(_["#name"]);return ue})().concat(F).join("/"),(function(){var pe;try{return R=T.options.validator(X,K&&K[F],R)}catch(le){return pe=le,T.emit("error",pe)}})()),T.options.explicitChildren&&!T.options.mergeAttrs&&typeof R=="object"){if(!T.options.preserveChildrenOrder)_={},T.options.attrkey in R&&(_[T.options.attrkey]=R[T.options.attrkey],delete R[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in R&&(_[T.options.charkey]=R[T.options.charkey],delete R[T.options.charkey]),Object.getOwnPropertyNames(R).length>0&&(_[T.options.childkey]=R),R=_;else if(K){K[T.options.childkey]=K[T.options.childkey]||[],q={};for(C in R)m.call(R,C)&&t(q,C,R[C]);K[T.options.childkey].push(q),delete R["#name"],Object.keys(R).length===1&&w in R&&!T.EXPLICIT_CHARKEY&&(R=R[w])}}return A.length>0?T.assignOrPush(K,F,R):(T.options.explicitRoot&&(H=R,R={},t(R,F,H)),T.resultObject=R,T.saxParser.ended=!0,T.emit("end",T.resultObject))}})(this),S=(function(T){return function(b){var E,C;if(C=A[A.length-1],C)return C[w]+=b,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||b.replace(/\\n/g,"").trim()!=="")&&(C[T.options.childkey]=C[T.options.childkey]||[],E={"#name":"__text__"},E[w]=b,T.options.normalize&&(E[w]=E[w].replace(/\s{2,}/g," ").trim()),C[T.options.childkey].push(E)),C}})(this),this.saxParser.ontext=S,this.saxParser.oncdata=(function(T){return function(b){var E;if(E=S(b),E)return E.cdata=!0}})(this)},x.prototype.parseString=function(v,w){var S;w!=null&&typeof w=="function"&&(this.on("end",function(A){return this.reset(),w(null,A)}),this.on("error",function(A){return this.reset(),w(A)}));try{return v=v.toString(),v.trim()===""?(this.emit("end",null),!0):(v=r.stripBOM(v),this.options.async?(this.remaining=v,c(this.processAsync),this.saxParser):this.saxParser.write(v).close())}catch(A){if(S=A,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw S}else return this.emit("error",S),this.saxParser.errThrown=!0}},x.prototype.parseStringPromise=function(v){return new Promise((function(w){return function(S,A){return w.parseString(v,function(T,b){return T?A(T):S(b)})}})(this))},x})(n),Lo.parseString=function(g,x,v){var w,S,A;return v!=null?(typeof v=="function"&&(w=v),typeof x=="object"&&(S=x)):(typeof x=="function"&&(w=x),S={}),A=new Lo.Parser(S),A.parseString(g,w)},Lo.parseStringPromise=function(g,x){var v,w;return typeof x=="object"&&(v=x),w=new Lo.Parser(v),w.parseStringPromise(g)}}).call(Lo)});var Xj=Z(Vo=>{"use strict";(function(){"use strict";var r,e,t,n,s=o(function(a,u){for(var c in u)i.call(u,c)&&(a[c]=u[c]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;e=ab(),r=Kj(),t=Gj(),n=h_(),Vo.defaults=e.defaults,Vo.processors=n,Vo.ValidationError=(function(a){s(u,a);function u(c){this.message=c}return o(u,"ValidationError"),u})(Error),Vo.Builder=r.Builder,Vo.Parser=t.Parser,Vo.parseString=t.parseString,Vo.parseStringPromise=t.parseStringPromise}).call(Vo)});var I2="http://www.w3.org/2000/09/xmldsig#",dO="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",_2=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),Cu=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),B2=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var br={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},_he=Object.keys(br);var Dhe={Production:"1",Homolog:"2"};var pn=class extends Error{static{o(this,"NFeTsError")}};var mO=class extends pn{static{o(this,"ValidationError")}};var D2=o(r=>{throw new pn("Didn't expect to get here")},"unreachable");var K0={includeComments:!1,exclusive:!0};var Zh=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Cu.SHA1,s=K0){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:I2},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:dO}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:I2},...e},{rootName:"SignedInfo"}),this.canonical);return await this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case Cu.SHA256:return B2.SHA256;case Cu.SHA1:return B2.SHA1;default:return D2(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Cu.SHA256:return _2.RSA_SHA256;case Cu.SHA1:return _2.RSA_SHA1;default:return D2(this.algorithm)}}};var R2=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},ew=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},ti=o(r=>new R2(r),"left"),ri=o(r=>r===void 0?new ew(void 0):new ew(r),"right");var gO=class extends Zh{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n;if(!e[s])return ti(new pn(`Node ${String(s)} not found`));let c=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),f=this.signedInfo(c,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=e;return m.Signature=this.assemble(f,h.value,u),ri(m)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...u}=s??{};return{$:{xmlns:n,...u},...i}}};var vO=class extends Zh{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n,c=this.toolkit.getNode(e,s);if(!c)return ti(new pn(`Node ${s} not found`));let f=this.signedInfo(c,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=await this.toolkit.build(this.assemble(f,h.value,u),{rootName:"Signature"});return ri(this.toolkit.appendNode(e,m))}};import"reflect-metadata";var $0="__SkipValidation__",ape=o(()=>(r,e)=>{Reflect.defineMetadata($0,!0,r,e.toString())},"SkipValidation"),ope=o(()=>r=>{Reflect.defineMetadata($0,!0,r)},"SkipAllValidations");import{plainToInstance as IW}from"class-transformer";var tw=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&tw(t)},"clearEmptyValues"),yO=o((r,e,t={})=>{let n=IW(e,r);return t.clearEmptyValues&&tw(n),n},"plainToInstance");import"reflect-metadata";import{validateSync as _W}from"class-validator";var xO="__ValidateErrors__",wO=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(wO(n.children,e?`${e}.${n.property}`:n.property));let s=Object.values(n.constraints??{}).map(i=>e?`${e}.${i}`:i).join(", ");return s?t.concat(s):t},[]),"mapConstraintsToErrors"),vpe=o(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata($0,this.constructor);if(Reflect.getMetadata($0,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[c,...f]=i,h=yO(c,r),m=_W(h,{whitelist:!0});if(tw(h),m.length){let g=Reflect.getMetadata(xO,this)??[];Reflect.defineMetadata(xO,g.concat(wO(m,s?.name)),this)}return s?.apply(this,[h,...f])}},"Validates");var ep=9e15,_u=1e9,P2="0123456789abcdef",sw="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",iw="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",O2={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ep,maxE:ep,crypto:!1},AO,Ao,_t=!0,ow="[DecimalError] ",Iu=ow+"Invalid argument: ",CO=ow+"Precision limit exceeded",NO=ow+"crypto unavailable",TO="[object Decimal]",ns=Math.floor,Sn=Math.pow,BW=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,DW=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,RW=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,IO=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Qi=1e7,bt=7,PW=9007199254740991,OW=sw.length-1,k2=iw.length-1,Pe={toStringTag:TO};Pe.absoluteValue=Pe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),gt(r)};Pe.ceil=function(){return gt(new this.constructor(this),this.e+1,2)};Pe.clampedTo=Pe.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(Iu+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Pe.comparedTo=Pe.cmp=function(r){var e,t,n,s,i=this,a=i.d,u=(r=new i.constructor(r)).d,c=i.s,f=r.s;if(!a||!u)return!c||!f?NaN:c!==f?c:a===u?0:!a^c<0?1:-1;if(!a[0]||!u[0])return a[0]?c:u[0]?-f:0;if(c!==f)return c;if(i.e!==r.e)return i.e>r.e^c<0?1:-1;for(n=a.length,s=u.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^c<0?1:-1;return n===s?0:n>s^c<0?1:-1};Pe.cosine=Pe.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+bt,n.rounding=1,t=kW(n,PO(n,t)),n.precision=r,n.rounding=e,gt(Ao==2||Ao==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Pe.cubeRoot=Pe.cbrt=function(){var r,e,t,n,s,i,a,u,c,f,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(_t=!1,i=h.s*Sn(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=Fn(h.d),r=h.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Sn(t,1/3),r=ns((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=h.s):n=new m(i.toString()),a=(r=m.precision)+3;;)if(u=n,c=u.times(u).times(u),f=c.plus(h),n=Tr(f.plus(h).times(u),f.plus(c),a+2,1),Fn(u.d).slice(0,a)===(t=Fn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(gt(u,r+1,0),u.times(u).times(u).eq(h))){n=u;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(gt(n,r+1,1),e=!n.times(n).times(n).eq(h));break}return _t=!0,gt(n,r,m.rounding,e)};Pe.decimalPlaces=Pe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-ns(this.e/bt))*bt,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Pe.dividedBy=Pe.div=function(r){return Tr(this,new this.constructor(r))};Pe.dividedToIntegerBy=Pe.divToInt=function(r){var e=this,t=e.constructor;return gt(Tr(e,new t(r),0,1,1),t.precision,t.rounding)};Pe.equals=Pe.eq=function(r){return this.cmp(r)===0};Pe.floor=function(){return gt(new this.constructor(this),this.e+1,3)};Pe.greaterThan=Pe.gt=function(r){return this.cmp(r)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(r){var e=this.cmp(r);return e==1||e===0};Pe.hyperbolicCosine=Pe.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/cw(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=tp(a,1,i.times(e),new a(1),!0);for(var c,f=r,h=new a(8);f--;)c=i.times(i),i=u.minus(c.times(h.minus(c.times(h))));return gt(i,a.precision=t,a.rounding=n,!0)};Pe.hyperbolicSine=Pe.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=tp(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/cw(5,r)),s=tp(i,2,s,s,!0);for(var a,u=new i(5),c=new i(16),f=new i(20);r--;)a=s.times(s),s=s.times(u.plus(a.times(c.times(a).plus(f))))}return i.precision=e,i.rounding=t,gt(s,e,t,!0)};Pe.hyperbolicTangent=Pe.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,Tr(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Pe.inverseCosine=Pe.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?Na(e,n,s):new e(0):new e(NaN):r.isZero()?Na(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};Pe.inverseHyperbolicCosine=Pe.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,_t=!1,t=t.times(t).minus(1).sqrt().plus(t),_t=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Pe.inverseHyperbolicSine=Pe.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,_t=!1,t=t.times(t).plus(1).sqrt().plus(t),_t=!0,n.precision=r,n.rounding=e,t.ln())};Pe.inverseHyperbolicTangent=Pe.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?gt(new i(s),r,e,!0):(i.precision=t=n-s.e,s=Tr(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};Pe.inverseSine=Pe.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=Na(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};Pe.inverseTangent=Pe.atan=function(){var r,e,t,n,s,i,a,u,c,f=this,h=f.constructor,m=h.precision,g=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&m+4<=k2)return a=Na(h,m+4,g).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(m+4<=k2)return a=Na(h,m+4,g).times(.5),a.s=f.s,a}for(h.precision=u=m+10,h.rounding=1,t=Math.min(28,u/bt+2|0),r=t;r;--r)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(_t=!1,e=Math.ceil(u/bt),n=1,c=f.times(f),a=new h(f),s=f;r!==-1;)if(s=s.times(c),i=a.minus(s.div(n+=2)),s=s.times(c),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),_t=!0,gt(a,h.precision=m,h.rounding=g,!0)};Pe.isFinite=function(){return!!this.d};Pe.isInteger=Pe.isInt=function(){return!!this.d&&ns(this.e/bt)>this.d.length-2};Pe.isNaN=function(){return!this.s};Pe.isNegative=Pe.isNeg=function(){return this.s<0};Pe.isPositive=Pe.isPos=function(){return this.s>0};Pe.isZero=function(){return!!this.d&&this.d[0]===0};Pe.lessThan=Pe.lt=function(r){return this.cmp(r)<0};Pe.lessThanOrEqualTo=Pe.lte=function(r){return this.cmp(r)<1};Pe.logarithm=Pe.log=function(r){var e,t,n,s,i,a,u,c,f=this,h=f.constructor,m=h.precision,g=h.rounding,x=5;if(r==null)r=new h(10),e=!0;else{if(r=new h(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new h(NaN);e=r.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new h(t&&!t[0]?-1/0:f.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(_t=!1,u=m+x,a=Tu(f,u),n=e?aw(h,u+10):Tu(r,u),c=Tr(a,n,u,1),G0(c.d,s=m,g))do if(u+=10,a=Tu(f,u),n=e?aw(h,u+10):Tu(r,u),c=Tr(a,n,u,1),!i){+Fn(c.d).slice(s+1,s+15)+1==1e14&&(c=gt(c,m+1,0));break}while(G0(c.d,s+=10,g));return _t=!0,gt(c,m,g)};Pe.minus=Pe.sub=function(r){var e,t,n,s,i,a,u,c,f,h,m,g,x=this,v=x.constructor;if(r=new v(r),!x.d||!r.d)return!x.s||!r.s?r=new v(NaN):x.d?r.s=-r.s:r=new v(r.d||x.s!==r.s?x:NaN),r;if(x.s!=r.s)return r.s=-r.s,x.plus(r);if(f=x.d,g=r.d,u=v.precision,c=v.rounding,!f[0]||!g[0]){if(g[0])r.s=-r.s;else if(f[0])r=new v(x);else return new v(c===3?-0:0);return _t?gt(r,u,c):r}if(t=ns(r.e/bt),h=ns(x.e/bt),f=f.slice(),i=h-t,i){for(m=i<0,m?(e=f,i=-i,a=g.length):(e=g,t=h,a=f.length),n=Math.max(Math.ceil(u/bt),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=f.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(f[n]!=g[n]){m=f[n]<g[n];break}i=0}for(m&&(e=f,f=g,g=e,r.s=-r.s),a=f.length,n=g.length-a;n>0;--n)f[a++]=0;for(n=g.length;n>i;){if(f[--n]<g[n]){for(s=n;s&&f[--s]===0;)f[s]=Qi-1;--f[s],f[n]+=Qi}f[n]-=g[n]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(r.d=f,r.e=uw(f,t),_t?gt(r,u,c):r):new v(c===3?-0:0)};Pe.modulo=Pe.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?gt(new n(t),n.precision,n.rounding):(_t=!1,n.modulo==9?(e=Tr(t,r.abs(),0,3,1),e.s*=r.s):e=Tr(t,r,0,n.modulo,1),e=e.times(r),_t=!0,t.minus(e))};Pe.naturalExponential=Pe.exp=function(){return L2(this)};Pe.naturalLogarithm=Pe.ln=function(){return Tu(this)};Pe.negated=Pe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,gt(r)};Pe.plus=Pe.add=function(r){var e,t,n,s,i,a,u,c,f,h,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(f=m.d,h=r.d,u=g.precision,c=g.rounding,!f[0]||!h[0])return h[0]||(r=new g(m)),_t?gt(r,u,c):r;if(i=ns(m.e/bt),n=ns(r.e/bt),f=f.slice(),s=i-n,s){for(s<0?(t=f,s=-s,a=h.length):(t=h,n=i,a=f.length),i=Math.ceil(u/bt),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=f.length,s=h.length,a-s<0&&(s=a,t=h,h=f,f=t),e=0;s;)e=(f[--s]=f[s]+h[s]+e)/Qi|0,f[s]%=Qi;for(e&&(f.unshift(e),++n),a=f.length;f[--a]==0;)f.pop();return r.d=f,r.e=uw(f,n),_t?gt(r,u,c):r};Pe.precision=Pe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(Iu+r);return t.d?(e=_O(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Pe.round=function(){var r=this,e=r.constructor;return gt(new e(r),r.e+1,e.rounding)};Pe.sine=Pe.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+bt,n.rounding=1,t=VW(n,PO(n,t)),n.precision=r,n.rounding=e,gt(Ao>2?t.neg():t,r,e,!0)):new n(NaN)};Pe.squareRoot=Pe.sqrt=function(){var r,e,t,n,s,i,a=this,u=a.d,c=a.e,f=a.s,h=a.constructor;if(f!==1||!u||!u[0])return new h(!f||f<0&&(!u||u[0])?NaN:u?a:1/0);for(_t=!1,f=Math.sqrt(+a),f==0||f==1/0?(e=Fn(u),(e.length+c)%2==0&&(e+="0"),f=Math.sqrt(e),c=ns((c+1)/2)-(c<0||c%2),f==1/0?e="5e"+c:(e=f.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new h(e)):n=new h(f.toString()),t=(c=h.precision)+3;;)if(i=n,n=i.plus(Tr(a,i,t+2,1)).times(.5),Fn(i.d).slice(0,t)===(e=Fn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(gt(i,c+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(gt(n,c+1,1),r=!n.times(n).eq(a));break}return _t=!0,gt(n,c,h.rounding,r)};Pe.tangent=Pe.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=Tr(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,gt(Ao==2||Ao==4?t.neg():t,r,e,!0)):new n(NaN)};Pe.times=Pe.mul=function(r){var e,t,n,s,i,a,u,c,f,h=this,m=h.constructor,g=h.d,x=(r=new m(r)).d;if(r.s*=h.s,!g||!g[0]||!x||!x[0])return new m(!r.s||g&&!g[0]&&!x||x&&!x[0]&&!g?NaN:!g||!x?r.s/0:r.s*0);for(t=ns(h.e/bt)+ns(r.e/bt),c=g.length,f=x.length,c<f&&(i=g,g=x,x=i,a=c,c=f,f=a),i=[],a=c+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(e=0,s=c+n;s>n;)u=i[s]+x[n]*g[s-n-1]+e,i[s--]=u%Qi|0,e=u/Qi|0;i[s]=(i[s]+e)%Qi|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=uw(i,t),_t?gt(r,m.precision,m.rounding):r};Pe.toBinary=function(r,e){return V2(this,2,r,e)};Pe.toDecimalPlaces=Pe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Is(r,0,_u),e===void 0?e=n.rounding:Is(e,0,8),gt(t,r+t.e+1,e))};Pe.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Ta(n,!0):(Is(r,0,_u),e===void 0?e=s.rounding:Is(e,0,8),n=gt(new s(n),r+1,e),t=Ta(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=Ta(s):(Is(r,0,_u),e===void 0?e=i.rounding:Is(e,0,8),n=gt(new i(s),r+s.e+1,e),t=Ta(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Pe.toFraction=function(r){var e,t,n,s,i,a,u,c,f,h,m,g,x=this,v=x.d,w=x.constructor;if(!v)return new w(x);if(f=t=new w(1),n=c=new w(0),e=new w(n),i=e.e=_O(v)-x.e-1,a=i%bt,e.d[0]=Sn(10,a<0?bt+a:a),r==null)r=i>0?e:f;else{if(u=new w(r),!u.isInt()||u.lt(f))throw Error(Iu+u);r=u.gt(e)?i>0?e:f:u}for(_t=!1,u=new w(Fn(v)),h=w.precision,w.precision=i=v.length*bt*2;m=Tr(u,e,0,1,1),s=t.plus(m.times(n)),s.cmp(r)!=1;)t=n,n=s,s=f,f=c.plus(m.times(s)),c=s,s=e,e=u.minus(m.times(s)),u=s;return s=Tr(r.minus(t),n,0,1,1),c=c.plus(s.times(f)),t=t.plus(s.times(n)),c.s=f.s=x.s,g=Tr(f,n,i,1).minus(x).abs().cmp(Tr(c,t,i,1).minus(x).abs())<1?[f,n]:[c,t],w.precision=h,_t=!0,g};Pe.toHexadecimal=Pe.toHex=function(r,e){return V2(this,16,r,e)};Pe.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Is(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(_t=!1,t=Tr(t,r,0,e,1).times(r),_t=!0,gt(t)):(r.s=t.s,t=r),t};Pe.toNumber=function(){return+this};Pe.toOctal=function(r,e){return V2(this,8,r,e)};Pe.toPower=Pe.pow=function(r){var e,t,n,s,i,a,u=this,c=u.constructor,f=+(r=new c(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new c(Sn(+u,f));if(u=new c(u),u.eq(1))return u;if(n=c.precision,i=c.rounding,r.eq(1))return gt(u,n,i);if(e=ns(r.e/bt),e>=r.d.length-1&&(t=f<0?-f:f)<=PW)return s=BO(c,u,t,n),r.s<0?new c(1).div(s):gt(s,n,i);if(a=u.s,a<0){if(e<r.d.length-1)return new c(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=Sn(+u,f),e=t==0||!isFinite(t)?ns(f*(Math.log("0."+Fn(u.d))/Math.LN10+u.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?a/0:0):(_t=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),s=L2(r.times(Tu(u,n+t)),n),s.d&&(s=gt(s,n+5,1),G0(s.d,n,i)&&(e=n+10,s=gt(L2(r.times(Tu(u,e+t)),e),e+5,1),+Fn(s.d).slice(n+1,n+15)+1==1e14&&(s=gt(s,n+1,0)))),s.s=a,_t=!0,c.rounding=i,gt(s,n,i))};Pe.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Ta(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(Is(r,1,_u),e===void 0?e=s.rounding:Is(e,0,8),n=gt(new s(n),r,e),t=Ta(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toSignificantDigits=Pe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Is(r,1,_u),e===void 0?e=n.rounding:Is(e,0,8)),gt(new n(t),r,e)};Pe.toString=function(){var r=this,e=r.constructor,t=Ta(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Pe.truncated=Pe.trunc=function(){return gt(new this.constructor(this),this.e+1,1)};Pe.valueOf=Pe.toJSON=function(){var r=this,e=r.constructor,t=Ta(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Fn(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=bt-n.length,t&&(i+=Nu(t)),i+=n;a=r[e],n=a+"",t=bt-n.length,t&&(i+=Nu(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}o(Fn,"digitsToString");function Is(r,e,t){if(r!==~~r||r<e||r>t)throw Error(Iu+r)}o(Is,"checkInt32");function G0(r,e,t,n){var s,i,a,u;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=bt,s=0):(s=Math.ceil((e+1)/bt),e%=bt),i=Sn(10,bt-e),u=r[s]%i|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(r[s+1]/i/100|0)==Sn(10,e-2)-1||(u==i/2||u==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==i||!n&&t>3&&u+1==i/2)&&(r[s+1]/i/1e3|0)==Sn(10,e-3)-1,a}o(G0,"checkRoundingDigits");function rw(r,e,t){for(var n,s=[0],i,a=0,u=r.length;a<u;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=P2.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}o(rw,"convertBase");function kW(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/cw(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=tp(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(kW,"cosine");var Tr=(function(){function r(n,s,i){var a,u=0,c=n.length;for(n=n.slice();c--;)a=n[c]*s+u,n[c]=a%i|0,u=a/i|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,s,i,a){var u,c;if(i!=a)c=i>a?1:-1;else for(u=c=0;u<i;u++)if(n[u]!=s[u]){c=n[u]>s[u]?1:-1;break}return c}o(e,"compare");function t(n,s,i,a){for(var u=0;i--;)n[i]-=u,u=n[i]<s[i]?1:0,n[i]=u*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,s,i,a,u,c){var f,h,m,g,x,v,w,S,A,T,b,E,C,_,F,R,q,H,K,X,pe=n.constructor,le=n.s==s.s?1:-1,ue=n.d,ee=s.d;if(!ue||!ue[0]||!ee||!ee[0])return new pe(!n.s||!s.s||(ue?ee&&ue[0]==ee[0]:!ee)?NaN:ue&&ue[0]==0||!ee?le*0:le/0);for(c?(x=1,h=n.e-s.e):(c=Qi,x=bt,h=ns(n.e/x)-ns(s.e/x)),K=ee.length,q=ue.length,A=new pe(le),T=A.d=[],m=0;ee[m]==(ue[m]||0);m++);if(ee[m]>(ue[m]||0)&&h--,i==null?(_=i=pe.precision,a=pe.rounding):u?_=i+(n.e-s.e)+1:_=i,_<0)T.push(1),v=!0;else{if(_=_/x+2|0,m=0,K==1){for(g=0,ee=ee[0],_++;(m<q||g)&&_--;m++)F=g*c+(ue[m]||0),T[m]=F/ee|0,g=F%ee|0;v=g||m<q}else{for(g=c/(ee[0]+1)|0,g>1&&(ee=r(ee,g,c),ue=r(ue,g,c),K=ee.length,q=ue.length),R=K,b=ue.slice(0,K),E=b.length;E<K;)b[E++]=0;X=ee.slice(),X.unshift(0),H=ee[0],ee[1]>=c/2&&++H;do g=0,f=e(ee,b,K,E),f<0?(C=b[0],K!=E&&(C=C*c+(b[1]||0)),g=C/H|0,g>1?(g>=c&&(g=c-1),w=r(ee,g,c),S=w.length,E=b.length,f=e(w,b,S,E),f==1&&(g--,t(w,K<S?X:ee,S,c))):(g==0&&(f=g=1),w=ee.slice()),S=w.length,S<E&&w.unshift(0),t(b,w,E,c),f==-1&&(E=b.length,f=e(ee,b,K,E),f<1&&(g++,t(b,K<E?X:ee,E,c))),E=b.length):f===0&&(g++,b=[0]),T[m++]=g,f&&b[0]?b[E++]=ue[R]||0:(b=[ue[R]],E=1);while((R++<q||b[0]!==void 0)&&_--);v=b[0]!==void 0}T[0]||T.shift()}if(x==1)A.e=h,AO=v;else{for(m=1,g=T[0];g>=10;g/=10)m++;A.e=m+h*x-1,gt(A,u?i+A.e+1:i,a,v)}return A}})();function gt(r,e,t,n){var s,i,a,u,c,f,h,m,g,x=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(s=1,u=m[0];u>=10;u/=10)s++;if(i=e-s,i<0)i+=bt,a=e,h=m[g=0],c=h/Sn(10,s-a-1)%10|0;else if(g=Math.ceil((i+1)/bt),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);h=c=0,s=1,i%=bt,a=i-bt+1}else break e;else{for(h=u=m[g],s=1;u>=10;u/=10)s++;i%=bt,a=i-bt+s,c=a<0?0:h/Sn(10,s-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?h:h%Sn(10,s-a-1)),f=t<4?(c||n)&&(t==0||t==(r.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(i>0?a>0?h/Sn(10,s-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,f?(e-=r.e+1,m[0]=Sn(10,(bt-e%bt)%bt),r.e=-e||0):m[0]=r.e=0,r;if(i==0?(m.length=g,u=1,g--):(m.length=g+1,u=Sn(10,bt-i),m[g]=a>0?(h/Sn(10,s-a)%Sn(10,a)|0)*u:0),f)for(;;)if(g==0){for(i=1,a=m[0];a>=10;a/=10)i++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(r.e++,m[0]==Qi&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Qi)break;m[g--]=0,u=1}for(i=m.length;m[--i]===0;)m.pop()}return _t&&(r.e>x.maxE?(r.d=null,r.e=NaN):r.e<x.minE&&(r.e=0,r.d=[0])),r}o(gt,"finalise");function Ta(r,e,t){if(!r.isFinite())return RO(r);var n,s=r.e,i=Fn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+Nu(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+Nu(-s-1)+i,t&&(n=t-a)>0&&(i+=Nu(n))):s>=a?(i+=Nu(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+Nu(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=Nu(n))),i}o(Ta,"finiteToString");function uw(r,e){var t=r[0];for(e*=bt;t>=10;t/=10)e++;return e}o(uw,"getBase10Exponent");function aw(r,e,t){if(e>OW)throw _t=!0,t&&(r.precision=t),Error(CO);return gt(new r(sw),e,1,!0)}o(aw,"getLn10");function Na(r,e,t){if(e>k2)throw Error(CO);return gt(new r(iw),e,t,!0)}o(Na,"getPi");function _O(r){var e=r.length-1,t=e*bt+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(_O,"getPrecision");function Nu(r){for(var e="";r--;)e+="0";return e}o(Nu,"getZeroString");function BO(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/bt+4);for(_t=!1;;){if(t%2&&(i=i.times(e),bO(i.d,a)&&(s=!0)),t=ns(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),bO(e.d,a)}return _t=!0,i}o(BO,"intPow");function SO(r){return r.d[r.d.length-1]&1}o(SO,"isOdd");function DO(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}o(DO,"maxOrMin");function L2(r,e){var t,n,s,i,a,u,c,f=0,h=0,m=0,g=r.constructor,x=g.rounding,v=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(_t=!1,c=v):c=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(Sn(2,m))/Math.LN10*2+5|0,c+=n,t=i=a=new g(1),g.precision=c;;){if(i=gt(i.times(r),c,1),t=t.times(++h),u=a.plus(Tr(i,t,c,1)),Fn(u.d).slice(0,c)===Fn(a.d).slice(0,c)){for(s=m;s--;)a=gt(a.times(a),c,1);if(e==null)if(f<3&&G0(a.d,c-n,x,f))g.precision=c+=10,t=i=u=new g(1),h=0,f++;else return gt(a,g.precision=v,x,_t=!0);else return g.precision=v,a}a=u}}o(L2,"naturalExponential");function Tu(r,e){var t,n,s,i,a,u,c,f,h,m,g,x=1,v=10,w=r,S=w.d,A=w.constructor,T=A.rounding,b=A.precision;if(w.s<0||!S||!S[0]||!w.e&&S[0]==1&&S.length==1)return new A(S&&!S[0]?-1/0:w.s!=1?NaN:S?0:w);if(e==null?(_t=!1,h=b):h=e,A.precision=h+=v,t=Fn(S),n=t.charAt(0),Math.abs(i=w.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)w=w.times(r),t=Fn(w.d),n=t.charAt(0),x++;i=w.e,n>1?(w=new A("0."+t),i++):w=new A(n+"."+t.slice(1))}else return f=aw(A,h+2,b).times(i+""),w=Tu(new A(n+"."+t.slice(1)),h-v).plus(f),A.precision=b,e==null?gt(w,b,T,_t=!0):w;for(m=w,c=a=w=Tr(w.minus(1),w.plus(1),h,1),g=gt(w.times(w),h,1),s=3;;){if(a=gt(a.times(g),h,1),f=c.plus(Tr(a,new A(s),h,1)),Fn(f.d).slice(0,h)===Fn(c.d).slice(0,h))if(c=c.times(2),i!==0&&(c=c.plus(aw(A,h+2,b).times(i+""))),c=Tr(c,new A(x),h,1),e==null)if(G0(c.d,h-v,T,u))A.precision=h+=v,f=a=w=Tr(m.minus(1),m.plus(1),h,1),g=gt(w.times(w),h,1),s=u=1;else return gt(c,A.precision=b,T,_t=!0);else return A.precision=b,c;c=f,s+=2}}o(Tu,"naturalLogarithm");function RO(r){return String(r.s*r.s/0)}o(RO,"nonFiniteToString");function nw(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%bt,t<0&&(n+=bt),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=bt;n<s;)r.d.push(+e.slice(n,n+=bt));e=e.slice(n),n=bt-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),_t&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(nw,"parseDecimal");function LW(r,e){var t,n,s,i,a,u,c,f,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),IO.test(e))return nw(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(DW.test(e))t=16,e=e.toLowerCase();else if(BW.test(e))t=2;else if(RW.test(e))t=8;else throw Error(Iu+e);for(i=e.search(/p/i),i>0?(c=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,i=u-i,s=BO(n,new n(t),i,i*2)),f=rw(e,t,Qi),h=f.length-1,i=h;f[i]===0;--i)f.pop();return i<0?new n(r.s*0):(r.e=uw(f,h),r.d=f,_t=!1,a&&(r=Tr(r,s,u*4)),c&&(r=r.times(Math.abs(c)<54?Sn(2,c):rp.pow(2,c))),_t=!0,r)}o(LW,"parseOther");function VW(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:tp(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/cw(5,t)),e=tp(r,2,e,e);for(var s,i=new r(5),a=new r(16),u=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(u))));return e}o(VW,"sine");function tp(r,e,t,n,s){var i,a,u,c,f=1,h=r.precision,m=Math.ceil(h/bt);for(_t=!1,c=t.times(t),u=new r(n);;){if(a=Tr(u.times(c),new r(e++*e++),h,1),u=s?n.plus(a):n.minus(a),n=Tr(a.times(c),new r(e++*e++),h,1),a=u.plus(n),a.d[m]!==void 0){for(i=m;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=n,n=a,a=i,f++}return _t=!0,a.d.length=m+1,a}o(tp,"taylorSeries");function cw(r,e){for(var t=r;--e;)t*=r;return t}o(cw,"tinyPow");function PO(r,e){var t,n=e.s<0,s=Na(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return Ao=n?4:1,e;if(t=e.divToInt(s),t.isZero())Ao=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return Ao=SO(t)?n?2:3:n?4:1,e;Ao=SO(t)?n?1:4:n?3:2}return e.minus(s).abs()}o(PO,"toLessThanHalfPi");function V2(r,e,t,n){var s,i,a,u,c,f,h,m,g,x=r.constructor,v=t!==void 0;if(v?(Is(t,1,_u),n===void 0?n=x.rounding:Is(n,0,8)):(t=x.precision,n=x.rounding),!r.isFinite())h=RO(r);else{for(h=Ta(r),a=h.indexOf("."),v?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(h=h.replace(".",""),g=new x(1),g.e=h.length-a,g.d=rw(Ta(g),10,s),g.e=g.d.length),m=rw(h,10,s),i=c=m.length;m[--c]==0;)m.pop();if(!m[0])h=v?"0p+0":"0";else{if(a<0?i--:(r=new x(r),r.d=m,r.e=i,r=Tr(r,g,t,n,0,s),m=r.d,i=r.e,f=AO),a=m[t],u=s/2,f=f||m[t+1]!==void 0,f=n<4?(a!==void 0||f)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||f||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,f)for(;++m[--t]>s-1;)m[t]=0,t||(++i,m.unshift(1));for(c=m.length;!m[c-1];--c);for(a=0,h="";a<c;a++)h+=P2.charAt(m[a]);if(v){if(c>1)if(e==16||e==8){for(a=e==16?4:3,--c;c%a;c++)h+="0";for(m=rw(h,s,e),c=m.length;!m[c-1];--c);for(a=1,h="1.";a<c;a++)h+=P2.charAt(m[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>c)for(i-=c;i--;)h+="0";else i<c&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return r.s<0?"-"+h:h}o(V2,"toStringBinary");function bO(r,e){if(r.length>e)return r.length=e,!0}o(bO,"truncate");function UW(r){return new this(r).abs()}o(UW,"abs");function jW(r){return new this(r).acos()}o(jW,"acos");function MW(r){return new this(r).acosh()}o(MW,"acosh");function FW(r,e){return new this(r).plus(e)}o(FW,"add");function qW(r){return new this(r).asin()}o(qW,"asin");function HW(r){return new this(r).asinh()}o(HW,"asinh");function KW(r){return new this(r).atan()}o(KW,"atan");function $W(r){return new this(r).atanh()}o($W,"atanh");function GW(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=Na(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?Na(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=Na(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(Tr(r,e,i,1)),e=Na(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(Tr(r,e,i,1)),t}o(GW,"atan2");function XW(r){return new this(r).cbrt()}o(XW,"cbrt");function WW(r){return gt(r=new this(r),r.e+1,2)}o(WW,"ceil");function zW(r,e,t){return new this(r).clamp(e,t)}o(zW,"clamp");function JW(r){if(!r||typeof r!="object")throw Error(ow+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,_u,"rounding",0,8,"toExpNeg",-ep,0,"toExpPos",0,ep,"maxE",0,ep,"minE",-ep,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=O2[t]),(n=r[t])!==void 0)if(ns(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(Iu+t+": "+n);if(t="crypto",s&&(this[t]=O2[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(NO);else this[t]=!1;else throw Error(Iu+t+": "+n);return this}o(JW,"config");function YW(r){return new this(r).cos()}o(YW,"cos");function QW(r){return new this(r).cosh()}o(QW,"cosh");function OO(r){var e,t,n;function s(i){var a,u,c,f=this;if(!(f instanceof s))return new s(i);if(f.constructor=s,EO(i)){f.s=i.s,_t?!i.d||i.e>s.maxE?(f.e=NaN,f.d=null):i.e<s.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(c=typeof i,c==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;_t?a>s.maxE?(f.e=NaN,f.d=null):a<s.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[i]):(f.e=a,f.d=[i]);return}if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return nw(f,i.toString())}if(c==="string")return(u=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(u===43&&(i=i.slice(1)),f.s=1),IO.test(i)?nw(f,i):LW(f,i);if(c==="bigint")return i<0?(i=-i,f.s=-1):f.s=1,nw(f,i.toString());throw Error(Iu+i)}if(o(s,"Decimal"),s.prototype=Pe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=JW,s.clone=OO,s.isDecimal=EO,s.abs=UW,s.acos=jW,s.acosh=MW,s.add=FW,s.asin=qW,s.asinh=HW,s.atan=KW,s.atanh=$W,s.atan2=GW,s.cbrt=XW,s.ceil=WW,s.clamp=zW,s.cos=YW,s.cosh=QW,s.div=ZW,s.exp=ez,s.floor=tz,s.hypot=rz,s.ln=nz,s.log=sz,s.log10=az,s.log2=iz,s.max=oz,s.min=uz,s.mod=cz,s.mul=lz,s.pow=fz,s.random=hz,s.round=pz,s.sign=dz,s.sin=mz,s.sinh=gz,s.sqrt=vz,s.sub=yz,s.sum=xz,s.tan=wz,s.tanh=Sz,s.trunc=bz,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}o(OO,"clone");function ZW(r,e){return new this(r).div(e)}o(ZW,"div");function ez(r){return new this(r).exp()}o(ez,"exp");function tz(r){return gt(r=new this(r),r.e+1,3)}o(tz,"floor");function rz(){var r,e,t=new this(0);for(_t=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return _t=!0,new this(1/0);t=e}return _t=!0,t.sqrt()}o(rz,"hypot");function EO(r){return r instanceof rp||r&&r.toStringTag===TO||!1}o(EO,"isDecimalInstance");function nz(r){return new this(r).ln()}o(nz,"ln");function sz(r,e){return new this(r).log(e)}o(sz,"log");function iz(r){return new this(r).log(2)}o(iz,"log2");function az(r){return new this(r).log(10)}o(az,"log10");function oz(){return DO(this,arguments,-1)}o(oz,"max");function uz(){return DO(this,arguments,1)}o(uz,"min");function cz(r,e){return new this(r).mod(e)}o(cz,"mod");function lz(r,e){return new this(r).mul(e)}o(lz,"mul");function fz(r,e){return new this(r).pow(e)}o(fz,"pow");function hz(r){var e,t,n,s,i=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Is(r,1,_u),n=Math.ceil(r/bt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(s%1e7),i+=4);i=n/4}else throw Error(NO);else for(;i<n;)u[i++]=Math.random()*1e7|0;for(n=u[--i],r%=bt,n&&r&&(s=Sn(10,bt-r),u[i]=(n/s|0)*s);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=bt)u.shift();for(n=1,s=u[0];s>=10;s/=10)n++;n<bt&&(t-=bt-n)}return a.e=t,a.d=u,a}o(hz,"random");function pz(r){return gt(r=new this(r),r.e+1,this.rounding)}o(pz,"round");function dz(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(dz,"sign");function mz(r){return new this(r).sin()}o(mz,"sin");function gz(r){return new this(r).sinh()}o(gz,"sinh");function vz(r){return new this(r).sqrt()}o(vz,"sqrt");function yz(r,e){return new this(r).sub(e)}o(yz,"sub");function xz(){var r=0,e=arguments,t=new this(e[r]);for(_t=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return _t=!0,gt(t,this.precision,this.rounding)}o(xz,"sum");function wz(r){return new this(r).tan()}o(wz,"tan");function Sz(r){return new this(r).tanh()}o(Sz,"tanh");function bz(r){return gt(r=new this(r),r.e+1,1)}o(bz,"trunc");Pe[Symbol.for("nodejs.util.inspect.custom")]=Pe.toString;Pe[Symbol.toStringTag]="Decimal";var rp=Pe.constructor=OO(O2);sw=new rp(sw);iw=new rp(iw);var np=class r extends rp{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var kO=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var Ez=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),Bu=o(r=>typeof r=="string"?ti(new pn(r)):r instanceof Error?ti(new pn(r.message,{cause:r.cause})):Ez(r)?ti(new pn(r.message)):ti(new pn("unexpected error")),"leftFromError");var lw=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var Vh=Zx(Yk(),1);import pq from"fs";import The from"path";import N0 from"crypto";import"reflect-metadata";var yU=Zx(mU(),1);import{constants as vue}from"crypto";import{Agent as gU}from"https";var vU=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:vue.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new gU({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return new gU({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,yU.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{httpsAgent:t});return ri(c)}catch(t){return Bu(t)}}};import{arch as Sue,platform as bue}from"os";import{join as Kg,dirname as r_,resolve as Eue}from"path";import{existsSync as ib}from"fs";import{resolve as wU}from"path";import{createRequire as xU}from"module";import{fileURLToPath as yue,pathToFileURL as xue}from"url";var wue=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Jp,SU=o(()=>{if(Jp!==void 0)return Jp;if(wue){Jp=void 0;return}try{Jp=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Jp=void 0}return Jp},"getImportMetaUrl"),bU=o(()=>{if(typeof Xe<"u")return Xe;let r=SU();if(r)return xU(r);let e=xue(wU(process.cwd(),"package.json")).href;return xU(e)},"getRequireFn"),EU=o(()=>{if(typeof __filename<"u")return __filename;let r=SU();return r?yue(r):wU(process.cwd())},"getCurrentFile");var $g=o(r=>bU()(r),"exportRequireModule"),AU=o(r=>{r=`${r}.node`;let e=`${bue()}-${Sue()}`;if(process.env.NFETS_ADDONS_DIR)return $g(Kg(process.env.NFETS_ADDONS_DIR,r));let t=EU(),n=Eue(t,"../../../../"),s=Kg(n,"build","addons",e,r);if(ib(s))return $g(s);let i=t;for(let a=0;a<5;a++){let u=Kg(i,"build","addons",e,r);if(ib(u))return $g(u);let c=r_(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=Kg(i,"node_modules","nfets","build","addons",e,r);if(ib(u))return $g(u);let c=r_(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=Kg(i,"build","Release",r);if(ib(u))return $g(u);let c=r_(i);if(c===i)break;i=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var Aue=AU("xml_validator"),CU=Aue;var whe=Zx(Xj(),1);import xhe from"crypto";var Wj="application/xml";var Ut;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ut||(Ut={}));function Cue(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(Cue,"SelectNodesEx");function Nue(r,e){let t=Yp("xpath").select;return t(e,r)}o(Nue,"SelectNodesNode");var zj=typeof self<"u"?Cue:Nue;function Li(r){r=r.replace(/\r\n/g,`
90
90
  `).replace(/\r/g,`
91
91
  `);let e;return typeof DOMParser<"u"?e=DOMParser:e=Yp("DOMParser"),new e().parseFromString(r,Wj)}o(Li,"Parse");function Qa(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Yp("XMLSerializer"),new e().serializeToString(r)}o(Qa,"Stringify");function Sb(r,e){let t=zj(r,e);return t&&t.length>0?t[0]:null}o(Sb,"SelectSingleNode");function Jj(r,e){return r&&r.nodeType===e}o(Jj,"isNodeType");function oi(r){return Jj(r,Ut.Element)}o(oi,"isElement");function Jl(r){return Jj(r,Ut.Document)}o(Jl,"isDocument");var Yj=new Map;function Qj(r){for(let e in r)Yj.set(e,r[e])}o(Qj,"setNodeDependencies");function Yp(r){let e=Yj.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Yp,"getNodeDependency");var Wg="element",zg="attribute",bb="content";var Tue=1e9;function p_(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o(p_,"assign");function jt(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=p_({},t.items)),t.target=e}}o(jt,"XmlElement");function Gt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=p_({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||Tue,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Wg},eM(e,s,r)}}o(Gt,"XmlChildElement");function Or(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=p_({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=zg,eM(e,s,r)}}o(Or,"XmlAttribute");function eM(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(eM,"defineProperty");var lc=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function Iue(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(Iue,"printf");function _ue(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(_ue,"padNum");var Fe=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=Iue(ln[e],...t);this.message=`${this.prefix}${_ue(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Te;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(Te||(Te={}));var ln={};ln[Te.NONE]="No description";ln[Te.NULL_REFERENCE]="Null reference";ln[Te.NULL_PARAM]="'%1' has empty '%2' object";ln[Te.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";ln[Te.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";ln[Te.METHOD_NOT_IMPLEMENTED]="Method is not implemented";ln[Te.METHOD_NOT_SUPPORTED]="Method is not supported";ln[Te.PARAM_REQUIRED]="Required parameter is missing '%1'";ln[Te.CONVERTER_UNSUPPORTED]="Converter is not supported";ln[Te.ELEMENT_MALFORMED]="Malformed element '%1'";ln[Te.ELEMENT_MISSING]="Element '%1' is missing in '%2'";ln[Te.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";ln[Te.CONTENT_MISSING]="Content is missing in '%1'";ln[Te.CRYPTOGRAPHIC]="Cryptographic error: %1";ln[Te.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";ln[Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";ln[Te.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";ln[Te.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";ln[Te.XML_EXCEPTION]="XML exception: %1";ln[Te.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var wr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new Fe(Te.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Vi={get:o(r=>{if(r)return wr.ToBase64(r)},"get"),set:o(r=>wr.FromBase64(r),"set")},Jg={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var Bue="xml_root",Ms=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new Fe(Te.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Jl(e)&&(n=e.getElementById(t)),n==null&&(n=Sb(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=Sb(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=Sb(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=Bue,t=null,n=null){if(n&&!t)throw new Fe(Te.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Li(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Jl(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];oi(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=Jl(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(oi(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(oi(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let c=t[u],f=i.items[u];switch(f.type){case bb:{let h=f,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new Fe(Te.CONTENT_MISSING,a);(h.defaultValue!==c||h.required)&&(s.textContent=m);break}case zg:{let h=f,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new Fe(Te.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==c||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case Wg:{let h=f,m=null;if(h.parser){if(h.required&&!c||h.minOccurs&&!c.Count){let g=c?.localName||h.localName;throw new Fe(Te.ELEMENT_MISSING,g,a)}c&&(m=c.GetXml(c.element===void 0&&(h.required||c.Count)))}else{let g=h.converter?h.converter.get(c):c;if(h.required&&g===void 0)throw new Fe(Te.ELEMENT_MISSING,h.localName,a);if(c!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let x of g){let v=x instanceof r?x.GetXml(!0):x;v!==null&&m&&m.appendChild(v)}else if(g instanceof r){let x=g.GetXml(!0);x&&m&&m.appendChild(x)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let w=0;w<m.childNodes.length;w++){let S=m.childNodes.item(w);oi(S)&&g.push(S)}let x=h.minOccurs||0,v=h.maxOccurs||1/0;if(g.length<x||g.length>v)throw new Fe(Te.COLLECTION_LIMIT,c.localName,i.localName);g.forEach(w=>s.appendChild(w.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new Fe(Te.COLLECTION_LIMIT,c.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Li(e).documentElement:t=e,!t)throw new Fe(Te.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new Fe(Te.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case bb:{let c=u;if(c.required&&!t.textContent)throw new Fe(Te.CONTENT_MISSING,i);if(!t.textContent)n[a]=c.defaultValue;else{let f=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=f}break}case zg:{let c=u,f,h;if(!c.localName)throw new Fe(Te.PARAM_REQUIRED,"localName");if(c.namespaceURI?(f=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),h=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(f=t.hasAttribute.bind(t,c.localName),h=t.getAttribute.bind(t,c.localName)),c.required&&!f())throw new Fe(Te.ATTRIBUTE_MISSING,c.localName,i);if(!f())n[a]=c.defaultValue;else{let m=h(),g=c.converter&&m?c.converter.set(m):m;n[a]=g}break}case Wg:{let c=u;if(c.noRoot){if(!c.parser)throw new Fe(Te.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let h=new c.parser;if(!(h instanceof Qp))throw new Fe(Te.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=c.minOccurs||0,g=c.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new Fe(Te.COLLECTION_LIMIT,c.parser.localName,i);n[a]=h;continue}let f=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!oi(m))continue;let g=m;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){f=g;break}}if(c.required&&!f)throw new Fe(Te.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,i);if(c.parser){if(f){let h=new c.parser;h.localName=c.localName,h.namespaceURI=c.namespaceURI,n[a]=h,h.LoadXml(f)}}else if(!f)n[a]=c.defaultValue;else{let h=f.textContent||"",m=c.converter?c.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Qa(e):""}GetElement(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new Fe(Te.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var Qp=class extends Ms{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new lc(this.GetIterator().map(e))}Filter(e){return new lc(this.GetIterator().filter(e))}Sort(e){return new lc(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new Fe(Te.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(oi(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var Zp=class extends lc{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var Due="[object ArrayBuffer]",mt=class g_{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===Due}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=g_.toUint8Array(e),s=g_.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},m_="string",Rue=/^[0-9a-f\s]+$/i,Pue=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Oue=/^[a-zA-Z0-9-_]+$/,tM=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=mt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},Za=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=mt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Et=class ed{static{o(this,"Convert")}static isHex(e){return typeof e===m_&&Rue.test(e)}static isBase64(e){return typeof e===m_&&Pue.test(e)}static isBase64Url(e){return typeof e===m_&&Oue.test(e)}static ToString(e,t="utf8"){let n=mt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Za.toString(n,!0);case"utf16":case"utf16be":return Za.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Za.fromString(e,!0);case"utf16":case"utf16be":return Za.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=mt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ed.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ed.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=ed.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return tM.fromString(e);case"utf16":case"utf16be":return Za.fromString(e);case"utf16le":case"usc2":return Za.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=ed.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return tM.toString(e);case"utf16":case"utf16be":return Za.toString(e);case"utf16le":case"usc2":return Za.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=mt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=mt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ed.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return Za.toString(e,t)}static FromUtf16String(e,t=!1){return Za.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Et.DEFAULT_UTF8_ENCODING="utf8";function B(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(B,"getParametersValue");function Eb(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(Eb,"bufferToHexCodes");function Uo(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(Uo,"utilFromBase");function aa(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let f=new Uint8Array(c);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);f[i-h-1]=Math.floor(s/m),s-=f[i-h-1]*m}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(aa,"utilToBase");function Yl(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(Yl,"utilConcatBuf");function Ab(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(Ab,"utilConcatView");function v_(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=Uo(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,Uo(i,8)-n}o(v_,"utilDecodeTC");function nM(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=aa(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let s=aa(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let c=0;c<a.byteLength;c++)i[c+1]=u[c];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(nM,"utilEncodeTC");function fc(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(fc,"isEqualBuffer");function Fs(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(Fs,"padNumber");var sM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",iM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function Cb(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",c=e?iM:sM;if(n){let f=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){f=h;break}r=r.slice(f)}for(;s<r.length;){let f=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=f>>2,x=(f&3)<<4|h>>4,v=(h&15)<<2|m>>6,w=m&63;i===1?v=w=64:a===1&&(w=64),t?v===64?u+=`${c.charAt(g)}${c.charAt(x)}`:w===64?u+=`${c.charAt(g)}${c.charAt(x)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(x)}${c.charAt(v)}${c.charAt(w)}`:u+=`${c.charAt(g)}${c.charAt(x)}${c.charAt(v)}${c.charAt(w)}`}return u}o(Cb,"toBase64");function td(r,e=!1,t=!1){let n=e?iM:sM;function s(c){for(let f=0;f<64;f++)if(n.charAt(f)===c)return f;return 64}o(s,"indexOf");function i(c){return c===64?0:c}o(i,"test");let a=0,u="";for(;a<r.length;){let c=s(r.charAt(a++)),f=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(c)<<2|i(f)>>4,x=(i(f)&15)<<4|i(h)>>2,v=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(x)),m!==64&&(u+=String.fromCharCode(v))}if(t){let c=u.length,f=-1;for(let h=c-1;h>=0;h--)if(u.charCodeAt(h)!==0){f=h;break}f!==-1?u=u.slice(0,f+1):u=""}return u}o(td,"fromBase64");function Yg(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(Yg,"arrayBufferToString");function Ql(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Ql,"stringToArrayBuffer");var kue=Math.log(2);function aM(r){let e=Math.log(r)/kue,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(aM,"nearestPowerOf2");function De(r,e){for(let t of e)delete r[t]}o(De,"clearProps");function Nb(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(Nb,"assertBigInt");function S_(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(S_,"concat");function jo(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(jo,"checkBufferParams");var b_=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return S_(this.items)}},Qg=[new Uint8Array([1])],uM="0123456789",y_="name",cM="valueHexView",Lue="isHexOnly",Vue="idBlock",Uue="tagClass",jue="tagNumber",Mue="isConstructed",Fue="fromBER",que="toBER",Hue="local",qs="",oa=new ArrayBuffer(0),Tb=new Uint8Array(0),ev="EndOfContent",fM="OCTET STRING",hM="BIT STRING";function Mo(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?mt.toUint8Array(i.valueHex):Tb}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!jo(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",oa)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Et.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(Mo,"HexBlock");var Zl=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=qs,warnings:n=[],valueBeforeDecode:s=Tb}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=mt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Et.ToHex(this.valueBeforeDecodeView)}}};Zl.NAME="baseBlock";var Hs=class extends Zl{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Hs.NAME="valueBlock";var pM=class extends Mo(Zl){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?mt.toUint8Array(e.valueHex):Tb,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",oa}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=aa(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=i[c]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=mt.toUint8Array(e);if(!jo(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,f=this.valueHexView=new Uint8Array(255),h=255;for(;i[c]&128;){if(f[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===h){h+=255;let g=new Uint8Array(h);for(let x=0;x<f.length;x++)g[x]=f[x];f=this.valueHexView=new Uint8Array(h)}}this.blockLength=c+1,f[c-1]=i[c]&127;let m=new Uint8Array(c);for(let g=0;g<c;g++)m[g]=f[g];f=this.valueHexView=new Uint8Array(c),f.set(m),this.blockLength<=9?this.tagNumber=Uo(f,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};pM.NAME="identificationBlock";var dM=class extends Zl{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=mt.toUint8Array(e);if(!jo(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=s.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Uo(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=aa(this.length,8);if(s.byteLength>127)return this.error="Too big length",oa;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};dM.NAME="lengthBlock";var ut={},Ss=class extends Zl{static{o(this,"BaseBlock")}constructor({name:e=qs,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new pM(s),this.lenBlock=new dM(s),this.valueBlock=i?new i(s):new Hs(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new b_;t||mM(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?oa:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Et.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Et.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return fc(t,n)}};Ss.NAME="BaseBlock";function mM(r){var e;if(r instanceof ut.Constructed)for(let t of r.valueBlock.value)mM(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(mM,"prepareIndefiniteForm");var gM=class extends Ss{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=qs,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};gM.NAME="BaseStringBlock";var vM=class extends Mo(Hs){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};vM.NAME="PrimitiveValueBlock";var yM,vt=class extends Ss{static{o(this,"Primitive")}constructor(e={}){super(e,vM),this.idBlock.isConstructed=!1}};yM=vt;ut.Primitive=yM;vt.NAME="PRIMITIVE";function Kue(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(Kue,"localChangeType");function tv(r,e=0,t=r.length){let n=e,s=new Ss({},Hs),i=new Zl;if(!jo(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let c=Ss;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};c=ut.EndOfContent;break;case 1:c=ut.Boolean;break;case 2:c=ut.Integer;break;case 3:c=ut.BitString;break;case 4:c=ut.OctetString;break;case 5:c=ut.Null;break;case 6:c=ut.ObjectIdentifier;break;case 10:c=ut.Enumerated;break;case 12:c=ut.Utf8String;break;case 13:c=ut.RelativeObjectIdentifier;break;case 14:c=ut.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:c=ut.Sequence;break;case 17:c=ut.Set;break;case 18:c=ut.NumericString;break;case 19:c=ut.PrintableString;break;case 20:c=ut.TeletexString;break;case 21:c=ut.VideotexString;break;case 22:c=ut.IA5String;break;case 23:c=ut.UTCTime;break;case 24:c=ut.GeneralizedTime;break;case 25:c=ut.GraphicString;break;case 26:c=ut.VisibleString;break;case 27:c=ut.GeneralString;break;case 28:c=ut.UniversalString;break;case 29:c=ut.CharacterString;break;case 30:c=ut.BmpString;break;case 31:c=ut.DATE;break;case 32:c=ut.TimeOfDay;break;case 33:c=ut.DateTime;break;case 34:c=ut.Duration;break;default:{let f=s.idBlock.isConstructed?new ut.Constructed:new ut.Primitive;f.idBlock=s.idBlock,f.lenBlock=s.lenBlock,f.warnings=s.warnings,s=f}}break;case 2:case 3:case 4:default:c=s.idBlock.isConstructed?ut.Constructed:ut.Primitive}return s=Kue(s,c),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(tv,"localFromBER");function Gr(r){if(!r.byteLength){let e=new Ss({},Hs);return e.error="Input buffer has zero length",{offset:-1,result:e}}return tv(mt.toUint8Array(r).slice(),0,r.byteLength)}o(Gr,"fromBER");function $ue(r,e){return r?1:e}o($ue,"checkLen");var hc=class extends Hs{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=mt.toUint8Array(e);if(!jo(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;$ue(this.isIndefiniteForm,n)>0;){let a=tv(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===ev)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===ev?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new b_;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?oa:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};hc.NAME="ConstructedValueBlock";var xM,oe=class extends Ss{static{o(this,"Constructed")}constructor(e={}){super(e,hc),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
92
92
  `).map(s=>` ${s}`).join(`