@clubmed/usg-chat-ui 1.0.1 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/chunks/_commonjsHelpers.js +9 -0
  2. package/chunks/_commonjsHelpers.js.map +1 -0
  3. package/chunks/browser.js +579 -0
  4. package/chunks/browser.js.map +1 -0
  5. package/chunks/client.js +27323 -0
  6. package/chunks/client.js.map +1 -0
  7. package/chunks/index.js +59 -32
  8. package/chunks/index.js.map +1 -1
  9. package/chunks/index2.js +32 -59
  10. package/chunks/index2.js.map +1 -1
  11. package/chunks/index3.js +22 -740
  12. package/chunks/index3.js.map +1 -1
  13. package/chunks/index4.js +740 -22
  14. package/chunks/index4.js.map +1 -1
  15. package/chunks/index5.js +1 -1
  16. package/chunks/index6.js +144 -150
  17. package/chunks/index6.js.map +1 -1
  18. package/chunks/index7.js +14 -13
  19. package/chunks/index7.js.map +1 -1
  20. package/chunks/magic-string.es.js +664 -0
  21. package/chunks/magic-string.es.js.map +1 -0
  22. package/chunks/react.esm.js +10007 -0
  23. package/chunks/react.esm.js.map +1 -0
  24. package/chunks/{collaboration.js → useCollaboration.js} +536 -523
  25. package/chunks/useCollaboration.js.map +1 -0
  26. package/chunks/vi.2VT5v0um.js +10573 -0
  27. package/chunks/vi.2VT5v0um.js.map +1 -0
  28. package/contexts/ChatContext.d.ts +2 -1
  29. package/contexts/ChatContext.js +32 -30
  30. package/contexts/ChatContext.js.map +1 -1
  31. package/core/interfaces/ChatConfig.d.ts +4 -0
  32. package/core/interfaces/StoryVersion.d.ts +7 -2
  33. package/index.d.ts +1 -0
  34. package/molecules/AiElements/Message.js +1 -1
  35. package/molecules/AiElements/Response.js +15 -13
  36. package/molecules/AiElements/Response.js.map +1 -1
  37. package/molecules/AiElements/Sources.d.ts +2 -2
  38. package/molecules/AiElements/Sources.js.map +1 -1
  39. package/molecules/Buttons/Button.d.ts +1 -1
  40. package/molecules/Buttons/Button.js +2 -2
  41. package/molecules/{AiElements → CodeBlock}/CodeBlock.d.ts +5 -2
  42. package/molecules/CodeBlock/CodeBlock.js +128 -0
  43. package/molecules/CodeBlock/CodeBlock.js.map +1 -0
  44. package/molecules/CodeBlock/CodeBlock.test.d.ts +1 -0
  45. package/molecules/CodeBlock/CodeBlock.test.js +3158 -0
  46. package/molecules/CodeBlock/CodeBlock.test.js.map +1 -0
  47. package/molecules/CodeBlock/highlightCode.d.ts +2 -0
  48. package/molecules/CodeBlock/highlightCode.js +5850 -0
  49. package/molecules/CodeBlock/highlightCode.js.map +1 -0
  50. package/molecules/CodeBlock/highlightCode.test.d.ts +1 -0
  51. package/molecules/CodeBlock/highlightCode.test.js +47 -0
  52. package/molecules/CodeBlock/highlightCode.test.js.map +1 -0
  53. package/molecules/Collapsibles/Collapsible.js +1 -1
  54. package/molecules/Forms/InputGroups/InputGroup.js +1 -1
  55. package/molecules/Labels/Label.js +2 -2
  56. package/molecules/Notifications/{Sonner.js → Toaster.js} +2 -2
  57. package/molecules/Notifications/Toaster.js.map +1 -0
  58. package/molecules/Notifications/{use-toast.js → useToast.js} +1 -1
  59. package/molecules/Notifications/useToast.js.map +1 -0
  60. package/{organisms → molecules}/RichText/DynamicEditor.js.map +1 -1
  61. package/molecules/RichText/EditorWithAI.js +55854 -0
  62. package/molecules/RichText/EditorWithAI.js.map +1 -0
  63. package/molecules/RichText/useCollaboration.d.ts +9 -0
  64. package/molecules/RichText/useCollaboration.js +8 -0
  65. package/molecules/RichText/useCollaboration.js.map +1 -0
  66. package/molecules/RichText/useCollaboration.test.d.ts +1 -0
  67. package/molecules/RichText/useCollaboration.test.js +70 -0
  68. package/molecules/RichText/useCollaboration.test.js.map +1 -0
  69. package/molecules/Tabs/Tabs.js +1 -1
  70. package/organisms/canvas/ApiDocsCanvas.js +15 -15
  71. package/organisms/canvas/ApiDocsCanvas.js.map +1 -1
  72. package/organisms/canvas/ReleaseNoteCanvas.js +2 -2
  73. package/organisms/canvas/ReleaseNoteCanvas.js.map +1 -1
  74. package/organisms/canvas/StoryCanvas.js +2 -2
  75. package/organisms/canvas/StoryCanvas.js.map +1 -1
  76. package/organisms/chat/MessageActions.js +1 -1
  77. package/organisms/chat/MessageActions.js.map +1 -1
  78. package/organisms/chat/hooks/useChat.js +1 -1
  79. package/organisms/chat/hooks/useChat.js.map +1 -1
  80. package/organisms/chat/hooks/useChatKeyboardsShortcuts.js +16 -33
  81. package/organisms/chat/hooks/useChatKeyboardsShortcuts.js.map +1 -1
  82. package/organisms/chat/hooks/useConversations.js +1 -1
  83. package/organisms/chat/hooks/useConversations.js.map +1 -1
  84. package/organisms/settings/SettingsModal.js +1 -1
  85. package/package.json +3 -4
  86. package/.npm/_logs/2026-01-19T16_54_30_380Z-debug-0.log +0 -19
  87. package/.npm/_logs/2026-01-19T16_54_30_467Z-debug-0.log +0 -19
  88. package/.npm/_logs/2026-01-19T16_54_30_553Z-debug-0.log +0 -14
  89. package/chunks/collaboration.js.map +0 -1
  90. package/core/collaboration.d.ts +0 -6
  91. package/core/collaboration.js +0 -5
  92. package/core/collaboration.js.map +0 -1
  93. package/molecules/AiElements/CodeBlock.js +0 -6525
  94. package/molecules/AiElements/CodeBlock.js.map +0 -1
  95. package/molecules/Notifications/Sonner.js.map +0 -1
  96. package/molecules/Notifications/use-toast.js.map +0 -1
  97. package/molecules/index.d.ts +0 -28
  98. package/molecules/index.js +0 -88
  99. package/molecules/index.js.map +0 -1
  100. package/organisms/RichText/EditorWithAI.js +0 -83167
  101. package/organisms/RichText/EditorWithAI.js.map +0 -1
  102. /package/molecules/Notifications/{Sonner.d.ts → Toaster.d.ts} +0 -0
  103. /package/molecules/Notifications/{use-toast.d.ts → useToast.d.ts} +0 -0
  104. /package/{organisms → molecules}/RichText/DynamicEditor.d.ts +0 -0
  105. /package/{organisms → molecules}/RichText/DynamicEditor.js +0 -0
  106. /package/{organisms → molecules}/RichText/EditorWithAI.d.ts +0 -0
