@andre1502/react-utilities 1.0.5 → 1.0.7
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 +35 -51
- package/dist/Config/Config.d.ts +12 -1
- package/dist/EnvironmentEnum-CXTWJxNo.js +10 -0
- package/dist/EnvironmentEnum-CXTWJxNo.js.map +1 -0
- package/dist/Utils-CJ7ureSW.js +14 -0
- package/dist/Utils-CJ7ureSW.js.map +1 -0
- package/dist/browser-ponyfill-C-HVh7ck.js +321 -0
- package/dist/browser-ponyfill-C-HVh7ck.js.map +1 -0
- package/dist/chunk-vKJrgz-R.js +16 -0
- package/dist/config-cli-BIF4xuoO.js +1491 -0
- package/dist/config-cli-BIF4xuoO.js.map +1 -0
- package/dist/config-cli.d.ts +1 -1
- package/dist/config-cli.js +3 -222
- package/dist/enums/CurrencySymbolEnum.d.ts +6 -5
- package/dist/enums/DeviceEnum.d.ts +5 -4
- package/dist/enums/EnvironmentEnum.d.ts +6 -5
- package/dist/format-BgweN3o5.js +65549 -0
- package/dist/format-BgweN3o5.js.map +1 -0
- package/dist/format.d.ts +26 -26
- package/dist/format.js +2 -55
- package/dist/hooks-oAipbPQ2.js +78 -0
- package/dist/hooks-oAipbPQ2.js.map +1 -0
- package/dist/hooks.js +2 -86
- package/dist/i18n-D1jKJPI0.js +1941 -0
- package/dist/i18n-D1jKJPI0.js.map +1 -0
- package/dist/i18n.js +4 -28
- package/dist/index-cli.d.ts +0 -1
- package/dist/index-cli.js +3 -28
- package/dist/index-rn.js +6 -39
- package/dist/index.js +7 -61
- package/dist/interfaces/Config/EntryOptions.d.ts +4 -0
- package/dist/sentry-rn-DZwIel7y.js +743 -0
- package/dist/sentry-rn-DZwIel7y.js.map +1 -0
- package/dist/sentry-rn.js +2 -28
- package/dist/sentry.js +39 -26
- package/dist/sentry.js.map +1 -1
- package/dist/utils.js +45 -37
- package/dist/utils.js.map +1 -1
- package/package.json +56 -86
- package/src/Config/Config.ts +48 -1
- package/src/Config/GoogleAuth.ts +1 -1
- package/src/Sentry/React.ts +2 -4
- package/src/Sentry/ReactNative.ts +2 -4
- package/src/config-cli.ts +1 -1
- package/src/enums/CurrencySymbolEnum.ts +8 -5
- package/src/enums/DeviceEnum.ts +6 -4
- package/src/enums/EnvironmentEnum.ts +8 -5
- package/src/format.ts +32 -32
- package/src/index-cli.ts +0 -1
- package/src/interfaces/Config/EntryOptions.ts +4 -0
- package/dist/Config/Config.js +0 -216
- package/dist/Config/Config.js.map +0 -1
- package/dist/Config/GoogleAuth.js +0 -68
- package/dist/Config/GoogleAuth.js.map +0 -1
- package/dist/Config/Locales.js +0 -62
- package/dist/Config/Locales.js.map +0 -1
- package/dist/Config/Output.js +0 -36
- package/dist/Config/Output.js.map +0 -1
- package/dist/Config/Sitemap.js +0 -72
- package/dist/Config/Sitemap.js.map +0 -1
- package/dist/EnvironmentEnum-BjXsfSRZ.js +0 -9
- package/dist/EnvironmentEnum-BjXsfSRZ.js.map +0 -1
- package/dist/EnvironmentEnum-UcQ6Il1O.js +0 -9
- package/dist/EnvironmentEnum-UcQ6Il1O.js.map +0 -1
- package/dist/Format/NumberFormat.js +0 -77
- package/dist/Format/NumberFormat.js.map +0 -1
- package/dist/Format/NumberParser.js +0 -51
- package/dist/Format/NumberParser.js.map +0 -1
- package/dist/Hooks/useDevice.js +0 -47
- package/dist/Hooks/useDevice.js.map +0 -1
- package/dist/Hooks/useSound.js +0 -47
- package/dist/Hooks/useSound.js.map +0 -1
- package/dist/Hooks/useWebSocket.js +0 -120
- package/dist/Hooks/useWebSocket.js.map +0 -1
- package/dist/I18n/I18n.js +0 -134
- package/dist/I18n/I18n.js.map +0 -1
- package/dist/NumberFormat-CvvBWhHc.js +0 -89
- package/dist/NumberFormat-CvvBWhHc.js.map +0 -1
- package/dist/NumberFormat-glmpbk7E.js +0 -94
- package/dist/NumberFormat-glmpbk7E.js.map +0 -1
- package/dist/React-BaJ1KfGF.js +0 -87
- package/dist/React-BaJ1KfGF.js.map +0 -1
- package/dist/React-qUl0CBmE.js +0 -109
- package/dist/React-qUl0CBmE.js.map +0 -1
- package/dist/ReactNative-B4gt8nBr.js +0 -1790
- package/dist/ReactNative-B4gt8nBr.js.map +0 -1
- package/dist/ReactNative-CDMfQFfN.js +0 -1812
- package/dist/ReactNative-CDMfQFfN.js.map +0 -1
- package/dist/Sentry/Build.d.ts +0 -9
- package/dist/Sentry/Build.js +0 -87
- package/dist/Sentry/Build.js.map +0 -1
- package/dist/Sentry/React.js +0 -103
- package/dist/Sentry/React.js.map +0 -1
- package/dist/Sentry/ReactNative.js +0 -113
- package/dist/Sentry/ReactNative.js.map +0 -1
- package/dist/Sentry/Utils.js +0 -24
- package/dist/Sentry/Utils.js.map +0 -1
- package/dist/Utils/Array.js +0 -26
- package/dist/Utils/Array.js.map +0 -1
- package/dist/Utils/Files.js +0 -51
- package/dist/Utils/Files.js.map +0 -1
- package/dist/Utils/Pagination.js +0 -32
- package/dist/Utils/Pagination.js.map +0 -1
- package/dist/Utils/Utils.js +0 -101
- package/dist/Utils/Utils.js.map +0 -1
- package/dist/Utils-BC1fDy39.js +0 -74
- package/dist/Utils-BC1fDy39.js.map +0 -1
- package/dist/Utils-Cq948gfa.js +0 -20
- package/dist/Utils-Cq948gfa.js.map +0 -1
- package/dist/Utils-D7KRF8VU.js +0 -64
- package/dist/Utils-D7KRF8VU.js.map +0 -1
- package/dist/Utils-Dilye04y.js +0 -22
- package/dist/Utils-Dilye04y.js.map +0 -1
- package/dist/config-cli.cjs +0 -500
- package/dist/config-cli.cjs.map +0 -1
- package/dist/config-cli.js.map +0 -1
- package/dist/config-cli.mjs +0 -469
- package/dist/config-cli.mjs.map +0 -1
- package/dist/enums/CurrencySymbolEnum.js +0 -15
- package/dist/enums/CurrencySymbolEnum.js.map +0 -1
- package/dist/enums/DeviceEnum.js +0 -12
- package/dist/enums/DeviceEnum.js.map +0 -1
- package/dist/enums/EnvironmentEnum.js +0 -13
- package/dist/enums/EnvironmentEnum.js.map +0 -1
- package/dist/format.cjs +0 -43
- package/dist/format.cjs.map +0 -1
- package/dist/format.js.map +0 -1
- package/dist/format.mjs +0 -30
- package/dist/format.mjs.map +0 -1
- package/dist/hooks.cjs +0 -13
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/hooks.mjs +0 -4
- package/dist/hooks.mjs.map +0 -1
- package/dist/i18n.cjs +0 -3039
- package/dist/i18n.cjs.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/i18n.mjs +0 -3032
- package/dist/i18n.mjs.map +0 -1
- package/dist/index-cli.cjs +0 -30
- package/dist/index-cli.cjs.map +0 -1
- package/dist/index-cli.js.map +0 -1
- package/dist/index-cli.mjs +0 -14
- package/dist/index-cli.mjs.map +0 -1
- package/dist/index-rn.cjs +0 -57
- package/dist/index-rn.cjs.map +0 -1
- package/dist/index-rn.js.map +0 -1
- package/dist/index-rn.mjs +0 -36
- package/dist/index-rn.mjs.map +0 -1
- package/dist/index.cjs +0 -79
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -40
- package/dist/index.mjs.map +0 -1
- package/dist/interfaces/Config/ConfigOptions.js +0 -6
- package/dist/interfaces/Config/ConfigOptions.js.map +0 -1
- package/dist/interfaces/Config/OutputMap.js +0 -6
- package/dist/interfaces/Config/OutputMap.js.map +0 -1
- package/dist/interfaces/Config/OutputOptions.js +0 -6
- package/dist/interfaces/Config/OutputOptions.js.map +0 -1
- package/dist/interfaces/Config/SitemapMap.js +0 -6
- package/dist/interfaces/Config/SitemapMap.js.map +0 -1
- package/dist/interfaces/Config/StringMap.js +0 -6
- package/dist/interfaces/Config/StringMap.js.map +0 -1
- package/dist/interfaces/Format/FormatOptions.js +0 -6
- package/dist/interfaces/Format/FormatOptions.js.map +0 -1
- package/dist/interfaces/Sentry/InitOptions.js +0 -6
- package/dist/interfaces/Sentry/InitOptions.js.map +0 -1
- package/dist/interfaces/Sentry/InitOptionsRN.js +0 -6
- package/dist/interfaces/Sentry/InitOptionsRN.js.map +0 -1
- package/dist/interfaces/Sentry/SourceMapOptions.d.ts +0 -7
- package/dist/interfaces/Sentry/SourceMapOptions.js +0 -6
- package/dist/interfaces/Sentry/SourceMapOptions.js.map +0 -1
- package/dist/sentry-cli.cjs +0 -119
- package/dist/sentry-cli.cjs.map +0 -1
- package/dist/sentry-cli.d.ts +0 -9
- package/dist/sentry-cli.js +0 -49
- package/dist/sentry-cli.js.map +0 -1
- package/dist/sentry-cli.mjs +0 -98
- package/dist/sentry-cli.mjs.map +0 -1
- package/dist/sentry-rn.cjs +0 -11
- package/dist/sentry-rn.cjs.map +0 -1
- package/dist/sentry-rn.js.map +0 -1
- package/dist/sentry-rn.mjs +0 -4
- package/dist/sentry-rn.mjs.map +0 -1
- package/dist/sentry.cjs +0 -11
- package/dist/sentry.cjs.map +0 -1
- package/dist/sentry.mjs +0 -4
- package/dist/sentry.mjs.map +0 -1
- package/dist/types/Config/OptionType.js +0 -6
- package/dist/types/Config/OptionType.js.map +0 -1
- package/dist/types/Format/OptionType.js +0 -6
- package/dist/types/Format/OptionType.js.map +0 -1
- package/dist/types/Sentry/OptionType.js +0 -6
- package/dist/types/Sentry/OptionType.js.map +0 -1
- package/dist/useWebSocket-B_B6kWXM.js +0 -167
- package/dist/useWebSocket-B_B6kWXM.js.map +0 -1
- package/dist/useWebSocket-YQWaiBz9.js +0 -172
- package/dist/useWebSocket-YQWaiBz9.js.map +0 -1
- package/dist/utils.cjs +0 -59
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.mjs +0 -43
- package/dist/utils.mjs.map +0 -1
- package/src/Sentry/Build.ts +0 -67
- package/src/interfaces/Sentry/SourceMapOptions.ts +0 -7
- package/src/sentry-cli.ts +0 -16
|
@@ -0,0 +1,1491 @@
|
|
|
1
|
+
import { n as e, t } from "./chunk-vKJrgz-R.js";
|
|
2
|
+
import { t as n } from "./EnvironmentEnum-CXTWJxNo.js";
|
|
3
|
+
import { isHiddenKey as r } from "./utils.js";
|
|
4
|
+
import { copyFile as i, existsSync as a, mkdirSync as o, writeFile as s } from "fs";
|
|
5
|
+
import { isNull as c } from "lodash-es";
|
|
6
|
+
import { GoogleAuth as l } from "google-auth-library";
|
|
7
|
+
import { google as u } from "googleapis";
|
|
8
|
+
import * as d from "path";
|
|
9
|
+
import * as f from "process";
|
|
10
|
+
import { Transform as p, Writable as m } from "node:stream";
|
|
11
|
+
import { statSync as h } from "node:fs";
|
|
12
|
+
import "node:readline";
|
|
13
|
+
import { URL as g } from "node:url";
|
|
14
|
+
import "node:path";
|
|
15
|
+
import "node:child_process";
|
|
16
|
+
import { Readable as _ } from "stream";
|
|
17
|
+
import "node:zlib";
|
|
18
|
+
import "node:stream/promises";
|
|
19
|
+
//#region src/Config/Output.ts
|
|
20
|
+
var v = (e, t) => {
|
|
21
|
+
let n = t.filename;
|
|
22
|
+
t.isFilenameLowercase && (n = n.toLowerCase());
|
|
23
|
+
let r = `${t.folder}/${n}`;
|
|
24
|
+
a(t.folder) || o(t.folder, { recursive: !0 }), s(r, e, {
|
|
25
|
+
encoding: "utf-8",
|
|
26
|
+
flag: "w"
|
|
27
|
+
}, function(t) {
|
|
28
|
+
if (t) throw t;
|
|
29
|
+
console.log(r, e);
|
|
30
|
+
});
|
|
31
|
+
}, ee = (e) => {
|
|
32
|
+
let t = {}, n = e[0].map((e) => e);
|
|
33
|
+
return e.forEach((e, r) => {
|
|
34
|
+
r !== 0 && (t = te(e, n, t));
|
|
35
|
+
}), t;
|
|
36
|
+
}, te = (e, t, n) => {
|
|
37
|
+
let r = e[0];
|
|
38
|
+
return n[r] = {}, t.forEach((t, i) => {
|
|
39
|
+
i === 0 || e[i] === void 0 || e[i] === "" || (n[r][t] = b(e[i]));
|
|
40
|
+
}), n;
|
|
41
|
+
}, y = (e) => {
|
|
42
|
+
try {
|
|
43
|
+
JSON.parse(e);
|
|
44
|
+
} catch {
|
|
45
|
+
return !1;
|
|
46
|
+
}
|
|
47
|
+
return !0;
|
|
48
|
+
}, b = (e) => ["TRUE", "FALSE"].includes(e.toUpperCase()) ? e === "TRUE" : y(e) ? JSON.parse(e) : e, ne = (e, t) => {
|
|
49
|
+
let n = { params: e }, r = "";
|
|
50
|
+
switch (t.exportAs) {
|
|
51
|
+
case "ts":
|
|
52
|
+
r = "export default " + JSON.stringify(n, null, 2), t.filename = `${t.filename}.ts`;
|
|
53
|
+
break;
|
|
54
|
+
case "json":
|
|
55
|
+
r = JSON.stringify(n, null, 2), t.filename = `${t.filename}.json`;
|
|
56
|
+
break;
|
|
57
|
+
case "js":
|
|
58
|
+
r = `module.exports = ${JSON.stringify(n, null, 2)}`, t.filename = `${t.filename}.js`;
|
|
59
|
+
break;
|
|
60
|
+
default: throw Error(`exportAs ${t.exportAs} not supported.`);
|
|
61
|
+
}
|
|
62
|
+
v(r, t);
|
|
63
|
+
}, x = (e) => {
|
|
64
|
+
let t;
|
|
65
|
+
switch (e) {
|
|
66
|
+
case "dev":
|
|
67
|
+
case "develop":
|
|
68
|
+
case "development":
|
|
69
|
+
t = n.DEV;
|
|
70
|
+
break;
|
|
71
|
+
case "stg":
|
|
72
|
+
case "stag":
|
|
73
|
+
case "staging":
|
|
74
|
+
t = n.STAGING;
|
|
75
|
+
break;
|
|
76
|
+
case "prd":
|
|
77
|
+
case "prod":
|
|
78
|
+
case "production":
|
|
79
|
+
t = n.PRODUCTION;
|
|
80
|
+
break;
|
|
81
|
+
default: throw Error(`env ${e} not supported.`);
|
|
82
|
+
}
|
|
83
|
+
return t;
|
|
84
|
+
}, S = (e, t, n) => {
|
|
85
|
+
let r = "";
|
|
86
|
+
switch (n) {
|
|
87
|
+
case "ts":
|
|
88
|
+
c(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
|
+
break;
|
|
90
|
+
case "js":
|
|
91
|
+
r += `export const ${e} = "${t}";\n`;
|
|
92
|
+
break;
|
|
93
|
+
case "env":
|
|
94
|
+
r += `${e} = "${t}"\n`;
|
|
95
|
+
break;
|
|
96
|
+
default: throw Error(`exportAs ${n} not supported.`);
|
|
97
|
+
}
|
|
98
|
+
return r;
|
|
99
|
+
}, C = (e, t, n, i) => {
|
|
100
|
+
let a = S(n ? `${n}ENV` : "ENV", x(t), i.exportAs);
|
|
101
|
+
Object.keys(e).forEach((o) => {
|
|
102
|
+
let s = n && !r(o) ? `${n}${o}` : o;
|
|
103
|
+
if (o === "BASE_PROJECT" || o === "__BASE_PROJECT") {
|
|
104
|
+
let t = [
|
|
105
|
+
`.${e[o]}.js`,
|
|
106
|
+
`.${e[o]}.jsx`,
|
|
107
|
+
`.${e[o]}.ts`,
|
|
108
|
+
`.${e[o]}.tsx`,
|
|
109
|
+
`.${e[o]}.css`,
|
|
110
|
+
`.${e[o]}.json`,
|
|
111
|
+
`.${e[o]}.scss`
|
|
112
|
+
];
|
|
113
|
+
a += S(s, t.join(","), i.exportAs);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (o === "SITEMAP" || o === "__SITEMAP") {
|
|
117
|
+
a += S(s, JSON.stringify(e[o]), i.exportAs);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (Array.isArray(e[o])) {
|
|
121
|
+
a += S(s, e[o].join(","), i.exportAs);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (typeof e[o] == "object") {
|
|
125
|
+
e[o].hasOwnProperty(t) ? a += S(s, e[o][t], i.exportAs) : a += S(s, JSON.stringify(e[o]), i.exportAs);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
a += S(s, e[o], i.exportAs);
|
|
129
|
+
}), v(a, i);
|
|
130
|
+
}, re = (e, t, n) => {
|
|
131
|
+
let r = "index.html", o = "index";
|
|
132
|
+
if (n.excludeVersion.includes(e) || (o = `.${e}.`), n.excludeEnv.includes(t) || (o = `${o}.${t}`), o = `${o}.html`, o !== r && a(o)) {
|
|
133
|
+
i(o, r, (e) => {
|
|
134
|
+
if (e) {
|
|
135
|
+
console.error(e);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
console.log(`File copied from '${o}' to '${r}' successfully!`);
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
console.log("use current index.html");
|
|
143
|
+
}, w = ["https://www.googleapis.com/auth/spreadsheets.readonly"], T = d.join(f.cwd(), "/google_application_credentials.json"), E = () => {
|
|
144
|
+
let e = a(T), t = { scopes: w };
|
|
145
|
+
return e && (t.keyFile = T), new l(t);
|
|
146
|
+
}, D = async (e, t, n) => (await u.sheets({
|
|
147
|
+
version: "v4",
|
|
148
|
+
auth: e
|
|
149
|
+
}).spreadsheets.values.get({
|
|
150
|
+
spreadsheetId: t,
|
|
151
|
+
range: n,
|
|
152
|
+
majorDimension: "COLUMNS"
|
|
153
|
+
})).data.values, ie = (e) => {
|
|
154
|
+
let t = e[0].map((e) => e), n = {};
|
|
155
|
+
return e.forEach((e, r) => {
|
|
156
|
+
if (r === 0) return;
|
|
157
|
+
let i = {};
|
|
158
|
+
e.forEach((e, n) => {
|
|
159
|
+
n !== 0 && (i[t[n]] = e);
|
|
160
|
+
}), n[e[0]] = i;
|
|
161
|
+
}), n;
|
|
162
|
+
}, O = (e, t) => {
|
|
163
|
+
Object.keys(e).forEach((n) => {
|
|
164
|
+
t.filename = `${n}.${t.exportAs.toLowerCase()}`;
|
|
165
|
+
let r = "";
|
|
166
|
+
switch (t.exportAs) {
|
|
167
|
+
case "ts":
|
|
168
|
+
r = "export default " + JSON.stringify(e[n], null, 2);
|
|
169
|
+
break;
|
|
170
|
+
case "json":
|
|
171
|
+
r = JSON.stringify(e[n], null, 2);
|
|
172
|
+
break;
|
|
173
|
+
default: throw Error(`exportAs ${t.exportAs} not supported.`);
|
|
174
|
+
}
|
|
175
|
+
if (!r) throw Error("empty content, please check remote value.");
|
|
176
|
+
v(r, t);
|
|
177
|
+
});
|
|
178
|
+
}, k = class e extends Error {
|
|
179
|
+
constructor(t) {
|
|
180
|
+
super(t || "URL is required"), this.name = "NoURLError", Error.captureStackTrace(this, e);
|
|
181
|
+
}
|
|
182
|
+
}, A = class e extends Error {
|
|
183
|
+
constructor(t) {
|
|
184
|
+
super(t || "SitemapItem requires a configuration"), this.name = "NoConfigError", Error.captureStackTrace(this, e);
|
|
185
|
+
}
|
|
186
|
+
}, j = class e extends Error {
|
|
187
|
+
constructor(t, n) {
|
|
188
|
+
super(`${t}: changefreq "${n}" is invalid`), this.name = "ChangeFreqInvalidError", Error.captureStackTrace(this, e);
|
|
189
|
+
}
|
|
190
|
+
}, M = class e extends Error {
|
|
191
|
+
constructor(t, n) {
|
|
192
|
+
super(`${t}: priority "${n}" must be a number between 0 and 1 inclusive`), this.name = "PriorityInvalidError", Error.captureStackTrace(this, e);
|
|
193
|
+
}
|
|
194
|
+
}, N = class e extends Error {
|
|
195
|
+
constructor(t) {
|
|
196
|
+
super(`${t} video must include thumbnail_loc, title and description fields for videos`), this.name = "InvalidVideoFormat", Error.captureStackTrace(this, e);
|
|
197
|
+
}
|
|
198
|
+
}, ae = class e extends Error {
|
|
199
|
+
constructor(t, n) {
|
|
200
|
+
super(`${t} duration "${n}" must be an integer of seconds between 0 and 28800`), this.name = "InvalidVideoDuration", Error.captureStackTrace(this, e);
|
|
201
|
+
}
|
|
202
|
+
}, P = class e extends Error {
|
|
203
|
+
constructor(t, n) {
|
|
204
|
+
let r = `${t}: video description is too long ${n} vs limit of 2048 characters.`;
|
|
205
|
+
super(r), this.name = "InvalidVideoDescription", Error.captureStackTrace(this, e);
|
|
206
|
+
}
|
|
207
|
+
}, F = class e extends Error {
|
|
208
|
+
constructor(t, n, r) {
|
|
209
|
+
super(`${t}: video "${n}" rating "${r}" must be between 0 and 5 inclusive`), this.name = "InvalidVideoRating", Error.captureStackTrace(this, e);
|
|
210
|
+
}
|
|
211
|
+
}, I = class e extends Error {
|
|
212
|
+
constructor(t, n, r) {
|
|
213
|
+
super("\"" + n + "\" tested against: " + r + " is not a valid value for attr: \"" + t + "\""), this.name = "InvalidAttrValue", Error.captureStackTrace(this, e);
|
|
214
|
+
}
|
|
215
|
+
}, L = class e extends Error {
|
|
216
|
+
constructor(t) {
|
|
217
|
+
super("\"" + t + "\" is malformed"), this.name = "InvalidAttr", Error.captureStackTrace(this, e);
|
|
218
|
+
}
|
|
219
|
+
}, oe = class e extends Error {
|
|
220
|
+
constructor(t) {
|
|
221
|
+
super(`${t} News must include publication, publication name, publication language, title, and publication_date for news`), this.name = "InvalidNewsFormat", Error.captureStackTrace(this, e);
|
|
222
|
+
}
|
|
223
|
+
}, R = class e extends Error {
|
|
224
|
+
constructor(t, n) {
|
|
225
|
+
super(`${t} News access "${n}" must be either Registration, Subscription or not be present`), this.name = "InvalidNewsAccessValue", Error.captureStackTrace(this, e);
|
|
226
|
+
}
|
|
227
|
+
}, z = class e extends Error {
|
|
228
|
+
constructor(t, n) {
|
|
229
|
+
super(`${t}: video title is too long ${n} vs 100 character limit`), this.name = "InvalidVideoTitle", Error.captureStackTrace(this, e);
|
|
230
|
+
}
|
|
231
|
+
}, se = class e extends Error {
|
|
232
|
+
constructor(t, n) {
|
|
233
|
+
super(`${t}: video view count must be positive, view count was ${n}`), this.name = "InvalidVideoViewCount", Error.captureStackTrace(this, e);
|
|
234
|
+
}
|
|
235
|
+
}, ce = class e extends Error {
|
|
236
|
+
constructor(t, n) {
|
|
237
|
+
super(`${t}: video can have no more than 32 tags, this has ${n}`), this.name = "InvalidVideoTagCount", Error.captureStackTrace(this, e);
|
|
238
|
+
}
|
|
239
|
+
}, le = class e extends Error {
|
|
240
|
+
constructor(t, n) {
|
|
241
|
+
super(`${t}: video category can only be 256 characters but was passed ${n}`), this.name = "InvalidVideoCategory", Error.captureStackTrace(this, e);
|
|
242
|
+
}
|
|
243
|
+
}, ue = class e extends Error {
|
|
244
|
+
constructor(t, n) {
|
|
245
|
+
super(`${t}: video family friendly must be yes or no, was passed "${n}"`), this.name = "InvalidVideoFamilyFriendly", Error.captureStackTrace(this, e);
|
|
246
|
+
}
|
|
247
|
+
}, de = class e extends Error {
|
|
248
|
+
constructor(t, n) {
|
|
249
|
+
super(`${t}: video restriction must be one or more two letter country codes. Was passed "${n}"`), this.name = "InvalidVideoRestriction", Error.captureStackTrace(this, e);
|
|
250
|
+
}
|
|
251
|
+
}, fe = class e extends Error {
|
|
252
|
+
constructor(t, n) {
|
|
253
|
+
super(`${t}: video restriction relationship must be either allow or deny. Was passed "${n}"`), this.name = "InvalidVideoRestrictionRelationship", Error.captureStackTrace(this, e);
|
|
254
|
+
}
|
|
255
|
+
}, pe = class e extends Error {
|
|
256
|
+
constructor(t, n, r) {
|
|
257
|
+
super(n === void 0 && r === "" ? `${t}: video priceType is required when price is not provided` : `${t}: video price type "${n}" is not "rent" or "purchase"`), this.name = "InvalidVideoPriceType", Error.captureStackTrace(this, e);
|
|
258
|
+
}
|
|
259
|
+
}, me = class e extends Error {
|
|
260
|
+
constructor(t, n) {
|
|
261
|
+
super(`${t}: video price resolution "${n}" is not hd or sd`), this.name = "InvalidVideoResolution", Error.captureStackTrace(this, e);
|
|
262
|
+
}
|
|
263
|
+
}, he = class e extends Error {
|
|
264
|
+
constructor(t, n) {
|
|
265
|
+
super(`${t}: video price currency "${n}" must be a three capital letter abbrieviation for the country currency`), this.name = "InvalidVideoPriceCurrency", Error.captureStackTrace(this, e);
|
|
266
|
+
}
|
|
267
|
+
}, ge = class e extends Error {
|
|
268
|
+
constructor() {
|
|
269
|
+
super("You have ended the stream before anything was written. streamToPromise MUST be called before ending the stream."), this.name = "EmptyStream", Error.captureStackTrace(this, e);
|
|
270
|
+
}
|
|
271
|
+
}, _e = class extends Error {
|
|
272
|
+
constructor() {
|
|
273
|
+
super("You ended the stream without writing anything."), this.name = "EmptySitemap", Error.captureStackTrace(this, ge);
|
|
274
|
+
}
|
|
275
|
+
}, B = class e extends Error {
|
|
276
|
+
constructor(t, n) {
|
|
277
|
+
super(`Invalid hostname "${t}": ${n}`), this.name = "InvalidHostnameError", Error.captureStackTrace(this, e);
|
|
278
|
+
}
|
|
279
|
+
}, V = class e extends Error {
|
|
280
|
+
constructor(t, n) {
|
|
281
|
+
super(`Invalid xslUrl "${t}": ${n}`), this.name = "InvalidXSLUrlError", Error.captureStackTrace(this, e);
|
|
282
|
+
}
|
|
283
|
+
}, ve = class e extends Error {
|
|
284
|
+
constructor(t) {
|
|
285
|
+
super(`Invalid XML attribute name "${t}": must contain only alphanumeric characters, hyphens, underscores, and colons`), this.name = "InvalidXMLAttributeNameError", Error.captureStackTrace(this, e);
|
|
286
|
+
}
|
|
287
|
+
}, ye;
|
|
288
|
+
(function(e) {
|
|
289
|
+
e.DAILY = "daily", e.MONTHLY = "monthly", e.ALWAYS = "always", e.HOURLY = "hourly", e.WEEKLY = "weekly", e.YEARLY = "yearly", e.NEVER = "never";
|
|
290
|
+
})(ye ||= {});
|
|
291
|
+
var H;
|
|
292
|
+
(function(e) {
|
|
293
|
+
e.YES = "YES", e.NO = "NO", e.Yes = "Yes", e.No = "No", e.yes = "yes", e.no = "no";
|
|
294
|
+
})(H ||= {});
|
|
295
|
+
var be;
|
|
296
|
+
(function(e) {
|
|
297
|
+
e.ALLOW = "allow", e.DENY = "deny";
|
|
298
|
+
})(be ||= {});
|
|
299
|
+
var U;
|
|
300
|
+
(function(e) {
|
|
301
|
+
e.SILENT = "silent", e.WARN = "warn", e.THROW = "throw";
|
|
302
|
+
})(U ||= {});
|
|
303
|
+
var W;
|
|
304
|
+
(function(e) {
|
|
305
|
+
e.url = "url", e.loc = "loc", e.urlset = "urlset", e.lastmod = "lastmod", e.changefreq = "changefreq", e.priority = "priority", e["video:thumbnail_loc"] = "video:thumbnail_loc", e["video:video"] = "video:video", e["video:title"] = "video:title", e["video:description"] = "video:description", e["video:tag"] = "video:tag", e["video:duration"] = "video:duration", e["video:player_loc"] = "video:player_loc", e["video:content_loc"] = "video:content_loc", e["image:image"] = "image:image", e["image:loc"] = "image:loc", e["image:geo_location"] = "image:geo_location", e["image:license"] = "image:license", e["image:title"] = "image:title", e["image:caption"] = "image:caption", e["video:requires_subscription"] = "video:requires_subscription", e["video:publication_date"] = "video:publication_date", e["video:id"] = "video:id", e["video:restriction"] = "video:restriction", e["video:family_friendly"] = "video:family_friendly", e["video:view_count"] = "video:view_count", e["video:uploader"] = "video:uploader", e["video:expiration_date"] = "video:expiration_date", e["video:platform"] = "video:platform", e["video:price"] = "video:price", e["video:rating"] = "video:rating", e["video:category"] = "video:category", e["video:live"] = "video:live", e["video:gallery_loc"] = "video:gallery_loc", e["news:news"] = "news:news", e["news:publication"] = "news:publication", e["news:name"] = "news:name", e["news:access"] = "news:access", e["news:genres"] = "news:genres", e["news:publication_date"] = "news:publication_date", e["news:title"] = "news:title", e["news:keywords"] = "news:keywords", e["news:stock_tickers"] = "news:stock_tickers", e["news:language"] = "news:language", e["mobile:mobile"] = "mobile:mobile", e["xhtml:link"] = "xhtml:link", e.expires = "expires";
|
|
306
|
+
})(W ||= {});
|
|
307
|
+
var xe;
|
|
308
|
+
(function(e) {
|
|
309
|
+
e.sitemap = "sitemap", e.sitemapindex = "sitemapindex", e.loc = "loc", e.lastmod = "lastmod";
|
|
310
|
+
})(xe ||= {});
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region node_modules/sitemap/dist/esm/lib/sitemap-xml.js
|
|
313
|
+
var Se = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u0084\u0086-\u009F\uD800-\uDFFF\p{NChar}]/gu, Ce = /&/g, we = /</g, Te = />/g, Ee = /'/g, De = /"/g, Oe = /^[a-zA-Z_:][\w:.-]*$/;
|
|
314
|
+
function ke(e) {
|
|
315
|
+
if (!Oe.test(e)) throw new ve(e);
|
|
316
|
+
}
|
|
317
|
+
function Ae(e) {
|
|
318
|
+
if (typeof e != "string") throw TypeError(`text() requires a string, received ${typeof e}: ${String(e)}`);
|
|
319
|
+
return e.replace(Ce, "&").replace(we, "<").replace(Te, ">").replace(Se, "");
|
|
320
|
+
}
|
|
321
|
+
function G(e, t, n = !1) {
|
|
322
|
+
if (typeof e != "string") throw TypeError(`otag() nodeName must be a string, received ${typeof e}: ${String(e)}`);
|
|
323
|
+
let r = "";
|
|
324
|
+
for (let e in t) {
|
|
325
|
+
ke(e);
|
|
326
|
+
let n = t[e];
|
|
327
|
+
if (typeof n != "string") throw TypeError(`otag() attribute "${e}" value must be a string, received ${typeof n}: ${String(n)}`);
|
|
328
|
+
let i = n.replace(Ce, "&").replace(we, "<").replace(Te, ">").replace(Ee, "'").replace(De, """).replace(Se, "");
|
|
329
|
+
r += ` ${e}="${i}"`;
|
|
330
|
+
}
|
|
331
|
+
return `<${e}${r}${n ? "/" : ""}>`;
|
|
332
|
+
}
|
|
333
|
+
function K(e) {
|
|
334
|
+
if (typeof e != "string") throw TypeError(`ctag() nodeName must be a string, received ${typeof e}: ${String(e)}`);
|
|
335
|
+
return `</${e}>`;
|
|
336
|
+
}
|
|
337
|
+
function q(e, t, n) {
|
|
338
|
+
return typeof t == "string" ? G(e) + Ae(t) + K(e) : n === void 0 ? G(e, t, !0) : G(e, t) + Ae(n) + K(e);
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region node_modules/sitemap/dist/esm/lib/sitemap-item-stream.js
|
|
342
|
+
function J(e, t) {
|
|
343
|
+
return typeof t == "string" && (t = [t]), t.reduce((t, n) => {
|
|
344
|
+
if (e[n] !== void 0) {
|
|
345
|
+
let r = n.split(":");
|
|
346
|
+
if (r.length !== 2) throw new L(n);
|
|
347
|
+
t[r[1]] = e[n];
|
|
348
|
+
}
|
|
349
|
+
return t;
|
|
350
|
+
}, {});
|
|
351
|
+
}
|
|
352
|
+
var je = class extends p {
|
|
353
|
+
level;
|
|
354
|
+
constructor(e = { level: U.WARN }) {
|
|
355
|
+
e.objectMode = !0, super(e), this.level = e.level || U.WARN;
|
|
356
|
+
}
|
|
357
|
+
_transform(e, t, n) {
|
|
358
|
+
this.push(G(W.url)), this.push(q(W.loc, e.url)), e.lastmod && this.push(q(W.lastmod, e.lastmod)), e.changefreq && this.push(q(W.changefreq, e.changefreq)), e.priority !== void 0 && e.priority !== null && (e.fullPrecisionPriority ? this.push(q(W.priority, e.priority.toString())) : this.push(q(W.priority, e.priority.toFixed(1)))), e.video.forEach((e) => {
|
|
359
|
+
if (this.push(G(W["video:video"])), this.push(q(W["video:thumbnail_loc"], e.thumbnail_loc)), this.push(q(W["video:title"], e.title)), this.push(q(W["video:description"], e.description)), e.content_loc && this.push(q(W["video:content_loc"], e.content_loc)), e.player_loc && this.push(q(W["video:player_loc"], J(e, ["player_loc:autoplay", "player_loc:allow_embed"]), e.player_loc)), e.duration && this.push(q(W["video:duration"], e.duration.toString())), e.expiration_date && this.push(q(W["video:expiration_date"], e.expiration_date)), e.rating !== void 0 && this.push(q(W["video:rating"], e.rating.toString())), e.view_count !== void 0 && this.push(q(W["video:view_count"], String(e.view_count))), e.publication_date && this.push(q(W["video:publication_date"], e.publication_date)), e.tag && e.tag.length > 0) for (let t of e.tag) this.push(q(W["video:tag"], t));
|
|
360
|
+
e.category && this.push(q(W["video:category"], e.category)), e.family_friendly && this.push(q(W["video:family_friendly"], e.family_friendly)), e.restriction && this.push(q(W["video:restriction"], J(e, "restriction:relationship"), e.restriction)), e.gallery_loc && this.push(q(W["video:gallery_loc"], J(e, "gallery_loc:title"), e.gallery_loc)), e.price && this.push(q(W["video:price"], J(e, [
|
|
361
|
+
"price:resolution",
|
|
362
|
+
"price:currency",
|
|
363
|
+
"price:type"
|
|
364
|
+
]), e.price)), e.requires_subscription && this.push(q(W["video:requires_subscription"], e.requires_subscription)), e.uploader && this.push(q(W["video:uploader"], J(e, "uploader:info"), e.uploader)), e.platform && this.push(q(W["video:platform"], J(e, "platform:relationship"), e.platform)), e.live && this.push(q(W["video:live"], e.live)), e.id && this.push(q(W["video:id"], { type: "url" }, e.id)), this.push(K(W["video:video"]));
|
|
365
|
+
}), e.links.forEach((e) => {
|
|
366
|
+
this.push(q(W["xhtml:link"], {
|
|
367
|
+
rel: "alternate",
|
|
368
|
+
hreflang: e.lang || e.hreflang,
|
|
369
|
+
href: e.url
|
|
370
|
+
}));
|
|
371
|
+
}), e.expires && this.push(q(W.expires, new Date(e.expires).toISOString())), e.androidLink && this.push(q(W["xhtml:link"], {
|
|
372
|
+
rel: "alternate",
|
|
373
|
+
href: e.androidLink
|
|
374
|
+
})), e.ampLink && this.push(q(W["xhtml:link"], {
|
|
375
|
+
rel: "amphtml",
|
|
376
|
+
href: e.ampLink
|
|
377
|
+
})), e.news && (this.push(G(W["news:news"])), this.push(G(W["news:publication"])), this.push(q(W["news:name"], e.news.publication.name)), this.push(q(W["news:language"], e.news.publication.language)), this.push(K(W["news:publication"])), e.news.access && this.push(q(W["news:access"], e.news.access)), e.news.genres && this.push(q(W["news:genres"], e.news.genres)), this.push(q(W["news:publication_date"], e.news.publication_date)), this.push(q(W["news:title"], e.news.title)), e.news.keywords && this.push(q(W["news:keywords"], e.news.keywords)), e.news.stock_tickers && this.push(q(W["news:stock_tickers"], e.news.stock_tickers)), this.push(K(W["news:news"]))), e.img.forEach((e) => {
|
|
378
|
+
this.push(G(W["image:image"])), this.push(q(W["image:loc"], e.url)), e.caption && this.push(q(W["image:caption"], e.caption)), e.geoLocation && this.push(q(W["image:geo_location"], e.geoLocation)), e.title && this.push(q(W["image:title"], e.title)), e.license && this.push(q(W["image:license"], e.license)), this.push(K(W["image:image"]));
|
|
379
|
+
}), this.push(K(W.url)), n();
|
|
380
|
+
}
|
|
381
|
+
}, Y = {
|
|
382
|
+
MAX_URL_LENGTH: 2048,
|
|
383
|
+
URL_PROTOCOL_REGEX: /^https?:\/\//i,
|
|
384
|
+
MIN_SITEMAP_ITEM_LIMIT: 1,
|
|
385
|
+
MAX_SITEMAP_ITEM_LIMIT: 5e4,
|
|
386
|
+
MAX_VIDEO_TITLE_LENGTH: 100,
|
|
387
|
+
MAX_VIDEO_DESCRIPTION_LENGTH: 2048,
|
|
388
|
+
MAX_VIDEO_CATEGORY_LENGTH: 256,
|
|
389
|
+
MAX_TAGS_PER_VIDEO: 32,
|
|
390
|
+
MAX_NEWS_TITLE_LENGTH: 200,
|
|
391
|
+
MAX_NEWS_NAME_LENGTH: 256,
|
|
392
|
+
MAX_IMAGE_CAPTION_LENGTH: 512,
|
|
393
|
+
MAX_IMAGE_TITLE_LENGTH: 512,
|
|
394
|
+
MAX_IMAGES_PER_URL: 1e3,
|
|
395
|
+
MAX_VIDEOS_PER_URL: 100,
|
|
396
|
+
MAX_LINKS_PER_URL: 100,
|
|
397
|
+
MAX_URL_ENTRIES: 5e4,
|
|
398
|
+
ISO_DATE_REGEX: /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?([+-]\d{2}:\d{2}|Z)?)?$/,
|
|
399
|
+
MAX_CUSTOM_NAMESPACES: 20,
|
|
400
|
+
MAX_NAMESPACE_LENGTH: 512,
|
|
401
|
+
MAX_PARSER_ERRORS: 100
|
|
402
|
+
}, X = /^(?:allow|deny)$/, Z = {
|
|
403
|
+
"price:currency": /^[A-Z]{3}$/,
|
|
404
|
+
"price:type": /^(?:rent|purchase|RENT|PURCHASE)$/,
|
|
405
|
+
"price:resolution": /^(?:HD|hd|sd|SD)$/,
|
|
406
|
+
"platform:relationship": X,
|
|
407
|
+
"restriction:relationship": X,
|
|
408
|
+
restriction: /^([A-Z]{2}( +[A-Z]{2})*)?$/,
|
|
409
|
+
platform: /^((web|mobile|tv)( (web|mobile|tv))*)?$/,
|
|
410
|
+
language: /^(zh-cn|zh-tw|[a-z]{2,3})$/,
|
|
411
|
+
genres: /^(PressRelease|Satire|Blog|OpEd|Opinion|UserGenerated)(, *(PressRelease|Satire|Blog|OpEd|Opinion|UserGenerated))*$/,
|
|
412
|
+
stock_tickers: /^(\w+:\w+(, *\w+:\w+){0,4})?$/
|
|
413
|
+
};
|
|
414
|
+
function Me(e) {
|
|
415
|
+
return Z["price:type"].test(e);
|
|
416
|
+
}
|
|
417
|
+
function Ne(e) {
|
|
418
|
+
return Z["price:resolution"].test(e);
|
|
419
|
+
}
|
|
420
|
+
var Pe = Object.values(ye);
|
|
421
|
+
function Fe(e) {
|
|
422
|
+
return Pe.includes(e);
|
|
423
|
+
}
|
|
424
|
+
function Ie(e) {
|
|
425
|
+
return /^YES|NO|[Yy]es|[Nn]o$/.test(e);
|
|
426
|
+
}
|
|
427
|
+
function Le(e) {
|
|
428
|
+
return X.test(e);
|
|
429
|
+
}
|
|
430
|
+
function Re(e, t) {
|
|
431
|
+
if (!e || typeof e != "string") throw new B(e, `${t} must be a non-empty string`);
|
|
432
|
+
if (e.length > Y.MAX_URL_LENGTH) throw new B(e, `${t} exceeds maximum length of ${Y.MAX_URL_LENGTH} characters`);
|
|
433
|
+
if (!Y.URL_PROTOCOL_REGEX.test(e)) throw new B(e, `${t} must use http:// or https:// protocol`);
|
|
434
|
+
try {
|
|
435
|
+
new URL(e);
|
|
436
|
+
} catch (n) {
|
|
437
|
+
throw new B(e, `${t} is not a valid URL: ${n instanceof Error ? n.message : String(n)}`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function ze(e) {
|
|
441
|
+
if (!e || typeof e != "string") throw new V(e, "must be a non-empty string");
|
|
442
|
+
if (e.length > Y.MAX_URL_LENGTH) throw new V(e, `exceeds maximum length of ${Y.MAX_URL_LENGTH} characters`);
|
|
443
|
+
if (!Y.URL_PROTOCOL_REGEX.test(e)) throw new V(e, "must use http:// or https:// protocol");
|
|
444
|
+
try {
|
|
445
|
+
new URL(e);
|
|
446
|
+
} catch (t) {
|
|
447
|
+
throw new V(e, `is not a valid URL: ${t instanceof Error ? t.message : String(t)}`);
|
|
448
|
+
}
|
|
449
|
+
let t = e.toLowerCase();
|
|
450
|
+
if (t.includes("<script")) throw new V(e, "contains potentially malicious content (<script tag)");
|
|
451
|
+
for (let n of [
|
|
452
|
+
"javascript:",
|
|
453
|
+
"data:",
|
|
454
|
+
"vbscript:",
|
|
455
|
+
"file:",
|
|
456
|
+
"about:"
|
|
457
|
+
]) if (t.includes(n)) throw new V(e, `contains dangerous protocol: ${n}`);
|
|
458
|
+
for (let n of [
|
|
459
|
+
"%3cscript",
|
|
460
|
+
"%3c%73%63%72%69%70%74",
|
|
461
|
+
"javascript%3a",
|
|
462
|
+
"data%3a"
|
|
463
|
+
]) if (t.includes(n)) throw new V(e, "contains URL-encoded malicious content");
|
|
464
|
+
if (e.includes("\"") || e.includes("<") || e.includes(">")) throw new V(e, "contains unencoded XML special characters (\" < >); percent-encode them in the URL");
|
|
465
|
+
}
|
|
466
|
+
function Q(e, t, n, r) {
|
|
467
|
+
Object.keys(e).forEach((i) => {
|
|
468
|
+
let a = e[i];
|
|
469
|
+
if (Z[i] && !Z[i].test(a)) {
|
|
470
|
+
if (r === U.THROW) throw new I(i, a, Z[i]);
|
|
471
|
+
console.warn(`${n}: ${t} key ${i} has invalid value: ${a}`);
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
function Be(e, t) {
|
|
476
|
+
if (t === U.THROW) throw e;
|
|
477
|
+
t === U.WARN && console.warn(e.name, e.message);
|
|
478
|
+
}
|
|
479
|
+
function Ve(e, t = U.WARN, n = Be) {
|
|
480
|
+
if (!e) throw new A();
|
|
481
|
+
if (t === U.SILENT) return e;
|
|
482
|
+
let { url: r, changefreq: i, priority: a, news: o, video: s } = e;
|
|
483
|
+
return r || n(new k(), t), i && (Fe(i) || n(new j(r, i), t)), a && (a >= 0 && a <= 1 || n(new M(r, a), t)), o && (o.access && o.access !== "Registration" && o.access !== "Subscription" && n(new R(r, o.access), t), (!o.publication || !o.publication.name || !o.publication.language || !o.publication_date || !o.title) && n(new oe(r), t), Q(o, "news", r, t), Q(o.publication, "publication", r, t)), s && s.forEach((e) => {
|
|
484
|
+
e.duration !== void 0 && (e.duration < 0 || e.duration > 28800) && n(new ae(r, e.duration), t), e.rating !== void 0 && (e.rating < 0 || e.rating > 5) && n(new F(r, e.title, e.rating), t), (typeof e != "object" || !e.thumbnail_loc || !e.title || !e.description) && n(new N(r), t), e.title.length > 100 && n(new z(r, e.title.length), t), e.description.length > 2048 && n(new P(r, e.description.length), t), e.view_count !== void 0 && e.view_count < 0 && n(new se(r, e.view_count), t), e.tag.length > 32 && n(new ce(r, e.tag.length), t), e.category !== void 0 && e.category?.length > 256 && n(new le(r, e.category.length), t), e.family_friendly !== void 0 && !Ie(e.family_friendly) && n(new ue(r, e.family_friendly), t), e.restriction && (Z.restriction.test(e.restriction) || n(new de(r, e.restriction), t), (!e["restriction:relationship"] || !Le(e["restriction:relationship"])) && n(new fe(r, e["restriction:relationship"]), t)), (e.price === "" && e["price:type"] === void 0 || e["price:type"] !== void 0 && !Me(e["price:type"])) && n(new pe(r, e["price:type"], e.price), t), e["price:resolution"] !== void 0 && !Ne(e["price:resolution"]) && n(new me(r, e["price:resolution"]), t), e["price:currency"] !== void 0 && !Z["price:currency"].test(e["price:currency"]) && n(new he(r, e["price:currency"]), t), Q(e, "video", r, t);
|
|
485
|
+
}), e;
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region node_modules/sitemap/dist/esm/lib/utils.js
|
|
489
|
+
function $(e) {
|
|
490
|
+
if (e !== void 0) return typeof e == "boolean" ? e ? H.yes : H.no : e;
|
|
491
|
+
}
|
|
492
|
+
function He(e, t, n = !1) {
|
|
493
|
+
let r = {
|
|
494
|
+
img: [],
|
|
495
|
+
video: [],
|
|
496
|
+
links: [],
|
|
497
|
+
url: ""
|
|
498
|
+
};
|
|
499
|
+
if (typeof e == "string") return r.url = new g(e, t).toString(), r;
|
|
500
|
+
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 g(i, t).toString(), a && (r.img = (Array.isArray(a) ? a : [a]).map((e) => typeof e == "string" ? { url: new g(e, t).toString() } : {
|
|
502
|
+
...e,
|
|
503
|
+
url: new g(e.url, t).toString()
|
|
504
|
+
})), o && (r.links = o.map((e) => ({
|
|
505
|
+
...e,
|
|
506
|
+
url: new g(e.url, t).toString()
|
|
507
|
+
}))), s && (r.video = (Array.isArray(s) ? s : [s]).map((t) => {
|
|
508
|
+
let n = {
|
|
509
|
+
...t,
|
|
510
|
+
family_friendly: $(t.family_friendly),
|
|
511
|
+
live: $(t.live),
|
|
512
|
+
requires_subscription: $(t.requires_subscription),
|
|
513
|
+
tag: [],
|
|
514
|
+
rating: void 0
|
|
515
|
+
};
|
|
516
|
+
if (t.tag !== void 0 && (n.tag = Array.isArray(t.tag) ? t.tag : [t.tag]), t.rating !== void 0) if (typeof t.rating == "string") {
|
|
517
|
+
let r = parseFloat(t.rating);
|
|
518
|
+
if (Number.isNaN(r)) throw Error(`Invalid video rating "${t.rating}" for URL "${e.url}": must be a valid number`);
|
|
519
|
+
n.rating = r;
|
|
520
|
+
} else n.rating = t.rating;
|
|
521
|
+
if (typeof t.view_count == "string") {
|
|
522
|
+
let r = parseInt(t.view_count, 10);
|
|
523
|
+
if (Number.isNaN(r)) throw Error(`Invalid video view_count "${t.view_count}" for URL "${e.url}": must be a valid number`);
|
|
524
|
+
if (r < 0) throw Error(`Invalid video view_count "${t.view_count}" for URL "${e.url}": cannot be negative`);
|
|
525
|
+
n.view_count = r;
|
|
526
|
+
} else typeof t.view_count == "number" && (n.view_count = t.view_count);
|
|
527
|
+
return n;
|
|
528
|
+
})), c) {
|
|
529
|
+
let { mtime: e } = h(c), t = new Date(e);
|
|
530
|
+
if (Number.isNaN(t.getTime())) throw Error(`Invalid date from file stats for URL "${r.url}": file modification time is invalid`);
|
|
531
|
+
r.lastmod = t.toISOString();
|
|
532
|
+
} else if (l) {
|
|
533
|
+
let e = new Date(l);
|
|
534
|
+
if (Number.isNaN(e.getTime())) throw Error(`Invalid lastmodISO "${l}" for URL "${r.url}": must be a valid date string`);
|
|
535
|
+
r.lastmod = e.toISOString();
|
|
536
|
+
} else if (u) {
|
|
537
|
+
let e = new Date(u);
|
|
538
|
+
if (Number.isNaN(e.getTime())) throw Error(`Invalid lastmod "${u}" for URL "${r.url}": must be a valid date string`);
|
|
539
|
+
r.lastmod = e.toISOString();
|
|
540
|
+
}
|
|
541
|
+
return n && r.lastmod && (r.lastmod = r.lastmod.slice(0, 10)), r;
|
|
542
|
+
}
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region node_modules/sitemap/dist/esm/lib/sitemap-stream.js
|
|
545
|
+
var Ue = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>", We = (e) => `<?xml-stylesheet type="text/xsl" href="${e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">")}"?>`, Ge = "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"";
|
|
546
|
+
function Ke(e) {
|
|
547
|
+
if (!Array.isArray(e)) throw Error("Custom namespaces must be an array");
|
|
548
|
+
if (e.length > Y.MAX_CUSTOM_NAMESPACES) throw Error(`Too many custom namespaces: ${e.length} exceeds limit of ${Y.MAX_CUSTOM_NAMESPACES}`);
|
|
549
|
+
let t = /^[a-zA-Z_][\w.-]*:[a-zA-Z_][\w.-]*="[^"<>]*"$/;
|
|
550
|
+
for (let n of e) {
|
|
551
|
+
if (typeof n != "string" || n.length === 0) throw Error("Custom namespace must be a non-empty string");
|
|
552
|
+
if (n.length > Y.MAX_NAMESPACE_LENGTH) throw Error(`Custom namespace exceeds maximum length of ${Y.MAX_NAMESPACE_LENGTH} characters: ${n.substring(0, 50)}...`);
|
|
553
|
+
let e = n.toLowerCase();
|
|
554
|
+
if (e.includes("<script") || e.includes("javascript:") || e.includes("data:text/html")) throw Error(`Custom namespace contains potentially malicious content: ${n.substring(0, 50)}`);
|
|
555
|
+
if (!t.test(n)) throw Error(`Invalid namespace format (must be prefix:name="value", e.g., xmlns:prefix="uri" or xsi:schemaLocation="..."): ${n.substring(0, 50)}`);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
var qe = ({ news: e, video: t, image: n, xhtml: r, custom: i }, a) => {
|
|
559
|
+
let o = Ue;
|
|
560
|
+
return a && (o += We(a)), o += Ge, e && (o += " xmlns:news=\"http://www.google.com/schemas/sitemap-news/0.9\""), r && (o += " xmlns:xhtml=\"http://www.w3.org/1999/xhtml\""), n && (o += " xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\""), t && (o += " xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\""), i && (Ke(i), o += " " + i.join(" ")), o + ">";
|
|
561
|
+
}, Je = "</urlset>", Ye = {
|
|
562
|
+
news: !0,
|
|
563
|
+
xhtml: !0,
|
|
564
|
+
image: !0,
|
|
565
|
+
video: !0
|
|
566
|
+
}, Xe = { xmlns: Ye }, Ze = class extends p {
|
|
567
|
+
hostname;
|
|
568
|
+
level;
|
|
569
|
+
hasHeadOutput;
|
|
570
|
+
xmlNS;
|
|
571
|
+
xslUrl;
|
|
572
|
+
errorHandler;
|
|
573
|
+
smiStream;
|
|
574
|
+
lastmodDateOnly;
|
|
575
|
+
constructor(e = Xe) {
|
|
576
|
+
e.objectMode = !0, super(e), e.hostname !== void 0 && Re(e.hostname, "hostname"), e.xslUrl !== void 0 && ze(e.xslUrl), this.hasHeadOutput = !1, this.hostname = e.hostname, this.level = e.level || U.WARN, this.errorHandler = e.errorHandler, this.smiStream = new je({ level: e.level }), this.smiStream.on("data", (e) => this.push(e)), this.lastmodDateOnly = e.lastmodDateOnly || !1, this.xmlNS = e.xmlns || Ye, this.xslUrl = e.xslUrl;
|
|
577
|
+
}
|
|
578
|
+
_transform(e, t, n) {
|
|
579
|
+
this.hasHeadOutput || (this.hasHeadOutput = !0, this.push(qe(this.xmlNS, this.xslUrl))), this.smiStream.write(Ve(He(e, this.hostname, this.lastmodDateOnly), this.level, this.errorHandler)) ? process.nextTick(n) : this.smiStream.once("drain", n);
|
|
580
|
+
}
|
|
581
|
+
_flush(e) {
|
|
582
|
+
this.hasHeadOutput ? (this.push(Je), e()) : e(new _e());
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
function Qe(e) {
|
|
586
|
+
return new Promise((t, n) => {
|
|
587
|
+
let r = [];
|
|
588
|
+
e.on("error", n).pipe(new m({ write(e, t, n) {
|
|
589
|
+
r.push(e), n();
|
|
590
|
+
} })).on("error", n).on("finish", () => {
|
|
591
|
+
r.length ? t(Buffer.concat(r)) : n(new ge());
|
|
592
|
+
});
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
(/* @__PURE__ */ t(((t) => {
|
|
596
|
+
(function(t) {
|
|
597
|
+
t.parser = function(e, t) {
|
|
598
|
+
return new r(e, t);
|
|
599
|
+
}, t.SAXParser = r, t.SAXStream = d, t.createStream = l, t.MAX_BUFFER_LENGTH = 64 * 1024;
|
|
600
|
+
var n = [
|
|
601
|
+
"comment",
|
|
602
|
+
"sgmlDecl",
|
|
603
|
+
"textNode",
|
|
604
|
+
"tagName",
|
|
605
|
+
"doctype",
|
|
606
|
+
"procInstName",
|
|
607
|
+
"procInstBody",
|
|
608
|
+
"entity",
|
|
609
|
+
"attribName",
|
|
610
|
+
"attribValue",
|
|
611
|
+
"cdata",
|
|
612
|
+
"script"
|
|
613
|
+
];
|
|
614
|
+
t.EVENTS = [
|
|
615
|
+
"text",
|
|
616
|
+
"processinginstruction",
|
|
617
|
+
"sgmldeclaration",
|
|
618
|
+
"doctype",
|
|
619
|
+
"comment",
|
|
620
|
+
"opentagstart",
|
|
621
|
+
"attribute",
|
|
622
|
+
"opentag",
|
|
623
|
+
"closetag",
|
|
624
|
+
"opencdata",
|
|
625
|
+
"cdata",
|
|
626
|
+
"closecdata",
|
|
627
|
+
"error",
|
|
628
|
+
"end",
|
|
629
|
+
"ready",
|
|
630
|
+
"script",
|
|
631
|
+
"opennamespace",
|
|
632
|
+
"closenamespace"
|
|
633
|
+
];
|
|
634
|
+
function r(e, n) {
|
|
635
|
+
if (!(this instanceof r)) return new r(e, n);
|
|
636
|
+
var i = this;
|
|
637
|
+
a(i), i.q = i.c = "", i.bufferCheckPosition = t.MAX_BUFFER_LENGTH, i.encoding = null, i.opt = n || {}, i.opt.lowercase = i.opt.lowercase || i.opt.lowercasetags, i.looseCase = i.opt.lowercase ? "toLowerCase" : "toUpperCase", i.opt.maxEntityCount = i.opt.maxEntityCount || 512, i.opt.maxEntityDepth = i.opt.maxEntityDepth || 4, i.entityCount = i.entityDepth = 0, i.tags = [], i.closed = i.closedRoot = i.sawRoot = !1, i.tag = i.error = null, i.strict = !!e, i.noscript = !!(e || i.opt.noscript), i.state = C.BEGIN, i.strictEntities = i.opt.strictEntities, i.ENTITIES = i.strictEntities ? Object.create(t.XML_ENTITIES) : Object.create(t.ENTITIES), i.attribList = [], i.opt.xmlns && (i.ns = Object.create(g)), i.opt.unquotedAttributeValues === void 0 && (i.opt.unquotedAttributeValues = !e), i.trackPosition = i.opt.position !== !1, i.trackPosition && (i.position = i.line = i.column = 0), w(i, "onready");
|
|
638
|
+
}
|
|
639
|
+
Object.create || (Object.create = function(e) {
|
|
640
|
+
function t() {}
|
|
641
|
+
return t.prototype = e, new t();
|
|
642
|
+
}), Object.keys || (Object.keys = function(e) {
|
|
643
|
+
var t = [];
|
|
644
|
+
for (var n in e) e.hasOwnProperty(n) && t.push(n);
|
|
645
|
+
return t;
|
|
646
|
+
});
|
|
647
|
+
function i(e) {
|
|
648
|
+
for (var r = Math.max(t.MAX_BUFFER_LENGTH, 10), i = 0, a = 0, o = n.length; a < o; a++) {
|
|
649
|
+
var s = e[n[a]].length;
|
|
650
|
+
if (s > r) switch (n[a]) {
|
|
651
|
+
case "textNode":
|
|
652
|
+
k(e);
|
|
653
|
+
break;
|
|
654
|
+
case "cdata":
|
|
655
|
+
O(e, "oncdata", e.cdata), e.cdata = "";
|
|
656
|
+
break;
|
|
657
|
+
case "script":
|
|
658
|
+
O(e, "onscript", e.script), e.script = "";
|
|
659
|
+
break;
|
|
660
|
+
default: j(e, "Max buffer length exceeded: " + n[a]);
|
|
661
|
+
}
|
|
662
|
+
i = Math.max(i, s);
|
|
663
|
+
}
|
|
664
|
+
e.bufferCheckPosition = t.MAX_BUFFER_LENGTH - i + e.position;
|
|
665
|
+
}
|
|
666
|
+
function a(e) {
|
|
667
|
+
for (var t = 0, r = n.length; t < r; t++) e[n[t]] = "";
|
|
668
|
+
}
|
|
669
|
+
function o(e) {
|
|
670
|
+
k(e), e.cdata !== "" && (O(e, "oncdata", e.cdata), e.cdata = ""), e.script !== "" && (O(e, "onscript", e.script), e.script = "");
|
|
671
|
+
}
|
|
672
|
+
r.prototype = {
|
|
673
|
+
end: function() {
|
|
674
|
+
M(this);
|
|
675
|
+
},
|
|
676
|
+
write: se,
|
|
677
|
+
resume: function() {
|
|
678
|
+
return this.error = null, this;
|
|
679
|
+
},
|
|
680
|
+
close: function() {
|
|
681
|
+
return this.write(null);
|
|
682
|
+
},
|
|
683
|
+
flush: function() {
|
|
684
|
+
o(this);
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
var s;
|
|
688
|
+
try {
|
|
689
|
+
s = e("stream").Stream;
|
|
690
|
+
} catch {
|
|
691
|
+
s = function() {};
|
|
692
|
+
}
|
|
693
|
+
s ||= function() {};
|
|
694
|
+
var c = t.EVENTS.filter(function(e) {
|
|
695
|
+
return e !== "error" && e !== "end";
|
|
696
|
+
});
|
|
697
|
+
function l(e, t) {
|
|
698
|
+
return new d(e, t);
|
|
699
|
+
}
|
|
700
|
+
function u(e, t) {
|
|
701
|
+
if (e.length >= 2) {
|
|
702
|
+
if (e[0] === 255 && e[1] === 254) return "utf-16le";
|
|
703
|
+
if (e[0] === 254 && e[1] === 255) return "utf-16be";
|
|
704
|
+
}
|
|
705
|
+
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
|
+
}
|
|
707
|
+
function d(e, t) {
|
|
708
|
+
if (!(this instanceof d)) return new d(e, t);
|
|
709
|
+
s.apply(this), this._parser = new r(e, t), this.writable = !0, this.readable = !0;
|
|
710
|
+
var n = this;
|
|
711
|
+
this._parser.onend = function() {
|
|
712
|
+
n.emit("end");
|
|
713
|
+
}, this._parser.onerror = function(e) {
|
|
714
|
+
n.emit("error", e), n._parser.error = null;
|
|
715
|
+
}, this._decoder = null, this._decoderBuffer = null, c.forEach(function(e) {
|
|
716
|
+
Object.defineProperty(n, "on" + e, {
|
|
717
|
+
get: function() {
|
|
718
|
+
return n._parser["on" + e];
|
|
719
|
+
},
|
|
720
|
+
set: function(t) {
|
|
721
|
+
if (!t) return n.removeAllListeners(e), n._parser["on" + e] = t, t;
|
|
722
|
+
n.on(e, t);
|
|
723
|
+
},
|
|
724
|
+
enumerable: !0,
|
|
725
|
+
configurable: !1
|
|
726
|
+
});
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
d.prototype = Object.create(s.prototype, { constructor: { value: d } }), d.prototype._decodeBuffer = function(e, t) {
|
|
730
|
+
if (this._decoderBuffer &&= (e = Buffer.concat([this._decoderBuffer, e]), null), !this._decoder) {
|
|
731
|
+
var n = u(e, t);
|
|
732
|
+
if (!n) return this._decoderBuffer = e, "";
|
|
733
|
+
this._parser.encoding = n, this._decoder = new TextDecoder(n);
|
|
734
|
+
}
|
|
735
|
+
return this._decoder.decode(e, { stream: !t });
|
|
736
|
+
}, d.prototype.write = function(e) {
|
|
737
|
+
if (typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(e)) e = this._decodeBuffer(e, !1);
|
|
738
|
+
else if (this._decoderBuffer) {
|
|
739
|
+
var t = this._decodeBuffer(Buffer.alloc(0), !0);
|
|
740
|
+
t && (this._parser.write(t), this.emit("data", t));
|
|
741
|
+
}
|
|
742
|
+
return this._parser.write(e.toString()), this.emit("data", e), !0;
|
|
743
|
+
}, d.prototype.end = function(e) {
|
|
744
|
+
if (e && e.length && this.write(e), this._decoderBuffer) {
|
|
745
|
+
var t = this._decodeBuffer(Buffer.alloc(0), !0);
|
|
746
|
+
t && (this._parser.write(t), this.emit("data", t));
|
|
747
|
+
} else if (this._decoder) {
|
|
748
|
+
var n = this._decoder.decode();
|
|
749
|
+
n && (this._parser.write(n), this.emit("data", n));
|
|
750
|
+
}
|
|
751
|
+
return this._parser.end(), !0;
|
|
752
|
+
}, d.prototype.on = function(e, t) {
|
|
753
|
+
var n = this;
|
|
754
|
+
return !n._parser["on" + e] && c.indexOf(e) !== -1 && (n._parser["on" + e] = function() {
|
|
755
|
+
var t = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
756
|
+
t.splice(0, 0, e), n.emit.apply(n, t);
|
|
757
|
+
}), s.prototype.on.call(n, e, t);
|
|
758
|
+
};
|
|
759
|
+
var f = "[CDATA[", p = "DOCTYPE", m = "http://www.w3.org/XML/1998/namespace", h = "http://www.w3.org/2000/xmlns/", g = {
|
|
760
|
+
xml: m,
|
|
761
|
+
xmlns: h
|
|
762
|
+
}, _ = /[:_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]/, v = /[:_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-]/, ee = /[#:_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]/, te = /[#:_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-]/;
|
|
763
|
+
function y(e) {
|
|
764
|
+
return e === " " || e === "\n" || e === "\r" || e === " ";
|
|
765
|
+
}
|
|
766
|
+
function b(e) {
|
|
767
|
+
return e === "\"" || e === "'";
|
|
768
|
+
}
|
|
769
|
+
function ne(e) {
|
|
770
|
+
return e === ">" || y(e);
|
|
771
|
+
}
|
|
772
|
+
function x(e, t) {
|
|
773
|
+
return e.test(t);
|
|
774
|
+
}
|
|
775
|
+
function S(e, t) {
|
|
776
|
+
return !x(e, t);
|
|
777
|
+
}
|
|
778
|
+
var C = 0;
|
|
779
|
+
for (var re in t.STATE = {
|
|
780
|
+
BEGIN: C++,
|
|
781
|
+
BEGIN_WHITESPACE: C++,
|
|
782
|
+
TEXT: C++,
|
|
783
|
+
TEXT_ENTITY: C++,
|
|
784
|
+
OPEN_WAKA: C++,
|
|
785
|
+
SGML_DECL: C++,
|
|
786
|
+
SGML_DECL_QUOTED: C++,
|
|
787
|
+
DOCTYPE: C++,
|
|
788
|
+
DOCTYPE_QUOTED: C++,
|
|
789
|
+
DOCTYPE_DTD: C++,
|
|
790
|
+
DOCTYPE_DTD_QUOTED: C++,
|
|
791
|
+
COMMENT_STARTING: C++,
|
|
792
|
+
COMMENT: C++,
|
|
793
|
+
COMMENT_ENDING: C++,
|
|
794
|
+
COMMENT_ENDED: C++,
|
|
795
|
+
CDATA: C++,
|
|
796
|
+
CDATA_ENDING: C++,
|
|
797
|
+
CDATA_ENDING_2: C++,
|
|
798
|
+
PROC_INST: C++,
|
|
799
|
+
PROC_INST_BODY: C++,
|
|
800
|
+
PROC_INST_ENDING: C++,
|
|
801
|
+
OPEN_TAG: C++,
|
|
802
|
+
OPEN_TAG_SLASH: C++,
|
|
803
|
+
ATTRIB: C++,
|
|
804
|
+
ATTRIB_NAME: C++,
|
|
805
|
+
ATTRIB_NAME_SAW_WHITE: C++,
|
|
806
|
+
ATTRIB_VALUE: C++,
|
|
807
|
+
ATTRIB_VALUE_QUOTED: C++,
|
|
808
|
+
ATTRIB_VALUE_CLOSED: C++,
|
|
809
|
+
ATTRIB_VALUE_UNQUOTED: C++,
|
|
810
|
+
ATTRIB_VALUE_ENTITY_Q: C++,
|
|
811
|
+
ATTRIB_VALUE_ENTITY_U: C++,
|
|
812
|
+
CLOSE_TAG: C++,
|
|
813
|
+
CLOSE_TAG_SAW_WHITE: C++,
|
|
814
|
+
SCRIPT: C++,
|
|
815
|
+
SCRIPT_ENDING: C++
|
|
816
|
+
}, t.XML_ENTITIES = {
|
|
817
|
+
amp: "&",
|
|
818
|
+
gt: ">",
|
|
819
|
+
lt: "<",
|
|
820
|
+
quot: "\"",
|
|
821
|
+
apos: "'"
|
|
822
|
+
}, t.ENTITIES = {
|
|
823
|
+
amp: "&",
|
|
824
|
+
gt: ">",
|
|
825
|
+
lt: "<",
|
|
826
|
+
quot: "\"",
|
|
827
|
+
apos: "'",
|
|
828
|
+
AElig: 198,
|
|
829
|
+
Aacute: 193,
|
|
830
|
+
Acirc: 194,
|
|
831
|
+
Agrave: 192,
|
|
832
|
+
Aring: 197,
|
|
833
|
+
Atilde: 195,
|
|
834
|
+
Auml: 196,
|
|
835
|
+
Ccedil: 199,
|
|
836
|
+
ETH: 208,
|
|
837
|
+
Eacute: 201,
|
|
838
|
+
Ecirc: 202,
|
|
839
|
+
Egrave: 200,
|
|
840
|
+
Euml: 203,
|
|
841
|
+
Iacute: 205,
|
|
842
|
+
Icirc: 206,
|
|
843
|
+
Igrave: 204,
|
|
844
|
+
Iuml: 207,
|
|
845
|
+
Ntilde: 209,
|
|
846
|
+
Oacute: 211,
|
|
847
|
+
Ocirc: 212,
|
|
848
|
+
Ograve: 210,
|
|
849
|
+
Oslash: 216,
|
|
850
|
+
Otilde: 213,
|
|
851
|
+
Ouml: 214,
|
|
852
|
+
THORN: 222,
|
|
853
|
+
Uacute: 218,
|
|
854
|
+
Ucirc: 219,
|
|
855
|
+
Ugrave: 217,
|
|
856
|
+
Uuml: 220,
|
|
857
|
+
Yacute: 221,
|
|
858
|
+
aacute: 225,
|
|
859
|
+
acirc: 226,
|
|
860
|
+
aelig: 230,
|
|
861
|
+
agrave: 224,
|
|
862
|
+
aring: 229,
|
|
863
|
+
atilde: 227,
|
|
864
|
+
auml: 228,
|
|
865
|
+
ccedil: 231,
|
|
866
|
+
eacute: 233,
|
|
867
|
+
ecirc: 234,
|
|
868
|
+
egrave: 232,
|
|
869
|
+
eth: 240,
|
|
870
|
+
euml: 235,
|
|
871
|
+
iacute: 237,
|
|
872
|
+
icirc: 238,
|
|
873
|
+
igrave: 236,
|
|
874
|
+
iuml: 239,
|
|
875
|
+
ntilde: 241,
|
|
876
|
+
oacute: 243,
|
|
877
|
+
ocirc: 244,
|
|
878
|
+
ograve: 242,
|
|
879
|
+
oslash: 248,
|
|
880
|
+
otilde: 245,
|
|
881
|
+
ouml: 246,
|
|
882
|
+
szlig: 223,
|
|
883
|
+
thorn: 254,
|
|
884
|
+
uacute: 250,
|
|
885
|
+
ucirc: 251,
|
|
886
|
+
ugrave: 249,
|
|
887
|
+
uuml: 252,
|
|
888
|
+
yacute: 253,
|
|
889
|
+
yuml: 255,
|
|
890
|
+
copy: 169,
|
|
891
|
+
reg: 174,
|
|
892
|
+
nbsp: 160,
|
|
893
|
+
iexcl: 161,
|
|
894
|
+
cent: 162,
|
|
895
|
+
pound: 163,
|
|
896
|
+
curren: 164,
|
|
897
|
+
yen: 165,
|
|
898
|
+
brvbar: 166,
|
|
899
|
+
sect: 167,
|
|
900
|
+
uml: 168,
|
|
901
|
+
ordf: 170,
|
|
902
|
+
laquo: 171,
|
|
903
|
+
not: 172,
|
|
904
|
+
shy: 173,
|
|
905
|
+
macr: 175,
|
|
906
|
+
deg: 176,
|
|
907
|
+
plusmn: 177,
|
|
908
|
+
sup1: 185,
|
|
909
|
+
sup2: 178,
|
|
910
|
+
sup3: 179,
|
|
911
|
+
acute: 180,
|
|
912
|
+
micro: 181,
|
|
913
|
+
para: 182,
|
|
914
|
+
middot: 183,
|
|
915
|
+
cedil: 184,
|
|
916
|
+
ordm: 186,
|
|
917
|
+
raquo: 187,
|
|
918
|
+
frac14: 188,
|
|
919
|
+
frac12: 189,
|
|
920
|
+
frac34: 190,
|
|
921
|
+
iquest: 191,
|
|
922
|
+
times: 215,
|
|
923
|
+
divide: 247,
|
|
924
|
+
OElig: 338,
|
|
925
|
+
oelig: 339,
|
|
926
|
+
Scaron: 352,
|
|
927
|
+
scaron: 353,
|
|
928
|
+
Yuml: 376,
|
|
929
|
+
fnof: 402,
|
|
930
|
+
circ: 710,
|
|
931
|
+
tilde: 732,
|
|
932
|
+
Alpha: 913,
|
|
933
|
+
Beta: 914,
|
|
934
|
+
Gamma: 915,
|
|
935
|
+
Delta: 916,
|
|
936
|
+
Epsilon: 917,
|
|
937
|
+
Zeta: 918,
|
|
938
|
+
Eta: 919,
|
|
939
|
+
Theta: 920,
|
|
940
|
+
Iota: 921,
|
|
941
|
+
Kappa: 922,
|
|
942
|
+
Lambda: 923,
|
|
943
|
+
Mu: 924,
|
|
944
|
+
Nu: 925,
|
|
945
|
+
Xi: 926,
|
|
946
|
+
Omicron: 927,
|
|
947
|
+
Pi: 928,
|
|
948
|
+
Rho: 929,
|
|
949
|
+
Sigma: 931,
|
|
950
|
+
Tau: 932,
|
|
951
|
+
Upsilon: 933,
|
|
952
|
+
Phi: 934,
|
|
953
|
+
Chi: 935,
|
|
954
|
+
Psi: 936,
|
|
955
|
+
Omega: 937,
|
|
956
|
+
alpha: 945,
|
|
957
|
+
beta: 946,
|
|
958
|
+
gamma: 947,
|
|
959
|
+
delta: 948,
|
|
960
|
+
epsilon: 949,
|
|
961
|
+
zeta: 950,
|
|
962
|
+
eta: 951,
|
|
963
|
+
theta: 952,
|
|
964
|
+
iota: 953,
|
|
965
|
+
kappa: 954,
|
|
966
|
+
lambda: 955,
|
|
967
|
+
mu: 956,
|
|
968
|
+
nu: 957,
|
|
969
|
+
xi: 958,
|
|
970
|
+
omicron: 959,
|
|
971
|
+
pi: 960,
|
|
972
|
+
rho: 961,
|
|
973
|
+
sigmaf: 962,
|
|
974
|
+
sigma: 963,
|
|
975
|
+
tau: 964,
|
|
976
|
+
upsilon: 965,
|
|
977
|
+
phi: 966,
|
|
978
|
+
chi: 967,
|
|
979
|
+
psi: 968,
|
|
980
|
+
omega: 969,
|
|
981
|
+
thetasym: 977,
|
|
982
|
+
upsih: 978,
|
|
983
|
+
piv: 982,
|
|
984
|
+
ensp: 8194,
|
|
985
|
+
emsp: 8195,
|
|
986
|
+
thinsp: 8201,
|
|
987
|
+
zwnj: 8204,
|
|
988
|
+
zwj: 8205,
|
|
989
|
+
lrm: 8206,
|
|
990
|
+
rlm: 8207,
|
|
991
|
+
ndash: 8211,
|
|
992
|
+
mdash: 8212,
|
|
993
|
+
lsquo: 8216,
|
|
994
|
+
rsquo: 8217,
|
|
995
|
+
sbquo: 8218,
|
|
996
|
+
ldquo: 8220,
|
|
997
|
+
rdquo: 8221,
|
|
998
|
+
bdquo: 8222,
|
|
999
|
+
dagger: 8224,
|
|
1000
|
+
Dagger: 8225,
|
|
1001
|
+
bull: 8226,
|
|
1002
|
+
hellip: 8230,
|
|
1003
|
+
permil: 8240,
|
|
1004
|
+
prime: 8242,
|
|
1005
|
+
Prime: 8243,
|
|
1006
|
+
lsaquo: 8249,
|
|
1007
|
+
rsaquo: 8250,
|
|
1008
|
+
oline: 8254,
|
|
1009
|
+
frasl: 8260,
|
|
1010
|
+
euro: 8364,
|
|
1011
|
+
image: 8465,
|
|
1012
|
+
weierp: 8472,
|
|
1013
|
+
real: 8476,
|
|
1014
|
+
trade: 8482,
|
|
1015
|
+
alefsym: 8501,
|
|
1016
|
+
larr: 8592,
|
|
1017
|
+
uarr: 8593,
|
|
1018
|
+
rarr: 8594,
|
|
1019
|
+
darr: 8595,
|
|
1020
|
+
harr: 8596,
|
|
1021
|
+
crarr: 8629,
|
|
1022
|
+
lArr: 8656,
|
|
1023
|
+
uArr: 8657,
|
|
1024
|
+
rArr: 8658,
|
|
1025
|
+
dArr: 8659,
|
|
1026
|
+
hArr: 8660,
|
|
1027
|
+
forall: 8704,
|
|
1028
|
+
part: 8706,
|
|
1029
|
+
exist: 8707,
|
|
1030
|
+
empty: 8709,
|
|
1031
|
+
nabla: 8711,
|
|
1032
|
+
isin: 8712,
|
|
1033
|
+
notin: 8713,
|
|
1034
|
+
ni: 8715,
|
|
1035
|
+
prod: 8719,
|
|
1036
|
+
sum: 8721,
|
|
1037
|
+
minus: 8722,
|
|
1038
|
+
lowast: 8727,
|
|
1039
|
+
radic: 8730,
|
|
1040
|
+
prop: 8733,
|
|
1041
|
+
infin: 8734,
|
|
1042
|
+
ang: 8736,
|
|
1043
|
+
and: 8743,
|
|
1044
|
+
or: 8744,
|
|
1045
|
+
cap: 8745,
|
|
1046
|
+
cup: 8746,
|
|
1047
|
+
int: 8747,
|
|
1048
|
+
there4: 8756,
|
|
1049
|
+
sim: 8764,
|
|
1050
|
+
cong: 8773,
|
|
1051
|
+
asymp: 8776,
|
|
1052
|
+
ne: 8800,
|
|
1053
|
+
equiv: 8801,
|
|
1054
|
+
le: 8804,
|
|
1055
|
+
ge: 8805,
|
|
1056
|
+
sub: 8834,
|
|
1057
|
+
sup: 8835,
|
|
1058
|
+
nsub: 8836,
|
|
1059
|
+
sube: 8838,
|
|
1060
|
+
supe: 8839,
|
|
1061
|
+
oplus: 8853,
|
|
1062
|
+
otimes: 8855,
|
|
1063
|
+
perp: 8869,
|
|
1064
|
+
sdot: 8901,
|
|
1065
|
+
lceil: 8968,
|
|
1066
|
+
rceil: 8969,
|
|
1067
|
+
lfloor: 8970,
|
|
1068
|
+
rfloor: 8971,
|
|
1069
|
+
lang: 9001,
|
|
1070
|
+
rang: 9002,
|
|
1071
|
+
loz: 9674,
|
|
1072
|
+
spades: 9824,
|
|
1073
|
+
clubs: 9827,
|
|
1074
|
+
hearts: 9829,
|
|
1075
|
+
diams: 9830
|
|
1076
|
+
}, Object.keys(t.ENTITIES).forEach(function(e) {
|
|
1077
|
+
var n = t.ENTITIES[e], r = typeof n == "number" ? String.fromCharCode(n) : n;
|
|
1078
|
+
t.ENTITIES[e] = r;
|
|
1079
|
+
}), t.STATE) t.STATE[t.STATE[re]] = re;
|
|
1080
|
+
C = t.STATE;
|
|
1081
|
+
function w(e, t, n) {
|
|
1082
|
+
e[t] && e[t](n);
|
|
1083
|
+
}
|
|
1084
|
+
function T(e) {
|
|
1085
|
+
var t = e && e.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);
|
|
1086
|
+
return t ? t[2] : null;
|
|
1087
|
+
}
|
|
1088
|
+
function E(e) {
|
|
1089
|
+
return e ? e.toLowerCase().replace(/[^a-z0-9]/g, "") : null;
|
|
1090
|
+
}
|
|
1091
|
+
function D(e, t) {
|
|
1092
|
+
let n = E(e), r = E(t);
|
|
1093
|
+
return !n || !r ? !0 : r === "utf16" ? n === "utf16le" || n === "utf16be" : n === r;
|
|
1094
|
+
}
|
|
1095
|
+
function ie(e, t) {
|
|
1096
|
+
if (!(!e.strict || !e.encoding || !t || t.name !== "xml")) {
|
|
1097
|
+
var n = T(t.body);
|
|
1098
|
+
n && !D(e.encoding, n) && N(e, "XML declaration encoding " + n + " does not match detected stream encoding " + e.encoding.toUpperCase());
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
function O(e, t, n) {
|
|
1102
|
+
e.textNode && k(e), w(e, t, n);
|
|
1103
|
+
}
|
|
1104
|
+
function k(e) {
|
|
1105
|
+
e.textNode = A(e.opt, e.textNode), e.textNode && w(e, "ontext", e.textNode), e.textNode = "";
|
|
1106
|
+
}
|
|
1107
|
+
function A(e, t) {
|
|
1108
|
+
return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t;
|
|
1109
|
+
}
|
|
1110
|
+
function j(e, t) {
|
|
1111
|
+
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
|
+
}
|
|
1113
|
+
function M(e) {
|
|
1114
|
+
return e.sawRoot && !e.closedRoot && N(e, "Unclosed root tag"), e.state !== C.BEGIN && e.state !== C.BEGIN_WHITESPACE && e.state !== C.TEXT && j(e, "Unexpected end"), k(e), e.c = "", e.closed = !0, w(e, "onend"), r.call(e, e.strict, e.opt), e;
|
|
1115
|
+
}
|
|
1116
|
+
function N(e, t) {
|
|
1117
|
+
if (typeof e != "object" || !(e instanceof r)) throw Error("bad call to strictFail");
|
|
1118
|
+
e.strict && j(e, t);
|
|
1119
|
+
}
|
|
1120
|
+
function ae(e) {
|
|
1121
|
+
e.strict || (e.tagName = e.tagName[e.looseCase]());
|
|
1122
|
+
var t = e.tags[e.tags.length - 1] || e, n = e.tag = {
|
|
1123
|
+
name: e.tagName,
|
|
1124
|
+
attributes: {}
|
|
1125
|
+
};
|
|
1126
|
+
e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, O(e, "onopentagstart", n);
|
|
1127
|
+
}
|
|
1128
|
+
function P(e, t) {
|
|
1129
|
+
var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), r = n[0], i = n[1];
|
|
1130
|
+
return t && e === "xmlns" && (r = "xmlns", i = ""), {
|
|
1131
|
+
prefix: r,
|
|
1132
|
+
local: i
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
function F(e) {
|
|
1136
|
+
if (e.strict || (e.attribName = e.attribName[e.looseCase]()), e.attribList.indexOf(e.attribName) !== -1 || e.tag.attributes.hasOwnProperty(e.attribName)) {
|
|
1137
|
+
e.attribName = e.attribValue = "";
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
if (e.opt.xmlns) {
|
|
1141
|
+
var t = P(e.attribName, !0), n = t.prefix, r = t.local;
|
|
1142
|
+
if (n === "xmlns") if (r === "xml" && e.attribValue !== m) N(e, "xml: prefix must be bound to " + m + "\nActual: " + e.attribValue);
|
|
1143
|
+
else if (r === "xmlns" && e.attribValue !== h) N(e, "xmlns: prefix must be bound to " + h + "\nActual: " + e.attribValue);
|
|
1144
|
+
else {
|
|
1145
|
+
var i = e.tag, a = e.tags[e.tags.length - 1] || e;
|
|
1146
|
+
i.ns === a.ns && (i.ns = Object.create(a.ns)), i.ns[r] = e.attribValue;
|
|
1147
|
+
}
|
|
1148
|
+
e.attribList.push([e.attribName, e.attribValue]);
|
|
1149
|
+
} else e.tag.attributes[e.attribName] = e.attribValue, O(e, "onattribute", {
|
|
1150
|
+
name: e.attribName,
|
|
1151
|
+
value: e.attribValue
|
|
1152
|
+
});
|
|
1153
|
+
e.attribName = e.attribValue = "";
|
|
1154
|
+
}
|
|
1155
|
+
function I(e, t) {
|
|
1156
|
+
if (e.opt.xmlns) {
|
|
1157
|
+
var n = e.tag, r = P(e.tagName);
|
|
1158
|
+
n.prefix = r.prefix, n.local = r.local, n.uri = n.ns[r.prefix] || "", n.prefix && !n.uri && (N(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = r.prefix);
|
|
1159
|
+
var i = e.tags[e.tags.length - 1] || e;
|
|
1160
|
+
n.ns && i.ns !== n.ns && Object.keys(n.ns).forEach(function(t) {
|
|
1161
|
+
O(e, "onopennamespace", {
|
|
1162
|
+
prefix: t,
|
|
1163
|
+
uri: n.ns[t]
|
|
1164
|
+
});
|
|
1165
|
+
});
|
|
1166
|
+
for (var a = 0, o = e.attribList.length; a < o; a++) {
|
|
1167
|
+
var s = e.attribList[a], c = s[0], l = s[1], u = P(c, !0), d = u.prefix, f = u.local, p = d === "" ? "" : n.ns[d] || "", m = {
|
|
1168
|
+
name: c,
|
|
1169
|
+
value: l,
|
|
1170
|
+
prefix: d,
|
|
1171
|
+
local: f,
|
|
1172
|
+
uri: p
|
|
1173
|
+
};
|
|
1174
|
+
d && d !== "xmlns" && !p && (N(e, "Unbound namespace prefix: " + JSON.stringify(d)), m.uri = d), e.tag.attributes[c] = m, O(e, "onattribute", m);
|
|
1175
|
+
}
|
|
1176
|
+
e.attribList.length = 0;
|
|
1177
|
+
}
|
|
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 = C.SCRIPT : e.state = C.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
|
|
1179
|
+
}
|
|
1180
|
+
function L(e) {
|
|
1181
|
+
if (!e.tagName) {
|
|
1182
|
+
N(e, "Weird empty close tag."), e.textNode += "</>", e.state = C.TEXT;
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
if (e.script) {
|
|
1186
|
+
if (e.tagName !== "script") {
|
|
1187
|
+
e.script += "</" + e.tagName + ">", e.tagName = "", e.state = C.SCRIPT;
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
O(e, "onscript", e.script), e.script = "";
|
|
1191
|
+
}
|
|
1192
|
+
var t = e.tags.length, n = e.tagName;
|
|
1193
|
+
e.strict || (n = n[e.looseCase]());
|
|
1194
|
+
for (var r = n; t-- && e.tags[t].name !== r;) N(e, "Unexpected close tag");
|
|
1195
|
+
if (t < 0) {
|
|
1196
|
+
N(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", e.state = C.TEXT;
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
e.tagName = n;
|
|
1200
|
+
for (var i = e.tags.length; i-- > t;) {
|
|
1201
|
+
var a = e.tag = e.tags.pop();
|
|
1202
|
+
e.tagName = e.tag.name, O(e, "onclosetag", e.tagName);
|
|
1203
|
+
var o = {};
|
|
1204
|
+
for (var s in a.ns) o[s] = a.ns[s];
|
|
1205
|
+
var c = e.tags[e.tags.length - 1] || e;
|
|
1206
|
+
e.opt.xmlns && a.ns !== c.ns && Object.keys(a.ns).forEach(function(t) {
|
|
1207
|
+
var n = a.ns[t];
|
|
1208
|
+
O(e, "onclosenamespace", {
|
|
1209
|
+
prefix: t,
|
|
1210
|
+
uri: n
|
|
1211
|
+
});
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = C.TEXT;
|
|
1215
|
+
}
|
|
1216
|
+
function oe(e) {
|
|
1217
|
+
var t = e.entity, n = t.toLowerCase(), r, i = "";
|
|
1218
|
+
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
|
+
}
|
|
1220
|
+
function R(e, t) {
|
|
1221
|
+
t === "<" ? (e.state = C.OPEN_WAKA, e.startTagPosition = e.position) : y(t) || (N(e, "Non-whitespace before first tag."), e.textNode = t, e.state = C.TEXT);
|
|
1222
|
+
}
|
|
1223
|
+
function z(e, t) {
|
|
1224
|
+
var n = "";
|
|
1225
|
+
return t < e.length && (n = e.charAt(t)), n;
|
|
1226
|
+
}
|
|
1227
|
+
function se(e) {
|
|
1228
|
+
var n = this;
|
|
1229
|
+
if (this.error) throw this.error;
|
|
1230
|
+
if (n.closed) return j(n, "Cannot write after close. Assign an onready handler.");
|
|
1231
|
+
if (e === null) return M(n);
|
|
1232
|
+
typeof e == "object" && (e = e.toString());
|
|
1233
|
+
for (var r = 0, a = ""; a = z(e, r++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
|
|
1234
|
+
case C.BEGIN:
|
|
1235
|
+
if (n.state = C.BEGIN_WHITESPACE, a === "") continue;
|
|
1236
|
+
R(n, a);
|
|
1237
|
+
continue;
|
|
1238
|
+
case C.BEGIN_WHITESPACE:
|
|
1239
|
+
R(n, a);
|
|
1240
|
+
continue;
|
|
1241
|
+
case C.TEXT:
|
|
1242
|
+
if (n.sawRoot && !n.closedRoot) {
|
|
1243
|
+
for (var o = r - 1; a && a !== "<" && a !== "&";) a = z(e, r++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
|
|
1244
|
+
n.textNode += e.substring(o, r - 1);
|
|
1245
|
+
}
|
|
1246
|
+
a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = C.OPEN_WAKA, n.startTagPosition = n.position) : (!y(a) && (!n.sawRoot || n.closedRoot) && N(n, "Text data outside of root node."), a === "&" ? n.state = C.TEXT_ENTITY : n.textNode += a);
|
|
1247
|
+
continue;
|
|
1248
|
+
case C.SCRIPT:
|
|
1249
|
+
a === "<" ? n.state = C.SCRIPT_ENDING : n.script += a;
|
|
1250
|
+
continue;
|
|
1251
|
+
case C.SCRIPT_ENDING:
|
|
1252
|
+
a === "/" ? n.state = C.CLOSE_TAG : (n.script += "<" + a, n.state = C.SCRIPT);
|
|
1253
|
+
continue;
|
|
1254
|
+
case C.OPEN_WAKA:
|
|
1255
|
+
if (a === "!") n.state = C.SGML_DECL, n.sgmlDecl = "";
|
|
1256
|
+
else if (!y(a)) if (x(_, a)) n.state = C.OPEN_TAG, n.tagName = a;
|
|
1257
|
+
else if (a === "/") n.state = C.CLOSE_TAG, n.tagName = "";
|
|
1258
|
+
else if (a === "?") n.state = C.PROC_INST, n.procInstName = n.procInstBody = "";
|
|
1259
|
+
else {
|
|
1260
|
+
if (N(n, "Unencoded <"), n.startTagPosition + 1 < n.position) {
|
|
1261
|
+
var s = n.position - n.startTagPosition;
|
|
1262
|
+
a = Array(s).join(" ") + a;
|
|
1263
|
+
}
|
|
1264
|
+
n.textNode += "<" + a, n.state = C.TEXT;
|
|
1265
|
+
}
|
|
1266
|
+
continue;
|
|
1267
|
+
case C.SGML_DECL:
|
|
1268
|
+
if (n.sgmlDecl + a === "--") {
|
|
1269
|
+
n.state = C.COMMENT, n.comment = "", n.sgmlDecl = "";
|
|
1270
|
+
continue;
|
|
1271
|
+
}
|
|
1272
|
+
n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = C.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === f ? (O(n, "onopencdata"), n.state = C.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + a).toUpperCase() === p ? (n.state = C.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 = C.TEXT) : (b(a) && (n.state = C.SGML_DECL_QUOTED), n.sgmlDecl += a);
|
|
1273
|
+
continue;
|
|
1274
|
+
case C.SGML_DECL_QUOTED:
|
|
1275
|
+
a === n.q && (n.state = C.SGML_DECL, n.q = ""), n.sgmlDecl += a;
|
|
1276
|
+
continue;
|
|
1277
|
+
case C.DOCTYPE:
|
|
1278
|
+
a === ">" ? (n.state = C.TEXT, O(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += a, a === "[" ? n.state = C.DOCTYPE_DTD : b(a) && (n.state = C.DOCTYPE_QUOTED, n.q = a));
|
|
1279
|
+
continue;
|
|
1280
|
+
case C.DOCTYPE_QUOTED:
|
|
1281
|
+
n.doctype += a, a === n.q && (n.q = "", n.state = C.DOCTYPE);
|
|
1282
|
+
continue;
|
|
1283
|
+
case C.DOCTYPE_DTD:
|
|
1284
|
+
a === "]" ? (n.doctype += a, n.state = C.DOCTYPE) : a === "<" ? (n.state = C.OPEN_WAKA, n.startTagPosition = n.position) : b(a) ? (n.doctype += a, n.state = C.DOCTYPE_DTD_QUOTED, n.q = a) : n.doctype += a;
|
|
1285
|
+
continue;
|
|
1286
|
+
case C.DOCTYPE_DTD_QUOTED:
|
|
1287
|
+
n.doctype += a, a === n.q && (n.state = C.DOCTYPE_DTD, n.q = "");
|
|
1288
|
+
continue;
|
|
1289
|
+
case C.COMMENT:
|
|
1290
|
+
a === "-" ? n.state = C.COMMENT_ENDING : n.comment += a;
|
|
1291
|
+
continue;
|
|
1292
|
+
case C.COMMENT_ENDING:
|
|
1293
|
+
a === "-" ? (n.state = C.COMMENT_ENDED, n.comment = A(n.opt, n.comment), n.comment && O(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + a, n.state = C.COMMENT);
|
|
1294
|
+
continue;
|
|
1295
|
+
case C.COMMENT_ENDED:
|
|
1296
|
+
a === ">" ? n.doctype && n.doctype !== !0 ? n.state = C.DOCTYPE_DTD : n.state = C.TEXT : (N(n, "Malformed comment"), n.comment += "--" + a, n.state = C.COMMENT);
|
|
1297
|
+
continue;
|
|
1298
|
+
case C.CDATA:
|
|
1299
|
+
for (var o = r - 1; a && a !== "]";) a = z(e, r++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
|
|
1300
|
+
n.cdata += e.substring(o, r - 1), a === "]" && (n.state = C.CDATA_ENDING);
|
|
1301
|
+
continue;
|
|
1302
|
+
case C.CDATA_ENDING:
|
|
1303
|
+
a === "]" ? n.state = C.CDATA_ENDING_2 : (n.cdata += "]" + a, n.state = C.CDATA);
|
|
1304
|
+
continue;
|
|
1305
|
+
case C.CDATA_ENDING_2:
|
|
1306
|
+
a === ">" ? (n.cdata && O(n, "oncdata", n.cdata), O(n, "onclosecdata"), n.cdata = "", n.state = C.TEXT) : a === "]" ? n.cdata += "]" : (n.cdata += "]]" + a, n.state = C.CDATA);
|
|
1307
|
+
continue;
|
|
1308
|
+
case C.PROC_INST:
|
|
1309
|
+
a === "?" ? n.state = C.PROC_INST_ENDING : y(a) ? n.state = C.PROC_INST_BODY : n.procInstName += a;
|
|
1310
|
+
continue;
|
|
1311
|
+
case C.PROC_INST_BODY:
|
|
1312
|
+
if (!n.procInstBody && y(a)) continue;
|
|
1313
|
+
a === "?" ? n.state = C.PROC_INST_ENDING : n.procInstBody += a;
|
|
1314
|
+
continue;
|
|
1315
|
+
case C.PROC_INST_ENDING:
|
|
1316
|
+
if (a === ">") {
|
|
1317
|
+
let e = {
|
|
1318
|
+
name: n.procInstName,
|
|
1319
|
+
body: n.procInstBody
|
|
1320
|
+
};
|
|
1321
|
+
ie(n, e), O(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state = C.TEXT;
|
|
1322
|
+
} else n.procInstBody += "?" + a, n.state = C.PROC_INST_BODY;
|
|
1323
|
+
continue;
|
|
1324
|
+
case C.OPEN_TAG:
|
|
1325
|
+
x(v, a) ? n.tagName += a : (ae(n), a === ">" ? I(n) : a === "/" ? n.state = C.OPEN_TAG_SLASH : (y(a) || N(n, "Invalid character in tag name"), n.state = C.ATTRIB));
|
|
1326
|
+
continue;
|
|
1327
|
+
case C.OPEN_TAG_SLASH:
|
|
1328
|
+
a === ">" ? (I(n, !0), L(n)) : (N(n, "Forward-slash in opening tag not followed by >"), n.state = C.ATTRIB);
|
|
1329
|
+
continue;
|
|
1330
|
+
case C.ATTRIB:
|
|
1331
|
+
if (y(a)) continue;
|
|
1332
|
+
a === ">" ? I(n) : a === "/" ? n.state = C.OPEN_TAG_SLASH : x(_, a) ? (n.attribName = a, n.attribValue = "", n.state = C.ATTRIB_NAME) : N(n, "Invalid attribute name");
|
|
1333
|
+
continue;
|
|
1334
|
+
case C.ATTRIB_NAME:
|
|
1335
|
+
a === "=" ? n.state = C.ATTRIB_VALUE : a === ">" ? (N(n, "Attribute without value"), n.attribValue = n.attribName, F(n), I(n)) : y(a) ? n.state = C.ATTRIB_NAME_SAW_WHITE : x(v, a) ? n.attribName += a : N(n, "Invalid attribute name");
|
|
1336
|
+
continue;
|
|
1337
|
+
case C.ATTRIB_NAME_SAW_WHITE:
|
|
1338
|
+
if (a === "=") n.state = C.ATTRIB_VALUE;
|
|
1339
|
+
else if (y(a)) continue;
|
|
1340
|
+
else N(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", O(n, "onattribute", {
|
|
1341
|
+
name: n.attribName,
|
|
1342
|
+
value: ""
|
|
1343
|
+
}), n.attribName = "", a === ">" ? I(n) : x(_, a) ? (n.attribName = a, n.state = C.ATTRIB_NAME) : (N(n, "Invalid attribute name"), n.state = C.ATTRIB);
|
|
1344
|
+
continue;
|
|
1345
|
+
case C.ATTRIB_VALUE:
|
|
1346
|
+
if (y(a)) continue;
|
|
1347
|
+
b(a) ? (n.q = a, n.state = C.ATTRIB_VALUE_QUOTED) : (n.opt.unquotedAttributeValues || j(n, "Unquoted attribute value"), n.state = C.ATTRIB_VALUE_UNQUOTED, n.attribValue = a);
|
|
1348
|
+
continue;
|
|
1349
|
+
case C.ATTRIB_VALUE_QUOTED:
|
|
1350
|
+
if (a !== n.q) {
|
|
1351
|
+
a === "&" ? n.state = C.ATTRIB_VALUE_ENTITY_Q : n.attribValue += a;
|
|
1352
|
+
continue;
|
|
1353
|
+
}
|
|
1354
|
+
F(n), n.q = "", n.state = C.ATTRIB_VALUE_CLOSED;
|
|
1355
|
+
continue;
|
|
1356
|
+
case C.ATTRIB_VALUE_CLOSED:
|
|
1357
|
+
y(a) ? n.state = C.ATTRIB : a === ">" ? I(n) : a === "/" ? n.state = C.OPEN_TAG_SLASH : x(_, a) ? (N(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = C.ATTRIB_NAME) : N(n, "Invalid attribute name");
|
|
1358
|
+
continue;
|
|
1359
|
+
case C.ATTRIB_VALUE_UNQUOTED:
|
|
1360
|
+
if (!ne(a)) {
|
|
1361
|
+
a === "&" ? n.state = C.ATTRIB_VALUE_ENTITY_U : n.attribValue += a;
|
|
1362
|
+
continue;
|
|
1363
|
+
}
|
|
1364
|
+
F(n), a === ">" ? I(n) : n.state = C.ATTRIB;
|
|
1365
|
+
continue;
|
|
1366
|
+
case C.CLOSE_TAG:
|
|
1367
|
+
if (n.tagName) a === ">" ? L(n) : x(v, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = C.SCRIPT) : (y(a) || N(n, "Invalid tagname in closing tag"), n.state = C.CLOSE_TAG_SAW_WHITE);
|
|
1368
|
+
else {
|
|
1369
|
+
if (y(a)) continue;
|
|
1370
|
+
S(_, a) ? n.script ? (n.script += "</" + a, n.state = C.SCRIPT) : N(n, "Invalid tagname in closing tag.") : n.tagName = a;
|
|
1371
|
+
}
|
|
1372
|
+
continue;
|
|
1373
|
+
case C.CLOSE_TAG_SAW_WHITE:
|
|
1374
|
+
if (y(a)) continue;
|
|
1375
|
+
a === ">" ? L(n) : N(n, "Invalid characters in closing tag");
|
|
1376
|
+
continue;
|
|
1377
|
+
case C.TEXT_ENTITY:
|
|
1378
|
+
case C.ATTRIB_VALUE_ENTITY_Q:
|
|
1379
|
+
case C.ATTRIB_VALUE_ENTITY_U:
|
|
1380
|
+
var c, l;
|
|
1381
|
+
switch (n.state) {
|
|
1382
|
+
case C.TEXT_ENTITY:
|
|
1383
|
+
c = C.TEXT, l = "textNode";
|
|
1384
|
+
break;
|
|
1385
|
+
case C.ATTRIB_VALUE_ENTITY_Q:
|
|
1386
|
+
c = C.ATTRIB_VALUE_QUOTED, l = "attribValue";
|
|
1387
|
+
break;
|
|
1388
|
+
case C.ATTRIB_VALUE_ENTITY_U:
|
|
1389
|
+
c = C.ATTRIB_VALUE_UNQUOTED, l = "attribValue";
|
|
1390
|
+
break;
|
|
1391
|
+
}
|
|
1392
|
+
if (a === ";") {
|
|
1393
|
+
var u = oe(n);
|
|
1394
|
+
n.opt.unparsedEntities && !Object.values(t.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);
|
|
1395
|
+
} else x(n.entity.length ? te : ee, a) ? n.entity += a : (N(n, "Invalid character in entity name"), n[l] += "&" + n.entity + a, n.entity = "", n.state = c);
|
|
1396
|
+
continue;
|
|
1397
|
+
default: throw Error(n, "Unknown state: " + n.state);
|
|
1398
|
+
}
|
|
1399
|
+
return n.position >= n.bufferCheckPosition && i(n), n;
|
|
1400
|
+
}
|
|
1401
|
+
/* istanbul ignore next */
|
|
1402
|
+
String.fromCodePoint || (function() {
|
|
1403
|
+
var e = String.fromCharCode, t = Math.floor, n = function() {
|
|
1404
|
+
var n = 16384, r = [], i, a, o = -1, s = arguments.length;
|
|
1405
|
+
if (!s) return "";
|
|
1406
|
+
for (var c = ""; ++o < s;) {
|
|
1407
|
+
var l = Number(arguments[o]);
|
|
1408
|
+
if (!isFinite(l) || l < 0 || l > 1114111 || t(l) !== l) throw RangeError("Invalid code point: " + l);
|
|
1409
|
+
l <= 65535 ? r.push(l) : (l -= 65536, i = (l >> 10) + 55296, a = l % 1024 + 56320, r.push(i, a)), (o + 1 === s || r.length > n) && (c += e.apply(null, r), r.length = 0);
|
|
1410
|
+
}
|
|
1411
|
+
return c;
|
|
1412
|
+
};
|
|
1413
|
+
/* istanbul ignore next */
|
|
1414
|
+
Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
|
|
1415
|
+
value: n,
|
|
1416
|
+
configurable: !0,
|
|
1417
|
+
writable: !0
|
|
1418
|
+
}) : String.fromCodePoint = n;
|
|
1419
|
+
})();
|
|
1420
|
+
})(t === void 0 ? t.sax = {} : t);
|
|
1421
|
+
})))();
|
|
1422
|
+
//#endregion
|
|
1423
|
+
//#region src/Config/Sitemap.ts
|
|
1424
|
+
var $e = (e, t) => {
|
|
1425
|
+
let n = [
|
|
1426
|
+
"# https://www.robotstxt.org/robotstxt.html",
|
|
1427
|
+
`Sitemap: ${e}/${t.filename}`,
|
|
1428
|
+
"User-agent: *",
|
|
1429
|
+
"Disallow:"
|
|
1430
|
+
];
|
|
1431
|
+
t.filename = "robots.txt", v(n.join("\r\n"), t);
|
|
1432
|
+
}, et = async (e, t, n, r) => {
|
|
1433
|
+
let i = new Ze({
|
|
1434
|
+
hostname: e,
|
|
1435
|
+
lastmodDateOnly: !1,
|
|
1436
|
+
xmlns: {
|
|
1437
|
+
news: !1,
|
|
1438
|
+
xhtml: !1,
|
|
1439
|
+
image: !1,
|
|
1440
|
+
video: !1,
|
|
1441
|
+
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
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
v(await Qe(_.from(t).pipe(i)).then((e) => e.toString()), r), n && $e(e, r);
|
|
1445
|
+
}, tt = async (e, t) => {
|
|
1446
|
+
let n = await D(e, t.spreadsheetId, t.spreadsheetTab);
|
|
1447
|
+
if (!n || n.length === 0) {
|
|
1448
|
+
console.log("No data found.");
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
O(ie(n), t.output);
|
|
1452
|
+
}, nt = async (e, t) => {
|
|
1453
|
+
let n = await D(e, t.spreadsheetId, t.spreadsheetTab);
|
|
1454
|
+
if (!n || n.length === 0) {
|
|
1455
|
+
console.log("No data found.");
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
ne(ee(n), t.output);
|
|
1459
|
+
}, rt = (e) => {
|
|
1460
|
+
try {
|
|
1461
|
+
tt(E(), e);
|
|
1462
|
+
} catch (e) {
|
|
1463
|
+
console.error(e);
|
|
1464
|
+
}
|
|
1465
|
+
}, it = (e) => {
|
|
1466
|
+
try {
|
|
1467
|
+
nt(E(), e);
|
|
1468
|
+
} catch (e) {
|
|
1469
|
+
console.error(e);
|
|
1470
|
+
}
|
|
1471
|
+
}, at = (e) => {
|
|
1472
|
+
try {
|
|
1473
|
+
let t = E();
|
|
1474
|
+
e.forEach((e) => {
|
|
1475
|
+
e.formatAs === "locales" ? tt(t, e) : e.formatAs === "config" && nt(t, e);
|
|
1476
|
+
});
|
|
1477
|
+
} catch (e) {
|
|
1478
|
+
console.error(e);
|
|
1479
|
+
}
|
|
1480
|
+
}, ot = async (e) => {
|
|
1481
|
+
try {
|
|
1482
|
+
return await D(E(), e.spreadsheetId, e.spreadsheetTab);
|
|
1483
|
+
} catch (e) {
|
|
1484
|
+
console.error(e);
|
|
1485
|
+
}
|
|
1486
|
+
return null;
|
|
1487
|
+
};
|
|
1488
|
+
//#endregion
|
|
1489
|
+
export { et as a, ot as i, it as n, re as o, rt as r, C as s, at as t };
|
|
1490
|
+
|
|
1491
|
+
//# sourceMappingURL=config-cli-BIF4xuoO.js.map
|