@linto-ai/transcript-ui-webcomponent 0.9.18 → 0.9.22-unstable.202609181254
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/{highlight-CJMoAPSe.js → highlight-D3MWj8e2.js} +2 -2
- package/dist/{highlight-CJMoAPSe.js.map → highlight-D3MWj8e2.js.map} +1 -1
- package/dist/{index-CB7gHC-N.js → index-CR1TdCV6.js} +638 -577
- package/dist/index-CR1TdCV6.js.map +1 -0
- package/dist/linto-editor.iife.js +594 -533
- package/dist/linto-editor.iife.js.map +1 -1
- package/dist/linto-editor.js +1 -1
- package/package.json +10 -10
- package/dist/index-CB7gHC-N.js.map +0 -1
|
@@ -116,10 +116,10 @@ var LintoEditor = (function(exports) {
|
|
|
116
116
|
}
|
|
117
117
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
118
118
|
const propertyDelimiterRE = /:([^]+)/;
|
|
119
|
-
const styleCommentRE =
|
|
119
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
120
120
|
function parseStringStyle(cssText) {
|
|
121
121
|
const ret = {};
|
|
122
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
122
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
123
123
|
if (item) {
|
|
124
124
|
const tmp = item.split(propertyDelimiterRE);
|
|
125
125
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -163,22 +163,22 @@ var LintoEditor = (function(exports) {
|
|
|
163
163
|
function includeBooleanAttr(value) {
|
|
164
164
|
return !!value || value === "";
|
|
165
165
|
}
|
|
166
|
-
function looseCompareArrays(a2, b2) {
|
|
166
|
+
function looseCompareArrays(a2, b2, seen) {
|
|
167
167
|
if (a2.length !== b2.length) return false;
|
|
168
168
|
let equal = true;
|
|
169
169
|
for (let i2 = 0; equal && i2 < a2.length; i2++) {
|
|
170
|
-
equal = looseEqual(a2[i2], b2[i2]);
|
|
170
|
+
equal = looseEqual(a2[i2], b2[i2], seen);
|
|
171
171
|
}
|
|
172
172
|
return equal;
|
|
173
173
|
}
|
|
174
|
-
function looseCompareCollections(a2, b2) {
|
|
174
|
+
function looseCompareCollections(a2, b2, seen) {
|
|
175
175
|
if (a2.size !== b2.size) return false;
|
|
176
176
|
const candidates = Array.from(b2);
|
|
177
177
|
const matched = new Uint8Array(candidates.length);
|
|
178
178
|
for (const item of a2) {
|
|
179
179
|
let index = -1;
|
|
180
180
|
for (let i2 = 0; i2 < candidates.length; i2++) {
|
|
181
|
-
if (!matched[i2] && looseEqual(item, candidates[i2])) {
|
|
181
|
+
if (!matched[i2] && looseEqual(item, candidates[i2], seen)) {
|
|
182
182
|
index = i2;
|
|
183
183
|
break;
|
|
184
184
|
}
|
|
@@ -188,7 +188,47 @@ var LintoEditor = (function(exports) {
|
|
|
188
188
|
}
|
|
189
189
|
return true;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function looseCompareObjects(a2, b2, seen) {
|
|
192
|
+
let aValidType = isMap(a2);
|
|
193
|
+
let bValidType = isMap(b2);
|
|
194
|
+
if (aValidType || bValidType) {
|
|
195
|
+
return aValidType && bValidType ? looseCompareCollections(a2, b2, seen) : false;
|
|
196
|
+
}
|
|
197
|
+
aValidType = isSet(a2);
|
|
198
|
+
bValidType = isSet(b2);
|
|
199
|
+
if (aValidType || bValidType) {
|
|
200
|
+
return aValidType && bValidType ? looseCompareCollections(a2, b2, seen) : false;
|
|
201
|
+
}
|
|
202
|
+
const aKeysCount = Object.keys(a2).length;
|
|
203
|
+
const bKeysCount = Object.keys(b2).length;
|
|
204
|
+
if (aKeysCount !== bKeysCount) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
for (const key in a2) {
|
|
208
|
+
const aHasKey = a2.hasOwnProperty(key);
|
|
209
|
+
const bHasKey = b2.hasOwnProperty(key);
|
|
210
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key], seen)) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return String(a2) === String(b2);
|
|
215
|
+
}
|
|
216
|
+
function looseCompareNested(a2, b2, seen, compare) {
|
|
217
|
+
if (!seen) {
|
|
218
|
+
seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
219
|
+
}
|
|
220
|
+
const [seenA, seenB] = seen;
|
|
221
|
+
if (seenA.has(a2) || seenB.has(b2)) {
|
|
222
|
+
return seenA.get(a2) === b2 && seenB.get(b2) === a2;
|
|
223
|
+
}
|
|
224
|
+
seenA.set(a2, b2);
|
|
225
|
+
seenB.set(b2, a2);
|
|
226
|
+
const equal = compare(a2, b2, seen);
|
|
227
|
+
seenA.delete(a2);
|
|
228
|
+
seenB.delete(b2);
|
|
229
|
+
return equal;
|
|
230
|
+
}
|
|
231
|
+
function looseEqual(a2, b2, seen) {
|
|
192
232
|
if (a2 === b2) return true;
|
|
193
233
|
let aValidType = isDate(a2);
|
|
194
234
|
let bValidType = isDate(b2);
|
|
@@ -203,7 +243,7 @@ var LintoEditor = (function(exports) {
|
|
|
203
243
|
aValidType = isArray(a2);
|
|
204
244
|
bValidType = isArray(b2);
|
|
205
245
|
if (aValidType || bValidType) {
|
|
206
|
-
return aValidType && bValidType ?
|
|
246
|
+
return aValidType && bValidType ? looseCompareNested(a2, b2, seen, looseCompareArrays) : false;
|
|
207
247
|
}
|
|
208
248
|
aValidType = isObject$1(a2);
|
|
209
249
|
bValidType = isObject$1(b2);
|
|
@@ -211,28 +251,7 @@ var LintoEditor = (function(exports) {
|
|
|
211
251
|
if (!aValidType || !bValidType) {
|
|
212
252
|
return false;
|
|
213
253
|
}
|
|
214
|
-
|
|
215
|
-
bValidType = isMap(b2);
|
|
216
|
-
if (aValidType || bValidType) {
|
|
217
|
-
return aValidType && bValidType ? looseCompareCollections(a2, b2) : false;
|
|
218
|
-
}
|
|
219
|
-
aValidType = isSet(a2);
|
|
220
|
-
bValidType = isSet(b2);
|
|
221
|
-
if (aValidType || bValidType) {
|
|
222
|
-
return aValidType && bValidType ? looseCompareCollections(a2, b2) : false;
|
|
223
|
-
}
|
|
224
|
-
const aKeysCount = Object.keys(a2).length;
|
|
225
|
-
const bKeysCount = Object.keys(b2).length;
|
|
226
|
-
if (aKeysCount !== bKeysCount) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
for (const key in a2) {
|
|
230
|
-
const aHasKey = a2.hasOwnProperty(key);
|
|
231
|
-
const bHasKey = b2.hasOwnProperty(key);
|
|
232
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) {
|
|
233
|
-
return false;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
254
|
+
return looseCompareNested(a2, b2, seen, looseCompareObjects);
|
|
236
255
|
}
|
|
237
256
|
return String(a2) === String(b2);
|
|
238
257
|
}
|
|
@@ -889,7 +908,9 @@ var LintoEditor = (function(exports) {
|
|
|
889
908
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
890
909
|
if (raw === array) return raw;
|
|
891
910
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
892
|
-
|
|
911
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
912
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
913
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
893
914
|
}
|
|
894
915
|
function shallowReadArray(arr) {
|
|
895
916
|
track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
|
|
@@ -4975,6 +4996,12 @@ var LintoEditor = (function(exports) {
|
|
|
4975
4996
|
optimized = false;
|
|
4976
4997
|
n2.dynamicChildren = null;
|
|
4977
4998
|
}
|
|
4999
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
5000
|
+
if (n2.dynamicChildren === EMPTY_ARR) {
|
|
5001
|
+
n2.dynamicChildren = [];
|
|
5002
|
+
}
|
|
5003
|
+
n2.dynamicChildren.hasOnce = true;
|
|
5004
|
+
}
|
|
4978
5005
|
const { type, ref: ref3, shapeFlag } = n2;
|
|
4979
5006
|
switch (type) {
|
|
4980
5007
|
case Text:
|
|
@@ -5527,6 +5554,7 @@ var LintoEditor = (function(exports) {
|
|
|
5527
5554
|
const instance = n2.component = n1.component;
|
|
5528
5555
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
5529
5556
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
5557
|
+
n2.el = n1.el;
|
|
5530
5558
|
updateComponentPreRender(instance, n2, optimized);
|
|
5531
5559
|
return;
|
|
5532
5560
|
} else {
|
|
@@ -5872,7 +5900,7 @@ var LintoEditor = (function(exports) {
|
|
|
5872
5900
|
keyToNewIndexMap.set(nextChild.key, i2);
|
|
5873
5901
|
}
|
|
5874
5902
|
}
|
|
5875
|
-
let
|
|
5903
|
+
let j;
|
|
5876
5904
|
let patched = 0;
|
|
5877
5905
|
const toBePatched = e2 - s2 + 1;
|
|
5878
5906
|
let moved = false;
|
|
@@ -5889,9 +5917,9 @@ var LintoEditor = (function(exports) {
|
|
|
5889
5917
|
if (prevChild.key != null) {
|
|
5890
5918
|
newIndex = keyToNewIndexMap.get(prevChild.key);
|
|
5891
5919
|
} else {
|
|
5892
|
-
for (
|
|
5893
|
-
if (newIndexToOldIndexMap[
|
|
5894
|
-
newIndex =
|
|
5920
|
+
for (j = s2; j <= e2; j++) {
|
|
5921
|
+
if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
|
|
5922
|
+
newIndex = j;
|
|
5895
5923
|
break;
|
|
5896
5924
|
}
|
|
5897
5925
|
}
|
|
@@ -5920,7 +5948,7 @@ var LintoEditor = (function(exports) {
|
|
|
5920
5948
|
}
|
|
5921
5949
|
}
|
|
5922
5950
|
const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
|
|
5923
|
-
|
|
5951
|
+
j = increasingNewIndexSequence.length - 1;
|
|
5924
5952
|
for (i2 = toBePatched - 1; i2 >= 0; i2--) {
|
|
5925
5953
|
const nextIndex = s2 + i2;
|
|
5926
5954
|
const nextChild = c2[nextIndex];
|
|
@@ -5942,10 +5970,10 @@ var LintoEditor = (function(exports) {
|
|
|
5942
5970
|
optimized
|
|
5943
5971
|
);
|
|
5944
5972
|
} else if (moved) {
|
|
5945
|
-
if (
|
|
5973
|
+
if (j < 0 || i2 !== increasingNewIndexSequence[j]) {
|
|
5946
5974
|
move(nextChild, container, anchor, 2);
|
|
5947
5975
|
} else {
|
|
5948
|
-
|
|
5976
|
+
j--;
|
|
5949
5977
|
}
|
|
5950
5978
|
}
|
|
5951
5979
|
}
|
|
@@ -6036,7 +6064,7 @@ var LintoEditor = (function(exports) {
|
|
|
6036
6064
|
cacheIndex,
|
|
6037
6065
|
memo
|
|
6038
6066
|
} = vnode;
|
|
6039
|
-
if (patchFlag === -2) {
|
|
6067
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) {
|
|
6040
6068
|
optimized = false;
|
|
6041
6069
|
}
|
|
6042
6070
|
if (ref3 != null) {
|
|
@@ -6044,7 +6072,7 @@ var LintoEditor = (function(exports) {
|
|
|
6044
6072
|
setRef(ref3, null, parentSuspense, vnode, true);
|
|
6045
6073
|
resetTracking();
|
|
6046
6074
|
}
|
|
6047
|
-
if (cacheIndex != null) {
|
|
6075
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
6048
6076
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
6049
6077
|
}
|
|
6050
6078
|
if (shapeFlag & 256) {
|
|
@@ -6117,6 +6145,9 @@ var LintoEditor = (function(exports) {
|
|
|
6117
6145
|
}
|
|
6118
6146
|
if (type === Static) {
|
|
6119
6147
|
removeStaticNode(vnode);
|
|
6148
|
+
if (transition && !transition.persisted && transition.afterLeave) {
|
|
6149
|
+
transition.afterLeave();
|
|
6150
|
+
}
|
|
6120
6151
|
return;
|
|
6121
6152
|
}
|
|
6122
6153
|
const performRemove = () => {
|
|
@@ -6157,6 +6188,9 @@ var LintoEditor = (function(exports) {
|
|
|
6157
6188
|
if (job) {
|
|
6158
6189
|
job.flags |= 8;
|
|
6159
6190
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6191
|
+
} else if (instance.vnode.el && subTree) {
|
|
6192
|
+
subTree.transition = instance.vnode.transition;
|
|
6193
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6160
6194
|
}
|
|
6161
6195
|
if (um) {
|
|
6162
6196
|
queuePostRenderEffect(um, parentSuspense);
|
|
@@ -6272,14 +6306,14 @@ var LintoEditor = (function(exports) {
|
|
|
6272
6306
|
function getSequence(arr) {
|
|
6273
6307
|
const p2 = arr.slice();
|
|
6274
6308
|
const result = [0];
|
|
6275
|
-
let i2,
|
|
6309
|
+
let i2, j, u2, v2, c2;
|
|
6276
6310
|
const len = arr.length;
|
|
6277
6311
|
for (i2 = 0; i2 < len; i2++) {
|
|
6278
6312
|
const arrI = arr[i2];
|
|
6279
6313
|
if (arrI !== 0) {
|
|
6280
|
-
|
|
6281
|
-
if (arr[
|
|
6282
|
-
p2[i2] =
|
|
6314
|
+
j = result[result.length - 1];
|
|
6315
|
+
if (arr[j] < arrI) {
|
|
6316
|
+
p2[i2] = j;
|
|
6283
6317
|
result.push(i2);
|
|
6284
6318
|
continue;
|
|
6285
6319
|
}
|
|
@@ -6570,7 +6604,8 @@ var LintoEditor = (function(exports) {
|
|
|
6570
6604
|
el: vnode.el,
|
|
6571
6605
|
anchor: vnode.anchor,
|
|
6572
6606
|
ctx: vnode.ctx,
|
|
6573
|
-
ce: vnode.ce
|
|
6607
|
+
ce: vnode.ce,
|
|
6608
|
+
cacheIndex: vnode.cacheIndex
|
|
6574
6609
|
};
|
|
6575
6610
|
if (transition && cloneTransition) {
|
|
6576
6611
|
setTransitionHooks(
|
|
@@ -7031,7 +7066,7 @@ var LintoEditor = (function(exports) {
|
|
|
7031
7066
|
}
|
|
7032
7067
|
return true;
|
|
7033
7068
|
}
|
|
7034
|
-
const version = "3.5.
|
|
7069
|
+
const version = "3.5.43";
|
|
7035
7070
|
let policy = void 0;
|
|
7036
7071
|
const tt$1 = typeof window !== "undefined" && window.trustedTypes;
|
|
7037
7072
|
if (tt$1) {
|
|
@@ -8529,7 +8564,7 @@ var LintoEditor = (function(exports) {
|
|
|
8529
8564
|
}
|
|
8530
8565
|
const eventKey = hyphenate(event.key);
|
|
8531
8566
|
if (modifiers.some(
|
|
8532
|
-
(
|
|
8567
|
+
(k) => k === eventKey || keyNames[k] === eventKey
|
|
8533
8568
|
)) {
|
|
8534
8569
|
return fn(event);
|
|
8535
8570
|
}
|
|
@@ -9179,7 +9214,7 @@ var LintoEditor = (function(exports) {
|
|
|
9179
9214
|
const start = Math.floor(i2 * scale);
|
|
9180
9215
|
const end = Math.max(start + 1, Math.floor((i2 + step * 2) * scale));
|
|
9181
9216
|
let sum = 0;
|
|
9182
|
-
for (let
|
|
9217
|
+
for (let j = start; j < end; j++) sum += Math.abs(channel[j] ?? 0);
|
|
9183
9218
|
const value = sum / (end - start);
|
|
9184
9219
|
let x2 = i2;
|
|
9185
9220
|
let y2 = value * (height / 2);
|
|
@@ -10684,7 +10719,7 @@ pre[class*="language-"] {
|
|
|
10684
10719
|
};
|
|
10685
10720
|
const _hoisted_4$c = { class: "form-field__input-wrapper" };
|
|
10686
10721
|
const _hoisted_5$b = ["id", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"];
|
|
10687
|
-
const _hoisted_6$
|
|
10722
|
+
const _hoisted_6$a = ["value"];
|
|
10688
10723
|
const _hoisted_7$5 = ["type", "id", "disabled", "readonly", "placeholder", "autocomplete", "required", "aria-required", "aria-invalid", "aria-describedby"];
|
|
10689
10724
|
const _hoisted_8$3 = {
|
|
10690
10725
|
key: 3,
|
|
@@ -10843,7 +10878,7 @@ pre[class*="language-"] {
|
|
|
10843
10878
|
return openBlock(), createElementBlock("option", {
|
|
10844
10879
|
key: opt.value,
|
|
10845
10880
|
value: opt.value
|
|
10846
|
-
}, toDisplayString(opt.label), 9, _hoisted_6$
|
|
10881
|
+
}, toDisplayString(opt.label), 9, _hoisted_6$a);
|
|
10847
10882
|
}), 128))
|
|
10848
10883
|
], 16, _hoisted_5$b)), [
|
|
10849
10884
|
[vModelSelect, draft.value]
|
|
@@ -12710,11 +12745,11 @@ pre[class*="language-"] {
|
|
|
12710
12745
|
function isPointInPolygon(point, polygon) {
|
|
12711
12746
|
const { x: x2, y: y2 } = point;
|
|
12712
12747
|
let inside = false;
|
|
12713
|
-
for (let i2 = 0,
|
|
12748
|
+
for (let i2 = 0, j = polygon.length - 1; i2 < polygon.length; j = i2++) {
|
|
12714
12749
|
const xi = polygon[i2].x;
|
|
12715
12750
|
const yi = polygon[i2].y;
|
|
12716
|
-
const xj = polygon[
|
|
12717
|
-
const yj = polygon[
|
|
12751
|
+
const xj = polygon[j].x;
|
|
12752
|
+
const yj = polygon[j].y;
|
|
12718
12753
|
const intersect = yi > y2 !== yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
|
|
12719
12754
|
if (intersect) inside = !inside;
|
|
12720
12755
|
}
|
|
@@ -18316,41 +18351,41 @@ pre[class*="language-"] {
|
|
|
18316
18351
|
function A() {
|
|
18317
18352
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
18318
18353
|
}
|
|
18319
|
-
var
|
|
18320
|
-
function
|
|
18321
|
-
|
|
18354
|
+
var T = A();
|
|
18355
|
+
function U(l2) {
|
|
18356
|
+
T = l2;
|
|
18322
18357
|
}
|
|
18323
|
-
var
|
|
18358
|
+
var E$1 = { exec: () => null };
|
|
18324
18359
|
function I(l2) {
|
|
18325
18360
|
let e2 = [];
|
|
18326
18361
|
return (t2) => {
|
|
18327
|
-
let n2 = Math.max(0, Math.min(3, t2 - 1)),
|
|
18328
|
-
return
|
|
18362
|
+
let n2 = Math.max(0, Math.min(3, t2 - 1)), i2 = e2[n2];
|
|
18363
|
+
return i2 || (i2 = l2(n2), e2[n2] = i2), i2;
|
|
18329
18364
|
};
|
|
18330
18365
|
}
|
|
18331
|
-
function
|
|
18332
|
-
let t2 = typeof l2 == "string" ? l2 : l2.source, n2 = { replace: (
|
|
18333
|
-
let
|
|
18334
|
-
return
|
|
18366
|
+
function d$2(l2, e2 = "") {
|
|
18367
|
+
let t2 = typeof l2 == "string" ? l2 : l2.source, n2 = { replace: (i2, r2) => {
|
|
18368
|
+
let o2 = typeof r2 == "string" ? r2 : r2.source;
|
|
18369
|
+
return o2 = o2.replace(m$1.caret, "$1"), t2 = t2.replace(i2, o2), n2;
|
|
18335
18370
|
}, getRegex: () => new RegExp(t2, e2) };
|
|
18336
18371
|
return n2;
|
|
18337
18372
|
}
|
|
18338
|
-
var
|
|
18373
|
+
var we = ((l2 = "") => {
|
|
18339
18374
|
try {
|
|
18340
18375
|
return !!new RegExp("(?<=1)(?<!1)" + l2);
|
|
18341
18376
|
} catch {
|
|
18342
18377
|
return false;
|
|
18343
18378
|
}
|
|
18344
|
-
})(), m$1 = { codeRemoveIndent: /^(?: {
|
|
18345
|
-
]`).replace("lheading",
|
|
18346
|
-
var
|
|
18347
|
-
function
|
|
18379
|
+
})(), m$1 = { codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, endingSpaceTabChar: /[ \t]$/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l2) => new RegExp(`^( {0,3}${l2})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: I((l2) => new RegExp(`^ {0,${l2}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: I((l2) => new RegExp(`^ {0,${l2}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)), fencesBeginRegex: I((l2) => new RegExp(`^ {0,${l2}}(?:\`\`\`|~~~)`)), headingBeginRegex: I((l2) => new RegExp(`^ {0,${l2}}#`)), htmlBeginRegex: I((l2) => new RegExp(`^ {0,${l2}}(?:</?(?:${H})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")), blockquoteBeginRegex: I((l2) => new RegExp(`^ {0,${l2}}>`)) }, ye = /^(?:[ \t]*(?:\n|$))+/, Pe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Se = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, v$1 = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, K = / {0,3}(?:[*+-]|\d{1,9}[.)])/, le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ue = d$2(le).replace(/bull/g, K).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), $e = d$2(le).replace(/bull/g, K).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Le = /^[^\n]+/, X = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ze = d$2(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", X).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ee = d$2(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, K).getRegex(), H = "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", J = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Me = d$2("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", J).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), pe = (l2) => d$2(W).replace("hr", v$1).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l2).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Ae = pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Ie = pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Ce = d$2(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ie).getRegex(), V = { blockquote: Ce, code: Pe, def: ze, fences: Se, heading: _e, hr: v$1, html: Me, lheading: ue, list: Ee, newline: ye, paragraph: Ae, table: E$1, text: Le }, ie = d$2("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v$1).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Be = { ...V, lheading: $e, table: ie, paragraph: d$2(W).replace("hr", v$1).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ie).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex() }, De = { ...V, html: d$2(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", J).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(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: E$1, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d$2(W).replace("hr", v$1).replace("heading", ` *#{1,6} *[^
|
|
18380
|
+
]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ve = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ce = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, He = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _ = /[\p{P}\p{S}]/u, C$1 = /[\s\p{P}\p{S}]/u, Z = /[^\s\p{P}\p{S}]/u, Ze = d$2(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C$1).getRegex(), Ge = /[\p{Pi}\p{Ps}"']/u, he = /(?!~)[\p{P}\p{S}]/u, Qe = /(?!~)[\s\p{P}\p{S}]/u, Ne = /(?:[^\s\p{P}\p{S}]|~)/u, je = d$2(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", we ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), de = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ue = d$2(de, "u").replace(/punct/g, _).getRegex(), Fe = d$2(de, "u").replace(/punct/g, he).getRegex(), Ke = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, We = d$2(Ke, "u").replace(/openQuote/g, Ge).replace(/punct/g, _).getRegex(), ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Xe = d$2(ke, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), Je = d$2(ke, "gu").replace(/notPunctSpace/g, Ne).replace(/punctSpace/g, Qe).replace(/punct/g, he).getRegex(), Ve = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", Ye = d$2(Ve, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), et = d$2("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), tt = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", nt = d$2(tt, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), rt = d$2(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex(), st = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", it = d$2(st, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), ot = d$2(/\\(punct)/, "gu").replace(/punct/g, _).getRegex(), at = d$2(/^<(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(), lt = d$2(J).replace("(?:-->|$)", "-->").getRegex(), ut = d$2("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", lt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), ge = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, N = d$2(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", ge).getRegex(), pt = d$2(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", N).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ct = d$2(/^!?\[(label)\]\[(ref)\]/).replace("label", N).replace("ref", X).getRegex(), ht = d$2(/^!?\[(ref)\](?:\[\])?/).replace("ref", X).getRegex(), oe = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, dt = d$2(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", ge).getRegex(), kt = d$2("reflink|nolink(?!\\()", "g").replace("reflink", d$2(/^!?\[(label)\]\[(ref)\]/).replace("label", dt).replace("ref", oe).getRegex()).replace("nolink", d$2(/^!?\[(ref)\](?:\[\])?/).replace("ref", oe).getRegex()).getRegex(), ae = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Y = { _backpedal: E$1, anyPunctuation: ot, autolink: at, blockSkip: je, br: ce, code: ve, del: E$1, delLDelim: E$1, delRDelim: E$1, emStrongLDelim: Ue, emStrongRDelimAst: Xe, emStrongRDelimUnd: et, escape: qe, link: pt, nolink: ht, punctuation: Ze, reflink: ct, reflinkSearch: kt, tag: ut, text: He, url: E$1 }, gt = { ...Y, emStrongLDelim: We, emStrongRDelimAst: Ye, emStrongRDelimUnd: nt, link: d$2(/^!?\[(label)\]\((.*?)\)/).replace("label", N).getRegex(), reflink: d$2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", N).getRegex() }, F = { ...Y, emStrongRDelimAst: Je, emStrongLDelim: Fe, delLDelim: rt, delRDelim: it, url: d$2(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ae).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d$2(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ae).getRegex() }, ft = { ...F, br: d$2(ce).replace("{2,}", "*").getRegex(), text: d$2(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, G = { normal: V, gfm: Be, pedantic: De }, B = { normal: Y, gfm: F, breaks: ft, pedantic: gt };
|
|
18381
|
+
var mt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, fe = (l2) => mt[l2];
|
|
18382
|
+
function R(l2, e2) {
|
|
18348
18383
|
if (e2) {
|
|
18349
|
-
if (m$1.escapeTest.test(l2)) return l2.replace(m$1.escapeReplace,
|
|
18350
|
-
} else if (m$1.escapeTestNoEncode.test(l2)) return l2.replace(m$1.escapeReplaceNoEncode,
|
|
18384
|
+
if (m$1.escapeTest.test(l2)) return l2.replace(m$1.escapeReplace, fe);
|
|
18385
|
+
} else if (m$1.escapeTestNoEncode.test(l2)) return l2.replace(m$1.escapeReplaceNoEncode, fe);
|
|
18351
18386
|
return l2;
|
|
18352
18387
|
}
|
|
18353
|
-
function
|
|
18388
|
+
function ee(l2) {
|
|
18354
18389
|
try {
|
|
18355
18390
|
l2 = encodeURI(l2).replace(m$1.percentDecode, "%");
|
|
18356
18391
|
} catch {
|
|
@@ -18358,36 +18393,39 @@ pre[class*="language-"] {
|
|
|
18358
18393
|
}
|
|
18359
18394
|
return l2;
|
|
18360
18395
|
}
|
|
18361
|
-
function
|
|
18362
|
-
let t2 = l2.replace(m$1.findPipe, (r2,
|
|
18363
|
-
let u2 = false, a2 =
|
|
18364
|
-
for (; --a2 >= 0 &&
|
|
18396
|
+
function te(l2, e2) {
|
|
18397
|
+
let t2 = l2.replace(m$1.findPipe, (r2, o2, s2) => {
|
|
18398
|
+
let u2 = false, a2 = o2;
|
|
18399
|
+
for (; --a2 >= 0 && s2[a2] === "\\"; ) u2 = !u2;
|
|
18365
18400
|
return u2 ? "|" : " |";
|
|
18366
|
-
}), n2 = t2.split(m$1.splitPipe),
|
|
18401
|
+
}), n2 = t2.split(m$1.splitPipe), i2 = 0;
|
|
18367
18402
|
if (n2[0].trim() || n2.shift(), n2.length > 0 && !n2.at(-1)?.trim() && n2.pop(), e2) if (n2.length > e2) n2.splice(e2);
|
|
18368
18403
|
else for (; n2.length < e2; ) n2.push("");
|
|
18369
|
-
for (;
|
|
18404
|
+
for (; i2 < n2.length; i2++) n2[i2] = n2[i2].trim().replace(m$1.slashPipe, "|");
|
|
18370
18405
|
return n2;
|
|
18371
18406
|
}
|
|
18372
18407
|
function $(l2, e2, t2) {
|
|
18373
18408
|
let n2 = l2.length;
|
|
18374
18409
|
if (n2 === 0) return "";
|
|
18375
|
-
let
|
|
18376
|
-
for (;
|
|
18377
|
-
let r2 = l2.charAt(n2 -
|
|
18378
|
-
if (r2 === e2 && true)
|
|
18410
|
+
let i2 = 0;
|
|
18411
|
+
for (; i2 < n2; ) {
|
|
18412
|
+
let r2 = l2.charAt(n2 - i2 - 1);
|
|
18413
|
+
if (r2 === e2 && true) i2++;
|
|
18379
18414
|
else break;
|
|
18380
18415
|
}
|
|
18381
|
-
return l2.slice(0, n2 -
|
|
18416
|
+
return l2.slice(0, n2 - i2);
|
|
18382
18417
|
}
|
|
18383
|
-
function
|
|
18418
|
+
function ne(l2) {
|
|
18384
18419
|
let e2 = l2.split(`
|
|
18385
18420
|
`), t2 = e2.length - 1;
|
|
18386
18421
|
for (; t2 >= 0 && m$1.blankLine.test(e2[t2]); ) t2--;
|
|
18387
18422
|
return e2.length - t2 <= 2 ? l2 : e2.slice(0, t2 + 1).join(`
|
|
18388
18423
|
`);
|
|
18389
18424
|
}
|
|
18390
|
-
function
|
|
18425
|
+
function D(l2) {
|
|
18426
|
+
return l2.toLowerCase().toUpperCase().toLowerCase();
|
|
18427
|
+
}
|
|
18428
|
+
function me(l2, e2) {
|
|
18391
18429
|
if (l2.indexOf(e2[1]) === -1) return -1;
|
|
18392
18430
|
let t2 = 0;
|
|
18393
18431
|
for (let n2 = 0; n2 < l2.length; n2++) if (l2[n2] === "\\") n2++;
|
|
@@ -18395,20 +18433,20 @@ pre[class*="language-"] {
|
|
|
18395
18433
|
else if (l2[n2] === e2[1] && (t2--, t2 < 0)) return n2;
|
|
18396
18434
|
return t2 > 0 ? -2 : -1;
|
|
18397
18435
|
}
|
|
18398
|
-
function
|
|
18436
|
+
function xe(l2, e2 = 0) {
|
|
18399
18437
|
let t2 = e2, n2 = "";
|
|
18400
|
-
for (let
|
|
18438
|
+
for (let i2 of l2) if (i2 === " ") {
|
|
18401
18439
|
let r2 = 4 - t2 % 4;
|
|
18402
18440
|
n2 += " ".repeat(r2), t2 += r2;
|
|
18403
|
-
} else n2 +=
|
|
18441
|
+
} else n2 += i2, t2++;
|
|
18404
18442
|
return n2;
|
|
18405
18443
|
}
|
|
18406
|
-
function
|
|
18407
|
-
let r2 = e2.href,
|
|
18444
|
+
function be(l2, e2, t2, n2, i2) {
|
|
18445
|
+
let r2 = e2.href, o2 = e2.title || null, s2 = l2[1].replace(i2.other.outputLinkReplace, "$1"), u2 = l2[0].charAt(0) === "!";
|
|
18408
18446
|
n2.state.inLink = true;
|
|
18409
18447
|
let a2 = n2.state.linkEmitted, p2 = n2.state.inRawBlock;
|
|
18410
18448
|
n2.state.linkEmitted = false;
|
|
18411
|
-
let c2 = n2.inlineTokens(
|
|
18449
|
+
let c2 = n2.inlineTokens(s2), h2 = n2.state.linkEmitted;
|
|
18412
18450
|
if (n2.state.linkEmitted = a2, n2.state.inLink = false, !u2) {
|
|
18413
18451
|
if (h2) {
|
|
18414
18452
|
n2.state.inRawBlock = p2;
|
|
@@ -18416,27 +18454,50 @@ pre[class*="language-"] {
|
|
|
18416
18454
|
}
|
|
18417
18455
|
n2.state.linkEmitted = true;
|
|
18418
18456
|
}
|
|
18419
|
-
return { type: u2 ? "image" : "link", raw: t2, href: r2, title:
|
|
18457
|
+
return { type: u2 ? "image" : "link", raw: t2, href: r2, title: o2, text: s2, tokens: c2 };
|
|
18420
18458
|
}
|
|
18421
|
-
function
|
|
18459
|
+
function xt(l2, e2, t2) {
|
|
18422
18460
|
let n2 = l2.match(t2.other.indentCodeCompensation);
|
|
18423
18461
|
if (n2 === null) return e2;
|
|
18424
|
-
let
|
|
18462
|
+
let i2 = n2[1];
|
|
18425
18463
|
return e2.split(`
|
|
18426
18464
|
`).map((r2) => {
|
|
18427
|
-
let
|
|
18428
|
-
if (
|
|
18429
|
-
let [
|
|
18430
|
-
return
|
|
18465
|
+
let o2 = r2.match(t2.other.beginningSpace);
|
|
18466
|
+
if (o2 === null) return r2;
|
|
18467
|
+
let [s2] = o2;
|
|
18468
|
+
return r2.slice(Math.min(s2.length, i2.length));
|
|
18431
18469
|
}).join(`
|
|
18432
18470
|
`);
|
|
18433
18471
|
}
|
|
18472
|
+
function Re(l2, e2, t2, n2) {
|
|
18473
|
+
if (!e2.includes("<")) return false;
|
|
18474
|
+
for (let i2 = 0; i2 < e2.length; i2++) {
|
|
18475
|
+
if (e2[i2] === "\\") {
|
|
18476
|
+
i2++;
|
|
18477
|
+
continue;
|
|
18478
|
+
}
|
|
18479
|
+
if (e2[i2] === "`") {
|
|
18480
|
+
let s2 = n2.inline.code.exec(e2.slice(i2));
|
|
18481
|
+
if (s2) {
|
|
18482
|
+
i2 += s2[0].length - 1;
|
|
18483
|
+
continue;
|
|
18484
|
+
}
|
|
18485
|
+
}
|
|
18486
|
+
if (e2[i2] !== "<") continue;
|
|
18487
|
+
let r2 = l2.slice(t2 + i2), o2 = n2.inline.tag.exec(r2) || n2.inline.autolink.exec(r2);
|
|
18488
|
+
if (o2) {
|
|
18489
|
+
if (o2[0].length > e2.length - i2) return true;
|
|
18490
|
+
i2 += o2[0].length - 1;
|
|
18491
|
+
}
|
|
18492
|
+
}
|
|
18493
|
+
return false;
|
|
18494
|
+
}
|
|
18434
18495
|
var y$1 = class y {
|
|
18435
18496
|
options;
|
|
18436
18497
|
rules;
|
|
18437
18498
|
lexer;
|
|
18438
18499
|
constructor(e2) {
|
|
18439
|
-
this.options = e2 ||
|
|
18500
|
+
this.options = e2 || T;
|
|
18440
18501
|
}
|
|
18441
18502
|
space(e2) {
|
|
18442
18503
|
let t2 = this.rules.block.newline.exec(e2);
|
|
@@ -18445,15 +18506,15 @@ pre[class*="language-"] {
|
|
|
18445
18506
|
code(e2) {
|
|
18446
18507
|
let t2 = this.rules.block.code.exec(e2);
|
|
18447
18508
|
if (t2) {
|
|
18448
|
-
let n2 = this.options.pedantic ? t2[0] :
|
|
18449
|
-
return { type: "code", raw: n2, codeBlockStyle: "indented", text:
|
|
18509
|
+
let n2 = this.options.pedantic ? t2[0] : ne(t2[0]), i2 = n2.replace(this.rules.other.codeRemoveIndent, "");
|
|
18510
|
+
return { type: "code", raw: n2, codeBlockStyle: "indented", text: i2 };
|
|
18450
18511
|
}
|
|
18451
18512
|
}
|
|
18452
18513
|
fences(e2) {
|
|
18453
18514
|
let t2 = this.rules.block.fences.exec(e2);
|
|
18454
18515
|
if (t2) {
|
|
18455
|
-
let n2 = t2[0],
|
|
18456
|
-
return { type: "code", raw: n2, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text:
|
|
18516
|
+
let n2 = t2[0], i2 = xt(n2, t2[3] || "", this.rules);
|
|
18517
|
+
return { type: "code", raw: n2, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: i2 };
|
|
18457
18518
|
}
|
|
18458
18519
|
}
|
|
18459
18520
|
heading(e2) {
|
|
@@ -18461,8 +18522,8 @@ pre[class*="language-"] {
|
|
|
18461
18522
|
if (t2) {
|
|
18462
18523
|
let n2 = t2[2].trim();
|
|
18463
18524
|
if (this.rules.other.endingHash.test(n2)) {
|
|
18464
|
-
let
|
|
18465
|
-
(this.options.pedantic || !
|
|
18525
|
+
let i2 = $(n2, "#");
|
|
18526
|
+
(this.options.pedantic || !i2 || this.rules.other.endingSpaceTabChar.test(i2)) && (n2 = i2.trim());
|
|
18466
18527
|
}
|
|
18467
18528
|
return { type: "heading", raw: $(t2[0], `
|
|
18468
18529
|
`), depth: t2[1].length, text: n2, tokens: this.lexer.inline(n2) };
|
|
@@ -18478,74 +18539,74 @@ pre[class*="language-"] {
|
|
|
18478
18539
|
if (t2) {
|
|
18479
18540
|
let n2 = $(t2[0], `
|
|
18480
18541
|
`).split(`
|
|
18481
|
-
`),
|
|
18542
|
+
`), i2 = "", r2 = "", o2 = [];
|
|
18482
18543
|
for (; n2.length > 0; ) {
|
|
18483
|
-
let
|
|
18484
|
-
for (a2 = 0; a2 < n2.length; a2++) if (this.rules.other.blockquoteStart.test(n2[a2])) u2.push(n2[a2]),
|
|
18485
|
-
else if (!
|
|
18544
|
+
let s2 = false, u2 = [], a2;
|
|
18545
|
+
for (a2 = 0; a2 < n2.length; a2++) if (this.rules.other.blockquoteStart.test(n2[a2])) u2.push(n2[a2]), s2 = true;
|
|
18546
|
+
else if (!s2) u2.push(n2[a2]);
|
|
18486
18547
|
else break;
|
|
18487
18548
|
n2 = n2.slice(a2);
|
|
18488
18549
|
let p2 = u2.join(`
|
|
18489
18550
|
`), c2 = p2.replace(this.rules.other.blockquoteSetextReplace, `
|
|
18490
18551
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
18491
|
-
|
|
18552
|
+
i2 = i2 ? `${i2}
|
|
18492
18553
|
${p2}` : p2, r2 = r2 ? `${r2}
|
|
18493
18554
|
${c2}` : c2;
|
|
18494
18555
|
let h2 = this.lexer.state.top;
|
|
18495
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(c2,
|
|
18496
|
-
let
|
|
18497
|
-
if (
|
|
18498
|
-
if (
|
|
18499
|
-
let O =
|
|
18556
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c2, o2, true), this.lexer.state.top = h2, n2.length === 0) break;
|
|
18557
|
+
let k = o2.at(-1);
|
|
18558
|
+
if (k?.type === "code") break;
|
|
18559
|
+
if (k?.type === "blockquote") {
|
|
18560
|
+
let O = k, g2 = n2.join(`
|
|
18500
18561
|
`), w2 = O.raw + `
|
|
18501
|
-
` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""),
|
|
18502
|
-
|
|
18503
|
-
${g2}`, r2 = r2.substring(0, r2.length - O.text.length) +
|
|
18562
|
+
` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w2);
|
|
18563
|
+
o2[o2.length - 1] = z, i2 = `${i2}
|
|
18564
|
+
${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
|
|
18504
18565
|
break;
|
|
18505
|
-
} else if (
|
|
18506
|
-
let O =
|
|
18566
|
+
} else if (k?.type === "list") {
|
|
18567
|
+
let O = k, g2 = O.raw + `
|
|
18507
18568
|
` + n2.join(`
|
|
18508
18569
|
`), w2 = this.list(g2);
|
|
18509
|
-
|
|
18570
|
+
o2[o2.length - 1] = w2, i2 = i2.substring(0, i2.length - k.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n2 = g2.substring(o2.at(-1).raw.length).split(`
|
|
18510
18571
|
`);
|
|
18511
18572
|
continue;
|
|
18512
18573
|
}
|
|
18513
18574
|
}
|
|
18514
|
-
return { type: "blockquote", raw:
|
|
18575
|
+
return { type: "blockquote", raw: i2, tokens: o2, text: r2 };
|
|
18515
18576
|
}
|
|
18516
18577
|
}
|
|
18517
18578
|
list(e2) {
|
|
18518
18579
|
let t2 = this.rules.block.list.exec(e2);
|
|
18519
18580
|
if (t2) {
|
|
18520
|
-
let n2 = t2[1].trim(),
|
|
18521
|
-
n2 =
|
|
18522
|
-
let
|
|
18581
|
+
let n2 = t2[1].trim(), i2 = n2.length > 1, r2 = { type: "list", raw: "", ordered: i2, start: i2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
|
|
18582
|
+
n2 = i2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = i2 ? n2 : "[*+-]");
|
|
18583
|
+
let o2 = this.rules.other.listItemRegex(n2), s2 = false;
|
|
18523
18584
|
for (; e2; ) {
|
|
18524
18585
|
let a2 = false, p2 = "", c2 = "";
|
|
18525
|
-
if (!(t2 =
|
|
18586
|
+
if (!(t2 = o2.exec(e2)) || this.rules.block.hr.test(e2)) break;
|
|
18526
18587
|
p2 = t2[0], e2 = e2.substring(p2.length);
|
|
18527
|
-
let h2 =
|
|
18528
|
-
`, 1)[0], t2[1].length),
|
|
18588
|
+
let h2 = xe(t2[2].split(`
|
|
18589
|
+
`, 1)[0], t2[1].length), k = e2.split(`
|
|
18529
18590
|
`, 1)[0], O = !h2.trim(), g2 = 0;
|
|
18530
|
-
if (this.options.pedantic ? (g2 = 2, c2 = h2.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h2.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h2.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(
|
|
18531
|
-
`, e2 = e2.substring(
|
|
18532
|
-
let w2 = this.rules.other.nextBulletRegex(g2),
|
|
18591
|
+
if (this.options.pedantic ? (g2 = 2, c2 = h2.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h2.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h2.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(k) && (p2 += k + `
|
|
18592
|
+
`, e2 = e2.substring(k.length + 1), a2 = true), !a2) {
|
|
18593
|
+
let w2 = this.rules.other.nextBulletRegex(g2), z = this.rules.other.hrRegex(g2), re = this.rules.other.fencesBeginRegex(g2), se = this.rules.other.headingBeginRegex(g2), Te = this.rules.other.htmlBeginRegex(g2), Oe = this.rules.other.blockquoteBeginRegex(g2);
|
|
18533
18594
|
for (; e2; ) {
|
|
18534
|
-
let
|
|
18535
|
-
`, 1)[0],
|
|
18536
|
-
if (
|
|
18537
|
-
if (
|
|
18538
|
-
` +
|
|
18595
|
+
let j = e2.split(`
|
|
18596
|
+
`, 1)[0], q;
|
|
18597
|
+
if (k = j, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), q = k) : q = k.replace(this.rules.other.tabCharGlobal, " "), re.test(k) || se.test(k) || Te.test(k) || Oe.test(k) || w2.test(k) || z.test(k)) break;
|
|
18598
|
+
if (q.search(this.rules.other.nonSpaceChar) >= g2 || !k.trim()) c2 += `
|
|
18599
|
+
` + q.slice(g2);
|
|
18539
18600
|
else {
|
|
18540
|
-
if (O || h2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 ||
|
|
18601
|
+
if (O || h2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test(h2) || se.test(h2) || z.test(h2)) break;
|
|
18541
18602
|
c2 += `
|
|
18542
|
-
` +
|
|
18603
|
+
` + k;
|
|
18543
18604
|
}
|
|
18544
|
-
O = !
|
|
18545
|
-
`, e2 = e2.substring(
|
|
18605
|
+
O = !k.trim(), p2 += j + `
|
|
18606
|
+
`, e2 = e2.substring(j.length + 1), h2 = q.slice(g2);
|
|
18546
18607
|
}
|
|
18547
18608
|
}
|
|
18548
|
-
r2.loose || (
|
|
18609
|
+
r2.loose || (s2 ? r2.loose = true : this.rules.other.doubleBlankLine.test(p2) && (s2 = true)), r2.items.push({ type: "list_item", raw: p2, task: !!this.options.gfm && this.rules.other.listIsTask.test(c2), loose: false, text: c2, tokens: [] }), r2.raw += p2;
|
|
18549
18610
|
}
|
|
18550
18611
|
let u2 = r2.items.at(-1);
|
|
18551
18612
|
if (u2) u2.raw = u2.raw.trimEnd(), u2.text = u2.text.trimEnd();
|
|
@@ -18580,29 +18641,29 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18580
18641
|
html(e2) {
|
|
18581
18642
|
let t2 = this.rules.block.html.exec(e2);
|
|
18582
18643
|
if (t2) {
|
|
18583
|
-
let n2 =
|
|
18644
|
+
let n2 = ne(t2[0]);
|
|
18584
18645
|
return { type: "html", block: true, raw: n2, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n2 };
|
|
18585
18646
|
}
|
|
18586
18647
|
}
|
|
18587
18648
|
def(e2) {
|
|
18588
18649
|
let t2 = this.rules.block.def.exec(e2);
|
|
18589
18650
|
if (t2) {
|
|
18590
|
-
let n2 = t2[1]
|
|
18651
|
+
let n2 = D(t2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i2 = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3];
|
|
18591
18652
|
return { type: "def", tag: n2, raw: $(t2[0], `
|
|
18592
|
-
`), href:
|
|
18653
|
+
`), href: i2, title: r2 };
|
|
18593
18654
|
}
|
|
18594
18655
|
}
|
|
18595
18656
|
table(e2) {
|
|
18596
18657
|
let t2 = this.rules.block.table.exec(e2);
|
|
18597
18658
|
if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
|
|
18598
|
-
let n2 =
|
|
18599
|
-
`) : [],
|
|
18659
|
+
let n2 = te(t2[1]), i2 = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
18660
|
+
`) : [], o2 = { type: "table", raw: $(t2[0], `
|
|
18600
18661
|
`), header: [], align: [], rows: [] };
|
|
18601
|
-
if (n2.length ===
|
|
18602
|
-
for (let
|
|
18603
|
-
for (let
|
|
18604
|
-
for (let
|
|
18605
|
-
return
|
|
18662
|
+
if (n2.length === i2.length) {
|
|
18663
|
+
for (let s2 of i2) this.rules.other.tableAlignRight.test(s2) ? o2.align.push("right") : this.rules.other.tableAlignCenter.test(s2) ? o2.align.push("center") : this.rules.other.tableAlignLeft.test(s2) ? o2.align.push("left") : o2.align.push(null);
|
|
18664
|
+
for (let s2 = 0; s2 < n2.length; s2++) o2.header.push({ text: n2[s2], tokens: this.lexer.inline(n2[s2]), header: true, align: o2.align[s2] });
|
|
18665
|
+
for (let s2 of r2) o2.rows.push(te(s2, o2.header.length).map((u2, a2) => ({ text: u2, tokens: this.lexer.inline(u2), header: false, align: o2.align[a2] })));
|
|
18666
|
+
return o2;
|
|
18606
18667
|
}
|
|
18607
18668
|
}
|
|
18608
18669
|
lheading(e2) {
|
|
@@ -18636,50 +18697,54 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18636
18697
|
link(e2) {
|
|
18637
18698
|
let t2 = this.rules.inline.link.exec(e2);
|
|
18638
18699
|
if (t2) {
|
|
18639
|
-
let n2 = t2[
|
|
18640
|
-
if (!this.options.pedantic && this.rules
|
|
18641
|
-
|
|
18642
|
-
|
|
18643
|
-
if ((
|
|
18700
|
+
let n2 = t2[0].charAt(0) === "!" ? 2 : 1;
|
|
18701
|
+
if (!this.options.pedantic && Re(e2, t2[1], n2, this.rules)) return;
|
|
18702
|
+
let i2 = t2[2].trim();
|
|
18703
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i2)) {
|
|
18704
|
+
if (!this.rules.other.endAngleBracket.test(i2)) return;
|
|
18705
|
+
let s2 = $(i2.slice(0, -1), "\\");
|
|
18706
|
+
if ((i2.length - s2.length) % 2 === 0) return;
|
|
18644
18707
|
} else {
|
|
18645
|
-
let
|
|
18646
|
-
if (
|
|
18647
|
-
if (
|
|
18648
|
-
let
|
|
18649
|
-
t2[2] = t2[2].substring(0,
|
|
18708
|
+
let s2 = me(t2[2], "()");
|
|
18709
|
+
if (s2 === -2) return;
|
|
18710
|
+
if (s2 > -1) {
|
|
18711
|
+
let a2 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s2;
|
|
18712
|
+
t2[2] = t2[2].substring(0, s2), t2[0] = t2[0].substring(0, a2).trim(), t2[3] = "";
|
|
18650
18713
|
}
|
|
18651
18714
|
}
|
|
18652
|
-
let
|
|
18715
|
+
let r2 = t2[2], o2 = "";
|
|
18653
18716
|
if (this.options.pedantic) {
|
|
18654
|
-
let
|
|
18655
|
-
|
|
18656
|
-
} else
|
|
18657
|
-
return
|
|
18717
|
+
let s2 = this.rules.other.pedanticHrefTitle.exec(r2);
|
|
18718
|
+
s2 && (r2 = s2[1], o2 = s2[3]);
|
|
18719
|
+
} else o2 = t2[3] ? t2[3].slice(1, -1) : "";
|
|
18720
|
+
return r2 = r2.trim(), this.rules.other.startAngleBracket.test(r2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i2) ? r2 = r2.slice(1) : r2 = r2.slice(1, -1)), be(t2, { href: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1"), title: o2 && o2.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
|
|
18658
18721
|
}
|
|
18659
18722
|
}
|
|
18660
18723
|
reflink(e2, t2) {
|
|
18661
18724
|
let n2;
|
|
18662
18725
|
if ((n2 = this.rules.inline.reflink.exec(e2)) || (n2 = this.rules.inline.nolink.exec(e2))) {
|
|
18663
|
-
let
|
|
18664
|
-
if (!
|
|
18665
|
-
|
|
18666
|
-
|
|
18726
|
+
let i2 = n2[0].charAt(0) === "!" ? 2 : 1;
|
|
18727
|
+
if (!this.options.pedantic && Re(e2, n2[1], i2, this.rules)) return;
|
|
18728
|
+
let r2 = (n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o2 = t2[D(r2)];
|
|
18729
|
+
if (!o2) {
|
|
18730
|
+
let s2 = n2[0].charAt(0);
|
|
18731
|
+
return { type: "text", raw: s2, text: s2 };
|
|
18667
18732
|
}
|
|
18668
|
-
return
|
|
18733
|
+
return be(n2, o2, n2[0], this.lexer, this.rules);
|
|
18669
18734
|
}
|
|
18670
18735
|
}
|
|
18671
18736
|
emStrong(e2, t2, n2 = "") {
|
|
18672
|
-
let
|
|
18673
|
-
if (!
|
|
18674
|
-
if (!(
|
|
18675
|
-
let
|
|
18676
|
-
for (
|
|
18677
|
-
if (
|
|
18678
|
-
if (u2 = [...
|
|
18737
|
+
let i2 = this.rules.inline.emStrongLDelim.exec(e2);
|
|
18738
|
+
if (!i2 || !i2[1] && !i2[2] && !i2[3] && !i2[4] || i2[4] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
18739
|
+
if (!(i2[1] || i2[3] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
|
|
18740
|
+
let o2 = [...i2[0]].length - 1, s2, u2, a2 = o2, p2 = 0, c2 = i2[0][0], h2 = n2 === c2, k = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
18741
|
+
for (k.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i2 = k.exec(t2)) !== null; ) {
|
|
18742
|
+
if (s2 = i2[1] || i2[2] || i2[3] || i2[4] || i2[5] || i2[6], !s2) continue;
|
|
18743
|
+
if (u2 = [...s2].length, i2[3] || i2[4]) {
|
|
18679
18744
|
a2 += u2;
|
|
18680
18745
|
continue;
|
|
18681
|
-
} else if (
|
|
18682
|
-
if (
|
|
18746
|
+
} else if (i2[5] || i2[6]) {
|
|
18747
|
+
if (o2 % 3 && !((o2 + u2) % 3)) {
|
|
18683
18748
|
p2 += u2;
|
|
18684
18749
|
continue;
|
|
18685
18750
|
}
|
|
@@ -18687,10 +18752,10 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18687
18752
|
}
|
|
18688
18753
|
if (a2 -= u2, a2 > 0) continue;
|
|
18689
18754
|
u2 = Math.min(u2, u2 + a2 + p2);
|
|
18690
|
-
let O = [...
|
|
18691
|
-
if (Math.min(
|
|
18692
|
-
let
|
|
18693
|
-
return { type: "em", raw: g2, text:
|
|
18755
|
+
let O = [...i2[0]][0].length, g2 = e2.slice(0, o2 + i2.index + O + u2);
|
|
18756
|
+
if (Math.min(o2, u2) % 2) {
|
|
18757
|
+
let z = g2.slice(1, -1);
|
|
18758
|
+
return { type: "em", raw: g2, text: z, tokens: this.lexer.inlineTokens(z) };
|
|
18694
18759
|
}
|
|
18695
18760
|
let w2 = g2.slice(2, -2);
|
|
18696
18761
|
return { type: "strong", raw: g2, text: w2, tokens: this.lexer.inlineTokens(w2) };
|
|
@@ -18700,8 +18765,8 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18700
18765
|
codespan(e2) {
|
|
18701
18766
|
let t2 = this.rules.inline.code.exec(e2);
|
|
18702
18767
|
if (t2) {
|
|
18703
|
-
let n2 = t2[2].replace(this.rules.other.newLineCharGlobal, " "),
|
|
18704
|
-
return
|
|
18768
|
+
let n2 = t2[2].replace(this.rules.other.newLineCharGlobal, " "), i2 = this.rules.other.nonSpaceChar.test(n2), r2 = this.rules.other.startingSpaceChar.test(n2) && this.rules.other.endingSpaceChar.test(n2);
|
|
18769
|
+
return i2 && r2 && (n2 = n2.substring(1, n2.length - 1)), { type: "codespan", raw: t2[0], text: n2 };
|
|
18705
18770
|
}
|
|
18706
18771
|
}
|
|
18707
18772
|
br(e2) {
|
|
@@ -18709,43 +18774,43 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18709
18774
|
if (t2) return { type: "br", raw: t2[0] };
|
|
18710
18775
|
}
|
|
18711
18776
|
del(e2, t2, n2 = "") {
|
|
18712
|
-
let
|
|
18713
|
-
if (!
|
|
18714
|
-
if (!(
|
|
18715
|
-
let
|
|
18716
|
-
for (p2.lastIndex = 0, t2 = t2.slice(-1 * e2.length +
|
|
18717
|
-
if (
|
|
18718
|
-
if (
|
|
18777
|
+
let i2 = this.rules.inline.delLDelim.exec(e2);
|
|
18778
|
+
if (!i2) return;
|
|
18779
|
+
if (!(i2[1] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
|
|
18780
|
+
let o2 = [...i2[0]].length - 1, s2, u2, a2 = o2, p2 = this.rules.inline.delRDelim;
|
|
18781
|
+
for (p2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i2 = p2.exec(t2)) !== null; ) {
|
|
18782
|
+
if (s2 = i2[1] || i2[2] || i2[3] || i2[4] || i2[5] || i2[6], !s2 || (u2 = [...s2].length, u2 !== o2)) continue;
|
|
18783
|
+
if (i2[3] || i2[4]) {
|
|
18719
18784
|
a2 += u2;
|
|
18720
18785
|
continue;
|
|
18721
18786
|
}
|
|
18722
18787
|
if (a2 -= u2, a2 > 0) continue;
|
|
18723
18788
|
u2 = Math.min(u2, u2 + a2);
|
|
18724
|
-
let c2 = [...
|
|
18725
|
-
return { type: "del", raw: h2, text:
|
|
18789
|
+
let c2 = [...i2[0]][0].length, h2 = e2.slice(0, o2 + i2.index + c2 + u2), k = h2.slice(o2, -o2);
|
|
18790
|
+
return { type: "del", raw: h2, text: k, tokens: this.lexer.inlineTokens(k) };
|
|
18726
18791
|
}
|
|
18727
18792
|
}
|
|
18728
18793
|
}
|
|
18729
18794
|
autolink(e2) {
|
|
18730
18795
|
let t2 = this.rules.inline.autolink.exec(e2);
|
|
18731
18796
|
if (t2) {
|
|
18732
|
-
let n2,
|
|
18733
|
-
return t2[2] === "@" ? (n2 = t2[1],
|
|
18797
|
+
let n2, i2;
|
|
18798
|
+
return t2[2] === "@" ? (n2 = t2[1], i2 = "mailto:" + n2) : (n2 = t2[1], i2 = n2), { type: "link", raw: t2[0], text: n2, href: i2, autolink: true, tokens: [{ type: "text", raw: n2, text: n2 }] };
|
|
18734
18799
|
}
|
|
18735
18800
|
}
|
|
18736
18801
|
url(e2) {
|
|
18737
18802
|
let t2;
|
|
18738
18803
|
if (t2 = this.rules.inline.url.exec(e2)) {
|
|
18739
|
-
let n2,
|
|
18740
|
-
if (t2[2] === "@") n2 = t2[0],
|
|
18804
|
+
let n2, i2;
|
|
18805
|
+
if (t2[2] === "@") n2 = t2[0], i2 = "mailto:" + n2;
|
|
18741
18806
|
else {
|
|
18742
18807
|
let r2;
|
|
18743
18808
|
do
|
|
18744
18809
|
r2 = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? "";
|
|
18745
18810
|
while (r2 !== t2[0]);
|
|
18746
|
-
n2 = t2[0], t2[1] === "www." ?
|
|
18811
|
+
n2 = t2[0], t2[1] === "www." ? i2 = "http://" + t2[0] : i2 = t2[0];
|
|
18747
18812
|
}
|
|
18748
|
-
return { type: "link", raw: t2[0], text: n2, href:
|
|
18813
|
+
return { type: "link", raw: t2[0], text: n2, href: i2, autolink: true, tokens: [{ type: "text", raw: n2, text: n2 }] };
|
|
18749
18814
|
}
|
|
18750
18815
|
}
|
|
18751
18816
|
inlineText(e2) {
|
|
@@ -18763,12 +18828,12 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18763
18828
|
inlineQueue;
|
|
18764
18829
|
tokenizer;
|
|
18765
18830
|
constructor(e2) {
|
|
18766
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 ||
|
|
18767
|
-
let t2 = { other: m$1, block:
|
|
18768
|
-
this.options.pedantic ? (t2.block =
|
|
18831
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new y$1(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, linkEmitted: false, top: true };
|
|
18832
|
+
let t2 = { other: m$1, block: G.normal, inline: B.normal };
|
|
18833
|
+
this.options.pedantic ? (t2.block = G.pedantic, t2.inline = B.pedantic) : this.options.gfm && (t2.block = G.gfm, this.options.breaks ? t2.inline = B.breaks : t2.inline = B.gfm), this.tokenizer.rules = t2;
|
|
18769
18834
|
}
|
|
18770
18835
|
static get rules() {
|
|
18771
|
-
return { block:
|
|
18836
|
+
return { block: G, inline: B };
|
|
18772
18837
|
}
|
|
18773
18838
|
static lex(e2, t2) {
|
|
18774
18839
|
return new l2(t2).lex(e2);
|
|
@@ -18787,29 +18852,29 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18787
18852
|
}
|
|
18788
18853
|
blockTokens(e2, t2 = [], n2 = false) {
|
|
18789
18854
|
this.tokenizer.lexer = this, this.options.pedantic && (e2 = e2.replace(m$1.tabCharGlobal, " ").replace(m$1.spaceLine, ""));
|
|
18790
|
-
let
|
|
18855
|
+
let i2 = 1 / 0;
|
|
18791
18856
|
for (; e2; ) {
|
|
18792
|
-
if (e2.length <
|
|
18857
|
+
if (e2.length < i2) i2 = e2.length;
|
|
18793
18858
|
else {
|
|
18794
18859
|
this.infiniteLoopError(e2.charCodeAt(0));
|
|
18795
18860
|
break;
|
|
18796
18861
|
}
|
|
18797
18862
|
let r2;
|
|
18798
|
-
if (this.options.extensions?.block?.some((
|
|
18863
|
+
if (this.options.extensions?.block?.some((s2) => (r2 = s2.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
|
|
18799
18864
|
if (r2 = this.tokenizer.space(e2)) {
|
|
18800
18865
|
e2 = e2.substring(r2.raw.length);
|
|
18801
|
-
let
|
|
18802
|
-
r2.raw.length === 1 &&
|
|
18866
|
+
let s2 = t2.at(-1);
|
|
18867
|
+
r2.raw.length === 1 && s2 !== void 0 ? s2.raw += `
|
|
18803
18868
|
` : t2.push(r2);
|
|
18804
18869
|
continue;
|
|
18805
18870
|
}
|
|
18806
18871
|
if (r2 = this.tokenizer.code(e2)) {
|
|
18807
18872
|
e2 = e2.substring(r2.raw.length);
|
|
18808
|
-
let
|
|
18809
|
-
|
|
18873
|
+
let s2 = t2.at(-1);
|
|
18874
|
+
s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
|
|
18810
18875
|
`) ? "" : `
|
|
18811
|
-
`) + r2.raw,
|
|
18812
|
-
` + r2.text, this.inlineQueue.at(-1).src =
|
|
18876
|
+
`) + r2.raw, s2.text += `
|
|
18877
|
+
` + r2.text, this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
|
|
18813
18878
|
continue;
|
|
18814
18879
|
}
|
|
18815
18880
|
if (r2 = this.tokenizer.fences(e2)) {
|
|
@@ -18838,11 +18903,11 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18838
18903
|
}
|
|
18839
18904
|
if (r2 = this.tokenizer.def(e2)) {
|
|
18840
18905
|
e2 = e2.substring(r2.raw.length);
|
|
18841
|
-
let
|
|
18842
|
-
|
|
18906
|
+
let s2 = t2.at(-1);
|
|
18907
|
+
s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
|
|
18843
18908
|
`) ? "" : `
|
|
18844
|
-
`) + r2.raw,
|
|
18845
|
-
` + r2.raw, this.inlineQueue.at(-1).src =
|
|
18909
|
+
`) + r2.raw, s2.text += `
|
|
18910
|
+
` + r2.raw, this.inlineQueue.at(-1).src = s2.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2));
|
|
18846
18911
|
continue;
|
|
18847
18912
|
}
|
|
18848
18913
|
if (r2 = this.tokenizer.table(e2)) {
|
|
@@ -18853,28 +18918,28 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18853
18918
|
e2 = e2.substring(r2.raw.length), t2.push(r2);
|
|
18854
18919
|
continue;
|
|
18855
18920
|
}
|
|
18856
|
-
let
|
|
18921
|
+
let o2 = e2;
|
|
18857
18922
|
if (this.options.extensions?.startBlock) {
|
|
18858
|
-
let
|
|
18923
|
+
let s2 = 1 / 0, u2 = e2.slice(1), a2;
|
|
18859
18924
|
this.options.extensions.startBlock.forEach((p2) => {
|
|
18860
|
-
a2 = p2.call({ lexer: this }, u2), typeof a2 == "number" && a2 >= 0 && (
|
|
18861
|
-
}),
|
|
18925
|
+
a2 = p2.call({ lexer: this }, u2), typeof a2 == "number" && a2 >= 0 && (s2 = Math.min(s2, a2));
|
|
18926
|
+
}), s2 < 1 / 0 && s2 >= 0 && (o2 = e2.substring(0, s2 + 1));
|
|
18862
18927
|
}
|
|
18863
|
-
if (this.state.top && (r2 = this.tokenizer.paragraph(
|
|
18864
|
-
let
|
|
18865
|
-
n2 &&
|
|
18928
|
+
if (this.state.top && (r2 = this.tokenizer.paragraph(o2))) {
|
|
18929
|
+
let s2 = t2.at(-1);
|
|
18930
|
+
n2 && s2?.type === "paragraph" ? (s2.raw += (s2.raw.endsWith(`
|
|
18866
18931
|
`) ? "" : `
|
|
18867
|
-
`) + r2.raw,
|
|
18868
|
-
` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src =
|
|
18932
|
+
`) + r2.raw, s2.text += `
|
|
18933
|
+
` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2), n2 = o2.length !== e2.length, e2 = e2.substring(r2.raw.length);
|
|
18869
18934
|
continue;
|
|
18870
18935
|
}
|
|
18871
18936
|
if (r2 = this.tokenizer.text(e2)) {
|
|
18872
18937
|
e2 = e2.substring(r2.raw.length);
|
|
18873
|
-
let
|
|
18874
|
-
|
|
18938
|
+
let s2 = t2.at(-1);
|
|
18939
|
+
s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
|
|
18875
18940
|
`) ? "" : `
|
|
18876
|
-
`) + r2.raw,
|
|
18877
|
-
` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src =
|
|
18941
|
+
`) + r2.raw, s2.text += `
|
|
18942
|
+
` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
|
|
18878
18943
|
continue;
|
|
18879
18944
|
}
|
|
18880
18945
|
if (e2) {
|
|
@@ -18892,8 +18957,8 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18892
18957
|
let t2 = this.tokenizer.rules.inline.link;
|
|
18893
18958
|
for (let n2 of e2.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t2.test(n2[0]) && e2.charAt(n2.index - 1) !== "!") return true;
|
|
18894
18959
|
for (let n2 of e2.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
18895
|
-
let
|
|
18896
|
-
if (!(
|
|
18960
|
+
let i2 = n2[0], r2 = i2.lastIndexOf("[");
|
|
18961
|
+
if (!(i2.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, D(i2.slice(r2 + 1, -1)))) && !(r2 > 1 && this.linkInText(i2.slice(1, r2 - 1)))) return true;
|
|
18897
18962
|
}
|
|
18898
18963
|
return false;
|
|
18899
18964
|
}
|
|
@@ -18901,71 +18966,71 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18901
18966
|
this.tokenizer.lexer = this;
|
|
18902
18967
|
let n2 = e2;
|
|
18903
18968
|
if (this.tokens.links && e2.includes("[")) {
|
|
18904
|
-
let
|
|
18969
|
+
let s2 = this.tokenizer.rules.inline.reflinkSearch, u2 = (a2) => {
|
|
18905
18970
|
let p2 = a2.lastIndexOf("[");
|
|
18906
|
-
if (!Object.hasOwn(this.tokens.links, a2.slice(p2 + 1, -1))) return a2;
|
|
18971
|
+
if (!Object.hasOwn(this.tokens.links, D(a2.slice(p2 + 1, -1)))) return a2;
|
|
18907
18972
|
if (p2 > 1 && a2.charAt(0) !== "!") {
|
|
18908
18973
|
let c2 = a2.slice(1, p2 - 1);
|
|
18909
|
-
if (this.linkInText(c2)) return "[" + c2.replace(
|
|
18974
|
+
if (this.linkInText(c2)) return "[" + c2.replace(s2, u2) + "][" + "a".repeat(a2.length - p2 - 2) + "]";
|
|
18910
18975
|
}
|
|
18911
18976
|
return "[" + "a".repeat(a2.length - 2) + "]";
|
|
18912
18977
|
};
|
|
18913
|
-
n2 = n2.replace(
|
|
18978
|
+
n2 = n2.replace(s2, u2);
|
|
18914
18979
|
}
|
|
18915
|
-
n2 = n2.replace(this.tokenizer.rules.inline.anyPunctuation, (
|
|
18980
|
+
n2 = n2.replace(this.tokenizer.rules.inline.anyPunctuation, (s2) => "+".repeat(s2.length)), n2 = n2.replace(this.tokenizer.rules.inline.blockSkip, (s2, u2, a2) => {
|
|
18916
18981
|
let p2 = a2 ? a2.length : 0;
|
|
18917
|
-
return
|
|
18982
|
+
return s2.slice(0, p2) + "[" + "a".repeat(s2.length - p2 - 2) + "]";
|
|
18918
18983
|
}), n2 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n2) ?? n2;
|
|
18919
|
-
let
|
|
18984
|
+
let i2 = false, r2 = "", o2 = 1 / 0;
|
|
18920
18985
|
for (; e2; ) {
|
|
18921
|
-
if (e2.length <
|
|
18986
|
+
if (e2.length < o2) o2 = e2.length;
|
|
18922
18987
|
else {
|
|
18923
18988
|
this.infiniteLoopError(e2.charCodeAt(0));
|
|
18924
18989
|
break;
|
|
18925
18990
|
}
|
|
18926
|
-
|
|
18927
|
-
let
|
|
18928
|
-
if (this.options.extensions?.inline?.some((a2) => (
|
|
18929
|
-
if (
|
|
18930
|
-
e2 = e2.substring(
|
|
18991
|
+
i2 || (r2 = ""), i2 = false;
|
|
18992
|
+
let s2;
|
|
18993
|
+
if (this.options.extensions?.inline?.some((a2) => (s2 = a2.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(s2.raw.length), t2.push(s2), true) : false)) continue;
|
|
18994
|
+
if (s2 = this.tokenizer.escape(e2)) {
|
|
18995
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18931
18996
|
continue;
|
|
18932
18997
|
}
|
|
18933
|
-
if (
|
|
18934
|
-
e2 = e2.substring(
|
|
18998
|
+
if (s2 = this.tokenizer.tag(e2)) {
|
|
18999
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18935
19000
|
continue;
|
|
18936
19001
|
}
|
|
18937
|
-
if (
|
|
18938
|
-
e2 = e2.substring(
|
|
19002
|
+
if (s2 = this.tokenizer.link(e2)) {
|
|
19003
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18939
19004
|
continue;
|
|
18940
19005
|
}
|
|
18941
|
-
if (
|
|
18942
|
-
e2 = e2.substring(
|
|
19006
|
+
if (s2 = this.tokenizer.reflink(e2, this.tokens.links)) {
|
|
19007
|
+
e2 = e2.substring(s2.raw.length);
|
|
18943
19008
|
let a2 = t2.at(-1);
|
|
18944
|
-
|
|
19009
|
+
s2.type === "text" && a2?.type === "text" ? (a2.raw += s2.raw, a2.text += s2.text) : t2.push(s2);
|
|
18945
19010
|
continue;
|
|
18946
19011
|
}
|
|
18947
|
-
if (
|
|
18948
|
-
e2 = e2.substring(
|
|
19012
|
+
if (s2 = this.tokenizer.emStrong(e2, n2, r2)) {
|
|
19013
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18949
19014
|
continue;
|
|
18950
19015
|
}
|
|
18951
|
-
if (
|
|
18952
|
-
e2 = e2.substring(
|
|
19016
|
+
if (s2 = this.tokenizer.codespan(e2)) {
|
|
19017
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18953
19018
|
continue;
|
|
18954
19019
|
}
|
|
18955
|
-
if (
|
|
18956
|
-
e2 = e2.substring(
|
|
19020
|
+
if (s2 = this.tokenizer.br(e2)) {
|
|
19021
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18957
19022
|
continue;
|
|
18958
19023
|
}
|
|
18959
|
-
if (
|
|
18960
|
-
e2 = e2.substring(
|
|
19024
|
+
if (s2 = this.tokenizer.del(e2, n2, r2)) {
|
|
19025
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18961
19026
|
continue;
|
|
18962
19027
|
}
|
|
18963
|
-
if (
|
|
18964
|
-
e2 = e2.substring(
|
|
19028
|
+
if (s2 = this.tokenizer.autolink(e2)) {
|
|
19029
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18965
19030
|
continue;
|
|
18966
19031
|
}
|
|
18967
|
-
if (!this.state.inLink && (
|
|
18968
|
-
e2 = e2.substring(
|
|
19032
|
+
if (!this.state.inLink && (s2 = this.tokenizer.url(e2))) {
|
|
19033
|
+
e2 = e2.substring(s2.raw.length), t2.push(s2);
|
|
18969
19034
|
continue;
|
|
18970
19035
|
}
|
|
18971
19036
|
let u2 = e2;
|
|
@@ -18975,10 +19040,10 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18975
19040
|
c2 = h2.call({ lexer: this }, p2), typeof c2 == "number" && c2 >= 0 && (a2 = Math.min(a2, c2));
|
|
18976
19041
|
}), a2 < 1 / 0 && a2 >= 0 && (u2 = e2.substring(0, a2 + 1));
|
|
18977
19042
|
}
|
|
18978
|
-
if (
|
|
18979
|
-
e2 = e2.substring(
|
|
19043
|
+
if (s2 = this.tokenizer.inlineText(u2)) {
|
|
19044
|
+
e2 = e2.substring(s2.raw.length), s2.raw.slice(-1) !== "_" && (r2 = s2.raw.slice(-1)), i2 = true;
|
|
18980
19045
|
let a2 = t2.at(-1);
|
|
18981
|
-
a2?.type === "text" ? (a2.raw +=
|
|
19046
|
+
a2?.type === "text" ? (a2.raw += s2.raw, a2.text += s2.text) : t2.push(s2);
|
|
18982
19047
|
continue;
|
|
18983
19048
|
}
|
|
18984
19049
|
if (e2) {
|
|
@@ -18998,16 +19063,16 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
|
|
|
18998
19063
|
options;
|
|
18999
19064
|
parser;
|
|
19000
19065
|
constructor(e2) {
|
|
19001
|
-
this.options = e2 ||
|
|
19066
|
+
this.options = e2 || T;
|
|
19002
19067
|
}
|
|
19003
19068
|
space(e2) {
|
|
19004
19069
|
return "";
|
|
19005
19070
|
}
|
|
19006
19071
|
code({ text: e2, lang: t2, escaped: n2 }) {
|
|
19007
|
-
let
|
|
19008
|
-
|
|
19009
|
-
return
|
|
19010
|
-
` : "<pre><code>" + (n2 ? r2 :
|
|
19072
|
+
let i2 = (t2 || "").match(m$1.notSpaceStart)?.[0], r2 = e2 ? e2.replace(m$1.endingNewline, "") + `
|
|
19073
|
+
` : "";
|
|
19074
|
+
return i2 ? '<pre><code class="language-' + R(i2) + '">' + (n2 ? r2 : R(r2, true)) + `</code></pre>
|
|
19075
|
+
` : "<pre><code>" + (n2 ? r2 : R(r2, true)) + `</code></pre>
|
|
19011
19076
|
`;
|
|
19012
19077
|
}
|
|
19013
19078
|
blockquote({ tokens: e2 }) {
|
|
@@ -19030,14 +19095,14 @@ ${this.parser.parse(e2)}</blockquote>
|
|
|
19030
19095
|
`;
|
|
19031
19096
|
}
|
|
19032
19097
|
list(e2) {
|
|
19033
|
-
let t2 = e2.ordered, n2 = e2.start,
|
|
19034
|
-
for (let
|
|
19035
|
-
let u2 = e2.items[
|
|
19036
|
-
|
|
19037
|
-
}
|
|
19038
|
-
let r2 = t2 ? "ol" : "ul",
|
|
19039
|
-
return "<" + r2 +
|
|
19040
|
-
` +
|
|
19098
|
+
let t2 = e2.ordered, n2 = e2.start, i2 = "";
|
|
19099
|
+
for (let s2 = 0; s2 < e2.items.length; s2++) {
|
|
19100
|
+
let u2 = e2.items[s2];
|
|
19101
|
+
i2 += this.listitem(u2);
|
|
19102
|
+
}
|
|
19103
|
+
let r2 = t2 ? "ol" : "ul", o2 = t2 && n2 !== 1 ? ' start="' + n2 + '"' : "";
|
|
19104
|
+
return "<" + r2 + o2 + `>
|
|
19105
|
+
` + i2 + "</" + r2 + `>
|
|
19041
19106
|
`;
|
|
19042
19107
|
}
|
|
19043
19108
|
listitem(e2) {
|
|
@@ -19055,17 +19120,17 @@ ${this.parser.parse(e2)}</blockquote>
|
|
|
19055
19120
|
let t2 = "", n2 = "";
|
|
19056
19121
|
for (let r2 = 0; r2 < e2.header.length; r2++) n2 += this.tablecell(e2.header[r2]);
|
|
19057
19122
|
t2 += this.tablerow({ text: n2 });
|
|
19058
|
-
let
|
|
19123
|
+
let i2 = "";
|
|
19059
19124
|
for (let r2 = 0; r2 < e2.rows.length; r2++) {
|
|
19060
|
-
let
|
|
19125
|
+
let o2 = e2.rows[r2];
|
|
19061
19126
|
n2 = "";
|
|
19062
|
-
for (let
|
|
19063
|
-
|
|
19127
|
+
for (let s2 = 0; s2 < o2.length; s2++) n2 += this.tablecell(o2[s2]);
|
|
19128
|
+
i2 += this.tablerow({ text: n2 });
|
|
19064
19129
|
}
|
|
19065
|
-
return
|
|
19130
|
+
return i2 && (i2 = `<tbody>${i2}</tbody>`), `<table>
|
|
19066
19131
|
<thead>
|
|
19067
19132
|
` + t2 + `</thead>
|
|
19068
|
-
` +
|
|
19133
|
+
` + i2 + `</table>
|
|
19069
19134
|
`;
|
|
19070
19135
|
}
|
|
19071
19136
|
tablerow({ text: e2 }) {
|
|
@@ -19085,7 +19150,7 @@ ${e2}</tr>
|
|
|
19085
19150
|
return `<em>${this.parser.parseInline(e2)}</em>`;
|
|
19086
19151
|
}
|
|
19087
19152
|
codespan({ text: e2 }) {
|
|
19088
|
-
return `<code>${
|
|
19153
|
+
return `<code>${R(e2, true)}</code>`;
|
|
19089
19154
|
}
|
|
19090
19155
|
br(e2) {
|
|
19091
19156
|
return "<br>";
|
|
@@ -19093,23 +19158,23 @@ ${e2}</tr>
|
|
|
19093
19158
|
del({ tokens: e2 }) {
|
|
19094
19159
|
return `<del>${this.parser.parseInline(e2)}</del>`;
|
|
19095
19160
|
}
|
|
19096
|
-
link({ href: e2, title: t2,
|
|
19097
|
-
let
|
|
19098
|
-
if (
|
|
19099
|
-
e2 = r2;
|
|
19100
|
-
let
|
|
19101
|
-
return t2 && (
|
|
19102
|
-
}
|
|
19103
|
-
image({ href: e2, title: t2, text: n2, tokens:
|
|
19104
|
-
|
|
19105
|
-
let r2 =
|
|
19106
|
-
if (r2 === null) return
|
|
19161
|
+
link({ href: e2, title: t2, text: n2, tokens: i2, autolink: r2 }) {
|
|
19162
|
+
let o2 = r2 ? R(n2, true) : this.parser.parseInline(i2), s2 = ee(e2);
|
|
19163
|
+
if (s2 === null) return o2;
|
|
19164
|
+
e2 = R(s2, r2);
|
|
19165
|
+
let u2 = '<a href="' + e2 + '"';
|
|
19166
|
+
return t2 && (u2 += ' title="' + R(t2) + '"'), u2 += ">" + o2 + "</a>", u2;
|
|
19167
|
+
}
|
|
19168
|
+
image({ href: e2, title: t2, text: n2, tokens: i2 }) {
|
|
19169
|
+
i2 && (n2 = this.parser.parseInline(i2, this.parser.textRenderer));
|
|
19170
|
+
let r2 = ee(e2);
|
|
19171
|
+
if (r2 === null) return R(n2);
|
|
19107
19172
|
e2 = r2;
|
|
19108
|
-
let
|
|
19109
|
-
return t2 && (
|
|
19173
|
+
let o2 = `<img src="${R(e2)}" alt="${R(n2)}"`;
|
|
19174
|
+
return t2 && (o2 += ` title="${R(t2)}"`), o2 += ">", o2;
|
|
19110
19175
|
}
|
|
19111
19176
|
text(e2) {
|
|
19112
|
-
return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text :
|
|
19177
|
+
return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : R(e2.text);
|
|
19113
19178
|
}
|
|
19114
19179
|
};
|
|
19115
19180
|
var L = class {
|
|
@@ -19149,7 +19214,7 @@ ${e2}</tr>
|
|
|
19149
19214
|
renderer;
|
|
19150
19215
|
textRenderer;
|
|
19151
19216
|
constructor(e2) {
|
|
19152
|
-
this.options = e2 ||
|
|
19217
|
+
this.options = e2 || T, this.options.renderer = this.options.renderer || new P$1(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
|
|
19153
19218
|
}
|
|
19154
19219
|
static parse(e2, t2) {
|
|
19155
19220
|
return new l2(t2).parse(e2);
|
|
@@ -19161,15 +19226,15 @@ ${e2}</tr>
|
|
|
19161
19226
|
this.renderer.parser = this;
|
|
19162
19227
|
let t2 = "";
|
|
19163
19228
|
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
19164
|
-
let
|
|
19165
|
-
if (this.options.extensions?.renderers?.[
|
|
19166
|
-
let
|
|
19167
|
-
if (
|
|
19168
|
-
t2 +=
|
|
19229
|
+
let i2 = e2[n2];
|
|
19230
|
+
if (this.options.extensions?.renderers?.[i2.type]) {
|
|
19231
|
+
let o2 = i2, s2 = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
|
|
19232
|
+
if (s2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o2.type)) {
|
|
19233
|
+
t2 += s2 || "";
|
|
19169
19234
|
continue;
|
|
19170
19235
|
}
|
|
19171
19236
|
}
|
|
19172
|
-
let r2 =
|
|
19237
|
+
let r2 = i2;
|
|
19173
19238
|
switch (r2.type) {
|
|
19174
19239
|
case "space": {
|
|
19175
19240
|
t2 += this.renderer.space(r2);
|
|
@@ -19220,9 +19285,9 @@ ${e2}</tr>
|
|
|
19220
19285
|
break;
|
|
19221
19286
|
}
|
|
19222
19287
|
default: {
|
|
19223
|
-
let
|
|
19224
|
-
if (this.options.silent) return console.error(
|
|
19225
|
-
throw new Error(
|
|
19288
|
+
let o2 = 'Token with "' + r2.type + '" type was not found.';
|
|
19289
|
+
if (this.options.silent) return console.error(o2), "";
|
|
19290
|
+
throw new Error(o2);
|
|
19226
19291
|
}
|
|
19227
19292
|
}
|
|
19228
19293
|
}
|
|
@@ -19231,65 +19296,65 @@ ${e2}</tr>
|
|
|
19231
19296
|
parseInline(e2, t2 = this.renderer) {
|
|
19232
19297
|
this.renderer.parser = this;
|
|
19233
19298
|
let n2 = "";
|
|
19234
|
-
for (let
|
|
19235
|
-
let r2 = e2[
|
|
19299
|
+
for (let i2 = 0; i2 < e2.length; i2++) {
|
|
19300
|
+
let r2 = e2[i2];
|
|
19236
19301
|
if (this.options.extensions?.renderers?.[r2.type]) {
|
|
19237
|
-
let
|
|
19238
|
-
if (
|
|
19239
|
-
n2 +=
|
|
19302
|
+
let s2 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
|
|
19303
|
+
if (s2 !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
|
|
19304
|
+
n2 += s2 || "";
|
|
19240
19305
|
continue;
|
|
19241
19306
|
}
|
|
19242
19307
|
}
|
|
19243
|
-
let
|
|
19244
|
-
switch (
|
|
19308
|
+
let o2 = r2;
|
|
19309
|
+
switch (o2.type) {
|
|
19245
19310
|
case "escape": {
|
|
19246
|
-
n2 += t2.text(
|
|
19311
|
+
n2 += t2.text(o2);
|
|
19247
19312
|
break;
|
|
19248
19313
|
}
|
|
19249
19314
|
case "html": {
|
|
19250
|
-
n2 += t2.html(
|
|
19315
|
+
n2 += t2.html(o2);
|
|
19251
19316
|
break;
|
|
19252
19317
|
}
|
|
19253
19318
|
case "link": {
|
|
19254
|
-
n2 += t2.link(
|
|
19319
|
+
n2 += t2.link(o2);
|
|
19255
19320
|
break;
|
|
19256
19321
|
}
|
|
19257
19322
|
case "image": {
|
|
19258
|
-
n2 += t2.image(
|
|
19323
|
+
n2 += t2.image(o2);
|
|
19259
19324
|
break;
|
|
19260
19325
|
}
|
|
19261
19326
|
case "checkbox": {
|
|
19262
|
-
n2 += t2.checkbox(
|
|
19327
|
+
n2 += t2.checkbox(o2);
|
|
19263
19328
|
break;
|
|
19264
19329
|
}
|
|
19265
19330
|
case "strong": {
|
|
19266
|
-
n2 += t2.strong(
|
|
19331
|
+
n2 += t2.strong(o2);
|
|
19267
19332
|
break;
|
|
19268
19333
|
}
|
|
19269
19334
|
case "em": {
|
|
19270
|
-
n2 += t2.em(
|
|
19335
|
+
n2 += t2.em(o2);
|
|
19271
19336
|
break;
|
|
19272
19337
|
}
|
|
19273
19338
|
case "codespan": {
|
|
19274
|
-
n2 += t2.codespan(
|
|
19339
|
+
n2 += t2.codespan(o2);
|
|
19275
19340
|
break;
|
|
19276
19341
|
}
|
|
19277
19342
|
case "br": {
|
|
19278
|
-
n2 += t2.br(
|
|
19343
|
+
n2 += t2.br(o2);
|
|
19279
19344
|
break;
|
|
19280
19345
|
}
|
|
19281
19346
|
case "del": {
|
|
19282
|
-
n2 += t2.del(
|
|
19347
|
+
n2 += t2.del(o2);
|
|
19283
19348
|
break;
|
|
19284
19349
|
}
|
|
19285
19350
|
case "text": {
|
|
19286
|
-
n2 += t2.text(
|
|
19351
|
+
n2 += t2.text(o2);
|
|
19287
19352
|
break;
|
|
19288
19353
|
}
|
|
19289
19354
|
default: {
|
|
19290
|
-
let
|
|
19291
|
-
if (this.options.silent) return console.error(
|
|
19292
|
-
throw new Error(
|
|
19355
|
+
let s2 = 'Token with "' + o2.type + '" type was not found.';
|
|
19356
|
+
if (this.options.silent) return console.error(s2), "";
|
|
19357
|
+
throw new Error(s2);
|
|
19293
19358
|
}
|
|
19294
19359
|
}
|
|
19295
19360
|
}
|
|
@@ -19300,7 +19365,7 @@ ${e2}</tr>
|
|
|
19300
19365
|
options;
|
|
19301
19366
|
block;
|
|
19302
19367
|
constructor(e2) {
|
|
19303
|
-
this.options = e2 ||
|
|
19368
|
+
this.options = e2 || T;
|
|
19304
19369
|
}
|
|
19305
19370
|
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
19306
19371
|
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
@@ -19323,7 +19388,7 @@ ${e2}</tr>
|
|
|
19323
19388
|
return e2 ? b$1.parse : b$1.parseInline;
|
|
19324
19389
|
}
|
|
19325
19390
|
};
|
|
19326
|
-
var
|
|
19391
|
+
var Q = class {
|
|
19327
19392
|
defaults = A();
|
|
19328
19393
|
options = this.setOptions;
|
|
19329
19394
|
parse = this.parseMarkdown(true);
|
|
@@ -19339,23 +19404,23 @@ ${e2}</tr>
|
|
|
19339
19404
|
}
|
|
19340
19405
|
walkTokens(e2, t2) {
|
|
19341
19406
|
let n2 = [];
|
|
19342
|
-
for (let
|
|
19407
|
+
for (let i2 of e2) switch (n2 = n2.concat(t2.call(this, i2)), i2.type) {
|
|
19343
19408
|
case "table": {
|
|
19344
|
-
let r2 =
|
|
19345
|
-
for (let
|
|
19346
|
-
for (let
|
|
19409
|
+
let r2 = i2;
|
|
19410
|
+
for (let o2 of r2.header) n2 = n2.concat(this.walkTokens(o2.tokens, t2));
|
|
19411
|
+
for (let o2 of r2.rows) for (let s2 of o2) n2 = n2.concat(this.walkTokens(s2.tokens, t2));
|
|
19347
19412
|
break;
|
|
19348
19413
|
}
|
|
19349
19414
|
case "list": {
|
|
19350
|
-
let r2 =
|
|
19415
|
+
let r2 = i2;
|
|
19351
19416
|
n2 = n2.concat(this.walkTokens(r2.items, t2));
|
|
19352
19417
|
break;
|
|
19353
19418
|
}
|
|
19354
19419
|
default: {
|
|
19355
|
-
let r2 =
|
|
19356
|
-
this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((
|
|
19357
|
-
let
|
|
19358
|
-
n2 = n2.concat(this.walkTokens(
|
|
19420
|
+
let r2 = i2;
|
|
19421
|
+
this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((o2) => {
|
|
19422
|
+
let s2 = r2[o2].flat(1 / 0);
|
|
19423
|
+
n2 = n2.concat(this.walkTokens(s2, t2));
|
|
19359
19424
|
}) : r2.tokens && (n2 = n2.concat(this.walkTokens(r2.tokens, t2)));
|
|
19360
19425
|
}
|
|
19361
19426
|
}
|
|
@@ -19364,62 +19429,62 @@ ${e2}</tr>
|
|
|
19364
19429
|
use(...e2) {
|
|
19365
19430
|
let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
19366
19431
|
return e2.forEach((n2) => {
|
|
19367
|
-
let
|
|
19368
|
-
if (
|
|
19432
|
+
let i2 = { ...n2 };
|
|
19433
|
+
if (i2.async = this.defaults.async || i2.async || false, n2.extensions && (n2.extensions.forEach((r2) => {
|
|
19369
19434
|
if (!r2.name) throw new Error("extension name required");
|
|
19370
19435
|
if ("renderer" in r2) {
|
|
19371
|
-
let
|
|
19372
|
-
|
|
19373
|
-
let u2 = r2.renderer.apply(this,
|
|
19374
|
-
return u2 === false && (u2 =
|
|
19436
|
+
let o2 = t2.renderers[r2.name];
|
|
19437
|
+
o2 ? t2.renderers[r2.name] = function(...s2) {
|
|
19438
|
+
let u2 = r2.renderer.apply(this, s2);
|
|
19439
|
+
return u2 === false && (u2 = o2.apply(this, s2)), u2;
|
|
19375
19440
|
} : t2.renderers[r2.name] = r2.renderer;
|
|
19376
19441
|
}
|
|
19377
19442
|
if ("tokenizer" in r2) {
|
|
19378
19443
|
if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
19379
|
-
let
|
|
19380
|
-
|
|
19444
|
+
let o2 = t2[r2.level];
|
|
19445
|
+
o2 ? o2.unshift(r2.tokenizer) : t2[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t2.startBlock ? t2.startBlock.push(r2.start) : t2.startBlock = [r2.start] : r2.level === "inline" && (t2.startInline ? t2.startInline.push(r2.start) : t2.startInline = [r2.start]));
|
|
19381
19446
|
}
|
|
19382
19447
|
"childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
|
|
19383
|
-
}),
|
|
19448
|
+
}), i2.extensions = t2), n2.renderer) {
|
|
19384
19449
|
let r2 = this.defaults.renderer || new P$1(this.defaults);
|
|
19385
|
-
for (let
|
|
19386
|
-
if (!(
|
|
19387
|
-
if (["options", "parser"].includes(
|
|
19388
|
-
let
|
|
19389
|
-
r2[
|
|
19450
|
+
for (let o2 in n2.renderer) {
|
|
19451
|
+
if (!(o2 in r2)) throw new Error(`renderer '${o2}' does not exist`);
|
|
19452
|
+
if (["options", "parser"].includes(o2)) continue;
|
|
19453
|
+
let s2 = o2, u2 = n2.renderer[s2], a2 = r2[s2];
|
|
19454
|
+
r2[s2] = (...p2) => {
|
|
19390
19455
|
let c2 = u2.apply(r2, p2);
|
|
19391
19456
|
return c2 === false && (c2 = a2.apply(r2, p2)), c2 || "";
|
|
19392
19457
|
};
|
|
19393
19458
|
}
|
|
19394
|
-
|
|
19459
|
+
i2.renderer = r2;
|
|
19395
19460
|
}
|
|
19396
19461
|
if (n2.tokenizer) {
|
|
19397
19462
|
let r2 = this.defaults.tokenizer || new y$1(this.defaults);
|
|
19398
|
-
for (let
|
|
19399
|
-
if (!(
|
|
19400
|
-
if (["options", "rules", "lexer"].includes(
|
|
19401
|
-
let
|
|
19402
|
-
r2[
|
|
19463
|
+
for (let o2 in n2.tokenizer) {
|
|
19464
|
+
if (!(o2 in r2)) throw new Error(`tokenizer '${o2}' does not exist`);
|
|
19465
|
+
if (["options", "rules", "lexer"].includes(o2)) continue;
|
|
19466
|
+
let s2 = o2, u2 = n2.tokenizer[s2], a2 = r2[s2];
|
|
19467
|
+
r2[s2] = (...p2) => {
|
|
19403
19468
|
let c2 = u2.apply(r2, p2);
|
|
19404
19469
|
return c2 === false && (c2 = a2.apply(r2, p2)), c2;
|
|
19405
19470
|
};
|
|
19406
19471
|
}
|
|
19407
|
-
|
|
19472
|
+
i2.tokenizer = r2;
|
|
19408
19473
|
}
|
|
19409
19474
|
if (n2.hooks) {
|
|
19410
19475
|
let r2 = this.defaults.hooks || new S$1();
|
|
19411
|
-
for (let
|
|
19412
|
-
if (!(
|
|
19413
|
-
if (["options", "block"].includes(
|
|
19414
|
-
let
|
|
19415
|
-
S$1.passThroughHooks.has(
|
|
19416
|
-
if (this.defaults.async && S$1.passThroughHooksRespectAsync.has(
|
|
19476
|
+
for (let o2 in n2.hooks) {
|
|
19477
|
+
if (!(o2 in r2)) throw new Error(`hook '${o2}' does not exist`);
|
|
19478
|
+
if (["options", "block"].includes(o2)) continue;
|
|
19479
|
+
let s2 = o2, u2 = n2.hooks[s2], a2 = r2[s2];
|
|
19480
|
+
S$1.passThroughHooks.has(o2) ? r2[s2] = (p2) => {
|
|
19481
|
+
if (this.defaults.async && S$1.passThroughHooksRespectAsync.has(o2)) return (async () => {
|
|
19417
19482
|
let h2 = await u2.call(r2, p2);
|
|
19418
19483
|
return a2.call(r2, h2);
|
|
19419
19484
|
})();
|
|
19420
19485
|
let c2 = u2.call(r2, p2);
|
|
19421
19486
|
return a2.call(r2, c2);
|
|
19422
|
-
} : r2[
|
|
19487
|
+
} : r2[s2] = (...p2) => {
|
|
19423
19488
|
if (this.defaults.async) return (async () => {
|
|
19424
19489
|
let h2 = await u2.apply(r2, p2);
|
|
19425
19490
|
return h2 === false && (h2 = await a2.apply(r2, p2)), h2;
|
|
@@ -19428,16 +19493,16 @@ ${e2}</tr>
|
|
|
19428
19493
|
return c2 === false && (c2 = a2.apply(r2, p2)), c2;
|
|
19429
19494
|
};
|
|
19430
19495
|
}
|
|
19431
|
-
|
|
19496
|
+
i2.hooks = r2;
|
|
19432
19497
|
}
|
|
19433
19498
|
if (n2.walkTokens) {
|
|
19434
|
-
let r2 = this.defaults.walkTokens,
|
|
19435
|
-
|
|
19499
|
+
let r2 = this.defaults.walkTokens, o2 = n2.walkTokens;
|
|
19500
|
+
i2.walkTokens = function(s2) {
|
|
19436
19501
|
let u2 = [];
|
|
19437
|
-
return u2.push(
|
|
19502
|
+
return u2.push(o2.call(this, s2)), r2 && (u2 = u2.concat(r2.call(this, s2))), u2;
|
|
19438
19503
|
};
|
|
19439
19504
|
}
|
|
19440
|
-
this.defaults = { ...this.defaults, ...
|
|
19505
|
+
this.defaults = { ...this.defaults, ...i2 };
|
|
19441
19506
|
}), this;
|
|
19442
19507
|
}
|
|
19443
19508
|
setOptions(e2) {
|
|
@@ -19450,25 +19515,25 @@ ${e2}</tr>
|
|
|
19450
19515
|
return b$1.parse(e2, t2 ?? this.defaults);
|
|
19451
19516
|
}
|
|
19452
19517
|
parseMarkdown(e2) {
|
|
19453
|
-
return (n2,
|
|
19454
|
-
let r2 = { ...
|
|
19455
|
-
if (this.defaults.async === true && r2.async === false) return
|
|
19456
|
-
if (typeof n2 > "u" || n2 === null) return
|
|
19457
|
-
if (typeof n2 != "string") return
|
|
19458
|
-
if (
|
|
19459
|
-
let u2 =
|
|
19460
|
-
|
|
19461
|
-
let
|
|
19462
|
-
return
|
|
19463
|
-
})().catch(
|
|
19518
|
+
return (n2, i2) => {
|
|
19519
|
+
let r2 = { ...i2 }, o2 = { ...this.defaults, ...r2 }, s2 = this.onError(!!o2.silent, !!o2.async);
|
|
19520
|
+
if (this.defaults.async === true && r2.async === false) return s2(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."));
|
|
19521
|
+
if (typeof n2 > "u" || n2 === null) return s2(new Error("marked(): input parameter is undefined or null"));
|
|
19522
|
+
if (typeof n2 != "string") return s2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
|
|
19523
|
+
if (o2.hooks && (o2.hooks.options = o2, o2.hooks.block = e2), o2.async) return (async () => {
|
|
19524
|
+
let u2 = o2.hooks ? await o2.hooks.preprocess(n2) : n2, p2 = await (o2.hooks ? await o2.hooks.provideLexer(e2) : e2 ? x.lex : x.lexInline)(u2, o2), c2 = o2.hooks ? await o2.hooks.processAllTokens(p2) : p2;
|
|
19525
|
+
o2.walkTokens && await Promise.all(this.walkTokens(c2, o2.walkTokens));
|
|
19526
|
+
let k = await (o2.hooks ? await o2.hooks.provideParser(e2) : e2 ? b$1.parse : b$1.parseInline)(c2, o2);
|
|
19527
|
+
return o2.hooks ? await o2.hooks.postprocess(k) : k;
|
|
19528
|
+
})().catch(s2);
|
|
19464
19529
|
try {
|
|
19465
|
-
|
|
19466
|
-
let a2 = (
|
|
19467
|
-
|
|
19468
|
-
let c2 = (
|
|
19469
|
-
return
|
|
19530
|
+
o2.hooks && (n2 = o2.hooks.preprocess(n2));
|
|
19531
|
+
let a2 = (o2.hooks ? o2.hooks.provideLexer(e2) : e2 ? x.lex : x.lexInline)(n2, o2);
|
|
19532
|
+
o2.hooks && (a2 = o2.hooks.processAllTokens(a2)), o2.walkTokens && this.walkTokens(a2, o2.walkTokens);
|
|
19533
|
+
let c2 = (o2.hooks ? o2.hooks.provideParser(e2) : e2 ? b$1.parse : b$1.parseInline)(a2, o2);
|
|
19534
|
+
return o2.hooks && (c2 = o2.hooks.postprocess(c2)), c2;
|
|
19470
19535
|
} catch (u2) {
|
|
19471
|
-
return
|
|
19536
|
+
return s2(u2);
|
|
19472
19537
|
}
|
|
19473
19538
|
};
|
|
19474
19539
|
}
|
|
@@ -19476,27 +19541,27 @@ ${e2}</tr>
|
|
|
19476
19541
|
return (n2) => {
|
|
19477
19542
|
if (n2.message += `
|
|
19478
19543
|
Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
19479
|
-
let
|
|
19480
|
-
return t2 ? Promise.resolve(
|
|
19544
|
+
let i2 = "<p>An error occurred:</p><pre>" + R(n2.message + "", true) + "</pre>";
|
|
19545
|
+
return t2 ? Promise.resolve(i2) : i2;
|
|
19481
19546
|
}
|
|
19482
19547
|
if (t2) return Promise.reject(n2);
|
|
19483
19548
|
throw n2;
|
|
19484
19549
|
};
|
|
19485
19550
|
}
|
|
19486
19551
|
};
|
|
19487
|
-
var M = new
|
|
19552
|
+
var M = new Q();
|
|
19488
19553
|
function f$1(l2, e2) {
|
|
19489
19554
|
return M.parse(l2, e2);
|
|
19490
19555
|
}
|
|
19491
19556
|
f$1.options = f$1.setOptions = function(l2) {
|
|
19492
|
-
return M.setOptions(l2), f$1.defaults = M.defaults,
|
|
19557
|
+
return M.setOptions(l2), f$1.defaults = M.defaults, U(f$1.defaults), f$1;
|
|
19493
19558
|
};
|
|
19494
19559
|
f$1.getDefaults = A;
|
|
19495
|
-
f$1.defaults =
|
|
19496
|
-
function
|
|
19497
|
-
return M.use(...l2), f$1.defaults = M.defaults,
|
|
19560
|
+
f$1.defaults = T;
|
|
19561
|
+
function bt(...l2) {
|
|
19562
|
+
return M.use(...l2), f$1.defaults = M.defaults, U(f$1.defaults), f$1;
|
|
19498
19563
|
}
|
|
19499
|
-
f$1.use =
|
|
19564
|
+
f$1.use = bt;
|
|
19500
19565
|
f$1.walkTokens = function(l2, e2) {
|
|
19501
19566
|
return M.walkTokens(l2, e2);
|
|
19502
19567
|
};
|
|
@@ -19847,7 +19912,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
19847
19912
|
function createDOMPurify() {
|
|
19848
19913
|
let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
|
19849
19914
|
const DOMPurify = (root2) => createDOMPurify(root2);
|
|
19850
|
-
DOMPurify.version = "3.4.
|
|
19915
|
+
DOMPurify.version = "3.4.15";
|
|
19851
19916
|
DOMPurify.removed = [];
|
|
19852
19917
|
if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
|
|
19853
19918
|
DOMPurify.isSupported = false;
|
|
@@ -19864,6 +19929,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
19864
19929
|
const ElementPrototype = Element2.prototype;
|
|
19865
19930
|
const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
|
|
19866
19931
|
const remove2 = lookupGetter(ElementPrototype, "remove");
|
|
19932
|
+
const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
|
|
19867
19933
|
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
|
|
19868
19934
|
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
|
19869
19935
|
const getParentNode2 = lookupGetter(ElementPrototype, "parentNode");
|
|
@@ -20297,7 +20363,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20297
20363
|
};
|
|
20298
20364
|
const _stripAttributeNode = function _stripAttributeNode2(element, attribute, name) {
|
|
20299
20365
|
try {
|
|
20300
|
-
|
|
20366
|
+
removeAttributeNode(element, attribute);
|
|
20301
20367
|
} catch (_2) {
|
|
20302
20368
|
try {
|
|
20303
20369
|
element.removeAttribute(name);
|
|
@@ -20345,7 +20411,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20345
20411
|
});
|
|
20346
20412
|
try {
|
|
20347
20413
|
if (attr) {
|
|
20348
|
-
|
|
20414
|
+
removeAttributeNode(element, attr);
|
|
20349
20415
|
} else {
|
|
20350
20416
|
element.removeAttribute(name);
|
|
20351
20417
|
}
|
|
@@ -20533,7 +20599,16 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20533
20599
|
// makes the direct read diverge from the cached read; a clean form
|
|
20534
20600
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
20535
20601
|
// canonical NamedNodeMap.
|
|
20536
|
-
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" ||
|
|
20602
|
+
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || // A form descendant named "removeAttributeNode" or "getAttributeNode"
|
|
20603
|
+
// shadows these Attr-node methods via [LegacyOverrideBuiltIns].
|
|
20604
|
+
// _removeAttribute() / _stripAttributeNode() reach for
|
|
20605
|
+
// element.removeAttributeNode(attr) first; when it is shadowed the call
|
|
20606
|
+
// throws and the name-based fallback element.removeAttribute(name)
|
|
20607
|
+
// ASCII-lowercases its lookup key in an HTML document, silently missing
|
|
20608
|
+
// a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
|
|
20609
|
+
// that reached the sanitizer through an XML/XHTML parse). Flag the form
|
|
20610
|
+
// so it is removed wholesale, exactly as for the other shadowed methods.
|
|
20611
|
+
typeof element.removeAttributeNode !== "function" || typeof element.getAttributeNode !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
20537
20612
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
20538
20613
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
20539
20614
|
// the named child element. Cheap addition — nodeType is read from
|
|
@@ -20759,11 +20834,12 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20759
20834
|
}
|
|
20760
20835
|
if (_isClobbered(currentNode)) {
|
|
20761
20836
|
_forceRemove(currentNode);
|
|
20762
|
-
|
|
20763
|
-
arrayPop(DOMPurify.removed);
|
|
20837
|
+
return false;
|
|
20764
20838
|
}
|
|
20839
|
+
return true;
|
|
20765
20840
|
} catch (_2) {
|
|
20766
20841
|
_removeAttribute(name, currentNode);
|
|
20842
|
+
return false;
|
|
20767
20843
|
}
|
|
20768
20844
|
};
|
|
20769
20845
|
const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
|
|
@@ -20788,6 +20864,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20788
20864
|
const lcName = transformCaseFunc(name);
|
|
20789
20865
|
const initValue = attrValue;
|
|
20790
20866
|
let value = name === "value" ? initValue : stringTrim(initValue);
|
|
20867
|
+
let recreatedNamedProp = false;
|
|
20791
20868
|
hookEvent.attrName = lcName;
|
|
20792
20869
|
hookEvent.attrValue = value;
|
|
20793
20870
|
hookEvent.keepAttr = true;
|
|
@@ -20797,6 +20874,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20797
20874
|
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
|
|
20798
20875
|
_removeAttribute(name, currentNode, attr);
|
|
20799
20876
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
20877
|
+
recreatedNamedProp = true;
|
|
20800
20878
|
}
|
|
20801
20879
|
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
|
|
20802
20880
|
_removeAttribute(name, currentNode, attr);
|
|
@@ -20826,7 +20904,10 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20826
20904
|
}
|
|
20827
20905
|
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
20828
20906
|
if (value !== initValue) {
|
|
20829
|
-
_setAttributeValue(currentNode, name, namespaceURI, value);
|
|
20907
|
+
const cleanWrite = _setAttributeValue(currentNode, name, namespaceURI, value);
|
|
20908
|
+
if (cleanWrite && recreatedNamedProp) {
|
|
20909
|
+
arrayPop(DOMPurify.removed);
|
|
20910
|
+
}
|
|
20830
20911
|
}
|
|
20831
20912
|
}
|
|
20832
20913
|
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
@@ -20964,7 +21045,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
20964
21045
|
} else {
|
|
20965
21046
|
body.appendChild(importedNode);
|
|
20966
21047
|
}
|
|
20967
|
-
_sanitizeAttachedShadowRoots(
|
|
21048
|
+
_sanitizeAttachedShadowRoots(body);
|
|
20968
21049
|
} else {
|
|
20969
21050
|
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
|
|
20970
21051
|
dirty.indexOf("<") === -1) {
|
|
@@ -21775,7 +21856,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
21775
21856
|
const _hoisted_3$h = { class: "document-article__toolbar-left" };
|
|
21776
21857
|
const _hoisted_4$a = { class: "document-article__toolbar-center" };
|
|
21777
21858
|
const _hoisted_5$9 = { class: "document-article__toolbar-right" };
|
|
21778
|
-
const _hoisted_6$
|
|
21859
|
+
const _hoisted_6$9 = { class: "document-article__body" };
|
|
21779
21860
|
const _hoisted_7$4 = {
|
|
21780
21861
|
key: 0,
|
|
21781
21862
|
class: "document-article__center document-article__center--processing",
|
|
@@ -21829,7 +21910,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
21829
21910
|
renderSlot(_ctx.$slots, "toolbar-right", {}, void 0, true)
|
|
21830
21911
|
])
|
|
21831
21912
|
])) : createCommentVNode("", true),
|
|
21832
|
-
createBaseVNode("div", _hoisted_6$
|
|
21913
|
+
createBaseVNode("div", _hoisted_6$9, [
|
|
21833
21914
|
props.status === "processing" ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
|
|
21834
21915
|
createVNode(EditorIcon, {
|
|
21835
21916
|
name: "spinner",
|
|
@@ -22125,7 +22206,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
22125
22206
|
class: "document-meta"
|
|
22126
22207
|
};
|
|
22127
22208
|
const _hoisted_5$8 = { class: "header-right" };
|
|
22128
|
-
const _hoisted_6$
|
|
22209
|
+
const _hoisted_6$8 = { key: 0 };
|
|
22129
22210
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
22130
22211
|
__name: "Header",
|
|
22131
22212
|
props: {
|
|
@@ -22187,34 +22268,36 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
22187
22268
|
]),
|
|
22188
22269
|
_: 1
|
|
22189
22270
|
}, 8, ["aria-label"])) : createCommentVNode("", true),
|
|
22190
|
-
|
|
22191
|
-
|
|
22192
|
-
|
|
22193
|
-
|
|
22194
|
-
|
|
22195
|
-
|
|
22196
|
-
|
|
22197
|
-
|
|
22198
|
-
|
|
22199
|
-
|
|
22200
|
-
|
|
22201
|
-
|
|
22202
|
-
|
|
22203
|
-
|
|
22204
|
-
|
|
22205
|
-
|
|
22206
|
-
|
|
22207
|
-
|
|
22208
|
-
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22271
|
+
props.canUndo || props.canRedo ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
22272
|
+
createVNode(unref(Button), {
|
|
22273
|
+
variant: "secondary",
|
|
22274
|
+
"aria-label": unref(t2)("header.undo"),
|
|
22275
|
+
disabled: !props.canUndo,
|
|
22276
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
|
|
22277
|
+
}, {
|
|
22278
|
+
icon: withCtx(() => [
|
|
22279
|
+
createVNode(unref(EditorIcon), {
|
|
22280
|
+
name: "undo",
|
|
22281
|
+
size: 16
|
|
22282
|
+
})
|
|
22283
|
+
]),
|
|
22284
|
+
_: 1
|
|
22285
|
+
}, 8, ["aria-label", "disabled"]),
|
|
22286
|
+
createVNode(unref(Button), {
|
|
22287
|
+
variant: "secondary",
|
|
22288
|
+
"aria-label": unref(t2)("header.redo"),
|
|
22289
|
+
disabled: !props.canRedo,
|
|
22290
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
|
|
22291
|
+
}, {
|
|
22292
|
+
icon: withCtx(() => [
|
|
22293
|
+
createVNode(unref(EditorIcon), {
|
|
22294
|
+
name: "redo",
|
|
22295
|
+
size: 16
|
|
22296
|
+
})
|
|
22297
|
+
]),
|
|
22298
|
+
_: 1
|
|
22299
|
+
}, 8, ["aria-label", "disabled"])
|
|
22300
|
+
], 64)) : createCommentVNode("", true),
|
|
22218
22301
|
createVNode(unref(Button), {
|
|
22219
22302
|
variant: "primary",
|
|
22220
22303
|
"aria-label": unref(t2)("header.ask"),
|
|
@@ -22228,7 +22311,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
22228
22311
|
})
|
|
22229
22312
|
]),
|
|
22230
22313
|
default: withCtx(() => [
|
|
22231
|
-
!__props.isMobile ? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
22314
|
+
!__props.isMobile ? (openBlock(), createElementBlock("span", _hoisted_6$8, toDisplayString(unref(t2)("header.ask")), 1)) : createCommentVNode("", true)
|
|
22232
22315
|
]),
|
|
22233
22316
|
_: 1
|
|
22234
22317
|
}, 8, ["aria-label", "disabled"])
|
|
@@ -22237,8 +22320,8 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
|
22237
22320
|
};
|
|
22238
22321
|
}
|
|
22239
22322
|
});
|
|
22240
|
-
const _style_0$p = '\n.editor-header[data-v-
|
|
22241
|
-
const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-
|
|
22323
|
+
const _style_0$p = '\n.editor-header[data-v-491cf8ab] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--spacing-md);\n padding: var(--spacing-sm) var(--spacing-lg);\n min-height: var(--header-height);\n border-bottom: 1px solid var(--color-border);\n background-color: var(--color-surface);\n flex-shrink: 0;\n}\n.header-main[data-v-491cf8ab] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1;\n}\n.document-title[data-v-491cf8ab] {\n font-size: var(--font-size-lg);\n font-weight: 600;\n color: var(--color-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n}\n.document-meta[data-v-491cf8ab] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--spacing-xs);\n font-size: var(--font-size-xs);\n color: var(--color-text-muted);\n}\n.document-meta__part[data-v-491cf8ab] {\n text-box: cap alphabetic;\n}\n.document-meta__part + .document-meta__part[data-v-491cf8ab]::before {\n content: "·";\n margin-right: var(--spacing-xs);\n}\n.header-right[data-v-491cf8ab] {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n flex-shrink: 0;\n}\n@media (max-width: 767px) {\n.editor-header[data-v-491cf8ab] {\n padding: var(--spacing-xs) var(--spacing-md);\n}\n.document-title[data-v-491cf8ab] {\n font-size: var(--font-size-base);\n}\n}\n';
|
|
22324
|
+
const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-491cf8ab"]]);
|
|
22242
22325
|
const TRANSCRIPTION_TAB = "__transcription__";
|
|
22243
22326
|
const VERBATIM_TAB = "__verbatim__";
|
|
22244
22327
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
@@ -23555,6 +23638,9 @@ ${text2}` : text2;
|
|
|
23555
23638
|
if (playing) isFollowing.value = true;
|
|
23556
23639
|
}
|
|
23557
23640
|
);
|
|
23641
|
+
const stopSeekListener = core.on("audio:seek", () => {
|
|
23642
|
+
isFollowing.value = true;
|
|
23643
|
+
});
|
|
23558
23644
|
function onManualScroll() {
|
|
23559
23645
|
isFollowing.value = false;
|
|
23560
23646
|
}
|
|
@@ -23568,7 +23654,6 @@ ${text2}` : text2;
|
|
|
23568
23654
|
if (!el) return;
|
|
23569
23655
|
el.addEventListener("wheel", handler, { passive: true });
|
|
23570
23656
|
el.addEventListener("touchstart", handler, { passive: true });
|
|
23571
|
-
el.addEventListener("pointerdown", handler, { passive: true });
|
|
23572
23657
|
el.addEventListener("keydown", checkKeyDownIsScroll);
|
|
23573
23658
|
}
|
|
23574
23659
|
function downScrollListener(handler) {
|
|
@@ -23576,7 +23661,6 @@ ${text2}` : text2;
|
|
|
23576
23661
|
if (!el) return;
|
|
23577
23662
|
el.removeEventListener("wheel", handler);
|
|
23578
23663
|
el.removeEventListener("touchstart", handler);
|
|
23579
|
-
el.removeEventListener("pointerdown", handler);
|
|
23580
23664
|
el.removeEventListener("keydown", checkKeyDownIsScroll);
|
|
23581
23665
|
}
|
|
23582
23666
|
onMounted(() => {
|
|
@@ -23584,6 +23668,7 @@ ${text2}` : text2;
|
|
|
23584
23668
|
});
|
|
23585
23669
|
onBeforeUnmount(() => {
|
|
23586
23670
|
downScrollListener(onManualScroll);
|
|
23671
|
+
stopSeekListener();
|
|
23587
23672
|
});
|
|
23588
23673
|
function resumeFollow() {
|
|
23589
23674
|
isFollowing.value = true;
|
|
@@ -23606,6 +23691,10 @@ ${text2}` : text2;
|
|
|
23606
23691
|
key: 1,
|
|
23607
23692
|
class: "history-start"
|
|
23608
23693
|
};
|
|
23694
|
+
const _hoisted_6$7 = {
|
|
23695
|
+
key: 0,
|
|
23696
|
+
class: "resume-scroll-anchor"
|
|
23697
|
+
};
|
|
23609
23698
|
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
23610
23699
|
__name: "TranscriptionPanel",
|
|
23611
23700
|
props: {
|
|
@@ -23741,19 +23830,20 @@ ${text2}` : text2;
|
|
|
23741
23830
|
]),
|
|
23742
23831
|
createVNode(Transition, { name: "fade-slide" }, {
|
|
23743
23832
|
default: withCtx(() => [
|
|
23744
|
-
showResumeButton.value ? (openBlock(),
|
|
23745
|
-
|
|
23746
|
-
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
|
|
23750
|
-
|
|
23751
|
-
|
|
23752
|
-
|
|
23753
|
-
|
|
23754
|
-
|
|
23755
|
-
|
|
23756
|
-
|
|
23833
|
+
showResumeButton.value ? (openBlock(), createElementBlock("div", _hoisted_6$7, [
|
|
23834
|
+
createVNode(unref(Button), {
|
|
23835
|
+
size: "sm",
|
|
23836
|
+
icon: "arrow-down",
|
|
23837
|
+
class: "resume-scroll-btn",
|
|
23838
|
+
"aria-label": unref(t2)("transcription.resumeScroll"),
|
|
23839
|
+
onClick: onResumeClick
|
|
23840
|
+
}, {
|
|
23841
|
+
default: withCtx(() => [
|
|
23842
|
+
createTextVNode(toDisplayString(unref(t2)("transcription.resumeScroll")), 1)
|
|
23843
|
+
]),
|
|
23844
|
+
_: 1
|
|
23845
|
+
}, 8, ["aria-label"])
|
|
23846
|
+
])) : createCommentVNode("", true)
|
|
23757
23847
|
]),
|
|
23758
23848
|
_: 1
|
|
23759
23849
|
})
|
|
@@ -23762,8 +23852,8 @@ ${text2}` : text2;
|
|
|
23762
23852
|
};
|
|
23763
23853
|
}
|
|
23764
23854
|
});
|
|
23765
|
-
const _style_0$j = "\n.transcription-panel[data-v-
|
|
23766
|
-
const TranscriptionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["styles", [_style_0$j]], ["__scopeId", "data-v-
|
|
23855
|
+
const _style_0$j = "\n.transcription-panel[data-v-66b767d7] {\n min-height: 0;\n overflow: hidden;\n background-color: var(--color-surface);\n}\n.scroll-container[data-v-66b767d7] {\n height: 100%;\n overflow: auto;\n position: relative;\n}\n.turns-container[data-v-66b767d7] {\n max-width: 80ch;\n margin-inline: auto;\n padding: var(--spacing-lg);\n}\n.turns-container[data-v-66b767d7]:has(.transcription-empty) {\n display: flex;\n flex-direction: column;\n min-height: 100%;\n}\n.history-loading[data-v-66b767d7] {\n text-align: center;\n padding: var(--spacing-md);\n}\n.history-loading progress[data-v-66b767d7] {\n width: 120px;\n}\n.history-start[data-v-66b767d7] {\n text-align: center;\n padding: var(--spacing-md);\n color: var(--color-text-muted);\n font-size: var(--font-size-sm);\n}\n\n/* Resume scroll button — placement lives on this wrapper, never on the\n button itself: Button.vue's `.editor-btn` base rule resets `position` via\n `all: unset` (and, in the webcomponent build, gets re-injected a second\n time after everything else to reach teleported popovers/dialogs — see\n packages/webcomponent/src/index.ts), so any positioning put directly on\n the button is one rebuild away from being silently overridden again. */\n.resume-scroll-anchor[data-v-66b767d7] {\n position: sticky;\n bottom: var(--spacing-lg);\n z-index: var(--z-sticky);\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.resume-scroll-btn[data-v-66b767d7] {\n /* No backdrop-filter: this button is sticky inside the tall scroll\n container, where a backdrop-filter makes WebRender allocate a render\n target spanning the whole scroll height — multi-GB on a long transcript. */\n background: white !important;\n border: 1px solid var(--color-border);\n box-shadow: var(--shadow-sm);\n}\n\n/* Transition */\n.fade-slide-enter-active[data-v-66b767d7],\n.fade-slide-leave-active[data-v-66b767d7] {\n transition:\n opacity 200ms ease,\n translate 200ms ease;\n}\n.fade-slide-enter-from[data-v-66b767d7],\n.fade-slide-leave-to[data-v-66b767d7] {\n opacity: 0;\n translate: 0 8px;\n}\n@media (prefers-reduced-motion: reduce) {\n.fade-slide-enter-active[data-v-66b767d7],\n .fade-slide-leave-active[data-v-66b767d7] {\n transition: none;\n}\n}\n@media (max-width: 767px) {\n.turns-container[data-v-66b767d7] {\n padding: var(--spacing-md);\n}\n}\n";
|
|
23856
|
+
const TranscriptionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["styles", [_style_0$j]], ["__scopeId", "data-v-66b767d7"]]);
|
|
23767
23857
|
const _hoisted_1$i = { class: "verbatim-panel" };
|
|
23768
23858
|
const _hoisted_2$f = { class: "verbatim-panel__content" };
|
|
23769
23859
|
const _hoisted_3$c = { class: "verbatim-panel__header" };
|
|
@@ -25801,7 +25891,7 @@ section.turn:has([data-state="open"]) {
|
|
|
25801
25891
|
i2 && (i2(), i2 = void 0), s2.forEach(((t3) => t3()));
|
|
25802
25892
|
};
|
|
25803
25893
|
}
|
|
25804
|
-
class
|
|
25894
|
+
let d$1 = class d extends e$1 {
|
|
25805
25895
|
get isPlayingSignal() {
|
|
25806
25896
|
return this._isPlaying;
|
|
25807
25897
|
}
|
|
@@ -25932,8 +26022,8 @@ section.turn:has([data-state="open"]) {
|
|
|
25932
26022
|
setSinkId(t2) {
|
|
25933
26023
|
return this.media.setSinkId(t2);
|
|
25934
26024
|
}
|
|
25935
|
-
}
|
|
25936
|
-
function
|
|
26025
|
+
};
|
|
26026
|
+
function u({ maxTop: t2, maxBottom: e2, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
|
|
25937
26027
|
let o2 = Math.round(t2 * i2 * n2);
|
|
25938
26028
|
let a2 = o2 + Math.round(e2 * i2 * n2) || 1;
|
|
25939
26029
|
return a2 < s2 && (a2 = s2, r2 || (o2 = a2 / 2)), { topHeight: o2, totalHeight: a2 };
|
|
@@ -26026,16 +26116,16 @@ section.turn:has([data-state="open"]) {
|
|
|
26026
26116
|
if (o2.has(e3.pointerId)) return;
|
|
26027
26117
|
if (o2.set(e3.pointerId, e3), o2.size > 1) return;
|
|
26028
26118
|
const l2 = e3.pointerId;
|
|
26029
|
-
let c3 = e3.clientX,
|
|
26119
|
+
let c3 = e3.clientX, d2 = e3.clientY, u2 = false;
|
|
26030
26120
|
const p2 = Date.now(), m2 = t3.getBoundingClientRect(), { left: g2, top: f2 } = m2, v2 = (t4) => {
|
|
26031
26121
|
if (t4.pointerId !== l2) return;
|
|
26032
26122
|
if (t4.defaultPrevented || o2.size > 1) return;
|
|
26033
26123
|
if (a2 && Date.now() - p2 < s2) return;
|
|
26034
|
-
const e4 = t4.clientX, n3 = t4.clientY, h3 = e4 - c3, m3 = n3 -
|
|
26035
|
-
(
|
|
26124
|
+
const e4 = t4.clientX, n3 = t4.clientY, h3 = e4 - c3, m3 = n3 - d2;
|
|
26125
|
+
(u2 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), u2 || (r2.set({ type: "start", x: c3 - g2, y: d2 - f2 }), u2 = true), r2.set({ type: "move", x: e4 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e4, d2 = n3);
|
|
26036
26126
|
}, b2 = (t4) => {
|
|
26037
26127
|
if (o2.delete(t4.pointerId)) {
|
|
26038
|
-
if (t4.pointerId === l2 &&
|
|
26128
|
+
if (t4.pointerId === l2 && u2) {
|
|
26039
26129
|
const e4 = t4.clientX, i3 = t4.clientY;
|
|
26040
26130
|
r2.set({ type: "end", x: e4 - g2, y: i3 - f2 });
|
|
26041
26131
|
}
|
|
@@ -26044,9 +26134,9 @@ section.turn:has([data-state="open"]) {
|
|
|
26044
26134
|
}, y2 = (t4) => {
|
|
26045
26135
|
t4.relatedTarget && t4.relatedTarget !== document.documentElement || b2(t4);
|
|
26046
26136
|
}, C2 = (t4) => {
|
|
26047
|
-
|
|
26137
|
+
u2 && (t4.stopPropagation(), t4.preventDefault());
|
|
26048
26138
|
}, S2 = (t4) => {
|
|
26049
|
-
t4.defaultPrevented || o2.size > 1 ||
|
|
26139
|
+
t4.defaultPrevented || o2.size > 1 || u2 && t4.preventDefault();
|
|
26050
26140
|
};
|
|
26051
26141
|
document.addEventListener("pointermove", v2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", y2), document.addEventListener("pointercancel", y2), document.addEventListener("touchmove", S2, { passive: false }), document.addEventListener("click", C2, { capture: true }), h2 = () => {
|
|
26052
26142
|
document.removeEventListener("pointermove", v2), document.removeEventListener("pointerup", b2), document.removeEventListener("pointerout", y2), document.removeEventListener("pointercancel", y2), document.removeEventListener("touchmove", S2), setTimeout((() => {
|
|
@@ -26219,23 +26309,23 @@ section.turn:has([data-state="open"]) {
|
|
|
26219
26309
|
var t2;
|
|
26220
26310
|
}
|
|
26221
26311
|
renderBarWaveform(t2, e2, i2, n2) {
|
|
26222
|
-
const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l2, barIndexScale: h2, barSpacing: c2, barMinHeight:
|
|
26312
|
+
const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l2, barIndexScale: h2, barSpacing: c2, barMinHeight: d2 } = (function({ width: t3, height: e3, length: i3, options: n3, pixelRatio: s3 }) {
|
|
26223
26313
|
const r3 = e3 / 2, o3 = n3.barWidth ? n3.barWidth * s3 : 1, a3 = n3.barGap ? n3.barGap * s3 : n3.barWidth ? o3 / 2 : 0, l3 = o3 + a3 || 1;
|
|
26224
26314
|
return { halfHeight: r3, barWidth: o3, barGap: a3, barRadius: n3.barRadius || 0, barMinHeight: n3.barMinHeight ? n3.barMinHeight * s3 : 0, barIndexScale: i3 > 0 ? t3 / l3 / i3 : 0, barSpacing: l3 };
|
|
26225
26315
|
})({ width: s2, height: r2, length: (t2[0] || []).length, options: e2, pixelRatio: this.getPixelRatio() }), m2 = (function({ channelData: t3, barIndexScale: e3, barSpacing: i3, barWidth: n3, halfHeight: s3, vScale: r3, canvasHeight: o3, barAlign: a3, barMinHeight: l3 }) {
|
|
26226
|
-
const h3 = t3[0] || [], c3 = t3[1] || h3,
|
|
26316
|
+
const h3 = t3[0] || [], c3 = t3[1] || h3, d3 = h3.length, m3 = [];
|
|
26227
26317
|
let g2 = 0, f2 = 0, v2 = 0;
|
|
26228
|
-
for (let t4 = 0; t4 <=
|
|
26229
|
-
const
|
|
26230
|
-
if (
|
|
26231
|
-
const { topHeight: t5, totalHeight: e4 } =
|
|
26232
|
-
m3.push({ x: g2 * i3, y: h4, width: n3, height: e4 }), g2 =
|
|
26318
|
+
for (let t4 = 0; t4 <= d3; t4++) {
|
|
26319
|
+
const d4 = Math.round(t4 * e3);
|
|
26320
|
+
if (d4 > g2) {
|
|
26321
|
+
const { topHeight: t5, totalHeight: e4 } = u({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l3, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e4, canvasHeight: o3 });
|
|
26322
|
+
m3.push({ x: g2 * i3, y: h4, width: n3, height: e4 }), g2 = d4, f2 = 0, v2 = 0;
|
|
26233
26323
|
}
|
|
26234
26324
|
const b2 = Math.abs(h3[t4] || 0), y2 = Math.abs(c3[t4] || 0);
|
|
26235
26325
|
b2 > f2 && (f2 = b2), y2 > v2 && (v2 = y2);
|
|
26236
26326
|
}
|
|
26237
26327
|
return m3;
|
|
26238
|
-
})({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e2.barAlign, barMinHeight:
|
|
26328
|
+
})({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e2.barAlign, barMinHeight: d2 });
|
|
26239
26329
|
i2.beginPath();
|
|
26240
26330
|
for (const t3 of m2) l2 && "roundRect" in i2 ? i2.roundRect(t3.x, t3.y, t3.width, t3.height, l2) : i2.rect(t3.x, t3.y, t3.width, t3.height);
|
|
26241
26331
|
i2.fill(), i2.closePath();
|
|
@@ -26245,15 +26335,15 @@ section.turn:has([data-state="open"]) {
|
|
|
26245
26335
|
const s3 = i3 / 2, r3 = t3[0] || [];
|
|
26246
26336
|
return [r3, t3[1] || r3].map(((t4, i4) => {
|
|
26247
26337
|
const r4 = t4.length, o3 = r4 ? e3 / r4 : 0, a2 = s3, l2 = 0 === i4 ? -1 : 1, h2 = [{ x: 0, y: a2 }];
|
|
26248
|
-
let c2 = 0,
|
|
26338
|
+
let c2 = 0, d2 = 0;
|
|
26249
26339
|
for (let e4 = 0; e4 <= r4; e4++) {
|
|
26250
26340
|
const i5 = Math.round(e4 * o3);
|
|
26251
26341
|
if (i5 > c2) {
|
|
26252
|
-
const t5 = a2 + (Math.round(
|
|
26253
|
-
h2.push({ x: c2, y: t5 }), c2 = i5,
|
|
26342
|
+
const t5 = a2 + (Math.round(d2 * s3 * n3) || 1) * l2;
|
|
26343
|
+
h2.push({ x: c2, y: t5 }), c2 = i5, d2 = 0;
|
|
26254
26344
|
}
|
|
26255
26345
|
const r5 = Math.abs(t4[e4] || 0);
|
|
26256
|
-
r5 >
|
|
26346
|
+
r5 > d2 && (d2 = r5);
|
|
26257
26347
|
}
|
|
26258
26348
|
return h2.push({ x: c2, y: a2 }), h2;
|
|
26259
26349
|
}));
|
|
@@ -26300,29 +26390,29 @@ section.turn:has([data-state="open"]) {
|
|
|
26300
26390
|
})({ clientWidth: a2, totalWidth: l2, options: e2 });
|
|
26301
26391
|
let c2 = {};
|
|
26302
26392
|
if (0 === h2) return;
|
|
26303
|
-
const
|
|
26304
|
-
if (i3 < 0 || i3 >=
|
|
26393
|
+
const d2 = (i3) => {
|
|
26394
|
+
if (i3 < 0 || i3 >= u2) return;
|
|
26305
26395
|
if (c2[i3]) return;
|
|
26306
26396
|
c2[i3] = true;
|
|
26307
26397
|
const o3 = i3 * h2;
|
|
26308
26398
|
let a3 = Math.min(l2 - o3, h2);
|
|
26309
26399
|
if (a3 = f(a3, e2), a3 <= 0) return;
|
|
26310
|
-
const
|
|
26400
|
+
const d3 = (function({ channelData: t3, offset: e3, clampedWidth: i4, totalWidth: n3 }) {
|
|
26311
26401
|
return t3.map(((t4) => {
|
|
26312
26402
|
const s3 = Math.floor(e3 / n3 * t4.length), r3 = Math.floor((e3 + i4) / n3 * t4.length);
|
|
26313
26403
|
return t4.slice(s3, r3);
|
|
26314
26404
|
}));
|
|
26315
26405
|
})({ channelData: t2, offset: o3, clampedWidth: a3, totalWidth: l2 });
|
|
26316
|
-
this.renderSingleCanvas(
|
|
26317
|
-
},
|
|
26406
|
+
this.renderSingleCanvas(d3, e2, a3, n2, o3, s2, r2);
|
|
26407
|
+
}, u2 = Math.ceil(l2 / h2);
|
|
26318
26408
|
if (!this.isScrollable) {
|
|
26319
|
-
for (let t3 = 0; t3 <
|
|
26409
|
+
for (let t3 = 0; t3 < u2; t3++) d2(t3);
|
|
26320
26410
|
return;
|
|
26321
26411
|
}
|
|
26322
|
-
if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l2, numCanvases:
|
|
26412
|
+
if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l2, numCanvases: u2 }).forEach(((t3) => d2(t3))), u2 > 1) {
|
|
26323
26413
|
const t3 = this.on("scroll", (() => {
|
|
26324
26414
|
const { scrollLeft: t4 } = this.scrollContainer;
|
|
26325
|
-
Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l2, numCanvases:
|
|
26415
|
+
Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l2, numCanvases: u2 }).forEach(((t5) => d2(t5)));
|
|
26326
26416
|
}));
|
|
26327
26417
|
this.unsubscribeOnScroll.push(t3);
|
|
26328
26418
|
}
|
|
@@ -26585,7 +26675,7 @@ section.turn:has([data-state="open"]) {
|
|
|
26585
26675
|
}
|
|
26586
26676
|
}
|
|
26587
26677
|
const P = { waveColor: "#999", progressColor: "#555", cursorWidth: 1, minPxPerSec: 0, fillParent: true, interact: true, dragToSeek: false, autoScroll: true, autoCenter: true, sampleRate: 8e3 };
|
|
26588
|
-
class w extends
|
|
26678
|
+
class w extends d$1 {
|
|
26589
26679
|
static create(t2) {
|
|
26590
26680
|
return new w(t2);
|
|
26591
26681
|
}
|
|
@@ -26597,19 +26687,19 @@ section.turn:has([data-state="open"]) {
|
|
|
26597
26687
|
}
|
|
26598
26688
|
constructor(t2) {
|
|
26599
26689
|
const e2 = t2.media || ("WebAudio" === t2.backend ? new E() : void 0);
|
|
26600
|
-
super({ media: e2, mediaControls: t2.mediaControls, autoplay: t2.autoplay, playbackRate: t2.audioRate }), this.plugins = [], this.decodedData = null, this.stopAtPosition = null, this.subscriptions = [], this.mediaSubscriptions = [], this.abortController = null, this._isDestroyed = false, this._loadVersion = 0, this.
|
|
26690
|
+
super({ media: e2, mediaControls: t2.mediaControls, autoplay: t2.autoplay, playbackRate: t2.audioRate }), this.plugins = [], this.decodedData = null, this.stopAtPosition = null, this.subscriptions = [], this.mediaSubscriptions = [], this.abortController = null, this._isDestroyed = false, this._loadVersion = 0, this.options = Object.assign({}, P, t2);
|
|
26601
26691
|
const { state: i2, actions: n2 } = (function(t3) {
|
|
26602
26692
|
var e3, i3, n3, s3, r3, o2;
|
|
26603
|
-
const a2 = null !== (e3 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e3 ? e3 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0),
|
|
26604
|
-
return { state: { currentTime: a2, duration: c2, isPlaying:
|
|
26693
|
+
const a2 = null !== (e3 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e3 ? e3 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), d2 = null !== (n3 = null == t3 ? void 0 : t3.isPlaying) && void 0 !== n3 ? n3 : l$1(false), u2 = null !== (s3 = null == t3 ? void 0 : t3.isSeeking) && void 0 !== s3 ? s3 : l$1(false), p2 = null !== (r3 = null == t3 ? void 0 : t3.volume) && void 0 !== r3 ? r3 : l$1(1), m2 = null !== (o2 = null == t3 ? void 0 : t3.playbackRate) && void 0 !== o2 ? o2 : l$1(1), g2 = l$1(null), f2 = l$1(null), v2 = l$1(""), b2 = l$1(0), y2 = l$1(0), C2 = h$1((() => !d2.value), [d2]), S2 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S2.value && c2.value > 0), [S2, c2]), P2 = h$1((() => a2.value), [a2]), w2 = h$1((() => c2.value > 0 ? a2.value / c2.value : 0), [a2, c2]);
|
|
26694
|
+
return { state: { currentTime: a2, duration: c2, isPlaying: d2, isPaused: C2, isSeeking: u2, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y2, canPlay: S2, isReady: E2, progress: P2, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
|
|
26605
26695
|
const e4 = Math.max(0, Math.min(c2.value || 1 / 0, t4));
|
|
26606
26696
|
a2.set(e4);
|
|
26607
26697
|
}, setDuration: (t4) => {
|
|
26608
26698
|
c2.set(Math.max(0, t4));
|
|
26609
26699
|
}, setPlaying: (t4) => {
|
|
26610
|
-
u2.set(t4);
|
|
26611
|
-
}, setSeeking: (t4) => {
|
|
26612
26700
|
d2.set(t4);
|
|
26701
|
+
}, setSeeking: (t4) => {
|
|
26702
|
+
u2.set(t4);
|
|
26613
26703
|
}, setVolume: (t4) => {
|
|
26614
26704
|
const e4 = Math.max(0, Math.min(1, t4));
|
|
26615
26705
|
p2.set(e4);
|
|
@@ -26630,7 +26720,7 @@ section.turn:has([data-state="open"]) {
|
|
|
26630
26720
|
})({ isPlaying: this.isPlayingSignal, currentTime: this.currentTimeSignal, duration: this.durationSignal, volume: this.volumeSignal, playbackRate: this.playbackRateSignal, isSeeking: this.seekingSignal });
|
|
26631
26721
|
this.wavesurferState = i2, this.wavesurferActions = n2, this.timer = new S();
|
|
26632
26722
|
const s2 = e2 ? void 0 : this.getMediaElement();
|
|
26633
|
-
this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.
|
|
26723
|
+
this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initPlugins();
|
|
26634
26724
|
const r2 = this.options.url || this.getSrc() || "";
|
|
26635
26725
|
Promise.resolve().then((() => {
|
|
26636
26726
|
this.emit("init");
|
|
@@ -26653,36 +26743,6 @@ section.turn:has([data-state="open"]) {
|
|
|
26653
26743
|
}
|
|
26654
26744
|
})));
|
|
26655
26745
|
}
|
|
26656
|
-
initReactiveState() {
|
|
26657
|
-
this.reactiveCleanups.push((function(t2, e2) {
|
|
26658
|
-
const i2 = [];
|
|
26659
|
-
i2.push(c((() => {
|
|
26660
|
-
const i3 = t2.isPlaying.value;
|
|
26661
|
-
e2.emit(i3 ? "play" : "pause");
|
|
26662
|
-
}), [t2.isPlaying])), i2.push(c((() => {
|
|
26663
|
-
const i3 = t2.currentTime.value;
|
|
26664
|
-
e2.emit("timeupdate", i3), t2.isPlaying.value && e2.emit("audioprocess", i3);
|
|
26665
|
-
}), [t2.currentTime, t2.isPlaying])), i2.push(c((() => {
|
|
26666
|
-
t2.isSeeking.value && e2.emit("seeking", t2.currentTime.value);
|
|
26667
|
-
}), [t2.isSeeking, t2.currentTime]));
|
|
26668
|
-
let n2 = false;
|
|
26669
|
-
i2.push(c((() => {
|
|
26670
|
-
t2.isReady.value && !n2 && (n2 = true, e2.emit("ready", t2.duration.value));
|
|
26671
|
-
}), [t2.isReady, t2.duration])), i2.push(c((() => {
|
|
26672
|
-
null === t2.audioBuffer.value && (n2 = false);
|
|
26673
|
-
}), [t2.audioBuffer]));
|
|
26674
|
-
let s2 = false;
|
|
26675
|
-
return i2.push(c((() => {
|
|
26676
|
-
const i3 = t2.isPlaying.value, n3 = t2.currentTime.value, r2 = t2.duration.value, o2 = r2 > 0 && n3 >= r2;
|
|
26677
|
-
s2 && !i3 && o2 && e2.emit("finish"), s2 = i3 && o2;
|
|
26678
|
-
}), [t2.isPlaying, t2.currentTime, t2.duration])), i2.push(c((() => {
|
|
26679
|
-
const i3 = t2.zoom.value;
|
|
26680
|
-
i3 > 0 && e2.emit("zoom", i3);
|
|
26681
|
-
}), [t2.zoom])), () => {
|
|
26682
|
-
i2.forEach(((t3) => t3()));
|
|
26683
|
-
};
|
|
26684
|
-
})(this.wavesurferState, { emit: this.emit.bind(this) }));
|
|
26685
|
-
}
|
|
26686
26746
|
initPlayerEvents() {
|
|
26687
26747
|
this.isPlaying() && (this.emit("play"), this.timer.start()), this.mediaSubscriptions.push(this.onMediaEvent("timeupdate", (() => {
|
|
26688
26748
|
const t2 = this.updateProgress();
|
|
@@ -26902,7 +26962,7 @@ section.turn:has([data-state="open"]) {
|
|
|
26902
26962
|
}
|
|
26903
26963
|
destroy() {
|
|
26904
26964
|
var t2;
|
|
26905
|
-
this._isDestroyed = true, this.emit("destroy"), null === (t2 = this.abortController) || void 0 === t2 || t2.abort(), this.plugins.forEach(((t3) => t3.destroy())), this.subscriptions.forEach(((t3) => t3())), this.unsubscribePlayerEvents(), this.
|
|
26965
|
+
this._isDestroyed = true, this.emit("destroy"), null === (t2 = this.abortController) || void 0 === t2 || t2.abort(), this.plugins.forEach(((t3) => t3.destroy())), this.subscriptions.forEach(((t3) => t3())), this.unsubscribePlayerEvents(), this.timer.destroy(), this.renderer.destroy(), super.destroy();
|
|
26906
26966
|
}
|
|
26907
26967
|
}
|
|
26908
26968
|
w.BasePlugin = class extends e$1 {
|
|
@@ -27729,6 +27789,7 @@ section.turn:has([data-state="open"]) {
|
|
|
27729
27789
|
});
|
|
27730
27790
|
function seekTo(time) {
|
|
27731
27791
|
seekHandler?.(time);
|
|
27792
|
+
core.emit("audio:seek", { time });
|
|
27732
27793
|
}
|
|
27733
27794
|
function setSeekHandler(fn) {
|
|
27734
27795
|
seekHandler = fn;
|
|
@@ -31010,11 +31071,11 @@ section.turn:has([data-state="open"]) {
|
|
|
31010
31071
|
}
|
|
31011
31072
|
var patterns = grammar[token];
|
|
31012
31073
|
patterns = Array.isArray(patterns) ? patterns : [patterns];
|
|
31013
|
-
for (var
|
|
31014
|
-
if (rematch && rematch.cause == token + "," +
|
|
31074
|
+
for (var j = 0; j < patterns.length; ++j) {
|
|
31075
|
+
if (rematch && rematch.cause == token + "," + j) {
|
|
31015
31076
|
return;
|
|
31016
31077
|
}
|
|
31017
|
-
var patternObj = patterns[
|
|
31078
|
+
var patternObj = patterns[j];
|
|
31018
31079
|
var inside = patternObj.inside;
|
|
31019
31080
|
var lookbehind = !!patternObj.lookbehind;
|
|
31020
31081
|
var greedy = !!patternObj.greedy;
|
|
@@ -31055,9 +31116,9 @@ section.turn:has([data-state="open"]) {
|
|
|
31055
31116
|
if (currentNode.value instanceof Token) {
|
|
31056
31117
|
continue;
|
|
31057
31118
|
}
|
|
31058
|
-
for (var
|
|
31119
|
+
for (var k = currentNode; k !== tokenList.tail && (p2 < to || typeof k.value === "string"); k = k.next) {
|
|
31059
31120
|
removeCount++;
|
|
31060
|
-
p2 +=
|
|
31121
|
+
p2 += k.value.length;
|
|
31061
31122
|
}
|
|
31062
31123
|
removeCount--;
|
|
31063
31124
|
str = text2.slice(pos, p2);
|
|
@@ -31089,7 +31150,7 @@ section.turn:has([data-state="open"]) {
|
|
|
31089
31150
|
}
|
|
31090
31151
|
if (removeCount > 1) {
|
|
31091
31152
|
var nestedRematch = {
|
|
31092
|
-
cause: token + "," +
|
|
31153
|
+
cause: token + "," + j,
|
|
31093
31154
|
reach
|
|
31094
31155
|
};
|
|
31095
31156
|
matchGrammar(text2, tokenList, grammar, currentNode.prev, pos, nestedRematch);
|