substack-feed-api 1.1.1 → 1.1.4
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 +572 -571
- package/dist/substackFeedApi.umd.cjs +6 -6
- package/package.json +8 -9
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(W,rt){typeof exports=="object"&&typeof module<"u"?rt(exports):typeof define=="function"&&define.amd?define(["exports"],rt):(W=typeof globalThis<"u"?globalThis:W||self,rt(W.SubstackFeedAPI={}))})(this,function(W){"use strict";function rt(n){if(n
|
|
2
|
-
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(nt)),nt}var it={},K={},z={},le;function H(){return le||(le=1,(function(){var n,a,g,h,p,t,e,o=[].slice,l={}.hasOwnProperty;n=function(){var b,m,y,d,w,O;if(O=arguments[0],w=2<=arguments.length?o.call(arguments,1):[],p(Object.assign))Object.assign.apply(null,arguments);else for(b=0,y=w.length;b<y;b++)if(d=w[b],d!=null)for(m in d)l.call(d,m)&&(O[m]=d[m]);return O},p=function(b){return!!b&&Object.prototype.toString.call(b)==="[object Function]"},t=function(b){var m;return!!b&&((m=typeof b)=="function"||m==="object")},g=function(b){return p(Array.isArray)?Array.isArray(b):Object.prototype.toString.call(b)==="[object Array]"},h=function(b){var m;if(g(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 p(b.valueOf)?b.valueOf():b},z.assign=n,z.isFunction=p,z.isObject=t,z.isArray=g,z.isEmpty=h,z.isPlainObject=e,z.getValue=a}).call(z)),z}var ot={exports:{}},lr=ot.exports,fe;function he(){return fe||(fe=1,(function(){ot.exports=function(){function n(){}return n.prototype.hasFeature=function(a,g){return!0},n.prototype.createDocumentType=function(a,g,h){throw new Error("This DOM method is not implemented.")},n.prototype.createDocument=function(a,g,h){throw new Error("This DOM method is not implemented.")},n.prototype.createHTMLDocument=function(a){throw new Error("This DOM method is not implemented.")},n.prototype.getFeature=function(a,g){throw new Error("This DOM method is not implemented.")},n}()}).call(lr)),ot.exports}var st={exports:{}},ut={exports:{}},at={exports:{}},fr=at.exports,pe;function hr(){return pe||(pe=1,(function(){at.exports=function(){function n(){}return n.prototype.handleError=function(a){throw new Error(a)},n}()}).call(fr)),at.exports}var ct={exports:{}},pr=ct.exports,de;function dr(){return de||(de=1,(function(){ct.exports=function(){function n(a){this.arr=a||[]}return Object.defineProperty(n.prototype,"length",{get:function(){return this.arr.length}}),n.prototype.item=function(a){return this.arr[a]||null},n.prototype.contains=function(a){return this.arr.indexOf(a)!==-1},n}()}).call(pr)),ct.exports}var yr=ut.exports,ye;function mr(){return ye||(ye=1,(function(){var n,a;n=hr(),a=dr(),ut.exports=function(){function g(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new n,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(g.prototype,"parameterNames",{get:function(){return new a(Object.keys(this.defaultParams))}}),g.prototype.getParameter=function(h){return this.params.hasOwnProperty(h)?this.params[h]:null},g.prototype.canSetParameter=function(h,p){return!0},g.prototype.setParameter=function(h,p){return p!=null?this.params[h]=p:delete this.params[h]},g}()}).call(yr)),ut.exports}var lt={exports:{}},ft={exports:{}},ht={exports:{}},gr=ht.exports,me;function B(){return me||(me=1,(function(){ht.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(gr)),ht.exports}var pt={exports:{}},wr=pt.exports,ge;function we(){return ge||(ge=1,(function(){var n;n=B(),G(),pt.exports=function(){function a(g,h,p){if(this.parent=g,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),h==null)throw new Error("Missing attribute name. "+this.debugInfo(h));this.name=this.stringify.name(h),this.value=this.stringify.attValue(p),this.type=n.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(g){return this.value=g||""}}),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(g){return this.options.writer.attribute(this,this.options.writer.filterOptions(g))},a.prototype.debugInfo=function(g){return g=g||this.name,g==null?"parent: <"+this.parent.name+">":"attribute: {"+g+"}, parent: <"+this.parent.name+">"},a.prototype.isEqualNode=function(g){return!(g.namespaceURI!==this.namespaceURI||g.prefix!==this.prefix||g.localName!==this.localName||g.value!==this.value)},a}()}).call(wr)),pt.exports}var dt={exports:{}},Tr=dt.exports,Te;function kt(){return Te||(Te=1,(function(){dt.exports=function(){function n(a){this.nodes=a}return Object.defineProperty(n.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),n.prototype.clone=function(){return this.nodes=null},n.prototype.getNamedItem=function(a){return this.nodes[a]},n.prototype.setNamedItem=function(a){var g;return g=this.nodes[a.nodeName],this.nodes[a.nodeName]=a,g||null},n.prototype.removeNamedItem=function(a){var g;return g=this.nodes[a],delete this.nodes[a],g||null},n.prototype.item=function(a){return this.nodes[Object.keys(this.nodes)[a]]||null},n.prototype.getNamedItemNS=function(a,g){throw new Error("This DOM method is not implemented.")},n.prototype.setNamedItemNS=function(a){throw new Error("This DOM method is not implemented.")},n.prototype.removeNamedItemNS=function(a,g){throw new Error("This DOM method is not implemented.")},n}()}).call(Tr)),dt.exports}var Dr=ft.exports,De;function $t(){return De||(De=1,(function(){var n,a,g,h,p,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function w(){this.constructor=m}return w.prototype=y.prototype,m.prototype=new w,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=H(),e=o.isObject,t=o.isFunction,p=o.getValue,h=G(),n=B(),a=we(),g=kt(),ft.exports=function(m){l(y,m);function y(d,w,O){var I,P,_,E;if(y.__super__.constructor.call(this,d),w==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(w),this.type=n.Element,this.attribs={},this.schemaTypeInfo=null,O!=null&&this.attribute(O),d.type===n.Document&&(this.isRoot=!0,this.documentObject=d,d.rootObject=this,d.children)){for(E=d.children,P=0,_=E.length;P<_;P++)if(I=E[P],I.type===n.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 g(this.attribs)),this.attributeMap}}),y.prototype.clone=function(){var d,w,O,I;O=Object.create(this),O.isRoot&&(O.documentObject=null),O.attribs={},I=this.attribs;for(w in I)b.call(I,w)&&(d=I[w],O.attribs[w]=d.clone());return O.children=[],this.children.forEach(function(P){var _;return _=P.clone(),_.parent=O,O.children.push(_)}),O},y.prototype.attribute=function(d,w){var O,I;if(d!=null&&(d=p(d)),e(d))for(O in d)b.call(d,O)&&(I=d[O],this.attribute(O,I));else t(w)&&(w=w.apply()),this.options.keepNullAttributes&&w==null?this.attribs[d]=new a(this,d,""):w!=null&&(this.attribs[d]=new a(this,d,w));return this},y.prototype.removeAttribute=function(d){var w,O,I;if(d==null)throw new Error("Missing attribute name. "+this.debugInfo());if(d=p(d),Array.isArray(d))for(O=0,I=d.length;O<I;O++)w=d[O],delete this.attribs[w];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,w){return this.attribute(d,w)},y.prototype.a=function(d,w){return this.attribute(d,w)},y.prototype.getAttribute=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d].value:null},y.prototype.setAttribute=function(d,w){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,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNS=function(d,w,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNS=function(d,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNodeNS=function(d,w){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,w){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,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttribute=function(d,w){return this.attribs.hasOwnProperty(d)?this.attribs[d].isId:w},y.prototype.setIdAttributeNS=function(d,w,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttributeNode=function(d,w){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,w){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 w,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(w=O=0,I=this.attribs.length-1;0<=I?O<=I:O>=I;w=0<=I?++O:--O)if(!this.attribs[w].isEqualNode(d.attribs[w]))return!1;return!0},y}(h)}).call(Dr)),ft.exports}var yt={exports:{}},mt={exports:{}},Er=mt.exports,Ee;function gt(){return Ee||(Ee=1,(function(){var n,a=function(h,p){for(var t in p)g.call(p,t)&&(h[t]=p[t]);function e(){this.constructor=h}return e.prototype=p.prototype,h.prototype=new e,h.__super__=p.prototype,h},g={}.hasOwnProperty;n=G(),mt.exports=function(h){a(p,h);function p(t){p.__super__.constructor.call(this,t),this.value=""}return Object.defineProperty(p.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(p.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(p.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),p.prototype.clone=function(){return Object.create(this)},p.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.replaceData=function(t,e,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.isEqualNode=function(t){return!(!p.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)||t.data!==this.data)},p}(n)}).call(Er)),mt.exports}var br=yt.exports,be;function Gt(){return be||(be=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;n=B(),a=gt(),yt.exports=function(p){g(t,p);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=n.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(br)),yt.exports}var wt={exports:{}},Or=wt.exports,Oe;function Wt(){return Oe||(Oe=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;n=B(),a=gt(),wt.exports=function(p){g(t,p);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=n.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(Or)),wt.exports}var Tt={exports:{}},Nr=Tt.exports,Ne;function Yt(){return Ne||(Ne=1,(function(){var n,a,g,h=function(t,e){for(var o in e)p.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},p={}.hasOwnProperty;g=H().isObject,a=G(),n=B(),Tt.exports=function(t){h(e,t);function e(o,l,b,m){var y;e.__super__.constructor.call(this,o),g(l)&&(y=l,l=y.version,b=y.encoding,m=y.standalone),l||(l="1.0"),this.type=n.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(Nr)),Tt.exports}var Dt={exports:{}},Et={exports:{}},vr=Et.exports,ve;function Kt(){return ve||(ve=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;a=G(),n=B(),Et.exports=function(p){g(t,p);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=n.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(vr)),Et.exports}var bt={exports:{}},Lr=bt.exports,Le;function zt(){return Le||(Le=1,(function(){var n,a,g,h=function(t,e){for(var o in e)p.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},p={}.hasOwnProperty;g=H().isObject,a=G(),n=B(),bt.exports=function(t){h(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=n.EntityDeclaration,!g(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(Lr)),bt.exports}var Ot={exports:{}},Ir=Ot.exports,Ie;function Ht(){return Ie||(Ie=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;a=G(),n=B(),Ot.exports=function(p){g(t,p);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=n.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(Ir)),Ot.exports}var Nt={exports:{}},Pr=Nt.exports,Pe;function Qt(){return Pe||(Pe=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;a=G(),n=B(),Nt.exports=function(p){g(t,p);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=n.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(Pr)),Nt.exports}var xr=Dt.exports,xe;function Zt(){return xe||(xe=1,(function(){var n,a,g,h,p,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function w(){this.constructor=m}return w.prototype=y.prototype,m.prototype=new w,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=H().isObject,e=G(),n=B(),a=Kt(),h=zt(),g=Ht(),p=Qt(),t=kt(),Dt.exports=function(m){l(y,m);function y(d,w,O){var I,P,_,E,s,c;if(y.__super__.constructor.call(this,d),this.type=n.DocType,d.children){for(E=d.children,P=0,_=E.length;P<_;P++)if(I=E[P],I.type===n.Element){this.name=I.name;break}}this.documentObject=d,o(w)&&(s=w,w=s.pubID,O=s.sysID),O==null&&(c=[w,O],O=c[0],w=c[1]),w!=null&&(this.pubID=this.stringify.dtdPubID(w)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return Object.defineProperty(y.prototype,"entities",{get:function(){var d,w,O,I,P;for(I={},P=this.children,w=0,O=P.length;w<O;w++)d=P[w],d.type===n.EntityDeclaration&&!d.pe&&(I[d.name]=d);return new t(I)}}),Object.defineProperty(y.prototype,"notations",{get:function(){var d,w,O,I,P;for(I={},P=this.children,w=0,O=P.length;w<O;w++)d=P[w],d.type===n.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,w){var O;return O=new g(this,d,w),this.children.push(O),this},y.prototype.attList=function(d,w,O,I,P){var _;return _=new a(this,d,w,O,I,P),this.children.push(_),this},y.prototype.entity=function(d,w){var O;return O=new h(this,!1,d,w),this.children.push(O),this},y.prototype.pEntity=function(d,w){var O;return O=new h(this,!0,d,w),this.children.push(O),this},y.prototype.notation=function(d,w){var O;return O=new p(this,d,w),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,w){return this.element(d,w)},y.prototype.att=function(d,w,O,I,P){return this.attList(d,w,O,I,P)},y.prototype.ent=function(d,w){return this.entity(d,w)},y.prototype.pent=function(d,w){return this.pEntity(d,w)},y.prototype.not=function(d,w){return this.notation(d,w)},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(xr)),Dt.exports}var vt={exports:{}},Ar=vt.exports,Ae;function Jt(){return Ae||(Ae=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;n=B(),a=G(),vt.exports=function(p){g(t,p);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=n.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(Ar)),vt.exports}var Lt={exports:{}},_r=Lt.exports,_e;function te(){return _e||(_e=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;n=B(),a=gt(),Lt.exports=function(p){g(t,p);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=n.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(_r)),Lt.exports}var It={exports:{}},Mr=It.exports,Me;function ee(){return Me||(Me=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;n=B(),a=gt(),It.exports=function(p){g(t,p);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=n.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(Mr)),It.exports}var Pt={exports:{}},Cr=Pt.exports,Ce;function Se(){return Ce||(Ce=1,(function(){var n,a,g=function(p,t){for(var e in t)h.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},h={}.hasOwnProperty;a=G(),n=B(),Pt.exports=function(p){g(t,p);function t(e){t.__super__.constructor.call(this,e),this.type=n.Dummy}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return""},t}(a)}).call(Cr)),Pt.exports}var xt={exports:{}},Sr=xt.exports,Fe;function Fr(){return Fe||(Fe=1,(function(){xt.exports=function(){function n(a){this.nodes=a}return Object.defineProperty(n.prototype,"length",{get:function(){return this.nodes.length||0}}),n.prototype.clone=function(){return this.nodes=null},n.prototype.item=function(a){return this.nodes[a]||null},n}()}).call(Sr)),xt.exports}var At={exports:{}},Xr=At.exports,Xe;function Rr(){return Xe||(Xe=1,(function(){At.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(Xr)),At.exports}var jr=lt.exports,Re;function G(){return Re||(Re=1,(function(){var n,a,g,h,p,t,e,o,l,b,m,y,d,w,O,I,P,_={}.hasOwnProperty;P=H(),I=P.isObject,O=P.isFunction,w=P.isEmpty,d=P.getValue,o=null,g=null,h=null,p=null,t=null,m=null,y=null,b=null,e=null,a=null,l=null,n=null,lt.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=$t(),g=Gt(),h=Wt(),p=Yt(),t=Zt(),m=Jt(),y=te(),b=ee(),e=Se(),a=B(),l=Fr(),kt(),n=Rr())}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,D,L;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){for(L="",D=this.children,c=0,f=D.length;c<f;c++)s=D[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,D,L,v;for(this.parent=s,s&&(this.options=s.options,this.stringify=s.stringify),L=this.children,v=[],f=0,D=L.length;f<D;f++)c=L[f],v.push(c.setParent(this));return v},E.prototype.element=function(s,c,f){var D,L,v,r,N,x,M,C,F,j,X;if(x=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,M=s.length;v<M;v++)L=s[v],x=this.element(L);else if(O(s))x=this.element(s.apply());else if(I(s)){for(N in s)if(_.call(s,N))if(X=s[N],O(X)&&(X=X.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&N.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(N.substr(this.stringify.convertAttKey.length),X);else if(!this.options.separateArrayItems&&Array.isArray(X)&&w(X))x=this.dummy();else if(I(X)&&w(X))x=this.element(N);else if(!this.options.keepNullNodes&&X==null)x=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(X))for(r=0,C=X.length;r<C;r++)L=X[r],D={},D[N]=L,x=this.element(D);else I(X)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&N.indexOf(this.stringify.convertTextKey)===0?x=this.element(X):(x=this.element(N),x.element(X)):x=this.element(N,X)}else!this.options.keepNullNodes&&f===null?x=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&s.indexOf(this.stringify.convertTextKey)===0?x=this.text(f):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&s.indexOf(this.stringify.convertCDataKey)===0?x=this.cdata(f):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&s.indexOf(this.stringify.convertCommentKey)===0?x=this.comment(f):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&s.indexOf(this.stringify.convertRawKey)===0?x=this.raw(f):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&s.indexOf(this.stringify.convertPIKey)===0?x=this.instruction(s.substr(this.stringify.convertPIKey.length),f):x=this.node(s,c,f);if(x==null)throw new Error("Could not create any elements with: "+s+". "+this.debugInfo());return x},E.prototype.insertBefore=function(s,c,f){var D,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),D=this.parent.element(s,c,f),Array.prototype.push.apply(this.parent.children,N),D},E.prototype.insertAfter=function(s,c,f){var D,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),D=this.parent.element(s,c,f),Array.prototype.push.apply(this.parent.children,v),D},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 D,L;return s!=null&&(s=d(s)),c||(c={}),c=d(c),I(c)||(L=[c,f],f=L[0],c=L[1]),D=new o(this,s,c),f!=null&&D.text(f),this.children.push(D),D},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 g(this,s),this.children.push(c),this},E.prototype.comment=function(s){var c;return c=new h(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,D,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)_.call(s,f)&&(D=s[f],this.instruction(f,D));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,D;return f=this.parent.children.indexOf(this),D=this.parent.children.splice(f),this.parent.instruction(s,c),Array.prototype.push.apply(this.parent.children,D),this},E.prototype.instructionAfter=function(s,c){var f,D;return f=this.parent.children.indexOf(this),D=this.parent.children.splice(f+1),this.parent.instruction(s,c),Array.prototype.push.apply(this.parent.children,D),this},E.prototype.declaration=function(s,c,f){var D,L;return D=this.document(),L=new p(D,s,c,f),D.children.length===0?D.children.unshift(L):D.children[0].type===a.Declaration?D.children[0]=L:D.children.unshift(L),D.root()||D},E.prototype.dtd=function(s,c){var f,D,L,v,r,N,x,M,C,F;for(D=this.document(),L=new t(D,s,c),C=D.children,v=r=0,x=C.length;r<x;v=++r)if(f=C[v],f.type===a.DocType)return D.children[v]=L,L;for(F=D.children,v=N=0,M=F.length;N<M;v=++N)if(f=F[v],f.isRoot)return D.children.splice(v,0,L),L;return D.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=n.Disconnected|n.ImplementationSpecific,Math.random()<.5?f|=n.Preceding:f|=n.Following,f):c.isAncestor(s)?n.Contains|n.Preceding:c.isDescendant(s)?n.Contains|n.Following:c.isPreceding(s)?n.Preceding:n.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,D;if(s.nodeType!==this.nodeType||s.children.length!==this.children.length)return!1;for(c=f=0,D=this.children.length-1;0<=D?f<=D:f>=D;c=0<=D?++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,D,L,v;for(v=this.children,D=0,L=v.length;D<L;D++)if(c=v[D],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(D){if(f++,!c&&D===s)return c=!0}),c?f:-1},E.prototype.foreachTreeNode=function(s,c){var f,D,L,v,r;for(s||(s=this.document()),v=s.children,D=0,L=v.length;D<L;D++){if(f=v[D],r=c(f))return r;if(r=this.foreachTreeNode(f,c),r)return r}},E}()}).call(jr)),lt.exports}var _t={exports:{}},Br=_t.exports,je;function Be(){return je||(je=1,(function(){var n=function(g,h){return function(){return g.apply(h,arguments)}},a={}.hasOwnProperty;_t.exports=function(){function g(h){this.assertLegalName=n(this.assertLegalName,this),this.assertLegalChar=n(this.assertLegalChar,this);var p,t,e;h||(h={}),this.options=h,this.options.version||(this.options.version="1.0"),t=h.stringify||{};for(p in t)a.call(t,p)&&(e=t[p],this[p]=e)}return g.prototype.name=function(h){return this.options.noValidation?h:this.assertLegalName(""+h||"")},g.prototype.text=function(h){return this.options.noValidation?h:this.assertLegalChar(this.textEscape(""+h||""))},g.prototype.cdata=function(h){return this.options.noValidation?h:(h=""+h||"",h=h.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(h))},g.prototype.comment=function(h){if(this.options.noValidation)return h;if(h=""+h||"",h.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+h);return this.assertLegalChar(h)},g.prototype.raw=function(h){return this.options.noValidation?h:""+h||""},g.prototype.attValue=function(h){return this.options.noValidation?h:this.assertLegalChar(this.attEscape(h=""+h||""))},g.prototype.insTarget=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.insValue=function(h){if(this.options.noValidation)return h;if(h=""+h||"",h.match(/\?>/))throw new Error("Invalid processing instruction value: "+h);return this.assertLegalChar(h)},g.prototype.xmlVersion=function(h){if(this.options.noValidation)return h;if(h=""+h||"",!h.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+h);return h},g.prototype.xmlEncoding=function(h){if(this.options.noValidation)return h;if(h=""+h||"",!h.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+h);return this.assertLegalChar(h)},g.prototype.xmlStandalone=function(h){return this.options.noValidation?h:h?"yes":"no"},g.prototype.dtdPubID=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.dtdSysID=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.dtdElementValue=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.dtdAttType=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.dtdAttDefault=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.dtdEntityValue=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.dtdNData=function(h){return this.options.noValidation?h:this.assertLegalChar(""+h||"")},g.prototype.convertAttKey="@",g.prototype.convertPIKey="?",g.prototype.convertTextKey="#text",g.prototype.convertCDataKey="#cdata",g.prototype.convertCommentKey="#comment",g.prototype.convertRawKey="#raw",g.prototype.assertLegalChar=function(h){var p,t;if(this.options.noValidation)return h;if(p="",this.options.version==="1.0"){if(p=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=h.match(p))throw new Error("Invalid character in string: "+h+" at index "+t.index)}else if(this.options.version==="1.1"&&(p=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=h.match(p)))throw new Error("Invalid character in string: "+h+" at index "+t.index);return h},g.prototype.assertLegalName=function(h){var p;if(this.options.noValidation)return h;if(this.assertLegalChar(h),p=/^([: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])*$/,!h.match(p))throw new Error("Invalid character in name");return h},g.prototype.textEscape=function(h){var p;return this.options.noValidation?h:(p=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,h.replace(p,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},g.prototype.attEscape=function(h){var p;return this.options.noValidation?h:(p=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,h.replace(p,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},g}()}).call(Br)),_t.exports}var Mt={exports:{}},Ct={exports:{}},St={exports:{}},qr=St.exports,qe;function Ft(){return qe||(qe=1,(function(){St.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(qr)),St.exports}var Ur=Ct.exports,Ue;function Ve(){return Ue||(Ue=1,(function(){var n,a,g,h={}.hasOwnProperty;g=H().assign,n=B(),Yt(),Zt(),Gt(),Wt(),$t(),Jt(),te(),ee(),Se(),Kt(),Ht(),zt(),Qt(),a=Ft(),Ct.exports=function(){function p(t){var e,o,l;t||(t={}),this.options=t,o=t.writer||{};for(e in o)h.call(o,e)&&(l=o[e],this["_"+e]=this[e],this[e]=l)}return p.prototype.filterOptions=function(t){var e,o,l,b,m,y,d,w;return t||(t={}),t=g({},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=(w=t.spaceBeforeSlash)!=null?w:t.spacebeforeslash)!=null?d:"",e.spaceBeforeSlash===!0&&(e.spaceBeforeSlash=" "),e.suppressPrettyCount=0,e.user={},e.state=a.None,e},p.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):""},p.prototype.endline=function(t,e,o){return!e.pretty||e.suppressPrettyCount?"":e.newline},p.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},p.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},p.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},p.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},p.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},p.prototype.element=function(t,e,o){var l,b,m,y,d,w,O,I,P,_,E,s,c,f;o||(o=0),_=!1,E="",this.openNode(t,e,o),e.state=a.OpenTag,E+=this.indent(t,e,o)+"<"+t.name,s=t.attribs;for(P in s)h.call(s,P)&&(l=s[P],E+=this.attribute(l,e,o));if(m=t.children.length,y=m===0?null:t.children[0],m===0||t.children.every(function(D){return(D.type===n.Text||D.type===n.Raw)&&D.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===n.Text||y.type===n.Raw)&&y.value!=null)E+=">",e.state=a.InsideTag,e.suppressPrettyCount++,_=!0,E+=this.writeChildNode(y,e,o+1),e.suppressPrettyCount--,_=!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===n.Text||b.type===n.Raw)&&b.value!=null){e.suppressPrettyCount++,_=!0;break}}for(E+=">"+this.endline(t,e,o),e.state=a.InsideTag,f=t.children,w=0,I=f.length;w<I;w++)b=f[w],E+=this.writeChildNode(b,e,o+1);e.state=a.CloseTag,E+=this.indent(t,e,o)+"</"+t.name+">",_&&e.suppressPrettyCount--,E+=this.endline(t,e,o),e.state=a.None}return this.closeNode(t,e,o),E},p.prototype.writeChildNode=function(t,e,o){switch(t.type){case n.CData:return this.cdata(t,e,o);case n.Comment:return this.comment(t,e,o);case n.Element:return this.element(t,e,o);case n.Raw:return this.raw(t,e,o);case n.Text:return this.text(t,e,o);case n.ProcessingInstruction:return this.processingInstruction(t,e,o);case n.Dummy:return"";case n.Declaration:return this.declaration(t,e,o);case n.DocType:return this.docType(t,e,o);case n.AttributeDeclaration:return this.dtdAttList(t,e,o);case n.ElementDeclaration:return this.dtdElement(t,e,o);case n.EntityDeclaration:return this.dtdEntity(t,e,o);case n.NotationDeclaration:return this.dtdNotation(t,e,o);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},p.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},p.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},p.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},p.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},p.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},p.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},p.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},p.prototype.openNode=function(t,e,o){},p.prototype.closeNode=function(t,e,o){},p.prototype.openAttribute=function(t,e,o){},p.prototype.closeAttribute=function(t,e,o){},p}()}).call(Ur)),Ct.exports}var Vr=Mt.exports,ke;function re(){return ke||(ke=1,(function(){var n,a=function(h,p){for(var t in p)g.call(p,t)&&(h[t]=p[t]);function e(){this.constructor=h}return e.prototype=p.prototype,h.prototype=new e,h.__super__=p.prototype,h},g={}.hasOwnProperty;n=Ve(),Mt.exports=function(h){a(p,h);function p(t){p.__super__.constructor.call(this,t)}return p.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},p}(n)}).call(Vr)),Mt.exports}var kr=st.exports,$e;function Ge(){return $e||($e=1,(function(){var n,a,g,h,p,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=H().isPlainObject,g=he(),a=mr(),h=G(),n=B(),t=Be(),p=re(),st.exports=function(b){o(m,b);function m(y){m.__super__.constructor.call(this,null),this.name="#document",this.type=n.Document,this.documentURI=null,this.domConfig=new a,y||(y={}),y.writer||(y.writer=new p),this.options=y,this.stringify=new t(y)}return Object.defineProperty(m.prototype,"implementation",{value:new g}),Object.defineProperty(m.prototype,"doctype",{get:function(){var y,d,w,O;for(O=this.children,d=0,w=O.length;d<w;d++)if(y=O[d],y.type===n.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===n.Declaration?this.children[0].encoding:null}}),Object.defineProperty(m.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===n.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(m.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===n.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,w){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,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(y,d,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m}(h)}).call(kr)),st.exports}var Xt={exports:{}},$r=Xt.exports,We;function Gr(){return We||(We=1,(function(){var n,a,g,h,p,t,e,o,l,b,m,y,d,w,O,I,P,_,E,s,c,f,D,L={}.hasOwnProperty;D=H(),c=D.isObject,s=D.isFunction,f=D.isPlainObject,E=D.getValue,n=B(),y=Ge(),d=$t(),h=Gt(),p=Wt(),O=Jt(),_=te(),w=ee(),b=Yt(),m=Zt(),t=Kt(),o=zt(),e=Ht(),l=Qt(),g=we(),P=Be(),I=re(),a=Ft(),Xt.exports=function(){function v(r,N,x){var M;this.name="?xml",this.type=n.Document,r||(r={}),M={},r.writer?f(r.writer)&&(M=r.writer,r.writer=new I):r.writer=new I,this.options=r,this.writer=r.writer,this.writerOptions=this.writer.filterOptions(M),this.stringify=new P(r),this.onDataCallback=N||function(){},this.onEndCallback=x||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,x,M,C,F,j,X,S;switch(r.type){case n.CData:this.cdata(r.value);break;case n.Comment:this.comment(r.value);break;case n.Element:M={},X=r.attribs;for(x in X)L.call(X,x)&&(N=X[x],M[x]=N.value);this.node(r.name,M);break;case n.Dummy:this.dummy();break;case n.Raw:this.raw(r.value);break;case n.Text:this.text(r.value);break;case n.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===n.Element&&this.up();return this},v.prototype.dummy=function(){return this},v.prototype.node=function(r,N,x){var M;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)||(M=[N,x],x=M[0],N=M[1]),this.currentNode=new d(this,r,N),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,x!=null&&this.text(x),this},v.prototype.element=function(r,N,x){var M,C,F,j,X,S;if(this.currentNode&&this.currentNode.type===n.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++)M=X[C],this.createChildNode(M),M.type===n.Element&&this.up();else this.node(r,N,x);return this},v.prototype.attribute=function(r,N){var x,M;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(x in r)L.call(r,x)&&(M=r[x],this.attribute(x,M));else s(N)&&(N=N.apply()),this.options.keepNullAttributes&&N==null?this.currentNode.attribs[r]=new g(this,r,""):N!=null&&(this.currentNode.attribs[r]=new g(this,r,N));return this},v.prototype.text=function(r){var N;return this.openCurrent(),N=new _(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 h(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 p(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 x,M,C,F,j;if(this.openCurrent(),r!=null&&(r=E(r)),N!=null&&(N=E(N)),Array.isArray(r))for(x=0,F=r.length;x<F;x++)M=r[x],this.instruction(M);else if(c(r))for(M in r)L.call(r,M)&&(C=r[M],this.instruction(M,C));else s(N)&&(N=N.apply()),j=new w(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,x){var M;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return M=new b(this,r,N,x),this.onData(this.writer.declaration(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.doctype=function(r,N,x){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,x),this.currentNode.rootNodeName=r,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},v.prototype.dtdElement=function(r,N){var x;return this.openCurrent(),x=new e(this,r,N),this.onData(this.writer.dtdElement(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.attList=function(r,N,x,M,C){var F;return this.openCurrent(),F=new t(this,r,N,x,M,C),this.onData(this.writer.dtdAttList(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.entity=function(r,N){var x;return this.openCurrent(),x=new o(this,!1,r,N),this.onData(this.writer.dtdEntity(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.pEntity=function(r,N){var x;return this.openCurrent(),x=new o(this,!0,r,N),this.onData(this.writer.dtdEntity(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.notation=function(r,N){var x;return this.openCurrent(),x=new l(this,r,N),this.onData(this.writer.dtdNotation(x,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,x,M,C;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===n.Element&&(this.root=r),x="",r.type===n.Element){this.writerOptions.state=a.OpenTag,x=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name,C=r.attribs;for(M in C)L.call(C,M)&&(N=C[M],x+=this.writer.attribute(N,this.writerOptions,this.currentLevel));x+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel),this.writerOptions.state=a.InsideTag}else this.writerOptions.state=a.OpenTag,x=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName,r.pubID&&r.sysID?x+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"':r.sysID&&(x+=' SYSTEM "'+r.sysID+'"'),r.children?(x+=" [",this.writerOptions.state=a.InsideTag):(this.writerOptions.state=a.CloseTag,x+=">"),x+=this.writer.endline(r,this.writerOptions,this.currentLevel);return this.onData(x,this.currentLevel),r.isOpen=!0}},v.prototype.closeNode=function(r){var N;if(!r.isClosed)return N="",this.writerOptions.state=a.CloseTag,r.type===n.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,x){return this.node(r,N,x)},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,x){return this.declaration(r,N,x)},v.prototype.dtd=function(r,N,x){return this.doctype(r,N,x)},v.prototype.e=function(r,N,x){return this.element(r,N,x)},v.prototype.n=function(r,N,x){return this.node(r,N,x)},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===n.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},v.prototype.a=function(){return this.currentNode&&this.currentNode.type===n.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($r)),Xt.exports}var Rt={exports:{}},Wr=Rt.exports,Ye;function Yr(){return Ye||(Ye=1,(function(){var n,a,g,h=function(t,e){for(var o in e)p.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},p={}.hasOwnProperty;n=B(),g=Ve(),a=Ft(),Rt.exports=function(t){h(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,w,O,I,P,_;for(I=o.children,m=y=0,w=I.length;y<w;m=++y)b=I[m],b.isLastRootNode=m===o.children.length-1;for(l=this.filterOptions(l),P=o.children,_=[],d=0,O=P.length;d<O;d++)b=P[d],_.push(this.writeChildNode(b,l,0));return _},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,w;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,w=o.children,y=0,d=w.length;y<d;y++)m=w[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,w,O,I,P,_,E;b||(b=0),this.openNode(o,l,b),l.state=a.OpenTag,this.stream.write(this.indent(o,l,b)+"<"+o.name),_=o.attribs;for(P in _)p.call(_,P)&&(m=_[P],this.attribute(m,l,b));if(d=o.children.length,w=d===0?null:o.children[0],d===0||o.children.every(function(s){return(s.type===n.Text||s.type===n.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&&(w.type===n.Text||w.type===n.Raw)&&w.value!=null)this.stream.write(">"),l.state=a.InsideTag,l.suppressPrettyCount++,this.writeChildNode(w,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}(g)}).call(Wr)),Rt.exports}var Ke;function Kr(){return Ke||(Ke=1,(function(){var n,a,g,h,p,t,e,o,l,b;b=H(),o=b.assign,l=b.isFunction,g=he(),h=Ge(),p=Gr(),e=re(),t=Yr(),n=B(),a=Ft(),K.create=function(m,y,d,w){var O,I;if(m==null)throw new Error("Root element needs a name.");return w=o({},y,d,w),O=new h(w),I=O.element(m),w.headless||(O.declaration(w),(w.pubID!=null||w.sysID!=null)&&O.dtd(w)),I},K.begin=function(m,y,d){var w;return l(m)&&(w=[m,y],y=w[0],d=w[1],m={}),y?new p(m,y,d):new h(m)},K.stringWriter=function(m){return new e(m)},K.streamWriter=function(m,y){return new t(m,y)},K.implementation=new g,K.nodeType=n,K.writerState=a}).call(K)),K}var ze;function zr(){return ze||(ze=1,(function(){var n,a,g,h,p,t={}.hasOwnProperty;n=Kr(),a=Vt().defaults,h=function(e){return typeof e=="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},p=function(e){return"<![CDATA["+g(e)+"]]>"},g=function(e){return e.replace("]]>","]]]]><![CDATA[>")},it.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(w){return function(O,I){var P,_,E,s,c,f;if(typeof I!="object")w.options.cdata&&h(I)?O.raw(p(I)):O.txt(I);else if(Array.isArray(I)){for(s in I)if(t.call(I,s)){_=I[s];for(c in _)E=_[c],O=m(O.ele(c),E).up()}}else for(c in I)if(t.call(I,c))if(_=I[c],c===l){if(typeof _=="object")for(P in _)f=_[P],O=O.att(P,f)}else if(c===b)w.options.cdata&&h(_)?O=O.raw(p(_)):O=O.txt(_);else if(Array.isArray(_))for(s in _)t.call(_,s)&&(E=_[s],typeof E=="string"?w.options.cdata&&h(E)?O=O.ele(c).raw(p(E)).up():O=O.ele(c,E).up():O=m(O.ele(c),E).up());else typeof _=="object"?O=m(O.ele(c),_).up():typeof _=="string"&&w.options.cdata&&h(_)?O=O.ele(c).raw(p(_)).up():(_==null&&(_=""),O=O.ele(c,_.toString()).up());return O}}(this),y=n.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(it)),it}var jt={},ne={};const ie=rt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var He;function Hr(){return He||(He=1,function(n){(function(a){a.parser=function(u,i){return new h(u,i)},a.SAXParser=h,a.SAXStream=m,a.createStream=b,a.MAX_BUFFER_LENGTH=64*1024;var g=["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 h(u,i){if(!(this instanceof h))return new h(u,i);var A=this;t(A),A.q=A.c="",A.bufferCheckPosition=a.MAX_BUFFER_LENGTH,A.opt=i||{},A.opt.lowercase=A.opt.lowercase||A.opt.lowercasetags,A.looseCase=A.opt.lowercase?"toLowerCase":"toUpperCase",A.tags=[],A.closed=A.closedRoot=A.sawRoot=!1,A.tag=A.error=null,A.strict=!!u,A.noscript=!!(u||A.opt.noscript),A.state=r.BEGIN,A.strictEntities=A.opt.strictEntities,A.ENTITIES=A.strictEntities?Object.create(a.XML_ENTITIES):Object.create(a.ENTITIES),A.attribList=[],A.opt.xmlns&&(A.ns=Object.create(I)),A.opt.unquotedAttributeValues===void 0&&(A.opt.unquotedAttributeValues=!u),A.trackPosition=A.opt.position!==!1,A.trackPosition&&(A.position=A.line=A.column=0),x(A,"onready")}Object.create||(Object.create=function(u){function i(){}i.prototype=u;var A=new i;return A}),Object.keys||(Object.keys=function(u){var i=[];for(var A in u)u.hasOwnProperty(A)&&i.push(A);return i});function p(u){for(var i=Math.max(a.MAX_BUFFER_LENGTH,10),A=0,T=0,R=g.length;T<R;T++){var q=u[g[T]].length;if(q>i)switch(g[T]){case"textNode":C(u);break;case"cdata":M(u,"oncdata",u.cdata),u.cdata="";break;case"script":M(u,"onscript",u.script),u.script="";break;default:j(u,"Max buffer length exceeded: "+g[T])}A=Math.max(A,q)}var U=a.MAX_BUFFER_LENGTH-A;u.bufferCheckPosition=U+u.position}function t(u){for(var i=0,A=g.length;i<A;i++)u[g[i]]=""}function e(u){C(u),u.cdata!==""&&(M(u,"oncdata",u.cdata),u.cdata=""),u.script!==""&&(M(u,"onscript",u.script),u.script="")}h.prototype={end:function(){X(this)},write:Ln,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){e(this)}};var o;try{o=ie.Stream}catch{o=function(){}}o||(o=function(){});var l=a.EVENTS.filter(function(u){return u!=="error"&&u!=="end"});function b(u,i){return new m(u,i)}function m(u,i){if(!(this instanceof m))return new m(u,i);o.apply(this),this._parser=new h(u,i),this.writable=!0,this.readable=!0;var A=this;this._parser.onend=function(){A.emit("end")},this._parser.onerror=function(T){A.emit("error",T),A._parser.error=null},this._decoder=null,l.forEach(function(T){Object.defineProperty(A,"on"+T,{get:function(){return A._parser["on"+T]},set:function(R){if(!R)return A.removeAllListeners(T),A._parser["on"+T]=R,R;A.on(T,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 i=ie.StringDecoder;this._decoder=new i("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,i){var A=this;return!A._parser["on"+u]&&l.indexOf(u)!==-1&&(A._parser["on"+u]=function(){var T=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);T.splice(0,0,u),A.emit.apply(A,T)}),o.prototype.on.call(A,u,i)};var y="[CDATA[",d="DOCTYPE",w="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",I={xml:w,xmlns:O},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]/,_=/[:_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
|
|
1
|
+
(function(W,rt){typeof exports=="object"&&typeof module<"u"?rt(exports):typeof define=="function"&&define.amd?define(["exports"],rt):(W=typeof globalThis<"u"?globalThis:W||self,rt(W.SubstackFeedAPI={}))})(this,function(W){"use strict";function rt(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var a=n.default;if(typeof a=="function"){var g=function f(){return this instanceof f?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};g.prototype=a.prototype}else g={};return Object.defineProperty(g,"__esModule",{value:!0}),Object.keys(n).forEach(function(f){var p=Object.getOwnPropertyDescriptor(n,f);Object.defineProperty(g,f,p.get?p:{enumerable:!0,get:function(){return n[f]}})}),g}var Y={},nt={},ce;function Vt(){return ce||(ce=1,(function(){nt.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(nt)),nt}var it={},K={},z={},le;function H(){return le||(le=1,(function(){var n,a,g,f,p,t,e,o=[].slice,l={}.hasOwnProperty;n=function(){var b,m,y,d,w,O;if(O=arguments[0],w=2<=arguments.length?o.call(arguments,1):[],p(Object.assign))Object.assign.apply(null,arguments);else for(b=0,y=w.length;b<y;b++)if(d=w[b],d!=null)for(m in d)l.call(d,m)&&(O[m]=d[m]);return O},p=function(b){return!!b&&Object.prototype.toString.call(b)==="[object Function]"},t=function(b){var m;return!!b&&((m=typeof b)=="function"||m==="object")},g=function(b){return p(Array.isArray)?Array.isArray(b):Object.prototype.toString.call(b)==="[object Array]"},f=function(b){var m;if(g(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 p(b.valueOf)?b.valueOf():b},z.assign=n,z.isFunction=p,z.isObject=t,z.isArray=g,z.isEmpty=f,z.isPlainObject=e,z.getValue=a}).call(z)),z}var ot={exports:{}},lr=ot.exports,fe;function he(){return fe||(fe=1,(function(){ot.exports=function(){function n(){}return n.prototype.hasFeature=function(a,g){return!0},n.prototype.createDocumentType=function(a,g,f){throw new Error("This DOM method is not implemented.")},n.prototype.createDocument=function(a,g,f){throw new Error("This DOM method is not implemented.")},n.prototype.createHTMLDocument=function(a){throw new Error("This DOM method is not implemented.")},n.prototype.getFeature=function(a,g){throw new Error("This DOM method is not implemented.")},n}()}).call(lr)),ot.exports}var st={exports:{}},ut={exports:{}},at={exports:{}},fr=at.exports,pe;function hr(){return pe||(pe=1,(function(){at.exports=function(){function n(){}return n.prototype.handleError=function(a){throw new Error(a)},n}()}).call(fr)),at.exports}var ct={exports:{}},pr=ct.exports,de;function dr(){return de||(de=1,(function(){ct.exports=function(){function n(a){this.arr=a||[]}return Object.defineProperty(n.prototype,"length",{get:function(){return this.arr.length}}),n.prototype.item=function(a){return this.arr[a]||null},n.prototype.contains=function(a){return this.arr.indexOf(a)!==-1},n}()}).call(pr)),ct.exports}var yr=ut.exports,ye;function mr(){return ye||(ye=1,(function(){var n,a;n=hr(),a=dr(),ut.exports=function(){function g(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new n,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(g.prototype,"parameterNames",{get:function(){return new a(Object.keys(this.defaultParams))}}),g.prototype.getParameter=function(f){return this.params.hasOwnProperty(f)?this.params[f]:null},g.prototype.canSetParameter=function(f,p){return!0},g.prototype.setParameter=function(f,p){return p!=null?this.params[f]=p:delete this.params[f]},g}()}).call(yr)),ut.exports}var lt={exports:{}},ft={exports:{}},ht={exports:{}},gr=ht.exports,me;function B(){return me||(me=1,(function(){ht.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(gr)),ht.exports}var pt={exports:{}},wr=pt.exports,ge;function we(){return ge||(ge=1,(function(){var n;n=B(),G(),pt.exports=function(){function a(g,f,p){if(this.parent=g,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(p),this.type=n.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(g){return this.value=g||""}}),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(g){return this.options.writer.attribute(this,this.options.writer.filterOptions(g))},a.prototype.debugInfo=function(g){return g=g||this.name,g==null?"parent: <"+this.parent.name+">":"attribute: {"+g+"}, parent: <"+this.parent.name+">"},a.prototype.isEqualNode=function(g){return!(g.namespaceURI!==this.namespaceURI||g.prefix!==this.prefix||g.localName!==this.localName||g.value!==this.value)},a}()}).call(wr)),pt.exports}var dt={exports:{}},Tr=dt.exports,Te;function kt(){return Te||(Te=1,(function(){dt.exports=function(){function n(a){this.nodes=a}return Object.defineProperty(n.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),n.prototype.clone=function(){return this.nodes=null},n.prototype.getNamedItem=function(a){return this.nodes[a]},n.prototype.setNamedItem=function(a){var g;return g=this.nodes[a.nodeName],this.nodes[a.nodeName]=a,g||null},n.prototype.removeNamedItem=function(a){var g;return g=this.nodes[a],delete this.nodes[a],g||null},n.prototype.item=function(a){return this.nodes[Object.keys(this.nodes)[a]]||null},n.prototype.getNamedItemNS=function(a,g){throw new Error("This DOM method is not implemented.")},n.prototype.setNamedItemNS=function(a){throw new Error("This DOM method is not implemented.")},n.prototype.removeNamedItemNS=function(a,g){throw new Error("This DOM method is not implemented.")},n}()}).call(Tr)),dt.exports}var Dr=ft.exports,De;function $t(){return De||(De=1,(function(){var n,a,g,f,p,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function w(){this.constructor=m}return w.prototype=y.prototype,m.prototype=new w,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=H(),e=o.isObject,t=o.isFunction,p=o.getValue,f=G(),n=B(),a=we(),g=kt(),ft.exports=function(m){l(y,m);function y(d,w,O){var I,P,_,E;if(y.__super__.constructor.call(this,d),w==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(w),this.type=n.Element,this.attribs={},this.schemaTypeInfo=null,O!=null&&this.attribute(O),d.type===n.Document&&(this.isRoot=!0,this.documentObject=d,d.rootObject=this,d.children)){for(E=d.children,P=0,_=E.length;P<_;P++)if(I=E[P],I.type===n.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 g(this.attribs)),this.attributeMap}}),y.prototype.clone=function(){var d,w,O,I;O=Object.create(this),O.isRoot&&(O.documentObject=null),O.attribs={},I=this.attribs;for(w in I)b.call(I,w)&&(d=I[w],O.attribs[w]=d.clone());return O.children=[],this.children.forEach(function(P){var _;return _=P.clone(),_.parent=O,O.children.push(_)}),O},y.prototype.attribute=function(d,w){var O,I;if(d!=null&&(d=p(d)),e(d))for(O in d)b.call(d,O)&&(I=d[O],this.attribute(O,I));else t(w)&&(w=w.apply()),this.options.keepNullAttributes&&w==null?this.attribs[d]=new a(this,d,""):w!=null&&(this.attribs[d]=new a(this,d,w));return this},y.prototype.removeAttribute=function(d){var w,O,I;if(d==null)throw new Error("Missing attribute name. "+this.debugInfo());if(d=p(d),Array.isArray(d))for(O=0,I=d.length;O<I;O++)w=d[O],delete this.attribs[w];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,w){return this.attribute(d,w)},y.prototype.a=function(d,w){return this.attribute(d,w)},y.prototype.getAttribute=function(d){return this.attribs.hasOwnProperty(d)?this.attribs[d].value:null},y.prototype.setAttribute=function(d,w){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,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setAttributeNS=function(d,w,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.removeAttributeNS=function(d,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.getAttributeNodeNS=function(d,w){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,w){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,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttribute=function(d,w){return this.attribs.hasOwnProperty(d)?this.attribs[d].isId:w},y.prototype.setIdAttributeNS=function(d,w,O){throw new Error("This DOM method is not implemented."+this.debugInfo())},y.prototype.setIdAttributeNode=function(d,w){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,w){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 w,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(w=O=0,I=this.attribs.length-1;0<=I?O<=I:O>=I;w=0<=I?++O:--O)if(!this.attribs[w].isEqualNode(d.attribs[w]))return!1;return!0},y}(f)}).call(Dr)),ft.exports}var yt={exports:{}},mt={exports:{}},Er=mt.exports,Ee;function gt(){return Ee||(Ee=1,(function(){var n,a=function(f,p){for(var t in p)g.call(p,t)&&(f[t]=p[t]);function e(){this.constructor=f}return e.prototype=p.prototype,f.prototype=new e,f.__super__=p.prototype,f},g={}.hasOwnProperty;n=G(),mt.exports=function(f){a(p,f);function p(t){p.__super__.constructor.call(this,t),this.value=""}return Object.defineProperty(p.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(p.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(p.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),p.prototype.clone=function(){return Object.create(this)},p.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.replaceData=function(t,e,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.isEqualNode=function(t){return!(!p.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)||t.data!==this.data)},p}(n)}).call(Er)),mt.exports}var br=yt.exports,be;function Gt(){return be||(be=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;n=B(),a=gt(),yt.exports=function(p){g(t,p);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=n.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(br)),yt.exports}var wt={exports:{}},Or=wt.exports,Oe;function Wt(){return Oe||(Oe=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;n=B(),a=gt(),wt.exports=function(p){g(t,p);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=n.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(Or)),wt.exports}var Tt={exports:{}},Nr=Tt.exports,Ne;function Yt(){return Ne||(Ne=1,(function(){var n,a,g,f=function(t,e){for(var o in e)p.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},p={}.hasOwnProperty;g=H().isObject,a=G(),n=B(),Tt.exports=function(t){f(e,t);function e(o,l,b,m){var y;e.__super__.constructor.call(this,o),g(l)&&(y=l,l=y.version,b=y.encoding,m=y.standalone),l||(l="1.0"),this.type=n.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(Nr)),Tt.exports}var Dt={exports:{}},Et={exports:{}},vr=Et.exports,ve;function Kt(){return ve||(ve=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;a=G(),n=B(),Et.exports=function(p){g(t,p);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=n.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(vr)),Et.exports}var bt={exports:{}},Lr=bt.exports,Le;function zt(){return Le||(Le=1,(function(){var n,a,g,f=function(t,e){for(var o in e)p.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},p={}.hasOwnProperty;g=H().isObject,a=G(),n=B(),bt.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=n.EntityDeclaration,!g(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(Lr)),bt.exports}var Ot={exports:{}},Ir=Ot.exports,Ie;function Ht(){return Ie||(Ie=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;a=G(),n=B(),Ot.exports=function(p){g(t,p);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=n.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(Ir)),Ot.exports}var Nt={exports:{}},Pr=Nt.exports,Pe;function Qt(){return Pe||(Pe=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;a=G(),n=B(),Nt.exports=function(p){g(t,p);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=n.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(Pr)),Nt.exports}var xr=Dt.exports,xe;function Zt(){return xe||(xe=1,(function(){var n,a,g,f,p,t,e,o,l=function(m,y){for(var d in y)b.call(y,d)&&(m[d]=y[d]);function w(){this.constructor=m}return w.prototype=y.prototype,m.prototype=new w,m.__super__=y.prototype,m},b={}.hasOwnProperty;o=H().isObject,e=G(),n=B(),a=Kt(),f=zt(),g=Ht(),p=Qt(),t=kt(),Dt.exports=function(m){l(y,m);function y(d,w,O){var I,P,_,E,s,c;if(y.__super__.constructor.call(this,d),this.type=n.DocType,d.children){for(E=d.children,P=0,_=E.length;P<_;P++)if(I=E[P],I.type===n.Element){this.name=I.name;break}}this.documentObject=d,o(w)&&(s=w,w=s.pubID,O=s.sysID),O==null&&(c=[w,O],O=c[0],w=c[1]),w!=null&&(this.pubID=this.stringify.dtdPubID(w)),O!=null&&(this.sysID=this.stringify.dtdSysID(O))}return Object.defineProperty(y.prototype,"entities",{get:function(){var d,w,O,I,P;for(I={},P=this.children,w=0,O=P.length;w<O;w++)d=P[w],d.type===n.EntityDeclaration&&!d.pe&&(I[d.name]=d);return new t(I)}}),Object.defineProperty(y.prototype,"notations",{get:function(){var d,w,O,I,P;for(I={},P=this.children,w=0,O=P.length;w<O;w++)d=P[w],d.type===n.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,w){var O;return O=new g(this,d,w),this.children.push(O),this},y.prototype.attList=function(d,w,O,I,P){var _;return _=new a(this,d,w,O,I,P),this.children.push(_),this},y.prototype.entity=function(d,w){var O;return O=new f(this,!1,d,w),this.children.push(O),this},y.prototype.pEntity=function(d,w){var O;return O=new f(this,!0,d,w),this.children.push(O),this},y.prototype.notation=function(d,w){var O;return O=new p(this,d,w),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,w){return this.element(d,w)},y.prototype.att=function(d,w,O,I,P){return this.attList(d,w,O,I,P)},y.prototype.ent=function(d,w){return this.entity(d,w)},y.prototype.pent=function(d,w){return this.pEntity(d,w)},y.prototype.not=function(d,w){return this.notation(d,w)},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(xr)),Dt.exports}var vt={exports:{}},Ar=vt.exports,Ae;function Jt(){return Ae||(Ae=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;n=B(),a=G(),vt.exports=function(p){g(t,p);function t(e,o){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=n.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(Ar)),vt.exports}var Lt={exports:{}},_r=Lt.exports,_e;function te(){return _e||(_e=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;n=B(),a=gt(),Lt.exports=function(p){g(t,p);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=n.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(_r)),Lt.exports}var It={exports:{}},Mr=It.exports,Me;function ee(){return Me||(Me=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;n=B(),a=gt(),It.exports=function(p){g(t,p);function t(e,o,l){if(t.__super__.constructor.call(this,e),o==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=n.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(Mr)),It.exports}var Pt={exports:{}},Cr=Pt.exports,Ce;function Se(){return Ce||(Ce=1,(function(){var n,a,g=function(p,t){for(var e in t)f.call(t,e)&&(p[e]=t[e]);function o(){this.constructor=p}return o.prototype=t.prototype,p.prototype=new o,p.__super__=t.prototype,p},f={}.hasOwnProperty;a=G(),n=B(),Pt.exports=function(p){g(t,p);function t(e){t.__super__.constructor.call(this,e),this.type=n.Dummy}return t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return""},t}(a)}).call(Cr)),Pt.exports}var xt={exports:{}},Sr=xt.exports,Fe;function Fr(){return Fe||(Fe=1,(function(){xt.exports=function(){function n(a){this.nodes=a}return Object.defineProperty(n.prototype,"length",{get:function(){return this.nodes.length||0}}),n.prototype.clone=function(){return this.nodes=null},n.prototype.item=function(a){return this.nodes[a]||null},n}()}).call(Sr)),xt.exports}var At={exports:{}},Xr=At.exports,Xe;function Rr(){return Xe||(Xe=1,(function(){At.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(Xr)),At.exports}var jr=lt.exports,Re;function G(){return Re||(Re=1,(function(){var n,a,g,f,p,t,e,o,l,b,m,y,d,w,O,I,P,_={}.hasOwnProperty;P=H(),I=P.isObject,O=P.isFunction,w=P.isEmpty,d=P.getValue,o=null,g=null,f=null,p=null,t=null,m=null,y=null,b=null,e=null,a=null,l=null,n=null,lt.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=$t(),g=Gt(),f=Wt(),p=Yt(),t=Zt(),m=Jt(),y=te(),b=ee(),e=Se(),a=B(),l=Fr(),kt(),n=Rr())}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,h,D,L;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){for(L="",D=this.children,c=0,h=D.length;c<h;c++)s=D[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,h,D,L,v;for(this.parent=s,s&&(this.options=s.options,this.stringify=s.stringify),L=this.children,v=[],h=0,D=L.length;h<D;h++)c=L[h],v.push(c.setParent(this));return v},E.prototype.element=function(s,c,h){var D,L,v,r,N,x,M,C,F,j,X;if(x=null,c===null&&h==null&&(F=[{},null],c=F[0],h=F[1]),c==null&&(c={}),c=d(c),I(c)||(j=[c,h],h=j[0],c=j[1]),s!=null&&(s=d(s)),Array.isArray(s))for(v=0,M=s.length;v<M;v++)L=s[v],x=this.element(L);else if(O(s))x=this.element(s.apply());else if(I(s)){for(N in s)if(_.call(s,N))if(X=s[N],O(X)&&(X=X.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&N.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(N.substr(this.stringify.convertAttKey.length),X);else if(!this.options.separateArrayItems&&Array.isArray(X)&&w(X))x=this.dummy();else if(I(X)&&w(X))x=this.element(N);else if(!this.options.keepNullNodes&&X==null)x=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(X))for(r=0,C=X.length;r<C;r++)L=X[r],D={},D[N]=L,x=this.element(D);else I(X)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&N.indexOf(this.stringify.convertTextKey)===0?x=this.element(X):(x=this.element(N),x.element(X)):x=this.element(N,X)}else!this.options.keepNullNodes&&h===null?x=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&s.indexOf(this.stringify.convertTextKey)===0?x=this.text(h):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&s.indexOf(this.stringify.convertCDataKey)===0?x=this.cdata(h):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&s.indexOf(this.stringify.convertCommentKey)===0?x=this.comment(h):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&s.indexOf(this.stringify.convertRawKey)===0?x=this.raw(h):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&s.indexOf(this.stringify.convertPIKey)===0?x=this.instruction(s.substr(this.stringify.convertPIKey.length),h):x=this.node(s,c,h);if(x==null)throw new Error("Could not create any elements with: "+s+". "+this.debugInfo());return x},E.prototype.insertBefore=function(s,c,h){var D,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),D=this.parent.element(s,c,h),Array.prototype.push.apply(this.parent.children,N),D},E.prototype.insertAfter=function(s,c,h){var D,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),D=this.parent.element(s,c,h),Array.prototype.push.apply(this.parent.children,v),D},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,h){var D,L;return s!=null&&(s=d(s)),c||(c={}),c=d(c),I(c)||(L=[c,h],h=L[0],c=L[1]),D=new o(this,s,c),h!=null&&D.text(h),this.children.push(D),D},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 g(this,s),this.children.push(c),this},E.prototype.comment=function(s){var c;return c=new f(this,s),this.children.push(c),this},E.prototype.commentBefore=function(s){var c,h;return c=this.parent.children.indexOf(this),h=this.parent.children.splice(c),this.parent.comment(s),Array.prototype.push.apply(this.parent.children,h),this},E.prototype.commentAfter=function(s){var c,h;return c=this.parent.children.indexOf(this),h=this.parent.children.splice(c+1),this.parent.comment(s),Array.prototype.push.apply(this.parent.children,h),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 h,D,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++)h=s[v],this.instruction(h);else if(I(s))for(h in s)_.call(s,h)&&(D=s[h],this.instruction(h,D));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 h,D;return h=this.parent.children.indexOf(this),D=this.parent.children.splice(h),this.parent.instruction(s,c),Array.prototype.push.apply(this.parent.children,D),this},E.prototype.instructionAfter=function(s,c){var h,D;return h=this.parent.children.indexOf(this),D=this.parent.children.splice(h+1),this.parent.instruction(s,c),Array.prototype.push.apply(this.parent.children,D),this},E.prototype.declaration=function(s,c,h){var D,L;return D=this.document(),L=new p(D,s,c,h),D.children.length===0?D.children.unshift(L):D.children[0].type===a.Declaration?D.children[0]=L:D.children.unshift(L),D.root()||D},E.prototype.dtd=function(s,c){var h,D,L,v,r,N,x,M,C,F;for(D=this.document(),L=new t(D,s,c),C=D.children,v=r=0,x=C.length;r<x;v=++r)if(h=C[v],h.type===a.DocType)return D.children[v]=L,L;for(F=D.children,v=N=0,M=F.length;N<M;v=++N)if(h=F[v],h.isRoot)return D.children.splice(v,0,L),L;return D.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,h;return s=s||this.name,s==null&&!((c=this.parent)!=null&&c.name)?"":s==null?"parent: <"+this.parent.name+">":(h=this.parent)!=null&&h.name?"node: <"+s+">, parent: <"+this.parent.name+">":"node: <"+s+">"},E.prototype.ele=function(s,c,h){return this.element(s,c,h)},E.prototype.nod=function(s,c,h){return this.node(s,c,h)},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,h){return this.declaration(s,c,h)},E.prototype.e=function(s,c,h){return this.element(s,c,h)},E.prototype.n=function(s,c,h){return this.node(s,c,h)},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,h;return c=this,c===s?0:this.document()!==s.document()?(h=n.Disconnected|n.ImplementationSpecific,Math.random()<.5?h|=n.Preceding:h|=n.Following,h):c.isAncestor(s)?n.Contains|n.Preceding:c.isDescendant(s)?n.Contains|n.Following:c.isPreceding(s)?n.Preceding:n.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,h,D;if(s.nodeType!==this.nodeType||s.children.length!==this.children.length)return!1;for(c=h=0,D=this.children.length-1;0<=D?h<=D:h>=D;c=0<=D?++h:--h)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,h){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,h,D,L,v;for(v=this.children,D=0,L=v.length;D<L;D++)if(c=v[D],s===c||(h=c.isDescendant(s),h))return!0;return!1},E.prototype.isAncestor=function(s){return s.isDescendant(this)},E.prototype.isPreceding=function(s){var c,h;return c=this.treePosition(s),h=this.treePosition(this),c===-1||h===-1?!1:c<h},E.prototype.isFollowing=function(s){var c,h;return c=this.treePosition(s),h=this.treePosition(this),c===-1||h===-1?!1:c>h},E.prototype.treePosition=function(s){var c,h;return h=0,c=!1,this.foreachTreeNode(this.document(),function(D){if(h++,!c&&D===s)return c=!0}),c?h:-1},E.prototype.foreachTreeNode=function(s,c){var h,D,L,v,r;for(s||(s=this.document()),v=s.children,D=0,L=v.length;D<L;D++){if(h=v[D],r=c(h))return r;if(r=this.foreachTreeNode(h,c),r)return r}},E}()}).call(jr)),lt.exports}var _t={exports:{}},Br=_t.exports,je;function Be(){return je||(je=1,(function(){var n=function(g,f){return function(){return g.apply(f,arguments)}},a={}.hasOwnProperty;_t.exports=function(){function g(f){this.assertLegalName=n(this.assertLegalName,this),this.assertLegalChar=n(this.assertLegalChar,this);var p,t,e;f||(f={}),this.options=f,this.options.version||(this.options.version="1.0"),t=f.stringify||{};for(p in t)a.call(t,p)&&(e=t[p],this[p]=e)}return g.prototype.name=function(f){return this.options.noValidation?f:this.assertLegalName(""+f||"")},g.prototype.text=function(f){return this.options.noValidation?f:this.assertLegalChar(this.textEscape(""+f||""))},g.prototype.cdata=function(f){return this.options.noValidation?f:(f=""+f||"",f=f.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(f))},g.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)},g.prototype.raw=function(f){return this.options.noValidation?f:""+f||""},g.prototype.attValue=function(f){return this.options.noValidation?f:this.assertLegalChar(this.attEscape(f=""+f||""))},g.prototype.insTarget=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.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)},g.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},g.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)},g.prototype.xmlStandalone=function(f){return this.options.noValidation?f:f?"yes":"no"},g.prototype.dtdPubID=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.dtdSysID=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.dtdElementValue=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.dtdAttType=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.dtdAttDefault=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.dtdEntityValue=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.dtdNData=function(f){return this.options.noValidation?f:this.assertLegalChar(""+f||"")},g.prototype.convertAttKey="@",g.prototype.convertPIKey="?",g.prototype.convertTextKey="#text",g.prototype.convertCDataKey="#cdata",g.prototype.convertCommentKey="#comment",g.prototype.convertRawKey="#raw",g.prototype.assertLegalChar=function(f){var p,t;if(this.options.noValidation)return f;if(p="",this.options.version==="1.0"){if(p=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=f.match(p))throw new Error("Invalid character in string: "+f+" at index "+t.index)}else if(this.options.version==="1.1"&&(p=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,t=f.match(p)))throw new Error("Invalid character in string: "+f+" at index "+t.index);return f},g.prototype.assertLegalName=function(f){var p;if(this.options.noValidation)return f;if(this.assertLegalChar(f),p=/^([: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(p))throw new Error("Invalid character in name");return f},g.prototype.textEscape=function(f){var p;return this.options.noValidation?f:(p=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,f.replace(p,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},g.prototype.attEscape=function(f){var p;return this.options.noValidation?f:(p=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,f.replace(p,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},g}()}).call(Br)),_t.exports}var Mt={exports:{}},Ct={exports:{}},St={exports:{}},qr=St.exports,qe;function Ft(){return qe||(qe=1,(function(){St.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(qr)),St.exports}var Ur=Ct.exports,Ue;function Ve(){return Ue||(Ue=1,(function(){var n,a,g,f={}.hasOwnProperty;g=H().assign,n=B(),Yt(),Zt(),Gt(),Wt(),$t(),Jt(),te(),ee(),Se(),Kt(),Ht(),zt(),Qt(),a=Ft(),Ct.exports=function(){function p(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 p.prototype.filterOptions=function(t){var e,o,l,b,m,y,d,w;return t||(t={}),t=g({},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=(w=t.spaceBeforeSlash)!=null?w:t.spacebeforeslash)!=null?d:"",e.spaceBeforeSlash===!0&&(e.spaceBeforeSlash=" "),e.suppressPrettyCount=0,e.user={},e.state=a.None,e},p.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):""},p.prototype.endline=function(t,e,o){return!e.pretty||e.suppressPrettyCount?"":e.newline},p.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},p.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},p.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},p.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},p.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},p.prototype.element=function(t,e,o){var l,b,m,y,d,w,O,I,P,_,E,s,c,h;o||(o=0),_=!1,E="",this.openNode(t,e,o),e.state=a.OpenTag,E+=this.indent(t,e,o)+"<"+t.name,s=t.attribs;for(P in s)f.call(s,P)&&(l=s[P],E+=this.attribute(l,e,o));if(m=t.children.length,y=m===0?null:t.children[0],m===0||t.children.every(function(D){return(D.type===n.Text||D.type===n.Raw)&&D.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===n.Text||y.type===n.Raw)&&y.value!=null)E+=">",e.state=a.InsideTag,e.suppressPrettyCount++,_=!0,E+=this.writeChildNode(y,e,o+1),e.suppressPrettyCount--,_=!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===n.Text||b.type===n.Raw)&&b.value!=null){e.suppressPrettyCount++,_=!0;break}}for(E+=">"+this.endline(t,e,o),e.state=a.InsideTag,h=t.children,w=0,I=h.length;w<I;w++)b=h[w],E+=this.writeChildNode(b,e,o+1);e.state=a.CloseTag,E+=this.indent(t,e,o)+"</"+t.name+">",_&&e.suppressPrettyCount--,E+=this.endline(t,e,o),e.state=a.None}return this.closeNode(t,e,o),E},p.prototype.writeChildNode=function(t,e,o){switch(t.type){case n.CData:return this.cdata(t,e,o);case n.Comment:return this.comment(t,e,o);case n.Element:return this.element(t,e,o);case n.Raw:return this.raw(t,e,o);case n.Text:return this.text(t,e,o);case n.ProcessingInstruction:return this.processingInstruction(t,e,o);case n.Dummy:return"";case n.Declaration:return this.declaration(t,e,o);case n.DocType:return this.docType(t,e,o);case n.AttributeDeclaration:return this.dtdAttList(t,e,o);case n.ElementDeclaration:return this.dtdElement(t,e,o);case n.EntityDeclaration:return this.dtdEntity(t,e,o);case n.NotationDeclaration:return this.dtdNotation(t,e,o);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},p.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},p.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},p.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},p.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},p.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},p.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},p.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},p.prototype.openNode=function(t,e,o){},p.prototype.closeNode=function(t,e,o){},p.prototype.openAttribute=function(t,e,o){},p.prototype.closeAttribute=function(t,e,o){},p}()}).call(Ur)),Ct.exports}var Vr=Mt.exports,ke;function re(){return ke||(ke=1,(function(){var n,a=function(f,p){for(var t in p)g.call(p,t)&&(f[t]=p[t]);function e(){this.constructor=f}return e.prototype=p.prototype,f.prototype=new e,f.__super__=p.prototype,f},g={}.hasOwnProperty;n=Ve(),Mt.exports=function(f){a(p,f);function p(t){p.__super__.constructor.call(this,t)}return p.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},p}(n)}).call(Vr)),Mt.exports}var kr=st.exports,$e;function Ge(){return $e||($e=1,(function(){var n,a,g,f,p,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=H().isPlainObject,g=he(),a=mr(),f=G(),n=B(),t=Be(),p=re(),st.exports=function(b){o(m,b);function m(y){m.__super__.constructor.call(this,null),this.name="#document",this.type=n.Document,this.documentURI=null,this.domConfig=new a,y||(y={}),y.writer||(y.writer=new p),this.options=y,this.stringify=new t(y)}return Object.defineProperty(m.prototype,"implementation",{value:new g}),Object.defineProperty(m.prototype,"doctype",{get:function(){var y,d,w,O;for(O=this.children,d=0,w=O.length;d<w;d++)if(y=O[d],y.type===n.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===n.Declaration?this.children[0].encoding:null}}),Object.defineProperty(m.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===n.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(m.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===n.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,w){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,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(y,d,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m}(f)}).call(kr)),st.exports}var Xt={exports:{}},$r=Xt.exports,We;function Gr(){return We||(We=1,(function(){var n,a,g,f,p,t,e,o,l,b,m,y,d,w,O,I,P,_,E,s,c,h,D,L={}.hasOwnProperty;D=H(),c=D.isObject,s=D.isFunction,h=D.isPlainObject,E=D.getValue,n=B(),y=Ge(),d=$t(),f=Gt(),p=Wt(),O=Jt(),_=te(),w=ee(),b=Yt(),m=Zt(),t=Kt(),o=zt(),e=Ht(),l=Qt(),g=we(),P=Be(),I=re(),a=Ft(),Xt.exports=function(){function v(r,N,x){var M;this.name="?xml",this.type=n.Document,r||(r={}),M={},r.writer?h(r.writer)&&(M=r.writer,r.writer=new I):r.writer=new I,this.options=r,this.writer=r.writer,this.writerOptions=this.writer.filterOptions(M),this.stringify=new P(r),this.onDataCallback=N||function(){},this.onEndCallback=x||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,x,M,C,F,j,X,S;switch(r.type){case n.CData:this.cdata(r.value);break;case n.Comment:this.comment(r.value);break;case n.Element:M={},X=r.attribs;for(x in X)L.call(X,x)&&(N=X[x],M[x]=N.value);this.node(r.name,M);break;case n.Dummy:this.dummy();break;case n.Raw:this.raw(r.value);break;case n.Text:this.text(r.value);break;case n.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===n.Element&&this.up();return this},v.prototype.dummy=function(){return this},v.prototype.node=function(r,N,x){var M;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)||(M=[N,x],x=M[0],N=M[1]),this.currentNode=new d(this,r,N),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,x!=null&&this.text(x),this},v.prototype.element=function(r,N,x){var M,C,F,j,X,S;if(this.currentNode&&this.currentNode.type===n.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++)M=X[C],this.createChildNode(M),M.type===n.Element&&this.up();else this.node(r,N,x);return this},v.prototype.attribute=function(r,N){var x,M;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(x in r)L.call(r,x)&&(M=r[x],this.attribute(x,M));else s(N)&&(N=N.apply()),this.options.keepNullAttributes&&N==null?this.currentNode.attribs[r]=new g(this,r,""):N!=null&&(this.currentNode.attribs[r]=new g(this,r,N));return this},v.prototype.text=function(r){var N;return this.openCurrent(),N=new _(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 p(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 x,M,C,F,j;if(this.openCurrent(),r!=null&&(r=E(r)),N!=null&&(N=E(N)),Array.isArray(r))for(x=0,F=r.length;x<F;x++)M=r[x],this.instruction(M);else if(c(r))for(M in r)L.call(r,M)&&(C=r[M],this.instruction(M,C));else s(N)&&(N=N.apply()),j=new w(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,x){var M;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return M=new b(this,r,N,x),this.onData(this.writer.declaration(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.doctype=function(r,N,x){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,x),this.currentNode.rootNodeName=r,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},v.prototype.dtdElement=function(r,N){var x;return this.openCurrent(),x=new e(this,r,N),this.onData(this.writer.dtdElement(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.attList=function(r,N,x,M,C){var F;return this.openCurrent(),F=new t(this,r,N,x,M,C),this.onData(this.writer.dtdAttList(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.entity=function(r,N){var x;return this.openCurrent(),x=new o(this,!1,r,N),this.onData(this.writer.dtdEntity(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.pEntity=function(r,N){var x;return this.openCurrent(),x=new o(this,!0,r,N),this.onData(this.writer.dtdEntity(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},v.prototype.notation=function(r,N){var x;return this.openCurrent(),x=new l(this,r,N),this.onData(this.writer.dtdNotation(x,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,x,M,C;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===n.Element&&(this.root=r),x="",r.type===n.Element){this.writerOptions.state=a.OpenTag,x=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name,C=r.attribs;for(M in C)L.call(C,M)&&(N=C[M],x+=this.writer.attribute(N,this.writerOptions,this.currentLevel));x+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel),this.writerOptions.state=a.InsideTag}else this.writerOptions.state=a.OpenTag,x=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName,r.pubID&&r.sysID?x+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"':r.sysID&&(x+=' SYSTEM "'+r.sysID+'"'),r.children?(x+=" [",this.writerOptions.state=a.InsideTag):(this.writerOptions.state=a.CloseTag,x+=">"),x+=this.writer.endline(r,this.writerOptions,this.currentLevel);return this.onData(x,this.currentLevel),r.isOpen=!0}},v.prototype.closeNode=function(r){var N;if(!r.isClosed)return N="",this.writerOptions.state=a.CloseTag,r.type===n.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,x){return this.node(r,N,x)},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,x){return this.declaration(r,N,x)},v.prototype.dtd=function(r,N,x){return this.doctype(r,N,x)},v.prototype.e=function(r,N,x){return this.element(r,N,x)},v.prototype.n=function(r,N,x){return this.node(r,N,x)},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===n.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},v.prototype.a=function(){return this.currentNode&&this.currentNode.type===n.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($r)),Xt.exports}var Rt={exports:{}},Wr=Rt.exports,Ye;function Yr(){return Ye||(Ye=1,(function(){var n,a,g,f=function(t,e){for(var o in e)p.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},p={}.hasOwnProperty;n=B(),g=Ve(),a=Ft(),Rt.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===a.CloseTag?"":e.__super__.endline.call(this,o,l,b)},e.prototype.document=function(o,l){var b,m,y,d,w,O,I,P,_;for(I=o.children,m=y=0,w=I.length;y<w;m=++y)b=I[m],b.isLastRootNode=m===o.children.length-1;for(l=this.filterOptions(l),P=o.children,_=[],d=0,O=P.length;d<O;d++)b=P[d],_.push(this.writeChildNode(b,l,0));return _},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,w;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,w=o.children,y=0,d=w.length;y<d;y++)m=w[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,w,O,I,P,_,E;b||(b=0),this.openNode(o,l,b),l.state=a.OpenTag,this.stream.write(this.indent(o,l,b)+"<"+o.name),_=o.attribs;for(P in _)p.call(_,P)&&(m=_[P],this.attribute(m,l,b));if(d=o.children.length,w=d===0?null:o.children[0],d===0||o.children.every(function(s){return(s.type===n.Text||s.type===n.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&&(w.type===n.Text||w.type===n.Raw)&&w.value!=null)this.stream.write(">"),l.state=a.InsideTag,l.suppressPrettyCount++,this.writeChildNode(w,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}(g)}).call(Wr)),Rt.exports}var Ke;function Kr(){return Ke||(Ke=1,(function(){var n,a,g,f,p,t,e,o,l,b;b=H(),o=b.assign,l=b.isFunction,g=he(),f=Ge(),p=Gr(),e=re(),t=Yr(),n=B(),a=Ft(),K.create=function(m,y,d,w){var O,I;if(m==null)throw new Error("Root element needs a name.");return w=o({},y,d,w),O=new f(w),I=O.element(m),w.headless||(O.declaration(w),(w.pubID!=null||w.sysID!=null)&&O.dtd(w)),I},K.begin=function(m,y,d){var w;return l(m)&&(w=[m,y],y=w[0],d=w[1],m={}),y?new p(m,y,d):new f(m)},K.stringWriter=function(m){return new e(m)},K.streamWriter=function(m,y){return new t(m,y)},K.implementation=new g,K.nodeType=n,K.writerState=a}).call(K)),K}var ze;function zr(){return ze||(ze=1,(function(){var n,a,g,f,p,t={}.hasOwnProperty;n=Kr(),a=Vt().defaults,f=function(e){return typeof e=="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},p=function(e){return"<![CDATA["+g(e)+"]]>"},g=function(e){return e.replace("]]>","]]]]><![CDATA[>")},it.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(w){return function(O,I){var P,_,E,s,c,h;if(typeof I!="object")w.options.cdata&&f(I)?O.raw(p(I)):O.txt(I);else if(Array.isArray(I)){for(s in I)if(t.call(I,s)){_=I[s];for(c in _)E=_[c],O=m(O.ele(c),E).up()}}else for(c in I)if(t.call(I,c))if(_=I[c],c===l){if(typeof _=="object")for(P in _)h=_[P],O=O.att(P,h)}else if(c===b)w.options.cdata&&f(_)?O=O.raw(p(_)):O=O.txt(_);else if(Array.isArray(_))for(s in _)t.call(_,s)&&(E=_[s],typeof E=="string"?w.options.cdata&&f(E)?O=O.ele(c).raw(p(E)).up():O=O.ele(c,E).up():O=m(O.ele(c),E).up());else typeof _=="object"?O=m(O.ele(c),_).up():typeof _=="string"&&w.options.cdata&&f(_)?O=O.ele(c).raw(p(_)).up():(_==null&&(_=""),O=O.ele(c,_.toString()).up());return O}}(this),y=n.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(it)),it}var jt={},ne={};const ie=rt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var He;function Hr(){return He||(He=1,function(n){(function(a){a.parser=function(u,i){return new f(u,i)},a.SAXParser=f,a.SAXStream=m,a.createStream=b,a.MAX_BUFFER_LENGTH=64*1024;var g=["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 f(u,i){if(!(this instanceof f))return new f(u,i);var A=this;t(A),A.q=A.c="",A.bufferCheckPosition=a.MAX_BUFFER_LENGTH,A.opt=i||{},A.opt.lowercase=A.opt.lowercase||A.opt.lowercasetags,A.looseCase=A.opt.lowercase?"toLowerCase":"toUpperCase",A.tags=[],A.closed=A.closedRoot=A.sawRoot=!1,A.tag=A.error=null,A.strict=!!u,A.noscript=!!(u||A.opt.noscript),A.state=r.BEGIN,A.strictEntities=A.opt.strictEntities,A.ENTITIES=A.strictEntities?Object.create(a.XML_ENTITIES):Object.create(a.ENTITIES),A.attribList=[],A.opt.xmlns&&(A.ns=Object.create(I)),A.opt.unquotedAttributeValues===void 0&&(A.opt.unquotedAttributeValues=!u),A.trackPosition=A.opt.position!==!1,A.trackPosition&&(A.position=A.line=A.column=0),x(A,"onready")}Object.create||(Object.create=function(u){function i(){}i.prototype=u;var A=new i;return A}),Object.keys||(Object.keys=function(u){var i=[];for(var A in u)u.hasOwnProperty(A)&&i.push(A);return i});function p(u){for(var i=Math.max(a.MAX_BUFFER_LENGTH,10),A=0,T=0,R=g.length;T<R;T++){var q=u[g[T]].length;if(q>i)switch(g[T]){case"textNode":C(u);break;case"cdata":M(u,"oncdata",u.cdata),u.cdata="";break;case"script":M(u,"onscript",u.script),u.script="";break;default:j(u,"Max buffer length exceeded: "+g[T])}A=Math.max(A,q)}var U=a.MAX_BUFFER_LENGTH-A;u.bufferCheckPosition=U+u.position}function t(u){for(var i=0,A=g.length;i<A;i++)u[g[i]]=""}function e(u){C(u),u.cdata!==""&&(M(u,"oncdata",u.cdata),u.cdata=""),u.script!==""&&(M(u,"onscript",u.script),u.script="")}f.prototype={end:function(){X(this)},write:Ln,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){e(this)}};var o;try{o=ie.Stream}catch{o=function(){}}o||(o=function(){});var l=a.EVENTS.filter(function(u){return u!=="error"&&u!=="end"});function b(u,i){return new m(u,i)}function m(u,i){if(!(this instanceof m))return new m(u,i);o.apply(this),this._parser=new f(u,i),this.writable=!0,this.readable=!0;var A=this;this._parser.onend=function(){A.emit("end")},this._parser.onerror=function(T){A.emit("error",T),A._parser.error=null},this._decoder=null,l.forEach(function(T){Object.defineProperty(A,"on"+T,{get:function(){return A._parser["on"+T]},set:function(R){if(!R)return A.removeAllListeners(T),A._parser["on"+T]=R,R;A.on(T,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 i=ie.StringDecoder;this._decoder=new i("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,i){var A=this;return!A._parser["on"+u]&&l.indexOf(u)!==-1&&(A._parser["on"+u]=function(){var T=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);T.splice(0,0,u),A.emit.apply(A,T)}),o.prototype.on.call(A,u,i)};var y="[CDATA[",d="DOCTYPE",w="http://www.w3.org/XML/1998/namespace",O="http://www.w3.org/2000/xmlns/",I={xml:w,xmlns:O},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]/,_=/[:_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 h(u){return u==='"'||u==="'"}function D(u){return u===">"||c(u)}function L(u,i){return u.test(i)}function v(u,i){return!L(u,i)}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 i=a.ENTITIES[u],A=typeof i=="number"?String.fromCharCode(i):i;a.ENTITIES[u]=A});for(var N in a.STATE)a.STATE[a.STATE[N]]=N;r=a.STATE;function x(u,i,A){u[i]&&u[i](A)}function M(u,i,A){u.textNode&&C(u),x(u,i,A)}function C(u){u.textNode=F(u.opt,u.textNode),u.textNode&&x(u,"ontext",u.textNode),u.textNode=""}function F(u,i){return u.trim&&(i=i.trim()),u.normalize&&(i=i.replace(/\s+/g," ")),i}function j(u,i){return C(u),u.trackPosition&&(i+=`
|
|
5
5
|
Line: `+u.line+`
|
|
6
6
|
Column: `+u.column+`
|
|
7
|
-
Char: `+u.c),i=new Error(i),u.error=i,x(u,"onerror",i),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,x(u,"onend"),
|
|
7
|
+
Char: `+u.c),i=new Error(i),u.error=i,x(u,"onerror",i),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,x(u,"onend"),f.call(u,u.strict,u.opt),u}function S(u,i){if(typeof u!="object"||!(u instanceof f))throw new Error("bad call to strictFail");u.strict&&j(u,i)}function Nn(u){u.strict||(u.tagName=u.tagName[u.looseCase]());var i=u.tags[u.tags.length-1]||u,A=u.tag={name:u.tagName,attributes:{}};u.opt.xmlns&&(A.ns=i.ns),u.attribList.length=0,M(u,"onopentagstart",A)}function oe(u,i){var A=u.indexOf(":"),T=A<0?["",u]:u.split(":"),R=T[0],q=T[1];return i&&u==="xmlns"&&(R="xmlns",q=""),{prefix:R,local:q}}function se(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 i=oe(u.attribName,!0),A=i.prefix,T=i.local;if(A==="xmlns")if(T==="xml"&&u.attribValue!==w)S(u,"xml: prefix must be bound to "+w+`
|
|
8
8
|
Actual: `+u.attribValue);else if(T==="xmlns"&&u.attribValue!==O)S(u,"xmlns: prefix must be bound to "+O+`
|
|
9
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[T]=u.attribValue}u.attribList.push([u.attribName,u.attribValue])}else u.tag.attributes[u.attribName]=u.attribValue,M(u,"onattribute",{name:u.attribName,value:u.attribValue});u.attribName=u.attribValue=""}function J(u,i){if(u.opt.xmlns){var A=u.tag,T=oe(u.tagName);A.prefix=T.prefix,A.local=T.local,A.uri=A.ns[T.prefix]||"",A.prefix&&!A.uri&&(S(u,"Unbound namespace prefix: "+JSON.stringify(u.tagName)),A.uri=T.prefix);var R=u.tags[u.tags.length-1]||u;A.ns&&R.ns!==A.ns&&Object.keys(A.ns).forEach(function(cr){M(u,"onopennamespace",{prefix:cr,uri:A.ns[cr]})});for(var q=0,U=u.attribList.length;q<U;q++){var k=u.attribList[q],$=k[0],et=k[1],V=oe($,!0),Q=V.prefix,In=V.local,ar=Q===""?"":A.ns[Q]||"",ae={name:$,value:et,prefix:Q,local:In,uri:ar};Q&&Q!=="xmlns"&&!ar&&(S(u,"Unbound namespace prefix: "+JSON.stringify(Q)),ae.uri=Q),u.tag.attributes[$]=ae,M(u,"onattribute",ae)}u.attribList.length=0}u.tag.isSelfClosing=!!i,u.sawRoot=!0,u.tags.push(u.tag),M(u,"onopentag",u.tag),i||(!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 ue(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}M(u,"onscript",u.script),u.script=""}var i=u.tags.length,A=u.tagName;u.strict||(A=A[u.looseCase]());for(var T=A;i--;){var R=u.tags[i];if(R.name!==T)S(u,"Unexpected close tag");else break}if(i<0){S(u,"Unmatched closing tag: "+u.tagName),u.textNode+="</"+u.tagName+">",u.state=r.TEXT;return}u.tagName=A;for(var q=u.tags.length;q-- >i;){var U=u.tag=u.tags.pop();u.tagName=u.tag.name,M(u,"onclosetag",u.tagName);var k={};for(var $ in U.ns)k[$]=U.ns[$];var et=u.tags[u.tags.length-1]||u;u.opt.xmlns&&U.ns!==et.ns&&Object.keys(U.ns).forEach(function(V){var Q=U.ns[V];M(u,"onclosenamespace",{prefix:V,uri:Q})})}i===0&&(u.closedRoot=!0),u.tagName=u.attribValue=u.attribName="",u.attribList.length=0,u.state=r.TEXT}function vn(u){var i=u.entity,A=i.toLowerCase(),T,R="";return u.ENTITIES[i]?u.ENTITIES[i]:u.ENTITIES[A]?u.ENTITIES[A]:(i=A,i.charAt(0)==="#"&&(i.charAt(1)==="x"?(i=i.slice(2),T=parseInt(i,16),R=T.toString(16)):(i=i.slice(1),T=parseInt(i,10),R=T.toString(10))),i=i.replace(/^0+/,""),isNaN(T)||R.toLowerCase()!==i?(S(u,"Invalid character entity"),"&"+u.entity+";"):String.fromCodePoint(T))}function sr(u,i){i==="<"?(u.state=r.OPEN_WAKA,u.startTagPosition=u.position):c(i)||(S(u,"Non-whitespace before first tag."),u.textNode=i,u.state=r.TEXT)}function ur(u,i){var A="";return i<u.length&&(A=u.charAt(i)),A}function Ln(u){var i=this;if(this.error)throw this.error;if(i.closed)return j(i,"Cannot write after close. Assign an onready handler.");if(u===null)return X(i);typeof u=="object"&&(u=u.toString());for(var A=0,T="";T=ur(u,A++),i.c=T,!!T;)switch(i.trackPosition&&(i.position++,T===`
|
|
10
10
|
`?(i.line++,i.column=0):i.column++),i.state){case r.BEGIN:if(i.state=r.BEGIN_WHITESPACE,T==="\uFEFF")continue;sr(i,T);continue;case r.BEGIN_WHITESPACE:sr(i,T);continue;case r.TEXT:if(i.sawRoot&&!i.closedRoot){for(var R=A-1;T&&T!=="<"&&T!=="&";)T=ur(u,A++),T&&i.trackPosition&&(i.position++,T===`
|
|
11
|
-
`?(i.line++,i.column=0):i.column++);i.textNode+=u.substring(R,A-1)}T==="<"&&!(i.sawRoot&&i.closedRoot&&!i.strict)?(i.state=r.OPEN_WAKA,i.startTagPosition=i.position):(!c(T)&&(!i.sawRoot||i.closedRoot)&&S(i,"Text data outside of root node."),T==="&"?i.state=r.TEXT_ENTITY:i.textNode+=T);continue;case r.SCRIPT:T==="<"?i.state=r.SCRIPT_ENDING:i.script+=T;continue;case r.SCRIPT_ENDING:T==="/"?i.state=r.CLOSE_TAG:(i.script+="<"+T,i.state=r.SCRIPT);continue;case r.OPEN_WAKA:if(T==="!")i.state=r.SGML_DECL,i.sgmlDecl="";else if(!c(T))if(L(P,T))i.state=r.OPEN_TAG,i.tagName=T;else if(T==="/")i.state=r.CLOSE_TAG,i.tagName="";else if(T==="?")i.state=r.PROC_INST,i.procInstName=i.procInstBody="";else{if(S(i,"Unencoded <"),i.startTagPosition+1<i.position){var q=i.position-i.startTagPosition;T=new Array(q).join(" ")+T}i.textNode+="<"+T,i.state=r.TEXT}continue;case r.SGML_DECL:if(i.sgmlDecl+T==="--"){i.state=r.COMMENT,i.comment="",i.sgmlDecl="";continue}i.doctype&&i.doctype!==!0&&i.sgmlDecl?(i.state=r.DOCTYPE_DTD,i.doctype+="<!"+i.sgmlDecl+T,i.sgmlDecl=""):(i.sgmlDecl+T).toUpperCase()===y?(M(i,"onopencdata"),i.state=r.CDATA,i.sgmlDecl="",i.cdata=""):(i.sgmlDecl+T).toUpperCase()===d?(i.state=r.DOCTYPE,(i.doctype||i.sawRoot)&&S(i,"Inappropriately located doctype declaration"),i.doctype="",i.sgmlDecl=""):T===">"?(M(i,"onsgmldeclaration",i.sgmlDecl),i.sgmlDecl="",i.state=r.TEXT):(f(T)&&(i.state=r.SGML_DECL_QUOTED),i.sgmlDecl+=T);continue;case r.SGML_DECL_QUOTED:T===i.q&&(i.state=r.SGML_DECL,i.q=""),i.sgmlDecl+=T;continue;case r.DOCTYPE:T===">"?(i.state=r.TEXT,M(i,"ondoctype",i.doctype),i.doctype=!0):(i.doctype+=T,T==="["?i.state=r.DOCTYPE_DTD:f(T)&&(i.state=r.DOCTYPE_QUOTED,i.q=T));continue;case r.DOCTYPE_QUOTED:i.doctype+=T,T===i.q&&(i.q="",i.state=r.DOCTYPE);continue;case r.DOCTYPE_DTD:T==="]"?(i.doctype+=T,i.state=r.DOCTYPE):T==="<"?(i.state=r.OPEN_WAKA,i.startTagPosition=i.position):f(T)?(i.doctype+=T,i.state=r.DOCTYPE_DTD_QUOTED,i.q=T):i.doctype+=T;continue;case r.DOCTYPE_DTD_QUOTED:i.doctype+=T,T===i.q&&(i.state=r.DOCTYPE_DTD,i.q="");continue;case r.COMMENT:T==="-"?i.state=r.COMMENT_ENDING:i.comment+=T;continue;case r.COMMENT_ENDING:T==="-"?(i.state=r.COMMENT_ENDED,i.comment=F(i.opt,i.comment),i.comment&&M(i,"oncomment",i.comment),i.comment=""):(i.comment+="-"+T,i.state=r.COMMENT);continue;case r.COMMENT_ENDED:T!==">"?(S(i,"Malformed comment"),i.comment+="--"+T,i.state=r.COMMENT):i.doctype&&i.doctype!==!0?i.state=r.DOCTYPE_DTD:i.state=r.TEXT;continue;case r.CDATA:T==="]"?i.state=r.CDATA_ENDING:i.cdata+=T;continue;case r.CDATA_ENDING:T==="]"?i.state=r.CDATA_ENDING_2:(i.cdata+="]"+T,i.state=r.CDATA);continue;case r.CDATA_ENDING_2:T===">"?(i.cdata&&M(i,"oncdata",i.cdata),M(i,"onclosecdata"),i.cdata="",i.state=r.TEXT):T==="]"?i.cdata+="]":(i.cdata+="]]"+T,i.state=r.CDATA);continue;case r.PROC_INST:T==="?"?i.state=r.PROC_INST_ENDING:c(T)?i.state=r.PROC_INST_BODY:i.procInstName+=T;continue;case r.PROC_INST_BODY:if(!i.procInstBody&&c(T))continue;T==="?"?i.state=r.PROC_INST_ENDING:i.procInstBody+=T;continue;case r.PROC_INST_ENDING:T===">"?(M(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody}),i.procInstName=i.procInstBody="",i.state=r.TEXT):(i.procInstBody+="?"+T,i.state=r.PROC_INST_BODY);continue;case r.OPEN_TAG:L(_,T)?i.tagName+=T:(Nn(i),T===">"?J(i):T==="/"?i.state=r.OPEN_TAG_SLASH:(c(T)||S(i,"Invalid character in tag name"),i.state=r.ATTRIB));continue;case r.OPEN_TAG_SLASH:T===">"?(J(i,!0),ue(i)):(S(i,"Forward-slash in opening tag not followed by >"),i.state=r.ATTRIB);continue;case r.ATTRIB:if(c(T))continue;T===">"?J(i):T==="/"?i.state=r.OPEN_TAG_SLASH:L(P,T)?(i.attribName=T,i.attribValue="",i.state=r.ATTRIB_NAME):S(i,"Invalid attribute name");continue;case r.ATTRIB_NAME:T==="="?i.state=r.ATTRIB_VALUE:T===">"?(S(i,"Attribute without value"),i.attribValue=i.attribName,se(i),J(i)):c(T)?i.state=r.ATTRIB_NAME_SAW_WHITE:L(_,T)?i.attribName+=T:S(i,"Invalid attribute name");continue;case r.ATTRIB_NAME_SAW_WHITE:if(T==="=")i.state=r.ATTRIB_VALUE;else{if(c(T))continue;S(i,"Attribute without value"),i.tag.attributes[i.attribName]="",i.attribValue="",M(i,"onattribute",{name:i.attribName,value:""}),i.attribName="",T===">"?J(i):L(P,T)?(i.attribName=T,i.state=r.ATTRIB_NAME):(S(i,"Invalid attribute name"),i.state=r.ATTRIB)}continue;case r.ATTRIB_VALUE:if(c(T))continue;f(T)?(i.q=T,i.state=r.ATTRIB_VALUE_QUOTED):(i.opt.unquotedAttributeValues||j(i,"Unquoted attribute value"),i.state=r.ATTRIB_VALUE_UNQUOTED,i.attribValue=T);continue;case r.ATTRIB_VALUE_QUOTED:if(T!==i.q){T==="&"?i.state=r.ATTRIB_VALUE_ENTITY_Q:i.attribValue+=T;continue}se(i),i.q="",i.state=r.ATTRIB_VALUE_CLOSED;continue;case r.ATTRIB_VALUE_CLOSED:c(T)?i.state=r.ATTRIB:T===">"?J(i):T==="/"?i.state=r.OPEN_TAG_SLASH:L(P,T)?(S(i,"No whitespace between attributes"),i.attribName=T,i.attribValue="",i.state=r.ATTRIB_NAME):S(i,"Invalid attribute name");continue;case r.ATTRIB_VALUE_UNQUOTED:if(!D(T)){T==="&"?i.state=r.ATTRIB_VALUE_ENTITY_U:i.attribValue+=T;continue}se(i),T===">"?J(i):i.state=r.ATTRIB;continue;case r.CLOSE_TAG:if(i.tagName)T===">"?ue(i):L(_,T)?i.tagName+=T:i.script?(i.script+="</"+i.tagName,i.tagName="",i.state=r.SCRIPT):(c(T)||S(i,"Invalid tagname in closing tag"),i.state=r.CLOSE_TAG_SAW_WHITE);else{if(c(T))continue;v(P,T)?i.script?(i.script+="</"+T,i.state=r.SCRIPT):S(i,"Invalid tagname in closing tag."):i.tagName=T}continue;case r.CLOSE_TAG_SAW_WHITE:if(c(T))continue;T===">"?ue(i):S(i,"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(i.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(T===";"){var $=vn(i);i.opt.unparsedEntities&&!Object.values(a.XML_ENTITIES).includes($)?(i.entity="",i.state=U,i.write($)):(i[k]+=$,i.entity="",i.state=U)}else L(i.entity.length?s:E,T)?i.entity+=T:(S(i,"Invalid character in entity name"),i[k]+="&"+i.entity+T,i.entity="",i.state=U);continue;default:throw new Error(i,"Unknown state: "+i.state)}return i.position>=i.bufferCheckPosition&&p(i),i}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var u=String.fromCharCode,i=Math.floor,A=function(){var T=16384,R=[],q,U,k=-1,$=arguments.length;if(!$)return"";for(var et="";++k<$;){var V=Number(arguments[k]);if(!isFinite(V)||V<0||V>1114111||i(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>T)&&(et+=u.apply(null,R),R.length=0)}return et};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A}()})(n)}(ne)),ne}var Bt={exports:{}},Qe;function Qr(){if(Qe)return Bt.exports;Qe=1;var n=typeof Reflect=="object"?Reflect:null,a=n&&typeof n.apply=="function"?n.apply:function(f,D,L){return Function.prototype.apply.call(f,D,L)},g;n&&typeof n.ownKeys=="function"?g=n.ownKeys:Object.getOwnPropertySymbols?g=function(f){return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f))}:g=function(f){return Object.getOwnPropertyNames(f)};function h(c){console&&console.warn&&console.warn(c)}var p=Number.isNaN||function(f){return f!==f};function t(){t.init.call(this)}Bt.exports=t,Bt.exports.once=_,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||p(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||p(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 D=[],L=1;L<arguments.length;L++)D.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(D.length>0&&(N=D[0]),N instanceof Error)throw N;var x=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw x.context=N,x}var M=r[f];if(M===void 0)return!1;if(typeof M=="function")a(M,this,D);else for(var C=M.length,F=O(M,C),L=0;L<C;++L)a(F[L],this,D);return!0};function b(c,f,D,L){var v,r,N;if(o(D),r=c._events,r===void 0?(r=c._events=Object.create(null),c._eventsCount=0):(r.newListener!==void 0&&(c.emit("newListener",f,D.listener?D.listener:D),r=c._events),N=r[f]),N===void 0)N=r[f]=D,++c._eventsCount;else if(typeof N=="function"?N=r[f]=L?[D,N]:[N,D]:L?N.unshift(D):N.push(D),v=l(c),v>0&&N.length>v&&!N.warned){N.warned=!0;var x=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(f)+" listeners added. Use emitter.setMaxListeners() to increase limit");x.name="MaxListenersExceededWarning",x.emitter=c,x.type=f,x.count=N.length,h(x)}return c}t.prototype.addListener=function(f,D){return b(this,f,D,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(f,D){return b(this,f,D,!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,D){var L={fired:!1,wrapFn:void 0,target:c,type:f,listener:D},v=m.bind(L);return v.listener=D,L.wrapFn=v,v}t.prototype.once=function(f,D){return o(D),this.on(f,y(this,f,D)),this},t.prototype.prependOnceListener=function(f,D){return o(D),this.prependListener(f,y(this,f,D)),this},t.prototype.removeListener=function(f,D){var L,v,r,N,x;if(o(D),v=this._events,v===void 0)return this;if(L=v[f],L===void 0)return this;if(L===D||L.listener===D)--this._eventsCount===0?this._events=Object.create(null):(delete v[f],v.removeListener&&this.emit("removeListener",f,L.listener||D));else if(typeof L!="function"){for(r=-1,N=L.length-1;N>=0;N--)if(L[N]===D||L[N].listener===D){x=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,x||D)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(f){var D,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(D=L[f],typeof D=="function")this.removeListener(f,D);else if(D!==void 0)for(v=D.length-1;v>=0;v--)this.removeListener(f,D[v]);return this};function d(c,f,D){var L=c._events;if(L===void 0)return[];var v=L[f];return v===void 0?[]:typeof v=="function"?D?[v.listener||v]:[v]:D?P(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):w.call(c,f)},t.prototype.listenerCount=w;function w(c){var f=this._events;if(f!==void 0){var D=f[c];if(typeof D=="function")return 1;if(D!==void 0)return D.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]};function O(c,f){for(var D=new Array(f),L=0;L<f;++L)D[L]=c[L];return D}function I(c,f){for(;f+1<c.length;f++)c[f]=c[f+1];c.pop()}function P(c){for(var f=new Array(c.length),D=0;D<f.length;++D)f[D]=c[D].listener||c[D];return f}function _(c,f){return new Promise(function(D,L){function v(N){c.removeListener(f,r),L(N)}function r(){typeof c.removeListener=="function"&&c.removeListener("error",v),D([].slice.call(arguments))}s(c,f,r,{once:!0}),f!=="error"&&E(c,v,{once:!0})})}function E(c,f,D){typeof c.on=="function"&&s(c,"error",f,D)}function s(c,f,D,L){if(typeof c.on=="function")L.once?c.once(f,D):c.on(f,D);else if(typeof c.addEventListener=="function")c.addEventListener(f,function v(r){L.once&&c.removeEventListener(f,v),D(r)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof c)}return Bt.exports}var qt={},Ze;function Zr(){return Ze||(Ze=1,(function(){qt.stripBOM=function(n){return n[0]==="\uFEFF"?n.substring(1):n}}).call(qt)),qt}var Z={},Je;function tr(){return Je||(Je=1,(function(){var n;n=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(n,"")},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 er;function Jr(){return er||(er=1,function(n){(function(){var a,g,h,p,t,e,o,l,b,m=function(w,O){return function(){return w.apply(O,arguments)}},y=function(w,O){for(var I in O)d.call(O,I)&&(w[I]=O[I]);function P(){this.constructor=w}return P.prototype=O.prototype,w.prototype=new P,w.__super__=O.prototype,w},d={}.hasOwnProperty;l=Hr(),p=Qr(),a=Zr(),o=tr(),b=ie.setImmediate,g=Vt().defaults,t=function(w){return typeof w=="object"&&w!=null&&Object.keys(w).length===0},e=function(w,O,I){var P,_,E;for(P=0,_=w.length;P<_;P++)E=w[P],O=E(O,I);return O},h=function(w,O,I){var P;return P=Object.create(null),P.value=I,P.writable=!0,P.enumerable=!0,P.configurable=!0,Object.defineProperty(w,O,P)},n.Parser=function(w){y(O,w);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 P,_,E;if(!(this instanceof n.Parser))return new n.Parser(I);this.options={},_=g["0.2"];for(P in _)d.call(_,P)&&(E=_[P],this.options[P]=E);for(P in I)d.call(I,P)&&(E=I[P],this.options[P]=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,P;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(_){if(P=_,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(P)}},O.prototype.assignOrPush=function(I,P,_){return P in I?(I[P]instanceof Array||h(I,P,[I[P]]),I[P].push(_)):this.options.explicitArray?h(I,P,[_]):h(I,P,_)},O.prototype.reset=function(){var I,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,P=this.options.charkey,this.saxParser.onopentag=function(s){return function(c){var f,D,L,v,r;if(L={},L[P]="",!s.options.ignoreAttrs){r=c.attributes;for(f in r)d.call(r,f)&&(!(I in L)&&!s.options.mergeAttrs&&(L[I]={}),D=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,D):h(L[I],v,D))}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,D,L,v,r,N,x,M,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),M=E[E.length-1],r[P].match(/^\s*$/)&&!c?(f=r[P],delete r[P]):(s.options.trim&&(r[P]=r[P].trim()),s.options.normalize&&(r[P]=r[P].replace(/\s{2,}/g," ").trim()),r[P]=s.options.valueProcessors?e(s.options.valueProcessors,r[P],v):r[P],Object.keys(r).length===1&&P in r&&!s.EXPLICIT_CHARKEY&&(r=r[P])),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,M&&M[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(M){M[s.options.childkey]=M[s.options.childkey]||[],N={};for(D in r)d.call(r,D)&&h(N,D,r[D]);M[s.options.childkey].push(N),delete r["#name"],Object.keys(r).length===1&&P in r&&!s.EXPLICIT_CHARKEY&&(r=r[P])}}return E.length>0?s.assignOrPush(M,v,r):(s.options.explicitRoot&&(x=r,r={},h(r,v,x)),s.resultObject=r,s.saxParser.ended=!0,s.emit("end",s.resultObject))}}(this),_=function(s){return function(c){var f,D;if(D=E[E.length-1],D)return D[P]+=c,s.options.explicitChildren&&s.options.preserveChildrenOrder&&s.options.charsAsChildren&&(s.options.includeWhiteChars||c.replace(/\\n/g,"").trim()!=="")&&(D[s.options.childkey]=D[s.options.childkey]||[],f={"#name":"__text__"},f[P]=c,s.options.normalize&&(f[P]=f[P].replace(/\s{2,}/g," ").trim()),D[s.options.childkey].push(f)),D}}(this),this.saxParser.ontext=_,this.saxParser.oncdata=function(s){return function(c){var f;if(f=_(c),f)return f.cdata=!0}}()},O.prototype.parseString=function(I,P){var _;P!=null&&typeof P=="function"&&(this.on("end",function(E){return this.reset(),P(null,E)}),this.on("error",function(E){return this.reset(),P(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(_=E,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw _}else return this.emit("error",_),this.saxParser.errThrown=!0}},O.prototype.parseStringPromise=function(I){return new Promise(function(P){return function(_,E){return P.parseString(I,function(s,c){return s?E(s):_(c)})}}(this))},O}(p),n.parseString=function(w,O,I){var P,_,E;return I!=null?(typeof I=="function"&&(P=I),typeof O=="object"&&(_=O)):(typeof O=="function"&&(P=O),_={}),E=new n.Parser(_),E.parseString(w,P)},n.parseStringPromise=function(w,O){var I,P;return typeof O=="object"&&(I=O),P=new n.Parser(I),P.parseStringPromise(w)}}).call(jt)}(jt)),jt}var rr;function tn(){return rr||(rr=1,(function(){var n,a,g,h,p=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=Vt(),n=zr(),g=Jr(),h=tr(),Y.defaults=a.defaults,Y.processors=h,Y.ValidationError=function(e){p(o,e);function o(l){this.message=l}return o}(Error),Y.Builder=n.Builder,Y.Parser=g.Parser,Y.parseString=g.parseString,Y.parseStringPromise=g.parseStringPromise}).call(Y)),Y}var nr=tn();const en=n=>n!==null&&typeof n=="object"&&n.hasOwnProperty("rss")&&typeof n.rss=="object"&&n.rss!==null&&n.rss.hasOwnProperty("channel")&&Array.isArray(n.rss.channel),rn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&Array.isArray(n.title)&&n.hasOwnProperty("description")&&Array.isArray(n.description)&&n.hasOwnProperty("link")&&Array.isArray(n.link)&&n.hasOwnProperty("image")&&Array.isArray(n.image)&&n.image.every(nn)&&n.hasOwnProperty("generator")&&Array.isArray(n.generator)&&n.hasOwnProperty("lastBuildDate")&&Array.isArray(n.lastBuildDate)&&n.hasOwnProperty("atom:link")&&Array.isArray(n["atom:link"])&&n["atom:link"].every(on)&&n.hasOwnProperty("copyright")&&Array.isArray(n.copyright)&&n.hasOwnProperty("language")&&Array.isArray(n.language)&&n.hasOwnProperty("webMaster")&&Array.isArray(n.webMaster)&&n.hasOwnProperty("itunes:owner")&&Array.isArray(n["itunes:owner"])&&n["itunes:owner"].every(sn)&&n.hasOwnProperty("itunes:author")&&Array.isArray(n["itunes:author"])&&n.hasOwnProperty("googleplay:owner")&&Array.isArray(n["googleplay:owner"])&&n.hasOwnProperty("googleplay:email")&&Array.isArray(n["googleplay:email"])&&n.hasOwnProperty("googleplay:author")&&Array.isArray(n["googleplay:author"])&&n.hasOwnProperty("item")&&Array.isArray(n.item)&&n.item.every(un),nn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("url")&&Array.isArray(n.url)&&n.hasOwnProperty("title")&&Array.isArray(n.title)&&n.hasOwnProperty("link")&&Array.isArray(n.link),on=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("$")&&typeof n.$=="object"&&n.$!==null&&n.$.hasOwnProperty("href")&&typeof n.$.href=="string"&&n.$.hasOwnProperty("rel")&&typeof n.$.rel=="string"&&n.$.hasOwnProperty("type")&&typeof n.$.type=="string",sn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("itunes:email")&&Array.isArray(n["itunes:email"])&&n.hasOwnProperty("itunes:name")&&Array.isArray(n["itunes:name"]),un=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&Array.isArray(n.title)&&n.hasOwnProperty("description")&&Array.isArray(n.description)&&n.hasOwnProperty("link")&&Array.isArray(n.link)&&n.hasOwnProperty("guid")&&Array.isArray(n.guid)&&n.guid.every(an)&&n.hasOwnProperty("dc:creator")&&Array.isArray(n["dc:creator"])&&n.hasOwnProperty("pubDate")&&Array.isArray(n.pubDate)&&n.hasOwnProperty("enclosure")&&Array.isArray(n.enclosure)&&n.enclosure.every(cn)&&n.hasOwnProperty("content:encoded")&&Array.isArray(n["content:encoded"]),an=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("_")&&typeof n._=="string"&&n.hasOwnProperty("$")&&typeof n.$=="object"&&n.$!==null&&n.$.hasOwnProperty("isPermaLink")&&typeof n.$.isPermaLink=="string",cn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("$")&&typeof n.$=="object"&&n.$!==null&&n.$.hasOwnProperty("url")&&typeof n.$.url=="string"&&n.$.hasOwnProperty("length")&&typeof n.$.length=="string"&&n.$.hasOwnProperty("type")&&typeof n.$.type=="string",ln=n=>n&&n.contents&&n.status.http_code==200,fn=n=>n!==null&&typeof n=="object"&&n.hasOwnProperty("rss"),hn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("channel"),pn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&n.hasOwnProperty("item"),ir=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&n.hasOwnProperty("link")&&n.hasOwnProperty("book_image_url")&&n.hasOwnProperty("author_name")&&n.hasOwnProperty("book_description"),dn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("contents")&&n.hasOwnProperty("status"),or="https://api.allorigins.win/get?url=",tt=typeof document<"u",yn=async n=>{try{const a=tt?`${or}${encodeURIComponent(n)}`:n,g=await fetch(a);if(g.ok)return tt?g.json():g.text()}catch{throw new Error("Error occurred fetching Feed from Substack")}},Ut=async(n="",a)=>{if(!a)return nr.parseStringPromise(n);nr.parseString(n,a)},mn=n=>({title:n.title[0],description:n.description[0],link:n.link[0],pubDate:n.pubDate[0],content:n["content:encoded"][0]}),gn=async(n,a)=>{const g=await yn(n);if(!tt)return Ut(g,a);if(!ln(g))throw new Error("Error occurred fetching Feed from Substack");await Ut(g.contents,a)},wn=(n,a)=>{if(!en(n))throw new Error("Feed is not in the correct format");try{return n.rss.channel.filter(rn).filter(g=>g.link[0]===a)}catch{throw new Error(`Error occurred fetching Feed by Link: ${a}`)}},Tn=n=>n[0].item.map(mn),Dn=n=>{if(!ir(n))throw new Error("Goodreads item is not in the correct format");return{title:n.title[0],link:n.link[0],book_image_url:n.book_image_url[0],author_name:n.author_name[0],book_description:n.book_description[0]}},En=async n=>{try{const a=tt?`${or}${encodeURIComponent(n)}`:n,g=await fetch(a);if(g.ok)return tt?g.json():g.text()}catch{throw new Error("Error occurred fetching Feed from Goodreads")}},bn=async(n,a)=>{const g=await En(n);if(!tt)return Ut(g,a);if(!dn(g))throw new Error("Error occurred fetching Feed from Goodreads");await Ut(g.contents,a)},On=n=>{if(!fn(n))throw new Error("Goodreads feed is not in the correct format");if(!hn(n.rss))throw new Error("Goodreads RSS feed is not in the correct format");const a=n.rss.channel.filter(pn);if(a.length===0)throw new Error("Goodreads feed does not contain any channels");const g=a[0];return Array.isArray(g.item)?g.item.filter(ir).map(Dn):[]};W.getFeedByLink=wn,W.getGoodreadsFeed=bn,W.getGoodreadsFeedItems=On,W.getPosts=Tn,W.getSubstackFeed=gn,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
11
|
+
`?(i.line++,i.column=0):i.column++);i.textNode+=u.substring(R,A-1)}T==="<"&&!(i.sawRoot&&i.closedRoot&&!i.strict)?(i.state=r.OPEN_WAKA,i.startTagPosition=i.position):(!c(T)&&(!i.sawRoot||i.closedRoot)&&S(i,"Text data outside of root node."),T==="&"?i.state=r.TEXT_ENTITY:i.textNode+=T);continue;case r.SCRIPT:T==="<"?i.state=r.SCRIPT_ENDING:i.script+=T;continue;case r.SCRIPT_ENDING:T==="/"?i.state=r.CLOSE_TAG:(i.script+="<"+T,i.state=r.SCRIPT);continue;case r.OPEN_WAKA:if(T==="!")i.state=r.SGML_DECL,i.sgmlDecl="";else if(!c(T))if(L(P,T))i.state=r.OPEN_TAG,i.tagName=T;else if(T==="/")i.state=r.CLOSE_TAG,i.tagName="";else if(T==="?")i.state=r.PROC_INST,i.procInstName=i.procInstBody="";else{if(S(i,"Unencoded <"),i.startTagPosition+1<i.position){var q=i.position-i.startTagPosition;T=new Array(q).join(" ")+T}i.textNode+="<"+T,i.state=r.TEXT}continue;case r.SGML_DECL:if(i.sgmlDecl+T==="--"){i.state=r.COMMENT,i.comment="",i.sgmlDecl="";continue}i.doctype&&i.doctype!==!0&&i.sgmlDecl?(i.state=r.DOCTYPE_DTD,i.doctype+="<!"+i.sgmlDecl+T,i.sgmlDecl=""):(i.sgmlDecl+T).toUpperCase()===y?(M(i,"onopencdata"),i.state=r.CDATA,i.sgmlDecl="",i.cdata=""):(i.sgmlDecl+T).toUpperCase()===d?(i.state=r.DOCTYPE,(i.doctype||i.sawRoot)&&S(i,"Inappropriately located doctype declaration"),i.doctype="",i.sgmlDecl=""):T===">"?(M(i,"onsgmldeclaration",i.sgmlDecl),i.sgmlDecl="",i.state=r.TEXT):(h(T)&&(i.state=r.SGML_DECL_QUOTED),i.sgmlDecl+=T);continue;case r.SGML_DECL_QUOTED:T===i.q&&(i.state=r.SGML_DECL,i.q=""),i.sgmlDecl+=T;continue;case r.DOCTYPE:T===">"?(i.state=r.TEXT,M(i,"ondoctype",i.doctype),i.doctype=!0):(i.doctype+=T,T==="["?i.state=r.DOCTYPE_DTD:h(T)&&(i.state=r.DOCTYPE_QUOTED,i.q=T));continue;case r.DOCTYPE_QUOTED:i.doctype+=T,T===i.q&&(i.q="",i.state=r.DOCTYPE);continue;case r.DOCTYPE_DTD:T==="]"?(i.doctype+=T,i.state=r.DOCTYPE):T==="<"?(i.state=r.OPEN_WAKA,i.startTagPosition=i.position):h(T)?(i.doctype+=T,i.state=r.DOCTYPE_DTD_QUOTED,i.q=T):i.doctype+=T;continue;case r.DOCTYPE_DTD_QUOTED:i.doctype+=T,T===i.q&&(i.state=r.DOCTYPE_DTD,i.q="");continue;case r.COMMENT:T==="-"?i.state=r.COMMENT_ENDING:i.comment+=T;continue;case r.COMMENT_ENDING:T==="-"?(i.state=r.COMMENT_ENDED,i.comment=F(i.opt,i.comment),i.comment&&M(i,"oncomment",i.comment),i.comment=""):(i.comment+="-"+T,i.state=r.COMMENT);continue;case r.COMMENT_ENDED:T!==">"?(S(i,"Malformed comment"),i.comment+="--"+T,i.state=r.COMMENT):i.doctype&&i.doctype!==!0?i.state=r.DOCTYPE_DTD:i.state=r.TEXT;continue;case r.CDATA:T==="]"?i.state=r.CDATA_ENDING:i.cdata+=T;continue;case r.CDATA_ENDING:T==="]"?i.state=r.CDATA_ENDING_2:(i.cdata+="]"+T,i.state=r.CDATA);continue;case r.CDATA_ENDING_2:T===">"?(i.cdata&&M(i,"oncdata",i.cdata),M(i,"onclosecdata"),i.cdata="",i.state=r.TEXT):T==="]"?i.cdata+="]":(i.cdata+="]]"+T,i.state=r.CDATA);continue;case r.PROC_INST:T==="?"?i.state=r.PROC_INST_ENDING:c(T)?i.state=r.PROC_INST_BODY:i.procInstName+=T;continue;case r.PROC_INST_BODY:if(!i.procInstBody&&c(T))continue;T==="?"?i.state=r.PROC_INST_ENDING:i.procInstBody+=T;continue;case r.PROC_INST_ENDING:T===">"?(M(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody}),i.procInstName=i.procInstBody="",i.state=r.TEXT):(i.procInstBody+="?"+T,i.state=r.PROC_INST_BODY);continue;case r.OPEN_TAG:L(_,T)?i.tagName+=T:(Nn(i),T===">"?J(i):T==="/"?i.state=r.OPEN_TAG_SLASH:(c(T)||S(i,"Invalid character in tag name"),i.state=r.ATTRIB));continue;case r.OPEN_TAG_SLASH:T===">"?(J(i,!0),ue(i)):(S(i,"Forward-slash in opening tag not followed by >"),i.state=r.ATTRIB);continue;case r.ATTRIB:if(c(T))continue;T===">"?J(i):T==="/"?i.state=r.OPEN_TAG_SLASH:L(P,T)?(i.attribName=T,i.attribValue="",i.state=r.ATTRIB_NAME):S(i,"Invalid attribute name");continue;case r.ATTRIB_NAME:T==="="?i.state=r.ATTRIB_VALUE:T===">"?(S(i,"Attribute without value"),i.attribValue=i.attribName,se(i),J(i)):c(T)?i.state=r.ATTRIB_NAME_SAW_WHITE:L(_,T)?i.attribName+=T:S(i,"Invalid attribute name");continue;case r.ATTRIB_NAME_SAW_WHITE:if(T==="=")i.state=r.ATTRIB_VALUE;else{if(c(T))continue;S(i,"Attribute without value"),i.tag.attributes[i.attribName]="",i.attribValue="",M(i,"onattribute",{name:i.attribName,value:""}),i.attribName="",T===">"?J(i):L(P,T)?(i.attribName=T,i.state=r.ATTRIB_NAME):(S(i,"Invalid attribute name"),i.state=r.ATTRIB)}continue;case r.ATTRIB_VALUE:if(c(T))continue;h(T)?(i.q=T,i.state=r.ATTRIB_VALUE_QUOTED):(i.opt.unquotedAttributeValues||j(i,"Unquoted attribute value"),i.state=r.ATTRIB_VALUE_UNQUOTED,i.attribValue=T);continue;case r.ATTRIB_VALUE_QUOTED:if(T!==i.q){T==="&"?i.state=r.ATTRIB_VALUE_ENTITY_Q:i.attribValue+=T;continue}se(i),i.q="",i.state=r.ATTRIB_VALUE_CLOSED;continue;case r.ATTRIB_VALUE_CLOSED:c(T)?i.state=r.ATTRIB:T===">"?J(i):T==="/"?i.state=r.OPEN_TAG_SLASH:L(P,T)?(S(i,"No whitespace between attributes"),i.attribName=T,i.attribValue="",i.state=r.ATTRIB_NAME):S(i,"Invalid attribute name");continue;case r.ATTRIB_VALUE_UNQUOTED:if(!D(T)){T==="&"?i.state=r.ATTRIB_VALUE_ENTITY_U:i.attribValue+=T;continue}se(i),T===">"?J(i):i.state=r.ATTRIB;continue;case r.CLOSE_TAG:if(i.tagName)T===">"?ue(i):L(_,T)?i.tagName+=T:i.script?(i.script+="</"+i.tagName,i.tagName="",i.state=r.SCRIPT):(c(T)||S(i,"Invalid tagname in closing tag"),i.state=r.CLOSE_TAG_SAW_WHITE);else{if(c(T))continue;v(P,T)?i.script?(i.script+="</"+T,i.state=r.SCRIPT):S(i,"Invalid tagname in closing tag."):i.tagName=T}continue;case r.CLOSE_TAG_SAW_WHITE:if(c(T))continue;T===">"?ue(i):S(i,"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(i.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(T===";"){var $=vn(i);i.opt.unparsedEntities&&!Object.values(a.XML_ENTITIES).includes($)?(i.entity="",i.state=U,i.write($)):(i[k]+=$,i.entity="",i.state=U)}else L(i.entity.length?s:E,T)?i.entity+=T:(S(i,"Invalid character in entity name"),i[k]+="&"+i.entity+T,i.entity="",i.state=U);continue;default:throw new Error(i,"Unknown state: "+i.state)}return i.position>=i.bufferCheckPosition&&p(i),i}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var u=String.fromCharCode,i=Math.floor,A=function(){var T=16384,R=[],q,U,k=-1,$=arguments.length;if(!$)return"";for(var et="";++k<$;){var V=Number(arguments[k]);if(!isFinite(V)||V<0||V>1114111||i(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>T)&&(et+=u.apply(null,R),R.length=0)}return et};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A}()})(n)}(ne)),ne}var Bt={exports:{}},Qe;function Qr(){if(Qe)return Bt.exports;Qe=1;var n=typeof Reflect=="object"?Reflect:null,a=n&&typeof n.apply=="function"?n.apply:function(h,D,L){return Function.prototype.apply.call(h,D,L)},g;n&&typeof n.ownKeys=="function"?g=n.ownKeys:Object.getOwnPropertySymbols?g=function(h){return Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h))}:g=function(h){return Object.getOwnPropertyNames(h)};function f(c){console&&console.warn&&console.warn(c)}var p=Number.isNaN||function(h){return h!==h};function t(){t.init.call(this)}Bt.exports=t,Bt.exports.once=_,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||p(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(h){if(typeof h!="number"||h<0||p(h))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+h+".");return this._maxListeners=h,this};function l(c){return c._maxListeners===void 0?t.defaultMaxListeners:c._maxListeners}t.prototype.getMaxListeners=function(){return l(this)},t.prototype.emit=function(h){for(var D=[],L=1;L<arguments.length;L++)D.push(arguments[L]);var v=h==="error",r=this._events;if(r!==void 0)v=v&&r.error===void 0;else if(!v)return!1;if(v){var N;if(D.length>0&&(N=D[0]),N instanceof Error)throw N;var x=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw x.context=N,x}var M=r[h];if(M===void 0)return!1;if(typeof M=="function")a(M,this,D);else for(var C=M.length,F=O(M,C),L=0;L<C;++L)a(F[L],this,D);return!0};function b(c,h,D,L){var v,r,N;if(o(D),r=c._events,r===void 0?(r=c._events=Object.create(null),c._eventsCount=0):(r.newListener!==void 0&&(c.emit("newListener",h,D.listener?D.listener:D),r=c._events),N=r[h]),N===void 0)N=r[h]=D,++c._eventsCount;else if(typeof N=="function"?N=r[h]=L?[D,N]:[N,D]:L?N.unshift(D):N.push(D),v=l(c),v>0&&N.length>v&&!N.warned){N.warned=!0;var x=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(h)+" listeners added. Use emitter.setMaxListeners() to increase limit");x.name="MaxListenersExceededWarning",x.emitter=c,x.type=h,x.count=N.length,f(x)}return c}t.prototype.addListener=function(h,D){return b(this,h,D,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(h,D){return b(this,h,D,!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,h,D){var L={fired:!1,wrapFn:void 0,target:c,type:h,listener:D},v=m.bind(L);return v.listener=D,L.wrapFn=v,v}t.prototype.once=function(h,D){return o(D),this.on(h,y(this,h,D)),this},t.prototype.prependOnceListener=function(h,D){return o(D),this.prependListener(h,y(this,h,D)),this},t.prototype.removeListener=function(h,D){var L,v,r,N,x;if(o(D),v=this._events,v===void 0)return this;if(L=v[h],L===void 0)return this;if(L===D||L.listener===D)--this._eventsCount===0?this._events=Object.create(null):(delete v[h],v.removeListener&&this.emit("removeListener",h,L.listener||D));else if(typeof L!="function"){for(r=-1,N=L.length-1;N>=0;N--)if(L[N]===D||L[N].listener===D){x=L[N].listener,r=N;break}if(r<0)return this;r===0?L.shift():I(L,r),L.length===1&&(v[h]=L[0]),v.removeListener!==void 0&&this.emit("removeListener",h,x||D)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(h){var D,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[h]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete L[h]),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(D=L[h],typeof D=="function")this.removeListener(h,D);else if(D!==void 0)for(v=D.length-1;v>=0;v--)this.removeListener(h,D[v]);return this};function d(c,h,D){var L=c._events;if(L===void 0)return[];var v=L[h];return v===void 0?[]:typeof v=="function"?D?[v.listener||v]:[v]:D?P(v):O(v,v.length)}t.prototype.listeners=function(h){return d(this,h,!0)},t.prototype.rawListeners=function(h){return d(this,h,!1)},t.listenerCount=function(c,h){return typeof c.listenerCount=="function"?c.listenerCount(h):w.call(c,h)},t.prototype.listenerCount=w;function w(c){var h=this._events;if(h!==void 0){var D=h[c];if(typeof D=="function")return 1;if(D!==void 0)return D.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]};function O(c,h){for(var D=new Array(h),L=0;L<h;++L)D[L]=c[L];return D}function I(c,h){for(;h+1<c.length;h++)c[h]=c[h+1];c.pop()}function P(c){for(var h=new Array(c.length),D=0;D<h.length;++D)h[D]=c[D].listener||c[D];return h}function _(c,h){return new Promise(function(D,L){function v(N){c.removeListener(h,r),L(N)}function r(){typeof c.removeListener=="function"&&c.removeListener("error",v),D([].slice.call(arguments))}s(c,h,r,{once:!0}),h!=="error"&&E(c,v,{once:!0})})}function E(c,h,D){typeof c.on=="function"&&s(c,"error",h,D)}function s(c,h,D,L){if(typeof c.on=="function")L.once?c.once(h,D):c.on(h,D);else if(typeof c.addEventListener=="function")c.addEventListener(h,function v(r){L.once&&c.removeEventListener(h,v),D(r)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof c)}return Bt.exports}var qt={},Ze;function Zr(){return Ze||(Ze=1,(function(){qt.stripBOM=function(n){return n[0]==="\uFEFF"?n.substring(1):n}}).call(qt)),qt}var Z={},Je;function tr(){return Je||(Je=1,(function(){var n;n=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(n,"")},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 er;function Jr(){return er||(er=1,function(n){(function(){var a,g,f,p,t,e,o,l,b,m=function(w,O){return function(){return w.apply(O,arguments)}},y=function(w,O){for(var I in O)d.call(O,I)&&(w[I]=O[I]);function P(){this.constructor=w}return P.prototype=O.prototype,w.prototype=new P,w.__super__=O.prototype,w},d={}.hasOwnProperty;l=Hr(),p=Qr(),a=Zr(),o=tr(),b=ie.setImmediate,g=Vt().defaults,t=function(w){return typeof w=="object"&&w!=null&&Object.keys(w).length===0},e=function(w,O,I){var P,_,E;for(P=0,_=w.length;P<_;P++)E=w[P],O=E(O,I);return O},f=function(w,O,I){var P;return P=Object.create(null),P.value=I,P.writable=!0,P.enumerable=!0,P.configurable=!0,Object.defineProperty(w,O,P)},n.Parser=function(w){y(O,w);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 P,_,E;if(!(this instanceof n.Parser))return new n.Parser(I);this.options={},_=g["0.2"];for(P in _)d.call(_,P)&&(E=_[P],this.options[P]=E);for(P in I)d.call(I,P)&&(E=I[P],this.options[P]=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,P;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(_){if(P=_,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(P)}},O.prototype.assignOrPush=function(I,P,_){return P in I?(I[P]instanceof Array||f(I,P,[I[P]]),I[P].push(_)):this.options.explicitArray?f(I,P,[_]):f(I,P,_)},O.prototype.reset=function(){var I,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,P=this.options.charkey,this.saxParser.onopentag=function(s){return function(c){var h,D,L,v,r;if(L={},L[P]="",!s.options.ignoreAttrs){r=c.attributes;for(h in r)d.call(r,h)&&(!(I in L)&&!s.options.mergeAttrs&&(L[I]={}),D=s.options.attrValueProcessors?e(s.options.attrValueProcessors,c.attributes[h],h):c.attributes[h],v=s.options.attrNameProcessors?e(s.options.attrNameProcessors,h):h,s.options.mergeAttrs?s.assignOrPush(L,v,D):f(L[I],v,D))}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,h,D,L,v,r,N,x,M,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),M=E[E.length-1],r[P].match(/^\s*$/)&&!c?(h=r[P],delete r[P]):(s.options.trim&&(r[P]=r[P].trim()),s.options.normalize&&(r[P]=r[P].replace(/\s{2,}/g," ").trim()),r[P]=s.options.valueProcessors?e(s.options.valueProcessors,r[P],v):r[P],Object.keys(r).length===1&&P in r&&!s.EXPLICIT_CHARKEY&&(r=r[P])),t(r)&&(typeof s.options.emptyTag=="function"?r=s.options.emptyTag():r=s.options.emptyTag!==""?s.options.emptyTag:h),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,M&&M[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(M){M[s.options.childkey]=M[s.options.childkey]||[],N={};for(D in r)d.call(r,D)&&f(N,D,r[D]);M[s.options.childkey].push(N),delete r["#name"],Object.keys(r).length===1&&P in r&&!s.EXPLICIT_CHARKEY&&(r=r[P])}}return E.length>0?s.assignOrPush(M,v,r):(s.options.explicitRoot&&(x=r,r={},f(r,v,x)),s.resultObject=r,s.saxParser.ended=!0,s.emit("end",s.resultObject))}}(this),_=function(s){return function(c){var h,D;if(D=E[E.length-1],D)return D[P]+=c,s.options.explicitChildren&&s.options.preserveChildrenOrder&&s.options.charsAsChildren&&(s.options.includeWhiteChars||c.replace(/\\n/g,"").trim()!=="")&&(D[s.options.childkey]=D[s.options.childkey]||[],h={"#name":"__text__"},h[P]=c,s.options.normalize&&(h[P]=h[P].replace(/\s{2,}/g," ").trim()),D[s.options.childkey].push(h)),D}}(this),this.saxParser.ontext=_,this.saxParser.oncdata=function(s){return function(c){var h;if(h=_(c),h)return h.cdata=!0}}()},O.prototype.parseString=function(I,P){var _;P!=null&&typeof P=="function"&&(this.on("end",function(E){return this.reset(),P(null,E)}),this.on("error",function(E){return this.reset(),P(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(_=E,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw _}else return this.emit("error",_),this.saxParser.errThrown=!0}},O.prototype.parseStringPromise=function(I){return new Promise(function(P){return function(_,E){return P.parseString(I,function(s,c){return s?E(s):_(c)})}}(this))},O}(p),n.parseString=function(w,O,I){var P,_,E;return I!=null?(typeof I=="function"&&(P=I),typeof O=="object"&&(_=O)):(typeof O=="function"&&(P=O),_={}),E=new n.Parser(_),E.parseString(w,P)},n.parseStringPromise=function(w,O){var I,P;return typeof O=="object"&&(I=O),P=new n.Parser(I),P.parseStringPromise(w)}}).call(jt)}(jt)),jt}var rr;function tn(){return rr||(rr=1,(function(){var n,a,g,f,p=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=Vt(),n=zr(),g=Jr(),f=tr(),Y.defaults=a.defaults,Y.processors=f,Y.ValidationError=function(e){p(o,e);function o(l){this.message=l}return o}(Error),Y.Builder=n.Builder,Y.Parser=g.Parser,Y.parseString=g.parseString,Y.parseStringPromise=g.parseStringPromise}).call(Y)),Y}var nr=tn();const en=n=>n!==null&&typeof n=="object"&&n.hasOwnProperty("rss")&&typeof n.rss=="object"&&n.rss!==null&&n.rss.hasOwnProperty("channel")&&Array.isArray(n.rss.channel),rn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&Array.isArray(n.title)&&n.hasOwnProperty("description")&&Array.isArray(n.description)&&n.hasOwnProperty("link")&&Array.isArray(n.link)&&n.hasOwnProperty("image")&&Array.isArray(n.image)&&n.image.every(nn)&&n.hasOwnProperty("generator")&&Array.isArray(n.generator)&&n.hasOwnProperty("lastBuildDate")&&Array.isArray(n.lastBuildDate)&&n.hasOwnProperty("atom:link")&&Array.isArray(n["atom:link"])&&n["atom:link"].every(on)&&n.hasOwnProperty("copyright")&&Array.isArray(n.copyright)&&n.hasOwnProperty("language")&&Array.isArray(n.language)&&n.hasOwnProperty("webMaster")&&Array.isArray(n.webMaster)&&n.hasOwnProperty("itunes:owner")&&Array.isArray(n["itunes:owner"])&&n["itunes:owner"].every(sn)&&n.hasOwnProperty("itunes:author")&&Array.isArray(n["itunes:author"])&&n.hasOwnProperty("googleplay:owner")&&Array.isArray(n["googleplay:owner"])&&n.hasOwnProperty("googleplay:email")&&Array.isArray(n["googleplay:email"])&&n.hasOwnProperty("googleplay:author")&&Array.isArray(n["googleplay:author"])&&n.hasOwnProperty("item")&&Array.isArray(n.item)&&n.item.every(un),nn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("url")&&Array.isArray(n.url)&&n.hasOwnProperty("title")&&Array.isArray(n.title)&&n.hasOwnProperty("link")&&Array.isArray(n.link),on=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("$")&&typeof n.$=="object"&&n.$!==null&&n.$.hasOwnProperty("href")&&typeof n.$.href=="string"&&n.$.hasOwnProperty("rel")&&typeof n.$.rel=="string"&&n.$.hasOwnProperty("type")&&typeof n.$.type=="string",sn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("itunes:email")&&Array.isArray(n["itunes:email"])&&n.hasOwnProperty("itunes:name")&&Array.isArray(n["itunes:name"]),un=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&Array.isArray(n.title)&&n.hasOwnProperty("description")&&Array.isArray(n.description)&&n.hasOwnProperty("link")&&Array.isArray(n.link)&&n.hasOwnProperty("guid")&&Array.isArray(n.guid)&&n.guid.every(an)&&n.hasOwnProperty("dc:creator")&&Array.isArray(n["dc:creator"])&&n.hasOwnProperty("pubDate")&&Array.isArray(n.pubDate)&&n.hasOwnProperty("enclosure")&&Array.isArray(n.enclosure)&&n.enclosure.every(cn)&&n.hasOwnProperty("content:encoded")&&Array.isArray(n["content:encoded"]),an=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("_")&&typeof n._=="string"&&n.hasOwnProperty("$")&&typeof n.$=="object"&&n.$!==null&&n.$.hasOwnProperty("isPermaLink")&&typeof n.$.isPermaLink=="string",cn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("$")&&typeof n.$=="object"&&n.$!==null&&n.$.hasOwnProperty("url")&&typeof n.$.url=="string"&&n.$.hasOwnProperty("length")&&typeof n.$.length=="string"&&n.$.hasOwnProperty("type")&&typeof n.$.type=="string",ln=n=>n&&n.contents&&n.status.http_code==200,fn=n=>n!==null&&typeof n=="object"&&n.hasOwnProperty("rss"),hn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("channel"),pn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&n.hasOwnProperty("item"),ir=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("title")&&n.hasOwnProperty("link")&&n.hasOwnProperty("book_image_url")&&n.hasOwnProperty("book_large_image_url")&&n.hasOwnProperty("author_name")&&n.hasOwnProperty("book_description"),dn=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("contents")&&n.hasOwnProperty("status"),or="https://lol-origin-84f24d4beb26.herokuapp.com/get?url=",tt=typeof document<"u",yn=async n=>{try{const a=tt?`${or}${encodeURIComponent(n)}`:n,g=await fetch(a);if(g.ok)return tt?g.json():g.text()}catch(a){throw console.error(a),new Error("Error occurred fetching Feed from Substack")}},Ut=async(n="",a)=>{if(!a)return nr.parseStringPromise(n);nr.parseString(n,a)},mn=n=>({title:n.title[0],description:n.description[0],link:n.link[0],pubDate:n.pubDate[0],content:n["content:encoded"][0]}),gn=async(n,a)=>{const g=await yn(n);if(!tt)return Ut(g,a);if(!ln(g))throw new Error("Error occurred fetching Feed from Substack");await Ut(g.contents,a)},wn=(n,a)=>{if(!en(n))throw new Error("Feed is not in the correct format");try{return n.rss.channel.filter(rn).filter(g=>g.link[0]===a)}catch(g){const f=new Error(`Error occurred fetching Feed by Link: ${a}`);throw f.cause=g,f}},Tn=n=>n[0].item.map(mn),Dn=n=>{if(!ir(n))throw new Error("Goodreads item is not in the correct format");return{title:n.title[0],link:n.link[0],book_image_url:n.book_large_image_url[0],author_name:n.author_name[0],book_description:n.book_description[0]}},En=async(n,a)=>{try{const g=tt?`${a??or}${encodeURIComponent(n)}`:n,f=await fetch(g);if(f.ok)return tt?f.json():f.text()}catch(g){throw console.error(g),new Error("Error occurred fetching Feed from Goodreads")}},bn=async(n,a,g)=>{const f=await En(n,g);if(!tt)return Ut(f,a);if(!dn(f))throw new Error("Error occurred fetching Feed from Goodreads");await Ut(f.contents,a)},On=n=>{if(!fn(n))throw new Error("Goodreads feed is not in the correct format");if(!hn(n.rss))throw new Error("Goodreads RSS feed is not in the correct format");const a=n.rss.channel.filter(pn);if(a.length===0)throw new Error("Goodreads feed does not contain any channels");const g=a[0];return Array.isArray(g.item)?g.item.filter(ir).map(Dn):[]};W.getFeedByLink=wn,W.getGoodreadsFeed=bn,W.getGoodreadsFeedItems=On,W.getPosts=Tn,W.getSubstackFeed=gn,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|