package/chunks/index6.js CHANGED
@@ -1,29 +1,26 @@
1
- var be = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function ve(l) {
3
- return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
1
+ function be(l) {
2
+ const t = [], e = String(l || "");
3
+ let n = e.indexOf(","), a = 0, r = !1;
4
+ for (; !r; ) {
5
+ n === -1 && (n = e.length, r = !0);
6
+ const u = e.slice(a, n).trim();
7
+ (u || !r) && t.push(u), a = n + 1, n = e.indexOf(",", a);
8
+ }
9
+ return t;
10
+ }
11
+ function ln(l, t) {
12
+ const e = t || {};
13
+ return (l[l.length - 1] === "" ? [...l, ""] : l).join(
14
+ (e.padRight ? " " : "") + "," + (e.padLeft === !1 ? "" : " ")
15
+ ).trim();
16
+ }
17
+ const tn = /[ \t\n\f\r]/g;
18
+ function R(l) {
19
+ return typeof l == "object" ? l.type === "text" ? U(l.value) : !1 : U(l);
20
+ }
21
+ function U(l) {
22
+ return l.replace(tn, "") === "";
4
23
  }
5
- const ln = [
6
- "area",
7
- "base",
8
- "basefont",
9
- "bgsound",
10
- "br",
11
- "col",
12
- "command",
13
- "embed",
14
- "frame",
15
- "hr",
16
- "image",
17
- "img",
18
- "input",
19
- "keygen",
20
- "link",
21
- "meta",
22
- "param",
23
- "source",
24
- "track",
25
- "wbr"
26
- ];
27
24
  class C {
28
25
  /**
29
26
  * @param {SchemaType['property']} property
@@ -42,7 +39,7 @@ class C {
42
39
  C.prototype.normal = {};
43
40
  C.prototype.property = {};
44
41
  C.prototype.space = void 0;
45
- function _(l, t) {
42
+ function j(l, t) {
46
43
  const e = {}, n = {};
47
44
  for (const a of l)
48
45
  Object.assign(e, a.property), Object.assign(n, a.normal);
@@ -76,10 +73,10 @@ d.prototype.overloadedBoolean = !1;
76
73
  d.prototype.property = "";
77
74
  d.prototype.spaceSeparated = !1;
78
75
  d.prototype.space = void 0;
79
- let tn = 0;
76
+ let on = 0;
80
77
  const i = f(), g = f(), E = f(), o = f(), s = f(), y = f(), m = f();
81
78
  function f() {
82
- return 2 ** ++tn;
79
+ return 2 ** ++on;
83
80
  }
84
81
  const A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
85
82
  __proto__: null,
@@ -94,7 +91,7 @@ const A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
94
91
  /** @type {ReadonlyArray<keyof typeof types>} */
95
92
  Object.keys(A)
96
93
  );
97
- class R extends d {
94
+ class L extends d {
98
95
  /**
99
96
  * @constructor
100
97
  * @param {string} property
@@ -110,21 +107,21 @@ class R extends d {
110
107
  */
111
108
  constructor(t, e, n, a) {
112
109
  let r = -1;
113
- if (super(t, e), U(this, "space", a), typeof n == "number")
110
+ if (super(t, e), z(this, "space", a), typeof n == "number")
114
111
  for (; ++r < w.length; ) {
115
112
  const u = w[r];
116
- U(this, w[r], (n & A[u]) === A[u]);
113
+ z(this, w[r], (n & A[u]) === A[u]);
117
114
  }
118
115
  }
119
116
  }
120
- R.prototype.defined = !0;
121
- function U(l, t, e) {
117
+ L.prototype.defined = !0;
118
+ function z(l, t, e) {
122
119
  e && (l[t] = e);
123
120
  }
124
121
  function v(l) {
125
122
  const t = {}, e = {};
126
123
  for (const [n, a] of Object.entries(l.properties)) {
127
- const r = new R(
124
+ const r = new L(
128
125
  n,
129
126
  l.transform(l.attributes || {}, n),
130
127
  a,
@@ -196,7 +193,7 @@ function $(l, t) {
196
193
  function W(l, t) {
197
194
  return $(l, t.toLowerCase());
198
195
  }
199
- const on = v({
196
+ const an = v({
200
197
  attributes: {
201
198
  acceptcharset: "accept-charset",
202
199
  classname: "class",
@@ -557,7 +554,7 @@ const on = v({
557
554
  },
558
555
  space: "html",
559
556
  transform: W
560
- }), an = v({
557
+ }), rn = v({
561
558
  attributes: {
562
559
  accentHeight: "accent-height",
563
560
  alignmentBaseline: "alignment-baseline",
@@ -1141,59 +1138,97 @@ const on = v({
1141
1138
  transform(l, t) {
1142
1139
  return "xml:" + t.slice(3).toLowerCase();
1143
1140
  }
1144
- }), rn = /[A-Z]/g, z = /-[a-z]/g, un = /^data[-\w.:]+$/i;
1145
- function sn(l, t) {
1141
+ }), un = /[A-Z]/g, q = /-[a-z]/g, sn = /^data[-\w.:]+$/i;
1142
+ function cn(l, t) {
1146
1143
  const e = P(t);
1147
1144
  let n = t, a = d;
1148
1145
  if (e in l.normal)
1149
1146
  return l.property[l.normal[e]];
1150
- if (e.length > 4 && e.slice(0, 4) === "data" && un.test(t)) {
1147
+ if (e.length > 4 && e.slice(0, 4) === "data" && sn.test(t)) {
1151
1148
  if (t.charAt(4) === "-") {
1152
- const r = t.slice(5).replace(z, gn);
1149
+ const r = t.slice(5).replace(q, pn);
1153
1150
  n = "data" + r.charAt(0).toUpperCase() + r.slice(1);
1154
1151
  } else {
1155
1152
  const r = t.slice(4);
1156
- if (!z.test(r)) {
1157
- let u = r.replace(rn, cn);
1153
+ if (!q.test(r)) {
1154
+ let u = r.replace(un, gn);
1158
1155
  u.charAt(0) !== "-" && (u = "-" + u), t = "data" + u;
1159
1156
  }
1160
1157
  }
1161
- a = R;
1158
+ a = L;
1162
1159
  }
1163
1160
  return new a(n, t);
1164
1161
  }
1165
- function cn(l) {
1162
+ function gn(l) {
1166
1163
  return "-" + l.toLowerCase();
1167
1164
  }
1168
- function gn(l) {
1165
+ function pn(l) {
1169
1166
  return l.charAt(1).toUpperCase();
1170
1167
  }
1171
- const pn = _([V, on, Y, K, X], "html"), Z = _([V, an, Y, K, X], "svg"), q = {}.hasOwnProperty;
1172
- function dn(l, t) {
1168
+ const dn = j([V, an, Y, K, X], "html"), Z = j([V, rn, Y, K, X], "svg");
1169
+ function ve(l) {
1170
+ const t = String(l || "").trim();
1171
+ return t ? t.split(/[ \t\n\r\f]+/g) : [];
1172
+ }
1173
+ function mn(l) {
1174
+ return l.join(" ").trim();
1175
+ }
1176
+ function B(l, t) {
1177
+ const e = String(l);
1178
+ if (typeof t != "string")
1179
+ throw new TypeError("Expected character");
1180
+ let n = 0, a = e.indexOf(t);
1181
+ for (; a !== -1; )
1182
+ n++, a = e.indexOf(t, a + t.length);
1183
+ return n;
1184
+ }
1185
+ const I = {}.hasOwnProperty;
1186
+ function hn(l, t) {
1173
1187
  const e = t || {};
1174
1188
  function n(a, ...r) {
1175
1189
  let u = n.invalid;
1176
1190
  const c = n.handlers;
1177
- if (a && q.call(a, l)) {
1191
+ if (a && I.call(a, l)) {
1178
1192
  const h = String(a[l]);
1179
- u = q.call(c, h) ? c[h] : n.unknown;
1193
+ u = I.call(c, h) ? c[h] : n.unknown;
1180
1194
  }
1181
1195
  if (u)
1182
1196
  return u.call(this, a, ...r);
1183
1197
  }
1184
1198
  return n.handlers = e.handlers || {}, n.invalid = e.invalid, n.unknown = e.unknown, n;
1185
1199
  }
1186
- const mn = /["&'<>`]/g, hn = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, fn = (
1200
+ const fn = [
1201
+ "area",
1202
+ "base",
1203
+ "basefont",
1204
+ "bgsound",
1205
+ "br",
1206
+ "col",
1207
+ "command",
1208
+ "embed",
1209
+ "frame",
1210
+ "hr",
1211
+ "image",
1212
+ "img",
1213
+ "input",
1214
+ "keygen",
1215
+ "link",
1216
+ "meta",
1217
+ "param",
1218
+ "source",
1219
+ "track",
1220
+ "wbr"
1221
+ ], yn = /["&'<>`]/g, bn = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, vn = (
1187
1222
  // eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
1188
1223
  /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g
1189
- ), yn = /[|\\{}()[\]^$+*?.]/g, B = /* @__PURE__ */ new WeakMap();
1190
- function bn(l, t) {
1224
+ ), xn = /[|\\{}()[\]^$+*?.]/g, F = /* @__PURE__ */ new WeakMap();
1225
+ function Cn(l, t) {
1191
1226
  if (l = l.replace(
1192
- t.subset ? vn(t.subset) : mn,
1227
+ t.subset ? Sn(t.subset) : yn,
1193
1228
  n
1194
1229
  ), t.subset || t.escapeOnly)
1195
1230
  return l;
1196
- return l.replace(hn, e).replace(fn, n);
1231
+ return l.replace(bn, e).replace(vn, n);
1197
1232
  function e(a, r, u) {
1198
1233
  return t.format(
1199
1234
  (a.charCodeAt(0) - 55296) * 1024 + a.charCodeAt(1) - 56320 + 65536,
@@ -1209,28 +1244,28 @@ function bn(l, t) {
1209
1244
  );
1210
1245
  }
1211
1246
  }
1212
- function vn(l) {
1213
- let t = B.get(l);
1214
- return t || (t = xn(l), B.set(l, t)), t;
1247
+ function Sn(l) {
1248
+ let t = F.get(l);
1249
+ return t || (t = kn(l), F.set(l, t)), t;
1215
1250
  }
1216
- function xn(l) {
1251
+ function kn(l) {
1217
1252
  const t = [];
1218
1253
  let e = -1;
1219
1254
  for (; ++e < l.length; )
1220
- t.push(l[e].replace(yn, "\\$&"));
1255
+ t.push(l[e].replace(xn, "\\$&"));
1221
1256
  return new RegExp("(?:" + t.join("|") + ")", "g");
1222
1257
  }
1223
- const Cn = /[\dA-Fa-f]/;
1224
- function Sn(l, t, e) {
1258
+ const wn = /[\dA-Fa-f]/;
1259
+ function On(l, t, e) {
1225
1260
  const n = "&#x" + l.toString(16).toUpperCase();
1226
- return e && t && !Cn.test(String.fromCharCode(t)) ? n : n + ";";
1261
+ return e && t && !wn.test(String.fromCharCode(t)) ? n : n + ";";
1227
1262
  }
1228
- const kn = /\d/;
1229
- function wn(l, t, e) {
1263
+ const Nn = /\d/;
1264
+ function Pn(l, t, e) {
1230
1265
  const n = "&#" + String(l);
1231
- return e && t && !kn.test(String.fromCharCode(t)) ? n : n + ";";
1266
+ return e && t && !Nn.test(String.fromCharCode(t)) ? n : n + ";";
1232
1267
  }
1233
- const On = [
1268
+ const En = [
1234
1269
  "AElig",
1235
1270
  "AMP",
1236
1271
  "Aacute",
@@ -1590,7 +1625,7 @@ const On = [
1590
1625
  lsaquo: "‹",
1591
1626
  rsaquo: "›",
1592
1627
  euro: "€"
1593
- }, Nn = [
1628
+ }, An = [
1594
1629
  "cent",
1595
1630
  "copy",
1596
1631
  "divide",
@@ -1603,90 +1638,51 @@ const On = [
1603
1638
  let S;
1604
1639
  for (S in O)
1605
1640
  G.call(O, S) && (D[O[S]] = S);
1606
- const Pn = /[^\dA-Za-z]/;
1607
- function En(l, t, e, n) {
1641
+ const Dn = /[^\dA-Za-z]/;
1642
+ function Rn(l, t, e, n) {
1608
1643
  const a = String.fromCharCode(l);
1609
1644
  if (G.call(D, a)) {
1610
1645
  const r = D[a], u = "&" + r;
1611
- return e && On.includes(r) && !Nn.includes(r) && (!n || t && t !== 61 && Pn.test(String.fromCharCode(t))) ? u : u + ";";
1646
+ return e && En.includes(r) && !An.includes(r) && (!n || t && t !== 61 && Dn.test(String.fromCharCode(t))) ? u : u + ";";
1612
1647
  }
1613
1648
  return "";
1614
1649
  }
1615
- function An(l, t, e) {
1616
- let n = Sn(l, t, e.omitOptionalSemicolons), a;
1617
- if ((e.useNamedReferences || e.useShortestReferences) && (a = En(
1650
+ function Ln(l, t, e) {
1651
+ let n = On(l, t, e.omitOptionalSemicolons), a;
1652
+ if ((e.useNamedReferences || e.useShortestReferences) && (a = Rn(
1618
1653
  l,
1619
1654
  t,
1620
1655
  e.omitOptionalSemicolons,
1621
1656
  e.attribute
1622
1657
  )), (e.useShortestReferences || !a) && e.useShortestReferences) {
1623
- const r = wn(l, t, e.omitOptionalSemicolons);
1658
+ const r = Pn(l, t, e.omitOptionalSemicolons);
1624
1659
  r.length < n.length && (n = r);
1625
1660
  }
1626
1661
  return a && (!e.useShortestReferences || a.length < n.length) ? a : n;
1627
1662
  }
1628
1663
  function b(l, t) {
1629
- return bn(l, Object.assign({ format: An }, t));
1664
+ return Cn(l, Object.assign({ format: Ln }, t));
1630
1665
  }
1631
- const Dn = /^>|^->|<!--|-->|--!>|<!-$/g, Rn = [">"], Ln = ["<", ">"];
1632
- function Mn(l, t, e, n) {
1666
+ const Mn = /^>|^->|<!--|-->|--!>|<!-$/g, Tn = [">"], Un = ["<", ">"];
1667
+ function zn(l, t, e, n) {
1633
1668
  return n.settings.bogusComments ? "<?" + b(
1634
1669
  l.value,
1635
1670
  Object.assign({}, n.settings.characterReferences, {
1636
- subset: Rn
1671
+ subset: Tn
1637
1672
  })
1638
- ) + ">" : "<!--" + l.value.replace(Dn, a) + "-->";
1673
+ ) + ">" : "<!--" + l.value.replace(Mn, a) + "-->";
1639
1674
  function a(r) {
1640
1675
  return b(
1641
1676
  r,
1642
1677
  Object.assign({}, n.settings.characterReferences, {
1643
- subset: Ln
1678
+ subset: Un
1644
1679
  })
1645
1680
  );
1646
1681
  }
1647
1682
  }
1648
- function Tn(l, t, e, n) {
1683
+ function qn(l, t, e, n) {
1649
1684
  return "<!" + (n.settings.upperDoctype ? "DOCTYPE" : "doctype") + (n.settings.tightDoctype ? "" : " ") + "html>";
1650
1685
  }
1651
- function I(l, t) {
1652
- const e = String(l);
1653
- if (typeof t != "string")
1654
- throw new TypeError("Expected character");
1655
- let n = 0, a = e.indexOf(t);
1656
- for (; a !== -1; )
1657
- n++, a = e.indexOf(t, a + t.length);
1658
- return n;
1659
- }
1660
- function xe(l) {
1661
- const t = [], e = String(l || "");
1662
- let n = e.indexOf(","), a = 0, r = !1;
1663
- for (; !r; ) {
1664
- n === -1 && (n = e.length, r = !0);
1665
- const u = e.slice(a, n).trim();
1666
- (u || !r) && t.push(u), a = n + 1, n = e.indexOf(",", a);
1667
- }
1668
- return t;
1669
- }
1670
- function Un(l, t) {
1671
- const e = t || {};
1672
- return (l[l.length - 1] === "" ? [...l, ""] : l).join(
1673
- (e.padRight ? " " : "") + "," + (e.padLeft === !1 ? "" : " ")
1674
- ).trim();
1675
- }
1676
- function Ce(l) {
1677
- const t = String(l || "").trim();
1678
- return t ? t.split(/[ \t\n\r\f]+/g) : [];
1679
- }
1680
- function zn(l) {
1681
- return l.join(" ").trim();
1682
- }
1683
- const qn = /[ \t\n\f\r]/g;
1684
- function L(l) {
1685
- return typeof l == "object" ? l.type === "text" ? F(l.value) : !1 : F(l);
1686
- }
1687
- function F(l) {
1688
- return l.replace(qn, "") === "";
1689
- }
1690
1686
  const p = Q(1), J = Q(-1), Bn = [];
1691
1687
  function Q(l) {
1692
1688
  return t;
@@ -1694,7 +1690,7 @@ function Q(l) {
1694
1690
  const r = e ? e.children : Bn;
1695
1691
  let u = (n || 0) + l, c = r[u];
1696
1692
  if (!a)
1697
- for (; c && L(c); )
1693
+ for (; c && R(c); )
1698
1694
  u += l, c = r[u];
1699
1695
  return c;
1700
1696
  }
@@ -1714,22 +1710,22 @@ const M = nn({
1714
1710
  dt: Vn,
1715
1711
  head: N,
1716
1712
  html: Fn,
1717
- li: _n,
1713
+ li: jn,
1718
1714
  optgroup: Wn,
1719
1715
  option: Yn,
1720
- p: jn,
1716
+ p: _n,
1721
1717
  rp: H,
1722
1718
  rt: H,
1723
1719
  tbody: Xn,
1724
- td: j,
1720
+ td: _,
1725
1721
  tfoot: Zn,
1726
- th: j,
1722
+ th: _,
1727
1723
  thead: Kn,
1728
1724
  tr: Gn
1729
1725
  });
1730
1726
  function N(l, t, e) {
1731
1727
  const n = p(e, t, !0);
1732
- return !n || n.type !== "comment" && !(n.type === "text" && L(n.value.charAt(0)));
1728
+ return !n || n.type !== "comment" && !(n.type === "text" && R(n.value.charAt(0)));
1733
1729
  }
1734
1730
  function Fn(l, t, e) {
1735
1731
  const n = p(e, t);
@@ -1739,12 +1735,12 @@ function Hn(l, t, e) {
1739
1735
  const n = p(e, t);
1740
1736
  return !n || n.type !== "comment";
1741
1737
  }
1742
- function jn(l, t, e) {
1738
+ function _n(l, t, e) {
1743
1739
  const n = p(e, t);
1744
1740
  return n ? n.type === "element" && (n.tagName === "address" || n.tagName === "article" || n.tagName === "aside" || n.tagName === "blockquote" || n.tagName === "details" || n.tagName === "div" || n.tagName === "dl" || n.tagName === "fieldset" || n.tagName === "figcaption" || n.tagName === "figure" || n.tagName === "footer" || n.tagName === "form" || n.tagName === "h1" || n.tagName === "h2" || n.tagName === "h3" || n.tagName === "h4" || n.tagName === "h5" || n.tagName === "h6" || n.tagName === "header" || n.tagName === "hgroup" || n.tagName === "hr" || n.tagName === "main" || n.tagName === "menu" || n.tagName === "nav" || n.tagName === "ol" || n.tagName === "p" || n.tagName === "pre" || n.tagName === "section" || n.tagName === "table" || n.tagName === "ul") : !e || // Confusing parent.
1745
1741
  !(e.type === "element" && (e.tagName === "a" || e.tagName === "audio" || e.tagName === "del" || e.tagName === "ins" || e.tagName === "map" || e.tagName === "noscript" || e.tagName === "video"));
1746
1742
  }
1747
- function _n(l, t, e) {
1743
+ function jn(l, t, e) {
1748
1744
  const n = p(e, t);
1749
1745
  return !n || n.type === "element" && n.tagName === "li";
1750
1746
  }
@@ -1783,7 +1779,7 @@ function Gn(l, t, e) {
1783
1779
  const n = p(e, t);
1784
1780
  return !n || n.type === "element" && n.tagName === "tr";
1785
1781
  }
1786
- function j(l, t, e) {
1782
+ function _(l, t, e) {
1787
1783
  const n = p(e, t);
1788
1784
  return !n || n.type === "element" && (n.tagName === "td" || n.tagName === "th");
1789
1785
  }
@@ -1810,7 +1806,7 @@ function ne(l) {
1810
1806
  }
1811
1807
  function ee(l) {
1812
1808
  const t = p(l, -1, !0);
1813
- return !t || t.type !== "comment" && !(t.type === "text" && L(t.value.charAt(0))) && !(t.type === "element" && (t.tagName === "meta" || t.tagName === "link" || t.tagName === "script" || t.tagName === "style" || t.tagName === "template"));
1809
+ return !t || t.type !== "comment" && !(t.type === "text" && R(t.value.charAt(0))) && !(t.type === "element" && (t.tagName === "meta" || t.tagName === "link" || t.tagName === "script" || t.tagName === "style" || t.tagName === "template"));
1814
1810
  }
1815
1811
  function le(l, t, e) {
1816
1812
  const n = J(e, t), a = p(l, -1, !0);
@@ -1878,7 +1874,7 @@ function ae(l, t) {
1878
1874
  return e.join("");
1879
1875
  }
1880
1876
  function re(l, t, e) {
1881
- const n = sn(l.schema, t), a = l.settings.allowParseErrors && l.schema.space === "html" ? 0 : 1, r = l.settings.allowDangerousCharacters ? 0 : 1;
1877
+ const n = cn(l.schema, t), a = l.settings.allowParseErrors && l.schema.space === "html" ? 0 : 1, r = l.settings.allowDangerousCharacters ? 0 : 1;
1882
1878
  let u = l.quote, c;
1883
1879
  if (n.overloadedBoolean && (e === n.attribute || e === "") ? e = !0 : (n.boolean || n.overloadedBoolean) && (typeof e != "string" || e === n.attribute || e === "") && (e = !!e), e == null || e === !1 || typeof e == "number" && Number.isNaN(e))
1884
1880
  return "";
@@ -1889,7 +1885,7 @@ function re(l, t, e) {
1889
1885
  subset: k.name[a][r]
1890
1886
  })
1891
1887
  );
1892
- return e === !0 || (e = Array.isArray(e) ? (n.commaSeparated ? Un : zn)(e, {
1888
+ return e === !0 || (e = Array.isArray(e) ? (n.commaSeparated ? ln : mn)(e, {
1893
1889
  padLeft: !l.settings.tightCommaSeparatedLists
1894
1890
  }) : String(e), l.settings.collapseEmptyAttributes && !e) ? h : (l.settings.preferUnquoted && (c = b(
1895
1891
  e,
@@ -1897,7 +1893,7 @@ function re(l, t, e) {
1897
1893
  attribute: !0,
1898
1894
  subset: k.unquoted[a][r]
1899
1895
  })
1900
- )), c !== e && (l.settings.quoteSmart && I(e, u) > I(e, l.alternative) && (u = l.alternative), c = u + b(
1896
+ )), c !== e && (l.settings.quoteSmart && B(e, u) > B(e, l.alternative) && (u = l.alternative), c = u + b(
1901
1897
  e,
1902
1898
  Object.assign({}, l.settings.characterReferences, {
1903
1899
  // Always encode without parse errors in non-HTML.
@@ -1921,10 +1917,10 @@ function ue(l, t, e, n) {
1921
1917
  function se(l, t, e, n) {
1922
1918
  return n.all(l);
1923
1919
  }
1924
- const ce = dn("type", {
1920
+ const ce = hn("type", {
1925
1921
  invalid: ge,
1926
1922
  unknown: pe,
1927
- handlers: { comment: Mn, doctype: Tn, element: oe, raw: ue, root: se, text: en }
1923
+ handlers: { comment: zn, doctype: qn, element: oe, raw: ue, root: se, text: en }
1928
1924
  });
1929
1925
  function ge(l) {
1930
1926
  throw new Error("Expected node, not `" + l + "`");
@@ -1937,7 +1933,7 @@ function pe(l) {
1937
1933
  throw new Error("Cannot compile unknown node `" + t.type + "`");
1938
1934
  }
1939
1935
  const de = {}, me = {}, he = [];
1940
- function Se(l, t) {
1936
+ function xe(l, t) {
1941
1937
  const e = t || de, n = e.quote || '"', a = n === '"' ? "'" : '"';
1942
1938
  if (n !== '"' && n !== "'")
1943
1939
  throw new Error("Invalid quote `" + n + "`, expected `'` or `\"`");
@@ -1958,12 +1954,12 @@ function Se(l, t) {
1958
1954
  tightSelfClosing: e.tightSelfClosing || !1,
1959
1955
  collapseEmptyAttributes: e.collapseEmptyAttributes || !1,
1960
1956
  allowDangerousHtml: e.allowDangerousHtml || !1,
1961
- voids: e.voids || ln,
1957
+ voids: e.voids || fn,
1962
1958
  characterReferences: e.characterReferences || me,
1963
1959
  closeSelfClosing: e.closeSelfClosing || !1,
1964
1960
  closeEmptyElements: e.closeEmptyElements || !1
1965
1961
  },
1966
- schema: e.space === "svg" ? Z : pn,
1962
+ schema: e.space === "svg" ? Z : dn,
1967
1963
  quote: n,
1968
1964
  alternative: a
1969
1965
  }.one(
@@ -1983,19 +1979,17 @@ function ye(l) {
1983
1979
  return t.join("");
1984
1980
  }
1985
1981
  export {
1986
- Un as a,
1987
- zn as b,
1988
- be as c,
1989
- I as d,
1990
- xe as e,
1991
- sn as f,
1992
- ve as g,
1993
- pn as h,
1982
+ ln as a,
1983
+ mn as b,
1984
+ B as c,
1985
+ be as d,
1986
+ cn as f,
1987
+ dn as h,
1994
1988
  P as n,
1995
- Ce as p,
1989
+ ve as p,
1996
1990
  Z as s,
1997
- Se as t,
1998
- L as w,
1999
- dn as z
1991
+ xe as t,
1992
+ R as w,
1993
+ hn as z
2000
1994
  };
2001
1995
  //# sourceMappingURL=index6.js.map