@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.
@@ -114,10 +114,10 @@ function normalizeStyle(value) {
114
114
  }
115
115
  const listDelimiterRE = /;(?![^(]*\))/g;
116
116
  const propertyDelimiterRE = /:([^]+)/;
117
- const styleCommentRE = /\/\*[^]*?\*\//g;
117
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
118
118
  function parseStringStyle(cssText) {
119
119
  const ret = {};
120
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
120
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
121
121
  if (item) {
122
122
  const tmp = item.split(propertyDelimiterRE);
123
123
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -161,22 +161,22 @@ const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
161
161
  function includeBooleanAttr(value) {
162
162
  return !!value || value === "";
163
163
  }
164
- function looseCompareArrays(a2, b2) {
164
+ function looseCompareArrays(a2, b2, seen) {
165
165
  if (a2.length !== b2.length) return false;
166
166
  let equal = true;
167
167
  for (let i2 = 0; equal && i2 < a2.length; i2++) {
168
- equal = looseEqual(a2[i2], b2[i2]);
168
+ equal = looseEqual(a2[i2], b2[i2], seen);
169
169
  }
170
170
  return equal;
171
171
  }
172
- function looseCompareCollections(a2, b2) {
172
+ function looseCompareCollections(a2, b2, seen) {
173
173
  if (a2.size !== b2.size) return false;
174
174
  const candidates = Array.from(b2);
175
175
  const matched = new Uint8Array(candidates.length);
176
176
  for (const item of a2) {
177
177
  let index = -1;
178
178
  for (let i2 = 0; i2 < candidates.length; i2++) {
179
- if (!matched[i2] && looseEqual(item, candidates[i2])) {
179
+ if (!matched[i2] && looseEqual(item, candidates[i2], seen)) {
180
180
  index = i2;
181
181
  break;
182
182
  }
@@ -186,7 +186,47 @@ function looseCompareCollections(a2, b2) {
186
186
  }
187
187
  return true;
188
188
  }
189
- function looseEqual(a2, b2) {
189
+ function looseCompareObjects(a2, b2, seen) {
190
+ let aValidType = isMap(a2);
191
+ let bValidType = isMap(b2);
192
+ if (aValidType || bValidType) {
193
+ return aValidType && bValidType ? looseCompareCollections(a2, b2, seen) : false;
194
+ }
195
+ aValidType = isSet(a2);
196
+ bValidType = isSet(b2);
197
+ if (aValidType || bValidType) {
198
+ return aValidType && bValidType ? looseCompareCollections(a2, b2, seen) : false;
199
+ }
200
+ const aKeysCount = Object.keys(a2).length;
201
+ const bKeysCount = Object.keys(b2).length;
202
+ if (aKeysCount !== bKeysCount) {
203
+ return false;
204
+ }
205
+ for (const key in a2) {
206
+ const aHasKey = a2.hasOwnProperty(key);
207
+ const bHasKey = b2.hasOwnProperty(key);
208
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key], seen)) {
209
+ return false;
210
+ }
211
+ }
212
+ return String(a2) === String(b2);
213
+ }
214
+ function looseCompareNested(a2, b2, seen, compare) {
215
+ if (!seen) {
216
+ seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
217
+ }
218
+ const [seenA, seenB] = seen;
219
+ if (seenA.has(a2) || seenB.has(b2)) {
220
+ return seenA.get(a2) === b2 && seenB.get(b2) === a2;
221
+ }
222
+ seenA.set(a2, b2);
223
+ seenB.set(b2, a2);
224
+ const equal = compare(a2, b2, seen);
225
+ seenA.delete(a2);
226
+ seenB.delete(b2);
227
+ return equal;
228
+ }
229
+ function looseEqual(a2, b2, seen) {
190
230
  if (a2 === b2) return true;
191
231
  let aValidType = isDate(a2);
192
232
  let bValidType = isDate(b2);
@@ -201,7 +241,7 @@ function looseEqual(a2, b2) {
201
241
  aValidType = isArray(a2);
202
242
  bValidType = isArray(b2);
203
243
  if (aValidType || bValidType) {
204
- return aValidType && bValidType ? looseCompareArrays(a2, b2) : false;
244
+ return aValidType && bValidType ? looseCompareNested(a2, b2, seen, looseCompareArrays) : false;
205
245
  }
206
246
  aValidType = isObject$1(a2);
207
247
  bValidType = isObject$1(b2);
@@ -209,28 +249,7 @@ function looseEqual(a2, b2) {
209
249
  if (!aValidType || !bValidType) {
210
250
  return false;
211
251
  }
212
- aValidType = isMap(a2);
213
- bValidType = isMap(b2);
214
- if (aValidType || bValidType) {
215
- return aValidType && bValidType ? looseCompareCollections(a2, b2) : false;
216
- }
217
- aValidType = isSet(a2);
218
- bValidType = isSet(b2);
219
- if (aValidType || bValidType) {
220
- return aValidType && bValidType ? looseCompareCollections(a2, b2) : false;
221
- }
222
- const aKeysCount = Object.keys(a2).length;
223
- const bKeysCount = Object.keys(b2).length;
224
- if (aKeysCount !== bKeysCount) {
225
- return false;
226
- }
227
- for (const key in a2) {
228
- const aHasKey = a2.hasOwnProperty(key);
229
- const bHasKey = b2.hasOwnProperty(key);
230
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) {
231
- return false;
232
- }
233
- }
252
+ return looseCompareNested(a2, b2, seen, looseCompareObjects);
234
253
  }
235
254
  return String(a2) === String(b2);
236
255
  }
@@ -887,7 +906,9 @@ function reactiveReadArray(array) {
887
906
  const raw = /* @__PURE__ */ toRaw(array);
888
907
  if (raw === array) return raw;
889
908
  track(raw, "iterate", ARRAY_ITERATE_KEY);
890
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
909
+ if (/* @__PURE__ */ isShallow(array)) return raw;
910
+ if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
911
+ return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
891
912
  }
892
913
  function shallowReadArray(arr) {
893
914
  track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
@@ -4973,6 +4994,12 @@ function baseCreateRenderer(options, createHydrationFns) {
4973
4994
  optimized = false;
4974
4995
  n2.dynamicChildren = null;
4975
4996
  }
4997
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
4998
+ if (n2.dynamicChildren === EMPTY_ARR) {
4999
+ n2.dynamicChildren = [];
5000
+ }
5001
+ n2.dynamicChildren.hasOnce = true;
5002
+ }
4976
5003
  const { type, ref: ref3, shapeFlag } = n2;
4977
5004
  switch (type) {
4978
5005
  case Text:
@@ -5525,6 +5552,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5525
5552
  const instance = n2.component = n1.component;
5526
5553
  if (shouldUpdateComponent(n1, n2, optimized)) {
5527
5554
  if (instance.asyncDep && !instance.asyncResolved) {
5555
+ n2.el = n1.el;
5528
5556
  updateComponentPreRender(instance, n2, optimized);
5529
5557
  return;
5530
5558
  } else {
@@ -5870,7 +5898,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5870
5898
  keyToNewIndexMap.set(nextChild.key, i2);
5871
5899
  }
5872
5900
  }
5873
- let j2;
5901
+ let j;
5874
5902
  let patched = 0;
5875
5903
  const toBePatched = e22 - s2 + 1;
5876
5904
  let moved = false;
@@ -5887,9 +5915,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5887
5915
  if (prevChild.key != null) {
5888
5916
  newIndex = keyToNewIndexMap.get(prevChild.key);
5889
5917
  } else {
5890
- for (j2 = s2; j2 <= e22; j2++) {
5891
- if (newIndexToOldIndexMap[j2 - s2] === 0 && isSameVNodeType(prevChild, c2[j2])) {
5892
- newIndex = j2;
5918
+ for (j = s2; j <= e22; j++) {
5919
+ if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
5920
+ newIndex = j;
5893
5921
  break;
5894
5922
  }
5895
5923
  }
@@ -5918,7 +5946,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5918
5946
  }
5919
5947
  }
5920
5948
  const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
5921
- j2 = increasingNewIndexSequence.length - 1;
5949
+ j = increasingNewIndexSequence.length - 1;
5922
5950
  for (i2 = toBePatched - 1; i2 >= 0; i2--) {
5923
5951
  const nextIndex = s2 + i2;
5924
5952
  const nextChild = c2[nextIndex];
@@ -5940,10 +5968,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5940
5968
  optimized
5941
5969
  );
5942
5970
  } else if (moved) {
5943
- if (j2 < 0 || i2 !== increasingNewIndexSequence[j2]) {
5971
+ if (j < 0 || i2 !== increasingNewIndexSequence[j]) {
5944
5972
  move(nextChild, container, anchor, 2);
5945
5973
  } else {
5946
- j2--;
5974
+ j--;
5947
5975
  }
5948
5976
  }
5949
5977
  }
@@ -6034,7 +6062,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6034
6062
  cacheIndex,
6035
6063
  memo
6036
6064
  } = vnode;
6037
- if (patchFlag === -2) {
6065
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) {
6038
6066
  optimized = false;
6039
6067
  }
6040
6068
  if (ref3 != null) {
@@ -6042,7 +6070,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6042
6070
  setRef(ref3, null, parentSuspense, vnode, true);
6043
6071
  resetTracking();
6044
6072
  }
6045
- if (cacheIndex != null) {
6073
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
6046
6074
  parentComponent.renderCache[cacheIndex] = void 0;
6047
6075
  }
6048
6076
  if (shapeFlag & 256) {
@@ -6115,6 +6143,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6115
6143
  }
6116
6144
  if (type === Static) {
6117
6145
  removeStaticNode(vnode);
6146
+ if (transition && !transition.persisted && transition.afterLeave) {
6147
+ transition.afterLeave();
6148
+ }
6118
6149
  return;
6119
6150
  }
6120
6151
  const performRemove = () => {
@@ -6155,6 +6186,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6155
6186
  if (job) {
6156
6187
  job.flags |= 8;
6157
6188
  unmount(subTree, instance, parentSuspense, doRemove);
6189
+ } else if (instance.vnode.el && subTree) {
6190
+ subTree.transition = instance.vnode.transition;
6191
+ unmount(subTree, instance, parentSuspense, doRemove);
6158
6192
  }
6159
6193
  if (um) {
6160
6194
  queuePostRenderEffect(um, parentSuspense);
@@ -6270,14 +6304,14 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6270
6304
  function getSequence(arr) {
6271
6305
  const p2 = arr.slice();
6272
6306
  const result = [0];
6273
- let i2, j2, u2, v2, c2;
6307
+ let i2, j, u2, v2, c2;
6274
6308
  const len = arr.length;
6275
6309
  for (i2 = 0; i2 < len; i2++) {
6276
6310
  const arrI = arr[i2];
6277
6311
  if (arrI !== 0) {
6278
- j2 = result[result.length - 1];
6279
- if (arr[j2] < arrI) {
6280
- p2[i2] = j2;
6312
+ j = result[result.length - 1];
6313
+ if (arr[j] < arrI) {
6314
+ p2[i2] = j;
6281
6315
  result.push(i2);
6282
6316
  continue;
6283
6317
  }
@@ -6568,7 +6602,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
6568
6602
  el: vnode.el,
6569
6603
  anchor: vnode.anchor,
6570
6604
  ctx: vnode.ctx,
6571
- ce: vnode.ce
6605
+ ce: vnode.ce,
6606
+ cacheIndex: vnode.cacheIndex
6572
6607
  };
6573
6608
  if (transition && cloneTransition) {
6574
6609
  setTransitionHooks(
@@ -7029,7 +7064,7 @@ function isMemoSame(cached, memo) {
7029
7064
  }
7030
7065
  return true;
7031
7066
  }
7032
- const version = "3.5.42";
7067
+ const version = "3.5.43";
7033
7068
  let policy = void 0;
7034
7069
  const tt$1 = typeof window !== "undefined" && window.trustedTypes;
7035
7070
  if (tt$1) {
@@ -7376,7 +7411,7 @@ function getTimeout(delays, durations) {
7376
7411
  while (delays.length < durations.length) {
7377
7412
  delays = delays.concat(delays);
7378
7413
  }
7379
- return Math.max(...durations.map((d2, i2) => toMs(d2) + toMs(delays[i2])));
7414
+ return Math.max(...durations.map((d3, i2) => toMs(d3) + toMs(delays[i2])));
7380
7415
  }
7381
7416
  function toMs(s2) {
7382
7417
  if (s2 === "auto") return 0;
@@ -8527,7 +8562,7 @@ const withKeys = (fn, modifiers) => {
8527
8562
  }
8528
8563
  const eventKey = hyphenate(event.key);
8529
8564
  if (modifiers.some(
8530
- (k2) => k2 === eventKey || keyNames[k2] === eventKey
8565
+ (k) => k === eventKey || keyNames[k] === eventKey
8531
8566
  )) {
8532
8567
  return fn(event);
8533
8568
  }
@@ -9054,17 +9089,17 @@ function toDate(value) {
9054
9089
  const d22 = new Date(ms);
9055
9090
  return Number.isNaN(d22.getTime()) ? null : d22;
9056
9091
  }
9057
- const d2 = new Date(value);
9058
- return Number.isNaN(d2.getTime()) ? null : d2;
9092
+ const d3 = new Date(value);
9093
+ return Number.isNaN(d3.getTime()) ? null : d3;
9059
9094
  }
9060
9095
  function formatLongDate(value, locale) {
9061
- const d2 = toDate(value);
9062
- if (!d2) return "";
9096
+ const d3 = toDate(value);
9097
+ if (!d3) return "";
9063
9098
  return new Intl.DateTimeFormat(locale, {
9064
9099
  day: "numeric",
9065
9100
  month: "long",
9066
9101
  year: "numeric"
9067
- }).format(d2);
9102
+ }).format(d3);
9068
9103
  }
9069
9104
  function formatDurationMinutes(seconds, locale) {
9070
9105
  const minutes = Math.max(0, Math.round(seconds / 60));
@@ -9102,18 +9137,18 @@ function validateEditorDocument(doc2) {
9102
9137
  if (doc2 == null || typeof doc2 !== "object") {
9103
9138
  throw new DocumentValidationError("document", "must be a non-null object");
9104
9139
  }
9105
- const d2 = doc2;
9106
- if (typeof d2.title !== "string") {
9140
+ const d3 = doc2;
9141
+ if (typeof d3.title !== "string") {
9107
9142
  throw new DocumentValidationError("document.title", "must be a string");
9108
9143
  }
9109
- if (!(d2.speakers instanceof Map)) {
9144
+ if (!(d3.speakers instanceof Map)) {
9110
9145
  throw new DocumentValidationError("document.speakers", "must be a Map");
9111
9146
  }
9112
- if (!Array.isArray(d2.channels)) {
9147
+ if (!Array.isArray(d3.channels)) {
9113
9148
  throw new DocumentValidationError("document.channels", "must be an array");
9114
9149
  }
9115
- for (let ci = 0; ci < d2.channels.length; ci++) {
9116
- const ch = d2.channels[ci];
9150
+ for (let ci = 0; ci < d3.channels.length; ci++) {
9151
+ const ch = d3.channels[ci];
9117
9152
  const cp = `channels[${ci}]`;
9118
9153
  if (ch == null || typeof ch !== "object") {
9119
9154
  throw new DocumentValidationError(cp, "must be a non-null object");
@@ -9177,7 +9212,7 @@ function renderWaveform(channels, ctx) {
9177
9212
  const start = Math.floor(i2 * scale);
9178
9213
  const end = Math.max(start + 1, Math.floor((i2 + step * 2) * scale));
9179
9214
  let sum = 0;
9180
- for (let j2 = start; j2 < end; j2++) sum += Math.abs(channel[j2] ?? 0);
9215
+ for (let j = start; j < end; j++) sum += Math.abs(channel[j] ?? 0);
9181
9216
  const value = sum / (end - start);
9182
9217
  let x2 = i2;
9183
9218
  let y3 = value * (height / 2);
@@ -10518,7 +10553,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
10518
10553
  highlighted.value = null;
10519
10554
  return;
10520
10555
  }
10521
- const { highlightCode } = await import("./highlight-CJMoAPSe.js");
10556
+ const { highlightCode } = await import("./highlight-D3MWj8e2.js");
10522
10557
  if (run === seq) highlighted.value = highlightCode(code, lang ?? "");
10523
10558
  },
10524
10559
  { immediate: true }
@@ -10682,7 +10717,7 @@ const _hoisted_3$m = {
10682
10717
  };
10683
10718
  const _hoisted_4$c = { class: "form-field__input-wrapper" };
10684
10719
  const _hoisted_5$b = ["id", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"];
10685
- const _hoisted_6$9 = ["value"];
10720
+ const _hoisted_6$a = ["value"];
10686
10721
  const _hoisted_7$5 = ["type", "id", "disabled", "readonly", "placeholder", "autocomplete", "required", "aria-required", "aria-invalid", "aria-describedby"];
10687
10722
  const _hoisted_8$3 = {
10688
10723
  key: 3,
@@ -10841,7 +10876,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
10841
10876
  return openBlock(), createElementBlock("option", {
10842
10877
  key: opt.value,
10843
10878
  value: opt.value
10844
- }, toDisplayString(opt.label), 9, _hoisted_6$9);
10879
+ }, toDisplayString(opt.label), 9, _hoisted_6$a);
10845
10880
  }), 128))
10846
10881
  ], 16, _hoisted_5$b)), [
10847
10882
  [vModelSelect, draft.value]
@@ -12708,11 +12743,11 @@ function focusFirst$1(candidates) {
12708
12743
  function isPointInPolygon(point, polygon) {
12709
12744
  const { x: x2, y: y3 } = point;
12710
12745
  let inside = false;
12711
- for (let i2 = 0, j2 = polygon.length - 1; i2 < polygon.length; j2 = i2++) {
12746
+ for (let i2 = 0, j = polygon.length - 1; i2 < polygon.length; j = i2++) {
12712
12747
  const xi = polygon[i2].x;
12713
12748
  const yi = polygon[i2].y;
12714
- const xj = polygon[j2].x;
12715
- const yj = polygon[j2].y;
12749
+ const xj = polygon[j].x;
12750
+ const yj = polygon[j].y;
12716
12751
  const intersect = yi > y3 !== yj > y3 && x2 < (xj - xi) * (y3 - yi) / (yj - yi) + xi;
12717
12752
  if (intersect) inside = !inside;
12718
12753
  }
@@ -14098,7 +14133,7 @@ const flip$1 = function(options) {
14098
14133
  const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
14099
14134
  if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
14100
14135
  // overflows the main axis.
14101
- overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) {
14136
+ overflowsData.every((d3) => getSideAxis(d3.placement) === initialSideAxis ? d3.overflows[0] > 0 : true)) {
14102
14137
  return {
14103
14138
  data: {
14104
14139
  index: nextIndex,
@@ -14110,20 +14145,20 @@ const flip$1 = function(options) {
14110
14145
  };
14111
14146
  }
14112
14147
  }
14113
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
14148
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d3) => d3.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
14114
14149
  if (!resetPlacement) {
14115
14150
  switch (fallbackStrategy) {
14116
14151
  case "bestFit": {
14117
14152
  var _overflowsData$filter2;
14118
- const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
14153
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d3) => {
14119
14154
  if (hasFallbackAxisSideDirection) {
14120
- const currentSideAxis = getSideAxis(d2.placement);
14155
+ const currentSideAxis = getSideAxis(d3.placement);
14121
14156
  return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
14122
14157
  // reading directions favoring greater width.
14123
14158
  currentSideAxis === "y";
14124
14159
  }
14125
14160
  return true;
14126
- }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
14161
+ }).map((d3) => [d3.placement, d3.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
14127
14162
  if (placement2) {
14128
14163
  resetPlacement = placement2;
14129
14164
  }
@@ -18314,41 +18349,41 @@ function gfm(turndownService) {
18314
18349
  function A() {
18315
18350
  return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
18316
18351
  }
18317
- var R = A();
18318
- function j(l4) {
18319
- R = l4;
18352
+ var T = A();
18353
+ function U(l4) {
18354
+ T = l4;
18320
18355
  }
18321
- var z = { exec: () => null };
18356
+ var E$1 = { exec: () => null };
18322
18357
  function I(l4) {
18323
18358
  let e3 = [];
18324
18359
  return (t2) => {
18325
- let n2 = Math.max(0, Math.min(3, t2 - 1)), s2 = e3[n2];
18326
- return s2 || (s2 = l4(n2), e3[n2] = s2), s2;
18360
+ let n2 = Math.max(0, Math.min(3, t2 - 1)), i2 = e3[n2];
18361
+ return i2 || (i2 = l4(n2), e3[n2] = i2), i2;
18327
18362
  };
18328
18363
  }
18329
- function k(l4, e3 = "") {
18330
- let t2 = typeof l4 == "string" ? l4 : l4.source, n2 = { replace: (s2, r2) => {
18331
- let i2 = typeof r2 == "string" ? r2 : r2.source;
18332
- return i2 = i2.replace(m$1.caret, "$1"), t2 = t2.replace(s2, i2), n2;
18364
+ function d$2(l4, e3 = "") {
18365
+ let t2 = typeof l4 == "string" ? l4 : l4.source, n2 = { replace: (i2, r2) => {
18366
+ let o2 = typeof r2 == "string" ? r2 : r2.source;
18367
+ return o2 = o2.replace(m$1.caret, "$1"), t2 = t2.replace(i2, o2), n2;
18333
18368
  }, getRegex: () => new RegExp(t2, e3) };
18334
18369
  return n2;
18335
18370
  }
18336
- var Oe = ((l4 = "") => {
18371
+ var we = ((l4 = "") => {
18337
18372
  try {
18338
18373
  return !!new RegExp("(?<=1)(?<!1)" + l4);
18339
18374
  } catch {
18340
18375
  return false;
18341
18376
  }
18342
- })(), m$1 = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, 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: (l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: I((l4) => new RegExp(`^ {0,${l4}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:\`\`\`|~~~)`)), headingBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}#`)), htmlBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}>`)) }, Te = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, q = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, U = / {0,3}(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = k(oe).replace(/bull/g, U).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(), Se = k(oe).replace(/bull/g, U).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(), K = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, _e = /^[^\n]+/, W = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", W).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Le = k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, U).getRegex(), Q = "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", X = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ee = k("^ {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][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", X).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (l4) => k(K).replace("hr", q).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", l4).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Q).getRegex(), ze = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Me = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Ae = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Me).getRegex(), J = { blockquote: Ae, code: we, def: $e, fences: ye, heading: Pe, hr: q, html: Ee, lheading: ae, list: Le, newline: Te, paragraph: ze, table: z, text: _e }, se = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", q).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", Q).getRegex(), Ie = { ...J, lheading: Se, table: se, paragraph: k(K).replace("hr", q).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).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", Q).getRegex() }, Ce = { ...J, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", X).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: z, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(K).replace("hr", q).replace("heading", ` *#{1,6} *[^
18343
- ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Be = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, De = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _ = /[\p{P}\p{S}]/u, C$1 = /[\s\p{P}\p{S}]/u, v$1 = /[^\s\p{P}\p{S}]/u, ve = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C$1).getRegex(), He = /[\p{Pi}\p{Ps}"']/u, pe = /(?!~)[\p{P}\p{S}]/u, Ze = /(?!~)[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|~)/u, Qe = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Oe ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ne = k(ce, "u").replace(/punct/g, _).getRegex(), je = k(ce, "u").replace(/punct/g, pe).getRegex(), Fe = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, Ue = k(Fe, "u").replace(/openQuote/g, He).replace(/punct/g, _).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ke = k(he, "gu").replace(/notPunctSpace/g, v$1).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), We = k(he, "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, Ze).replace(/punct/g, pe).getRegex(), Xe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", Je = k(Xe, "gu").replace(/notPunctSpace/g, v$1).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), Ve = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, v$1).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), Ye = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", et = k(Ye, "gu").replace(/notPunctSpace/g, v$1).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), tt = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex(), nt = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", rt = k(nt, "gu").replace(/notPunctSpace/g, v$1).replace(/punctSpace/g, C$1).replace(/punct/g, _).getRegex(), st = k(/\\(punct)/, "gu").replace(/punct/g, _).getRegex(), it = k(/^<(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(), ot = k(X).replace("(?:-->|$)", "-->").getRegex(), at = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ot).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), G = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, lt = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", G).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = k(/^!?\[(label)\]\[(ref)\]/).replace("label", G).replace("ref", W).getRegex(), de = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", W).getRegex(), ut = k("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex(), ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, V = { _backpedal: z, anyPunctuation: st, autolink: it, blockSkip: Qe, br: ue, code: De, del: z, delLDelim: z, delRDelim: z, emStrongLDelim: Ne, emStrongRDelimAst: Ke, emStrongRDelimUnd: Ve, escape: Be, link: lt, nolink: de, punctuation: ve, reflink: ke, reflinkSearch: ut, tag: at, text: qe, url: z }, pt = { ...V, emStrongLDelim: Ue, emStrongRDelimAst: Je, emStrongRDelimUnd: et, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", G).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", G).getRegex() }, F = { ...V, emStrongRDelimAst: We, emStrongLDelim: je, delLDelim: tt, delRDelim: rt, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() }, ct = { ...F, br: k(ue).replace("{2,}", "*").getRegex(), text: k(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, H = { normal: J, gfm: Ie, pedantic: Ce }, B = { normal: V, gfm: F, breaks: ct, pedantic: pt };
18344
- var ht = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ge = (l4) => ht[l4];
18345
- function T(l4, e3) {
18377
+ })(), 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: (l4) => new RegExp(`^( {0,3}${l4})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: I((l4) => new RegExp(`^ {0,${l4}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)), fencesBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:\`\`\`|~~~)`)), headingBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}#`)), htmlBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}(?:</?(?:${H})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")), blockquoteBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}>`)) }, 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 = (l4) => 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", l4).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} *[^
18378
+ ]`).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 };
18379
+ var mt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, fe = (l4) => mt[l4];
18380
+ function R(l4, e3) {
18346
18381
  if (e3) {
18347
- if (m$1.escapeTest.test(l4)) return l4.replace(m$1.escapeReplace, ge);
18348
- } else if (m$1.escapeTestNoEncode.test(l4)) return l4.replace(m$1.escapeReplaceNoEncode, ge);
18382
+ if (m$1.escapeTest.test(l4)) return l4.replace(m$1.escapeReplace, fe);
18383
+ } else if (m$1.escapeTestNoEncode.test(l4)) return l4.replace(m$1.escapeReplaceNoEncode, fe);
18349
18384
  return l4;
18350
18385
  }
18351
- function Y(l4) {
18386
+ function ee(l4) {
18352
18387
  try {
18353
18388
  l4 = encodeURI(l4).replace(m$1.percentDecode, "%");
18354
18389
  } catch {
@@ -18356,36 +18391,39 @@ function Y(l4) {
18356
18391
  }
18357
18392
  return l4;
18358
18393
  }
18359
- function ee(l4, e3) {
18360
- let t2 = l4.replace(m$1.findPipe, (r2, i2, o2) => {
18361
- let u2 = false, a2 = i2;
18362
- for (; --a2 >= 0 && o2[a2] === "\\"; ) u2 = !u2;
18394
+ function te(l4, e3) {
18395
+ let t2 = l4.replace(m$1.findPipe, (r2, o2, s2) => {
18396
+ let u2 = false, a2 = o2;
18397
+ for (; --a2 >= 0 && s2[a2] === "\\"; ) u2 = !u2;
18363
18398
  return u2 ? "|" : " |";
18364
- }), n2 = t2.split(m$1.splitPipe), s2 = 0;
18399
+ }), n2 = t2.split(m$1.splitPipe), i2 = 0;
18365
18400
  if (n2[0].trim() || n2.shift(), n2.length > 0 && !n2.at(-1)?.trim() && n2.pop(), e3) if (n2.length > e3) n2.splice(e3);
18366
18401
  else for (; n2.length < e3; ) n2.push("");
18367
- for (; s2 < n2.length; s2++) n2[s2] = n2[s2].trim().replace(m$1.slashPipe, "|");
18402
+ for (; i2 < n2.length; i2++) n2[i2] = n2[i2].trim().replace(m$1.slashPipe, "|");
18368
18403
  return n2;
18369
18404
  }
18370
18405
  function $(l4, e3, t2) {
18371
18406
  let n2 = l4.length;
18372
18407
  if (n2 === 0) return "";
18373
- let s2 = 0;
18374
- for (; s2 < n2; ) {
18375
- let r2 = l4.charAt(n2 - s2 - 1);
18376
- if (r2 === e3 && true) s2++;
18408
+ let i2 = 0;
18409
+ for (; i2 < n2; ) {
18410
+ let r2 = l4.charAt(n2 - i2 - 1);
18411
+ if (r2 === e3 && true) i2++;
18377
18412
  else break;
18378
18413
  }
18379
- return l4.slice(0, n2 - s2);
18414
+ return l4.slice(0, n2 - i2);
18380
18415
  }
18381
- function te(l4) {
18416
+ function ne(l4) {
18382
18417
  let e3 = l4.split(`
18383
18418
  `), t2 = e3.length - 1;
18384
18419
  for (; t2 >= 0 && m$1.blankLine.test(e3[t2]); ) t2--;
18385
18420
  return e3.length - t2 <= 2 ? l4 : e3.slice(0, t2 + 1).join(`
18386
18421
  `);
18387
18422
  }
18388
- function fe(l4, e3) {
18423
+ function D(l4) {
18424
+ return l4.toLowerCase().toUpperCase().toLowerCase();
18425
+ }
18426
+ function me(l4, e3) {
18389
18427
  if (l4.indexOf(e3[1]) === -1) return -1;
18390
18428
  let t2 = 0;
18391
18429
  for (let n2 = 0; n2 < l4.length; n2++) if (l4[n2] === "\\") n2++;
@@ -18393,20 +18431,20 @@ function fe(l4, e3) {
18393
18431
  else if (l4[n2] === e3[1] && (t2--, t2 < 0)) return n2;
18394
18432
  return t2 > 0 ? -2 : -1;
18395
18433
  }
18396
- function me(l4, e3 = 0) {
18434
+ function xe(l4, e3 = 0) {
18397
18435
  let t2 = e3, n2 = "";
18398
- for (let s2 of l4) if (s2 === " ") {
18436
+ for (let i2 of l4) if (i2 === " ") {
18399
18437
  let r2 = 4 - t2 % 4;
18400
18438
  n2 += " ".repeat(r2), t2 += r2;
18401
- } else n2 += s2, t2++;
18439
+ } else n2 += i2, t2++;
18402
18440
  return n2;
18403
18441
  }
18404
- function xe(l4, e3, t2, n2, s2) {
18405
- let r2 = e3.href, i2 = e3.title || null, o2 = l4[1].replace(s2.other.outputLinkReplace, "$1"), u2 = l4[0].charAt(0) === "!";
18442
+ function be(l4, e3, t2, n2, i2) {
18443
+ let r2 = e3.href, o2 = e3.title || null, s2 = l4[1].replace(i2.other.outputLinkReplace, "$1"), u2 = l4[0].charAt(0) === "!";
18406
18444
  n2.state.inLink = true;
18407
18445
  let a2 = n2.state.linkEmitted, p2 = n2.state.inRawBlock;
18408
18446
  n2.state.linkEmitted = false;
18409
- let c2 = n2.inlineTokens(o2), h2 = n2.state.linkEmitted;
18447
+ let c2 = n2.inlineTokens(s2), h2 = n2.state.linkEmitted;
18410
18448
  if (n2.state.linkEmitted = a2, n2.state.inLink = false, !u2) {
18411
18449
  if (h2) {
18412
18450
  n2.state.inRawBlock = p2;
@@ -18414,27 +18452,50 @@ function xe(l4, e3, t2, n2, s2) {
18414
18452
  }
18415
18453
  n2.state.linkEmitted = true;
18416
18454
  }
18417
- return { type: u2 ? "image" : "link", raw: t2, href: r2, title: i2, text: o2, tokens: c2 };
18455
+ return { type: u2 ? "image" : "link", raw: t2, href: r2, title: o2, text: s2, tokens: c2 };
18418
18456
  }
18419
- function kt(l4, e3, t2) {
18457
+ function xt(l4, e3, t2) {
18420
18458
  let n2 = l4.match(t2.other.indentCodeCompensation);
18421
18459
  if (n2 === null) return e3;
18422
- let s2 = n2[1];
18460
+ let i2 = n2[1];
18423
18461
  return e3.split(`
18424
18462
  `).map((r2) => {
18425
- let i2 = r2.match(t2.other.beginningSpace);
18426
- if (i2 === null) return r2;
18427
- let [o2] = i2;
18428
- return o2.length >= s2.length ? r2.slice(s2.length) : r2;
18463
+ let o2 = r2.match(t2.other.beginningSpace);
18464
+ if (o2 === null) return r2;
18465
+ let [s2] = o2;
18466
+ return r2.slice(Math.min(s2.length, i2.length));
18429
18467
  }).join(`
18430
18468
  `);
18431
18469
  }
18470
+ function Re(l4, e3, t2, n2) {
18471
+ if (!e3.includes("<")) return false;
18472
+ for (let i2 = 0; i2 < e3.length; i2++) {
18473
+ if (e3[i2] === "\\") {
18474
+ i2++;
18475
+ continue;
18476
+ }
18477
+ if (e3[i2] === "`") {
18478
+ let s2 = n2.inline.code.exec(e3.slice(i2));
18479
+ if (s2) {
18480
+ i2 += s2[0].length - 1;
18481
+ continue;
18482
+ }
18483
+ }
18484
+ if (e3[i2] !== "<") continue;
18485
+ let r2 = l4.slice(t2 + i2), o2 = n2.inline.tag.exec(r2) || n2.inline.autolink.exec(r2);
18486
+ if (o2) {
18487
+ if (o2[0].length > e3.length - i2) return true;
18488
+ i2 += o2[0].length - 1;
18489
+ }
18490
+ }
18491
+ return false;
18492
+ }
18432
18493
  var y$1 = class y {
18433
18494
  options;
18434
18495
  rules;
18435
18496
  lexer;
18436
18497
  constructor(e3) {
18437
- this.options = e3 || R;
18498
+ this.options = e3 || T;
18438
18499
  }
18439
18500
  space(e3) {
18440
18501
  let t2 = this.rules.block.newline.exec(e3);
@@ -18443,15 +18504,15 @@ var y$1 = class y {
18443
18504
  code(e3) {
18444
18505
  let t2 = this.rules.block.code.exec(e3);
18445
18506
  if (t2) {
18446
- let n2 = this.options.pedantic ? t2[0] : te(t2[0]), s2 = n2.replace(this.rules.other.codeRemoveIndent, "");
18447
- return { type: "code", raw: n2, codeBlockStyle: "indented", text: s2 };
18507
+ let n2 = this.options.pedantic ? t2[0] : ne(t2[0]), i2 = n2.replace(this.rules.other.codeRemoveIndent, "");
18508
+ return { type: "code", raw: n2, codeBlockStyle: "indented", text: i2 };
18448
18509
  }
18449
18510
  }
18450
18511
  fences(e3) {
18451
18512
  let t2 = this.rules.block.fences.exec(e3);
18452
18513
  if (t2) {
18453
- let n2 = t2[0], s2 = kt(n2, t2[3] || "", this.rules);
18454
- return { type: "code", raw: n2, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: s2 };
18514
+ let n2 = t2[0], i2 = xt(n2, t2[3] || "", this.rules);
18515
+ return { type: "code", raw: n2, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: i2 };
18455
18516
  }
18456
18517
  }
18457
18518
  heading(e3) {
@@ -18459,8 +18520,8 @@ var y$1 = class y {
18459
18520
  if (t2) {
18460
18521
  let n2 = t2[2].trim();
18461
18522
  if (this.rules.other.endingHash.test(n2)) {
18462
- let s2 = $(n2, "#");
18463
- (this.options.pedantic || !s2 || this.rules.other.endingSpaceChar.test(s2)) && (n2 = s2.trim());
18523
+ let i2 = $(n2, "#");
18524
+ (this.options.pedantic || !i2 || this.rules.other.endingSpaceTabChar.test(i2)) && (n2 = i2.trim());
18464
18525
  }
18465
18526
  return { type: "heading", raw: $(t2[0], `
18466
18527
  `), depth: t2[1].length, text: n2, tokens: this.lexer.inline(n2) };
@@ -18476,74 +18537,74 @@ var y$1 = class y {
18476
18537
  if (t2) {
18477
18538
  let n2 = $(t2[0], `
18478
18539
  `).split(`
18479
- `), s2 = "", r2 = "", i2 = [];
18540
+ `), i2 = "", r2 = "", o2 = [];
18480
18541
  for (; n2.length > 0; ) {
18481
- let o2 = false, u2 = [], a2;
18482
- for (a2 = 0; a2 < n2.length; a2++) if (this.rules.other.blockquoteStart.test(n2[a2])) u2.push(n2[a2]), o2 = true;
18483
- else if (!o2) u2.push(n2[a2]);
18542
+ let s2 = false, u2 = [], a2;
18543
+ for (a2 = 0; a2 < n2.length; a2++) if (this.rules.other.blockquoteStart.test(n2[a2])) u2.push(n2[a2]), s2 = true;
18544
+ else if (!s2) u2.push(n2[a2]);
18484
18545
  else break;
18485
18546
  n2 = n2.slice(a2);
18486
18547
  let p2 = u2.join(`
18487
18548
  `), c2 = p2.replace(this.rules.other.blockquoteSetextReplace, `
18488
18549
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
18489
- s2 = s2 ? `${s2}
18550
+ i2 = i2 ? `${i2}
18490
18551
  ${p2}` : p2, r2 = r2 ? `${r2}
18491
18552
  ${c2}` : c2;
18492
18553
  let h2 = this.lexer.state.top;
18493
- if (this.lexer.state.top = true, this.lexer.blockTokens(c2, i2, true), this.lexer.state.top = h2, n2.length === 0) break;
18494
- let d2 = i2.at(-1);
18495
- if (d2?.type === "code") break;
18496
- if (d2?.type === "blockquote") {
18497
- let O = d2, g2 = n2.join(`
18554
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c2, o2, true), this.lexer.state.top = h2, n2.length === 0) break;
18555
+ let k = o2.at(-1);
18556
+ if (k?.type === "code") break;
18557
+ if (k?.type === "blockquote") {
18558
+ let O = k, g2 = n2.join(`
18498
18559
  `), w2 = O.raw + `
18499
- ` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), E2 = this.blockquote(w2);
18500
- i2[i2.length - 1] = E2, s2 = `${s2}
18501
- ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
18560
+ ` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w2);
18561
+ o2[o2.length - 1] = z, i2 = `${i2}
18562
+ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
18502
18563
  break;
18503
- } else if (d2?.type === "list") {
18504
- let O = d2, g2 = O.raw + `
18564
+ } else if (k?.type === "list") {
18565
+ let O = k, g2 = O.raw + `
18505
18566
  ` + n2.join(`
18506
18567
  `), w2 = this.list(g2);
18507
- i2[i2.length - 1] = w2, s2 = s2.substring(0, s2.length - d2.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n2 = g2.substring(i2.at(-1).raw.length).split(`
18568
+ 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(`
18508
18569
  `);
18509
18570
  continue;
18510
18571
  }
18511
18572
  }
18512
- return { type: "blockquote", raw: s2, tokens: i2, text: r2 };
18573
+ return { type: "blockquote", raw: i2, tokens: o2, text: r2 };
18513
18574
  }
18514
18575
  }
18515
18576
  list(e3) {
18516
18577
  let t2 = this.rules.block.list.exec(e3);
18517
18578
  if (t2) {
18518
- let n2 = t2[1].trim(), s2 = n2.length > 1, r2 = { type: "list", raw: "", ordered: s2, start: s2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
18519
- n2 = s2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = s2 ? n2 : "[*+-]");
18520
- let i2 = this.rules.other.listItemRegex(n2), o2 = false;
18579
+ let n2 = t2[1].trim(), i2 = n2.length > 1, r2 = { type: "list", raw: "", ordered: i2, start: i2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
18580
+ n2 = i2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = i2 ? n2 : "[*+-]");
18581
+ let o2 = this.rules.other.listItemRegex(n2), s2 = false;
18521
18582
  for (; e3; ) {
18522
18583
  let a2 = false, p2 = "", c2 = "";
18523
- if (!(t2 = i2.exec(e3)) || this.rules.block.hr.test(e3)) break;
18584
+ if (!(t2 = o2.exec(e3)) || this.rules.block.hr.test(e3)) break;
18524
18585
  p2 = t2[0], e3 = e3.substring(p2.length);
18525
- let h2 = me(t2[2].split(`
18526
- `, 1)[0], t2[1].length), d2 = e3.split(`
18586
+ let h2 = xe(t2[2].split(`
18587
+ `, 1)[0], t2[1].length), k = e3.split(`
18527
18588
  `, 1)[0], O = !h2.trim(), g2 = 0;
18528
- 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(d2) && (p2 += d2 + `
18529
- `, e3 = e3.substring(d2.length + 1), a2 = true), !a2) {
18530
- let w2 = this.rules.other.nextBulletRegex(g2), E2 = this.rules.other.hrRegex(g2), ne = this.rules.other.fencesBeginRegex(g2), re = this.rules.other.headingBeginRegex(g2), be = this.rules.other.htmlBeginRegex(g2), Re = this.rules.other.blockquoteBeginRegex(g2);
18589
+ 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 + `
18590
+ `, e3 = e3.substring(k.length + 1), a2 = true), !a2) {
18591
+ 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);
18531
18592
  for (; e3; ) {
18532
- let N = e3.split(`
18533
- `, 1)[0], D;
18534
- if (d2 = N, this.options.pedantic ? (d2 = d2.replace(this.rules.other.listReplaceNesting, " "), D = d2) : D = d2.replace(this.rules.other.tabCharGlobal, " "), ne.test(d2) || re.test(d2) || be.test(d2) || Re.test(d2) || w2.test(d2) || E2.test(d2)) break;
18535
- if (D.search(this.rules.other.nonSpaceChar) >= g2 || !d2.trim()) c2 += `
18536
- ` + D.slice(g2);
18593
+ let j = e3.split(`
18594
+ `, 1)[0], q;
18595
+ 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;
18596
+ if (q.search(this.rules.other.nonSpaceChar) >= g2 || !k.trim()) c2 += `
18597
+ ` + q.slice(g2);
18537
18598
  else {
18538
- if (O || h2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(h2) || re.test(h2) || E2.test(h2)) break;
18599
+ if (O || h2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test(h2) || se.test(h2) || z.test(h2)) break;
18539
18600
  c2 += `
18540
- ` + d2;
18601
+ ` + k;
18541
18602
  }
18542
- O = !d2.trim(), p2 += N + `
18543
- `, e3 = e3.substring(N.length + 1), h2 = D.slice(g2);
18603
+ O = !k.trim(), p2 += j + `
18604
+ `, e3 = e3.substring(j.length + 1), h2 = q.slice(g2);
18544
18605
  }
18545
18606
  }
18546
- r2.loose || (o2 ? r2.loose = true : this.rules.other.doubleBlankLine.test(p2) && (o2 = 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;
18607
+ 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;
18547
18608
  }
18548
18609
  let u2 = r2.items.at(-1);
18549
18610
  if (u2) u2.raw = u2.raw.trimEnd(), u2.text = u2.text.trimEnd();
@@ -18578,29 +18639,29 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
18578
18639
  html(e3) {
18579
18640
  let t2 = this.rules.block.html.exec(e3);
18580
18641
  if (t2) {
18581
- let n2 = te(t2[0]);
18642
+ let n2 = ne(t2[0]);
18582
18643
  return { type: "html", block: true, raw: n2, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n2 };
18583
18644
  }
18584
18645
  }
18585
18646
  def(e3) {
18586
18647
  let t2 = this.rules.block.def.exec(e3);
18587
18648
  if (t2) {
18588
- let n2 = t2[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s2 = 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];
18649
+ 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];
18589
18650
  return { type: "def", tag: n2, raw: $(t2[0], `
18590
- `), href: s2, title: r2 };
18651
+ `), href: i2, title: r2 };
18591
18652
  }
18592
18653
  }
18593
18654
  table(e3) {
18594
18655
  let t2 = this.rules.block.table.exec(e3);
18595
18656
  if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
18596
- let n2 = ee(t2[1]), s2 = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
18597
- `) : [], i2 = { type: "table", raw: $(t2[0], `
18657
+ 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(`
18658
+ `) : [], o2 = { type: "table", raw: $(t2[0], `
18598
18659
  `), header: [], align: [], rows: [] };
18599
- if (n2.length === s2.length) {
18600
- for (let o2 of s2) this.rules.other.tableAlignRight.test(o2) ? i2.align.push("right") : this.rules.other.tableAlignCenter.test(o2) ? i2.align.push("center") : this.rules.other.tableAlignLeft.test(o2) ? i2.align.push("left") : i2.align.push(null);
18601
- for (let o2 = 0; o2 < n2.length; o2++) i2.header.push({ text: n2[o2], tokens: this.lexer.inline(n2[o2]), header: true, align: i2.align[o2] });
18602
- for (let o2 of r2) i2.rows.push(ee(o2, i2.header.length).map((u2, a2) => ({ text: u2, tokens: this.lexer.inline(u2), header: false, align: i2.align[a2] })));
18603
- return i2;
18660
+ if (n2.length === i2.length) {
18661
+ 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);
18662
+ 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] });
18663
+ 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] })));
18664
+ return o2;
18604
18665
  }
18605
18666
  }
18606
18667
  lheading(e3) {
@@ -18634,50 +18695,54 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
18634
18695
  link(e3) {
18635
18696
  let t2 = this.rules.inline.link.exec(e3);
18636
18697
  if (t2) {
18637
- let n2 = t2[2].trim();
18638
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n2)) {
18639
- if (!this.rules.other.endAngleBracket.test(n2)) return;
18640
- let i2 = $(n2.slice(0, -1), "\\");
18641
- if ((n2.length - i2.length) % 2 === 0) return;
18698
+ let n2 = t2[0].charAt(0) === "!" ? 2 : 1;
18699
+ if (!this.options.pedantic && Re(e3, t2[1], n2, this.rules)) return;
18700
+ let i2 = t2[2].trim();
18701
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i2)) {
18702
+ if (!this.rules.other.endAngleBracket.test(i2)) return;
18703
+ let s2 = $(i2.slice(0, -1), "\\");
18704
+ if ((i2.length - s2.length) % 2 === 0) return;
18642
18705
  } else {
18643
- let i2 = fe(t2[2], "()");
18644
- if (i2 === -2) return;
18645
- if (i2 > -1) {
18646
- let u2 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + i2;
18647
- t2[2] = t2[2].substring(0, i2), t2[0] = t2[0].substring(0, u2).trim(), t2[3] = "";
18706
+ let s2 = me(t2[2], "()");
18707
+ if (s2 === -2) return;
18708
+ if (s2 > -1) {
18709
+ let a2 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s2;
18710
+ t2[2] = t2[2].substring(0, s2), t2[0] = t2[0].substring(0, a2).trim(), t2[3] = "";
18648
18711
  }
18649
18712
  }
18650
- let s2 = t2[2], r2 = "";
18713
+ let r2 = t2[2], o2 = "";
18651
18714
  if (this.options.pedantic) {
18652
- let i2 = this.rules.other.pedanticHrefTitle.exec(s2);
18653
- i2 && (s2 = i2[1], r2 = i2[3]);
18654
- } else r2 = t2[3] ? t2[3].slice(1, -1) : "";
18655
- return s2 = s2.trim(), this.rules.other.startAngleBracket.test(s2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n2) ? s2 = s2.slice(1) : s2 = s2.slice(1, -1)), xe(t2, { href: s2 && s2.replace(this.rules.inline.anyPunctuation, "$1"), title: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
18715
+ let s2 = this.rules.other.pedanticHrefTitle.exec(r2);
18716
+ s2 && (r2 = s2[1], o2 = s2[3]);
18717
+ } else o2 = t2[3] ? t2[3].slice(1, -1) : "";
18718
+ 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);
18656
18719
  }
18657
18720
  }
18658
18721
  reflink(e3, t2) {
18659
18722
  let n2;
18660
18723
  if ((n2 = this.rules.inline.reflink.exec(e3)) || (n2 = this.rules.inline.nolink.exec(e3))) {
18661
- let s2 = (n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r2 = t2[s2.toLowerCase()];
18662
- if (!r2) {
18663
- let i2 = n2[0].charAt(0);
18664
- return { type: "text", raw: i2, text: i2 };
18724
+ let i2 = n2[0].charAt(0) === "!" ? 2 : 1;
18725
+ if (!this.options.pedantic && Re(e3, n2[1], i2, this.rules)) return;
18726
+ let r2 = (n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o2 = t2[D(r2)];
18727
+ if (!o2) {
18728
+ let s2 = n2[0].charAt(0);
18729
+ return { type: "text", raw: s2, text: s2 };
18665
18730
  }
18666
- return xe(n2, r2, n2[0], this.lexer, this.rules);
18731
+ return be(n2, o2, n2[0], this.lexer, this.rules);
18667
18732
  }
18668
18733
  }
18669
18734
  emStrong(e3, t2, n2 = "") {
18670
- let s2 = this.rules.inline.emStrongLDelim.exec(e3);
18671
- if (!s2 || !s2[1] && !s2[2] && !s2[3] && !s2[4] || s2[4] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
18672
- if (!(s2[1] || s2[3] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
18673
- let i2 = [...s2[0]].length - 1, o2, u2, a2 = i2, p2 = 0, c2 = s2[0][0], h2 = n2 === c2, d2 = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
18674
- for (d2.lastIndex = 0, t2 = t2.slice(-1 * e3.length + i2); (s2 = d2.exec(t2)) !== null; ) {
18675
- if (o2 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o2) continue;
18676
- if (u2 = [...o2].length, s2[3] || s2[4]) {
18735
+ let i2 = this.rules.inline.emStrongLDelim.exec(e3);
18736
+ if (!i2 || !i2[1] && !i2[2] && !i2[3] && !i2[4] || i2[4] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
18737
+ if (!(i2[1] || i2[3] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
18738
+ 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;
18739
+ for (k.lastIndex = 0, t2 = t2.slice(-1 * e3.length + o2); (i2 = k.exec(t2)) !== null; ) {
18740
+ if (s2 = i2[1] || i2[2] || i2[3] || i2[4] || i2[5] || i2[6], !s2) continue;
18741
+ if (u2 = [...s2].length, i2[3] || i2[4]) {
18677
18742
  a2 += u2;
18678
18743
  continue;
18679
- } else if (s2[5] || s2[6]) {
18680
- if (i2 % 3 && !((i2 + u2) % 3)) {
18744
+ } else if (i2[5] || i2[6]) {
18745
+ if (o2 % 3 && !((o2 + u2) % 3)) {
18681
18746
  p2 += u2;
18682
18747
  continue;
18683
18748
  }
@@ -18685,10 +18750,10 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
18685
18750
  }
18686
18751
  if (a2 -= u2, a2 > 0) continue;
18687
18752
  u2 = Math.min(u2, u2 + a2 + p2);
18688
- let O = [...s2[0]][0].length, g2 = e3.slice(0, i2 + s2.index + O + u2);
18689
- if (Math.min(i2, u2) % 2) {
18690
- let E2 = g2.slice(1, -1);
18691
- return { type: "em", raw: g2, text: E2, tokens: this.lexer.inlineTokens(E2) };
18753
+ let O = [...i2[0]][0].length, g2 = e3.slice(0, o2 + i2.index + O + u2);
18754
+ if (Math.min(o2, u2) % 2) {
18755
+ let z = g2.slice(1, -1);
18756
+ return { type: "em", raw: g2, text: z, tokens: this.lexer.inlineTokens(z) };
18692
18757
  }
18693
18758
  let w2 = g2.slice(2, -2);
18694
18759
  return { type: "strong", raw: g2, text: w2, tokens: this.lexer.inlineTokens(w2) };
@@ -18698,8 +18763,8 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
18698
18763
  codespan(e3) {
18699
18764
  let t2 = this.rules.inline.code.exec(e3);
18700
18765
  if (t2) {
18701
- let n2 = t2[2].replace(this.rules.other.newLineCharGlobal, " "), s2 = this.rules.other.nonSpaceChar.test(n2), r2 = this.rules.other.startingSpaceChar.test(n2) && this.rules.other.endingSpaceChar.test(n2);
18702
- return s2 && r2 && (n2 = n2.substring(1, n2.length - 1)), { type: "codespan", raw: t2[0], text: n2 };
18766
+ 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);
18767
+ return i2 && r2 && (n2 = n2.substring(1, n2.length - 1)), { type: "codespan", raw: t2[0], text: n2 };
18703
18768
  }
18704
18769
  }
18705
18770
  br(e3) {
@@ -18707,43 +18772,43 @@ ${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + E2.text;
18707
18772
  if (t2) return { type: "br", raw: t2[0] };
18708
18773
  }
18709
18774
  del(e3, t2, n2 = "") {
18710
- let s2 = this.rules.inline.delLDelim.exec(e3);
18711
- if (!s2) return;
18712
- if (!(s2[1] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
18713
- let i2 = [...s2[0]].length - 1, o2, u2, a2 = i2, p2 = this.rules.inline.delRDelim;
18714
- for (p2.lastIndex = 0, t2 = t2.slice(-1 * e3.length + i2); (s2 = p2.exec(t2)) !== null; ) {
18715
- if (o2 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o2 || (u2 = [...o2].length, u2 !== i2)) continue;
18716
- if (s2[3] || s2[4]) {
18775
+ let i2 = this.rules.inline.delLDelim.exec(e3);
18776
+ if (!i2) return;
18777
+ if (!(i2[1] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
18778
+ let o2 = [...i2[0]].length - 1, s2, u2, a2 = o2, p2 = this.rules.inline.delRDelim;
18779
+ for (p2.lastIndex = 0, t2 = t2.slice(-1 * e3.length + o2); (i2 = p2.exec(t2)) !== null; ) {
18780
+ if (s2 = i2[1] || i2[2] || i2[3] || i2[4] || i2[5] || i2[6], !s2 || (u2 = [...s2].length, u2 !== o2)) continue;
18781
+ if (i2[3] || i2[4]) {
18717
18782
  a2 += u2;
18718
18783
  continue;
18719
18784
  }
18720
18785
  if (a2 -= u2, a2 > 0) continue;
18721
18786
  u2 = Math.min(u2, u2 + a2);
18722
- let c2 = [...s2[0]][0].length, h2 = e3.slice(0, i2 + s2.index + c2 + u2), d2 = h2.slice(i2, -i2);
18723
- return { type: "del", raw: h2, text: d2, tokens: this.lexer.inlineTokens(d2) };
18787
+ let c2 = [...i2[0]][0].length, h2 = e3.slice(0, o2 + i2.index + c2 + u2), k = h2.slice(o2, -o2);
18788
+ return { type: "del", raw: h2, text: k, tokens: this.lexer.inlineTokens(k) };
18724
18789
  }
18725
18790
  }
18726
18791
  }
18727
18792
  autolink(e3) {
18728
18793
  let t2 = this.rules.inline.autolink.exec(e3);
18729
18794
  if (t2) {
18730
- let n2, s2;
18731
- return t2[2] === "@" ? (n2 = t2[1], s2 = "mailto:" + n2) : (n2 = t2[1], s2 = n2), { type: "link", raw: t2[0], text: n2, href: s2, tokens: [{ type: "text", raw: n2, text: n2 }] };
18795
+ let n2, i2;
18796
+ 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 }] };
18732
18797
  }
18733
18798
  }
18734
18799
  url(e3) {
18735
18800
  let t2;
18736
18801
  if (t2 = this.rules.inline.url.exec(e3)) {
18737
- let n2, s2;
18738
- if (t2[2] === "@") n2 = t2[0], s2 = "mailto:" + n2;
18802
+ let n2, i2;
18803
+ if (t2[2] === "@") n2 = t2[0], i2 = "mailto:" + n2;
18739
18804
  else {
18740
18805
  let r2;
18741
18806
  do
18742
18807
  r2 = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? "";
18743
18808
  while (r2 !== t2[0]);
18744
- n2 = t2[0], t2[1] === "www." ? s2 = "http://" + t2[0] : s2 = t2[0];
18809
+ n2 = t2[0], t2[1] === "www." ? i2 = "http://" + t2[0] : i2 = t2[0];
18745
18810
  }
18746
- return { type: "link", raw: t2[0], text: n2, href: s2, tokens: [{ type: "text", raw: n2, text: n2 }] };
18811
+ return { type: "link", raw: t2[0], text: n2, href: i2, autolink: true, tokens: [{ type: "text", raw: n2, text: n2 }] };
18747
18812
  }
18748
18813
  }
18749
18814
  inlineText(e3) {
@@ -18761,12 +18826,12 @@ var x = class l {
18761
18826
  inlineQueue;
18762
18827
  tokenizer;
18763
18828
  constructor(e3) {
18764
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e3 || R, 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 };
18765
- let t2 = { other: m$1, block: H.normal, inline: B.normal };
18766
- this.options.pedantic ? (t2.block = H.pedantic, t2.inline = B.pedantic) : this.options.gfm && (t2.block = H.gfm, this.options.breaks ? t2.inline = B.breaks : t2.inline = B.gfm), this.tokenizer.rules = t2;
18829
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e3 || 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 };
18830
+ let t2 = { other: m$1, block: G.normal, inline: B.normal };
18831
+ 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;
18767
18832
  }
18768
18833
  static get rules() {
18769
- return { block: H, inline: B };
18834
+ return { block: G, inline: B };
18770
18835
  }
18771
18836
  static lex(e3, t2) {
18772
18837
  return new l(t2).lex(e3);
@@ -18785,29 +18850,29 @@ var x = class l {
18785
18850
  }
18786
18851
  blockTokens(e3, t2 = [], n2 = false) {
18787
18852
  this.tokenizer.lexer = this, this.options.pedantic && (e3 = e3.replace(m$1.tabCharGlobal, " ").replace(m$1.spaceLine, ""));
18788
- let s2 = 1 / 0;
18853
+ let i2 = 1 / 0;
18789
18854
  for (; e3; ) {
18790
- if (e3.length < s2) s2 = e3.length;
18855
+ if (e3.length < i2) i2 = e3.length;
18791
18856
  else {
18792
18857
  this.infiniteLoopError(e3.charCodeAt(0));
18793
18858
  break;
18794
18859
  }
18795
18860
  let r2;
18796
- if (this.options.extensions?.block?.some((o2) => (r2 = o2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
18861
+ if (this.options.extensions?.block?.some((s2) => (r2 = s2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
18797
18862
  if (r2 = this.tokenizer.space(e3)) {
18798
18863
  e3 = e3.substring(r2.raw.length);
18799
- let o2 = t2.at(-1);
18800
- r2.raw.length === 1 && o2 !== void 0 ? o2.raw += `
18864
+ let s2 = t2.at(-1);
18865
+ r2.raw.length === 1 && s2 !== void 0 ? s2.raw += `
18801
18866
  ` : t2.push(r2);
18802
18867
  continue;
18803
18868
  }
18804
18869
  if (r2 = this.tokenizer.code(e3)) {
18805
18870
  e3 = e3.substring(r2.raw.length);
18806
- let o2 = t2.at(-1);
18807
- o2?.type === "paragraph" || o2?.type === "text" ? (o2.raw += (o2.raw.endsWith(`
18871
+ let s2 = t2.at(-1);
18872
+ s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
18808
18873
  `) ? "" : `
18809
- `) + r2.raw, o2.text += `
18810
- ` + r2.text, this.inlineQueue.at(-1).src = o2.text) : t2.push(r2);
18874
+ `) + r2.raw, s2.text += `
18875
+ ` + r2.text, this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
18811
18876
  continue;
18812
18877
  }
18813
18878
  if (r2 = this.tokenizer.fences(e3)) {
@@ -18836,11 +18901,11 @@ var x = class l {
18836
18901
  }
18837
18902
  if (r2 = this.tokenizer.def(e3)) {
18838
18903
  e3 = e3.substring(r2.raw.length);
18839
- let o2 = t2.at(-1);
18840
- o2?.type === "paragraph" || o2?.type === "text" ? (o2.raw += (o2.raw.endsWith(`
18904
+ let s2 = t2.at(-1);
18905
+ s2?.type === "paragraph" || s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
18841
18906
  `) ? "" : `
18842
- `) + r2.raw, o2.text += `
18843
- ` + r2.raw, this.inlineQueue.at(-1).src = o2.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2));
18907
+ `) + r2.raw, s2.text += `
18908
+ ` + 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));
18844
18909
  continue;
18845
18910
  }
18846
18911
  if (r2 = this.tokenizer.table(e3)) {
@@ -18851,28 +18916,28 @@ var x = class l {
18851
18916
  e3 = e3.substring(r2.raw.length), t2.push(r2);
18852
18917
  continue;
18853
18918
  }
18854
- let i2 = e3;
18919
+ let o2 = e3;
18855
18920
  if (this.options.extensions?.startBlock) {
18856
- let o2 = 1 / 0, u2 = e3.slice(1), a2;
18921
+ let s2 = 1 / 0, u2 = e3.slice(1), a2;
18857
18922
  this.options.extensions.startBlock.forEach((p2) => {
18858
- a2 = p2.call({ lexer: this }, u2), typeof a2 == "number" && a2 >= 0 && (o2 = Math.min(o2, a2));
18859
- }), o2 < 1 / 0 && o2 >= 0 && (i2 = e3.substring(0, o2 + 1));
18923
+ a2 = p2.call({ lexer: this }, u2), typeof a2 == "number" && a2 >= 0 && (s2 = Math.min(s2, a2));
18924
+ }), s2 < 1 / 0 && s2 >= 0 && (o2 = e3.substring(0, s2 + 1));
18860
18925
  }
18861
- if (this.state.top && (r2 = this.tokenizer.paragraph(i2))) {
18862
- let o2 = t2.at(-1);
18863
- n2 && o2?.type === "paragraph" ? (o2.raw += (o2.raw.endsWith(`
18926
+ if (this.state.top && (r2 = this.tokenizer.paragraph(o2))) {
18927
+ let s2 = t2.at(-1);
18928
+ n2 && s2?.type === "paragraph" ? (s2.raw += (s2.raw.endsWith(`
18864
18929
  `) ? "" : `
18865
- `) + r2.raw, o2.text += `
18866
- ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o2.text) : t2.push(r2), n2 = i2.length !== e3.length, e3 = e3.substring(r2.raw.length);
18930
+ `) + r2.raw, s2.text += `
18931
+ ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2), n2 = o2.length !== e3.length, e3 = e3.substring(r2.raw.length);
18867
18932
  continue;
18868
18933
  }
18869
18934
  if (r2 = this.tokenizer.text(e3)) {
18870
18935
  e3 = e3.substring(r2.raw.length);
18871
- let o2 = t2.at(-1);
18872
- o2?.type === "text" ? (o2.raw += (o2.raw.endsWith(`
18936
+ let s2 = t2.at(-1);
18937
+ s2?.type === "text" ? (s2.raw += (s2.raw.endsWith(`
18873
18938
  `) ? "" : `
18874
- `) + r2.raw, o2.text += `
18875
- ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o2.text) : t2.push(r2);
18939
+ `) + r2.raw, s2.text += `
18940
+ ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
18876
18941
  continue;
18877
18942
  }
18878
18943
  if (e3) {
@@ -18890,8 +18955,8 @@ var x = class l {
18890
18955
  let t2 = this.tokenizer.rules.inline.link;
18891
18956
  for (let n2 of e3.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t2.test(n2[0]) && e3.charAt(n2.index - 1) !== "!") return true;
18892
18957
  for (let n2 of e3.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
18893
- let s2 = n2[0], r2 = s2.lastIndexOf("[");
18894
- if (!(s2.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, s2.slice(r2 + 1, -1))) && !(r2 > 1 && this.linkInText(s2.slice(1, r2 - 1)))) return true;
18958
+ let i2 = n2[0], r2 = i2.lastIndexOf("[");
18959
+ 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;
18895
18960
  }
18896
18961
  return false;
18897
18962
  }
@@ -18899,71 +18964,71 @@ var x = class l {
18899
18964
  this.tokenizer.lexer = this;
18900
18965
  let n2 = e3;
18901
18966
  if (this.tokens.links && e3.includes("[")) {
18902
- let o2 = this.tokenizer.rules.inline.reflinkSearch, u2 = (a2) => {
18967
+ let s2 = this.tokenizer.rules.inline.reflinkSearch, u2 = (a2) => {
18903
18968
  let p2 = a2.lastIndexOf("[");
18904
- if (!Object.hasOwn(this.tokens.links, a2.slice(p2 + 1, -1))) return a2;
18969
+ if (!Object.hasOwn(this.tokens.links, D(a2.slice(p2 + 1, -1)))) return a2;
18905
18970
  if (p2 > 1 && a2.charAt(0) !== "!") {
18906
18971
  let c2 = a2.slice(1, p2 - 1);
18907
- if (this.linkInText(c2)) return "[" + c2.replace(o2, u2) + "][" + "a".repeat(a2.length - p2 - 2) + "]";
18972
+ if (this.linkInText(c2)) return "[" + c2.replace(s2, u2) + "][" + "a".repeat(a2.length - p2 - 2) + "]";
18908
18973
  }
18909
18974
  return "[" + "a".repeat(a2.length - 2) + "]";
18910
18975
  };
18911
- n2 = n2.replace(o2, u2);
18976
+ n2 = n2.replace(s2, u2);
18912
18977
  }
18913
- n2 = n2.replace(this.tokenizer.rules.inline.anyPunctuation, (o2) => "+".repeat(o2.length)), n2 = n2.replace(this.tokenizer.rules.inline.blockSkip, (o2, u2, a2) => {
18978
+ n2 = n2.replace(this.tokenizer.rules.inline.anyPunctuation, (s2) => "+".repeat(s2.length)), n2 = n2.replace(this.tokenizer.rules.inline.blockSkip, (s2, u2, a2) => {
18914
18979
  let p2 = a2 ? a2.length : 0;
18915
- return o2.slice(0, p2) + "[" + "a".repeat(o2.length - p2 - 2) + "]";
18980
+ return s2.slice(0, p2) + "[" + "a".repeat(s2.length - p2 - 2) + "]";
18916
18981
  }), n2 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n2) ?? n2;
18917
- let s2 = false, r2 = "", i2 = 1 / 0;
18982
+ let i2 = false, r2 = "", o2 = 1 / 0;
18918
18983
  for (; e3; ) {
18919
- if (e3.length < i2) i2 = e3.length;
18984
+ if (e3.length < o2) o2 = e3.length;
18920
18985
  else {
18921
18986
  this.infiniteLoopError(e3.charCodeAt(0));
18922
18987
  break;
18923
18988
  }
18924
- s2 || (r2 = ""), s2 = false;
18925
- let o2;
18926
- if (this.options.extensions?.inline?.some((a2) => (o2 = a2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(o2.raw.length), t2.push(o2), true) : false)) continue;
18927
- if (o2 = this.tokenizer.escape(e3)) {
18928
- e3 = e3.substring(o2.raw.length), t2.push(o2);
18989
+ i2 || (r2 = ""), i2 = false;
18990
+ let s2;
18991
+ if (this.options.extensions?.inline?.some((a2) => (s2 = a2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(s2.raw.length), t2.push(s2), true) : false)) continue;
18992
+ if (s2 = this.tokenizer.escape(e3)) {
18993
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18929
18994
  continue;
18930
18995
  }
18931
- if (o2 = this.tokenizer.tag(e3)) {
18932
- e3 = e3.substring(o2.raw.length), t2.push(o2);
18996
+ if (s2 = this.tokenizer.tag(e3)) {
18997
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18933
18998
  continue;
18934
18999
  }
18935
- if (o2 = this.tokenizer.link(e3)) {
18936
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19000
+ if (s2 = this.tokenizer.link(e3)) {
19001
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18937
19002
  continue;
18938
19003
  }
18939
- if (o2 = this.tokenizer.reflink(e3, this.tokens.links)) {
18940
- e3 = e3.substring(o2.raw.length);
19004
+ if (s2 = this.tokenizer.reflink(e3, this.tokens.links)) {
19005
+ e3 = e3.substring(s2.raw.length);
18941
19006
  let a2 = t2.at(-1);
18942
- o2.type === "text" && a2?.type === "text" ? (a2.raw += o2.raw, a2.text += o2.text) : t2.push(o2);
19007
+ s2.type === "text" && a2?.type === "text" ? (a2.raw += s2.raw, a2.text += s2.text) : t2.push(s2);
18943
19008
  continue;
18944
19009
  }
18945
- if (o2 = this.tokenizer.emStrong(e3, n2, r2)) {
18946
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19010
+ if (s2 = this.tokenizer.emStrong(e3, n2, r2)) {
19011
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18947
19012
  continue;
18948
19013
  }
18949
- if (o2 = this.tokenizer.codespan(e3)) {
18950
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19014
+ if (s2 = this.tokenizer.codespan(e3)) {
19015
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18951
19016
  continue;
18952
19017
  }
18953
- if (o2 = this.tokenizer.br(e3)) {
18954
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19018
+ if (s2 = this.tokenizer.br(e3)) {
19019
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18955
19020
  continue;
18956
19021
  }
18957
- if (o2 = this.tokenizer.del(e3, n2, r2)) {
18958
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19022
+ if (s2 = this.tokenizer.del(e3, n2, r2)) {
19023
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18959
19024
  continue;
18960
19025
  }
18961
- if (o2 = this.tokenizer.autolink(e3)) {
18962
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19026
+ if (s2 = this.tokenizer.autolink(e3)) {
19027
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18963
19028
  continue;
18964
19029
  }
18965
- if (!this.state.inLink && (o2 = this.tokenizer.url(e3))) {
18966
- e3 = e3.substring(o2.raw.length), t2.push(o2);
19030
+ if (!this.state.inLink && (s2 = this.tokenizer.url(e3))) {
19031
+ e3 = e3.substring(s2.raw.length), t2.push(s2);
18967
19032
  continue;
18968
19033
  }
18969
19034
  let u2 = e3;
@@ -18973,10 +19038,10 @@ var x = class l {
18973
19038
  c2 = h2.call({ lexer: this }, p2), typeof c2 == "number" && c2 >= 0 && (a2 = Math.min(a2, c2));
18974
19039
  }), a2 < 1 / 0 && a2 >= 0 && (u2 = e3.substring(0, a2 + 1));
18975
19040
  }
18976
- if (o2 = this.tokenizer.inlineText(u2)) {
18977
- e3 = e3.substring(o2.raw.length), o2.raw.slice(-1) !== "_" && (r2 = o2.raw.slice(-1)), s2 = true;
19041
+ if (s2 = this.tokenizer.inlineText(u2)) {
19042
+ e3 = e3.substring(s2.raw.length), s2.raw.slice(-1) !== "_" && (r2 = s2.raw.slice(-1)), i2 = true;
18978
19043
  let a2 = t2.at(-1);
18979
- a2?.type === "text" ? (a2.raw += o2.raw, a2.text += o2.text) : t2.push(o2);
19044
+ a2?.type === "text" ? (a2.raw += s2.raw, a2.text += s2.text) : t2.push(s2);
18980
19045
  continue;
18981
19046
  }
18982
19047
  if (e3) {
@@ -18996,16 +19061,16 @@ var P$1 = class P {
18996
19061
  options;
18997
19062
  parser;
18998
19063
  constructor(e3) {
18999
- this.options = e3 || R;
19064
+ this.options = e3 || T;
19000
19065
  }
19001
19066
  space(e3) {
19002
19067
  return "";
19003
19068
  }
19004
19069
  code({ text: e3, lang: t2, escaped: n2 }) {
19005
- let s2 = (t2 || "").match(m$1.notSpaceStart)?.[0], r2 = e3.replace(m$1.endingNewline, "") + `
19006
- `;
19007
- return s2 ? '<pre><code class="language-' + T(s2) + '">' + (n2 ? r2 : T(r2, true)) + `</code></pre>
19008
- ` : "<pre><code>" + (n2 ? r2 : T(r2, true)) + `</code></pre>
19070
+ let i2 = (t2 || "").match(m$1.notSpaceStart)?.[0], r2 = e3 ? e3.replace(m$1.endingNewline, "") + `
19071
+ ` : "";
19072
+ return i2 ? '<pre><code class="language-' + R(i2) + '">' + (n2 ? r2 : R(r2, true)) + `</code></pre>
19073
+ ` : "<pre><code>" + (n2 ? r2 : R(r2, true)) + `</code></pre>
19009
19074
  `;
19010
19075
  }
19011
19076
  blockquote({ tokens: e3 }) {
@@ -19028,14 +19093,14 @@ ${this.parser.parse(e3)}</blockquote>
19028
19093
  `;
19029
19094
  }
19030
19095
  list(e3) {
19031
- let t2 = e3.ordered, n2 = e3.start, s2 = "";
19032
- for (let o2 = 0; o2 < e3.items.length; o2++) {
19033
- let u2 = e3.items[o2];
19034
- s2 += this.listitem(u2);
19035
- }
19036
- let r2 = t2 ? "ol" : "ul", i2 = t2 && n2 !== 1 ? ' start="' + n2 + '"' : "";
19037
- return "<" + r2 + i2 + `>
19038
- ` + s2 + "</" + r2 + `>
19096
+ let t2 = e3.ordered, n2 = e3.start, i2 = "";
19097
+ for (let s2 = 0; s2 < e3.items.length; s2++) {
19098
+ let u2 = e3.items[s2];
19099
+ i2 += this.listitem(u2);
19100
+ }
19101
+ let r2 = t2 ? "ol" : "ul", o2 = t2 && n2 !== 1 ? ' start="' + n2 + '"' : "";
19102
+ return "<" + r2 + o2 + `>
19103
+ ` + i2 + "</" + r2 + `>
19039
19104
  `;
19040
19105
  }
19041
19106
  listitem(e3) {
@@ -19053,17 +19118,17 @@ ${this.parser.parse(e3)}</blockquote>
19053
19118
  let t2 = "", n2 = "";
19054
19119
  for (let r2 = 0; r2 < e3.header.length; r2++) n2 += this.tablecell(e3.header[r2]);
19055
19120
  t2 += this.tablerow({ text: n2 });
19056
- let s2 = "";
19121
+ let i2 = "";
19057
19122
  for (let r2 = 0; r2 < e3.rows.length; r2++) {
19058
- let i2 = e3.rows[r2];
19123
+ let o2 = e3.rows[r2];
19059
19124
  n2 = "";
19060
- for (let o2 = 0; o2 < i2.length; o2++) n2 += this.tablecell(i2[o2]);
19061
- s2 += this.tablerow({ text: n2 });
19125
+ for (let s2 = 0; s2 < o2.length; s2++) n2 += this.tablecell(o2[s2]);
19126
+ i2 += this.tablerow({ text: n2 });
19062
19127
  }
19063
- return s2 && (s2 = `<tbody>${s2}</tbody>`), `<table>
19128
+ return i2 && (i2 = `<tbody>${i2}</tbody>`), `<table>
19064
19129
  <thead>
19065
19130
  ` + t2 + `</thead>
19066
- ` + s2 + `</table>
19131
+ ` + i2 + `</table>
19067
19132
  `;
19068
19133
  }
19069
19134
  tablerow({ text: e3 }) {
@@ -19083,7 +19148,7 @@ ${e3}</tr>
19083
19148
  return `<em>${this.parser.parseInline(e3)}</em>`;
19084
19149
  }
19085
19150
  codespan({ text: e3 }) {
19086
- return `<code>${T(e3, true)}</code>`;
19151
+ return `<code>${R(e3, true)}</code>`;
19087
19152
  }
19088
19153
  br(e3) {
19089
19154
  return "<br>";
@@ -19091,23 +19156,23 @@ ${e3}</tr>
19091
19156
  del({ tokens: e3 }) {
19092
19157
  return `<del>${this.parser.parseInline(e3)}</del>`;
19093
19158
  }
19094
- link({ href: e3, title: t2, tokens: n2 }) {
19095
- let s2 = this.parser.parseInline(n2), r2 = Y(e3);
19096
- if (r2 === null) return s2;
19097
- e3 = r2;
19098
- let i2 = '<a href="' + e3 + '"';
19099
- return t2 && (i2 += ' title="' + T(t2) + '"'), i2 += ">" + s2 + "</a>", i2;
19100
- }
19101
- image({ href: e3, title: t2, text: n2, tokens: s2 }) {
19102
- s2 && (n2 = this.parser.parseInline(s2, this.parser.textRenderer));
19103
- let r2 = Y(e3);
19104
- if (r2 === null) return T(n2);
19159
+ link({ href: e3, title: t2, text: n2, tokens: i2, autolink: r2 }) {
19160
+ let o2 = r2 ? R(n2, true) : this.parser.parseInline(i2), s2 = ee(e3);
19161
+ if (s2 === null) return o2;
19162
+ e3 = R(s2, r2);
19163
+ let u2 = '<a href="' + e3 + '"';
19164
+ return t2 && (u2 += ' title="' + R(t2) + '"'), u2 += ">" + o2 + "</a>", u2;
19165
+ }
19166
+ image({ href: e3, title: t2, text: n2, tokens: i2 }) {
19167
+ i2 && (n2 = this.parser.parseInline(i2, this.parser.textRenderer));
19168
+ let r2 = ee(e3);
19169
+ if (r2 === null) return R(n2);
19105
19170
  e3 = r2;
19106
- let i2 = `<img src="${e3}" alt="${T(n2)}"`;
19107
- return t2 && (i2 += ` title="${T(t2)}"`), i2 += ">", i2;
19171
+ let o2 = `<img src="${R(e3)}" alt="${R(n2)}"`;
19172
+ return t2 && (o2 += ` title="${R(t2)}"`), o2 += ">", o2;
19108
19173
  }
19109
19174
  text(e3) {
19110
- return "tokens" in e3 && e3.tokens ? this.parser.parseInline(e3.tokens) : "escaped" in e3 && e3.escaped ? e3.text : T(e3.text);
19175
+ return "tokens" in e3 && e3.tokens ? this.parser.parseInline(e3.tokens) : "escaped" in e3 && e3.escaped ? e3.text : R(e3.text);
19111
19176
  }
19112
19177
  };
19113
19178
  var L = class {
@@ -19147,7 +19212,7 @@ var b$1 = class l2 {
19147
19212
  renderer;
19148
19213
  textRenderer;
19149
19214
  constructor(e3) {
19150
- this.options = e3 || R, 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();
19215
+ this.options = e3 || 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();
19151
19216
  }
19152
19217
  static parse(e3, t2) {
19153
19218
  return new l2(t2).parse(e3);
@@ -19159,15 +19224,15 @@ var b$1 = class l2 {
19159
19224
  this.renderer.parser = this;
19160
19225
  let t2 = "";
19161
19226
  for (let n2 = 0; n2 < e3.length; n2++) {
19162
- let s2 = e3[n2];
19163
- if (this.options.extensions?.renderers?.[s2.type]) {
19164
- let i2 = s2, o2 = this.options.extensions.renderers[i2.type].call({ parser: this }, i2);
19165
- if (o2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(i2.type)) {
19166
- t2 += o2 || "";
19227
+ let i2 = e3[n2];
19228
+ if (this.options.extensions?.renderers?.[i2.type]) {
19229
+ let o2 = i2, s2 = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
19230
+ if (s2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o2.type)) {
19231
+ t2 += s2 || "";
19167
19232
  continue;
19168
19233
  }
19169
19234
  }
19170
- let r2 = s2;
19235
+ let r2 = i2;
19171
19236
  switch (r2.type) {
19172
19237
  case "space": {
19173
19238
  t2 += this.renderer.space(r2);
@@ -19218,9 +19283,9 @@ var b$1 = class l2 {
19218
19283
  break;
19219
19284
  }
19220
19285
  default: {
19221
- let i2 = 'Token with "' + r2.type + '" type was not found.';
19222
- if (this.options.silent) return console.error(i2), "";
19223
- throw new Error(i2);
19286
+ let o2 = 'Token with "' + r2.type + '" type was not found.';
19287
+ if (this.options.silent) return console.error(o2), "";
19288
+ throw new Error(o2);
19224
19289
  }
19225
19290
  }
19226
19291
  }
@@ -19229,65 +19294,65 @@ var b$1 = class l2 {
19229
19294
  parseInline(e3, t2 = this.renderer) {
19230
19295
  this.renderer.parser = this;
19231
19296
  let n2 = "";
19232
- for (let s2 = 0; s2 < e3.length; s2++) {
19233
- let r2 = e3[s2];
19297
+ for (let i2 = 0; i2 < e3.length; i2++) {
19298
+ let r2 = e3[i2];
19234
19299
  if (this.options.extensions?.renderers?.[r2.type]) {
19235
- let o2 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
19236
- if (o2 !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
19237
- n2 += o2 || "";
19300
+ let s2 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
19301
+ if (s2 !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
19302
+ n2 += s2 || "";
19238
19303
  continue;
19239
19304
  }
19240
19305
  }
19241
- let i2 = r2;
19242
- switch (i2.type) {
19306
+ let o2 = r2;
19307
+ switch (o2.type) {
19243
19308
  case "escape": {
19244
- n2 += t2.text(i2);
19309
+ n2 += t2.text(o2);
19245
19310
  break;
19246
19311
  }
19247
19312
  case "html": {
19248
- n2 += t2.html(i2);
19313
+ n2 += t2.html(o2);
19249
19314
  break;
19250
19315
  }
19251
19316
  case "link": {
19252
- n2 += t2.link(i2);
19317
+ n2 += t2.link(o2);
19253
19318
  break;
19254
19319
  }
19255
19320
  case "image": {
19256
- n2 += t2.image(i2);
19321
+ n2 += t2.image(o2);
19257
19322
  break;
19258
19323
  }
19259
19324
  case "checkbox": {
19260
- n2 += t2.checkbox(i2);
19325
+ n2 += t2.checkbox(o2);
19261
19326
  break;
19262
19327
  }
19263
19328
  case "strong": {
19264
- n2 += t2.strong(i2);
19329
+ n2 += t2.strong(o2);
19265
19330
  break;
19266
19331
  }
19267
19332
  case "em": {
19268
- n2 += t2.em(i2);
19333
+ n2 += t2.em(o2);
19269
19334
  break;
19270
19335
  }
19271
19336
  case "codespan": {
19272
- n2 += t2.codespan(i2);
19337
+ n2 += t2.codespan(o2);
19273
19338
  break;
19274
19339
  }
19275
19340
  case "br": {
19276
- n2 += t2.br(i2);
19341
+ n2 += t2.br(o2);
19277
19342
  break;
19278
19343
  }
19279
19344
  case "del": {
19280
- n2 += t2.del(i2);
19345
+ n2 += t2.del(o2);
19281
19346
  break;
19282
19347
  }
19283
19348
  case "text": {
19284
- n2 += t2.text(i2);
19349
+ n2 += t2.text(o2);
19285
19350
  break;
19286
19351
  }
19287
19352
  default: {
19288
- let o2 = 'Token with "' + i2.type + '" type was not found.';
19289
- if (this.options.silent) return console.error(o2), "";
19290
- throw new Error(o2);
19353
+ let s2 = 'Token with "' + o2.type + '" type was not found.';
19354
+ if (this.options.silent) return console.error(s2), "";
19355
+ throw new Error(s2);
19291
19356
  }
19292
19357
  }
19293
19358
  }
@@ -19298,7 +19363,7 @@ var S$1 = class S {
19298
19363
  options;
19299
19364
  block;
19300
19365
  constructor(e3) {
19301
- this.options = e3 || R;
19366
+ this.options = e3 || T;
19302
19367
  }
19303
19368
  static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
19304
19369
  static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
@@ -19321,7 +19386,7 @@ var S$1 = class S {
19321
19386
  return e3 ? b$1.parse : b$1.parseInline;
19322
19387
  }
19323
19388
  };
19324
- var Z = class {
19389
+ var Q = class {
19325
19390
  defaults = A();
19326
19391
  options = this.setOptions;
19327
19392
  parse = this.parseMarkdown(true);
@@ -19337,23 +19402,23 @@ var Z = class {
19337
19402
  }
19338
19403
  walkTokens(e3, t2) {
19339
19404
  let n2 = [];
19340
- for (let s2 of e3) switch (n2 = n2.concat(t2.call(this, s2)), s2.type) {
19405
+ for (let i2 of e3) switch (n2 = n2.concat(t2.call(this, i2)), i2.type) {
19341
19406
  case "table": {
19342
- let r2 = s2;
19343
- for (let i2 of r2.header) n2 = n2.concat(this.walkTokens(i2.tokens, t2));
19344
- for (let i2 of r2.rows) for (let o2 of i2) n2 = n2.concat(this.walkTokens(o2.tokens, t2));
19407
+ let r2 = i2;
19408
+ for (let o2 of r2.header) n2 = n2.concat(this.walkTokens(o2.tokens, t2));
19409
+ for (let o2 of r2.rows) for (let s2 of o2) n2 = n2.concat(this.walkTokens(s2.tokens, t2));
19345
19410
  break;
19346
19411
  }
19347
19412
  case "list": {
19348
- let r2 = s2;
19413
+ let r2 = i2;
19349
19414
  n2 = n2.concat(this.walkTokens(r2.items, t2));
19350
19415
  break;
19351
19416
  }
19352
19417
  default: {
19353
- let r2 = s2;
19354
- this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((i2) => {
19355
- let o2 = r2[i2].flat(1 / 0);
19356
- n2 = n2.concat(this.walkTokens(o2, t2));
19418
+ let r2 = i2;
19419
+ this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((o2) => {
19420
+ let s2 = r2[o2].flat(1 / 0);
19421
+ n2 = n2.concat(this.walkTokens(s2, t2));
19357
19422
  }) : r2.tokens && (n2 = n2.concat(this.walkTokens(r2.tokens, t2)));
19358
19423
  }
19359
19424
  }
@@ -19362,62 +19427,62 @@ var Z = class {
19362
19427
  use(...e3) {
19363
19428
  let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
19364
19429
  return e3.forEach((n2) => {
19365
- let s2 = { ...n2 };
19366
- if (s2.async = this.defaults.async || s2.async || false, n2.extensions && (n2.extensions.forEach((r2) => {
19430
+ let i2 = { ...n2 };
19431
+ if (i2.async = this.defaults.async || i2.async || false, n2.extensions && (n2.extensions.forEach((r2) => {
19367
19432
  if (!r2.name) throw new Error("extension name required");
19368
19433
  if ("renderer" in r2) {
19369
- let i2 = t2.renderers[r2.name];
19370
- i2 ? t2.renderers[r2.name] = function(...o2) {
19371
- let u2 = r2.renderer.apply(this, o2);
19372
- return u2 === false && (u2 = i2.apply(this, o2)), u2;
19434
+ let o2 = t2.renderers[r2.name];
19435
+ o2 ? t2.renderers[r2.name] = function(...s2) {
19436
+ let u2 = r2.renderer.apply(this, s2);
19437
+ return u2 === false && (u2 = o2.apply(this, s2)), u2;
19373
19438
  } : t2.renderers[r2.name] = r2.renderer;
19374
19439
  }
19375
19440
  if ("tokenizer" in r2) {
19376
19441
  if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
19377
- let i2 = t2[r2.level];
19378
- i2 ? i2.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]));
19442
+ let o2 = t2[r2.level];
19443
+ 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]));
19379
19444
  }
19380
19445
  "childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
19381
- }), s2.extensions = t2), n2.renderer) {
19446
+ }), i2.extensions = t2), n2.renderer) {
19382
19447
  let r2 = this.defaults.renderer || new P$1(this.defaults);
19383
- for (let i2 in n2.renderer) {
19384
- if (!(i2 in r2)) throw new Error(`renderer '${i2}' does not exist`);
19385
- if (["options", "parser"].includes(i2)) continue;
19386
- let o2 = i2, u2 = n2.renderer[o2], a2 = r2[o2];
19387
- r2[o2] = (...p2) => {
19448
+ for (let o2 in n2.renderer) {
19449
+ if (!(o2 in r2)) throw new Error(`renderer '${o2}' does not exist`);
19450
+ if (["options", "parser"].includes(o2)) continue;
19451
+ let s2 = o2, u2 = n2.renderer[s2], a2 = r2[s2];
19452
+ r2[s2] = (...p2) => {
19388
19453
  let c2 = u2.apply(r2, p2);
19389
19454
  return c2 === false && (c2 = a2.apply(r2, p2)), c2 || "";
19390
19455
  };
19391
19456
  }
19392
- s2.renderer = r2;
19457
+ i2.renderer = r2;
19393
19458
  }
19394
19459
  if (n2.tokenizer) {
19395
19460
  let r2 = this.defaults.tokenizer || new y$1(this.defaults);
19396
- for (let i2 in n2.tokenizer) {
19397
- if (!(i2 in r2)) throw new Error(`tokenizer '${i2}' does not exist`);
19398
- if (["options", "rules", "lexer"].includes(i2)) continue;
19399
- let o2 = i2, u2 = n2.tokenizer[o2], a2 = r2[o2];
19400
- r2[o2] = (...p2) => {
19461
+ for (let o2 in n2.tokenizer) {
19462
+ if (!(o2 in r2)) throw new Error(`tokenizer '${o2}' does not exist`);
19463
+ if (["options", "rules", "lexer"].includes(o2)) continue;
19464
+ let s2 = o2, u2 = n2.tokenizer[s2], a2 = r2[s2];
19465
+ r2[s2] = (...p2) => {
19401
19466
  let c2 = u2.apply(r2, p2);
19402
19467
  return c2 === false && (c2 = a2.apply(r2, p2)), c2;
19403
19468
  };
19404
19469
  }
19405
- s2.tokenizer = r2;
19470
+ i2.tokenizer = r2;
19406
19471
  }
19407
19472
  if (n2.hooks) {
19408
19473
  let r2 = this.defaults.hooks || new S$1();
19409
- for (let i2 in n2.hooks) {
19410
- if (!(i2 in r2)) throw new Error(`hook '${i2}' does not exist`);
19411
- if (["options", "block"].includes(i2)) continue;
19412
- let o2 = i2, u2 = n2.hooks[o2], a2 = r2[o2];
19413
- S$1.passThroughHooks.has(i2) ? r2[o2] = (p2) => {
19414
- if (this.defaults.async && S$1.passThroughHooksRespectAsync.has(i2)) return (async () => {
19474
+ for (let o2 in n2.hooks) {
19475
+ if (!(o2 in r2)) throw new Error(`hook '${o2}' does not exist`);
19476
+ if (["options", "block"].includes(o2)) continue;
19477
+ let s2 = o2, u2 = n2.hooks[s2], a2 = r2[s2];
19478
+ S$1.passThroughHooks.has(o2) ? r2[s2] = (p2) => {
19479
+ if (this.defaults.async && S$1.passThroughHooksRespectAsync.has(o2)) return (async () => {
19415
19480
  let h2 = await u2.call(r2, p2);
19416
19481
  return a2.call(r2, h2);
19417
19482
  })();
19418
19483
  let c2 = u2.call(r2, p2);
19419
19484
  return a2.call(r2, c2);
19420
- } : r2[o2] = (...p2) => {
19485
+ } : r2[s2] = (...p2) => {
19421
19486
  if (this.defaults.async) return (async () => {
19422
19487
  let h2 = await u2.apply(r2, p2);
19423
19488
  return h2 === false && (h2 = await a2.apply(r2, p2)), h2;
@@ -19426,16 +19491,16 @@ var Z = class {
19426
19491
  return c2 === false && (c2 = a2.apply(r2, p2)), c2;
19427
19492
  };
19428
19493
  }
19429
- s2.hooks = r2;
19494
+ i2.hooks = r2;
19430
19495
  }
19431
19496
  if (n2.walkTokens) {
19432
- let r2 = this.defaults.walkTokens, i2 = n2.walkTokens;
19433
- s2.walkTokens = function(o2) {
19497
+ let r2 = this.defaults.walkTokens, o2 = n2.walkTokens;
19498
+ i2.walkTokens = function(s2) {
19434
19499
  let u2 = [];
19435
- return u2.push(i2.call(this, o2)), r2 && (u2 = u2.concat(r2.call(this, o2))), u2;
19500
+ return u2.push(o2.call(this, s2)), r2 && (u2 = u2.concat(r2.call(this, s2))), u2;
19436
19501
  };
19437
19502
  }
19438
- this.defaults = { ...this.defaults, ...s2 };
19503
+ this.defaults = { ...this.defaults, ...i2 };
19439
19504
  }), this;
19440
19505
  }
19441
19506
  setOptions(e3) {
@@ -19448,25 +19513,25 @@ var Z = class {
19448
19513
  return b$1.parse(e3, t2 ?? this.defaults);
19449
19514
  }
19450
19515
  parseMarkdown(e3) {
19451
- return (n2, s2) => {
19452
- let r2 = { ...s2 }, i2 = { ...this.defaults, ...r2 }, o2 = this.onError(!!i2.silent, !!i2.async);
19453
- if (this.defaults.async === true && r2.async === false) return o2(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."));
19454
- if (typeof n2 > "u" || n2 === null) return o2(new Error("marked(): input parameter is undefined or null"));
19455
- if (typeof n2 != "string") return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
19456
- if (i2.hooks && (i2.hooks.options = i2, i2.hooks.block = e3), i2.async) return (async () => {
19457
- let u2 = i2.hooks ? await i2.hooks.preprocess(n2) : n2, p2 = await (i2.hooks ? await i2.hooks.provideLexer(e3) : e3 ? x.lex : x.lexInline)(u2, i2), c2 = i2.hooks ? await i2.hooks.processAllTokens(p2) : p2;
19458
- i2.walkTokens && await Promise.all(this.walkTokens(c2, i2.walkTokens));
19459
- let d2 = await (i2.hooks ? await i2.hooks.provideParser(e3) : e3 ? b$1.parse : b$1.parseInline)(c2, i2);
19460
- return i2.hooks ? await i2.hooks.postprocess(d2) : d2;
19461
- })().catch(o2);
19516
+ return (n2, i2) => {
19517
+ let r2 = { ...i2 }, o2 = { ...this.defaults, ...r2 }, s2 = this.onError(!!o2.silent, !!o2.async);
19518
+ 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."));
19519
+ if (typeof n2 > "u" || n2 === null) return s2(new Error("marked(): input parameter is undefined or null"));
19520
+ if (typeof n2 != "string") return s2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
19521
+ if (o2.hooks && (o2.hooks.options = o2, o2.hooks.block = e3), o2.async) return (async () => {
19522
+ let u2 = o2.hooks ? await o2.hooks.preprocess(n2) : n2, p2 = await (o2.hooks ? await o2.hooks.provideLexer(e3) : e3 ? x.lex : x.lexInline)(u2, o2), c2 = o2.hooks ? await o2.hooks.processAllTokens(p2) : p2;
19523
+ o2.walkTokens && await Promise.all(this.walkTokens(c2, o2.walkTokens));
19524
+ let k = await (o2.hooks ? await o2.hooks.provideParser(e3) : e3 ? b$1.parse : b$1.parseInline)(c2, o2);
19525
+ return o2.hooks ? await o2.hooks.postprocess(k) : k;
19526
+ })().catch(s2);
19462
19527
  try {
19463
- i2.hooks && (n2 = i2.hooks.preprocess(n2));
19464
- let a2 = (i2.hooks ? i2.hooks.provideLexer(e3) : e3 ? x.lex : x.lexInline)(n2, i2);
19465
- i2.hooks && (a2 = i2.hooks.processAllTokens(a2)), i2.walkTokens && this.walkTokens(a2, i2.walkTokens);
19466
- let c2 = (i2.hooks ? i2.hooks.provideParser(e3) : e3 ? b$1.parse : b$1.parseInline)(a2, i2);
19467
- return i2.hooks && (c2 = i2.hooks.postprocess(c2)), c2;
19528
+ o2.hooks && (n2 = o2.hooks.preprocess(n2));
19529
+ let a2 = (o2.hooks ? o2.hooks.provideLexer(e3) : e3 ? x.lex : x.lexInline)(n2, o2);
19530
+ o2.hooks && (a2 = o2.hooks.processAllTokens(a2)), o2.walkTokens && this.walkTokens(a2, o2.walkTokens);
19531
+ let c2 = (o2.hooks ? o2.hooks.provideParser(e3) : e3 ? b$1.parse : b$1.parseInline)(a2, o2);
19532
+ return o2.hooks && (c2 = o2.hooks.postprocess(c2)), c2;
19468
19533
  } catch (u2) {
19469
- return o2(u2);
19534
+ return s2(u2);
19470
19535
  }
19471
19536
  };
19472
19537
  }
@@ -19474,27 +19539,27 @@ var Z = class {
19474
19539
  return (n2) => {
19475
19540
  if (n2.message += `
19476
19541
  Please report this to https://github.com/markedjs/marked.`, e3) {
19477
- let s2 = "<p>An error occurred:</p><pre>" + T(n2.message + "", true) + "</pre>";
19478
- return t2 ? Promise.resolve(s2) : s2;
19542
+ let i2 = "<p>An error occurred:</p><pre>" + R(n2.message + "", true) + "</pre>";
19543
+ return t2 ? Promise.resolve(i2) : i2;
19479
19544
  }
19480
19545
  if (t2) return Promise.reject(n2);
19481
19546
  throw n2;
19482
19547
  };
19483
19548
  }
19484
19549
  };
19485
- var M = new Z();
19550
+ var M = new Q();
19486
19551
  function f$1(l4, e3) {
19487
19552
  return M.parse(l4, e3);
19488
19553
  }
19489
19554
  f$1.options = f$1.setOptions = function(l4) {
19490
- return M.setOptions(l4), f$1.defaults = M.defaults, j(f$1.defaults), f$1;
19555
+ return M.setOptions(l4), f$1.defaults = M.defaults, U(f$1.defaults), f$1;
19491
19556
  };
19492
19557
  f$1.getDefaults = A;
19493
- f$1.defaults = R;
19494
- function dt(...l4) {
19495
- return M.use(...l4), f$1.defaults = M.defaults, j(f$1.defaults), f$1;
19558
+ f$1.defaults = T;
19559
+ function bt(...l4) {
19560
+ return M.use(...l4), f$1.defaults = M.defaults, U(f$1.defaults), f$1;
19496
19561
  }
19497
- f$1.use = dt;
19562
+ f$1.use = bt;
19498
19563
  f$1.walkTokens = function(l4, e3) {
19499
19564
  return M.walkTokens(l4, e3);
19500
19565
  };
@@ -19845,7 +19910,7 @@ const _resolveObjectOption = function _resolveObjectOption2(cfg, key, makeFallba
19845
19910
  function createDOMPurify() {
19846
19911
  let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
19847
19912
  const DOMPurify = (root2) => createDOMPurify(root2);
19848
- DOMPurify.version = "3.4.14";
19913
+ DOMPurify.version = "3.4.15";
19849
19914
  DOMPurify.removed = [];
19850
19915
  if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
19851
19916
  DOMPurify.isSupported = false;
@@ -19862,6 +19927,7 @@ function createDOMPurify() {
19862
19927
  const ElementPrototype = Element2.prototype;
19863
19928
  const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
19864
19929
  const remove2 = lookupGetter(ElementPrototype, "remove");
19930
+ const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
19865
19931
  const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
19866
19932
  const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
19867
19933
  const getParentNode2 = lookupGetter(ElementPrototype, "parentNode");
@@ -20295,7 +20361,7 @@ function createDOMPurify() {
20295
20361
  };
20296
20362
  const _stripAttributeNode = function _stripAttributeNode2(element, attribute, name) {
20297
20363
  try {
20298
- element.removeAttributeNode(attribute);
20364
+ removeAttributeNode(element, attribute);
20299
20365
  } catch (_2) {
20300
20366
  try {
20301
20367
  element.removeAttribute(name);
@@ -20343,7 +20409,7 @@ function createDOMPurify() {
20343
20409
  });
20344
20410
  try {
20345
20411
  if (attr) {
20346
- element.removeAttributeNode(attr);
20412
+ removeAttributeNode(element, attr);
20347
20413
  } else {
20348
20414
  element.removeAttribute(name);
20349
20415
  }
@@ -20531,7 +20597,16 @@ function createDOMPurify() {
20531
20597
  // makes the direct read diverge from the cached read; a clean form
20532
20598
  // (same-realm OR foreign-realm) has both reads pointing at the same
20533
20599
  // canonical NamedNodeMap.
20534
- element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "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
20600
+ element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || // A form descendant named "removeAttributeNode" or "getAttributeNode"
20601
+ // shadows these Attr-node methods via [LegacyOverrideBuiltIns].
20602
+ // _removeAttribute() / _stripAttributeNode() reach for
20603
+ // element.removeAttributeNode(attr) first; when it is shadowed the call
20604
+ // throws and the name-based fallback element.removeAttribute(name)
20605
+ // ASCII-lowercases its lookup key in an HTML document, silently missing
20606
+ // a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
20607
+ // that reached the sanitizer through an XML/XHTML parse). Flag the form
20608
+ // so it is removed wholesale, exactly as for the other shadowed methods.
20609
+ 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
20535
20610
  // returns the integer 1 for any Element regardless of realm; direct
20536
20611
  // read on a clobbered form (e.g. <input name="nodeType">) returns
20537
20612
  // the named child element. Cheap addition — nodeType is read from
@@ -20757,11 +20832,12 @@ function createDOMPurify() {
20757
20832
  }
20758
20833
  if (_isClobbered(currentNode)) {
20759
20834
  _forceRemove(currentNode);
20760
- } else {
20761
- arrayPop(DOMPurify.removed);
20835
+ return false;
20762
20836
  }
20837
+ return true;
20763
20838
  } catch (_2) {
20764
20839
  _removeAttribute(name, currentNode);
20840
+ return false;
20765
20841
  }
20766
20842
  };
20767
20843
  const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
@@ -20786,6 +20862,7 @@ function createDOMPurify() {
20786
20862
  const lcName = transformCaseFunc(name);
20787
20863
  const initValue = attrValue;
20788
20864
  let value = name === "value" ? initValue : stringTrim(initValue);
20865
+ let recreatedNamedProp = false;
20789
20866
  hookEvent.attrName = lcName;
20790
20867
  hookEvent.attrValue = value;
20791
20868
  hookEvent.keepAttr = true;
@@ -20795,6 +20872,7 @@ function createDOMPurify() {
20795
20872
  if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
20796
20873
  _removeAttribute(name, currentNode, attr);
20797
20874
  value = SANITIZE_NAMED_PROPS_PREFIX + value;
20875
+ recreatedNamedProp = true;
20798
20876
  }
20799
20877
  if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
20800
20878
  _removeAttribute(name, currentNode, attr);
@@ -20824,7 +20902,10 @@ function createDOMPurify() {
20824
20902
  }
20825
20903
  value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
20826
20904
  if (value !== initValue) {
20827
- _setAttributeValue(currentNode, name, namespaceURI, value);
20905
+ const cleanWrite = _setAttributeValue(currentNode, name, namespaceURI, value);
20906
+ if (cleanWrite && recreatedNamedProp) {
20907
+ arrayPop(DOMPurify.removed);
20908
+ }
20828
20909
  }
20829
20910
  }
20830
20911
  _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
@@ -20962,7 +21043,7 @@ function createDOMPurify() {
20962
21043
  } else {
20963
21044
  body.appendChild(importedNode);
20964
21045
  }
20965
- _sanitizeAttachedShadowRoots(importedNode);
21046
+ _sanitizeAttachedShadowRoots(body);
20966
21047
  } else {
20967
21048
  if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
20968
21049
  dirty.indexOf("<") === -1) {
@@ -21773,7 +21854,7 @@ const _hoisted_2$n = {
21773
21854
  const _hoisted_3$h = { class: "document-article__toolbar-left" };
21774
21855
  const _hoisted_4$a = { class: "document-article__toolbar-center" };
21775
21856
  const _hoisted_5$9 = { class: "document-article__toolbar-right" };
21776
- const _hoisted_6$8 = { class: "document-article__body" };
21857
+ const _hoisted_6$9 = { class: "document-article__body" };
21777
21858
  const _hoisted_7$4 = {
21778
21859
  key: 0,
21779
21860
  class: "document-article__center document-article__center--processing",
@@ -21827,7 +21908,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
21827
21908
  renderSlot(_ctx.$slots, "toolbar-right", {}, void 0, true)
21828
21909
  ])
21829
21910
  ])) : createCommentVNode("", true),
21830
- createBaseVNode("div", _hoisted_6$8, [
21911
+ createBaseVNode("div", _hoisted_6$9, [
21831
21912
  props.status === "processing" ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
21832
21913
  createVNode(EditorIcon, {
21833
21914
  name: "spinner",
@@ -22123,7 +22204,7 @@ const _hoisted_4$9 = {
22123
22204
  class: "document-meta"
22124
22205
  };
22125
22206
  const _hoisted_5$8 = { class: "header-right" };
22126
- const _hoisted_6$7 = { key: 0 };
22207
+ const _hoisted_6$8 = { key: 0 };
22127
22208
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
22128
22209
  __name: "Header",
22129
22210
  props: {
@@ -22185,34 +22266,36 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
22185
22266
  ]),
22186
22267
  _: 1
22187
22268
  }, 8, ["aria-label"])) : createCommentVNode("", true),
22188
- createVNode(unref(Button), {
22189
- variant: "secondary",
22190
- "aria-label": unref(t2)("header.undo"),
22191
- disabled: !props.canUndo,
22192
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
22193
- }, {
22194
- icon: withCtx(() => [
22195
- createVNode(unref(EditorIcon), {
22196
- name: "undo",
22197
- size: 16
22198
- })
22199
- ]),
22200
- _: 1
22201
- }, 8, ["aria-label", "disabled"]),
22202
- createVNode(unref(Button), {
22203
- variant: "secondary",
22204
- "aria-label": unref(t2)("header.redo"),
22205
- disabled: !props.canRedo,
22206
- onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
22207
- }, {
22208
- icon: withCtx(() => [
22209
- createVNode(unref(EditorIcon), {
22210
- name: "redo",
22211
- size: 16
22212
- })
22213
- ]),
22214
- _: 1
22215
- }, 8, ["aria-label", "disabled"]),
22269
+ props.canUndo || props.canRedo ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
22270
+ createVNode(unref(Button), {
22271
+ variant: "secondary",
22272
+ "aria-label": unref(t2)("header.undo"),
22273
+ disabled: !props.canUndo,
22274
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("undo"))
22275
+ }, {
22276
+ icon: withCtx(() => [
22277
+ createVNode(unref(EditorIcon), {
22278
+ name: "undo",
22279
+ size: 16
22280
+ })
22281
+ ]),
22282
+ _: 1
22283
+ }, 8, ["aria-label", "disabled"]),
22284
+ createVNode(unref(Button), {
22285
+ variant: "secondary",
22286
+ "aria-label": unref(t2)("header.redo"),
22287
+ disabled: !props.canRedo,
22288
+ onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("redo"))
22289
+ }, {
22290
+ icon: withCtx(() => [
22291
+ createVNode(unref(EditorIcon), {
22292
+ name: "redo",
22293
+ size: 16
22294
+ })
22295
+ ]),
22296
+ _: 1
22297
+ }, 8, ["aria-label", "disabled"])
22298
+ ], 64)) : createCommentVNode("", true),
22216
22299
  createVNode(unref(Button), {
22217
22300
  variant: "primary",
22218
22301
  "aria-label": unref(t2)("header.ask"),
@@ -22226,7 +22309,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
22226
22309
  })
22227
22310
  ]),
22228
22311
  default: withCtx(() => [
22229
- !__props.isMobile ? (openBlock(), createElementBlock("span", _hoisted_6$7, toDisplayString(unref(t2)("header.ask")), 1)) : createCommentVNode("", true)
22312
+ !__props.isMobile ? (openBlock(), createElementBlock("span", _hoisted_6$8, toDisplayString(unref(t2)("header.ask")), 1)) : createCommentVNode("", true)
22230
22313
  ]),
22231
22314
  _: 1
22232
22315
  }, 8, ["aria-label", "disabled"])
@@ -22235,8 +22318,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
22235
22318
  };
22236
22319
  }
22237
22320
  });
22238
- const _style_0$p = '\n.editor-header[data-v-6464a453] {\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-6464a453] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n flex: 1;\n}\n.document-title[data-v-6464a453] {\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-6464a453] {\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-6464a453] {\n text-box: cap alphabetic;\n}\n.document-meta__part + .document-meta__part[data-v-6464a453]::before {\n content: "·";\n margin-right: var(--spacing-xs);\n}\n.header-right[data-v-6464a453] {\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-6464a453] {\n padding: var(--spacing-xs) var(--spacing-md);\n}\n.document-title[data-v-6464a453] {\n font-size: var(--font-size-base);\n}\n}\n';
22239
- const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-6464a453"]]);
22321
+ 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';
22322
+ const Header = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["styles", [_style_0$p]], ["__scopeId", "data-v-491cf8ab"]]);
22240
22323
  const TRANSCRIPTION_TAB = "__transcription__";
22241
22324
  const VERBATIM_TAB = "__verbatim__";
22242
22325
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
@@ -23553,6 +23636,9 @@ function useFollowPlayback(scrollContainer) {
23553
23636
  if (playing) isFollowing.value = true;
23554
23637
  }
23555
23638
  );
23639
+ const stopSeekListener = core.on("audio:seek", () => {
23640
+ isFollowing.value = true;
23641
+ });
23556
23642
  function onManualScroll() {
23557
23643
  isFollowing.value = false;
23558
23644
  }
@@ -23566,7 +23652,6 @@ function useFollowPlayback(scrollContainer) {
23566
23652
  if (!el) return;
23567
23653
  el.addEventListener("wheel", handler, { passive: true });
23568
23654
  el.addEventListener("touchstart", handler, { passive: true });
23569
- el.addEventListener("pointerdown", handler, { passive: true });
23570
23655
  el.addEventListener("keydown", checkKeyDownIsScroll);
23571
23656
  }
23572
23657
  function downScrollListener(handler) {
@@ -23574,7 +23659,6 @@ function useFollowPlayback(scrollContainer) {
23574
23659
  if (!el) return;
23575
23660
  el.removeEventListener("wheel", handler);
23576
23661
  el.removeEventListener("touchstart", handler);
23577
- el.removeEventListener("pointerdown", handler);
23578
23662
  el.removeEventListener("keydown", checkKeyDownIsScroll);
23579
23663
  }
23580
23664
  onMounted(() => {
@@ -23582,6 +23666,7 @@ function useFollowPlayback(scrollContainer) {
23582
23666
  });
23583
23667
  onBeforeUnmount(() => {
23584
23668
  downScrollListener(onManualScroll);
23669
+ stopSeekListener();
23585
23670
  });
23586
23671
  function resumeFollow() {
23587
23672
  isFollowing.value = true;
@@ -23604,6 +23689,10 @@ const _hoisted_5$7 = {
23604
23689
  key: 1,
23605
23690
  class: "history-start"
23606
23691
  };
23692
+ const _hoisted_6$7 = {
23693
+ key: 0,
23694
+ class: "resume-scroll-anchor"
23695
+ };
23607
23696
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
23608
23697
  __name: "TranscriptionPanel",
23609
23698
  props: {
@@ -23739,19 +23828,20 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
23739
23828
  ]),
23740
23829
  createVNode(Transition, { name: "fade-slide" }, {
23741
23830
  default: withCtx(() => [
23742
- showResumeButton.value ? (openBlock(), createBlock(unref(Button), {
23743
- key: 0,
23744
- size: "sm",
23745
- icon: "arrow-down",
23746
- class: "resume-scroll-btn",
23747
- "aria-label": unref(t2)("transcription.resumeScroll"),
23748
- onClick: onResumeClick
23749
- }, {
23750
- default: withCtx(() => [
23751
- createTextVNode(toDisplayString(unref(t2)("transcription.resumeScroll")), 1)
23752
- ]),
23753
- _: 1
23754
- }, 8, ["aria-label"])) : createCommentVNode("", true)
23831
+ showResumeButton.value ? (openBlock(), createElementBlock("div", _hoisted_6$7, [
23832
+ createVNode(unref(Button), {
23833
+ size: "sm",
23834
+ icon: "arrow-down",
23835
+ class: "resume-scroll-btn",
23836
+ "aria-label": unref(t2)("transcription.resumeScroll"),
23837
+ onClick: onResumeClick
23838
+ }, {
23839
+ default: withCtx(() => [
23840
+ createTextVNode(toDisplayString(unref(t2)("transcription.resumeScroll")), 1)
23841
+ ]),
23842
+ _: 1
23843
+ }, 8, ["aria-label"])
23844
+ ])) : createCommentVNode("", true)
23755
23845
  ]),
23756
23846
  _: 1
23757
23847
  })
@@ -23760,8 +23850,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
23760
23850
  };
23761
23851
  }
23762
23852
  });
23763
- const _style_0$j = "\n.transcription-panel[data-v-7f4303ed] {\n min-height: 0;\n overflow: hidden;\n background-color: var(--color-surface);\n}\n.scroll-container[data-v-7f4303ed] {\n height: 100%;\n overflow: auto;\n position: relative;\n}\n.turns-container[data-v-7f4303ed] {\n max-width: 80ch;\n margin-inline: auto;\n padding: var(--spacing-lg);\n}\n.turns-container[data-v-7f4303ed]:has(.transcription-empty) {\n display: flex;\n flex-direction: column;\n min-height: 100%;\n}\n.history-loading[data-v-7f4303ed] {\n text-align: center;\n padding: var(--spacing-md);\n}\n.history-loading progress[data-v-7f4303ed] {\n width: 120px;\n}\n.history-start[data-v-7f4303ed] {\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 */\n.resume-scroll-btn[data-v-7f4303ed] {\n position: sticky;\n bottom: var(--spacing-lg);\n left: 50%;\n translate: -50% 0;\n z-index: var(--z-sticky);\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-7f4303ed],\n.fade-slide-leave-active[data-v-7f4303ed] {\n transition:\n opacity 200ms ease,\n translate 200ms ease;\n}\n.fade-slide-enter-from[data-v-7f4303ed],\n.fade-slide-leave-to[data-v-7f4303ed] {\n opacity: 0;\n translate: -50% 8px;\n}\n@media (prefers-reduced-motion: reduce) {\n.fade-slide-enter-active[data-v-7f4303ed],\n .fade-slide-leave-active[data-v-7f4303ed] {\n transition: none;\n}\n}\n@media (max-width: 767px) {\n.turns-container[data-v-7f4303ed] {\n padding: var(--spacing-md);\n}\n}\n";
23764
- const TranscriptionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["styles", [_style_0$j]], ["__scopeId", "data-v-7f4303ed"]]);
23853
+ 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";
23854
+ const TranscriptionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["styles", [_style_0$j]], ["__scopeId", "data-v-66b767d7"]]);
23765
23855
  const _hoisted_1$i = { class: "verbatim-panel" };
23766
23856
  const _hoisted_2$f = { class: "verbatim-panel__content" };
23767
23857
  const _hoisted_3$c = { class: "verbatim-panel__header" };
@@ -25799,7 +25889,7 @@ function c(t2, e3) {
25799
25889
  i2 && (i2(), i2 = void 0), s2.forEach(((t3) => t3()));
25800
25890
  };
25801
25891
  }
25802
- class u extends e$1 {
25892
+ let d$1 = class d extends e$1 {
25803
25893
  get isPlayingSignal() {
25804
25894
  return this._isPlaying;
25805
25895
  }
@@ -25930,8 +26020,8 @@ class u extends e$1 {
25930
26020
  setSinkId(t2) {
25931
26021
  return this.media.setSinkId(t2);
25932
26022
  }
25933
- }
25934
- function d$1({ maxTop: t2, maxBottom: e3, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
26023
+ };
26024
+ function u({ maxTop: t2, maxBottom: e3, halfHeight: i2, vScale: n2, barMinHeight: s2 = 0, barAlign: r2 }) {
25935
26025
  let o2 = Math.round(t2 * i2 * n2);
25936
26026
  let a2 = o2 + Math.round(e3 * i2 * n2) || 1;
25937
26027
  return a2 < s2 && (a2 = s2, r2 || (o2 = a2 / 2)), { topHeight: o2, totalHeight: a2 };
@@ -26024,16 +26114,16 @@ class C extends e$1 {
26024
26114
  if (o2.has(e4.pointerId)) return;
26025
26115
  if (o2.set(e4.pointerId, e4), o2.size > 1) return;
26026
26116
  const l4 = e4.pointerId;
26027
- let c3 = e4.clientX, u2 = e4.clientY, d2 = false;
26117
+ let c3 = e4.clientX, d3 = e4.clientY, u2 = false;
26028
26118
  const p2 = Date.now(), m2 = t3.getBoundingClientRect(), { left: g2, top: f2 } = m2, v2 = (t4) => {
26029
26119
  if (t4.pointerId !== l4) return;
26030
26120
  if (t4.defaultPrevented || o2.size > 1) return;
26031
26121
  if (a2 && Date.now() - p2 < s2) return;
26032
- const e5 = t4.clientX, n3 = t4.clientY, h3 = e5 - c3, m3 = n3 - u2;
26033
- (d2 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), d2 || (r2.set({ type: "start", x: c3 - g2, y: u2 - f2 }), d2 = true), r2.set({ type: "move", x: e5 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e5, u2 = n3);
26122
+ const e5 = t4.clientX, n3 = t4.clientY, h3 = e5 - c3, m3 = n3 - d3;
26123
+ (u2 || Math.abs(h3) > i2 || Math.abs(m3) > i2) && (t4.preventDefault(), t4.stopPropagation(), u2 || (r2.set({ type: "start", x: c3 - g2, y: d3 - f2 }), u2 = true), r2.set({ type: "move", x: e5 - g2, y: n3 - f2, deltaX: h3, deltaY: m3 }), c3 = e5, d3 = n3);
26034
26124
  }, b2 = (t4) => {
26035
26125
  if (o2.delete(t4.pointerId)) {
26036
- if (t4.pointerId === l4 && d2) {
26126
+ if (t4.pointerId === l4 && u2) {
26037
26127
  const e5 = t4.clientX, i3 = t4.clientY;
26038
26128
  r2.set({ type: "end", x: e5 - g2, y: i3 - f2 });
26039
26129
  }
@@ -26042,9 +26132,9 @@ class C extends e$1 {
26042
26132
  }, y3 = (t4) => {
26043
26133
  t4.relatedTarget && t4.relatedTarget !== document.documentElement || b2(t4);
26044
26134
  }, C2 = (t4) => {
26045
- d2 && (t4.stopPropagation(), t4.preventDefault());
26135
+ u2 && (t4.stopPropagation(), t4.preventDefault());
26046
26136
  }, S3 = (t4) => {
26047
- t4.defaultPrevented || o2.size > 1 || d2 && t4.preventDefault();
26137
+ t4.defaultPrevented || o2.size > 1 || u2 && t4.preventDefault();
26048
26138
  };
26049
26139
  document.addEventListener("pointermove", v2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", y3), document.addEventListener("pointercancel", y3), document.addEventListener("touchmove", S3, { passive: false }), document.addEventListener("click", C2, { capture: true }), h2 = () => {
26050
26140
  document.removeEventListener("pointermove", v2), document.removeEventListener("pointerup", b2), document.removeEventListener("pointerout", y3), document.removeEventListener("pointercancel", y3), document.removeEventListener("touchmove", S3), setTimeout((() => {
@@ -26217,23 +26307,23 @@ class C extends e$1 {
26217
26307
  var t2;
26218
26308
  }
26219
26309
  renderBarWaveform(t2, e3, i2, n2) {
26220
- const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l4, barIndexScale: h2, barSpacing: c2, barMinHeight: u2 } = (function({ width: t3, height: e4, length: i3, options: n3, pixelRatio: s3 }) {
26310
+ const { width: s2, height: r2 } = i2.canvas, { halfHeight: o2, barWidth: a2, barRadius: l4, barIndexScale: h2, barSpacing: c2, barMinHeight: d3 } = (function({ width: t3, height: e4, length: i3, options: n3, pixelRatio: s3 }) {
26221
26311
  const r3 = e4 / 2, o3 = n3.barWidth ? n3.barWidth * s3 : 1, a3 = n3.barGap ? n3.barGap * s3 : n3.barWidth ? o3 / 2 : 0, l5 = o3 + a3 || 1;
26222
26312
  return { halfHeight: r3, barWidth: o3, barGap: a3, barRadius: n3.barRadius || 0, barMinHeight: n3.barMinHeight ? n3.barMinHeight * s3 : 0, barIndexScale: i3 > 0 ? t3 / l5 / i3 : 0, barSpacing: l5 };
26223
26313
  })({ width: s2, height: r2, length: (t2[0] || []).length, options: e3, pixelRatio: this.getPixelRatio() }), m2 = (function({ channelData: t3, barIndexScale: e4, barSpacing: i3, barWidth: n3, halfHeight: s3, vScale: r3, canvasHeight: o3, barAlign: a3, barMinHeight: l5 }) {
26224
- const h3 = t3[0] || [], c3 = t3[1] || h3, u3 = h3.length, m3 = [];
26314
+ const h3 = t3[0] || [], c3 = t3[1] || h3, d4 = h3.length, m3 = [];
26225
26315
  let g2 = 0, f2 = 0, v2 = 0;
26226
- for (let t4 = 0; t4 <= u3; t4++) {
26227
- const u4 = Math.round(t4 * e4);
26228
- if (u4 > g2) {
26229
- const { topHeight: t5, totalHeight: e5 } = d$1({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l5, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e5, canvasHeight: o3 });
26230
- m3.push({ x: g2 * i3, y: h4, width: n3, height: e5 }), g2 = u4, f2 = 0, v2 = 0;
26316
+ for (let t4 = 0; t4 <= d4; t4++) {
26317
+ const d5 = Math.round(t4 * e4);
26318
+ if (d5 > g2) {
26319
+ const { topHeight: t5, totalHeight: e5 } = u({ maxTop: f2, maxBottom: v2, halfHeight: s3, vScale: r3, barMinHeight: l5, barAlign: a3 }), h4 = p({ barAlign: a3, halfHeight: s3, topHeight: t5, totalHeight: e5, canvasHeight: o3 });
26320
+ m3.push({ x: g2 * i3, y: h4, width: n3, height: e5 }), g2 = d5, f2 = 0, v2 = 0;
26231
26321
  }
26232
26322
  const b2 = Math.abs(h3[t4] || 0), y3 = Math.abs(c3[t4] || 0);
26233
26323
  b2 > f2 && (f2 = b2), y3 > v2 && (v2 = y3);
26234
26324
  }
26235
26325
  return m3;
26236
- })({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e3.barAlign, barMinHeight: u2 });
26326
+ })({ channelData: t2, barIndexScale: h2, barSpacing: c2, barWidth: a2, halfHeight: o2, vScale: n2, canvasHeight: r2, barAlign: e3.barAlign, barMinHeight: d3 });
26237
26327
  i2.beginPath();
26238
26328
  for (const t3 of m2) l4 && "roundRect" in i2 ? i2.roundRect(t3.x, t3.y, t3.width, t3.height, l4) : i2.rect(t3.x, t3.y, t3.width, t3.height);
26239
26329
  i2.fill(), i2.closePath();
@@ -26243,15 +26333,15 @@ class C extends e$1 {
26243
26333
  const s3 = i3 / 2, r3 = t3[0] || [];
26244
26334
  return [r3, t3[1] || r3].map(((t4, i4) => {
26245
26335
  const r4 = t4.length, o3 = r4 ? e4 / r4 : 0, a2 = s3, l4 = 0 === i4 ? -1 : 1, h2 = [{ x: 0, y: a2 }];
26246
- let c2 = 0, u2 = 0;
26336
+ let c2 = 0, d3 = 0;
26247
26337
  for (let e5 = 0; e5 <= r4; e5++) {
26248
26338
  const i5 = Math.round(e5 * o3);
26249
26339
  if (i5 > c2) {
26250
- const t5 = a2 + (Math.round(u2 * s3 * n3) || 1) * l4;
26251
- h2.push({ x: c2, y: t5 }), c2 = i5, u2 = 0;
26340
+ const t5 = a2 + (Math.round(d3 * s3 * n3) || 1) * l4;
26341
+ h2.push({ x: c2, y: t5 }), c2 = i5, d3 = 0;
26252
26342
  }
26253
26343
  const r5 = Math.abs(t4[e5] || 0);
26254
- r5 > u2 && (u2 = r5);
26344
+ r5 > d3 && (d3 = r5);
26255
26345
  }
26256
26346
  return h2.push({ x: c2, y: a2 }), h2;
26257
26347
  }));
@@ -26298,29 +26388,29 @@ class C extends e$1 {
26298
26388
  })({ clientWidth: a2, totalWidth: l4, options: e3 });
26299
26389
  let c2 = {};
26300
26390
  if (0 === h2) return;
26301
- const u2 = (i3) => {
26302
- if (i3 < 0 || i3 >= d2) return;
26391
+ const d3 = (i3) => {
26392
+ if (i3 < 0 || i3 >= u2) return;
26303
26393
  if (c2[i3]) return;
26304
26394
  c2[i3] = true;
26305
26395
  const o3 = i3 * h2;
26306
26396
  let a3 = Math.min(l4 - o3, h2);
26307
26397
  if (a3 = f(a3, e3), a3 <= 0) return;
26308
- const u3 = (function({ channelData: t3, offset: e4, clampedWidth: i4, totalWidth: n3 }) {
26398
+ const d4 = (function({ channelData: t3, offset: e4, clampedWidth: i4, totalWidth: n3 }) {
26309
26399
  return t3.map(((t4) => {
26310
26400
  const s3 = Math.floor(e4 / n3 * t4.length), r3 = Math.floor((e4 + i4) / n3 * t4.length);
26311
26401
  return t4.slice(s3, r3);
26312
26402
  }));
26313
26403
  })({ channelData: t2, offset: o3, clampedWidth: a3, totalWidth: l4 });
26314
- this.renderSingleCanvas(u3, e3, a3, n2, o3, s2, r2);
26315
- }, d2 = Math.ceil(l4 / h2);
26404
+ this.renderSingleCanvas(d4, e3, a3, n2, o3, s2, r2);
26405
+ }, u2 = Math.ceil(l4 / h2);
26316
26406
  if (!this.isScrollable) {
26317
- for (let t3 = 0; t3 < d2; t3++) u2(t3);
26407
+ for (let t3 = 0; t3 < u2; t3++) d3(t3);
26318
26408
  return;
26319
26409
  }
26320
- if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l4, numCanvases: d2 }).forEach(((t3) => u2(t3))), d2 > 1) {
26410
+ if (v({ scrollLeft: this.scrollContainer.scrollLeft, totalWidth: l4, numCanvases: u2 }).forEach(((t3) => d3(t3))), u2 > 1) {
26321
26411
  const t3 = this.on("scroll", (() => {
26322
26412
  const { scrollLeft: t4 } = this.scrollContainer;
26323
- Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l4, numCanvases: d2 }).forEach(((t5) => u2(t5)));
26413
+ Object.keys(c2).length > 10 && (s2.innerHTML = "", r2.innerHTML = "", c2 = {}), v({ scrollLeft: t4, totalWidth: l4, numCanvases: u2 }).forEach(((t5) => d3(t5)));
26324
26414
  }));
26325
26415
  this.unsubscribeOnScroll.push(t3);
26326
26416
  }
@@ -26583,7 +26673,7 @@ class E extends e$1 {
26583
26673
  }
26584
26674
  }
26585
26675
  const P2 = { waveColor: "#999", progressColor: "#555", cursorWidth: 1, minPxPerSec: 0, fillParent: true, interact: true, dragToSeek: false, autoScroll: true, autoCenter: true, sampleRate: 8e3 };
26586
- class w extends u {
26676
+ class w extends d$1 {
26587
26677
  static create(t2) {
26588
26678
  return new w(t2);
26589
26679
  }
@@ -26595,19 +26685,19 @@ class w extends u {
26595
26685
  }
26596
26686
  constructor(t2) {
26597
26687
  const e3 = t2.media || ("WebAudio" === t2.backend ? new E() : void 0);
26598
- super({ media: e3, 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.reactiveCleanups = [], this.options = Object.assign({}, P2, t2);
26688
+ super({ media: e3, 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({}, P2, t2);
26599
26689
  const { state: i2, actions: n2 } = (function(t3) {
26600
26690
  var e4, i3, n3, s3, r3, o2;
26601
- const a2 = null !== (e4 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e4 ? e4 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), u2 = null !== (n3 = null == t3 ? void 0 : t3.isPlaying) && void 0 !== n3 ? n3 : l$1(false), d2 = 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), y3 = l$1(0), C2 = h$1((() => !u2.value), [u2]), S3 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S3.value && c2.value > 0), [S3, c2]), P3 = h$1((() => a2.value), [a2]), w2 = h$1((() => c2.value > 0 ? a2.value / c2.value : 0), [a2, c2]);
26602
- return { state: { currentTime: a2, duration: c2, isPlaying: u2, isPaused: C2, isSeeking: d2, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y3, canPlay: S3, isReady: E2, progress: P3, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
26691
+ const a2 = null !== (e4 = null == t3 ? void 0 : t3.currentTime) && void 0 !== e4 ? e4 : l$1(0), c2 = null !== (i3 = null == t3 ? void 0 : t3.duration) && void 0 !== i3 ? i3 : l$1(0), d3 = 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), y3 = l$1(0), C2 = h$1((() => !d3.value), [d3]), S3 = h$1((() => null !== g2.value), [g2]), E2 = h$1((() => S3.value && c2.value > 0), [S3, c2]), P3 = h$1((() => a2.value), [a2]), w2 = h$1((() => c2.value > 0 ? a2.value / c2.value : 0), [a2, c2]);
26692
+ return { state: { currentTime: a2, duration: c2, isPlaying: d3, isPaused: C2, isSeeking: u2, volume: p2, playbackRate: m2, audioBuffer: g2, peaks: f2, url: v2, zoom: b2, scrollPosition: y3, canPlay: S3, isReady: E2, progress: P3, progressPercent: w2 }, actions: { setCurrentTime: (t4) => {
26603
26693
  const e5 = Math.max(0, Math.min(c2.value || 1 / 0, t4));
26604
26694
  a2.set(e5);
26605
26695
  }, setDuration: (t4) => {
26606
26696
  c2.set(Math.max(0, t4));
26607
26697
  }, setPlaying: (t4) => {
26608
- u2.set(t4);
26698
+ d3.set(t4);
26609
26699
  }, setSeeking: (t4) => {
26610
- d2.set(t4);
26700
+ u2.set(t4);
26611
26701
  }, setVolume: (t4) => {
26612
26702
  const e5 = Math.max(0, Math.min(1, t4));
26613
26703
  p2.set(e5);
@@ -26628,7 +26718,7 @@ class w extends u {
26628
26718
  })({ isPlaying: this.isPlayingSignal, currentTime: this.currentTimeSignal, duration: this.durationSignal, volume: this.volumeSignal, playbackRate: this.playbackRateSignal, isSeeking: this.seekingSignal });
26629
26719
  this.wavesurferState = i2, this.wavesurferActions = n2, this.timer = new S2();
26630
26720
  const s2 = e3 ? void 0 : this.getMediaElement();
26631
- this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initReactiveState(), this.initPlugins();
26721
+ this.renderer = new C(this.options, s2), this.initPlayerEvents(), this.initRendererEvents(), this.initTimerEvents(), this.initPlugins();
26632
26722
  const r2 = this.options.url || this.getSrc() || "";
26633
26723
  Promise.resolve().then((() => {
26634
26724
  this.emit("init");
@@ -26651,36 +26741,6 @@ class w extends u {
26651
26741
  }
26652
26742
  })));
26653
26743
  }
26654
- initReactiveState() {
26655
- this.reactiveCleanups.push((function(t2, e3) {
26656
- const i2 = [];
26657
- i2.push(c((() => {
26658
- const i3 = t2.isPlaying.value;
26659
- e3.emit(i3 ? "play" : "pause");
26660
- }), [t2.isPlaying])), i2.push(c((() => {
26661
- const i3 = t2.currentTime.value;
26662
- e3.emit("timeupdate", i3), t2.isPlaying.value && e3.emit("audioprocess", i3);
26663
- }), [t2.currentTime, t2.isPlaying])), i2.push(c((() => {
26664
- t2.isSeeking.value && e3.emit("seeking", t2.currentTime.value);
26665
- }), [t2.isSeeking, t2.currentTime]));
26666
- let n2 = false;
26667
- i2.push(c((() => {
26668
- t2.isReady.value && !n2 && (n2 = true, e3.emit("ready", t2.duration.value));
26669
- }), [t2.isReady, t2.duration])), i2.push(c((() => {
26670
- null === t2.audioBuffer.value && (n2 = false);
26671
- }), [t2.audioBuffer]));
26672
- let s2 = false;
26673
- return i2.push(c((() => {
26674
- const i3 = t2.isPlaying.value, n3 = t2.currentTime.value, r2 = t2.duration.value, o2 = r2 > 0 && n3 >= r2;
26675
- s2 && !i3 && o2 && e3.emit("finish"), s2 = i3 && o2;
26676
- }), [t2.isPlaying, t2.currentTime, t2.duration])), i2.push(c((() => {
26677
- const i3 = t2.zoom.value;
26678
- i3 > 0 && e3.emit("zoom", i3);
26679
- }), [t2.zoom])), () => {
26680
- i2.forEach(((t3) => t3()));
26681
- };
26682
- })(this.wavesurferState, { emit: this.emit.bind(this) }));
26683
- }
26684
26744
  initPlayerEvents() {
26685
26745
  this.isPlaying() && (this.emit("play"), this.timer.start()), this.mediaSubscriptions.push(this.onMediaEvent("timeupdate", (() => {
26686
26746
  const t2 = this.updateProgress();
@@ -26900,7 +26960,7 @@ class w extends u {
26900
26960
  }
26901
26961
  destroy() {
26902
26962
  var t2;
26903
- 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.reactiveCleanups.forEach(((t3) => t3())), this.reactiveCleanups = [], this.timer.destroy(), this.renderer.destroy(), super.destroy();
26963
+ 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();
26904
26964
  }
26905
26965
  }
26906
26966
  w.BasePlugin = class extends e$1 {
@@ -27000,7 +27060,7 @@ function l3(t2) {
27000
27060
  }
27001
27061
  function h(t2, e3 = {}) {
27002
27062
  const { threshold: i2 = 3, mouseButton: n2 = 0, touchDelay: r2 = 100 } = e3, o2 = s(null), h2 = /* @__PURE__ */ new Map(), a2 = matchMedia("(pointer: coarse)").matches;
27003
- let d2 = () => {
27063
+ let d3 = () => {
27004
27064
  };
27005
27065
  const c2 = (e4) => {
27006
27066
  if (e4.button !== n2) return;
@@ -27012,15 +27072,15 @@ function h(t2, e3 = {}) {
27012
27072
  if (t3.pointerId !== s2) return;
27013
27073
  if (t3.defaultPrevented || h2.size > 1) return;
27014
27074
  if (a2 && Date.now() - p2 < r2) return;
27015
- const e5 = t3.clientX, n3 = t3.clientY, d3 = e5 - l4, v3 = n3 - c3;
27016
- (u2 || Math.abs(d3) > i2 || Math.abs(v3) > i2) && (t3.preventDefault(), t3.stopPropagation(), u2 || (o2.set({ type: "start", x: l4 - g2, y: c3 - m2 }), u2 = true), o2.set({ type: "move", x: e5 - g2, y: n3 - m2, deltaX: d3, deltaY: v3 }), l4 = e5, c3 = n3);
27075
+ const e5 = t3.clientX, n3 = t3.clientY, d4 = e5 - l4, v3 = n3 - c3;
27076
+ (u2 || Math.abs(d4) > i2 || Math.abs(v3) > i2) && (t3.preventDefault(), t3.stopPropagation(), u2 || (o2.set({ type: "start", x: l4 - g2, y: c3 - m2 }), u2 = true), o2.set({ type: "move", x: e5 - g2, y: n3 - m2, deltaX: d4, deltaY: v3 }), l4 = e5, c3 = n3);
27017
27077
  }, b2 = (t3) => {
27018
27078
  if (h2.delete(t3.pointerId)) {
27019
27079
  if (t3.pointerId === s2 && u2) {
27020
27080
  const e5 = t3.clientX, i3 = t3.clientY;
27021
27081
  o2.set({ type: "end", x: e5 - g2, y: i3 - m2 });
27022
27082
  }
27023
- 0 === h2.size && d2();
27083
+ 0 === h2.size && d3();
27024
27084
  }
27025
27085
  }, E2 = (t3) => {
27026
27086
  t3.relatedTarget && t3.relatedTarget !== document.documentElement || b2(t3);
@@ -27029,7 +27089,7 @@ function h(t2, e3 = {}) {
27029
27089
  }, L2 = (t3) => {
27030
27090
  t3.defaultPrevented || h2.size > 1 || u2 && t3.preventDefault();
27031
27091
  };
27032
- document.addEventListener("pointermove", f2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", E2), document.addEventListener("pointercancel", E2), document.addEventListener("touchmove", L2, { passive: false }), document.addEventListener("click", C2, { capture: true }), d2 = () => {
27092
+ document.addEventListener("pointermove", f2), document.addEventListener("pointerup", b2), document.addEventListener("pointerout", E2), document.addEventListener("pointercancel", E2), document.addEventListener("touchmove", L2, { passive: false }), document.addEventListener("click", C2, { capture: true }), d3 = () => {
27033
27093
  document.removeEventListener("pointermove", f2), document.removeEventListener("pointerup", b2), document.removeEventListener("pointerout", E2), document.removeEventListener("pointercancel", E2), document.removeEventListener("touchmove", L2), setTimeout((() => {
27034
27094
  document.removeEventListener("click", C2, { capture: true });
27035
27095
  }), 10);
@@ -27037,13 +27097,13 @@ function h(t2, e3 = {}) {
27037
27097
  };
27038
27098
  t2.addEventListener("pointerdown", c2);
27039
27099
  return { signal: o2, cleanup: () => {
27040
- d2(), t2.removeEventListener("pointerdown", c2), h2.clear(), l3(o2);
27100
+ d3(), t2.removeEventListener("pointerdown", c2), h2.clear(), l3(o2);
27041
27101
  } };
27042
27102
  }
27043
27103
  class a extends t {
27044
27104
  constructor(t2, e3, i2 = 0) {
27045
- var n2, s2, r2, o2, l4, h2, a2, d2, c2, u2;
27046
- super(), this.totalDuration = e3, this.numberOfChannels = i2, this.element = null, this.minLength = 0, this.maxLength = 1 / 0, this.contentEditable = false, this.subscriptions = [], this.updatingSide = void 0, this.isRemoved = false, this.subscriptions = [], this.id = t2.id || `region-${Math.random().toString(32).slice(2)}`, this.start = this.clampPosition(t2.start), this.end = this.clampPosition(null !== (n2 = t2.end) && void 0 !== n2 ? n2 : t2.start), this.drag = null === (s2 = t2.drag) || void 0 === s2 || s2, this.resize = null === (r2 = t2.resize) || void 0 === r2 || r2, this.resizeStart = null === (o2 = t2.resizeStart) || void 0 === o2 || o2, this.resizeEnd = null === (l4 = t2.resizeEnd) || void 0 === l4 || l4, this.color = null !== (h2 = t2.color) && void 0 !== h2 ? h2 : "rgba(0, 0, 0, 0.1)", this.minLength = null !== (a2 = t2.minLength) && void 0 !== a2 ? a2 : this.minLength, this.maxLength = null !== (d2 = t2.maxLength) && void 0 !== d2 ? d2 : this.maxLength, this.channelIdx = null !== (c2 = t2.channelIdx) && void 0 !== c2 ? c2 : -1, this.contentEditable = null !== (u2 = t2.contentEditable) && void 0 !== u2 ? u2 : this.contentEditable, this.element = this.initElement(), this.setContent(t2.content), this.setPart(), this.renderPosition(), this.initMouseEvents();
27105
+ var n2, s2, r2, o2, l4, h2, a2, d3, c2, u2;
27106
+ super(), this.totalDuration = e3, this.numberOfChannels = i2, this.element = null, this.minLength = 0, this.maxLength = 1 / 0, this.contentEditable = false, this.subscriptions = [], this.updatingSide = void 0, this.isRemoved = false, this.subscriptions = [], this.id = t2.id || `region-${Math.random().toString(32).slice(2)}`, this.start = this.clampPosition(t2.start), this.end = this.clampPosition(null !== (n2 = t2.end) && void 0 !== n2 ? n2 : t2.start), this.drag = null === (s2 = t2.drag) || void 0 === s2 || s2, this.resize = null === (r2 = t2.resize) || void 0 === r2 || r2, this.resizeStart = null === (o2 = t2.resizeStart) || void 0 === o2 || o2, this.resizeEnd = null === (l4 = t2.resizeEnd) || void 0 === l4 || l4, this.color = null !== (h2 = t2.color) && void 0 !== h2 ? h2 : "rgba(0, 0, 0, 0.1)", this.minLength = null !== (a2 = t2.minLength) && void 0 !== a2 ? a2 : this.minLength, this.maxLength = null !== (d3 = t2.maxLength) && void 0 !== d3 ? d3 : this.maxLength, this.channelIdx = null !== (c2 = t2.channelIdx) && void 0 !== c2 ? c2 : -1, this.contentEditable = null !== (u2 = t2.contentEditable) && void 0 !== u2 ? u2 : this.contentEditable, this.element = this.initElement(), this.setContent(t2.content), this.setPart(), this.renderPosition(), this.initMouseEvents();
27047
27107
  }
27048
27108
  clampPosition(t2) {
27049
27109
  return Math.max(0, Math.min(this.totalDuration, t2));
@@ -27057,12 +27117,12 @@ class a extends t {
27057
27117
  const e3 = { position: "absolute", zIndex: "2", width: "6px", height: "100%", top: "0", cursor: "ew-resize", wordBreak: "keep-all" }, i2 = n("div", { part: "region-handle region-handle-left", style: Object.assign(Object.assign({}, e3), { left: "0", borderLeft: "2px solid rgba(0, 0, 0, 0.5)", borderRadius: "2px 0 0 2px" }) }, t2), s2 = n("div", { part: "region-handle region-handle-right", style: Object.assign(Object.assign({}, e3), { right: "0", borderRight: "2px solid rgba(0, 0, 0, 0.5)", borderRadius: "0 2px 2px 0" }) }, t2), o2 = h(i2, { threshold: 1 }), l4 = h(s2, { threshold: 1 }), a2 = r((() => {
27058
27118
  const t3 = o2.signal.value;
27059
27119
  t3 && ("move" === t3.type && void 0 !== t3.deltaX ? this.onResize(t3.deltaX, "start") : "end" === t3.type && this.onEndResizing("start"));
27060
- }), [o2.signal]), d2 = r((() => {
27120
+ }), [o2.signal]), d3 = r((() => {
27061
27121
  const t3 = l4.signal.value;
27062
27122
  t3 && ("move" === t3.type && void 0 !== t3.deltaX ? this.onResize(t3.deltaX, "end") : "end" === t3.type && this.onEndResizing("end"));
27063
27123
  }), [l4.signal]);
27064
27124
  this.subscriptions.push((() => {
27065
- a2(), d2(), o2.cleanup(), l4.cleanup();
27125
+ a2(), d3(), o2.cleanup(), l4.cleanup();
27066
27126
  }));
27067
27127
  }
27068
27128
  removeResizeHandles(t2) {
@@ -27089,9 +27149,9 @@ class a extends t {
27089
27149
  initMouseEvents() {
27090
27150
  const { element: t2 } = this;
27091
27151
  if (!t2) return;
27092
- const e3 = o(t2, "click"), i2 = o(t2, "mouseenter"), n2 = o(t2, "mouseleave"), s2 = o(t2, "dblclick"), a2 = o(t2, "pointerdown"), d2 = o(t2, "pointerup"), c2 = e3.subscribe(((t3) => t3 && this.emit("click", t3))), u2 = i2.subscribe(((t3) => t3 && this.emit("over", t3))), p2 = n2.subscribe(((t3) => t3 && this.emit("leave", t3))), v2 = s2.subscribe(((t3) => t3 && this.emit("dblclick", t3))), g2 = a2.subscribe(((t3) => t3 && this.toggleCursor(true))), m2 = d2.subscribe(((t3) => t3 && this.toggleCursor(false)));
27152
+ const e3 = o(t2, "click"), i2 = o(t2, "mouseenter"), n2 = o(t2, "mouseleave"), s2 = o(t2, "dblclick"), a2 = o(t2, "pointerdown"), d3 = o(t2, "pointerup"), c2 = e3.subscribe(((t3) => t3 && this.emit("click", t3))), u2 = i2.subscribe(((t3) => t3 && this.emit("over", t3))), p2 = n2.subscribe(((t3) => t3 && this.emit("leave", t3))), v2 = s2.subscribe(((t3) => t3 && this.emit("dblclick", t3))), g2 = a2.subscribe(((t3) => t3 && this.toggleCursor(true))), m2 = d3.subscribe(((t3) => t3 && this.toggleCursor(false)));
27093
27153
  this.subscriptions.push((() => {
27094
- c2(), u2(), p2(), v2(), g2(), m2(), l3(e3), l3(i2), l3(n2), l3(s2), l3(a2), l3(d2);
27154
+ c2(), u2(), p2(), v2(), g2(), m2(), l3(e3), l3(i2), l3(n2), l3(s2), l3(a2), l3(d3);
27095
27155
  }));
27096
27156
  const f2 = h(t2), b2 = r((() => {
27097
27157
  const t3 = f2.signal.value;
@@ -27110,8 +27170,8 @@ class a extends t {
27110
27170
  h2 && this.updatingSide && this.updatingSide !== e3 && ("start" === this.updatingSide ? o2 = i2 : l4 = i2), o2 = Math.max(0, o2), l4 = Math.min(this.totalDuration, l4);
27111
27171
  const a2 = l4 - o2;
27112
27172
  this.updatingSide = e3;
27113
- const d2 = a2 >= this.minLength && a2 <= this.maxLength;
27114
- o2 <= l4 && (d2 || h2) && (this.start = o2, this.end = l4, this.renderPosition(), this.emit("update", e3));
27173
+ const d3 = a2 >= this.minLength && a2 <= this.maxLength;
27174
+ o2 <= l4 && (d3 || h2) && (this.start = o2, this.end = l4, this.renderPosition(), this.emit("update", e3));
27115
27175
  }
27116
27176
  onMove(t2) {
27117
27177
  this.drag && this._onUpdate(t2);
@@ -27167,12 +27227,12 @@ class a extends t {
27167
27227
  this.isRemoved = true, this.emit("remove"), this.subscriptions.forEach(((t2) => t2())), this.subscriptions = [], this.content && this.contentEditable && (this.contentClickListener && (this.content.removeEventListener("click", this.contentClickListener), this.contentClickListener = void 0), this.contentBlurListener && (this.content.removeEventListener("blur", this.contentBlurListener), this.contentBlurListener = void 0)), this.element && (this.element.remove(), this.element = null), this.unAll();
27168
27228
  }
27169
27229
  }
27170
- class d extends e2 {
27230
+ class d2 extends e2 {
27171
27231
  constructor(t2) {
27172
27232
  super(t2), this.regions = [], this.regionsContainer = this.initRegionsContainer();
27173
27233
  }
27174
27234
  static create(t2) {
27175
- return new d(t2);
27235
+ return new d2(t2);
27176
27236
  }
27177
27237
  onInit() {
27178
27238
  if (!this.wavesurfer) throw Error("WaveSurfer is not initialized");
@@ -27281,19 +27341,19 @@ class d extends e2 {
27281
27341
  if (!(n2 && n2 instanceof HTMLElement)) return () => {
27282
27342
  };
27283
27343
  let s2 = null, o2 = 0, l4 = 0;
27284
- const d2 = h(n2, { threshold: e3 }), c2 = r((() => {
27344
+ const d3 = h(n2, { threshold: e3 }), c2 = r((() => {
27285
27345
  var e4, i3;
27286
- const n3 = d2.signal.value;
27346
+ const n3 = d3.signal.value;
27287
27347
  if (n3) if ("start" === n3.type) {
27288
27348
  if (o2 = n3.x, !this.wavesurfer) return;
27289
- const r2 = this.wavesurfer.getDuration(), h2 = null === (i3 = null === (e4 = this.wavesurfer) || void 0 === e4 ? void 0 : e4.getDecodedData()) || void 0 === i3 ? void 0 : i3.numberOfChannels, { width: d3 } = this.wavesurfer.getWrapper().getBoundingClientRect();
27290
- l4 = o2 / d3 * r2;
27291
- const c3 = n3.x / d3 * r2, u2 = (n3.x + 5) / d3 * r2;
27349
+ const r2 = this.wavesurfer.getDuration(), h2 = null === (i3 = null === (e4 = this.wavesurfer) || void 0 === e4 ? void 0 : e4.getDecodedData()) || void 0 === i3 ? void 0 : i3.numberOfChannels, { width: d4 } = this.wavesurfer.getWrapper().getBoundingClientRect();
27350
+ l4 = o2 / d4 * r2;
27351
+ const c3 = n3.x / d4 * r2, u2 = (n3.x + 5) / d4 * r2;
27292
27352
  s2 = new a(Object.assign(Object.assign({}, t2), { start: c3, end: u2 }), r2, h2), this.emit("region-initialized", s2), s2.element && this.regionsContainer.appendChild(s2.element);
27293
27353
  } else "move" === n3.type && void 0 !== n3.deltaX ? s2 && s2._onUpdate(n3.deltaX, n3.x > o2 ? "end" : "start", l4) : "end" === n3.type && s2 && (this.saveRegion(s2), s2.updatingSide = void 0, s2 = null);
27294
- }), [d2.signal]);
27354
+ }), [d3.signal]);
27295
27355
  return () => {
27296
- c2(), d2.cleanup();
27356
+ c2(), d3.cleanup();
27297
27357
  };
27298
27358
  }
27299
27359
  clearRegions() {
@@ -27465,7 +27525,7 @@ function useAudioPlayer(options) {
27465
27525
  isLoading.value = true;
27466
27526
  isReady.value = false;
27467
27527
  loadError.value = null;
27468
- const regionsPlugin = d.create();
27528
+ const regionsPlugin = d2.create();
27469
27529
  regions.value = regionsPlugin;
27470
27530
  const precomputed = audio.waveform.value;
27471
27531
  const peaks = precomputed?.length ? [normalizePeaks(precomputed)] : void 0;
@@ -27727,6 +27787,7 @@ function createAudioPlugin(options = {}) {
27727
27787
  });
27728
27788
  function seekTo(time) {
27729
27789
  seekHandler?.(time);
27790
+ core.emit("audio:seek", { time });
27730
27791
  }
27731
27792
  function setSeekHandler(fn) {
27732
27793
  seekHandler = fn;
@@ -28000,23 +28061,23 @@ function splitPartialSubtitles({ previousText, previousIndexes: oldCutPositions
28000
28061
  );
28001
28062
  wordIndex += diff.countRemoved;
28002
28063
  } else if ("removed" in diff && diff.removed) {
28003
- const d2 = diff;
28004
- wordIndex += d2.count;
28064
+ const d3 = diff;
28065
+ wordIndex += d3.count;
28005
28066
  newCutPositions = incrementIndexes(
28006
28067
  newCutPositions,
28007
28068
  copyCutPositions[0],
28008
- -d2.count
28069
+ -d3.count
28009
28070
  );
28010
28071
  } else if ("added" in diff && diff.added) {
28011
- const d2 = diff;
28072
+ const d3 = diff;
28012
28073
  newCutPositions = incrementIndexes(
28013
28074
  newCutPositions,
28014
28075
  copyCutPositions[0],
28015
- d2.count
28076
+ d3.count
28016
28077
  );
28017
28078
  } else {
28018
- const d2 = diff;
28019
- wordIndex += d2.count;
28079
+ const d3 = diff;
28080
+ wordIndex += d3.count;
28020
28081
  }
28021
28082
  }
28022
28083
  const lineText = (from, to) => newTextSplitBySpace.slice(from, to).join(" ");
@@ -30294,4 +30355,4 @@ export {
30294
30355
  purify as p,
30295
30356
  register as r
30296
30357
  };
30297
- //# sourceMappingURL=index-CB7gHC-N.js.map
30358
+ //# sourceMappingURL=index-CR1TdCV6.js.map