substack-feed-api 1.0.4 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/substackFeedApi.js +766 -760
- package/dist/substackFeedApi.umd.cjs +8 -8
- package/index.d.ts +2 -2
- package/package.json +9 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(Q,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(Q=typeof globalThis<"u"?globalThis:Q||self,et(Q.SubstackFeedAPI={}))})(this,function(Q){"use strict";function et(i){if(i.__esModule)return i;var
|
|
2
|
-
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(rt)),rt}var nt={},Y={},K={},ae;function z(){return ae||(ae=1,(function(){var i,c,D,f,h,t,e,o=[].slice,l={}.hasOwnProperty;i=function(){var b,m,y,d,g,O;if(O=arguments[0],g=2<=arguments.length?o.call(arguments,1):[],h(Object.assign))Object.assign.apply(null,arguments);else for(b=0,y=g.length;b<y;b++)if(d=g[b],d!=null)for(m in d)l.call(d,m)&&(O[m]=d[m]);return O},h=function(b){return!!b&&Object.prototype.toString.call(b)==="[object Function]"},t=function(b){var m;return!!b&&((m=typeof b)=="function"||m==="object")},D=function(b){return h(Array.isArray)?Array.isArray(b):Object.prototype.toString.call(b)==="[object Array]"},f=function(b){var m;if(D(b))return!b.length;for(m in b)if(l.call(b,m))return!1;return!0},e=function(b){var m,y;return t(b)&&(y=Object.getPrototypeOf(b))&&(m=y.constructor)&&typeof m=="function"&&m instanceof m&&Function.prototype.toString.call(m)===Function.prototype.toString.call(Object)},c=function(b){return h(b.valueOf)?b.valueOf():b},K.assign=i,K.isFunction=h,K.isObject=t,K.isArray=D,K.isEmpty=f,K.isPlainObject=e,K.getValue=c}).call(K)),K}var it={exports:{}},or=it.exports,ce;function le(){return ce||(ce=1,(function(){it.exports=function(){function i(){}return i.prototype.hasFeature=function(c,D){return!0},i.prototype.createDocumentType=function(c,D,f){throw new Error("This DOM method is not implemented.")},i.prototype.createDocument=function(c,D,f){throw new Error("This DOM method is not implemented.")},i.prototype.createHTMLDocument=function(c){throw new Error("This DOM method is not implemented.")},i.prototype.getFeature=function(c,D){throw new Error("This DOM method is not implemented.")},i}()}).call(or)),it.exports}var ot={exports:{}},st={exports:{}},ut={exports:{}},sr=ut.exports,fe;function ur(){return fe||(fe=1,(function(){ut.exports=function(){function i(){}return i.prototype.handleError=function(c){throw new Error(c)},i}()}).call(sr)),ut.exports}var at={exports:{}},ar=at.exports,pe;function cr(){return pe||(pe=1,(function(){at.exports=function(){function i(c){this.arr=c||[]}return Object.defineProperty(i.prototype,"length",{get:function(){return this.arr.length}}),i.prototype.item=function(c){return this.arr[c]||null},i.prototype.contains=function(c){return this.arr.indexOf(c)!==-1},i}()}).call(ar)),at.exports}var lr=st.exports,he;function fr(){return he||(he=1,(function(){var i,c;i=ur(),c=cr(),st.exports=function(){function D(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new i,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=Object.create(this.defaultParams)}return Object.defineProperty(D.prototype,"parameterNames",{get:function(){return new c(Object.keys(this.defaultParams))}}),D.prototype.getParameter=function(f){return this.params.hasOwnProperty(f)?this.params[f]:null},D.prototype.canSetParameter=function(f,h){return!0},D.prototype.setParameter=function(f,h){return h!=null?this.params[f]=h:delete this.params[f]},D}()}).call(lr)),st.exports}var ct={exports:{}},lt={exports:{}},ft={exports:{}},pr=ft.exports,de;function B(){return de||(de=1,(function(){ft.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(pr)),ft.exports}var pt={exports:{}},hr=pt.exports,ye;function me(){return ye||(ye=1,(function(){var i;i=B(),W(),pt.exports=function(){function c(D,f,h){if(this.parent=D,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),f==null)throw new Error("Missing attribute name. "+this.debugInfo(f));this.name=this.stringify.name(f),this.value=this.stringify.attValue(h),this.type=i.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(c.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(c.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(c.prototype,"textContent",{get:function(){return this.value},set:function(D){return this.value=D||""}}),Object.defineProperty(c.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(c.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(c.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(c.prototype,"specified",{get:function(){return!0}}),c.prototype.clone=function(){return Object.create(this)},c.prototype.toString=function(D){return this.options.writer.attribute(this,this.options.writer.filterOptions(D))},c.prototype.debugInfo=function(D){return D=D||this.name,D==null?"parent: <"+this.parent.name+">":"attribute: {"+D+"}, parent: <"+this.parent.name+">"},c.prototype.isEqualNode=function(D){return!(D.namespaceURI!==this.namespaceURI||D.prefix!==this.prefix||D.localName!==this.localName||D.value!==this.value)},c}()}).call(hr)),pt.exports}var ht={exports:{}},dr=ht.exports,ge;function Ut(){return ge||(ge=1,(function(){ht.exports=function(){function i(c){this.nodes=c}return Object.defineProperty(i.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),i.prototype.clone=function(){return this.nodes=null},i.prototype.getNamedItem=function(c){return this.nodes[c]},i.prototype.setNamedItem=function(c){var D;return D=this.nodes[c.nodeName],this.nodes[c.nodeName]=c,D||null},i.prototype.removeNamedItem=function(c){var D;return D=this.nodes[c],delete this.nodes[c],D||null},i.prototype.item=function(c){return this.nodes[Object.keys(this.nodes)[c]]||null},i.prototype.getNamedItemNS=function(c,D){throw new Error("This DOM method is not implemented.")},i.prototype.setNamedItemNS=function(c){throw new Error("This DOM method is not implemented.")},i.prototype.removeNamedItemNS=function(c,D){throw new Error("This DOM method is not implemented.")},i}()}).call(dr)),ht.exports}var yr=lt.exports,we;function Vt(){return we||(we=1,(function(){var i,c,D,f,h,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function g(){this.constructor=m}return g.prototype=y.prototype,m.prototype=new g,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=z(),e=o.isObject,t=o.isFunction,h=o.getValue,f=W(),i=B(),c=me(),D=Ut(),lt.exports=function(m){l(y,m);function y(d,g,O){var I,x,P,E;if(y.__super__.constructor.call(this,d),g==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(g),this.type=i.Element,this.attribs={},this.schemaTypeInfo=null,O!=null&&this.attribute(O),d.type===i.Document&&(this.isRoot=!0,this.documentObject=d,d.rootObject=this,d.children)){for(E=d.children,x=0,P=E.length;x<P;x++)if(I=E[x],I.type===i.DocType){I.name=this.name;break}}}return Object.defineProperty(y.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(y.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(y.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new D(this.attribs)),this.attributeMap}}),y.prototype.clone=function(){var d,g,O,I;O=Object.create(this),O.isRoot&&(O.documentObject=null),O.attribs={},I=this.attribs;for(g in I)b.call(I,g)&&(d=I[g],O.attribs[g]=d.clone());return O.children=[],this.children.forEach(function(x){var P;return P=x.clone(),P.parent=O,O.children.push(P)}),O},y.prototype.attribute=function(d,g){var O,I;if(d!=null&&(d=h(d)),e(d))for(O in d)b.call(d,O)&&(I=d[O],this.attribute(O,I));else t(g)&&(g=g.apply()),this.options.keepNullAttributes&&g==null?this.attribs[d]=new c(this,d,""):g!=null&&(this.attribs[d]=new c(this,d,g));return this},y.prototype.removeAttribute=function(d){var g,O,I;if(d==null)throw new Error("Missing attribute name. "+this.debugInfo());if(d=h(d),Array.isArray(d))for(O=0,I=d.length;O<I;O++)g=d[O],delete this.attribs[g];else delete this.attribs[d];return this},y.prototype.toString=function(d){return this.options.writer.element(this,this.options.writer.filterOptions(d))},y.prototype.att=function(d,g){return this.attribute(d,g)},y.prototype.a=function(d,g){return this.attribute(d,g)},y.prototype.getAttribute=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d].value:null},y.prototype.setAttribute=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNode=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d]:null},y.prototype.setAttributeNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNS=function(d,g,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNodeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNodeNS=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.hasAttribute=function(d){return this.attribs.hasOwnProperty(d)},y.prototype.hasAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttribute=function(d,g){return this.attribs.hasOwnProperty(d)?this.attribs[d].isId:g},y.prototype.setIdAttributeNS=function(d,g,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttributeNode=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.isEqualNode=function(d){var g,O,I;if(!y.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)||d.namespaceURI!==this.namespaceURI||d.prefix!==this.prefix||d.localName!==this.localName||d.attribs.length!==this.attribs.length)return!1;for(g=O=0,I=this.attribs.length-1;0<=I?O<=I:O>=I;g=0<=I?++O:--O)if(!this.attribs[g].isEqualNode(d.attribs[g]))return!1;return!0},y}(f)}).call(yr)),lt.exports}var dt={exports:{}},yt={exports:{}},mr=yt.exports,Te;function mt(){return Te||(Te=1,(function(){var i,c=function(f,h){for(var t in h)D.call(h,t)&&(f[t]=h[t]);function e(){this.constructor=f}return e.prototype=h.prototype,f.prototype=new e,f.__super__=h.prototype,f},D={}.hasOwnProperty;i=W(),yt.exports=function(f){c(h,f);function h(t){h.__super__.constructor.call(this,t),this.value=""}return Object.defineProperty(h.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(h.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),h.prototype.clone=function(){return Object.create(this)},h.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.replaceData=function(t,e,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.isEqualNode=function(t){return!(!h.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)||t.data!==this.data)},h}(i)}).call(mr)),yt.exports}var gr=dt.exports,De;function kt(){return De||(De=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;i=B(),c=mt(),dt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=i.CData,this.value=this.stringify.cdata(o)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))},t}(c)}).call(gr)),dt.exports}var gt={exports:{}},wr=gt.exports,Ee;function $t(){return Ee||(Ee=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;i=B(),c=mt(),gt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=i.Comment,this.value=this.stringify.comment(o)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))},t}(c)}).call(wr)),gt.exports}var wt={exports:{}},Tr=wt.exports,be;function Wt(){return be||(be=1,(function(){var i,c,D,f=function(t,e){for(var o in e)h.call(e,o)&&(t[o]=e[o]);function l(){this.constructor=t}return l.prototype=e.prototype,t.prototype=new l,t.__super__=e.prototype,t},h={}.hasOwnProperty;D=z().isObject,c=W(),i=B(),wt.exports=function(t){f(e,t);function e(o,l,b,m){var y;e.__super__.constructor.call(this,o),D(l)&&(y=l,l=y.version,b=y.encoding,m=y.standalone),l||(l="1.0"),this.type=i.Declaration,this.version=this.stringify.xmlVersion(l),b!=null&&(this.encoding=this.stringify.xmlEncoding(b)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return e.prototype.toString=function(o){return this.options.writer.declaration(this,this.options.writer.filterOptions(o))},e}(c)}).call(Tr)),wt.exports}var Tt={exports:{}},Dt={exports:{}},Dr=Dt.exports,Oe;function Gt(){return Oe||(Oe=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;c=W(),i=B(),Dt.exports=function(h){D(t,h);function t(e,o,l,b,m,y){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(l==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(o));if(!b)throw new Error("Missing DTD attribute type. "+this.debugInfo(o));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(o));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(o));if(y&&!m.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o));this.elementName=this.stringify.name(o),this.type=i.AttributeDeclaration,this.attributeName=this.stringify.name(l),this.attributeType=this.stringify.dtdAttType(b),y&&(this.defaultValue=this.stringify.dtdAttDefault(y)),this.defaultValueType=m}return t.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))},t}(c)}).call(Dr)),Dt.exports}var Et={exports:{}},Er=Et.exports,Ne;function Yt(){return Ne||(Ne=1,(function(){var i,c,D,f=function(t,e){for(var o in e)h.call(e,o)&&(t[o]=e[o]);function l(){this.constructor=t}return l.prototype=e.prototype,t.prototype=new l,t.__super__=e.prototype,t},h={}.hasOwnProperty;D=z().isObject,c=W(),i=B(),Et.exports=function(t){f(e,t);function e(o,l,b,m){if(e.__super__.constructor.call(this,o),b==null)throw new Error("Missing DTD entity name. "+this.debugInfo(b));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(b));if(this.pe=!!l,this.name=this.stringify.name(b),this.type=i.EntityDeclaration,!D(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(b));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(b));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(b))}}return Object.defineProperty(e.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(e.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(e.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(e.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(e.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(e.prototype,"xmlVersion",{get:function(){return null}}),e.prototype.toString=function(o){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(o))},e}(c)}).call(Er)),Et.exports}var bt={exports:{}},br=bt.exports,ve;function Kt(){return ve||(ve=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;c=W(),i=B(),bt.exports=function(h){D(t,h);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.name(o),this.type=i.ElementDeclaration,this.value=this.stringify.dtdElementValue(l)}return t.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))},t}(c)}).call(br)),bt.exports}var Ot={exports:{}},Or=Ot.exports,Le;function zt(){return Le||(Le=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;c=W(),i=B(),Ot.exports=function(h){D(t,h);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing DTD notation name. "+this.debugInfo(o));if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o));this.name=this.stringify.name(o),this.type=i.NotationDeclaration,l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return Object.defineProperty(t.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(t.prototype,"systemId",{get:function(){return this.sysID}}),t.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))},t}(c)}).call(Or)),Ot.exports}var Nr=Tt.exports,Ie;function Ht(){return Ie||(Ie=1,(function(){var i,c,D,f,h,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function g(){this.constructor=m}return g.prototype=y.prototype,m.prototype=new g,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=z().isObject,e=W(),i=B(),c=Gt(),f=Yt(),D=Kt(),h=zt(),t=Ut(),Tt.exports=function(m){l(y,m);function y(d,g,O){var I,x,P,E,s,a;if(y.__super__.constructor.call(this,d),this.type=i.DocType,d.children){for(E=d.children,x=0,P=E.length;x<P;x++)if(I=E[x],I.type===i.Element){this.name=I.name;break}}this.documentObject=d,o(g)&&(s=g,g=s.pubID,O=s.sysID),O==null&&(a=[g,O],O=a[0],g=a[1]),g!=null&&(this.pubID=this.stringify.dtdPubID(g)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return Object.defineProperty(y.prototype,"entities",{get:function(){var d,g,O,I,x;for(I={},x=this.children,g=0,O=x.length;g<O;g++)d=x[g],d.type===i.EntityDeclaration&&!d.pe&&(I[d.name]=d);return new t(I)}}),Object.defineProperty(y.prototype,"notations",{get:function(){var d,g,O,I,x;for(I={},x=this.children,g=0,O=x.length;g<O;g++)d=x[g],d.type===i.NotationDeclaration&&(I[d.name]=d);return new t(I)}}),Object.defineProperty(y.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(y.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(y.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),y.prototype.element=function(d,g){var O;return O=new D(this,d,g),this.children.push(O),this},y.prototype.attList=function(d,g,O,I,x){var P;return P=new c(this,d,g,O,I,x),this.children.push(P),this},y.prototype.entity=function(d,g){var O;return O=new f(this,!1,d,g),this.children.push(O),this},y.prototype.pEntity=function(d,g){var O;return O=new f(this,!0,d,g),this.children.push(O),this},y.prototype.notation=function(d,g){var O;return O=new h(this,d,g),this.children.push(O),this},y.prototype.toString=function(d){return this.options.writer.docType(this,this.options.writer.filterOptions(d))},y.prototype.ele=function(d,g){return this.element(d,g)},y.prototype.att=function(d,g,O,I,x){return this.attList(d,g,O,I,x)},y.prototype.ent=function(d,g){return this.entity(d,g)},y.prototype.pent=function(d,g){return this.pEntity(d,g)},y.prototype.not=function(d,g){return this.notation(d,g)},y.prototype.up=function(){return this.root()||this.documentObject},y.prototype.isEqualNode=function(d){return!(!y.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)||d.name!==this.name||d.publicId!==this.publicId||d.systemId!==this.systemId)},y}(e)}).call(Nr)),Tt.exports}var Nt={exports:{}},vr=Nt.exports,xe;function Qt(){return xe||(xe=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;i=B(),c=W(),Nt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=i.Raw,this.value=this.stringify.raw(o)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))},t}(c)}).call(vr)),Nt.exports}var vt={exports:{}},Lr=vt.exports,Ae;function Zt(){return Ae||(Ae=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;i=B(),c=mt(),vt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=i.Text,this.value=this.stringify.text(o)}return Object.defineProperty(t.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(t.prototype,"wholeText",{get:function(){var e,o,l;for(l="",o=this.previousSibling;o;)l=o.data+l,o=o.previousSibling;for(l+=this.data,e=this.nextSibling;e;)l=l+e.data,e=e.nextSibling;return l}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))},t.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t}(c)}).call(Lr)),vt.exports}var Lt={exports:{}},Ir=Lt.exports,Me;function Jt(){return Me||(Me=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;i=B(),c=mt(),Lt.exports=function(h){D(t,h);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=i.ProcessingInstruction,this.target=this.stringify.insTarget(o),this.name=this.target,l&&(this.value=this.stringify.insValue(l))}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))},t.prototype.isEqualNode=function(e){return!(!t.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)||e.target!==this.target)},t}(c)}).call(Ir)),Lt.exports}var It={exports:{}},xr=It.exports,Pe;function _e(){return Pe||(Pe=1,(function(){var i,c,D=function(h,t){for(var e in t)f.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},f={}.hasOwnProperty;c=W(),i=B(),It.exports=function(h){D(t,h);function t(e){t.__super__.constructor.call(this,e),this.type=i.Dummy}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return""},t}(c)}).call(xr)),It.exports}var xt={exports:{}},Ar=xt.exports,Ce;function Mr(){return Ce||(Ce=1,(function(){xt.exports=function(){function i(c){this.nodes=c}return Object.defineProperty(i.prototype,"length",{get:function(){return this.nodes.length||0}}),i.prototype.clone=function(){return this.nodes=null},i.prototype.item=function(c){return this.nodes[c]||null},i}()}).call(Ar)),xt.exports}var At={exports:{}},Pr=At.exports,Se;function _r(){return Se||(Se=1,(function(){At.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(Pr)),At.exports}var Cr=ct.exports,Xe;function W(){return Xe||(Xe=1,(function(){var i,c,D,f,h,t,e,o,l,b,m,y,d,g,O,I,x,P={}.hasOwnProperty;x=z(),I=x.isObject,O=x.isFunction,g=x.isEmpty,d=x.getValue,o=null,D=null,f=null,h=null,t=null,m=null,y=null,b=null,e=null,c=null,l=null,i=null,ct.exports=function(){function E(s){this.parent=s,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,o||(o=Vt(),D=kt(),f=$t(),h=Wt(),t=Ht(),m=Qt(),y=Zt(),b=Jt(),e=_e(),c=B(),l=Mr(),Ut(),i=_r())}return Object.defineProperty(E.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(E.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(E.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(E.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(E.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(E.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(E.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(E.prototype,"previousSibling",{get:function(){var s;return s=this.parent.children.indexOf(this),this.parent.children[s-1]||null}}),Object.defineProperty(E.prototype,"nextSibling",{get:function(){var s;return s=this.parent.children.indexOf(this),this.parent.children[s+1]||null}}),Object.defineProperty(E.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(E.prototype,"textContent",{get:function(){var s,a,p,T,L;if(this.nodeType===c.Element||this.nodeType===c.DocumentFragment){for(L="",T=this.children,a=0,p=T.length;a<p;a++)s=T[a],s.textContent&&(L+=s.textContent);return L}else return null},set:function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),E.prototype.setParent=function(s){var a,p,T,L,v;for(this.parent=s,s&&(this.options=s.options,this.stringify=s.stringify),L=this.children,v=[],p=0,T=L.length;p<T;p++)a=L[p],v.push(a.setParent(this));return v},E.prototype.element=function(s,a,p){var T,L,v,r,N,A,_,C,X,j,F;if(A=null,a===null&&p==null&&(X=[{},null],a=X[0],p=X[1]),a==null&&(a={}),a=d(a),I(a)||(j=[a,p],p=j[0],a=j[1]),s!=null&&(s=d(s)),Array.isArray(s))for(v=0,_=s.length;v<_;v++)L=s[v],A=this.element(L);else if(O(s))A=this.element(s.apply());else if(I(s)){for(N in s)if(P.call(s,N))if(F=s[N],O(F)&&(F=F.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&N.indexOf(this.stringify.convertAttKey)===0)A=this.attribute(N.substr(this.stringify.convertAttKey.length),F);else if(!this.options.separateArrayItems&&Array.isArray(F)&&g(F))A=this.dummy();else if(I(F)&&g(F))A=this.element(N);else if(!this.options.keepNullNodes&&F==null)A=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(F))for(r=0,C=F.length;r<C;r++)L=F[r],T={},T[N]=L,A=this.element(T);else I(F)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&N.indexOf(this.stringify.convertTextKey)===0?A=this.element(F):(A=this.element(N),A.element(F)):A=this.element(N,F)}else!this.options.keepNullNodes&&p===null?A=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&s.indexOf(this.stringify.convertTextKey)===0?A=this.text(p):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&s.indexOf(this.stringify.convertCDataKey)===0?A=this.cdata(p):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&s.indexOf(this.stringify.convertCommentKey)===0?A=this.comment(p):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&s.indexOf(this.stringify.convertRawKey)===0?A=this.raw(p):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&s.indexOf(this.stringify.convertPIKey)===0?A=this.instruction(s.substr(this.stringify.convertPIKey.length),p):A=this.node(s,a,p);if(A==null)throw new Error("Could not create any elements with: "+s+". "+this.debugInfo());return A},E.prototype.insertBefore=function(s,a,p){var T,L,v,r,N;if(s!=null&&s.type)return v=s,r=a,v.setParent(this),r?(L=children.indexOf(r),N=children.splice(L),children.push(v),Array.prototype.push.apply(children,N)):children.push(v),v;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(s));return L=this.parent.children.indexOf(this),N=this.parent.children.splice(L),T=this.parent.element(s,a,p),Array.prototype.push.apply(this.parent.children,N),T},E.prototype.insertAfter=function(s,a,p){var T,L,v;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(s));return L=this.parent.children.indexOf(this),v=this.parent.children.splice(L+1),T=this.parent.element(s,a,p),Array.prototype.push.apply(this.parent.children,v),T},E.prototype.remove=function(){var s;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return s=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[s,s-s+1].concat([])),this.parent},E.prototype.node=function(s,a,p){var T,L;return s!=null&&(s=d(s)),a||(a={}),a=d(a),I(a)||(L=[a,p],p=L[0],a=L[1]),T=new o(this,s,a),p!=null&&T.text(p),this.children.push(T),T},E.prototype.text=function(s){var a;return I(s)&&this.element(s),a=new y(this,s),this.children.push(a),this},E.prototype.cdata=function(s){var a;return a=new D(this,s),this.children.push(a),this},E.prototype.comment=function(s){var a;return a=new f(this,s),this.children.push(a),this},E.prototype.commentBefore=function(s){var a,p;return a=this.parent.children.indexOf(this),p=this.parent.children.splice(a),this.parent.comment(s),Array.prototype.push.apply(this.parent.children,p),this},E.prototype.commentAfter=function(s){var a,p;return a=this.parent.children.indexOf(this),p=this.parent.children.splice(a+1),this.parent.comment(s),Array.prototype.push.apply(this.parent.children,p),this},E.prototype.raw=function(s){var a;return a=new m(this,s),this.children.push(a),this},E.prototype.dummy=function(){var s;return s=new e(this),s},E.prototype.instruction=function(s,a){var p,T,L,v,r;if(s!=null&&(s=d(s)),a!=null&&(a=d(a)),Array.isArray(s))for(v=0,r=s.length;v<r;v++)p=s[v],this.instruction(p);else if(I(s))for(p in s)P.call(s,p)&&(T=s[p],this.instruction(p,T));else O(a)&&(a=a.apply()),L=new b(this,s,a),this.children.push(L);return this},E.prototype.instructionBefore=function(s,a){var p,T;return p=this.parent.children.indexOf(this),T=this.parent.children.splice(p),this.parent.instruction(s,a),Array.prototype.push.apply(this.parent.children,T),this},E.prototype.instructionAfter=function(s,a){var p,T;return p=this.parent.children.indexOf(this),T=this.parent.children.splice(p+1),this.parent.instruction(s,a),Array.prototype.push.apply(this.parent.children,T),this},E.prototype.declaration=function(s,a,p){var T,L;return T=this.document(),L=new h(T,s,a,p),T.children.length===0?T.children.unshift(L):T.children[0].type===c.Declaration?T.children[0]=L:T.children.unshift(L),T.root()||T},E.prototype.dtd=function(s,a){var p,T,L,v,r,N,A,_,C,X;for(T=this.document(),L=new t(T,s,a),C=T.children,v=r=0,A=C.length;r<A;v=++r)if(p=C[v],p.type===c.DocType)return T.children[v]=L,L;for(X=T.children,v=N=0,_=X.length;N<_;v=++N)if(p=X[v],p.isRoot)return T.children.splice(v,0,L),L;return T.children.push(L),L},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 s;for(s=this;s;){if(s.type===c.Document)return s.rootObject;if(s.isRoot)return s;s=s.parent}},E.prototype.document=function(){var s;for(s=this;s;){if(s.type===c.Document)return s;s=s.parent}},E.prototype.end=function(s){return this.document().end(s)},E.prototype.prev=function(){var s;if(s=this.parent.children.indexOf(this),s<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[s-1]},E.prototype.next=function(){var s;if(s=this.parent.children.indexOf(this),s===-1||s===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[s+1]},E.prototype.importDocument=function(s){var a;return a=s.root().clone(),a.parent=this,a.isRoot=!1,this.children.push(a),this},E.prototype.debugInfo=function(s){var a,p;return s=s||this.name,s==null&&!((a=this.parent)!=null&&a.name)?"":s==null?"parent: <"+this.parent.name+">":(p=this.parent)!=null&&p.name?"node: <"+s+">, parent: <"+this.parent.name+">":"node: <"+s+">"},E.prototype.ele=function(s,a,p){return this.element(s,a,p)},E.prototype.nod=function(s,a,p){return this.node(s,a,p)},E.prototype.txt=function(s){return this.text(s)},E.prototype.dat=function(s){return this.cdata(s)},E.prototype.com=function(s){return this.comment(s)},E.prototype.ins=function(s,a){return this.instruction(s,a)},E.prototype.doc=function(){return this.document()},E.prototype.dec=function(s,a,p){return this.declaration(s,a,p)},E.prototype.e=function(s,a,p){return this.element(s,a,p)},E.prototype.n=function(s,a,p){return this.node(s,a,p)},E.prototype.t=function(s){return this.text(s)},E.prototype.d=function(s){return this.cdata(s)},E.prototype.c=function(s){return this.comment(s)},E.prototype.r=function(s){return this.raw(s)},E.prototype.i=function(s,a){return this.instruction(s,a)},E.prototype.u=function(){return this.up()},E.prototype.importXMLBuilder=function(s){return this.importDocument(s)},E.prototype.replaceChild=function(s,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeChild=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.appendChild=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.hasChildNodes=function(){return this.children.length!==0},E.prototype.cloneNode=function(s){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(s,a){return!0},E.prototype.hasAttributes=function(){return this.attribs.length!==0},E.prototype.compareDocumentPosition=function(s){var a,p;return a=this,a===s?0:this.document()!==s.document()?(p=i.Disconnected|i.ImplementationSpecific,Math.random()<.5?p|=i.Preceding:p|=i.Following,p):a.isAncestor(s)?i.Contains|i.Preceding:a.isDescendant(s)?i.Contains|i.Following:a.isPreceding(s)?i.Preceding:i.Following},E.prototype.isSameNode=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupPrefix=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isDefaultNamespace=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupNamespaceURI=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isEqualNode=function(s){var a,p,T;if(s.nodeType!==this.nodeType||s.children.length!==this.children.length)return!1;for(a=p=0,T=this.children.length-1;0<=T?p<=T:p>=T;a=0<=T?++p:--p)if(!this.children[a].isEqualNode(s.children[a]))return!1;return!0},E.prototype.getFeature=function(s,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setUserData=function(s,a,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getUserData=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.contains=function(s){return s?s===this||this.isDescendant(s):!1},E.prototype.isDescendant=function(s){var a,p,T,L,v;for(v=this.children,T=0,L=v.length;T<L;T++)if(a=v[T],s===a||(p=a.isDescendant(s),p))return!0;return!1},E.prototype.isAncestor=function(s){return s.isDescendant(this)},E.prototype.isPreceding=function(s){var a,p;return a=this.treePosition(s),p=this.treePosition(this),a===-1||p===-1?!1:a<p},E.prototype.isFollowing=function(s){var a,p;return a=this.treePosition(s),p=this.treePosition(this),a===-1||p===-1?!1:a>p},E.prototype.treePosition=function(s){var a,p;return p=0,a=!1,this.foreachTreeNode(this.document(),function(T){if(p++,!a&&T===s)return a=!0}),a?p:-1},E.prototype.foreachTreeNode=function(s,a){var p,T,L,v,r;for(s||(s=this.document()),v=s.children,T=0,L=v.length;T<L;T++){if(p=v[T],r=a(p))return r;if(r=this.foreachTreeNode(p,a),r)return r}},E}()}).call(Cr)),ct.exports}var Mt={exports:{}},Sr=Mt.exports,Fe;function Re(){return Fe||(Fe=1,(function(){var i=function(D,f){return function(){return D.apply(f,arguments)}},c={}.hasOwnProperty;Mt.exports=function(){function D(f){this.assertLegalName=i(this.assertLegalName,this),this.assertLegalChar=i(this.assertLegalChar,this);var h,t,e;f||(f={}),this.options=f,this.options.version||(this.options.version="1.0"),t=f.stringify||{};for(h in t)c.call(t,h)&&(e=t[h],this[h]=e)}return D.prototype.name=function(f){return this.options.noValidation?f:this.assertLegalName(""+f||"")},D.prototype.text=function(f){return this.options.noValidation?f:this.assertLegalChar(this.textEscape(""+f||""))},D.prototype.cdata=function(f){return this.options.noValidation?f:(f=""+f||"",f=f.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(f))},D.prototype.comment=function(f){if(this.options.noValidation)return f;if(f=""+f||"",f.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+f);return this.assertLegalChar(f)},D.prototype.raw=function(f){return this.options.noValidation?f:""+f||""},D.prototype.attValue=function(f){return this.options.noValidation?f:this.assertLegalChar(this.attEscape(f=""+f||""))},D.prototype.insTarget=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.insValue=function(f){if(this.options.noValidation)return f;if(f=""+f||"",f.match(/\?>/))throw new Error("Invalid processing instruction value: "+f);return this.assertLegalChar(f)},D.prototype.xmlVersion=function(f){if(this.options.noValidation)return f;if(f=""+f||"",!f.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+f);return f},D.prototype.xmlEncoding=function(f){if(this.options.noValidation)return f;if(f=""+f||"",!f.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+f);return this.assertLegalChar(f)},D.prototype.xmlStandalone=function(f){return this.options.noValidation?f:f?"yes":"no"},D.prototype.dtdPubID=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdSysID=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdElementValue=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdAttType=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdAttDefault=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdEntityValue=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.dtdNData=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},D.prototype.convertAttKey="@",D.prototype.convertPIKey="?",D.prototype.convertTextKey="#text",D.prototype.convertCDataKey="#cdata",D.prototype.convertCommentKey="#comment",D.prototype.convertRawKey="#raw",D.prototype.assertLegalChar=function(f){var h,t;if(this.options.noValidation)return f;if(h="",this.options.version==="1.0"){if(h=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=f.match(h))throw new Error("Invalid character in string: "+f+" at index "+t.index)}else if(this.options.version==="1.1"&&(h=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=f.match(h)))throw new Error("Invalid character in string: "+f+" at index "+t.index);return f},D.prototype.assertLegalName=function(f){var h;if(this.options.noValidation)return f;if(this.assertLegalChar(f),h=/^([: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])*$/,!f.match(h))throw new Error("Invalid character in name");return f},D.prototype.textEscape=function(f){var h;return this.options.noValidation?f:(h=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,f.replace(h,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},D.prototype.attEscape=function(f){var h;return this.options.noValidation?f:(h=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,f.replace(h,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},D}()}).call(Sr)),Mt.exports}var Pt={exports:{}},_t={exports:{}},Ct={exports:{}},Xr=Ct.exports,je;function St(){return je||(je=1,(function(){Ct.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(Xr)),Ct.exports}var Fr=_t.exports,Be;function qe(){return Be||(Be=1,(function(){var i,c,D,f={}.hasOwnProperty;D=z().assign,i=B(),Wt(),Ht(),kt(),$t(),Vt(),Qt(),Zt(),Jt(),_e(),Gt(),Kt(),Yt(),zt(),c=St(),_t.exports=function(){function h(t){var e,o,l;t||(t={}),this.options=t,o=t.writer||{};for(e in o)f.call(o,e)&&(l=o[e],this["_"+e]=this[e],this[e]=l)}return h.prototype.filterOptions=function(t){var e,o,l,b,m,y,d,g;return t||(t={}),t=D({},this.options,t),e={writer:this},e.pretty=t.pretty||!1,e.allowEmpty=t.allowEmpty||!1,e.indent=(o=t.indent)!=null?o:" ",e.newline=(l=t.newline)!=null?l:`
|
|
3
|
-
`,e.offset=(b=t.offset)!=null?b:0,e.dontPrettyTextNodes=(m=(y=t.dontPrettyTextNodes)!=null?y:t.dontprettytextnodes)!=null?m:0,e.spaceBeforeSlash=(d=(g=t.spaceBeforeSlash)!=null?g:t.spacebeforeslash)!=null?d:"",e.spaceBeforeSlash===!0&&(e.spaceBeforeSlash=" "),e.suppressPrettyCount=0,e.user={},e.state=c.None,e},h.prototype.indent=function(t,e,o){var l;return!e.pretty||e.suppressPrettyCount?"":e.pretty&&(l=(o||0)+e.offset+1,l>0)?new Array(l).join(e.indent):""},h.prototype.endline=function(t,e,o){return!e.pretty||e.suppressPrettyCount?"":e.newline},h.prototype.attribute=function(t,e,o){var l;return this.openAttribute(t,e,o),l=" "+t.name+'="'+t.value+'"',this.closeAttribute(t,e,o),l},h.prototype.cdata=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<![CDATA[",e.state=c.InsideTag,l+=t.value,e.state=c.CloseTag,l+="]]>"+this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.comment=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<!-- ",e.state=c.InsideTag,l+=t.value,e.state=c.CloseTag,l+=" -->"+this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.declaration=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<?xml",e.state=c.InsideTag,l+=' version="'+t.version+'"',t.encoding!=null&&(l+=' encoding="'+t.encoding+'"'),t.standalone!=null&&(l+=' standalone="'+t.standalone+'"'),e.state=c.CloseTag,l+=e.spaceBeforeSlash+"?>",l+=this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.docType=function(t,e,o){var l,b,m,y,d;if(o||(o=0),this.openNode(t,e,o),e.state=c.OpenTag,y=this.indent(t,e,o),y+="<!DOCTYPE "+t.root().name,t.pubID&&t.sysID?y+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(y+=' SYSTEM "'+t.sysID+'"'),t.children.length>0){for(y+=" [",y+=this.endline(t,e,o),e.state=c.InsideTag,d=t.children,b=0,m=d.length;b<m;b++)l=d[b],y+=this.writeChildNode(l,e,o+1);e.state=c.CloseTag,y+="]"}return e.state=c.CloseTag,y+=e.spaceBeforeSlash+">",y+=this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),y},h.prototype.element=function(t,e,o){var l,b,m,y,d,g,O,I,x,P,E,s,a,p;o||(o=0),P=!1,E="",this.openNode(t,e,o),e.state=c.OpenTag,E+=this.indent(t,e,o)+"<"+t.name,s=t.attribs;for(x in s)f.call(s,x)&&(l=s[x],E+=this.attribute(l,e,o));if(m=t.children.length,y=m===0?null:t.children[0],m===0||t.children.every(function(T){return(T.type===i.Text||T.type===i.Raw)&&T.value===""}))e.allowEmpty?(E+=">",e.state=c.CloseTag,E+="</"+t.name+">"+this.endline(t,e,o)):(e.state=c.CloseTag,E+=e.spaceBeforeSlash+"/>"+this.endline(t,e,o));else if(e.pretty&&m===1&&(y.type===i.Text||y.type===i.Raw)&&y.value!=null)E+=">",e.state=c.InsideTag,e.suppressPrettyCount++,P=!0,E+=this.writeChildNode(y,e,o+1),e.suppressPrettyCount--,P=!1,e.state=c.CloseTag,E+="</"+t.name+">"+this.endline(t,e,o);else{if(e.dontPrettyTextNodes){for(a=t.children,d=0,O=a.length;d<O;d++)if(b=a[d],(b.type===i.Text||b.type===i.Raw)&&b.value!=null){e.suppressPrettyCount++,P=!0;break}}for(E+=">"+this.endline(t,e,o),e.state=c.InsideTag,p=t.children,g=0,I=p.length;g<I;g++)b=p[g],E+=this.writeChildNode(b,e,o+1);e.state=c.CloseTag,E+=this.indent(t,e,o)+"</"+t.name+">",P&&e.suppressPrettyCount--,E+=this.endline(t,e,o),e.state=c.None}return this.closeNode(t,e,o),E},h.prototype.writeChildNode=function(t,e,o){switch(t.type){case i.CData:return this.cdata(t,e,o);case i.Comment:return this.comment(t,e,o);case i.Element:return this.element(t,e,o);case i.Raw:return this.raw(t,e,o);case i.Text:return this.text(t,e,o);case i.ProcessingInstruction:return this.processingInstruction(t,e,o);case i.Dummy:return"";case i.Declaration:return this.declaration(t,e,o);case i.DocType:return this.docType(t,e,o);case i.AttributeDeclaration:return this.dtdAttList(t,e,o);case i.ElementDeclaration:return this.dtdElement(t,e,o);case i.EntityDeclaration:return this.dtdEntity(t,e,o);case i.NotationDeclaration:return this.dtdNotation(t,e,o);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},h.prototype.processingInstruction=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<?",e.state=c.InsideTag,l+=t.target,t.value&&(l+=" "+t.value),e.state=c.CloseTag,l+=e.spaceBeforeSlash+"?>",l+=this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.raw=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o),e.state=c.InsideTag,l+=t.value,e.state=c.CloseTag,l+=this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.text=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o),e.state=c.InsideTag,l+=t.value,e.state=c.CloseTag,l+=this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.dtdAttList=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<!ATTLIST",e.state=c.InsideTag,l+=" "+t.elementName+" "+t.attributeName+" "+t.attributeType,t.defaultValueType!=="#DEFAULT"&&(l+=" "+t.defaultValueType),t.defaultValue&&(l+=' "'+t.defaultValue+'"'),e.state=c.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.dtdElement=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<!ELEMENT",e.state=c.InsideTag,l+=" "+t.name+" "+t.value,e.state=c.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.dtdEntity=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<!ENTITY",e.state=c.InsideTag,t.pe&&(l+=" %"),l+=" "+t.name,t.value?l+=' "'+t.value+'"':(t.pubID&&t.sysID?l+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(l+=' SYSTEM "'+t.sysID+'"'),t.nData&&(l+=" NDATA "+t.nData)),e.state=c.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.dtdNotation=function(t,e,o){var l;return this.openNode(t,e,o),e.state=c.OpenTag,l=this.indent(t,e,o)+"<!NOTATION",e.state=c.InsideTag,l+=" "+t.name,t.pubID&&t.sysID?l+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.pubID?l+=' PUBLIC "'+t.pubID+'"':t.sysID&&(l+=' SYSTEM "'+t.sysID+'"'),e.state=c.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=c.None,this.closeNode(t,e,o),l},h.prototype.openNode=function(t,e,o){},h.prototype.closeNode=function(t,e,o){},h.prototype.openAttribute=function(t,e,o){},h.prototype.closeAttribute=function(t,e,o){},h}()}).call(Fr)),_t.exports}var Rr=Pt.exports,Ue;function te(){return Ue||(Ue=1,(function(){var i,c=function(f,h){for(var t in h)D.call(h,t)&&(f[t]=h[t]);function e(){this.constructor=f}return e.prototype=h.prototype,f.prototype=new e,f.__super__=h.prototype,f},D={}.hasOwnProperty;i=qe(),Pt.exports=function(f){c(h,f);function h(t){h.__super__.constructor.call(this,t)}return h.prototype.document=function(t,e){var o,l,b,m,y;for(e=this.filterOptions(e),m="",y=t.children,l=0,b=y.length;l<b;l++)o=y[l],m+=this.writeChildNode(o,e,0);return e.pretty&&m.slice(-e.newline.length)===e.newline&&(m=m.slice(0,-e.newline.length)),m},h}(i)}).call(Rr)),Pt.exports}var jr=ot.exports,Ve;function ke(){return Ve||(Ve=1,(function(){var i,c,D,f,h,t,e,o=function(b,m){for(var y in m)l.call(m,y)&&(b[y]=m[y]);function d(){this.constructor=b}return d.prototype=m.prototype,b.prototype=new d,b.__super__=m.prototype,b},l={}.hasOwnProperty;e=z().isPlainObject,D=le(),c=fr(),f=W(),i=B(),t=Re(),h=te(),ot.exports=function(b){o(m,b);function m(y){m.__super__.constructor.call(this,null),this.name="#document",this.type=i.Document,this.documentURI=null,this.domConfig=new c,y||(y={}),y.writer||(y.writer=new h),this.options=y,this.stringify=new t(y)}return Object.defineProperty(m.prototype,"implementation",{value:new D}),Object.defineProperty(m.prototype,"doctype",{get:function(){var y,d,g,O;for(O=this.children,d=0,g=O.length;d<g;d++)if(y=O[d],y.type===i.DocType)return y;return null}}),Object.defineProperty(m.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(m.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(m.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===i.Declaration?this.children[0].encoding:null}}),Object.defineProperty(m.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===i.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(m.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===i.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(m.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(m.prototype,"origin",{get:function(){return null}}),Object.defineProperty(m.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(m.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(m.prototype,"contentType",{get:function(){return null}}),m.prototype.end=function(y){var d;return d={},y?e(y)&&(d=y,y=this.options.writer):y=this.options.writer,y.document(this,y.filterOptions(d))},m.prototype.toString=function(y){return this.options.writer.document(this,this.options.writer.filterOptions(y))},m.prototype.createElement=function(y){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(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(y){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(y,d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(y){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(y,d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(y,d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m}(f)}).call(jr)),ot.exports}var Xt={exports:{}},Br=Xt.exports,$e;function qr(){return $e||($e=1,(function(){var i,c,D,f,h,t,e,o,l,b,m,y,d,g,O,I,x,P,E,s,a,p,T,L={}.hasOwnProperty;T=z(),a=T.isObject,s=T.isFunction,p=T.isPlainObject,E=T.getValue,i=B(),y=ke(),d=Vt(),f=kt(),h=$t(),O=Qt(),P=Zt(),g=Jt(),b=Wt(),m=Ht(),t=Gt(),o=Yt(),e=Kt(),l=zt(),D=me(),x=Re(),I=te(),c=St(),Xt.exports=function(){function v(r,N,A){var _;this.name="?xml",this.type=i.Document,r||(r={}),_={},r.writer?p(r.writer)&&(_=r.writer,r.writer=new I):r.writer=new I,this.options=r,this.writer=r.writer,this.writerOptions=this.writer.filterOptions(_),this.stringify=new x(r),this.onDataCallback=N||function(){},this.onEndCallback=A||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return v.prototype.createChildNode=function(r){var N,A,_,C,X,j,F,S;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:_={},F=r.attribs;for(A in F)L.call(F,A)&&(N=F[A],_[A]=N.value);this.node(r.name,_);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}for(S=r.children,X=0,j=S.length;X<j;X++)C=S[X],this.createChildNode(C),C.type===i.Element&&this.up();return this},v.prototype.dummy=function(){return this},v.prototype.node=function(r,N,A){var _;if(r==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(r));return this.openCurrent(),r=E(r),N==null&&(N={}),N=E(N),a(N)||(_=[N,A],A=_[0],N=_[1]),this.currentNode=new d(this,r,N),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,A!=null&&this.text(A),this},v.prototype.element=function(r,N,A){var _,C,X,j,F,S;if(this.currentNode&&this.currentNode.type===i.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(r)||a(r)||s(r))for(j=this.options.noValidation,this.options.noValidation=!0,S=new y(this.options).element("TEMP_ROOT"),S.element(r),this.options.noValidation=j,F=S.children,C=0,X=F.length;C<X;C++)_=F[C],this.createChildNode(_),_.type===i.Element&&this.up();else this.node(r,N,A);return this},v.prototype.attribute=function(r,N){var A,_;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r));if(r!=null&&(r=E(r)),a(r))for(A in r)L.call(r,A)&&(_=r[A],this.attribute(A,_));else s(N)&&(N=N.apply()),this.options.keepNullAttributes&&N==null?this.currentNode.attribs[r]=new D(this,r,""):N!=null&&(this.currentNode.attribs[r]=new D(this,r,N));return this},v.prototype.text=function(r){var N;return this.openCurrent(),N=new P(this,r),this.onData(this.writer.text(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.cdata=function(r){var N;return this.openCurrent(),N=new f(this,r),this.onData(this.writer.cdata(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.comment=function(r){var N;return this.openCurrent(),N=new h(this,r),this.onData(this.writer.comment(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.raw=function(r){var N;return this.openCurrent(),N=new O(this,r),this.onData(this.writer.raw(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.instruction=function(r,N){var A,_,C,X,j;if(this.openCurrent(),r!=null&&(r=E(r)),N!=null&&(N=E(N)),Array.isArray(r))for(A=0,X=r.length;A<X;A++)_=r[A],this.instruction(_);else if(a(r))for(_ in r)L.call(r,_)&&(C=r[_],this.instruction(_,C));else s(N)&&(N=N.apply()),j=new g(this,r,N),this.onData(this.writer.processingInstruction(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},v.prototype.declaration=function(r,N,A){var _;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return _=new b(this,r,N,A),this.onData(this.writer.declaration(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.doctype=function(r,N,A){if(this.openCurrent(),r==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 m(this,N,A),this.currentNode.rootNodeName=r,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},v.prototype.dtdElement=function(r,N){var A;return this.openCurrent(),A=new e(this,r,N),this.onData(this.writer.dtdElement(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.attList=function(r,N,A,_,C){var X;return this.openCurrent(),X=new t(this,r,N,A,_,C),this.onData(this.writer.dtdAttList(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.entity=function(r,N){var A;return this.openCurrent(),A=new o(this,!1,r,N),this.onData(this.writer.dtdEntity(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.pEntity=function(r,N){var A;return this.openCurrent(),A=new o(this,!0,r,N),this.onData(this.writer.dtdEntity(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.notation=function(r,N){var A;return this.openCurrent(),A=new l(this,r,N),this.onData(this.writer.dtdNotation(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.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},v.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},v.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},v.prototype.openNode=function(r){var N,A,_,C;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element&&(this.root=r),A="",r.type===i.Element){this.writerOptions.state=c.OpenTag,A=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name,C=r.attribs;for(_ in C)L.call(C,_)&&(N=C[_],A+=this.writer.attribute(N,this.writerOptions,this.currentLevel));A+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel),this.writerOptions.state=c.InsideTag}else this.writerOptions.state=c.OpenTag,A=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName,r.pubID&&r.sysID?A+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"':r.sysID&&(A+=' SYSTEM "'+r.sysID+'"'),r.children?(A+=" [",this.writerOptions.state=c.InsideTag):(this.writerOptions.state=c.CloseTag,A+=">"),A+=this.writer.endline(r,this.writerOptions,this.currentLevel);return this.onData(A,this.currentLevel),r.isOpen=!0}},v.prototype.closeNode=function(r){var N;if(!r.isClosed)return N="",this.writerOptions.state=c.CloseTag,r.type===i.Element?N=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel):N=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel),this.writerOptions.state=c.None,this.onData(N,this.currentLevel),r.isClosed=!0},v.prototype.onData=function(r,N){return this.documentStarted=!0,this.onDataCallback(r,N+1)},v.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},v.prototype.debugInfo=function(r){return r==null?"":"node: <"+r+">"},v.prototype.ele=function(){return this.element.apply(this,arguments)},v.prototype.nod=function(r,N,A){return this.node(r,N,A)},v.prototype.txt=function(r){return this.text(r)},v.prototype.dat=function(r){return this.cdata(r)},v.prototype.com=function(r){return this.comment(r)},v.prototype.ins=function(r,N){return this.instruction(r,N)},v.prototype.dec=function(r,N,A){return this.declaration(r,N,A)},v.prototype.dtd=function(r,N,A){return this.doctype(r,N,A)},v.prototype.e=function(r,N,A){return this.element(r,N,A)},v.prototype.n=function(r,N,A){return this.node(r,N,A)},v.prototype.t=function(r){return this.text(r)},v.prototype.d=function(r){return this.cdata(r)},v.prototype.c=function(r){return this.comment(r)},v.prototype.r=function(r){return this.raw(r)},v.prototype.i=function(r,N){return this.instruction(r,N)},v.prototype.att=function(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},v.prototype.a=function(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},v.prototype.ent=function(r,N){return this.entity(r,N)},v.prototype.pent=function(r,N){return this.pEntity(r,N)},v.prototype.not=function(r,N){return this.notation(r,N)},v}()}).call(Br)),Xt.exports}var Ft={exports:{}},Ur=Ft.exports,We;function Vr(){return We||(We=1,(function(){var i,c,D,f=function(t,e){for(var o in e)h.call(e,o)&&(t[o]=e[o]);function l(){this.constructor=t}return l.prototype=e.prototype,t.prototype=new l,t.__super__=e.prototype,t},h={}.hasOwnProperty;i=B(),D=qe(),c=St(),Ft.exports=function(t){f(e,t);function e(o,l){this.stream=o,e.__super__.constructor.call(this,l)}return e.prototype.endline=function(o,l,b){return o.isLastRootNode&&l.state===c.CloseTag?"":e.__super__.endline.call(this,o,l,b)},e.prototype.document=function(o,l){var b,m,y,d,g,O,I,x,P;for(I=o.children,m=y=0,g=I.length;y<g;m=++y)b=I[m],b.isLastRootNode=m===o.children.length-1;for(l=this.filterOptions(l),x=o.children,P=[],d=0,O=x.length;d<O;d++)b=x[d],P.push(this.writeChildNode(b,l,0));return P},e.prototype.attribute=function(o,l,b){return this.stream.write(e.__super__.attribute.call(this,o,l,b))},e.prototype.cdata=function(o,l,b){return this.stream.write(e.__super__.cdata.call(this,o,l,b))},e.prototype.comment=function(o,l,b){return this.stream.write(e.__super__.comment.call(this,o,l,b))},e.prototype.declaration=function(o,l,b){return this.stream.write(e.__super__.declaration.call(this,o,l,b))},e.prototype.docType=function(o,l,b){var m,y,d,g;if(b||(b=0),this.openNode(o,l,b),l.state=c.OpenTag,this.stream.write(this.indent(o,l,b)),this.stream.write("<!DOCTYPE "+o.root().name),o.pubID&&o.sysID?this.stream.write(' PUBLIC "'+o.pubID+'" "'+o.sysID+'"'):o.sysID&&this.stream.write(' SYSTEM "'+o.sysID+'"'),o.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(o,l,b)),l.state=c.InsideTag,g=o.children,y=0,d=g.length;y<d;y++)m=g[y],this.writeChildNode(m,l,b+1);l.state=c.CloseTag,this.stream.write("]")}return l.state=c.CloseTag,this.stream.write(l.spaceBeforeSlash+">"),this.stream.write(this.endline(o,l,b)),l.state=c.None,this.closeNode(o,l,b)},e.prototype.element=function(o,l,b){var m,y,d,g,O,I,x,P,E;b||(b=0),this.openNode(o,l,b),l.state=c.OpenTag,this.stream.write(this.indent(o,l,b)+"<"+o.name),P=o.attribs;for(x in P)h.call(P,x)&&(m=P[x],this.attribute(m,l,b));if(d=o.children.length,g=d===0?null:o.children[0],d===0||o.children.every(function(s){return(s.type===i.Text||s.type===i.Raw)&&s.value===""}))l.allowEmpty?(this.stream.write(">"),l.state=c.CloseTag,this.stream.write("</"+o.name+">")):(l.state=c.CloseTag,this.stream.write(l.spaceBeforeSlash+"/>"));else if(l.pretty&&d===1&&(g.type===i.Text||g.type===i.Raw)&&g.value!=null)this.stream.write(">"),l.state=c.InsideTag,l.suppressPrettyCount++,this.writeChildNode(g,l,b+1),l.suppressPrettyCount--,l.state=c.CloseTag,this.stream.write("</"+o.name+">");else{for(this.stream.write(">"+this.endline(o,l,b)),l.state=c.InsideTag,E=o.children,O=0,I=E.length;O<I;O++)y=E[O],this.writeChildNode(y,l,b+1);l.state=c.CloseTag,this.stream.write(this.indent(o,l,b)+"</"+o.name+">")}return this.stream.write(this.endline(o,l,b)),l.state=c.None,this.closeNode(o,l,b)},e.prototype.processingInstruction=function(o,l,b){return this.stream.write(e.__super__.processingInstruction.call(this,o,l,b))},e.prototype.raw=function(o,l,b){return this.stream.write(e.__super__.raw.call(this,o,l,b))},e.prototype.text=function(o,l,b){return this.stream.write(e.__super__.text.call(this,o,l,b))},e.prototype.dtdAttList=function(o,l,b){return this.stream.write(e.__super__.dtdAttList.call(this,o,l,b))},e.prototype.dtdElement=function(o,l,b){return this.stream.write(e.__super__.dtdElement.call(this,o,l,b))},e.prototype.dtdEntity=function(o,l,b){return this.stream.write(e.__super__.dtdEntity.call(this,o,l,b))},e.prototype.dtdNotation=function(o,l,b){return this.stream.write(e.__super__.dtdNotation.call(this,o,l,b))},e}(D)}).call(Ur)),Ft.exports}var Ge;function kr(){return Ge||(Ge=1,(function(){var i,c,D,f,h,t,e,o,l,b;b=z(),o=b.assign,l=b.isFunction,D=le(),f=ke(),h=qr(),e=te(),t=Vr(),i=B(),c=St(),Y.create=function(m,y,d,g){var O,I;if(m==null)throw new Error("Root element needs a name.");return g=o({},y,d,g),O=new f(g),I=O.element(m),g.headless||(O.declaration(g),(g.pubID!=null||g.sysID!=null)&&O.dtd(g)),I},Y.begin=function(m,y,d){var g;return l(m)&&(g=[m,y],y=g[0],d=g[1],m={}),y?new h(m,y,d):new f(m)},Y.stringWriter=function(m){return new e(m)},Y.streamWriter=function(m,y){return new t(m,y)},Y.implementation=new D,Y.nodeType=i,Y.writerState=c}).call(Y)),Y}var Ye;function $r(){return Ye||(Ye=1,(function(){var i,c,D,f,h,t={}.hasOwnProperty;i=kr(),c=qt().defaults,f=function(e){return typeof e=="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},h=function(e){return"<![CDATA["+D(e)+"]]>"},D=function(e){return e.replace("]]>","]]]]><![CDATA[>")},nt.Builder=function(){function e(o){var l,b,m;this.options={},b=c["0.2"];for(l in b)t.call(b,l)&&(m=b[l],this.options[l]=m);for(l in o)t.call(o,l)&&(m=o[l],this.options[l]=m)}return e.prototype.buildObject=function(o){var l,b,m,y,d;return l=this.options.attrkey,b=this.options.charkey,Object.keys(o).length===1&&this.options.rootName===c["0.2"].rootName?(d=Object.keys(o)[0],o=o[d]):d=this.options.rootName,m=function(g){return function(O,I){var x,P,E,s,a,p;if(typeof I!="object")g.options.cdata&&f(I)?O.raw(h(I)):O.txt(I);else if(Array.isArray(I)){for(s in I)if(t.call(I,s)){P=I[s];for(a in P)E=P[a],O=m(O.ele(a),E).up()}}else for(a in I)if(t.call(I,a))if(P=I[a],a===l){if(typeof P=="object")for(x in P)p=P[x],O=O.att(x,p)}else if(a===b)g.options.cdata&&f(P)?O=O.raw(h(P)):O=O.txt(P);else if(Array.isArray(P))for(s in P)t.call(P,s)&&(E=P[s],typeof E=="string"?g.options.cdata&&f(E)?O=O.ele(a).raw(h(E)).up():O=O.ele(a,E).up():O=m(O.ele(a),E).up());else typeof P=="object"?O=m(O.ele(a),P).up():typeof P=="string"&&g.options.cdata&&f(P)?O=O.ele(a).raw(h(P)).up():(P==null&&(P=""),O=O.ele(a,P.toString()).up());return O}}(this),y=i.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),m(y,o).end(this.options.renderOpts)},e}()}).call(nt)),nt}var Rt={},ee={};const re=et(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ke;function Wr(){return Ke||(Ke=1,function(i){(function(c){c.parser=function(u,n){return new f(u,n)},c.SAXParser=f,c.SAXStream=m,c.createStream=b,c.MAX_BUFFER_LENGTH=64*1024;var D=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];c.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function f(u,n){if(!(this instanceof f))return new f(u,n);var M=this;t(M),M.q=M.c="",M.bufferCheckPosition=c.MAX_BUFFER_LENGTH,M.opt=n||{},M.opt.lowercase=M.opt.lowercase||M.opt.lowercasetags,M.looseCase=M.opt.lowercase?"toLowerCase":"toUpperCase",M.tags=[],M.closed=M.closedRoot=M.sawRoot=!1,M.tag=M.error=null,M.strict=!!u,M.noscript=!!(u||M.opt.noscript),M.state=r.BEGIN,M.strictEntities=M.opt.strictEntities,M.ENTITIES=M.strictEntities?Object.create(c.XML_ENTITIES):Object.create(c.ENTITIES),M.attribList=[],M.opt.xmlns&&(M.ns=Object.create(I)),M.opt.unquotedAttributeValues===void 0&&(M.opt.unquotedAttributeValues=!u),M.trackPosition=M.opt.position!==!1,M.trackPosition&&(M.position=M.line=M.column=0),A(M,"onready")}Object.create||(Object.create=function(u){function n(){}n.prototype=u;var M=new n;return M}),Object.keys||(Object.keys=function(u){var n=[];for(var M in u)u.hasOwnProperty(M)&&n.push(M);return n});function h(u){for(var n=Math.max(c.MAX_BUFFER_LENGTH,10),M=0,w=0,R=D.length;w<R;w++){var q=u[D[w]].length;if(q>n)switch(D[w]){case"textNode":C(u);break;case"cdata":_(u,"oncdata",u.cdata),u.cdata="";break;case"script":_(u,"onscript",u.script),u.script="";break;default:j(u,"Max buffer length exceeded: "+D[w])}M=Math.max(M,q)}var U=c.MAX_BUFFER_LENGTH-M;u.bufferCheckPosition=U+u.position}function t(u){for(var n=0,M=D.length;n<M;n++)u[D[n]]=""}function e(u){C(u),u.cdata!==""&&(_(u,"oncdata",u.cdata),u.cdata=""),u.script!==""&&(_(u,"onscript",u.script),u.script="")}f.prototype={end:function(){F(this)},write:yn,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){e(this)}};var o;try{o=re.Stream}catch{o=function(){}}o||(o=function(){});var l=c.EVENTS.filter(function(u){return u!=="error"&&u!=="end"});function b(u,n){return new m(u,n)}function m(u,n){if(!(this instanceof m))return new m(u,n);o.apply(this),this._parser=new f(u,n),this.writable=!0,this.readable=!0;var M=this;this._parser.onend=function(){M.emit("end")},this._parser.onerror=function(w){M.emit("error",w),M._parser.error=null},this._decoder=null,l.forEach(function(w){Object.defineProperty(M,"on"+w,{get:function(){return M._parser["on"+w]},set:function(R){if(!R)return M.removeAllListeners(w),M._parser["on"+w]=R,R;M.on(w,R)},enumerable:!0,configurable:!1})})}m.prototype=Object.create(o.prototype,{constructor:{value:m}}),m.prototype.write=function(u){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(u)){if(!this._decoder){var n=re.StringDecoder;this._decoder=new n("utf8")}u=this._decoder.write(u)}return this._parser.write(u.toString()),this.emit("data",u),!0},m.prototype.end=function(u){return u&&u.length&&this.write(u),this._parser.end(),!0},m.prototype.on=function(u,n){var M=this;return!M._parser["on"+u]&&l.indexOf(u)!==-1&&(M._parser["on"+u]=function(){var w=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);w.splice(0,0,u),M.emit.apply(M,w)}),o.prototype.on.call(M,u,n)};var y="[CDATA[",d="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",I={xml:g,xmlns:O},x=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,P=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function a(u){return u===" "||u===`
|
|
4
|
-
`||u==="\r"||u===" "}function
|
|
1
|
+
(function(Q,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(Q=typeof globalThis<"u"?globalThis:Q||self,et(Q.SubstackFeedAPI={}))})(this,function(Q){"use strict";function et(i){if(i.__esModule)return i;var a=i.default;if(typeof a=="function"){var D=function p(){return this instanceof p?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};D.prototype=a.prototype}else D={};return Object.defineProperty(D,"__esModule",{value:!0}),Object.keys(i).forEach(function(p){var h=Object.getOwnPropertyDescriptor(i,p);Object.defineProperty(D,p,h.get?h:{enumerable:!0,get:function(){return i[p]}})}),D}var G={},rt={},ae;function qt(){return ae||(ae=1,(function(){rt.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:`
|
|
2
|
+
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(rt)),rt}var nt={},Y={},K={},ce;function z(){return ce||(ce=1,(function(){var i,a,D,p,h,t,e,o=[].slice,l={}.hasOwnProperty;i=function(){var b,m,y,d,g,O;if(O=arguments[0],g=2<=arguments.length?o.call(arguments,1):[],h(Object.assign))Object.assign.apply(null,arguments);else for(b=0,y=g.length;b<y;b++)if(d=g[b],d!=null)for(m in d)l.call(d,m)&&(O[m]=d[m]);return O},h=function(b){return!!b&&Object.prototype.toString.call(b)==="[object Function]"},t=function(b){var m;return!!b&&((m=typeof b)=="function"||m==="object")},D=function(b){return h(Array.isArray)?Array.isArray(b):Object.prototype.toString.call(b)==="[object Array]"},p=function(b){var m;if(D(b))return!b.length;for(m in b)if(l.call(b,m))return!1;return!0},e=function(b){var m,y;return t(b)&&(y=Object.getPrototypeOf(b))&&(m=y.constructor)&&typeof m=="function"&&m instanceof m&&Function.prototype.toString.call(m)===Function.prototype.toString.call(Object)},a=function(b){return h(b.valueOf)?b.valueOf():b},K.assign=i,K.isFunction=h,K.isObject=t,K.isArray=D,K.isEmpty=p,K.isPlainObject=e,K.getValue=a}).call(K)),K}var it={exports:{}},ur=it.exports,le;function fe(){return le||(le=1,(function(){it.exports=function(){function i(){}return i.prototype.hasFeature=function(a,D){return!0},i.prototype.createDocumentType=function(a,D,p){throw new Error("This DOM method is not implemented.")},i.prototype.createDocument=function(a,D,p){throw new Error("This DOM method is not implemented.")},i.prototype.createHTMLDocument=function(a){throw new Error("This DOM method is not implemented.")},i.prototype.getFeature=function(a,D){throw new Error("This DOM method is not implemented.")},i}()}).call(ur)),it.exports}var ot={exports:{}},st={exports:{}},ut={exports:{}},ar=ut.exports,pe;function cr(){return pe||(pe=1,(function(){ut.exports=function(){function i(){}return i.prototype.handleError=function(a){throw new Error(a)},i}()}).call(ar)),ut.exports}var at={exports:{}},lr=at.exports,he;function fr(){return he||(he=1,(function(){at.exports=function(){function i(a){this.arr=a||[]}return Object.defineProperty(i.prototype,"length",{get:function(){return this.arr.length}}),i.prototype.item=function(a){return this.arr[a]||null},i.prototype.contains=function(a){return this.arr.indexOf(a)!==-1},i}()}).call(lr)),at.exports}var pr=st.exports,de;function hr(){return de||(de=1,(function(){var i,a;i=cr(),a=fr(),st.exports=function(){function D(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new i,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=Object.create(this.defaultParams)}return Object.defineProperty(D.prototype,"parameterNames",{get:function(){return new a(Object.keys(this.defaultParams))}}),D.prototype.getParameter=function(p){return this.params.hasOwnProperty(p)?this.params[p]:null},D.prototype.canSetParameter=function(p,h){return!0},D.prototype.setParameter=function(p,h){return h!=null?this.params[p]=h:delete this.params[p]},D}()}).call(pr)),st.exports}var ct={exports:{}},lt={exports:{}},ft={exports:{}},dr=ft.exports,ye;function B(){return ye||(ye=1,(function(){ft.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(dr)),ft.exports}var pt={exports:{}},yr=pt.exports,me;function ge(){return me||(me=1,(function(){var i;i=B(),W(),pt.exports=function(){function a(D,p,h){if(this.parent=D,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),p==null)throw new Error("Missing attribute name. "+this.debugInfo(p));this.name=this.stringify.name(p),this.value=this.stringify.attValue(h),this.type=i.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(a.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(a.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(a.prototype,"textContent",{get:function(){return this.value},set:function(D){return this.value=D||""}}),Object.defineProperty(a.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(a.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(a.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(a.prototype,"specified",{get:function(){return!0}}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(D){return this.options.writer.attribute(this,this.options.writer.filterOptions(D))},a.prototype.debugInfo=function(D){return D=D||this.name,D==null?"parent: <"+this.parent.name+">":"attribute: {"+D+"}, parent: <"+this.parent.name+">"},a.prototype.isEqualNode=function(D){return!(D.namespaceURI!==this.namespaceURI||D.prefix!==this.prefix||D.localName!==this.localName||D.value!==this.value)},a}()}).call(yr)),pt.exports}var ht={exports:{}},mr=ht.exports,we;function Ut(){return we||(we=1,(function(){ht.exports=function(){function i(a){this.nodes=a}return Object.defineProperty(i.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),i.prototype.clone=function(){return this.nodes=null},i.prototype.getNamedItem=function(a){return this.nodes[a]},i.prototype.setNamedItem=function(a){var D;return D=this.nodes[a.nodeName],this.nodes[a.nodeName]=a,D||null},i.prototype.removeNamedItem=function(a){var D;return D=this.nodes[a],delete this.nodes[a],D||null},i.prototype.item=function(a){return this.nodes[Object.keys(this.nodes)[a]]||null},i.prototype.getNamedItemNS=function(a,D){throw new Error("This DOM method is not implemented.")},i.prototype.setNamedItemNS=function(a){throw new Error("This DOM method is not implemented.")},i.prototype.removeNamedItemNS=function(a,D){throw new Error("This DOM method is not implemented.")},i}()}).call(mr)),ht.exports}var gr=lt.exports,Te;function Vt(){return Te||(Te=1,(function(){var i,a,D,p,h,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function g(){this.constructor=m}return g.prototype=y.prototype,m.prototype=new g,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=z(),e=o.isObject,t=o.isFunction,h=o.getValue,p=W(),i=B(),a=ge(),D=Ut(),lt.exports=function(m){l(y,m);function y(d,g,O){var I,x,P,E;if(y.__super__.constructor.call(this,d),g==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(g),this.type=i.Element,this.attribs={},this.schemaTypeInfo=null,O!=null&&this.attribute(O),d.type===i.Document&&(this.isRoot=!0,this.documentObject=d,d.rootObject=this,d.children)){for(E=d.children,x=0,P=E.length;x<P;x++)if(I=E[x],I.type===i.DocType){I.name=this.name;break}}}return Object.defineProperty(y.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(y.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(y.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(y.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new D(this.attribs)),this.attributeMap}}),y.prototype.clone=function(){var d,g,O,I;O=Object.create(this),O.isRoot&&(O.documentObject=null),O.attribs={},I=this.attribs;for(g in I)b.call(I,g)&&(d=I[g],O.attribs[g]=d.clone());return O.children=[],this.children.forEach(function(x){var P;return P=x.clone(),P.parent=O,O.children.push(P)}),O},y.prototype.attribute=function(d,g){var O,I;if(d!=null&&(d=h(d)),e(d))for(O in d)b.call(d,O)&&(I=d[O],this.attribute(O,I));else t(g)&&(g=g.apply()),this.options.keepNullAttributes&&g==null?this.attribs[d]=new a(this,d,""):g!=null&&(this.attribs[d]=new a(this,d,g));return this},y.prototype.removeAttribute=function(d){var g,O,I;if(d==null)throw new Error("Missing attribute name. "+this.debugInfo());if(d=h(d),Array.isArray(d))for(O=0,I=d.length;O<I;O++)g=d[O],delete this.attribs[g];else delete this.attribs[d];return this},y.prototype.toString=function(d){return this.options.writer.element(this,this.options.writer.filterOptions(d))},y.prototype.att=function(d,g){return this.attribute(d,g)},y.prototype.a=function(d,g){return this.attribute(d,g)},y.prototype.getAttribute=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d].value:null},y.prototype.setAttribute=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNode=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d]:null},y.prototype.setAttributeNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNS=function(d,g,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNodeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNodeNS=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.hasAttribute=function(d){return this.attribs.hasOwnProperty(d)},y.prototype.hasAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttribute=function(d,g){return this.attribs.hasOwnProperty(d)?this.attribs[d].isId:g},y.prototype.setIdAttributeNS=function(d,g,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttributeNode=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByTagNameNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.isEqualNode=function(d){var g,O,I;if(!y.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)||d.namespaceURI!==this.namespaceURI||d.prefix!==this.prefix||d.localName!==this.localName||d.attribs.length!==this.attribs.length)return!1;for(g=O=0,I=this.attribs.length-1;0<=I?O<=I:O>=I;g=0<=I?++O:--O)if(!this.attribs[g].isEqualNode(d.attribs[g]))return!1;return!0},y}(p)}).call(gr)),lt.exports}var dt={exports:{}},yt={exports:{}},wr=yt.exports,De;function mt(){return De||(De=1,(function(){var i,a=function(p,h){for(var t in h)D.call(h,t)&&(p[t]=h[t]);function e(){this.constructor=p}return e.prototype=h.prototype,p.prototype=new e,p.__super__=h.prototype,p},D={}.hasOwnProperty;i=W(),yt.exports=function(p){a(h,p);function h(t){h.__super__.constructor.call(this,t),this.value=""}return Object.defineProperty(h.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(h.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),h.prototype.clone=function(){return Object.create(this)},h.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.replaceData=function(t,e,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.isEqualNode=function(t){return!(!h.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)||t.data!==this.data)},h}(i)}).call(wr)),yt.exports}var Tr=dt.exports,Ee;function kt(){return Ee||(Ee=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;i=B(),a=mt(),dt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=i.CData,this.value=this.stringify.cdata(o)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))},t}(a)}).call(Tr)),dt.exports}var gt={exports:{}},Dr=gt.exports,be;function $t(){return be||(be=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;i=B(),a=mt(),gt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=i.Comment,this.value=this.stringify.comment(o)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))},t}(a)}).call(Dr)),gt.exports}var wt={exports:{}},Er=wt.exports,Oe;function Wt(){return Oe||(Oe=1,(function(){var i,a,D,p=function(t,e){for(var o in e)h.call(e,o)&&(t[o]=e[o]);function l(){this.constructor=t}return l.prototype=e.prototype,t.prototype=new l,t.__super__=e.prototype,t},h={}.hasOwnProperty;D=z().isObject,a=W(),i=B(),wt.exports=function(t){p(e,t);function e(o,l,b,m){var y;e.__super__.constructor.call(this,o),D(l)&&(y=l,l=y.version,b=y.encoding,m=y.standalone),l||(l="1.0"),this.type=i.Declaration,this.version=this.stringify.xmlVersion(l),b!=null&&(this.encoding=this.stringify.xmlEncoding(b)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return e.prototype.toString=function(o){return this.options.writer.declaration(this,this.options.writer.filterOptions(o))},e}(a)}).call(Er)),wt.exports}var Tt={exports:{}},Dt={exports:{}},br=Dt.exports,Ne;function Gt(){return Ne||(Ne=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;a=W(),i=B(),Dt.exports=function(h){D(t,h);function t(e,o,l,b,m,y){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(l==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(o));if(!b)throw new Error("Missing DTD attribute type. "+this.debugInfo(o));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(o));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(o));if(y&&!m.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o));this.elementName=this.stringify.name(o),this.type=i.AttributeDeclaration,this.attributeName=this.stringify.name(l),this.attributeType=this.stringify.dtdAttType(b),y&&(this.defaultValue=this.stringify.dtdAttDefault(y)),this.defaultValueType=m}return t.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))},t}(a)}).call(br)),Dt.exports}var Et={exports:{}},Or=Et.exports,ve;function Yt(){return ve||(ve=1,(function(){var i,a,D,p=function(t,e){for(var o in e)h.call(e,o)&&(t[o]=e[o]);function l(){this.constructor=t}return l.prototype=e.prototype,t.prototype=new l,t.__super__=e.prototype,t},h={}.hasOwnProperty;D=z().isObject,a=W(),i=B(),Et.exports=function(t){p(e,t);function e(o,l,b,m){if(e.__super__.constructor.call(this,o),b==null)throw new Error("Missing DTD entity name. "+this.debugInfo(b));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(b));if(this.pe=!!l,this.name=this.stringify.name(b),this.type=i.EntityDeclaration,!D(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(b));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(b));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(b))}}return Object.defineProperty(e.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(e.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(e.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(e.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(e.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(e.prototype,"xmlVersion",{get:function(){return null}}),e.prototype.toString=function(o){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(o))},e}(a)}).call(Or)),Et.exports}var bt={exports:{}},Nr=bt.exports,Le;function Kt(){return Le||(Le=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;a=W(),i=B(),bt.exports=function(h){D(t,h);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.name(o),this.type=i.ElementDeclaration,this.value=this.stringify.dtdElementValue(l)}return t.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))},t}(a)}).call(Nr)),bt.exports}var Ot={exports:{}},vr=Ot.exports,Ie;function zt(){return Ie||(Ie=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;a=W(),i=B(),Ot.exports=function(h){D(t,h);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing DTD notation name. "+this.debugInfo(o));if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o));this.name=this.stringify.name(o),this.type=i.NotationDeclaration,l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return Object.defineProperty(t.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(t.prototype,"systemId",{get:function(){return this.sysID}}),t.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))},t}(a)}).call(vr)),Ot.exports}var Lr=Tt.exports,xe;function Ht(){return xe||(xe=1,(function(){var i,a,D,p,h,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function g(){this.constructor=m}return g.prototype=y.prototype,m.prototype=new g,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=z().isObject,e=W(),i=B(),a=Gt(),p=Yt(),D=Kt(),h=zt(),t=Ut(),Tt.exports=function(m){l(y,m);function y(d,g,O){var I,x,P,E,s,c;if(y.__super__.constructor.call(this,d),this.type=i.DocType,d.children){for(E=d.children,x=0,P=E.length;x<P;x++)if(I=E[x],I.type===i.Element){this.name=I.name;break}}this.documentObject=d,o(g)&&(s=g,g=s.pubID,O=s.sysID),O==null&&(c=[g,O],O=c[0],g=c[1]),g!=null&&(this.pubID=this.stringify.dtdPubID(g)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return Object.defineProperty(y.prototype,"entities",{get:function(){var d,g,O,I,x;for(I={},x=this.children,g=0,O=x.length;g<O;g++)d=x[g],d.type===i.EntityDeclaration&&!d.pe&&(I[d.name]=d);return new t(I)}}),Object.defineProperty(y.prototype,"notations",{get:function(){var d,g,O,I,x;for(I={},x=this.children,g=0,O=x.length;g<O;g++)d=x[g],d.type===i.NotationDeclaration&&(I[d.name]=d);return new t(I)}}),Object.defineProperty(y.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(y.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(y.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),y.prototype.element=function(d,g){var O;return O=new D(this,d,g),this.children.push(O),this},y.prototype.attList=function(d,g,O,I,x){var P;return P=new a(this,d,g,O,I,x),this.children.push(P),this},y.prototype.entity=function(d,g){var O;return O=new p(this,!1,d,g),this.children.push(O),this},y.prototype.pEntity=function(d,g){var O;return O=new p(this,!0,d,g),this.children.push(O),this},y.prototype.notation=function(d,g){var O;return O=new h(this,d,g),this.children.push(O),this},y.prototype.toString=function(d){return this.options.writer.docType(this,this.options.writer.filterOptions(d))},y.prototype.ele=function(d,g){return this.element(d,g)},y.prototype.att=function(d,g,O,I,x){return this.attList(d,g,O,I,x)},y.prototype.ent=function(d,g){return this.entity(d,g)},y.prototype.pent=function(d,g){return this.pEntity(d,g)},y.prototype.not=function(d,g){return this.notation(d,g)},y.prototype.up=function(){return this.root()||this.documentObject},y.prototype.isEqualNode=function(d){return!(!y.__super__.isEqualNode.apply(this,arguments).isEqualNode(d)||d.name!==this.name||d.publicId!==this.publicId||d.systemId!==this.systemId)},y}(e)}).call(Lr)),Tt.exports}var Nt={exports:{}},Ir=Nt.exports,Ae;function Qt(){return Ae||(Ae=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;i=B(),a=W(),Nt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=i.Raw,this.value=this.stringify.raw(o)}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))},t}(a)}).call(Ir)),Nt.exports}var vt={exports:{}},xr=vt.exports,Me;function Zt(){return Me||(Me=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;i=B(),a=mt(),vt.exports=function(h){D(t,h);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=i.Text,this.value=this.stringify.text(o)}return Object.defineProperty(t.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(t.prototype,"wholeText",{get:function(){var e,o,l;for(l="",o=this.previousSibling;o;)l=o.data+l,o=o.previousSibling;for(l+=this.data,e=this.nextSibling;e;)l=l+e.data,e=e.nextSibling;return l}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))},t.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t}(a)}).call(xr)),vt.exports}var Lt={exports:{}},Ar=Lt.exports,Pe;function Jt(){return Pe||(Pe=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;i=B(),a=mt(),Lt.exports=function(h){D(t,h);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=i.ProcessingInstruction,this.target=this.stringify.insTarget(o),this.name=this.target,l&&(this.value=this.stringify.insValue(l))}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))},t.prototype.isEqualNode=function(e){return!(!t.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)||e.target!==this.target)},t}(a)}).call(Ar)),Lt.exports}var It={exports:{}},Mr=It.exports,_e;function Ce(){return _e||(_e=1,(function(){var i,a,D=function(h,t){for(var e in t)p.call(t,e)&&(h[e]=t[e]);function o(){this.constructor=h}return o.prototype=t.prototype,h.prototype=new o,h.__super__=t.prototype,h},p={}.hasOwnProperty;a=W(),i=B(),It.exports=function(h){D(t,h);function t(e){t.__super__.constructor.call(this,e),this.type=i.Dummy}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return""},t}(a)}).call(Mr)),It.exports}var xt={exports:{}},Pr=xt.exports,Se;function _r(){return Se||(Se=1,(function(){xt.exports=function(){function i(a){this.nodes=a}return Object.defineProperty(i.prototype,"length",{get:function(){return this.nodes.length||0}}),i.prototype.clone=function(){return this.nodes=null},i.prototype.item=function(a){return this.nodes[a]||null},i}()}).call(Pr)),xt.exports}var At={exports:{}},Cr=At.exports,Fe;function Sr(){return Fe||(Fe=1,(function(){At.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(Cr)),At.exports}var Fr=ct.exports,Xe;function W(){return Xe||(Xe=1,(function(){var i,a,D,p,h,t,e,o,l,b,m,y,d,g,O,I,x,P={}.hasOwnProperty;x=z(),I=x.isObject,O=x.isFunction,g=x.isEmpty,d=x.getValue,o=null,D=null,p=null,h=null,t=null,m=null,y=null,b=null,e=null,a=null,l=null,i=null,ct.exports=function(){function E(s){this.parent=s,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,o||(o=Vt(),D=kt(),p=$t(),h=Wt(),t=Ht(),m=Qt(),y=Zt(),b=Jt(),e=Ce(),a=B(),l=_r(),Ut(),i=Sr())}return Object.defineProperty(E.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(E.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(E.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(E.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(E.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(E.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(E.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(E.prototype,"previousSibling",{get:function(){var s;return s=this.parent.children.indexOf(this),this.parent.children[s-1]||null}}),Object.defineProperty(E.prototype,"nextSibling",{get:function(){var s;return s=this.parent.children.indexOf(this),this.parent.children[s+1]||null}}),Object.defineProperty(E.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(E.prototype,"textContent",{get:function(){var s,c,f,T,L;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){for(L="",T=this.children,c=0,f=T.length;c<f;c++)s=T[c],s.textContent&&(L+=s.textContent);return L}else return null},set:function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),E.prototype.setParent=function(s){var c,f,T,L,v;for(this.parent=s,s&&(this.options=s.options,this.stringify=s.stringify),L=this.children,v=[],f=0,T=L.length;f<T;f++)c=L[f],v.push(c.setParent(this));return v},E.prototype.element=function(s,c,f){var T,L,v,r,N,A,_,C,F,j,X;if(A=null,c===null&&f==null&&(F=[{},null],c=F[0],f=F[1]),c==null&&(c={}),c=d(c),I(c)||(j=[c,f],f=j[0],c=j[1]),s!=null&&(s=d(s)),Array.isArray(s))for(v=0,_=s.length;v<_;v++)L=s[v],A=this.element(L);else if(O(s))A=this.element(s.apply());else if(I(s)){for(N in s)if(P.call(s,N))if(X=s[N],O(X)&&(X=X.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&N.indexOf(this.stringify.convertAttKey)===0)A=this.attribute(N.substr(this.stringify.convertAttKey.length),X);else if(!this.options.separateArrayItems&&Array.isArray(X)&&g(X))A=this.dummy();else if(I(X)&&g(X))A=this.element(N);else if(!this.options.keepNullNodes&&X==null)A=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(X))for(r=0,C=X.length;r<C;r++)L=X[r],T={},T[N]=L,A=this.element(T);else I(X)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&N.indexOf(this.stringify.convertTextKey)===0?A=this.element(X):(A=this.element(N),A.element(X)):A=this.element(N,X)}else!this.options.keepNullNodes&&f===null?A=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&s.indexOf(this.stringify.convertTextKey)===0?A=this.text(f):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&s.indexOf(this.stringify.convertCDataKey)===0?A=this.cdata(f):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&s.indexOf(this.stringify.convertCommentKey)===0?A=this.comment(f):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&s.indexOf(this.stringify.convertRawKey)===0?A=this.raw(f):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&s.indexOf(this.stringify.convertPIKey)===0?A=this.instruction(s.substr(this.stringify.convertPIKey.length),f):A=this.node(s,c,f);if(A==null)throw new Error("Could not create any elements with: "+s+". "+this.debugInfo());return A},E.prototype.insertBefore=function(s,c,f){var T,L,v,r,N;if(s!=null&&s.type)return v=s,r=c,v.setParent(this),r?(L=children.indexOf(r),N=children.splice(L),children.push(v),Array.prototype.push.apply(children,N)):children.push(v),v;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(s));return L=this.parent.children.indexOf(this),N=this.parent.children.splice(L),T=this.parent.element(s,c,f),Array.prototype.push.apply(this.parent.children,N),T},E.prototype.insertAfter=function(s,c,f){var T,L,v;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(s));return L=this.parent.children.indexOf(this),v=this.parent.children.splice(L+1),T=this.parent.element(s,c,f),Array.prototype.push.apply(this.parent.children,v),T},E.prototype.remove=function(){var s;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return s=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[s,s-s+1].concat([])),this.parent},E.prototype.node=function(s,c,f){var T,L;return s!=null&&(s=d(s)),c||(c={}),c=d(c),I(c)||(L=[c,f],f=L[0],c=L[1]),T=new o(this,s,c),f!=null&&T.text(f),this.children.push(T),T},E.prototype.text=function(s){var c;return I(s)&&this.element(s),c=new y(this,s),this.children.push(c),this},E.prototype.cdata=function(s){var c;return c=new D(this,s),this.children.push(c),this},E.prototype.comment=function(s){var c;return c=new p(this,s),this.children.push(c),this},E.prototype.commentBefore=function(s){var c,f;return c=this.parent.children.indexOf(this),f=this.parent.children.splice(c),this.parent.comment(s),Array.prototype.push.apply(this.parent.children,f),this},E.prototype.commentAfter=function(s){var c,f;return c=this.parent.children.indexOf(this),f=this.parent.children.splice(c+1),this.parent.comment(s),Array.prototype.push.apply(this.parent.children,f),this},E.prototype.raw=function(s){var c;return c=new m(this,s),this.children.push(c),this},E.prototype.dummy=function(){var s;return s=new e(this),s},E.prototype.instruction=function(s,c){var f,T,L,v,r;if(s!=null&&(s=d(s)),c!=null&&(c=d(c)),Array.isArray(s))for(v=0,r=s.length;v<r;v++)f=s[v],this.instruction(f);else if(I(s))for(f in s)P.call(s,f)&&(T=s[f],this.instruction(f,T));else O(c)&&(c=c.apply()),L=new b(this,s,c),this.children.push(L);return this},E.prototype.instructionBefore=function(s,c){var f,T;return f=this.parent.children.indexOf(this),T=this.parent.children.splice(f),this.parent.instruction(s,c),Array.prototype.push.apply(this.parent.children,T),this},E.prototype.instructionAfter=function(s,c){var f,T;return f=this.parent.children.indexOf(this),T=this.parent.children.splice(f+1),this.parent.instruction(s,c),Array.prototype.push.apply(this.parent.children,T),this},E.prototype.declaration=function(s,c,f){var T,L;return T=this.document(),L=new h(T,s,c,f),T.children.length===0?T.children.unshift(L):T.children[0].type===a.Declaration?T.children[0]=L:T.children.unshift(L),T.root()||T},E.prototype.dtd=function(s,c){var f,T,L,v,r,N,A,_,C,F;for(T=this.document(),L=new t(T,s,c),C=T.children,v=r=0,A=C.length;r<A;v=++r)if(f=C[v],f.type===a.DocType)return T.children[v]=L,L;for(F=T.children,v=N=0,_=F.length;N<_;v=++N)if(f=F[v],f.isRoot)return T.children.splice(v,0,L),L;return T.children.push(L),L},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 s;for(s=this;s;){if(s.type===a.Document)return s.rootObject;if(s.isRoot)return s;s=s.parent}},E.prototype.document=function(){var s;for(s=this;s;){if(s.type===a.Document)return s;s=s.parent}},E.prototype.end=function(s){return this.document().end(s)},E.prototype.prev=function(){var s;if(s=this.parent.children.indexOf(this),s<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[s-1]},E.prototype.next=function(){var s;if(s=this.parent.children.indexOf(this),s===-1||s===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[s+1]},E.prototype.importDocument=function(s){var c;return c=s.root().clone(),c.parent=this,c.isRoot=!1,this.children.push(c),this},E.prototype.debugInfo=function(s){var c,f;return s=s||this.name,s==null&&!((c=this.parent)!=null&&c.name)?"":s==null?"parent: <"+this.parent.name+">":(f=this.parent)!=null&&f.name?"node: <"+s+">, parent: <"+this.parent.name+">":"node: <"+s+">"},E.prototype.ele=function(s,c,f){return this.element(s,c,f)},E.prototype.nod=function(s,c,f){return this.node(s,c,f)},E.prototype.txt=function(s){return this.text(s)},E.prototype.dat=function(s){return this.cdata(s)},E.prototype.com=function(s){return this.comment(s)},E.prototype.ins=function(s,c){return this.instruction(s,c)},E.prototype.doc=function(){return this.document()},E.prototype.dec=function(s,c,f){return this.declaration(s,c,f)},E.prototype.e=function(s,c,f){return this.element(s,c,f)},E.prototype.n=function(s,c,f){return this.node(s,c,f)},E.prototype.t=function(s){return this.text(s)},E.prototype.d=function(s){return this.cdata(s)},E.prototype.c=function(s){return this.comment(s)},E.prototype.r=function(s){return this.raw(s)},E.prototype.i=function(s,c){return this.instruction(s,c)},E.prototype.u=function(){return this.up()},E.prototype.importXMLBuilder=function(s){return this.importDocument(s)},E.prototype.replaceChild=function(s,c){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeChild=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.appendChild=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.hasChildNodes=function(){return this.children.length!==0},E.prototype.cloneNode=function(s){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(s,c){return!0},E.prototype.hasAttributes=function(){return this.attribs.length!==0},E.prototype.compareDocumentPosition=function(s){var c,f;return c=this,c===s?0:this.document()!==s.document()?(f=i.Disconnected|i.ImplementationSpecific,Math.random()<.5?f|=i.Preceding:f|=i.Following,f):c.isAncestor(s)?i.Contains|i.Preceding:c.isDescendant(s)?i.Contains|i.Following:c.isPreceding(s)?i.Preceding:i.Following},E.prototype.isSameNode=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupPrefix=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isDefaultNamespace=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupNamespaceURI=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isEqualNode=function(s){var c,f,T;if(s.nodeType!==this.nodeType||s.children.length!==this.children.length)return!1;for(c=f=0,T=this.children.length-1;0<=T?f<=T:f>=T;c=0<=T?++f:--f)if(!this.children[c].isEqualNode(s.children[c]))return!1;return!0},E.prototype.getFeature=function(s,c){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setUserData=function(s,c,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getUserData=function(s){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.contains=function(s){return s?s===this||this.isDescendant(s):!1},E.prototype.isDescendant=function(s){var c,f,T,L,v;for(v=this.children,T=0,L=v.length;T<L;T++)if(c=v[T],s===c||(f=c.isDescendant(s),f))return!0;return!1},E.prototype.isAncestor=function(s){return s.isDescendant(this)},E.prototype.isPreceding=function(s){var c,f;return c=this.treePosition(s),f=this.treePosition(this),c===-1||f===-1?!1:c<f},E.prototype.isFollowing=function(s){var c,f;return c=this.treePosition(s),f=this.treePosition(this),c===-1||f===-1?!1:c>f},E.prototype.treePosition=function(s){var c,f;return f=0,c=!1,this.foreachTreeNode(this.document(),function(T){if(f++,!c&&T===s)return c=!0}),c?f:-1},E.prototype.foreachTreeNode=function(s,c){var f,T,L,v,r;for(s||(s=this.document()),v=s.children,T=0,L=v.length;T<L;T++){if(f=v[T],r=c(f))return r;if(r=this.foreachTreeNode(f,c),r)return r}},E}()}).call(Fr)),ct.exports}var Mt={exports:{}},Xr=Mt.exports,Re;function je(){return Re||(Re=1,(function(){var i=function(D,p){return function(){return D.apply(p,arguments)}},a={}.hasOwnProperty;Mt.exports=function(){function D(p){this.assertLegalName=i(this.assertLegalName,this),this.assertLegalChar=i(this.assertLegalChar,this);var h,t,e;p||(p={}),this.options=p,this.options.version||(this.options.version="1.0"),t=p.stringify||{};for(h in t)a.call(t,h)&&(e=t[h],this[h]=e)}return D.prototype.name=function(p){return this.options.noValidation?p:this.assertLegalName(""+p||"")},D.prototype.text=function(p){return this.options.noValidation?p:this.assertLegalChar(this.textEscape(""+p||""))},D.prototype.cdata=function(p){return this.options.noValidation?p:(p=""+p||"",p=p.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(p))},D.prototype.comment=function(p){if(this.options.noValidation)return p;if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},D.prototype.raw=function(p){return this.options.noValidation?p:""+p||""},D.prototype.attValue=function(p){return this.options.noValidation?p:this.assertLegalChar(this.attEscape(p=""+p||""))},D.prototype.insTarget=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.insValue=function(p){if(this.options.noValidation)return p;if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return this.assertLegalChar(p)},D.prototype.xmlVersion=function(p){if(this.options.noValidation)return p;if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},D.prototype.xmlEncoding=function(p){if(this.options.noValidation)return p;if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return this.assertLegalChar(p)},D.prototype.xmlStandalone=function(p){return this.options.noValidation?p:p?"yes":"no"},D.prototype.dtdPubID=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.dtdSysID=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.dtdElementValue=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.dtdAttType=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.dtdAttDefault=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.dtdEntityValue=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.dtdNData=function(p){return this.options.noValidation?p:this.assertLegalChar(""+p||"")},D.prototype.convertAttKey="@",D.prototype.convertPIKey="?",D.prototype.convertTextKey="#text",D.prototype.convertCDataKey="#cdata",D.prototype.convertCommentKey="#comment",D.prototype.convertRawKey="#raw",D.prototype.assertLegalChar=function(p){var h,t;if(this.options.noValidation)return p;if(h="",this.options.version==="1.0"){if(h=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=p.match(h))throw new Error("Invalid character in string: "+p+" at index "+t.index)}else if(this.options.version==="1.1"&&(h=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=p.match(h)))throw new Error("Invalid character in string: "+p+" at index "+t.index);return p},D.prototype.assertLegalName=function(p){var h;if(this.options.noValidation)return p;if(this.assertLegalChar(p),h=/^([: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])*$/,!p.match(h))throw new Error("Invalid character in name");return p},D.prototype.textEscape=function(p){var h;return this.options.noValidation?p:(h=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(h,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},D.prototype.attEscape=function(p){var h;return this.options.noValidation?p:(h=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(h,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},D}()}).call(Xr)),Mt.exports}var Pt={exports:{}},_t={exports:{}},Ct={exports:{}},Rr=Ct.exports,Be;function St(){return Be||(Be=1,(function(){Ct.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(Rr)),Ct.exports}var jr=_t.exports,qe;function Ue(){return qe||(qe=1,(function(){var i,a,D,p={}.hasOwnProperty;D=z().assign,i=B(),Wt(),Ht(),kt(),$t(),Vt(),Qt(),Zt(),Jt(),Ce(),Gt(),Kt(),Yt(),zt(),a=St(),_t.exports=function(){function h(t){var e,o,l;t||(t={}),this.options=t,o=t.writer||{};for(e in o)p.call(o,e)&&(l=o[e],this["_"+e]=this[e],this[e]=l)}return h.prototype.filterOptions=function(t){var e,o,l,b,m,y,d,g;return t||(t={}),t=D({},this.options,t),e={writer:this},e.pretty=t.pretty||!1,e.allowEmpty=t.allowEmpty||!1,e.indent=(o=t.indent)!=null?o:" ",e.newline=(l=t.newline)!=null?l:`
|
|
3
|
+
`,e.offset=(b=t.offset)!=null?b:0,e.dontPrettyTextNodes=(m=(y=t.dontPrettyTextNodes)!=null?y:t.dontprettytextnodes)!=null?m:0,e.spaceBeforeSlash=(d=(g=t.spaceBeforeSlash)!=null?g:t.spacebeforeslash)!=null?d:"",e.spaceBeforeSlash===!0&&(e.spaceBeforeSlash=" "),e.suppressPrettyCount=0,e.user={},e.state=a.None,e},h.prototype.indent=function(t,e,o){var l;return!e.pretty||e.suppressPrettyCount?"":e.pretty&&(l=(o||0)+e.offset+1,l>0)?new Array(l).join(e.indent):""},h.prototype.endline=function(t,e,o){return!e.pretty||e.suppressPrettyCount?"":e.newline},h.prototype.attribute=function(t,e,o){var l;return this.openAttribute(t,e,o),l=" "+t.name+'="'+t.value+'"',this.closeAttribute(t,e,o),l},h.prototype.cdata=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<![CDATA[",e.state=a.InsideTag,l+=t.value,e.state=a.CloseTag,l+="]]>"+this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.comment=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<!-- ",e.state=a.InsideTag,l+=t.value,e.state=a.CloseTag,l+=" -->"+this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.declaration=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<?xml",e.state=a.InsideTag,l+=' version="'+t.version+'"',t.encoding!=null&&(l+=' encoding="'+t.encoding+'"'),t.standalone!=null&&(l+=' standalone="'+t.standalone+'"'),e.state=a.CloseTag,l+=e.spaceBeforeSlash+"?>",l+=this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.docType=function(t,e,o){var l,b,m,y,d;if(o||(o=0),this.openNode(t,e,o),e.state=a.OpenTag,y=this.indent(t,e,o),y+="<!DOCTYPE "+t.root().name,t.pubID&&t.sysID?y+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(y+=' SYSTEM "'+t.sysID+'"'),t.children.length>0){for(y+=" [",y+=this.endline(t,e,o),e.state=a.InsideTag,d=t.children,b=0,m=d.length;b<m;b++)l=d[b],y+=this.writeChildNode(l,e,o+1);e.state=a.CloseTag,y+="]"}return e.state=a.CloseTag,y+=e.spaceBeforeSlash+">",y+=this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),y},h.prototype.element=function(t,e,o){var l,b,m,y,d,g,O,I,x,P,E,s,c,f;o||(o=0),P=!1,E="",this.openNode(t,e,o),e.state=a.OpenTag,E+=this.indent(t,e,o)+"<"+t.name,s=t.attribs;for(x in s)p.call(s,x)&&(l=s[x],E+=this.attribute(l,e,o));if(m=t.children.length,y=m===0?null:t.children[0],m===0||t.children.every(function(T){return(T.type===i.Text||T.type===i.Raw)&&T.value===""}))e.allowEmpty?(E+=">",e.state=a.CloseTag,E+="</"+t.name+">"+this.endline(t,e,o)):(e.state=a.CloseTag,E+=e.spaceBeforeSlash+"/>"+this.endline(t,e,o));else if(e.pretty&&m===1&&(y.type===i.Text||y.type===i.Raw)&&y.value!=null)E+=">",e.state=a.InsideTag,e.suppressPrettyCount++,P=!0,E+=this.writeChildNode(y,e,o+1),e.suppressPrettyCount--,P=!1,e.state=a.CloseTag,E+="</"+t.name+">"+this.endline(t,e,o);else{if(e.dontPrettyTextNodes){for(c=t.children,d=0,O=c.length;d<O;d++)if(b=c[d],(b.type===i.Text||b.type===i.Raw)&&b.value!=null){e.suppressPrettyCount++,P=!0;break}}for(E+=">"+this.endline(t,e,o),e.state=a.InsideTag,f=t.children,g=0,I=f.length;g<I;g++)b=f[g],E+=this.writeChildNode(b,e,o+1);e.state=a.CloseTag,E+=this.indent(t,e,o)+"</"+t.name+">",P&&e.suppressPrettyCount--,E+=this.endline(t,e,o),e.state=a.None}return this.closeNode(t,e,o),E},h.prototype.writeChildNode=function(t,e,o){switch(t.type){case i.CData:return this.cdata(t,e,o);case i.Comment:return this.comment(t,e,o);case i.Element:return this.element(t,e,o);case i.Raw:return this.raw(t,e,o);case i.Text:return this.text(t,e,o);case i.ProcessingInstruction:return this.processingInstruction(t,e,o);case i.Dummy:return"";case i.Declaration:return this.declaration(t,e,o);case i.DocType:return this.docType(t,e,o);case i.AttributeDeclaration:return this.dtdAttList(t,e,o);case i.ElementDeclaration:return this.dtdElement(t,e,o);case i.EntityDeclaration:return this.dtdEntity(t,e,o);case i.NotationDeclaration:return this.dtdNotation(t,e,o);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},h.prototype.processingInstruction=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<?",e.state=a.InsideTag,l+=t.target,t.value&&(l+=" "+t.value),e.state=a.CloseTag,l+=e.spaceBeforeSlash+"?>",l+=this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.raw=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o),e.state=a.InsideTag,l+=t.value,e.state=a.CloseTag,l+=this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.text=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o),e.state=a.InsideTag,l+=t.value,e.state=a.CloseTag,l+=this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.dtdAttList=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<!ATTLIST",e.state=a.InsideTag,l+=" "+t.elementName+" "+t.attributeName+" "+t.attributeType,t.defaultValueType!=="#DEFAULT"&&(l+=" "+t.defaultValueType),t.defaultValue&&(l+=' "'+t.defaultValue+'"'),e.state=a.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.dtdElement=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<!ELEMENT",e.state=a.InsideTag,l+=" "+t.name+" "+t.value,e.state=a.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.dtdEntity=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<!ENTITY",e.state=a.InsideTag,t.pe&&(l+=" %"),l+=" "+t.name,t.value?l+=' "'+t.value+'"':(t.pubID&&t.sysID?l+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(l+=' SYSTEM "'+t.sysID+'"'),t.nData&&(l+=" NDATA "+t.nData)),e.state=a.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.dtdNotation=function(t,e,o){var l;return this.openNode(t,e,o),e.state=a.OpenTag,l=this.indent(t,e,o)+"<!NOTATION",e.state=a.InsideTag,l+=" "+t.name,t.pubID&&t.sysID?l+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.pubID?l+=' PUBLIC "'+t.pubID+'"':t.sysID&&(l+=' SYSTEM "'+t.sysID+'"'),e.state=a.CloseTag,l+=e.spaceBeforeSlash+">"+this.endline(t,e,o),e.state=a.None,this.closeNode(t,e,o),l},h.prototype.openNode=function(t,e,o){},h.prototype.closeNode=function(t,e,o){},h.prototype.openAttribute=function(t,e,o){},h.prototype.closeAttribute=function(t,e,o){},h}()}).call(jr)),_t.exports}var Br=Pt.exports,Ve;function te(){return Ve||(Ve=1,(function(){var i,a=function(p,h){for(var t in h)D.call(h,t)&&(p[t]=h[t]);function e(){this.constructor=p}return e.prototype=h.prototype,p.prototype=new e,p.__super__=h.prototype,p},D={}.hasOwnProperty;i=Ue(),Pt.exports=function(p){a(h,p);function h(t){h.__super__.constructor.call(this,t)}return h.prototype.document=function(t,e){var o,l,b,m,y;for(e=this.filterOptions(e),m="",y=t.children,l=0,b=y.length;l<b;l++)o=y[l],m+=this.writeChildNode(o,e,0);return e.pretty&&m.slice(-e.newline.length)===e.newline&&(m=m.slice(0,-e.newline.length)),m},h}(i)}).call(Br)),Pt.exports}var qr=ot.exports,ke;function $e(){return ke||(ke=1,(function(){var i,a,D,p,h,t,e,o=function(b,m){for(var y in m)l.call(m,y)&&(b[y]=m[y]);function d(){this.constructor=b}return d.prototype=m.prototype,b.prototype=new d,b.__super__=m.prototype,b},l={}.hasOwnProperty;e=z().isPlainObject,D=fe(),a=hr(),p=W(),i=B(),t=je(),h=te(),ot.exports=function(b){o(m,b);function m(y){m.__super__.constructor.call(this,null),this.name="#document",this.type=i.Document,this.documentURI=null,this.domConfig=new a,y||(y={}),y.writer||(y.writer=new h),this.options=y,this.stringify=new t(y)}return Object.defineProperty(m.prototype,"implementation",{value:new D}),Object.defineProperty(m.prototype,"doctype",{get:function(){var y,d,g,O;for(O=this.children,d=0,g=O.length;d<g;d++)if(y=O[d],y.type===i.DocType)return y;return null}}),Object.defineProperty(m.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(m.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(m.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===i.Declaration?this.children[0].encoding:null}}),Object.defineProperty(m.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===i.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(m.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===i.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(m.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(m.prototype,"origin",{get:function(){return null}}),Object.defineProperty(m.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(m.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(m.prototype,"contentType",{get:function(){return null}}),m.prototype.end=function(y){var d;return d={},y?e(y)&&(d=y,y=this.options.writer):y=this.options.writer,y.document(this,y.filterOptions(d))},m.prototype.toString=function(y){return this.options.writer.document(this,this.options.writer.filterOptions(y))},m.prototype.createElement=function(y){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(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(y,d){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(y){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(y,d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(y){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(y,d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(y,d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m}(p)}).call(qr)),ot.exports}var Ft={exports:{}},Ur=Ft.exports,We;function Vr(){return We||(We=1,(function(){var i,a,D,p,h,t,e,o,l,b,m,y,d,g,O,I,x,P,E,s,c,f,T,L={}.hasOwnProperty;T=z(),c=T.isObject,s=T.isFunction,f=T.isPlainObject,E=T.getValue,i=B(),y=$e(),d=Vt(),p=kt(),h=$t(),O=Qt(),P=Zt(),g=Jt(),b=Wt(),m=Ht(),t=Gt(),o=Yt(),e=Kt(),l=zt(),D=ge(),x=je(),I=te(),a=St(),Ft.exports=function(){function v(r,N,A){var _;this.name="?xml",this.type=i.Document,r||(r={}),_={},r.writer?f(r.writer)&&(_=r.writer,r.writer=new I):r.writer=new I,this.options=r,this.writer=r.writer,this.writerOptions=this.writer.filterOptions(_),this.stringify=new x(r),this.onDataCallback=N||function(){},this.onEndCallback=A||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return v.prototype.createChildNode=function(r){var N,A,_,C,F,j,X,S;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:_={},X=r.attribs;for(A in X)L.call(X,A)&&(N=X[A],_[A]=N.value);this.node(r.name,_);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}for(S=r.children,F=0,j=S.length;F<j;F++)C=S[F],this.createChildNode(C),C.type===i.Element&&this.up();return this},v.prototype.dummy=function(){return this},v.prototype.node=function(r,N,A){var _;if(r==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(r));return this.openCurrent(),r=E(r),N==null&&(N={}),N=E(N),c(N)||(_=[N,A],A=_[0],N=_[1]),this.currentNode=new d(this,r,N),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,A!=null&&this.text(A),this},v.prototype.element=function(r,N,A){var _,C,F,j,X,S;if(this.currentNode&&this.currentNode.type===i.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(r)||c(r)||s(r))for(j=this.options.noValidation,this.options.noValidation=!0,S=new y(this.options).element("TEMP_ROOT"),S.element(r),this.options.noValidation=j,X=S.children,C=0,F=X.length;C<F;C++)_=X[C],this.createChildNode(_),_.type===i.Element&&this.up();else this.node(r,N,A);return this},v.prototype.attribute=function(r,N){var A,_;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r));if(r!=null&&(r=E(r)),c(r))for(A in r)L.call(r,A)&&(_=r[A],this.attribute(A,_));else s(N)&&(N=N.apply()),this.options.keepNullAttributes&&N==null?this.currentNode.attribs[r]=new D(this,r,""):N!=null&&(this.currentNode.attribs[r]=new D(this,r,N));return this},v.prototype.text=function(r){var N;return this.openCurrent(),N=new P(this,r),this.onData(this.writer.text(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.cdata=function(r){var N;return this.openCurrent(),N=new p(this,r),this.onData(this.writer.cdata(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.comment=function(r){var N;return this.openCurrent(),N=new h(this,r),this.onData(this.writer.comment(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.raw=function(r){var N;return this.openCurrent(),N=new O(this,r),this.onData(this.writer.raw(N,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.instruction=function(r,N){var A,_,C,F,j;if(this.openCurrent(),r!=null&&(r=E(r)),N!=null&&(N=E(N)),Array.isArray(r))for(A=0,F=r.length;A<F;A++)_=r[A],this.instruction(_);else if(c(r))for(_ in r)L.call(r,_)&&(C=r[_],this.instruction(_,C));else s(N)&&(N=N.apply()),j=new g(this,r,N),this.onData(this.writer.processingInstruction(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},v.prototype.declaration=function(r,N,A){var _;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return _=new b(this,r,N,A),this.onData(this.writer.declaration(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.doctype=function(r,N,A){if(this.openCurrent(),r==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 m(this,N,A),this.currentNode.rootNodeName=r,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},v.prototype.dtdElement=function(r,N){var A;return this.openCurrent(),A=new e(this,r,N),this.onData(this.writer.dtdElement(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.attList=function(r,N,A,_,C){var F;return this.openCurrent(),F=new t(this,r,N,A,_,C),this.onData(this.writer.dtdAttList(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.entity=function(r,N){var A;return this.openCurrent(),A=new o(this,!1,r,N),this.onData(this.writer.dtdEntity(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.pEntity=function(r,N){var A;return this.openCurrent(),A=new o(this,!0,r,N),this.onData(this.writer.dtdEntity(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.notation=function(r,N){var A;return this.openCurrent(),A=new l(this,r,N),this.onData(this.writer.dtdNotation(A,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.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},v.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},v.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},v.prototype.openNode=function(r){var N,A,_,C;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element&&(this.root=r),A="",r.type===i.Element){this.writerOptions.state=a.OpenTag,A=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name,C=r.attribs;for(_ in C)L.call(C,_)&&(N=C[_],A+=this.writer.attribute(N,this.writerOptions,this.currentLevel));A+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel),this.writerOptions.state=a.InsideTag}else this.writerOptions.state=a.OpenTag,A=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName,r.pubID&&r.sysID?A+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"':r.sysID&&(A+=' SYSTEM "'+r.sysID+'"'),r.children?(A+=" [",this.writerOptions.state=a.InsideTag):(this.writerOptions.state=a.CloseTag,A+=">"),A+=this.writer.endline(r,this.writerOptions,this.currentLevel);return this.onData(A,this.currentLevel),r.isOpen=!0}},v.prototype.closeNode=function(r){var N;if(!r.isClosed)return N="",this.writerOptions.state=a.CloseTag,r.type===i.Element?N=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel):N=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel),this.writerOptions.state=a.None,this.onData(N,this.currentLevel),r.isClosed=!0},v.prototype.onData=function(r,N){return this.documentStarted=!0,this.onDataCallback(r,N+1)},v.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},v.prototype.debugInfo=function(r){return r==null?"":"node: <"+r+">"},v.prototype.ele=function(){return this.element.apply(this,arguments)},v.prototype.nod=function(r,N,A){return this.node(r,N,A)},v.prototype.txt=function(r){return this.text(r)},v.prototype.dat=function(r){return this.cdata(r)},v.prototype.com=function(r){return this.comment(r)},v.prototype.ins=function(r,N){return this.instruction(r,N)},v.prototype.dec=function(r,N,A){return this.declaration(r,N,A)},v.prototype.dtd=function(r,N,A){return this.doctype(r,N,A)},v.prototype.e=function(r,N,A){return this.element(r,N,A)},v.prototype.n=function(r,N,A){return this.node(r,N,A)},v.prototype.t=function(r){return this.text(r)},v.prototype.d=function(r){return this.cdata(r)},v.prototype.c=function(r){return this.comment(r)},v.prototype.r=function(r){return this.raw(r)},v.prototype.i=function(r,N){return this.instruction(r,N)},v.prototype.att=function(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},v.prototype.a=function(){return this.currentNode&&this.currentNode.type===i.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},v.prototype.ent=function(r,N){return this.entity(r,N)},v.prototype.pent=function(r,N){return this.pEntity(r,N)},v.prototype.not=function(r,N){return this.notation(r,N)},v}()}).call(Ur)),Ft.exports}var Xt={exports:{}},kr=Xt.exports,Ge;function $r(){return Ge||(Ge=1,(function(){var i,a,D,p=function(t,e){for(var o in e)h.call(e,o)&&(t[o]=e[o]);function l(){this.constructor=t}return l.prototype=e.prototype,t.prototype=new l,t.__super__=e.prototype,t},h={}.hasOwnProperty;i=B(),D=Ue(),a=St(),Xt.exports=function(t){p(e,t);function e(o,l){this.stream=o,e.__super__.constructor.call(this,l)}return e.prototype.endline=function(o,l,b){return o.isLastRootNode&&l.state===a.CloseTag?"":e.__super__.endline.call(this,o,l,b)},e.prototype.document=function(o,l){var b,m,y,d,g,O,I,x,P;for(I=o.children,m=y=0,g=I.length;y<g;m=++y)b=I[m],b.isLastRootNode=m===o.children.length-1;for(l=this.filterOptions(l),x=o.children,P=[],d=0,O=x.length;d<O;d++)b=x[d],P.push(this.writeChildNode(b,l,0));return P},e.prototype.attribute=function(o,l,b){return this.stream.write(e.__super__.attribute.call(this,o,l,b))},e.prototype.cdata=function(o,l,b){return this.stream.write(e.__super__.cdata.call(this,o,l,b))},e.prototype.comment=function(o,l,b){return this.stream.write(e.__super__.comment.call(this,o,l,b))},e.prototype.declaration=function(o,l,b){return this.stream.write(e.__super__.declaration.call(this,o,l,b))},e.prototype.docType=function(o,l,b){var m,y,d,g;if(b||(b=0),this.openNode(o,l,b),l.state=a.OpenTag,this.stream.write(this.indent(o,l,b)),this.stream.write("<!DOCTYPE "+o.root().name),o.pubID&&o.sysID?this.stream.write(' PUBLIC "'+o.pubID+'" "'+o.sysID+'"'):o.sysID&&this.stream.write(' SYSTEM "'+o.sysID+'"'),o.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(o,l,b)),l.state=a.InsideTag,g=o.children,y=0,d=g.length;y<d;y++)m=g[y],this.writeChildNode(m,l,b+1);l.state=a.CloseTag,this.stream.write("]")}return l.state=a.CloseTag,this.stream.write(l.spaceBeforeSlash+">"),this.stream.write(this.endline(o,l,b)),l.state=a.None,this.closeNode(o,l,b)},e.prototype.element=function(o,l,b){var m,y,d,g,O,I,x,P,E;b||(b=0),this.openNode(o,l,b),l.state=a.OpenTag,this.stream.write(this.indent(o,l,b)+"<"+o.name),P=o.attribs;for(x in P)h.call(P,x)&&(m=P[x],this.attribute(m,l,b));if(d=o.children.length,g=d===0?null:o.children[0],d===0||o.children.every(function(s){return(s.type===i.Text||s.type===i.Raw)&&s.value===""}))l.allowEmpty?(this.stream.write(">"),l.state=a.CloseTag,this.stream.write("</"+o.name+">")):(l.state=a.CloseTag,this.stream.write(l.spaceBeforeSlash+"/>"));else if(l.pretty&&d===1&&(g.type===i.Text||g.type===i.Raw)&&g.value!=null)this.stream.write(">"),l.state=a.InsideTag,l.suppressPrettyCount++,this.writeChildNode(g,l,b+1),l.suppressPrettyCount--,l.state=a.CloseTag,this.stream.write("</"+o.name+">");else{for(this.stream.write(">"+this.endline(o,l,b)),l.state=a.InsideTag,E=o.children,O=0,I=E.length;O<I;O++)y=E[O],this.writeChildNode(y,l,b+1);l.state=a.CloseTag,this.stream.write(this.indent(o,l,b)+"</"+o.name+">")}return this.stream.write(this.endline(o,l,b)),l.state=a.None,this.closeNode(o,l,b)},e.prototype.processingInstruction=function(o,l,b){return this.stream.write(e.__super__.processingInstruction.call(this,o,l,b))},e.prototype.raw=function(o,l,b){return this.stream.write(e.__super__.raw.call(this,o,l,b))},e.prototype.text=function(o,l,b){return this.stream.write(e.__super__.text.call(this,o,l,b))},e.prototype.dtdAttList=function(o,l,b){return this.stream.write(e.__super__.dtdAttList.call(this,o,l,b))},e.prototype.dtdElement=function(o,l,b){return this.stream.write(e.__super__.dtdElement.call(this,o,l,b))},e.prototype.dtdEntity=function(o,l,b){return this.stream.write(e.__super__.dtdEntity.call(this,o,l,b))},e.prototype.dtdNotation=function(o,l,b){return this.stream.write(e.__super__.dtdNotation.call(this,o,l,b))},e}(D)}).call(kr)),Xt.exports}var Ye;function Wr(){return Ye||(Ye=1,(function(){var i,a,D,p,h,t,e,o,l,b;b=z(),o=b.assign,l=b.isFunction,D=fe(),p=$e(),h=Vr(),e=te(),t=$r(),i=B(),a=St(),Y.create=function(m,y,d,g){var O,I;if(m==null)throw new Error("Root element needs a name.");return g=o({},y,d,g),O=new p(g),I=O.element(m),g.headless||(O.declaration(g),(g.pubID!=null||g.sysID!=null)&&O.dtd(g)),I},Y.begin=function(m,y,d){var g;return l(m)&&(g=[m,y],y=g[0],d=g[1],m={}),y?new h(m,y,d):new p(m)},Y.stringWriter=function(m){return new e(m)},Y.streamWriter=function(m,y){return new t(m,y)},Y.implementation=new D,Y.nodeType=i,Y.writerState=a}).call(Y)),Y}var Ke;function Gr(){return Ke||(Ke=1,(function(){var i,a,D,p,h,t={}.hasOwnProperty;i=Wr(),a=qt().defaults,p=function(e){return typeof e=="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},h=function(e){return"<![CDATA["+D(e)+"]]>"},D=function(e){return e.replace("]]>","]]]]><![CDATA[>")},nt.Builder=function(){function e(o){var l,b,m;this.options={},b=a["0.2"];for(l in b)t.call(b,l)&&(m=b[l],this.options[l]=m);for(l in o)t.call(o,l)&&(m=o[l],this.options[l]=m)}return e.prototype.buildObject=function(o){var l,b,m,y,d;return l=this.options.attrkey,b=this.options.charkey,Object.keys(o).length===1&&this.options.rootName===a["0.2"].rootName?(d=Object.keys(o)[0],o=o[d]):d=this.options.rootName,m=function(g){return function(O,I){var x,P,E,s,c,f;if(typeof I!="object")g.options.cdata&&p(I)?O.raw(h(I)):O.txt(I);else if(Array.isArray(I)){for(s in I)if(t.call(I,s)){P=I[s];for(c in P)E=P[c],O=m(O.ele(c),E).up()}}else for(c in I)if(t.call(I,c))if(P=I[c],c===l){if(typeof P=="object")for(x in P)f=P[x],O=O.att(x,f)}else if(c===b)g.options.cdata&&p(P)?O=O.raw(h(P)):O=O.txt(P);else if(Array.isArray(P))for(s in P)t.call(P,s)&&(E=P[s],typeof E=="string"?g.options.cdata&&p(E)?O=O.ele(c).raw(h(E)).up():O=O.ele(c,E).up():O=m(O.ele(c),E).up());else typeof P=="object"?O=m(O.ele(c),P).up():typeof P=="string"&&g.options.cdata&&p(P)?O=O.ele(c).raw(h(P)).up():(P==null&&(P=""),O=O.ele(c,P.toString()).up());return O}}(this),y=i.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),m(y,o).end(this.options.renderOpts)},e}()}).call(nt)),nt}var Rt={},ee={};const re=et(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ze;function Yr(){return ze||(ze=1,function(i){(function(a){a.parser=function(u,n){return new p(u,n)},a.SAXParser=p,a.SAXStream=m,a.createStream=b,a.MAX_BUFFER_LENGTH=64*1024;var D=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];a.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function p(u,n){if(!(this instanceof p))return new p(u,n);var M=this;t(M),M.q=M.c="",M.bufferCheckPosition=a.MAX_BUFFER_LENGTH,M.opt=n||{},M.opt.lowercase=M.opt.lowercase||M.opt.lowercasetags,M.looseCase=M.opt.lowercase?"toLowerCase":"toUpperCase",M.tags=[],M.closed=M.closedRoot=M.sawRoot=!1,M.tag=M.error=null,M.strict=!!u,M.noscript=!!(u||M.opt.noscript),M.state=r.BEGIN,M.strictEntities=M.opt.strictEntities,M.ENTITIES=M.strictEntities?Object.create(a.XML_ENTITIES):Object.create(a.ENTITIES),M.attribList=[],M.opt.xmlns&&(M.ns=Object.create(I)),M.opt.unquotedAttributeValues===void 0&&(M.opt.unquotedAttributeValues=!u),M.trackPosition=M.opt.position!==!1,M.trackPosition&&(M.position=M.line=M.column=0),A(M,"onready")}Object.create||(Object.create=function(u){function n(){}n.prototype=u;var M=new n;return M}),Object.keys||(Object.keys=function(u){var n=[];for(var M in u)u.hasOwnProperty(M)&&n.push(M);return n});function h(u){for(var n=Math.max(a.MAX_BUFFER_LENGTH,10),M=0,w=0,R=D.length;w<R;w++){var q=u[D[w]].length;if(q>n)switch(D[w]){case"textNode":C(u);break;case"cdata":_(u,"oncdata",u.cdata),u.cdata="";break;case"script":_(u,"onscript",u.script),u.script="";break;default:j(u,"Max buffer length exceeded: "+D[w])}M=Math.max(M,q)}var U=a.MAX_BUFFER_LENGTH-M;u.bufferCheckPosition=U+u.position}function t(u){for(var n=0,M=D.length;n<M;n++)u[D[n]]=""}function e(u){C(u),u.cdata!==""&&(_(u,"oncdata",u.cdata),u.cdata=""),u.script!==""&&(_(u,"onscript",u.script),u.script="")}p.prototype={end:function(){X(this)},write:gn,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){e(this)}};var o;try{o=re.Stream}catch{o=function(){}}o||(o=function(){});var l=a.EVENTS.filter(function(u){return u!=="error"&&u!=="end"});function b(u,n){return new m(u,n)}function m(u,n){if(!(this instanceof m))return new m(u,n);o.apply(this),this._parser=new p(u,n),this.writable=!0,this.readable=!0;var M=this;this._parser.onend=function(){M.emit("end")},this._parser.onerror=function(w){M.emit("error",w),M._parser.error=null},this._decoder=null,l.forEach(function(w){Object.defineProperty(M,"on"+w,{get:function(){return M._parser["on"+w]},set:function(R){if(!R)return M.removeAllListeners(w),M._parser["on"+w]=R,R;M.on(w,R)},enumerable:!0,configurable:!1})})}m.prototype=Object.create(o.prototype,{constructor:{value:m}}),m.prototype.write=function(u){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(u)){if(!this._decoder){var n=re.StringDecoder;this._decoder=new n("utf8")}u=this._decoder.write(u)}return this._parser.write(u.toString()),this.emit("data",u),!0},m.prototype.end=function(u){return u&&u.length&&this.write(u),this._parser.end(),!0},m.prototype.on=function(u,n){var M=this;return!M._parser["on"+u]&&l.indexOf(u)!==-1&&(M._parser["on"+u]=function(){var w=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);w.splice(0,0,u),M.emit.apply(M,w)}),o.prototype.on.call(M,u,n)};var y="[CDATA[",d="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",I={xml:g,xmlns:O},x=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,P=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function c(u){return u===" "||u===`
|
|
4
|
+
`||u==="\r"||u===" "}function f(u){return u==='"'||u==="'"}function T(u){return u===">"||c(u)}function L(u,n){return u.test(n)}function v(u,n){return!L(u,n)}var r=0;a.STATE={BEGIN:r++,BEGIN_WHITESPACE:r++,TEXT:r++,TEXT_ENTITY:r++,OPEN_WAKA:r++,SGML_DECL:r++,SGML_DECL_QUOTED:r++,DOCTYPE:r++,DOCTYPE_QUOTED:r++,DOCTYPE_DTD:r++,DOCTYPE_DTD_QUOTED:r++,COMMENT_STARTING:r++,COMMENT:r++,COMMENT_ENDING:r++,COMMENT_ENDED:r++,CDATA:r++,CDATA_ENDING:r++,CDATA_ENDING_2:r++,PROC_INST:r++,PROC_INST_BODY:r++,PROC_INST_ENDING:r++,OPEN_TAG:r++,OPEN_TAG_SLASH:r++,ATTRIB:r++,ATTRIB_NAME:r++,ATTRIB_NAME_SAW_WHITE:r++,ATTRIB_VALUE:r++,ATTRIB_VALUE_QUOTED:r++,ATTRIB_VALUE_CLOSED:r++,ATTRIB_VALUE_UNQUOTED:r++,ATTRIB_VALUE_ENTITY_Q:r++,ATTRIB_VALUE_ENTITY_U:r++,CLOSE_TAG:r++,CLOSE_TAG_SAW_WHITE:r++,SCRIPT:r++,SCRIPT_ENDING:r++},a.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},a.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(a.ENTITIES).forEach(function(u){var n=a.ENTITIES[u],M=typeof n=="number"?String.fromCharCode(n):n;a.ENTITIES[u]=M});for(var N in a.STATE)a.STATE[a.STATE[N]]=N;r=a.STATE;function A(u,n,M){u[n]&&u[n](M)}function _(u,n,M){u.textNode&&C(u),A(u,n,M)}function C(u){u.textNode=F(u.opt,u.textNode),u.textNode&&A(u,"ontext",u.textNode),u.textNode=""}function F(u,n){return u.trim&&(n=n.trim()),u.normalize&&(n=n.replace(/\s+/g," ")),n}function j(u,n){return C(u),u.trackPosition&&(n+=`
|
|
5
5
|
Line: `+u.line+`
|
|
6
6
|
Column: `+u.column+`
|
|
7
|
-
Char: `+u.c),n=new Error(n),u.error=n,A(u,"onerror",n),u}function
|
|
7
|
+
Char: `+u.c),n=new Error(n),u.error=n,A(u,"onerror",n),u}function X(u){return u.sawRoot&&!u.closedRoot&&S(u,"Unclosed root tag"),u.state!==r.BEGIN&&u.state!==r.BEGIN_WHITESPACE&&u.state!==r.TEXT&&j(u,"Unexpected end"),C(u),u.c="",u.closed=!0,A(u,"onend"),p.call(u,u.strict,u.opt),u}function S(u,n){if(typeof u!="object"||!(u instanceof p))throw new Error("bad call to strictFail");u.strict&&j(u,n)}function yn(u){u.strict||(u.tagName=u.tagName[u.looseCase]());var n=u.tags[u.tags.length-1]||u,M=u.tag={name:u.tagName,attributes:{}};u.opt.xmlns&&(M.ns=n.ns),u.attribList.length=0,_(u,"onopentagstart",M)}function ie(u,n){var M=u.indexOf(":"),w=M<0?["",u]:u.split(":"),R=w[0],q=w[1];return n&&u==="xmlns"&&(R="xmlns",q=""),{prefix:R,local:q}}function oe(u){if(u.strict||(u.attribName=u.attribName[u.looseCase]()),u.attribList.indexOf(u.attribName)!==-1||u.tag.attributes.hasOwnProperty(u.attribName)){u.attribName=u.attribValue="";return}if(u.opt.xmlns){var n=ie(u.attribName,!0),M=n.prefix,w=n.local;if(M==="xmlns")if(w==="xml"&&u.attribValue!==g)S(u,"xml: prefix must be bound to "+g+`
|
|
8
8
|
Actual: `+u.attribValue);else if(w==="xmlns"&&u.attribValue!==O)S(u,"xmlns: prefix must be bound to "+O+`
|
|
9
|
-
Actual: `+u.attribValue);else{var R=u.tag,q=u.tags[u.tags.length-1]||u;R.ns===q.ns&&(R.ns=Object.create(q.ns)),R.ns[w]=u.attribValue}u.attribList.push([u.attribName,u.attribValue])}else u.tag.attributes[u.attribName]=u.attribValue,_(u,"onattribute",{name:u.attribName,value:u.attribValue});u.attribName=u.attribValue=""}function J(u,n){if(u.opt.xmlns){var M=u.tag,w=
|
|
10
|
-
`?(n.line++,n.column=0):n.column++),n.state){case r.BEGIN:if(n.state=r.BEGIN_WHITESPACE,w==="\uFEFF")continue;
|
|
11
|
-
`?(n.line++,n.column=0):n.column++);n.textNode+=u.substring(R,M-1)}w==="<"&&!(n.sawRoot&&n.closedRoot&&!n.strict)?(n.state=r.OPEN_WAKA,n.startTagPosition=n.position):(!a(w)&&(!n.sawRoot||n.closedRoot)&&S(n,"Text data outside of root node."),w==="&"?n.state=r.TEXT_ENTITY:n.textNode+=w);continue;case r.SCRIPT:w==="<"?n.state=r.SCRIPT_ENDING:n.script+=w;continue;case r.SCRIPT_ENDING:w==="/"?n.state=r.CLOSE_TAG:(n.script+="<"+w,n.state=r.SCRIPT);continue;case r.OPEN_WAKA:if(w==="!")n.state=r.SGML_DECL,n.sgmlDecl="";else if(!a(w))if(L(x,w))n.state=r.OPEN_TAG,n.tagName=w;else if(w==="/")n.state=r.CLOSE_TAG,n.tagName="";else if(w==="?")n.state=r.PROC_INST,n.procInstName=n.procInstBody="";else{if(S(n,"Unencoded <"),n.startTagPosition+1<n.position){var q=n.position-n.startTagPosition;w=new Array(q).join(" ")+w}n.textNode+="<"+w,n.state=r.TEXT}continue;case r.SGML_DECL:if(n.sgmlDecl+w==="--"){n.state=r.COMMENT,n.comment="",n.sgmlDecl="";continue}n.doctype&&n.doctype!==!0&&n.sgmlDecl?(n.state=r.DOCTYPE_DTD,n.doctype+="<!"+n.sgmlDecl+w,n.sgmlDecl=""):(n.sgmlDecl+w).toUpperCase()===y?(_(n,"onopencdata"),n.state=r.CDATA,n.sgmlDecl="",n.cdata=""):(n.sgmlDecl+w).toUpperCase()===d?(n.state=r.DOCTYPE,(n.doctype||n.sawRoot)&&S(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):w===">"?(_(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=r.TEXT):(p(w)&&(n.state=r.SGML_DECL_QUOTED),n.sgmlDecl+=w);continue;case r.SGML_DECL_QUOTED:w===n.q&&(n.state=r.SGML_DECL,n.q=""),n.sgmlDecl+=w;continue;case r.DOCTYPE:w===">"?(n.state=r.TEXT,_(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=w,w==="["?n.state=r.DOCTYPE_DTD:p(w)&&(n.state=r.DOCTYPE_QUOTED,n.q=w));continue;case r.DOCTYPE_QUOTED:n.doctype+=w,w===n.q&&(n.q="",n.state=r.DOCTYPE);continue;case r.DOCTYPE_DTD:w==="]"?(n.doctype+=w,n.state=r.DOCTYPE):w==="<"?(n.state=r.OPEN_WAKA,n.startTagPosition=n.position):p(w)?(n.doctype+=w,n.state=r.DOCTYPE_DTD_QUOTED,n.q=w):n.doctype+=w;continue;case r.DOCTYPE_DTD_QUOTED:n.doctype+=w,w===n.q&&(n.state=r.DOCTYPE_DTD,n.q="");continue;case r.COMMENT:w==="-"?n.state=r.COMMENT_ENDING:n.comment+=w;continue;case r.COMMENT_ENDING:w==="-"?(n.state=r.COMMENT_ENDED,n.comment=X(n.opt,n.comment),n.comment&&_(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+w,n.state=r.COMMENT);continue;case r.COMMENT_ENDED:w!==">"?(S(n,"Malformed comment"),n.comment+="--"+w,n.state=r.COMMENT):n.doctype&&n.doctype!==!0?n.state=r.DOCTYPE_DTD:n.state=r.TEXT;continue;case r.CDATA:w==="]"?n.state=r.CDATA_ENDING:n.cdata+=w;continue;case r.CDATA_ENDING:w==="]"?n.state=r.CDATA_ENDING_2:(n.cdata+="]"+w,n.state=r.CDATA);continue;case r.CDATA_ENDING_2:w===">"?(n.cdata&&_(n,"oncdata",n.cdata),_(n,"onclosecdata"),n.cdata="",n.state=r.TEXT):w==="]"?n.cdata+="]":(n.cdata+="]]"+w,n.state=r.CDATA);continue;case r.PROC_INST:w==="?"?n.state=r.PROC_INST_ENDING:a(w)?n.state=r.PROC_INST_BODY:n.procInstName+=w;continue;case r.PROC_INST_BODY:if(!n.procInstBody&&a(w))continue;w==="?"?n.state=r.PROC_INST_ENDING:n.procInstBody+=w;continue;case r.PROC_INST_ENDING:w===">"?(_(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=r.TEXT):(n.procInstBody+="?"+w,n.state=r.PROC_INST_BODY);continue;case r.OPEN_TAG:L(P,w)?n.tagName+=w:(hn(n),w===">"?J(n):w==="/"?n.state=r.OPEN_TAG_SLASH:(a(w)||S(n,"Invalid character in tag name"),n.state=r.ATTRIB));continue;case r.OPEN_TAG_SLASH:w===">"?(J(n,!0),oe(n)):(S(n,"Forward-slash in opening tag not followed by >"),n.state=r.ATTRIB);continue;case r.ATTRIB:if(a(w))continue;w===">"?J(n):w==="/"?n.state=r.OPEN_TAG_SLASH:L(x,w)?(n.attribName=w,n.attribValue="",n.state=r.ATTRIB_NAME):S(n,"Invalid attribute name");continue;case r.ATTRIB_NAME:w==="="?n.state=r.ATTRIB_VALUE:w===">"?(S(n,"Attribute without value"),n.attribValue=n.attribName,ie(n),J(n)):a(w)?n.state=r.ATTRIB_NAME_SAW_WHITE:L(P,w)?n.attribName+=w:S(n,"Invalid attribute name");continue;case r.ATTRIB_NAME_SAW_WHITE:if(w==="=")n.state=r.ATTRIB_VALUE;else{if(a(w))continue;S(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",_(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",w===">"?J(n):L(x,w)?(n.attribName=w,n.state=r.ATTRIB_NAME):(S(n,"Invalid attribute name"),n.state=r.ATTRIB)}continue;case r.ATTRIB_VALUE:if(a(w))continue;p(w)?(n.q=w,n.state=r.ATTRIB_VALUE_QUOTED):(n.opt.unquotedAttributeValues||j(n,"Unquoted attribute value"),n.state=r.ATTRIB_VALUE_UNQUOTED,n.attribValue=w);continue;case r.ATTRIB_VALUE_QUOTED:if(w!==n.q){w==="&"?n.state=r.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=w;continue}ie(n),n.q="",n.state=r.ATTRIB_VALUE_CLOSED;continue;case r.ATTRIB_VALUE_CLOSED:a(w)?n.state=r.ATTRIB:w===">"?J(n):w==="/"?n.state=r.OPEN_TAG_SLASH:L(x,w)?(S(n,"No whitespace between attributes"),n.attribName=w,n.attribValue="",n.state=r.ATTRIB_NAME):S(n,"Invalid attribute name");continue;case r.ATTRIB_VALUE_UNQUOTED:if(!T(w)){w==="&"?n.state=r.ATTRIB_VALUE_ENTITY_U:n.attribValue+=w;continue}ie(n),w===">"?J(n):n.state=r.ATTRIB;continue;case r.CLOSE_TAG:if(n.tagName)w===">"?oe(n):L(P,w)?n.tagName+=w:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=r.SCRIPT):(a(w)||S(n,"Invalid tagname in closing tag"),n.state=r.CLOSE_TAG_SAW_WHITE);else{if(a(w))continue;v(x,w)?n.script?(n.script+="</"+w,n.state=r.SCRIPT):S(n,"Invalid tagname in closing tag."):n.tagName=w}continue;case r.CLOSE_TAG_SAW_WHITE:if(a(w))continue;w===">"?oe(n):S(n,"Invalid characters in closing tag");continue;case r.TEXT_ENTITY:case r.ATTRIB_VALUE_ENTITY_Q:case r.ATTRIB_VALUE_ENTITY_U:var U,k;switch(n.state){case r.TEXT_ENTITY:U=r.TEXT,k="textNode";break;case r.ATTRIB_VALUE_ENTITY_Q:U=r.ATTRIB_VALUE_QUOTED,k="attribValue";break;case r.ATTRIB_VALUE_ENTITY_U:U=r.ATTRIB_VALUE_UNQUOTED,k="attribValue";break}if(w===";"){var $=dn(n);n.opt.unparsedEntities&&!Object.values(c.XML_ENTITIES).includes($)?(n.entity="",n.state=U,n.write($)):(n[k]+=$,n.entity="",n.state=U)}else L(n.entity.length?s:E,w)?n.entity+=w:(S(n,"Invalid character in entity name"),n[k]+="&"+n.entity+w,n.entity="",n.state=U);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&h(n),n}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var u=String.fromCharCode,n=Math.floor,M=function(){var w=16384,R=[],q,U,k=-1,$=arguments.length;if(!$)return"";for(var tt="";++k<$;){var V=Number(arguments[k]);if(!isFinite(V)||V<0||V>1114111||n(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?R.push(V):(V-=65536,q=(V>>10)+55296,U=V%1024+56320,R.push(q,U)),(k+1===$||R.length>w)&&(tt+=u.apply(null,R),R.length=0)}return tt};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:M,configurable:!0,writable:!0}):String.fromCodePoint=M}()})(i)}(ee)),ee}var jt={exports:{}},ze;function Gr(){if(ze)return jt.exports;ze=1;var i=typeof Reflect=="object"?Reflect:null,c=i&&typeof i.apply=="function"?i.apply:function(p,T,L){return Function.prototype.apply.call(p,T,L)},D;i&&typeof i.ownKeys=="function"?D=i.ownKeys:Object.getOwnPropertySymbols?D=function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:D=function(p){return Object.getOwnPropertyNames(p)};function f(a){console&&console.warn&&console.warn(a)}var h=Number.isNaN||function(p){return p!==p};function t(){t.init.call(this)}jt.exports=t,jt.exports.once=P,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var e=10;function o(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return e},set:function(a){if(typeof a!="number"||a<0||h(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");e=a}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(p){if(typeof p!="number"||p<0||h(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this};function l(a){return a._maxListeners===void 0?t.defaultMaxListeners:a._maxListeners}t.prototype.getMaxListeners=function(){return l(this)},t.prototype.emit=function(p){for(var T=[],L=1;L<arguments.length;L++)T.push(arguments[L]);var v=p==="error",r=this._events;if(r!==void 0)v=v&&r.error===void 0;else if(!v)return!1;if(v){var N;if(T.length>0&&(N=T[0]),N instanceof Error)throw N;var A=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw A.context=N,A}var _=r[p];if(_===void 0)return!1;if(typeof _=="function")c(_,this,T);else for(var C=_.length,X=O(_,C),L=0;L<C;++L)c(X[L],this,T);return!0};function b(a,p,T,L){var v,r,N;if(o(T),r=a._events,r===void 0?(r=a._events=Object.create(null),a._eventsCount=0):(r.newListener!==void 0&&(a.emit("newListener",p,T.listener?T.listener:T),r=a._events),N=r[p]),N===void 0)N=r[p]=T,++a._eventsCount;else if(typeof N=="function"?N=r[p]=L?[T,N]:[N,T]:L?N.unshift(T):N.push(T),v=l(a),v>0&&N.length>v&&!N.warned){N.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=a,A.type=p,A.count=N.length,f(A)}return a}t.prototype.addListener=function(p,T){return b(this,p,T,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(p,T){return b(this,p,T,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(a,p,T){var L={fired:!1,wrapFn:void 0,target:a,type:p,listener:T},v=m.bind(L);return v.listener=T,L.wrapFn=v,v}t.prototype.once=function(p,T){return o(T),this.on(p,y(this,p,T)),this},t.prototype.prependOnceListener=function(p,T){return o(T),this.prependListener(p,y(this,p,T)),this},t.prototype.removeListener=function(p,T){var L,v,r,N,A;if(o(T),v=this._events,v===void 0)return this;if(L=v[p],L===void 0)return this;if(L===T||L.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete v[p],v.removeListener&&this.emit("removeListener",p,L.listener||T));else if(typeof L!="function"){for(r=-1,N=L.length-1;N>=0;N--)if(L[N]===T||L[N].listener===T){A=L[N].listener,r=N;break}if(r<0)return this;r===0?L.shift():I(L,r),L.length===1&&(v[p]=L[0]),v.removeListener!==void 0&&this.emit("removeListener",p,A||T)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(p){var T,L,v;if(L=this._events,L===void 0)return this;if(L.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):L[p]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete L[p]),this;if(arguments.length===0){var r=Object.keys(L),N;for(v=0;v<r.length;++v)N=r[v],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=L[p],typeof T=="function")this.removeListener(p,T);else if(T!==void 0)for(v=T.length-1;v>=0;v--)this.removeListener(p,T[v]);return this};function d(a,p,T){var L=a._events;if(L===void 0)return[];var v=L[p];return v===void 0?[]:typeof v=="function"?T?[v.listener||v]:[v]:T?x(v):O(v,v.length)}t.prototype.listeners=function(p){return d(this,p,!0)},t.prototype.rawListeners=function(p){return d(this,p,!1)},t.listenerCount=function(a,p){return typeof a.listenerCount=="function"?a.listenerCount(p):g.call(a,p)},t.prototype.listenerCount=g;function g(a){var p=this._events;if(p!==void 0){var T=p[a];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function O(a,p){for(var T=new Array(p),L=0;L<p;++L)T[L]=a[L];return T}function I(a,p){for(;p+1<a.length;p++)a[p]=a[p+1];a.pop()}function x(a){for(var p=new Array(a.length),T=0;T<p.length;++T)p[T]=a[T].listener||a[T];return p}function P(a,p){return new Promise(function(T,L){function v(N){a.removeListener(p,r),L(N)}function r(){typeof a.removeListener=="function"&&a.removeListener("error",v),T([].slice.call(arguments))}s(a,p,r,{once:!0}),p!=="error"&&E(a,v,{once:!0})})}function E(a,p,T){typeof a.on=="function"&&s(a,"error",p,T)}function s(a,p,T,L){if(typeof a.on=="function")L.once?a.once(p,T):a.on(p,T);else if(typeof a.addEventListener=="function")a.addEventListener(p,function v(r){L.once&&a.removeEventListener(p,v),T(r)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}return jt.exports}var Bt={},He;function Yr(){return He||(He=1,(function(){Bt.stripBOM=function(i){return i[0]==="\uFEFF"?i.substring(1):i}}).call(Bt)),Bt}var Z={},Qe;function Ze(){return Qe||(Qe=1,(function(){var i;i=new RegExp(/(?!xmlns)^.*:/),Z.normalize=function(c){return c.toLowerCase()},Z.firstCharLowerCase=function(c){return c.charAt(0).toLowerCase()+c.slice(1)},Z.stripPrefix=function(c){return c.replace(i,"")},Z.parseNumbers=function(c){return isNaN(c)||(c=c%1===0?parseInt(c,10):parseFloat(c)),c},Z.parseBooleans=function(c){return/^(?:true|false)$/i.test(c)&&(c=c.toLowerCase()==="true"),c}}).call(Z)),Z}var Je;function Kr(){return Je||(Je=1,function(i){(function(){var c,D,f,h,t,e,o,l,b,m=function(g,O){return function(){return g.apply(O,arguments)}},y=function(g,O){for(var I in O)d.call(O,I)&&(g[I]=O[I]);function x(){this.constructor=g}return x.prototype=O.prototype,g.prototype=new x,g.__super__=O.prototype,g},d={}.hasOwnProperty;l=Wr(),h=Gr(),c=Yr(),o=Ze(),b=re.setImmediate,D=qt().defaults,t=function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},e=function(g,O,I){var x,P,E;for(x=0,P=g.length;x<P;x++)E=g[x],O=E(O,I);return O},f=function(g,O,I){var x;return x=Object.create(null),x.value=I,x.writable=!0,x.enumerable=!0,x.configurable=!0,Object.defineProperty(g,O,x)},i.Parser=function(g){y(O,g);function O(I){this.parseStringPromise=m(this.parseStringPromise,this),this.parseString=m(this.parseString,this),this.reset=m(this.reset,this),this.assignOrPush=m(this.assignOrPush,this),this.processAsync=m(this.processAsync,this);var x,P,E;if(!(this instanceof i.Parser))return new i.Parser(I);this.options={},P=D["0.2"];for(x in P)d.call(P,x)&&(E=P[x],this.options[x]=E);for(x in I)d.call(I,x)&&(E=I[x],this.options[x]=E);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return O.prototype.processAsync=function(){var I,x;try{return this.remaining.length<=this.options.chunkSize?(I=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(I),this.saxParser.close()):(I=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(I),b(this.processAsync))}catch(P){if(x=P,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(x)}},O.prototype.assignOrPush=function(I,x,P){return x in I?(I[x]instanceof Array||f(I,x,[I[x]]),I[x].push(P)):this.options.explicitArray?f(I,x,[P]):f(I,x,P)},O.prototype.reset=function(){var I,x,P,E;return this.removeAllListeners(),this.saxParser=l.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(s){return function(a){if(s.saxParser.resume(),!s.saxParser.errThrown)return s.saxParser.errThrown=!0,s.emit("error",a)}}(this),this.saxParser.onend=function(s){return function(){if(!s.saxParser.ended)return s.saxParser.ended=!0,s.emit("end",s.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,E=[],I=this.options.attrkey,x=this.options.charkey,this.saxParser.onopentag=function(s){return function(a){var p,T,L,v,r;if(L={},L[x]="",!s.options.ignoreAttrs){r=a.attributes;for(p in r)d.call(r,p)&&(!(I in L)&&!s.options.mergeAttrs&&(L[I]={}),T=s.options.attrValueProcessors?e(s.options.attrValueProcessors,a.attributes[p],p):a.attributes[p],v=s.options.attrNameProcessors?e(s.options.attrNameProcessors,p):p,s.options.mergeAttrs?s.assignOrPush(L,v,T):f(L[I],v,T))}return L["#name"]=s.options.tagNameProcessors?e(s.options.tagNameProcessors,a.name):a.name,s.options.xmlns&&(L[s.options.xmlnskey]={uri:a.uri,local:a.local}),E.push(L)}}(this),this.saxParser.onclosetag=function(s){return function(){var a,p,T,L,v,r,N,A,_,C;if(r=E.pop(),v=r["#name"],(!s.options.explicitChildren||!s.options.preserveChildrenOrder)&&delete r["#name"],r.cdata===!0&&(a=r.cdata,delete r.cdata),_=E[E.length-1],r[x].match(/^\s*$/)&&!a?(p=r[x],delete r[x]):(s.options.trim&&(r[x]=r[x].trim()),s.options.normalize&&(r[x]=r[x].replace(/\s{2,}/g," ").trim()),r[x]=s.options.valueProcessors?e(s.options.valueProcessors,r[x],v):r[x],Object.keys(r).length===1&&x in r&&!s.EXPLICIT_CHARKEY&&(r=r[x])),t(r)&&(typeof s.options.emptyTag=="function"?r=s.options.emptyTag():r=s.options.emptyTag!==""?s.options.emptyTag:p),s.options.validator!=null&&(C="/"+function(){var X,j,F;for(F=[],X=0,j=E.length;X<j;X++)L=E[X],F.push(L["#name"]);return F}().concat(v).join("/"),function(){var X;try{return r=s.options.validator(C,_&&_[v],r)}catch(j){return X=j,s.emit("error",X)}}()),s.options.explicitChildren&&!s.options.mergeAttrs&&typeof r=="object"){if(!s.options.preserveChildrenOrder)L={},s.options.attrkey in r&&(L[s.options.attrkey]=r[s.options.attrkey],delete r[s.options.attrkey]),!s.options.charsAsChildren&&s.options.charkey in r&&(L[s.options.charkey]=r[s.options.charkey],delete r[s.options.charkey]),Object.getOwnPropertyNames(r).length>0&&(L[s.options.childkey]=r),r=L;else if(_){_[s.options.childkey]=_[s.options.childkey]||[],N={};for(T in r)d.call(r,T)&&f(N,T,r[T]);_[s.options.childkey].push(N),delete r["#name"],Object.keys(r).length===1&&x in r&&!s.EXPLICIT_CHARKEY&&(r=r[x])}}return E.length>0?s.assignOrPush(_,v,r):(s.options.explicitRoot&&(A=r,r={},f(r,v,A)),s.resultObject=r,s.saxParser.ended=!0,s.emit("end",s.resultObject))}}(this),P=function(s){return function(a){var p,T;if(T=E[E.length-1],T)return T[x]+=a,s.options.explicitChildren&&s.options.preserveChildrenOrder&&s.options.charsAsChildren&&(s.options.includeWhiteChars||a.replace(/\\n/g,"").trim()!=="")&&(T[s.options.childkey]=T[s.options.childkey]||[],p={"#name":"__text__"},p[x]=a,s.options.normalize&&(p[x]=p[x].replace(/\s{2,}/g," ").trim()),T[s.options.childkey].push(p)),T}}(this),this.saxParser.ontext=P,this.saxParser.oncdata=function(s){return function(a){var p;if(p=P(a),p)return p.cdata=!0}}()},O.prototype.parseString=function(I,x){var P;x!=null&&typeof x=="function"&&(this.on("end",function(E){return this.reset(),x(null,E)}),this.on("error",function(E){return this.reset(),x(E)}));try{return I=I.toString(),I.trim()===""?(this.emit("end",null),!0):(I=c.stripBOM(I),this.options.async?(this.remaining=I,b(this.processAsync),this.saxParser):this.saxParser.write(I).close())}catch(E){if(P=E,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw P}else return this.emit("error",P),this.saxParser.errThrown=!0}},O.prototype.parseStringPromise=function(I){return new Promise(function(x){return function(P,E){return x.parseString(I,function(s,a){return s?E(s):P(a)})}}(this))},O}(h),i.parseString=function(g,O,I){var x,P,E;return I!=null?(typeof I=="function"&&(x=I),typeof O=="object"&&(P=O)):(typeof O=="function"&&(x=O),P={}),E=new i.Parser(P),E.parseString(g,x)},i.parseStringPromise=function(g,O){var I,x;return typeof O=="object"&&(I=O),x=new i.Parser(I),x.parseStringPromise(g)}}).call(Rt)}(Rt)),Rt}var tr;function zr(){return tr||(tr=1,(function(){var i,c,D,f,h=function(e,o){for(var l in o)t.call(o,l)&&(e[l]=o[l]);function b(){this.constructor=e}return b.prototype=o.prototype,e.prototype=new b,e.__super__=o.prototype,e},t={}.hasOwnProperty;c=qt(),i=$r(),D=Kr(),f=Ze(),G.defaults=c.defaults,G.processors=f,G.ValidationError=function(e){h(o,e);function o(l){this.message=l}return o}(Error),G.Builder=i.Builder,G.Parser=D.Parser,G.parseString=D.parseString,G.parseStringPromise=D.parseStringPromise}).call(G)),G}var Hr=zr();const Qr=i=>i!==null&&typeof i=="object"&&i.hasOwnProperty("rss")&&typeof i.rss=="object"&&i.rss!==null&&i.rss.hasOwnProperty("channel")&&Array.isArray(i.rss.channel),Zr=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("title")&&Array.isArray(i.title)&&i.hasOwnProperty("description")&&Array.isArray(i.description)&&i.hasOwnProperty("link")&&Array.isArray(i.link)&&i.hasOwnProperty("image")&&Array.isArray(i.image)&&i.image.every(Jr)&&i.hasOwnProperty("generator")&&Array.isArray(i.generator)&&i.hasOwnProperty("lastBuildDate")&&Array.isArray(i.lastBuildDate)&&i.hasOwnProperty("atom:link")&&Array.isArray(i["atom:link"])&&i["atom:link"].every(tn)&&i.hasOwnProperty("copyright")&&Array.isArray(i.copyright)&&i.hasOwnProperty("language")&&Array.isArray(i.language)&&i.hasOwnProperty("webMaster")&&Array.isArray(i.webMaster)&&i.hasOwnProperty("itunes:owner")&&Array.isArray(i["itunes:owner"])&&i["itunes:owner"].every(en)&&i.hasOwnProperty("itunes:author")&&Array.isArray(i["itunes:author"])&&i.hasOwnProperty("googleplay:owner")&&Array.isArray(i["googleplay:owner"])&&i.hasOwnProperty("googleplay:email")&&Array.isArray(i["googleplay:email"])&&i.hasOwnProperty("googleplay:author")&&Array.isArray(i["googleplay:author"])&&i.hasOwnProperty("item")&&Array.isArray(i.item)&&i.item.every(rn),Jr=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("url")&&Array.isArray(i.url)&&i.hasOwnProperty("title")&&Array.isArray(i.title)&&i.hasOwnProperty("link")&&Array.isArray(i.link),tn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("$")&&typeof i.$=="object"&&i.$!==null&&i.$.hasOwnProperty("href")&&typeof i.$.href=="string"&&i.$.hasOwnProperty("rel")&&typeof i.$.rel=="string"&&i.$.hasOwnProperty("type")&&typeof i.$.type=="string",en=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("itunes:email")&&Array.isArray(i["itunes:email"])&&i.hasOwnProperty("itunes:name")&&Array.isArray(i["itunes:name"]),rn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("title")&&Array.isArray(i.title)&&i.hasOwnProperty("description")&&Array.isArray(i.description)&&i.hasOwnProperty("link")&&Array.isArray(i.link)&&i.hasOwnProperty("guid")&&Array.isArray(i.guid)&&i.guid.every(nn)&&i.hasOwnProperty("dc:creator")&&Array.isArray(i["dc:creator"])&&i.hasOwnProperty("pubDate")&&Array.isArray(i.pubDate)&&i.hasOwnProperty("enclosure")&&Array.isArray(i.enclosure)&&i.enclosure.every(on)&&i.hasOwnProperty("content:encoded")&&Array.isArray(i["content:encoded"]),nn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("_")&&typeof i._=="string"&&i.hasOwnProperty("$")&&typeof i.$=="object"&&i.$!==null&&i.$.hasOwnProperty("isPermaLink")&&typeof i.$.isPermaLink=="string",on=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("$")&&typeof i.$=="object"&&i.$!==null&&i.$.hasOwnProperty("url")&&typeof i.$.url=="string"&&i.$.hasOwnProperty("length")&&typeof i.$.length=="string"&&i.$.hasOwnProperty("type")&&typeof i.$.type=="string",sn="https://api.allorigins.win/get?url=",un=async(i,c=!1)=>{try{const D=c?`${sn}${encodeURIComponent(i)}`:i,f=await fetch(D);if(f.ok)return f.text()}catch{throw new Error("Error occurred fetching Feed from Substack")}},an=async(i="",c)=>{Hr.parseString(i,c)},cn=i=>({title:i.title[0],description:i.description[0],link:i.link[0],pubDate:i.pubDate[0],content:i["content:encoded"][0]}),ln=async(i,c=!1,D)=>{const f=await un(i,c);if(!D)return f;await an(f,D)},fn=(i,c)=>{if(!Qr(i))throw new Error("Feed is not in the correct format");try{return i.rss.channel.filter(Zr).filter(D=>D.link[0]===c)}catch{throw new Error(`Error occurred fetching Feed by Link: ${c}`)}},pn=i=>i[0].item.map(cn);Q.getFeedByLink=fn,Q.getPosts=pn,Q.getSubstackFeed=ln,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
|
|
9
|
+
Actual: `+u.attribValue);else{var R=u.tag,q=u.tags[u.tags.length-1]||u;R.ns===q.ns&&(R.ns=Object.create(q.ns)),R.ns[w]=u.attribValue}u.attribList.push([u.attribName,u.attribValue])}else u.tag.attributes[u.attribName]=u.attribValue,_(u,"onattribute",{name:u.attribName,value:u.attribValue});u.attribName=u.attribValue=""}function J(u,n){if(u.opt.xmlns){var M=u.tag,w=ie(u.tagName);M.prefix=w.prefix,M.local=w.local,M.uri=M.ns[w.prefix]||"",M.prefix&&!M.uri&&(S(u,"Unbound namespace prefix: "+JSON.stringify(u.tagName)),M.uri=w.prefix);var R=u.tags[u.tags.length-1]||u;M.ns&&R.ns!==M.ns&&Object.keys(M.ns).forEach(function(sr){_(u,"onopennamespace",{prefix:sr,uri:M.ns[sr]})});for(var q=0,U=u.attribList.length;q<U;q++){var k=u.attribList[q],$=k[0],tt=k[1],V=ie($,!0),H=V.prefix,wn=V.local,or=H===""?"":M.ns[H]||"",ue={name:$,value:tt,prefix:H,local:wn,uri:or};H&&H!=="xmlns"&&!or&&(S(u,"Unbound namespace prefix: "+JSON.stringify(H)),ue.uri=H),u.tag.attributes[$]=ue,_(u,"onattribute",ue)}u.attribList.length=0}u.tag.isSelfClosing=!!n,u.sawRoot=!0,u.tags.push(u.tag),_(u,"onopentag",u.tag),n||(!u.noscript&&u.tagName.toLowerCase()==="script"?u.state=r.SCRIPT:u.state=r.TEXT,u.tag=null,u.tagName=""),u.attribName=u.attribValue="",u.attribList.length=0}function se(u){if(!u.tagName){S(u,"Weird empty close tag."),u.textNode+="</>",u.state=r.TEXT;return}if(u.script){if(u.tagName!=="script"){u.script+="</"+u.tagName+">",u.tagName="",u.state=r.SCRIPT;return}_(u,"onscript",u.script),u.script=""}var n=u.tags.length,M=u.tagName;u.strict||(M=M[u.looseCase]());for(var w=M;n--;){var R=u.tags[n];if(R.name!==w)S(u,"Unexpected close tag");else break}if(n<0){S(u,"Unmatched closing tag: "+u.tagName),u.textNode+="</"+u.tagName+">",u.state=r.TEXT;return}u.tagName=M;for(var q=u.tags.length;q-- >n;){var U=u.tag=u.tags.pop();u.tagName=u.tag.name,_(u,"onclosetag",u.tagName);var k={};for(var $ in U.ns)k[$]=U.ns[$];var tt=u.tags[u.tags.length-1]||u;u.opt.xmlns&&U.ns!==tt.ns&&Object.keys(U.ns).forEach(function(V){var H=U.ns[V];_(u,"onclosenamespace",{prefix:V,uri:H})})}n===0&&(u.closedRoot=!0),u.tagName=u.attribValue=u.attribName="",u.attribList.length=0,u.state=r.TEXT}function mn(u){var n=u.entity,M=n.toLowerCase(),w,R="";return u.ENTITIES[n]?u.ENTITIES[n]:u.ENTITIES[M]?u.ENTITIES[M]:(n=M,n.charAt(0)==="#"&&(n.charAt(1)==="x"?(n=n.slice(2),w=parseInt(n,16),R=w.toString(16)):(n=n.slice(1),w=parseInt(n,10),R=w.toString(10))),n=n.replace(/^0+/,""),isNaN(w)||R.toLowerCase()!==n?(S(u,"Invalid character entity"),"&"+u.entity+";"):String.fromCodePoint(w))}function nr(u,n){n==="<"?(u.state=r.OPEN_WAKA,u.startTagPosition=u.position):c(n)||(S(u,"Non-whitespace before first tag."),u.textNode=n,u.state=r.TEXT)}function ir(u,n){var M="";return n<u.length&&(M=u.charAt(n)),M}function gn(u){var n=this;if(this.error)throw this.error;if(n.closed)return j(n,"Cannot write after close. Assign an onready handler.");if(u===null)return X(n);typeof u=="object"&&(u=u.toString());for(var M=0,w="";w=ir(u,M++),n.c=w,!!w;)switch(n.trackPosition&&(n.position++,w===`
|
|
10
|
+
`?(n.line++,n.column=0):n.column++),n.state){case r.BEGIN:if(n.state=r.BEGIN_WHITESPACE,w==="\uFEFF")continue;nr(n,w);continue;case r.BEGIN_WHITESPACE:nr(n,w);continue;case r.TEXT:if(n.sawRoot&&!n.closedRoot){for(var R=M-1;w&&w!=="<"&&w!=="&";)w=ir(u,M++),w&&n.trackPosition&&(n.position++,w===`
|
|
11
|
+
`?(n.line++,n.column=0):n.column++);n.textNode+=u.substring(R,M-1)}w==="<"&&!(n.sawRoot&&n.closedRoot&&!n.strict)?(n.state=r.OPEN_WAKA,n.startTagPosition=n.position):(!c(w)&&(!n.sawRoot||n.closedRoot)&&S(n,"Text data outside of root node."),w==="&"?n.state=r.TEXT_ENTITY:n.textNode+=w);continue;case r.SCRIPT:w==="<"?n.state=r.SCRIPT_ENDING:n.script+=w;continue;case r.SCRIPT_ENDING:w==="/"?n.state=r.CLOSE_TAG:(n.script+="<"+w,n.state=r.SCRIPT);continue;case r.OPEN_WAKA:if(w==="!")n.state=r.SGML_DECL,n.sgmlDecl="";else if(!c(w))if(L(x,w))n.state=r.OPEN_TAG,n.tagName=w;else if(w==="/")n.state=r.CLOSE_TAG,n.tagName="";else if(w==="?")n.state=r.PROC_INST,n.procInstName=n.procInstBody="";else{if(S(n,"Unencoded <"),n.startTagPosition+1<n.position){var q=n.position-n.startTagPosition;w=new Array(q).join(" ")+w}n.textNode+="<"+w,n.state=r.TEXT}continue;case r.SGML_DECL:if(n.sgmlDecl+w==="--"){n.state=r.COMMENT,n.comment="",n.sgmlDecl="";continue}n.doctype&&n.doctype!==!0&&n.sgmlDecl?(n.state=r.DOCTYPE_DTD,n.doctype+="<!"+n.sgmlDecl+w,n.sgmlDecl=""):(n.sgmlDecl+w).toUpperCase()===y?(_(n,"onopencdata"),n.state=r.CDATA,n.sgmlDecl="",n.cdata=""):(n.sgmlDecl+w).toUpperCase()===d?(n.state=r.DOCTYPE,(n.doctype||n.sawRoot)&&S(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):w===">"?(_(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=r.TEXT):(f(w)&&(n.state=r.SGML_DECL_QUOTED),n.sgmlDecl+=w);continue;case r.SGML_DECL_QUOTED:w===n.q&&(n.state=r.SGML_DECL,n.q=""),n.sgmlDecl+=w;continue;case r.DOCTYPE:w===">"?(n.state=r.TEXT,_(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=w,w==="["?n.state=r.DOCTYPE_DTD:f(w)&&(n.state=r.DOCTYPE_QUOTED,n.q=w));continue;case r.DOCTYPE_QUOTED:n.doctype+=w,w===n.q&&(n.q="",n.state=r.DOCTYPE);continue;case r.DOCTYPE_DTD:w==="]"?(n.doctype+=w,n.state=r.DOCTYPE):w==="<"?(n.state=r.OPEN_WAKA,n.startTagPosition=n.position):f(w)?(n.doctype+=w,n.state=r.DOCTYPE_DTD_QUOTED,n.q=w):n.doctype+=w;continue;case r.DOCTYPE_DTD_QUOTED:n.doctype+=w,w===n.q&&(n.state=r.DOCTYPE_DTD,n.q="");continue;case r.COMMENT:w==="-"?n.state=r.COMMENT_ENDING:n.comment+=w;continue;case r.COMMENT_ENDING:w==="-"?(n.state=r.COMMENT_ENDED,n.comment=F(n.opt,n.comment),n.comment&&_(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+w,n.state=r.COMMENT);continue;case r.COMMENT_ENDED:w!==">"?(S(n,"Malformed comment"),n.comment+="--"+w,n.state=r.COMMENT):n.doctype&&n.doctype!==!0?n.state=r.DOCTYPE_DTD:n.state=r.TEXT;continue;case r.CDATA:w==="]"?n.state=r.CDATA_ENDING:n.cdata+=w;continue;case r.CDATA_ENDING:w==="]"?n.state=r.CDATA_ENDING_2:(n.cdata+="]"+w,n.state=r.CDATA);continue;case r.CDATA_ENDING_2:w===">"?(n.cdata&&_(n,"oncdata",n.cdata),_(n,"onclosecdata"),n.cdata="",n.state=r.TEXT):w==="]"?n.cdata+="]":(n.cdata+="]]"+w,n.state=r.CDATA);continue;case r.PROC_INST:w==="?"?n.state=r.PROC_INST_ENDING:c(w)?n.state=r.PROC_INST_BODY:n.procInstName+=w;continue;case r.PROC_INST_BODY:if(!n.procInstBody&&c(w))continue;w==="?"?n.state=r.PROC_INST_ENDING:n.procInstBody+=w;continue;case r.PROC_INST_ENDING:w===">"?(_(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=r.TEXT):(n.procInstBody+="?"+w,n.state=r.PROC_INST_BODY);continue;case r.OPEN_TAG:L(P,w)?n.tagName+=w:(yn(n),w===">"?J(n):w==="/"?n.state=r.OPEN_TAG_SLASH:(c(w)||S(n,"Invalid character in tag name"),n.state=r.ATTRIB));continue;case r.OPEN_TAG_SLASH:w===">"?(J(n,!0),se(n)):(S(n,"Forward-slash in opening tag not followed by >"),n.state=r.ATTRIB);continue;case r.ATTRIB:if(c(w))continue;w===">"?J(n):w==="/"?n.state=r.OPEN_TAG_SLASH:L(x,w)?(n.attribName=w,n.attribValue="",n.state=r.ATTRIB_NAME):S(n,"Invalid attribute name");continue;case r.ATTRIB_NAME:w==="="?n.state=r.ATTRIB_VALUE:w===">"?(S(n,"Attribute without value"),n.attribValue=n.attribName,oe(n),J(n)):c(w)?n.state=r.ATTRIB_NAME_SAW_WHITE:L(P,w)?n.attribName+=w:S(n,"Invalid attribute name");continue;case r.ATTRIB_NAME_SAW_WHITE:if(w==="=")n.state=r.ATTRIB_VALUE;else{if(c(w))continue;S(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",_(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",w===">"?J(n):L(x,w)?(n.attribName=w,n.state=r.ATTRIB_NAME):(S(n,"Invalid attribute name"),n.state=r.ATTRIB)}continue;case r.ATTRIB_VALUE:if(c(w))continue;f(w)?(n.q=w,n.state=r.ATTRIB_VALUE_QUOTED):(n.opt.unquotedAttributeValues||j(n,"Unquoted attribute value"),n.state=r.ATTRIB_VALUE_UNQUOTED,n.attribValue=w);continue;case r.ATTRIB_VALUE_QUOTED:if(w!==n.q){w==="&"?n.state=r.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=w;continue}oe(n),n.q="",n.state=r.ATTRIB_VALUE_CLOSED;continue;case r.ATTRIB_VALUE_CLOSED:c(w)?n.state=r.ATTRIB:w===">"?J(n):w==="/"?n.state=r.OPEN_TAG_SLASH:L(x,w)?(S(n,"No whitespace between attributes"),n.attribName=w,n.attribValue="",n.state=r.ATTRIB_NAME):S(n,"Invalid attribute name");continue;case r.ATTRIB_VALUE_UNQUOTED:if(!T(w)){w==="&"?n.state=r.ATTRIB_VALUE_ENTITY_U:n.attribValue+=w;continue}oe(n),w===">"?J(n):n.state=r.ATTRIB;continue;case r.CLOSE_TAG:if(n.tagName)w===">"?se(n):L(P,w)?n.tagName+=w:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=r.SCRIPT):(c(w)||S(n,"Invalid tagname in closing tag"),n.state=r.CLOSE_TAG_SAW_WHITE);else{if(c(w))continue;v(x,w)?n.script?(n.script+="</"+w,n.state=r.SCRIPT):S(n,"Invalid tagname in closing tag."):n.tagName=w}continue;case r.CLOSE_TAG_SAW_WHITE:if(c(w))continue;w===">"?se(n):S(n,"Invalid characters in closing tag");continue;case r.TEXT_ENTITY:case r.ATTRIB_VALUE_ENTITY_Q:case r.ATTRIB_VALUE_ENTITY_U:var U,k;switch(n.state){case r.TEXT_ENTITY:U=r.TEXT,k="textNode";break;case r.ATTRIB_VALUE_ENTITY_Q:U=r.ATTRIB_VALUE_QUOTED,k="attribValue";break;case r.ATTRIB_VALUE_ENTITY_U:U=r.ATTRIB_VALUE_UNQUOTED,k="attribValue";break}if(w===";"){var $=mn(n);n.opt.unparsedEntities&&!Object.values(a.XML_ENTITIES).includes($)?(n.entity="",n.state=U,n.write($)):(n[k]+=$,n.entity="",n.state=U)}else L(n.entity.length?s:E,w)?n.entity+=w:(S(n,"Invalid character in entity name"),n[k]+="&"+n.entity+w,n.entity="",n.state=U);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&h(n),n}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var u=String.fromCharCode,n=Math.floor,M=function(){var w=16384,R=[],q,U,k=-1,$=arguments.length;if(!$)return"";for(var tt="";++k<$;){var V=Number(arguments[k]);if(!isFinite(V)||V<0||V>1114111||n(V)!==V)throw RangeError("Invalid code point: "+V);V<=65535?R.push(V):(V-=65536,q=(V>>10)+55296,U=V%1024+56320,R.push(q,U)),(k+1===$||R.length>w)&&(tt+=u.apply(null,R),R.length=0)}return tt};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:M,configurable:!0,writable:!0}):String.fromCodePoint=M}()})(i)}(ee)),ee}var jt={exports:{}},He;function Kr(){if(He)return jt.exports;He=1;var i=typeof Reflect=="object"?Reflect:null,a=i&&typeof i.apply=="function"?i.apply:function(f,T,L){return Function.prototype.apply.call(f,T,L)},D;i&&typeof i.ownKeys=="function"?D=i.ownKeys:Object.getOwnPropertySymbols?D=function(f){return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f))}:D=function(f){return Object.getOwnPropertyNames(f)};function p(c){console&&console.warn&&console.warn(c)}var h=Number.isNaN||function(f){return f!==f};function t(){t.init.call(this)}jt.exports=t,jt.exports.once=P,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var e=10;function o(c){if(typeof c!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof c)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return e},set:function(c){if(typeof c!="number"||c<0||h(c))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+c+".");e=c}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(f){if(typeof f!="number"||f<0||h(f))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+f+".");return this._maxListeners=f,this};function l(c){return c._maxListeners===void 0?t.defaultMaxListeners:c._maxListeners}t.prototype.getMaxListeners=function(){return l(this)},t.prototype.emit=function(f){for(var T=[],L=1;L<arguments.length;L++)T.push(arguments[L]);var v=f==="error",r=this._events;if(r!==void 0)v=v&&r.error===void 0;else if(!v)return!1;if(v){var N;if(T.length>0&&(N=T[0]),N instanceof Error)throw N;var A=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw A.context=N,A}var _=r[f];if(_===void 0)return!1;if(typeof _=="function")a(_,this,T);else for(var C=_.length,F=O(_,C),L=0;L<C;++L)a(F[L],this,T);return!0};function b(c,f,T,L){var v,r,N;if(o(T),r=c._events,r===void 0?(r=c._events=Object.create(null),c._eventsCount=0):(r.newListener!==void 0&&(c.emit("newListener",f,T.listener?T.listener:T),r=c._events),N=r[f]),N===void 0)N=r[f]=T,++c._eventsCount;else if(typeof N=="function"?N=r[f]=L?[T,N]:[N,T]:L?N.unshift(T):N.push(T),v=l(c),v>0&&N.length>v&&!N.warned){N.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(f)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=c,A.type=f,A.count=N.length,p(A)}return c}t.prototype.addListener=function(f,T){return b(this,f,T,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(f,T){return b(this,f,T,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(c,f,T){var L={fired:!1,wrapFn:void 0,target:c,type:f,listener:T},v=m.bind(L);return v.listener=T,L.wrapFn=v,v}t.prototype.once=function(f,T){return o(T),this.on(f,y(this,f,T)),this},t.prototype.prependOnceListener=function(f,T){return o(T),this.prependListener(f,y(this,f,T)),this},t.prototype.removeListener=function(f,T){var L,v,r,N,A;if(o(T),v=this._events,v===void 0)return this;if(L=v[f],L===void 0)return this;if(L===T||L.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete v[f],v.removeListener&&this.emit("removeListener",f,L.listener||T));else if(typeof L!="function"){for(r=-1,N=L.length-1;N>=0;N--)if(L[N]===T||L[N].listener===T){A=L[N].listener,r=N;break}if(r<0)return this;r===0?L.shift():I(L,r),L.length===1&&(v[f]=L[0]),v.removeListener!==void 0&&this.emit("removeListener",f,A||T)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(f){var T,L,v;if(L=this._events,L===void 0)return this;if(L.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):L[f]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete L[f]),this;if(arguments.length===0){var r=Object.keys(L),N;for(v=0;v<r.length;++v)N=r[v],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=L[f],typeof T=="function")this.removeListener(f,T);else if(T!==void 0)for(v=T.length-1;v>=0;v--)this.removeListener(f,T[v]);return this};function d(c,f,T){var L=c._events;if(L===void 0)return[];var v=L[f];return v===void 0?[]:typeof v=="function"?T?[v.listener||v]:[v]:T?x(v):O(v,v.length)}t.prototype.listeners=function(f){return d(this,f,!0)},t.prototype.rawListeners=function(f){return d(this,f,!1)},t.listenerCount=function(c,f){return typeof c.listenerCount=="function"?c.listenerCount(f):g.call(c,f)},t.prototype.listenerCount=g;function g(c){var f=this._events;if(f!==void 0){var T=f[c];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function O(c,f){for(var T=new Array(f),L=0;L<f;++L)T[L]=c[L];return T}function I(c,f){for(;f+1<c.length;f++)c[f]=c[f+1];c.pop()}function x(c){for(var f=new Array(c.length),T=0;T<f.length;++T)f[T]=c[T].listener||c[T];return f}function P(c,f){return new Promise(function(T,L){function v(N){c.removeListener(f,r),L(N)}function r(){typeof c.removeListener=="function"&&c.removeListener("error",v),T([].slice.call(arguments))}s(c,f,r,{once:!0}),f!=="error"&&E(c,v,{once:!0})})}function E(c,f,T){typeof c.on=="function"&&s(c,"error",f,T)}function s(c,f,T,L){if(typeof c.on=="function")L.once?c.once(f,T):c.on(f,T);else if(typeof c.addEventListener=="function")c.addEventListener(f,function v(r){L.once&&c.removeEventListener(f,v),T(r)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof c)}return jt.exports}var Bt={},Qe;function zr(){return Qe||(Qe=1,(function(){Bt.stripBOM=function(i){return i[0]==="\uFEFF"?i.substring(1):i}}).call(Bt)),Bt}var Z={},Ze;function Je(){return Ze||(Ze=1,(function(){var i;i=new RegExp(/(?!xmlns)^.*:/),Z.normalize=function(a){return a.toLowerCase()},Z.firstCharLowerCase=function(a){return a.charAt(0).toLowerCase()+a.slice(1)},Z.stripPrefix=function(a){return a.replace(i,"")},Z.parseNumbers=function(a){return isNaN(a)||(a=a%1===0?parseInt(a,10):parseFloat(a)),a},Z.parseBooleans=function(a){return/^(?:true|false)$/i.test(a)&&(a=a.toLowerCase()==="true"),a}}).call(Z)),Z}var tr;function Hr(){return tr||(tr=1,function(i){(function(){var a,D,p,h,t,e,o,l,b,m=function(g,O){return function(){return g.apply(O,arguments)}},y=function(g,O){for(var I in O)d.call(O,I)&&(g[I]=O[I]);function x(){this.constructor=g}return x.prototype=O.prototype,g.prototype=new x,g.__super__=O.prototype,g},d={}.hasOwnProperty;l=Yr(),h=Kr(),a=zr(),o=Je(),b=re.setImmediate,D=qt().defaults,t=function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},e=function(g,O,I){var x,P,E;for(x=0,P=g.length;x<P;x++)E=g[x],O=E(O,I);return O},p=function(g,O,I){var x;return x=Object.create(null),x.value=I,x.writable=!0,x.enumerable=!0,x.configurable=!0,Object.defineProperty(g,O,x)},i.Parser=function(g){y(O,g);function O(I){this.parseStringPromise=m(this.parseStringPromise,this),this.parseString=m(this.parseString,this),this.reset=m(this.reset,this),this.assignOrPush=m(this.assignOrPush,this),this.processAsync=m(this.processAsync,this);var x,P,E;if(!(this instanceof i.Parser))return new i.Parser(I);this.options={},P=D["0.2"];for(x in P)d.call(P,x)&&(E=P[x],this.options[x]=E);for(x in I)d.call(I,x)&&(E=I[x],this.options[x]=E);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return O.prototype.processAsync=function(){var I,x;try{return this.remaining.length<=this.options.chunkSize?(I=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(I),this.saxParser.close()):(I=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(I),b(this.processAsync))}catch(P){if(x=P,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(x)}},O.prototype.assignOrPush=function(I,x,P){return x in I?(I[x]instanceof Array||p(I,x,[I[x]]),I[x].push(P)):this.options.explicitArray?p(I,x,[P]):p(I,x,P)},O.prototype.reset=function(){var I,x,P,E;return this.removeAllListeners(),this.saxParser=l.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(s){return function(c){if(s.saxParser.resume(),!s.saxParser.errThrown)return s.saxParser.errThrown=!0,s.emit("error",c)}}(this),this.saxParser.onend=function(s){return function(){if(!s.saxParser.ended)return s.saxParser.ended=!0,s.emit("end",s.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,E=[],I=this.options.attrkey,x=this.options.charkey,this.saxParser.onopentag=function(s){return function(c){var f,T,L,v,r;if(L={},L[x]="",!s.options.ignoreAttrs){r=c.attributes;for(f in r)d.call(r,f)&&(!(I in L)&&!s.options.mergeAttrs&&(L[I]={}),T=s.options.attrValueProcessors?e(s.options.attrValueProcessors,c.attributes[f],f):c.attributes[f],v=s.options.attrNameProcessors?e(s.options.attrNameProcessors,f):f,s.options.mergeAttrs?s.assignOrPush(L,v,T):p(L[I],v,T))}return L["#name"]=s.options.tagNameProcessors?e(s.options.tagNameProcessors,c.name):c.name,s.options.xmlns&&(L[s.options.xmlnskey]={uri:c.uri,local:c.local}),E.push(L)}}(this),this.saxParser.onclosetag=function(s){return function(){var c,f,T,L,v,r,N,A,_,C;if(r=E.pop(),v=r["#name"],(!s.options.explicitChildren||!s.options.preserveChildrenOrder)&&delete r["#name"],r.cdata===!0&&(c=r.cdata,delete r.cdata),_=E[E.length-1],r[x].match(/^\s*$/)&&!c?(f=r[x],delete r[x]):(s.options.trim&&(r[x]=r[x].trim()),s.options.normalize&&(r[x]=r[x].replace(/\s{2,}/g," ").trim()),r[x]=s.options.valueProcessors?e(s.options.valueProcessors,r[x],v):r[x],Object.keys(r).length===1&&x in r&&!s.EXPLICIT_CHARKEY&&(r=r[x])),t(r)&&(typeof s.options.emptyTag=="function"?r=s.options.emptyTag():r=s.options.emptyTag!==""?s.options.emptyTag:f),s.options.validator!=null&&(C="/"+function(){var F,j,X;for(X=[],F=0,j=E.length;F<j;F++)L=E[F],X.push(L["#name"]);return X}().concat(v).join("/"),function(){var F;try{return r=s.options.validator(C,_&&_[v],r)}catch(j){return F=j,s.emit("error",F)}}()),s.options.explicitChildren&&!s.options.mergeAttrs&&typeof r=="object"){if(!s.options.preserveChildrenOrder)L={},s.options.attrkey in r&&(L[s.options.attrkey]=r[s.options.attrkey],delete r[s.options.attrkey]),!s.options.charsAsChildren&&s.options.charkey in r&&(L[s.options.charkey]=r[s.options.charkey],delete r[s.options.charkey]),Object.getOwnPropertyNames(r).length>0&&(L[s.options.childkey]=r),r=L;else if(_){_[s.options.childkey]=_[s.options.childkey]||[],N={};for(T in r)d.call(r,T)&&p(N,T,r[T]);_[s.options.childkey].push(N),delete r["#name"],Object.keys(r).length===1&&x in r&&!s.EXPLICIT_CHARKEY&&(r=r[x])}}return E.length>0?s.assignOrPush(_,v,r):(s.options.explicitRoot&&(A=r,r={},p(r,v,A)),s.resultObject=r,s.saxParser.ended=!0,s.emit("end",s.resultObject))}}(this),P=function(s){return function(c){var f,T;if(T=E[E.length-1],T)return T[x]+=c,s.options.explicitChildren&&s.options.preserveChildrenOrder&&s.options.charsAsChildren&&(s.options.includeWhiteChars||c.replace(/\\n/g,"").trim()!=="")&&(T[s.options.childkey]=T[s.options.childkey]||[],f={"#name":"__text__"},f[x]=c,s.options.normalize&&(f[x]=f[x].replace(/\s{2,}/g," ").trim()),T[s.options.childkey].push(f)),T}}(this),this.saxParser.ontext=P,this.saxParser.oncdata=function(s){return function(c){var f;if(f=P(c),f)return f.cdata=!0}}()},O.prototype.parseString=function(I,x){var P;x!=null&&typeof x=="function"&&(this.on("end",function(E){return this.reset(),x(null,E)}),this.on("error",function(E){return this.reset(),x(E)}));try{return I=I.toString(),I.trim()===""?(this.emit("end",null),!0):(I=a.stripBOM(I),this.options.async?(this.remaining=I,b(this.processAsync),this.saxParser):this.saxParser.write(I).close())}catch(E){if(P=E,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw P}else return this.emit("error",P),this.saxParser.errThrown=!0}},O.prototype.parseStringPromise=function(I){return new Promise(function(x){return function(P,E){return x.parseString(I,function(s,c){return s?E(s):P(c)})}}(this))},O}(h),i.parseString=function(g,O,I){var x,P,E;return I!=null?(typeof I=="function"&&(x=I),typeof O=="object"&&(P=O)):(typeof O=="function"&&(x=O),P={}),E=new i.Parser(P),E.parseString(g,x)},i.parseStringPromise=function(g,O){var I,x;return typeof O=="object"&&(I=O),x=new i.Parser(I),x.parseStringPromise(g)}}).call(Rt)}(Rt)),Rt}var er;function Qr(){return er||(er=1,(function(){var i,a,D,p,h=function(e,o){for(var l in o)t.call(o,l)&&(e[l]=o[l]);function b(){this.constructor=e}return b.prototype=o.prototype,e.prototype=new b,e.__super__=o.prototype,e},t={}.hasOwnProperty;a=qt(),i=Gr(),D=Hr(),p=Je(),G.defaults=a.defaults,G.processors=p,G.ValidationError=function(e){h(o,e);function o(l){this.message=l}return o}(Error),G.Builder=i.Builder,G.Parser=D.Parser,G.parseString=D.parseString,G.parseStringPromise=D.parseStringPromise}).call(G)),G}var Zr=Qr();const Jr=i=>i!==null&&typeof i=="object"&&i.hasOwnProperty("rss")&&typeof i.rss=="object"&&i.rss!==null&&i.rss.hasOwnProperty("channel")&&Array.isArray(i.rss.channel),tn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("title")&&Array.isArray(i.title)&&i.hasOwnProperty("description")&&Array.isArray(i.description)&&i.hasOwnProperty("link")&&Array.isArray(i.link)&&i.hasOwnProperty("image")&&Array.isArray(i.image)&&i.image.every(en)&&i.hasOwnProperty("generator")&&Array.isArray(i.generator)&&i.hasOwnProperty("lastBuildDate")&&Array.isArray(i.lastBuildDate)&&i.hasOwnProperty("atom:link")&&Array.isArray(i["atom:link"])&&i["atom:link"].every(rn)&&i.hasOwnProperty("copyright")&&Array.isArray(i.copyright)&&i.hasOwnProperty("language")&&Array.isArray(i.language)&&i.hasOwnProperty("webMaster")&&Array.isArray(i.webMaster)&&i.hasOwnProperty("itunes:owner")&&Array.isArray(i["itunes:owner"])&&i["itunes:owner"].every(nn)&&i.hasOwnProperty("itunes:author")&&Array.isArray(i["itunes:author"])&&i.hasOwnProperty("googleplay:owner")&&Array.isArray(i["googleplay:owner"])&&i.hasOwnProperty("googleplay:email")&&Array.isArray(i["googleplay:email"])&&i.hasOwnProperty("googleplay:author")&&Array.isArray(i["googleplay:author"])&&i.hasOwnProperty("item")&&Array.isArray(i.item)&&i.item.every(on),en=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("url")&&Array.isArray(i.url)&&i.hasOwnProperty("title")&&Array.isArray(i.title)&&i.hasOwnProperty("link")&&Array.isArray(i.link),rn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("$")&&typeof i.$=="object"&&i.$!==null&&i.$.hasOwnProperty("href")&&typeof i.$.href=="string"&&i.$.hasOwnProperty("rel")&&typeof i.$.rel=="string"&&i.$.hasOwnProperty("type")&&typeof i.$.type=="string",nn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("itunes:email")&&Array.isArray(i["itunes:email"])&&i.hasOwnProperty("itunes:name")&&Array.isArray(i["itunes:name"]),on=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("title")&&Array.isArray(i.title)&&i.hasOwnProperty("description")&&Array.isArray(i.description)&&i.hasOwnProperty("link")&&Array.isArray(i.link)&&i.hasOwnProperty("guid")&&Array.isArray(i.guid)&&i.guid.every(sn)&&i.hasOwnProperty("dc:creator")&&Array.isArray(i["dc:creator"])&&i.hasOwnProperty("pubDate")&&Array.isArray(i.pubDate)&&i.hasOwnProperty("enclosure")&&Array.isArray(i.enclosure)&&i.enclosure.every(un)&&i.hasOwnProperty("content:encoded")&&Array.isArray(i["content:encoded"]),sn=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("_")&&typeof i._=="string"&&i.hasOwnProperty("$")&&typeof i.$=="object"&&i.$!==null&&i.$.hasOwnProperty("isPermaLink")&&typeof i.$.isPermaLink=="string",un=i=>typeof i=="object"&&i!==null&&i.hasOwnProperty("$")&&typeof i.$=="object"&&i.$!==null&&i.$.hasOwnProperty("url")&&typeof i.$.url=="string"&&i.$.hasOwnProperty("length")&&typeof i.$.length=="string"&&i.$.hasOwnProperty("type")&&typeof i.$.type=="string",an=i=>i&&i.contents&&i.status.http_code==200,cn="https://api.allorigins.win/get?url=",ne=typeof document<"u",ln=async i=>{try{const a=ne?`${cn}${encodeURIComponent(i)}`:i,D=await fetch(a);if(D.ok)return ne?D.json():D.text()}catch{throw new Error("Error occurred fetching Feed from Substack")}},rr=async(i="",a)=>{Zr.parseString(i,a)},fn=i=>({title:i.title[0],description:i.description[0],link:i.link[0],pubDate:i.pubDate[0],content:i["content:encoded"][0]}),pn=async(i,a)=>{const D=await ln(i);if(!a)return D;if(!ne){await rr(D,a);return}if(!an(D))throw new Error("Error occurred fetching Feed from Substack");await rr(D.contents,a)},hn=(i,a)=>{if(!Jr(i))throw new Error("Feed is not in the correct format");try{return i.rss.channel.filter(tn).filter(D=>D.link[0]===a)}catch{throw new Error(`Error occurred fetching Feed by Link: ${a}`)}},dn=i=>i[0].item.map(fn);Q.getFeedByLink=hn,Q.getPosts=dn,Q.getSubstackFeed=pn,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
|