substack-feed-api 1.0.0

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.
@@ -0,0 +1,3366 @@
1
+ var M = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function ur(i) {
3
+ if (i.__esModule) return i;
4
+ var c = i.default;
5
+ if (typeof c == "function") {
6
+ var D = function h() {
7
+ return this instanceof h ? Reflect.construct(c, arguments, this.constructor) : c.apply(this, arguments);
8
+ };
9
+ D.prototype = c.prototype;
10
+ } else D = {};
11
+ return Object.defineProperty(D, "__esModule", { value: !0 }), Object.keys(i).forEach(function(h) {
12
+ var p = Object.getOwnPropertyDescriptor(i, h);
13
+ Object.defineProperty(D, h, p.get ? p : {
14
+ enumerable: !0,
15
+ get: function() {
16
+ return i[h];
17
+ }
18
+ });
19
+ }), D;
20
+ }
21
+ var ut = {}, ce;
22
+ function Wt() {
23
+ return ce || (ce = 1, (function() {
24
+ ut.defaults = {
25
+ "0.1": {
26
+ explicitCharkey: !1,
27
+ trim: !0,
28
+ normalize: !0,
29
+ normalizeTags: !1,
30
+ attrkey: "@",
31
+ charkey: "#",
32
+ explicitArray: !1,
33
+ ignoreAttrs: !1,
34
+ mergeAttrs: !1,
35
+ explicitRoot: !1,
36
+ validator: null,
37
+ xmlns: !1,
38
+ explicitChildren: !1,
39
+ childkey: "@@",
40
+ charsAsChildren: !1,
41
+ includeWhiteChars: !1,
42
+ async: !1,
43
+ strict: !0,
44
+ attrNameProcessors: null,
45
+ attrValueProcessors: null,
46
+ tagNameProcessors: null,
47
+ valueProcessors: null,
48
+ emptyTag: ""
49
+ },
50
+ "0.2": {
51
+ explicitCharkey: !1,
52
+ trim: !1,
53
+ normalize: !1,
54
+ normalizeTags: !1,
55
+ attrkey: "$",
56
+ charkey: "_",
57
+ explicitArray: !0,
58
+ ignoreAttrs: !1,
59
+ mergeAttrs: !1,
60
+ explicitRoot: !0,
61
+ validator: null,
62
+ xmlns: !1,
63
+ explicitChildren: !1,
64
+ preserveChildrenOrder: !1,
65
+ childkey: "$$",
66
+ charsAsChildren: !1,
67
+ includeWhiteChars: !1,
68
+ async: !1,
69
+ strict: !0,
70
+ attrNameProcessors: null,
71
+ attrValueProcessors: null,
72
+ tagNameProcessors: null,
73
+ valueProcessors: null,
74
+ rootName: "root",
75
+ xmldec: {
76
+ version: "1.0",
77
+ encoding: "UTF-8",
78
+ standalone: !0
79
+ },
80
+ doctype: null,
81
+ renderOpts: {
82
+ pretty: !0,
83
+ indent: " ",
84
+ newline: `
85
+ `
86
+ },
87
+ headless: !1,
88
+ chunkSize: 1e4,
89
+ emptyTag: "",
90
+ cdata: !1
91
+ }
92
+ };
93
+ }).call(M)), ut;
94
+ }
95
+ var at = {}, K = {}, z = {}, le;
96
+ function H() {
97
+ return le || (le = 1, (function() {
98
+ var i, c, D, h, p, t, e, o = [].slice, l = {}.hasOwnProperty;
99
+ i = function() {
100
+ var O, m, y, d, g, b;
101
+ if (b = arguments[0], g = 2 <= arguments.length ? o.call(arguments, 1) : [], p(Object.assign))
102
+ Object.assign.apply(null, arguments);
103
+ else
104
+ for (O = 0, y = g.length; O < y; O++)
105
+ if (d = g[O], d != null)
106
+ for (m in d)
107
+ l.call(d, m) && (b[m] = d[m]);
108
+ return b;
109
+ }, p = function(O) {
110
+ return !!O && Object.prototype.toString.call(O) === "[object Function]";
111
+ }, t = function(O) {
112
+ var m;
113
+ return !!O && ((m = typeof O) == "function" || m === "object");
114
+ }, D = function(O) {
115
+ return p(Array.isArray) ? Array.isArray(O) : Object.prototype.toString.call(O) === "[object Array]";
116
+ }, h = function(O) {
117
+ var m;
118
+ if (D(O))
119
+ return !O.length;
120
+ for (m in O)
121
+ if (l.call(O, m))
122
+ return !1;
123
+ return !0;
124
+ }, e = function(O) {
125
+ var m, y;
126
+ return t(O) && (y = Object.getPrototypeOf(O)) && (m = y.constructor) && typeof m == "function" && m instanceof m && Function.prototype.toString.call(m) === Function.prototype.toString.call(Object);
127
+ }, c = function(O) {
128
+ return p(O.valueOf) ? O.valueOf() : O;
129
+ }, z.assign = i, z.isFunction = p, z.isObject = t, z.isArray = D, z.isEmpty = h, z.isPlainObject = e, z.getValue = c;
130
+ }).call(M)), z;
131
+ }
132
+ var ct = { exports: {} }, fe;
133
+ function ze() {
134
+ return fe || (fe = 1, (function() {
135
+ ct.exports = function() {
136
+ function i() {
137
+ }
138
+ return i.prototype.hasFeature = function(c, D) {
139
+ return !0;
140
+ }, i.prototype.createDocumentType = function(c, D, h) {
141
+ throw new Error("This DOM method is not implemented.");
142
+ }, i.prototype.createDocument = function(c, D, h) {
143
+ throw new Error("This DOM method is not implemented.");
144
+ }, i.prototype.createHTMLDocument = function(c) {
145
+ throw new Error("This DOM method is not implemented.");
146
+ }, i.prototype.getFeature = function(c, D) {
147
+ throw new Error("This DOM method is not implemented.");
148
+ }, i;
149
+ }();
150
+ }).call(M)), ct.exports;
151
+ }
152
+ var lt = { exports: {} }, ft = { exports: {} }, ht = { exports: {} }, he;
153
+ function ar() {
154
+ return he || (he = 1, (function() {
155
+ ht.exports = function() {
156
+ function i() {
157
+ }
158
+ return i.prototype.handleError = function(c) {
159
+ throw new Error(c);
160
+ }, i;
161
+ }();
162
+ }).call(M)), ht.exports;
163
+ }
164
+ var pt = { exports: {} }, pe;
165
+ function cr() {
166
+ return pe || (pe = 1, (function() {
167
+ pt.exports = function() {
168
+ function i(c) {
169
+ this.arr = c || [];
170
+ }
171
+ return Object.defineProperty(i.prototype, "length", {
172
+ get: function() {
173
+ return this.arr.length;
174
+ }
175
+ }), i.prototype.item = function(c) {
176
+ return this.arr[c] || null;
177
+ }, i.prototype.contains = function(c) {
178
+ return this.arr.indexOf(c) !== -1;
179
+ }, i;
180
+ }();
181
+ }).call(M)), pt.exports;
182
+ }
183
+ var de;
184
+ function lr() {
185
+ return de || (de = 1, (function() {
186
+ var i, c;
187
+ i = ar(), c = cr(), ft.exports = function() {
188
+ function D() {
189
+ this.defaultParams = {
190
+ "canonical-form": !1,
191
+ "cdata-sections": !1,
192
+ comments: !1,
193
+ "datatype-normalization": !1,
194
+ "element-content-whitespace": !0,
195
+ entities: !0,
196
+ "error-handler": new i(),
197
+ infoset: !0,
198
+ "validate-if-schema": !1,
199
+ namespaces: !0,
200
+ "namespace-declarations": !0,
201
+ "normalize-characters": !1,
202
+ "schema-location": "",
203
+ "schema-type": "",
204
+ "split-cdata-sections": !0,
205
+ validate: !1,
206
+ "well-formed": !0
207
+ }, this.params = Object.create(this.defaultParams);
208
+ }
209
+ return Object.defineProperty(D.prototype, "parameterNames", {
210
+ get: function() {
211
+ return new c(Object.keys(this.defaultParams));
212
+ }
213
+ }), D.prototype.getParameter = function(h) {
214
+ return this.params.hasOwnProperty(h) ? this.params[h] : null;
215
+ }, D.prototype.canSetParameter = function(h, p) {
216
+ return !0;
217
+ }, D.prototype.setParameter = function(h, p) {
218
+ return p != null ? this.params[h] = p : delete this.params[h];
219
+ }, D;
220
+ }();
221
+ }).call(M)), ft.exports;
222
+ }
223
+ var dt = { exports: {} }, yt = { exports: {} }, mt = { exports: {} }, ye;
224
+ function q() {
225
+ return ye || (ye = 1, (function() {
226
+ mt.exports = {
227
+ Element: 1,
228
+ Attribute: 2,
229
+ Text: 3,
230
+ CData: 4,
231
+ EntityReference: 5,
232
+ EntityDeclaration: 6,
233
+ ProcessingInstruction: 7,
234
+ Comment: 8,
235
+ Document: 9,
236
+ DocType: 10,
237
+ DocumentFragment: 11,
238
+ NotationDeclaration: 12,
239
+ Declaration: 201,
240
+ Raw: 202,
241
+ AttributeDeclaration: 203,
242
+ ElementDeclaration: 204,
243
+ Dummy: 205
244
+ };
245
+ }).call(M)), mt.exports;
246
+ }
247
+ var gt = { exports: {} }, me;
248
+ function He() {
249
+ return me || (me = 1, (function() {
250
+ var i;
251
+ i = q(), Y(), gt.exports = function() {
252
+ function c(D, h, p) {
253
+ if (this.parent = D, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), h == null)
254
+ throw new Error("Missing attribute name. " + this.debugInfo(h));
255
+ this.name = this.stringify.name(h), this.value = this.stringify.attValue(p), this.type = i.Attribute, this.isId = !1, this.schemaTypeInfo = null;
256
+ }
257
+ return Object.defineProperty(c.prototype, "nodeType", {
258
+ get: function() {
259
+ return this.type;
260
+ }
261
+ }), Object.defineProperty(c.prototype, "ownerElement", {
262
+ get: function() {
263
+ return this.parent;
264
+ }
265
+ }), Object.defineProperty(c.prototype, "textContent", {
266
+ get: function() {
267
+ return this.value;
268
+ },
269
+ set: function(D) {
270
+ return this.value = D || "";
271
+ }
272
+ }), Object.defineProperty(c.prototype, "namespaceURI", {
273
+ get: function() {
274
+ return "";
275
+ }
276
+ }), Object.defineProperty(c.prototype, "prefix", {
277
+ get: function() {
278
+ return "";
279
+ }
280
+ }), Object.defineProperty(c.prototype, "localName", {
281
+ get: function() {
282
+ return this.name;
283
+ }
284
+ }), Object.defineProperty(c.prototype, "specified", {
285
+ get: function() {
286
+ return !0;
287
+ }
288
+ }), c.prototype.clone = function() {
289
+ return Object.create(this);
290
+ }, c.prototype.toString = function(D) {
291
+ return this.options.writer.attribute(this, this.options.writer.filterOptions(D));
292
+ }, c.prototype.debugInfo = function(D) {
293
+ return D = D || this.name, D == null ? "parent: <" + this.parent.name + ">" : "attribute: {" + D + "}, parent: <" + this.parent.name + ">";
294
+ }, c.prototype.isEqualNode = function(D) {
295
+ return !(D.namespaceURI !== this.namespaceURI || D.prefix !== this.prefix || D.localName !== this.localName || D.value !== this.value);
296
+ }, c;
297
+ }();
298
+ }).call(M)), gt.exports;
299
+ }
300
+ var wt = { exports: {} }, ge;
301
+ function Gt() {
302
+ return ge || (ge = 1, (function() {
303
+ wt.exports = function() {
304
+ function i(c) {
305
+ this.nodes = c;
306
+ }
307
+ return Object.defineProperty(i.prototype, "length", {
308
+ get: function() {
309
+ return Object.keys(this.nodes).length || 0;
310
+ }
311
+ }), i.prototype.clone = function() {
312
+ return this.nodes = null;
313
+ }, i.prototype.getNamedItem = function(c) {
314
+ return this.nodes[c];
315
+ }, i.prototype.setNamedItem = function(c) {
316
+ var D;
317
+ return D = this.nodes[c.nodeName], this.nodes[c.nodeName] = c, D || null;
318
+ }, i.prototype.removeNamedItem = function(c) {
319
+ var D;
320
+ return D = this.nodes[c], delete this.nodes[c], D || null;
321
+ }, i.prototype.item = function(c) {
322
+ return this.nodes[Object.keys(this.nodes)[c]] || null;
323
+ }, i.prototype.getNamedItemNS = function(c, D) {
324
+ throw new Error("This DOM method is not implemented.");
325
+ }, i.prototype.setNamedItemNS = function(c) {
326
+ throw new Error("This DOM method is not implemented.");
327
+ }, i.prototype.removeNamedItemNS = function(c, D) {
328
+ throw new Error("This DOM method is not implemented.");
329
+ }, i;
330
+ }();
331
+ }).call(M)), wt.exports;
332
+ }
333
+ var we;
334
+ function Yt() {
335
+ return we || (we = 1, (function() {
336
+ var i, c, D, h, p, t, e, o, l = function(m, y) {
337
+ for (var d in y)
338
+ O.call(y, d) && (m[d] = y[d]);
339
+ function g() {
340
+ this.constructor = m;
341
+ }
342
+ return g.prototype = y.prototype, m.prototype = new g(), m.__super__ = y.prototype, m;
343
+ }, O = {}.hasOwnProperty;
344
+ o = H(), e = o.isObject, t = o.isFunction, p = o.getValue, h = Y(), i = q(), c = He(), D = Gt(), yt.exports = function(m) {
345
+ l(y, m);
346
+ function y(d, g, b) {
347
+ var L, A, x, E;
348
+ if (y.__super__.constructor.call(this, d), g == null)
349
+ throw new Error("Missing element name. " + this.debugInfo());
350
+ if (this.name = this.stringify.name(g), this.type = i.Element, this.attribs = {}, this.schemaTypeInfo = null, b != null && this.attribute(b), d.type === i.Document && (this.isRoot = !0, this.documentObject = d, d.rootObject = this, d.children)) {
351
+ for (E = d.children, A = 0, x = E.length; A < x; A++)
352
+ if (L = E[A], L.type === i.DocType) {
353
+ L.name = this.name;
354
+ break;
355
+ }
356
+ }
357
+ }
358
+ return Object.defineProperty(y.prototype, "tagName", {
359
+ get: function() {
360
+ return this.name;
361
+ }
362
+ }), Object.defineProperty(y.prototype, "namespaceURI", {
363
+ get: function() {
364
+ return "";
365
+ }
366
+ }), Object.defineProperty(y.prototype, "prefix", {
367
+ get: function() {
368
+ return "";
369
+ }
370
+ }), Object.defineProperty(y.prototype, "localName", {
371
+ get: function() {
372
+ return this.name;
373
+ }
374
+ }), Object.defineProperty(y.prototype, "id", {
375
+ get: function() {
376
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
377
+ }
378
+ }), Object.defineProperty(y.prototype, "className", {
379
+ get: function() {
380
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
381
+ }
382
+ }), Object.defineProperty(y.prototype, "classList", {
383
+ get: function() {
384
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
385
+ }
386
+ }), Object.defineProperty(y.prototype, "attributes", {
387
+ get: function() {
388
+ return (!this.attributeMap || !this.attributeMap.nodes) && (this.attributeMap = new D(this.attribs)), this.attributeMap;
389
+ }
390
+ }), y.prototype.clone = function() {
391
+ var d, g, b, L;
392
+ b = Object.create(this), b.isRoot && (b.documentObject = null), b.attribs = {}, L = this.attribs;
393
+ for (g in L)
394
+ O.call(L, g) && (d = L[g], b.attribs[g] = d.clone());
395
+ return b.children = [], this.children.forEach(function(A) {
396
+ var x;
397
+ return x = A.clone(), x.parent = b, b.children.push(x);
398
+ }), b;
399
+ }, y.prototype.attribute = function(d, g) {
400
+ var b, L;
401
+ if (d != null && (d = p(d)), e(d))
402
+ for (b in d)
403
+ O.call(d, b) && (L = d[b], this.attribute(b, L));
404
+ else
405
+ t(g) && (g = g.apply()), this.options.keepNullAttributes && g == null ? this.attribs[d] = new c(this, d, "") : g != null && (this.attribs[d] = new c(this, d, g));
406
+ return this;
407
+ }, y.prototype.removeAttribute = function(d) {
408
+ var g, b, L;
409
+ if (d == null)
410
+ throw new Error("Missing attribute name. " + this.debugInfo());
411
+ if (d = p(d), Array.isArray(d))
412
+ for (b = 0, L = d.length; b < L; b++)
413
+ g = d[b], delete this.attribs[g];
414
+ else
415
+ delete this.attribs[d];
416
+ return this;
417
+ }, y.prototype.toString = function(d) {
418
+ return this.options.writer.element(this, this.options.writer.filterOptions(d));
419
+ }, y.prototype.att = function(d, g) {
420
+ return this.attribute(d, g);
421
+ }, y.prototype.a = function(d, g) {
422
+ return this.attribute(d, g);
423
+ }, y.prototype.getAttribute = function(d) {
424
+ return this.attribs.hasOwnProperty(d) ? this.attribs[d].value : null;
425
+ }, y.prototype.setAttribute = function(d, g) {
426
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
427
+ }, y.prototype.getAttributeNode = function(d) {
428
+ return this.attribs.hasOwnProperty(d) ? this.attribs[d] : null;
429
+ }, y.prototype.setAttributeNode = function(d) {
430
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
431
+ }, y.prototype.removeAttributeNode = function(d) {
432
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
433
+ }, y.prototype.getElementsByTagName = function(d) {
434
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
435
+ }, y.prototype.getAttributeNS = function(d, g) {
436
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
437
+ }, y.prototype.setAttributeNS = function(d, g, b) {
438
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
439
+ }, y.prototype.removeAttributeNS = function(d, g) {
440
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
441
+ }, y.prototype.getAttributeNodeNS = function(d, g) {
442
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
443
+ }, y.prototype.setAttributeNodeNS = function(d) {
444
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
445
+ }, y.prototype.getElementsByTagNameNS = function(d, g) {
446
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
447
+ }, y.prototype.hasAttribute = function(d) {
448
+ return this.attribs.hasOwnProperty(d);
449
+ }, y.prototype.hasAttributeNS = function(d, g) {
450
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
451
+ }, y.prototype.setIdAttribute = function(d, g) {
452
+ return this.attribs.hasOwnProperty(d) ? this.attribs[d].isId : g;
453
+ }, y.prototype.setIdAttributeNS = function(d, g, b) {
454
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
455
+ }, y.prototype.setIdAttributeNode = function(d, g) {
456
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
457
+ }, y.prototype.getElementsByTagName = function(d) {
458
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
459
+ }, y.prototype.getElementsByTagNameNS = function(d, g) {
460
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
461
+ }, y.prototype.getElementsByClassName = function(d) {
462
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
463
+ }, y.prototype.isEqualNode = function(d) {
464
+ var g, b, L;
465
+ 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)
466
+ return !1;
467
+ for (g = b = 0, L = this.attribs.length - 1; 0 <= L ? b <= L : b >= L; g = 0 <= L ? ++b : --b)
468
+ if (!this.attribs[g].isEqualNode(d.attribs[g]))
469
+ return !1;
470
+ return !0;
471
+ }, y;
472
+ }(h);
473
+ }).call(M)), yt.exports;
474
+ }
475
+ var Tt = { exports: {} }, Dt = { exports: {} }, Te;
476
+ function et() {
477
+ return Te || (Te = 1, (function() {
478
+ var i, c = function(h, p) {
479
+ for (var t in p)
480
+ D.call(p, t) && (h[t] = p[t]);
481
+ function e() {
482
+ this.constructor = h;
483
+ }
484
+ return e.prototype = p.prototype, h.prototype = new e(), h.__super__ = p.prototype, h;
485
+ }, D = {}.hasOwnProperty;
486
+ i = Y(), Dt.exports = function(h) {
487
+ c(p, h);
488
+ function p(t) {
489
+ p.__super__.constructor.call(this, t), this.value = "";
490
+ }
491
+ return Object.defineProperty(p.prototype, "data", {
492
+ get: function() {
493
+ return this.value;
494
+ },
495
+ set: function(t) {
496
+ return this.value = t || "";
497
+ }
498
+ }), Object.defineProperty(p.prototype, "length", {
499
+ get: function() {
500
+ return this.value.length;
501
+ }
502
+ }), Object.defineProperty(p.prototype, "textContent", {
503
+ get: function() {
504
+ return this.value;
505
+ },
506
+ set: function(t) {
507
+ return this.value = t || "";
508
+ }
509
+ }), p.prototype.clone = function() {
510
+ return Object.create(this);
511
+ }, p.prototype.substringData = function(t, e) {
512
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
513
+ }, p.prototype.appendData = function(t) {
514
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
515
+ }, p.prototype.insertData = function(t, e) {
516
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
517
+ }, p.prototype.deleteData = function(t, e) {
518
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
519
+ }, p.prototype.replaceData = function(t, e, o) {
520
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
521
+ }, p.prototype.isEqualNode = function(t) {
522
+ return !(!p.__super__.isEqualNode.apply(this, arguments).isEqualNode(t) || t.data !== this.data);
523
+ }, p;
524
+ }(i);
525
+ }).call(M)), Dt.exports;
526
+ }
527
+ var De;
528
+ function $t() {
529
+ return De || (De = 1, (function() {
530
+ var i, c, D = function(p, t) {
531
+ for (var e in t)
532
+ h.call(t, e) && (p[e] = t[e]);
533
+ function o() {
534
+ this.constructor = p;
535
+ }
536
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
537
+ }, h = {}.hasOwnProperty;
538
+ i = q(), c = et(), Tt.exports = function(p) {
539
+ D(t, p);
540
+ function t(e, o) {
541
+ if (t.__super__.constructor.call(this, e), o == null)
542
+ throw new Error("Missing CDATA text. " + this.debugInfo());
543
+ this.name = "#cdata-section", this.type = i.CData, this.value = this.stringify.cdata(o);
544
+ }
545
+ return t.prototype.clone = function() {
546
+ return Object.create(this);
547
+ }, t.prototype.toString = function(e) {
548
+ return this.options.writer.cdata(this, this.options.writer.filterOptions(e));
549
+ }, t;
550
+ }(c);
551
+ }).call(M)), Tt.exports;
552
+ }
553
+ var Et = { exports: {} }, Ee;
554
+ function Kt() {
555
+ return Ee || (Ee = 1, (function() {
556
+ var i, c, D = function(p, t) {
557
+ for (var e in t)
558
+ h.call(t, e) && (p[e] = t[e]);
559
+ function o() {
560
+ this.constructor = p;
561
+ }
562
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
563
+ }, h = {}.hasOwnProperty;
564
+ i = q(), c = et(), Et.exports = function(p) {
565
+ D(t, p);
566
+ function t(e, o) {
567
+ if (t.__super__.constructor.call(this, e), o == null)
568
+ throw new Error("Missing comment text. " + this.debugInfo());
569
+ this.name = "#comment", this.type = i.Comment, this.value = this.stringify.comment(o);
570
+ }
571
+ return t.prototype.clone = function() {
572
+ return Object.create(this);
573
+ }, t.prototype.toString = function(e) {
574
+ return this.options.writer.comment(this, this.options.writer.filterOptions(e));
575
+ }, t;
576
+ }(c);
577
+ }).call(M)), Et.exports;
578
+ }
579
+ var bt = { exports: {} }, be;
580
+ function zt() {
581
+ return be || (be = 1, (function() {
582
+ var i, c, D, h = function(t, e) {
583
+ for (var o in e)
584
+ p.call(e, o) && (t[o] = e[o]);
585
+ function l() {
586
+ this.constructor = t;
587
+ }
588
+ return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
589
+ }, p = {}.hasOwnProperty;
590
+ D = H().isObject, c = Y(), i = q(), bt.exports = function(t) {
591
+ h(e, t);
592
+ function e(o, l, O, m) {
593
+ var y;
594
+ e.__super__.constructor.call(this, o), D(l) && (y = l, l = y.version, O = y.encoding, m = y.standalone), l || (l = "1.0"), this.type = i.Declaration, this.version = this.stringify.xmlVersion(l), O != null && (this.encoding = this.stringify.xmlEncoding(O)), m != null && (this.standalone = this.stringify.xmlStandalone(m));
595
+ }
596
+ return e.prototype.toString = function(o) {
597
+ return this.options.writer.declaration(this, this.options.writer.filterOptions(o));
598
+ }, e;
599
+ }(c);
600
+ }).call(M)), bt.exports;
601
+ }
602
+ var Ot = { exports: {} }, Nt = { exports: {} }, Oe;
603
+ function Ht() {
604
+ return Oe || (Oe = 1, (function() {
605
+ var i, c, D = function(p, t) {
606
+ for (var e in t)
607
+ h.call(t, e) && (p[e] = t[e]);
608
+ function o() {
609
+ this.constructor = p;
610
+ }
611
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
612
+ }, h = {}.hasOwnProperty;
613
+ c = Y(), i = q(), Nt.exports = function(p) {
614
+ D(t, p);
615
+ function t(e, o, l, O, m, y) {
616
+ if (t.__super__.constructor.call(this, e), o == null)
617
+ throw new Error("Missing DTD element name. " + this.debugInfo());
618
+ if (l == null)
619
+ throw new Error("Missing DTD attribute name. " + this.debugInfo(o));
620
+ if (!O)
621
+ throw new Error("Missing DTD attribute type. " + this.debugInfo(o));
622
+ if (!m)
623
+ throw new Error("Missing DTD attribute default. " + this.debugInfo(o));
624
+ if (m.indexOf("#") !== 0 && (m = "#" + m), !m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))
625
+ throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(o));
626
+ if (y && !m.match(/^(#FIXED|#DEFAULT)$/))
627
+ throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(o));
628
+ this.elementName = this.stringify.name(o), this.type = i.AttributeDeclaration, this.attributeName = this.stringify.name(l), this.attributeType = this.stringify.dtdAttType(O), y && (this.defaultValue = this.stringify.dtdAttDefault(y)), this.defaultValueType = m;
629
+ }
630
+ return t.prototype.toString = function(e) {
631
+ return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(e));
632
+ }, t;
633
+ }(c);
634
+ }).call(M)), Nt.exports;
635
+ }
636
+ var vt = { exports: {} }, Ne;
637
+ function Qt() {
638
+ return Ne || (Ne = 1, (function() {
639
+ var i, c, D, h = function(t, e) {
640
+ for (var o in e)
641
+ p.call(e, o) && (t[o] = e[o]);
642
+ function l() {
643
+ this.constructor = t;
644
+ }
645
+ return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
646
+ }, p = {}.hasOwnProperty;
647
+ D = H().isObject, c = Y(), i = q(), vt.exports = function(t) {
648
+ h(e, t);
649
+ function e(o, l, O, m) {
650
+ if (e.__super__.constructor.call(this, o), O == null)
651
+ throw new Error("Missing DTD entity name. " + this.debugInfo(O));
652
+ if (m == null)
653
+ throw new Error("Missing DTD entity value. " + this.debugInfo(O));
654
+ if (this.pe = !!l, this.name = this.stringify.name(O), this.type = i.EntityDeclaration, !D(m))
655
+ this.value = this.stringify.dtdEntityValue(m), this.internal = !0;
656
+ else {
657
+ if (!m.pubID && !m.sysID)
658
+ throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(O));
659
+ if (m.pubID && !m.sysID)
660
+ throw new Error("System identifier is required for a public external entity. " + this.debugInfo(O));
661
+ 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)
662
+ throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(O));
663
+ }
664
+ }
665
+ return Object.defineProperty(e.prototype, "publicId", {
666
+ get: function() {
667
+ return this.pubID;
668
+ }
669
+ }), Object.defineProperty(e.prototype, "systemId", {
670
+ get: function() {
671
+ return this.sysID;
672
+ }
673
+ }), Object.defineProperty(e.prototype, "notationName", {
674
+ get: function() {
675
+ return this.nData || null;
676
+ }
677
+ }), Object.defineProperty(e.prototype, "inputEncoding", {
678
+ get: function() {
679
+ return null;
680
+ }
681
+ }), Object.defineProperty(e.prototype, "xmlEncoding", {
682
+ get: function() {
683
+ return null;
684
+ }
685
+ }), Object.defineProperty(e.prototype, "xmlVersion", {
686
+ get: function() {
687
+ return null;
688
+ }
689
+ }), e.prototype.toString = function(o) {
690
+ return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(o));
691
+ }, e;
692
+ }(c);
693
+ }).call(M)), vt.exports;
694
+ }
695
+ var It = { exports: {} }, ve;
696
+ function Zt() {
697
+ return ve || (ve = 1, (function() {
698
+ var i, c, D = function(p, t) {
699
+ for (var e in t)
700
+ h.call(t, e) && (p[e] = t[e]);
701
+ function o() {
702
+ this.constructor = p;
703
+ }
704
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
705
+ }, h = {}.hasOwnProperty;
706
+ c = Y(), i = q(), It.exports = function(p) {
707
+ D(t, p);
708
+ function t(e, o, l) {
709
+ if (t.__super__.constructor.call(this, e), o == null)
710
+ throw new Error("Missing DTD element name. " + this.debugInfo());
711
+ l || (l = "(#PCDATA)"), Array.isArray(l) && (l = "(" + l.join(",") + ")"), this.name = this.stringify.name(o), this.type = i.ElementDeclaration, this.value = this.stringify.dtdElementValue(l);
712
+ }
713
+ return t.prototype.toString = function(e) {
714
+ return this.options.writer.dtdElement(this, this.options.writer.filterOptions(e));
715
+ }, t;
716
+ }(c);
717
+ }).call(M)), It.exports;
718
+ }
719
+ var Lt = { exports: {} }, Ie;
720
+ function Jt() {
721
+ return Ie || (Ie = 1, (function() {
722
+ var i, c, D = function(p, t) {
723
+ for (var e in t)
724
+ h.call(t, e) && (p[e] = t[e]);
725
+ function o() {
726
+ this.constructor = p;
727
+ }
728
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
729
+ }, h = {}.hasOwnProperty;
730
+ c = Y(), i = q(), Lt.exports = function(p) {
731
+ D(t, p);
732
+ function t(e, o, l) {
733
+ if (t.__super__.constructor.call(this, e), o == null)
734
+ throw new Error("Missing DTD notation name. " + this.debugInfo(o));
735
+ if (!l.pubID && !l.sysID)
736
+ throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(o));
737
+ this.name = this.stringify.name(o), this.type = i.NotationDeclaration, l.pubID != null && (this.pubID = this.stringify.dtdPubID(l.pubID)), l.sysID != null && (this.sysID = this.stringify.dtdSysID(l.sysID));
738
+ }
739
+ return Object.defineProperty(t.prototype, "publicId", {
740
+ get: function() {
741
+ return this.pubID;
742
+ }
743
+ }), Object.defineProperty(t.prototype, "systemId", {
744
+ get: function() {
745
+ return this.sysID;
746
+ }
747
+ }), t.prototype.toString = function(e) {
748
+ return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(e));
749
+ }, t;
750
+ }(c);
751
+ }).call(M)), Lt.exports;
752
+ }
753
+ var Le;
754
+ function te() {
755
+ return Le || (Le = 1, (function() {
756
+ var i, c, D, h, p, t, e, o, l = function(m, y) {
757
+ for (var d in y)
758
+ O.call(y, d) && (m[d] = y[d]);
759
+ function g() {
760
+ this.constructor = m;
761
+ }
762
+ return g.prototype = y.prototype, m.prototype = new g(), m.__super__ = y.prototype, m;
763
+ }, O = {}.hasOwnProperty;
764
+ o = H().isObject, e = Y(), i = q(), c = Ht(), h = Qt(), D = Zt(), p = Jt(), t = Gt(), Ot.exports = function(m) {
765
+ l(y, m);
766
+ function y(d, g, b) {
767
+ var L, A, x, E, s, a;
768
+ if (y.__super__.constructor.call(this, d), this.type = i.DocType, d.children) {
769
+ for (E = d.children, A = 0, x = E.length; A < x; A++)
770
+ if (L = E[A], L.type === i.Element) {
771
+ this.name = L.name;
772
+ break;
773
+ }
774
+ }
775
+ this.documentObject = d, o(g) && (s = g, g = s.pubID, b = s.sysID), b == null && (a = [g, b], b = a[0], g = a[1]), g != null && (this.pubID = this.stringify.dtdPubID(g)), b != null && (this.sysID = this.stringify.dtdSysID(b));
776
+ }
777
+ return Object.defineProperty(y.prototype, "entities", {
778
+ get: function() {
779
+ var d, g, b, L, A;
780
+ for (L = {}, A = this.children, g = 0, b = A.length; g < b; g++)
781
+ d = A[g], d.type === i.EntityDeclaration && !d.pe && (L[d.name] = d);
782
+ return new t(L);
783
+ }
784
+ }), Object.defineProperty(y.prototype, "notations", {
785
+ get: function() {
786
+ var d, g, b, L, A;
787
+ for (L = {}, A = this.children, g = 0, b = A.length; g < b; g++)
788
+ d = A[g], d.type === i.NotationDeclaration && (L[d.name] = d);
789
+ return new t(L);
790
+ }
791
+ }), Object.defineProperty(y.prototype, "publicId", {
792
+ get: function() {
793
+ return this.pubID;
794
+ }
795
+ }), Object.defineProperty(y.prototype, "systemId", {
796
+ get: function() {
797
+ return this.sysID;
798
+ }
799
+ }), Object.defineProperty(y.prototype, "internalSubset", {
800
+ get: function() {
801
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
802
+ }
803
+ }), y.prototype.element = function(d, g) {
804
+ var b;
805
+ return b = new D(this, d, g), this.children.push(b), this;
806
+ }, y.prototype.attList = function(d, g, b, L, A) {
807
+ var x;
808
+ return x = new c(this, d, g, b, L, A), this.children.push(x), this;
809
+ }, y.prototype.entity = function(d, g) {
810
+ var b;
811
+ return b = new h(this, !1, d, g), this.children.push(b), this;
812
+ }, y.prototype.pEntity = function(d, g) {
813
+ var b;
814
+ return b = new h(this, !0, d, g), this.children.push(b), this;
815
+ }, y.prototype.notation = function(d, g) {
816
+ var b;
817
+ return b = new p(this, d, g), this.children.push(b), this;
818
+ }, y.prototype.toString = function(d) {
819
+ return this.options.writer.docType(this, this.options.writer.filterOptions(d));
820
+ }, y.prototype.ele = function(d, g) {
821
+ return this.element(d, g);
822
+ }, y.prototype.att = function(d, g, b, L, A) {
823
+ return this.attList(d, g, b, L, A);
824
+ }, y.prototype.ent = function(d, g) {
825
+ return this.entity(d, g);
826
+ }, y.prototype.pent = function(d, g) {
827
+ return this.pEntity(d, g);
828
+ }, y.prototype.not = function(d, g) {
829
+ return this.notation(d, g);
830
+ }, y.prototype.up = function() {
831
+ return this.root() || this.documentObject;
832
+ }, y.prototype.isEqualNode = function(d) {
833
+ return !(!y.__super__.isEqualNode.apply(this, arguments).isEqualNode(d) || d.name !== this.name || d.publicId !== this.publicId || d.systemId !== this.systemId);
834
+ }, y;
835
+ }(e);
836
+ }).call(M)), Ot.exports;
837
+ }
838
+ var At = { exports: {} }, Ae;
839
+ function ee() {
840
+ return Ae || (Ae = 1, (function() {
841
+ var i, c, D = function(p, t) {
842
+ for (var e in t)
843
+ h.call(t, e) && (p[e] = t[e]);
844
+ function o() {
845
+ this.constructor = p;
846
+ }
847
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
848
+ }, h = {}.hasOwnProperty;
849
+ i = q(), c = Y(), At.exports = function(p) {
850
+ D(t, p);
851
+ function t(e, o) {
852
+ if (t.__super__.constructor.call(this, e), o == null)
853
+ throw new Error("Missing raw text. " + this.debugInfo());
854
+ this.type = i.Raw, this.value = this.stringify.raw(o);
855
+ }
856
+ return t.prototype.clone = function() {
857
+ return Object.create(this);
858
+ }, t.prototype.toString = function(e) {
859
+ return this.options.writer.raw(this, this.options.writer.filterOptions(e));
860
+ }, t;
861
+ }(c);
862
+ }).call(M)), At.exports;
863
+ }
864
+ var Pt = { exports: {} }, Pe;
865
+ function re() {
866
+ return Pe || (Pe = 1, (function() {
867
+ var i, c, D = function(p, t) {
868
+ for (var e in t)
869
+ h.call(t, e) && (p[e] = t[e]);
870
+ function o() {
871
+ this.constructor = p;
872
+ }
873
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
874
+ }, h = {}.hasOwnProperty;
875
+ i = q(), c = et(), Pt.exports = function(p) {
876
+ D(t, p);
877
+ function t(e, o) {
878
+ if (t.__super__.constructor.call(this, e), o == null)
879
+ throw new Error("Missing element text. " + this.debugInfo());
880
+ this.name = "#text", this.type = i.Text, this.value = this.stringify.text(o);
881
+ }
882
+ return Object.defineProperty(t.prototype, "isElementContentWhitespace", {
883
+ get: function() {
884
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
885
+ }
886
+ }), Object.defineProperty(t.prototype, "wholeText", {
887
+ get: function() {
888
+ var e, o, l;
889
+ for (l = "", o = this.previousSibling; o; )
890
+ l = o.data + l, o = o.previousSibling;
891
+ for (l += this.data, e = this.nextSibling; e; )
892
+ l = l + e.data, e = e.nextSibling;
893
+ return l;
894
+ }
895
+ }), t.prototype.clone = function() {
896
+ return Object.create(this);
897
+ }, t.prototype.toString = function(e) {
898
+ return this.options.writer.text(this, this.options.writer.filterOptions(e));
899
+ }, t.prototype.splitText = function(e) {
900
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
901
+ }, t.prototype.replaceWholeText = function(e) {
902
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
903
+ }, t;
904
+ }(c);
905
+ }).call(M)), Pt.exports;
906
+ }
907
+ var _t = { exports: {} }, _e;
908
+ function ne() {
909
+ return _e || (_e = 1, (function() {
910
+ var i, c, D = function(p, t) {
911
+ for (var e in t)
912
+ h.call(t, e) && (p[e] = t[e]);
913
+ function o() {
914
+ this.constructor = p;
915
+ }
916
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
917
+ }, h = {}.hasOwnProperty;
918
+ i = q(), c = et(), _t.exports = function(p) {
919
+ D(t, p);
920
+ function t(e, o, l) {
921
+ if (t.__super__.constructor.call(this, e), o == null)
922
+ throw new Error("Missing instruction target. " + this.debugInfo());
923
+ this.type = i.ProcessingInstruction, this.target = this.stringify.insTarget(o), this.name = this.target, l && (this.value = this.stringify.insValue(l));
924
+ }
925
+ return t.prototype.clone = function() {
926
+ return Object.create(this);
927
+ }, t.prototype.toString = function(e) {
928
+ return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(e));
929
+ }, t.prototype.isEqualNode = function(e) {
930
+ return !(!t.__super__.isEqualNode.apply(this, arguments).isEqualNode(e) || e.target !== this.target);
931
+ }, t;
932
+ }(c);
933
+ }).call(M)), _t.exports;
934
+ }
935
+ var xt = { exports: {} }, xe;
936
+ function Qe() {
937
+ return xe || (xe = 1, (function() {
938
+ var i, c, D = function(p, t) {
939
+ for (var e in t)
940
+ h.call(t, e) && (p[e] = t[e]);
941
+ function o() {
942
+ this.constructor = p;
943
+ }
944
+ return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
945
+ }, h = {}.hasOwnProperty;
946
+ c = Y(), i = q(), xt.exports = function(p) {
947
+ D(t, p);
948
+ function t(e) {
949
+ t.__super__.constructor.call(this, e), this.type = i.Dummy;
950
+ }
951
+ return t.prototype.clone = function() {
952
+ return Object.create(this);
953
+ }, t.prototype.toString = function(e) {
954
+ return "";
955
+ }, t;
956
+ }(c);
957
+ }).call(M)), xt.exports;
958
+ }
959
+ var Ct = { exports: {} }, Ce;
960
+ function fr() {
961
+ return Ce || (Ce = 1, (function() {
962
+ Ct.exports = function() {
963
+ function i(c) {
964
+ this.nodes = c;
965
+ }
966
+ return Object.defineProperty(i.prototype, "length", {
967
+ get: function() {
968
+ return this.nodes.length || 0;
969
+ }
970
+ }), i.prototype.clone = function() {
971
+ return this.nodes = null;
972
+ }, i.prototype.item = function(c) {
973
+ return this.nodes[c] || null;
974
+ }, i;
975
+ }();
976
+ }).call(M)), Ct.exports;
977
+ }
978
+ var Mt = { exports: {} }, Me;
979
+ function hr() {
980
+ return Me || (Me = 1, (function() {
981
+ Mt.exports = {
982
+ Disconnected: 1,
983
+ Preceding: 2,
984
+ Following: 4,
985
+ Contains: 8,
986
+ ContainedBy: 16,
987
+ ImplementationSpecific: 32
988
+ };
989
+ }).call(M)), Mt.exports;
990
+ }
991
+ var Se;
992
+ function Y() {
993
+ return Se || (Se = 1, (function() {
994
+ var i, c, D, h, p, t, e, o, l, O, m, y, d, g, b, L, A, x = {}.hasOwnProperty;
995
+ A = H(), L = A.isObject, b = A.isFunction, g = A.isEmpty, d = A.getValue, o = null, D = null, h = null, p = null, t = null, m = null, y = null, O = null, e = null, c = null, l = null, i = null, dt.exports = function() {
996
+ function E(s) {
997
+ 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 = Yt(), D = $t(), h = Kt(), p = zt(), t = te(), m = ee(), y = re(), O = ne(), e = Qe(), c = q(), l = fr(), Gt(), i = hr());
998
+ }
999
+ return Object.defineProperty(E.prototype, "nodeName", {
1000
+ get: function() {
1001
+ return this.name;
1002
+ }
1003
+ }), Object.defineProperty(E.prototype, "nodeType", {
1004
+ get: function() {
1005
+ return this.type;
1006
+ }
1007
+ }), Object.defineProperty(E.prototype, "nodeValue", {
1008
+ get: function() {
1009
+ return this.value;
1010
+ }
1011
+ }), Object.defineProperty(E.prototype, "parentNode", {
1012
+ get: function() {
1013
+ return this.parent;
1014
+ }
1015
+ }), Object.defineProperty(E.prototype, "childNodes", {
1016
+ get: function() {
1017
+ return (!this.childNodeList || !this.childNodeList.nodes) && (this.childNodeList = new l(this.children)), this.childNodeList;
1018
+ }
1019
+ }), Object.defineProperty(E.prototype, "firstChild", {
1020
+ get: function() {
1021
+ return this.children[0] || null;
1022
+ }
1023
+ }), Object.defineProperty(E.prototype, "lastChild", {
1024
+ get: function() {
1025
+ return this.children[this.children.length - 1] || null;
1026
+ }
1027
+ }), Object.defineProperty(E.prototype, "previousSibling", {
1028
+ get: function() {
1029
+ var s;
1030
+ return s = this.parent.children.indexOf(this), this.parent.children[s - 1] || null;
1031
+ }
1032
+ }), Object.defineProperty(E.prototype, "nextSibling", {
1033
+ get: function() {
1034
+ var s;
1035
+ return s = this.parent.children.indexOf(this), this.parent.children[s + 1] || null;
1036
+ }
1037
+ }), Object.defineProperty(E.prototype, "ownerDocument", {
1038
+ get: function() {
1039
+ return this.document() || null;
1040
+ }
1041
+ }), Object.defineProperty(E.prototype, "textContent", {
1042
+ get: function() {
1043
+ var s, a, f, T, I;
1044
+ if (this.nodeType === c.Element || this.nodeType === c.DocumentFragment) {
1045
+ for (I = "", T = this.children, a = 0, f = T.length; a < f; a++)
1046
+ s = T[a], s.textContent && (I += s.textContent);
1047
+ return I;
1048
+ } else
1049
+ return null;
1050
+ },
1051
+ set: function(s) {
1052
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1053
+ }
1054
+ }), E.prototype.setParent = function(s) {
1055
+ var a, f, T, I, v;
1056
+ for (this.parent = s, s && (this.options = s.options, this.stringify = s.stringify), I = this.children, v = [], f = 0, T = I.length; f < T; f++)
1057
+ a = I[f], v.push(a.setParent(this));
1058
+ return v;
1059
+ }, E.prototype.element = function(s, a, f) {
1060
+ var T, I, v, r, N, P, C, S, X, B, R;
1061
+ if (P = null, a === null && f == null && (X = [{}, null], a = X[0], f = X[1]), a == null && (a = {}), a = d(a), L(a) || (B = [a, f], f = B[0], a = B[1]), s != null && (s = d(s)), Array.isArray(s))
1062
+ for (v = 0, C = s.length; v < C; v++)
1063
+ I = s[v], P = this.element(I);
1064
+ else if (b(s))
1065
+ P = this.element(s.apply());
1066
+ else if (L(s)) {
1067
+ for (N in s)
1068
+ if (x.call(s, N))
1069
+ if (R = s[N], b(R) && (R = R.apply()), !this.options.ignoreDecorators && this.stringify.convertAttKey && N.indexOf(this.stringify.convertAttKey) === 0)
1070
+ P = this.attribute(N.substr(this.stringify.convertAttKey.length), R);
1071
+ else if (!this.options.separateArrayItems && Array.isArray(R) && g(R))
1072
+ P = this.dummy();
1073
+ else if (L(R) && g(R))
1074
+ P = this.element(N);
1075
+ else if (!this.options.keepNullNodes && R == null)
1076
+ P = this.dummy();
1077
+ else if (!this.options.separateArrayItems && Array.isArray(R))
1078
+ for (r = 0, S = R.length; r < S; r++)
1079
+ I = R[r], T = {}, T[N] = I, P = this.element(T);
1080
+ else L(R) ? !this.options.ignoreDecorators && this.stringify.convertTextKey && N.indexOf(this.stringify.convertTextKey) === 0 ? P = this.element(R) : (P = this.element(N), P.element(R)) : P = this.element(N, R);
1081
+ } else !this.options.keepNullNodes && f === null ? P = this.dummy() : !this.options.ignoreDecorators && this.stringify.convertTextKey && s.indexOf(this.stringify.convertTextKey) === 0 ? P = this.text(f) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && s.indexOf(this.stringify.convertCDataKey) === 0 ? P = this.cdata(f) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && s.indexOf(this.stringify.convertCommentKey) === 0 ? P = this.comment(f) : !this.options.ignoreDecorators && this.stringify.convertRawKey && s.indexOf(this.stringify.convertRawKey) === 0 ? P = this.raw(f) : !this.options.ignoreDecorators && this.stringify.convertPIKey && s.indexOf(this.stringify.convertPIKey) === 0 ? P = this.instruction(s.substr(this.stringify.convertPIKey.length), f) : P = this.node(s, a, f);
1082
+ if (P == null)
1083
+ throw new Error("Could not create any elements with: " + s + ". " + this.debugInfo());
1084
+ return P;
1085
+ }, E.prototype.insertBefore = function(s, a, f) {
1086
+ var T, I, v, r, N;
1087
+ if (s != null && s.type)
1088
+ return v = s, r = a, v.setParent(this), r ? (I = children.indexOf(r), N = children.splice(I), children.push(v), Array.prototype.push.apply(children, N)) : children.push(v), v;
1089
+ if (this.isRoot)
1090
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(s));
1091
+ return I = this.parent.children.indexOf(this), N = this.parent.children.splice(I), T = this.parent.element(s, a, f), Array.prototype.push.apply(this.parent.children, N), T;
1092
+ }, E.prototype.insertAfter = function(s, a, f) {
1093
+ var T, I, v;
1094
+ if (this.isRoot)
1095
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(s));
1096
+ return I = this.parent.children.indexOf(this), v = this.parent.children.splice(I + 1), T = this.parent.element(s, a, f), Array.prototype.push.apply(this.parent.children, v), T;
1097
+ }, E.prototype.remove = function() {
1098
+ var s;
1099
+ if (this.isRoot)
1100
+ throw new Error("Cannot remove the root element. " + this.debugInfo());
1101
+ return s = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [s, s - s + 1].concat([])), this.parent;
1102
+ }, E.prototype.node = function(s, a, f) {
1103
+ var T, I;
1104
+ return s != null && (s = d(s)), a || (a = {}), a = d(a), L(a) || (I = [a, f], f = I[0], a = I[1]), T = new o(this, s, a), f != null && T.text(f), this.children.push(T), T;
1105
+ }, E.prototype.text = function(s) {
1106
+ var a;
1107
+ return L(s) && this.element(s), a = new y(this, s), this.children.push(a), this;
1108
+ }, E.prototype.cdata = function(s) {
1109
+ var a;
1110
+ return a = new D(this, s), this.children.push(a), this;
1111
+ }, E.prototype.comment = function(s) {
1112
+ var a;
1113
+ return a = new h(this, s), this.children.push(a), this;
1114
+ }, E.prototype.commentBefore = function(s) {
1115
+ var a, f;
1116
+ return a = this.parent.children.indexOf(this), f = this.parent.children.splice(a), this.parent.comment(s), Array.prototype.push.apply(this.parent.children, f), this;
1117
+ }, E.prototype.commentAfter = function(s) {
1118
+ var a, f;
1119
+ return a = this.parent.children.indexOf(this), f = this.parent.children.splice(a + 1), this.parent.comment(s), Array.prototype.push.apply(this.parent.children, f), this;
1120
+ }, E.prototype.raw = function(s) {
1121
+ var a;
1122
+ return a = new m(this, s), this.children.push(a), this;
1123
+ }, E.prototype.dummy = function() {
1124
+ var s;
1125
+ return s = new e(this), s;
1126
+ }, E.prototype.instruction = function(s, a) {
1127
+ var f, T, I, v, r;
1128
+ if (s != null && (s = d(s)), a != null && (a = d(a)), Array.isArray(s))
1129
+ for (v = 0, r = s.length; v < r; v++)
1130
+ f = s[v], this.instruction(f);
1131
+ else if (L(s))
1132
+ for (f in s)
1133
+ x.call(s, f) && (T = s[f], this.instruction(f, T));
1134
+ else
1135
+ b(a) && (a = a.apply()), I = new O(this, s, a), this.children.push(I);
1136
+ return this;
1137
+ }, E.prototype.instructionBefore = function(s, a) {
1138
+ var f, T;
1139
+ return f = this.parent.children.indexOf(this), T = this.parent.children.splice(f), this.parent.instruction(s, a), Array.prototype.push.apply(this.parent.children, T), this;
1140
+ }, E.prototype.instructionAfter = function(s, a) {
1141
+ var f, T;
1142
+ return f = this.parent.children.indexOf(this), T = this.parent.children.splice(f + 1), this.parent.instruction(s, a), Array.prototype.push.apply(this.parent.children, T), this;
1143
+ }, E.prototype.declaration = function(s, a, f) {
1144
+ var T, I;
1145
+ return T = this.document(), I = new p(T, s, a, f), T.children.length === 0 ? T.children.unshift(I) : T.children[0].type === c.Declaration ? T.children[0] = I : T.children.unshift(I), T.root() || T;
1146
+ }, E.prototype.dtd = function(s, a) {
1147
+ var f, T, I, v, r, N, P, C, S, X;
1148
+ for (T = this.document(), I = new t(T, s, a), S = T.children, v = r = 0, P = S.length; r < P; v = ++r)
1149
+ if (f = S[v], f.type === c.DocType)
1150
+ return T.children[v] = I, I;
1151
+ for (X = T.children, v = N = 0, C = X.length; N < C; v = ++N)
1152
+ if (f = X[v], f.isRoot)
1153
+ return T.children.splice(v, 0, I), I;
1154
+ return T.children.push(I), I;
1155
+ }, E.prototype.up = function() {
1156
+ if (this.isRoot)
1157
+ throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
1158
+ return this.parent;
1159
+ }, E.prototype.root = function() {
1160
+ var s;
1161
+ for (s = this; s; ) {
1162
+ if (s.type === c.Document)
1163
+ return s.rootObject;
1164
+ if (s.isRoot)
1165
+ return s;
1166
+ s = s.parent;
1167
+ }
1168
+ }, E.prototype.document = function() {
1169
+ var s;
1170
+ for (s = this; s; ) {
1171
+ if (s.type === c.Document)
1172
+ return s;
1173
+ s = s.parent;
1174
+ }
1175
+ }, E.prototype.end = function(s) {
1176
+ return this.document().end(s);
1177
+ }, E.prototype.prev = function() {
1178
+ var s;
1179
+ if (s = this.parent.children.indexOf(this), s < 1)
1180
+ throw new Error("Already at the first node. " + this.debugInfo());
1181
+ return this.parent.children[s - 1];
1182
+ }, E.prototype.next = function() {
1183
+ var s;
1184
+ if (s = this.parent.children.indexOf(this), s === -1 || s === this.parent.children.length - 1)
1185
+ throw new Error("Already at the last node. " + this.debugInfo());
1186
+ return this.parent.children[s + 1];
1187
+ }, E.prototype.importDocument = function(s) {
1188
+ var a;
1189
+ return a = s.root().clone(), a.parent = this, a.isRoot = !1, this.children.push(a), this;
1190
+ }, E.prototype.debugInfo = function(s) {
1191
+ var a, f;
1192
+ return s = s || this.name, s == null && !((a = this.parent) != null && a.name) ? "" : s == null ? "parent: <" + this.parent.name + ">" : (f = this.parent) != null && f.name ? "node: <" + s + ">, parent: <" + this.parent.name + ">" : "node: <" + s + ">";
1193
+ }, E.prototype.ele = function(s, a, f) {
1194
+ return this.element(s, a, f);
1195
+ }, E.prototype.nod = function(s, a, f) {
1196
+ return this.node(s, a, f);
1197
+ }, E.prototype.txt = function(s) {
1198
+ return this.text(s);
1199
+ }, E.prototype.dat = function(s) {
1200
+ return this.cdata(s);
1201
+ }, E.prototype.com = function(s) {
1202
+ return this.comment(s);
1203
+ }, E.prototype.ins = function(s, a) {
1204
+ return this.instruction(s, a);
1205
+ }, E.prototype.doc = function() {
1206
+ return this.document();
1207
+ }, E.prototype.dec = function(s, a, f) {
1208
+ return this.declaration(s, a, f);
1209
+ }, E.prototype.e = function(s, a, f) {
1210
+ return this.element(s, a, f);
1211
+ }, E.prototype.n = function(s, a, f) {
1212
+ return this.node(s, a, f);
1213
+ }, E.prototype.t = function(s) {
1214
+ return this.text(s);
1215
+ }, E.prototype.d = function(s) {
1216
+ return this.cdata(s);
1217
+ }, E.prototype.c = function(s) {
1218
+ return this.comment(s);
1219
+ }, E.prototype.r = function(s) {
1220
+ return this.raw(s);
1221
+ }, E.prototype.i = function(s, a) {
1222
+ return this.instruction(s, a);
1223
+ }, E.prototype.u = function() {
1224
+ return this.up();
1225
+ }, E.prototype.importXMLBuilder = function(s) {
1226
+ return this.importDocument(s);
1227
+ }, E.prototype.replaceChild = function(s, a) {
1228
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1229
+ }, E.prototype.removeChild = function(s) {
1230
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1231
+ }, E.prototype.appendChild = function(s) {
1232
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1233
+ }, E.prototype.hasChildNodes = function() {
1234
+ return this.children.length !== 0;
1235
+ }, E.prototype.cloneNode = function(s) {
1236
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1237
+ }, E.prototype.normalize = function() {
1238
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1239
+ }, E.prototype.isSupported = function(s, a) {
1240
+ return !0;
1241
+ }, E.prototype.hasAttributes = function() {
1242
+ return this.attribs.length !== 0;
1243
+ }, E.prototype.compareDocumentPosition = function(s) {
1244
+ var a, f;
1245
+ return a = this, a === s ? 0 : this.document() !== s.document() ? (f = i.Disconnected | i.ImplementationSpecific, Math.random() < 0.5 ? f |= i.Preceding : f |= i.Following, f) : a.isAncestor(s) ? i.Contains | i.Preceding : a.isDescendant(s) ? i.Contains | i.Following : a.isPreceding(s) ? i.Preceding : i.Following;
1246
+ }, E.prototype.isSameNode = function(s) {
1247
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1248
+ }, E.prototype.lookupPrefix = function(s) {
1249
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1250
+ }, E.prototype.isDefaultNamespace = function(s) {
1251
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1252
+ }, E.prototype.lookupNamespaceURI = function(s) {
1253
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1254
+ }, E.prototype.isEqualNode = function(s) {
1255
+ var a, f, T;
1256
+ if (s.nodeType !== this.nodeType || s.children.length !== this.children.length)
1257
+ return !1;
1258
+ for (a = f = 0, T = this.children.length - 1; 0 <= T ? f <= T : f >= T; a = 0 <= T ? ++f : --f)
1259
+ if (!this.children[a].isEqualNode(s.children[a]))
1260
+ return !1;
1261
+ return !0;
1262
+ }, E.prototype.getFeature = function(s, a) {
1263
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1264
+ }, E.prototype.setUserData = function(s, a, f) {
1265
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1266
+ }, E.prototype.getUserData = function(s) {
1267
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1268
+ }, E.prototype.contains = function(s) {
1269
+ return s ? s === this || this.isDescendant(s) : !1;
1270
+ }, E.prototype.isDescendant = function(s) {
1271
+ var a, f, T, I, v;
1272
+ for (v = this.children, T = 0, I = v.length; T < I; T++)
1273
+ if (a = v[T], s === a || (f = a.isDescendant(s), f))
1274
+ return !0;
1275
+ return !1;
1276
+ }, E.prototype.isAncestor = function(s) {
1277
+ return s.isDescendant(this);
1278
+ }, E.prototype.isPreceding = function(s) {
1279
+ var a, f;
1280
+ return a = this.treePosition(s), f = this.treePosition(this), a === -1 || f === -1 ? !1 : a < f;
1281
+ }, E.prototype.isFollowing = function(s) {
1282
+ var a, f;
1283
+ return a = this.treePosition(s), f = this.treePosition(this), a === -1 || f === -1 ? !1 : a > f;
1284
+ }, E.prototype.treePosition = function(s) {
1285
+ var a, f;
1286
+ return f = 0, a = !1, this.foreachTreeNode(this.document(), function(T) {
1287
+ if (f++, !a && T === s)
1288
+ return a = !0;
1289
+ }), a ? f : -1;
1290
+ }, E.prototype.foreachTreeNode = function(s, a) {
1291
+ var f, T, I, v, r;
1292
+ for (s || (s = this.document()), v = s.children, T = 0, I = v.length; T < I; T++) {
1293
+ if (f = v[T], r = a(f))
1294
+ return r;
1295
+ if (r = this.foreachTreeNode(f, a), r)
1296
+ return r;
1297
+ }
1298
+ }, E;
1299
+ }();
1300
+ }).call(M)), dt.exports;
1301
+ }
1302
+ var St = { exports: {} }, Fe;
1303
+ function Ze() {
1304
+ return Fe || (Fe = 1, (function() {
1305
+ var i = function(D, h) {
1306
+ return function() {
1307
+ return D.apply(h, arguments);
1308
+ };
1309
+ }, c = {}.hasOwnProperty;
1310
+ St.exports = function() {
1311
+ function D(h) {
1312
+ this.assertLegalName = i(this.assertLegalName, this), this.assertLegalChar = i(this.assertLegalChar, this);
1313
+ var p, t, e;
1314
+ h || (h = {}), this.options = h, this.options.version || (this.options.version = "1.0"), t = h.stringify || {};
1315
+ for (p in t)
1316
+ c.call(t, p) && (e = t[p], this[p] = e);
1317
+ }
1318
+ return D.prototype.name = function(h) {
1319
+ return this.options.noValidation ? h : this.assertLegalName("" + h || "");
1320
+ }, D.prototype.text = function(h) {
1321
+ return this.options.noValidation ? h : this.assertLegalChar(this.textEscape("" + h || ""));
1322
+ }, D.prototype.cdata = function(h) {
1323
+ return this.options.noValidation ? h : (h = "" + h || "", h = h.replace("]]>", "]]]]><![CDATA[>"), this.assertLegalChar(h));
1324
+ }, D.prototype.comment = function(h) {
1325
+ if (this.options.noValidation)
1326
+ return h;
1327
+ if (h = "" + h || "", h.match(/--/))
1328
+ throw new Error("Comment text cannot contain double-hypen: " + h);
1329
+ return this.assertLegalChar(h);
1330
+ }, D.prototype.raw = function(h) {
1331
+ return this.options.noValidation ? h : "" + h || "";
1332
+ }, D.prototype.attValue = function(h) {
1333
+ return this.options.noValidation ? h : this.assertLegalChar(this.attEscape(h = "" + h || ""));
1334
+ }, D.prototype.insTarget = function(h) {
1335
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1336
+ }, D.prototype.insValue = function(h) {
1337
+ if (this.options.noValidation)
1338
+ return h;
1339
+ if (h = "" + h || "", h.match(/\?>/))
1340
+ throw new Error("Invalid processing instruction value: " + h);
1341
+ return this.assertLegalChar(h);
1342
+ }, D.prototype.xmlVersion = function(h) {
1343
+ if (this.options.noValidation)
1344
+ return h;
1345
+ if (h = "" + h || "", !h.match(/1\.[0-9]+/))
1346
+ throw new Error("Invalid version number: " + h);
1347
+ return h;
1348
+ }, D.prototype.xmlEncoding = function(h) {
1349
+ if (this.options.noValidation)
1350
+ return h;
1351
+ if (h = "" + h || "", !h.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))
1352
+ throw new Error("Invalid encoding: " + h);
1353
+ return this.assertLegalChar(h);
1354
+ }, D.prototype.xmlStandalone = function(h) {
1355
+ return this.options.noValidation ? h : h ? "yes" : "no";
1356
+ }, D.prototype.dtdPubID = function(h) {
1357
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1358
+ }, D.prototype.dtdSysID = function(h) {
1359
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1360
+ }, D.prototype.dtdElementValue = function(h) {
1361
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1362
+ }, D.prototype.dtdAttType = function(h) {
1363
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1364
+ }, D.prototype.dtdAttDefault = function(h) {
1365
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1366
+ }, D.prototype.dtdEntityValue = function(h) {
1367
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1368
+ }, D.prototype.dtdNData = function(h) {
1369
+ return this.options.noValidation ? h : this.assertLegalChar("" + h || "");
1370
+ }, D.prototype.convertAttKey = "@", D.prototype.convertPIKey = "?", D.prototype.convertTextKey = "#text", D.prototype.convertCDataKey = "#cdata", D.prototype.convertCommentKey = "#comment", D.prototype.convertRawKey = "#raw", D.prototype.assertLegalChar = function(h) {
1371
+ var p, t;
1372
+ if (this.options.noValidation)
1373
+ return h;
1374
+ if (p = "", this.options.version === "1.0") {
1375
+ if (p = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, t = h.match(p))
1376
+ throw new Error("Invalid character in string: " + h + " at index " + t.index);
1377
+ } else if (this.options.version === "1.1" && (p = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, t = h.match(p)))
1378
+ throw new Error("Invalid character in string: " + h + " at index " + t.index);
1379
+ return h;
1380
+ }, D.prototype.assertLegalName = function(h) {
1381
+ var p;
1382
+ if (this.options.noValidation)
1383
+ return h;
1384
+ 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))
1385
+ throw new Error("Invalid character in name");
1386
+ return h;
1387
+ }, D.prototype.textEscape = function(h) {
1388
+ var p;
1389
+ return this.options.noValidation ? h : (p = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, h.replace(p, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;"));
1390
+ }, D.prototype.attEscape = function(h) {
1391
+ var p;
1392
+ return this.options.noValidation ? h : (p = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, h.replace(p, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;"));
1393
+ }, D;
1394
+ }();
1395
+ }).call(M)), St.exports;
1396
+ }
1397
+ var Ft = { exports: {} }, Xt = { exports: {} }, Rt = { exports: {} }, Xe;
1398
+ function rt() {
1399
+ return Xe || (Xe = 1, (function() {
1400
+ Rt.exports = {
1401
+ None: 0,
1402
+ OpenTag: 1,
1403
+ InsideTag: 2,
1404
+ CloseTag: 3
1405
+ };
1406
+ }).call(M)), Rt.exports;
1407
+ }
1408
+ var Re;
1409
+ function Je() {
1410
+ return Re || (Re = 1, (function() {
1411
+ var i, c, D, h = {}.hasOwnProperty;
1412
+ D = H().assign, i = q(), zt(), te(), $t(), Kt(), Yt(), ee(), re(), ne(), Qe(), Ht(), Zt(), Qt(), Jt(), c = rt(), Xt.exports = function() {
1413
+ function p(t) {
1414
+ var e, o, l;
1415
+ t || (t = {}), this.options = t, o = t.writer || {};
1416
+ for (e in o)
1417
+ h.call(o, e) && (l = o[e], this["_" + e] = this[e], this[e] = l);
1418
+ }
1419
+ return p.prototype.filterOptions = function(t) {
1420
+ var e, o, l, O, m, y, d, g;
1421
+ return t || (t = {}), t = D({}, this.options, t), e = {
1422
+ writer: this
1423
+ }, e.pretty = t.pretty || !1, e.allowEmpty = t.allowEmpty || !1, e.indent = (o = t.indent) != null ? o : " ", e.newline = (l = t.newline) != null ? l : `
1424
+ `, e.offset = (O = t.offset) != null ? O : 0, e.dontPrettyTextNodes = (m = (y = t.dontPrettyTextNodes) != null ? y : t.dontprettytextnodes) != null ? m : 0, e.spaceBeforeSlash = (d = (g = t.spaceBeforeSlash) != null ? g : t.spacebeforeslash) != null ? d : "", e.spaceBeforeSlash === !0 && (e.spaceBeforeSlash = " "), e.suppressPrettyCount = 0, e.user = {}, e.state = c.None, e;
1425
+ }, p.prototype.indent = function(t, e, o) {
1426
+ var l;
1427
+ return !e.pretty || e.suppressPrettyCount ? "" : e.pretty && (l = (o || 0) + e.offset + 1, l > 0) ? new Array(l).join(e.indent) : "";
1428
+ }, p.prototype.endline = function(t, e, o) {
1429
+ return !e.pretty || e.suppressPrettyCount ? "" : e.newline;
1430
+ }, p.prototype.attribute = function(t, e, o) {
1431
+ var l;
1432
+ return this.openAttribute(t, e, o), l = " " + t.name + '="' + t.value + '"', this.closeAttribute(t, e, o), l;
1433
+ }, p.prototype.cdata = function(t, e, o) {
1434
+ var l;
1435
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<![CDATA[", e.state = c.InsideTag, l += t.value, e.state = c.CloseTag, l += "]]>" + this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1436
+ }, p.prototype.comment = function(t, e, o) {
1437
+ var l;
1438
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<!-- ", e.state = c.InsideTag, l += t.value, e.state = c.CloseTag, l += " -->" + this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1439
+ }, p.prototype.declaration = function(t, e, o) {
1440
+ var l;
1441
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<?xml", e.state = c.InsideTag, l += ' version="' + t.version + '"', t.encoding != null && (l += ' encoding="' + t.encoding + '"'), t.standalone != null && (l += ' standalone="' + t.standalone + '"'), e.state = c.CloseTag, l += e.spaceBeforeSlash + "?>", l += this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1442
+ }, p.prototype.docType = function(t, e, o) {
1443
+ var l, O, m, y, d;
1444
+ if (o || (o = 0), this.openNode(t, e, o), e.state = c.OpenTag, y = this.indent(t, e, o), y += "<!DOCTYPE " + t.root().name, t.pubID && t.sysID ? y += ' PUBLIC "' + t.pubID + '" "' + t.sysID + '"' : t.sysID && (y += ' SYSTEM "' + t.sysID + '"'), t.children.length > 0) {
1445
+ for (y += " [", y += this.endline(t, e, o), e.state = c.InsideTag, d = t.children, O = 0, m = d.length; O < m; O++)
1446
+ l = d[O], y += this.writeChildNode(l, e, o + 1);
1447
+ e.state = c.CloseTag, y += "]";
1448
+ }
1449
+ return e.state = c.CloseTag, y += e.spaceBeforeSlash + ">", y += this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), y;
1450
+ }, p.prototype.element = function(t, e, o) {
1451
+ var l, O, m, y, d, g, b, L, A, x, E, s, a, f;
1452
+ o || (o = 0), x = !1, E = "", this.openNode(t, e, o), e.state = c.OpenTag, E += this.indent(t, e, o) + "<" + t.name, s = t.attribs;
1453
+ for (A in s)
1454
+ h.call(s, A) && (l = s[A], E += this.attribute(l, e, o));
1455
+ if (m = t.children.length, y = m === 0 ? null : t.children[0], m === 0 || t.children.every(function(T) {
1456
+ return (T.type === i.Text || T.type === i.Raw) && T.value === "";
1457
+ }))
1458
+ e.allowEmpty ? (E += ">", e.state = c.CloseTag, E += "</" + t.name + ">" + this.endline(t, e, o)) : (e.state = c.CloseTag, E += e.spaceBeforeSlash + "/>" + this.endline(t, e, o));
1459
+ else if (e.pretty && m === 1 && (y.type === i.Text || y.type === i.Raw) && y.value != null)
1460
+ E += ">", e.state = c.InsideTag, e.suppressPrettyCount++, x = !0, E += this.writeChildNode(y, e, o + 1), e.suppressPrettyCount--, x = !1, e.state = c.CloseTag, E += "</" + t.name + ">" + this.endline(t, e, o);
1461
+ else {
1462
+ if (e.dontPrettyTextNodes) {
1463
+ for (a = t.children, d = 0, b = a.length; d < b; d++)
1464
+ if (O = a[d], (O.type === i.Text || O.type === i.Raw) && O.value != null) {
1465
+ e.suppressPrettyCount++, x = !0;
1466
+ break;
1467
+ }
1468
+ }
1469
+ for (E += ">" + this.endline(t, e, o), e.state = c.InsideTag, f = t.children, g = 0, L = f.length; g < L; g++)
1470
+ O = f[g], E += this.writeChildNode(O, e, o + 1);
1471
+ e.state = c.CloseTag, E += this.indent(t, e, o) + "</" + t.name + ">", x && e.suppressPrettyCount--, E += this.endline(t, e, o), e.state = c.None;
1472
+ }
1473
+ return this.closeNode(t, e, o), E;
1474
+ }, p.prototype.writeChildNode = function(t, e, o) {
1475
+ switch (t.type) {
1476
+ case i.CData:
1477
+ return this.cdata(t, e, o);
1478
+ case i.Comment:
1479
+ return this.comment(t, e, o);
1480
+ case i.Element:
1481
+ return this.element(t, e, o);
1482
+ case i.Raw:
1483
+ return this.raw(t, e, o);
1484
+ case i.Text:
1485
+ return this.text(t, e, o);
1486
+ case i.ProcessingInstruction:
1487
+ return this.processingInstruction(t, e, o);
1488
+ case i.Dummy:
1489
+ return "";
1490
+ case i.Declaration:
1491
+ return this.declaration(t, e, o);
1492
+ case i.DocType:
1493
+ return this.docType(t, e, o);
1494
+ case i.AttributeDeclaration:
1495
+ return this.dtdAttList(t, e, o);
1496
+ case i.ElementDeclaration:
1497
+ return this.dtdElement(t, e, o);
1498
+ case i.EntityDeclaration:
1499
+ return this.dtdEntity(t, e, o);
1500
+ case i.NotationDeclaration:
1501
+ return this.dtdNotation(t, e, o);
1502
+ default:
1503
+ throw new Error("Unknown XML node type: " + t.constructor.name);
1504
+ }
1505
+ }, p.prototype.processingInstruction = function(t, e, o) {
1506
+ var l;
1507
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<?", e.state = c.InsideTag, l += t.target, t.value && (l += " " + t.value), e.state = c.CloseTag, l += e.spaceBeforeSlash + "?>", l += this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1508
+ }, p.prototype.raw = function(t, e, o) {
1509
+ var l;
1510
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o), e.state = c.InsideTag, l += t.value, e.state = c.CloseTag, l += this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1511
+ }, p.prototype.text = function(t, e, o) {
1512
+ var l;
1513
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o), e.state = c.InsideTag, l += t.value, e.state = c.CloseTag, l += this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1514
+ }, p.prototype.dtdAttList = function(t, e, o) {
1515
+ var l;
1516
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<!ATTLIST", e.state = c.InsideTag, l += " " + t.elementName + " " + t.attributeName + " " + t.attributeType, t.defaultValueType !== "#DEFAULT" && (l += " " + t.defaultValueType), t.defaultValue && (l += ' "' + t.defaultValue + '"'), e.state = c.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1517
+ }, p.prototype.dtdElement = function(t, e, o) {
1518
+ var l;
1519
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<!ELEMENT", e.state = c.InsideTag, l += " " + t.name + " " + t.value, e.state = c.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1520
+ }, p.prototype.dtdEntity = function(t, e, o) {
1521
+ var l;
1522
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<!ENTITY", e.state = c.InsideTag, t.pe && (l += " %"), l += " " + t.name, t.value ? l += ' "' + t.value + '"' : (t.pubID && t.sysID ? l += ' PUBLIC "' + t.pubID + '" "' + t.sysID + '"' : t.sysID && (l += ' SYSTEM "' + t.sysID + '"'), t.nData && (l += " NDATA " + t.nData)), e.state = c.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1523
+ }, p.prototype.dtdNotation = function(t, e, o) {
1524
+ var l;
1525
+ return this.openNode(t, e, o), e.state = c.OpenTag, l = this.indent(t, e, o) + "<!NOTATION", e.state = c.InsideTag, l += " " + t.name, t.pubID && t.sysID ? l += ' PUBLIC "' + t.pubID + '" "' + t.sysID + '"' : t.pubID ? l += ' PUBLIC "' + t.pubID + '"' : t.sysID && (l += ' SYSTEM "' + t.sysID + '"'), e.state = c.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = c.None, this.closeNode(t, e, o), l;
1526
+ }, p.prototype.openNode = function(t, e, o) {
1527
+ }, p.prototype.closeNode = function(t, e, o) {
1528
+ }, p.prototype.openAttribute = function(t, e, o) {
1529
+ }, p.prototype.closeAttribute = function(t, e, o) {
1530
+ }, p;
1531
+ }();
1532
+ }).call(M)), Xt.exports;
1533
+ }
1534
+ var je;
1535
+ function ie() {
1536
+ return je || (je = 1, (function() {
1537
+ var i, c = function(h, p) {
1538
+ for (var t in p)
1539
+ D.call(p, t) && (h[t] = p[t]);
1540
+ function e() {
1541
+ this.constructor = h;
1542
+ }
1543
+ return e.prototype = p.prototype, h.prototype = new e(), h.__super__ = p.prototype, h;
1544
+ }, D = {}.hasOwnProperty;
1545
+ i = Je(), Ft.exports = function(h) {
1546
+ c(p, h);
1547
+ function p(t) {
1548
+ p.__super__.constructor.call(this, t);
1549
+ }
1550
+ return p.prototype.document = function(t, e) {
1551
+ var o, l, O, m, y;
1552
+ for (e = this.filterOptions(e), m = "", y = t.children, l = 0, O = y.length; l < O; l++)
1553
+ o = y[l], m += this.writeChildNode(o, e, 0);
1554
+ return e.pretty && m.slice(-e.newline.length) === e.newline && (m = m.slice(0, -e.newline.length)), m;
1555
+ }, p;
1556
+ }(i);
1557
+ }).call(M)), Ft.exports;
1558
+ }
1559
+ var Be;
1560
+ function tr() {
1561
+ return Be || (Be = 1, (function() {
1562
+ var i, c, D, h, p, t, e, o = function(O, m) {
1563
+ for (var y in m)
1564
+ l.call(m, y) && (O[y] = m[y]);
1565
+ function d() {
1566
+ this.constructor = O;
1567
+ }
1568
+ return d.prototype = m.prototype, O.prototype = new d(), O.__super__ = m.prototype, O;
1569
+ }, l = {}.hasOwnProperty;
1570
+ e = H().isPlainObject, D = ze(), c = lr(), h = Y(), i = q(), t = Ze(), p = ie(), lt.exports = function(O) {
1571
+ o(m, O);
1572
+ function m(y) {
1573
+ m.__super__.constructor.call(this, null), this.name = "#document", this.type = i.Document, this.documentURI = null, this.domConfig = new c(), y || (y = {}), y.writer || (y.writer = new p()), this.options = y, this.stringify = new t(y);
1574
+ }
1575
+ return Object.defineProperty(m.prototype, "implementation", {
1576
+ value: new D()
1577
+ }), Object.defineProperty(m.prototype, "doctype", {
1578
+ get: function() {
1579
+ var y, d, g, b;
1580
+ for (b = this.children, d = 0, g = b.length; d < g; d++)
1581
+ if (y = b[d], y.type === i.DocType)
1582
+ return y;
1583
+ return null;
1584
+ }
1585
+ }), Object.defineProperty(m.prototype, "documentElement", {
1586
+ get: function() {
1587
+ return this.rootObject || null;
1588
+ }
1589
+ }), Object.defineProperty(m.prototype, "inputEncoding", {
1590
+ get: function() {
1591
+ return null;
1592
+ }
1593
+ }), Object.defineProperty(m.prototype, "strictErrorChecking", {
1594
+ get: function() {
1595
+ return !1;
1596
+ }
1597
+ }), Object.defineProperty(m.prototype, "xmlEncoding", {
1598
+ get: function() {
1599
+ return this.children.length !== 0 && this.children[0].type === i.Declaration ? this.children[0].encoding : null;
1600
+ }
1601
+ }), Object.defineProperty(m.prototype, "xmlStandalone", {
1602
+ get: function() {
1603
+ return this.children.length !== 0 && this.children[0].type === i.Declaration ? this.children[0].standalone === "yes" : !1;
1604
+ }
1605
+ }), Object.defineProperty(m.prototype, "xmlVersion", {
1606
+ get: function() {
1607
+ return this.children.length !== 0 && this.children[0].type === i.Declaration ? this.children[0].version : "1.0";
1608
+ }
1609
+ }), Object.defineProperty(m.prototype, "URL", {
1610
+ get: function() {
1611
+ return this.documentURI;
1612
+ }
1613
+ }), Object.defineProperty(m.prototype, "origin", {
1614
+ get: function() {
1615
+ return null;
1616
+ }
1617
+ }), Object.defineProperty(m.prototype, "compatMode", {
1618
+ get: function() {
1619
+ return null;
1620
+ }
1621
+ }), Object.defineProperty(m.prototype, "characterSet", {
1622
+ get: function() {
1623
+ return null;
1624
+ }
1625
+ }), Object.defineProperty(m.prototype, "contentType", {
1626
+ get: function() {
1627
+ return null;
1628
+ }
1629
+ }), m.prototype.end = function(y) {
1630
+ var d;
1631
+ return d = {}, y ? e(y) && (d = y, y = this.options.writer) : y = this.options.writer, y.document(this, y.filterOptions(d));
1632
+ }, m.prototype.toString = function(y) {
1633
+ return this.options.writer.document(this, this.options.writer.filterOptions(y));
1634
+ }, m.prototype.createElement = function(y) {
1635
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1636
+ }, m.prototype.createDocumentFragment = function() {
1637
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1638
+ }, m.prototype.createTextNode = function(y) {
1639
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1640
+ }, m.prototype.createComment = function(y) {
1641
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1642
+ }, m.prototype.createCDATASection = function(y) {
1643
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1644
+ }, m.prototype.createProcessingInstruction = function(y, d) {
1645
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1646
+ }, m.prototype.createAttribute = function(y) {
1647
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1648
+ }, m.prototype.createEntityReference = function(y) {
1649
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1650
+ }, m.prototype.getElementsByTagName = function(y) {
1651
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1652
+ }, m.prototype.importNode = function(y, d) {
1653
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1654
+ }, m.prototype.createElementNS = function(y, d) {
1655
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1656
+ }, m.prototype.createAttributeNS = function(y, d) {
1657
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1658
+ }, m.prototype.getElementsByTagNameNS = function(y, d) {
1659
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1660
+ }, m.prototype.getElementById = function(y) {
1661
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1662
+ }, m.prototype.adoptNode = function(y) {
1663
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1664
+ }, m.prototype.normalizeDocument = function() {
1665
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1666
+ }, m.prototype.renameNode = function(y, d, g) {
1667
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1668
+ }, m.prototype.getElementsByClassName = function(y) {
1669
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1670
+ }, m.prototype.createEvent = function(y) {
1671
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1672
+ }, m.prototype.createRange = function() {
1673
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1674
+ }, m.prototype.createNodeIterator = function(y, d, g) {
1675
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1676
+ }, m.prototype.createTreeWalker = function(y, d, g) {
1677
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
1678
+ }, m;
1679
+ }(h);
1680
+ }).call(M)), lt.exports;
1681
+ }
1682
+ var jt = { exports: {} }, qe;
1683
+ function pr() {
1684
+ return qe || (qe = 1, (function() {
1685
+ var i, c, D, h, p, t, e, o, l, O, m, y, d, g, b, L, A, x, E, s, a, f, T, I = {}.hasOwnProperty;
1686
+ T = H(), a = T.isObject, s = T.isFunction, f = T.isPlainObject, E = T.getValue, i = q(), y = tr(), d = Yt(), h = $t(), p = Kt(), b = ee(), x = re(), g = ne(), O = zt(), m = te(), t = Ht(), o = Qt(), e = Zt(), l = Jt(), D = He(), A = Ze(), L = ie(), c = rt(), jt.exports = function() {
1687
+ function v(r, N, P) {
1688
+ var C;
1689
+ this.name = "?xml", this.type = i.Document, r || (r = {}), C = {}, r.writer ? f(r.writer) && (C = r.writer, r.writer = new L()) : r.writer = new L(), this.options = r, this.writer = r.writer, this.writerOptions = this.writer.filterOptions(C), this.stringify = new A(r), this.onDataCallback = N || function() {
1690
+ }, this.onEndCallback = P || function() {
1691
+ }, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null;
1692
+ }
1693
+ return v.prototype.createChildNode = function(r) {
1694
+ var N, P, C, S, X, B, R, F;
1695
+ switch (r.type) {
1696
+ case i.CData:
1697
+ this.cdata(r.value);
1698
+ break;
1699
+ case i.Comment:
1700
+ this.comment(r.value);
1701
+ break;
1702
+ case i.Element:
1703
+ C = {}, R = r.attribs;
1704
+ for (P in R)
1705
+ I.call(R, P) && (N = R[P], C[P] = N.value);
1706
+ this.node(r.name, C);
1707
+ break;
1708
+ case i.Dummy:
1709
+ this.dummy();
1710
+ break;
1711
+ case i.Raw:
1712
+ this.raw(r.value);
1713
+ break;
1714
+ case i.Text:
1715
+ this.text(r.value);
1716
+ break;
1717
+ case i.ProcessingInstruction:
1718
+ this.instruction(r.target, r.value);
1719
+ break;
1720
+ default:
1721
+ throw new Error("This XML node type is not supported in a JS object: " + r.constructor.name);
1722
+ }
1723
+ for (F = r.children, X = 0, B = F.length; X < B; X++)
1724
+ S = F[X], this.createChildNode(S), S.type === i.Element && this.up();
1725
+ return this;
1726
+ }, v.prototype.dummy = function() {
1727
+ return this;
1728
+ }, v.prototype.node = function(r, N, P) {
1729
+ var C;
1730
+ if (r == null)
1731
+ throw new Error("Missing node name.");
1732
+ if (this.root && this.currentLevel === -1)
1733
+ throw new Error("Document can only have one root node. " + this.debugInfo(r));
1734
+ return this.openCurrent(), r = E(r), N == null && (N = {}), N = E(N), a(N) || (C = [N, P], P = C[0], N = C[1]), this.currentNode = new d(this, r, N), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, P != null && this.text(P), this;
1735
+ }, v.prototype.element = function(r, N, P) {
1736
+ var C, S, X, B, R, F;
1737
+ if (this.currentNode && this.currentNode.type === i.DocType)
1738
+ this.dtdElement.apply(this, arguments);
1739
+ else if (Array.isArray(r) || a(r) || s(r))
1740
+ for (B = this.options.noValidation, this.options.noValidation = !0, F = new y(this.options).element("TEMP_ROOT"), F.element(r), this.options.noValidation = B, R = F.children, S = 0, X = R.length; S < X; S++)
1741
+ C = R[S], this.createChildNode(C), C.type === i.Element && this.up();
1742
+ else
1743
+ this.node(r, N, P);
1744
+ return this;
1745
+ }, v.prototype.attribute = function(r, N) {
1746
+ var P, C;
1747
+ if (!this.currentNode || this.currentNode.children)
1748
+ throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(r));
1749
+ if (r != null && (r = E(r)), a(r))
1750
+ for (P in r)
1751
+ I.call(r, P) && (C = r[P], this.attribute(P, C));
1752
+ else
1753
+ s(N) && (N = N.apply()), this.options.keepNullAttributes && N == null ? this.currentNode.attribs[r] = new D(this, r, "") : N != null && (this.currentNode.attribs[r] = new D(this, r, N));
1754
+ return this;
1755
+ }, v.prototype.text = function(r) {
1756
+ var N;
1757
+ return this.openCurrent(), N = new x(this, r), this.onData(this.writer.text(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1758
+ }, v.prototype.cdata = function(r) {
1759
+ var N;
1760
+ return this.openCurrent(), N = new h(this, r), this.onData(this.writer.cdata(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1761
+ }, v.prototype.comment = function(r) {
1762
+ var N;
1763
+ return this.openCurrent(), N = new p(this, r), this.onData(this.writer.comment(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1764
+ }, v.prototype.raw = function(r) {
1765
+ var N;
1766
+ return this.openCurrent(), N = new b(this, r), this.onData(this.writer.raw(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1767
+ }, v.prototype.instruction = function(r, N) {
1768
+ var P, C, S, X, B;
1769
+ if (this.openCurrent(), r != null && (r = E(r)), N != null && (N = E(N)), Array.isArray(r))
1770
+ for (P = 0, X = r.length; P < X; P++)
1771
+ C = r[P], this.instruction(C);
1772
+ else if (a(r))
1773
+ for (C in r)
1774
+ I.call(r, C) && (S = r[C], this.instruction(C, S));
1775
+ else
1776
+ s(N) && (N = N.apply()), B = new g(this, r, N), this.onData(this.writer.processingInstruction(B, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
1777
+ return this;
1778
+ }, v.prototype.declaration = function(r, N, P) {
1779
+ var C;
1780
+ if (this.openCurrent(), this.documentStarted)
1781
+ throw new Error("declaration() must be the first node.");
1782
+ return C = new O(this, r, N, P), this.onData(this.writer.declaration(C, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1783
+ }, v.prototype.doctype = function(r, N, P) {
1784
+ if (this.openCurrent(), r == null)
1785
+ throw new Error("Missing root node name.");
1786
+ if (this.root)
1787
+ throw new Error("dtd() must come before the root node.");
1788
+ return this.currentNode = new m(this, N, P), this.currentNode.rootNodeName = r, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this;
1789
+ }, v.prototype.dtdElement = function(r, N) {
1790
+ var P;
1791
+ return this.openCurrent(), P = new e(this, r, N), this.onData(this.writer.dtdElement(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1792
+ }, v.prototype.attList = function(r, N, P, C, S) {
1793
+ var X;
1794
+ return this.openCurrent(), X = new t(this, r, N, P, C, S), this.onData(this.writer.dtdAttList(X, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1795
+ }, v.prototype.entity = function(r, N) {
1796
+ var P;
1797
+ return this.openCurrent(), P = new o(this, !1, r, N), this.onData(this.writer.dtdEntity(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1798
+ }, v.prototype.pEntity = function(r, N) {
1799
+ var P;
1800
+ return this.openCurrent(), P = new o(this, !0, r, N), this.onData(this.writer.dtdEntity(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1801
+ }, v.prototype.notation = function(r, N) {
1802
+ var P;
1803
+ return this.openCurrent(), P = new l(this, r, N), this.onData(this.writer.dtdNotation(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1804
+ }, v.prototype.up = function() {
1805
+ if (this.currentLevel < 0)
1806
+ throw new Error("The document node has no parent.");
1807
+ 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;
1808
+ }, v.prototype.end = function() {
1809
+ for (; this.currentLevel >= 0; )
1810
+ this.up();
1811
+ return this.onEnd();
1812
+ }, v.prototype.openCurrent = function() {
1813
+ if (this.currentNode)
1814
+ return this.currentNode.children = !0, this.openNode(this.currentNode);
1815
+ }, v.prototype.openNode = function(r) {
1816
+ var N, P, C, S;
1817
+ if (!r.isOpen) {
1818
+ if (!this.root && this.currentLevel === 0 && r.type === i.Element && (this.root = r), P = "", r.type === i.Element) {
1819
+ this.writerOptions.state = c.OpenTag, P = this.writer.indent(r, this.writerOptions, this.currentLevel) + "<" + r.name, S = r.attribs;
1820
+ for (C in S)
1821
+ I.call(S, C) && (N = S[C], P += this.writer.attribute(N, this.writerOptions, this.currentLevel));
1822
+ P += (r.children ? ">" : "/>") + this.writer.endline(r, this.writerOptions, this.currentLevel), this.writerOptions.state = c.InsideTag;
1823
+ } else
1824
+ this.writerOptions.state = c.OpenTag, P = this.writer.indent(r, this.writerOptions, this.currentLevel) + "<!DOCTYPE " + r.rootNodeName, r.pubID && r.sysID ? P += ' PUBLIC "' + r.pubID + '" "' + r.sysID + '"' : r.sysID && (P += ' SYSTEM "' + r.sysID + '"'), r.children ? (P += " [", this.writerOptions.state = c.InsideTag) : (this.writerOptions.state = c.CloseTag, P += ">"), P += this.writer.endline(r, this.writerOptions, this.currentLevel);
1825
+ return this.onData(P, this.currentLevel), r.isOpen = !0;
1826
+ }
1827
+ }, v.prototype.closeNode = function(r) {
1828
+ var N;
1829
+ if (!r.isClosed)
1830
+ return N = "", this.writerOptions.state = c.CloseTag, r.type === i.Element ? N = this.writer.indent(r, this.writerOptions, this.currentLevel) + "</" + r.name + ">" + this.writer.endline(r, this.writerOptions, this.currentLevel) : N = this.writer.indent(r, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(r, this.writerOptions, this.currentLevel), this.writerOptions.state = c.None, this.onData(N, this.currentLevel), r.isClosed = !0;
1831
+ }, v.prototype.onData = function(r, N) {
1832
+ return this.documentStarted = !0, this.onDataCallback(r, N + 1);
1833
+ }, v.prototype.onEnd = function() {
1834
+ return this.documentCompleted = !0, this.onEndCallback();
1835
+ }, v.prototype.debugInfo = function(r) {
1836
+ return r == null ? "" : "node: <" + r + ">";
1837
+ }, v.prototype.ele = function() {
1838
+ return this.element.apply(this, arguments);
1839
+ }, v.prototype.nod = function(r, N, P) {
1840
+ return this.node(r, N, P);
1841
+ }, v.prototype.txt = function(r) {
1842
+ return this.text(r);
1843
+ }, v.prototype.dat = function(r) {
1844
+ return this.cdata(r);
1845
+ }, v.prototype.com = function(r) {
1846
+ return this.comment(r);
1847
+ }, v.prototype.ins = function(r, N) {
1848
+ return this.instruction(r, N);
1849
+ }, v.prototype.dec = function(r, N, P) {
1850
+ return this.declaration(r, N, P);
1851
+ }, v.prototype.dtd = function(r, N, P) {
1852
+ return this.doctype(r, N, P);
1853
+ }, v.prototype.e = function(r, N, P) {
1854
+ return this.element(r, N, P);
1855
+ }, v.prototype.n = function(r, N, P) {
1856
+ return this.node(r, N, P);
1857
+ }, v.prototype.t = function(r) {
1858
+ return this.text(r);
1859
+ }, v.prototype.d = function(r) {
1860
+ return this.cdata(r);
1861
+ }, v.prototype.c = function(r) {
1862
+ return this.comment(r);
1863
+ }, v.prototype.r = function(r) {
1864
+ return this.raw(r);
1865
+ }, v.prototype.i = function(r, N) {
1866
+ return this.instruction(r, N);
1867
+ }, v.prototype.att = function() {
1868
+ return this.currentNode && this.currentNode.type === i.DocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments);
1869
+ }, v.prototype.a = function() {
1870
+ return this.currentNode && this.currentNode.type === i.DocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments);
1871
+ }, v.prototype.ent = function(r, N) {
1872
+ return this.entity(r, N);
1873
+ }, v.prototype.pent = function(r, N) {
1874
+ return this.pEntity(r, N);
1875
+ }, v.prototype.not = function(r, N) {
1876
+ return this.notation(r, N);
1877
+ }, v;
1878
+ }();
1879
+ }).call(M)), jt.exports;
1880
+ }
1881
+ var Bt = { exports: {} }, Ue;
1882
+ function dr() {
1883
+ return Ue || (Ue = 1, (function() {
1884
+ var i, c, D, h = function(t, e) {
1885
+ for (var o in e)
1886
+ p.call(e, o) && (t[o] = e[o]);
1887
+ function l() {
1888
+ this.constructor = t;
1889
+ }
1890
+ return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
1891
+ }, p = {}.hasOwnProperty;
1892
+ i = q(), D = Je(), c = rt(), Bt.exports = function(t) {
1893
+ h(e, t);
1894
+ function e(o, l) {
1895
+ this.stream = o, e.__super__.constructor.call(this, l);
1896
+ }
1897
+ return e.prototype.endline = function(o, l, O) {
1898
+ return o.isLastRootNode && l.state === c.CloseTag ? "" : e.__super__.endline.call(this, o, l, O);
1899
+ }, e.prototype.document = function(o, l) {
1900
+ var O, m, y, d, g, b, L, A, x;
1901
+ for (L = o.children, m = y = 0, g = L.length; y < g; m = ++y)
1902
+ O = L[m], O.isLastRootNode = m === o.children.length - 1;
1903
+ for (l = this.filterOptions(l), A = o.children, x = [], d = 0, b = A.length; d < b; d++)
1904
+ O = A[d], x.push(this.writeChildNode(O, l, 0));
1905
+ return x;
1906
+ }, e.prototype.attribute = function(o, l, O) {
1907
+ return this.stream.write(e.__super__.attribute.call(this, o, l, O));
1908
+ }, e.prototype.cdata = function(o, l, O) {
1909
+ return this.stream.write(e.__super__.cdata.call(this, o, l, O));
1910
+ }, e.prototype.comment = function(o, l, O) {
1911
+ return this.stream.write(e.__super__.comment.call(this, o, l, O));
1912
+ }, e.prototype.declaration = function(o, l, O) {
1913
+ return this.stream.write(e.__super__.declaration.call(this, o, l, O));
1914
+ }, e.prototype.docType = function(o, l, O) {
1915
+ var m, y, d, g;
1916
+ if (O || (O = 0), this.openNode(o, l, O), l.state = c.OpenTag, this.stream.write(this.indent(o, l, O)), 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) {
1917
+ for (this.stream.write(" ["), this.stream.write(this.endline(o, l, O)), l.state = c.InsideTag, g = o.children, y = 0, d = g.length; y < d; y++)
1918
+ m = g[y], this.writeChildNode(m, l, O + 1);
1919
+ l.state = c.CloseTag, this.stream.write("]");
1920
+ }
1921
+ return l.state = c.CloseTag, this.stream.write(l.spaceBeforeSlash + ">"), this.stream.write(this.endline(o, l, O)), l.state = c.None, this.closeNode(o, l, O);
1922
+ }, e.prototype.element = function(o, l, O) {
1923
+ var m, y, d, g, b, L, A, x, E;
1924
+ O || (O = 0), this.openNode(o, l, O), l.state = c.OpenTag, this.stream.write(this.indent(o, l, O) + "<" + o.name), x = o.attribs;
1925
+ for (A in x)
1926
+ p.call(x, A) && (m = x[A], this.attribute(m, l, O));
1927
+ if (d = o.children.length, g = d === 0 ? null : o.children[0], d === 0 || o.children.every(function(s) {
1928
+ return (s.type === i.Text || s.type === i.Raw) && s.value === "";
1929
+ }))
1930
+ l.allowEmpty ? (this.stream.write(">"), l.state = c.CloseTag, this.stream.write("</" + o.name + ">")) : (l.state = c.CloseTag, this.stream.write(l.spaceBeforeSlash + "/>"));
1931
+ else if (l.pretty && d === 1 && (g.type === i.Text || g.type === i.Raw) && g.value != null)
1932
+ this.stream.write(">"), l.state = c.InsideTag, l.suppressPrettyCount++, this.writeChildNode(g, l, O + 1), l.suppressPrettyCount--, l.state = c.CloseTag, this.stream.write("</" + o.name + ">");
1933
+ else {
1934
+ for (this.stream.write(">" + this.endline(o, l, O)), l.state = c.InsideTag, E = o.children, b = 0, L = E.length; b < L; b++)
1935
+ y = E[b], this.writeChildNode(y, l, O + 1);
1936
+ l.state = c.CloseTag, this.stream.write(this.indent(o, l, O) + "</" + o.name + ">");
1937
+ }
1938
+ return this.stream.write(this.endline(o, l, O)), l.state = c.None, this.closeNode(o, l, O);
1939
+ }, e.prototype.processingInstruction = function(o, l, O) {
1940
+ return this.stream.write(e.__super__.processingInstruction.call(this, o, l, O));
1941
+ }, e.prototype.raw = function(o, l, O) {
1942
+ return this.stream.write(e.__super__.raw.call(this, o, l, O));
1943
+ }, e.prototype.text = function(o, l, O) {
1944
+ return this.stream.write(e.__super__.text.call(this, o, l, O));
1945
+ }, e.prototype.dtdAttList = function(o, l, O) {
1946
+ return this.stream.write(e.__super__.dtdAttList.call(this, o, l, O));
1947
+ }, e.prototype.dtdElement = function(o, l, O) {
1948
+ return this.stream.write(e.__super__.dtdElement.call(this, o, l, O));
1949
+ }, e.prototype.dtdEntity = function(o, l, O) {
1950
+ return this.stream.write(e.__super__.dtdEntity.call(this, o, l, O));
1951
+ }, e.prototype.dtdNotation = function(o, l, O) {
1952
+ return this.stream.write(e.__super__.dtdNotation.call(this, o, l, O));
1953
+ }, e;
1954
+ }(D);
1955
+ }).call(M)), Bt.exports;
1956
+ }
1957
+ var Ve;
1958
+ function yr() {
1959
+ return Ve || (Ve = 1, (function() {
1960
+ var i, c, D, h, p, t, e, o, l, O;
1961
+ O = H(), o = O.assign, l = O.isFunction, D = ze(), h = tr(), p = pr(), e = ie(), t = dr(), i = q(), c = rt(), K.create = function(m, y, d, g) {
1962
+ var b, L;
1963
+ if (m == null)
1964
+ throw new Error("Root element needs a name.");
1965
+ return g = o({}, y, d, g), b = new h(g), L = b.element(m), g.headless || (b.declaration(g), (g.pubID != null || g.sysID != null) && b.dtd(g)), L;
1966
+ }, K.begin = function(m, y, d) {
1967
+ var g;
1968
+ return l(m) && (g = [m, y], y = g[0], d = g[1], m = {}), y ? new p(m, y, d) : new h(m);
1969
+ }, K.stringWriter = function(m) {
1970
+ return new e(m);
1971
+ }, K.streamWriter = function(m, y) {
1972
+ return new t(m, y);
1973
+ }, K.implementation = new D(), K.nodeType = i, K.writerState = c;
1974
+ }).call(M)), K;
1975
+ }
1976
+ var ke;
1977
+ function mr() {
1978
+ return ke || (ke = 1, (function() {
1979
+ var i, c, D, h, p, t = {}.hasOwnProperty;
1980
+ i = yr(), c = Wt().defaults, h = function(e) {
1981
+ return typeof e == "string" && (e.indexOf("&") >= 0 || e.indexOf(">") >= 0 || e.indexOf("<") >= 0);
1982
+ }, p = function(e) {
1983
+ return "<![CDATA[" + D(e) + "]]>";
1984
+ }, D = function(e) {
1985
+ return e.replace("]]>", "]]]]><![CDATA[>");
1986
+ }, at.Builder = function() {
1987
+ function e(o) {
1988
+ var l, O, m;
1989
+ this.options = {}, O = c["0.2"];
1990
+ for (l in O)
1991
+ t.call(O, l) && (m = O[l], this.options[l] = m);
1992
+ for (l in o)
1993
+ t.call(o, l) && (m = o[l], this.options[l] = m);
1994
+ }
1995
+ return e.prototype.buildObject = function(o) {
1996
+ var l, O, m, y, d;
1997
+ return l = this.options.attrkey, O = this.options.charkey, Object.keys(o).length === 1 && this.options.rootName === c["0.2"].rootName ? (d = Object.keys(o)[0], o = o[d]) : d = this.options.rootName, m = /* @__PURE__ */ function(g) {
1998
+ return function(b, L) {
1999
+ var A, x, E, s, a, f;
2000
+ if (typeof L != "object")
2001
+ g.options.cdata && h(L) ? b.raw(p(L)) : b.txt(L);
2002
+ else if (Array.isArray(L)) {
2003
+ for (s in L)
2004
+ if (t.call(L, s)) {
2005
+ x = L[s];
2006
+ for (a in x)
2007
+ E = x[a], b = m(b.ele(a), E).up();
2008
+ }
2009
+ } else
2010
+ for (a in L)
2011
+ if (t.call(L, a))
2012
+ if (x = L[a], a === l) {
2013
+ if (typeof x == "object")
2014
+ for (A in x)
2015
+ f = x[A], b = b.att(A, f);
2016
+ } else if (a === O)
2017
+ g.options.cdata && h(x) ? b = b.raw(p(x)) : b = b.txt(x);
2018
+ else if (Array.isArray(x))
2019
+ for (s in x)
2020
+ t.call(x, s) && (E = x[s], typeof E == "string" ? g.options.cdata && h(E) ? b = b.ele(a).raw(p(E)).up() : b = b.ele(a, E).up() : b = m(b.ele(a), E).up());
2021
+ else typeof x == "object" ? b = m(b.ele(a), x).up() : typeof x == "string" && g.options.cdata && h(x) ? b = b.ele(a).raw(p(x)).up() : (x == null && (x = ""), b = b.ele(a, x.toString()).up());
2022
+ return b;
2023
+ };
2024
+ }(this), y = i.create(d, this.options.xmldec, this.options.doctype, {
2025
+ headless: this.options.headless,
2026
+ allowSurrogateChars: this.options.allowSurrogateChars
2027
+ }), m(y, o).end(this.options.renderOpts);
2028
+ }, e;
2029
+ }();
2030
+ }).call(M)), at;
2031
+ }
2032
+ var qt = {}, Ut = {};
2033
+ const gr = {}, wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2034
+ __proto__: null,
2035
+ default: gr
2036
+ }, Symbol.toStringTag, { value: "Module" })), kt = /* @__PURE__ */ ur(wr);
2037
+ var We;
2038
+ function Tr() {
2039
+ return We || (We = 1, function(i) {
2040
+ (function(c) {
2041
+ c.parser = function(u, n) {
2042
+ return new h(u, n);
2043
+ }, c.SAXParser = h, c.SAXStream = m, c.createStream = O, c.MAX_BUFFER_LENGTH = 64 * 1024;
2044
+ var D = [
2045
+ "comment",
2046
+ "sgmlDecl",
2047
+ "textNode",
2048
+ "tagName",
2049
+ "doctype",
2050
+ "procInstName",
2051
+ "procInstBody",
2052
+ "entity",
2053
+ "attribName",
2054
+ "attribValue",
2055
+ "cdata",
2056
+ "script"
2057
+ ];
2058
+ c.EVENTS = [
2059
+ "text",
2060
+ "processinginstruction",
2061
+ "sgmldeclaration",
2062
+ "doctype",
2063
+ "comment",
2064
+ "opentagstart",
2065
+ "attribute",
2066
+ "opentag",
2067
+ "closetag",
2068
+ "opencdata",
2069
+ "cdata",
2070
+ "closecdata",
2071
+ "error",
2072
+ "end",
2073
+ "ready",
2074
+ "script",
2075
+ "opennamespace",
2076
+ "closenamespace"
2077
+ ];
2078
+ function h(u, n) {
2079
+ if (!(this instanceof h))
2080
+ return new h(u, n);
2081
+ var _ = this;
2082
+ t(_), _.q = _.c = "", _.bufferCheckPosition = c.MAX_BUFFER_LENGTH, _.opt = n || {}, _.opt.lowercase = _.opt.lowercase || _.opt.lowercasetags, _.looseCase = _.opt.lowercase ? "toLowerCase" : "toUpperCase", _.tags = [], _.closed = _.closedRoot = _.sawRoot = !1, _.tag = _.error = null, _.strict = !!u, _.noscript = !!(u || _.opt.noscript), _.state = r.BEGIN, _.strictEntities = _.opt.strictEntities, _.ENTITIES = _.strictEntities ? Object.create(c.XML_ENTITIES) : Object.create(c.ENTITIES), _.attribList = [], _.opt.xmlns && (_.ns = Object.create(L)), _.opt.unquotedAttributeValues === void 0 && (_.opt.unquotedAttributeValues = !u), _.trackPosition = _.opt.position !== !1, _.trackPosition && (_.position = _.line = _.column = 0), P(_, "onready");
2083
+ }
2084
+ Object.create || (Object.create = function(u) {
2085
+ function n() {
2086
+ }
2087
+ n.prototype = u;
2088
+ var _ = new n();
2089
+ return _;
2090
+ }), Object.keys || (Object.keys = function(u) {
2091
+ var n = [];
2092
+ for (var _ in u) u.hasOwnProperty(_) && n.push(_);
2093
+ return n;
2094
+ });
2095
+ function p(u) {
2096
+ for (var n = Math.max(c.MAX_BUFFER_LENGTH, 10), _ = 0, w = 0, j = D.length; w < j; w++) {
2097
+ var U = u[D[w]].length;
2098
+ if (U > n)
2099
+ switch (D[w]) {
2100
+ case "textNode":
2101
+ S(u);
2102
+ break;
2103
+ case "cdata":
2104
+ C(u, "oncdata", u.cdata), u.cdata = "";
2105
+ break;
2106
+ case "script":
2107
+ C(u, "onscript", u.script), u.script = "";
2108
+ break;
2109
+ default:
2110
+ B(u, "Max buffer length exceeded: " + D[w]);
2111
+ }
2112
+ _ = Math.max(_, U);
2113
+ }
2114
+ var V = c.MAX_BUFFER_LENGTH - _;
2115
+ u.bufferCheckPosition = V + u.position;
2116
+ }
2117
+ function t(u) {
2118
+ for (var n = 0, _ = D.length; n < _; n++)
2119
+ u[D[n]] = "";
2120
+ }
2121
+ function e(u) {
2122
+ S(u), u.cdata !== "" && (C(u, "oncdata", u.cdata), u.cdata = ""), u.script !== "" && (C(u, "onscript", u.script), u.script = "");
2123
+ }
2124
+ h.prototype = {
2125
+ end: function() {
2126
+ R(this);
2127
+ },
2128
+ write: or,
2129
+ resume: function() {
2130
+ return this.error = null, this;
2131
+ },
2132
+ close: function() {
2133
+ return this.write(null);
2134
+ },
2135
+ flush: function() {
2136
+ e(this);
2137
+ }
2138
+ };
2139
+ var o;
2140
+ try {
2141
+ o = kt.Stream;
2142
+ } catch {
2143
+ o = function() {
2144
+ };
2145
+ }
2146
+ o || (o = function() {
2147
+ });
2148
+ var l = c.EVENTS.filter(function(u) {
2149
+ return u !== "error" && u !== "end";
2150
+ });
2151
+ function O(u, n) {
2152
+ return new m(u, n);
2153
+ }
2154
+ function m(u, n) {
2155
+ if (!(this instanceof m))
2156
+ return new m(u, n);
2157
+ o.apply(this), this._parser = new h(u, n), this.writable = !0, this.readable = !0;
2158
+ var _ = this;
2159
+ this._parser.onend = function() {
2160
+ _.emit("end");
2161
+ }, this._parser.onerror = function(w) {
2162
+ _.emit("error", w), _._parser.error = null;
2163
+ }, this._decoder = null, l.forEach(function(w) {
2164
+ Object.defineProperty(_, "on" + w, {
2165
+ get: function() {
2166
+ return _._parser["on" + w];
2167
+ },
2168
+ set: function(j) {
2169
+ if (!j)
2170
+ return _.removeAllListeners(w), _._parser["on" + w] = j, j;
2171
+ _.on(w, j);
2172
+ },
2173
+ enumerable: !0,
2174
+ configurable: !1
2175
+ });
2176
+ });
2177
+ }
2178
+ m.prototype = Object.create(o.prototype, {
2179
+ constructor: {
2180
+ value: m
2181
+ }
2182
+ }), m.prototype.write = function(u) {
2183
+ if (typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(u)) {
2184
+ if (!this._decoder) {
2185
+ var n = kt.StringDecoder;
2186
+ this._decoder = new n("utf8");
2187
+ }
2188
+ u = this._decoder.write(u);
2189
+ }
2190
+ return this._parser.write(u.toString()), this.emit("data", u), !0;
2191
+ }, m.prototype.end = function(u) {
2192
+ return u && u.length && this.write(u), this._parser.end(), !0;
2193
+ }, m.prototype.on = function(u, n) {
2194
+ var _ = this;
2195
+ return !_._parser["on" + u] && l.indexOf(u) !== -1 && (_._parser["on" + u] = function() {
2196
+ var w = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
2197
+ w.splice(0, 0, u), _.emit.apply(_, w);
2198
+ }), o.prototype.on.call(_, u, n);
2199
+ };
2200
+ var y = "[CDATA[", d = "DOCTYPE", g = "http://www.w3.org/XML/1998/namespace", b = "http://www.w3.org/2000/xmlns/", L = { xml: g, xmlns: b }, A = /[:_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]/, x = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\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-]/;
2201
+ function a(u) {
2202
+ return u === " " || u === `
2203
+ ` || u === "\r" || u === " ";
2204
+ }
2205
+ function f(u) {
2206
+ return u === '"' || u === "'";
2207
+ }
2208
+ function T(u) {
2209
+ return u === ">" || a(u);
2210
+ }
2211
+ function I(u, n) {
2212
+ return u.test(n);
2213
+ }
2214
+ function v(u, n) {
2215
+ return !I(u, n);
2216
+ }
2217
+ var r = 0;
2218
+ c.STATE = {
2219
+ BEGIN: r++,
2220
+ // leading byte order mark or whitespace
2221
+ BEGIN_WHITESPACE: r++,
2222
+ // leading whitespace
2223
+ TEXT: r++,
2224
+ // general stuff
2225
+ TEXT_ENTITY: r++,
2226
+ // &amp and such.
2227
+ OPEN_WAKA: r++,
2228
+ // <
2229
+ SGML_DECL: r++,
2230
+ // <!BLARG
2231
+ SGML_DECL_QUOTED: r++,
2232
+ // <!BLARG foo "bar
2233
+ DOCTYPE: r++,
2234
+ // <!DOCTYPE
2235
+ DOCTYPE_QUOTED: r++,
2236
+ // <!DOCTYPE "//blah
2237
+ DOCTYPE_DTD: r++,
2238
+ // <!DOCTYPE "//blah" [ ...
2239
+ DOCTYPE_DTD_QUOTED: r++,
2240
+ // <!DOCTYPE "//blah" [ "foo
2241
+ COMMENT_STARTING: r++,
2242
+ // <!-
2243
+ COMMENT: r++,
2244
+ // <!--
2245
+ COMMENT_ENDING: r++,
2246
+ // <!-- blah -
2247
+ COMMENT_ENDED: r++,
2248
+ // <!-- blah --
2249
+ CDATA: r++,
2250
+ // <![CDATA[ something
2251
+ CDATA_ENDING: r++,
2252
+ // ]
2253
+ CDATA_ENDING_2: r++,
2254
+ // ]]
2255
+ PROC_INST: r++,
2256
+ // <?hi
2257
+ PROC_INST_BODY: r++,
2258
+ // <?hi there
2259
+ PROC_INST_ENDING: r++,
2260
+ // <?hi "there" ?
2261
+ OPEN_TAG: r++,
2262
+ // <strong
2263
+ OPEN_TAG_SLASH: r++,
2264
+ // <strong /
2265
+ ATTRIB: r++,
2266
+ // <a
2267
+ ATTRIB_NAME: r++,
2268
+ // <a foo
2269
+ ATTRIB_NAME_SAW_WHITE: r++,
2270
+ // <a foo _
2271
+ ATTRIB_VALUE: r++,
2272
+ // <a foo=
2273
+ ATTRIB_VALUE_QUOTED: r++,
2274
+ // <a foo="bar
2275
+ ATTRIB_VALUE_CLOSED: r++,
2276
+ // <a foo="bar"
2277
+ ATTRIB_VALUE_UNQUOTED: r++,
2278
+ // <a foo=bar
2279
+ ATTRIB_VALUE_ENTITY_Q: r++,
2280
+ // <foo bar="&quot;"
2281
+ ATTRIB_VALUE_ENTITY_U: r++,
2282
+ // <foo bar=&quot
2283
+ CLOSE_TAG: r++,
2284
+ // </a
2285
+ CLOSE_TAG_SAW_WHITE: r++,
2286
+ // </a >
2287
+ SCRIPT: r++,
2288
+ // <script> ...
2289
+ SCRIPT_ENDING: r++
2290
+ // <script> ... <
2291
+ }, c.XML_ENTITIES = {
2292
+ amp: "&",
2293
+ gt: ">",
2294
+ lt: "<",
2295
+ quot: '"',
2296
+ apos: "'"
2297
+ }, c.ENTITIES = {
2298
+ amp: "&",
2299
+ gt: ">",
2300
+ lt: "<",
2301
+ quot: '"',
2302
+ apos: "'",
2303
+ AElig: 198,
2304
+ Aacute: 193,
2305
+ Acirc: 194,
2306
+ Agrave: 192,
2307
+ Aring: 197,
2308
+ Atilde: 195,
2309
+ Auml: 196,
2310
+ Ccedil: 199,
2311
+ ETH: 208,
2312
+ Eacute: 201,
2313
+ Ecirc: 202,
2314
+ Egrave: 200,
2315
+ Euml: 203,
2316
+ Iacute: 205,
2317
+ Icirc: 206,
2318
+ Igrave: 204,
2319
+ Iuml: 207,
2320
+ Ntilde: 209,
2321
+ Oacute: 211,
2322
+ Ocirc: 212,
2323
+ Ograve: 210,
2324
+ Oslash: 216,
2325
+ Otilde: 213,
2326
+ Ouml: 214,
2327
+ THORN: 222,
2328
+ Uacute: 218,
2329
+ Ucirc: 219,
2330
+ Ugrave: 217,
2331
+ Uuml: 220,
2332
+ Yacute: 221,
2333
+ aacute: 225,
2334
+ acirc: 226,
2335
+ aelig: 230,
2336
+ agrave: 224,
2337
+ aring: 229,
2338
+ atilde: 227,
2339
+ auml: 228,
2340
+ ccedil: 231,
2341
+ eacute: 233,
2342
+ ecirc: 234,
2343
+ egrave: 232,
2344
+ eth: 240,
2345
+ euml: 235,
2346
+ iacute: 237,
2347
+ icirc: 238,
2348
+ igrave: 236,
2349
+ iuml: 239,
2350
+ ntilde: 241,
2351
+ oacute: 243,
2352
+ ocirc: 244,
2353
+ ograve: 242,
2354
+ oslash: 248,
2355
+ otilde: 245,
2356
+ ouml: 246,
2357
+ szlig: 223,
2358
+ thorn: 254,
2359
+ uacute: 250,
2360
+ ucirc: 251,
2361
+ ugrave: 249,
2362
+ uuml: 252,
2363
+ yacute: 253,
2364
+ yuml: 255,
2365
+ copy: 169,
2366
+ reg: 174,
2367
+ nbsp: 160,
2368
+ iexcl: 161,
2369
+ cent: 162,
2370
+ pound: 163,
2371
+ curren: 164,
2372
+ yen: 165,
2373
+ brvbar: 166,
2374
+ sect: 167,
2375
+ uml: 168,
2376
+ ordf: 170,
2377
+ laquo: 171,
2378
+ not: 172,
2379
+ shy: 173,
2380
+ macr: 175,
2381
+ deg: 176,
2382
+ plusmn: 177,
2383
+ sup1: 185,
2384
+ sup2: 178,
2385
+ sup3: 179,
2386
+ acute: 180,
2387
+ micro: 181,
2388
+ para: 182,
2389
+ middot: 183,
2390
+ cedil: 184,
2391
+ ordm: 186,
2392
+ raquo: 187,
2393
+ frac14: 188,
2394
+ frac12: 189,
2395
+ frac34: 190,
2396
+ iquest: 191,
2397
+ times: 215,
2398
+ divide: 247,
2399
+ OElig: 338,
2400
+ oelig: 339,
2401
+ Scaron: 352,
2402
+ scaron: 353,
2403
+ Yuml: 376,
2404
+ fnof: 402,
2405
+ circ: 710,
2406
+ tilde: 732,
2407
+ Alpha: 913,
2408
+ Beta: 914,
2409
+ Gamma: 915,
2410
+ Delta: 916,
2411
+ Epsilon: 917,
2412
+ Zeta: 918,
2413
+ Eta: 919,
2414
+ Theta: 920,
2415
+ Iota: 921,
2416
+ Kappa: 922,
2417
+ Lambda: 923,
2418
+ Mu: 924,
2419
+ Nu: 925,
2420
+ Xi: 926,
2421
+ Omicron: 927,
2422
+ Pi: 928,
2423
+ Rho: 929,
2424
+ Sigma: 931,
2425
+ Tau: 932,
2426
+ Upsilon: 933,
2427
+ Phi: 934,
2428
+ Chi: 935,
2429
+ Psi: 936,
2430
+ Omega: 937,
2431
+ alpha: 945,
2432
+ beta: 946,
2433
+ gamma: 947,
2434
+ delta: 948,
2435
+ epsilon: 949,
2436
+ zeta: 950,
2437
+ eta: 951,
2438
+ theta: 952,
2439
+ iota: 953,
2440
+ kappa: 954,
2441
+ lambda: 955,
2442
+ mu: 956,
2443
+ nu: 957,
2444
+ xi: 958,
2445
+ omicron: 959,
2446
+ pi: 960,
2447
+ rho: 961,
2448
+ sigmaf: 962,
2449
+ sigma: 963,
2450
+ tau: 964,
2451
+ upsilon: 965,
2452
+ phi: 966,
2453
+ chi: 967,
2454
+ psi: 968,
2455
+ omega: 969,
2456
+ thetasym: 977,
2457
+ upsih: 978,
2458
+ piv: 982,
2459
+ ensp: 8194,
2460
+ emsp: 8195,
2461
+ thinsp: 8201,
2462
+ zwnj: 8204,
2463
+ zwj: 8205,
2464
+ lrm: 8206,
2465
+ rlm: 8207,
2466
+ ndash: 8211,
2467
+ mdash: 8212,
2468
+ lsquo: 8216,
2469
+ rsquo: 8217,
2470
+ sbquo: 8218,
2471
+ ldquo: 8220,
2472
+ rdquo: 8221,
2473
+ bdquo: 8222,
2474
+ dagger: 8224,
2475
+ Dagger: 8225,
2476
+ bull: 8226,
2477
+ hellip: 8230,
2478
+ permil: 8240,
2479
+ prime: 8242,
2480
+ Prime: 8243,
2481
+ lsaquo: 8249,
2482
+ rsaquo: 8250,
2483
+ oline: 8254,
2484
+ frasl: 8260,
2485
+ euro: 8364,
2486
+ image: 8465,
2487
+ weierp: 8472,
2488
+ real: 8476,
2489
+ trade: 8482,
2490
+ alefsym: 8501,
2491
+ larr: 8592,
2492
+ uarr: 8593,
2493
+ rarr: 8594,
2494
+ darr: 8595,
2495
+ harr: 8596,
2496
+ crarr: 8629,
2497
+ lArr: 8656,
2498
+ uArr: 8657,
2499
+ rArr: 8658,
2500
+ dArr: 8659,
2501
+ hArr: 8660,
2502
+ forall: 8704,
2503
+ part: 8706,
2504
+ exist: 8707,
2505
+ empty: 8709,
2506
+ nabla: 8711,
2507
+ isin: 8712,
2508
+ notin: 8713,
2509
+ ni: 8715,
2510
+ prod: 8719,
2511
+ sum: 8721,
2512
+ minus: 8722,
2513
+ lowast: 8727,
2514
+ radic: 8730,
2515
+ prop: 8733,
2516
+ infin: 8734,
2517
+ ang: 8736,
2518
+ and: 8743,
2519
+ or: 8744,
2520
+ cap: 8745,
2521
+ cup: 8746,
2522
+ int: 8747,
2523
+ there4: 8756,
2524
+ sim: 8764,
2525
+ cong: 8773,
2526
+ asymp: 8776,
2527
+ ne: 8800,
2528
+ equiv: 8801,
2529
+ le: 8804,
2530
+ ge: 8805,
2531
+ sub: 8834,
2532
+ sup: 8835,
2533
+ nsub: 8836,
2534
+ sube: 8838,
2535
+ supe: 8839,
2536
+ oplus: 8853,
2537
+ otimes: 8855,
2538
+ perp: 8869,
2539
+ sdot: 8901,
2540
+ lceil: 8968,
2541
+ rceil: 8969,
2542
+ lfloor: 8970,
2543
+ rfloor: 8971,
2544
+ lang: 9001,
2545
+ rang: 9002,
2546
+ loz: 9674,
2547
+ spades: 9824,
2548
+ clubs: 9827,
2549
+ hearts: 9829,
2550
+ diams: 9830
2551
+ }, Object.keys(c.ENTITIES).forEach(function(u) {
2552
+ var n = c.ENTITIES[u], _ = typeof n == "number" ? String.fromCharCode(n) : n;
2553
+ c.ENTITIES[u] = _;
2554
+ });
2555
+ for (var N in c.STATE)
2556
+ c.STATE[c.STATE[N]] = N;
2557
+ r = c.STATE;
2558
+ function P(u, n, _) {
2559
+ u[n] && u[n](_);
2560
+ }
2561
+ function C(u, n, _) {
2562
+ u.textNode && S(u), P(u, n, _);
2563
+ }
2564
+ function S(u) {
2565
+ u.textNode = X(u.opt, u.textNode), u.textNode && P(u, "ontext", u.textNode), u.textNode = "";
2566
+ }
2567
+ function X(u, n) {
2568
+ return u.trim && (n = n.trim()), u.normalize && (n = n.replace(/\s+/g, " ")), n;
2569
+ }
2570
+ function B(u, n) {
2571
+ return S(u), u.trackPosition && (n += `
2572
+ Line: ` + u.line + `
2573
+ Column: ` + u.column + `
2574
+ Char: ` + u.c), n = new Error(n), u.error = n, P(u, "onerror", n), u;
2575
+ }
2576
+ function R(u) {
2577
+ return u.sawRoot && !u.closedRoot && F(u, "Unclosed root tag"), u.state !== r.BEGIN && u.state !== r.BEGIN_WHITESPACE && u.state !== r.TEXT && B(u, "Unexpected end"), S(u), u.c = "", u.closed = !0, P(u, "onend"), h.call(u, u.strict, u.opt), u;
2578
+ }
2579
+ function F(u, n) {
2580
+ if (typeof u != "object" || !(u instanceof h))
2581
+ throw new Error("bad call to strictFail");
2582
+ u.strict && B(u, n);
2583
+ }
2584
+ function nr(u) {
2585
+ u.strict || (u.tagName = u.tagName[u.looseCase]());
2586
+ var n = u.tags[u.tags.length - 1] || u, _ = u.tag = { name: u.tagName, attributes: {} };
2587
+ u.opt.xmlns && (_.ns = n.ns), u.attribList.length = 0, C(u, "onopentagstart", _);
2588
+ }
2589
+ function nt(u, n) {
2590
+ var _ = u.indexOf(":"), w = _ < 0 ? ["", u] : u.split(":"), j = w[0], U = w[1];
2591
+ return n && u === "xmlns" && (j = "xmlns", U = ""), { prefix: j, local: U };
2592
+ }
2593
+ function it(u) {
2594
+ if (u.strict || (u.attribName = u.attribName[u.looseCase]()), u.attribList.indexOf(u.attribName) !== -1 || u.tag.attributes.hasOwnProperty(u.attribName)) {
2595
+ u.attribName = u.attribValue = "";
2596
+ return;
2597
+ }
2598
+ if (u.opt.xmlns) {
2599
+ var n = nt(u.attribName, !0), _ = n.prefix, w = n.local;
2600
+ if (_ === "xmlns")
2601
+ if (w === "xml" && u.attribValue !== g)
2602
+ F(
2603
+ u,
2604
+ "xml: prefix must be bound to " + g + `
2605
+ Actual: ` + u.attribValue
2606
+ );
2607
+ else if (w === "xmlns" && u.attribValue !== b)
2608
+ F(
2609
+ u,
2610
+ "xmlns: prefix must be bound to " + b + `
2611
+ Actual: ` + u.attribValue
2612
+ );
2613
+ else {
2614
+ var j = u.tag, U = u.tags[u.tags.length - 1] || u;
2615
+ j.ns === U.ns && (j.ns = Object.create(U.ns)), j.ns[w] = u.attribValue;
2616
+ }
2617
+ u.attribList.push([u.attribName, u.attribValue]);
2618
+ } else
2619
+ u.tag.attributes[u.attribName] = u.attribValue, C(u, "onattribute", {
2620
+ name: u.attribName,
2621
+ value: u.attribValue
2622
+ });
2623
+ u.attribName = u.attribValue = "";
2624
+ }
2625
+ function Q(u, n) {
2626
+ if (u.opt.xmlns) {
2627
+ var _ = u.tag, w = nt(u.tagName);
2628
+ _.prefix = w.prefix, _.local = w.local, _.uri = _.ns[w.prefix] || "", _.prefix && !_.uri && (F(u, "Unbound namespace prefix: " + JSON.stringify(u.tagName)), _.uri = w.prefix);
2629
+ var j = u.tags[u.tags.length - 1] || u;
2630
+ _.ns && j.ns !== _.ns && Object.keys(_.ns).forEach(function(ae) {
2631
+ C(u, "onopennamespace", {
2632
+ prefix: ae,
2633
+ uri: _.ns[ae]
2634
+ });
2635
+ });
2636
+ for (var U = 0, V = u.attribList.length; U < V; U++) {
2637
+ var W = u.attribList[U], G = W[0], J = W[1], k = nt(G, !0), $ = k.prefix, sr = k.local, ue = $ === "" ? "" : _.ns[$] || "", st = {
2638
+ name: G,
2639
+ value: J,
2640
+ prefix: $,
2641
+ local: sr,
2642
+ uri: ue
2643
+ };
2644
+ $ && $ !== "xmlns" && !ue && (F(u, "Unbound namespace prefix: " + JSON.stringify($)), st.uri = $), u.tag.attributes[G] = st, C(u, "onattribute", st);
2645
+ }
2646
+ u.attribList.length = 0;
2647
+ }
2648
+ u.tag.isSelfClosing = !!n, u.sawRoot = !0, u.tags.push(u.tag), C(u, "onopentag", u.tag), n || (!u.noscript && u.tagName.toLowerCase() === "script" ? u.state = r.SCRIPT : u.state = r.TEXT, u.tag = null, u.tagName = ""), u.attribName = u.attribValue = "", u.attribList.length = 0;
2649
+ }
2650
+ function ot(u) {
2651
+ if (!u.tagName) {
2652
+ F(u, "Weird empty close tag."), u.textNode += "</>", u.state = r.TEXT;
2653
+ return;
2654
+ }
2655
+ if (u.script) {
2656
+ if (u.tagName !== "script") {
2657
+ u.script += "</" + u.tagName + ">", u.tagName = "", u.state = r.SCRIPT;
2658
+ return;
2659
+ }
2660
+ C(u, "onscript", u.script), u.script = "";
2661
+ }
2662
+ var n = u.tags.length, _ = u.tagName;
2663
+ u.strict || (_ = _[u.looseCase]());
2664
+ for (var w = _; n--; ) {
2665
+ var j = u.tags[n];
2666
+ if (j.name !== w)
2667
+ F(u, "Unexpected close tag");
2668
+ else
2669
+ break;
2670
+ }
2671
+ if (n < 0) {
2672
+ F(u, "Unmatched closing tag: " + u.tagName), u.textNode += "</" + u.tagName + ">", u.state = r.TEXT;
2673
+ return;
2674
+ }
2675
+ u.tagName = _;
2676
+ for (var U = u.tags.length; U-- > n; ) {
2677
+ var V = u.tag = u.tags.pop();
2678
+ u.tagName = u.tag.name, C(u, "onclosetag", u.tagName);
2679
+ var W = {};
2680
+ for (var G in V.ns)
2681
+ W[G] = V.ns[G];
2682
+ var J = u.tags[u.tags.length - 1] || u;
2683
+ u.opt.xmlns && V.ns !== J.ns && Object.keys(V.ns).forEach(function(k) {
2684
+ var $ = V.ns[k];
2685
+ C(u, "onclosenamespace", { prefix: k, uri: $ });
2686
+ });
2687
+ }
2688
+ n === 0 && (u.closedRoot = !0), u.tagName = u.attribValue = u.attribName = "", u.attribList.length = 0, u.state = r.TEXT;
2689
+ }
2690
+ function ir(u) {
2691
+ var n = u.entity, _ = n.toLowerCase(), w, j = "";
2692
+ return u.ENTITIES[n] ? u.ENTITIES[n] : u.ENTITIES[_] ? u.ENTITIES[_] : (n = _, n.charAt(0) === "#" && (n.charAt(1) === "x" ? (n = n.slice(2), w = parseInt(n, 16), j = w.toString(16)) : (n = n.slice(1), w = parseInt(n, 10), j = w.toString(10))), n = n.replace(/^0+/, ""), isNaN(w) || j.toLowerCase() !== n ? (F(u, "Invalid character entity"), "&" + u.entity + ";") : String.fromCodePoint(w));
2693
+ }
2694
+ function oe(u, n) {
2695
+ n === "<" ? (u.state = r.OPEN_WAKA, u.startTagPosition = u.position) : a(n) || (F(u, "Non-whitespace before first tag."), u.textNode = n, u.state = r.TEXT);
2696
+ }
2697
+ function se(u, n) {
2698
+ var _ = "";
2699
+ return n < u.length && (_ = u.charAt(n)), _;
2700
+ }
2701
+ function or(u) {
2702
+ var n = this;
2703
+ if (this.error)
2704
+ throw this.error;
2705
+ if (n.closed)
2706
+ return B(
2707
+ n,
2708
+ "Cannot write after close. Assign an onready handler."
2709
+ );
2710
+ if (u === null)
2711
+ return R(n);
2712
+ typeof u == "object" && (u = u.toString());
2713
+ for (var _ = 0, w = ""; w = se(u, _++), n.c = w, !!w; )
2714
+ switch (n.trackPosition && (n.position++, w === `
2715
+ ` ? (n.line++, n.column = 0) : n.column++), n.state) {
2716
+ case r.BEGIN:
2717
+ if (n.state = r.BEGIN_WHITESPACE, w === "\uFEFF")
2718
+ continue;
2719
+ oe(n, w);
2720
+ continue;
2721
+ case r.BEGIN_WHITESPACE:
2722
+ oe(n, w);
2723
+ continue;
2724
+ case r.TEXT:
2725
+ if (n.sawRoot && !n.closedRoot) {
2726
+ for (var j = _ - 1; w && w !== "<" && w !== "&"; )
2727
+ w = se(u, _++), w && n.trackPosition && (n.position++, w === `
2728
+ ` ? (n.line++, n.column = 0) : n.column++);
2729
+ n.textNode += u.substring(j, _ - 1);
2730
+ }
2731
+ w === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = r.OPEN_WAKA, n.startTagPosition = n.position) : (!a(w) && (!n.sawRoot || n.closedRoot) && F(n, "Text data outside of root node."), w === "&" ? n.state = r.TEXT_ENTITY : n.textNode += w);
2732
+ continue;
2733
+ case r.SCRIPT:
2734
+ w === "<" ? n.state = r.SCRIPT_ENDING : n.script += w;
2735
+ continue;
2736
+ case r.SCRIPT_ENDING:
2737
+ w === "/" ? n.state = r.CLOSE_TAG : (n.script += "<" + w, n.state = r.SCRIPT);
2738
+ continue;
2739
+ case r.OPEN_WAKA:
2740
+ if (w === "!")
2741
+ n.state = r.SGML_DECL, n.sgmlDecl = "";
2742
+ else if (!a(w)) if (I(A, w))
2743
+ n.state = r.OPEN_TAG, n.tagName = w;
2744
+ else if (w === "/")
2745
+ n.state = r.CLOSE_TAG, n.tagName = "";
2746
+ else if (w === "?")
2747
+ n.state = r.PROC_INST, n.procInstName = n.procInstBody = "";
2748
+ else {
2749
+ if (F(n, "Unencoded <"), n.startTagPosition + 1 < n.position) {
2750
+ var U = n.position - n.startTagPosition;
2751
+ w = new Array(U).join(" ") + w;
2752
+ }
2753
+ n.textNode += "<" + w, n.state = r.TEXT;
2754
+ }
2755
+ continue;
2756
+ case r.SGML_DECL:
2757
+ if (n.sgmlDecl + w === "--") {
2758
+ n.state = r.COMMENT, n.comment = "", n.sgmlDecl = "";
2759
+ continue;
2760
+ }
2761
+ n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = r.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + w, n.sgmlDecl = "") : (n.sgmlDecl + w).toUpperCase() === y ? (C(n, "onopencdata"), n.state = r.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + w).toUpperCase() === d ? (n.state = r.DOCTYPE, (n.doctype || n.sawRoot) && F(
2762
+ n,
2763
+ "Inappropriately located doctype declaration"
2764
+ ), n.doctype = "", n.sgmlDecl = "") : w === ">" ? (C(n, "onsgmldeclaration", n.sgmlDecl), n.sgmlDecl = "", n.state = r.TEXT) : (f(w) && (n.state = r.SGML_DECL_QUOTED), n.sgmlDecl += w);
2765
+ continue;
2766
+ case r.SGML_DECL_QUOTED:
2767
+ w === n.q && (n.state = r.SGML_DECL, n.q = ""), n.sgmlDecl += w;
2768
+ continue;
2769
+ case r.DOCTYPE:
2770
+ w === ">" ? (n.state = r.TEXT, C(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += w, w === "[" ? n.state = r.DOCTYPE_DTD : f(w) && (n.state = r.DOCTYPE_QUOTED, n.q = w));
2771
+ continue;
2772
+ case r.DOCTYPE_QUOTED:
2773
+ n.doctype += w, w === n.q && (n.q = "", n.state = r.DOCTYPE);
2774
+ continue;
2775
+ case r.DOCTYPE_DTD:
2776
+ w === "]" ? (n.doctype += w, n.state = r.DOCTYPE) : w === "<" ? (n.state = r.OPEN_WAKA, n.startTagPosition = n.position) : f(w) ? (n.doctype += w, n.state = r.DOCTYPE_DTD_QUOTED, n.q = w) : n.doctype += w;
2777
+ continue;
2778
+ case r.DOCTYPE_DTD_QUOTED:
2779
+ n.doctype += w, w === n.q && (n.state = r.DOCTYPE_DTD, n.q = "");
2780
+ continue;
2781
+ case r.COMMENT:
2782
+ w === "-" ? n.state = r.COMMENT_ENDING : n.comment += w;
2783
+ continue;
2784
+ case r.COMMENT_ENDING:
2785
+ w === "-" ? (n.state = r.COMMENT_ENDED, n.comment = X(n.opt, n.comment), n.comment && C(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + w, n.state = r.COMMENT);
2786
+ continue;
2787
+ case r.COMMENT_ENDED:
2788
+ w !== ">" ? (F(n, "Malformed comment"), n.comment += "--" + w, n.state = r.COMMENT) : n.doctype && n.doctype !== !0 ? n.state = r.DOCTYPE_DTD : n.state = r.TEXT;
2789
+ continue;
2790
+ case r.CDATA:
2791
+ w === "]" ? n.state = r.CDATA_ENDING : n.cdata += w;
2792
+ continue;
2793
+ case r.CDATA_ENDING:
2794
+ w === "]" ? n.state = r.CDATA_ENDING_2 : (n.cdata += "]" + w, n.state = r.CDATA);
2795
+ continue;
2796
+ case r.CDATA_ENDING_2:
2797
+ w === ">" ? (n.cdata && C(n, "oncdata", n.cdata), C(n, "onclosecdata"), n.cdata = "", n.state = r.TEXT) : w === "]" ? n.cdata += "]" : (n.cdata += "]]" + w, n.state = r.CDATA);
2798
+ continue;
2799
+ case r.PROC_INST:
2800
+ w === "?" ? n.state = r.PROC_INST_ENDING : a(w) ? n.state = r.PROC_INST_BODY : n.procInstName += w;
2801
+ continue;
2802
+ case r.PROC_INST_BODY:
2803
+ if (!n.procInstBody && a(w))
2804
+ continue;
2805
+ w === "?" ? n.state = r.PROC_INST_ENDING : n.procInstBody += w;
2806
+ continue;
2807
+ case r.PROC_INST_ENDING:
2808
+ w === ">" ? (C(n, "onprocessinginstruction", {
2809
+ name: n.procInstName,
2810
+ body: n.procInstBody
2811
+ }), n.procInstName = n.procInstBody = "", n.state = r.TEXT) : (n.procInstBody += "?" + w, n.state = r.PROC_INST_BODY);
2812
+ continue;
2813
+ case r.OPEN_TAG:
2814
+ I(x, w) ? n.tagName += w : (nr(n), w === ">" ? Q(n) : w === "/" ? n.state = r.OPEN_TAG_SLASH : (a(w) || F(n, "Invalid character in tag name"), n.state = r.ATTRIB));
2815
+ continue;
2816
+ case r.OPEN_TAG_SLASH:
2817
+ w === ">" ? (Q(n, !0), ot(n)) : (F(n, "Forward-slash in opening tag not followed by >"), n.state = r.ATTRIB);
2818
+ continue;
2819
+ case r.ATTRIB:
2820
+ if (a(w))
2821
+ continue;
2822
+ w === ">" ? Q(n) : w === "/" ? n.state = r.OPEN_TAG_SLASH : I(A, w) ? (n.attribName = w, n.attribValue = "", n.state = r.ATTRIB_NAME) : F(n, "Invalid attribute name");
2823
+ continue;
2824
+ case r.ATTRIB_NAME:
2825
+ w === "=" ? n.state = r.ATTRIB_VALUE : w === ">" ? (F(n, "Attribute without value"), n.attribValue = n.attribName, it(n), Q(n)) : a(w) ? n.state = r.ATTRIB_NAME_SAW_WHITE : I(x, w) ? n.attribName += w : F(n, "Invalid attribute name");
2826
+ continue;
2827
+ case r.ATTRIB_NAME_SAW_WHITE:
2828
+ if (w === "=")
2829
+ n.state = r.ATTRIB_VALUE;
2830
+ else {
2831
+ if (a(w))
2832
+ continue;
2833
+ F(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", C(n, "onattribute", {
2834
+ name: n.attribName,
2835
+ value: ""
2836
+ }), n.attribName = "", w === ">" ? Q(n) : I(A, w) ? (n.attribName = w, n.state = r.ATTRIB_NAME) : (F(n, "Invalid attribute name"), n.state = r.ATTRIB);
2837
+ }
2838
+ continue;
2839
+ case r.ATTRIB_VALUE:
2840
+ if (a(w))
2841
+ continue;
2842
+ f(w) ? (n.q = w, n.state = r.ATTRIB_VALUE_QUOTED) : (n.opt.unquotedAttributeValues || B(n, "Unquoted attribute value"), n.state = r.ATTRIB_VALUE_UNQUOTED, n.attribValue = w);
2843
+ continue;
2844
+ case r.ATTRIB_VALUE_QUOTED:
2845
+ if (w !== n.q) {
2846
+ w === "&" ? n.state = r.ATTRIB_VALUE_ENTITY_Q : n.attribValue += w;
2847
+ continue;
2848
+ }
2849
+ it(n), n.q = "", n.state = r.ATTRIB_VALUE_CLOSED;
2850
+ continue;
2851
+ case r.ATTRIB_VALUE_CLOSED:
2852
+ a(w) ? n.state = r.ATTRIB : w === ">" ? Q(n) : w === "/" ? n.state = r.OPEN_TAG_SLASH : I(A, w) ? (F(n, "No whitespace between attributes"), n.attribName = w, n.attribValue = "", n.state = r.ATTRIB_NAME) : F(n, "Invalid attribute name");
2853
+ continue;
2854
+ case r.ATTRIB_VALUE_UNQUOTED:
2855
+ if (!T(w)) {
2856
+ w === "&" ? n.state = r.ATTRIB_VALUE_ENTITY_U : n.attribValue += w;
2857
+ continue;
2858
+ }
2859
+ it(n), w === ">" ? Q(n) : n.state = r.ATTRIB;
2860
+ continue;
2861
+ case r.CLOSE_TAG:
2862
+ if (n.tagName)
2863
+ w === ">" ? ot(n) : I(x, w) ? n.tagName += w : n.script ? (n.script += "</" + n.tagName, n.tagName = "", n.state = r.SCRIPT) : (a(w) || F(n, "Invalid tagname in closing tag"), n.state = r.CLOSE_TAG_SAW_WHITE);
2864
+ else {
2865
+ if (a(w))
2866
+ continue;
2867
+ v(A, w) ? n.script ? (n.script += "</" + w, n.state = r.SCRIPT) : F(n, "Invalid tagname in closing tag.") : n.tagName = w;
2868
+ }
2869
+ continue;
2870
+ case r.CLOSE_TAG_SAW_WHITE:
2871
+ if (a(w))
2872
+ continue;
2873
+ w === ">" ? ot(n) : F(n, "Invalid characters in closing tag");
2874
+ continue;
2875
+ case r.TEXT_ENTITY:
2876
+ case r.ATTRIB_VALUE_ENTITY_Q:
2877
+ case r.ATTRIB_VALUE_ENTITY_U:
2878
+ var V, W;
2879
+ switch (n.state) {
2880
+ case r.TEXT_ENTITY:
2881
+ V = r.TEXT, W = "textNode";
2882
+ break;
2883
+ case r.ATTRIB_VALUE_ENTITY_Q:
2884
+ V = r.ATTRIB_VALUE_QUOTED, W = "attribValue";
2885
+ break;
2886
+ case r.ATTRIB_VALUE_ENTITY_U:
2887
+ V = r.ATTRIB_VALUE_UNQUOTED, W = "attribValue";
2888
+ break;
2889
+ }
2890
+ if (w === ";") {
2891
+ var G = ir(n);
2892
+ n.opt.unparsedEntities && !Object.values(c.XML_ENTITIES).includes(G) ? (n.entity = "", n.state = V, n.write(G)) : (n[W] += G, n.entity = "", n.state = V);
2893
+ } else I(n.entity.length ? s : E, w) ? n.entity += w : (F(n, "Invalid character in entity name"), n[W] += "&" + n.entity + w, n.entity = "", n.state = V);
2894
+ continue;
2895
+ default:
2896
+ throw new Error(n, "Unknown state: " + n.state);
2897
+ }
2898
+ return n.position >= n.bufferCheckPosition && p(n), n;
2899
+ }
2900
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
2901
+ String.fromCodePoint || function() {
2902
+ var u = String.fromCharCode, n = Math.floor, _ = function() {
2903
+ var w = 16384, j = [], U, V, W = -1, G = arguments.length;
2904
+ if (!G)
2905
+ return "";
2906
+ for (var J = ""; ++W < G; ) {
2907
+ var k = Number(arguments[W]);
2908
+ if (!isFinite(k) || // `NaN`, `+Infinity`, or `-Infinity`
2909
+ k < 0 || // not a valid Unicode code point
2910
+ k > 1114111 || // not a valid Unicode code point
2911
+ n(k) !== k)
2912
+ throw RangeError("Invalid code point: " + k);
2913
+ k <= 65535 ? j.push(k) : (k -= 65536, U = (k >> 10) + 55296, V = k % 1024 + 56320, j.push(U, V)), (W + 1 === G || j.length > w) && (J += u.apply(null, j), j.length = 0);
2914
+ }
2915
+ return J;
2916
+ };
2917
+ Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
2918
+ value: _,
2919
+ configurable: !0,
2920
+ writable: !0
2921
+ }) : String.fromCodePoint = _;
2922
+ }();
2923
+ })(i);
2924
+ }(Ut)), Ut;
2925
+ }
2926
+ var tt = { exports: {} }, Ge;
2927
+ function Dr() {
2928
+ if (Ge) return tt.exports;
2929
+ Ge = 1;
2930
+ var i = typeof Reflect == "object" ? Reflect : null, c = i && typeof i.apply == "function" ? i.apply : function(f, T, I) {
2931
+ return Function.prototype.apply.call(f, T, I);
2932
+ }, D;
2933
+ i && typeof i.ownKeys == "function" ? D = i.ownKeys : Object.getOwnPropertySymbols ? D = function(f) {
2934
+ return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f));
2935
+ } : D = function(f) {
2936
+ return Object.getOwnPropertyNames(f);
2937
+ };
2938
+ function h(a) {
2939
+ console && console.warn && console.warn(a);
2940
+ }
2941
+ var p = Number.isNaN || function(f) {
2942
+ return f !== f;
2943
+ };
2944
+ function t() {
2945
+ t.init.call(this);
2946
+ }
2947
+ tt.exports = t, tt.exports.once = x, t.EventEmitter = t, t.prototype._events = void 0, t.prototype._eventsCount = 0, t.prototype._maxListeners = void 0;
2948
+ var e = 10;
2949
+ function o(a) {
2950
+ if (typeof a != "function")
2951
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof a);
2952
+ }
2953
+ Object.defineProperty(t, "defaultMaxListeners", {
2954
+ enumerable: !0,
2955
+ get: function() {
2956
+ return e;
2957
+ },
2958
+ set: function(a) {
2959
+ if (typeof a != "number" || a < 0 || p(a))
2960
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + a + ".");
2961
+ e = a;
2962
+ }
2963
+ }), t.init = function() {
2964
+ (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
2965
+ }, t.prototype.setMaxListeners = function(f) {
2966
+ if (typeof f != "number" || f < 0 || p(f))
2967
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + f + ".");
2968
+ return this._maxListeners = f, this;
2969
+ };
2970
+ function l(a) {
2971
+ return a._maxListeners === void 0 ? t.defaultMaxListeners : a._maxListeners;
2972
+ }
2973
+ t.prototype.getMaxListeners = function() {
2974
+ return l(this);
2975
+ }, t.prototype.emit = function(f) {
2976
+ for (var T = [], I = 1; I < arguments.length; I++) T.push(arguments[I]);
2977
+ var v = f === "error", r = this._events;
2978
+ if (r !== void 0)
2979
+ v = v && r.error === void 0;
2980
+ else if (!v)
2981
+ return !1;
2982
+ if (v) {
2983
+ var N;
2984
+ if (T.length > 0 && (N = T[0]), N instanceof Error)
2985
+ throw N;
2986
+ var P = new Error("Unhandled error." + (N ? " (" + N.message + ")" : ""));
2987
+ throw P.context = N, P;
2988
+ }
2989
+ var C = r[f];
2990
+ if (C === void 0)
2991
+ return !1;
2992
+ if (typeof C == "function")
2993
+ c(C, this, T);
2994
+ else
2995
+ for (var S = C.length, X = b(C, S), I = 0; I < S; ++I)
2996
+ c(X[I], this, T);
2997
+ return !0;
2998
+ };
2999
+ function O(a, f, T, I) {
3000
+ var v, r, N;
3001
+ if (o(T), r = a._events, r === void 0 ? (r = a._events = /* @__PURE__ */ Object.create(null), a._eventsCount = 0) : (r.newListener !== void 0 && (a.emit(
3002
+ "newListener",
3003
+ f,
3004
+ T.listener ? T.listener : T
3005
+ ), r = a._events), N = r[f]), N === void 0)
3006
+ N = r[f] = T, ++a._eventsCount;
3007
+ else if (typeof N == "function" ? N = r[f] = I ? [T, N] : [N, T] : I ? N.unshift(T) : N.push(T), v = l(a), v > 0 && N.length > v && !N.warned) {
3008
+ N.warned = !0;
3009
+ var P = new Error("Possible EventEmitter memory leak detected. " + N.length + " " + String(f) + " listeners added. Use emitter.setMaxListeners() to increase limit");
3010
+ P.name = "MaxListenersExceededWarning", P.emitter = a, P.type = f, P.count = N.length, h(P);
3011
+ }
3012
+ return a;
3013
+ }
3014
+ t.prototype.addListener = function(f, T) {
3015
+ return O(this, f, T, !1);
3016
+ }, t.prototype.on = t.prototype.addListener, t.prototype.prependListener = function(f, T) {
3017
+ return O(this, f, T, !0);
3018
+ };
3019
+ function m() {
3020
+ if (!this.fired)
3021
+ 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);
3022
+ }
3023
+ function y(a, f, T) {
3024
+ var I = { fired: !1, wrapFn: void 0, target: a, type: f, listener: T }, v = m.bind(I);
3025
+ return v.listener = T, I.wrapFn = v, v;
3026
+ }
3027
+ t.prototype.once = function(f, T) {
3028
+ return o(T), this.on(f, y(this, f, T)), this;
3029
+ }, t.prototype.prependOnceListener = function(f, T) {
3030
+ return o(T), this.prependListener(f, y(this, f, T)), this;
3031
+ }, t.prototype.removeListener = function(f, T) {
3032
+ var I, v, r, N, P;
3033
+ if (o(T), v = this._events, v === void 0)
3034
+ return this;
3035
+ if (I = v[f], I === void 0)
3036
+ return this;
3037
+ if (I === T || I.listener === T)
3038
+ --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete v[f], v.removeListener && this.emit("removeListener", f, I.listener || T));
3039
+ else if (typeof I != "function") {
3040
+ for (r = -1, N = I.length - 1; N >= 0; N--)
3041
+ if (I[N] === T || I[N].listener === T) {
3042
+ P = I[N].listener, r = N;
3043
+ break;
3044
+ }
3045
+ if (r < 0)
3046
+ return this;
3047
+ r === 0 ? I.shift() : L(I, r), I.length === 1 && (v[f] = I[0]), v.removeListener !== void 0 && this.emit("removeListener", f, P || T);
3048
+ }
3049
+ return this;
3050
+ }, t.prototype.off = t.prototype.removeListener, t.prototype.removeAllListeners = function(f) {
3051
+ var T, I, v;
3052
+ if (I = this._events, I === void 0)
3053
+ return this;
3054
+ if (I.removeListener === void 0)
3055
+ return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : I[f] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete I[f]), this;
3056
+ if (arguments.length === 0) {
3057
+ var r = Object.keys(I), N;
3058
+ for (v = 0; v < r.length; ++v)
3059
+ N = r[v], N !== "removeListener" && this.removeAllListeners(N);
3060
+ return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
3061
+ }
3062
+ if (T = I[f], typeof T == "function")
3063
+ this.removeListener(f, T);
3064
+ else if (T !== void 0)
3065
+ for (v = T.length - 1; v >= 0; v--)
3066
+ this.removeListener(f, T[v]);
3067
+ return this;
3068
+ };
3069
+ function d(a, f, T) {
3070
+ var I = a._events;
3071
+ if (I === void 0)
3072
+ return [];
3073
+ var v = I[f];
3074
+ return v === void 0 ? [] : typeof v == "function" ? T ? [v.listener || v] : [v] : T ? A(v) : b(v, v.length);
3075
+ }
3076
+ t.prototype.listeners = function(f) {
3077
+ return d(this, f, !0);
3078
+ }, t.prototype.rawListeners = function(f) {
3079
+ return d(this, f, !1);
3080
+ }, t.listenerCount = function(a, f) {
3081
+ return typeof a.listenerCount == "function" ? a.listenerCount(f) : g.call(a, f);
3082
+ }, t.prototype.listenerCount = g;
3083
+ function g(a) {
3084
+ var f = this._events;
3085
+ if (f !== void 0) {
3086
+ var T = f[a];
3087
+ if (typeof T == "function")
3088
+ return 1;
3089
+ if (T !== void 0)
3090
+ return T.length;
3091
+ }
3092
+ return 0;
3093
+ }
3094
+ t.prototype.eventNames = function() {
3095
+ return this._eventsCount > 0 ? D(this._events) : [];
3096
+ };
3097
+ function b(a, f) {
3098
+ for (var T = new Array(f), I = 0; I < f; ++I)
3099
+ T[I] = a[I];
3100
+ return T;
3101
+ }
3102
+ function L(a, f) {
3103
+ for (; f + 1 < a.length; f++)
3104
+ a[f] = a[f + 1];
3105
+ a.pop();
3106
+ }
3107
+ function A(a) {
3108
+ for (var f = new Array(a.length), T = 0; T < f.length; ++T)
3109
+ f[T] = a[T].listener || a[T];
3110
+ return f;
3111
+ }
3112
+ function x(a, f) {
3113
+ return new Promise(function(T, I) {
3114
+ function v(N) {
3115
+ a.removeListener(f, r), I(N);
3116
+ }
3117
+ function r() {
3118
+ typeof a.removeListener == "function" && a.removeListener("error", v), T([].slice.call(arguments));
3119
+ }
3120
+ s(a, f, r, { once: !0 }), f !== "error" && E(a, v, { once: !0 });
3121
+ });
3122
+ }
3123
+ function E(a, f, T) {
3124
+ typeof a.on == "function" && s(a, "error", f, T);
3125
+ }
3126
+ function s(a, f, T, I) {
3127
+ if (typeof a.on == "function")
3128
+ I.once ? a.once(f, T) : a.on(f, T);
3129
+ else if (typeof a.addEventListener == "function")
3130
+ a.addEventListener(f, function v(r) {
3131
+ I.once && a.removeEventListener(f, v), T(r);
3132
+ });
3133
+ else
3134
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof a);
3135
+ }
3136
+ return tt.exports;
3137
+ }
3138
+ var Vt = {}, Ye;
3139
+ function Er() {
3140
+ return Ye || (Ye = 1, (function() {
3141
+ Vt.stripBOM = function(i) {
3142
+ return i[0] === "\uFEFF" ? i.substring(1) : i;
3143
+ };
3144
+ }).call(M)), Vt;
3145
+ }
3146
+ var Z = {}, $e;
3147
+ function er() {
3148
+ return $e || ($e = 1, (function() {
3149
+ var i;
3150
+ i = new RegExp(/(?!xmlns)^.*:/), Z.normalize = function(c) {
3151
+ return c.toLowerCase();
3152
+ }, Z.firstCharLowerCase = function(c) {
3153
+ return c.charAt(0).toLowerCase() + c.slice(1);
3154
+ }, Z.stripPrefix = function(c) {
3155
+ return c.replace(i, "");
3156
+ }, Z.parseNumbers = function(c) {
3157
+ return isNaN(c) || (c = c % 1 === 0 ? parseInt(c, 10) : parseFloat(c)), c;
3158
+ }, Z.parseBooleans = function(c) {
3159
+ return /^(?:true|false)$/i.test(c) && (c = c.toLowerCase() === "true"), c;
3160
+ };
3161
+ }).call(M)), Z;
3162
+ }
3163
+ var Ke;
3164
+ function br() {
3165
+ return Ke || (Ke = 1, function(i) {
3166
+ (function() {
3167
+ var c, D, h, p, t, e, o, l, O, m = function(g, b) {
3168
+ return function() {
3169
+ return g.apply(b, arguments);
3170
+ };
3171
+ }, y = function(g, b) {
3172
+ for (var L in b)
3173
+ d.call(b, L) && (g[L] = b[L]);
3174
+ function A() {
3175
+ this.constructor = g;
3176
+ }
3177
+ return A.prototype = b.prototype, g.prototype = new A(), g.__super__ = b.prototype, g;
3178
+ }, d = {}.hasOwnProperty;
3179
+ l = Tr(), p = Dr(), c = Er(), o = er(), O = kt.setImmediate, D = Wt().defaults, t = function(g) {
3180
+ return typeof g == "object" && g != null && Object.keys(g).length === 0;
3181
+ }, e = function(g, b, L) {
3182
+ var A, x, E;
3183
+ for (A = 0, x = g.length; A < x; A++)
3184
+ E = g[A], b = E(b, L);
3185
+ return b;
3186
+ }, h = function(g, b, L) {
3187
+ var A;
3188
+ return A = /* @__PURE__ */ Object.create(null), A.value = L, A.writable = !0, A.enumerable = !0, A.configurable = !0, Object.defineProperty(g, b, A);
3189
+ }, i.Parser = function(g) {
3190
+ y(b, g);
3191
+ function b(L) {
3192
+ 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);
3193
+ var A, x, E;
3194
+ if (!(this instanceof i.Parser))
3195
+ return new i.Parser(L);
3196
+ this.options = {}, x = D["0.2"];
3197
+ for (A in x)
3198
+ d.call(x, A) && (E = x[A], this.options[A] = E);
3199
+ for (A in L)
3200
+ d.call(L, A) && (E = L[A], this.options[A] = E);
3201
+ 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();
3202
+ }
3203
+ return b.prototype.processAsync = function() {
3204
+ var L, A;
3205
+ try {
3206
+ return this.remaining.length <= this.options.chunkSize ? (L = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(L), this.saxParser.close()) : (L = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(L), O(this.processAsync));
3207
+ } catch (x) {
3208
+ if (A = x, !this.saxParser.errThrown)
3209
+ return this.saxParser.errThrown = !0, this.emit(A);
3210
+ }
3211
+ }, b.prototype.assignOrPush = function(L, A, x) {
3212
+ return A in L ? (L[A] instanceof Array || h(L, A, [L[A]]), L[A].push(x)) : this.options.explicitArray ? h(L, A, [x]) : h(L, A, x);
3213
+ }, b.prototype.reset = function() {
3214
+ var L, A, x, E;
3215
+ return this.removeAllListeners(), this.saxParser = l.parser(this.options.strict, {
3216
+ trim: !1,
3217
+ normalize: !1,
3218
+ xmlns: this.options.xmlns
3219
+ }), this.saxParser.errThrown = !1, this.saxParser.onerror = /* @__PURE__ */ function(s) {
3220
+ return function(a) {
3221
+ if (s.saxParser.resume(), !s.saxParser.errThrown)
3222
+ return s.saxParser.errThrown = !0, s.emit("error", a);
3223
+ };
3224
+ }(this), this.saxParser.onend = /* @__PURE__ */ function(s) {
3225
+ return function() {
3226
+ if (!s.saxParser.ended)
3227
+ return s.saxParser.ended = !0, s.emit("end", s.resultObject);
3228
+ };
3229
+ }(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, E = [], L = this.options.attrkey, A = this.options.charkey, this.saxParser.onopentag = /* @__PURE__ */ function(s) {
3230
+ return function(a) {
3231
+ var f, T, I, v, r;
3232
+ if (I = {}, I[A] = "", !s.options.ignoreAttrs) {
3233
+ r = a.attributes;
3234
+ for (f in r)
3235
+ d.call(r, f) && (!(L in I) && !s.options.mergeAttrs && (I[L] = {}), T = s.options.attrValueProcessors ? e(s.options.attrValueProcessors, a.attributes[f], f) : a.attributes[f], v = s.options.attrNameProcessors ? e(s.options.attrNameProcessors, f) : f, s.options.mergeAttrs ? s.assignOrPush(I, v, T) : h(I[L], v, T));
3236
+ }
3237
+ return I["#name"] = s.options.tagNameProcessors ? e(s.options.tagNameProcessors, a.name) : a.name, s.options.xmlns && (I[s.options.xmlnskey] = {
3238
+ uri: a.uri,
3239
+ local: a.local
3240
+ }), E.push(I);
3241
+ };
3242
+ }(this), this.saxParser.onclosetag = /* @__PURE__ */ function(s) {
3243
+ return function() {
3244
+ var a, f, T, I, v, r, N, P, C, S;
3245
+ if (r = E.pop(), v = r["#name"], (!s.options.explicitChildren || !s.options.preserveChildrenOrder) && delete r["#name"], r.cdata === !0 && (a = r.cdata, delete r.cdata), C = E[E.length - 1], r[A].match(/^\s*$/) && !a ? (f = r[A], delete r[A]) : (s.options.trim && (r[A] = r[A].trim()), s.options.normalize && (r[A] = r[A].replace(/\s{2,}/g, " ").trim()), r[A] = s.options.valueProcessors ? e(s.options.valueProcessors, r[A], v) : r[A], Object.keys(r).length === 1 && A in r && !s.EXPLICIT_CHARKEY && (r = r[A])), t(r) && (typeof s.options.emptyTag == "function" ? r = s.options.emptyTag() : r = s.options.emptyTag !== "" ? s.options.emptyTag : f), s.options.validator != null && (S = "/" + function() {
3246
+ var X, B, R;
3247
+ for (R = [], X = 0, B = E.length; X < B; X++)
3248
+ I = E[X], R.push(I["#name"]);
3249
+ return R;
3250
+ }().concat(v).join("/"), function() {
3251
+ var X;
3252
+ try {
3253
+ return r = s.options.validator(S, C && C[v], r);
3254
+ } catch (B) {
3255
+ return X = B, s.emit("error", X);
3256
+ }
3257
+ }()), s.options.explicitChildren && !s.options.mergeAttrs && typeof r == "object") {
3258
+ if (!s.options.preserveChildrenOrder)
3259
+ I = {}, s.options.attrkey in r && (I[s.options.attrkey] = r[s.options.attrkey], delete r[s.options.attrkey]), !s.options.charsAsChildren && s.options.charkey in r && (I[s.options.charkey] = r[s.options.charkey], delete r[s.options.charkey]), Object.getOwnPropertyNames(r).length > 0 && (I[s.options.childkey] = r), r = I;
3260
+ else if (C) {
3261
+ C[s.options.childkey] = C[s.options.childkey] || [], N = {};
3262
+ for (T in r)
3263
+ d.call(r, T) && h(N, T, r[T]);
3264
+ C[s.options.childkey].push(N), delete r["#name"], Object.keys(r).length === 1 && A in r && !s.EXPLICIT_CHARKEY && (r = r[A]);
3265
+ }
3266
+ }
3267
+ return E.length > 0 ? s.assignOrPush(C, v, r) : (s.options.explicitRoot && (P = r, r = {}, h(r, v, P)), s.resultObject = r, s.saxParser.ended = !0, s.emit("end", s.resultObject));
3268
+ };
3269
+ }(this), x = /* @__PURE__ */ function(s) {
3270
+ return function(a) {
3271
+ var f, T;
3272
+ if (T = E[E.length - 1], T)
3273
+ return T[A] += a, s.options.explicitChildren && s.options.preserveChildrenOrder && s.options.charsAsChildren && (s.options.includeWhiteChars || a.replace(/\\n/g, "").trim() !== "") && (T[s.options.childkey] = T[s.options.childkey] || [], f = {
3274
+ "#name": "__text__"
3275
+ }, f[A] = a, s.options.normalize && (f[A] = f[A].replace(/\s{2,}/g, " ").trim()), T[s.options.childkey].push(f)), T;
3276
+ };
3277
+ }(this), this.saxParser.ontext = x, this.saxParser.oncdata = /* @__PURE__ */ function(s) {
3278
+ return function(a) {
3279
+ var f;
3280
+ if (f = x(a), f)
3281
+ return f.cdata = !0;
3282
+ };
3283
+ }();
3284
+ }, b.prototype.parseString = function(L, A) {
3285
+ var x;
3286
+ A != null && typeof A == "function" && (this.on("end", function(E) {
3287
+ return this.reset(), A(null, E);
3288
+ }), this.on("error", function(E) {
3289
+ return this.reset(), A(E);
3290
+ }));
3291
+ try {
3292
+ return L = L.toString(), L.trim() === "" ? (this.emit("end", null), !0) : (L = c.stripBOM(L), this.options.async ? (this.remaining = L, O(this.processAsync), this.saxParser) : this.saxParser.write(L).close());
3293
+ } catch (E) {
3294
+ if (x = E, this.saxParser.errThrown || this.saxParser.ended) {
3295
+ if (this.saxParser.ended)
3296
+ throw x;
3297
+ } else return this.emit("error", x), this.saxParser.errThrown = !0;
3298
+ }
3299
+ }, b.prototype.parseStringPromise = function(L) {
3300
+ return new Promise(/* @__PURE__ */ function(A) {
3301
+ return function(x, E) {
3302
+ return A.parseString(L, function(s, a) {
3303
+ return s ? E(s) : x(a);
3304
+ });
3305
+ };
3306
+ }(this));
3307
+ }, b;
3308
+ }(p), i.parseString = function(g, b, L) {
3309
+ var A, x, E;
3310
+ return L != null ? (typeof L == "function" && (A = L), typeof b == "object" && (x = b)) : (typeof b == "function" && (A = b), x = {}), E = new i.Parser(x), E.parseString(g, A);
3311
+ }, i.parseStringPromise = function(g, b) {
3312
+ var L, A;
3313
+ return typeof b == "object" && (L = b), A = new i.Parser(L), A.parseStringPromise(g);
3314
+ };
3315
+ }).call(M);
3316
+ }(qt)), qt;
3317
+ }
3318
+ var rr;
3319
+ (function() {
3320
+ var i, c, D, h = function(t, e) {
3321
+ for (var o in e)
3322
+ p.call(e, o) && (t[o] = e[o]);
3323
+ function l() {
3324
+ this.constructor = t;
3325
+ }
3326
+ return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
3327
+ }, p = {}.hasOwnProperty;
3328
+ c = Wt(), i = mr(), D = br(), er(), c.defaults, function(t) {
3329
+ h(e, t);
3330
+ function e(o) {
3331
+ this.message = o;
3332
+ }
3333
+ return e;
3334
+ }(Error), i.Builder, D.Parser, rr = D.parseString, D.parseStringPromise;
3335
+ }).call(M);
3336
+ const Or = (i) => i !== null && typeof i == "object" && i.hasOwnProperty("rss") && typeof i.rss == "object" && i.rss !== null && i.rss.hasOwnProperty("channel") && Array.isArray(i.rss.channel), Nr = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("title") && Array.isArray(i.title) && i.hasOwnProperty("description") && Array.isArray(i.description) && i.hasOwnProperty("link") && Array.isArray(i.link) && i.hasOwnProperty("image") && Array.isArray(i.image) && i.image.every(vr) && i.hasOwnProperty("generator") && Array.isArray(i.generator) && i.hasOwnProperty("lastBuildDate") && Array.isArray(i.lastBuildDate) && i.hasOwnProperty("atom:link") && Array.isArray(i["atom:link"]) && i["atom:link"].every(Ir) && i.hasOwnProperty("copyright") && Array.isArray(i.copyright) && i.hasOwnProperty("language") && Array.isArray(i.language) && i.hasOwnProperty("webMaster") && Array.isArray(i.webMaster) && i.hasOwnProperty("itunes:owner") && Array.isArray(i["itunes:owner"]) && i["itunes:owner"].every(Lr) && i.hasOwnProperty("itunes:author") && Array.isArray(i["itunes:author"]) && i.hasOwnProperty("googleplay:owner") && Array.isArray(i["googleplay:owner"]) && i.hasOwnProperty("googleplay:email") && Array.isArray(i["googleplay:email"]) && i.hasOwnProperty("googleplay:author") && Array.isArray(i["googleplay:author"]) && i.hasOwnProperty("item") && Array.isArray(i.item) && i.item.every(Ar), vr = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("url") && Array.isArray(i.url) && i.hasOwnProperty("title") && Array.isArray(i.title) && i.hasOwnProperty("link") && Array.isArray(i.link), Ir = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("$") && typeof i.$ == "object" && i.$ !== null && i.$.hasOwnProperty("href") && typeof i.$.href == "string" && i.$.hasOwnProperty("rel") && typeof i.$.rel == "string" && i.$.hasOwnProperty("type") && typeof i.$.type == "string", Lr = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("itunes:email") && Array.isArray(i["itunes:email"]) && i.hasOwnProperty("itunes:name") && Array.isArray(i["itunes:name"]), Ar = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("title") && Array.isArray(i.title) && i.hasOwnProperty("description") && Array.isArray(i.description) && i.hasOwnProperty("link") && Array.isArray(i.link) && i.hasOwnProperty("guid") && Array.isArray(i.guid) && i.guid.every(Pr) && i.hasOwnProperty("dc:creator") && Array.isArray(i["dc:creator"]) && i.hasOwnProperty("pubDate") && Array.isArray(i.pubDate) && i.hasOwnProperty("enclosure") && Array.isArray(i.enclosure) && i.enclosure.every(_r) && i.hasOwnProperty("content:encoded") && Array.isArray(i["content:encoded"]), Pr = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("_") && typeof i._ == "string" && i.hasOwnProperty("$") && typeof i.$ == "object" && i.$ !== null && i.$.hasOwnProperty("isPermaLink") && typeof i.$.isPermaLink == "string", _r = (i) => typeof i == "object" && i !== null && i.hasOwnProperty("$") && typeof i.$ == "object" && i.$ !== null && i.$.hasOwnProperty("url") && typeof i.$.url == "string" && i.$.hasOwnProperty("length") && typeof i.$.length == "string" && i.$.hasOwnProperty("type") && typeof i.$.type == "string", xr = "https://corsproxy.io/?", Cr = async (i) => {
3337
+ try {
3338
+ const c = await fetch(`${xr}${encodeURIComponent(i)}`);
3339
+ if (c.ok) return c.text();
3340
+ } catch {
3341
+ throw new Error("Error occurred fetching Feed from Substack");
3342
+ }
3343
+ }, Mr = async (i = "", c) => {
3344
+ rr(i, c);
3345
+ }, Sr = (i) => ({
3346
+ title: i.title[0],
3347
+ description: i.description[0],
3348
+ link: i.link[0],
3349
+ pubDate: i.pubDate[0],
3350
+ content: i["content:encoded"][0]
3351
+ }), Fr = async (i, c) => {
3352
+ const D = await Cr(i);
3353
+ await Mr(D, c);
3354
+ }, Xr = (i, c) => {
3355
+ if (!Or(i)) throw new Error("Feed is not in the correct format");
3356
+ try {
3357
+ return i.rss.channel.filter(Nr).filter((D) => D.link[0] === c);
3358
+ } catch {
3359
+ throw new Error(`Error occurred fetching Feed by Link: ${c}`);
3360
+ }
3361
+ }, Rr = (i) => i[0].item.map(Sr);
3362
+ export {
3363
+ Xr as getFeedByLink,
3364
+ Rr as getPosts,
3365
+ Fr as getSubstackFeed
3366
+ };