PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/blocks/index.js +1177 -1055 23.8.0 → 24.1.0 View file →
@@ -574,56 +574,56 @@
574 574 // node_modules/fast-deep-equal/es6/index.js
575 575 var require_es6 = __commonJS({
576 576 "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
577 577 "use strict";
578 - module.exports = function equal(a2, b3) {
579 - if (a2 === b3) return true;
580 - if (a2 && b3 && typeof a2 == "object" && typeof b3 == "object") {
581 - if (a2.constructor !== b3.constructor) return false;
582 - var length, i2, keys;
583 - if (Array.isArray(a2)) {
584 - length = a2.length;
585 - if (length != b3.length) return false;
586 - for (i2 = length; i2-- !== 0; )
587 - if (!equal(a2[i2], b3[i2])) return false;
578 + module.exports = function equal(a, b2) {
579 + if (a === b2) return true;
580 + if (a && b2 && typeof a == "object" && typeof b2 == "object") {
581 + if (a.constructor !== b2.constructor) return false;
582 + var length, i, keys;
583 + if (Array.isArray(a)) {
584 + length = a.length;
585 + if (length != b2.length) return false;
586 + for (i = length; i-- !== 0; )
587 + if (!equal(a[i], b2[i])) return false;
588 588 return true;
589 589 }
590 - if (a2 instanceof Map && b3 instanceof Map) {
591 - if (a2.size !== b3.size) return false;
592 - for (i2 of a2.entries())
593 - if (!b3.has(i2[0])) return false;
594 - for (i2 of a2.entries())
595 - if (!equal(i2[1], b3.get(i2[0]))) return false;
590 + if (a instanceof Map && b2 instanceof Map) {
591 + if (a.size !== b2.size) return false;
592 + for (i of a.entries())
593 + if (!b2.has(i[0])) return false;
594 + for (i of a.entries())
595 + if (!equal(i[1], b2.get(i[0]))) return false;
596 596 return true;
597 597 }
598 - if (a2 instanceof Set && b3 instanceof Set) {
599 - if (a2.size !== b3.size) return false;
600 - for (i2 of a2.entries())
601 - if (!b3.has(i2[0])) return false;
598 + if (a instanceof Set && b2 instanceof Set) {
599 + if (a.size !== b2.size) return false;
600 + for (i of a.entries())
601 + if (!b2.has(i[0])) return false;
602 602 return true;
603 603 }
604 - if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b3)) {
605 - length = a2.length;
606 - if (length != b3.length) return false;
607 - for (i2 = length; i2-- !== 0; )
608 - if (a2[i2] !== b3[i2]) return false;
604 + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b2)) {
605 + length = a.length;
606 + if (length != b2.length) return false;
607 + for (i = length; i-- !== 0; )
608 + if (a[i] !== b2[i]) return false;
609 609 return true;
610 610 }
611 - if (a2.constructor === RegExp) return a2.source === b3.source && a2.flags === b3.flags;
612 - if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b3.valueOf();
613 - if (a2.toString !== Object.prototype.toString) return a2.toString() === b3.toString();
614 - keys = Object.keys(a2);
611 + if (a.constructor === RegExp) return a.source === b2.source && a.flags === b2.flags;
612 + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b2.valueOf();
613 + if (a.toString !== Object.prototype.toString) return a.toString() === b2.toString();
614 + keys = Object.keys(a);
615 615 length = keys.length;
616 - if (length !== Object.keys(b3).length) return false;
617 - for (i2 = length; i2-- !== 0; )
618 - if (!Object.prototype.hasOwnProperty.call(b3, keys[i2])) return false;
619 - for (i2 = length; i2-- !== 0; ) {
620 - var key = keys[i2];
621 - if (!equal(a2[key], b3[key])) return false;
616 + if (length !== Object.keys(b2).length) return false;
617 + for (i = length; i-- !== 0; )
618 + if (!Object.prototype.hasOwnProperty.call(b2, keys[i])) return false;
619 + for (i = length; i-- !== 0; ) {
620 + var key = keys[i];
621 + if (!equal(a[key], b2[key])) return false;
622 622 }
623 623 return true;
624 624 }
625 - return a2 !== a2 && b3 !== b3;
625 + return a !== a && b2 !== b2;
626 626 };
627 627 }
628 628 });
629 629
@@ -967,14 +967,14 @@
967 967 var import_data5 = __toESM(require_data(), 1);
968 968
969 969 // node_modules/tslib/tslib.es6.mjs
970 970 var __assign = function() {
971 - __assign = Object.assign || function __assign2(t3) {
972 - for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
973 - s2 = arguments[i2];
974 - for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2];
971 + __assign = Object.assign || function __assign2(t2) {
972 + for (var s, i = 1, n = arguments.length; i < n; i++) {
973 + s = arguments[i];
974 + for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2];
975 975 }
976 - return t3;
976 + return t2;
977 977 };
978 978 return __assign.apply(this, arguments);
979 979 };
980 980
@@ -999,13 +999,13 @@
999 999 while (result.charAt(end - 1) === "\0")
1000 1000 end--;
1001 1001 return result.slice(start, end).split("\0").map(transform).join(delimiter);
1002 1002 }
1003 - function replace(input, re2, value) {
1004 - if (re2 instanceof RegExp)
1005 - return input.replace(re2, value);
1006 - return re2.reduce(function(input2, re3) {
1007 - return input2.replace(re3, value);
1003 + function replace(input, re, value) {
1004 + if (re instanceof RegExp)
1005 + return input.replace(re, value);
1006 + return re.reduce(function(input2, re2) {
1007 + return input2.replace(re2, value);
1008 1008 }, input);
1009 1009 }
1010 1010
1011 1011 // node_modules/pascal-case/dist.es2015/index.js
@@ -1041,217 +1041,230 @@
1041 1041 var import_data2 = __toESM(require_data(), 1);
1042 1042 var import_i18n3 = __toESM(require_i18n(), 1);
1043 1043
1044 1044 // node_modules/colord/index.mjs
1045 - var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) };
1046 - var t = function(r2) {
1047 - return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2;
1045 + for (r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, t2 = function(r3) {
1046 + return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3;
1047 + }, n = function(r3, t3, n2) {
1048 + return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0;
1049 + }, u = function(r3, t3, n2) {
1050 + return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3;
1051 + }, e2 = function(r3) {
1052 + return (r3 = isFinite(r3) ? r3 % 360 : 0) < 0 ? r3 + 360 : r3;
1053 + }, o2 = function(r3, t3) {
1054 + return void 0 === t3 && (t3 = 0), n(r3, t3) % 360;
1055 + }, a = function(r3) {
1056 + return { r: u(r3.r, 0, 255), g: u(r3.g, 0, 255), b: u(r3.b, 0, 255), a: u(r3.a) };
1057 + }, i = function(r3) {
1058 + return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) };
1059 + }, s = /^#([0-9a-f]{3,8})$/i, d2 = function(r3, t3) {
1060 + var n2 = r3.charCodeAt(t3);
1061 + return (15 & n2) + 9 * (n2 >> 6);
1062 + }, h = function(r3, t3) {
1063 + return d2(r3, t3) << 4 | d2(r3, t3 + 1);
1064 + }, b2 = [], f2 = 0; f2 < 256; f2++) b2.push((f2 < 16 ? "0" : "") + f2.toString(16));
1065 + var r2;
1066 + var t2;
1067 + var n;
1068 + var u;
1069 + var e2;
1070 + var o2;
1071 + var a;
1072 + var i;
1073 + var s;
1074 + var d2;
1075 + var h;
1076 + var b2;
1077 + var f2;
1078 + var g = function(r2) {
1079 + return b2[u(r2, 0, 255)];
1048 1080 };
1049 - var n = function(r2, t3, n2) {
1050 - return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r2) / n2 + 0;
1081 + var c = function(r2) {
1082 + var t2 = r2.r, n = r2.g, u = r2.b, e2 = r2.a, o2 = Math.max(t2, n, u), a = o2 - Math.min(t2, n, u), i = a ? o2 === t2 ? (n - u) / a : o2 === n ? 2 + (u - t2) / a : 4 + (t2 - n) / a : 0;
1083 + return { h: 60 * (i < 0 ? i + 6 : i), s: o2 ? a / o2 * 100 : 0, v: o2 / 255 * 100, a: e2 };
1051 1084 };
1052 - var e = function(r2, t3, n2) {
1053 - return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t3 ? r2 : t3;
1085 + var v = function(r2) {
1086 + var t2 = r2.h, n = r2.s, u = r2.v, e2 = r2.a;
1087 + t2 = t2 / 360 * 6, n /= 100, u /= 100;
1088 + var o2 = Math.floor(t2), a = u * (1 - n), i = u * (1 - (t2 - o2) * n), s = u * (1 - (1 - t2 + o2) * n), d2 = o2 % 6;
1089 + return { r: 255 * [u, i, a, a, s, u][d2], g: 255 * [s, u, u, i, a, a][d2], b: 255 * [a, a, s, u, u, i][d2], a: e2 };
1054 1090 };
1055 - var u = function(r2) {
1056 - return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360;
1091 + var l = function(r2) {
1092 + return { h: e2(r2.h), s: u(r2.s, 0, 100), l: u(r2.l, 0, 100), a: u(r2.a) };
1057 1093 };
1058 - var a = function(r2) {
1059 - return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) };
1094 + var p = function(r2) {
1095 + return { h: o2(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
1060 1096 };
1061 - var o = function(r2) {
1062 - return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) };
1097 + var m = function(r2) {
1098 + return v((n = (t2 = r2).s, { h: t2.h, s: (n *= ((u = t2.l) < 50 ? u : 100 - u) / 100) > 0 ? 2 * n / (u + n) * 100 : 0, v: u + n, a: t2.a }));
1099 + var t2, n, u;
1063 1100 };
1064 - var i = /^#([0-9a-f]{3,8})$/i;
1065 - var s = function(r2) {
1066 - var t3 = r2.toString(16);
1067 - return t3.length < 2 ? "0" + t3 : t3;
1101 + var y = function(r2) {
1102 + return { h: (t2 = c(r2)).h, s: (e2 = (200 - (n = t2.s)) * (u = t2.v) / 100) > 0 && e2 < 200 ? n * u / 100 / (e2 <= 100 ? e2 : 200 - e2) * 100 : 0, l: e2 / 2, a: t2.a };
1103 + var t2, n, u, e2;
1068 1104 };
1069 - var h = function(r2) {
1070 - var t3 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0;
1071 - return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 };
1072 - };
1073 - var b = function(r2) {
1074 - var t3 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a;
1075 - t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100;
1076 - var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6;
1077 - return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 };
1078 - };
1079 - var g = function(r2) {
1080 - return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) };
1081 - };
1082 - var d = function(r2) {
1083 - return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
1084 - };
1085 - var f = function(r2) {
1086 - return b((n2 = (t3 = r2).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a }));
1087 - var t3, n2, e2;
1088 - };
1089 - var c = function(r2) {
1090 - return { h: (t3 = h(r2)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a };
1091 - var t3, n2, e2, u2;
1092 - };
1093 - var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1094 - var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1095 - var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1096 - var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
1097 - var y = { string: [[function(r2) {
1098 - var t3 = i.exec(r2);
1099 - return t3 ? (r2 = t3[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
1105 + var N = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1106 + var x = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1107 + var M = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1108 + var H = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i;
1109 + var $ = { string: [[function(r2) {
1110 + if (!s.test(r2)) return null;
1111 + var t2 = r2.length;
1112 + return t2 <= 5 ? { r: 17 * d2(r2, 1), g: 17 * d2(r2, 2), b: 17 * d2(r2, 3), a: 5 === t2 ? n(17 * d2(r2, 4) / 255, 2) : 1 } : 7 === t2 || 9 === t2 ? { r: h(r2, 1), g: h(r2, 3), b: h(r2, 5), a: 9 === t2 ? n(h(r2, 7) / 255, 2) : 1 } : null;
1100 1113 }, "hex"], [function(r2) {
1101 - var t3 = v.exec(r2) || m.exec(r2);
1102 - return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null;
1103 - }, "rgb"], [function(t3) {
1104 - var n2 = l.exec(t3) || p.exec(t3);
1105 - if (!n2) return null;
1106 - var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) });
1107 - return f(a2);
1114 + var t2 = M.exec(r2) || H.exec(r2);
1115 + return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null;
1116 + }, "rgb"], [function(t2) {
1117 + var n = N.exec(t2) || x.exec(t2);
1118 + if (!n) return null;
1119 + var u, e2, o2 = l({ h: (u = n[1], e2 = n[2], void 0 === e2 && (e2 = "deg"), Number(u) * (r2[e2] || 1)), s: Number(n[3]), l: Number(n[4]), a: void 0 === n[5] ? 1 : Number(n[5]) / (n[6] ? 100 : 1) });
1120 + return m(o2);
1108 1121 }, "hsl"]], object: [[function(r2) {
1109 - var n2 = r2.r, e2 = r2.g, u2 = r2.b, o3 = r2.a, i2 = void 0 === o3 ? 1 : o3;
1110 - return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null;
1122 + var n = r2.r, u = r2.g, e2 = r2.b, o2 = r2.a, i = void 0 === o2 ? 1 : o2;
1123 + return t2(n) && t2(u) && t2(e2) ? a({ r: Number(n), g: Number(u), b: Number(e2), a: Number(i) }) : null;
1111 1124 }, "rgb"], [function(r2) {
1112 - var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o3 = void 0 === a2 ? 1 : a2;
1113 - if (!t(n2) || !t(e2) || !t(u2)) return null;
1114 - var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) });
1115 - return f(i2);
1125 + var n = r2.h, u = r2.s, e2 = r2.l, o2 = r2.a, a = void 0 === o2 ? 1 : o2;
1126 + if (!t2(n) || !t2(u) || !t2(e2)) return null;
1127 + var i = l({ h: Number(n), s: Number(u), l: Number(e2), a: Number(a) });
1128 + return m(i);
1116 1129 }, "hsl"], [function(r2) {
1117 - var n2 = r2.h, a2 = r2.s, o3 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2;
1118 - if (!t(n2) || !t(a2) || !t(o3)) return null;
1119 - var h2 = (function(r3) {
1120 - return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) };
1121 - })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) });
1122 - return b(h2);
1130 + var n = r2.h, o2 = r2.s, a = r2.v, i = r2.a, s = void 0 === i ? 1 : i;
1131 + if (!t2(n) || !t2(o2) || !t2(a)) return null;
1132 + var d2 = (function(r3) {
1133 + return { h: e2(r3.h), s: u(r3.s, 0, 100), v: u(r3.v, 0, 100), a: u(r3.a) };
1134 + })({ h: Number(n), s: Number(o2), v: Number(a), a: Number(s) });
1135 + return v(d2);
1123 1136 }, "hsv"]] };
1124 - var N = function(r2, t3) {
1125 - for (var n2 = 0; n2 < t3.length; n2++) {
1126 - var e2 = t3[n2][0](r2);
1127 - if (e2) return [e2, t3[n2][1]];
1137 + var j = function(r2, t2) {
1138 + for (var n = 0; n < t2.length; n++) {
1139 + var u = t2[n][0](r2);
1140 + if (u) return [u, t2[n][1]];
1128 1141 }
1129 1142 return [null, void 0];
1130 1143 };
1131 - var x = function(r2) {
1132 - return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0];
1144 + var w = function(r2) {
1145 + return "string" == typeof r2 ? j(r2.trim(), $.string) : "object" == typeof r2 && null !== r2 ? j(r2, $.object) : [null, void 0];
1133 1146 };
1134 - var M = function(r2, t3) {
1135 - var n2 = c(r2);
1136 - return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a };
1147 + var k = function(r2, t2) {
1148 + var n = y(r2);
1149 + return { h: n.h, s: u(n.s + 100 * t2, 0, 100), l: n.l, a: n.a };
1137 1150 };
1138 - var H = function(r2) {
1151 + var E = function(r2) {
1139 1152 return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255;
1140 1153 };
1141 - var $ = function(r2, t3) {
1142 - var n2 = c(r2);
1143 - return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a };
1154 + var R = function(r2, t2) {
1155 + var n = y(r2);
1156 + return { h: n.h, s: n.s, l: u(n.l + 100 * t2, 0, 100), a: n.a };
1144 1157 };
1145 - var j = (function() {
1158 + var q = (function() {
1146 1159 function r2(r3) {
1147 - this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
1160 + this.parsed = w(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
1148 1161 }
1149 1162 return r2.prototype.isValid = function() {
1150 1163 return null !== this.parsed;
1151 1164 }, r2.prototype.brightness = function() {
1152 - return n(H(this.rgba), 2);
1165 + return n(E(this.rgba), 2);
1153 1166 }, r2.prototype.isDark = function() {
1154 - return H(this.rgba) < 0.5;
1167 + return E(this.rgba) < 0.5;
1155 1168 }, r2.prototype.isLight = function() {
1156 - return H(this.rgba) >= 0.5;
1169 + return E(this.rgba) >= 0.5;
1157 1170 }, r2.prototype.toHex = function() {
1158 - return r3 = o(this.rgba), t3 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2;
1159 - var r3, t3, e2, u2, a2, i2;
1171 + return r3 = i(this.rgba), t2 = r3.r, u = r3.g, e2 = r3.b, a = (o2 = r3.a) < 1 ? g(n(255 * o2)) : "", "#" + g(t2) + g(u) + g(e2) + a;
1172 + var r3, t2, u, e2, o2, a;
1160 1173 }, r2.prototype.toRgb = function() {
1161 - return o(this.rgba);
1174 + return i(this.rgba);
1162 1175 }, r2.prototype.toRgbString = function() {
1163 - return r3 = o(this.rgba), t3 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")";
1164 - var r3, t3, n2, e2, u2;
1176 + return r3 = i(this.rgba), t2 = r3.r, n = r3.g, u = r3.b, (e2 = r3.a) < 1 ? "rgba(" + t2 + ", " + n + ", " + u + ", " + e2 + ")" : "rgb(" + t2 + ", " + n + ", " + u + ")";
1177 + var r3, t2, n, u, e2;
1165 1178 }, r2.prototype.toHsl = function() {
1166 - return d(c(this.rgba));
1179 + return p(y(this.rgba));
1167 1180 }, r2.prototype.toHslString = function() {
1168 - return r3 = d(c(this.rgba)), t3 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)";
1169 - var r3, t3, n2, e2, u2;
1181 + return r3 = p(y(this.rgba)), t2 = r3.h, n = r3.s, u = r3.l, (e2 = r3.a) < 1 ? "hsla(" + t2 + ", " + n + "%, " + u + "%, " + e2 + ")" : "hsl(" + t2 + ", " + n + "%, " + u + "%)";
1182 + var r3, t2, n, u, e2;
1170 1183 }, r2.prototype.toHsv = function() {
1171 - return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
1184 + return r3 = c(this.rgba), { h: o2(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
1172 1185 var r3;
1173 1186 }, r2.prototype.invert = function() {
1174 - return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
1187 + return A({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
1175 1188 var r3;
1176 1189 }, r2.prototype.saturate = function(r3) {
1177 - return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3));
1190 + return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, r3));
1178 1191 }, r2.prototype.desaturate = function(r3) {
1179 - return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3));
1192 + return void 0 === r3 && (r3 = 0.1), A(k(this.rgba, -r3));
1180 1193 }, r2.prototype.grayscale = function() {
1181 - return w(M(this.rgba, -1));
1194 + return A(k(this.rgba, -1));
1182 1195 }, r2.prototype.lighten = function(r3) {
1183 - return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3));
1196 + return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, r3));
1184 1197 }, r2.prototype.darken = function(r3) {
1185 - return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3));
1198 + return void 0 === r3 && (r3 = 0.1), A(R(this.rgba, -r3));
1186 1199 }, r2.prototype.rotate = function(r3) {
1187 - return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3);
1200 + return void 0 === r3 && (r3 = 15), this.hue(y(this.rgba).h + r3);
1188 1201 }, r2.prototype.alpha = function(r3) {
1189 - return "number" == typeof r3 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r3 }) : n(this.rgba.a, 3);
1190 - var t3;
1202 + return "number" == typeof r3 ? A({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r3 }) : n(this.rgba.a, 3);
1203 + var t2;
1191 1204 }, r2.prototype.hue = function(r3) {
1192 - var t3 = c(this.rgba);
1193 - return "number" == typeof r3 ? w({ h: r3, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h);
1205 + var t2 = y(this.rgba);
1206 + return "number" == typeof r3 ? A({ h: r3, s: t2.s, l: t2.l, a: t2.a }) : o2(t2.h);
1194 1207 }, r2.prototype.isEqual = function(r3) {
1195 - return this.toHex() === w(r3).toHex();
1208 + return this.toHex() === A(r3).toHex();
1196 1209 }, r2;
1197 1210 })();
1198 - var w = function(r2) {
1199 - return r2 instanceof j ? r2 : new j(r2);
1211 + var A = function(r2) {
1212 + return r2 instanceof q ? r2 : new q(r2);
1200 1213 };
1201 - var S = [];
1202 - var k = function(r2) {
1214 + var C = [];
1215 + var D = function(r2) {
1203 1216 r2.forEach(function(r3) {
1204 - S.indexOf(r3) < 0 && (r3(j, y), S.push(r3));
1217 + C.indexOf(r3) < 0 && (r3(q, $), C.push(r3));
1205 1218 });
1206 1219 };
1207 1220
1208 1221 // node_modules/colord/plugins/names.mjs
1209 - function names_default(e2, f2) {
1210 - var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {};
1211 - for (var d3 in a2) r2[a2[d3]] = d3;
1222 + var e = function(e2, f2) {
1223 + var a = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {};
1224 + for (var d2 in a) r2[a[d2]] = d2;
1212 1225 var l4 = {};
1213 1226 e2.prototype.toName = function(f3) {
1214 1227 if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent";
1215 - var d4, i2, n2 = r2[this.toHex()];
1216 - if (n2) return n2;
1228 + var d3, i, n = r2[this.toHex()];
1229 + if (n) return n;
1217 1230 if (null == f3 ? void 0 : f3.closest) {
1218 - var o3 = this.toRgb(), t3 = 1 / 0, b3 = "black";
1219 - if (!l4.length) for (var c2 in a2) l4[c2] = new e2(a2[c2]).toRgb();
1220 - for (var g3 in a2) {
1221 - var u2 = (d4 = o3, i2 = l4[g3], Math.pow(d4.r - i2.r, 2) + Math.pow(d4.g - i2.g, 2) + Math.pow(d4.b - i2.b, 2));
1222 - u2 < t3 && (t3 = u2, b3 = g3);
1231 + var o2 = this.toRgb(), t2 = 1 / 0, b2 = "black";
1232 + if (!l4.length) for (var c2 in a) l4[c2] = new e2(a[c2]).toRgb();
1233 + for (var g2 in a) {
1234 + var u = (d3 = o2, i = l4[g2], Math.pow(d3.r - i.r, 2) + Math.pow(d3.g - i.g, 2) + Math.pow(d3.b - i.b, 2));
1235 + u < t2 && (t2 = u, b2 = g2);
1223 1236 }
1224 - return b3;
1237 + return b2;
1225 1238 }
1226 1239 };
1227 1240 f2.string.push([function(f3) {
1228 - var r3 = f3.toLowerCase(), d4 = "transparent" === r3 ? "#0000" : a2[r3];
1229 - return d4 ? new e2(d4).toRgb() : null;
1241 + var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a[r3];
1242 + return d3 ? new e2(d3).toRgb() : null;
1230 1243 }, "name"]);
1231 - }
1244 + };
1232 1245
1233 1246 // node_modules/colord/plugins/a11y.mjs
1234 - var o2 = function(o3) {
1235 - var t3 = o3 / 255;
1236 - return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4);
1247 + var o = function(o2) {
1248 + var t2 = o2 / 255;
1249 + return t2 < 0.04045 ? t2 / 12.92 : Math.pow((t2 + 0.055) / 1.055, 2.4);
1237 1250 };
1238 - var t2 = function(t3) {
1239 - return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b);
1251 + var t = function(t2) {
1252 + return 0.2126 * o(t2.r) + 0.7152 * o(t2.g) + 0.0722 * o(t2.b);
1240 1253 };
1241 - function a11y_default(o3) {
1242 - o3.prototype.luminance = function() {
1243 - return o4 = t2(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n2 && (n2 = Math.pow(10, r2)), Math.round(n2 * o4) / n2 + 0;
1244 - var o4, r2, n2;
1245 - }, o3.prototype.contrast = function(r2) {
1254 + var r = function(o2) {
1255 + o2.prototype.luminance = function() {
1256 + return o3 = t(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n && (n = Math.pow(10, r2)), Math.round(n * o3) / n + 0;
1257 + var o3, r2, n;
1258 + }, o2.prototype.contrast = function(r2) {
1246 1259 void 0 === r2 && (r2 = "#FFF");
1247 - var n2, a2, i2, e2, v3, u2, d3, c2 = r2 instanceof o3 ? r2 : new o3(r2);
1248 - return e2 = this.rgba, v3 = c2.toRgb(), u2 = t2(e2), d3 = t2(v3), n2 = u2 > d3 ? (u2 + 0.05) / (d3 + 0.05) : (d3 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0;
1249 - }, o3.prototype.isReadable = function(o4, t3) {
1250 - return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r2 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r2.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5);
1251 - var r2, n2, a2, i2, e2;
1260 + var n, a, i, e2, v3, u, d2, c2 = r2 instanceof o2 ? r2 : new o2(r2);
1261 + return e2 = this.rgba, v3 = c2.toRgb(), u = t(e2), d2 = t(v3), n = u > d2 ? (u + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u + 0.05), void 0 === (a = 2) && (a = 0), void 0 === i && (i = Math.pow(10, a)), Math.floor(i * n) / i + 0;
1262 + }, o2.prototype.isReadable = function(o3, t2) {
1263 + return void 0 === o3 && (o3 = "#FFF"), void 0 === t2 && (t2 = {}), this.contrast(o3) >= (e2 = void 0 === (i = (r2 = t2).size) ? "normal" : i, "AAA" === (a = void 0 === (n = r2.level) ? "AA" : n) && "normal" === e2 ? 7 : "AA" === a && "large" === e2 ? 3 : 4.5);
1264 + var r2, n, a, i, e2;
1252 1265 };
1253 - }
1266 + };
1254 1267
1255 1268 // packages/blocks/build-module/api/utils.mjs
1256 1269 var import_element = __toESM(require_element(), 1);
1257 1270 var import_i18n2 = __toESM(require_i18n(), 1);
@@ -1532,8 +1545,13 @@
1532 1545 value: ["typography", "textIndent"],
1533 1546 support: ["typography", "textIndent"],
1534 1547 useEngine: true
1535 1548 },
1549 + textShadow: {
1550 + value: ["typography", "textShadow"],
1551 + support: ["typography", "textShadow"],
1552 + useEngine: true
1553 + },
1536 1554 writingMode: {
1537 1555 value: ["typography", "writingMode"],
1538 1556 support: ["typography", "__experimentalWritingMode"],
1539 1557 useEngine: true
@@ -1561,8 +1579,9 @@
1561 1579 h6: "h6",
1562 1580 button: ".wp-element-button, .wp-block-button__link",
1563 1581 caption: ".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",
1564 1582 cite: "cite",
1583 + label: "label",
1565 1584 select: "select",
1566 1585 textInput: "textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"
1567 1586 };
1568 1587 var __EXPERIMENTAL_PATHS_WITH_OVERRIDE = {
@@ -1907,9 +1926,9 @@
1907 1926 return unlock((0, import_data.select)(store)).getAllBlockBindingsSources();
1908 1927 }
1909 1928
1910 1929 // packages/blocks/build-module/api/utils.mjs
1911 - k([names_default, a11y_default]);
1930 + D([e, r]);
1912 1931 var ICON_COLORS = ["#191e23", "#f8f9f9"];
1913 1932 function isUnmodifiedBlock(block, role) {
1914 1933 const blockAttributes = getBlockType(block.name)?.attributes ?? {};
1915 1934 const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => {
@@ -1944,9 +1963,9 @@
1944 1963 return { src: resolvedIcon };
1945 1964 }
1946 1965 const iconDescriptor = resolvedIcon;
1947 1966 if ("background" in iconDescriptor) {
1948 - const colordBgColor = w(iconDescriptor.background);
1967 + const colordBgColor = A(iconDescriptor.background);
1949 1968 const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor);
1950 1969 const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast));
1951 1970 return {
1952 1971 ...iconDescriptor,
@@ -2471,8 +2490,9 @@
2471 2490 __export(private_selectors_exports, {
2472 2491 getAllBlockBindingsSources: () => getAllBlockBindingsSources,
2473 2492 getBlockBindingsSource: () => getBlockBindingsSource2,
2474 2493 getBlockBindingsSourceFieldsList: () => getBlockBindingsSourceFieldsList,
2494 + getBlockKeyboardShortcuts: () => getBlockKeyboardShortcuts,
2475 2495 getBootstrappedBlockType: () => getBootstrappedBlockType,
2476 2496 getSupportedStyles: () => getSupportedStyles,
2477 2497 getUnprocessedBlockTypes: () => getUnprocessedBlockTypes,
2478 2498 hasContentRoleAttribute: () => hasContentRoleAttribute
@@ -2499,8 +2519,9 @@
2499 2519 "textAlign",
2500 2520 "textDecoration",
2501 2521 "textIndent",
2502 2522 "textTransform",
2523 + "textShadow",
2503 2524 "letterSpacing"
2504 2525 ];
2505 2526 function filterElementBlockSupports(blockSupports, name, element) {
2506 2527 return blockSupports.filter((support) => {
@@ -2606,8 +2627,59 @@
2606 2627 },
2607 2628 (state, source, blockContext) => [source.getFieldsList, source.usesContext, blockContext]
2608 2629 )
2609 2630 );
2631 + var getBlockKeyboardShortcuts = (0, import_data3.createSelector)(
2632 + (state) => {
2633 + const shortcuts = [];
2634 + for (const blockName of Object.keys(state.blockTypes)) {
2635 + for (const variation of state.blockVariations[blockName] ?? []) {
2636 + if (!variation.shortcut) {
2637 + continue;
2638 + }
2639 + shortcuts.push({
2640 + ...variation.shortcut,
2641 + targetBlockName: blockName,
2642 + blockNames: [blockName],
2643 + variationName: variation.name
2644 + });
2645 + }
2646 + const transforms = state.blockTypes[blockName]?.transforms;
2647 + for (const transform of transforms?.to ?? []) {
2648 + if (transform.type !== "block") {
2649 + continue;
2650 + }
2651 + const targetBlockName = transform.blocks?.[0];
2652 + if (!targetBlockName) {
2653 + continue;
2654 + }
2655 + for (const shortcut of transform.shortcuts ?? []) {
2656 + shortcuts.push({
2657 + ...shortcut,
2658 + targetBlockName,
2659 + blockNames: [blockName],
2660 + variationName: shortcut.variationName ?? transform.variationName
2661 + });
2662 + }
2663 + }
2664 + for (const transform of transforms?.from ?? []) {
2665 + if (transform.type !== "block" || !transform.blocks?.length) {
2666 + continue;
2667 + }
2668 + for (const shortcut of transform.shortcuts ?? []) {
2669 + shortcuts.push({
2670 + ...shortcut,
2671 + targetBlockName: blockName,
2672 + blockNames: transform.blocks,
2673 + variationName: shortcut.variationName ?? transform.variationName
2674 + });
2675 + }
2676 + }
2677 + }
2678 + return shortcuts;
2679 + },
2680 + (state) => [state.blockTypes, state.blockVariations]
2681 + );
2610 2682 var hasContentRoleAttribute = (state, blockTypeName) => {
2611 2683 const blockType = getBlockType2(state, blockTypeName);
2612 2684 if (!blockType) {
2613 2685 return false;
@@ -2822,15 +2894,15 @@
2822 2894 });
2823 2895 var import_deprecated5 = __toESM(require_deprecated(), 1);
2824 2896
2825 2897 // node_modules/is-plain-object/dist/is-plain-object.mjs
2826 - function isObject3(o3) {
2827 - return Object.prototype.toString.call(o3) === "[object Object]";
2898 + function isObject3(o2) {
2899 + return Object.prototype.toString.call(o2) === "[object Object]";
2828 2900 }
2829 - function isPlainObject(o3) {
2901 + function isPlainObject(o2) {
2830 2902 var ctor, prot;
2831 - if (isObject3(o3) === false) return false;
2832 - ctor = o3.constructor;
2903 + if (isObject3(o2) === false) return false;
2904 + ctor = o2.constructor;
2833 2905 if (ctor === void 0) return true;
2834 2906 prot = ctor.prototype;
2835 2907 if (isObject3(prot) === false) return false;
2836 2908 if (prot.hasOwnProperty("isPrototypeOf") === false) {
@@ -2948,9 +3020,9 @@
2948 3020 if ("edit" in settings && !(0, import_react_is.isValidElementType)(settings.edit)) {
2949 3021 (0, import_warning2.default)('The "edit" property must be a valid component.');
2950 3022 return;
2951 3023 }
2952 - if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
3024 + if (typeof settings.category === "string" && LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
2953 3025 settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
2954 3026 }
2955 3027 if ("category" in settings && !select3.getCategories().some(
2956 3028 ({ slug }) => slug === settings.category
@@ -2967,10 +3039,11 @@
2967 3039 if (typeof settings.title !== "string") {
2968 3040 (0, import_warning2.default)("Block titles must be strings.");
2969 3041 return;
2970 3042 }
2971 - settings.icon = normalizeIconObject(settings.icon);
2972 - if (!isValidIcon(settings.icon.src)) {
3043 + const icon = normalizeIconObject(settings.icon);
3044 + settings.icon = icon;
3045 + if (!isValidIcon(icon.src)) {
2973 3046 (0, import_warning2.default)(
2974 3047 "The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional"
2975 3048 );
2976 3049 return;
@@ -3176,10 +3249,10 @@
3176 3249 unlock(store).registerPrivateActions(private_actions_exports);
3177 3250
3178 3251 // node_modules/uuid/dist/stringify.js
3179 3252 var byteToHex = [];
3180 - for (let i2 = 0; i2 < 256; ++i2) {
3181 - byteToHex.push((i2 + 256).toString(16).slice(1));
3253 + for (let i = 0; i < 256; ++i) {
3254 + byteToHex.push((i + 256).toString(16).slice(1));
3182 3255 }
3183 3256 function unsafeStringify(arr, offset = 0) {
3184 3257 return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
3185 3258 }
@@ -3209,10 +3282,10 @@
3209 3282 offset = offset || 0;
3210 3283 if (offset < 0 || offset + 16 > buf.length) {
3211 3284 throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
3212 3285 }
3213 - for (let i2 = 0; i2 < 16; ++i2) {
3214 - buf[offset + i2] = rnds[i2];
3286 + for (let i = 0; i < 16; ++i) {
3287 + buf[offset + i] = rnds[i];
3215 3288 }
3216 3289 return buf;
3217 3290 }
3218 3291 return unsafeStringify(rnds);
@@ -3222,8 +3295,9 @@
3222 3295 // packages/blocks/build-module/api/factory.mjs
3223 3296 var import_hooks2 = __toESM(require_hooks(), 1);
3224 3297 var import_deprecated6 = __toESM(require_deprecated(), 1);
3225 3298 var import_warning3 = __toESM(require_warning(), 1);
3299 + var isBlockTypeTransform = (transform) => transform?.type === "block";
3226 3300 var getBlockTypeWithTransformMetadata = (blockType, transform) => transform.variationName ? { ...blockType, variationName: transform.variationName } : blockType;
3227 3301 function createBlock(name, attributes = {}, innerBlocks = [], innerContent) {
3228 3302 if (!isBlockRegistered(name)) {
3229 3303 return createBlock("core/missing", {
@@ -3325,12 +3399,8 @@
3325 3399 }
3326 3400 if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) {
3327 3401 return false;
3328 3402 }
3329 - const isBlockType = transform.type === "block";
3330 - if (!isBlockType) {
3331 - return false;
3332 - }
3333 3403 const sourceBlock = blocks[0];
3334 3404 const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
3335 3405 if (!hasMatchingName) {
3336 3406 return false;
@@ -3350,9 +3420,9 @@
3350 3420 const allBlockTypes = getBlockTypes();
3351 3421 const blockTypesWithPossibleFromTransforms = allBlockTypes.flatMap(
3352 3422 (blockType) => {
3353 3423 const fromTransforms = getBlockTransforms("from", blockType.name);
3354 - return fromTransforms.filter(
3424 + return fromTransforms.filter(isBlockTypeTransform).filter(
3355 3425 (transform) => isPossibleTransformForSource(transform, "from", blocks)
3356 3426 ).map(
3357 3427 (transform) => getBlockTypeWithTransformMetadata(blockType, transform)
3358 3428 );
@@ -3366,13 +3436,13 @@
3366 3436 }
3367 3437 const sourceBlock = blocks[0];
3368 3438 const blockType = getBlockType(sourceBlock.name);
3369 3439 const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : [];
3370 - const possibleTransforms = transformsTo.filter((transform) => {
3371 - return transform && isPossibleTransformForSource(transform, "to", blocks);
3372 - });
3440 + const possibleTransforms = transformsTo.filter(isBlockTypeTransform).filter(
3441 + (transform) => isPossibleTransformForSource(transform, "to", blocks)
3442 + );
3373 3443 return possibleTransforms.flatMap((transformation) => {
3374 - return (transformation.blocks || []).map((name) => {
3444 + return (transformation.blocks ?? []).map((name) => {
3375 3445 const transformedBlockType = getBlockType(name);
3376 3446 return transformedBlockType ? getBlockTypeWithTransformMetadata(
3377 3447 transformedBlockType,
3378 3448 transformation
@@ -3377,11 +3447,11 @@
3377 3447 transformedBlockType,
3378 3448 transformation
3379 3449 ) : void 0;
3380 3450 });
3381 - }).filter((bt) => !!bt);
3451 + }).filter((bt2) => !!bt2);
3382 3452 };
3383 - var isWildcardBlockTransform = (t3) => !!t3 && t3.type === "block" && Array.isArray(t3.blocks) && t3.blocks.includes("*");
3453 + var isWildcardBlockTransform = (t2) => isBlockTypeTransform(t2) && Array.isArray(t2.blocks) && t2.blocks.includes("*");
3384 3454 var isContainerGroupBlock = (name) => name === getGroupingBlockName();
3385 3455 function getPossibleBlockTransformations(blocks) {
3386 3456 if (!blocks.length) {
3387 3457 return [];
@@ -3401,14 +3471,14 @@
3401 3471 return [...blockTypesByNameAndVariation.values()];
3402 3472 }
3403 3473 function findTransform(transforms, predicate) {
3404 3474 const hooks = (0, import_hooks2.createHooks)();
3405 - for (let i2 = 0; i2 < transforms.length; i2++) {
3406 - const candidate = transforms[i2];
3475 + for (let i = 0; i < transforms.length; i++) {
3476 + const candidate = transforms[i];
3407 3477 if (predicate(candidate)) {
3408 3478 hooks.addFilter(
3409 3479 "transform",
3410 - "transform/" + i2.toString(),
3480 + "transform/" + i.toString(),
3411 3481 (result) => result ? result : candidate,
3412 3482 candidate.priority
3413 3483 );
3414 3484 }
@@ -3419,37 +3489,15 @@
3419 3489 if (blockTypeOrName === void 0) {
3420 3490 return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat();
3421 3491 }
3422 3492 const blockType = normalizeBlockType(blockTypeOrName);
3423 - const { name: blockName, transforms } = blockType || {};
3424 - const directionTransforms = transforms?.[direction];
3425 - if (!transforms || !Array.isArray(directionTransforms)) {
3493 + const directionTransforms = blockType?.transforms?.[direction];
3494 + if (!blockType || !Array.isArray(directionTransforms)) {
3426 3495 return [];
3427 3496 }
3428 - const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
3429 - const filteredTransforms = usingMobileTransformations ? directionTransforms.filter((t3) => {
3430 - if (t3.type === "raw") {
3431 - return true;
3432 - }
3433 - if (t3.type === "prefix") {
3434 - return true;
3435 - }
3436 - if (!t3.blocks || !t3.blocks.length) {
3437 - return false;
3438 - }
3439 - if (isWildcardBlockTransform(t3)) {
3440 - return true;
3441 - }
3442 - return t3.blocks.every(
3443 - (transformBlockName) => transforms.supportedMobileTransforms.includes(
3444 - transformBlockName
3445 - )
3446 - );
3447 - }) : directionTransforms;
3448 - return filteredTransforms.map((transform) => ({
3497 + return directionTransforms.map((transform) => ({
3449 3498 ...transform,
3450 - blockName,
3451 - usingMobileTransformations
3499 + blockName: blockType.name
3452 3500 }));
3453 3501 }
3454 3502 function maybeCheckTransformIsMatch(transform, blocks) {
3455 3503 if (typeof transform.isMatch !== "function") {
@@ -3464,17 +3512,21 @@
3464 3512 const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
3465 3513 const isMultiBlock = blocksArray.length > 1;
3466 3514 const firstBlock = blocksArray[0];
3467 3515 const sourceName = firstBlock.name;
3468 - const transformationsFrom = getBlockTransforms("from", name);
3469 - const transformationsTo = getBlockTransforms("to", sourceName);
3470 - const isMatchingVariation = (t3) => variationName ? t3.variationName === variationName : !t3.variationName;
3516 + const transformationsFrom = getBlockTransforms("from", name).filter(
3517 + isBlockTypeTransform
3518 + );
3519 + const transformationsTo = getBlockTransforms("to", sourceName).filter(
3520 + isBlockTypeTransform
3521 + );
3522 + const isMatchingVariation = (t2) => variationName ? t2.variationName === variationName : !t2.variationName;
3471 3523 const transformation = findTransform(
3472 3524 transformationsTo,
3473 - (t3) => t3.type === "block" && isMatchingVariation(t3) && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
3525 + (t2) => isMatchingVariation(t2) && (isWildcardBlockTransform(t2) || t2.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t2.isMultiBlock) && maybeCheckTransformIsMatch(t2, blocksArray)
3474 3526 ) || findTransform(
3475 3527 transformationsFrom,
3476 - (t3) => t3.type === "block" && isMatchingVariation(t3) && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
3528 + (t2) => isMatchingVariation(t2) && (isWildcardBlockTransform(t2) || t2.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t2.isMultiBlock) && maybeCheckTransformIsMatch(t2, blocksArray)
3477 3529 );
3478 3530 if (!transformation) {
3479 3531 return null;
3480 3532 }
@@ -4398,10 +4450,10 @@
4398 4450 }
4399 4451 if (arguments.length === 0) {
4400 4452 return token;
4401 4453 }
4402 - for (var i2 = 0; i2 < arguments.length; i2++) {
4403 - if (token.type === arguments[i2]) {
4454 + for (var i = 0; i < arguments.length; i++) {
4455 + if (token.type === arguments[i]) {
4404 4456 return token;
4405 4457 }
4406 4458 }
4407 4459 throw new Error("token type was unexpectedly " + token.type);
@@ -4655,10 +4707,10 @@
4655 4707 }
4656 4708 function isEquivalentTextTokens(actual, expected, logger = createLogger()) {
4657 4709 let actualChars = actual.chars;
4658 4710 let expectedChars = expected.chars;
4659 - for (let i2 = 0; i2 < TEXT_NORMALIZATIONS.length; i2++) {
4660 - const normalize = TEXT_NORMALIZATIONS[i2];
4711 + for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) {
4712 + const normalize = TEXT_NORMALIZATIONS[i];
4661 4713 actualChars = normalize(actualChars);
4662 4714 expectedChars = normalize(expectedChars);
4663 4715 if (actualChars === expectedChars) {
4664 4716 return true;
@@ -4727,13 +4779,13 @@
4727 4779 );
4728 4780 return false;
4729 4781 }
4730 4782 const expectedAttributes = {};
4731 - for (let i2 = 0; i2 < expected.length; i2++) {
4732 - expectedAttributes[expected[i2][0].toLowerCase()] = expected[i2][1];
4783 + for (let i = 0; i < expected.length; i++) {
4784 + expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1];
4733 4785 }
4734 - for (let i2 = 0; i2 < actual.length; i2++) {
4735 - const [name, actualValue] = actual[i2];
4786 + for (let i = 0; i < actual.length; i++) {
4787 + const [name, actualValue] = actual[i];
4736 4788 const nameLower = name.toLowerCase();
4737 4789 if (!expectedAttributes.hasOwnProperty(nameLower)) {
4738 4790 logger.warning("Encountered unexpected attribute `%s`.", name);
4739 4791 return false;
@@ -5124,16 +5176,16 @@
5124 5176 var head;
5125 5177 var tail;
5126 5178 options = options || {};
5127 5179 function memoized() {
5128 - var node = head, len = arguments.length, args, i2;
5180 + var node = head, len = arguments.length, args, i;
5129 5181 searchCache: while (node) {
5130 5182 if (node.args.length !== arguments.length) {
5131 5183 node = node.next;
5132 5184 continue;
5133 5185 }
5134 - for (i2 = 0; i2 < len; i2++) {
5135 - if (node.args[i2] !== arguments[i2]) {
5186 + for (i = 0; i < len; i++) {
5187 + if (node.args[i] !== arguments[i]) {
5136 5188 node = node.next;
5137 5189 continue searchCache;
5138 5190 }
5139 5191 }
@@ -5152,10 +5204,10 @@
5152 5204 }
5153 5205 return node.val;
5154 5206 }
5155 5207 args = new Array(len);
5156 - for (i2 = 0; i2 < len; i2++) {
5157 - args[i2] = arguments[i2];
5208 + for (i = 0; i < len; i++) {
5209 + args[i] = arguments[i];
5158 5210 }
5159 5211 node = {
5160 5212 args,
5161 5213 // Generate the result from original function
@@ -5217,12 +5269,12 @@
5217 5269 alternative: "wp.richText.concat",
5218 5270 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
5219 5271 });
5220 5272 const result = [];
5221 - for (let i2 = 0; i2 < blockNodes.length; i2++) {
5222 - const blockNode = Array.isArray(blockNodes[i2]) ? blockNodes[i2] : [blockNodes[i2]];
5223 - for (let j3 = 0; j3 < blockNode.length; j3++) {
5224 - const child = blockNode[j3];
5273 + for (let i = 0; i < blockNodes.length; i++) {
5274 + const blockNode = Array.isArray(blockNodes[i]) ? blockNodes[i] : [blockNodes[i]];
5275 + for (let j2 = 0; j2 < blockNode.length; j2++) {
5276 + const child = blockNode[j2];
5225 5277 const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string";
5226 5278 if (canConcatToPreviousString) {
5227 5279 result[result.length - 1] += child;
5228 5280 } else {
@@ -5239,11 +5291,11 @@
5239 5291 alternative: "wp.richText.create",
5240 5292 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
5241 5293 });
5242 5294 const result = [];
5243 - for (let i2 = 0; i2 < domNodes.length; i2++) {
5295 + for (let i = 0; i < domNodes.length; i++) {
5244 5296 try {
5245 - result.push(fromDOM2(domNodes[i2]));
5297 + result.push(fromDOM2(domNodes[i]));
5246 5298 } catch {
5247 5299 }
5248 5300 }
5249 5301 return result;
@@ -5294,10 +5346,10 @@
5294 5346 return typeof node !== "string" && node?.type === type;
5295 5347 }
5296 5348 function getNamedNodeMapAsObject(nodeMap) {
5297 5349 const result = {};
5298 - for (let i2 = 0; i2 < nodeMap.length; i2++) {
5299 - const { name, value } = nodeMap[i2];
5350 + for (let i = 0; i < nodeMap.length; i++) {
5351 + const { name, value } = nodeMap[i];
5300 5352 result[name] = value;
5301 5353 }
5302 5354 return result;
5303 5355 }
@@ -5502,9 +5554,12 @@
5502 5554 }
5503 5555 }
5504 5556 );
5505 5557 function parseHtml(innerHTML) {
5506 - return parse(innerHTML, (h2) => h2);
5558 + return parse(
5559 + innerHTML ?? "",
5560 + (h) => h
5561 + );
5507 5562 }
5508 5563 function parseWithAttributeSchema(innerHTML, attributeSchema) {
5509 5564 return matcherFromSource(attributeSchema)(
5510 5565 parseHtml(innerHTML)
@@ -5640,10 +5695,10 @@
5640 5695 const { deprecated: deprecatedDefinitions } = blockType;
5641 5696 if (!deprecatedDefinitions || !deprecatedDefinitions.length) {
5642 5697 return block;
5643 5698 }
5644 - for (let i2 = 0; i2 < deprecatedDefinitions.length; i2++) {
5645 - const { isEligible = stubFalse } = deprecatedDefinitions[i2];
5699 + for (let i = 0; i < deprecatedDefinitions.length; i++) {
5700 + const { isEligible = stubFalse } = deprecatedDefinitions[i];
5646 5701 if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, {
5647 5702 blockNode: rawBlock,
5648 5703 block
5649 5704 })) {
@@ -5653,9 +5708,9 @@
5653 5708 omit(
5654 5709 blockType,
5655 5710 DEPRECATED_ENTRY_KEYS
5656 5711 ),
5657 - deprecatedDefinitions[i2]
5712 + deprecatedDefinitions[i]
5658 5713 );
5659 5714 let migratedBlock = {
5660 5715 ...block,
5661 5716 attributes: getBlockAttributes(
@@ -5840,14 +5895,14 @@
5840 5895 var import_dom13 = __toESM(require_dom(), 1);
5841 5896
5842 5897 // packages/blocks/build-module/api/raw-handling/get-raw-transforms.mjs
5843 5898 function getRawTransforms() {
5844 - return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => {
5845 - return transform.isMatch ? transform : {
5846 - ...transform,
5847 - isMatch: (node) => transform.selector && node.matches(transform.selector)
5848 - };
5849 - });
5899 + return getBlockTransforms("from").filter(
5900 + (transform) => transform.type === "raw"
5901 + ).map((transform) => ({
5902 + ...transform,
5903 + isMatch: transform.isMatch ?? ((node) => !!transform.selector && node.matches(transform.selector))
5904 + }));
5850 5905 }
5851 5906
5852 5907 // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs
5853 5908 function htmlToBlocks(html2, handler) {
@@ -5856,12 +5911,9 @@
5856 5911 return Array.from(doc.body.children).flatMap((node) => {
5857 5912 const transforms = getRawTransforms();
5858 5913 const rawTransform = findTransform(
5859 5914 transforms,
5860 - ((t3) => {
5861 - const transform2 = t3;
5862 - return transform2.isMatch(node);
5863 - })
5915 + (transform2) => transform2.isMatch(node)
5864 5916 );
5865 5917 if (!rawTransform) {
5866 5918 return createBlock(
5867 5919 // Should not be hardcoded.
@@ -6099,19 +6151,16 @@
6099 6151 var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
6100 6152 var beforeLineRegexp = /(\n|<p>|<br\s*\/?>)\s*$/;
6101 6153 var afterLineRegexp = /^\s*(\n|<\/p>|<br\s*\/?>)/;
6102 6154 function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) {
6103 - const transformsFrom = getBlockTransforms(
6104 - "from"
6155 + const transformsFrom = getBlockTransforms("from").filter(
6156 + (transform) => transform.type === "shortcode"
6105 6157 );
6106 6158 const transformation = findTransform(
6107 6159 transformsFrom,
6108 - ((transform) => {
6109 - const t3 = transform;
6110 - return excludedBlockNames.indexOf(t3.blockName) === -1 && t3.type === "shortcode" && castArray(t3.tag).some(
6111 - (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
6112 - );
6113 - })
6160 + (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && castArray(transform.tag).some(
6161 + (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
6162 + )
6114 6163 );
6115 6164 if (!transformation) {
6116 6165 return [HTML];
6117 6166 }
@@ -6118,76 +6167,74 @@
6118 6167 const transformTags = castArray(transformation.tag);
6119 6168 const transformTag = transformTags.find(
6120 6169 (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
6121 6170 );
6122 - let match;
6123 6171 const previousIndex = lastIndex;
6124 - if (match = (0, import_shortcode.next)(transformTag, HTML, lastIndex)) {
6125 - lastIndex = match.index + match.content.length;
6126 - const beforeHTML = HTML.substr(0, match.index);
6127 - const afterHTML = HTML.substr(lastIndex);
6128 - if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
6129 - return segmentHTMLToShortcodeBlock(HTML, lastIndex);
6130 - }
6131 - if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
6132 - return segmentHTMLToShortcodeBlock(HTML, previousIndex, [
6133 - ...excludedBlockNames,
6134 - transformation.blockName
6135 - ]);
6136 - }
6137 - let blocks = [];
6138 - if (typeof transformation.transform === "function") {
6139 - blocks = [].concat(
6140 - transformation.transform(match.shortcode.attrs, match)
6141 - );
6142 - blocks = blocks.map((block) => {
6143 - block.originalContent = match.shortcode.content;
6144 - return applyBuiltInValidationFixes(
6145 - block,
6146 - getBlockType(block.name)
6147 - );
6148 - });
6149 - } else {
6150 - const attributes = Object.fromEntries(
6151 - Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [
6152 - key,
6153 - schema.shortcode(match.shortcode.attrs, match)
6154 - ])
6155 - );
6156 - const blockType = getBlockType(transformation.blockName);
6157 - if (!blockType) {
6158 - return [HTML];
6159 - }
6160 - const transformationBlockType = {
6161 - ...blockType,
6162 - attributes: transformation.attributes
6163 - };
6164 - let block = createBlock(
6165 - transformation.blockName,
6166 - getBlockAttributes(
6167 - transformationBlockType,
6168 - match.shortcode.content,
6169 - attributes
6170 - )
6171 - );
6172 + const match = (0, import_shortcode.next)(transformTag, HTML, lastIndex);
6173 + if (!match) {
6174 + return [HTML];
6175 + }
6176 + lastIndex = match.index + match.content.length;
6177 + const beforeHTML = HTML.substr(0, match.index);
6178 + const afterHTML = HTML.substr(lastIndex);
6179 + if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
6180 + return segmentHTMLToShortcodeBlock(HTML, lastIndex);
6181 + }
6182 + if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
6183 + return segmentHTMLToShortcodeBlock(HTML, previousIndex, [
6184 + ...excludedBlockNames,
6185 + transformation.blockName
6186 + ]);
6187 + }
6188 + let blocks = [];
6189 + if (typeof transformation.transform === "function") {
6190 + blocks = [].concat(
6191 + transformation.transform(match.shortcode.attrs, match)
6192 + );
6193 + blocks = blocks.map((block) => {
6172 6194 block.originalContent = match.shortcode.content;
6173 - block = applyBuiltInValidationFixes(
6195 + return applyBuiltInValidationFixes(
6174 6196 block,
6175 - transformationBlockType
6197 + getBlockType(block.name)
6176 6198 );
6177 - blocks = [block];
6199 + });
6200 + } else {
6201 + const blockType = getBlockType(transformation.blockName);
6202 + if (!blockType) {
6203 + return [HTML];
6178 6204 }
6179 - return [
6180 - ...segmentHTMLToShortcodeBlock(
6181 - beforeHTML.replace(beforeLineRegexp, "")
6182 - ),
6183 - ...blocks,
6184 - ...segmentHTMLToShortcodeBlock(
6185 - afterHTML.replace(afterLineRegexp, "")
6205 + const transformAttributes = transformation.attributes ?? blockType.attributes;
6206 + const attributes = Object.fromEntries(
6207 + Object.entries(transformAttributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [
6208 + key,
6209 + schema.shortcode(match.shortcode.attrs, match)
6210 + ])
6211 + );
6212 + const transformationBlockType = {
6213 + ...blockType,
6214 + attributes: transformAttributes
6215 + };
6216 + let block = createBlock(
6217 + transformation.blockName,
6218 + getBlockAttributes(
6219 + transformationBlockType,
6220 + match.shortcode.content,
6221 + attributes
6186 6222 )
6187 - ];
6223 + );
6224 + block.originalContent = match.shortcode.content;
6225 + block = applyBuiltInValidationFixes(block, transformationBlockType);
6226 + blocks = [block];
6188 6227 }
6189 - return [HTML];
6228 + return [
6229 + ...segmentHTMLToShortcodeBlock(
6230 + beforeHTML.replace(beforeLineRegexp, "")
6231 + ),
6232 + ...blocks,
6233 + ...segmentHTMLToShortcodeBlock(
6234 + afterHTML.replace(afterLineRegexp, "")
6235 + )
6236 + ];
6190 6237 }
6191 6238 var shortcode_converter_default = segmentHTMLToShortcodeBlock;
6192 6239
6193 6240 // packages/blocks/build-module/api/raw-handling/utils.mjs
@@ -6253,41 +6300,41 @@
6253 6300 return [...objValue || [], ...srcValue || []];
6254 6301 }
6255 6302 }
6256 6303 }
6257 - function mergeTagNameSchemas(a2, b3) {
6258 - if (a2 === b3) {
6259 - return a2;
6304 + function mergeTagNameSchemas(a, b2) {
6305 + if (a === b2) {
6306 + return a;
6260 6307 }
6261 - for (const key in b3) {
6262 - if (a2[key]) {
6263 - a2[key] = mergeTagNameSchemaProperties(
6264 - a2[key],
6265 - b3[key],
6308 + for (const key in b2) {
6309 + if (a[key]) {
6310 + a[key] = mergeTagNameSchemaProperties(
6311 + a[key],
6312 + b2[key],
6266 6313 key
6267 6314 );
6268 - } else if (Array.isArray(b3[key])) {
6269 - a2[key] = b3[key].slice();
6315 + } else if (Array.isArray(b2[key])) {
6316 + a[key] = b2[key].slice();
6270 6317 } else {
6271 - a2[key] = { ...b3[key] };
6318 + a[key] = { ...b2[key] };
6272 6319 }
6273 6320 }
6274 - return a2;
6321 + return a;
6275 6322 }
6276 - function mergeSchemas(a2, b3) {
6277 - if (a2 === b3) {
6278 - return a2;
6323 + function mergeSchemas(a, b2) {
6324 + if (a === b2) {
6325 + return a;
6279 6326 }
6280 - for (const key in b3) {
6281 - if (a2[key]) {
6282 - a2[key] = mergeTagNameSchemas(a2[key], b3[key]);
6283 - } else if (Array.isArray(b3[key])) {
6284 - a2[key] = b3[key].slice();
6327 + for (const key in b2) {
6328 + if (a[key]) {
6329 + a[key] = mergeTagNameSchemas(a[key], b2[key]);
6330 + } else if (Array.isArray(b2[key])) {
6331 + a[key] = b2[key].slice();
6285 6332 } else {
6286 - a2[key] = { ...b3[key] };
6333 + a[key] = { ...b2[key] };
6287 6334 }
6288 6335 }
6289 - return a2;
6336 + return a;
6290 6337 }
6291 6338 return schemas.reduce(mergeSchemas, {});
6292 6339 }
6293 6340 function getBlockContentSchema(context) {
@@ -6303,10 +6350,10 @@
6303 6350 return false;
6304 6351 }
6305 6352 const wrapper = doc.body.children.item(0);
6306 6353 const descendants = wrapper.getElementsByTagName("*");
6307 - for (let i2 = 0; i2 < descendants.length; i2++) {
6308 - if (descendants.item(i2).tagName !== "BR") {
6354 + for (let i = 0; i < descendants.length; i++) {
6355 + if (descendants.item(i).tagName !== "BR") {
6309 6356 return false;
6310 6357 }
6311 6358 }
6312 6359 if (wrapper.tagName !== "SPAN") {
@@ -6368,9 +6415,9 @@
6368 6415 ["ul", "li", "ol"],
6369 6416 ["h1", "h2", "h3", "h4", "h5", "h6"]
6370 6417 ];
6371 6418 return inlineAllowedTagGroups.some(
6372 - (tagGroup) => [tag, contextTag].filter((t3) => !tagGroup.includes(t3)).length === 0
6419 + (tagGroup) => [tag, contextTag].filter((t2) => !tagGroup.includes(t2)).length === 0
6373 6420 );
6374 6421 }
6375 6422 function deepCheck(nodes, contextTag) {
6376 6423 return nodes.every(
@@ -6536,10 +6583,10 @@
6536 6583 node.src = "";
6537 6584 return;
6538 6585 }
6539 6586 const uint8Array = new Uint8Array(decoded.length);
6540 - for (let i2 = 0; i2 < uint8Array.length; i2++) {
6541 - uint8Array[i2] = decoded.charCodeAt(i2);
6587 + for (let i = 0; i < uint8Array.length; i++) {
6588 + uint8Array[i] = decoded.charCodeAt(i);
6542 6589 }
6543 6590 const name = type.replace("/", ".");
6544 6591 const file = new window.File([uint8Array], name, { type });
6545 6592 node.src = (0, import_blob.createBlobURL)(file);
@@ -6558,24 +6605,31 @@
6558 6605 node.innerHTML = normaliseBlocks(node.innerHTML);
6559 6606 }
6560 6607
6561 6608 // node_modules/marked/lib/marked.esm.js
6562 - function z() {
6609 + function A2() {
6563 6610 return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
6564 6611 }
6565 - var T = z();
6566 - function G(l4) {
6612 + var T = A2();
6613 + function U(l4) {
6567 6614 T = l4;
6568 6615 }
6569 - var _ = { exec: () => null };
6570 - function d2(l4, e2 = "") {
6571 - let t3 = typeof l4 == "string" ? l4 : l4.source, n2 = { replace: (s2, r2) => {
6572 - let i2 = typeof r2 == "string" ? r2 : r2.source;
6573 - return i2 = i2.replace(m2.caret, "$1"), t3 = t3.replace(s2, i2), n2;
6574 - }, getRegex: () => new RegExp(t3, e2) };
6575 - return n2;
6616 + var E2 = { exec: () => null };
6617 + function I(l4) {
6618 + let e2 = [];
6619 + return (t2) => {
6620 + let n = Math.max(0, Math.min(3, t2 - 1)), i = e2[n];
6621 + return i || (i = l4(n), e2[n] = i), i;
6622 + };
6576 6623 }
6577 - var Re = ((l4 = "") => {
6624 + function d(l4, e2 = "") {
6625 + let t2 = typeof l4 == "string" ? l4 : l4.source, n = { replace: (i, r2) => {
6626 + let o2 = typeof r2 == "string" ? r2 : r2.source;
6627 + return o2 = o2.replace(m2.caret, "$1"), t2 = t2.replace(i, o2), n;
6628 + }, getRegex: () => new RegExp(t2, e2) };
6629 + return n;
6630 + }
6631 + var we = ((l4 = "") => {
6578 6632 try {
6579 6633 return !!new RegExp("(?<=1)(?<!1)" + l4);
6580 6634 } catch {
6581 6635 return false;
@@ -6580,80 +6634,92 @@
6580 6634 } catch {
6581 6635 return false;
6582 6636 }
6583 6637 })();
6584 - var m2 = { 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: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}#`), htmlBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (l4) => new RegExp(`^ {0,${Math.min(3, l4 - 1)}}>`) };
6585 - var Te = /^(?:[ \t]*(?:\n|$))+/;
6586 - var Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
6587 - var we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
6588 - var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
6589 - var ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
6590 - var Q = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
6591 - var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
6592 - var oe = d2(ie).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
6593 - var Pe = d2(ie).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
6594 - var j2 = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
6595 - var Se = /^[^\n]+/;
6596 - var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
6597 - var $e = d2(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
6598 - var Le = d2(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex();
6599 - var v2 = "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";
6600 - var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
6601 - var _e = d2("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
6602 - var ae = d2(j2).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v2).getRegex();
6603 - var Me = d2(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
6604 - var K = { blockquote: Me, code: Oe, def: $e, fences: we, heading: ye, hr: I, html: _e, lheading: oe, list: Le, newline: Te, paragraph: ae, table: _, text: Se };
6605 - var re = d2("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v2).getRegex();
6606 - var ze = { ...K, lheading: Pe, table: re, paragraph: d2(j2).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v2).getRegex() };
6607 - var Ee = { ...K, html: d2(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d2(j2).replace("hr", I).replace("heading", ` *#{1,6} *[^
6608 -]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
6609 - var Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
6610 - var Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
6611 - var le = /^( {2,}|\\)\n(?!\s*$)/;
6612 - var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
6613 - var E = /[\p{P}\p{S}]/u;
6614 - var H2 = /[\s\p{P}\p{S}]/u;
6615 - var W = /[^\s\p{P}\p{S}]/u;
6616 - var Be = d2(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, H2).getRegex();
6617 - var ue = /(?!~)[\p{P}\p{S}]/u;
6618 - var De = /(?!~)[\s\p{P}\p{S}]/u;
6619 - var qe = /(?:[^\s\p{P}\p{S}]|~)/u;
6620 - var ve = d2(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Re ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
6621 - var pe = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
6622 - var He = d2(pe, "u").replace(/punct/g, E).getRegex();
6623 - var Ze = d2(pe, "u").replace(/punct/g, ue).getRegex();
6624 - var ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
6625 - var Ge = d2(ce, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H2).replace(/punct/g, E).getRegex();
6626 - var Ne = d2(ce, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, De).replace(/punct/g, ue).getRegex();
6627 - var Qe = d2("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H2).replace(/punct/g, E).getRegex();
6628 - var je = d2(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, E).getRegex();
6629 - var Fe = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
6630 - var Ue = d2(Fe, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H2).replace(/punct/g, E).getRegex();
6631 - var Ke = d2(/\\(punct)/, "gu").replace(/punct/g, E).getRegex();
6632 - var We = d2(/^<(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();
6633 - var Xe = d2(U).replace("(?:-->|$)", "-->").getRegex();
6634 - var Je = d2("^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", Xe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
6635 - var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
6636 - var Ve = d2(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
6637 - var he = d2(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
6638 - var ke = d2(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
6639 - var Ye = d2("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", ke).getRegex();
6640 - var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
6641 - var X = { _backpedal: _, anyPunctuation: Ke, autolink: We, blockSkip: ve, br: le, code: Ce, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: He, emStrongRDelimAst: Ge, emStrongRDelimUnd: Qe, escape: Ae, link: Ve, nolink: ke, punctuation: Be, reflink: he, reflinkSearch: Ye, tag: Je, text: Ie, url: _ };
6642 - var et = { ...X, link: d2(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
6643 - var N2 = { ...X, emStrongRDelimAst: Ne, emStrongLDelim: Ze, delLDelim: je, delRDelim: Ue, url: d2(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).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: d2(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() };
6644 - var tt = { ...N2, br: d2(le).replace("{2,}", "*").getRegex(), text: d2(N2.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
6645 - var B = { normal: K, gfm: ze, pedantic: Ee };
6646 - var A = { normal: X, gfm: N2, breaks: tt, pedantic: et };
6647 - var nt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
6648 - var de = (l4) => nt[l4];
6649 - function O(l4, e2) {
6638 + var m2 = { 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}}(?:</?(?:${H2})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")), blockquoteBeginRegex: I((l4) => new RegExp(`^ {0,${l4}}>`)) };
6639 + var ye = /^(?:[ \t]*(?:\n|$))+/;
6640 + var Pe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
6641 + var Se = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
6642 + var v2 = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
6643 + var _e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
6644 + var K = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
6645 + var le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
6646 + var ue = d(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();
6647 + var $e = d(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();
6648 + var W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
6649 + var Le = /^[^\n]+/;
6650 + var X = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
6651 + var ze = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", X).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
6652 + var Ee = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, K).getRegex();
6653 + var H2 = "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";
6654 + var J = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
6655 + var Me = d("^ {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", H2).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
6656 + var pe = (l4) => d(W).replace("hr", v2).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", H2).getRegex();
6657 + var Ae = pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
6658 + var Ie = pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
6659 + var Ce = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ie).getRegex();
6660 + var V = { blockquote: Ce, code: Pe, def: ze, fences: Se, heading: _e, hr: v2, html: Me, lheading: ue, list: Ee, newline: ye, paragraph: Ae, table: E2, text: Le };
6661 + var ie = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v2).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", H2).getRegex();
6662 + var Be = { ...V, lheading: $e, table: ie, paragraph: d(W).replace("hr", v2).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", H2).getRegex() };
6663 + var De = { ...V, html: d(`^ *(?: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: E2, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(W).replace("hr", v2).replace("heading", ` *#{1,6} *[^
6664 +]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
6665 + var qe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
6666 + var ve = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
6667 + var ce = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
6668 + var He = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
6669 + var _ = /[\p{P}\p{S}]/u;
6670 + var C2 = /[\s\p{P}\p{S}]/u;
6671 + var Z = /[^\s\p{P}\p{S}]/u;
6672 + var Ze = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, C2).getRegex();
6673 + var Ge = /[\p{Pi}\p{Ps}"']/u;
6674 + var he = /(?!~)[\p{P}\p{S}]/u;
6675 + var Qe = /(?!~)[\s\p{P}\p{S}]/u;
6676 + var Ne = /(?:[^\s\p{P}\p{S}]|~)/u;
6677 + var je = d(/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();
6678 + var de = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
6679 + var Ue = d(de, "u").replace(/punct/g, _).getRegex();
6680 + var Fe = d(de, "u").replace(/punct/g, he).getRegex();
6681 + var Ke = /^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/;
6682 + var We = d(Ke, "u").replace(/openQuote/g, Ge).replace(/punct/g, _).getRegex();
6683 + var ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
6684 + var Xe = d(ke, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6685 + var Je = d(ke, "gu").replace(/notPunctSpace/g, Ne).replace(/punctSpace/g, Qe).replace(/punct/g, he).getRegex();
6686 + var Ve = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)";
6687 + var Ye = d(Ve, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6688 + var et = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6689 + var tt = "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)";
6690 + var nt = d(tt, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6691 + var rt = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, _).getRegex();
6692 + var st = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
6693 + var it = d(st, "gu").replace(/notPunctSpace/g, Z).replace(/punctSpace/g, C2).replace(/punct/g, _).getRegex();
6694 + var ot = d(/\\(punct)/, "gu").replace(/punct/g, _).getRegex();
6695 + var at = d(/^<(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();
6696 + var lt = d(J).replace("(?:-->|$)", "-->").getRegex();
6697 + var ut = d("^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();
6698 + var ge = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
6699 + var N2 = d(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", ge).getRegex();
6700 + var pt = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", N2).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
6701 + var ct = d(/^!?\[(label)\]\[(ref)\]/).replace("label", N2).replace("ref", X).getRegex();
6702 + var ht = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", X).getRegex();
6703 + var oe = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
6704 + var dt = d(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", ge).getRegex();
6705 + var kt = d("reflink|nolink(?!\\()", "g").replace("reflink", d(/^!?\[(label)\]\[(ref)\]/).replace("label", dt).replace("ref", oe).getRegex()).replace("nolink", d(/^!?\[(ref)\](?:\[\])?/).replace("ref", oe).getRegex()).getRegex();
6706 + var ae = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
6707 + var Y = { _backpedal: E2, anyPunctuation: ot, autolink: at, blockSkip: je, br: ce, code: ve, del: E2, delLDelim: E2, delRDelim: E2, emStrongLDelim: Ue, emStrongRDelimAst: Xe, emStrongRDelimUnd: et, escape: qe, link: pt, nolink: ht, punctuation: Ze, reflink: ct, reflinkSearch: kt, tag: ut, text: He, url: E2 };
6708 + var gt = { ...Y, emStrongLDelim: We, emStrongRDelimAst: Ye, emStrongRDelimUnd: nt, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", N2).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", N2).getRegex() };
6709 + var F = { ...Y, emStrongRDelimAst: Je, emStrongLDelim: Fe, delLDelim: rt, delRDelim: it, url: d(/^((?: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,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ae).getRegex() };
6710 + var ft = { ...F, br: d(ce).replace("{2,}", "*").getRegex(), text: d(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
6711 + var G = { normal: V, gfm: Be, pedantic: De };
6712 + var B = { normal: Y, gfm: F, breaks: ft, pedantic: gt };
6713 + var mt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
6714 + var fe = (l4) => mt[l4];
6715 + function R2(l4, e2) {
6650 6716 if (e2) {
6651 - if (m2.escapeTest.test(l4)) return l4.replace(m2.escapeReplace, de);
6652 - } else if (m2.escapeTestNoEncode.test(l4)) return l4.replace(m2.escapeReplaceNoEncode, de);
6717 + if (m2.escapeTest.test(l4)) return l4.replace(m2.escapeReplace, fe);
6718 + } else if (m2.escapeTestNoEncode.test(l4)) return l4.replace(m2.escapeReplaceNoEncode, fe);
6653 6719 return l4;
6654 6720 }
6655 - function J(l4) {
6721 + function ee(l4) {
6656 6722 try {
6657 6723 l4 = encodeURI(l4).replace(m2.percentDecode, "%");
6658 6724 } catch {
6659 6725 return null;
@@ -6659,74 +6725,109 @@
6659 6725 return null;
6660 6726 }
6661 6727 return l4;
6662 6728 }
6663 - function V(l4, e2) {
6664 - let t3 = l4.replace(m2.findPipe, (r2, i2, o3) => {
6665 - let u2 = false, a2 = i2;
6666 - for (; --a2 >= 0 && o3[a2] === "\\"; ) u2 = !u2;
6667 - return u2 ? "|" : " |";
6668 - }), n2 = t3.split(m2.splitPipe), s2 = 0;
6669 - if (n2[0].trim() || n2.shift(), n2.length > 0 && !n2.at(-1)?.trim() && n2.pop(), e2) if (n2.length > e2) n2.splice(e2);
6670 - else for (; n2.length < e2; ) n2.push("");
6671 - for (; s2 < n2.length; s2++) n2[s2] = n2[s2].trim().replace(m2.slashPipe, "|");
6672 - return n2;
6729 + function te(l4, e2) {
6730 + let t2 = l4.replace(m2.findPipe, (r2, o2, s) => {
6731 + let u = false, a = o2;
6732 + for (; --a >= 0 && s[a] === "\\"; ) u = !u;
6733 + return u ? "|" : " |";
6734 + }), n = t2.split(m2.splitPipe), i = 0;
6735 + if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e2) if (n.length > e2) n.splice(e2);
6736 + else for (; n.length < e2; ) n.push("");
6737 + for (; i < n.length; i++) n[i] = n[i].trim().replace(m2.slashPipe, "|");
6738 + return n;
6673 6739 }
6674 - function $2(l4, e2, t3) {
6675 - let n2 = l4.length;
6676 - if (n2 === 0) return "";
6677 - let s2 = 0;
6678 - for (; s2 < n2; ) {
6679 - let r2 = l4.charAt(n2 - s2 - 1);
6680 - if (r2 === e2 && !t3) s2++;
6681 - else if (r2 !== e2 && t3) s2++;
6740 + function $2(l4, e2, t2) {
6741 + let n = l4.length;
6742 + if (n === 0) return "";
6743 + let i = 0;
6744 + for (; i < n; ) {
6745 + let r2 = l4.charAt(n - i - 1);
6746 + if (r2 === e2 && !t2) i++;
6747 + else if (r2 !== e2 && t2) i++;
6682 6748 else break;
6683 6749 }
6684 - return l4.slice(0, n2 - s2);
6750 + return l4.slice(0, n - i);
6685 6751 }
6686 - function Y(l4) {
6752 + function ne(l4) {
6687 6753 let e2 = l4.split(`
6688 -`), t3 = e2.length - 1;
6689 - for (; t3 >= 0 && m2.blankLine.test(e2[t3]); ) t3--;
6690 - return e2.length - t3 <= 2 ? l4 : e2.slice(0, t3 + 1).join(`
6754 +`), t2 = e2.length - 1;
6755 + for (; t2 >= 0 && m2.blankLine.test(e2[t2]); ) t2--;
6756 + return e2.length - t2 <= 2 ? l4 : e2.slice(0, t2 + 1).join(`
6691 6757 `);
6692 6758 }
6693 - function ge(l4, e2) {
6759 + function D2(l4) {
6760 + return l4.toLowerCase().toUpperCase().toLowerCase();
6761 + }
6762 + function me(l4, e2) {
6694 6763 if (l4.indexOf(e2[1]) === -1) return -1;
6695 - let t3 = 0;
6696 - for (let n2 = 0; n2 < l4.length; n2++) if (l4[n2] === "\\") n2++;
6697 - else if (l4[n2] === e2[0]) t3++;
6698 - else if (l4[n2] === e2[1] && (t3--, t3 < 0)) return n2;
6699 - return t3 > 0 ? -2 : -1;
6764 + let t2 = 0;
6765 + for (let n = 0; n < l4.length; n++) if (l4[n] === "\\") n++;
6766 + else if (l4[n] === e2[0]) t2++;
6767 + else if (l4[n] === e2[1] && (t2--, t2 < 0)) return n;
6768 + return t2 > 0 ? -2 : -1;
6700 6769 }
6701 - function fe(l4, e2 = 0) {
6702 - let t3 = e2, n2 = "";
6703 - for (let s2 of l4) if (s2 === " ") {
6704 - let r2 = 4 - t3 % 4;
6705 - n2 += " ".repeat(r2), t3 += r2;
6706 - } else n2 += s2, t3++;
6707 - return n2;
6770 + function xe(l4, e2 = 0) {
6771 + let t2 = e2, n = "";
6772 + for (let i of l4) if (i === " ") {
6773 + let r2 = 4 - t2 % 4;
6774 + n += " ".repeat(r2), t2 += r2;
6775 + } else n += i, t2++;
6776 + return n;
6708 6777 }
6709 - function me(l4, e2, t3, n2, s2) {
6710 - let r2 = e2.href, i2 = e2.title || null, o3 = l4[1].replace(s2.other.outputLinkReplace, "$1");
6711 - n2.state.inLink = true;
6712 - let u2 = { type: l4[0].charAt(0) === "!" ? "image" : "link", raw: t3, href: r2, title: i2, text: o3, tokens: n2.inlineTokens(o3) };
6713 - return n2.state.inLink = false, u2;
6778 + function be(l4, e2, t2, n, i) {
6779 + let r2 = e2.href, o2 = e2.title || null, s = l4[1].replace(i.other.outputLinkReplace, "$1"), u = l4[0].charAt(0) === "!";
6780 + n.state.inLink = true;
6781 + let a = n.state.linkEmitted, p2 = n.state.inRawBlock;
6782 + n.state.linkEmitted = false;
6783 + let c2 = n.inlineTokens(s), h = n.state.linkEmitted;
6784 + if (n.state.linkEmitted = a, n.state.inLink = false, !u) {
6785 + if (h) {
6786 + n.state.inRawBlock = p2;
6787 + return;
6788 + }
6789 + n.state.linkEmitted = true;
6790 + }
6791 + return { type: u ? "image" : "link", raw: t2, href: r2, title: o2, text: s, tokens: c2 };
6714 6792 }
6715 - function rt(l4, e2, t3) {
6716 - let n2 = l4.match(t3.other.indentCodeCompensation);
6717 - if (n2 === null) return e2;
6718 - let s2 = n2[1];
6793 + function xt(l4, e2, t2) {
6794 + let n = l4.match(t2.other.indentCodeCompensation);
6795 + if (n === null) return e2;
6796 + let i = n[1];
6719 6797 return e2.split(`
6720 6798 `).map((r2) => {
6721 - let i2 = r2.match(t3.other.beginningSpace);
6722 - if (i2 === null) return r2;
6723 - let [o3] = i2;
6724 - return o3.length >= s2.length ? r2.slice(s2.length) : r2;
6799 + let o2 = r2.match(t2.other.beginningSpace);
6800 + if (o2 === null) return r2;
6801 + let [s] = o2;
6802 + return r2.slice(Math.min(s.length, i.length));
6725 6803 }).join(`
6726 6804 `);
6727 6805 }
6728 - var w2 = class {
6806 + function Re(l4, e2, t2, n) {
6807 + if (!e2.includes("<")) return false;
6808 + for (let i = 0; i < e2.length; i++) {
6809 + if (e2[i] === "\\") {
6810 + i++;
6811 + continue;
6812 + }
6813 + if (e2[i] === "`") {
6814 + let s = n.inline.code.exec(e2.slice(i));
6815 + if (s) {
6816 + i += s[0].length - 1;
6817 + continue;
6818 + }
6819 + }
6820 + if (e2[i] !== "<") continue;
6821 + let r2 = l4.slice(t2 + i), o2 = n.inline.tag.exec(r2) || n.inline.autolink.exec(r2);
6822 + if (o2) {
6823 + if (o2[0].length > e2.length - i) return true;
6824 + i += o2[0].length - 1;
6825 + }
6826 + }
6827 + return false;
6828 + }
6829 + var y2 = class {
6729 6830 options;
6730 6831 rules;
6731 6832 lexer;
6732 6833 constructor(e2) {
@@ -6732,319 +6833,326 @@
6732 6833 constructor(e2) {
6733 6834 this.options = e2 || T;
6734 6835 }
6735 6836 space(e2) {
6736 - let t3 = this.rules.block.newline.exec(e2);
6737 - if (t3 && t3[0].length > 0) return { type: "space", raw: t3[0] };
6837 + let t2 = this.rules.block.newline.exec(e2);
6838 + if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
6738 6839 }
6739 6840 code(e2) {
6740 - let t3 = this.rules.block.code.exec(e2);
6741 - if (t3) {
6742 - let n2 = this.options.pedantic ? t3[0] : Y(t3[0]), s2 = n2.replace(this.rules.other.codeRemoveIndent, "");
6743 - return { type: "code", raw: n2, codeBlockStyle: "indented", text: s2 };
6841 + let t2 = this.rules.block.code.exec(e2);
6842 + if (t2) {
6843 + let n = this.options.pedantic ? t2[0] : ne(t2[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
6844 + return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
6744 6845 }
6745 6846 }
6746 6847 fences(e2) {
6747 - let t3 = this.rules.block.fences.exec(e2);
6748 - if (t3) {
6749 - let n2 = t3[0], s2 = rt(n2, t3[3] || "", this.rules);
6750 - return { type: "code", raw: n2, lang: t3[2] ? t3[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t3[2], text: s2 };
6848 + let t2 = this.rules.block.fences.exec(e2);
6849 + if (t2) {
6850 + let n = t2[0], i = xt(n, t2[3] || "", this.rules);
6851 + return { type: "code", raw: n, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: i };
6751 6852 }
6752 6853 }
6753 6854 heading(e2) {
6754 - let t3 = this.rules.block.heading.exec(e2);
6755 - if (t3) {
6756 - let n2 = t3[2].trim();
6757 - if (this.rules.other.endingHash.test(n2)) {
6758 - let s2 = $2(n2, "#");
6759 - (this.options.pedantic || !s2 || this.rules.other.endingSpaceChar.test(s2)) && (n2 = s2.trim());
6855 + let t2 = this.rules.block.heading.exec(e2);
6856 + if (t2) {
6857 + let n = t2[2].trim();
6858 + if (this.rules.other.endingHash.test(n)) {
6859 + let i = $2(n, "#");
6860 + (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
6760 6861 }
6761 - return { type: "heading", raw: $2(t3[0], `
6762 -`), depth: t3[1].length, text: n2, tokens: this.lexer.inline(n2) };
6862 + return { type: "heading", raw: $2(t2[0], `
6863 +`), depth: t2[1].length, text: n, tokens: this.lexer.inline(n) };
6763 6864 }
6764 6865 }
6765 6866 hr(e2) {
6766 - let t3 = this.rules.block.hr.exec(e2);
6767 - if (t3) return { type: "hr", raw: $2(t3[0], `
6867 + let t2 = this.rules.block.hr.exec(e2);
6868 + if (t2) return { type: "hr", raw: $2(t2[0], `
6768 6869 `) };
6769 6870 }
6770 6871 blockquote(e2) {
6771 - let t3 = this.rules.block.blockquote.exec(e2);
6772 - if (t3) {
6773 - let n2 = $2(t3[0], `
6872 + let t2 = this.rules.block.blockquote.exec(e2);
6873 + if (t2) {
6874 + let n = $2(t2[0], `
6774 6875 `).split(`
6775 -`), s2 = "", r2 = "", i2 = [];
6776 - for (; n2.length > 0; ) {
6777 - let o3 = false, u2 = [], a2;
6778 - for (a2 = 0; a2 < n2.length; a2++) if (this.rules.other.blockquoteStart.test(n2[a2])) u2.push(n2[a2]), o3 = true;
6779 - else if (!o3) u2.push(n2[a2]);
6876 +`), i = "", r2 = "", o2 = [];
6877 + for (; n.length > 0; ) {
6878 + let s = false, u = [], a;
6879 + for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), s = true;
6880 + else if (!s) u.push(n[a]);
6780 6881 else break;
6781 - n2 = n2.slice(a2);
6782 - let c2 = u2.join(`
6783 -`), p2 = c2.replace(this.rules.other.blockquoteSetextReplace, `
6882 + n = n.slice(a);
6883 + let p2 = u.join(`
6884 +`), c2 = p2.replace(this.rules.other.blockquoteSetextReplace, `
6784 6885 $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
6785 - s2 = s2 ? `${s2}
6786 -${c2}` : c2, r2 = r2 ? `${r2}
6787 -${p2}` : p2;
6788 - let k2 = this.lexer.state.top;
6789 - if (this.lexer.state.top = true, this.lexer.blockTokens(p2, i2, true), this.lexer.state.top = k2, n2.length === 0) break;
6790 - let h2 = i2.at(-1);
6791 - if (h2?.type === "code") break;
6792 - if (h2?.type === "blockquote") {
6793 - let R = h2, f2 = R.raw + `
6794 -` + n2.join(`
6795 -`), S2 = this.blockquote(f2);
6796 - i2[i2.length - 1] = S2, s2 = s2.substring(0, s2.length - R.raw.length) + S2.raw, r2 = r2.substring(0, r2.length - R.text.length) + S2.text;
6886 + i = i ? `${i}
6887 +${p2}` : p2, r2 = r2 ? `${r2}
6888 +${c2}` : c2;
6889 + let h = this.lexer.state.top;
6890 + if (this.lexer.state.top = true, this.lexer.blockTokens(c2, o2, true), this.lexer.state.top = h, n.length === 0) break;
6891 + let k2 = o2.at(-1);
6892 + if (k2?.type === "code") break;
6893 + if (k2?.type === "blockquote") {
6894 + let O = k2, g2 = n.join(`
6895 +`), w2 = O.raw + `
6896 +` + g2.replace(this.rules.other.blockquoteSetextReplace2, ""), z = this.blockquote(w2);
6897 + o2[o2.length - 1] = z, i = `${i}
6898 +${g2}`, r2 = r2.substring(0, r2.length - O.text.length) + z.text;
6797 6899 break;
6798 - } else if (h2?.type === "list") {
6799 - let R = h2, f2 = R.raw + `
6800 -` + n2.join(`
6801 -`), S2 = this.list(f2);
6802 - i2[i2.length - 1] = S2, s2 = s2.substring(0, s2.length - h2.raw.length) + S2.raw, r2 = r2.substring(0, r2.length - R.raw.length) + S2.raw, n2 = f2.substring(i2.at(-1).raw.length).split(`
6900 + } else if (k2?.type === "list") {
6901 + let O = k2, g2 = O.raw + `
6902 +` + n.join(`
6903 +`), w2 = this.list(g2);
6904 + o2[o2.length - 1] = w2, i = i.substring(0, i.length - k2.raw.length) + w2.raw, r2 = r2.substring(0, r2.length - O.raw.length) + w2.raw, n = g2.substring(o2.at(-1).raw.length).split(`
6803 6905 `);
6804 6906 continue;
6805 6907 }
6806 6908 }
6807 - return { type: "blockquote", raw: s2, tokens: i2, text: r2 };
6909 + return { type: "blockquote", raw: i, tokens: o2, text: r2 };
6808 6910 }
6809 6911 }
6810 6912 list(e2) {
6811 - let t3 = this.rules.block.list.exec(e2);
6812 - if (t3) {
6813 - let n2 = t3[1].trim(), s2 = n2.length > 1, r2 = { type: "list", raw: "", ordered: s2, start: s2 ? +n2.slice(0, -1) : "", loose: false, items: [] };
6814 - n2 = s2 ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = s2 ? n2 : "[*+-]");
6815 - let i2 = this.rules.other.listItemRegex(n2), o3 = false;
6913 + let t2 = this.rules.block.list.exec(e2);
6914 + if (t2) {
6915 + let n = t2[1].trim(), i = n.length > 1, r2 = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: false, items: [] };
6916 + n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
6917 + let o2 = this.rules.other.listItemRegex(n), s = false;
6816 6918 for (; e2; ) {
6817 - let a2 = false, c2 = "", p2 = "";
6818 - if (!(t3 = i2.exec(e2)) || this.rules.block.hr.test(e2)) break;
6819 - c2 = t3[0], e2 = e2.substring(c2.length);
6820 - let k2 = fe(t3[2].split(`
6821 -`, 1)[0], t3[1].length), h2 = e2.split(`
6822 -`, 1)[0], R = !k2.trim(), f2 = 0;
6823 - if (this.options.pedantic ? (f2 = 2, p2 = k2.trimStart()) : R ? f2 = t3[1].length + 1 : (f2 = k2.search(this.rules.other.nonSpaceChar), f2 = f2 > 4 ? 1 : f2, p2 = k2.slice(f2), f2 += t3[1].length), R && this.rules.other.blankLine.test(h2) && (c2 += h2 + `
6824 -`, e2 = e2.substring(h2.length + 1), a2 = true), !a2) {
6825 - let S2 = this.rules.other.nextBulletRegex(f2), ee = this.rules.other.hrRegex(f2), te = this.rules.other.fencesBeginRegex(f2), ne = this.rules.other.headingBeginRegex(f2), xe = this.rules.other.htmlBeginRegex(f2), be = this.rules.other.blockquoteBeginRegex(f2);
6919 + let a = false, p2 = "", c2 = "";
6920 + if (!(t2 = o2.exec(e2)) || this.rules.block.hr.test(e2)) break;
6921 + p2 = t2[0], e2 = e2.substring(p2.length);
6922 + let h = xe(t2[2].split(`
6923 +`, 1)[0], t2[1].length), k2 = e2.split(`
6924 +`, 1)[0], O = !h.trim(), g2 = 0;
6925 + if (this.options.pedantic ? (g2 = 2, c2 = h.trimStart()) : O ? g2 = t2[1].length + 1 : (g2 = h.search(this.rules.other.nonSpaceChar), g2 = g2 > 4 ? 1 : g2, c2 = h.slice(g2), g2 += t2[1].length), O && this.rules.other.blankLine.test(k2) && (p2 += k2 + `
6926 +`, e2 = e2.substring(k2.length + 1), a = true), !a) {
6927 + 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);
6826 6928 for (; e2; ) {
6827 - let Z = e2.split(`
6828 -`, 1)[0], C;
6829 - if (h2 = Z, this.options.pedantic ? (h2 = h2.replace(this.rules.other.listReplaceNesting, " "), C = h2) : C = h2.replace(this.rules.other.tabCharGlobal, " "), te.test(h2) || ne.test(h2) || xe.test(h2) || be.test(h2) || S2.test(h2) || ee.test(h2)) break;
6830 - if (C.search(this.rules.other.nonSpaceChar) >= f2 || !h2.trim()) p2 += `
6831 -` + C.slice(f2);
6929 + let j2 = e2.split(`
6930 +`, 1)[0], q2;
6931 + if (k2 = j2, this.options.pedantic ? (k2 = k2.replace(this.rules.other.listReplaceNesting, " "), q2 = k2) : q2 = k2.replace(this.rules.other.tabCharGlobal, " "), re.test(k2) || se.test(k2) || Te.test(k2) || Oe.test(k2) || w2.test(k2) || z.test(k2)) break;
6932 + if (q2.search(this.rules.other.nonSpaceChar) >= g2 || !k2.trim()) c2 += `
6933 +` + q2.slice(g2);
6832 6934 else {
6833 - if (R || k2.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(k2) || ne.test(k2) || ee.test(k2)) break;
6834 - p2 += `
6835 -` + h2;
6935 + if (O || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test(h) || se.test(h) || z.test(h)) break;
6936 + c2 += `
6937 +` + k2;
6836 6938 }
6837 - R = !h2.trim(), c2 += Z + `
6838 -`, e2 = e2.substring(Z.length + 1), k2 = C.slice(f2);
6939 + O = !k2.trim(), p2 += j2 + `
6940 +`, e2 = e2.substring(j2.length + 1), h = q2.slice(g2);
6839 6941 }
6840 6942 }
6841 - r2.loose || (o3 ? r2.loose = true : this.rules.other.doubleBlankLine.test(c2) && (o3 = true)), r2.items.push({ type: "list_item", raw: c2, task: !!this.options.gfm && this.rules.other.listIsTask.test(p2), loose: false, text: p2, tokens: [] }), r2.raw += c2;
6943 + r2.loose || (s ? r2.loose = true : this.rules.other.doubleBlankLine.test(p2) && (s = 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;
6842 6944 }
6843 - let u2 = r2.items.at(-1);
6844 - if (u2) u2.raw = u2.raw.trimEnd(), u2.text = u2.text.trimEnd();
6945 + let u = r2.items.at(-1);
6946 + if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
6845 6947 else return;
6846 6948 r2.raw = r2.raw.trimEnd();
6847 - for (let a2 of r2.items) {
6848 - this.lexer.state.top = false, a2.tokens = this.lexer.blockTokens(a2.text, []);
6849 - let c2 = a2.tokens[0];
6850 - if (a2.task && (c2?.type === "text" || c2?.type === "paragraph")) {
6851 - a2.text = a2.text.replace(this.rules.other.listReplaceTask, ""), c2.raw = c2.raw.replace(this.rules.other.listReplaceTask, ""), c2.text = c2.text.replace(this.rules.other.listReplaceTask, "");
6852 - for (let k2 = this.lexer.inlineQueue.length - 1; k2 >= 0; k2--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k2].src)) {
6853 - this.lexer.inlineQueue[k2].src = this.lexer.inlineQueue[k2].src.replace(this.rules.other.listReplaceTask, "");
6949 + for (let a of r2.items) if (this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []), !r2.loose) {
6950 + let p2 = a.tokens.filter((h) => h.type === "space"), c2 = p2.length > 0 && p2.some((h) => this.rules.other.anyLine.test(h.raw));
6951 + r2.loose = c2;
6952 + }
6953 + for (let a of r2.items) {
6954 + let p2 = a.tokens[0];
6955 + if (a.task && (p2?.type === "text" || p2?.type === "paragraph")) {
6956 + a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p2.raw = p2.raw.replace(this.rules.other.listReplaceTask, ""), p2.text = p2.text.replace(this.rules.other.listReplaceTask, "");
6957 + for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
6958 + this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
6854 6959 break;
6855 6960 }
6856 - let p2 = this.rules.other.listTaskCheckbox.exec(a2.raw);
6857 - if (p2) {
6858 - let k2 = { type: "checkbox", raw: p2[0] + " ", checked: p2[0] !== "[ ]" };
6859 - a2.checked = k2.checked, r2.loose ? a2.tokens[0] && ["paragraph", "text"].includes(a2.tokens[0].type) && "tokens" in a2.tokens[0] && a2.tokens[0].tokens ? (a2.tokens[0].raw = k2.raw + a2.tokens[0].raw, a2.tokens[0].text = k2.raw + a2.tokens[0].text, a2.tokens[0].tokens.unshift(k2)) : a2.tokens.unshift({ type: "paragraph", raw: k2.raw, text: k2.raw, tokens: [k2] }) : a2.tokens.unshift(k2);
6961 + let c2 = this.rules.other.listTaskCheckbox.exec(a.raw);
6962 + if (c2) {
6963 + let h = { type: "checkbox", raw: c2[0] + " ", checked: c2[0] !== "[ ]" };
6964 + a.checked = h.checked, r2.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = h.raw + a.tokens[0].raw, a.tokens[0].text = h.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(h)) : a.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [h] }) : a.tokens.unshift(h);
6860 6965 }
6861 - } else a2.task && (a2.task = false);
6862 - if (!r2.loose) {
6863 - let p2 = a2.tokens.filter((h2) => h2.type === "space"), k2 = p2.length > 0 && p2.some((h2) => this.rules.other.anyLine.test(h2.raw));
6864 - r2.loose = k2;
6865 - }
6966 + } else a.task && (a.task = false);
6866 6967 }
6867 - if (r2.loose) for (let a2 of r2.items) {
6868 - a2.loose = true;
6869 - for (let c2 of a2.tokens) c2.type === "text" && (c2.type = "paragraph");
6968 + if (r2.loose) for (let a of r2.items) {
6969 + a.loose = true;
6970 + for (let p2 of a.tokens) p2.type === "text" && (p2.type = "paragraph");
6870 6971 }
6871 6972 return r2;
6872 6973 }
6873 6974 }
6874 6975 html(e2) {
6875 - let t3 = this.rules.block.html.exec(e2);
6876 - if (t3) {
6877 - let n2 = Y(t3[0]);
6878 - return { type: "html", block: true, raw: n2, pre: t3[1] === "pre" || t3[1] === "script" || t3[1] === "style", text: n2 };
6976 + let t2 = this.rules.block.html.exec(e2);
6977 + if (t2) {
6978 + let n = ne(t2[0]);
6979 + return { type: "html", block: true, raw: n, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n };
6879 6980 }
6880 6981 }
6881 6982 def(e2) {
6882 - let t3 = this.rules.block.def.exec(e2);
6883 - if (t3) {
6884 - let n2 = t3[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s2 = t3[2] ? t3[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t3[3] ? t3[3].substring(1, t3[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t3[3];
6885 - return { type: "def", tag: n2, raw: $2(t3[0], `
6886 -`), href: s2, title: r2 };
6983 + let t2 = this.rules.block.def.exec(e2);
6984 + if (t2) {
6985 + let n = D2(t2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = 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];
6986 + return { type: "def", tag: n, raw: $2(t2[0], `
6987 +`), href: i, title: r2 };
6887 6988 }
6888 6989 }
6889 6990 table(e2) {
6890 - let t3 = this.rules.block.table.exec(e2);
6891 - if (!t3 || !this.rules.other.tableDelimiter.test(t3[2])) return;
6892 - let n2 = V(t3[1]), s2 = t3[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t3[3]?.trim() ? t3[3].replace(this.rules.other.tableRowBlankLine, "").split(`
6893 -`) : [], i2 = { type: "table", raw: $2(t3[0], `
6991 + let t2 = this.rules.block.table.exec(e2);
6992 + if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
6993 + let n = te(t2[1]), i = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
6994 +`) : [], o2 = { type: "table", raw: $2(t2[0], `
6894 6995 `), header: [], align: [], rows: [] };
6895 - if (n2.length === s2.length) {
6896 - for (let o3 of s2) this.rules.other.tableAlignRight.test(o3) ? i2.align.push("right") : this.rules.other.tableAlignCenter.test(o3) ? i2.align.push("center") : this.rules.other.tableAlignLeft.test(o3) ? i2.align.push("left") : i2.align.push(null);
6897 - for (let o3 = 0; o3 < n2.length; o3++) i2.header.push({ text: n2[o3], tokens: this.lexer.inline(n2[o3]), header: true, align: i2.align[o3] });
6898 - for (let o3 of r2) i2.rows.push(V(o3, i2.header.length).map((u2, a2) => ({ text: u2, tokens: this.lexer.inline(u2), header: false, align: i2.align[a2] })));
6899 - return i2;
6996 + if (n.length === i.length) {
6997 + for (let s of i) this.rules.other.tableAlignRight.test(s) ? o2.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o2.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o2.align.push("left") : o2.align.push(null);
6998 + for (let s = 0; s < n.length; s++) o2.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: true, align: o2.align[s] });
6999 + for (let s of r2) o2.rows.push(te(s, o2.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: false, align: o2.align[a] })));
7000 + return o2;
6900 7001 }
6901 7002 }
6902 7003 lheading(e2) {
6903 - let t3 = this.rules.block.lheading.exec(e2);
6904 - if (t3) {
6905 - let n2 = t3[1].trim();
6906 - return { type: "heading", raw: $2(t3[0], `
6907 -`), depth: t3[2].charAt(0) === "=" ? 1 : 2, text: n2, tokens: this.lexer.inline(n2) };
7004 + let t2 = this.rules.block.lheading.exec(e2);
7005 + if (t2) {
7006 + let n = t2[1].trim();
7007 + return { type: "heading", raw: $2(t2[0], `
7008 +`), depth: t2[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
6908 7009 }
6909 7010 }
6910 7011 paragraph(e2) {
6911 - let t3 = this.rules.block.paragraph.exec(e2);
6912 - if (t3) {
6913 - let n2 = t3[1].charAt(t3[1].length - 1) === `
6914 -` ? t3[1].slice(0, -1) : t3[1];
6915 - return { type: "paragraph", raw: t3[0], text: n2, tokens: this.lexer.inline(n2) };
7012 + let t2 = this.rules.block.paragraph.exec(e2);
7013 + if (t2) {
7014 + let n = t2[1].charAt(t2[1].length - 1) === `
7015 +` ? t2[1].slice(0, -1) : t2[1];
7016 + return { type: "paragraph", raw: t2[0], text: n, tokens: this.lexer.inline(n) };
6916 7017 }
6917 7018 }
6918 7019 text(e2) {
6919 - let t3 = this.rules.block.text.exec(e2);
6920 - if (t3) return { type: "text", raw: t3[0], text: t3[0], tokens: this.lexer.inline(t3[0]) };
7020 + let t2 = this.rules.block.text.exec(e2);
7021 + if (t2) return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
6921 7022 }
6922 7023 escape(e2) {
6923 - let t3 = this.rules.inline.escape.exec(e2);
6924 - if (t3) return { type: "escape", raw: t3[0], text: t3[1] };
7024 + let t2 = this.rules.inline.escape.exec(e2);
7025 + if (t2) return { type: "escape", raw: t2[0], text: t2[1] };
6925 7026 }
6926 7027 tag(e2) {
6927 - let t3 = this.rules.inline.tag.exec(e2);
6928 - if (t3) return !this.lexer.state.inLink && this.rules.other.startATag.test(t3[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t3[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t3[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t3[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t3[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t3[0] };
7028 + let t2 = this.rules.inline.tag.exec(e2);
7029 + if (t2) return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] };
6929 7030 }
6930 7031 link(e2) {
6931 - let t3 = this.rules.inline.link.exec(e2);
6932 - if (t3) {
6933 - let n2 = t3[2].trim();
6934 - if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n2)) {
6935 - if (!this.rules.other.endAngleBracket.test(n2)) return;
6936 - let i2 = $2(n2.slice(0, -1), "\\");
6937 - if ((n2.length - i2.length) % 2 === 0) return;
7032 + let t2 = this.rules.inline.link.exec(e2);
7033 + if (t2) {
7034 + let n = t2[0].charAt(0) === "!" ? 2 : 1;
7035 + if (!this.options.pedantic && Re(e2, t2[1], n, this.rules)) return;
7036 + let i = t2[2].trim();
7037 + if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
7038 + if (!this.rules.other.endAngleBracket.test(i)) return;
7039 + let s = $2(i.slice(0, -1), "\\");
7040 + if ((i.length - s.length) % 2 === 0) return;
6938 7041 } else {
6939 - let i2 = ge(t3[2], "()");
6940 - if (i2 === -2) return;
6941 - if (i2 > -1) {
6942 - let u2 = (t3[0].indexOf("!") === 0 ? 5 : 4) + t3[1].length + i2;
6943 - t3[2] = t3[2].substring(0, i2), t3[0] = t3[0].substring(0, u2).trim(), t3[3] = "";
7042 + let s = me(t2[2], "()");
7043 + if (s === -2) return;
7044 + if (s > -1) {
7045 + let a = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s;
7046 + t2[2] = t2[2].substring(0, s), t2[0] = t2[0].substring(0, a).trim(), t2[3] = "";
6944 7047 }
6945 7048 }
6946 - let s2 = t3[2], r2 = "";
7049 + let r2 = t2[2], o2 = "";
6947 7050 if (this.options.pedantic) {
6948 - let i2 = this.rules.other.pedanticHrefTitle.exec(s2);
6949 - i2 && (s2 = i2[1], r2 = i2[3]);
6950 - } else r2 = t3[3] ? t3[3].slice(1, -1) : "";
6951 - 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)), me(t3, { href: s2 && s2.replace(this.rules.inline.anyPunctuation, "$1"), title: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1") }, t3[0], this.lexer, this.rules);
7051 + let s = this.rules.other.pedanticHrefTitle.exec(r2);
7052 + s && (r2 = s[1], o2 = s[3]);
7053 + } else o2 = t2[3] ? t2[3].slice(1, -1) : "";
7054 + return r2 = r2.trim(), this.rules.other.startAngleBracket.test(r2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? 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);
6952 7055 }
6953 7056 }
6954 - reflink(e2, t3) {
6955 - let n2;
6956 - if ((n2 = this.rules.inline.reflink.exec(e2)) || (n2 = this.rules.inline.nolink.exec(e2))) {
6957 - let s2 = (n2[2] || n2[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r2 = t3[s2.toLowerCase()];
6958 - if (!r2) {
6959 - let i2 = n2[0].charAt(0);
6960 - return { type: "text", raw: i2, text: i2 };
7057 + reflink(e2, t2) {
7058 + let n;
7059 + if ((n = this.rules.inline.reflink.exec(e2)) || (n = this.rules.inline.nolink.exec(e2))) {
7060 + let i = n[0].charAt(0) === "!" ? 2 : 1;
7061 + if (!this.options.pedantic && Re(e2, n[1], i, this.rules)) return;
7062 + let r2 = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), o2 = t2[D2(r2)];
7063 + if (!o2) {
7064 + let s = n[0].charAt(0);
7065 + return { type: "text", raw: s, text: s };
6961 7066 }
6962 - return me(n2, r2, n2[0], this.lexer, this.rules);
7067 + return be(n, o2, n[0], this.lexer, this.rules);
6963 7068 }
6964 7069 }
6965 - emStrong(e2, t3, n2 = "") {
6966 - let s2 = this.rules.inline.emStrongLDelim.exec(e2);
6967 - if (!s2 || !s2[1] && !s2[2] && !s2[3] && !s2[4] || s2[4] && n2.match(this.rules.other.unicodeAlphaNumeric)) return;
6968 - if (!(s2[1] || s2[3] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
6969 - let i2 = [...s2[0]].length - 1, o3, u2, a2 = i2, c2 = 0, p2 = s2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
6970 - for (p2.lastIndex = 0, t3 = t3.slice(-1 * e2.length + i2); (s2 = p2.exec(t3)) !== null; ) {
6971 - if (o3 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o3) continue;
6972 - if (u2 = [...o3].length, s2[3] || s2[4]) {
6973 - a2 += u2;
7070 + emStrong(e2, t2, n = "") {
7071 + let i = this.rules.inline.emStrongLDelim.exec(e2);
7072 + if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
7073 + if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
7074 + let o2 = [...i[0]].length - 1, s, u, a = o2, p2 = 0, c2 = i[0][0], h = n === c2, k2 = c2 === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
7075 + for (k2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i = k2.exec(t2)) !== null; ) {
7076 + if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue;
7077 + if (u = [...s].length, i[3] || i[4]) {
7078 + a += u;
6974 7079 continue;
6975 - } else if ((s2[5] || s2[6]) && i2 % 3 && !((i2 + u2) % 3)) {
6976 - c2 += u2;
6977 - continue;
7080 + } else if (i[5] || i[6]) {
7081 + if (o2 % 3 && !((o2 + u) % 3)) {
7082 + p2 += u;
7083 + continue;
7084 + }
7085 + if (h) break;
6978 7086 }
6979 - if (a2 -= u2, a2 > 0) continue;
6980 - u2 = Math.min(u2, u2 + a2 + c2);
6981 - let k2 = [...s2[0]][0].length, h2 = e2.slice(0, i2 + s2.index + k2 + u2);
6982 - if (Math.min(i2, u2) % 2) {
6983 - let f2 = h2.slice(1, -1);
6984 - return { type: "em", raw: h2, text: f2, tokens: this.lexer.inlineTokens(f2) };
7087 + if (a -= u, a > 0) continue;
7088 + u = Math.min(u, u + a + p2);
7089 + let O = [...i[0]][0].length, g2 = e2.slice(0, o2 + i.index + O + u);
7090 + if (Math.min(o2, u) % 2) {
7091 + let z = g2.slice(1, -1);
7092 + return { type: "em", raw: g2, text: z, tokens: this.lexer.inlineTokens(z) };
6985 7093 }
6986 - let R = h2.slice(2, -2);
6987 - return { type: "strong", raw: h2, text: R, tokens: this.lexer.inlineTokens(R) };
7094 + let w2 = g2.slice(2, -2);
7095 + return { type: "strong", raw: g2, text: w2, tokens: this.lexer.inlineTokens(w2) };
6988 7096 }
6989 7097 }
6990 7098 }
6991 7099 codespan(e2) {
6992 - let t3 = this.rules.inline.code.exec(e2);
6993 - if (t3) {
6994 - let n2 = t3[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);
6995 - return s2 && r2 && (n2 = n2.substring(1, n2.length - 1)), { type: "codespan", raw: t3[0], text: n2 };
7100 + let t2 = this.rules.inline.code.exec(e2);
7101 + if (t2) {
7102 + let n = t2[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r2 = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
7103 + return i && r2 && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t2[0], text: n };
6996 7104 }
6997 7105 }
6998 7106 br(e2) {
6999 - let t3 = this.rules.inline.br.exec(e2);
7000 - if (t3) return { type: "br", raw: t3[0] };
7107 + let t2 = this.rules.inline.br.exec(e2);
7108 + if (t2) return { type: "br", raw: t2[0] };
7001 7109 }
7002 - del(e2, t3, n2 = "") {
7003 - let s2 = this.rules.inline.delLDelim.exec(e2);
7004 - if (!s2) return;
7005 - if (!(s2[1] || "") || !n2 || this.rules.inline.punctuation.exec(n2)) {
7006 - let i2 = [...s2[0]].length - 1, o3, u2, a2 = i2, c2 = this.rules.inline.delRDelim;
7007 - for (c2.lastIndex = 0, t3 = t3.slice(-1 * e2.length + i2); (s2 = c2.exec(t3)) !== null; ) {
7008 - if (o3 = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o3 || (u2 = [...o3].length, u2 !== i2)) continue;
7009 - if (s2[3] || s2[4]) {
7010 - a2 += u2;
7110 + del(e2, t2, n = "") {
7111 + let i = this.rules.inline.delLDelim.exec(e2);
7112 + if (!i) return;
7113 + if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
7114 + let o2 = [...i[0]].length - 1, s, u, a = o2, p2 = this.rules.inline.delRDelim;
7115 + for (p2.lastIndex = 0, t2 = t2.slice(-1 * e2.length + o2); (i = p2.exec(t2)) !== null; ) {
7116 + if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (u = [...s].length, u !== o2)) continue;
7117 + if (i[3] || i[4]) {
7118 + a += u;
7011 7119 continue;
7012 7120 }
7013 - if (a2 -= u2, a2 > 0) continue;
7014 - u2 = Math.min(u2, u2 + a2);
7015 - let p2 = [...s2[0]][0].length, k2 = e2.slice(0, i2 + s2.index + p2 + u2), h2 = k2.slice(i2, -i2);
7016 - return { type: "del", raw: k2, text: h2, tokens: this.lexer.inlineTokens(h2) };
7121 + if (a -= u, a > 0) continue;
7122 + u = Math.min(u, u + a);
7123 + let c2 = [...i[0]][0].length, h = e2.slice(0, o2 + i.index + c2 + u), k2 = h.slice(o2, -o2);
7124 + return { type: "del", raw: h, text: k2, tokens: this.lexer.inlineTokens(k2) };
7017 7125 }
7018 7126 }
7019 7127 }
7020 7128 autolink(e2) {
7021 - let t3 = this.rules.inline.autolink.exec(e2);
7022 - if (t3) {
7023 - let n2, s2;
7024 - return t3[2] === "@" ? (n2 = t3[1], s2 = "mailto:" + n2) : (n2 = t3[1], s2 = n2), { type: "link", raw: t3[0], text: n2, href: s2, tokens: [{ type: "text", raw: n2, text: n2 }] };
7129 + let t2 = this.rules.inline.autolink.exec(e2);
7130 + if (t2) {
7131 + let n, i;
7132 + return t2[2] === "@" ? (n = t2[1], i = "mailto:" + n) : (n = t2[1], i = n), { type: "link", raw: t2[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
7025 7133 }
7026 7134 }
7027 7135 url(e2) {
7028 - let t3;
7029 - if (t3 = this.rules.inline.url.exec(e2)) {
7030 - let n2, s2;
7031 - if (t3[2] === "@") n2 = t3[0], s2 = "mailto:" + n2;
7136 + let t2;
7137 + if (t2 = this.rules.inline.url.exec(e2)) {
7138 + let n, i;
7139 + if (t2[2] === "@") n = t2[0], i = "mailto:" + n;
7032 7140 else {
7033 7141 let r2;
7034 7142 do
7035 - r2 = t3[0], t3[0] = this.rules.inline._backpedal.exec(t3[0])?.[0] ?? "";
7036 - while (r2 !== t3[0]);
7037 - n2 = t3[0], t3[1] === "www." ? s2 = "http://" + t3[0] : s2 = t3[0];
7143 + r2 = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? "";
7144 + while (r2 !== t2[0]);
7145 + n = t2[0], t2[1] === "www." ? i = "http://" + t2[0] : i = t2[0];
7038 7146 }
7039 - return { type: "link", raw: t3[0], text: n2, href: s2, tokens: [{ type: "text", raw: n2, text: n2 }] };
7147 + return { type: "link", raw: t2[0], text: n, href: i, autolink: true, tokens: [{ type: "text", raw: n, text: n }] };
7040 7148 }
7041 7149 }
7042 7150 inlineText(e2) {
7043 - let t3 = this.rules.inline.text.exec(e2);
7044 - if (t3) {
7045 - let n2 = this.lexer.state.inRawBlock;
7046 - return { type: "text", raw: t3[0], text: t3[0], escaped: n2 };
7151 + let t2 = this.rules.inline.text.exec(e2);
7152 + if (t2) {
7153 + let n = this.lexer.state.inRawBlock;
7154 + return { type: "text", raw: t2[0], text: t2[0], escaped: n };
7047 7155 }
7048 7156 }
7049 7157 };
7050 7158 var x2 = class l2 {
@@ -7053,120 +7161,120 @@
7053 7161 state;
7054 7162 inlineQueue;
7055 7163 tokenizer;
7056 7164 constructor(e2) {
7057 - this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new w2(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
7058 - let t3 = { other: m2, block: B.normal, inline: A.normal };
7059 - this.options.pedantic ? (t3.block = B.pedantic, t3.inline = A.pedantic) : this.options.gfm && (t3.block = B.gfm, this.options.breaks ? t3.inline = A.breaks : t3.inline = A.gfm), this.tokenizer.rules = t3;
7165 + this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new y2(), 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 };
7166 + let t2 = { other: m2, block: G.normal, inline: B.normal };
7167 + 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;
7060 7168 }
7061 7169 static get rules() {
7062 - return { block: B, inline: A };
7170 + return { block: G, inline: B };
7063 7171 }
7064 - static lex(e2, t3) {
7065 - return new l2(t3).lex(e2);
7172 + static lex(e2, t2) {
7173 + return new l2(t2).lex(e2);
7066 7174 }
7067 - static lexInline(e2, t3) {
7068 - return new l2(t3).inlineTokens(e2);
7175 + static lexInline(e2, t2) {
7176 + return new l2(t2).inlineTokens(e2);
7069 7177 }
7070 7178 lex(e2) {
7071 7179 e2 = e2.replace(m2.carriageReturn, `
7072 7180 `), this.blockTokens(e2, this.tokens);
7073 - for (let t3 = 0; t3 < this.inlineQueue.length; t3++) {
7074 - let n2 = this.inlineQueue[t3];
7075 - this.inlineTokens(n2.src, n2.tokens);
7181 + for (let t2 = 0; t2 < this.inlineQueue.length; t2++) {
7182 + let n = this.inlineQueue[t2];
7183 + this.inlineTokens(n.src, n.tokens);
7076 7184 }
7077 7185 return this.inlineQueue = [], this.tokens;
7078 7186 }
7079 - blockTokens(e2, t3 = [], n2 = false) {
7187 + blockTokens(e2, t2 = [], n = false) {
7080 7188 this.tokenizer.lexer = this, this.options.pedantic && (e2 = e2.replace(m2.tabCharGlobal, " ").replace(m2.spaceLine, ""));
7081 - let s2 = 1 / 0;
7189 + let i = 1 / 0;
7082 7190 for (; e2; ) {
7083 - if (e2.length < s2) s2 = e2.length;
7191 + if (e2.length < i) i = e2.length;
7084 7192 else {
7085 7193 this.infiniteLoopError(e2.charCodeAt(0));
7086 7194 break;
7087 7195 }
7088 7196 let r2;
7089 - if (this.options.extensions?.block?.some((o3) => (r2 = o3.call({ lexer: this }, e2, t3)) ? (e2 = e2.substring(r2.raw.length), t3.push(r2), true) : false)) continue;
7197 + if (this.options.extensions?.block?.some((s) => (r2 = s.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
7090 7198 if (r2 = this.tokenizer.space(e2)) {
7091 7199 e2 = e2.substring(r2.raw.length);
7092 - let o3 = t3.at(-1);
7093 - r2.raw.length === 1 && o3 !== void 0 ? o3.raw += `
7094 -` : t3.push(r2);
7200 + let s = t2.at(-1);
7201 + r2.raw.length === 1 && s !== void 0 ? s.raw += `
7202 +` : t2.push(r2);
7095 7203 continue;
7096 7204 }
7097 7205 if (r2 = this.tokenizer.code(e2)) {
7098 7206 e2 = e2.substring(r2.raw.length);
7099 - let o3 = t3.at(-1);
7100 - o3?.type === "paragraph" || o3?.type === "text" ? (o3.raw += (o3.raw.endsWith(`
7207 + let s = t2.at(-1);
7208 + s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
7101 7209 `) ? "" : `
7102 -`) + r2.raw, o3.text += `
7103 -` + r2.text, this.inlineQueue.at(-1).src = o3.text) : t3.push(r2);
7210 +`) + r2.raw, s.text += `
7211 +` + r2.text, this.inlineQueue.at(-1).src = s.text) : t2.push(r2);
7104 7212 continue;
7105 7213 }
7106 7214 if (r2 = this.tokenizer.fences(e2)) {
7107 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7215 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7108 7216 continue;
7109 7217 }
7110 7218 if (r2 = this.tokenizer.heading(e2)) {
7111 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7219 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7112 7220 continue;
7113 7221 }
7114 7222 if (r2 = this.tokenizer.hr(e2)) {
7115 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7223 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7116 7224 continue;
7117 7225 }
7118 7226 if (r2 = this.tokenizer.blockquote(e2)) {
7119 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7227 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7120 7228 continue;
7121 7229 }
7122 7230 if (r2 = this.tokenizer.list(e2)) {
7123 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7231 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7124 7232 continue;
7125 7233 }
7126 7234 if (r2 = this.tokenizer.html(e2)) {
7127 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7235 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7128 7236 continue;
7129 7237 }
7130 7238 if (r2 = this.tokenizer.def(e2)) {
7131 7239 e2 = e2.substring(r2.raw.length);
7132 - let o3 = t3.at(-1);
7133 - o3?.type === "paragraph" || o3?.type === "text" ? (o3.raw += (o3.raw.endsWith(`
7240 + let s = t2.at(-1);
7241 + s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
7134 7242 `) ? "" : `
7135 -`) + r2.raw, o3.text += `
7136 -` + r2.raw, this.inlineQueue.at(-1).src = o3.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t3.push(r2));
7243 +`) + r2.raw, s.text += `
7244 +` + r2.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2));
7137 7245 continue;
7138 7246 }
7139 7247 if (r2 = this.tokenizer.table(e2)) {
7140 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7248 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7141 7249 continue;
7142 7250 }
7143 7251 if (r2 = this.tokenizer.lheading(e2)) {
7144 - e2 = e2.substring(r2.raw.length), t3.push(r2);
7252 + e2 = e2.substring(r2.raw.length), t2.push(r2);
7145 7253 continue;
7146 7254 }
7147 - let i2 = e2;
7255 + let o2 = e2;
7148 7256 if (this.options.extensions?.startBlock) {
7149 - let o3 = 1 / 0, u2 = e2.slice(1), a2;
7150 - this.options.extensions.startBlock.forEach((c2) => {
7151 - a2 = c2.call({ lexer: this }, u2), typeof a2 == "number" && a2 >= 0 && (o3 = Math.min(o3, a2));
7152 - }), o3 < 1 / 0 && o3 >= 0 && (i2 = e2.substring(0, o3 + 1));
7257 + let s = 1 / 0, u = e2.slice(1), a;
7258 + this.options.extensions.startBlock.forEach((p2) => {
7259 + a = p2.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
7260 + }), s < 1 / 0 && s >= 0 && (o2 = e2.substring(0, s + 1));
7153 7261 }
7154 - if (this.state.top && (r2 = this.tokenizer.paragraph(i2))) {
7155 - let o3 = t3.at(-1);
7156 - n2 && o3?.type === "paragraph" ? (o3.raw += (o3.raw.endsWith(`
7262 + if (this.state.top && (r2 = this.tokenizer.paragraph(o2))) {
7263 + let s = t2.at(-1);
7264 + n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
7157 7265 `) ? "" : `
7158 -`) + r2.raw, o3.text += `
7159 -` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o3.text) : t3.push(r2), n2 = i2.length !== e2.length, e2 = e2.substring(r2.raw.length);
7266 +`) + r2.raw, s.text += `
7267 +` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r2), n = o2.length !== e2.length, e2 = e2.substring(r2.raw.length);
7160 7268 continue;
7161 7269 }
7162 7270 if (r2 = this.tokenizer.text(e2)) {
7163 7271 e2 = e2.substring(r2.raw.length);
7164 - let o3 = t3.at(-1);
7165 - o3?.type === "text" ? (o3.raw += (o3.raw.endsWith(`
7272 + let s = t2.at(-1);
7273 + s?.type === "text" ? (s.raw += (s.raw.endsWith(`
7166 7274 `) ? "" : `
7167 -`) + r2.raw, o3.text += `
7168 -` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o3.text) : t3.push(r2);
7275 +`) + r2.raw, s.text += `
7276 +` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r2);
7169 7277 continue;
7170 7278 }
7171 7279 if (e2) {
7172 7280 this.infiniteLoopError(e2.charCodeAt(0));
@@ -7172,87 +7280,105 @@
7172 7280 this.infiniteLoopError(e2.charCodeAt(0));
7173 7281 break;
7174 7282 }
7175 7283 }
7176 - return this.state.top = true, t3;
7284 + return this.state.top = true, t2;
7177 7285 }
7178 - inline(e2, t3 = []) {
7179 - return this.inlineQueue.push({ src: e2, tokens: t3 }), t3;
7286 + inline(e2, t2 = []) {
7287 + return this.inlineQueue.push({ src: e2, tokens: t2 }), t2;
7180 7288 }
7181 - inlineTokens(e2, t3 = []) {
7289 + linkInText(e2) {
7290 + if (!e2.includes("[")) return false;
7291 + let t2 = this.tokenizer.rules.inline.link;
7292 + for (let n of e2.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t2.test(n[0]) && e2.charAt(n.index - 1) !== "!") return true;
7293 + for (let n of e2.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
7294 + let i = n[0], r2 = i.lastIndexOf("[");
7295 + if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, D2(i.slice(r2 + 1, -1)))) && !(r2 > 1 && this.linkInText(i.slice(1, r2 - 1)))) return true;
7296 + }
7297 + return false;
7298 + }
7299 + inlineTokens(e2, t2 = []) {
7182 7300 this.tokenizer.lexer = this;
7183 - let n2 = e2, s2 = null;
7184 - if (this.tokens.links) {
7185 - let a2 = Object.keys(this.tokens.links);
7186 - if (a2.length > 0) for (; (s2 = this.tokenizer.rules.inline.reflinkSearch.exec(n2)) !== null; ) a2.includes(s2[0].slice(s2[0].lastIndexOf("[") + 1, -1)) && (n2 = n2.slice(0, s2.index) + "[" + "a".repeat(s2[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
7301 + let n = e2;
7302 + if (this.tokens.links && e2.includes("[")) {
7303 + let s = this.tokenizer.rules.inline.reflinkSearch, u = (a) => {
7304 + let p2 = a.lastIndexOf("[");
7305 + if (!Object.hasOwn(this.tokens.links, D2(a.slice(p2 + 1, -1)))) return a;
7306 + if (p2 > 1 && a.charAt(0) !== "!") {
7307 + let c2 = a.slice(1, p2 - 1);
7308 + if (this.linkInText(c2)) return "[" + c2.replace(s, u) + "][" + "a".repeat(a.length - p2 - 2) + "]";
7309 + }
7310 + return "[" + "a".repeat(a.length - 2) + "]";
7311 + };
7312 + n = n.replace(s, u);
7187 7313 }
7188 - for (; (s2 = this.tokenizer.rules.inline.anyPunctuation.exec(n2)) !== null; ) n2 = n2.slice(0, s2.index) + "++" + n2.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
7189 - let r2;
7190 - for (; (s2 = this.tokenizer.rules.inline.blockSkip.exec(n2)) !== null; ) r2 = s2[2] ? s2[2].length : 0, n2 = n2.slice(0, s2.index + r2) + "[" + "a".repeat(s2[0].length - r2 - 2) + "]" + n2.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
7191 - n2 = this.options.hooks?.emStrongMask?.call({ lexer: this }, n2) ?? n2;
7192 - let i2 = false, o3 = "", u2 = 1 / 0;
7314 + n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (s) => "+".repeat(s.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, u, a) => {
7315 + let p2 = a ? a.length : 0;
7316 + return s.slice(0, p2) + "[" + "a".repeat(s.length - p2 - 2) + "]";
7317 + }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
7318 + let i = false, r2 = "", o2 = 1 / 0;
7193 7319 for (; e2; ) {
7194 - if (e2.length < u2) u2 = e2.length;
7320 + if (e2.length < o2) o2 = e2.length;
7195 7321 else {
7196 7322 this.infiniteLoopError(e2.charCodeAt(0));
7197 7323 break;
7198 7324 }
7199 - i2 || (o3 = ""), i2 = false;
7200 - let a2;
7201 - if (this.options.extensions?.inline?.some((p2) => (a2 = p2.call({ lexer: this }, e2, t3)) ? (e2 = e2.substring(a2.raw.length), t3.push(a2), true) : false)) continue;
7202 - if (a2 = this.tokenizer.escape(e2)) {
7203 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7325 + i || (r2 = ""), i = false;
7326 + let s;
7327 + if (this.options.extensions?.inline?.some((a) => (s = a.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(s.raw.length), t2.push(s), true) : false)) continue;
7328 + if (s = this.tokenizer.escape(e2)) {
7329 + e2 = e2.substring(s.raw.length), t2.push(s);
7204 7330 continue;
7205 7331 }
7206 - if (a2 = this.tokenizer.tag(e2)) {
7207 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7332 + if (s = this.tokenizer.tag(e2)) {
7333 + e2 = e2.substring(s.raw.length), t2.push(s);
7208 7334 continue;
7209 7335 }
7210 - if (a2 = this.tokenizer.link(e2)) {
7211 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7336 + if (s = this.tokenizer.link(e2)) {
7337 + e2 = e2.substring(s.raw.length), t2.push(s);
7212 7338 continue;
7213 7339 }
7214 - if (a2 = this.tokenizer.reflink(e2, this.tokens.links)) {
7215 - e2 = e2.substring(a2.raw.length);
7216 - let p2 = t3.at(-1);
7217 - a2.type === "text" && p2?.type === "text" ? (p2.raw += a2.raw, p2.text += a2.text) : t3.push(a2);
7340 + if (s = this.tokenizer.reflink(e2, this.tokens.links)) {
7341 + e2 = e2.substring(s.raw.length);
7342 + let a = t2.at(-1);
7343 + s.type === "text" && a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t2.push(s);
7218 7344 continue;
7219 7345 }
7220 - if (a2 = this.tokenizer.emStrong(e2, n2, o3)) {
7221 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7346 + if (s = this.tokenizer.emStrong(e2, n, r2)) {
7347 + e2 = e2.substring(s.raw.length), t2.push(s);
7222 7348 continue;
7223 7349 }
7224 - if (a2 = this.tokenizer.codespan(e2)) {
7225 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7350 + if (s = this.tokenizer.codespan(e2)) {
7351 + e2 = e2.substring(s.raw.length), t2.push(s);
7226 7352 continue;
7227 7353 }
7228 - if (a2 = this.tokenizer.br(e2)) {
7229 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7354 + if (s = this.tokenizer.br(e2)) {
7355 + e2 = e2.substring(s.raw.length), t2.push(s);
7230 7356 continue;
7231 7357 }
7232 - if (a2 = this.tokenizer.del(e2, n2, o3)) {
7233 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7358 + if (s = this.tokenizer.del(e2, n, r2)) {
7359 + e2 = e2.substring(s.raw.length), t2.push(s);
7234 7360 continue;
7235 7361 }
7236 - if (a2 = this.tokenizer.autolink(e2)) {
7237 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7362 + if (s = this.tokenizer.autolink(e2)) {
7363 + e2 = e2.substring(s.raw.length), t2.push(s);
7238 7364 continue;
7239 7365 }
7240 - if (!this.state.inLink && (a2 = this.tokenizer.url(e2))) {
7241 - e2 = e2.substring(a2.raw.length), t3.push(a2);
7366 + if (!this.state.inLink && (s = this.tokenizer.url(e2))) {
7367 + e2 = e2.substring(s.raw.length), t2.push(s);
7242 7368 continue;
7243 7369 }
7244 - let c2 = e2;
7370 + let u = e2;
7245 7371 if (this.options.extensions?.startInline) {
7246 - let p2 = 1 / 0, k2 = e2.slice(1), h2;
7247 - this.options.extensions.startInline.forEach((R) => {
7248 - h2 = R.call({ lexer: this }, k2), typeof h2 == "number" && h2 >= 0 && (p2 = Math.min(p2, h2));
7249 - }), p2 < 1 / 0 && p2 >= 0 && (c2 = e2.substring(0, p2 + 1));
7372 + let a = 1 / 0, p2 = e2.slice(1), c2;
7373 + this.options.extensions.startInline.forEach((h) => {
7374 + c2 = h.call({ lexer: this }, p2), typeof c2 == "number" && c2 >= 0 && (a = Math.min(a, c2));
7375 + }), a < 1 / 0 && a >= 0 && (u = e2.substring(0, a + 1));
7250 7376 }
7251 - if (a2 = this.tokenizer.inlineText(c2)) {
7252 - e2 = e2.substring(a2.raw.length), a2.raw.slice(-1) !== "_" && (o3 = a2.raw.slice(-1)), i2 = true;
7253 - let p2 = t3.at(-1);
7254 - p2?.type === "text" ? (p2.raw += a2.raw, p2.text += a2.text) : t3.push(a2);
7377 + if (s = this.tokenizer.inlineText(u)) {
7378 + e2 = e2.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r2 = s.raw.slice(-1)), i = true;
7379 + let a = t2.at(-1);
7380 + a?.type === "text" ? (a.raw += s.raw, a.text += s.text) : t2.push(s);
7255 7381 continue;
7256 7382 }
7257 7383 if (e2) {
7258 7384 this.infiniteLoopError(e2.charCodeAt(0));
@@ -7258,17 +7384,17 @@
7258 7384 this.infiniteLoopError(e2.charCodeAt(0));
7259 7385 break;
7260 7386 }
7261 7387 }
7262 - return t3;
7388 + return t2;
7263 7389 }
7264 7390 infiniteLoopError(e2) {
7265 - let t3 = "Infinite loop on byte: " + e2;
7266 - if (this.options.silent) console.error(t3);
7267 - else throw new Error(t3);
7391 + let t2 = "Infinite loop on byte: " + e2;
7392 + if (this.options.silent) console.error(t2);
7393 + else throw new Error(t2);
7268 7394 }
7269 7395 };
7270 - var y2 = class {
7396 + var P = class {
7271 7397 options;
7272 7398 parser;
7273 7399 constructor(e2) {
7274 7400 this.options = e2 || T;
@@ -7275,14 +7401,14 @@
7275 7401 }
7276 7402 space(e2) {
7277 7403 return "";
7278 7404 }
7279 - code({ text: e2, lang: t3, escaped: n2 }) {
7280 - let s2 = (t3 || "").match(m2.notSpaceStart)?.[0], r2 = e2.replace(m2.endingNewline, "") + `
7405 + code({ text: e2, lang: t2, escaped: n }) {
7406 + let i = (t2 || "").match(m2.notSpaceStart)?.[0], r2 = e2 ? e2.replace(m2.endingNewline, "") + `
7407 +` : "";
7408 + return i ? '<pre><code class="language-' + R2(i) + '">' + (n ? r2 : R2(r2, true)) + `</code></pre>
7409 +` : "<pre><code>" + (n ? r2 : R2(r2, true)) + `</code></pre>
7281 7410 `;
7282 - return s2 ? '<pre><code class="language-' + O(s2) + '">' + (n2 ? r2 : O(r2, true)) + `</code></pre>
7283 -` : "<pre><code>" + (n2 ? r2 : O(r2, true)) + `</code></pre>
7284 -`;
7285 7411 }
7286 7412 blockquote({ tokens: e2 }) {
7287 7413 return `<blockquote>
7288 7414 ${this.parser.parse(e2)}</blockquote>
@@ -7293,10 +7419,10 @@
7293 7419 }
7294 7420 def(e2) {
7295 7421 return "";
7296 7422 }
7297 - heading({ tokens: e2, depth: t3 }) {
7298 - return `<h${t3}>${this.parser.parseInline(e2)}</h${t3}>
7423 + heading({ tokens: e2, depth: t2 }) {
7424 + return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}>
7299 7425 `;
7300 7426 }
7301 7427 hr(e2) {
7302 7428 return `<hr>
@@ -7302,16 +7428,16 @@
7302 7428 return `<hr>
7303 7429 `;
7304 7430 }
7305 7431 list(e2) {
7306 - let t3 = e2.ordered, n2 = e2.start, s2 = "";
7307 - for (let o3 = 0; o3 < e2.items.length; o3++) {
7308 - let u2 = e2.items[o3];
7309 - s2 += this.listitem(u2);
7432 + let t2 = e2.ordered, n = e2.start, i = "";
7433 + for (let s = 0; s < e2.items.length; s++) {
7434 + let u = e2.items[s];
7435 + i += this.listitem(u);
7310 7436 }
7311 - let r2 = t3 ? "ol" : "ul", i2 = t3 && n2 !== 1 ? ' start="' + n2 + '"' : "";
7312 - return "<" + r2 + i2 + `>
7313 -` + s2 + "</" + r2 + `>
7437 + let r2 = t2 ? "ol" : "ul", o2 = t2 && n !== 1 ? ' start="' + n + '"' : "";
7438 + return "<" + r2 + o2 + `>
7439 +` + i + "</" + r2 + `>
7314 7440 `;
7315 7441 }
7316 7442 listitem(e2) {
7317 7443 return `<li>${this.parser.parse(e2.tokens)}</li>
@@ -7324,22 +7450,22 @@
7324 7450 return `<p>${this.parser.parseInline(e2)}</p>
7325 7451 `;
7326 7452 }
7327 7453 table(e2) {
7328 - let t3 = "", n2 = "";
7329 - for (let r2 = 0; r2 < e2.header.length; r2++) n2 += this.tablecell(e2.header[r2]);
7330 - t3 += this.tablerow({ text: n2 });
7331 - let s2 = "";
7454 + let t2 = "", n = "";
7455 + for (let r2 = 0; r2 < e2.header.length; r2++) n += this.tablecell(e2.header[r2]);
7456 + t2 += this.tablerow({ text: n });
7457 + let i = "";
7332 7458 for (let r2 = 0; r2 < e2.rows.length; r2++) {
7333 - let i2 = e2.rows[r2];
7334 - n2 = "";
7335 - for (let o3 = 0; o3 < i2.length; o3++) n2 += this.tablecell(i2[o3]);
7336 - s2 += this.tablerow({ text: n2 });
7459 + let o2 = e2.rows[r2];
7460 + n = "";
7461 + for (let s = 0; s < o2.length; s++) n += this.tablecell(o2[s]);
7462 + i += this.tablerow({ text: n });
7337 7463 }
7338 - return s2 && (s2 = `<tbody>${s2}</tbody>`), `<table>
7464 + return i && (i = `<tbody>${i}</tbody>`), `<table>
7339 7465 <thead>
7340 -` + t3 + `</thead>
7341 -` + s2 + `</table>
7466 +` + t2 + `</thead>
7467 +` + i + `</table>
7342 7468 `;
7343 7469 }
7344 7470 tablerow({ text: e2 }) {
7345 7471 return `<tr>
@@ -7346,10 +7472,10 @@
7346 7472 ${e2}</tr>
7347 7473 `;
7348 7474 }
7349 7475 tablecell(e2) {
7350 - let t3 = this.parser.parseInline(e2.tokens), n2 = e2.header ? "th" : "td";
7351 - return (e2.align ? `<${n2} align="${e2.align}">` : `<${n2}>`) + t3 + `</${n2}>
7476 + let t2 = this.parser.parseInline(e2.tokens), n = e2.header ? "th" : "td";
7477 + return (e2.align ? `<${n} align="${e2.align}">` : `<${n}>`) + t2 + `</${n}>
7352 7478 `;
7353 7479 }
7354 7480 strong({ tokens: e2 }) {
7355 7481 return `<strong>${this.parser.parseInline(e2)}</strong>`;
@@ -7357,9 +7483,9 @@
7357 7483 em({ tokens: e2 }) {
7358 7484 return `<em>${this.parser.parseInline(e2)}</em>`;
7359 7485 }
7360 7486 codespan({ text: e2 }) {
7361 - return `<code>${O(e2, true)}</code>`;
7487 + return `<code>${R2(e2, true)}</code>`;
7362 7488 }
7363 7489 br(e2) {
7364 7490 return "<br>";
7365 7491 }
@@ -7365,25 +7491,25 @@
7365 7491 }
7366 7492 del({ tokens: e2 }) {
7367 7493 return `<del>${this.parser.parseInline(e2)}</del>`;
7368 7494 }
7369 - link({ href: e2, title: t3, tokens: n2 }) {
7370 - let s2 = this.parser.parseInline(n2), r2 = J(e2);
7371 - if (r2 === null) return s2;
7372 - e2 = r2;
7373 - let i2 = '<a href="' + e2 + '"';
7374 - return t3 && (i2 += ' title="' + O(t3) + '"'), i2 += ">" + s2 + "</a>", i2;
7495 + link({ href: e2, title: t2, text: n, tokens: i, autolink: r2 }) {
7496 + let o2 = r2 ? R2(n, true) : this.parser.parseInline(i), s = ee(e2);
7497 + if (s === null) return o2;
7498 + e2 = R2(s, r2);
7499 + let u = '<a href="' + e2 + '"';
7500 + return t2 && (u += ' title="' + R2(t2) + '"'), u += ">" + o2 + "</a>", u;
7375 7501 }
7376 - image({ href: e2, title: t3, text: n2, tokens: s2 }) {
7377 - s2 && (n2 = this.parser.parseInline(s2, this.parser.textRenderer));
7378 - let r2 = J(e2);
7379 - if (r2 === null) return O(n2);
7502 + image({ href: e2, title: t2, text: n, tokens: i }) {
7503 + i && (n = this.parser.parseInline(i, this.parser.textRenderer));
7504 + let r2 = ee(e2);
7505 + if (r2 === null) return R2(n);
7380 7506 e2 = r2;
7381 - let i2 = `<img src="${e2}" alt="${O(n2)}"`;
7382 - return t3 && (i2 += ` title="${O(t3)}"`), i2 += ">", i2;
7507 + let o2 = `<img src="${R2(e2)}" alt="${R2(n)}"`;
7508 + return t2 && (o2 += ` title="${R2(t2)}"`), o2 += ">", o2;
7383 7509 }
7384 7510 text(e2) {
7385 - return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : O(e2.text);
7511 + return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : R2(e2.text);
7386 7512 }
7387 7513 };
7388 7514 var L = class {
7389 7515 strong({ text: e2 }) {
@@ -7416,161 +7542,161 @@
7416 7542 checkbox({ raw: e2 }) {
7417 7543 return e2;
7418 7544 }
7419 7545 };
7420 - var b2 = class l3 {
7546 + var b = class l3 {
7421 7547 options;
7422 7548 renderer;
7423 7549 textRenderer;
7424 7550 constructor(e2) {
7425 - this.options = e2 || T, this.options.renderer = this.options.renderer || new y2(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
7551 + this.options = e2 || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
7426 7552 }
7427 - static parse(e2, t3) {
7428 - return new l3(t3).parse(e2);
7553 + static parse(e2, t2) {
7554 + return new l3(t2).parse(e2);
7429 7555 }
7430 - static parseInline(e2, t3) {
7431 - return new l3(t3).parseInline(e2);
7556 + static parseInline(e2, t2) {
7557 + return new l3(t2).parseInline(e2);
7432 7558 }
7433 7559 parse(e2) {
7434 7560 this.renderer.parser = this;
7435 - let t3 = "";
7436 - for (let n2 = 0; n2 < e2.length; n2++) {
7437 - let s2 = e2[n2];
7438 - if (this.options.extensions?.renderers?.[s2.type]) {
7439 - let i2 = s2, o3 = this.options.extensions.renderers[i2.type].call({ parser: this }, i2);
7440 - if (o3 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(i2.type)) {
7441 - t3 += o3 || "";
7561 + let t2 = "";
7562 + for (let n = 0; n < e2.length; n++) {
7563 + let i = e2[n];
7564 + if (this.options.extensions?.renderers?.[i.type]) {
7565 + let o2 = i, s = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
7566 + if (s !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "checkbox", "html", "def", "paragraph", "text"].includes(o2.type)) {
7567 + t2 += s || "";
7442 7568 continue;
7443 7569 }
7444 7570 }
7445 - let r2 = s2;
7571 + let r2 = i;
7446 7572 switch (r2.type) {
7447 7573 case "space": {
7448 - t3 += this.renderer.space(r2);
7574 + t2 += this.renderer.space(r2);
7449 7575 break;
7450 7576 }
7451 7577 case "hr": {
7452 - t3 += this.renderer.hr(r2);
7578 + t2 += this.renderer.hr(r2);
7453 7579 break;
7454 7580 }
7455 7581 case "heading": {
7456 - t3 += this.renderer.heading(r2);
7582 + t2 += this.renderer.heading(r2);
7457 7583 break;
7458 7584 }
7459 7585 case "code": {
7460 - t3 += this.renderer.code(r2);
7586 + t2 += this.renderer.code(r2);
7461 7587 break;
7462 7588 }
7463 7589 case "table": {
7464 - t3 += this.renderer.table(r2);
7590 + t2 += this.renderer.table(r2);
7465 7591 break;
7466 7592 }
7467 7593 case "blockquote": {
7468 - t3 += this.renderer.blockquote(r2);
7594 + t2 += this.renderer.blockquote(r2);
7469 7595 break;
7470 7596 }
7471 7597 case "list": {
7472 - t3 += this.renderer.list(r2);
7598 + t2 += this.renderer.list(r2);
7473 7599 break;
7474 7600 }
7475 7601 case "checkbox": {
7476 - t3 += this.renderer.checkbox(r2);
7602 + t2 += this.renderer.checkbox(r2);
7477 7603 break;
7478 7604 }
7479 7605 case "html": {
7480 - t3 += this.renderer.html(r2);
7606 + t2 += this.renderer.html(r2);
7481 7607 break;
7482 7608 }
7483 7609 case "def": {
7484 - t3 += this.renderer.def(r2);
7610 + t2 += this.renderer.def(r2);
7485 7611 break;
7486 7612 }
7487 7613 case "paragraph": {
7488 - t3 += this.renderer.paragraph(r2);
7614 + t2 += this.renderer.paragraph(r2);
7489 7615 break;
7490 7616 }
7491 7617 case "text": {
7492 - t3 += this.renderer.text(r2);
7618 + t2 += this.renderer.text(r2);
7493 7619 break;
7494 7620 }
7495 7621 default: {
7496 - let i2 = 'Token with "' + r2.type + '" type was not found.';
7497 - if (this.options.silent) return console.error(i2), "";
7498 - throw new Error(i2);
7622 + let o2 = 'Token with "' + r2.type + '" type was not found.';
7623 + if (this.options.silent) return console.error(o2), "";
7624 + throw new Error(o2);
7499 7625 }
7500 7626 }
7501 7627 }
7502 - return t3;
7628 + return t2;
7503 7629 }
7504 - parseInline(e2, t3 = this.renderer) {
7630 + parseInline(e2, t2 = this.renderer) {
7505 7631 this.renderer.parser = this;
7506 - let n2 = "";
7507 - for (let s2 = 0; s2 < e2.length; s2++) {
7508 - let r2 = e2[s2];
7632 + let n = "";
7633 + for (let i = 0; i < e2.length; i++) {
7634 + let r2 = e2[i];
7509 7635 if (this.options.extensions?.renderers?.[r2.type]) {
7510 - let o3 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
7511 - if (o3 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
7512 - n2 += o3 || "";
7636 + let s = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
7637 + if (s !== false || !["escape", "html", "link", "image", "checkbox", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
7638 + n += s || "";
7513 7639 continue;
7514 7640 }
7515 7641 }
7516 - let i2 = r2;
7517 - switch (i2.type) {
7642 + let o2 = r2;
7643 + switch (o2.type) {
7518 7644 case "escape": {
7519 - n2 += t3.text(i2);
7645 + n += t2.text(o2);
7520 7646 break;
7521 7647 }
7522 7648 case "html": {
7523 - n2 += t3.html(i2);
7649 + n += t2.html(o2);
7524 7650 break;
7525 7651 }
7526 7652 case "link": {
7527 - n2 += t3.link(i2);
7653 + n += t2.link(o2);
7528 7654 break;
7529 7655 }
7530 7656 case "image": {
7531 - n2 += t3.image(i2);
7657 + n += t2.image(o2);
7532 7658 break;
7533 7659 }
7534 7660 case "checkbox": {
7535 - n2 += t3.checkbox(i2);
7661 + n += t2.checkbox(o2);
7536 7662 break;
7537 7663 }
7538 7664 case "strong": {
7539 - n2 += t3.strong(i2);
7665 + n += t2.strong(o2);
7540 7666 break;
7541 7667 }
7542 7668 case "em": {
7543 - n2 += t3.em(i2);
7669 + n += t2.em(o2);
7544 7670 break;
7545 7671 }
7546 7672 case "codespan": {
7547 - n2 += t3.codespan(i2);
7673 + n += t2.codespan(o2);
7548 7674 break;
7549 7675 }
7550 7676 case "br": {
7551 - n2 += t3.br(i2);
7677 + n += t2.br(o2);
7552 7678 break;
7553 7679 }
7554 7680 case "del": {
7555 - n2 += t3.del(i2);
7681 + n += t2.del(o2);
7556 7682 break;
7557 7683 }
7558 7684 case "text": {
7559 - n2 += t3.text(i2);
7685 + n += t2.text(o2);
7560 7686 break;
7561 7687 }
7562 7688 default: {
7563 - let o3 = 'Token with "' + i2.type + '" type was not found.';
7564 - if (this.options.silent) return console.error(o3), "";
7565 - throw new Error(o3);
7689 + let s = 'Token with "' + o2.type + '" type was not found.';
7690 + if (this.options.silent) return console.error(s), "";
7691 + throw new Error(s);
7566 7692 }
7567 7693 }
7568 7694 }
7569 - return n2;
7695 + return n;
7570 7696 }
7571 7697 };
7572 - var P = class {
7698 + var S = class {
7573 7699 options;
7574 7700 block;
7575 7701 constructor(e2) {
7576 7702 this.options = e2 || T;
@@ -7592,210 +7718,210 @@
7592 7718 provideLexer(e2 = this.block) {
7593 7719 return e2 ? x2.lex : x2.lexInline;
7594 7720 }
7595 7721 provideParser(e2 = this.block) {
7596 - return e2 ? b2.parse : b2.parseInline;
7722 + return e2 ? b.parse : b.parseInline;
7597 7723 }
7598 7724 };
7599 - var D = class {
7600 - defaults = z();
7725 + var Q = class {
7726 + defaults = A2();
7601 7727 options = this.setOptions;
7602 7728 parse = this.parseMarkdown(true);
7603 7729 parseInline = this.parseMarkdown(false);
7604 - Parser = b2;
7605 - Renderer = y2;
7730 + Parser = b;
7731 + Renderer = P;
7606 7732 TextRenderer = L;
7607 7733 Lexer = x2;
7608 - Tokenizer = w2;
7609 - Hooks = P;
7734 + Tokenizer = y2;
7735 + Hooks = S;
7610 7736 constructor(...e2) {
7611 7737 this.use(...e2);
7612 7738 }
7613 - walkTokens(e2, t3) {
7614 - let n2 = [];
7615 - for (let s2 of e2) switch (n2 = n2.concat(t3.call(this, s2)), s2.type) {
7739 + walkTokens(e2, t2) {
7740 + let n = [];
7741 + for (let i of e2) switch (n = n.concat(t2.call(this, i)), i.type) {
7616 7742 case "table": {
7617 - let r2 = s2;
7618 - for (let i2 of r2.header) n2 = n2.concat(this.walkTokens(i2.tokens, t3));
7619 - for (let i2 of r2.rows) for (let o3 of i2) n2 = n2.concat(this.walkTokens(o3.tokens, t3));
7743 + let r2 = i;
7744 + for (let o2 of r2.header) n = n.concat(this.walkTokens(o2.tokens, t2));
7745 + for (let o2 of r2.rows) for (let s of o2) n = n.concat(this.walkTokens(s.tokens, t2));
7620 7746 break;
7621 7747 }
7622 7748 case "list": {
7623 - let r2 = s2;
7624 - n2 = n2.concat(this.walkTokens(r2.items, t3));
7749 + let r2 = i;
7750 + n = n.concat(this.walkTokens(r2.items, t2));
7625 7751 break;
7626 7752 }
7627 7753 default: {
7628 - let r2 = s2;
7629 - this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((i2) => {
7630 - let o3 = r2[i2].flat(1 / 0);
7631 - n2 = n2.concat(this.walkTokens(o3, t3));
7632 - }) : r2.tokens && (n2 = n2.concat(this.walkTokens(r2.tokens, t3)));
7754 + let r2 = i;
7755 + this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((o2) => {
7756 + let s = r2[o2].flat(1 / 0);
7757 + n = n.concat(this.walkTokens(s, t2));
7758 + }) : r2.tokens && (n = n.concat(this.walkTokens(r2.tokens, t2)));
7633 7759 }
7634 7760 }
7635 - return n2;
7761 + return n;
7636 7762 }
7637 7763 use(...e2) {
7638 - let t3 = this.defaults.extensions || { renderers: {}, childTokens: {} };
7639 - return e2.forEach((n2) => {
7640 - let s2 = { ...n2 };
7641 - if (s2.async = this.defaults.async || s2.async || false, n2.extensions && (n2.extensions.forEach((r2) => {
7764 + let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
7765 + return e2.forEach((n) => {
7766 + let i = { ...n };
7767 + if (i.async = this.defaults.async || i.async || false, n.extensions && (n.extensions.forEach((r2) => {
7642 7768 if (!r2.name) throw new Error("extension name required");
7643 7769 if ("renderer" in r2) {
7644 - let i2 = t3.renderers[r2.name];
7645 - i2 ? t3.renderers[r2.name] = function(...o3) {
7646 - let u2 = r2.renderer.apply(this, o3);
7647 - return u2 === false && (u2 = i2.apply(this, o3)), u2;
7648 - } : t3.renderers[r2.name] = r2.renderer;
7770 + let o2 = t2.renderers[r2.name];
7771 + o2 ? t2.renderers[r2.name] = function(...s) {
7772 + let u = r2.renderer.apply(this, s);
7773 + return u === false && (u = o2.apply(this, s)), u;
7774 + } : t2.renderers[r2.name] = r2.renderer;
7649 7775 }
7650 7776 if ("tokenizer" in r2) {
7651 7777 if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
7652 - let i2 = t3[r2.level];
7653 - i2 ? i2.unshift(r2.tokenizer) : t3[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t3.startBlock ? t3.startBlock.push(r2.start) : t3.startBlock = [r2.start] : r2.level === "inline" && (t3.startInline ? t3.startInline.push(r2.start) : t3.startInline = [r2.start]));
7778 + let o2 = t2[r2.level];
7779 + 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]));
7654 7780 }
7655 - "childTokens" in r2 && r2.childTokens && (t3.childTokens[r2.name] = r2.childTokens);
7656 - }), s2.extensions = t3), n2.renderer) {
7657 - let r2 = this.defaults.renderer || new y2(this.defaults);
7658 - for (let i2 in n2.renderer) {
7659 - if (!(i2 in r2)) throw new Error(`renderer '${i2}' does not exist`);
7660 - if (["options", "parser"].includes(i2)) continue;
7661 - let o3 = i2, u2 = n2.renderer[o3], a2 = r2[o3];
7662 - r2[o3] = (...c2) => {
7663 - let p2 = u2.apply(r2, c2);
7664 - return p2 === false && (p2 = a2.apply(r2, c2)), p2 || "";
7781 + "childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
7782 + }), i.extensions = t2), n.renderer) {
7783 + let r2 = this.defaults.renderer || new P(this.defaults);
7784 + for (let o2 in n.renderer) {
7785 + if (!(o2 in r2)) throw new Error(`renderer '${o2}' does not exist`);
7786 + if (["options", "parser"].includes(o2)) continue;
7787 + let s = o2, u = n.renderer[s], a = r2[s];
7788 + r2[s] = (...p2) => {
7789 + let c2 = u.apply(r2, p2);
7790 + return c2 === false && (c2 = a.apply(r2, p2)), c2 || "";
7665 7791 };
7666 7792 }
7667 - s2.renderer = r2;
7793 + i.renderer = r2;
7668 7794 }
7669 - if (n2.tokenizer) {
7670 - let r2 = this.defaults.tokenizer || new w2(this.defaults);
7671 - for (let i2 in n2.tokenizer) {
7672 - if (!(i2 in r2)) throw new Error(`tokenizer '${i2}' does not exist`);
7673 - if (["options", "rules", "lexer"].includes(i2)) continue;
7674 - let o3 = i2, u2 = n2.tokenizer[o3], a2 = r2[o3];
7675 - r2[o3] = (...c2) => {
7676 - let p2 = u2.apply(r2, c2);
7677 - return p2 === false && (p2 = a2.apply(r2, c2)), p2;
7795 + if (n.tokenizer) {
7796 + let r2 = this.defaults.tokenizer || new y2(this.defaults);
7797 + for (let o2 in n.tokenizer) {
7798 + if (!(o2 in r2)) throw new Error(`tokenizer '${o2}' does not exist`);
7799 + if (["options", "rules", "lexer"].includes(o2)) continue;
7800 + let s = o2, u = n.tokenizer[s], a = r2[s];
7801 + r2[s] = (...p2) => {
7802 + let c2 = u.apply(r2, p2);
7803 + return c2 === false && (c2 = a.apply(r2, p2)), c2;
7678 7804 };
7679 7805 }
7680 - s2.tokenizer = r2;
7806 + i.tokenizer = r2;
7681 7807 }
7682 - if (n2.hooks) {
7683 - let r2 = this.defaults.hooks || new P();
7684 - for (let i2 in n2.hooks) {
7685 - if (!(i2 in r2)) throw new Error(`hook '${i2}' does not exist`);
7686 - if (["options", "block"].includes(i2)) continue;
7687 - let o3 = i2, u2 = n2.hooks[o3], a2 = r2[o3];
7688 - P.passThroughHooks.has(i2) ? r2[o3] = (c2) => {
7689 - if (this.defaults.async && P.passThroughHooksRespectAsync.has(i2)) return (async () => {
7690 - let k2 = await u2.call(r2, c2);
7691 - return a2.call(r2, k2);
7808 + if (n.hooks) {
7809 + let r2 = this.defaults.hooks || new S();
7810 + for (let o2 in n.hooks) {
7811 + if (!(o2 in r2)) throw new Error(`hook '${o2}' does not exist`);
7812 + if (["options", "block"].includes(o2)) continue;
7813 + let s = o2, u = n.hooks[s], a = r2[s];
7814 + S.passThroughHooks.has(o2) ? r2[s] = (p2) => {
7815 + if (this.defaults.async && S.passThroughHooksRespectAsync.has(o2)) return (async () => {
7816 + let h = await u.call(r2, p2);
7817 + return a.call(r2, h);
7692 7818 })();
7693 - let p2 = u2.call(r2, c2);
7694 - return a2.call(r2, p2);
7695 - } : r2[o3] = (...c2) => {
7819 + let c2 = u.call(r2, p2);
7820 + return a.call(r2, c2);
7821 + } : r2[s] = (...p2) => {
7696 7822 if (this.defaults.async) return (async () => {
7697 - let k2 = await u2.apply(r2, c2);
7698 - return k2 === false && (k2 = await a2.apply(r2, c2)), k2;
7823 + let h = await u.apply(r2, p2);
7824 + return h === false && (h = await a.apply(r2, p2)), h;
7699 7825 })();
7700 - let p2 = u2.apply(r2, c2);
7701 - return p2 === false && (p2 = a2.apply(r2, c2)), p2;
7826 + let c2 = u.apply(r2, p2);
7827 + return c2 === false && (c2 = a.apply(r2, p2)), c2;
7702 7828 };
7703 7829 }
7704 - s2.hooks = r2;
7830 + i.hooks = r2;
7705 7831 }
7706 - if (n2.walkTokens) {
7707 - let r2 = this.defaults.walkTokens, i2 = n2.walkTokens;
7708 - s2.walkTokens = function(o3) {
7709 - let u2 = [];
7710 - return u2.push(i2.call(this, o3)), r2 && (u2 = u2.concat(r2.call(this, o3))), u2;
7832 + if (n.walkTokens) {
7833 + let r2 = this.defaults.walkTokens, o2 = n.walkTokens;
7834 + i.walkTokens = function(s) {
7835 + let u = [];
7836 + return u.push(o2.call(this, s)), r2 && (u = u.concat(r2.call(this, s))), u;
7711 7837 };
7712 7838 }
7713 - this.defaults = { ...this.defaults, ...s2 };
7839 + this.defaults = { ...this.defaults, ...i };
7714 7840 }), this;
7715 7841 }
7716 7842 setOptions(e2) {
7717 7843 return this.defaults = { ...this.defaults, ...e2 }, this;
7718 7844 }
7719 - lexer(e2, t3) {
7720 - return x2.lex(e2, t3 ?? this.defaults);
7845 + lexer(e2, t2) {
7846 + return x2.lex(e2, t2 ?? this.defaults);
7721 7847 }
7722 - parser(e2, t3) {
7723 - return b2.parse(e2, t3 ?? this.defaults);
7848 + parser(e2, t2) {
7849 + return b.parse(e2, t2 ?? this.defaults);
7724 7850 }
7725 7851 parseMarkdown(e2) {
7726 - return (n2, s2) => {
7727 - let r2 = { ...s2 }, i2 = { ...this.defaults, ...r2 }, o3 = this.onError(!!i2.silent, !!i2.async);
7728 - if (this.defaults.async === true && r2.async === false) return o3(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."));
7729 - if (typeof n2 > "u" || n2 === null) return o3(new Error("marked(): input parameter is undefined or null"));
7730 - if (typeof n2 != "string") return o3(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
7731 - if (i2.hooks && (i2.hooks.options = i2, i2.hooks.block = e2), i2.async) return (async () => {
7732 - let u2 = i2.hooks ? await i2.hooks.preprocess(n2) : n2, c2 = await (i2.hooks ? await i2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(u2, i2), p2 = i2.hooks ? await i2.hooks.processAllTokens(c2) : c2;
7733 - i2.walkTokens && await Promise.all(this.walkTokens(p2, i2.walkTokens));
7734 - let h2 = await (i2.hooks ? await i2.hooks.provideParser(e2) : e2 ? b2.parse : b2.parseInline)(p2, i2);
7735 - return i2.hooks ? await i2.hooks.postprocess(h2) : h2;
7736 - })().catch(o3);
7852 + return (n, i) => {
7853 + let r2 = { ...i }, o2 = { ...this.defaults, ...r2 }, s = this.onError(!!o2.silent, !!o2.async);
7854 + if (this.defaults.async === true && r2.async === false) return s(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."));
7855 + if (typeof n > "u" || n === null) return s(new Error("marked(): input parameter is undefined or null"));
7856 + if (typeof n != "string") return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
7857 + if (o2.hooks && (o2.hooks.options = o2, o2.hooks.block = e2), o2.async) return (async () => {
7858 + let u = o2.hooks ? await o2.hooks.preprocess(n) : n, p2 = await (o2.hooks ? await o2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(u, o2), c2 = o2.hooks ? await o2.hooks.processAllTokens(p2) : p2;
7859 + o2.walkTokens && await Promise.all(this.walkTokens(c2, o2.walkTokens));
7860 + let k2 = await (o2.hooks ? await o2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(c2, o2);
7861 + return o2.hooks ? await o2.hooks.postprocess(k2) : k2;
7862 + })().catch(s);
7737 7863 try {
7738 - i2.hooks && (n2 = i2.hooks.preprocess(n2));
7739 - let a2 = (i2.hooks ? i2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(n2, i2);
7740 - i2.hooks && (a2 = i2.hooks.processAllTokens(a2)), i2.walkTokens && this.walkTokens(a2, i2.walkTokens);
7741 - let p2 = (i2.hooks ? i2.hooks.provideParser(e2) : e2 ? b2.parse : b2.parseInline)(a2, i2);
7742 - return i2.hooks && (p2 = i2.hooks.postprocess(p2)), p2;
7743 - } catch (u2) {
7744 - return o3(u2);
7864 + o2.hooks && (n = o2.hooks.preprocess(n));
7865 + let a = (o2.hooks ? o2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(n, o2);
7866 + o2.hooks && (a = o2.hooks.processAllTokens(a)), o2.walkTokens && this.walkTokens(a, o2.walkTokens);
7867 + let c2 = (o2.hooks ? o2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(a, o2);
7868 + return o2.hooks && (c2 = o2.hooks.postprocess(c2)), c2;
7869 + } catch (u) {
7870 + return s(u);
7745 7871 }
7746 7872 };
7747 7873 }
7748 - onError(e2, t3) {
7749 - return (n2) => {
7750 - if (n2.message += `
7874 + onError(e2, t2) {
7875 + return (n) => {
7876 + if (n.message += `
7751 7877 Please report this to https://github.com/markedjs/marked.`, e2) {
7752 - let s2 = "<p>An error occurred:</p><pre>" + O(n2.message + "", true) + "</pre>";
7753 - return t3 ? Promise.resolve(s2) : s2;
7878 + let i = "<p>An error occurred:</p><pre>" + R2(n.message + "", true) + "</pre>";
7879 + return t2 ? Promise.resolve(i) : i;
7754 7880 }
7755 - if (t3) return Promise.reject(n2);
7756 - throw n2;
7881 + if (t2) return Promise.reject(n);
7882 + throw n;
7757 7883 };
7758 7884 }
7759 7885 };
7760 - var M2 = new D();
7761 - function g2(l4, e2) {
7886 + var M2 = new Q();
7887 + function f(l4, e2) {
7762 7888 return M2.parse(l4, e2);
7763 7889 }
7764 - g2.options = g2.setOptions = function(l4) {
7765 - return M2.setOptions(l4), g2.defaults = M2.defaults, G(g2.defaults), g2;
7890 + f.options = f.setOptions = function(l4) {
7891 + return M2.setOptions(l4), f.defaults = M2.defaults, U(f.defaults), f;
7766 7892 };
7767 - g2.getDefaults = z;
7768 - g2.defaults = T;
7769 - g2.use = function(...l4) {
7770 - return M2.use(...l4), g2.defaults = M2.defaults, G(g2.defaults), g2;
7771 - };
7772 - g2.walkTokens = function(l4, e2) {
7893 + f.getDefaults = A2;
7894 + f.defaults = T;
7895 + function bt(...l4) {
7896 + return M2.use(...l4), f.defaults = M2.defaults, U(f.defaults), f;
7897 + }
7898 + f.use = bt;
7899 + f.walkTokens = function(l4, e2) {
7773 7900 return M2.walkTokens(l4, e2);
7774 7901 };
7775 - g2.parseInline = M2.parseInline;
7776 - g2.Parser = b2;
7777 - g2.parser = b2.parse;
7778 - g2.Renderer = y2;
7779 - g2.TextRenderer = L;
7780 - g2.Lexer = x2;
7781 - g2.lexer = x2.lex;
7782 - g2.Tokenizer = w2;
7783 - g2.Hooks = P;
7784 - g2.parse = g2;
7785 - var jt = g2.options;
7786 - var Ft = g2.setOptions;
7787 - var Ut = g2.use;
7788 - var Kt = g2.walkTokens;
7789 - var Wt = g2.parseInline;
7790 - var Jt = b2.parse;
7791 - var Vt = x2.lex;
7902 + f.parseInline = M2.parseInline;
7903 + f.Parser = b;
7904 + f.parser = b.parse;
7905 + f.Renderer = P;
7906 + f.TextRenderer = L;
7907 + f.Lexer = x2;
7908 + f.lexer = x2.lex;
7909 + f.Tokenizer = y2;
7910 + f.Hooks = S;
7911 + f.parse = f;
7912 + var un = f.options;
7913 + var pn = f.setOptions;
7914 + var cn = f.walkTokens;
7915 + var hn = f.parseInline;
7916 + var kn = b.parse;
7917 + var gn = x2.lex;
7792 7918
7793 7919 // packages/blocks/build-module/api/raw-handling/markdown-converter.mjs
7794 7920 function escapeBodyText(value) {
7795 7921 return value.replace(/&(?!#?\w+;)/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
7796 7922 }
7797 - var converter = new D({
7923 + var converter = new Q({
7798 7924 gfm: true,
7799 7925 breaks: true,
7800 7926 renderer: {
7801 7927 // Match showdown's `omitExtraWLInCodeBlocks`: marked appends `\n`
@@ -7991,13 +8117,13 @@
7991 8117 if (/\\[a-zA-Z]+\s*\{/g.test(text2)) {
7992 8118 return true;
7993 8119 }
7994 8120 const softClues = [
7995 - (t3) => t3.includes("^") && !t3.startsWith("^"),
7996 - (t3) => ["=", "+", "-", "/", "*"].some(
7997 - (operator) => t3.includes(operator)
8121 + (t2) => t2.includes("^") && !t2.startsWith("^"),
8122 + (t2) => ["=", "+", "-", "/", "*"].some(
8123 + (operator) => t2.includes(operator)
7998 8124 ),
7999 - (t3) => /\\[a-zA-Z]+/g.test(t3)
8125 + (t2) => /\\[a-zA-Z]+/g.test(t2)
8000 8126 ];
8001 8127 if (softClues.filter((clue) => clue(text2)).length >= 2) {
8002 8128 return true;
8003 8129 }
@@ -8276,16 +8402,12 @@
8276 8402 );
8277 8403 }
8278 8404
8279 8405 // packages/blocks/build-module/api/index.mjs
8280 - var fieldsKey = /* @__PURE__ */ Symbol("fields");
8281 - var formKey = /* @__PURE__ */ Symbol("form");
8282 8406 var editableRootKey = /* @__PURE__ */ Symbol("editableRoot");
8283 8407 var privateApis = {};
8284 8408 lock(privateApis, {
8285 8409 isContentBlock,
8286 - fieldsKey,
8287 - formKey,
8288 8410 editableRootKey,
8289 8411 parseRawBlock
8290 8412 });
8291 8413