@shell-shock/preset-cli 0.9.13 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.cjs +8 -0
- package/dist/node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.mjs +8 -0
- package/dist/node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/index.cjs +14 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/index.mjs +15 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup-data.cjs +655 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup-data.mjs +651 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup-data.mjs.map +1 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup.cjs +48 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup.mjs +47 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup.mjs.map +1 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/utilities.cjs +24 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/utilities.mjs +24 -0
- package/dist/node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/utilities.mjs.map +1 -0
- package/dist/node_modules/.pnpm/string-width@8.2.0/node_modules/string-width/index.cjs +65 -0
- package/dist/node_modules/.pnpm/string-width@8.2.0/node_modules/string-width/index.mjs +66 -0
- package/dist/node_modules/.pnpm/string-width@8.2.0/node_modules/string-width/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.cjs +12 -0
- package/dist/node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.mjs +13 -0
- package/dist/node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.cjs +290 -3
- package/dist/node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.mjs +287 -1
- package/dist/node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.mjs.map +1 -1
- package/dist/packages/plugin-changelog/dist/components/changelog-command.cjs +4 -4
- package/dist/packages/plugin-changelog/dist/components/changelog-command.mjs +4 -4
- package/dist/packages/plugin-changelog/dist/components/changelog-command.mjs.map +1 -1
- package/dist/packages/unified/dist/html-Dw6VvFHa.cjs +612 -0
- package/dist/packages/unified/dist/html-Dw6VvFHa.mjs +613 -0
- package/dist/packages/unified/dist/html-Dw6VvFHa.mjs.map +1 -0
- package/dist/packages/unified/dist/markdown/index.cjs +1 -1
- package/dist/packages/unified/dist/markdown/index.mjs +1 -1
- package/dist/packages/unified/dist/{markdown-BiaU4FQg.cjs → markdown-BGGlzivq.cjs} +14 -50
- package/dist/packages/unified/dist/{markdown-BiaU4FQg.mjs → markdown-BGGlzivq.mjs} +16 -52
- package/dist/packages/unified/dist/markdown-BGGlzivq.mjs.map +1 -0
- package/package.json +19 -15
- package/dist/packages/unified/dist/html-DzncQodH.cjs +0 -156
- package/dist/packages/unified/dist/html-DzncQodH.mjs +0 -157
- package/dist/packages/unified/dist/html-DzncQodH.mjs.map +0 -1
- package/dist/packages/unified/dist/markdown-BiaU4FQg.mjs.map +0 -1
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_index = require('../../../node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/index.cjs');
|
|
3
|
+
const require_he$1 = require('../../../node_modules/.pnpm/he@1.2.0/node_modules/he/he.cjs');
|
|
4
|
+
const require_index$1 = require('../../../node_modules/.pnpm/normalize-html-whitespace@1.0.0/node_modules/normalize-html-whitespace/index.cjs');
|
|
5
|
+
const require_index$2 = require('../../../node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.cjs');
|
|
6
|
+
let _shell_shock_plugin_theme_helpers_constants = require("@shell-shock/plugin-theme/helpers/constants");
|
|
7
|
+
|
|
8
|
+
//#region ../unified/dist/html-Dw6VvFHa.mjs
|
|
9
|
+
var import_he = /* @__PURE__ */ require_runtime.__toESM(require_he$1.default, 1);
|
|
10
|
+
var import_normalize_html_whitespace = /* @__PURE__ */ require_runtime.__toESM(require_index$1.default, 1);
|
|
11
|
+
const a = (e) => ({
|
|
12
|
+
pre: !1,
|
|
13
|
+
lineWidth: 120,
|
|
14
|
+
fontAttrs: !0,
|
|
15
|
+
depth: 0,
|
|
16
|
+
asciiMode: !1,
|
|
17
|
+
...e
|
|
18
|
+
}), o = (e) => {
|
|
19
|
+
if (e == null) return 0;
|
|
20
|
+
let t = Number(e);
|
|
21
|
+
return Number.isFinite(t) ? t : 0;
|
|
22
|
+
}, s = (e, t) => {
|
|
23
|
+
if (!e && !t) return null;
|
|
24
|
+
if (e) {
|
|
25
|
+
let e = o(t.marginTop), n = o(t.marginBottom);
|
|
26
|
+
return {
|
|
27
|
+
...t,
|
|
28
|
+
marginTop: e,
|
|
29
|
+
marginBottom: n
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (t) {
|
|
33
|
+
let t = o(e.marginTop), n = o(e.marginBottom);
|
|
34
|
+
return {
|
|
35
|
+
...e,
|
|
36
|
+
marginTop: t,
|
|
37
|
+
marginBottom: n
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
let n = o(e.marginTop), r = o(e.marginBottom), i = o(t.marginTop), a = o(t.marginBottom);
|
|
41
|
+
if (!t.value) return {
|
|
42
|
+
marginTop: n,
|
|
43
|
+
value: e.value,
|
|
44
|
+
marginBottom: Math.max(r, i, a)
|
|
45
|
+
};
|
|
46
|
+
if (!e.value) return {
|
|
47
|
+
marginTop: Math.max(n, r, i),
|
|
48
|
+
value: t.value,
|
|
49
|
+
marginBottom: a
|
|
50
|
+
};
|
|
51
|
+
let s = Math.max(r, i);
|
|
52
|
+
return {
|
|
53
|
+
marginTop: n,
|
|
54
|
+
value: `${e.value}${`
|
|
55
|
+
`.repeat(s)}${t.value}`,
|
|
56
|
+
marginBottom: a
|
|
57
|
+
};
|
|
58
|
+
}, c = (e, t) => e == null && t == null ? null : e == null ? t : t == null ? e : t.value == null ? {
|
|
59
|
+
pre: e.pre,
|
|
60
|
+
value: e.value,
|
|
61
|
+
post: e.post ?? t.pre ?? t.post ?? ``,
|
|
62
|
+
type: `inline`,
|
|
63
|
+
nodeName: e.nodeName
|
|
64
|
+
} : e.value == null ? {
|
|
65
|
+
pre: e.pre ?? e.post ?? t.pre ?? ``,
|
|
66
|
+
value: t.value,
|
|
67
|
+
post: t.post,
|
|
68
|
+
type: `inline`,
|
|
69
|
+
nodeName: t.nodeName
|
|
70
|
+
} : e.post == null ? t.pre == null ? {
|
|
71
|
+
pre: e.pre,
|
|
72
|
+
value: `${e.value}${t.value}`,
|
|
73
|
+
post: t.post,
|
|
74
|
+
type: `inline`,
|
|
75
|
+
nodeName: t.nodeName
|
|
76
|
+
} : {
|
|
77
|
+
pre: e.pre,
|
|
78
|
+
value: `${e.value}${t.pre}${t.value}`,
|
|
79
|
+
post: t.post,
|
|
80
|
+
type: `inline`,
|
|
81
|
+
nodeName: t.nodeName
|
|
82
|
+
} : {
|
|
83
|
+
pre: e.pre,
|
|
84
|
+
value: `${e.value}${e.post}${t.value}`,
|
|
85
|
+
post: t.post,
|
|
86
|
+
type: `inline`,
|
|
87
|
+
nodeName: t.nodeName
|
|
88
|
+
}, l = /* @__PURE__ */ new WeakMap(), u = (e, t, n = null) => {
|
|
89
|
+
if (!e || typeof e != `object` || !t || typeof t != `string`) return n;
|
|
90
|
+
let r = l.get(e);
|
|
91
|
+
if (r) {
|
|
92
|
+
let e = r.get(t);
|
|
93
|
+
if (e !== void 0) return e ?? n;
|
|
94
|
+
}
|
|
95
|
+
if (!e.attrs || !Array.isArray(e.attrs) || e.attrs.length === 0) return r || (r = /* @__PURE__ */ new Map(), l.set(e, r)), r.set(t, null), n;
|
|
96
|
+
let i = e.attrs.find((e) => e && typeof e == `object` && e.name === t);
|
|
97
|
+
if (r || (r = /* @__PURE__ */ new Map(), l.set(e, r)), !i || i.value === void 0) return r.set(t, null), n;
|
|
98
|
+
let a = i.value;
|
|
99
|
+
return r.set(t, a), a;
|
|
100
|
+
};
|
|
101
|
+
function d(e) {
|
|
102
|
+
let t = u(e, `class`, null);
|
|
103
|
+
return t ? t.split(/\s+/).map((e) => e.trim()).filter((e) => e.length > 0) : [];
|
|
104
|
+
}
|
|
105
|
+
const f = (e, t) => require_index$2.default(e, t.lineWidth ?? 80, { trim: !t.pre }), p = import_he.default.decode, ee = import_normalize_html_whitespace.default, m = (e) => e ? {
|
|
106
|
+
...e,
|
|
107
|
+
marginTop: 0,
|
|
108
|
+
marginBottom: 0,
|
|
109
|
+
type: `block`,
|
|
110
|
+
nodeName: `#blockTag`
|
|
111
|
+
} : null, te = (e, t) => {
|
|
112
|
+
let n = String(e.value ?? ``);
|
|
113
|
+
if (t.pre) return {
|
|
114
|
+
pre: null,
|
|
115
|
+
value: p(n),
|
|
116
|
+
post: null,
|
|
117
|
+
type: `inline`,
|
|
118
|
+
nodeName: `#text`
|
|
119
|
+
};
|
|
120
|
+
let r = [...(ee(n) || ``).replaceAll(`
|
|
121
|
+
`, ` `)], i = [` `, `
|
|
122
|
+
`].includes(r[0] ?? ``) ? r.shift() ?? null : null, a = [` `, `
|
|
123
|
+
`].includes(r.at(-1) ?? ``) ? r.pop() ?? null : null;
|
|
124
|
+
return {
|
|
125
|
+
pre: i,
|
|
126
|
+
value: r.length > 0 ? `${p(r.join(``))}` : null,
|
|
127
|
+
post: a,
|
|
128
|
+
type: `inline`,
|
|
129
|
+
nodeName: `#text`
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
function h(e, t) {
|
|
133
|
+
return (n, r) => {
|
|
134
|
+
let i = e ?? ((e) => e);
|
|
135
|
+
if (!n || !n.childNodes) return null;
|
|
136
|
+
let a = Number.parseInt(u(n, `start`, `1`) ?? `1`, 10), o = n.childNodes.reduce((e, t) => {
|
|
137
|
+
let n = $(t, {
|
|
138
|
+
...r,
|
|
139
|
+
liItemNumber: a
|
|
140
|
+
});
|
|
141
|
+
return n ? (n.nodeName === `li` && (a += 1), n.type === `inline` ? {
|
|
142
|
+
block: e.block,
|
|
143
|
+
inline: c(e.inline, n)
|
|
144
|
+
} : (e.inline && e.inline.value && (e.inline.value = f(e.inline.value, r)), e.block = s(e.block ?? null, m(e.inline) ?? null), e.block = s(e.block ?? null, n), {
|
|
145
|
+
block: e.block,
|
|
146
|
+
inline: null
|
|
147
|
+
})) : e;
|
|
148
|
+
}, {
|
|
149
|
+
block: null,
|
|
150
|
+
inline: null
|
|
151
|
+
});
|
|
152
|
+
o.inline && o.inline.value && (o.inline.value = f(o.inline.value, r)), o.block = s(o.block ?? null, m(o.inline) ?? null);
|
|
153
|
+
let l = t?.marginTop ?? 0;
|
|
154
|
+
l = !r || !r.pre ? l + 1 : l;
|
|
155
|
+
let d = t?.marginBottom ?? 0;
|
|
156
|
+
return d = !r || !r.pre ? d + 1 : d, !o.block || !o.block.value ? {
|
|
157
|
+
marginTop: l,
|
|
158
|
+
value: ``,
|
|
159
|
+
marginBottom: d,
|
|
160
|
+
type: `block`,
|
|
161
|
+
nodeName: n.nodeName
|
|
162
|
+
} : {
|
|
163
|
+
marginTop: o.block.marginTop && o.block.marginTop > l ? o.block.marginTop : l,
|
|
164
|
+
value: i(o.block.value, n, r),
|
|
165
|
+
marginBottom: o.block.marginBottom && o.block.marginBottom > d ? o.block.marginBottom : d,
|
|
166
|
+
type: `block`,
|
|
167
|
+
nodeName: n.nodeName
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
const g = (e) => (t, n) => {
|
|
172
|
+
let r = e ?? ((e) => e ?? null), i = X.span;
|
|
173
|
+
if (!t || !t.childNodes) return;
|
|
174
|
+
let a = t.childNodes.reduce((e, r) => {
|
|
175
|
+
let a = $(r, n, i);
|
|
176
|
+
return a ? {
|
|
177
|
+
...c(e, a),
|
|
178
|
+
type: `inline`,
|
|
179
|
+
nodeName: t.nodeName
|
|
180
|
+
} : e;
|
|
181
|
+
}, null);
|
|
182
|
+
return {
|
|
183
|
+
pre: a?.pre ? r(a.pre, t, n) : null,
|
|
184
|
+
value: r(a?.value, t, n),
|
|
185
|
+
post: a?.post ? r(a.post, t, n) : null,
|
|
186
|
+
type: `inline`,
|
|
187
|
+
nodeName: t.nodeName
|
|
188
|
+
};
|
|
189
|
+
}, _ = () => void 0, ne = g((e, t, n) => {
|
|
190
|
+
let r = u(t, `href`, null), i = u(t, `title`, null), a = !r || [
|
|
191
|
+
`file://`,
|
|
192
|
+
`http://`,
|
|
193
|
+
`https://`,
|
|
194
|
+
`mailto:`,
|
|
195
|
+
`ftp://`,
|
|
196
|
+
`ftps://`,
|
|
197
|
+
`sftp://`,
|
|
198
|
+
`ssh://`,
|
|
199
|
+
`dav://`,
|
|
200
|
+
`tel:`,
|
|
201
|
+
`git://`
|
|
202
|
+
].some((e) => r.startsWith(e)) ? r : null;
|
|
203
|
+
return a ? `link("${a}", ${i ? `"${i}", ` : ``}${a && (a.startsWith(`http://`) || a.startsWith(`https://`)) ? `true` : `false`})` : i ? `"${i}"` : ``;
|
|
204
|
+
}), v = g((e, t) => {
|
|
205
|
+
let n = u(t, `title`, null);
|
|
206
|
+
return e ? n ? `${e} (${n})` : e : ``;
|
|
207
|
+
}), re = v, ie = v;
|
|
208
|
+
function y(e) {
|
|
209
|
+
return `textColors.body.primary(${JSON.stringify(String(e ?? ``))})`;
|
|
210
|
+
}
|
|
211
|
+
function b(e) {
|
|
212
|
+
return JSON.stringify(String(e ?? ``));
|
|
213
|
+
}
|
|
214
|
+
function x(e) {
|
|
215
|
+
return `inlineCode(${b(e)})`;
|
|
216
|
+
}
|
|
217
|
+
function S(e, t) {
|
|
218
|
+
return `code(${JSON.stringify(e)}${t ? `, ${JSON.stringify(t)}` : ``})`;
|
|
219
|
+
}
|
|
220
|
+
function C(e) {
|
|
221
|
+
return e ? typeof e.value == `string` ? e.value : !e.childNodes || e.childNodes.length === 0 ? `` : e.childNodes.map((e) => C(e)).join(``) : ``;
|
|
222
|
+
}
|
|
223
|
+
function w(e) {
|
|
224
|
+
return e.replaceAll(/\s+/g, ` `).trim();
|
|
225
|
+
}
|
|
226
|
+
function T(e, t, n = null, r = null) {
|
|
227
|
+
return {
|
|
228
|
+
pre: n,
|
|
229
|
+
value: t,
|
|
230
|
+
post: r,
|
|
231
|
+
type: `inline`,
|
|
232
|
+
nodeName: e
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function E(e, t, n = 0, r = 0) {
|
|
236
|
+
return {
|
|
237
|
+
marginTop: n,
|
|
238
|
+
value: t,
|
|
239
|
+
marginBottom: r,
|
|
240
|
+
type: `block`,
|
|
241
|
+
nodeName: e
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function ae(e) {
|
|
245
|
+
if (!e) return null;
|
|
246
|
+
let t = u(e, `class`, ``)?.split(/\s+/).map((e) => e.trim()).filter(Boolean) ?? [];
|
|
247
|
+
for (let e of t) {
|
|
248
|
+
if (e.startsWith(`language-`)) return e.slice(9) || null;
|
|
249
|
+
if (e.startsWith(`lang-`)) return e.slice(5) || null;
|
|
250
|
+
}
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
function D(e, t, n = 10, r = `#`, i = `-`) {
|
|
254
|
+
if (!Number.isFinite(e) || !Number.isFinite(t) || t <= 0) return i.repeat(n);
|
|
255
|
+
let a = Math.max(0, Math.min(1, e / t)), o = Math.round(a * n);
|
|
256
|
+
return r.repeat(o) + i.repeat(Math.max(n - o, 0));
|
|
257
|
+
}
|
|
258
|
+
const oe = h((e) => y(e)), se = g((e) => y(e)), ce = g((e) => y(e));
|
|
259
|
+
function O(e) {
|
|
260
|
+
return String(e ?? ``).replaceAll(`\\`, `\\\\`).replaceAll("`", "\\`").replaceAll("${", "\\${").replaceAll(`
|
|
261
|
+
`, `\\n`).replaceAll(`\r`, `\\r`).replaceAll(` `, `\\t`);
|
|
262
|
+
}
|
|
263
|
+
const k = (e) => h((e) => `textColors.body.primary(\`${O(e)}\`)`), A = (e) => g((e) => `textColors.body.primary(\`${O(e)}\`)`), le = h((e) => `textColors.body.primary(\`${O(e)}\`)`, {
|
|
264
|
+
marginTop: 1,
|
|
265
|
+
marginBottom: 1
|
|
266
|
+
}), ue = A(`label`);
|
|
267
|
+
A(`blink`);
|
|
268
|
+
const de = k(`div`), fe = k(`header`), pe = k(`article`), me = k(`footer`), he = k(`section`), ge = k(`main`), _e = k(`nav`), ve = k(`aside`), j = k(`form`), M = k(`picture`), N = k(`hgroup`), P = k(`dialog`), F = g((e) => `blockquote(${e ? `\`${O(e)}\`` : `''`})`), ye = () => ({
|
|
269
|
+
pre: ``,
|
|
270
|
+
value: `
|
|
271
|
+
`,
|
|
272
|
+
post: ``,
|
|
273
|
+
type: `inline`
|
|
274
|
+
}), be = h((e) => y(e)), xe = g((e) => x(e));
|
|
275
|
+
function Se(e, t) {
|
|
276
|
+
let n = e.childNodes?.find((e) => e.nodeName === `code`) ?? null, r = C(n ?? e).replaceAll(/\n+$/g, ``), i = ae(n ?? e);
|
|
277
|
+
return E(e.nodeName, S(r, i), 1, 1);
|
|
278
|
+
}
|
|
279
|
+
const Ce = g((e, t) => {
|
|
280
|
+
let n = u(t, `value`, null), r = String(e ?? ``);
|
|
281
|
+
return y(n && r && n !== r ? `${r} (${n})` : r || n || ``);
|
|
282
|
+
}), we = h(void 0, {
|
|
283
|
+
marginTop: 1,
|
|
284
|
+
marginBottom: 1
|
|
285
|
+
}), Te = h((e) => `bold(${b(e)})`), Ee = h((e) => y(` ${String(e ?? ``)}`)), De = (e, t) => ({
|
|
286
|
+
pre: null,
|
|
287
|
+
value: `bold(${b(w(e.childNodes?.map((e) => e.value ?? ``).join(``) ?? ``))})`,
|
|
288
|
+
post: null,
|
|
289
|
+
type: `inline`,
|
|
290
|
+
nodeName: e.nodeName
|
|
291
|
+
});
|
|
292
|
+
function Oe(e, t) {
|
|
293
|
+
let n = w((e.childNodes?.find((e) => e.nodeName === `summary`) ?? null)?.childNodes?.map((e) => e.value ?? ``).join(``) ?? `Details`), r = w((e.childNodes ?? []).filter((e) => e.nodeName !== `summary`).map((e) => typeof e.value == `string` ? e.value : e.childNodes?.map((e) => e.value ?? ``).join(``) ?? ``).join(`
|
|
294
|
+
`)), i = u(e, `open`, null) === null ? `[+]` : `[-]`, a = r ? `${i} ${n}\n${r}` : `${i} ${n}`;
|
|
295
|
+
return E(e.nodeName, `blockquote(${b(a)})`, 1, 1);
|
|
296
|
+
}
|
|
297
|
+
const I = h(), ke = I, Ae = I, je = g((e) => `bold(${b(e)})`);
|
|
298
|
+
function Me(e, t) {
|
|
299
|
+
let n = w((e.childNodes?.find((e) => e.nodeName === `legend`) ?? null)?.childNodes?.map((e) => e.value ?? ``).join(``) ?? ``), r = w((e.childNodes ?? []).filter((e) => e.nodeName !== `legend`).map((e) => typeof e.value == `string` ? e.value : e.childNodes?.map((e) => e.value ?? ``).join(``) ?? ``).join(`
|
|
300
|
+
`)), i = n ? `${n}\n${r}`.trim() : r;
|
|
301
|
+
return E(e.nodeName, `blockquote(${b(i)})`, 1, 1);
|
|
302
|
+
}
|
|
303
|
+
const Ne = h((e) => `italic(${b(e)})`);
|
|
304
|
+
function Pe(e, t) {
|
|
305
|
+
let n = w((e.childNodes?.find((e) => e.nodeName === `figcaption`) ?? null)?.childNodes?.map((e) => e.value ?? ``).join(``) ?? ``), r = w((e.childNodes ?? []).filter((e) => e.nodeName !== `figcaption`).map((e) => typeof e.value == `string` ? e.value : e.childNodes?.map((e) => e.value ?? ``).join(``) ?? ``).join(`
|
|
306
|
+
`)), i = n ? `${r}\n${n}`.trim() : r;
|
|
307
|
+
return E(e.nodeName, `blockquote(${b(i)})`, 1, 1);
|
|
308
|
+
}
|
|
309
|
+
const L = (e) => h((t) => `bold(textColors.heading.${e === 1 ? `primary` : e === 2 ? `secondary` : `tertiary`}(${b(t)}))`, {
|
|
310
|
+
marginTop: 1,
|
|
311
|
+
marginBottom: 1
|
|
312
|
+
}), Fe = L(1), Ie = L(2), Le = L(3), Re = L(4), ze = L(5), Be = L(6);
|
|
313
|
+
function Ve(e, t) {
|
|
314
|
+
return E(e.nodeName, `divider({ border: "primary" })`, 1, 1);
|
|
315
|
+
}
|
|
316
|
+
function He(e, t) {
|
|
317
|
+
let n = u(e, `alt`, null), r = u(e, `src`, null), i = n || r ? `[Image: ${n || r}]` : `[Image]`;
|
|
318
|
+
return T(e.nodeName, y(i));
|
|
319
|
+
}
|
|
320
|
+
function Ue(e, t) {
|
|
321
|
+
let n = (u(e, `type`, `text`) || `text`).toLowerCase(), r = u(e, `value`, ``) || ``, i = u(e, `placeholder`, ``) || ``, a = u(e, `checked`, null) !== null;
|
|
322
|
+
if (n === `hidden`) return null;
|
|
323
|
+
if (n === `checkbox`) return T(e.nodeName, y(a ? `[x]` : `[ ]`));
|
|
324
|
+
if (n === `radio`) return T(e.nodeName, y(a ? `(o)` : `( )`));
|
|
325
|
+
if ([
|
|
326
|
+
`submit`,
|
|
327
|
+
`button`,
|
|
328
|
+
`reset`
|
|
329
|
+
].includes(n)) return T(e.nodeName, `bold(${JSON.stringify(`[ ${r || n} ]`)})`);
|
|
330
|
+
if (n === `range`) {
|
|
331
|
+
let t = Number.parseFloat(u(e, `max`, `100`) || `100`), n = Number.parseFloat(u(e, `value`, `0`) || `0`), r = D(n, t, 10, `=`, `-`);
|
|
332
|
+
return T(e.nodeName, y(`[${r}] ${Math.round(n)}/${Math.round(t)}`));
|
|
333
|
+
}
|
|
334
|
+
return T(e.nodeName, y(`[${r || i}]`));
|
|
335
|
+
}
|
|
336
|
+
const We = g((e) => `bold(${JSON.stringify(`[ ${String(e ?? `button`)} ]`)})`), Ge = g((e) => y(e)), Ke = h((e, t) => {
|
|
337
|
+
let n = Number.parseInt(u(t, `rows`, `0`) || `0`, 10), r = C(t);
|
|
338
|
+
return n > 1 || r.includes(`
|
|
339
|
+
`) ? S(r) : y(e);
|
|
340
|
+
});
|
|
341
|
+
function qe(e) {
|
|
342
|
+
return (e.childNodes ?? []).filter((e) => e.nodeName === `li`);
|
|
343
|
+
}
|
|
344
|
+
function R(e, t) {
|
|
345
|
+
let n = qe(e).map((e, n) => {
|
|
346
|
+
let r = w(C(e));
|
|
347
|
+
return `${t(n)} ${r}`.trimEnd();
|
|
348
|
+
});
|
|
349
|
+
return E(e.nodeName, y(n.join(`
|
|
350
|
+
`)), 1, 1);
|
|
351
|
+
}
|
|
352
|
+
function z(e, t) {
|
|
353
|
+
let n = u(e, `type`, `disc`) || `disc`, r = n === `square` ? `▪` : n === `circle` ? `◦` : `•`;
|
|
354
|
+
return R(e, () => r);
|
|
355
|
+
}
|
|
356
|
+
function Je(e, t) {
|
|
357
|
+
let n = Number.parseInt(u(e, `start`, `1`) || `1`, 10);
|
|
358
|
+
return R(e, (e) => `${n + e}.`);
|
|
359
|
+
}
|
|
360
|
+
function B(e, t) {
|
|
361
|
+
let n = w(C(e));
|
|
362
|
+
return E(e.nodeName, y(n));
|
|
363
|
+
}
|
|
364
|
+
const Ye = g((e, t) => {
|
|
365
|
+
let n = d(t).find((e) => e.startsWith(`message-type-`))?.replace(`message-type-`, ``);
|
|
366
|
+
(!n || !_shell_shock_plugin_theme_helpers_constants.THEME_MESSAGE_VARIANTS.includes(n)) && (n = `info`);
|
|
367
|
+
let r = t.childNodes?.find((e) => e.type === `message-header` || e.type === `message-title`)?.value;
|
|
368
|
+
return `${n}(${e ? `\`${O(e)}\`` : `''`}${r ? `, \`${O(r)}\`` : ``})`;
|
|
369
|
+
});
|
|
370
|
+
function Xe(e, t) {
|
|
371
|
+
let n = Number.parseFloat(u(e, `min`, `0`) || `0`), r = Number.parseFloat(u(e, `max`, `1`) || `1`), i = Number.parseFloat(u(e, `value`, String(n)) || String(n)), a = Math.max(0, i - n), o = Math.max(1, r - n), s = C(e).trim(), c = Math.round(a / o * 100), l = D(a, o, 10, `#`, `-`);
|
|
372
|
+
return T(e.nodeName, y(`${s ? `${s} ` : ``}[${l}] ${c}%`));
|
|
373
|
+
}
|
|
374
|
+
function Ze(e, t) {
|
|
375
|
+
let n = Number.parseFloat(u(e, `max`, `1`) || `1`), r = Number.parseFloat(u(e, `value`, `0`) || `0`), i = C(e).trim(), a = Math.round(Math.max(0, r) / Math.max(1, n) * 100), o = D(r, n, 10, `=`, `-`);
|
|
376
|
+
return T(e.nodeName, y(`${i ? `${i} ` : ``}[${o}] ${a}%`));
|
|
377
|
+
}
|
|
378
|
+
const Qe = g((e) => y(e)), $e = g((e) => `textColors.body.primary(${JSON.stringify(` (${String(e ?? ``)})`)})`), et = _, tt = g((e) => y(e)), nt = h((e) => `bold(${b(e)})`);
|
|
379
|
+
function V(e, t = ``) {
|
|
380
|
+
let n = [];
|
|
381
|
+
for (let r of e.childNodes ?? []) {
|
|
382
|
+
if (r.nodeName === `optgroup`) {
|
|
383
|
+
let e = u(r, `label`, ``) || w(C(r));
|
|
384
|
+
n.push(`${t}${e}:`), n.push(...V(r, `${t} `));
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
if (r.nodeName === `option`) {
|
|
388
|
+
let e = u(r, `selected`, null) !== null;
|
|
389
|
+
n.push(`${t}${e ? `*` : `-`} ${w(C(r))}`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return n;
|
|
393
|
+
}
|
|
394
|
+
function rt(e, t) {
|
|
395
|
+
let n = V(e);
|
|
396
|
+
return E(e.nodeName, y(n.join(`
|
|
397
|
+
`)), 1, 1);
|
|
398
|
+
}
|
|
399
|
+
const it = g((e) => y(e));
|
|
400
|
+
function H(e) {
|
|
401
|
+
if (!e?.childNodes) return [];
|
|
402
|
+
let t = [];
|
|
403
|
+
for (let n of e.childNodes) {
|
|
404
|
+
if (n.nodeName === `tr`) {
|
|
405
|
+
t.push(n);
|
|
406
|
+
continue;
|
|
407
|
+
}
|
|
408
|
+
[
|
|
409
|
+
`thead`,
|
|
410
|
+
`tbody`,
|
|
411
|
+
`tfoot`
|
|
412
|
+
].includes(n.nodeName ?? ``) && t.push(...H(n));
|
|
413
|
+
}
|
|
414
|
+
return t;
|
|
415
|
+
}
|
|
416
|
+
function at(e) {
|
|
417
|
+
return (e.childNodes ?? []).filter((e) => [`td`, `th`].includes(e.nodeName ?? ``)).map((e) => w(C(e)));
|
|
418
|
+
}
|
|
419
|
+
const ot = h((e) => `italic(${b(e)})`), st = h(), ct = h(), lt = h(), ut = h(), dt = h(), ft = h(), pt = h((e) => y(e)), mt = h((e) => `bold(${b(e)})`);
|
|
420
|
+
function ht(e, t) {
|
|
421
|
+
let n = H(e).map(at).filter((e) => e.length > 0);
|
|
422
|
+
return E(e.nodeName, `table(${JSON.stringify(n)})`, 1, 1);
|
|
423
|
+
}
|
|
424
|
+
const U = g((e) => y(e)), W = g((e) => `bold(${b(e)})`), G = g((e) => `italic(${b(e)})`), K = g((e) => `underline(${b(e)})`), q = g((e) => `strikethrough(${b(e)})`), J = g((e) => x(e)), gt = W, _t = U, vt = U, yt = U, bt = W, xt = G, St = q, Ct = G, wt = U, Tt = G, Et = K, Dt = G, Ot = J, kt = g((e) => `underline(bold(${b(e)}))`), At = U, jt = g((e) => y(`"${String(e ?? ``)}"`)), Mt = q, Nt = J, Pt = U, Ft = q, It = q, Lt = W, Y = U, Rt = U, zt = U, Bt = J, Vt = K, Ht = K, Ut = J;
|
|
425
|
+
var X = {
|
|
426
|
+
"#text": te,
|
|
427
|
+
a: ne,
|
|
428
|
+
abbr: v,
|
|
429
|
+
acronym: re,
|
|
430
|
+
address: oe,
|
|
431
|
+
applet: _,
|
|
432
|
+
area: _,
|
|
433
|
+
article: pe,
|
|
434
|
+
aside: ve,
|
|
435
|
+
audio: _,
|
|
436
|
+
b: gt,
|
|
437
|
+
base: _,
|
|
438
|
+
basefont: _,
|
|
439
|
+
bdi: _t,
|
|
440
|
+
bdo: vt,
|
|
441
|
+
bgsound: _,
|
|
442
|
+
big: yt,
|
|
443
|
+
blink: se,
|
|
444
|
+
dialog: P,
|
|
445
|
+
div: de,
|
|
446
|
+
blockquote: F,
|
|
447
|
+
body: Ae,
|
|
448
|
+
bold: bt,
|
|
449
|
+
br: ye,
|
|
450
|
+
button: We,
|
|
451
|
+
canvas: _,
|
|
452
|
+
caption: ot,
|
|
453
|
+
center: be,
|
|
454
|
+
cite: xt,
|
|
455
|
+
code: xe,
|
|
456
|
+
col: dt,
|
|
457
|
+
colgroup: ft,
|
|
458
|
+
data: Ce,
|
|
459
|
+
datalist: _,
|
|
460
|
+
dd: Ee,
|
|
461
|
+
del: St,
|
|
462
|
+
details: Oe,
|
|
463
|
+
dfn: ie,
|
|
464
|
+
footer: me,
|
|
465
|
+
form: j,
|
|
466
|
+
dl: we,
|
|
467
|
+
dt: Te,
|
|
468
|
+
em: Ct,
|
|
469
|
+
embed: _,
|
|
470
|
+
fieldset: Me,
|
|
471
|
+
figcaption: Ne,
|
|
472
|
+
figure: Pe,
|
|
473
|
+
font: wt,
|
|
474
|
+
frame: _,
|
|
475
|
+
frameset: _,
|
|
476
|
+
h1: Fe,
|
|
477
|
+
h2: Ie,
|
|
478
|
+
h3: Le,
|
|
479
|
+
h4: Re,
|
|
480
|
+
h5: ze,
|
|
481
|
+
h6: Be,
|
|
482
|
+
head: _,
|
|
483
|
+
header: fe,
|
|
484
|
+
hgroup: N,
|
|
485
|
+
hr: Ve,
|
|
486
|
+
html: ke,
|
|
487
|
+
i: Tt,
|
|
488
|
+
iframe: _,
|
|
489
|
+
img: He,
|
|
490
|
+
input: Ue,
|
|
491
|
+
ins: Et,
|
|
492
|
+
italic: Dt,
|
|
493
|
+
kbd: Ot,
|
|
494
|
+
keygen: _,
|
|
495
|
+
label: ue,
|
|
496
|
+
legend: je,
|
|
497
|
+
li: B,
|
|
498
|
+
link: _,
|
|
499
|
+
main: ge,
|
|
500
|
+
map: _,
|
|
501
|
+
mark: kt,
|
|
502
|
+
marquee: ce,
|
|
503
|
+
math: _,
|
|
504
|
+
menu: z,
|
|
505
|
+
menuitem: B,
|
|
506
|
+
message: Ye,
|
|
507
|
+
meta: _,
|
|
508
|
+
meter: Xe,
|
|
509
|
+
nav: _e,
|
|
510
|
+
nobr: At,
|
|
511
|
+
noframes: _,
|
|
512
|
+
noscript: _,
|
|
513
|
+
object: _,
|
|
514
|
+
ol: Je,
|
|
515
|
+
optgroup: nt,
|
|
516
|
+
option: tt,
|
|
517
|
+
output: Ge,
|
|
518
|
+
p: le,
|
|
519
|
+
param: _,
|
|
520
|
+
picture: M,
|
|
521
|
+
plaintext: _,
|
|
522
|
+
portal: _,
|
|
523
|
+
pre: Se,
|
|
524
|
+
progress: Ze,
|
|
525
|
+
q: jt,
|
|
526
|
+
rp: et,
|
|
527
|
+
rt: $e,
|
|
528
|
+
ruby: Qe,
|
|
529
|
+
s: Mt,
|
|
530
|
+
samp: Nt,
|
|
531
|
+
script: _,
|
|
532
|
+
section: he,
|
|
533
|
+
select: rt,
|
|
534
|
+
slot: _,
|
|
535
|
+
small: Pt,
|
|
536
|
+
source: _,
|
|
537
|
+
span: it,
|
|
538
|
+
strike: Ft,
|
|
539
|
+
strikethrough: It,
|
|
540
|
+
strong: Lt,
|
|
541
|
+
style: _,
|
|
542
|
+
sub: Y,
|
|
543
|
+
summary: De,
|
|
544
|
+
sup: Rt,
|
|
545
|
+
svg: _,
|
|
546
|
+
table: ht,
|
|
547
|
+
tbody: lt,
|
|
548
|
+
td: pt,
|
|
549
|
+
template: _,
|
|
550
|
+
textarea: Ke,
|
|
551
|
+
tfoot: ut,
|
|
552
|
+
th: mt,
|
|
553
|
+
thead: ct,
|
|
554
|
+
time: zt,
|
|
555
|
+
title: _,
|
|
556
|
+
tr: st,
|
|
557
|
+
track: _,
|
|
558
|
+
tt: Bt,
|
|
559
|
+
u: Vt,
|
|
560
|
+
ul: z,
|
|
561
|
+
underline: Ht,
|
|
562
|
+
var: Ut,
|
|
563
|
+
video: _,
|
|
564
|
+
wbr: _,
|
|
565
|
+
xmp: _
|
|
566
|
+
};
|
|
567
|
+
const Z = process.env.CACHE_RENDER !== `false`, Q = /* @__PURE__ */ new WeakMap(), Wt = (e, t) => {
|
|
568
|
+
if (!Z || !e || typeof e != `object`) return;
|
|
569
|
+
let n = Q.get(e);
|
|
570
|
+
if (n) return n.get(JSON.stringify({
|
|
571
|
+
lineWidth: t.lineWidth,
|
|
572
|
+
pre: t.pre,
|
|
573
|
+
listDepth: t.listDepth,
|
|
574
|
+
listType: t.listType,
|
|
575
|
+
depth: t.depth
|
|
576
|
+
}));
|
|
577
|
+
}, Gt = (e, t, n) => {
|
|
578
|
+
if (!Z || !e || typeof e != `object`) return;
|
|
579
|
+
let r = Q.get(e);
|
|
580
|
+
if (r || (r = /* @__PURE__ */ new Map(), Q.set(e, r)), r.set(JSON.stringify({
|
|
581
|
+
lineWidth: t.lineWidth,
|
|
582
|
+
pre: t.pre,
|
|
583
|
+
listDepth: t.listDepth,
|
|
584
|
+
listType: t.listType,
|
|
585
|
+
depth: t.depth
|
|
586
|
+
}), n), r.size > 10) {
|
|
587
|
+
let e = r.keys().next().value;
|
|
588
|
+
r.delete(e);
|
|
589
|
+
}
|
|
590
|
+
}, $ = (e, t, n = X.div) => {
|
|
591
|
+
if (!e) return null;
|
|
592
|
+
let r = t.depth ?? 0;
|
|
593
|
+
if (r >= 100) return null;
|
|
594
|
+
let i = {
|
|
595
|
+
...t,
|
|
596
|
+
depth: r + 1
|
|
597
|
+
}, a = Wt(e, i);
|
|
598
|
+
if (a !== void 0) return a;
|
|
599
|
+
let o = null;
|
|
600
|
+
try {
|
|
601
|
+
o = (X[e.nodeName || `#text`] || n)(e, i), Gt(e, i, o);
|
|
602
|
+
} catch {
|
|
603
|
+
o = null;
|
|
604
|
+
}
|
|
605
|
+
return o;
|
|
606
|
+
};
|
|
607
|
+
function Kt(t, n = {}) {
|
|
608
|
+
return `${$(require_index.parse(t, { sourceCodeLocationInfo: !0 }), a(n))}\n`;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
//#endregion
|
|
612
|
+
exports.Kt = Kt;
|