@andre1502/react-utilities 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/{EnvironmentEnum-CXTWJxNo.js → EnvironmentEnum-F4hjulGN.js} +3 -1
- package/dist/EnvironmentEnum-F4hjulGN.js.map +1 -0
- package/dist/{Utils-CJ7ureSW.js → Utils-Bb2yUYbQ.js} +1 -1
- package/dist/{Utils-CJ7ureSW.js.map → Utils-Bb2yUYbQ.js.map} +1 -1
- package/dist/{config-cli-BIF4xuoO.js → config-cli-CY_z5CYp.js} +285 -283
- package/dist/config-cli-CY_z5CYp.js.map +1 -0
- package/dist/config-cli.js +3 -3
- package/dist/enums/EnvironmentEnum.d.ts +2 -0
- package/dist/{format-BgweN3o5.js → format-DOgTlvp7.js} +1 -1
- package/dist/{format-BgweN3o5.js.map → format-DOgTlvp7.js.map} +1 -1
- package/dist/format.js +1 -1
- package/dist/{hooks-oAipbPQ2.js → hooks-BBCIHhac.js} +1 -1
- package/dist/{hooks-oAipbPQ2.js.map → hooks-BBCIHhac.js.map} +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{i18n-D1jKJPI0.js → i18n-CJthsaWo.js} +475 -597
- package/dist/i18n-CJthsaWo.js.map +1 -0
- package/dist/i18n.js +2 -2
- package/dist/index-cli.js +3 -3
- package/dist/index-rn.js +4 -4
- package/dist/index.js +4 -4
- package/dist/{sentry-rn-DZwIel7y.js → sentry-rn-DNJphpGY.js} +2 -2
- package/dist/{sentry-rn-DZwIel7y.js.map → sentry-rn-DNJphpGY.js.map} +1 -1
- package/dist/sentry-rn.js +1 -1
- package/dist/sentry.js +1 -1
- package/package.json +2 -2
- package/src/Config/Config.ts +1 -1
- package/src/enums/EnvironmentEnum.ts +2 -0
- package/dist/EnvironmentEnum-CXTWJxNo.js.map +0 -1
- package/dist/browser-ponyfill-C-HVh7ck.js +0 -321
- package/dist/browser-ponyfill-C-HVh7ck.js.map +0 -1
- package/dist/chunk-vKJrgz-R.js +0 -16
- package/dist/config-cli-BIF4xuoO.js.map +0 -1
- package/dist/i18n-D1jKJPI0.js.map +0 -1
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import { statSync as h } from "node:fs";
|
|
1
|
+
import { t as e } from "./EnvironmentEnum-F4hjulGN.js";
|
|
2
|
+
import { isHiddenKey as t } from "./utils.js";
|
|
3
|
+
import { copyFile as n, existsSync as r, mkdirSync as i, writeFile as a } from "fs";
|
|
4
|
+
import { isNull as o } from "lodash-es";
|
|
5
|
+
import { GoogleAuth as s } from "google-auth-library";
|
|
6
|
+
import { google as c } from "googleapis";
|
|
7
|
+
import * as l from "path";
|
|
8
|
+
import * as u from "process";
|
|
9
|
+
import { Transform as d, Writable as f } from "node:stream";
|
|
10
|
+
import { statSync as p } from "node:fs";
|
|
12
11
|
import "node:readline";
|
|
13
|
-
import { URL as
|
|
12
|
+
import { URL as m } from "node:url";
|
|
14
13
|
import "node:path";
|
|
15
14
|
import "node:child_process";
|
|
16
|
-
import { Readable as
|
|
15
|
+
import { Readable as ee } from "stream";
|
|
17
16
|
import "node:zlib";
|
|
18
17
|
import "node:stream/promises";
|
|
19
|
-
//#region
|
|
20
|
-
var
|
|
18
|
+
//#region \0rolldown/runtime.js
|
|
19
|
+
var h = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), te = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
20
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
21
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
22
|
+
}), g = (e, t) => {
|
|
21
23
|
let n = t.filename;
|
|
22
24
|
t.isFilenameLowercase && (n = n.toLowerCase());
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
+
let o = `${t.folder}/${n}`;
|
|
26
|
+
r(t.folder) || i(t.folder, { recursive: !0 }), a(o, e, {
|
|
25
27
|
encoding: "utf-8",
|
|
26
28
|
flag: "w"
|
|
27
29
|
}, function(t) {
|
|
28
30
|
if (t) throw t;
|
|
29
|
-
console.log(
|
|
31
|
+
console.log(o, e);
|
|
30
32
|
});
|
|
31
|
-
},
|
|
33
|
+
}, ne = (e) => {
|
|
32
34
|
let t = {}, n = e[0].map((e) => e);
|
|
33
35
|
return e.forEach((e, r) => {
|
|
34
|
-
r !== 0 && (t =
|
|
36
|
+
r !== 0 && (t = _(e, n, t));
|
|
35
37
|
}), t;
|
|
36
|
-
},
|
|
38
|
+
}, _ = (e, t, n) => {
|
|
37
39
|
let r = e[0];
|
|
38
40
|
return n[r] = {}, t.forEach((t, i) => {
|
|
39
|
-
i === 0 || e[i] === void 0 || e[i] === "" || (n[r][t] =
|
|
41
|
+
i === 0 || e[i] === void 0 || e[i] === "" || (n[r][t] = y(e[i]));
|
|
40
42
|
}), n;
|
|
41
|
-
},
|
|
43
|
+
}, v = (e) => {
|
|
42
44
|
try {
|
|
43
45
|
JSON.parse(e);
|
|
44
46
|
} catch {
|
|
45
47
|
return !1;
|
|
46
48
|
}
|
|
47
49
|
return !0;
|
|
48
|
-
},
|
|
50
|
+
}, y = (e) => ["TRUE", "FALSE"].includes(e.toUpperCase()) ? e === "TRUE" : v(e) ? JSON.parse(e) : e, re = (e, t) => {
|
|
49
51
|
let n = { params: e }, r = "";
|
|
50
52
|
switch (t.exportAs) {
|
|
51
53
|
case "ts":
|
|
@@ -59,33 +61,33 @@ var v = (e, t) => {
|
|
|
59
61
|
break;
|
|
60
62
|
default: throw Error(`exportAs ${t.exportAs} not supported.`);
|
|
61
63
|
}
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
let
|
|
65
|
-
switch (
|
|
64
|
+
g(r, t);
|
|
65
|
+
}, b = (t) => {
|
|
66
|
+
let n;
|
|
67
|
+
switch (t) {
|
|
66
68
|
case "dev":
|
|
67
69
|
case "develop":
|
|
68
70
|
case "development":
|
|
69
|
-
|
|
71
|
+
n = e.DEV;
|
|
70
72
|
break;
|
|
71
73
|
case "stg":
|
|
72
74
|
case "stag":
|
|
73
75
|
case "staging":
|
|
74
|
-
|
|
76
|
+
n = e.STAGING;
|
|
75
77
|
break;
|
|
76
78
|
case "prd":
|
|
77
79
|
case "prod":
|
|
78
80
|
case "production":
|
|
79
|
-
|
|
81
|
+
n = e.PRODUCTION;
|
|
80
82
|
break;
|
|
81
|
-
default:
|
|
83
|
+
default: n = t;
|
|
82
84
|
}
|
|
83
|
-
return
|
|
84
|
-
},
|
|
85
|
+
return n;
|
|
86
|
+
}, x = (e, t, n) => {
|
|
85
87
|
let r = "";
|
|
86
88
|
switch (n) {
|
|
87
89
|
case "ts":
|
|
88
|
-
|
|
90
|
+
o(t) ? r += `export const ${e}: string | null = ${t};\n` : typeof t == "boolean" ? r += `export const ${e}: boolean = ${t};\n` : r += `export const ${e} = '${t}';\n`;
|
|
89
91
|
break;
|
|
90
92
|
case "js":
|
|
91
93
|
r += `export const ${e} = "${t}";\n`;
|
|
@@ -96,10 +98,10 @@ var v = (e, t) => {
|
|
|
96
98
|
default: throw Error(`exportAs ${n} not supported.`);
|
|
97
99
|
}
|
|
98
100
|
return r;
|
|
99
|
-
},
|
|
100
|
-
let a =
|
|
101
|
+
}, S = (e, n, r, i) => {
|
|
102
|
+
let a = x(r ? `${r}ENV` : "ENV", b(n), i.exportAs);
|
|
101
103
|
Object.keys(e).forEach((o) => {
|
|
102
|
-
let s =
|
|
104
|
+
let s = r && !t(o) ? `${r}${o}` : o;
|
|
103
105
|
if (o === "BASE_PROJECT" || o === "__BASE_PROJECT") {
|
|
104
106
|
let t = [
|
|
105
107
|
`.${e[o]}.js`,
|
|
@@ -110,40 +112,40 @@ var v = (e, t) => {
|
|
|
110
112
|
`.${e[o]}.json`,
|
|
111
113
|
`.${e[o]}.scss`
|
|
112
114
|
];
|
|
113
|
-
a +=
|
|
115
|
+
a += x(s, t.join(","), i.exportAs);
|
|
114
116
|
return;
|
|
115
117
|
}
|
|
116
118
|
if (o === "SITEMAP" || o === "__SITEMAP") {
|
|
117
|
-
a +=
|
|
119
|
+
a += x(s, JSON.stringify(e[o]), i.exportAs);
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
120
122
|
if (Array.isArray(e[o])) {
|
|
121
|
-
a +=
|
|
123
|
+
a += x(s, e[o].join(","), i.exportAs);
|
|
122
124
|
return;
|
|
123
125
|
}
|
|
124
126
|
if (typeof e[o] == "object") {
|
|
125
|
-
e[o].hasOwnProperty(
|
|
127
|
+
e[o].hasOwnProperty(n) ? a += x(s, e[o][n], i.exportAs) : a += x(s, JSON.stringify(e[o]), i.exportAs);
|
|
126
128
|
return;
|
|
127
129
|
}
|
|
128
|
-
a +=
|
|
129
|
-
}),
|
|
130
|
-
},
|
|
131
|
-
let
|
|
132
|
-
if (
|
|
133
|
-
|
|
130
|
+
a += x(s, e[o], i.exportAs);
|
|
131
|
+
}), g(a, i);
|
|
132
|
+
}, C = (e, t, i) => {
|
|
133
|
+
let a = "index.html", o = "index";
|
|
134
|
+
if (i.excludeVersion.includes(e) || (o = `.${e}.`), i.excludeEnv.includes(t) || (o = `${o}.${t}`), o = `${o}.html`, o !== a && r(o)) {
|
|
135
|
+
n(o, a, (e) => {
|
|
134
136
|
if (e) {
|
|
135
137
|
console.error(e);
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
138
|
-
console.log(`File copied from '${o}' to '${
|
|
140
|
+
console.log(`File copied from '${o}' to '${a}' successfully!`);
|
|
139
141
|
});
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
144
|
console.log("use current index.html");
|
|
143
|
-
}, w = ["https://www.googleapis.com/auth/spreadsheets.readonly"], T =
|
|
144
|
-
let e =
|
|
145
|
-
return e && (t.keyFile = T), new
|
|
146
|
-
}, D = async (e, t, n) => (await
|
|
145
|
+
}, w = ["https://www.googleapis.com/auth/spreadsheets.readonly"], T = l.join(u.cwd(), "/google_application_credentials.json"), E = () => {
|
|
146
|
+
let e = r(T), t = { scopes: w };
|
|
147
|
+
return e && (t.keyFile = T), new s(t);
|
|
148
|
+
}, D = async (e, t, n) => (await c.sheets({
|
|
147
149
|
version: "v4",
|
|
148
150
|
auth: e
|
|
149
151
|
}).spreadsheets.values.get({
|
|
@@ -173,7 +175,7 @@ var v = (e, t) => {
|
|
|
173
175
|
default: throw Error(`exportAs ${t.exportAs} not supported.`);
|
|
174
176
|
}
|
|
175
177
|
if (!r) throw Error("empty content, please check remote value.");
|
|
176
|
-
|
|
178
|
+
g(r, t);
|
|
177
179
|
});
|
|
178
180
|
}, k = class e extends Error {
|
|
179
181
|
constructor(t) {
|
|
@@ -349,7 +351,7 @@ function J(e, t) {
|
|
|
349
351
|
return t;
|
|
350
352
|
}, {});
|
|
351
353
|
}
|
|
352
|
-
var je = class extends
|
|
354
|
+
var je = class extends d {
|
|
353
355
|
level;
|
|
354
356
|
constructor(e = { level: U.WARN }) {
|
|
355
357
|
e.objectMode = !0, super(e), this.level = e.level || U.WARN;
|
|
@@ -496,14 +498,14 @@ function He(e, t, n = !1) {
|
|
|
496
498
|
links: [],
|
|
497
499
|
url: ""
|
|
498
500
|
};
|
|
499
|
-
if (typeof e == "string") return r.url = new
|
|
501
|
+
if (typeof e == "string") return r.url = new m(e, t).toString(), r;
|
|
500
502
|
let { url: i, img: a, links: o, video: s, lastmodfile: c, lastmodISO: l, lastmod: u, ...d } = e;
|
|
501
|
-
if (Object.assign(r, d), r.url = new
|
|
503
|
+
if (Object.assign(r, d), r.url = new m(i, t).toString(), a && (r.img = (Array.isArray(a) ? a : [a]).map((e) => typeof e == "string" ? { url: new m(e, t).toString() } : {
|
|
502
504
|
...e,
|
|
503
|
-
url: new
|
|
505
|
+
url: new m(e.url, t).toString()
|
|
504
506
|
})), o && (r.links = o.map((e) => ({
|
|
505
507
|
...e,
|
|
506
|
-
url: new
|
|
508
|
+
url: new m(e.url, t).toString()
|
|
507
509
|
}))), s && (r.video = (Array.isArray(s) ? s : [s]).map((t) => {
|
|
508
510
|
let n = {
|
|
509
511
|
...t,
|
|
@@ -526,7 +528,7 @@ function He(e, t, n = !1) {
|
|
|
526
528
|
} else typeof t.view_count == "number" && (n.view_count = t.view_count);
|
|
527
529
|
return n;
|
|
528
530
|
})), c) {
|
|
529
|
-
let { mtime: e } =
|
|
531
|
+
let { mtime: e } = p(c), t = new Date(e);
|
|
530
532
|
if (Number.isNaN(t.getTime())) throw Error(`Invalid date from file stats for URL "${r.url}": file modification time is invalid`);
|
|
531
533
|
r.lastmod = t.toISOString();
|
|
532
534
|
} else if (l) {
|
|
@@ -563,7 +565,7 @@ var qe = ({ news: e, video: t, image: n, xhtml: r, custom: i }, a) => {
|
|
|
563
565
|
xhtml: !0,
|
|
564
566
|
image: !0,
|
|
565
567
|
video: !0
|
|
566
|
-
}, Xe = { xmlns: Ye }, Ze = class extends
|
|
568
|
+
}, Xe = { xmlns: Ye }, Ze = class extends d {
|
|
567
569
|
hostname;
|
|
568
570
|
level;
|
|
569
571
|
hasHeadOutput;
|
|
@@ -585,19 +587,19 @@ var qe = ({ news: e, video: t, image: n, xhtml: r, custom: i }, a) => {
|
|
|
585
587
|
function Qe(e) {
|
|
586
588
|
return new Promise((t, n) => {
|
|
587
589
|
let r = [];
|
|
588
|
-
e.on("error", n).pipe(new
|
|
590
|
+
e.on("error", n).pipe(new f({ write(e, t, n) {
|
|
589
591
|
r.push(e), n();
|
|
590
592
|
} })).on("error", n).on("finish", () => {
|
|
591
593
|
r.length ? t(Buffer.concat(r)) : n(new ge());
|
|
592
594
|
});
|
|
593
595
|
});
|
|
594
596
|
}
|
|
595
|
-
(/* @__PURE__ */
|
|
596
|
-
(function(
|
|
597
|
-
|
|
598
|
-
return new
|
|
599
|
-
},
|
|
600
|
-
var
|
|
597
|
+
(/* @__PURE__ */ h(((e) => {
|
|
598
|
+
(function(e) {
|
|
599
|
+
e.parser = function(e, t) {
|
|
600
|
+
return new n(e, t);
|
|
601
|
+
}, e.SAXParser = n, e.SAXStream = u, e.createStream = c, e.MAX_BUFFER_LENGTH = 64 * 1024;
|
|
602
|
+
var t = [
|
|
601
603
|
"comment",
|
|
602
604
|
"sgmlDecl",
|
|
603
605
|
"textNode",
|
|
@@ -611,7 +613,7 @@ function Qe(e) {
|
|
|
611
613
|
"cdata",
|
|
612
614
|
"script"
|
|
613
615
|
];
|
|
614
|
-
|
|
616
|
+
e.EVENTS = [
|
|
615
617
|
"text",
|
|
616
618
|
"processinginstruction",
|
|
617
619
|
"sgmldeclaration",
|
|
@@ -631,10 +633,10 @@ function Qe(e) {
|
|
|
631
633
|
"opennamespace",
|
|
632
634
|
"closenamespace"
|
|
633
635
|
];
|
|
634
|
-
function
|
|
635
|
-
if (!(this instanceof
|
|
636
|
-
var
|
|
637
|
-
a
|
|
636
|
+
function n(t, r) {
|
|
637
|
+
if (!(this instanceof n)) return new n(t, r);
|
|
638
|
+
var a = this;
|
|
639
|
+
i(a), a.q = a.c = "", a.bufferCheckPosition = e.MAX_BUFFER_LENGTH, a.encoding = null, a.opt = r || {}, a.opt.lowercase = a.opt.lowercase || a.opt.lowercasetags, a.looseCase = a.opt.lowercase ? "toLowerCase" : "toUpperCase", a.opt.maxEntityCount = a.opt.maxEntityCount || 512, a.opt.maxEntityDepth = a.opt.maxEntityDepth || 4, a.entityCount = a.entityDepth = 0, a.tags = [], a.closed = a.closedRoot = a.sawRoot = !1, a.tag = a.error = null, a.strict = !!t, a.noscript = !!(t || a.opt.noscript), a.state = S.BEGIN, a.strictEntities = a.opt.strictEntities, a.ENTITIES = a.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), a.attribList = [], a.opt.xmlns && (a.ns = Object.create(ee)), a.opt.unquotedAttributeValues === void 0 && (a.opt.unquotedAttributeValues = !t), a.trackPosition = a.opt.position !== !1, a.trackPosition && (a.position = a.line = a.column = 0), w(a, "onready");
|
|
638
640
|
}
|
|
639
641
|
Object.create || (Object.create = function(e) {
|
|
640
642
|
function t() {}
|
|
@@ -644,32 +646,32 @@ function Qe(e) {
|
|
|
644
646
|
for (var n in e) e.hasOwnProperty(n) && t.push(n);
|
|
645
647
|
return t;
|
|
646
648
|
});
|
|
647
|
-
function
|
|
648
|
-
for (var r = Math.max(
|
|
649
|
-
var s =
|
|
650
|
-
if (s > r) switch (
|
|
649
|
+
function r(n) {
|
|
650
|
+
for (var r = Math.max(e.MAX_BUFFER_LENGTH, 10), i = 0, a = 0, o = t.length; a < o; a++) {
|
|
651
|
+
var s = n[t[a]].length;
|
|
652
|
+
if (s > r) switch (t[a]) {
|
|
651
653
|
case "textNode":
|
|
652
|
-
k(
|
|
654
|
+
k(n);
|
|
653
655
|
break;
|
|
654
656
|
case "cdata":
|
|
655
|
-
O(
|
|
657
|
+
O(n, "oncdata", n.cdata), n.cdata = "";
|
|
656
658
|
break;
|
|
657
659
|
case "script":
|
|
658
|
-
O(
|
|
660
|
+
O(n, "onscript", n.script), n.script = "";
|
|
659
661
|
break;
|
|
660
|
-
default: j(
|
|
662
|
+
default: j(n, "Max buffer length exceeded: " + t[a]);
|
|
661
663
|
}
|
|
662
664
|
i = Math.max(i, s);
|
|
663
665
|
}
|
|
664
|
-
|
|
666
|
+
n.bufferCheckPosition = e.MAX_BUFFER_LENGTH - i + n.position;
|
|
665
667
|
}
|
|
666
|
-
function
|
|
667
|
-
for (var
|
|
668
|
+
function i(e) {
|
|
669
|
+
for (var n = 0, r = t.length; n < r; n++) e[t[n]] = "";
|
|
668
670
|
}
|
|
669
|
-
function
|
|
671
|
+
function a(e) {
|
|
670
672
|
k(e), e.cdata !== "" && (O(e, "oncdata", e.cdata), e.cdata = ""), e.script !== "" && (O(e, "onscript", e.script), e.script = "");
|
|
671
673
|
}
|
|
672
|
-
|
|
674
|
+
n.prototype = {
|
|
673
675
|
end: function() {
|
|
674
676
|
M(this);
|
|
675
677
|
},
|
|
@@ -681,66 +683,66 @@ function Qe(e) {
|
|
|
681
683
|
return this.write(null);
|
|
682
684
|
},
|
|
683
685
|
flush: function() {
|
|
684
|
-
|
|
686
|
+
a(this);
|
|
685
687
|
}
|
|
686
688
|
};
|
|
687
|
-
var
|
|
689
|
+
var o;
|
|
688
690
|
try {
|
|
689
|
-
|
|
691
|
+
o = te("stream").Stream;
|
|
690
692
|
} catch {
|
|
691
|
-
|
|
693
|
+
o = function() {};
|
|
692
694
|
}
|
|
693
|
-
|
|
694
|
-
var
|
|
695
|
+
o ||= function() {};
|
|
696
|
+
var s = e.EVENTS.filter(function(e) {
|
|
695
697
|
return e !== "error" && e !== "end";
|
|
696
698
|
});
|
|
697
|
-
function
|
|
698
|
-
return new
|
|
699
|
+
function c(e, t) {
|
|
700
|
+
return new u(e, t);
|
|
699
701
|
}
|
|
700
|
-
function
|
|
702
|
+
function l(e, t) {
|
|
701
703
|
if (e.length >= 2) {
|
|
702
704
|
if (e[0] === 255 && e[1] === 254) return "utf-16le";
|
|
703
705
|
if (e[0] === 254 && e[1] === 255) return "utf-16be";
|
|
704
706
|
}
|
|
705
707
|
return e.length >= 3 && e[0] === 239 && e[1] === 187 && e[2] === 191 ? "utf8" : e.length >= 4 ? e[0] === 60 && e[1] === 0 && e[2] === 63 && e[3] === 0 ? "utf-16le" : e[0] === 0 && e[1] === 60 && e[2] === 0 && e[3] === 63 ? "utf-16be" : "utf8" : t ? "utf8" : null;
|
|
706
708
|
}
|
|
707
|
-
function
|
|
708
|
-
if (!(this instanceof
|
|
709
|
-
|
|
710
|
-
var
|
|
709
|
+
function u(e, t) {
|
|
710
|
+
if (!(this instanceof u)) return new u(e, t);
|
|
711
|
+
o.apply(this), this._parser = new n(e, t), this.writable = !0, this.readable = !0;
|
|
712
|
+
var r = this;
|
|
711
713
|
this._parser.onend = function() {
|
|
712
|
-
|
|
714
|
+
r.emit("end");
|
|
713
715
|
}, this._parser.onerror = function(e) {
|
|
714
|
-
|
|
715
|
-
}, this._decoder = null, this._decoderBuffer = null,
|
|
716
|
-
Object.defineProperty(
|
|
716
|
+
r.emit("error", e), r._parser.error = null;
|
|
717
|
+
}, this._decoder = null, this._decoderBuffer = null, s.forEach(function(e) {
|
|
718
|
+
Object.defineProperty(r, "on" + e, {
|
|
717
719
|
get: function() {
|
|
718
|
-
return
|
|
720
|
+
return r._parser["on" + e];
|
|
719
721
|
},
|
|
720
722
|
set: function(t) {
|
|
721
|
-
if (!t) return
|
|
722
|
-
|
|
723
|
+
if (!t) return r.removeAllListeners(e), r._parser["on" + e] = t, t;
|
|
724
|
+
r.on(e, t);
|
|
723
725
|
},
|
|
724
726
|
enumerable: !0,
|
|
725
727
|
configurable: !1
|
|
726
728
|
});
|
|
727
729
|
});
|
|
728
730
|
}
|
|
729
|
-
|
|
731
|
+
u.prototype = Object.create(o.prototype, { constructor: { value: u } }), u.prototype._decodeBuffer = function(e, t) {
|
|
730
732
|
if (this._decoderBuffer &&= (e = Buffer.concat([this._decoderBuffer, e]), null), !this._decoder) {
|
|
731
|
-
var n =
|
|
733
|
+
var n = l(e, t);
|
|
732
734
|
if (!n) return this._decoderBuffer = e, "";
|
|
733
735
|
this._parser.encoding = n, this._decoder = new TextDecoder(n);
|
|
734
736
|
}
|
|
735
737
|
return this._decoder.decode(e, { stream: !t });
|
|
736
|
-
},
|
|
738
|
+
}, u.prototype.write = function(e) {
|
|
737
739
|
if (typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(e)) e = this._decodeBuffer(e, !1);
|
|
738
740
|
else if (this._decoderBuffer) {
|
|
739
741
|
var t = this._decodeBuffer(Buffer.alloc(0), !0);
|
|
740
742
|
t && (this._parser.write(t), this.emit("data", t));
|
|
741
743
|
}
|
|
742
744
|
return this._parser.write(e.toString()), this.emit("data", e), !0;
|
|
743
|
-
},
|
|
745
|
+
}, u.prototype.end = function(e) {
|
|
744
746
|
if (e && e.length && this.write(e), this._decoderBuffer) {
|
|
745
747
|
var t = this._decodeBuffer(Buffer.alloc(0), !0);
|
|
746
748
|
t && (this._parser.write(t), this.emit("data", t));
|
|
@@ -749,77 +751,77 @@ function Qe(e) {
|
|
|
749
751
|
n && (this._parser.write(n), this.emit("data", n));
|
|
750
752
|
}
|
|
751
753
|
return this._parser.end(), !0;
|
|
752
|
-
},
|
|
754
|
+
}, u.prototype.on = function(e, t) {
|
|
753
755
|
var n = this;
|
|
754
|
-
return !n._parser["on" + e] &&
|
|
756
|
+
return !n._parser["on" + e] && s.indexOf(e) !== -1 && (n._parser["on" + e] = function() {
|
|
755
757
|
var t = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
756
758
|
t.splice(0, 0, e), n.emit.apply(n, t);
|
|
757
|
-
}),
|
|
759
|
+
}), o.prototype.on.call(n, e, t);
|
|
758
760
|
};
|
|
759
|
-
var
|
|
760
|
-
xml:
|
|
761
|
-
xmlns:
|
|
762
|
-
},
|
|
763
|
-
function
|
|
761
|
+
var d = "[CDATA[", f = "DOCTYPE", p = "http://www.w3.org/XML/1998/namespace", m = "http://www.w3.org/2000/xmlns/", ee = {
|
|
762
|
+
xml: p,
|
|
763
|
+
xmlns: m
|
|
764
|
+
}, h = /[:_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]/, g = /[:_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-]/, ne = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, _ = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
765
|
+
function v(e) {
|
|
764
766
|
return e === " " || e === "\n" || e === "\r" || e === " ";
|
|
765
767
|
}
|
|
766
|
-
function
|
|
768
|
+
function y(e) {
|
|
767
769
|
return e === "\"" || e === "'";
|
|
768
770
|
}
|
|
769
|
-
function
|
|
770
|
-
return e === ">" ||
|
|
771
|
+
function re(e) {
|
|
772
|
+
return e === ">" || v(e);
|
|
771
773
|
}
|
|
772
|
-
function
|
|
774
|
+
function b(e, t) {
|
|
773
775
|
return e.test(t);
|
|
774
776
|
}
|
|
775
|
-
function
|
|
776
|
-
return !
|
|
777
|
+
function x(e, t) {
|
|
778
|
+
return !b(e, t);
|
|
777
779
|
}
|
|
778
|
-
var
|
|
779
|
-
for (var
|
|
780
|
-
BEGIN:
|
|
781
|
-
BEGIN_WHITESPACE:
|
|
782
|
-
TEXT:
|
|
783
|
-
TEXT_ENTITY:
|
|
784
|
-
OPEN_WAKA:
|
|
785
|
-
SGML_DECL:
|
|
786
|
-
SGML_DECL_QUOTED:
|
|
787
|
-
DOCTYPE:
|
|
788
|
-
DOCTYPE_QUOTED:
|
|
789
|
-
DOCTYPE_DTD:
|
|
790
|
-
DOCTYPE_DTD_QUOTED:
|
|
791
|
-
COMMENT_STARTING:
|
|
792
|
-
COMMENT:
|
|
793
|
-
COMMENT_ENDING:
|
|
794
|
-
COMMENT_ENDED:
|
|
795
|
-
CDATA:
|
|
796
|
-
CDATA_ENDING:
|
|
797
|
-
CDATA_ENDING_2:
|
|
798
|
-
PROC_INST:
|
|
799
|
-
PROC_INST_BODY:
|
|
800
|
-
PROC_INST_ENDING:
|
|
801
|
-
OPEN_TAG:
|
|
802
|
-
OPEN_TAG_SLASH:
|
|
803
|
-
ATTRIB:
|
|
804
|
-
ATTRIB_NAME:
|
|
805
|
-
ATTRIB_NAME_SAW_WHITE:
|
|
806
|
-
ATTRIB_VALUE:
|
|
807
|
-
ATTRIB_VALUE_QUOTED:
|
|
808
|
-
ATTRIB_VALUE_CLOSED:
|
|
809
|
-
ATTRIB_VALUE_UNQUOTED:
|
|
810
|
-
ATTRIB_VALUE_ENTITY_Q:
|
|
811
|
-
ATTRIB_VALUE_ENTITY_U:
|
|
812
|
-
CLOSE_TAG:
|
|
813
|
-
CLOSE_TAG_SAW_WHITE:
|
|
814
|
-
SCRIPT:
|
|
815
|
-
SCRIPT_ENDING:
|
|
816
|
-
},
|
|
780
|
+
var S = 0;
|
|
781
|
+
for (var C in e.STATE = {
|
|
782
|
+
BEGIN: S++,
|
|
783
|
+
BEGIN_WHITESPACE: S++,
|
|
784
|
+
TEXT: S++,
|
|
785
|
+
TEXT_ENTITY: S++,
|
|
786
|
+
OPEN_WAKA: S++,
|
|
787
|
+
SGML_DECL: S++,
|
|
788
|
+
SGML_DECL_QUOTED: S++,
|
|
789
|
+
DOCTYPE: S++,
|
|
790
|
+
DOCTYPE_QUOTED: S++,
|
|
791
|
+
DOCTYPE_DTD: S++,
|
|
792
|
+
DOCTYPE_DTD_QUOTED: S++,
|
|
793
|
+
COMMENT_STARTING: S++,
|
|
794
|
+
COMMENT: S++,
|
|
795
|
+
COMMENT_ENDING: S++,
|
|
796
|
+
COMMENT_ENDED: S++,
|
|
797
|
+
CDATA: S++,
|
|
798
|
+
CDATA_ENDING: S++,
|
|
799
|
+
CDATA_ENDING_2: S++,
|
|
800
|
+
PROC_INST: S++,
|
|
801
|
+
PROC_INST_BODY: S++,
|
|
802
|
+
PROC_INST_ENDING: S++,
|
|
803
|
+
OPEN_TAG: S++,
|
|
804
|
+
OPEN_TAG_SLASH: S++,
|
|
805
|
+
ATTRIB: S++,
|
|
806
|
+
ATTRIB_NAME: S++,
|
|
807
|
+
ATTRIB_NAME_SAW_WHITE: S++,
|
|
808
|
+
ATTRIB_VALUE: S++,
|
|
809
|
+
ATTRIB_VALUE_QUOTED: S++,
|
|
810
|
+
ATTRIB_VALUE_CLOSED: S++,
|
|
811
|
+
ATTRIB_VALUE_UNQUOTED: S++,
|
|
812
|
+
ATTRIB_VALUE_ENTITY_Q: S++,
|
|
813
|
+
ATTRIB_VALUE_ENTITY_U: S++,
|
|
814
|
+
CLOSE_TAG: S++,
|
|
815
|
+
CLOSE_TAG_SAW_WHITE: S++,
|
|
816
|
+
SCRIPT: S++,
|
|
817
|
+
SCRIPT_ENDING: S++
|
|
818
|
+
}, e.XML_ENTITIES = {
|
|
817
819
|
amp: "&",
|
|
818
820
|
gt: ">",
|
|
819
821
|
lt: "<",
|
|
820
822
|
quot: "\"",
|
|
821
823
|
apos: "'"
|
|
822
|
-
},
|
|
824
|
+
}, e.ENTITIES = {
|
|
823
825
|
amp: "&",
|
|
824
826
|
gt: ">",
|
|
825
827
|
lt: "<",
|
|
@@ -1073,11 +1075,11 @@ function Qe(e) {
|
|
|
1073
1075
|
clubs: 9827,
|
|
1074
1076
|
hearts: 9829,
|
|
1075
1077
|
diams: 9830
|
|
1076
|
-
}, Object.keys(
|
|
1077
|
-
var n =
|
|
1078
|
-
|
|
1079
|
-
}),
|
|
1080
|
-
|
|
1078
|
+
}, Object.keys(e.ENTITIES).forEach(function(t) {
|
|
1079
|
+
var n = e.ENTITIES[t], r = typeof n == "number" ? String.fromCharCode(n) : n;
|
|
1080
|
+
e.ENTITIES[t] = r;
|
|
1081
|
+
}), e.STATE) e.STATE[e.STATE[C]] = C;
|
|
1082
|
+
S = e.STATE;
|
|
1081
1083
|
function w(e, t, n) {
|
|
1082
1084
|
e[t] && e[t](n);
|
|
1083
1085
|
}
|
|
@@ -1111,10 +1113,10 @@ function Qe(e) {
|
|
|
1111
1113
|
return k(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = Error(t), e.error = t, w(e, "onerror", t), e;
|
|
1112
1114
|
}
|
|
1113
1115
|
function M(e) {
|
|
1114
|
-
return e.sawRoot && !e.closedRoot && N(e, "Unclosed root tag"), e.state !==
|
|
1116
|
+
return e.sawRoot && !e.closedRoot && N(e, "Unclosed root tag"), e.state !== S.BEGIN && e.state !== S.BEGIN_WHITESPACE && e.state !== S.TEXT && j(e, "Unexpected end"), k(e), e.c = "", e.closed = !0, w(e, "onend"), n.call(e, e.strict, e.opt), e;
|
|
1115
1117
|
}
|
|
1116
1118
|
function N(e, t) {
|
|
1117
|
-
if (typeof e != "object" || !(e instanceof
|
|
1119
|
+
if (typeof e != "object" || !(e instanceof n)) throw Error("bad call to strictFail");
|
|
1118
1120
|
e.strict && j(e, t);
|
|
1119
1121
|
}
|
|
1120
1122
|
function ae(e) {
|
|
@@ -1139,8 +1141,8 @@ function Qe(e) {
|
|
|
1139
1141
|
}
|
|
1140
1142
|
if (e.opt.xmlns) {
|
|
1141
1143
|
var t = P(e.attribName, !0), n = t.prefix, r = t.local;
|
|
1142
|
-
if (n === "xmlns") if (r === "xml" && e.attribValue !==
|
|
1143
|
-
else if (r === "xmlns" && e.attribValue !==
|
|
1144
|
+
if (n === "xmlns") if (r === "xml" && e.attribValue !== p) N(e, "xml: prefix must be bound to " + p + "\nActual: " + e.attribValue);
|
|
1145
|
+
else if (r === "xmlns" && e.attribValue !== m) N(e, "xmlns: prefix must be bound to " + m + "\nActual: " + e.attribValue);
|
|
1144
1146
|
else {
|
|
1145
1147
|
var i = e.tag, a = e.tags[e.tags.length - 1] || e;
|
|
1146
1148
|
i.ns === a.ns && (i.ns = Object.create(a.ns)), i.ns[r] = e.attribValue;
|
|
@@ -1175,16 +1177,16 @@ function Qe(e) {
|
|
|
1175
1177
|
}
|
|
1176
1178
|
e.attribList.length = 0;
|
|
1177
1179
|
}
|
|
1178
|
-
e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), O(e, "onopentag", e.tag), t || (!e.noscript && e.tagName.toLowerCase() === "script" ? e.state =
|
|
1180
|
+
e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), O(e, "onopentag", e.tag), t || (!e.noscript && e.tagName.toLowerCase() === "script" ? e.state = S.SCRIPT : e.state = S.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
|
|
1179
1181
|
}
|
|
1180
1182
|
function L(e) {
|
|
1181
1183
|
if (!e.tagName) {
|
|
1182
|
-
N(e, "Weird empty close tag."), e.textNode += "</>", e.state =
|
|
1184
|
+
N(e, "Weird empty close tag."), e.textNode += "</>", e.state = S.TEXT;
|
|
1183
1185
|
return;
|
|
1184
1186
|
}
|
|
1185
1187
|
if (e.script) {
|
|
1186
1188
|
if (e.tagName !== "script") {
|
|
1187
|
-
e.script += "</" + e.tagName + ">", e.tagName = "", e.state =
|
|
1189
|
+
e.script += "</" + e.tagName + ">", e.tagName = "", e.state = S.SCRIPT;
|
|
1188
1190
|
return;
|
|
1189
1191
|
}
|
|
1190
1192
|
O(e, "onscript", e.script), e.script = "";
|
|
@@ -1193,7 +1195,7 @@ function Qe(e) {
|
|
|
1193
1195
|
e.strict || (n = n[e.looseCase]());
|
|
1194
1196
|
for (var r = n; t-- && e.tags[t].name !== r;) N(e, "Unexpected close tag");
|
|
1195
1197
|
if (t < 0) {
|
|
1196
|
-
N(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", e.state =
|
|
1198
|
+
N(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", e.state = S.TEXT;
|
|
1197
1199
|
return;
|
|
1198
1200
|
}
|
|
1199
1201
|
e.tagName = n;
|
|
@@ -1211,192 +1213,192 @@ function Qe(e) {
|
|
|
1211
1213
|
});
|
|
1212
1214
|
});
|
|
1213
1215
|
}
|
|
1214
|
-
t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state =
|
|
1216
|
+
t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = S.TEXT;
|
|
1215
1217
|
}
|
|
1216
1218
|
function oe(e) {
|
|
1217
1219
|
var t = e.entity, n = t.toLowerCase(), r, i = "";
|
|
1218
1220
|
return e.ENTITIES[t] ? e.ENTITIES[t] : e.ENTITIES[n] ? e.ENTITIES[n] : (t = n, t.charAt(0) === "#" && (t.charAt(1) === "x" ? (t = t.slice(2), r = parseInt(t, 16), i = r.toString(16)) : (t = t.slice(1), r = parseInt(t, 10), i = r.toString(10))), t = t.replace(/^0+/, ""), isNaN(r) || i.toLowerCase() !== t || r < 0 || r > 1114111 ? (N(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(r));
|
|
1219
1221
|
}
|
|
1220
1222
|
function R(e, t) {
|
|
1221
|
-
t === "<" ? (e.state =
|
|
1223
|
+
t === "<" ? (e.state = S.OPEN_WAKA, e.startTagPosition = e.position) : v(t) || (N(e, "Non-whitespace before first tag."), e.textNode = t, e.state = S.TEXT);
|
|
1222
1224
|
}
|
|
1223
1225
|
function z(e, t) {
|
|
1224
1226
|
var n = "";
|
|
1225
1227
|
return t < e.length && (n = e.charAt(t)), n;
|
|
1226
1228
|
}
|
|
1227
|
-
function se(
|
|
1229
|
+
function se(t) {
|
|
1228
1230
|
var n = this;
|
|
1229
1231
|
if (this.error) throw this.error;
|
|
1230
1232
|
if (n.closed) return j(n, "Cannot write after close. Assign an onready handler.");
|
|
1231
|
-
if (
|
|
1232
|
-
typeof
|
|
1233
|
-
for (var
|
|
1234
|
-
case
|
|
1235
|
-
if (n.state =
|
|
1233
|
+
if (t === null) return M(n);
|
|
1234
|
+
typeof t == "object" && (t = t.toString());
|
|
1235
|
+
for (var i = 0, a = ""; a = z(t, i++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
|
|
1236
|
+
case S.BEGIN:
|
|
1237
|
+
if (n.state = S.BEGIN_WHITESPACE, a === "") continue;
|
|
1236
1238
|
R(n, a);
|
|
1237
1239
|
continue;
|
|
1238
|
-
case
|
|
1240
|
+
case S.BEGIN_WHITESPACE:
|
|
1239
1241
|
R(n, a);
|
|
1240
1242
|
continue;
|
|
1241
|
-
case
|
|
1243
|
+
case S.TEXT:
|
|
1242
1244
|
if (n.sawRoot && !n.closedRoot) {
|
|
1243
|
-
for (var o =
|
|
1244
|
-
n.textNode +=
|
|
1245
|
+
for (var o = i - 1; a && a !== "<" && a !== "&";) a = z(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
|
|
1246
|
+
n.textNode += t.substring(o, i - 1);
|
|
1245
1247
|
}
|
|
1246
|
-
a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state =
|
|
1248
|
+
a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = S.OPEN_WAKA, n.startTagPosition = n.position) : (!v(a) && (!n.sawRoot || n.closedRoot) && N(n, "Text data outside of root node."), a === "&" ? n.state = S.TEXT_ENTITY : n.textNode += a);
|
|
1247
1249
|
continue;
|
|
1248
|
-
case
|
|
1249
|
-
a === "<" ? n.state =
|
|
1250
|
+
case S.SCRIPT:
|
|
1251
|
+
a === "<" ? n.state = S.SCRIPT_ENDING : n.script += a;
|
|
1250
1252
|
continue;
|
|
1251
|
-
case
|
|
1252
|
-
a === "/" ? n.state =
|
|
1253
|
+
case S.SCRIPT_ENDING:
|
|
1254
|
+
a === "/" ? n.state = S.CLOSE_TAG : (n.script += "<" + a, n.state = S.SCRIPT);
|
|
1253
1255
|
continue;
|
|
1254
|
-
case
|
|
1255
|
-
if (a === "!") n.state =
|
|
1256
|
-
else if (!
|
|
1257
|
-
else if (a === "/") n.state =
|
|
1258
|
-
else if (a === "?") n.state =
|
|
1256
|
+
case S.OPEN_WAKA:
|
|
1257
|
+
if (a === "!") n.state = S.SGML_DECL, n.sgmlDecl = "";
|
|
1258
|
+
else if (!v(a)) if (b(h, a)) n.state = S.OPEN_TAG, n.tagName = a;
|
|
1259
|
+
else if (a === "/") n.state = S.CLOSE_TAG, n.tagName = "";
|
|
1260
|
+
else if (a === "?") n.state = S.PROC_INST, n.procInstName = n.procInstBody = "";
|
|
1259
1261
|
else {
|
|
1260
1262
|
if (N(n, "Unencoded <"), n.startTagPosition + 1 < n.position) {
|
|
1261
1263
|
var s = n.position - n.startTagPosition;
|
|
1262
1264
|
a = Array(s).join(" ") + a;
|
|
1263
1265
|
}
|
|
1264
|
-
n.textNode += "<" + a, n.state =
|
|
1266
|
+
n.textNode += "<" + a, n.state = S.TEXT;
|
|
1265
1267
|
}
|
|
1266
1268
|
continue;
|
|
1267
|
-
case
|
|
1269
|
+
case S.SGML_DECL:
|
|
1268
1270
|
if (n.sgmlDecl + a === "--") {
|
|
1269
|
-
n.state =
|
|
1271
|
+
n.state = S.COMMENT, n.comment = "", n.sgmlDecl = "";
|
|
1270
1272
|
continue;
|
|
1271
1273
|
}
|
|
1272
|
-
n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state =
|
|
1274
|
+
n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = S.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === d ? (O(n, "onopencdata"), n.state = S.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + a).toUpperCase() === f ? (n.state = S.DOCTYPE, (n.doctype || n.sawRoot) && N(n, "Inappropriately located doctype declaration"), n.doctype = "", n.sgmlDecl = "") : a === ">" ? (O(n, "onsgmldeclaration", n.sgmlDecl), n.sgmlDecl = "", n.state = S.TEXT) : (y(a) && (n.state = S.SGML_DECL_QUOTED), n.sgmlDecl += a);
|
|
1273
1275
|
continue;
|
|
1274
|
-
case
|
|
1275
|
-
a === n.q && (n.state =
|
|
1276
|
+
case S.SGML_DECL_QUOTED:
|
|
1277
|
+
a === n.q && (n.state = S.SGML_DECL, n.q = ""), n.sgmlDecl += a;
|
|
1276
1278
|
continue;
|
|
1277
|
-
case
|
|
1278
|
-
a === ">" ? (n.state =
|
|
1279
|
+
case S.DOCTYPE:
|
|
1280
|
+
a === ">" ? (n.state = S.TEXT, O(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += a, a === "[" ? n.state = S.DOCTYPE_DTD : y(a) && (n.state = S.DOCTYPE_QUOTED, n.q = a));
|
|
1279
1281
|
continue;
|
|
1280
|
-
case
|
|
1281
|
-
n.doctype += a, a === n.q && (n.q = "", n.state =
|
|
1282
|
+
case S.DOCTYPE_QUOTED:
|
|
1283
|
+
n.doctype += a, a === n.q && (n.q = "", n.state = S.DOCTYPE);
|
|
1282
1284
|
continue;
|
|
1283
|
-
case
|
|
1284
|
-
a === "]" ? (n.doctype += a, n.state =
|
|
1285
|
+
case S.DOCTYPE_DTD:
|
|
1286
|
+
a === "]" ? (n.doctype += a, n.state = S.DOCTYPE) : a === "<" ? (n.state = S.OPEN_WAKA, n.startTagPosition = n.position) : y(a) ? (n.doctype += a, n.state = S.DOCTYPE_DTD_QUOTED, n.q = a) : n.doctype += a;
|
|
1285
1287
|
continue;
|
|
1286
|
-
case
|
|
1287
|
-
n.doctype += a, a === n.q && (n.state =
|
|
1288
|
+
case S.DOCTYPE_DTD_QUOTED:
|
|
1289
|
+
n.doctype += a, a === n.q && (n.state = S.DOCTYPE_DTD, n.q = "");
|
|
1288
1290
|
continue;
|
|
1289
|
-
case
|
|
1290
|
-
a === "-" ? n.state =
|
|
1291
|
+
case S.COMMENT:
|
|
1292
|
+
a === "-" ? n.state = S.COMMENT_ENDING : n.comment += a;
|
|
1291
1293
|
continue;
|
|
1292
|
-
case
|
|
1293
|
-
a === "-" ? (n.state =
|
|
1294
|
+
case S.COMMENT_ENDING:
|
|
1295
|
+
a === "-" ? (n.state = S.COMMENT_ENDED, n.comment = A(n.opt, n.comment), n.comment && O(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + a, n.state = S.COMMENT);
|
|
1294
1296
|
continue;
|
|
1295
|
-
case
|
|
1296
|
-
a === ">" ? n.doctype && n.doctype !== !0 ? n.state =
|
|
1297
|
+
case S.COMMENT_ENDED:
|
|
1298
|
+
a === ">" ? n.doctype && n.doctype !== !0 ? n.state = S.DOCTYPE_DTD : n.state = S.TEXT : (N(n, "Malformed comment"), n.comment += "--" + a, n.state = S.COMMENT);
|
|
1297
1299
|
continue;
|
|
1298
|
-
case
|
|
1299
|
-
for (var o =
|
|
1300
|
-
n.cdata +=
|
|
1300
|
+
case S.CDATA:
|
|
1301
|
+
for (var o = i - 1; a && a !== "]";) a = z(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
|
|
1302
|
+
n.cdata += t.substring(o, i - 1), a === "]" && (n.state = S.CDATA_ENDING);
|
|
1301
1303
|
continue;
|
|
1302
|
-
case
|
|
1303
|
-
a === "]" ? n.state =
|
|
1304
|
+
case S.CDATA_ENDING:
|
|
1305
|
+
a === "]" ? n.state = S.CDATA_ENDING_2 : (n.cdata += "]" + a, n.state = S.CDATA);
|
|
1304
1306
|
continue;
|
|
1305
|
-
case
|
|
1306
|
-
a === ">" ? (n.cdata && O(n, "oncdata", n.cdata), O(n, "onclosecdata"), n.cdata = "", n.state =
|
|
1307
|
+
case S.CDATA_ENDING_2:
|
|
1308
|
+
a === ">" ? (n.cdata && O(n, "oncdata", n.cdata), O(n, "onclosecdata"), n.cdata = "", n.state = S.TEXT) : a === "]" ? n.cdata += "]" : (n.cdata += "]]" + a, n.state = S.CDATA);
|
|
1307
1309
|
continue;
|
|
1308
|
-
case
|
|
1309
|
-
a === "?" ? n.state =
|
|
1310
|
+
case S.PROC_INST:
|
|
1311
|
+
a === "?" ? n.state = S.PROC_INST_ENDING : v(a) ? n.state = S.PROC_INST_BODY : n.procInstName += a;
|
|
1310
1312
|
continue;
|
|
1311
|
-
case
|
|
1312
|
-
if (!n.procInstBody &&
|
|
1313
|
-
a === "?" ? n.state =
|
|
1313
|
+
case S.PROC_INST_BODY:
|
|
1314
|
+
if (!n.procInstBody && v(a)) continue;
|
|
1315
|
+
a === "?" ? n.state = S.PROC_INST_ENDING : n.procInstBody += a;
|
|
1314
1316
|
continue;
|
|
1315
|
-
case
|
|
1317
|
+
case S.PROC_INST_ENDING:
|
|
1316
1318
|
if (a === ">") {
|
|
1317
1319
|
let e = {
|
|
1318
1320
|
name: n.procInstName,
|
|
1319
1321
|
body: n.procInstBody
|
|
1320
1322
|
};
|
|
1321
|
-
ie(n, e), O(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state =
|
|
1322
|
-
} else n.procInstBody += "?" + a, n.state =
|
|
1323
|
+
ie(n, e), O(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state = S.TEXT;
|
|
1324
|
+
} else n.procInstBody += "?" + a, n.state = S.PROC_INST_BODY;
|
|
1323
1325
|
continue;
|
|
1324
|
-
case
|
|
1325
|
-
|
|
1326
|
+
case S.OPEN_TAG:
|
|
1327
|
+
b(g, a) ? n.tagName += a : (ae(n), a === ">" ? I(n) : a === "/" ? n.state = S.OPEN_TAG_SLASH : (v(a) || N(n, "Invalid character in tag name"), n.state = S.ATTRIB));
|
|
1326
1328
|
continue;
|
|
1327
|
-
case
|
|
1328
|
-
a === ">" ? (I(n, !0), L(n)) : (N(n, "Forward-slash in opening tag not followed by >"), n.state =
|
|
1329
|
+
case S.OPEN_TAG_SLASH:
|
|
1330
|
+
a === ">" ? (I(n, !0), L(n)) : (N(n, "Forward-slash in opening tag not followed by >"), n.state = S.ATTRIB);
|
|
1329
1331
|
continue;
|
|
1330
|
-
case
|
|
1331
|
-
if (
|
|
1332
|
-
a === ">" ? I(n) : a === "/" ? n.state =
|
|
1332
|
+
case S.ATTRIB:
|
|
1333
|
+
if (v(a)) continue;
|
|
1334
|
+
a === ">" ? I(n) : a === "/" ? n.state = S.OPEN_TAG_SLASH : b(h, a) ? (n.attribName = a, n.attribValue = "", n.state = S.ATTRIB_NAME) : N(n, "Invalid attribute name");
|
|
1333
1335
|
continue;
|
|
1334
|
-
case
|
|
1335
|
-
a === "=" ? n.state =
|
|
1336
|
+
case S.ATTRIB_NAME:
|
|
1337
|
+
a === "=" ? n.state = S.ATTRIB_VALUE : a === ">" ? (N(n, "Attribute without value"), n.attribValue = n.attribName, F(n), I(n)) : v(a) ? n.state = S.ATTRIB_NAME_SAW_WHITE : b(g, a) ? n.attribName += a : N(n, "Invalid attribute name");
|
|
1336
1338
|
continue;
|
|
1337
|
-
case
|
|
1338
|
-
if (a === "=") n.state =
|
|
1339
|
-
else if (
|
|
1339
|
+
case S.ATTRIB_NAME_SAW_WHITE:
|
|
1340
|
+
if (a === "=") n.state = S.ATTRIB_VALUE;
|
|
1341
|
+
else if (v(a)) continue;
|
|
1340
1342
|
else N(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", O(n, "onattribute", {
|
|
1341
1343
|
name: n.attribName,
|
|
1342
1344
|
value: ""
|
|
1343
|
-
}), n.attribName = "", a === ">" ? I(n) :
|
|
1345
|
+
}), n.attribName = "", a === ">" ? I(n) : b(h, a) ? (n.attribName = a, n.state = S.ATTRIB_NAME) : (N(n, "Invalid attribute name"), n.state = S.ATTRIB);
|
|
1344
1346
|
continue;
|
|
1345
|
-
case
|
|
1346
|
-
if (
|
|
1347
|
-
|
|
1347
|
+
case S.ATTRIB_VALUE:
|
|
1348
|
+
if (v(a)) continue;
|
|
1349
|
+
y(a) ? (n.q = a, n.state = S.ATTRIB_VALUE_QUOTED) : (n.opt.unquotedAttributeValues || j(n, "Unquoted attribute value"), n.state = S.ATTRIB_VALUE_UNQUOTED, n.attribValue = a);
|
|
1348
1350
|
continue;
|
|
1349
|
-
case
|
|
1351
|
+
case S.ATTRIB_VALUE_QUOTED:
|
|
1350
1352
|
if (a !== n.q) {
|
|
1351
|
-
a === "&" ? n.state =
|
|
1353
|
+
a === "&" ? n.state = S.ATTRIB_VALUE_ENTITY_Q : n.attribValue += a;
|
|
1352
1354
|
continue;
|
|
1353
1355
|
}
|
|
1354
|
-
F(n), n.q = "", n.state =
|
|
1356
|
+
F(n), n.q = "", n.state = S.ATTRIB_VALUE_CLOSED;
|
|
1355
1357
|
continue;
|
|
1356
|
-
case
|
|
1357
|
-
|
|
1358
|
+
case S.ATTRIB_VALUE_CLOSED:
|
|
1359
|
+
v(a) ? n.state = S.ATTRIB : a === ">" ? I(n) : a === "/" ? n.state = S.OPEN_TAG_SLASH : b(h, a) ? (N(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = S.ATTRIB_NAME) : N(n, "Invalid attribute name");
|
|
1358
1360
|
continue;
|
|
1359
|
-
case
|
|
1360
|
-
if (!
|
|
1361
|
-
a === "&" ? n.state =
|
|
1361
|
+
case S.ATTRIB_VALUE_UNQUOTED:
|
|
1362
|
+
if (!re(a)) {
|
|
1363
|
+
a === "&" ? n.state = S.ATTRIB_VALUE_ENTITY_U : n.attribValue += a;
|
|
1362
1364
|
continue;
|
|
1363
1365
|
}
|
|
1364
|
-
F(n), a === ">" ? I(n) : n.state =
|
|
1366
|
+
F(n), a === ">" ? I(n) : n.state = S.ATTRIB;
|
|
1365
1367
|
continue;
|
|
1366
|
-
case
|
|
1367
|
-
if (n.tagName) a === ">" ? L(n) :
|
|
1368
|
+
case S.CLOSE_TAG:
|
|
1369
|
+
if (n.tagName) a === ">" ? L(n) : b(g, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = S.SCRIPT) : (v(a) || N(n, "Invalid tagname in closing tag"), n.state = S.CLOSE_TAG_SAW_WHITE);
|
|
1368
1370
|
else {
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1371
|
+
if (v(a)) continue;
|
|
1372
|
+
x(h, a) ? n.script ? (n.script += "</" + a, n.state = S.SCRIPT) : N(n, "Invalid tagname in closing tag.") : n.tagName = a;
|
|
1371
1373
|
}
|
|
1372
1374
|
continue;
|
|
1373
|
-
case
|
|
1374
|
-
if (
|
|
1375
|
+
case S.CLOSE_TAG_SAW_WHITE:
|
|
1376
|
+
if (v(a)) continue;
|
|
1375
1377
|
a === ">" ? L(n) : N(n, "Invalid characters in closing tag");
|
|
1376
1378
|
continue;
|
|
1377
|
-
case
|
|
1378
|
-
case
|
|
1379
|
-
case
|
|
1379
|
+
case S.TEXT_ENTITY:
|
|
1380
|
+
case S.ATTRIB_VALUE_ENTITY_Q:
|
|
1381
|
+
case S.ATTRIB_VALUE_ENTITY_U:
|
|
1380
1382
|
var c, l;
|
|
1381
1383
|
switch (n.state) {
|
|
1382
|
-
case
|
|
1383
|
-
c =
|
|
1384
|
+
case S.TEXT_ENTITY:
|
|
1385
|
+
c = S.TEXT, l = "textNode";
|
|
1384
1386
|
break;
|
|
1385
|
-
case
|
|
1386
|
-
c =
|
|
1387
|
+
case S.ATTRIB_VALUE_ENTITY_Q:
|
|
1388
|
+
c = S.ATTRIB_VALUE_QUOTED, l = "attribValue";
|
|
1387
1389
|
break;
|
|
1388
|
-
case
|
|
1389
|
-
c =
|
|
1390
|
+
case S.ATTRIB_VALUE_ENTITY_U:
|
|
1391
|
+
c = S.ATTRIB_VALUE_UNQUOTED, l = "attribValue";
|
|
1390
1392
|
break;
|
|
1391
1393
|
}
|
|
1392
1394
|
if (a === ";") {
|
|
1393
1395
|
var u = oe(n);
|
|
1394
|
-
n.opt.unparsedEntities && !Object.values(
|
|
1395
|
-
} else
|
|
1396
|
+
n.opt.unparsedEntities && !Object.values(e.XML_ENTITIES).includes(u) ? ((n.entityCount += 1) > n.opt.maxEntityCount && j(n, "Parsed entity count exceeds max entity count"), (n.entityDepth += 1) > n.opt.maxEntityDepth && j(n, "Parsed entity depth exceeds max entity depth"), n.entity = "", n.state = c, n.write(u), --n.entityDepth) : (n[l] += u, n.entity = "", n.state = c);
|
|
1397
|
+
} else b(n.entity.length ? _ : ne, a) ? n.entity += a : (N(n, "Invalid character in entity name"), n[l] += "&" + n.entity + a, n.entity = "", n.state = c);
|
|
1396
1398
|
continue;
|
|
1397
1399
|
default: throw Error(n, "Unknown state: " + n.state);
|
|
1398
1400
|
}
|
|
1399
|
-
return n.position >= n.bufferCheckPosition &&
|
|
1401
|
+
return n.position >= n.bufferCheckPosition && r(n), n;
|
|
1400
1402
|
}
|
|
1401
1403
|
/* istanbul ignore next */
|
|
1402
1404
|
String.fromCodePoint || (function() {
|
|
@@ -1417,7 +1419,7 @@ function Qe(e) {
|
|
|
1417
1419
|
writable: !0
|
|
1418
1420
|
}) : String.fromCodePoint = n;
|
|
1419
1421
|
})();
|
|
1420
|
-
})(
|
|
1422
|
+
})(e === void 0 ? e.sax = {} : e);
|
|
1421
1423
|
})))();
|
|
1422
1424
|
//#endregion
|
|
1423
1425
|
//#region src/Config/Sitemap.ts
|
|
@@ -1428,7 +1430,7 @@ var $e = (e, t) => {
|
|
|
1428
1430
|
"User-agent: *",
|
|
1429
1431
|
"Disallow:"
|
|
1430
1432
|
];
|
|
1431
|
-
t.filename = "robots.txt",
|
|
1433
|
+
t.filename = "robots.txt", g(n.join("\r\n"), t);
|
|
1432
1434
|
}, et = async (e, t, n, r) => {
|
|
1433
1435
|
let i = new Ze({
|
|
1434
1436
|
hostname: e,
|
|
@@ -1441,7 +1443,7 @@ var $e = (e, t) => {
|
|
|
1441
1443
|
custom: ["xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"", "xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\""]
|
|
1442
1444
|
}
|
|
1443
1445
|
});
|
|
1444
|
-
|
|
1446
|
+
g(await Qe(ee.from(t).pipe(i)).then((e) => e.toString()), r), n && $e(e, r);
|
|
1445
1447
|
}, tt = async (e, t) => {
|
|
1446
1448
|
let n = await D(e, t.spreadsheetId, t.spreadsheetTab);
|
|
1447
1449
|
if (!n || n.length === 0) {
|
|
@@ -1455,7 +1457,7 @@ var $e = (e, t) => {
|
|
|
1455
1457
|
console.log("No data found.");
|
|
1456
1458
|
return;
|
|
1457
1459
|
}
|
|
1458
|
-
ne(
|
|
1460
|
+
re(ne(n), t.output);
|
|
1459
1461
|
}, rt = (e) => {
|
|
1460
1462
|
try {
|
|
1461
1463
|
tt(E(), e);
|
|
@@ -1486,6 +1488,6 @@ var $e = (e, t) => {
|
|
|
1486
1488
|
return null;
|
|
1487
1489
|
};
|
|
1488
1490
|
//#endregion
|
|
1489
|
-
export { et as a, ot as i, it as n,
|
|
1491
|
+
export { et as a, ot as i, it as n, C as o, rt as r, S as s, at as t };
|
|
1490
1492
|
|
|
1491
|
-
//# sourceMappingURL=config-cli-
|
|
1493
|
+
//# sourceMappingURL=config-cli-CY_z5CYp.js.map
|