hanbiro-react16-sdk 1.0.4 → 1.0.5
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/hanbiro-react16-sdk.es.js +778 -1389
- package/dist/hanbiro-react16-sdk.umd.js +41 -60
- package/package.json +1 -1
|
@@ -1,705 +1,94 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
if (!
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var Ne = (t, e, n) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var g = (t, e, n) => Ne(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import * as u from "react";
|
|
5
|
+
import _, { forwardRef as se } from "react";
|
|
6
|
+
let N;
|
|
7
|
+
const He = new Uint8Array(16);
|
|
8
|
+
function We() {
|
|
9
|
+
if (!N && (N = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !N))
|
|
10
10
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
11
|
-
return
|
|
11
|
+
return N(He);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const w = [];
|
|
14
14
|
for (let t = 0; t < 256; ++t)
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
return
|
|
15
|
+
w.push((t + 256).toString(16).slice(1));
|
|
16
|
+
function Ue(t, e = 0) {
|
|
17
|
+
return w[t[e + 0]] + w[t[e + 1]] + w[t[e + 2]] + w[t[e + 3]] + "-" + w[t[e + 4]] + w[t[e + 5]] + "-" + w[t[e + 6]] + w[t[e + 7]] + "-" + w[t[e + 8]] + w[t[e + 9]] + "-" + w[t[e + 10]] + w[t[e + 11]] + w[t[e + 12]] + w[t[e + 13]] + w[t[e + 14]] + w[t[e + 15]];
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
randomUUID:
|
|
19
|
+
const Ze = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), be = {
|
|
20
|
+
randomUUID: Ze
|
|
21
21
|
};
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
22
|
+
function Ge(t, e, n) {
|
|
23
|
+
if (be.randomUUID && !t)
|
|
24
|
+
return be.randomUUID();
|
|
25
25
|
t = t || {};
|
|
26
|
-
const r = t.random || (t.rng ||
|
|
27
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
26
|
+
const r = t.random || (t.rng || We)();
|
|
27
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Ue(r);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Fe(t) {
|
|
30
30
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
* react-is.production.min.js
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
-
*
|
|
38
|
-
* This source code is licensed under the MIT license found in the
|
|
39
|
-
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/
|
|
41
|
-
var rt;
|
|
42
|
-
function Bt() {
|
|
43
|
-
if (rt) return A;
|
|
44
|
-
rt = 1;
|
|
45
|
-
var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, r = t ? Symbol.for("react.fragment") : 60107, i = t ? Symbol.for("react.strict_mode") : 60108, s = t ? Symbol.for("react.profiler") : 60114, c = t ? Symbol.for("react.provider") : 60109, o = t ? Symbol.for("react.context") : 60110, u = t ? Symbol.for("react.async_mode") : 60111, a = t ? Symbol.for("react.concurrent_mode") : 60111, l = t ? Symbol.for("react.forward_ref") : 60112, g = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, k = t ? Symbol.for("react.memo") : 60115, y = t ? Symbol.for("react.lazy") : 60116, x = t ? Symbol.for("react.block") : 60121, P = t ? Symbol.for("react.fundamental") : 60117, D = t ? Symbol.for("react.responder") : 60118, H = t ? Symbol.for("react.scope") : 60119;
|
|
46
|
-
function O(f) {
|
|
47
|
-
if (typeof f == "object" && f !== null) {
|
|
48
|
-
var U = f.$$typeof;
|
|
49
|
-
switch (U) {
|
|
50
|
-
case e:
|
|
51
|
-
switch (f = f.type, f) {
|
|
52
|
-
case u:
|
|
53
|
-
case a:
|
|
54
|
-
case r:
|
|
55
|
-
case s:
|
|
56
|
-
case i:
|
|
57
|
-
case g:
|
|
58
|
-
return f;
|
|
59
|
-
default:
|
|
60
|
-
switch (f = f && f.$$typeof, f) {
|
|
61
|
-
case o:
|
|
62
|
-
case l:
|
|
63
|
-
case y:
|
|
64
|
-
case k:
|
|
65
|
-
case c:
|
|
66
|
-
return f;
|
|
67
|
-
default:
|
|
68
|
-
return U;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
case n:
|
|
72
|
-
return U;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function M(f) {
|
|
77
|
-
return O(f) === a;
|
|
78
|
-
}
|
|
79
|
-
return A.AsyncMode = u, A.ConcurrentMode = a, A.ContextConsumer = o, A.ContextProvider = c, A.Element = e, A.ForwardRef = l, A.Fragment = r, A.Lazy = y, A.Memo = k, A.Portal = n, A.Profiler = s, A.StrictMode = i, A.Suspense = g, A.isAsyncMode = function(f) {
|
|
80
|
-
return M(f) || O(f) === u;
|
|
81
|
-
}, A.isConcurrentMode = M, A.isContextConsumer = function(f) {
|
|
82
|
-
return O(f) === o;
|
|
83
|
-
}, A.isContextProvider = function(f) {
|
|
84
|
-
return O(f) === c;
|
|
85
|
-
}, A.isElement = function(f) {
|
|
86
|
-
return typeof f == "object" && f !== null && f.$$typeof === e;
|
|
87
|
-
}, A.isForwardRef = function(f) {
|
|
88
|
-
return O(f) === l;
|
|
89
|
-
}, A.isFragment = function(f) {
|
|
90
|
-
return O(f) === r;
|
|
91
|
-
}, A.isLazy = function(f) {
|
|
92
|
-
return O(f) === y;
|
|
93
|
-
}, A.isMemo = function(f) {
|
|
94
|
-
return O(f) === k;
|
|
95
|
-
}, A.isPortal = function(f) {
|
|
96
|
-
return O(f) === n;
|
|
97
|
-
}, A.isProfiler = function(f) {
|
|
98
|
-
return O(f) === s;
|
|
99
|
-
}, A.isStrictMode = function(f) {
|
|
100
|
-
return O(f) === i;
|
|
101
|
-
}, A.isSuspense = function(f) {
|
|
102
|
-
return O(f) === g;
|
|
103
|
-
}, A.isValidElementType = function(f) {
|
|
104
|
-
return typeof f == "string" || typeof f == "function" || f === r || f === a || f === s || f === i || f === g || f === p || typeof f == "object" && f !== null && (f.$$typeof === y || f.$$typeof === k || f.$$typeof === c || f.$$typeof === o || f.$$typeof === l || f.$$typeof === P || f.$$typeof === D || f.$$typeof === H || f.$$typeof === x);
|
|
105
|
-
}, A.typeOf = O, A;
|
|
106
|
-
}
|
|
107
|
-
var I = {};
|
|
108
|
-
/** @license React v16.13.1
|
|
109
|
-
* react-is.development.js
|
|
110
|
-
*
|
|
111
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the MIT license found in the
|
|
114
|
-
* LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/
|
|
116
|
-
var it;
|
|
117
|
-
function Wt() {
|
|
118
|
-
return it || (it = 1, process.env.NODE_ENV !== "production" && function() {
|
|
119
|
-
var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, n = t ? Symbol.for("react.portal") : 60106, r = t ? Symbol.for("react.fragment") : 60107, i = t ? Symbol.for("react.strict_mode") : 60108, s = t ? Symbol.for("react.profiler") : 60114, c = t ? Symbol.for("react.provider") : 60109, o = t ? Symbol.for("react.context") : 60110, u = t ? Symbol.for("react.async_mode") : 60111, a = t ? Symbol.for("react.concurrent_mode") : 60111, l = t ? Symbol.for("react.forward_ref") : 60112, g = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, k = t ? Symbol.for("react.memo") : 60115, y = t ? Symbol.for("react.lazy") : 60116, x = t ? Symbol.for("react.block") : 60121, P = t ? Symbol.for("react.fundamental") : 60117, D = t ? Symbol.for("react.responder") : 60118, H = t ? Symbol.for("react.scope") : 60119;
|
|
120
|
-
function O(d) {
|
|
121
|
-
return typeof d == "string" || typeof d == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
122
|
-
d === r || d === a || d === s || d === i || d === g || d === p || typeof d == "object" && d !== null && (d.$$typeof === y || d.$$typeof === k || d.$$typeof === c || d.$$typeof === o || d.$$typeof === l || d.$$typeof === P || d.$$typeof === D || d.$$typeof === H || d.$$typeof === x);
|
|
123
|
-
}
|
|
124
|
-
function M(d) {
|
|
125
|
-
if (typeof d == "object" && d !== null) {
|
|
126
|
-
var F = d.$$typeof;
|
|
127
|
-
switch (F) {
|
|
128
|
-
case e:
|
|
129
|
-
var ce = d.type;
|
|
130
|
-
switch (ce) {
|
|
131
|
-
case u:
|
|
132
|
-
case a:
|
|
133
|
-
case r:
|
|
134
|
-
case s:
|
|
135
|
-
case i:
|
|
136
|
-
case g:
|
|
137
|
-
return ce;
|
|
138
|
-
default:
|
|
139
|
-
var tt = ce && ce.$$typeof;
|
|
140
|
-
switch (tt) {
|
|
141
|
-
case o:
|
|
142
|
-
case l:
|
|
143
|
-
case y:
|
|
144
|
-
case k:
|
|
145
|
-
case c:
|
|
146
|
-
return tt;
|
|
147
|
-
default:
|
|
148
|
-
return F;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
case n:
|
|
152
|
-
return F;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
var f = u, U = a, B = o, ne = c, ve = e, ke = l, ae = r, we = y, Se = k, te = n, Ee = s, Z = i, J = g, le = !1;
|
|
157
|
-
function Te(d) {
|
|
158
|
-
return le || (le = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), h(d) || M(d) === u;
|
|
159
|
-
}
|
|
160
|
-
function h(d) {
|
|
161
|
-
return M(d) === a;
|
|
162
|
-
}
|
|
163
|
-
function m(d) {
|
|
164
|
-
return M(d) === o;
|
|
165
|
-
}
|
|
166
|
-
function R(d) {
|
|
167
|
-
return M(d) === c;
|
|
168
|
-
}
|
|
169
|
-
function E(d) {
|
|
170
|
-
return typeof d == "object" && d !== null && d.$$typeof === e;
|
|
171
|
-
}
|
|
172
|
-
function v(d) {
|
|
173
|
-
return M(d) === l;
|
|
174
|
-
}
|
|
175
|
-
function _(d) {
|
|
176
|
-
return M(d) === r;
|
|
177
|
-
}
|
|
178
|
-
function w(d) {
|
|
179
|
-
return M(d) === y;
|
|
180
|
-
}
|
|
181
|
-
function T(d) {
|
|
182
|
-
return M(d) === k;
|
|
183
|
-
}
|
|
184
|
-
function C(d) {
|
|
185
|
-
return M(d) === n;
|
|
186
|
-
}
|
|
187
|
-
function j(d) {
|
|
188
|
-
return M(d) === s;
|
|
189
|
-
}
|
|
190
|
-
function $(d) {
|
|
191
|
-
return M(d) === i;
|
|
192
|
-
}
|
|
193
|
-
function N(d) {
|
|
194
|
-
return M(d) === g;
|
|
195
|
-
}
|
|
196
|
-
I.AsyncMode = f, I.ConcurrentMode = U, I.ContextConsumer = B, I.ContextProvider = ne, I.Element = ve, I.ForwardRef = ke, I.Fragment = ae, I.Lazy = we, I.Memo = Se, I.Portal = te, I.Profiler = Ee, I.StrictMode = Z, I.Suspense = J, I.isAsyncMode = Te, I.isConcurrentMode = h, I.isContextConsumer = m, I.isContextProvider = R, I.isElement = E, I.isForwardRef = v, I.isFragment = _, I.isLazy = w, I.isMemo = T, I.isPortal = C, I.isProfiler = j, I.isStrictMode = $, I.isSuspense = N, I.isValidElementType = O, I.typeOf = M;
|
|
197
|
-
}()), I;
|
|
198
|
-
}
|
|
199
|
-
var st;
|
|
200
|
-
function yt() {
|
|
201
|
-
return st || (st = 1, process.env.NODE_ENV === "production" ? pe.exports = Bt() : pe.exports = Wt()), pe.exports;
|
|
202
|
-
}
|
|
203
|
-
/*
|
|
204
|
-
object-assign
|
|
205
|
-
(c) Sindre Sorhus
|
|
206
|
-
@license MIT
|
|
207
|
-
*/
|
|
208
|
-
var Re, ot;
|
|
209
|
-
function Nt() {
|
|
210
|
-
if (ot) return Re;
|
|
211
|
-
ot = 1;
|
|
212
|
-
var t = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
|
|
213
|
-
function r(s) {
|
|
214
|
-
if (s == null)
|
|
215
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
216
|
-
return Object(s);
|
|
217
|
-
}
|
|
218
|
-
function i() {
|
|
219
|
-
try {
|
|
220
|
-
if (!Object.assign)
|
|
221
|
-
return !1;
|
|
222
|
-
var s = new String("abc");
|
|
223
|
-
if (s[5] = "de", Object.getOwnPropertyNames(s)[0] === "5")
|
|
224
|
-
return !1;
|
|
225
|
-
for (var c = {}, o = 0; o < 10; o++)
|
|
226
|
-
c["_" + String.fromCharCode(o)] = o;
|
|
227
|
-
var u = Object.getOwnPropertyNames(c).map(function(l) {
|
|
228
|
-
return c[l];
|
|
229
|
-
});
|
|
230
|
-
if (u.join("") !== "0123456789")
|
|
231
|
-
return !1;
|
|
232
|
-
var a = {};
|
|
233
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(l) {
|
|
234
|
-
a[l] = l;
|
|
235
|
-
}), Object.keys(Object.assign({}, a)).join("") === "abcdefghijklmnopqrst";
|
|
236
|
-
} catch {
|
|
237
|
-
return !1;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return Re = i() ? Object.assign : function(s, c) {
|
|
241
|
-
for (var o, u = r(s), a, l = 1; l < arguments.length; l++) {
|
|
242
|
-
o = Object(arguments[l]);
|
|
243
|
-
for (var g in o)
|
|
244
|
-
e.call(o, g) && (u[g] = o[g]);
|
|
245
|
-
if (t) {
|
|
246
|
-
a = t(o);
|
|
247
|
-
for (var p = 0; p < a.length; p++)
|
|
248
|
-
n.call(o, a[p]) && (u[a[p]] = o[a[p]]);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return u;
|
|
252
|
-
}, Re;
|
|
32
|
+
var Re = { exports: {} }, Ve = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", Qe = Ve, Ke = Qe;
|
|
33
|
+
function Te() {
|
|
253
34
|
}
|
|
254
|
-
|
|
255
|
-
function Ue() {
|
|
256
|
-
if (at) return _e;
|
|
257
|
-
at = 1;
|
|
258
|
-
var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
259
|
-
return _e = t, _e;
|
|
35
|
+
function Ee() {
|
|
260
36
|
}
|
|
261
|
-
|
|
262
|
-
function
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
if (ct) return $e;
|
|
268
|
-
ct = 1;
|
|
269
|
-
var t = function() {
|
|
270
|
-
};
|
|
271
|
-
if (process.env.NODE_ENV !== "production") {
|
|
272
|
-
var e = Ue(), n = {}, r = xt();
|
|
273
|
-
t = function(s) {
|
|
274
|
-
var c = "Warning: " + s;
|
|
275
|
-
typeof console < "u" && console.error(c);
|
|
276
|
-
try {
|
|
277
|
-
throw new Error(c);
|
|
278
|
-
} catch {
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
function i(s, c, o, u, a) {
|
|
283
|
-
if (process.env.NODE_ENV !== "production") {
|
|
284
|
-
for (var l in s)
|
|
285
|
-
if (r(s, l)) {
|
|
286
|
-
var g;
|
|
287
|
-
try {
|
|
288
|
-
if (typeof s[l] != "function") {
|
|
289
|
-
var p = Error(
|
|
290
|
-
(u || "React class") + ": " + o + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
291
|
-
);
|
|
292
|
-
throw p.name = "Invariant Violation", p;
|
|
293
|
-
}
|
|
294
|
-
g = s[l](c, l, u, o, null, e);
|
|
295
|
-
} catch (y) {
|
|
296
|
-
g = y;
|
|
297
|
-
}
|
|
298
|
-
if (g && !(g instanceof Error) && t(
|
|
299
|
-
(u || "React class") + ": type specification of " + o + " `" + l + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof g + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
300
|
-
), g instanceof Error && !(g.message in n)) {
|
|
301
|
-
n[g.message] = !0;
|
|
302
|
-
var k = a ? a() : "";
|
|
303
|
-
t(
|
|
304
|
-
"Failed " + o + " type: " + g.message + (k ?? "")
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return i.resetWarningCache = function() {
|
|
311
|
-
process.env.NODE_ENV !== "production" && (n = {});
|
|
312
|
-
}, $e = i, $e;
|
|
313
|
-
}
|
|
314
|
-
var Pe, ut;
|
|
315
|
-
function Ht() {
|
|
316
|
-
if (ut) return Pe;
|
|
317
|
-
ut = 1;
|
|
318
|
-
var t = yt(), e = Nt(), n = Ue(), r = xt(), i = Ut(), s = function() {
|
|
319
|
-
};
|
|
320
|
-
process.env.NODE_ENV !== "production" && (s = function(o) {
|
|
321
|
-
var u = "Warning: " + o;
|
|
322
|
-
typeof console < "u" && console.error(u);
|
|
323
|
-
try {
|
|
324
|
-
throw new Error(u);
|
|
325
|
-
} catch {
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
function c() {
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
return Pe = function(o, u) {
|
|
332
|
-
var a = typeof Symbol == "function" && Symbol.iterator, l = "@@iterator";
|
|
333
|
-
function g(h) {
|
|
334
|
-
var m = h && (a && h[a] || h[l]);
|
|
335
|
-
if (typeof m == "function")
|
|
336
|
-
return m;
|
|
337
|
-
}
|
|
338
|
-
var p = "<<anonymous>>", k = {
|
|
339
|
-
array: D("array"),
|
|
340
|
-
bigint: D("bigint"),
|
|
341
|
-
bool: D("boolean"),
|
|
342
|
-
func: D("function"),
|
|
343
|
-
number: D("number"),
|
|
344
|
-
object: D("object"),
|
|
345
|
-
string: D("string"),
|
|
346
|
-
symbol: D("symbol"),
|
|
347
|
-
any: H(),
|
|
348
|
-
arrayOf: O,
|
|
349
|
-
element: M(),
|
|
350
|
-
elementType: f(),
|
|
351
|
-
instanceOf: U,
|
|
352
|
-
node: ke(),
|
|
353
|
-
objectOf: ne,
|
|
354
|
-
oneOf: B,
|
|
355
|
-
oneOfType: ve,
|
|
356
|
-
shape: we,
|
|
357
|
-
exact: Se
|
|
358
|
-
};
|
|
359
|
-
function y(h, m) {
|
|
360
|
-
return h === m ? h !== 0 || 1 / h === 1 / m : h !== h && m !== m;
|
|
361
|
-
}
|
|
362
|
-
function x(h, m) {
|
|
363
|
-
this.message = h, this.data = m && typeof m == "object" ? m : {}, this.stack = "";
|
|
364
|
-
}
|
|
365
|
-
x.prototype = Error.prototype;
|
|
366
|
-
function P(h) {
|
|
367
|
-
if (process.env.NODE_ENV !== "production")
|
|
368
|
-
var m = {}, R = 0;
|
|
369
|
-
function E(_, w, T, C, j, $, N) {
|
|
370
|
-
if (C = C || p, $ = $ || T, N !== n) {
|
|
371
|
-
if (u) {
|
|
372
|
-
var d = new Error(
|
|
373
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
374
|
-
);
|
|
375
|
-
throw d.name = "Invariant Violation", d;
|
|
376
|
-
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
377
|
-
var F = C + ":" + T;
|
|
378
|
-
!m[F] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
379
|
-
R < 3 && (s(
|
|
380
|
-
"You are manually calling a React.PropTypes validation function for the `" + $ + "` prop on `" + C + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
381
|
-
), m[F] = !0, R++);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
return w[T] == null ? _ ? w[T] === null ? new x("The " + j + " `" + $ + "` is marked as required " + ("in `" + C + "`, but its value is `null`.")) : new x("The " + j + " `" + $ + "` is marked as required in " + ("`" + C + "`, but its value is `undefined`.")) : null : h(w, T, C, j, $);
|
|
385
|
-
}
|
|
386
|
-
var v = E.bind(null, !1);
|
|
387
|
-
return v.isRequired = E.bind(null, !0), v;
|
|
388
|
-
}
|
|
389
|
-
function D(h) {
|
|
390
|
-
function m(R, E, v, _, w, T) {
|
|
391
|
-
var C = R[E], j = Z(C);
|
|
392
|
-
if (j !== h) {
|
|
393
|
-
var $ = J(C);
|
|
394
|
-
return new x(
|
|
395
|
-
"Invalid " + _ + " `" + w + "` of type " + ("`" + $ + "` supplied to `" + v + "`, expected ") + ("`" + h + "`."),
|
|
396
|
-
{ expectedType: h }
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
return null;
|
|
400
|
-
}
|
|
401
|
-
return P(m);
|
|
402
|
-
}
|
|
403
|
-
function H() {
|
|
404
|
-
return P(c);
|
|
405
|
-
}
|
|
406
|
-
function O(h) {
|
|
407
|
-
function m(R, E, v, _, w) {
|
|
408
|
-
if (typeof h != "function")
|
|
409
|
-
return new x("Property `" + w + "` of component `" + v + "` has invalid PropType notation inside arrayOf.");
|
|
410
|
-
var T = R[E];
|
|
411
|
-
if (!Array.isArray(T)) {
|
|
412
|
-
var C = Z(T);
|
|
413
|
-
return new x("Invalid " + _ + " `" + w + "` of type " + ("`" + C + "` supplied to `" + v + "`, expected an array."));
|
|
414
|
-
}
|
|
415
|
-
for (var j = 0; j < T.length; j++) {
|
|
416
|
-
var $ = h(T, j, v, _, w + "[" + j + "]", n);
|
|
417
|
-
if ($ instanceof Error)
|
|
418
|
-
return $;
|
|
419
|
-
}
|
|
420
|
-
return null;
|
|
421
|
-
}
|
|
422
|
-
return P(m);
|
|
423
|
-
}
|
|
424
|
-
function M() {
|
|
425
|
-
function h(m, R, E, v, _) {
|
|
426
|
-
var w = m[R];
|
|
427
|
-
if (!o(w)) {
|
|
428
|
-
var T = Z(w);
|
|
429
|
-
return new x("Invalid " + v + " `" + _ + "` of type " + ("`" + T + "` supplied to `" + E + "`, expected a single ReactElement."));
|
|
430
|
-
}
|
|
431
|
-
return null;
|
|
432
|
-
}
|
|
433
|
-
return P(h);
|
|
434
|
-
}
|
|
435
|
-
function f() {
|
|
436
|
-
function h(m, R, E, v, _) {
|
|
437
|
-
var w = m[R];
|
|
438
|
-
if (!t.isValidElementType(w)) {
|
|
439
|
-
var T = Z(w);
|
|
440
|
-
return new x("Invalid " + v + " `" + _ + "` of type " + ("`" + T + "` supplied to `" + E + "`, expected a single ReactElement type."));
|
|
441
|
-
}
|
|
442
|
-
return null;
|
|
443
|
-
}
|
|
444
|
-
return P(h);
|
|
445
|
-
}
|
|
446
|
-
function U(h) {
|
|
447
|
-
function m(R, E, v, _, w) {
|
|
448
|
-
if (!(R[E] instanceof h)) {
|
|
449
|
-
var T = h.name || p, C = Te(R[E]);
|
|
450
|
-
return new x("Invalid " + _ + " `" + w + "` of type " + ("`" + C + "` supplied to `" + v + "`, expected ") + ("instance of `" + T + "`."));
|
|
451
|
-
}
|
|
452
|
-
return null;
|
|
453
|
-
}
|
|
454
|
-
return P(m);
|
|
455
|
-
}
|
|
456
|
-
function B(h) {
|
|
457
|
-
if (!Array.isArray(h))
|
|
458
|
-
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s(
|
|
459
|
-
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
460
|
-
) : s("Invalid argument supplied to oneOf, expected an array.")), c;
|
|
461
|
-
function m(R, E, v, _, w) {
|
|
462
|
-
for (var T = R[E], C = 0; C < h.length; C++)
|
|
463
|
-
if (y(T, h[C]))
|
|
464
|
-
return null;
|
|
465
|
-
var j = JSON.stringify(h, function(N, d) {
|
|
466
|
-
var F = J(d);
|
|
467
|
-
return F === "symbol" ? String(d) : d;
|
|
468
|
-
});
|
|
469
|
-
return new x("Invalid " + _ + " `" + w + "` of value `" + String(T) + "` " + ("supplied to `" + v + "`, expected one of " + j + "."));
|
|
470
|
-
}
|
|
471
|
-
return P(m);
|
|
472
|
-
}
|
|
473
|
-
function ne(h) {
|
|
474
|
-
function m(R, E, v, _, w) {
|
|
475
|
-
if (typeof h != "function")
|
|
476
|
-
return new x("Property `" + w + "` of component `" + v + "` has invalid PropType notation inside objectOf.");
|
|
477
|
-
var T = R[E], C = Z(T);
|
|
478
|
-
if (C !== "object")
|
|
479
|
-
return new x("Invalid " + _ + " `" + w + "` of type " + ("`" + C + "` supplied to `" + v + "`, expected an object."));
|
|
480
|
-
for (var j in T)
|
|
481
|
-
if (r(T, j)) {
|
|
482
|
-
var $ = h(T, j, v, _, w + "." + j, n);
|
|
483
|
-
if ($ instanceof Error)
|
|
484
|
-
return $;
|
|
485
|
-
}
|
|
486
|
-
return null;
|
|
487
|
-
}
|
|
488
|
-
return P(m);
|
|
489
|
-
}
|
|
490
|
-
function ve(h) {
|
|
491
|
-
if (!Array.isArray(h))
|
|
492
|
-
return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), c;
|
|
493
|
-
for (var m = 0; m < h.length; m++) {
|
|
494
|
-
var R = h[m];
|
|
495
|
-
if (typeof R != "function")
|
|
496
|
-
return s(
|
|
497
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + le(R) + " at index " + m + "."
|
|
498
|
-
), c;
|
|
499
|
-
}
|
|
500
|
-
function E(v, _, w, T, C) {
|
|
501
|
-
for (var j = [], $ = 0; $ < h.length; $++) {
|
|
502
|
-
var N = h[$], d = N(v, _, w, T, C, n);
|
|
503
|
-
if (d == null)
|
|
504
|
-
return null;
|
|
505
|
-
d.data && r(d.data, "expectedType") && j.push(d.data.expectedType);
|
|
506
|
-
}
|
|
507
|
-
var F = j.length > 0 ? ", expected one of type [" + j.join(", ") + "]" : "";
|
|
508
|
-
return new x("Invalid " + T + " `" + C + "` supplied to " + ("`" + w + "`" + F + "."));
|
|
509
|
-
}
|
|
510
|
-
return P(E);
|
|
511
|
-
}
|
|
512
|
-
function ke() {
|
|
513
|
-
function h(m, R, E, v, _) {
|
|
514
|
-
return te(m[R]) ? null : new x("Invalid " + v + " `" + _ + "` supplied to " + ("`" + E + "`, expected a ReactNode."));
|
|
515
|
-
}
|
|
516
|
-
return P(h);
|
|
517
|
-
}
|
|
518
|
-
function ae(h, m, R, E, v) {
|
|
519
|
-
return new x(
|
|
520
|
-
(h || "React class") + ": " + m + " type `" + R + "." + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + v + "`."
|
|
37
|
+
Ee.resetWarningCache = Te;
|
|
38
|
+
var Je = function() {
|
|
39
|
+
function t(r, i, s, o, a, p) {
|
|
40
|
+
if (p !== Ke) {
|
|
41
|
+
var l = new Error(
|
|
42
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
521
43
|
);
|
|
44
|
+
throw l.name = "Invariant Violation", l;
|
|
522
45
|
}
|
|
523
|
-
function we(h) {
|
|
524
|
-
function m(R, E, v, _, w) {
|
|
525
|
-
var T = R[E], C = Z(T);
|
|
526
|
-
if (C !== "object")
|
|
527
|
-
return new x("Invalid " + _ + " `" + w + "` of type `" + C + "` " + ("supplied to `" + v + "`, expected `object`."));
|
|
528
|
-
for (var j in h) {
|
|
529
|
-
var $ = h[j];
|
|
530
|
-
if (typeof $ != "function")
|
|
531
|
-
return ae(v, _, w, j, J($));
|
|
532
|
-
var N = $(T, j, v, _, w + "." + j, n);
|
|
533
|
-
if (N)
|
|
534
|
-
return N;
|
|
535
|
-
}
|
|
536
|
-
return null;
|
|
537
|
-
}
|
|
538
|
-
return P(m);
|
|
539
|
-
}
|
|
540
|
-
function Se(h) {
|
|
541
|
-
function m(R, E, v, _, w) {
|
|
542
|
-
var T = R[E], C = Z(T);
|
|
543
|
-
if (C !== "object")
|
|
544
|
-
return new x("Invalid " + _ + " `" + w + "` of type `" + C + "` " + ("supplied to `" + v + "`, expected `object`."));
|
|
545
|
-
var j = e({}, R[E], h);
|
|
546
|
-
for (var $ in j) {
|
|
547
|
-
var N = h[$];
|
|
548
|
-
if (r(h, $) && typeof N != "function")
|
|
549
|
-
return ae(v, _, w, $, J(N));
|
|
550
|
-
if (!N)
|
|
551
|
-
return new x(
|
|
552
|
-
"Invalid " + _ + " `" + w + "` key `" + $ + "` supplied to `" + v + "`.\nBad object: " + JSON.stringify(R[E], null, " ") + `
|
|
553
|
-
Valid keys: ` + JSON.stringify(Object.keys(h), null, " ")
|
|
554
|
-
);
|
|
555
|
-
var d = N(T, $, v, _, w + "." + $, n);
|
|
556
|
-
if (d)
|
|
557
|
-
return d;
|
|
558
|
-
}
|
|
559
|
-
return null;
|
|
560
|
-
}
|
|
561
|
-
return P(m);
|
|
562
|
-
}
|
|
563
|
-
function te(h) {
|
|
564
|
-
switch (typeof h) {
|
|
565
|
-
case "number":
|
|
566
|
-
case "string":
|
|
567
|
-
case "undefined":
|
|
568
|
-
return !0;
|
|
569
|
-
case "boolean":
|
|
570
|
-
return !h;
|
|
571
|
-
case "object":
|
|
572
|
-
if (Array.isArray(h))
|
|
573
|
-
return h.every(te);
|
|
574
|
-
if (h === null || o(h))
|
|
575
|
-
return !0;
|
|
576
|
-
var m = g(h);
|
|
577
|
-
if (m) {
|
|
578
|
-
var R = m.call(h), E;
|
|
579
|
-
if (m !== h.entries) {
|
|
580
|
-
for (; !(E = R.next()).done; )
|
|
581
|
-
if (!te(E.value))
|
|
582
|
-
return !1;
|
|
583
|
-
} else
|
|
584
|
-
for (; !(E = R.next()).done; ) {
|
|
585
|
-
var v = E.value;
|
|
586
|
-
if (v && !te(v[1]))
|
|
587
|
-
return !1;
|
|
588
|
-
}
|
|
589
|
-
} else
|
|
590
|
-
return !1;
|
|
591
|
-
return !0;
|
|
592
|
-
default:
|
|
593
|
-
return !1;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
function Ee(h, m) {
|
|
597
|
-
return h === "symbol" ? !0 : m ? m["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && m instanceof Symbol : !1;
|
|
598
|
-
}
|
|
599
|
-
function Z(h) {
|
|
600
|
-
var m = typeof h;
|
|
601
|
-
return Array.isArray(h) ? "array" : h instanceof RegExp ? "object" : Ee(m, h) ? "symbol" : m;
|
|
602
|
-
}
|
|
603
|
-
function J(h) {
|
|
604
|
-
if (typeof h > "u" || h === null)
|
|
605
|
-
return "" + h;
|
|
606
|
-
var m = Z(h);
|
|
607
|
-
if (m === "object") {
|
|
608
|
-
if (h instanceof Date)
|
|
609
|
-
return "date";
|
|
610
|
-
if (h instanceof RegExp)
|
|
611
|
-
return "regexp";
|
|
612
|
-
}
|
|
613
|
-
return m;
|
|
614
|
-
}
|
|
615
|
-
function le(h) {
|
|
616
|
-
var m = J(h);
|
|
617
|
-
switch (m) {
|
|
618
|
-
case "array":
|
|
619
|
-
case "object":
|
|
620
|
-
return "an " + m;
|
|
621
|
-
case "boolean":
|
|
622
|
-
case "date":
|
|
623
|
-
case "regexp":
|
|
624
|
-
return "a " + m;
|
|
625
|
-
default:
|
|
626
|
-
return m;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
function Te(h) {
|
|
630
|
-
return !h.constructor || !h.constructor.name ? p : h.constructor.name;
|
|
631
|
-
}
|
|
632
|
-
return k.checkPropTypes = i, k.resetWarningCache = i.resetWarningCache, k.PropTypes = k, k;
|
|
633
|
-
}, Pe;
|
|
634
|
-
}
|
|
635
|
-
var Oe, pt;
|
|
636
|
-
function Yt() {
|
|
637
|
-
if (pt) return Oe;
|
|
638
|
-
pt = 1;
|
|
639
|
-
var t = Ue();
|
|
640
|
-
function e() {
|
|
641
46
|
}
|
|
642
|
-
|
|
47
|
+
t.isRequired = t;
|
|
48
|
+
function e() {
|
|
49
|
+
return t;
|
|
643
50
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
oneOfType: i,
|
|
675
|
-
shape: i,
|
|
676
|
-
exact: i,
|
|
677
|
-
checkPropTypes: n,
|
|
678
|
-
resetWarningCache: e
|
|
679
|
-
};
|
|
680
|
-
return s.PropTypes = s, s;
|
|
681
|
-
}, Oe;
|
|
682
|
-
}
|
|
683
|
-
if (process.env.NODE_ENV !== "production") {
|
|
684
|
-
var Zt = yt(), Ft = !0;
|
|
685
|
-
Ie.exports = Ht()(Zt.isElement, Ft);
|
|
686
|
-
} else
|
|
687
|
-
Ie.exports = Yt()();
|
|
688
|
-
var Gt = Ie.exports;
|
|
689
|
-
const Y = /* @__PURE__ */ qt(Gt);
|
|
690
|
-
function ze() {
|
|
691
|
-
return ze = Object.assign || function(t) {
|
|
51
|
+
var n = {
|
|
52
|
+
array: t,
|
|
53
|
+
bigint: t,
|
|
54
|
+
bool: t,
|
|
55
|
+
func: t,
|
|
56
|
+
number: t,
|
|
57
|
+
object: t,
|
|
58
|
+
string: t,
|
|
59
|
+
symbol: t,
|
|
60
|
+
any: t,
|
|
61
|
+
arrayOf: e,
|
|
62
|
+
element: t,
|
|
63
|
+
elementType: t,
|
|
64
|
+
instanceOf: e,
|
|
65
|
+
node: t,
|
|
66
|
+
objectOf: e,
|
|
67
|
+
oneOf: e,
|
|
68
|
+
oneOfType: e,
|
|
69
|
+
shape: e,
|
|
70
|
+
exact: e,
|
|
71
|
+
checkPropTypes: Ee,
|
|
72
|
+
resetWarningCache: Te
|
|
73
|
+
};
|
|
74
|
+
return n.PropTypes = n, n;
|
|
75
|
+
};
|
|
76
|
+
Re.exports = Je();
|
|
77
|
+
var Xe = Re.exports;
|
|
78
|
+
const R = /* @__PURE__ */ Fe(Xe);
|
|
79
|
+
function J() {
|
|
80
|
+
return J = Object.assign || function(t) {
|
|
692
81
|
for (var e = 1; e < arguments.length; e++) {
|
|
693
82
|
var n = arguments[e];
|
|
694
83
|
for (var r in n)
|
|
695
84
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
696
85
|
}
|
|
697
86
|
return t;
|
|
698
|
-
},
|
|
87
|
+
}, J.apply(this, arguments);
|
|
699
88
|
}
|
|
700
|
-
function
|
|
89
|
+
function Ye(t, e) {
|
|
701
90
|
if (t == null) return {};
|
|
702
|
-
var n =
|
|
91
|
+
var n = et(t, e), r, i;
|
|
703
92
|
if (Object.getOwnPropertySymbols) {
|
|
704
93
|
var s = Object.getOwnPropertySymbols(t);
|
|
705
94
|
for (i = 0; i < s.length; i++)
|
|
@@ -707,16 +96,16 @@ function Vt(t, e) {
|
|
|
707
96
|
}
|
|
708
97
|
return n;
|
|
709
98
|
}
|
|
710
|
-
function
|
|
99
|
+
function et(t, e) {
|
|
711
100
|
if (t == null) return {};
|
|
712
101
|
var n = {}, r = Object.keys(t), i, s;
|
|
713
102
|
for (s = 0; s < r.length; s++)
|
|
714
103
|
i = r[s], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
|
|
715
104
|
return n;
|
|
716
105
|
}
|
|
717
|
-
var
|
|
718
|
-
var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i,
|
|
719
|
-
return /* @__PURE__ */
|
|
106
|
+
var F = se(function(t, e) {
|
|
107
|
+
var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i, o = Ye(t, ["color", "size"]);
|
|
108
|
+
return /* @__PURE__ */ _.createElement("svg", J({
|
|
720
109
|
ref: e,
|
|
721
110
|
xmlns: "http://www.w3.org/2000/svg",
|
|
722
111
|
width: s,
|
|
@@ -727,35 +116,35 @@ var be = Ne(function(t, e) {
|
|
|
727
116
|
strokeWidth: "2",
|
|
728
117
|
strokeLinecap: "round",
|
|
729
118
|
strokeLinejoin: "round"
|
|
730
|
-
},
|
|
119
|
+
}, o), /* @__PURE__ */ _.createElement("rect", {
|
|
731
120
|
x: "9",
|
|
732
121
|
y: "9",
|
|
733
122
|
width: "13",
|
|
734
123
|
height: "13",
|
|
735
124
|
rx: "2",
|
|
736
125
|
ry: "2"
|
|
737
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ _.createElement("path", {
|
|
738
127
|
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
|
|
739
128
|
}));
|
|
740
129
|
});
|
|
741
|
-
|
|
742
|
-
color:
|
|
743
|
-
size:
|
|
130
|
+
F.propTypes = {
|
|
131
|
+
color: R.string,
|
|
132
|
+
size: R.oneOfType([R.string, R.number])
|
|
744
133
|
};
|
|
745
|
-
|
|
746
|
-
function
|
|
747
|
-
return
|
|
134
|
+
F.displayName = "Copy";
|
|
135
|
+
function X() {
|
|
136
|
+
return X = Object.assign || function(t) {
|
|
748
137
|
for (var e = 1; e < arguments.length; e++) {
|
|
749
138
|
var n = arguments[e];
|
|
750
139
|
for (var r in n)
|
|
751
140
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
752
141
|
}
|
|
753
142
|
return t;
|
|
754
|
-
},
|
|
143
|
+
}, X.apply(this, arguments);
|
|
755
144
|
}
|
|
756
|
-
function
|
|
145
|
+
function tt(t, e) {
|
|
757
146
|
if (t == null) return {};
|
|
758
|
-
var n =
|
|
147
|
+
var n = nt(t, e), r, i;
|
|
759
148
|
if (Object.getOwnPropertySymbols) {
|
|
760
149
|
var s = Object.getOwnPropertySymbols(t);
|
|
761
150
|
for (i = 0; i < s.length; i++)
|
|
@@ -763,16 +152,16 @@ function Qt(t, e) {
|
|
|
763
152
|
}
|
|
764
153
|
return n;
|
|
765
154
|
}
|
|
766
|
-
function
|
|
155
|
+
function nt(t, e) {
|
|
767
156
|
if (t == null) return {};
|
|
768
157
|
var n = {}, r = Object.keys(t), i, s;
|
|
769
158
|
for (s = 0; s < r.length; s++)
|
|
770
159
|
i = r[s], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
|
|
771
160
|
return n;
|
|
772
161
|
}
|
|
773
|
-
var
|
|
774
|
-
var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i,
|
|
775
|
-
return /* @__PURE__ */
|
|
162
|
+
var ae = se(function(t, e) {
|
|
163
|
+
var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i, o = tt(t, ["color", "size"]);
|
|
164
|
+
return /* @__PURE__ */ _.createElement("svg", X({
|
|
776
165
|
ref: e,
|
|
777
166
|
xmlns: "http://www.w3.org/2000/svg",
|
|
778
167
|
width: s,
|
|
@@ -783,33 +172,33 @@ var He = Ne(function(t, e) {
|
|
|
783
172
|
strokeWidth: "2",
|
|
784
173
|
strokeLinecap: "round",
|
|
785
174
|
strokeLinejoin: "round"
|
|
786
|
-
},
|
|
175
|
+
}, o), /* @__PURE__ */ _.createElement("line", {
|
|
787
176
|
x1: "22",
|
|
788
177
|
y1: "2",
|
|
789
178
|
x2: "11",
|
|
790
179
|
y2: "13"
|
|
791
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ _.createElement("polygon", {
|
|
792
181
|
points: "22 2 15 22 11 13 2 9 22 2"
|
|
793
182
|
}));
|
|
794
183
|
});
|
|
795
|
-
|
|
796
|
-
color:
|
|
797
|
-
size:
|
|
184
|
+
ae.propTypes = {
|
|
185
|
+
color: R.string,
|
|
186
|
+
size: R.oneOfType([R.string, R.number])
|
|
798
187
|
};
|
|
799
|
-
|
|
800
|
-
function
|
|
801
|
-
return
|
|
188
|
+
ae.displayName = "Send";
|
|
189
|
+
function Y() {
|
|
190
|
+
return Y = Object.assign || function(t) {
|
|
802
191
|
for (var e = 1; e < arguments.length; e++) {
|
|
803
192
|
var n = arguments[e];
|
|
804
193
|
for (var r in n)
|
|
805
194
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
806
195
|
}
|
|
807
196
|
return t;
|
|
808
|
-
},
|
|
197
|
+
}, Y.apply(this, arguments);
|
|
809
198
|
}
|
|
810
|
-
function
|
|
199
|
+
function rt(t, e) {
|
|
811
200
|
if (t == null) return {};
|
|
812
|
-
var n =
|
|
201
|
+
var n = it(t, e), r, i;
|
|
813
202
|
if (Object.getOwnPropertySymbols) {
|
|
814
203
|
var s = Object.getOwnPropertySymbols(t);
|
|
815
204
|
for (i = 0; i < s.length; i++)
|
|
@@ -817,16 +206,16 @@ function Xt(t, e) {
|
|
|
817
206
|
}
|
|
818
207
|
return n;
|
|
819
208
|
}
|
|
820
|
-
function
|
|
209
|
+
function it(t, e) {
|
|
821
210
|
if (t == null) return {};
|
|
822
211
|
var n = {}, r = Object.keys(t), i, s;
|
|
823
212
|
for (s = 0; s < r.length; s++)
|
|
824
213
|
i = r[s], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
|
|
825
214
|
return n;
|
|
826
215
|
}
|
|
827
|
-
var
|
|
828
|
-
var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i,
|
|
829
|
-
return /* @__PURE__ */
|
|
216
|
+
var le = se(function(t, e) {
|
|
217
|
+
var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i, o = rt(t, ["color", "size"]);
|
|
218
|
+
return /* @__PURE__ */ _.createElement("svg", Y({
|
|
830
219
|
ref: e,
|
|
831
220
|
xmlns: "http://www.w3.org/2000/svg",
|
|
832
221
|
width: s,
|
|
@@ -837,20 +226,20 @@ var Ye = Ne(function(t, e) {
|
|
|
837
226
|
strokeWidth: "2",
|
|
838
227
|
strokeLinecap: "round",
|
|
839
228
|
strokeLinejoin: "round"
|
|
840
|
-
},
|
|
229
|
+
}, o), /* @__PURE__ */ _.createElement("circle", {
|
|
841
230
|
cx: "12",
|
|
842
231
|
cy: "12",
|
|
843
232
|
r: "3"
|
|
844
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ _.createElement("path", {
|
|
845
234
|
d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
846
235
|
}));
|
|
847
236
|
});
|
|
848
|
-
|
|
849
|
-
color:
|
|
850
|
-
size:
|
|
237
|
+
le.propTypes = {
|
|
238
|
+
color: R.string,
|
|
239
|
+
size: R.oneOfType([R.string, R.number])
|
|
851
240
|
};
|
|
852
|
-
|
|
853
|
-
const
|
|
241
|
+
le.displayName = "Settings";
|
|
242
|
+
const ee = [
|
|
854
243
|
{ label: "Korean", value: "KR", extra: "ko" },
|
|
855
244
|
{ label: "English", value: "US", extra: "en" },
|
|
856
245
|
{ label: "Japanese", value: "JP" },
|
|
@@ -859,9 +248,9 @@ const De = [
|
|
|
859
248
|
{ label: "Traditional Chinese (Hong Kong)", value: "zh-HK", extra: "zh-cht" },
|
|
860
249
|
{ label: "Vietnamese", value: "VN", extra: "vi" },
|
|
861
250
|
{ label: "Indonesian", value: "ID", extra: "id" }
|
|
862
|
-
],
|
|
251
|
+
], st = ({ isGradient: t = !1, stroke: e = 1.5, size: n = 40 }) => {
|
|
863
252
|
const r = "ai-gradient-" + Math.random().toString(36).substr(2, 9);
|
|
864
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ u.createElement(
|
|
865
254
|
"svg",
|
|
866
255
|
{
|
|
867
256
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -870,7 +259,7 @@ const De = [
|
|
|
870
259
|
viewBox: "0 0 24 24",
|
|
871
260
|
style: { flexShrink: 0 }
|
|
872
261
|
},
|
|
873
|
-
t && /* @__PURE__ */
|
|
262
|
+
t && /* @__PURE__ */ u.createElement("defs", null, /* @__PURE__ */ u.createElement("linearGradient", { id: r, x1: "0%", y1: "0%", x2: "0%", y2: "100%" }, /* @__PURE__ */ u.createElement("stop", { offset: "0%", stopColor: "#9D50BB" }, /* @__PURE__ */ u.createElement(
|
|
874
263
|
"animate",
|
|
875
264
|
{
|
|
876
265
|
attributeName: "offset",
|
|
@@ -878,7 +267,7 @@ const De = [
|
|
|
878
267
|
dur: "1s",
|
|
879
268
|
repeatCount: "indefinite"
|
|
880
269
|
}
|
|
881
|
-
)), /* @__PURE__ */
|
|
270
|
+
)), /* @__PURE__ */ u.createElement("stop", { offset: "30%", stopColor: "#6E48AA" }, /* @__PURE__ */ u.createElement(
|
|
882
271
|
"animate",
|
|
883
272
|
{
|
|
884
273
|
attributeName: "offset",
|
|
@@ -886,7 +275,7 @@ const De = [
|
|
|
886
275
|
dur: "1s",
|
|
887
276
|
repeatCount: "indefinite"
|
|
888
277
|
}
|
|
889
|
-
)), /* @__PURE__ */
|
|
278
|
+
)), /* @__PURE__ */ u.createElement("stop", { offset: "50%", stopColor: "#4776E6" }, /* @__PURE__ */ u.createElement(
|
|
890
279
|
"animate",
|
|
891
280
|
{
|
|
892
281
|
attributeName: "offset",
|
|
@@ -894,7 +283,7 @@ const De = [
|
|
|
894
283
|
dur: "1s",
|
|
895
284
|
repeatCount: "indefinite"
|
|
896
285
|
}
|
|
897
|
-
)), /* @__PURE__ */
|
|
286
|
+
)), /* @__PURE__ */ u.createElement(
|
|
898
287
|
"animateTransform",
|
|
899
288
|
{
|
|
900
289
|
attributeName: "gradientTransform",
|
|
@@ -905,7 +294,7 @@ const De = [
|
|
|
905
294
|
repeatCount: "indefinite"
|
|
906
295
|
}
|
|
907
296
|
))),
|
|
908
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ u.createElement(
|
|
909
298
|
"path",
|
|
910
299
|
{
|
|
911
300
|
fill: "none",
|
|
@@ -918,66 +307,66 @@ const De = [
|
|
|
918
307
|
)
|
|
919
308
|
);
|
|
920
309
|
};
|
|
921
|
-
async function
|
|
922
|
-
let
|
|
310
|
+
async function at(t, { setContent: e, setIsLoading: n, setConversationId: r, signer: i, baseUrl: s }) {
|
|
311
|
+
let o = "";
|
|
923
312
|
try {
|
|
924
313
|
n(!0);
|
|
925
|
-
const
|
|
314
|
+
const a = {
|
|
926
315
|
method: "POST",
|
|
927
316
|
baseURL: s,
|
|
928
317
|
url: "/nmail/chatdraft",
|
|
929
318
|
params: t
|
|
930
319
|
};
|
|
931
|
-
let
|
|
932
|
-
i && typeof i.generateHeaders == "function" && (
|
|
933
|
-
const
|
|
320
|
+
let p = {};
|
|
321
|
+
i && typeof i.generateHeaders == "function" && (p = await i.generateHeaders(a));
|
|
322
|
+
const l = await fetch(`${s}/nmail/chatdraft`, {
|
|
934
323
|
method: "POST",
|
|
935
324
|
body: JSON.stringify(t),
|
|
936
325
|
headers: {
|
|
937
326
|
"Content-Type": "application/json",
|
|
938
327
|
"Access-Control-Allow-Origin": "*",
|
|
939
|
-
...
|
|
328
|
+
...p
|
|
940
329
|
}
|
|
941
330
|
});
|
|
942
|
-
if (n(!1), !
|
|
331
|
+
if (n(!1), !l.body)
|
|
943
332
|
throw new Error("Response body is not available for streaming.");
|
|
944
|
-
const
|
|
945
|
-
let
|
|
333
|
+
const c = l.body.getReader();
|
|
334
|
+
let d = "", h = 0;
|
|
946
335
|
for (; ; ) {
|
|
947
|
-
const { done:
|
|
948
|
-
if (
|
|
336
|
+
const { done: x, value: f } = await c.read();
|
|
337
|
+
if (x)
|
|
949
338
|
break;
|
|
950
|
-
let
|
|
339
|
+
let k = "", v = "";
|
|
951
340
|
try {
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
const
|
|
955
|
-
for (
|
|
956
|
-
const
|
|
341
|
+
const T = new TextDecoder().decode(f);
|
|
342
|
+
d += T;
|
|
343
|
+
const A = /"answer":".*?"/g, S = /"conversation_id"\s*:\s*"([^"]+)"/, P = [...d.matchAll(A)], O = d.match(S);
|
|
344
|
+
for (O && O[1] && r(O[1]); h < P.length; ) {
|
|
345
|
+
const D = P[h];
|
|
957
346
|
try {
|
|
958
|
-
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
} catch (
|
|
964
|
-
console.error("Parse error: ",
|
|
347
|
+
k = D[0];
|
|
348
|
+
const E = k.slice(10, k.length - 1);
|
|
349
|
+
v = `"${E}"`, E.endsWith("\\") && (v = `"${E}\\"`);
|
|
350
|
+
const qe = JSON.parse(v);
|
|
351
|
+
o += qe, e(o);
|
|
352
|
+
} catch (E) {
|
|
353
|
+
console.error("Parse error: ", E, k, v);
|
|
965
354
|
}
|
|
966
|
-
|
|
355
|
+
h++;
|
|
967
356
|
}
|
|
968
|
-
} catch (
|
|
969
|
-
console.error("TextDecoder error: ",
|
|
357
|
+
} catch (T) {
|
|
358
|
+
console.error("TextDecoder error: ", T, k);
|
|
970
359
|
}
|
|
971
360
|
}
|
|
972
|
-
return
|
|
973
|
-
} catch (
|
|
974
|
-
console.error("Summary error:",
|
|
361
|
+
return o;
|
|
362
|
+
} catch (a) {
|
|
363
|
+
console.error("Summary error:", a), e("");
|
|
975
364
|
} finally {
|
|
976
365
|
n(!1);
|
|
977
366
|
}
|
|
978
367
|
return "";
|
|
979
368
|
}
|
|
980
|
-
function
|
|
369
|
+
function oe() {
|
|
981
370
|
return {
|
|
982
371
|
async: !1,
|
|
983
372
|
breaks: !1,
|
|
@@ -991,23 +380,23 @@ function Ze() {
|
|
|
991
380
|
walkTokens: null
|
|
992
381
|
};
|
|
993
382
|
}
|
|
994
|
-
var
|
|
995
|
-
function
|
|
996
|
-
|
|
383
|
+
var L = oe();
|
|
384
|
+
function $e(t) {
|
|
385
|
+
L = t;
|
|
997
386
|
}
|
|
998
|
-
var
|
|
999
|
-
function
|
|
387
|
+
var q = { exec: () => null };
|
|
388
|
+
function b(t, e = "") {
|
|
1000
389
|
let n = typeof t == "string" ? t : t.source;
|
|
1001
390
|
const r = {
|
|
1002
391
|
replace: (i, s) => {
|
|
1003
|
-
let
|
|
1004
|
-
return
|
|
392
|
+
let o = typeof s == "string" ? s : s.source;
|
|
393
|
+
return o = o.replace(y.caret, "$1"), n = n.replace(i, o), r;
|
|
1005
394
|
},
|
|
1006
395
|
getRegex: () => new RegExp(n, e)
|
|
1007
396
|
};
|
|
1008
397
|
return r;
|
|
1009
398
|
}
|
|
1010
|
-
var
|
|
399
|
+
var y = {
|
|
1011
400
|
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
1012
401
|
outputLinkReplace: /\\([\[\]])/g,
|
|
1013
402
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -1064,123 +453,123 @@ var W = {
|
|
|
1064
453
|
fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`),
|
|
1065
454
|
headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`),
|
|
1066
455
|
htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
1067
|
-
},
|
|
456
|
+
}, lt = /^(?:[ \t]*(?:\n|$))+/, ot = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ct = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, M = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, pt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ce = /(?:[*+-]|\d{1,9}[.)])/, ze = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ce = b(ze).replace(/bull/g, ce).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ht = b(ze).replace(/bull/g, ce).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), pe = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ut = /^[^\n]+/, he = /(?!\s*\])(?:\\.|[^\[\]\\])+/, gt = b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", he).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), dt = b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ce).getRegex(), V = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ue = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ft = b(
|
|
1068
457
|
"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
|
|
1069
458
|
"i"
|
|
1070
|
-
).replace("comment",
|
|
1071
|
-
blockquote:
|
|
1072
|
-
code:
|
|
1073
|
-
def:
|
|
1074
|
-
fences:
|
|
1075
|
-
heading:
|
|
1076
|
-
hr:
|
|
1077
|
-
html:
|
|
1078
|
-
lheading:
|
|
1079
|
-
list:
|
|
1080
|
-
newline:
|
|
1081
|
-
paragraph:
|
|
1082
|
-
table:
|
|
1083
|
-
text:
|
|
1084
|
-
},
|
|
459
|
+
).replace("comment", ue).replace("tag", V).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), _e = b(pe).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", V).getRegex(), mt = b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", _e).getRegex(), ge = {
|
|
460
|
+
blockquote: mt,
|
|
461
|
+
code: ot,
|
|
462
|
+
def: gt,
|
|
463
|
+
fences: ct,
|
|
464
|
+
heading: pt,
|
|
465
|
+
hr: M,
|
|
466
|
+
html: ft,
|
|
467
|
+
lheading: Ce,
|
|
468
|
+
list: dt,
|
|
469
|
+
newline: lt,
|
|
470
|
+
paragraph: _e,
|
|
471
|
+
table: q,
|
|
472
|
+
text: ut
|
|
473
|
+
}, ke = b(
|
|
1085
474
|
"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
1086
|
-
).replace("hr",
|
|
1087
|
-
...
|
|
1088
|
-
lheading:
|
|
1089
|
-
table:
|
|
1090
|
-
paragraph:
|
|
1091
|
-
},
|
|
1092
|
-
...
|
|
1093
|
-
html:
|
|
475
|
+
).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", V).getRegex(), bt = {
|
|
476
|
+
...ge,
|
|
477
|
+
lheading: ht,
|
|
478
|
+
table: ke,
|
|
479
|
+
paragraph: b(pe).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ke).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", V).getRegex()
|
|
480
|
+
}, kt = {
|
|
481
|
+
...ge,
|
|
482
|
+
html: b(
|
|
1094
483
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
1095
|
-
).replace("comment",
|
|
484
|
+
).replace("comment", ue).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
1096
485
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1097
486
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1098
|
-
fences:
|
|
487
|
+
fences: q,
|
|
1099
488
|
// fences not supported
|
|
1100
489
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1101
|
-
paragraph:
|
|
1102
|
-
]`).replace("lheading",
|
|
1103
|
-
},
|
|
490
|
+
paragraph: b(pe).replace("hr", M).replace("heading", ` *#{1,6} *[^
|
|
491
|
+
]`).replace("lheading", Ce).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
492
|
+
}, xt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, wt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ie = /^( {2,}|\\)\n(?!\s*$)/, yt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Q = /[\p{P}\p{S}]/u, de = /[\s\p{P}\p{S}]/u, Le = /[^\s\p{P}\p{S}]/u, vt = b(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, de).getRegex(), Ae = /(?!~)[\p{P}\p{S}]/u, St = /(?!~)[\s\p{P}\p{S}]/u, Rt = /(?:[^\s\p{P}\p{S}]|~)/u, Tt = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Et = b(Pe, "u").replace(/punct/g, Q).getRegex(), $t = b(Pe, "u").replace(/punct/g, Ae).getRegex(), Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", zt = b(Oe, "gu").replace(/notPunctSpace/g, Le).replace(/punctSpace/g, de).replace(/punct/g, Q).getRegex(), Ct = b(Oe, "gu").replace(/notPunctSpace/g, Rt).replace(/punctSpace/g, St).replace(/punct/g, Ae).getRegex(), _t = b(
|
|
1104
493
|
"^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
|
|
1105
494
|
"gu"
|
|
1106
|
-
).replace(/notPunctSpace/g,
|
|
495
|
+
).replace(/notPunctSpace/g, Le).replace(/punctSpace/g, de).replace(/punct/g, Q).getRegex(), It = b(/\\(punct)/, "gu").replace(/punct/g, Q).getRegex(), Lt = b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), At = b(ue).replace("(?:-->|$)", "-->").getRegex(), Pt = b(
|
|
1107
496
|
"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
|
|
1108
|
-
).replace("comment",
|
|
1109
|
-
_backpedal:
|
|
497
|
+
).replace("comment", At).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), U = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ot = b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", U).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), De = b(/^!?\[(label)\]\[(ref)\]/).replace("label", U).replace("ref", he).getRegex(), je = b(/^!?\[(ref)\](?:\[\])?/).replace("ref", he).getRegex(), Dt = b("reflink|nolink(?!\\()", "g").replace("reflink", De).replace("nolink", je).getRegex(), fe = {
|
|
498
|
+
_backpedal: q,
|
|
1110
499
|
// only used for GFM url
|
|
1111
|
-
anyPunctuation:
|
|
1112
|
-
autolink:
|
|
1113
|
-
blockSkip:
|
|
1114
|
-
br:
|
|
1115
|
-
code:
|
|
1116
|
-
del:
|
|
1117
|
-
emStrongLDelim:
|
|
1118
|
-
emStrongRDelimAst:
|
|
1119
|
-
emStrongRDelimUnd:
|
|
1120
|
-
escape:
|
|
1121
|
-
link:
|
|
1122
|
-
nolink:
|
|
1123
|
-
punctuation:
|
|
1124
|
-
reflink:
|
|
1125
|
-
reflinkSearch:
|
|
1126
|
-
tag:
|
|
1127
|
-
text:
|
|
1128
|
-
url:
|
|
1129
|
-
},
|
|
1130
|
-
...
|
|
1131
|
-
link:
|
|
1132
|
-
reflink:
|
|
1133
|
-
},
|
|
1134
|
-
...
|
|
1135
|
-
emStrongRDelimAst:
|
|
1136
|
-
emStrongLDelim:
|
|
1137
|
-
url:
|
|
500
|
+
anyPunctuation: It,
|
|
501
|
+
autolink: Lt,
|
|
502
|
+
blockSkip: Tt,
|
|
503
|
+
br: Ie,
|
|
504
|
+
code: wt,
|
|
505
|
+
del: q,
|
|
506
|
+
emStrongLDelim: Et,
|
|
507
|
+
emStrongRDelimAst: zt,
|
|
508
|
+
emStrongRDelimUnd: _t,
|
|
509
|
+
escape: xt,
|
|
510
|
+
link: Ot,
|
|
511
|
+
nolink: je,
|
|
512
|
+
punctuation: vt,
|
|
513
|
+
reflink: De,
|
|
514
|
+
reflinkSearch: Dt,
|
|
515
|
+
tag: Pt,
|
|
516
|
+
text: yt,
|
|
517
|
+
url: q
|
|
518
|
+
}, jt = {
|
|
519
|
+
...fe,
|
|
520
|
+
link: b(/^!?\[(label)\]\((.*?)\)/).replace("label", U).getRegex(),
|
|
521
|
+
reflink: b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", U).getRegex()
|
|
522
|
+
}, te = {
|
|
523
|
+
...fe,
|
|
524
|
+
emStrongRDelimAst: Ct,
|
|
525
|
+
emStrongLDelim: $t,
|
|
526
|
+
url: b(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
1138
527
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1139
528
|
del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1140
529
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
1141
|
-
},
|
|
1142
|
-
...
|
|
1143
|
-
br:
|
|
1144
|
-
text:
|
|
1145
|
-
},
|
|
1146
|
-
normal:
|
|
1147
|
-
gfm:
|
|
1148
|
-
pedantic:
|
|
1149
|
-
},
|
|
1150
|
-
normal:
|
|
1151
|
-
gfm:
|
|
1152
|
-
breaks:
|
|
1153
|
-
pedantic:
|
|
1154
|
-
},
|
|
530
|
+
}, Bt = {
|
|
531
|
+
...te,
|
|
532
|
+
br: b(Ie).replace("{2,}", "*").getRegex(),
|
|
533
|
+
text: b(te.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
534
|
+
}, H = {
|
|
535
|
+
normal: ge,
|
|
536
|
+
gfm: bt,
|
|
537
|
+
pedantic: kt
|
|
538
|
+
}, j = {
|
|
539
|
+
normal: fe,
|
|
540
|
+
gfm: te,
|
|
541
|
+
breaks: Bt,
|
|
542
|
+
pedantic: jt
|
|
543
|
+
}, qt = {
|
|
1155
544
|
"&": "&",
|
|
1156
545
|
"<": "<",
|
|
1157
546
|
">": ">",
|
|
1158
547
|
'"': """,
|
|
1159
548
|
"'": "'"
|
|
1160
|
-
},
|
|
1161
|
-
function
|
|
549
|
+
}, xe = (t) => qt[t];
|
|
550
|
+
function $(t, e) {
|
|
1162
551
|
if (e) {
|
|
1163
|
-
if (
|
|
1164
|
-
return t.replace(
|
|
1165
|
-
} else if (
|
|
1166
|
-
return t.replace(
|
|
552
|
+
if (y.escapeTest.test(t))
|
|
553
|
+
return t.replace(y.escapeReplace, xe);
|
|
554
|
+
} else if (y.escapeTestNoEncode.test(t))
|
|
555
|
+
return t.replace(y.escapeReplaceNoEncode, xe);
|
|
1167
556
|
return t;
|
|
1168
557
|
}
|
|
1169
|
-
function
|
|
558
|
+
function we(t) {
|
|
1170
559
|
try {
|
|
1171
|
-
t = encodeURI(t).replace(
|
|
560
|
+
t = encodeURI(t).replace(y.percentDecode, "%");
|
|
1172
561
|
} catch {
|
|
1173
562
|
return null;
|
|
1174
563
|
}
|
|
1175
564
|
return t;
|
|
1176
565
|
}
|
|
1177
|
-
function
|
|
566
|
+
function ye(t, e) {
|
|
1178
567
|
var s;
|
|
1179
|
-
const n = t.replace(
|
|
1180
|
-
let
|
|
1181
|
-
for (; --
|
|
1182
|
-
return
|
|
1183
|
-
}), r = n.split(
|
|
568
|
+
const n = t.replace(y.findPipe, (o, a, p) => {
|
|
569
|
+
let l = !1, c = a;
|
|
570
|
+
for (; --c >= 0 && p[c] === "\\"; ) l = !l;
|
|
571
|
+
return l ? "|" : " |";
|
|
572
|
+
}), r = n.split(y.splitPipe);
|
|
1184
573
|
let i = 0;
|
|
1185
574
|
if (r[0].trim() || r.shift(), r.length > 0 && !((s = r.at(-1)) != null && s.trim()) && r.pop(), e)
|
|
1186
575
|
if (r.length > e)
|
|
@@ -1188,10 +577,10 @@ function gt(t, e) {
|
|
|
1188
577
|
else
|
|
1189
578
|
for (; r.length < e; ) r.push("");
|
|
1190
579
|
for (; i < r.length; i++)
|
|
1191
|
-
r[i] = r[i].trim().replace(
|
|
580
|
+
r[i] = r[i].trim().replace(y.slashPipe, "|");
|
|
1192
581
|
return r;
|
|
1193
582
|
}
|
|
1194
|
-
function
|
|
583
|
+
function B(t, e, n) {
|
|
1195
584
|
const r = t.length;
|
|
1196
585
|
if (r === 0)
|
|
1197
586
|
return "";
|
|
@@ -1200,7 +589,7 @@ function ie(t, e, n) {
|
|
|
1200
589
|
i++;
|
|
1201
590
|
return t.slice(0, r - i);
|
|
1202
591
|
}
|
|
1203
|
-
function
|
|
592
|
+
function Mt(t, e) {
|
|
1204
593
|
if (t.indexOf(e[1]) === -1)
|
|
1205
594
|
return -1;
|
|
1206
595
|
let n = 0;
|
|
@@ -1213,42 +602,42 @@ function Dn(t, e) {
|
|
|
1213
602
|
return r;
|
|
1214
603
|
return n > 0 ? -2 : -1;
|
|
1215
604
|
}
|
|
1216
|
-
function
|
|
1217
|
-
const s = e.href,
|
|
605
|
+
function ve(t, e, n, r, i) {
|
|
606
|
+
const s = e.href, o = e.title || null, a = t[1].replace(i.other.outputLinkReplace, "$1");
|
|
1218
607
|
r.state.inLink = !0;
|
|
1219
|
-
const
|
|
608
|
+
const p = {
|
|
1220
609
|
type: t[0].charAt(0) === "!" ? "image" : "link",
|
|
1221
610
|
raw: n,
|
|
1222
611
|
href: s,
|
|
1223
|
-
title:
|
|
1224
|
-
text:
|
|
1225
|
-
tokens: r.inlineTokens(
|
|
612
|
+
title: o,
|
|
613
|
+
text: a,
|
|
614
|
+
tokens: r.inlineTokens(a)
|
|
1226
615
|
};
|
|
1227
|
-
return r.state.inLink = !1,
|
|
616
|
+
return r.state.inLink = !1, p;
|
|
1228
617
|
}
|
|
1229
|
-
function
|
|
618
|
+
function Nt(t, e, n) {
|
|
1230
619
|
const r = t.match(n.other.indentCodeCompensation);
|
|
1231
620
|
if (r === null)
|
|
1232
621
|
return e;
|
|
1233
622
|
const i = r[1];
|
|
1234
623
|
return e.split(`
|
|
1235
624
|
`).map((s) => {
|
|
1236
|
-
const
|
|
1237
|
-
if (
|
|
625
|
+
const o = s.match(n.other.beginningSpace);
|
|
626
|
+
if (o === null)
|
|
1238
627
|
return s;
|
|
1239
|
-
const [
|
|
1240
|
-
return
|
|
628
|
+
const [a] = o;
|
|
629
|
+
return a.length >= i.length ? s.slice(i.length) : s;
|
|
1241
630
|
}).join(`
|
|
1242
631
|
`);
|
|
1243
632
|
}
|
|
1244
|
-
var
|
|
633
|
+
var Z = class {
|
|
1245
634
|
// set by the lexer
|
|
1246
635
|
constructor(t) {
|
|
1247
|
-
|
|
1248
|
-
|
|
636
|
+
g(this, "options");
|
|
637
|
+
g(this, "rules");
|
|
1249
638
|
// set by the lexer
|
|
1250
|
-
|
|
1251
|
-
this.options = t ||
|
|
639
|
+
g(this, "lexer");
|
|
640
|
+
this.options = t || L;
|
|
1252
641
|
}
|
|
1253
642
|
space(t) {
|
|
1254
643
|
const e = this.rules.block.newline.exec(t);
|
|
@@ -1266,7 +655,7 @@ var ge = class {
|
|
|
1266
655
|
type: "code",
|
|
1267
656
|
raw: e[0],
|
|
1268
657
|
codeBlockStyle: "indented",
|
|
1269
|
-
text: this.options.pedantic ? n :
|
|
658
|
+
text: this.options.pedantic ? n : B(n, `
|
|
1270
659
|
`)
|
|
1271
660
|
};
|
|
1272
661
|
}
|
|
@@ -1274,7 +663,7 @@ var ge = class {
|
|
|
1274
663
|
fences(t) {
|
|
1275
664
|
const e = this.rules.block.fences.exec(t);
|
|
1276
665
|
if (e) {
|
|
1277
|
-
const n = e[0], r =
|
|
666
|
+
const n = e[0], r = Nt(n, e[3] || "", this.rules);
|
|
1278
667
|
return {
|
|
1279
668
|
type: "code",
|
|
1280
669
|
raw: n,
|
|
@@ -1288,7 +677,7 @@ var ge = class {
|
|
|
1288
677
|
if (e) {
|
|
1289
678
|
let n = e[2].trim();
|
|
1290
679
|
if (this.rules.other.endingHash.test(n)) {
|
|
1291
|
-
const r =
|
|
680
|
+
const r = B(n, "#");
|
|
1292
681
|
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
1293
682
|
}
|
|
1294
683
|
return {
|
|
@@ -1305,52 +694,52 @@ var ge = class {
|
|
|
1305
694
|
if (e)
|
|
1306
695
|
return {
|
|
1307
696
|
type: "hr",
|
|
1308
|
-
raw:
|
|
697
|
+
raw: B(e[0], `
|
|
1309
698
|
`)
|
|
1310
699
|
};
|
|
1311
700
|
}
|
|
1312
701
|
blockquote(t) {
|
|
1313
702
|
const e = this.rules.block.blockquote.exec(t);
|
|
1314
703
|
if (e) {
|
|
1315
|
-
let n =
|
|
704
|
+
let n = B(e[0], `
|
|
1316
705
|
`).split(`
|
|
1317
706
|
`), r = "", i = "";
|
|
1318
707
|
const s = [];
|
|
1319
708
|
for (; n.length > 0; ) {
|
|
1320
|
-
let
|
|
1321
|
-
const
|
|
1322
|
-
let
|
|
1323
|
-
for (
|
|
1324
|
-
if (this.rules.other.blockquoteStart.test(n[
|
|
1325
|
-
|
|
1326
|
-
else if (!
|
|
1327
|
-
|
|
709
|
+
let o = !1;
|
|
710
|
+
const a = [];
|
|
711
|
+
let p;
|
|
712
|
+
for (p = 0; p < n.length; p++)
|
|
713
|
+
if (this.rules.other.blockquoteStart.test(n[p]))
|
|
714
|
+
a.push(n[p]), o = !0;
|
|
715
|
+
else if (!o)
|
|
716
|
+
a.push(n[p]);
|
|
1328
717
|
else
|
|
1329
718
|
break;
|
|
1330
|
-
n = n.slice(
|
|
1331
|
-
const
|
|
1332
|
-
`),
|
|
719
|
+
n = n.slice(p);
|
|
720
|
+
const l = a.join(`
|
|
721
|
+
`), c = l.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1333
722
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1334
723
|
r = r ? `${r}
|
|
1335
|
-
${
|
|
1336
|
-
${
|
|
1337
|
-
const
|
|
1338
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
724
|
+
${l}` : l, i = i ? `${i}
|
|
725
|
+
${c}` : c;
|
|
726
|
+
const d = this.lexer.state.top;
|
|
727
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, s, !0), this.lexer.state.top = d, n.length === 0)
|
|
1339
728
|
break;
|
|
1340
|
-
const
|
|
1341
|
-
if ((
|
|
729
|
+
const h = s.at(-1);
|
|
730
|
+
if ((h == null ? void 0 : h.type) === "code")
|
|
1342
731
|
break;
|
|
1343
|
-
if ((
|
|
1344
|
-
const
|
|
732
|
+
if ((h == null ? void 0 : h.type) === "blockquote") {
|
|
733
|
+
const x = h, f = x.raw + `
|
|
1345
734
|
` + n.join(`
|
|
1346
|
-
`),
|
|
1347
|
-
s[s.length - 1] =
|
|
735
|
+
`), k = this.blockquote(f);
|
|
736
|
+
s[s.length - 1] = k, r = r.substring(0, r.length - x.raw.length) + k.raw, i = i.substring(0, i.length - x.text.length) + k.text;
|
|
1348
737
|
break;
|
|
1349
|
-
} else if ((
|
|
1350
|
-
const
|
|
738
|
+
} else if ((h == null ? void 0 : h.type) === "list") {
|
|
739
|
+
const x = h, f = x.raw + `
|
|
1351
740
|
` + n.join(`
|
|
1352
|
-
`),
|
|
1353
|
-
s[s.length - 1] =
|
|
741
|
+
`), k = this.list(f);
|
|
742
|
+
s[s.length - 1] = k, r = r.substring(0, r.length - h.raw.length) + k.raw, i = i.substring(0, i.length - x.raw.length) + k.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
1354
743
|
`);
|
|
1355
744
|
continue;
|
|
1356
745
|
}
|
|
@@ -1377,63 +766,63 @@ ${l}` : l;
|
|
|
1377
766
|
};
|
|
1378
767
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
1379
768
|
const s = this.rules.other.listItemRegex(n);
|
|
1380
|
-
let
|
|
769
|
+
let o = !1;
|
|
1381
770
|
for (; t; ) {
|
|
1382
|
-
let
|
|
771
|
+
let p = !1, l = "", c = "";
|
|
1383
772
|
if (!(e = s.exec(t)) || this.rules.block.hr.test(t))
|
|
1384
773
|
break;
|
|
1385
|
-
|
|
1386
|
-
let
|
|
1387
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
1388
|
-
`, 1)[0],
|
|
1389
|
-
if (this.options.pedantic ? (
|
|
1390
|
-
`, t = t.substring(
|
|
1391
|
-
const
|
|
774
|
+
l = e[0], t = t.substring(l.length);
|
|
775
|
+
let d = e[2].split(`
|
|
776
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (T) => " ".repeat(3 * T.length)), h = t.split(`
|
|
777
|
+
`, 1)[0], x = !d.trim(), f = 0;
|
|
778
|
+
if (this.options.pedantic ? (f = 2, c = d.trimStart()) : x ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = d.slice(f), f += e[1].length), x && this.rules.other.blankLine.test(h) && (l += h + `
|
|
779
|
+
`, t = t.substring(h.length + 1), p = !0), !p) {
|
|
780
|
+
const T = this.rules.other.nextBulletRegex(f), A = this.rules.other.hrRegex(f), S = this.rules.other.fencesBeginRegex(f), P = this.rules.other.headingBeginRegex(f), O = this.rules.other.htmlBeginRegex(f);
|
|
1392
781
|
for (; t; ) {
|
|
1393
|
-
const
|
|
782
|
+
const D = t.split(`
|
|
1394
783
|
`, 1)[0];
|
|
1395
|
-
let
|
|
1396
|
-
if (
|
|
784
|
+
let E;
|
|
785
|
+
if (h = D, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), E = h) : E = h.replace(this.rules.other.tabCharGlobal, " "), S.test(h) || P.test(h) || O.test(h) || T.test(h) || A.test(h))
|
|
1397
786
|
break;
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1400
|
-
` +
|
|
787
|
+
if (E.search(this.rules.other.nonSpaceChar) >= f || !h.trim())
|
|
788
|
+
c += `
|
|
789
|
+
` + E.slice(f);
|
|
1401
790
|
else {
|
|
1402
|
-
if (
|
|
791
|
+
if (x || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || S.test(d) || P.test(d) || A.test(d))
|
|
1403
792
|
break;
|
|
1404
|
-
|
|
1405
|
-
` +
|
|
793
|
+
c += `
|
|
794
|
+
` + h;
|
|
1406
795
|
}
|
|
1407
|
-
!
|
|
1408
|
-
`, t = t.substring(
|
|
796
|
+
!x && !h.trim() && (x = !0), l += D + `
|
|
797
|
+
`, t = t.substring(D.length + 1), d = E.slice(f);
|
|
1409
798
|
}
|
|
1410
799
|
}
|
|
1411
|
-
i.loose || (
|
|
1412
|
-
let
|
|
1413
|
-
this.options.gfm && (
|
|
800
|
+
i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(l) && (o = !0));
|
|
801
|
+
let k = null, v;
|
|
802
|
+
this.options.gfm && (k = this.rules.other.listIsTask.exec(c), k && (v = k[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
|
|
1414
803
|
type: "list_item",
|
|
1415
|
-
raw:
|
|
1416
|
-
task: !!
|
|
1417
|
-
checked:
|
|
804
|
+
raw: l,
|
|
805
|
+
task: !!k,
|
|
806
|
+
checked: v,
|
|
1418
807
|
loose: !1,
|
|
1419
|
-
text:
|
|
808
|
+
text: c,
|
|
1420
809
|
tokens: []
|
|
1421
|
-
}), i.raw +=
|
|
810
|
+
}), i.raw += l;
|
|
1422
811
|
}
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1425
|
-
|
|
812
|
+
const a = i.items.at(-1);
|
|
813
|
+
if (a)
|
|
814
|
+
a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
|
|
1426
815
|
else
|
|
1427
816
|
return;
|
|
1428
817
|
i.raw = i.raw.trimEnd();
|
|
1429
|
-
for (let
|
|
1430
|
-
if (this.lexer.state.top = !1, i.items[
|
|
1431
|
-
const
|
|
1432
|
-
i.loose =
|
|
818
|
+
for (let p = 0; p < i.items.length; p++)
|
|
819
|
+
if (this.lexer.state.top = !1, i.items[p].tokens = this.lexer.blockTokens(i.items[p].text, []), !i.loose) {
|
|
820
|
+
const l = i.items[p].tokens.filter((d) => d.type === "space"), c = l.length > 0 && l.some((d) => this.rules.other.anyLine.test(d.raw));
|
|
821
|
+
i.loose = c;
|
|
1433
822
|
}
|
|
1434
823
|
if (i.loose)
|
|
1435
|
-
for (let
|
|
1436
|
-
i.items[
|
|
824
|
+
for (let p = 0; p < i.items.length; p++)
|
|
825
|
+
i.items[p].loose = !0;
|
|
1437
826
|
return i;
|
|
1438
827
|
}
|
|
1439
828
|
}
|
|
@@ -1462,11 +851,11 @@ ${l}` : l;
|
|
|
1462
851
|
}
|
|
1463
852
|
}
|
|
1464
853
|
table(t) {
|
|
1465
|
-
var
|
|
854
|
+
var o;
|
|
1466
855
|
const e = this.rules.block.table.exec(t);
|
|
1467
856
|
if (!e || !this.rules.other.tableDelimiter.test(e[2]))
|
|
1468
857
|
return;
|
|
1469
|
-
const n =
|
|
858
|
+
const n = ye(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = (o = e[3]) != null && o.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1470
859
|
`) : [], s = {
|
|
1471
860
|
type: "table",
|
|
1472
861
|
raw: e[0],
|
|
@@ -1475,21 +864,21 @@ ${l}` : l;
|
|
|
1475
864
|
rows: []
|
|
1476
865
|
};
|
|
1477
866
|
if (n.length === r.length) {
|
|
1478
|
-
for (const
|
|
1479
|
-
this.rules.other.tableAlignRight.test(
|
|
1480
|
-
for (let
|
|
867
|
+
for (const a of r)
|
|
868
|
+
this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
869
|
+
for (let a = 0; a < n.length; a++)
|
|
1481
870
|
s.header.push({
|
|
1482
|
-
text: n[
|
|
1483
|
-
tokens: this.lexer.inline(n[
|
|
871
|
+
text: n[a],
|
|
872
|
+
tokens: this.lexer.inline(n[a]),
|
|
1484
873
|
header: !0,
|
|
1485
|
-
align: s.align[
|
|
874
|
+
align: s.align[a]
|
|
1486
875
|
});
|
|
1487
|
-
for (const
|
|
1488
|
-
s.rows.push(
|
|
1489
|
-
text:
|
|
1490
|
-
tokens: this.lexer.inline(
|
|
876
|
+
for (const a of i)
|
|
877
|
+
s.rows.push(ye(a, s.header.length).map((p, l) => ({
|
|
878
|
+
text: p,
|
|
879
|
+
tokens: this.lexer.inline(p),
|
|
1491
880
|
header: !1,
|
|
1492
|
-
align: s.align[
|
|
881
|
+
align: s.align[l]
|
|
1493
882
|
})));
|
|
1494
883
|
return s;
|
|
1495
884
|
}
|
|
@@ -1556,16 +945,16 @@ ${l}` : l;
|
|
|
1556
945
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
1557
946
|
if (!this.rules.other.endAngleBracket.test(n))
|
|
1558
947
|
return;
|
|
1559
|
-
const s =
|
|
948
|
+
const s = B(n.slice(0, -1), "\\");
|
|
1560
949
|
if ((n.length - s.length) % 2 === 0)
|
|
1561
950
|
return;
|
|
1562
951
|
} else {
|
|
1563
|
-
const s =
|
|
952
|
+
const s = Mt(e[2], "()");
|
|
1564
953
|
if (s === -2)
|
|
1565
954
|
return;
|
|
1566
955
|
if (s > -1) {
|
|
1567
|
-
const
|
|
1568
|
-
e[2] = e[2].substring(0, s), e[0] = e[0].substring(0,
|
|
956
|
+
const a = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
|
|
957
|
+
e[2] = e[2].substring(0, s), e[0] = e[0].substring(0, a).trim(), e[3] = "";
|
|
1569
958
|
}
|
|
1570
959
|
}
|
|
1571
960
|
let r = e[2], i = "";
|
|
@@ -1574,7 +963,7 @@ ${l}` : l;
|
|
|
1574
963
|
s && (r = s[1], i = s[3]);
|
|
1575
964
|
} else
|
|
1576
965
|
i = e[3] ? e[3].slice(1, -1) : "";
|
|
1577
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
966
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ve(e, {
|
|
1578
967
|
href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1579
968
|
title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1580
969
|
}, e[0], this.lexer, this.rules);
|
|
@@ -1592,7 +981,7 @@ ${l}` : l;
|
|
|
1592
981
|
text: s
|
|
1593
982
|
};
|
|
1594
983
|
}
|
|
1595
|
-
return
|
|
984
|
+
return ve(n, i, n[0], this.lexer, this.rules);
|
|
1596
985
|
}
|
|
1597
986
|
}
|
|
1598
987
|
emStrong(t, e, n = "") {
|
|
@@ -1600,35 +989,35 @@ ${l}` : l;
|
|
|
1600
989
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
1601
990
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
1602
991
|
const s = [...r[0]].length - 1;
|
|
1603
|
-
let
|
|
1604
|
-
const
|
|
1605
|
-
for (
|
|
1606
|
-
if (
|
|
1607
|
-
if (
|
|
1608
|
-
|
|
992
|
+
let o, a, p = s, l = 0;
|
|
993
|
+
const c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
994
|
+
for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) != null; ) {
|
|
995
|
+
if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
|
|
996
|
+
if (a = [...o].length, r[3] || r[4]) {
|
|
997
|
+
p += a;
|
|
1609
998
|
continue;
|
|
1610
|
-
} else if ((r[5] || r[6]) && s % 3 && !((s +
|
|
1611
|
-
|
|
999
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
|
|
1000
|
+
l += a;
|
|
1612
1001
|
continue;
|
|
1613
1002
|
}
|
|
1614
|
-
if (
|
|
1615
|
-
|
|
1616
|
-
const
|
|
1617
|
-
if (Math.min(s,
|
|
1618
|
-
const
|
|
1003
|
+
if (p -= a, p > 0) continue;
|
|
1004
|
+
a = Math.min(a, a + p + l);
|
|
1005
|
+
const d = [...r[0]][0].length, h = t.slice(0, s + r.index + d + a);
|
|
1006
|
+
if (Math.min(s, a) % 2) {
|
|
1007
|
+
const f = h.slice(1, -1);
|
|
1619
1008
|
return {
|
|
1620
1009
|
type: "em",
|
|
1621
|
-
raw:
|
|
1622
|
-
text:
|
|
1623
|
-
tokens: this.lexer.inlineTokens(
|
|
1010
|
+
raw: h,
|
|
1011
|
+
text: f,
|
|
1012
|
+
tokens: this.lexer.inlineTokens(f)
|
|
1624
1013
|
};
|
|
1625
1014
|
}
|
|
1626
|
-
const
|
|
1015
|
+
const x = h.slice(2, -2);
|
|
1627
1016
|
return {
|
|
1628
1017
|
type: "strong",
|
|
1629
|
-
raw:
|
|
1630
|
-
text:
|
|
1631
|
-
tokens: this.lexer.inlineTokens(
|
|
1018
|
+
raw: h,
|
|
1019
|
+
text: x,
|
|
1020
|
+
tokens: this.lexer.inlineTokens(x)
|
|
1632
1021
|
};
|
|
1633
1022
|
}
|
|
1634
1023
|
}
|
|
@@ -1723,51 +1112,51 @@ ${l}` : l;
|
|
|
1723
1112
|
};
|
|
1724
1113
|
}
|
|
1725
1114
|
}
|
|
1726
|
-
},
|
|
1115
|
+
}, z = class ne {
|
|
1727
1116
|
constructor(e) {
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
1117
|
+
g(this, "tokens");
|
|
1118
|
+
g(this, "options");
|
|
1119
|
+
g(this, "state");
|
|
1120
|
+
g(this, "tokenizer");
|
|
1121
|
+
g(this, "inlineQueue");
|
|
1122
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || L, this.options.tokenizer = this.options.tokenizer || new Z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1734
1123
|
inLink: !1,
|
|
1735
1124
|
inRawBlock: !1,
|
|
1736
1125
|
top: !0
|
|
1737
1126
|
};
|
|
1738
1127
|
const n = {
|
|
1739
|
-
other:
|
|
1740
|
-
block:
|
|
1741
|
-
inline:
|
|
1128
|
+
other: y,
|
|
1129
|
+
block: H.normal,
|
|
1130
|
+
inline: j.normal
|
|
1742
1131
|
};
|
|
1743
|
-
this.options.pedantic ? (n.block =
|
|
1132
|
+
this.options.pedantic ? (n.block = H.pedantic, n.inline = j.pedantic) : this.options.gfm && (n.block = H.gfm, this.options.breaks ? n.inline = j.breaks : n.inline = j.gfm), this.tokenizer.rules = n;
|
|
1744
1133
|
}
|
|
1745
1134
|
/**
|
|
1746
1135
|
* Expose Rules
|
|
1747
1136
|
*/
|
|
1748
1137
|
static get rules() {
|
|
1749
1138
|
return {
|
|
1750
|
-
block:
|
|
1751
|
-
inline:
|
|
1139
|
+
block: H,
|
|
1140
|
+
inline: j
|
|
1752
1141
|
};
|
|
1753
1142
|
}
|
|
1754
1143
|
/**
|
|
1755
1144
|
* Static Lex Method
|
|
1756
1145
|
*/
|
|
1757
1146
|
static lex(e, n) {
|
|
1758
|
-
return new
|
|
1147
|
+
return new ne(n).lex(e);
|
|
1759
1148
|
}
|
|
1760
1149
|
/**
|
|
1761
1150
|
* Static Lex Inline Method
|
|
1762
1151
|
*/
|
|
1763
1152
|
static lexInline(e, n) {
|
|
1764
|
-
return new
|
|
1153
|
+
return new ne(n).inlineTokens(e);
|
|
1765
1154
|
}
|
|
1766
1155
|
/**
|
|
1767
1156
|
* Preprocessing
|
|
1768
1157
|
*/
|
|
1769
1158
|
lex(e) {
|
|
1770
|
-
e = e.replace(
|
|
1159
|
+
e = e.replace(y.carriageReturn, `
|
|
1771
1160
|
`), this.blockTokens(e, this.tokens);
|
|
1772
1161
|
for (let n = 0; n < this.inlineQueue.length; n++) {
|
|
1773
1162
|
const r = this.inlineQueue[n];
|
|
@@ -1776,100 +1165,100 @@ ${l}` : l;
|
|
|
1776
1165
|
return this.inlineQueue = [], this.tokens;
|
|
1777
1166
|
}
|
|
1778
1167
|
blockTokens(e, n = [], r = !1) {
|
|
1779
|
-
var i, s,
|
|
1780
|
-
for (this.options.pedantic && (e = e.replace(
|
|
1781
|
-
let
|
|
1782
|
-
if ((s = (i = this.options.extensions) == null ? void 0 : i.block) != null && s.some((
|
|
1168
|
+
var i, s, o;
|
|
1169
|
+
for (this.options.pedantic && (e = e.replace(y.tabCharGlobal, " ").replace(y.spaceLine, "")); e; ) {
|
|
1170
|
+
let a;
|
|
1171
|
+
if ((s = (i = this.options.extensions) == null ? void 0 : i.block) != null && s.some((l) => (a = l.call({ lexer: this }, e, n)) ? (e = e.substring(a.raw.length), n.push(a), !0) : !1))
|
|
1783
1172
|
continue;
|
|
1784
|
-
if (
|
|
1785
|
-
e = e.substring(
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1788
|
-
` : n.push(
|
|
1173
|
+
if (a = this.tokenizer.space(e)) {
|
|
1174
|
+
e = e.substring(a.raw.length);
|
|
1175
|
+
const l = n.at(-1);
|
|
1176
|
+
a.raw.length === 1 && l !== void 0 ? l.raw += `
|
|
1177
|
+
` : n.push(a);
|
|
1789
1178
|
continue;
|
|
1790
1179
|
}
|
|
1791
|
-
if (
|
|
1792
|
-
e = e.substring(
|
|
1793
|
-
const
|
|
1794
|
-
(
|
|
1795
|
-
` +
|
|
1796
|
-
` +
|
|
1180
|
+
if (a = this.tokenizer.code(e)) {
|
|
1181
|
+
e = e.substring(a.raw.length);
|
|
1182
|
+
const l = n.at(-1);
|
|
1183
|
+
(l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += `
|
|
1184
|
+
` + a.raw, l.text += `
|
|
1185
|
+
` + a.text, this.inlineQueue.at(-1).src = l.text) : n.push(a);
|
|
1797
1186
|
continue;
|
|
1798
1187
|
}
|
|
1799
|
-
if (
|
|
1800
|
-
e = e.substring(
|
|
1188
|
+
if (a = this.tokenizer.fences(e)) {
|
|
1189
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1801
1190
|
continue;
|
|
1802
1191
|
}
|
|
1803
|
-
if (
|
|
1804
|
-
e = e.substring(
|
|
1192
|
+
if (a = this.tokenizer.heading(e)) {
|
|
1193
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1805
1194
|
continue;
|
|
1806
1195
|
}
|
|
1807
|
-
if (
|
|
1808
|
-
e = e.substring(
|
|
1196
|
+
if (a = this.tokenizer.hr(e)) {
|
|
1197
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1809
1198
|
continue;
|
|
1810
1199
|
}
|
|
1811
|
-
if (
|
|
1812
|
-
e = e.substring(
|
|
1200
|
+
if (a = this.tokenizer.blockquote(e)) {
|
|
1201
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1813
1202
|
continue;
|
|
1814
1203
|
}
|
|
1815
|
-
if (
|
|
1816
|
-
e = e.substring(
|
|
1204
|
+
if (a = this.tokenizer.list(e)) {
|
|
1205
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1817
1206
|
continue;
|
|
1818
1207
|
}
|
|
1819
|
-
if (
|
|
1820
|
-
e = e.substring(
|
|
1208
|
+
if (a = this.tokenizer.html(e)) {
|
|
1209
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1821
1210
|
continue;
|
|
1822
1211
|
}
|
|
1823
|
-
if (
|
|
1824
|
-
e = e.substring(
|
|
1825
|
-
const
|
|
1826
|
-
(
|
|
1827
|
-
` +
|
|
1828
|
-
` +
|
|
1829
|
-
href:
|
|
1830
|
-
title:
|
|
1212
|
+
if (a = this.tokenizer.def(e)) {
|
|
1213
|
+
e = e.substring(a.raw.length);
|
|
1214
|
+
const l = n.at(-1);
|
|
1215
|
+
(l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += `
|
|
1216
|
+
` + a.raw, l.text += `
|
|
1217
|
+
` + a.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[a.tag] || (this.tokens.links[a.tag] = {
|
|
1218
|
+
href: a.href,
|
|
1219
|
+
title: a.title
|
|
1831
1220
|
});
|
|
1832
1221
|
continue;
|
|
1833
1222
|
}
|
|
1834
|
-
if (
|
|
1835
|
-
e = e.substring(
|
|
1223
|
+
if (a = this.tokenizer.table(e)) {
|
|
1224
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1836
1225
|
continue;
|
|
1837
1226
|
}
|
|
1838
|
-
if (
|
|
1839
|
-
e = e.substring(
|
|
1227
|
+
if (a = this.tokenizer.lheading(e)) {
|
|
1228
|
+
e = e.substring(a.raw.length), n.push(a);
|
|
1840
1229
|
continue;
|
|
1841
1230
|
}
|
|
1842
|
-
let
|
|
1843
|
-
if ((
|
|
1844
|
-
let
|
|
1845
|
-
const
|
|
1846
|
-
let
|
|
1847
|
-
this.options.extensions.startBlock.forEach((
|
|
1848
|
-
|
|
1849
|
-
}),
|
|
1850
|
-
}
|
|
1851
|
-
if (this.state.top && (
|
|
1852
|
-
const
|
|
1853
|
-
r && (
|
|
1854
|
-
` +
|
|
1855
|
-
` +
|
|
1231
|
+
let p = e;
|
|
1232
|
+
if ((o = this.options.extensions) != null && o.startBlock) {
|
|
1233
|
+
let l = 1 / 0;
|
|
1234
|
+
const c = e.slice(1);
|
|
1235
|
+
let d;
|
|
1236
|
+
this.options.extensions.startBlock.forEach((h) => {
|
|
1237
|
+
d = h.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
|
|
1238
|
+
}), l < 1 / 0 && l >= 0 && (p = e.substring(0, l + 1));
|
|
1239
|
+
}
|
|
1240
|
+
if (this.state.top && (a = this.tokenizer.paragraph(p))) {
|
|
1241
|
+
const l = n.at(-1);
|
|
1242
|
+
r && (l == null ? void 0 : l.type) === "paragraph" ? (l.raw += `
|
|
1243
|
+
` + a.raw, l.text += `
|
|
1244
|
+
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(a), r = p.length !== e.length, e = e.substring(a.raw.length);
|
|
1856
1245
|
continue;
|
|
1857
1246
|
}
|
|
1858
|
-
if (
|
|
1859
|
-
e = e.substring(
|
|
1860
|
-
const
|
|
1861
|
-
(
|
|
1862
|
-
` +
|
|
1863
|
-
` +
|
|
1247
|
+
if (a = this.tokenizer.text(e)) {
|
|
1248
|
+
e = e.substring(a.raw.length);
|
|
1249
|
+
const l = n.at(-1);
|
|
1250
|
+
(l == null ? void 0 : l.type) === "text" ? (l.raw += `
|
|
1251
|
+
` + a.raw, l.text += `
|
|
1252
|
+
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(a);
|
|
1864
1253
|
continue;
|
|
1865
1254
|
}
|
|
1866
1255
|
if (e) {
|
|
1867
|
-
const
|
|
1256
|
+
const l = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
1868
1257
|
if (this.options.silent) {
|
|
1869
|
-
console.error(
|
|
1258
|
+
console.error(l);
|
|
1870
1259
|
break;
|
|
1871
1260
|
} else
|
|
1872
|
-
throw new Error(
|
|
1261
|
+
throw new Error(l);
|
|
1873
1262
|
}
|
|
1874
1263
|
}
|
|
1875
1264
|
return this.state.top = !0, n;
|
|
@@ -1881,108 +1270,108 @@ ${l}` : l;
|
|
|
1881
1270
|
* Lexing/Compiling
|
|
1882
1271
|
*/
|
|
1883
1272
|
inlineTokens(e, n = []) {
|
|
1884
|
-
var
|
|
1273
|
+
var a, p, l;
|
|
1885
1274
|
let r = e, i = null;
|
|
1886
1275
|
if (this.tokens.links) {
|
|
1887
|
-
const
|
|
1888
|
-
if (
|
|
1276
|
+
const c = Object.keys(this.tokens.links);
|
|
1277
|
+
if (c.length > 0)
|
|
1889
1278
|
for (; (i = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
|
|
1890
|
-
|
|
1279
|
+
c.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
1891
1280
|
}
|
|
1892
1281
|
for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(r)) != null; )
|
|
1893
1282
|
r = r.slice(0, i.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
1894
1283
|
for (; (i = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
|
|
1895
1284
|
r = r.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1896
|
-
let s = !1,
|
|
1285
|
+
let s = !1, o = "";
|
|
1897
1286
|
for (; e; ) {
|
|
1898
|
-
s || (
|
|
1899
|
-
let
|
|
1900
|
-
if ((
|
|
1287
|
+
s || (o = ""), s = !1;
|
|
1288
|
+
let c;
|
|
1289
|
+
if ((p = (a = this.options.extensions) == null ? void 0 : a.inline) != null && p.some((h) => (c = h.call({ lexer: this }, e, n)) ? (e = e.substring(c.raw.length), n.push(c), !0) : !1))
|
|
1901
1290
|
continue;
|
|
1902
|
-
if (
|
|
1903
|
-
e = e.substring(
|
|
1291
|
+
if (c = this.tokenizer.escape(e)) {
|
|
1292
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1904
1293
|
continue;
|
|
1905
1294
|
}
|
|
1906
|
-
if (
|
|
1907
|
-
e = e.substring(
|
|
1295
|
+
if (c = this.tokenizer.tag(e)) {
|
|
1296
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1908
1297
|
continue;
|
|
1909
1298
|
}
|
|
1910
|
-
if (
|
|
1911
|
-
e = e.substring(
|
|
1299
|
+
if (c = this.tokenizer.link(e)) {
|
|
1300
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1912
1301
|
continue;
|
|
1913
1302
|
}
|
|
1914
|
-
if (
|
|
1915
|
-
e = e.substring(
|
|
1916
|
-
const
|
|
1917
|
-
|
|
1303
|
+
if (c = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
1304
|
+
e = e.substring(c.raw.length);
|
|
1305
|
+
const h = n.at(-1);
|
|
1306
|
+
c.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += c.raw, h.text += c.text) : n.push(c);
|
|
1918
1307
|
continue;
|
|
1919
1308
|
}
|
|
1920
|
-
if (
|
|
1921
|
-
e = e.substring(
|
|
1309
|
+
if (c = this.tokenizer.emStrong(e, r, o)) {
|
|
1310
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1922
1311
|
continue;
|
|
1923
1312
|
}
|
|
1924
|
-
if (
|
|
1925
|
-
e = e.substring(
|
|
1313
|
+
if (c = this.tokenizer.codespan(e)) {
|
|
1314
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1926
1315
|
continue;
|
|
1927
1316
|
}
|
|
1928
|
-
if (
|
|
1929
|
-
e = e.substring(
|
|
1317
|
+
if (c = this.tokenizer.br(e)) {
|
|
1318
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1930
1319
|
continue;
|
|
1931
1320
|
}
|
|
1932
|
-
if (
|
|
1933
|
-
e = e.substring(
|
|
1321
|
+
if (c = this.tokenizer.del(e)) {
|
|
1322
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1934
1323
|
continue;
|
|
1935
1324
|
}
|
|
1936
|
-
if (
|
|
1937
|
-
e = e.substring(
|
|
1325
|
+
if (c = this.tokenizer.autolink(e)) {
|
|
1326
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1938
1327
|
continue;
|
|
1939
1328
|
}
|
|
1940
|
-
if (!this.state.inLink && (
|
|
1941
|
-
e = e.substring(
|
|
1329
|
+
if (!this.state.inLink && (c = this.tokenizer.url(e))) {
|
|
1330
|
+
e = e.substring(c.raw.length), n.push(c);
|
|
1942
1331
|
continue;
|
|
1943
1332
|
}
|
|
1944
|
-
let
|
|
1945
|
-
if ((
|
|
1946
|
-
let
|
|
1947
|
-
const
|
|
1948
|
-
let
|
|
1949
|
-
this.options.extensions.startInline.forEach((
|
|
1950
|
-
|
|
1951
|
-
}),
|
|
1952
|
-
}
|
|
1953
|
-
if (
|
|
1954
|
-
e = e.substring(
|
|
1955
|
-
const
|
|
1956
|
-
(
|
|
1333
|
+
let d = e;
|
|
1334
|
+
if ((l = this.options.extensions) != null && l.startInline) {
|
|
1335
|
+
let h = 1 / 0;
|
|
1336
|
+
const x = e.slice(1);
|
|
1337
|
+
let f;
|
|
1338
|
+
this.options.extensions.startInline.forEach((k) => {
|
|
1339
|
+
f = k.call({ lexer: this }, x), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
|
|
1340
|
+
}), h < 1 / 0 && h >= 0 && (d = e.substring(0, h + 1));
|
|
1341
|
+
}
|
|
1342
|
+
if (c = this.tokenizer.inlineText(d)) {
|
|
1343
|
+
e = e.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), s = !0;
|
|
1344
|
+
const h = n.at(-1);
|
|
1345
|
+
(h == null ? void 0 : h.type) === "text" ? (h.raw += c.raw, h.text += c.text) : n.push(c);
|
|
1957
1346
|
continue;
|
|
1958
1347
|
}
|
|
1959
1348
|
if (e) {
|
|
1960
|
-
const
|
|
1349
|
+
const h = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
1961
1350
|
if (this.options.silent) {
|
|
1962
|
-
console.error(
|
|
1351
|
+
console.error(h);
|
|
1963
1352
|
break;
|
|
1964
1353
|
} else
|
|
1965
|
-
throw new Error(
|
|
1354
|
+
throw new Error(h);
|
|
1966
1355
|
}
|
|
1967
1356
|
}
|
|
1968
1357
|
return n;
|
|
1969
1358
|
}
|
|
1970
|
-
},
|
|
1359
|
+
}, G = class {
|
|
1971
1360
|
// set by the parser
|
|
1972
1361
|
constructor(t) {
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
this.options = t ||
|
|
1362
|
+
g(this, "options");
|
|
1363
|
+
g(this, "parser");
|
|
1364
|
+
this.options = t || L;
|
|
1976
1365
|
}
|
|
1977
1366
|
space(t) {
|
|
1978
1367
|
return "";
|
|
1979
1368
|
}
|
|
1980
1369
|
code({ text: t, lang: e, escaped: n }) {
|
|
1981
1370
|
var s;
|
|
1982
|
-
const r = (s = (e || "").match(
|
|
1371
|
+
const r = (s = (e || "").match(y.notSpaceStart)) == null ? void 0 : s[0], i = t.replace(y.endingNewline, "") + `
|
|
1983
1372
|
`;
|
|
1984
|
-
return r ? '<pre><code class="language-' +
|
|
1985
|
-
` : "<pre><code>" + (n ? i :
|
|
1373
|
+
return r ? '<pre><code class="language-' + $(r) + '">' + (n ? i : $(i, !0)) + `</code></pre>
|
|
1374
|
+
` : "<pre><code>" + (n ? i : $(i, !0)) + `</code></pre>
|
|
1986
1375
|
`;
|
|
1987
1376
|
}
|
|
1988
1377
|
blockquote({ tokens: t }) {
|
|
@@ -2004,9 +1393,9 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
2004
1393
|
list(t) {
|
|
2005
1394
|
const e = t.ordered, n = t.start;
|
|
2006
1395
|
let r = "";
|
|
2007
|
-
for (let
|
|
2008
|
-
const
|
|
2009
|
-
r += this.listitem(
|
|
1396
|
+
for (let o = 0; o < t.items.length; o++) {
|
|
1397
|
+
const a = t.items[o];
|
|
1398
|
+
r += this.listitem(a);
|
|
2010
1399
|
}
|
|
2011
1400
|
const i = e ? "ol" : "ul", s = e && n !== 1 ? ' start="' + n + '"' : "";
|
|
2012
1401
|
return "<" + i + s + `>
|
|
@@ -2018,7 +1407,7 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
2018
1407
|
let e = "";
|
|
2019
1408
|
if (t.task) {
|
|
2020
1409
|
const r = this.checkbox({ checked: !!t.checked });
|
|
2021
|
-
t.loose ? ((n = t.tokens[0]) == null ? void 0 : n.type) === "paragraph" ? (t.tokens[0].text = r + " " + t.tokens[0].text, t.tokens[0].tokens && t.tokens[0].tokens.length > 0 && t.tokens[0].tokens[0].type === "text" && (t.tokens[0].tokens[0].text = r + " " +
|
|
1410
|
+
t.loose ? ((n = t.tokens[0]) == null ? void 0 : n.type) === "paragraph" ? (t.tokens[0].text = r + " " + t.tokens[0].text, t.tokens[0].tokens && t.tokens[0].tokens.length > 0 && t.tokens[0].tokens[0].type === "text" && (t.tokens[0].tokens[0].text = r + " " + $(t.tokens[0].tokens[0].text), t.tokens[0].tokens[0].escaped = !0)) : t.tokens.unshift({
|
|
2022
1411
|
type: "text",
|
|
2023
1412
|
raw: r + " ",
|
|
2024
1413
|
text: r + " ",
|
|
@@ -2044,8 +1433,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
2044
1433
|
for (let i = 0; i < t.rows.length; i++) {
|
|
2045
1434
|
const s = t.rows[i];
|
|
2046
1435
|
n = "";
|
|
2047
|
-
for (let
|
|
2048
|
-
n += this.tablecell(s[
|
|
1436
|
+
for (let o = 0; o < s.length; o++)
|
|
1437
|
+
n += this.tablecell(s[o]);
|
|
2049
1438
|
r += this.tablerow({ text: n });
|
|
2050
1439
|
}
|
|
2051
1440
|
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
@@ -2074,7 +1463,7 @@ ${t}</tr>
|
|
|
2074
1463
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
2075
1464
|
}
|
|
2076
1465
|
codespan({ text: t }) {
|
|
2077
|
-
return `<code>${
|
|
1466
|
+
return `<code>${$(t, !0)}</code>`;
|
|
2078
1467
|
}
|
|
2079
1468
|
br(t) {
|
|
2080
1469
|
return "<br>";
|
|
@@ -2083,26 +1472,26 @@ ${t}</tr>
|
|
|
2083
1472
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
2084
1473
|
}
|
|
2085
1474
|
link({ href: t, title: e, tokens: n }) {
|
|
2086
|
-
const r = this.parser.parseInline(n), i =
|
|
1475
|
+
const r = this.parser.parseInline(n), i = we(t);
|
|
2087
1476
|
if (i === null)
|
|
2088
1477
|
return r;
|
|
2089
1478
|
t = i;
|
|
2090
1479
|
let s = '<a href="' + t + '"';
|
|
2091
|
-
return e && (s += ' title="' +
|
|
1480
|
+
return e && (s += ' title="' + $(e) + '"'), s += ">" + r + "</a>", s;
|
|
2092
1481
|
}
|
|
2093
1482
|
image({ href: t, title: e, text: n, tokens: r }) {
|
|
2094
1483
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
2095
|
-
const i =
|
|
1484
|
+
const i = we(t);
|
|
2096
1485
|
if (i === null)
|
|
2097
|
-
return
|
|
1486
|
+
return $(n);
|
|
2098
1487
|
t = i;
|
|
2099
1488
|
let s = `<img src="${t}" alt="${n}"`;
|
|
2100
|
-
return e && (s += ` title="${
|
|
1489
|
+
return e && (s += ` title="${$(e)}"`), s += ">", s;
|
|
2101
1490
|
}
|
|
2102
1491
|
text(t) {
|
|
2103
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
1492
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : $(t.text);
|
|
2104
1493
|
}
|
|
2105
|
-
},
|
|
1494
|
+
}, me = class {
|
|
2106
1495
|
// no need for block level renderers
|
|
2107
1496
|
strong({ text: t }) {
|
|
2108
1497
|
return t;
|
|
@@ -2131,24 +1520,24 @@ ${t}</tr>
|
|
|
2131
1520
|
br() {
|
|
2132
1521
|
return "";
|
|
2133
1522
|
}
|
|
2134
|
-
},
|
|
1523
|
+
}, C = class re {
|
|
2135
1524
|
constructor(e) {
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
this.options = e ||
|
|
1525
|
+
g(this, "options");
|
|
1526
|
+
g(this, "renderer");
|
|
1527
|
+
g(this, "textRenderer");
|
|
1528
|
+
this.options = e || L, this.options.renderer = this.options.renderer || new G(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new me();
|
|
2140
1529
|
}
|
|
2141
1530
|
/**
|
|
2142
1531
|
* Static Parse Method
|
|
2143
1532
|
*/
|
|
2144
1533
|
static parse(e, n) {
|
|
2145
|
-
return new
|
|
1534
|
+
return new re(n).parse(e);
|
|
2146
1535
|
}
|
|
2147
1536
|
/**
|
|
2148
1537
|
* Static Parse Inline Method
|
|
2149
1538
|
*/
|
|
2150
1539
|
static parseInline(e, n) {
|
|
2151
|
-
return new
|
|
1540
|
+
return new re(n).parseInline(e);
|
|
2152
1541
|
}
|
|
2153
1542
|
/**
|
|
2154
1543
|
* Parse Loop
|
|
@@ -2156,71 +1545,71 @@ ${t}</tr>
|
|
|
2156
1545
|
parse(e, n = !0) {
|
|
2157
1546
|
var i, s;
|
|
2158
1547
|
let r = "";
|
|
2159
|
-
for (let
|
|
2160
|
-
const
|
|
2161
|
-
if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[
|
|
2162
|
-
const
|
|
2163
|
-
if (
|
|
2164
|
-
r +=
|
|
1548
|
+
for (let o = 0; o < e.length; o++) {
|
|
1549
|
+
const a = e[o];
|
|
1550
|
+
if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[a.type]) {
|
|
1551
|
+
const l = a, c = this.options.extensions.renderers[l.type].call({ parser: this }, l);
|
|
1552
|
+
if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(l.type)) {
|
|
1553
|
+
r += c || "";
|
|
2165
1554
|
continue;
|
|
2166
1555
|
}
|
|
2167
1556
|
}
|
|
2168
|
-
const
|
|
2169
|
-
switch (
|
|
1557
|
+
const p = a;
|
|
1558
|
+
switch (p.type) {
|
|
2170
1559
|
case "space": {
|
|
2171
|
-
r += this.renderer.space(
|
|
1560
|
+
r += this.renderer.space(p);
|
|
2172
1561
|
continue;
|
|
2173
1562
|
}
|
|
2174
1563
|
case "hr": {
|
|
2175
|
-
r += this.renderer.hr(
|
|
1564
|
+
r += this.renderer.hr(p);
|
|
2176
1565
|
continue;
|
|
2177
1566
|
}
|
|
2178
1567
|
case "heading": {
|
|
2179
|
-
r += this.renderer.heading(
|
|
1568
|
+
r += this.renderer.heading(p);
|
|
2180
1569
|
continue;
|
|
2181
1570
|
}
|
|
2182
1571
|
case "code": {
|
|
2183
|
-
r += this.renderer.code(
|
|
1572
|
+
r += this.renderer.code(p);
|
|
2184
1573
|
continue;
|
|
2185
1574
|
}
|
|
2186
1575
|
case "table": {
|
|
2187
|
-
r += this.renderer.table(
|
|
1576
|
+
r += this.renderer.table(p);
|
|
2188
1577
|
continue;
|
|
2189
1578
|
}
|
|
2190
1579
|
case "blockquote": {
|
|
2191
|
-
r += this.renderer.blockquote(
|
|
1580
|
+
r += this.renderer.blockquote(p);
|
|
2192
1581
|
continue;
|
|
2193
1582
|
}
|
|
2194
1583
|
case "list": {
|
|
2195
|
-
r += this.renderer.list(
|
|
1584
|
+
r += this.renderer.list(p);
|
|
2196
1585
|
continue;
|
|
2197
1586
|
}
|
|
2198
1587
|
case "html": {
|
|
2199
|
-
r += this.renderer.html(
|
|
1588
|
+
r += this.renderer.html(p);
|
|
2200
1589
|
continue;
|
|
2201
1590
|
}
|
|
2202
1591
|
case "paragraph": {
|
|
2203
|
-
r += this.renderer.paragraph(
|
|
1592
|
+
r += this.renderer.paragraph(p);
|
|
2204
1593
|
continue;
|
|
2205
1594
|
}
|
|
2206
1595
|
case "text": {
|
|
2207
|
-
let
|
|
2208
|
-
for (;
|
|
2209
|
-
|
|
2210
|
-
` + this.renderer.text(
|
|
1596
|
+
let l = p, c = this.renderer.text(l);
|
|
1597
|
+
for (; o + 1 < e.length && e[o + 1].type === "text"; )
|
|
1598
|
+
l = e[++o], c += `
|
|
1599
|
+
` + this.renderer.text(l);
|
|
2211
1600
|
n ? r += this.renderer.paragraph({
|
|
2212
1601
|
type: "paragraph",
|
|
2213
|
-
raw:
|
|
2214
|
-
text:
|
|
2215
|
-
tokens: [{ type: "text", raw:
|
|
2216
|
-
}) : r +=
|
|
1602
|
+
raw: c,
|
|
1603
|
+
text: c,
|
|
1604
|
+
tokens: [{ type: "text", raw: c, text: c, escaped: !0 }]
|
|
1605
|
+
}) : r += c;
|
|
2217
1606
|
continue;
|
|
2218
1607
|
}
|
|
2219
1608
|
default: {
|
|
2220
|
-
const
|
|
1609
|
+
const l = 'Token with "' + p.type + '" type was not found.';
|
|
2221
1610
|
if (this.options.silent)
|
|
2222
|
-
return console.error(
|
|
2223
|
-
throw new Error(
|
|
1611
|
+
return console.error(l), "";
|
|
1612
|
+
throw new Error(l);
|
|
2224
1613
|
}
|
|
2225
1614
|
}
|
|
2226
1615
|
}
|
|
@@ -2232,72 +1621,72 @@ ${t}</tr>
|
|
|
2232
1621
|
parseInline(e, n = this.renderer) {
|
|
2233
1622
|
var i, s;
|
|
2234
1623
|
let r = "";
|
|
2235
|
-
for (let
|
|
2236
|
-
const
|
|
2237
|
-
if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[
|
|
2238
|
-
const
|
|
2239
|
-
if (
|
|
2240
|
-
r +=
|
|
1624
|
+
for (let o = 0; o < e.length; o++) {
|
|
1625
|
+
const a = e[o];
|
|
1626
|
+
if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[a.type]) {
|
|
1627
|
+
const l = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
1628
|
+
if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
|
|
1629
|
+
r += l || "";
|
|
2241
1630
|
continue;
|
|
2242
1631
|
}
|
|
2243
1632
|
}
|
|
2244
|
-
const
|
|
2245
|
-
switch (
|
|
1633
|
+
const p = a;
|
|
1634
|
+
switch (p.type) {
|
|
2246
1635
|
case "escape": {
|
|
2247
|
-
r += n.text(
|
|
1636
|
+
r += n.text(p);
|
|
2248
1637
|
break;
|
|
2249
1638
|
}
|
|
2250
1639
|
case "html": {
|
|
2251
|
-
r += n.html(
|
|
1640
|
+
r += n.html(p);
|
|
2252
1641
|
break;
|
|
2253
1642
|
}
|
|
2254
1643
|
case "link": {
|
|
2255
|
-
r += n.link(
|
|
1644
|
+
r += n.link(p);
|
|
2256
1645
|
break;
|
|
2257
1646
|
}
|
|
2258
1647
|
case "image": {
|
|
2259
|
-
r += n.image(
|
|
1648
|
+
r += n.image(p);
|
|
2260
1649
|
break;
|
|
2261
1650
|
}
|
|
2262
1651
|
case "strong": {
|
|
2263
|
-
r += n.strong(
|
|
1652
|
+
r += n.strong(p);
|
|
2264
1653
|
break;
|
|
2265
1654
|
}
|
|
2266
1655
|
case "em": {
|
|
2267
|
-
r += n.em(
|
|
1656
|
+
r += n.em(p);
|
|
2268
1657
|
break;
|
|
2269
1658
|
}
|
|
2270
1659
|
case "codespan": {
|
|
2271
|
-
r += n.codespan(
|
|
1660
|
+
r += n.codespan(p);
|
|
2272
1661
|
break;
|
|
2273
1662
|
}
|
|
2274
1663
|
case "br": {
|
|
2275
|
-
r += n.br(
|
|
1664
|
+
r += n.br(p);
|
|
2276
1665
|
break;
|
|
2277
1666
|
}
|
|
2278
1667
|
case "del": {
|
|
2279
|
-
r += n.del(
|
|
1668
|
+
r += n.del(p);
|
|
2280
1669
|
break;
|
|
2281
1670
|
}
|
|
2282
1671
|
case "text": {
|
|
2283
|
-
r += n.text(
|
|
1672
|
+
r += n.text(p);
|
|
2284
1673
|
break;
|
|
2285
1674
|
}
|
|
2286
1675
|
default: {
|
|
2287
|
-
const
|
|
1676
|
+
const l = 'Token with "' + p.type + '" type was not found.';
|
|
2288
1677
|
if (this.options.silent)
|
|
2289
|
-
return console.error(
|
|
2290
|
-
throw new Error(
|
|
1678
|
+
return console.error(l), "";
|
|
1679
|
+
throw new Error(l);
|
|
2291
1680
|
}
|
|
2292
1681
|
}
|
|
2293
1682
|
}
|
|
2294
1683
|
return r;
|
|
2295
1684
|
}
|
|
2296
|
-
},
|
|
1685
|
+
}, K, W = (K = class {
|
|
2297
1686
|
constructor(t) {
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
this.options = t ||
|
|
1687
|
+
g(this, "options");
|
|
1688
|
+
g(this, "block");
|
|
1689
|
+
this.options = t || L;
|
|
2301
1690
|
}
|
|
2302
1691
|
/**
|
|
2303
1692
|
* Process markdown before marked
|
|
@@ -2321,30 +1710,30 @@ ${t}</tr>
|
|
|
2321
1710
|
* Provide function to tokenize markdown
|
|
2322
1711
|
*/
|
|
2323
1712
|
provideLexer() {
|
|
2324
|
-
return this.block ?
|
|
1713
|
+
return this.block ? z.lex : z.lexInline;
|
|
2325
1714
|
}
|
|
2326
1715
|
/**
|
|
2327
1716
|
* Provide function to parse tokens
|
|
2328
1717
|
*/
|
|
2329
1718
|
provideParser() {
|
|
2330
|
-
return this.block ?
|
|
1719
|
+
return this.block ? C.parse : C.parseInline;
|
|
2331
1720
|
}
|
|
2332
|
-
},
|
|
1721
|
+
}, g(K, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
2333
1722
|
"preprocess",
|
|
2334
1723
|
"postprocess",
|
|
2335
1724
|
"processAllTokens"
|
|
2336
|
-
])),
|
|
1725
|
+
])), K), Ht = class {
|
|
2337
1726
|
constructor(...t) {
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
1727
|
+
g(this, "defaults", oe());
|
|
1728
|
+
g(this, "options", this.setOptions);
|
|
1729
|
+
g(this, "parse", this.parseMarkdown(!0));
|
|
1730
|
+
g(this, "parseInline", this.parseMarkdown(!1));
|
|
1731
|
+
g(this, "Parser", C);
|
|
1732
|
+
g(this, "Renderer", G);
|
|
1733
|
+
g(this, "TextRenderer", me);
|
|
1734
|
+
g(this, "Lexer", z);
|
|
1735
|
+
g(this, "Tokenizer", Z);
|
|
1736
|
+
g(this, "Hooks", W);
|
|
2348
1737
|
this.use(...t);
|
|
2349
1738
|
}
|
|
2350
1739
|
/**
|
|
@@ -2356,25 +1745,25 @@ ${t}</tr>
|
|
|
2356
1745
|
for (const s of t)
|
|
2357
1746
|
switch (n = n.concat(e.call(this, s)), s.type) {
|
|
2358
1747
|
case "table": {
|
|
2359
|
-
const
|
|
2360
|
-
for (const
|
|
2361
|
-
n = n.concat(this.walkTokens(
|
|
2362
|
-
for (const
|
|
2363
|
-
for (const
|
|
2364
|
-
n = n.concat(this.walkTokens(
|
|
1748
|
+
const o = s;
|
|
1749
|
+
for (const a of o.header)
|
|
1750
|
+
n = n.concat(this.walkTokens(a.tokens, e));
|
|
1751
|
+
for (const a of o.rows)
|
|
1752
|
+
for (const p of a)
|
|
1753
|
+
n = n.concat(this.walkTokens(p.tokens, e));
|
|
2365
1754
|
break;
|
|
2366
1755
|
}
|
|
2367
1756
|
case "list": {
|
|
2368
|
-
const
|
|
2369
|
-
n = n.concat(this.walkTokens(
|
|
1757
|
+
const o = s;
|
|
1758
|
+
n = n.concat(this.walkTokens(o.items, e));
|
|
2370
1759
|
break;
|
|
2371
1760
|
}
|
|
2372
1761
|
default: {
|
|
2373
|
-
const
|
|
2374
|
-
(i = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && i[
|
|
2375
|
-
const
|
|
2376
|
-
n = n.concat(this.walkTokens(
|
|
2377
|
-
}) :
|
|
1762
|
+
const o = s;
|
|
1763
|
+
(i = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && i[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((a) => {
|
|
1764
|
+
const p = o[a].flat(1 / 0);
|
|
1765
|
+
n = n.concat(this.walkTokens(p, e));
|
|
1766
|
+
}) : o.tokens && (n = n.concat(this.walkTokens(o.tokens, e)));
|
|
2378
1767
|
}
|
|
2379
1768
|
}
|
|
2380
1769
|
return n;
|
|
@@ -2388,9 +1777,9 @@ ${t}</tr>
|
|
|
2388
1777
|
throw new Error("extension name required");
|
|
2389
1778
|
if ("renderer" in i) {
|
|
2390
1779
|
const s = e.renderers[i.name];
|
|
2391
|
-
s ? e.renderers[i.name] = function(...
|
|
2392
|
-
let
|
|
2393
|
-
return
|
|
1780
|
+
s ? e.renderers[i.name] = function(...o) {
|
|
1781
|
+
let a = i.renderer.apply(this, o);
|
|
1782
|
+
return a === !1 && (a = s.apply(this, o)), a;
|
|
2394
1783
|
} : e.renderers[i.name] = i.renderer;
|
|
2395
1784
|
}
|
|
2396
1785
|
if ("tokenizer" in i) {
|
|
@@ -2401,60 +1790,60 @@ ${t}</tr>
|
|
|
2401
1790
|
}
|
|
2402
1791
|
"childTokens" in i && i.childTokens && (e.childTokens[i.name] = i.childTokens);
|
|
2403
1792
|
}), r.extensions = e), n.renderer) {
|
|
2404
|
-
const i = this.defaults.renderer || new
|
|
1793
|
+
const i = this.defaults.renderer || new G(this.defaults);
|
|
2405
1794
|
for (const s in n.renderer) {
|
|
2406
1795
|
if (!(s in i))
|
|
2407
1796
|
throw new Error(`renderer '${s}' does not exist`);
|
|
2408
1797
|
if (["options", "parser"].includes(s))
|
|
2409
1798
|
continue;
|
|
2410
|
-
const
|
|
2411
|
-
i[
|
|
2412
|
-
let
|
|
2413
|
-
return
|
|
1799
|
+
const o = s, a = n.renderer[o], p = i[o];
|
|
1800
|
+
i[o] = (...l) => {
|
|
1801
|
+
let c = a.apply(i, l);
|
|
1802
|
+
return c === !1 && (c = p.apply(i, l)), c || "";
|
|
2414
1803
|
};
|
|
2415
1804
|
}
|
|
2416
1805
|
r.renderer = i;
|
|
2417
1806
|
}
|
|
2418
1807
|
if (n.tokenizer) {
|
|
2419
|
-
const i = this.defaults.tokenizer || new
|
|
1808
|
+
const i = this.defaults.tokenizer || new Z(this.defaults);
|
|
2420
1809
|
for (const s in n.tokenizer) {
|
|
2421
1810
|
if (!(s in i))
|
|
2422
1811
|
throw new Error(`tokenizer '${s}' does not exist`);
|
|
2423
1812
|
if (["options", "rules", "lexer"].includes(s))
|
|
2424
1813
|
continue;
|
|
2425
|
-
const
|
|
2426
|
-
i[
|
|
2427
|
-
let
|
|
2428
|
-
return
|
|
1814
|
+
const o = s, a = n.tokenizer[o], p = i[o];
|
|
1815
|
+
i[o] = (...l) => {
|
|
1816
|
+
let c = a.apply(i, l);
|
|
1817
|
+
return c === !1 && (c = p.apply(i, l)), c;
|
|
2429
1818
|
};
|
|
2430
1819
|
}
|
|
2431
1820
|
r.tokenizer = i;
|
|
2432
1821
|
}
|
|
2433
1822
|
if (n.hooks) {
|
|
2434
|
-
const i = this.defaults.hooks || new
|
|
1823
|
+
const i = this.defaults.hooks || new W();
|
|
2435
1824
|
for (const s in n.hooks) {
|
|
2436
1825
|
if (!(s in i))
|
|
2437
1826
|
throw new Error(`hook '${s}' does not exist`);
|
|
2438
1827
|
if (["options", "block"].includes(s))
|
|
2439
1828
|
continue;
|
|
2440
|
-
const
|
|
2441
|
-
|
|
1829
|
+
const o = s, a = n.hooks[o], p = i[o];
|
|
1830
|
+
W.passThroughHooks.has(s) ? i[o] = (l) => {
|
|
2442
1831
|
if (this.defaults.async)
|
|
2443
|
-
return Promise.resolve(
|
|
2444
|
-
const
|
|
2445
|
-
return
|
|
2446
|
-
} : i[
|
|
2447
|
-
let
|
|
2448
|
-
return
|
|
1832
|
+
return Promise.resolve(a.call(i, l)).then((d) => p.call(i, d));
|
|
1833
|
+
const c = a.call(i, l);
|
|
1834
|
+
return p.call(i, c);
|
|
1835
|
+
} : i[o] = (...l) => {
|
|
1836
|
+
let c = a.apply(i, l);
|
|
1837
|
+
return c === !1 && (c = p.apply(i, l)), c;
|
|
2449
1838
|
};
|
|
2450
1839
|
}
|
|
2451
1840
|
r.hooks = i;
|
|
2452
1841
|
}
|
|
2453
1842
|
if (n.walkTokens) {
|
|
2454
1843
|
const i = this.defaults.walkTokens, s = n.walkTokens;
|
|
2455
|
-
r.walkTokens = function(
|
|
2456
|
-
let
|
|
2457
|
-
return
|
|
1844
|
+
r.walkTokens = function(o) {
|
|
1845
|
+
let a = [];
|
|
1846
|
+
return a.push(s.call(this, o)), i && (a = a.concat(i.call(this, o))), a;
|
|
2458
1847
|
};
|
|
2459
1848
|
}
|
|
2460
1849
|
this.defaults = { ...this.defaults, ...r };
|
|
@@ -2464,32 +1853,32 @@ ${t}</tr>
|
|
|
2464
1853
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
2465
1854
|
}
|
|
2466
1855
|
lexer(t, e) {
|
|
2467
|
-
return
|
|
1856
|
+
return z.lex(t, e ?? this.defaults);
|
|
2468
1857
|
}
|
|
2469
1858
|
parser(t, e) {
|
|
2470
|
-
return
|
|
1859
|
+
return C.parse(t, e ?? this.defaults);
|
|
2471
1860
|
}
|
|
2472
1861
|
parseMarkdown(t) {
|
|
2473
1862
|
return (n, r) => {
|
|
2474
|
-
const i = { ...r }, s = { ...this.defaults, ...i },
|
|
1863
|
+
const i = { ...r }, s = { ...this.defaults, ...i }, o = this.onError(!!s.silent, !!s.async);
|
|
2475
1864
|
if (this.defaults.async === !0 && i.async === !1)
|
|
2476
|
-
return
|
|
1865
|
+
return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
2477
1866
|
if (typeof n > "u" || n === null)
|
|
2478
|
-
return
|
|
1867
|
+
return o(new Error("marked(): input parameter is undefined or null"));
|
|
2479
1868
|
if (typeof n != "string")
|
|
2480
|
-
return
|
|
1869
|
+
return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
2481
1870
|
s.hooks && (s.hooks.options = s, s.hooks.block = t);
|
|
2482
|
-
const
|
|
1871
|
+
const a = s.hooks ? s.hooks.provideLexer() : t ? z.lex : z.lexInline, p = s.hooks ? s.hooks.provideParser() : t ? C.parse : C.parseInline;
|
|
2483
1872
|
if (s.async)
|
|
2484
|
-
return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((
|
|
1873
|
+
return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((l) => a(l, s)).then((l) => s.hooks ? s.hooks.processAllTokens(l) : l).then((l) => s.walkTokens ? Promise.all(this.walkTokens(l, s.walkTokens)).then(() => l) : l).then((l) => p(l, s)).then((l) => s.hooks ? s.hooks.postprocess(l) : l).catch(o);
|
|
2485
1874
|
try {
|
|
2486
1875
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
2487
|
-
let
|
|
2488
|
-
s.hooks && (
|
|
2489
|
-
let
|
|
2490
|
-
return s.hooks && (
|
|
2491
|
-
} catch (
|
|
2492
|
-
return
|
|
1876
|
+
let l = a(n, s);
|
|
1877
|
+
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
1878
|
+
let c = p(l, s);
|
|
1879
|
+
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
1880
|
+
} catch (l) {
|
|
1881
|
+
return o(l);
|
|
2493
1882
|
}
|
|
2494
1883
|
};
|
|
2495
1884
|
}
|
|
@@ -2497,7 +1886,7 @@ ${t}</tr>
|
|
|
2497
1886
|
return (n) => {
|
|
2498
1887
|
if (n.message += `
|
|
2499
1888
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
2500
|
-
const r = "<p>An error occurred:</p><pre>" +
|
|
1889
|
+
const r = "<p>An error occurred:</p><pre>" + $(n.message + "", !0) + "</pre>";
|
|
2501
1890
|
return e ? Promise.resolve(r) : r;
|
|
2502
1891
|
}
|
|
2503
1892
|
if (e)
|
|
@@ -2505,39 +1894,39 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
2505
1894
|
throw n;
|
|
2506
1895
|
};
|
|
2507
1896
|
}
|
|
2508
|
-
},
|
|
2509
|
-
function
|
|
2510
|
-
return
|
|
1897
|
+
}, I = new Ht();
|
|
1898
|
+
function m(t, e) {
|
|
1899
|
+
return I.parse(t, e);
|
|
2511
1900
|
}
|
|
2512
|
-
|
|
2513
|
-
return
|
|
1901
|
+
m.options = m.setOptions = function(t) {
|
|
1902
|
+
return I.setOptions(t), m.defaults = I.defaults, $e(m.defaults), m;
|
|
2514
1903
|
};
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
return
|
|
1904
|
+
m.getDefaults = oe;
|
|
1905
|
+
m.defaults = L;
|
|
1906
|
+
m.use = function(...t) {
|
|
1907
|
+
return I.use(...t), m.defaults = I.defaults, $e(m.defaults), m;
|
|
2519
1908
|
};
|
|
2520
|
-
|
|
2521
|
-
return
|
|
1909
|
+
m.walkTokens = function(t, e) {
|
|
1910
|
+
return I.walkTokens(t, e);
|
|
2522
1911
|
};
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
const
|
|
1912
|
+
m.parseInline = I.parseInline;
|
|
1913
|
+
m.Parser = C;
|
|
1914
|
+
m.parser = C.parse;
|
|
1915
|
+
m.Renderer = G;
|
|
1916
|
+
m.TextRenderer = me;
|
|
1917
|
+
m.Lexer = z;
|
|
1918
|
+
m.lexer = z.lex;
|
|
1919
|
+
m.Tokenizer = Z;
|
|
1920
|
+
m.Hooks = W;
|
|
1921
|
+
m.parse = m;
|
|
1922
|
+
m.options;
|
|
1923
|
+
m.setOptions;
|
|
1924
|
+
m.use;
|
|
1925
|
+
m.walkTokens;
|
|
1926
|
+
m.parseInline;
|
|
1927
|
+
C.parse;
|
|
1928
|
+
z.lex;
|
|
1929
|
+
const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
|
|
2541
1930
|
"div",
|
|
2542
1931
|
{
|
|
2543
1932
|
style: {
|
|
@@ -2545,15 +1934,15 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2545
1934
|
...e
|
|
2546
1935
|
}
|
|
2547
1936
|
},
|
|
2548
|
-
t && t.subject ? /* @__PURE__ */
|
|
1937
|
+
t && t.subject ? /* @__PURE__ */ u.createElement(
|
|
2549
1938
|
"div",
|
|
2550
1939
|
{
|
|
2551
1940
|
dangerouslySetInnerHTML: {
|
|
2552
|
-
__html:
|
|
1941
|
+
__html: m.parse(t.body, { async: !1 })
|
|
2553
1942
|
}
|
|
2554
1943
|
}
|
|
2555
|
-
) : /* @__PURE__ */
|
|
2556
|
-
),
|
|
1944
|
+
) : /* @__PURE__ */ u.createElement("p", { style: { margin: 0, whiteSpace: "pre-wrap" } }, t ? t.question : "")
|
|
1945
|
+
), Wt = ({
|
|
2557
1946
|
items: t,
|
|
2558
1947
|
onApply: e,
|
|
2559
1948
|
getEditorContent: n
|
|
@@ -2562,12 +1951,12 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2562
1951
|
const s = /제목:[^\n]*/g;
|
|
2563
1952
|
((s.exec(i) || [])[0] || "").replace("제목: ", "").replace(`
|
|
2564
1953
|
`, "");
|
|
2565
|
-
const
|
|
2566
|
-
let
|
|
2567
|
-
const
|
|
2568
|
-
|
|
1954
|
+
const a = i.replace(s, "").replace("본문: ", "");
|
|
1955
|
+
let p = await m.parse(a);
|
|
1956
|
+
const l = /<!--HanbiroSignatureStart-->([\s\S]*?)<!--HanbiroSignatureEnd-->/g, c = n ? n() : "", d = l.exec(c) || [];
|
|
1957
|
+
d[0] && (p = p + "<br>" + d[0]), e({ html: p });
|
|
2569
1958
|
};
|
|
2570
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ u.createElement(
|
|
2571
1960
|
"div",
|
|
2572
1961
|
{
|
|
2573
1962
|
style: {
|
|
@@ -2582,7 +1971,7 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2582
1971
|
flexDirection: "column"
|
|
2583
1972
|
}
|
|
2584
1973
|
},
|
|
2585
|
-
t && t.map((i) => /* @__PURE__ */
|
|
1974
|
+
t && t.map((i) => /* @__PURE__ */ u.createElement(
|
|
2586
1975
|
"div",
|
|
2587
1976
|
{
|
|
2588
1977
|
key: i.id,
|
|
@@ -2592,7 +1981,7 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2592
1981
|
marginBottom: 16
|
|
2593
1982
|
}
|
|
2594
1983
|
},
|
|
2595
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ u.createElement(
|
|
2596
1985
|
"div",
|
|
2597
1986
|
{
|
|
2598
1987
|
style: {
|
|
@@ -2604,8 +1993,8 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2604
1993
|
marginTop: 8
|
|
2605
1994
|
}
|
|
2606
1995
|
},
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
|
|
1996
|
+
/* @__PURE__ */ u.createElement(
|
|
1997
|
+
Se,
|
|
2609
1998
|
{
|
|
2610
1999
|
data: { question: i.question },
|
|
2611
2000
|
style: {
|
|
@@ -2617,7 +2006,7 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2617
2006
|
}
|
|
2618
2007
|
)
|
|
2619
2008
|
),
|
|
2620
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ u.createElement(
|
|
2621
2010
|
"div",
|
|
2622
2011
|
{
|
|
2623
2012
|
style: {
|
|
@@ -2629,7 +2018,7 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2629
2018
|
marginTop: 8
|
|
2630
2019
|
}
|
|
2631
2020
|
},
|
|
2632
|
-
i.isLoading ? /* @__PURE__ */
|
|
2021
|
+
i.isLoading ? /* @__PURE__ */ u.createElement(
|
|
2633
2022
|
"div",
|
|
2634
2023
|
{
|
|
2635
2024
|
style: {
|
|
@@ -2639,7 +2028,7 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2639
2028
|
}
|
|
2640
2029
|
},
|
|
2641
2030
|
"Loading..."
|
|
2642
|
-
) : /* @__PURE__ */
|
|
2031
|
+
) : /* @__PURE__ */ u.createElement(
|
|
2643
2032
|
"div",
|
|
2644
2033
|
{
|
|
2645
2034
|
style: {
|
|
@@ -2649,8 +2038,8 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2649
2038
|
width: "100%"
|
|
2650
2039
|
}
|
|
2651
2040
|
},
|
|
2652
|
-
/* @__PURE__ */
|
|
2653
|
-
|
|
2041
|
+
/* @__PURE__ */ u.createElement(
|
|
2042
|
+
Se,
|
|
2654
2043
|
{
|
|
2655
2044
|
data: { subject: i.subject, body: i.body },
|
|
2656
2045
|
style: {
|
|
@@ -2662,7 +2051,7 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2662
2051
|
}
|
|
2663
2052
|
}
|
|
2664
2053
|
),
|
|
2665
|
-
/* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ u.createElement(
|
|
2666
2055
|
"button",
|
|
2667
2056
|
{
|
|
2668
2057
|
type: "button",
|
|
@@ -2680,28 +2069,28 @@ const bt = ({ data: t, style: e }) => /* @__PURE__ */ b.createElement(
|
|
|
2680
2069
|
borderRadius: 4
|
|
2681
2070
|
}
|
|
2682
2071
|
},
|
|
2683
|
-
/* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ u.createElement(F, { size: 16, color: "#666" })
|
|
2684
2073
|
)
|
|
2685
2074
|
)
|
|
2686
2075
|
)
|
|
2687
2076
|
))
|
|
2688
2077
|
);
|
|
2689
2078
|
};
|
|
2690
|
-
class
|
|
2079
|
+
class Ut extends u.Component {
|
|
2691
2080
|
constructor(n) {
|
|
2692
2081
|
super(n);
|
|
2693
|
-
|
|
2694
|
-
|
|
2082
|
+
g(this, "containerRef");
|
|
2083
|
+
g(this, "handleClickOutside", (n) => {
|
|
2695
2084
|
this.containerRef.current && !this.containerRef.current.contains(n.target) && this.setState({ open: !1 });
|
|
2696
2085
|
});
|
|
2697
|
-
|
|
2086
|
+
g(this, "togglePopper", () => {
|
|
2698
2087
|
this.setState((n) => ({ open: !n.open }));
|
|
2699
2088
|
});
|
|
2700
|
-
|
|
2701
|
-
const r =
|
|
2089
|
+
g(this, "handleLangChange", (n) => {
|
|
2090
|
+
const r = ee.find((i) => i.value === n.target.value);
|
|
2702
2091
|
this.props.setLang(r || null);
|
|
2703
2092
|
});
|
|
2704
|
-
this.state = { open: !1 }, this.containerRef =
|
|
2093
|
+
this.state = { open: !1 }, this.containerRef = u.createRef();
|
|
2705
2094
|
}
|
|
2706
2095
|
componentDidMount() {
|
|
2707
2096
|
document.addEventListener("mousedown", this.handleClickOutside);
|
|
@@ -2710,23 +2099,23 @@ class Wn extends b.Component {
|
|
|
2710
2099
|
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
2711
2100
|
}
|
|
2712
2101
|
render() {
|
|
2713
|
-
const { lang: n, originalEmail: r, setOriginalEmail: i, getEditorContent: s } = this.props, { open:
|
|
2714
|
-
return /* @__PURE__ */
|
|
2102
|
+
const { lang: n, originalEmail: r, setOriginalEmail: i, getEditorContent: s } = this.props, { open: o } = this.state;
|
|
2103
|
+
return /* @__PURE__ */ u.createElement(
|
|
2715
2104
|
"div",
|
|
2716
2105
|
{
|
|
2717
2106
|
ref: this.containerRef,
|
|
2718
2107
|
style: { position: "relative", display: "inline-block" }
|
|
2719
2108
|
},
|
|
2720
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ u.createElement(
|
|
2721
2110
|
"button",
|
|
2722
2111
|
{
|
|
2723
2112
|
type: "button",
|
|
2724
2113
|
onClick: this.togglePopper,
|
|
2725
2114
|
className: "icon-button small"
|
|
2726
2115
|
},
|
|
2727
|
-
/* @__PURE__ */
|
|
2116
|
+
/* @__PURE__ */ u.createElement(le, { size: 16 })
|
|
2728
2117
|
),
|
|
2729
|
-
|
|
2118
|
+
o && /* @__PURE__ */ u.createElement(
|
|
2730
2119
|
"div",
|
|
2731
2120
|
{
|
|
2732
2121
|
style: {
|
|
@@ -2743,7 +2132,7 @@ class Wn extends b.Component {
|
|
|
2743
2132
|
marginBottom: 8
|
|
2744
2133
|
}
|
|
2745
2134
|
},
|
|
2746
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 12 } }, /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, /* @__PURE__ */ u.createElement(
|
|
2747
2136
|
"span",
|
|
2748
2137
|
{
|
|
2749
2138
|
style: {
|
|
@@ -2753,7 +2142,7 @@ class Wn extends b.Component {
|
|
|
2753
2142
|
}
|
|
2754
2143
|
},
|
|
2755
2144
|
"Language"
|
|
2756
|
-
), /* @__PURE__ */
|
|
2145
|
+
), /* @__PURE__ */ u.createElement(
|
|
2757
2146
|
"select",
|
|
2758
2147
|
{
|
|
2759
2148
|
value: n ? n.value : "",
|
|
@@ -2765,9 +2154,9 @@ class Wn extends b.Component {
|
|
|
2765
2154
|
fontSize: 14
|
|
2766
2155
|
}
|
|
2767
2156
|
},
|
|
2768
|
-
/* @__PURE__ */
|
|
2769
|
-
|
|
2770
|
-
)), /* @__PURE__ */
|
|
2157
|
+
/* @__PURE__ */ u.createElement("option", { value: "", disabled: !0 }, "Select Language"),
|
|
2158
|
+
ee.map((a) => /* @__PURE__ */ u.createElement("option", { key: a.value, value: a.value }, a.label))
|
|
2159
|
+
)), /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, /* @__PURE__ */ u.createElement(
|
|
2771
2160
|
"div",
|
|
2772
2161
|
{
|
|
2773
2162
|
style: {
|
|
@@ -2776,7 +2165,7 @@ class Wn extends b.Component {
|
|
|
2776
2165
|
justifyContent: "space-between"
|
|
2777
2166
|
}
|
|
2778
2167
|
},
|
|
2779
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ u.createElement(
|
|
2780
2169
|
"span",
|
|
2781
2170
|
{
|
|
2782
2171
|
style: {
|
|
@@ -2787,24 +2176,24 @@ class Wn extends b.Component {
|
|
|
2787
2176
|
},
|
|
2788
2177
|
"AI Context"
|
|
2789
2178
|
),
|
|
2790
|
-
s && /* @__PURE__ */
|
|
2179
|
+
s && /* @__PURE__ */ u.createElement(
|
|
2791
2180
|
"button",
|
|
2792
2181
|
{
|
|
2793
2182
|
type: "button",
|
|
2794
2183
|
title: "Copy from origin email",
|
|
2795
2184
|
onClick: () => {
|
|
2796
|
-
const
|
|
2797
|
-
i(
|
|
2185
|
+
const a = s();
|
|
2186
|
+
i(a);
|
|
2798
2187
|
},
|
|
2799
2188
|
className: "icon-button"
|
|
2800
2189
|
},
|
|
2801
|
-
/* @__PURE__ */
|
|
2190
|
+
/* @__PURE__ */ u.createElement(F, null)
|
|
2802
2191
|
)
|
|
2803
|
-
), /* @__PURE__ */
|
|
2192
|
+
), /* @__PURE__ */ u.createElement(
|
|
2804
2193
|
"textarea",
|
|
2805
2194
|
{
|
|
2806
2195
|
value: r,
|
|
2807
|
-
onChange: (
|
|
2196
|
+
onChange: (a) => i(a.target.value),
|
|
2808
2197
|
style: {
|
|
2809
2198
|
width: "100%",
|
|
2810
2199
|
height: 120,
|
|
@@ -2822,85 +2211,85 @@ class Wn extends b.Component {
|
|
|
2822
2211
|
);
|
|
2823
2212
|
}
|
|
2824
2213
|
}
|
|
2825
|
-
class
|
|
2214
|
+
class Qt extends u.Component {
|
|
2826
2215
|
constructor(n) {
|
|
2827
2216
|
super(n);
|
|
2828
2217
|
// Equivalent to useImperativeHandle
|
|
2829
|
-
|
|
2218
|
+
g(this, "setAiContext", (n) => {
|
|
2830
2219
|
this.setState({ originalEmail: n });
|
|
2831
2220
|
});
|
|
2832
|
-
|
|
2221
|
+
g(this, "handleMessageChange", (n) => {
|
|
2833
2222
|
this.setState({ message: n.target.value });
|
|
2834
2223
|
});
|
|
2835
|
-
|
|
2836
|
-
const { message: n, messages: r, lang: i, originalEmail: s, conversationId:
|
|
2224
|
+
g(this, "handleSubmit", async () => {
|
|
2225
|
+
const { message: n, messages: r, lang: i, originalEmail: s, conversationId: o } = this.state, { signer: a, baseUrl: p = "" } = this.props;
|
|
2837
2226
|
if (!n.trim()) return;
|
|
2838
|
-
const
|
|
2839
|
-
let
|
|
2840
|
-
id:
|
|
2227
|
+
const l = Ge();
|
|
2228
|
+
let c = {
|
|
2229
|
+
id: l,
|
|
2841
2230
|
question: n,
|
|
2842
2231
|
subject: "",
|
|
2843
2232
|
body: "",
|
|
2844
2233
|
created_at: (/* @__PURE__ */ new Date()).getTime(),
|
|
2845
2234
|
isLoading: !0
|
|
2846
2235
|
};
|
|
2847
|
-
const
|
|
2236
|
+
const d = [...r, c];
|
|
2848
2237
|
this.setState({
|
|
2849
|
-
messages:
|
|
2238
|
+
messages: d,
|
|
2850
2239
|
message: "",
|
|
2851
2240
|
isSending: !0
|
|
2852
2241
|
});
|
|
2853
|
-
const
|
|
2242
|
+
const h = {
|
|
2854
2243
|
query: n,
|
|
2855
2244
|
default_language: i ? i.value : "KR",
|
|
2856
2245
|
original_email: s,
|
|
2857
2246
|
debug_grpc: !0
|
|
2858
2247
|
};
|
|
2859
|
-
|
|
2860
|
-
setContent: (
|
|
2861
|
-
this.setState((
|
|
2862
|
-
(
|
|
2863
|
-
...
|
|
2248
|
+
o && (h.conversation_id = o), await at(h, {
|
|
2249
|
+
setContent: (v) => {
|
|
2250
|
+
this.setState((T) => ({ messages: T.messages.map(
|
|
2251
|
+
(S) => S.id === l ? {
|
|
2252
|
+
...S,
|
|
2864
2253
|
subject: "Some thing not used",
|
|
2865
|
-
body:
|
|
2254
|
+
body: v,
|
|
2866
2255
|
isLoading: !1,
|
|
2867
2256
|
created_at: (/* @__PURE__ */ new Date()).getTime()
|
|
2868
|
-
} :
|
|
2257
|
+
} : S
|
|
2869
2258
|
) }));
|
|
2870
2259
|
},
|
|
2871
|
-
setIsLoading: (
|
|
2872
|
-
this.setState((
|
|
2873
|
-
(
|
|
2260
|
+
setIsLoading: (v) => {
|
|
2261
|
+
this.setState((T) => ({ messages: T.messages.map(
|
|
2262
|
+
(S) => S.id === l ? { ...S, isLoading: v } : S
|
|
2874
2263
|
) }));
|
|
2875
2264
|
},
|
|
2876
|
-
setConversationId: (
|
|
2877
|
-
this.setState({ conversationId:
|
|
2265
|
+
setConversationId: (v) => {
|
|
2266
|
+
this.setState({ conversationId: v });
|
|
2878
2267
|
},
|
|
2879
|
-
signer:
|
|
2880
|
-
baseUrl:
|
|
2268
|
+
signer: a,
|
|
2269
|
+
baseUrl: p
|
|
2881
2270
|
}), this.setState({ isSending: !1 });
|
|
2882
2271
|
});
|
|
2883
|
-
|
|
2272
|
+
g(this, "handleKeyDown", (n) => {
|
|
2884
2273
|
!n.shiftKey && n.key === "Enter" && !this.state.isSending && (n.preventDefault(), this.handleSubmit());
|
|
2885
2274
|
});
|
|
2886
|
-
|
|
2275
|
+
g(this, "setLang", (n) => {
|
|
2887
2276
|
this.setState({ lang: n });
|
|
2888
2277
|
});
|
|
2889
|
-
|
|
2278
|
+
g(this, "setOriginalEmail", (n) => {
|
|
2890
2279
|
this.setState({ originalEmail: n });
|
|
2891
2280
|
});
|
|
2892
2281
|
this.state = {
|
|
2893
2282
|
message: "",
|
|
2894
2283
|
messages: [],
|
|
2895
2284
|
isSending: !1,
|
|
2896
|
-
lang:
|
|
2285
|
+
lang: ee[0],
|
|
2897
2286
|
conversationId: "",
|
|
2898
2287
|
originalEmail: ""
|
|
2899
2288
|
};
|
|
2900
2289
|
}
|
|
2901
2290
|
render() {
|
|
2902
|
-
const { onApply: n, getEditorContent: r } = this.props, { message: i, messages: s, isSending:
|
|
2903
|
-
return /* @__PURE__ */
|
|
2291
|
+
const { onApply: n, getEditorContent: r } = this.props, { message: i, messages: s, isSending: o, lang: a, originalEmail: p } = this.state;
|
|
2292
|
+
return /* @__PURE__ */ u.createElement(
|
|
2904
2293
|
"div",
|
|
2905
2294
|
{
|
|
2906
2295
|
style: {
|
|
@@ -2913,14 +2302,14 @@ class Zn extends b.Component {
|
|
|
2913
2302
|
boxSizing: "border-box"
|
|
2914
2303
|
}
|
|
2915
2304
|
},
|
|
2916
|
-
s.length > 0 ? /* @__PURE__ */
|
|
2917
|
-
|
|
2305
|
+
s.length > 0 ? /* @__PURE__ */ u.createElement(
|
|
2306
|
+
Wt,
|
|
2918
2307
|
{
|
|
2919
2308
|
items: s,
|
|
2920
2309
|
onApply: n,
|
|
2921
2310
|
getEditorContent: r
|
|
2922
2311
|
}
|
|
2923
|
-
) : /* @__PURE__ */
|
|
2312
|
+
) : /* @__PURE__ */ u.createElement(
|
|
2924
2313
|
"div",
|
|
2925
2314
|
{
|
|
2926
2315
|
style: {
|
|
@@ -2933,8 +2322,8 @@ class Zn extends b.Component {
|
|
|
2933
2322
|
color: "var(--grey-light)"
|
|
2934
2323
|
}
|
|
2935
2324
|
},
|
|
2936
|
-
/* @__PURE__ */
|
|
2937
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ u.createElement(st, { size: 46 }),
|
|
2326
|
+
/* @__PURE__ */ u.createElement(
|
|
2938
2327
|
"h2",
|
|
2939
2328
|
{
|
|
2940
2329
|
style: {
|
|
@@ -2947,7 +2336,7 @@ class Zn extends b.Component {
|
|
|
2947
2336
|
"Build with Agent"
|
|
2948
2337
|
)
|
|
2949
2338
|
),
|
|
2950
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ u.createElement(
|
|
2951
2340
|
"div",
|
|
2952
2341
|
{
|
|
2953
2342
|
style: {
|
|
@@ -2955,12 +2344,12 @@ class Zn extends b.Component {
|
|
|
2955
2344
|
border: "1px solid #ddd",
|
|
2956
2345
|
borderRadius: 4,
|
|
2957
2346
|
// overflow: "hidden",
|
|
2958
|
-
background:
|
|
2347
|
+
background: o ? "var(--background-lightGrey)" : "#fff",
|
|
2959
2348
|
display: "flex",
|
|
2960
2349
|
flexDirection: "column"
|
|
2961
2350
|
}
|
|
2962
2351
|
},
|
|
2963
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ u.createElement(
|
|
2964
2353
|
"textarea",
|
|
2965
2354
|
{
|
|
2966
2355
|
value: i,
|
|
@@ -2968,7 +2357,7 @@ class Zn extends b.Component {
|
|
|
2968
2357
|
placeholder: "Describe your email",
|
|
2969
2358
|
name: "ai-content",
|
|
2970
2359
|
onKeyDown: this.handleKeyDown,
|
|
2971
|
-
disabled:
|
|
2360
|
+
disabled: o,
|
|
2972
2361
|
style: {
|
|
2973
2362
|
flex: 1,
|
|
2974
2363
|
minWidth: 0,
|
|
@@ -2983,7 +2372,7 @@ class Zn extends b.Component {
|
|
|
2983
2372
|
}
|
|
2984
2373
|
}
|
|
2985
2374
|
),
|
|
2986
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ u.createElement(
|
|
2987
2376
|
"div",
|
|
2988
2377
|
{
|
|
2989
2378
|
style: {
|
|
@@ -2996,54 +2385,54 @@ class Zn extends b.Component {
|
|
|
2996
2385
|
boxSizing: "border-box"
|
|
2997
2386
|
}
|
|
2998
2387
|
},
|
|
2999
|
-
/* @__PURE__ */
|
|
3000
|
-
|
|
2388
|
+
/* @__PURE__ */ u.createElement(
|
|
2389
|
+
Ut,
|
|
3001
2390
|
{
|
|
3002
|
-
lang:
|
|
2391
|
+
lang: a,
|
|
3003
2392
|
setLang: this.setLang,
|
|
3004
|
-
originalEmail:
|
|
2393
|
+
originalEmail: p,
|
|
3005
2394
|
setOriginalEmail: this.setOriginalEmail,
|
|
3006
2395
|
getEditorContent: r
|
|
3007
2396
|
}
|
|
3008
2397
|
),
|
|
3009
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ u.createElement(
|
|
3010
2399
|
"button",
|
|
3011
2400
|
{
|
|
3012
|
-
disabled: !i.trim() ||
|
|
2401
|
+
disabled: !i.trim() || o,
|
|
3013
2402
|
onClick: this.handleSubmit,
|
|
3014
2403
|
className: "icon-button",
|
|
3015
2404
|
color: "primary"
|
|
3016
2405
|
},
|
|
3017
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ u.createElement(ae, null)
|
|
3018
2407
|
)
|
|
3019
2408
|
)
|
|
3020
2409
|
)
|
|
3021
2410
|
);
|
|
3022
2411
|
}
|
|
3023
2412
|
}
|
|
3024
|
-
const
|
|
2413
|
+
const ie = {
|
|
3025
2414
|
baseUrl: "V3",
|
|
3026
2415
|
signer: null
|
|
3027
|
-
},
|
|
3028
|
-
|
|
3029
|
-
},
|
|
2416
|
+
}, Kt = ({ baseUrl: t, signer: e }) => {
|
|
2417
|
+
ie.baseUrl = t, ie.signer = e;
|
|
2418
|
+
}, Zt = () => {
|
|
3030
2419
|
const t = window.location, { hostname: e } = t;
|
|
3031
2420
|
return e === "localhost" || e === "127.0.0.1";
|
|
3032
|
-
},
|
|
2421
|
+
}, Be = Zt(), Gt = () => {
|
|
3033
2422
|
var n;
|
|
3034
2423
|
let t = window.location;
|
|
3035
2424
|
const { host: e } = t;
|
|
3036
|
-
if (
|
|
3037
|
-
const r = (n =
|
|
2425
|
+
if (Be) {
|
|
2426
|
+
const r = (n = ie.baseUrl) == null ? void 0 : n.split("/");
|
|
3038
2427
|
return r ? "https://" + (r == null ? void 0 : r[2]) : "https://vndev.hanbiro.com";
|
|
3039
2428
|
} else {
|
|
3040
2429
|
const r = localStorage.getItem("host") || e, i = r == null ? void 0 : r.split("/");
|
|
3041
2430
|
return "https://" + (i == null ? void 0 : i[0]);
|
|
3042
2431
|
}
|
|
3043
|
-
},
|
|
2432
|
+
}, Jt = () => {
|
|
3044
2433
|
let t = window.location;
|
|
3045
|
-
if (
|
|
3046
|
-
return
|
|
2434
|
+
if (Be)
|
|
2435
|
+
return Gt() || "https://vndev.hanbiro.com/ngw";
|
|
3047
2436
|
{
|
|
3048
2437
|
window.location !== window.parent.location && (t = window.parent.location);
|
|
3049
2438
|
const { hostname: e, protocol: n } = t;
|
|
@@ -3051,10 +2440,10 @@ const We = {
|
|
|
3051
2440
|
}
|
|
3052
2441
|
};
|
|
3053
2442
|
export {
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
2443
|
+
Qt as ChatAIDraft,
|
|
2444
|
+
ie as SDKConfig,
|
|
2445
|
+
Gt as getBaseUrl,
|
|
2446
|
+
Jt as getGroupwareUrl,
|
|
2447
|
+
Kt as initHanbiroReactSDK,
|
|
2448
|
+
Be as isDevelopment
|
|
3060
2449
|
};
|