@marimo-team/islands 0.23.10-dev9 → 0.23.11-dev67

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 (188) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CyV83R2m.js → ConnectedDataExplorerComponent-Z3RP7Vmm.js} +31 -31
  2. package/dist/{ErrorBoundary-rULOrC_p.js → ErrorBoundary-DpbaKVv7.js} +1 -1
  3. package/dist/{any-language-editor-CiES2a2h.js → any-language-editor-CAgFD4Kd.js} +20 -20
  4. package/dist/assets/__vite-browser-external-eshhtsgZ.js +1 -0
  5. package/dist/assets/worker-CC0Oul9k.js +73 -0
  6. package/dist/{chat-ui-K84W5ecY.js → chat-ui-C4-GMW9y.js} +77 -77
  7. package/dist/{check-DTbrK0zt.js → check-BCaJeT-J.js} +1 -1
  8. package/dist/{chunk-5FQGJX7Z-BNjes6Yx.js → chunk-5FQGJX7Z-BbqSm5gU.js} +1227 -1222
  9. package/dist/{code-block-37QAKDTI-m92Yc8pv.js → code-block-37QAKDTI-O6IH6wAi.js} +1 -1
  10. package/dist/{code-visibility-v6ucEVUg.js → code-visibility-UH2371Sv.js} +1943 -1223
  11. package/dist/{copy-5jQ_kGE1.js → copy-UqRYxiOg.js} +1 -1
  12. package/dist/dist-7QfXoMdB.js +5 -0
  13. package/dist/{dist-DgnE8F-r.js → dist-A2846XWO.js} +1 -1
  14. package/dist/dist-BEXXyZig.js +5 -0
  15. package/dist/{dist-B3pZ0Ab6.js → dist-BR_gyG9L.js} +3 -3
  16. package/dist/{dist-CcXxepx6.js → dist-BSAt6RhH.js} +27 -27
  17. package/dist/{dist-Bde4a2kU.js → dist-BY018Paw.js} +8 -8
  18. package/dist/dist-BYj57OV4.js +5 -0
  19. package/dist/{dist-CUCNs1ja.js → dist-BaoDKvdy.js} +2 -2
  20. package/dist/{dist-Cy1WxgBD.js → dist-Bf7SHuNp.js} +5 -5
  21. package/dist/{dist-Bz_sYWbr.js → dist-Bk75fBZA.js} +2 -2
  22. package/dist/dist-BlSvQzNr.js +5 -0
  23. package/dist/{dist-C5VC_yzu.js → dist-BzEzfugY.js} +1 -1
  24. package/dist/dist-CCBlxAgS.js +8 -0
  25. package/dist/dist-CIDTVIUf.js +5 -0
  26. package/dist/{dist-CLUtPrdy.js → dist-CIYBwstr.js} +1 -1
  27. package/dist/{dist-BotSqB48.js → dist-C_Y3oV3C.js} +12 -12
  28. package/dist/{dist-BTfv03uy.js → dist-CcWX6tmx.js} +2 -2
  29. package/dist/{dist-BhM8gdSO.js → dist-CoXAujgg.js} +4 -4
  30. package/dist/{dist-4j4c7bjm.js → dist-CpxNdDkw.js} +3 -3
  31. package/dist/dist-CqQyhAM8.js +8 -0
  32. package/dist/dist-CwRu2Xzh.js +5 -0
  33. package/dist/{dist-BcuoonNH.js → dist-CxJDU6Bh.js} +9 -9
  34. package/dist/{dist-DxvORzUR.js → dist-D-W5ny5a.js} +8 -8
  35. package/dist/dist-D8CDTVgf.js +6 -0
  36. package/dist/dist-D8DNB0nO.js +8 -0
  37. package/dist/dist-DL6N_q-A.js +5 -0
  38. package/dist/{dist-BbbIBDiQ.js → dist-DMjWuVs8.js} +1 -1
  39. package/dist/dist-DOFbNV_b.js +8 -0
  40. package/dist/dist-DPrYzMY0.js +6 -0
  41. package/dist/{dist-h2c8sZvT.js → dist-DZORgqKY.js} +1 -1
  42. package/dist/{dist-B3P2fFpz.js → dist-DZo4nSS0.js} +14 -14
  43. package/dist/{dist-D4CewLk6.js → dist-Dax--nl9.js} +1 -1
  44. package/dist/{dist-DRfcqpxJ.js → dist-DgGbNavJ.js} +2 -2
  45. package/dist/{dist-C1BYNeCR.js → dist-Dk6PV_d3.js} +10 -10
  46. package/dist/{dist-fQ0ViXGs.js → dist-Dv_Y15yk.js} +107 -107
  47. package/dist/{dist-Bfwsv11D.js → dist-DyyjKEYf.js} +2 -2
  48. package/dist/{dist-p2qyWijU.js → dist-GZXUmt0b.js} +2 -2
  49. package/dist/{dist-CLJWPTX2.js → dist-LTU8Hdvn.js} +3 -3
  50. package/dist/{dist-DqAWR3CS.js → dist-M9Vag9Y0.js} +20 -20
  51. package/dist/{dist-DNdhYsgW.js → dist-U4F-tbMs.js} +79 -62
  52. package/dist/{dist-RqXTaiir.js → dist-abid3KgM.js} +11 -11
  53. package/dist/dist-cdmMjgsn.js +5 -0
  54. package/dist/dist-hT4QzYX-.js +1247 -0
  55. package/dist/{dist-luvabDEB.js → dist-t9Kf7xqC.js} +2 -2
  56. package/dist/{error-banner-5bz0L9hS.js → error-banner-CJXYJ6Sb.js} +11 -6
  57. package/dist/esm-BaH2eg5-.js +1171 -0
  58. package/dist/{esm-Duie8iU-.js → esm-ga2Bf3O2.js} +43 -43
  59. package/dist/{extends-CkydH1Q5.js → extends-D_hDsj6R.js} +4 -4
  60. package/dist/files/wasm-intro.py +11 -8
  61. package/dist/{formats-DHxc-FdY.js → formats-C4wO47tk.js} +1 -1
  62. package/dist/{glide-data-editor-CgIxTzAP.js → glide-data-editor-BPkCPs7L.js} +255 -255
  63. package/dist/{html-to-image-B93KtAVY.js → html-to-image-BwfcJJxA.js} +2412 -2282
  64. package/dist/{input-_2sjvfne.js → input-OdWHkobi.js} +263 -245
  65. package/dist/{label-LWtdw5i8.js → label-CC4ytI1X.js} +1 -1
  66. package/dist/main.js +7630 -7558
  67. package/dist/{mermaid-4DMBBIKO-DIdL224_.js → mermaid-4DMBBIKO-Eg3D4FVz.js} +1 -1
  68. package/dist/{mermaid-lXOw5Py9.js → mermaid-BotvIKg9.js} +4 -4
  69. package/dist/{process-output-BOXi9fnS.js → process-output-DsloEDna.js} +3 -3
  70. package/dist/{reveal-component-gRcjQbNL.js → reveal-component-BNU1V1x5.js} +698 -620
  71. package/dist/{spec-B96zNUEA.js → spec-X7FwLJni.js} +4 -4
  72. package/dist/{strings-Bu3vlb6W.js → strings-J57tzLr3.js} +47 -46
  73. package/dist/style.css +1 -1
  74. package/dist/{toDate-x-WRDCH7.js → toDate-d8RCRrRd.js} +2 -2
  75. package/dist/{tooltip-C5FYOpQc.js → tooltip-DpcyNkQ2.js} +2 -2
  76. package/dist/{types-CVvp1fKr.js → types-ChtMFmZ2.js} +1 -1
  77. package/dist/{useAsyncData-iRgKDT5s.js → useAsyncData-PonK__yh.js} +1 -1
  78. package/dist/{useDateFormatter-BA4FCquG.js → useDateFormatter-QB-3MpYr.js} +2 -2
  79. package/dist/{useDeepCompareMemoize-CkQ57VS2.js → useDeepCompareMemoize-D3NGWke6.js} +1 -1
  80. package/dist/{useLifecycle-BBO9PIph.js → useLifecycle-00mO3OSS.js} +2 -2
  81. package/dist/{useTheme-DHIrRQOe.js → useTheme-DEhDzATN.js} +1 -1
  82. package/dist/{vega-component-Dq-SH463.js → vega-component-DGPUhbDs.js} +8 -8
  83. package/dist/{zod-CoBiJ5v4.js → zod-aLSua2NL.js} +24 -23
  84. package/package.json +4 -3
  85. package/src/__tests__/setup.ts +16 -0
  86. package/src/components/chat/chat-display.tsx +2 -2
  87. package/src/components/data-table/TableBottomBar.tsx +1 -15
  88. package/src/components/data-table/TableTopBar.tsx +8 -13
  89. package/src/components/data-table/__tests__/TableBottomBar.test.tsx +6 -12
  90. package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +227 -0
  91. package/src/components/data-table/column-visibility-dropdown.tsx +204 -0
  92. package/src/components/data-table/data-table.tsx +1 -1
  93. package/src/components/data-table/filter-by-values-picker.tsx +39 -17
  94. package/src/components/data-table/filter-pills.tsx +1 -1
  95. package/src/components/datasources/__tests__/filter-empty.test.ts +183 -0
  96. package/src/components/datasources/datasources.tsx +92 -3
  97. package/src/components/editor/cell/code/cell-editor.tsx +70 -32
  98. package/src/components/editor/cell/code/code-placeholder.css +18 -0
  99. package/src/components/editor/cell/code/code-placeholder.tsx +47 -0
  100. package/src/components/editor/cell/code/language-toggle.tsx +7 -1
  101. package/src/components/editor/chrome/wrapper/app-chrome.tsx +97 -52
  102. package/src/components/editor/chrome/wrapper/lazy-panels.ts +91 -0
  103. package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -0
  104. package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +9 -2
  105. package/src/components/editor/connections/storage/__tests__/as-code.test.ts +62 -27
  106. package/src/components/editor/connections/storage/add-storage-form.tsx +5 -1
  107. package/src/components/editor/connections/storage/as-code.ts +20 -6
  108. package/src/components/editor/documentation.css +35 -0
  109. package/src/components/editor/file-tree/file-explorer.tsx +8 -18
  110. package/src/components/editor/file-tree/tree-actions.tsx +46 -1
  111. package/src/components/editor/notebook-cell.tsx +3 -3
  112. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +20 -0
  113. package/src/components/editor/renderers/slides-layout/types.ts +1 -0
  114. package/src/components/markdown/__tests__/markdown-renderer.test.tsx +43 -0
  115. package/src/components/markdown/markdown-renderer.tsx +24 -1
  116. package/src/components/slides/__tests__/minimap-actions.test.tsx +166 -0
  117. package/src/components/slides/__tests__/reveal-component.test.ts +425 -0
  118. package/src/components/slides/minimap.tsx +127 -10
  119. package/src/components/slides/reveal-component.tsx +287 -61
  120. package/src/components/slides/slide-cell-view.tsx +26 -2
  121. package/src/components/slides/slide-form.tsx +26 -4
  122. package/src/components/storage/__tests__/storage-inspector.test.ts +180 -0
  123. package/src/components/storage/storage-inspector.tsx +535 -81
  124. package/src/components/ui/combobox.tsx +51 -32
  125. package/src/components/ui/number-field.tsx +5 -1
  126. package/src/components/ui/reorderable-list.tsx +13 -0
  127. package/src/components/ui/select-core/__tests__/use-select-list.test.ts +294 -0
  128. package/src/components/ui/select-core/__tests__/utils.test.ts +222 -0
  129. package/src/components/ui/select-core/index.ts +16 -0
  130. package/src/components/ui/select-core/option-row.tsx +33 -0
  131. package/src/components/ui/select-core/render-slot.ts +20 -0
  132. package/src/components/ui/select-core/select-list.tsx +248 -0
  133. package/src/components/ui/select-core/types.ts +44 -0
  134. package/src/components/ui/select-core/use-select-list.ts +347 -0
  135. package/src/components/ui/select-core/utils.ts +121 -0
  136. package/src/components/ui/toast.tsx +1 -0
  137. package/src/core/cells/__tests__/document-changes.test.ts +2 -2
  138. package/src/core/cells/__tests__/focus.test.ts +45 -2
  139. package/src/core/cells/focus.ts +1 -1
  140. package/src/core/cells/scrollCellIntoView.ts +4 -0
  141. package/src/core/cells/utils.ts +1 -1
  142. package/src/core/codemirror/__tests__/editor-mount-scheduler.test.ts +143 -0
  143. package/src/core/codemirror/copilot/getCodes.ts +3 -1
  144. package/src/core/codemirror/editor-mount-scheduler.ts +101 -0
  145. package/src/core/codemirror/language/languages/python.ts +2 -0
  146. package/src/core/codemirror/language/languages/sql/utils.ts +3 -1
  147. package/src/core/codemirror/lsp/__tests__/markdown-renderer.test.ts +41 -0
  148. package/src/core/codemirror/lsp/markdown-renderer.ts +59 -0
  149. package/src/core/datasets/data-source-connections.ts +2 -0
  150. package/src/core/errors/errors.ts +1 -1
  151. package/src/core/storage/__tests__/state.test.ts +49 -0
  152. package/src/core/storage/__tests__/useStorageEntries.test.tsx +199 -3
  153. package/src/core/storage/state.ts +124 -13
  154. package/src/core/storage/types.ts +6 -0
  155. package/src/core/wasm/worker/bootstrap.ts +12 -4
  156. package/src/plugins/core/__test__/registerReactComponent.test.ts +96 -0
  157. package/src/plugins/core/registerReactComponent.tsx +42 -10
  158. package/src/plugins/impl/MultiselectPlugin.tsx +19 -142
  159. package/src/plugins/impl/SearchableSelect.tsx +16 -97
  160. package/src/plugins/impl/SliderPlugin.tsx +132 -18
  161. package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +5 -2
  162. package/src/plugins/impl/__tests__/MultiSelectPlugin.test.ts +1 -1
  163. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +278 -8
  164. package/src/utils/__tests__/numbers.test.ts +20 -0
  165. package/src/utils/errors.ts +9 -0
  166. package/src/utils/lazy.ts +6 -1
  167. package/src/utils/numbers.ts +27 -0
  168. package/src/utils/schedule-task.ts +71 -0
  169. package/dist/assets/__vite-browser-external-Ci2ZQfXU.js +0 -1
  170. package/dist/assets/worker-ip3AI_sN.js +0 -73
  171. package/dist/dist-0Fif7jnk.js +0 -5
  172. package/dist/dist-B5h_9sHB.js +0 -6
  173. package/dist/dist-B9M6R5ye.js +0 -5
  174. package/dist/dist-BCt3tnck.js +0 -8
  175. package/dist/dist-BUIJwMwn.js +0 -8
  176. package/dist/dist-BpquMd3k.js +0 -5
  177. package/dist/dist-BzJsqYfz.js +0 -5
  178. package/dist/dist-CA5ELXAf.js +0 -6
  179. package/dist/dist-CLBRs6Uv.js +0 -5
  180. package/dist/dist-CStVCMbq.js +0 -5
  181. package/dist/dist-CZRIEY3Y.js +0 -8
  182. package/dist/dist-CuUHbFD0.js +0 -5
  183. package/dist/dist-DV7Iabxb.js +0 -8
  184. package/dist/dist-DhHh0jLg.js +0 -1247
  185. package/dist/dist-DuEeHMvL.js +0 -5
  186. package/dist/esm-CCuYCd3R.js +0 -1171
  187. package/src/plugins/impl/multiselectFilterFn.tsx +0 -22
  188. /package/src/components/{data-table → ui}/value-chips.tsx +0 -0
@@ -6,10 +6,10 @@ import { t as require_react } from "./react-DA-nE2FX.js";
6
6
  import { t as clsx } from "./clsx-CIWA5tNO.js";
7
7
  import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
8
8
  import { C as hastToReact, D as SKIP, E as EXIT, O as visitParents, S as find, T as CONTINUE, _ as s, a as asciiAtext, b as html$1, c as asciiHexDigit, d as markdownLineEndingOrSpace, f as markdownSpace, g as h$1, h as webNamespaces, i as asciiAlphanumeric, k as convert, l as asciiPunctuation, m as unicodeWhitespace, n as longestStreak, o as asciiControl, p as unicodePunctuation, r as asciiAlpha, s as asciiDigit, t as factorySpace, u as markdownLineEnding, v as stringify$1, w as ok, x as svg, y as stringify } from "./micromark-factory-space-DF2w36zS.js";
9
- let tt, cr, ao, xn, b, require_cjs, N;
9
+ let gn, rehypeSanitize, cr, defaultSchema, ao, tt, b, xn, N, require_cjs;
10
10
  let __tla = (async () => {
11
11
  var _a;
12
- let require_cjs$2, require_cjs$1, require_utilities;
12
+ let require_cjs$2, require_cjs$1, require_utilities, env, deserializer;
13
13
  require_cjs$2 = __commonJSMin(((e, t) => {
14
14
  var n = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, r = /\n/g, i = /^\s*/, a = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, o = /^:\s*/, l = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, dC = /^[;\s]*/, fC = /^\s+|\s+$/g, pC = "\n", mC = "/", hC = "*", gC = "", _C = "comment", vC = "declaration";
15
15
  function yC(e2, t2) {
@@ -145,124 +145,8 @@ let __tla = (async () => {
145
145
  }
146
146
  i.default = i, t.exports = i;
147
147
  }));
148
- function visit(e, t, n, r) {
149
- let i, a, o;
150
- typeof t == "function" && typeof n != "function" ? (a = void 0, o = t, i = n) : (a = t, o = n, i = r), visitParents(e, a, l, i);
151
- function l(e2, t2) {
152
- let n2 = t2[t2.length - 1], r2 = n2 ? n2.children.indexOf(e2) : void 0;
153
- return o(e2, r2, n2);
154
- }
155
- }
156
- function harden({ defaultOrigin: e = "", allowedLinkPrefixes: t = [], allowedImagePrefixes: n = [], allowDataImages: r = false, allowedProtocols: i = [], blockedImageClass: a = "inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm", blockedLinkClass: o = "text-gray-500" }) {
157
- let l = t.length && !t.every((e2) => e2 === "*"), dC = n.length && !n.every((e2) => e2 === "*");
158
- if (!e && (l || dC)) throw Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");
159
- return (l2) => {
160
- visit(l2, createVisitor(e, t, n, r, i, a, o));
161
- };
162
- }
163
- function parseUrl(e, t) {
164
- if (typeof e != "string") return null;
165
- try {
166
- return new URL(e);
167
- } catch {
168
- if (t) try {
169
- return new URL(e, t);
170
- } catch {
171
- return null;
172
- }
173
- if (e.startsWith("/") || e.startsWith("./") || e.startsWith("../")) try {
174
- return new URL(e, "http://example.com");
175
- } catch {
176
- return null;
177
- }
178
- return null;
179
- }
180
- }
181
- function isPathRelativeUrl(e) {
182
- return typeof e == "string" ? e.startsWith("/") || e.startsWith("./") || e.startsWith("../") : false;
183
- }
184
- var safeProtocols = /* @__PURE__ */ new Set([
185
- "https:",
186
- "http:",
187
- "irc:",
188
- "ircs:",
189
- "mailto:",
190
- "xmpp:",
191
- "blob:"
192
- ]), blockedProtocols = /* @__PURE__ */ new Set([
193
- "javascript:",
194
- "data:",
195
- "file:",
196
- "vbscript:"
197
- ]);
198
- function transformUrl(e, t, n, r = false, i = false, a = []) {
199
- if (!e) return null;
200
- if (typeof e == "string" && e.startsWith("#") && !i) try {
201
- if (new URL(e, "http://example.com").hash === e) return e;
202
- } catch {
203
- }
204
- if (typeof e == "string" && e.startsWith("data:")) return i && r && e.startsWith("data:image/") ? e : null;
205
- if (typeof e == "string" && e.startsWith("blob:")) {
206
- try {
207
- if (new URL(e).protocol === "blob:" && e.length > 5) {
208
- let t2 = e.substring(5);
209
- if (t2 && t2.length > 0 && t2 !== "invalid") return e;
210
- }
211
- } catch {
212
- return null;
213
- }
214
- return null;
215
- }
216
- let o = parseUrl(e, n);
217
- if (!o || blockedProtocols.has(o.protocol) || !(safeProtocols.has(o.protocol) || a.includes(o.protocol) || a.includes("*"))) return null;
218
- if (o.protocol === "mailto:" || !o.protocol.match(/^https?:$/)) return o.href;
219
- let l = isPathRelativeUrl(e);
220
- return o && t.some((e2) => {
221
- let t2 = parseUrl(e2, n);
222
- return !t2 || t2.origin !== o.origin ? false : o.href.startsWith(t2.href);
223
- }) ? l ? o.pathname + o.search + o.hash : o.href : t.includes("*") ? o.protocol !== "https:" && o.protocol !== "http:" ? null : l ? o.pathname + o.search + o.hash : o.href : null;
224
- }
225
- var SEEN = /* @__PURE__ */ Symbol("node-seen"), createVisitor = (e, t, n, r, i, a, o) => {
226
- let dC = (fC, pC, mC) => {
227
- if (fC.type !== "element" || fC[SEEN]) return true;
228
- if (fC.tagName === "a") {
229
- let n2 = transformUrl(fC.properties.href, t, e, false, false, i);
230
- return n2 === null ? (fC[SEEN] = true, visit(fC, dC), mC && typeof pC == "number" && (mC.children[pC] = {
231
- type: "element",
232
- tagName: "span",
233
- properties: {
234
- title: "Blocked URL: " + String(fC.properties.href),
235
- class: o
236
- },
237
- children: [
238
- ...fC.children,
239
- {
240
- type: "text",
241
- value: " [blocked]"
242
- }
243
- ]
244
- }), SKIP) : (fC.properties.href = n2, fC.properties.target = "_blank", fC.properties.rel = "noopener noreferrer", true);
245
- }
246
- if (fC.tagName === "img") {
247
- let t2 = transformUrl(fC.properties.src, n, e, r, true, i);
248
- return t2 === null ? (fC[SEEN] = true, visit(fC, dC), mC && typeof pC == "number" && (mC.children[pC] = {
249
- type: "element",
250
- tagName: "span",
251
- properties: {
252
- class: a
253
- },
254
- children: [
255
- {
256
- type: "text",
257
- value: "[Image blocked: " + String(fC.properties.alt || "No description") + "]"
258
- }
259
- ]
260
- }), SKIP) : (fC.properties.src = t2, true);
261
- }
262
- return true;
263
- };
264
- return dC;
265
- }, env = typeof self == "object" ? self : globalThis, deserializer = (e, t) => {
148
+ env = typeof self == "object" ? self : globalThis;
149
+ deserializer = (e, t) => {
266
150
  let n = (t2, n2) => (e.set(n2, t2), t2), r = (i) => {
267
151
  if (e.has(i)) return e.get(i);
268
152
  let [a, o] = t[i];
@@ -493,420 +377,885 @@ let __tla = (async () => {
493
377
  return serializer(!(t || n), !!t, /* @__PURE__ */ new Map(), r)(e), r;
494
378
  };
495
379
  var esm_default = typeof structuredClone == "function" ? (e, t) => t && ("json" in t || "lossy" in t) ? deserialize(serialize$1(e, t)) : structuredClone(e) : (e, t) => deserialize(serialize$1(e, t));
496
- function location(e) {
497
- let t = String(e), n = [];
498
- return {
499
- toOffset: i,
500
- toPoint: r
501
- };
502
- function r(e2) {
503
- if (typeof e2 == "number" && e2 > -1 && e2 <= t.length) {
504
- let r2 = 0;
505
- for (; ; ) {
506
- let i2 = n[r2];
507
- if (i2 === void 0) {
508
- let e3 = next(t, n[r2 - 1]);
509
- i2 = e3 === -1 ? t.length + 1 : e3 + 1, n[r2] = i2;
510
- }
511
- if (i2 > e2) return {
512
- line: r2 + 1,
513
- column: e2 - (r2 > 0 ? n[r2 - 1] : 0) + 1,
514
- offset: e2
515
- };
516
- r2++;
517
- }
518
- }
519
- }
520
- function i(e2) {
521
- if (e2 && typeof e2.line == "number" && typeof e2.column == "number" && !Number.isNaN(e2.line) && !Number.isNaN(e2.column)) {
522
- for (; n.length < e2.line; ) {
523
- let e3 = n[n.length - 1], r3 = next(t, e3), i2 = r3 === -1 ? t.length + 1 : r3 + 1;
524
- if (e3 === i2) break;
525
- n.push(i2);
526
- }
527
- let r2 = (e2.line > 1 ? n[e2.line - 2] : 0) + e2.column - 1;
528
- if (r2 < n[e2.line - 1]) return r2;
529
- }
530
- }
531
- }
532
- function next(e, t) {
533
- let n = e.indexOf("\r", t), r = e.indexOf("\n", t);
534
- return r === -1 ? n : n === -1 || n + 1 === r ? r : n < r ? n : r;
535
- }
536
- var own$8 = {}.hasOwnProperty, proto = Object.prototype;
537
- function fromParse5(e, t) {
538
- let n = t || {};
539
- return one$3({
540
- file: n.file || void 0,
541
- location: false,
542
- schema: n.space === "svg" ? svg : html$1,
543
- verbose: n.verbose || false
544
- }, e);
545
- }
546
- function one$3(e, t) {
547
- let n;
548
- switch (t.nodeName) {
549
- case "#comment": {
550
- let r = t;
551
- return n = {
552
- type: "comment",
553
- value: r.data
554
- }, patch$3(e, r, n), n;
555
- }
556
- case "#document":
557
- case "#document-fragment": {
558
- let r = t, i = "mode" in r ? r.mode === "quirks" || r.mode === "limited-quirks" : false;
559
- if (n = {
560
- type: "root",
561
- children: all$3(e, t.childNodes),
562
- data: {
563
- quirksMode: i
564
- }
565
- }, e.file && e.location) {
566
- let t2 = String(e.file), r2 = location(t2), i2 = r2.toPoint(0), a = r2.toPoint(t2.length);
567
- n.position = {
568
- start: i2,
569
- end: a
570
- };
571
- }
572
- return n;
573
- }
574
- case "#documentType": {
575
- let r = t;
576
- return n = {
577
- type: "doctype"
578
- }, patch$3(e, r, n), n;
579
- }
580
- case "#text": {
581
- let r = t;
582
- return n = {
583
- type: "text",
584
- value: r.value
585
- }, patch$3(e, r, n), n;
586
- }
587
- default:
588
- return n = element$5(e, t), n;
589
- }
590
- }
591
- function all$3(e, t) {
592
- let n = -1, r = [];
593
- for (; ++n < t.length; ) {
594
- let i = one$3(e, t[n]);
595
- r.push(i);
596
- }
597
- return r;
598
- }
599
- function element$5(e, t) {
600
- let n = e.schema;
601
- e.schema = t.namespaceURI === webNamespaces.svg ? svg : html$1;
602
- let r = -1, i = {};
603
- for (; ++r < t.attrs.length; ) {
604
- let e2 = t.attrs[r], n2 = (e2.prefix ? e2.prefix + ":" : "") + e2.name;
605
- own$8.call(proto, n2) || (i[n2] = e2.value);
606
- }
607
- let a = (e.schema.space === "svg" ? s : h$1)(t.tagName, i, all$3(e, t.childNodes));
608
- if (patch$3(e, t, a), a.tagName === "template") {
609
- let n2 = t, r2 = n2.sourceCodeLocation, i2 = r2 && r2.startTag && position$2(r2.startTag), o = r2 && r2.endTag && position$2(r2.endTag), l = one$3(e, n2.content);
610
- i2 && o && e.file && (l.position = {
611
- start: i2.end,
612
- end: o.start
613
- }), a.content = l;
380
+ const pointEnd = point$3("end"), pointStart = point$3("start");
381
+ function point$3(e) {
382
+ return t;
383
+ function t(t2) {
384
+ let n = t2 && t2.position && t2.position[e] || {};
385
+ if (typeof n.line == "number" && n.line > 0 && typeof n.column == "number" && n.column > 0) return {
386
+ line: n.line,
387
+ column: n.column,
388
+ offset: typeof n.offset == "number" && n.offset > -1 ? n.offset : void 0
389
+ };
614
390
  }
615
- return e.schema = n, a;
616
391
  }
617
- function patch$3(e, t, n) {
618
- if ("sourceCodeLocation" in t && t.sourceCodeLocation && e.file) {
619
- let r = createLocation(e, n, t.sourceCodeLocation);
620
- r && (e.location = true, n.position = r);
621
- }
392
+ function position(e) {
393
+ let t = pointStart(e), n = pointEnd(e);
394
+ if (t && n) return {
395
+ start: t,
396
+ end: n
397
+ };
622
398
  }
623
- function createLocation(e, t, n) {
624
- let r = position$2(n);
625
- if (t.type === "element") {
626
- let i = t.children[t.children.length - 1];
627
- if (r && !n.endTag && i && i.position && i.position.end && (r.end = Object.assign({}, i.position.end)), e.verbose) {
628
- let r2 = {}, i2;
629
- if (n.attrs) for (i2 in n.attrs) own$8.call(n.attrs, i2) && (r2[find(e.schema, i2).property] = position$2(n.attrs[i2]));
630
- n.startTag;
631
- let a = position$2(n.startTag), o = n.endTag ? position$2(n.endTag) : void 0, l = {
632
- opening: a
633
- };
634
- o && (l.closing = o), l.properties = r2, t.data = {
635
- position: l
636
- };
399
+ var aria$1 = [
400
+ "ariaDescribedBy",
401
+ "ariaLabel",
402
+ "ariaLabelledBy"
403
+ ];
404
+ defaultSchema = {
405
+ ancestors: {
406
+ tbody: [
407
+ "table"
408
+ ],
409
+ td: [
410
+ "table"
411
+ ],
412
+ th: [
413
+ "table"
414
+ ],
415
+ thead: [
416
+ "table"
417
+ ],
418
+ tfoot: [
419
+ "table"
420
+ ],
421
+ tr: [
422
+ "table"
423
+ ]
424
+ },
425
+ attributes: {
426
+ a: [
427
+ ...aria$1,
428
+ "dataFootnoteBackref",
429
+ "dataFootnoteRef",
430
+ [
431
+ "className",
432
+ "data-footnote-backref"
433
+ ],
434
+ "href"
435
+ ],
436
+ blockquote: [
437
+ "cite"
438
+ ],
439
+ code: [
440
+ [
441
+ "className",
442
+ /^language-./
443
+ ]
444
+ ],
445
+ del: [
446
+ "cite"
447
+ ],
448
+ div: [
449
+ "itemScope",
450
+ "itemType"
451
+ ],
452
+ dl: [
453
+ ...aria$1
454
+ ],
455
+ h2: [
456
+ [
457
+ "className",
458
+ "sr-only"
459
+ ]
460
+ ],
461
+ img: [
462
+ ...aria$1,
463
+ "longDesc",
464
+ "src"
465
+ ],
466
+ input: [
467
+ [
468
+ "disabled",
469
+ true
470
+ ],
471
+ [
472
+ "type",
473
+ "checkbox"
474
+ ]
475
+ ],
476
+ ins: [
477
+ "cite"
478
+ ],
479
+ li: [
480
+ [
481
+ "className",
482
+ "task-list-item"
483
+ ]
484
+ ],
485
+ ol: [
486
+ ...aria$1,
487
+ [
488
+ "className",
489
+ "contains-task-list"
490
+ ]
491
+ ],
492
+ q: [
493
+ "cite"
494
+ ],
495
+ section: [
496
+ "dataFootnotes",
497
+ [
498
+ "className",
499
+ "footnotes"
500
+ ]
501
+ ],
502
+ source: [
503
+ "srcSet"
504
+ ],
505
+ summary: [
506
+ ...aria$1
507
+ ],
508
+ table: [
509
+ ...aria$1
510
+ ],
511
+ ul: [
512
+ ...aria$1,
513
+ [
514
+ "className",
515
+ "contains-task-list"
516
+ ]
517
+ ],
518
+ "*": "abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width".split(".")
519
+ },
520
+ clobber: [
521
+ "ariaDescribedBy",
522
+ "ariaLabelledBy",
523
+ "id",
524
+ "name"
525
+ ],
526
+ clobberPrefix: "user-content-",
527
+ protocols: {
528
+ cite: [
529
+ "http",
530
+ "https"
531
+ ],
532
+ href: [
533
+ "http",
534
+ "https",
535
+ "irc",
536
+ "ircs",
537
+ "mailto",
538
+ "xmpp"
539
+ ],
540
+ longDesc: [
541
+ "http",
542
+ "https"
543
+ ],
544
+ src: [
545
+ "http",
546
+ "https"
547
+ ]
548
+ },
549
+ required: {
550
+ input: {
551
+ disabled: true,
552
+ type: "checkbox"
637
553
  }
638
- }
639
- return r;
640
- }
641
- function position$2(e) {
642
- let t = point$3({
643
- line: e.startLine,
644
- column: e.startCol,
645
- offset: e.startOffset
646
- }), n = point$3({
647
- line: e.endLine,
648
- column: e.endCol,
649
- offset: e.endOffset
650
- });
651
- return t || n ? {
652
- start: t,
653
- end: n
654
- } : void 0;
655
- }
656
- function point$3(e) {
657
- return e.line && e.column ? e : void 0;
658
- }
659
- var Schema = class {
660
- constructor(e, t, n) {
661
- this.property = e, this.normal = t, n && (this.space = n);
662
- }
554
+ },
555
+ strip: [
556
+ "script"
557
+ ],
558
+ tagNames: "a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var".split(".")
663
559
  };
664
- Schema.prototype.property = {}, Schema.prototype.normal = {}, Schema.prototype.space = null;
665
- function merge(e, t) {
666
- let n = {}, r = {}, i = -1;
667
- for (; ++i < e.length; ) Object.assign(n, e[i].property), Object.assign(r, e[i].normal);
668
- return new Schema(n, r, t);
669
- }
670
- function normalize$1(e) {
671
- return e.toLowerCase();
560
+ var own$8 = {}.hasOwnProperty;
561
+ function sanitize(e, t) {
562
+ let n = {
563
+ type: "root",
564
+ children: []
565
+ }, r = transform({
566
+ schema: t ? {
567
+ ...defaultSchema,
568
+ ...t
569
+ } : defaultSchema,
570
+ stack: []
571
+ }, e);
572
+ return r && (Array.isArray(r) ? r.length === 1 ? n = r[0] : n.children = r : n = r), n;
672
573
  }
673
- var Info = class {
674
- constructor(e, t) {
675
- this.property = e, this.attribute = t;
574
+ function transform(e, t) {
575
+ if (t && typeof t == "object") {
576
+ let n = t;
577
+ switch (typeof n.type == "string" ? n.type : "") {
578
+ case "comment":
579
+ return comment$2(e, n);
580
+ case "doctype":
581
+ return doctype$2(e, n);
582
+ case "element":
583
+ return element$5(e, n);
584
+ case "root":
585
+ return root$5(e, n);
586
+ case "text":
587
+ return text$8(e, n);
588
+ default:
589
+ }
676
590
  }
677
- };
678
- Info.prototype.space = null, Info.prototype.boolean = false, Info.prototype.booleanish = false, Info.prototype.overloadedBoolean = false, Info.prototype.number = false, Info.prototype.commaSeparated = false, Info.prototype.spaceSeparated = false, Info.prototype.commaOrSpaceSeparated = false, Info.prototype.mustUseProperty = false, Info.prototype.defined = false;
679
- var types_exports = __export({
680
- boolean: () => boolean,
681
- booleanish: () => booleanish,
682
- commaOrSpaceSeparated: () => commaOrSpaceSeparated,
683
- commaSeparated: () => commaSeparated,
684
- number: () => number,
685
- overloadedBoolean: () => overloadedBoolean,
686
- spaceSeparated: () => spaceSeparated
687
- }, 1), powers = 0;
688
- const boolean = increment(), booleanish = increment(), overloadedBoolean = increment(), number = increment(), spaceSeparated = increment(), commaSeparated = increment(), commaOrSpaceSeparated = increment();
689
- function increment() {
690
- return 2 ** ++powers;
691
591
  }
692
- var checks = Object.keys(types_exports), DefinedInfo = class extends Info {
693
- constructor(e, t, n, r) {
694
- let i = -1;
695
- if (super(e, t), mark(this, "space", r), typeof n == "number") for (; ++i < checks.length; ) {
696
- let e2 = checks[i];
697
- mark(this, checks[i], (n & types_exports[e2]) === types_exports[e2]);
698
- }
592
+ function comment$2(e, t) {
593
+ if (e.schema.allowComments) {
594
+ let e2 = typeof t.value == "string" ? t.value : "", n = e2.indexOf("-->"), r = {
595
+ type: "comment",
596
+ value: n < 0 ? e2 : e2.slice(0, n)
597
+ };
598
+ return patch$3(r, t), r;
699
599
  }
700
- };
701
- DefinedInfo.prototype.defined = true;
702
- function mark(e, t, n) {
703
- n && (e[t] = n);
704
600
  }
705
- var own$7 = {}.hasOwnProperty;
706
- function create(e) {
707
- let t = {}, n = {}, r;
708
- for (r in e.properties) if (own$7.call(e.properties, r)) {
709
- let i = e.properties[r], a = new DefinedInfo(r, e.transform(e.attributes || {}, r), i, e.space);
710
- e.mustUseProperty && e.mustUseProperty.includes(r) && (a.mustUseProperty = true), t[r] = a, n[normalize$1(r)] = r, n[normalize$1(a.attribute)] = r;
601
+ function doctype$2(e, t) {
602
+ if (e.schema.allowDoctypes) {
603
+ let e2 = {
604
+ type: "doctype"
605
+ };
606
+ return patch$3(e2, t), e2;
711
607
  }
712
- return new Schema(t, n, e.space);
713
608
  }
714
- const xlink = create({
715
- space: "xlink",
716
- transform(e, t) {
717
- return "xlink:" + t.slice(5).toLowerCase();
718
- },
719
- properties: {
720
- xLinkActuate: null,
721
- xLinkArcRole: null,
722
- xLinkHref: null,
723
- xLinkRole: null,
724
- xLinkShow: null,
725
- xLinkTitle: null,
726
- xLinkType: null
609
+ function element$5(e, t) {
610
+ let n = typeof t.tagName == "string" ? t.tagName : "";
611
+ e.stack.push(n);
612
+ let r = children(e, t.children), i = properties(e, t.properties);
613
+ e.stack.pop();
614
+ let a = false;
615
+ if (n && n !== "*" && (!e.schema.tagNames || e.schema.tagNames.includes(n)) && (a = true, e.schema.ancestors && own$8.call(e.schema.ancestors, n))) {
616
+ let t2 = e.schema.ancestors[n], r2 = -1;
617
+ for (a = false; ++r2 < t2.length; ) e.stack.includes(t2[r2]) && (a = true);
727
618
  }
728
- }), xml = create({
729
- space: "xml",
730
- transform(e, t) {
731
- return "xml:" + t.slice(3).toLowerCase();
732
- },
733
- properties: {
734
- xmlLang: null,
735
- xmlBase: null,
736
- xmlSpace: null
619
+ if (!a) return e.schema.strip && !e.schema.strip.includes(n) ? r : void 0;
620
+ let o = {
621
+ type: "element",
622
+ tagName: n,
623
+ properties: i,
624
+ children: r
625
+ };
626
+ return patch$3(o, t), o;
627
+ }
628
+ function root$5(e, t) {
629
+ let n = {
630
+ type: "root",
631
+ children: children(e, t.children)
632
+ };
633
+ return patch$3(n, t), n;
634
+ }
635
+ function text$8(e, t) {
636
+ let n = {
637
+ type: "text",
638
+ value: typeof t.value == "string" ? t.value : ""
639
+ };
640
+ return patch$3(n, t), n;
641
+ }
642
+ function children(e, t) {
643
+ let n = [];
644
+ if (Array.isArray(t)) {
645
+ let r = t, i = -1;
646
+ for (; ++i < r.length; ) {
647
+ let t2 = transform(e, r[i]);
648
+ t2 && (Array.isArray(t2) ? n.push(...t2) : n.push(t2));
649
+ }
737
650
  }
738
- });
739
- function caseSensitiveTransform(e, t) {
740
- return t in e ? e[t] : t;
651
+ return n;
741
652
  }
742
- function caseInsensitiveTransform(e, t) {
743
- return caseSensitiveTransform(e, t.toLowerCase());
653
+ function properties(e, t) {
654
+ let n = e.stack[e.stack.length - 1], r = e.schema.attributes, i = e.schema.required, a = r && own$8.call(r, n) ? r[n] : void 0, o = r && own$8.call(r, "*") ? r["*"] : void 0, l = t && typeof t == "object" ? t : {}, dC = {}, fC;
655
+ for (fC in l) if (own$8.call(l, fC)) {
656
+ let t2 = l[fC], n2 = propertyValue(e, findDefinition(a, fC), fC, t2);
657
+ n2 ?? (n2 = propertyValue(e, findDefinition(o, fC), fC, t2)), n2 != null && (dC[fC] = n2);
658
+ }
659
+ if (i && own$8.call(i, n)) {
660
+ let e2 = i[n];
661
+ for (fC in e2) own$8.call(e2, fC) && !own$8.call(dC, fC) && (dC[fC] = e2[fC]);
662
+ }
663
+ return dC;
744
664
  }
745
- const xmlns = create({
746
- space: "xmlns",
747
- attributes: {
748
- xmlnsxlink: "xmlns:xlink"
749
- },
750
- transform: caseInsensitiveTransform,
751
- properties: {
752
- xmlns: null,
753
- xmlnsXLink: null
665
+ function propertyValue(e, t, n, r) {
666
+ return t ? Array.isArray(r) ? propertyValueMany(e, t, n, r) : propertyValuePrimitive(e, t, n, r) : void 0;
667
+ }
668
+ function propertyValueMany(e, t, n, r) {
669
+ let i = -1, a = [];
670
+ for (; ++i < r.length; ) {
671
+ let o = propertyValuePrimitive(e, t, n, r[i]);
672
+ (typeof o == "number" || typeof o == "string") && a.push(o);
754
673
  }
755
- }), aria$1 = create({
756
- transform(e, t) {
757
- return t === "role" ? t : "aria-" + t.slice(4).toLowerCase();
758
- },
759
- properties: {
760
- ariaActiveDescendant: null,
761
- ariaAtomic: booleanish,
762
- ariaAutoComplete: null,
763
- ariaBusy: booleanish,
764
- ariaChecked: booleanish,
765
- ariaColCount: number,
766
- ariaColIndex: number,
767
- ariaColSpan: number,
768
- ariaControls: spaceSeparated,
769
- ariaCurrent: null,
770
- ariaDescribedBy: spaceSeparated,
771
- ariaDetails: null,
772
- ariaDisabled: booleanish,
773
- ariaDropEffect: spaceSeparated,
774
- ariaErrorMessage: null,
775
- ariaExpanded: booleanish,
776
- ariaFlowTo: spaceSeparated,
777
- ariaGrabbed: booleanish,
778
- ariaHasPopup: null,
779
- ariaHidden: booleanish,
780
- ariaInvalid: null,
781
- ariaKeyShortcuts: null,
782
- ariaLabel: null,
783
- ariaLabelledBy: spaceSeparated,
784
- ariaLevel: number,
785
- ariaLive: null,
786
- ariaModal: booleanish,
787
- ariaMultiLine: booleanish,
788
- ariaMultiSelectable: booleanish,
789
- ariaOrientation: null,
790
- ariaOwns: spaceSeparated,
791
- ariaPlaceholder: null,
792
- ariaPosInSet: number,
793
- ariaPressed: booleanish,
794
- ariaReadOnly: booleanish,
795
- ariaRelevant: null,
796
- ariaRequired: booleanish,
797
- ariaRoleDescription: spaceSeparated,
798
- ariaRowCount: number,
799
- ariaRowIndex: number,
800
- ariaRowSpan: number,
801
- ariaSelected: booleanish,
802
- ariaSetSize: number,
803
- ariaSort: null,
804
- ariaValueMax: number,
805
- ariaValueMin: number,
806
- ariaValueNow: number,
807
- ariaValueText: null,
808
- role: null
674
+ return a;
675
+ }
676
+ function propertyValuePrimitive(e, t, n, r) {
677
+ if (!(typeof r != "boolean" && typeof r != "number" && typeof r != "string") && safeProtocol(e, n, r)) {
678
+ if (typeof t == "object" && t.length > 1) {
679
+ let e2 = false, n2 = 0;
680
+ for (; ++n2 < t.length; ) {
681
+ let i = t[n2];
682
+ if (i && typeof i == "object" && "flags" in i) {
683
+ if (i.test(String(r))) {
684
+ e2 = true;
685
+ break;
686
+ }
687
+ } else if (i === r) {
688
+ e2 = true;
689
+ break;
690
+ }
691
+ }
692
+ if (!e2) return;
693
+ }
694
+ return e.schema.clobber && e.schema.clobberPrefix && e.schema.clobber.includes(n) ? e.schema.clobberPrefix + r : r;
809
695
  }
810
- }), html$4 = create({
811
- space: "html",
812
- attributes: {
813
- acceptcharset: "accept-charset",
814
- classname: "class",
815
- htmlfor: "for",
816
- httpequiv: "http-equiv"
817
- },
818
- transform: caseInsensitiveTransform,
819
- mustUseProperty: [
820
- "checked",
821
- "multiple",
822
- "muted",
823
- "selected"
824
- ],
825
- properties: {
826
- abbr: null,
827
- accept: commaSeparated,
828
- acceptCharset: spaceSeparated,
829
- accessKey: spaceSeparated,
830
- action: null,
831
- allow: null,
832
- allowFullScreen: boolean,
833
- allowPaymentRequest: boolean,
834
- allowUserMedia: boolean,
835
- alt: null,
836
- as: null,
837
- async: boolean,
838
- autoCapitalize: null,
839
- autoComplete: spaceSeparated,
840
- autoFocus: boolean,
841
- autoPlay: boolean,
842
- blocking: spaceSeparated,
843
- capture: null,
844
- charSet: null,
845
- checked: boolean,
846
- cite: null,
847
- className: spaceSeparated,
848
- cols: number,
849
- colSpan: null,
850
- content: null,
851
- contentEditable: booleanish,
852
- controls: boolean,
853
- controlsList: spaceSeparated,
854
- coords: number | commaSeparated,
855
- crossOrigin: null,
856
- data: null,
857
- dateTime: null,
858
- decoding: null,
859
- default: boolean,
860
- defer: boolean,
861
- dir: null,
862
- dirName: null,
863
- disabled: boolean,
864
- download: overloadedBoolean,
865
- draggable: booleanish,
866
- encType: null,
867
- enterKeyHint: null,
868
- fetchPriority: null,
869
- form: null,
870
- formAction: null,
871
- formEncType: null,
872
- formMethod: null,
873
- formNoValidate: boolean,
874
- formTarget: null,
875
- headers: spaceSeparated,
876
- height: number,
877
- hidden: boolean,
878
- high: number,
879
- href: null,
880
- hrefLang: null,
881
- htmlFor: spaceSeparated,
882
- httpEquiv: spaceSeparated,
883
- id: null,
884
- imageSizes: null,
885
- imageSrcSet: null,
886
- inert: boolean,
887
- inputMode: null,
888
- integrity: null,
889
- is: null,
890
- isMap: boolean,
891
- itemId: null,
892
- itemProp: spaceSeparated,
893
- itemRef: spaceSeparated,
894
- itemScope: boolean,
895
- itemType: spaceSeparated,
896
- kind: null,
897
- label: null,
898
- lang: null,
899
- language: null,
900
- list: null,
901
- loading: null,
902
- loop: boolean,
903
- low: number,
904
- manifest: null,
905
- max: null,
906
- maxLength: number,
907
- media: null,
908
- method: null,
909
- min: null,
696
+ }
697
+ function safeProtocol(e, t, n) {
698
+ let r = e.schema.protocols && own$8.call(e.schema.protocols, t) ? e.schema.protocols[t] : void 0;
699
+ if (!r || r.length === 0) return true;
700
+ let i = String(n), a = i.indexOf(":"), o = i.indexOf("?"), l = i.indexOf("#"), dC = i.indexOf("/");
701
+ if (a < 0 || dC > -1 && a > dC || o > -1 && a > o || l > -1 && a > l) return true;
702
+ let fC = -1;
703
+ for (; ++fC < r.length; ) {
704
+ let e2 = r[fC];
705
+ if (a === e2.length && i.slice(0, e2.length) === e2) return true;
706
+ }
707
+ return false;
708
+ }
709
+ function patch$3(e, t) {
710
+ let n = position(t);
711
+ t.data && (e.data = esm_default(t.data)), n && (e.position = n);
712
+ }
713
+ function findDefinition(e, t) {
714
+ let n, r = -1;
715
+ if (e) for (; ++r < e.length; ) {
716
+ let i = e[r], a = typeof i == "string" ? i : i[0];
717
+ if (a === t) return i;
718
+ a === "data*" && (n = i);
719
+ }
720
+ if (t.length > 4 && t.slice(0, 4).toLowerCase() === "data") return n;
721
+ }
722
+ rehypeSanitize = function(e) {
723
+ return function(t) {
724
+ return sanitize(t, e);
725
+ };
726
+ };
727
+ function visit(e, t, n, r) {
728
+ let i, a, o;
729
+ typeof t == "function" && typeof n != "function" ? (a = void 0, o = t, i = n) : (a = t, o = n, i = r), visitParents(e, a, l, i);
730
+ function l(e2, t2) {
731
+ let n2 = t2[t2.length - 1], r2 = n2 ? n2.children.indexOf(e2) : void 0;
732
+ return o(e2, r2, n2);
733
+ }
734
+ }
735
+ function harden({ defaultOrigin: e = "", allowedLinkPrefixes: t = [], allowedImagePrefixes: n = [], allowDataImages: r = false, allowedProtocols: i = [], blockedImageClass: a = "inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm", blockedLinkClass: o = "text-gray-500" }) {
736
+ let l = t.length && !t.every((e2) => e2 === "*"), dC = n.length && !n.every((e2) => e2 === "*");
737
+ if (!e && (l || dC)) throw Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");
738
+ return (l2) => {
739
+ visit(l2, createVisitor(e, t, n, r, i, a, o));
740
+ };
741
+ }
742
+ function parseUrl(e, t) {
743
+ if (typeof e != "string") return null;
744
+ try {
745
+ return new URL(e);
746
+ } catch {
747
+ if (t) try {
748
+ return new URL(e, t);
749
+ } catch {
750
+ return null;
751
+ }
752
+ if (e.startsWith("/") || e.startsWith("./") || e.startsWith("../")) try {
753
+ return new URL(e, "http://example.com");
754
+ } catch {
755
+ return null;
756
+ }
757
+ return null;
758
+ }
759
+ }
760
+ function isPathRelativeUrl(e) {
761
+ return typeof e == "string" ? e.startsWith("/") || e.startsWith("./") || e.startsWith("../") : false;
762
+ }
763
+ var safeProtocols = /* @__PURE__ */ new Set([
764
+ "https:",
765
+ "http:",
766
+ "irc:",
767
+ "ircs:",
768
+ "mailto:",
769
+ "xmpp:",
770
+ "blob:"
771
+ ]), blockedProtocols = /* @__PURE__ */ new Set([
772
+ "javascript:",
773
+ "data:",
774
+ "file:",
775
+ "vbscript:"
776
+ ]);
777
+ function transformUrl(e, t, n, r = false, i = false, a = []) {
778
+ if (!e) return null;
779
+ if (typeof e == "string" && e.startsWith("#") && !i) try {
780
+ if (new URL(e, "http://example.com").hash === e) return e;
781
+ } catch {
782
+ }
783
+ if (typeof e == "string" && e.startsWith("data:")) return i && r && e.startsWith("data:image/") ? e : null;
784
+ if (typeof e == "string" && e.startsWith("blob:")) {
785
+ try {
786
+ if (new URL(e).protocol === "blob:" && e.length > 5) {
787
+ let t2 = e.substring(5);
788
+ if (t2 && t2.length > 0 && t2 !== "invalid") return e;
789
+ }
790
+ } catch {
791
+ return null;
792
+ }
793
+ return null;
794
+ }
795
+ let o = parseUrl(e, n);
796
+ if (!o || blockedProtocols.has(o.protocol) || !(safeProtocols.has(o.protocol) || a.includes(o.protocol) || a.includes("*"))) return null;
797
+ if (o.protocol === "mailto:" || !o.protocol.match(/^https?:$/)) return o.href;
798
+ let l = isPathRelativeUrl(e);
799
+ return o && t.some((e2) => {
800
+ let t2 = parseUrl(e2, n);
801
+ return !t2 || t2.origin !== o.origin ? false : o.href.startsWith(t2.href);
802
+ }) ? l ? o.pathname + o.search + o.hash : o.href : t.includes("*") ? o.protocol !== "https:" && o.protocol !== "http:" ? null : l ? o.pathname + o.search + o.hash : o.href : null;
803
+ }
804
+ var SEEN = /* @__PURE__ */ Symbol("node-seen"), createVisitor = (e, t, n, r, i, a, o) => {
805
+ let dC = (fC, pC, mC) => {
806
+ if (fC.type !== "element" || fC[SEEN]) return true;
807
+ if (fC.tagName === "a") {
808
+ let n2 = transformUrl(fC.properties.href, t, e, false, false, i);
809
+ return n2 === null ? (fC[SEEN] = true, visit(fC, dC), mC && typeof pC == "number" && (mC.children[pC] = {
810
+ type: "element",
811
+ tagName: "span",
812
+ properties: {
813
+ title: "Blocked URL: " + String(fC.properties.href),
814
+ class: o
815
+ },
816
+ children: [
817
+ ...fC.children,
818
+ {
819
+ type: "text",
820
+ value: " [blocked]"
821
+ }
822
+ ]
823
+ }), SKIP) : (fC.properties.href = n2, fC.properties.target = "_blank", fC.properties.rel = "noopener noreferrer", true);
824
+ }
825
+ if (fC.tagName === "img") {
826
+ let t2 = transformUrl(fC.properties.src, n, e, r, true, i);
827
+ return t2 === null ? (fC[SEEN] = true, visit(fC, dC), mC && typeof pC == "number" && (mC.children[pC] = {
828
+ type: "element",
829
+ tagName: "span",
830
+ properties: {
831
+ class: a
832
+ },
833
+ children: [
834
+ {
835
+ type: "text",
836
+ value: "[Image blocked: " + String(fC.properties.alt || "No description") + "]"
837
+ }
838
+ ]
839
+ }), SKIP) : (fC.properties.src = t2, true);
840
+ }
841
+ return true;
842
+ };
843
+ return dC;
844
+ };
845
+ function location(e) {
846
+ let t = String(e), n = [];
847
+ return {
848
+ toOffset: i,
849
+ toPoint: r
850
+ };
851
+ function r(e2) {
852
+ if (typeof e2 == "number" && e2 > -1 && e2 <= t.length) {
853
+ let r2 = 0;
854
+ for (; ; ) {
855
+ let i2 = n[r2];
856
+ if (i2 === void 0) {
857
+ let e3 = next(t, n[r2 - 1]);
858
+ i2 = e3 === -1 ? t.length + 1 : e3 + 1, n[r2] = i2;
859
+ }
860
+ if (i2 > e2) return {
861
+ line: r2 + 1,
862
+ column: e2 - (r2 > 0 ? n[r2 - 1] : 0) + 1,
863
+ offset: e2
864
+ };
865
+ r2++;
866
+ }
867
+ }
868
+ }
869
+ function i(e2) {
870
+ if (e2 && typeof e2.line == "number" && typeof e2.column == "number" && !Number.isNaN(e2.line) && !Number.isNaN(e2.column)) {
871
+ for (; n.length < e2.line; ) {
872
+ let e3 = n[n.length - 1], r3 = next(t, e3), i2 = r3 === -1 ? t.length + 1 : r3 + 1;
873
+ if (e3 === i2) break;
874
+ n.push(i2);
875
+ }
876
+ let r2 = (e2.line > 1 ? n[e2.line - 2] : 0) + e2.column - 1;
877
+ if (r2 < n[e2.line - 1]) return r2;
878
+ }
879
+ }
880
+ }
881
+ function next(e, t) {
882
+ let n = e.indexOf("\r", t), r = e.indexOf("\n", t);
883
+ return r === -1 ? n : n === -1 || n + 1 === r ? r : n < r ? n : r;
884
+ }
885
+ var own$7 = {}.hasOwnProperty, proto = Object.prototype;
886
+ function fromParse5(e, t) {
887
+ let n = t || {};
888
+ return one$3({
889
+ file: n.file || void 0,
890
+ location: false,
891
+ schema: n.space === "svg" ? svg : html$1,
892
+ verbose: n.verbose || false
893
+ }, e);
894
+ }
895
+ function one$3(e, t) {
896
+ let n;
897
+ switch (t.nodeName) {
898
+ case "#comment": {
899
+ let r = t;
900
+ return n = {
901
+ type: "comment",
902
+ value: r.data
903
+ }, patch$2(e, r, n), n;
904
+ }
905
+ case "#document":
906
+ case "#document-fragment": {
907
+ let r = t, i = "mode" in r ? r.mode === "quirks" || r.mode === "limited-quirks" : false;
908
+ if (n = {
909
+ type: "root",
910
+ children: all$3(e, t.childNodes),
911
+ data: {
912
+ quirksMode: i
913
+ }
914
+ }, e.file && e.location) {
915
+ let t2 = String(e.file), r2 = location(t2), i2 = r2.toPoint(0), a = r2.toPoint(t2.length);
916
+ n.position = {
917
+ start: i2,
918
+ end: a
919
+ };
920
+ }
921
+ return n;
922
+ }
923
+ case "#documentType": {
924
+ let r = t;
925
+ return n = {
926
+ type: "doctype"
927
+ }, patch$2(e, r, n), n;
928
+ }
929
+ case "#text": {
930
+ let r = t;
931
+ return n = {
932
+ type: "text",
933
+ value: r.value
934
+ }, patch$2(e, r, n), n;
935
+ }
936
+ default:
937
+ return n = element$4(e, t), n;
938
+ }
939
+ }
940
+ function all$3(e, t) {
941
+ let n = -1, r = [];
942
+ for (; ++n < t.length; ) {
943
+ let i = one$3(e, t[n]);
944
+ r.push(i);
945
+ }
946
+ return r;
947
+ }
948
+ function element$4(e, t) {
949
+ let n = e.schema;
950
+ e.schema = t.namespaceURI === webNamespaces.svg ? svg : html$1;
951
+ let r = -1, i = {};
952
+ for (; ++r < t.attrs.length; ) {
953
+ let e2 = t.attrs[r], n2 = (e2.prefix ? e2.prefix + ":" : "") + e2.name;
954
+ own$7.call(proto, n2) || (i[n2] = e2.value);
955
+ }
956
+ let a = (e.schema.space === "svg" ? s : h$1)(t.tagName, i, all$3(e, t.childNodes));
957
+ if (patch$2(e, t, a), a.tagName === "template") {
958
+ let n2 = t, r2 = n2.sourceCodeLocation, i2 = r2 && r2.startTag && position$2(r2.startTag), o = r2 && r2.endTag && position$2(r2.endTag), l = one$3(e, n2.content);
959
+ i2 && o && e.file && (l.position = {
960
+ start: i2.end,
961
+ end: o.start
962
+ }), a.content = l;
963
+ }
964
+ return e.schema = n, a;
965
+ }
966
+ function patch$2(e, t, n) {
967
+ if ("sourceCodeLocation" in t && t.sourceCodeLocation && e.file) {
968
+ let r = createLocation(e, n, t.sourceCodeLocation);
969
+ r && (e.location = true, n.position = r);
970
+ }
971
+ }
972
+ function createLocation(e, t, n) {
973
+ let r = position$2(n);
974
+ if (t.type === "element") {
975
+ let i = t.children[t.children.length - 1];
976
+ if (r && !n.endTag && i && i.position && i.position.end && (r.end = Object.assign({}, i.position.end)), e.verbose) {
977
+ let r2 = {}, i2;
978
+ if (n.attrs) for (i2 in n.attrs) own$7.call(n.attrs, i2) && (r2[find(e.schema, i2).property] = position$2(n.attrs[i2]));
979
+ n.startTag;
980
+ let a = position$2(n.startTag), o = n.endTag ? position$2(n.endTag) : void 0, l = {
981
+ opening: a
982
+ };
983
+ o && (l.closing = o), l.properties = r2, t.data = {
984
+ position: l
985
+ };
986
+ }
987
+ }
988
+ return r;
989
+ }
990
+ function position$2(e) {
991
+ let t = point$2({
992
+ line: e.startLine,
993
+ column: e.startCol,
994
+ offset: e.startOffset
995
+ }), n = point$2({
996
+ line: e.endLine,
997
+ column: e.endCol,
998
+ offset: e.endOffset
999
+ });
1000
+ return t || n ? {
1001
+ start: t,
1002
+ end: n
1003
+ } : void 0;
1004
+ }
1005
+ function point$2(e) {
1006
+ return e.line && e.column ? e : void 0;
1007
+ }
1008
+ var Schema = class {
1009
+ constructor(e, t, n) {
1010
+ this.property = e, this.normal = t, n && (this.space = n);
1011
+ }
1012
+ };
1013
+ Schema.prototype.property = {}, Schema.prototype.normal = {}, Schema.prototype.space = null;
1014
+ function merge(e, t) {
1015
+ let n = {}, r = {}, i = -1;
1016
+ for (; ++i < e.length; ) Object.assign(n, e[i].property), Object.assign(r, e[i].normal);
1017
+ return new Schema(n, r, t);
1018
+ }
1019
+ function normalize$1(e) {
1020
+ return e.toLowerCase();
1021
+ }
1022
+ var Info = class {
1023
+ constructor(e, t) {
1024
+ this.property = e, this.attribute = t;
1025
+ }
1026
+ };
1027
+ Info.prototype.space = null, Info.prototype.boolean = false, Info.prototype.booleanish = false, Info.prototype.overloadedBoolean = false, Info.prototype.number = false, Info.prototype.commaSeparated = false, Info.prototype.spaceSeparated = false, Info.prototype.commaOrSpaceSeparated = false, Info.prototype.mustUseProperty = false, Info.prototype.defined = false;
1028
+ var types_exports = __export({
1029
+ boolean: () => boolean,
1030
+ booleanish: () => booleanish,
1031
+ commaOrSpaceSeparated: () => commaOrSpaceSeparated,
1032
+ commaSeparated: () => commaSeparated,
1033
+ number: () => number,
1034
+ overloadedBoolean: () => overloadedBoolean,
1035
+ spaceSeparated: () => spaceSeparated
1036
+ }, 1), powers = 0;
1037
+ const boolean = increment(), booleanish = increment(), overloadedBoolean = increment(), number = increment(), spaceSeparated = increment(), commaSeparated = increment(), commaOrSpaceSeparated = increment();
1038
+ function increment() {
1039
+ return 2 ** ++powers;
1040
+ }
1041
+ var checks = Object.keys(types_exports), DefinedInfo = class extends Info {
1042
+ constructor(e, t, n, r) {
1043
+ let i = -1;
1044
+ if (super(e, t), mark(this, "space", r), typeof n == "number") for (; ++i < checks.length; ) {
1045
+ let e2 = checks[i];
1046
+ mark(this, checks[i], (n & types_exports[e2]) === types_exports[e2]);
1047
+ }
1048
+ }
1049
+ };
1050
+ DefinedInfo.prototype.defined = true;
1051
+ function mark(e, t, n) {
1052
+ n && (e[t] = n);
1053
+ }
1054
+ var own$6 = {}.hasOwnProperty;
1055
+ function create(e) {
1056
+ let t = {}, n = {}, r;
1057
+ for (r in e.properties) if (own$6.call(e.properties, r)) {
1058
+ let i = e.properties[r], a = new DefinedInfo(r, e.transform(e.attributes || {}, r), i, e.space);
1059
+ e.mustUseProperty && e.mustUseProperty.includes(r) && (a.mustUseProperty = true), t[r] = a, n[normalize$1(r)] = r, n[normalize$1(a.attribute)] = r;
1060
+ }
1061
+ return new Schema(t, n, e.space);
1062
+ }
1063
+ const xlink = create({
1064
+ space: "xlink",
1065
+ transform(e, t) {
1066
+ return "xlink:" + t.slice(5).toLowerCase();
1067
+ },
1068
+ properties: {
1069
+ xLinkActuate: null,
1070
+ xLinkArcRole: null,
1071
+ xLinkHref: null,
1072
+ xLinkRole: null,
1073
+ xLinkShow: null,
1074
+ xLinkTitle: null,
1075
+ xLinkType: null
1076
+ }
1077
+ }), xml = create({
1078
+ space: "xml",
1079
+ transform(e, t) {
1080
+ return "xml:" + t.slice(3).toLowerCase();
1081
+ },
1082
+ properties: {
1083
+ xmlLang: null,
1084
+ xmlBase: null,
1085
+ xmlSpace: null
1086
+ }
1087
+ });
1088
+ function caseSensitiveTransform(e, t) {
1089
+ return t in e ? e[t] : t;
1090
+ }
1091
+ function caseInsensitiveTransform(e, t) {
1092
+ return caseSensitiveTransform(e, t.toLowerCase());
1093
+ }
1094
+ const xmlns = create({
1095
+ space: "xmlns",
1096
+ attributes: {
1097
+ xmlnsxlink: "xmlns:xlink"
1098
+ },
1099
+ transform: caseInsensitiveTransform,
1100
+ properties: {
1101
+ xmlns: null,
1102
+ xmlnsXLink: null
1103
+ }
1104
+ }), aria = create({
1105
+ transform(e, t) {
1106
+ return t === "role" ? t : "aria-" + t.slice(4).toLowerCase();
1107
+ },
1108
+ properties: {
1109
+ ariaActiveDescendant: null,
1110
+ ariaAtomic: booleanish,
1111
+ ariaAutoComplete: null,
1112
+ ariaBusy: booleanish,
1113
+ ariaChecked: booleanish,
1114
+ ariaColCount: number,
1115
+ ariaColIndex: number,
1116
+ ariaColSpan: number,
1117
+ ariaControls: spaceSeparated,
1118
+ ariaCurrent: null,
1119
+ ariaDescribedBy: spaceSeparated,
1120
+ ariaDetails: null,
1121
+ ariaDisabled: booleanish,
1122
+ ariaDropEffect: spaceSeparated,
1123
+ ariaErrorMessage: null,
1124
+ ariaExpanded: booleanish,
1125
+ ariaFlowTo: spaceSeparated,
1126
+ ariaGrabbed: booleanish,
1127
+ ariaHasPopup: null,
1128
+ ariaHidden: booleanish,
1129
+ ariaInvalid: null,
1130
+ ariaKeyShortcuts: null,
1131
+ ariaLabel: null,
1132
+ ariaLabelledBy: spaceSeparated,
1133
+ ariaLevel: number,
1134
+ ariaLive: null,
1135
+ ariaModal: booleanish,
1136
+ ariaMultiLine: booleanish,
1137
+ ariaMultiSelectable: booleanish,
1138
+ ariaOrientation: null,
1139
+ ariaOwns: spaceSeparated,
1140
+ ariaPlaceholder: null,
1141
+ ariaPosInSet: number,
1142
+ ariaPressed: booleanish,
1143
+ ariaReadOnly: booleanish,
1144
+ ariaRelevant: null,
1145
+ ariaRequired: booleanish,
1146
+ ariaRoleDescription: spaceSeparated,
1147
+ ariaRowCount: number,
1148
+ ariaRowIndex: number,
1149
+ ariaRowSpan: number,
1150
+ ariaSelected: booleanish,
1151
+ ariaSetSize: number,
1152
+ ariaSort: null,
1153
+ ariaValueMax: number,
1154
+ ariaValueMin: number,
1155
+ ariaValueNow: number,
1156
+ ariaValueText: null,
1157
+ role: null
1158
+ }
1159
+ }), html$4 = create({
1160
+ space: "html",
1161
+ attributes: {
1162
+ acceptcharset: "accept-charset",
1163
+ classname: "class",
1164
+ htmlfor: "for",
1165
+ httpequiv: "http-equiv"
1166
+ },
1167
+ transform: caseInsensitiveTransform,
1168
+ mustUseProperty: [
1169
+ "checked",
1170
+ "multiple",
1171
+ "muted",
1172
+ "selected"
1173
+ ],
1174
+ properties: {
1175
+ abbr: null,
1176
+ accept: commaSeparated,
1177
+ acceptCharset: spaceSeparated,
1178
+ accessKey: spaceSeparated,
1179
+ action: null,
1180
+ allow: null,
1181
+ allowFullScreen: boolean,
1182
+ allowPaymentRequest: boolean,
1183
+ allowUserMedia: boolean,
1184
+ alt: null,
1185
+ as: null,
1186
+ async: boolean,
1187
+ autoCapitalize: null,
1188
+ autoComplete: spaceSeparated,
1189
+ autoFocus: boolean,
1190
+ autoPlay: boolean,
1191
+ blocking: spaceSeparated,
1192
+ capture: null,
1193
+ charSet: null,
1194
+ checked: boolean,
1195
+ cite: null,
1196
+ className: spaceSeparated,
1197
+ cols: number,
1198
+ colSpan: null,
1199
+ content: null,
1200
+ contentEditable: booleanish,
1201
+ controls: boolean,
1202
+ controlsList: spaceSeparated,
1203
+ coords: number | commaSeparated,
1204
+ crossOrigin: null,
1205
+ data: null,
1206
+ dateTime: null,
1207
+ decoding: null,
1208
+ default: boolean,
1209
+ defer: boolean,
1210
+ dir: null,
1211
+ dirName: null,
1212
+ disabled: boolean,
1213
+ download: overloadedBoolean,
1214
+ draggable: booleanish,
1215
+ encType: null,
1216
+ enterKeyHint: null,
1217
+ fetchPriority: null,
1218
+ form: null,
1219
+ formAction: null,
1220
+ formEncType: null,
1221
+ formMethod: null,
1222
+ formNoValidate: boolean,
1223
+ formTarget: null,
1224
+ headers: spaceSeparated,
1225
+ height: number,
1226
+ hidden: boolean,
1227
+ high: number,
1228
+ href: null,
1229
+ hrefLang: null,
1230
+ htmlFor: spaceSeparated,
1231
+ httpEquiv: spaceSeparated,
1232
+ id: null,
1233
+ imageSizes: null,
1234
+ imageSrcSet: null,
1235
+ inert: boolean,
1236
+ inputMode: null,
1237
+ integrity: null,
1238
+ is: null,
1239
+ isMap: boolean,
1240
+ itemId: null,
1241
+ itemProp: spaceSeparated,
1242
+ itemRef: spaceSeparated,
1243
+ itemScope: boolean,
1244
+ itemType: spaceSeparated,
1245
+ kind: null,
1246
+ label: null,
1247
+ lang: null,
1248
+ language: null,
1249
+ list: null,
1250
+ loading: null,
1251
+ loop: boolean,
1252
+ low: number,
1253
+ manifest: null,
1254
+ max: null,
1255
+ maxLength: number,
1256
+ media: null,
1257
+ method: null,
1258
+ min: null,
910
1259
  minLength: number,
911
1260
  multiple: boolean,
912
1261
  muted: boolean,
@@ -1701,57 +2050,57 @@ let __tla = (async () => {
1701
2050
  xml,
1702
2051
  xlink,
1703
2052
  xmlns,
1704
- aria$1,
2053
+ aria,
1705
2054
  html$4
1706
2055
  ], "html"), svg$1 = merge([
1707
2056
  xml,
1708
2057
  xlink,
1709
2058
  xmlns,
1710
- aria$1,
2059
+ aria,
1711
2060
  svg$2
1712
2061
  ], "svg");
1713
- var own$6 = {}.hasOwnProperty;
2062
+ var own$5 = {}.hasOwnProperty;
1714
2063
  function zwitch(e, t) {
1715
2064
  let n = t || {};
1716
2065
  function r(t2, ...n2) {
1717
2066
  let i = r.invalid, a = r.handlers;
1718
- if (t2 && own$6.call(t2, e)) {
2067
+ if (t2 && own$5.call(t2, e)) {
1719
2068
  let n3 = String(t2[e]);
1720
- i = own$6.call(a, n3) ? a[n3] : r.unknown;
2069
+ i = own$5.call(a, n3) ? a[n3] : r.unknown;
1721
2070
  }
1722
2071
  if (i) return i.call(this, t2, ...n2);
1723
2072
  }
1724
2073
  return r.handlers = n.handlers || {}, r.invalid = n.invalid, r.unknown = n.unknown, r;
1725
2074
  }
1726
- var emptyOptions$4 = {}, own$5 = {}.hasOwnProperty, one$2 = zwitch("type", {
2075
+ var emptyOptions$4 = {}, own$4 = {}.hasOwnProperty, one$2 = zwitch("type", {
1727
2076
  handlers: {
1728
- root: root$5,
1729
- element: element$4,
1730
- text: text$8,
1731
- comment: comment$2,
1732
- doctype: doctype$2
2077
+ root: root$4,
2078
+ element: element$3,
2079
+ text: text$7,
2080
+ comment: comment$1,
2081
+ doctype: doctype$1
1733
2082
  }
1734
2083
  });
1735
2084
  function toParse5(e, t) {
1736
2085
  let n = (t || emptyOptions$4).space;
1737
2086
  return one$2(e, n === "svg" ? svg$1 : html$3);
1738
2087
  }
1739
- function root$5(e, t) {
2088
+ function root$4(e, t) {
1740
2089
  let n = {
1741
2090
  nodeName: "#document",
1742
2091
  mode: (e.data || {}).quirksMode ? "quirks" : "no-quirks",
1743
2092
  childNodes: []
1744
2093
  };
1745
- return n.childNodes = all$2(e.children, n, t), patch$2(e, n), n;
2094
+ return n.childNodes = all$2(e.children, n, t), patch$1(e, n), n;
1746
2095
  }
1747
2096
  function fragment(e, t) {
1748
2097
  let n = {
1749
2098
  nodeName: "#document-fragment",
1750
2099
  childNodes: []
1751
2100
  };
1752
- return n.childNodes = all$2(e.children, n, t), patch$2(e, n), n;
2101
+ return n.childNodes = all$2(e.children, n, t), patch$1(e, n), n;
1753
2102
  }
1754
- function doctype$2(e) {
2103
+ function doctype$1(e) {
1755
2104
  let t = {
1756
2105
  nodeName: "#documentType",
1757
2106
  name: "html",
@@ -1759,30 +2108,30 @@ let __tla = (async () => {
1759
2108
  systemId: "",
1760
2109
  parentNode: null
1761
2110
  };
1762
- return patch$2(e, t), t;
2111
+ return patch$1(e, t), t;
1763
2112
  }
1764
- function text$8(e) {
2113
+ function text$7(e) {
1765
2114
  let t = {
1766
2115
  nodeName: "#text",
1767
2116
  value: e.value,
1768
2117
  parentNode: null
1769
2118
  };
1770
- return patch$2(e, t), t;
2119
+ return patch$1(e, t), t;
1771
2120
  }
1772
- function comment$2(e) {
2121
+ function comment$1(e) {
1773
2122
  let t = {
1774
2123
  nodeName: "#comment",
1775
2124
  data: e.value,
1776
2125
  parentNode: null
1777
2126
  };
1778
- return patch$2(e, t), t;
2127
+ return patch$1(e, t), t;
1779
2128
  }
1780
- function element$4(e, t) {
2129
+ function element$3(e, t) {
1781
2130
  let n = t, r = n;
1782
2131
  e.type === "element" && e.tagName.toLowerCase() === "svg" && n.space === "html" && (r = svg$1);
1783
2132
  let i = [], a;
1784
2133
  if (e.properties) {
1785
- for (a in e.properties) if (a !== "children" && own$5.call(e.properties, a)) {
2134
+ for (a in e.properties) if (a !== "children" && own$4.call(e.properties, a)) {
1786
2135
  let t2 = createProperty$1(r, a, e.properties[a]);
1787
2136
  t2 && i.push(t2);
1788
2137
  }
@@ -1795,7 +2144,7 @@ let __tla = (async () => {
1795
2144
  childNodes: [],
1796
2145
  parentNode: null
1797
2146
  };
1798
- return l.childNodes = all$2(e.children, l, r), patch$2(e, l), e.tagName === "template" && e.content && (l.content = fragment(e.content, r)), l;
2147
+ return l.childNodes = all$2(e.children, l, r), patch$1(e, l), e.tagName === "template" && e.content && (l.content = fragment(e.content, r)), l;
1799
2148
  }
1800
2149
  function createProperty$1(e, t, n) {
1801
2150
  let r = find$1(e, t);
@@ -1819,7 +2168,7 @@ let __tla = (async () => {
1819
2168
  }
1820
2169
  return i;
1821
2170
  }
1822
- function patch$2(e, t) {
2171
+ function patch$1(e, t) {
1823
2172
  let n = e.position;
1824
2173
  n && n.start && n.end && (n.start.offset, n.end.offset, t.sourceCodeLocation = {
1825
2174
  startLine: n.start.line,
@@ -6889,728 +7238,381 @@ let __tla = (async () => {
6889
7238
  e.openElements.hasInSelectScope(TAG_ID.SELECT) && (e.openElements.popUntilTagNamePopped(TAG_ID.SELECT), e._resetInsertionMode());
6890
7239
  break;
6891
7240
  case TAG_ID.TEMPLATE:
6892
- templateEndTagInHead(e, t);
6893
- break;
6894
- default:
6895
- }
6896
- }
6897
- function startTagInSelectInTable(e, t) {
6898
- let n = t.tagID;
6899
- n === TAG_ID.CAPTION || n === TAG_ID.TABLE || n === TAG_ID.TBODY || n === TAG_ID.TFOOT || n === TAG_ID.THEAD || n === TAG_ID.TR || n === TAG_ID.TD || n === TAG_ID.TH ? (e.openElements.popUntilTagNamePopped(TAG_ID.SELECT), e._resetInsertionMode(), e._processStartTag(t)) : startTagInSelect(e, t);
6900
- }
6901
- function endTagInSelectInTable(e, t) {
6902
- let n = t.tagID;
6903
- n === TAG_ID.CAPTION || n === TAG_ID.TABLE || n === TAG_ID.TBODY || n === TAG_ID.TFOOT || n === TAG_ID.THEAD || n === TAG_ID.TR || n === TAG_ID.TD || n === TAG_ID.TH ? e.openElements.hasInTableScope(n) && (e.openElements.popUntilTagNamePopped(TAG_ID.SELECT), e._resetInsertionMode(), e.onEndTag(t)) : endTagInSelect(e, t);
6904
- }
6905
- function startTagInTemplate(e, t) {
6906
- switch (t.tagID) {
6907
- case TAG_ID.BASE:
6908
- case TAG_ID.BASEFONT:
6909
- case TAG_ID.BGSOUND:
6910
- case TAG_ID.LINK:
6911
- case TAG_ID.META:
6912
- case TAG_ID.NOFRAMES:
6913
- case TAG_ID.SCRIPT:
6914
- case TAG_ID.STYLE:
6915
- case TAG_ID.TEMPLATE:
6916
- case TAG_ID.TITLE:
6917
- startTagInHead(e, t);
6918
- break;
6919
- case TAG_ID.CAPTION:
6920
- case TAG_ID.COLGROUP:
6921
- case TAG_ID.TBODY:
6922
- case TAG_ID.TFOOT:
6923
- case TAG_ID.THEAD:
6924
- e.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE, e.insertionMode = InsertionMode.IN_TABLE, startTagInTable(e, t);
6925
- break;
6926
- case TAG_ID.COL:
6927
- e.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP, e.insertionMode = InsertionMode.IN_COLUMN_GROUP, startTagInColumnGroup(e, t);
6928
- break;
6929
- case TAG_ID.TR:
6930
- e.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY, e.insertionMode = InsertionMode.IN_TABLE_BODY, startTagInTableBody(e, t);
6931
- break;
6932
- case TAG_ID.TD:
6933
- case TAG_ID.TH:
6934
- e.tmplInsertionModeStack[0] = InsertionMode.IN_ROW, e.insertionMode = InsertionMode.IN_ROW, startTagInRow(e, t);
6935
- break;
6936
- default:
6937
- e.tmplInsertionModeStack[0] = InsertionMode.IN_BODY, e.insertionMode = InsertionMode.IN_BODY, startTagInBody(e, t);
6938
- }
6939
- }
6940
- function endTagInTemplate(e, t) {
6941
- t.tagID === TAG_ID.TEMPLATE && templateEndTagInHead(e, t);
6942
- }
6943
- function eofInTemplate(e, t) {
6944
- e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : stopParsing(e, t);
6945
- }
6946
- function startTagAfterBody(e, t) {
6947
- t.tagID === TAG_ID.HTML ? startTagInBody(e, t) : tokenAfterBody(e, t);
6948
- }
6949
- function endTagAfterBody(e, t) {
6950
- var _a2;
6951
- if (t.tagID === TAG_ID.HTML) {
6952
- if (e.fragmentContext || (e.insertionMode = InsertionMode.AFTER_AFTER_BODY), e.options.sourceCodeLocationInfo && e.openElements.tagIDs[0] === TAG_ID.HTML) {
6953
- e._setEndLocation(e.openElements.items[0], t);
6954
- let n = e.openElements.items[1];
6955
- n && !((_a2 = e.treeAdapter.getNodeSourceCodeLocation(n)) == null ? void 0 : _a2.endTag) && e._setEndLocation(n, t);
6956
- }
6957
- } else tokenAfterBody(e, t);
6958
- }
6959
- function tokenAfterBody(e, t) {
6960
- e.insertionMode = InsertionMode.IN_BODY, modeInBody(e, t);
6961
- }
6962
- function startTagInFrameset(e, t) {
6963
- switch (t.tagID) {
6964
- case TAG_ID.HTML:
6965
- startTagInBody(e, t);
6966
- break;
6967
- case TAG_ID.FRAMESET:
6968
- e._insertElement(t, NS.HTML);
6969
- break;
6970
- case TAG_ID.FRAME:
6971
- e._appendElement(t, NS.HTML), t.ackSelfClosing = true;
6972
- break;
6973
- case TAG_ID.NOFRAMES:
6974
- startTagInHead(e, t);
6975
- break;
6976
- default:
6977
- }
6978
- }
6979
- function endTagInFrameset(e, t) {
6980
- t.tagID === TAG_ID.FRAMESET && !e.openElements.isRootHtmlElementCurrent() && (e.openElements.pop(), !e.fragmentContext && e.openElements.currentTagId !== TAG_ID.FRAMESET && (e.insertionMode = InsertionMode.AFTER_FRAMESET));
6981
- }
6982
- function startTagAfterFrameset(e, t) {
6983
- switch (t.tagID) {
6984
- case TAG_ID.HTML:
6985
- startTagInBody(e, t);
6986
- break;
6987
- case TAG_ID.NOFRAMES:
6988
- startTagInHead(e, t);
6989
- break;
6990
- default:
6991
- }
6992
- }
6993
- function endTagAfterFrameset(e, t) {
6994
- t.tagID === TAG_ID.HTML && (e.insertionMode = InsertionMode.AFTER_AFTER_FRAMESET);
6995
- }
6996
- function startTagAfterAfterBody(e, t) {
6997
- t.tagID === TAG_ID.HTML ? startTagInBody(e, t) : tokenAfterAfterBody(e, t);
6998
- }
6999
- function tokenAfterAfterBody(e, t) {
7000
- e.insertionMode = InsertionMode.IN_BODY, modeInBody(e, t);
7001
- }
7002
- function startTagAfterAfterFrameset(e, t) {
7003
- switch (t.tagID) {
7004
- case TAG_ID.HTML:
7005
- startTagInBody(e, t);
7006
- break;
7007
- case TAG_ID.NOFRAMES:
7008
- startTagInHead(e, t);
7009
- break;
7010
- default:
7011
- }
7012
- }
7013
- function nullCharacterInForeignContent(e, t) {
7014
- t.chars = "\uFFFD", e._insertCharacters(t);
7015
- }
7016
- function characterInForeignContent(e, t) {
7017
- e._insertCharacters(t), e.framesetOk = false;
7018
- }
7019
- function popUntilHtmlOrIntegrationPoint(e) {
7020
- for (; e.treeAdapter.getNamespaceURI(e.openElements.current) !== NS.HTML && e.openElements.currentTagId !== void 0 && !e._isIntegrationPoint(e.openElements.currentTagId, e.openElements.current); ) e.openElements.pop();
7021
- }
7022
- function startTagInForeignContent(e, t) {
7023
- if (causesExit(t)) popUntilHtmlOrIntegrationPoint(e), e._startTagOutsideForeignContent(t);
7024
- else {
7025
- let n = e._getAdjustedCurrentElement(), r = e.treeAdapter.getNamespaceURI(n);
7026
- r === NS.MATHML ? adjustTokenMathMLAttrs(t) : r === NS.SVG && (adjustTokenSVGTagName(t), adjustTokenSVGAttrs(t)), adjustTokenXMLAttrs(t), t.selfClosing ? e._appendElement(t, r) : e._insertElement(t, r), t.ackSelfClosing = true;
7027
- }
7028
- }
7029
- function endTagInForeignContent(e, t) {
7030
- if (t.tagID === TAG_ID.P || t.tagID === TAG_ID.BR) {
7031
- popUntilHtmlOrIntegrationPoint(e), e._endTagOutsideForeignContent(t);
7032
- return;
7033
- }
7034
- for (let n = e.openElements.stackTop; n > 0; n--) {
7035
- let r = e.openElements.items[n];
7036
- if (e.treeAdapter.getNamespaceURI(r) === NS.HTML) {
7037
- e._endTagOutsideForeignContent(t);
7038
- break;
7039
- }
7040
- let i = e.treeAdapter.getTagName(r);
7041
- if (i.toLowerCase() === t.tagName) {
7042
- t.tagName = i, e.openElements.shortenToLength(n);
7043
- break;
7044
- }
7045
- }
7046
- }
7047
- /* @__PURE__ */ new Set([
7048
- TAG_NAMES.AREA,
7049
- TAG_NAMES.BASE,
7050
- TAG_NAMES.BASEFONT,
7051
- TAG_NAMES.BGSOUND,
7052
- TAG_NAMES.BR,
7053
- TAG_NAMES.COL,
7054
- TAG_NAMES.EMBED,
7055
- TAG_NAMES.FRAME,
7056
- TAG_NAMES.HR,
7057
- TAG_NAMES.IMG,
7058
- TAG_NAMES.INPUT,
7059
- TAG_NAMES.KEYGEN,
7060
- TAG_NAMES.LINK,
7061
- TAG_NAMES.META,
7062
- TAG_NAMES.PARAM,
7063
- TAG_NAMES.SOURCE,
7064
- TAG_NAMES.TRACK,
7065
- TAG_NAMES.WBR
7066
- ]);
7067
- const pointEnd = point$2("end"), pointStart = point$2("start");
7068
- function point$2(e) {
7069
- return t;
7070
- function t(t2) {
7071
- let n = t2 && t2.position && t2.position[e] || {};
7072
- if (typeof n.line == "number" && n.line > 0 && typeof n.column == "number" && n.column > 0) return {
7073
- line: n.line,
7074
- column: n.column,
7075
- offset: typeof n.offset == "number" && n.offset > -1 ? n.offset : void 0
7076
- };
7077
- }
7078
- }
7079
- function position(e) {
7080
- let t = pointStart(e), n = pointEnd(e);
7081
- if (t && n) return {
7082
- start: t,
7083
- end: n
7084
- };
7241
+ templateEndTagInHead(e, t);
7242
+ break;
7243
+ default:
7244
+ }
7085
7245
  }
7086
- var gfmTagfilterExpression = /<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi, knownMdxNames = /* @__PURE__ */ new Set([
7087
- "mdxFlowExpression",
7088
- "mdxJsxFlowElement",
7089
- "mdxJsxTextElement",
7090
- "mdxTextExpression",
7091
- "mdxjsEsm"
7092
- ]), parseOptions = {
7093
- sourceCodeLocationInfo: true,
7094
- scriptingEnabled: false
7095
- };
7096
- function raw(e, t) {
7097
- let n = documentMode(e), r = zwitch("type", {
7098
- handlers: {
7099
- root: root$4,
7100
- element: element$3,
7101
- text: text$7,
7102
- comment: comment$1,
7103
- doctype: doctype$1,
7104
- raw: handleRaw
7105
- },
7106
- unknown
7107
- }), i = {
7108
- parser: n ? new Parser(parseOptions) : Parser.getFragmentParser(void 0, parseOptions),
7109
- handle(e2) {
7110
- r(e2, i);
7111
- },
7112
- stitches: false,
7113
- options: t || {}
7114
- };
7115
- r(e, i), resetTokenizer(i, pointStart());
7116
- let a = fromParse5(n ? i.parser.document : i.parser.getFragment(), {
7117
- file: i.options.file
7118
- });
7119
- return i.stitches && visit(a, "comment", function(e2, t2, n2) {
7120
- let r2 = e2;
7121
- if (r2.value.stitch && n2 && t2 !== void 0) {
7122
- let e3 = n2.children;
7123
- return e3[t2] = r2.value.stitch, t2;
7124
- }
7125
- }), a.type === "root" && a.children.length === 1 && a.children[0].type === e.type ? a.children[0] : a;
7246
+ function startTagInSelectInTable(e, t) {
7247
+ let n = t.tagID;
7248
+ n === TAG_ID.CAPTION || n === TAG_ID.TABLE || n === TAG_ID.TBODY || n === TAG_ID.TFOOT || n === TAG_ID.THEAD || n === TAG_ID.TR || n === TAG_ID.TD || n === TAG_ID.TH ? (e.openElements.popUntilTagNamePopped(TAG_ID.SELECT), e._resetInsertionMode(), e._processStartTag(t)) : startTagInSelect(e, t);
7126
7249
  }
7127
- function all$1(e, t) {
7128
- let n = -1;
7129
- if (e) for (; ++n < e.length; ) t.handle(e[n]);
7250
+ function endTagInSelectInTable(e, t) {
7251
+ let n = t.tagID;
7252
+ n === TAG_ID.CAPTION || n === TAG_ID.TABLE || n === TAG_ID.TBODY || n === TAG_ID.TFOOT || n === TAG_ID.THEAD || n === TAG_ID.TR || n === TAG_ID.TD || n === TAG_ID.TH ? e.openElements.hasInTableScope(n) && (e.openElements.popUntilTagNamePopped(TAG_ID.SELECT), e._resetInsertionMode(), e.onEndTag(t)) : endTagInSelect(e, t);
7130
7253
  }
7131
- function root$4(e, t) {
7132
- all$1(e.children, t);
7254
+ function startTagInTemplate(e, t) {
7255
+ switch (t.tagID) {
7256
+ case TAG_ID.BASE:
7257
+ case TAG_ID.BASEFONT:
7258
+ case TAG_ID.BGSOUND:
7259
+ case TAG_ID.LINK:
7260
+ case TAG_ID.META:
7261
+ case TAG_ID.NOFRAMES:
7262
+ case TAG_ID.SCRIPT:
7263
+ case TAG_ID.STYLE:
7264
+ case TAG_ID.TEMPLATE:
7265
+ case TAG_ID.TITLE:
7266
+ startTagInHead(e, t);
7267
+ break;
7268
+ case TAG_ID.CAPTION:
7269
+ case TAG_ID.COLGROUP:
7270
+ case TAG_ID.TBODY:
7271
+ case TAG_ID.TFOOT:
7272
+ case TAG_ID.THEAD:
7273
+ e.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE, e.insertionMode = InsertionMode.IN_TABLE, startTagInTable(e, t);
7274
+ break;
7275
+ case TAG_ID.COL:
7276
+ e.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP, e.insertionMode = InsertionMode.IN_COLUMN_GROUP, startTagInColumnGroup(e, t);
7277
+ break;
7278
+ case TAG_ID.TR:
7279
+ e.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY, e.insertionMode = InsertionMode.IN_TABLE_BODY, startTagInTableBody(e, t);
7280
+ break;
7281
+ case TAG_ID.TD:
7282
+ case TAG_ID.TH:
7283
+ e.tmplInsertionModeStack[0] = InsertionMode.IN_ROW, e.insertionMode = InsertionMode.IN_ROW, startTagInRow(e, t);
7284
+ break;
7285
+ default:
7286
+ e.tmplInsertionModeStack[0] = InsertionMode.IN_BODY, e.insertionMode = InsertionMode.IN_BODY, startTagInBody(e, t);
7287
+ }
7133
7288
  }
7134
- function element$3(e, t) {
7135
- startTag(e, t), all$1(e.children, t), endTag(e, t);
7289
+ function endTagInTemplate(e, t) {
7290
+ t.tagID === TAG_ID.TEMPLATE && templateEndTagInHead(e, t);
7136
7291
  }
7137
- function text$7(e, t) {
7138
- t.parser.tokenizer.state > 4 && (t.parser.tokenizer.state = 0);
7139
- let n = {
7140
- type: TokenType.CHARACTER,
7141
- chars: e.value,
7142
- location: createParse5Location(e)
7143
- };
7144
- resetTokenizer(t, pointStart(e)), t.parser.currentToken = n, t.parser._processToken(t.parser.currentToken);
7292
+ function eofInTemplate(e, t) {
7293
+ e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : stopParsing(e, t);
7145
7294
  }
7146
- function doctype$1(e, t) {
7147
- let n = {
7148
- type: TokenType.DOCTYPE,
7149
- name: "html",
7150
- forceQuirks: false,
7151
- publicId: "",
7152
- systemId: "",
7153
- location: createParse5Location(e)
7154
- };
7155
- resetTokenizer(t, pointStart(e)), t.parser.currentToken = n, t.parser._processToken(t.parser.currentToken);
7295
+ function startTagAfterBody(e, t) {
7296
+ t.tagID === TAG_ID.HTML ? startTagInBody(e, t) : tokenAfterBody(e, t);
7156
7297
  }
7157
- function stitch(e, t) {
7158
- t.stitches = true;
7159
- let n = cloneWithoutChildren(e);
7160
- "children" in e && "children" in n && (n.children = raw({
7161
- type: "root",
7162
- children: e.children
7163
- }, t.options).children), comment$1({
7164
- type: "comment",
7165
- value: {
7166
- stitch: n
7298
+ function endTagAfterBody(e, t) {
7299
+ var _a2;
7300
+ if (t.tagID === TAG_ID.HTML) {
7301
+ if (e.fragmentContext || (e.insertionMode = InsertionMode.AFTER_AFTER_BODY), e.options.sourceCodeLocationInfo && e.openElements.tagIDs[0] === TAG_ID.HTML) {
7302
+ e._setEndLocation(e.openElements.items[0], t);
7303
+ let n = e.openElements.items[1];
7304
+ n && !((_a2 = e.treeAdapter.getNodeSourceCodeLocation(n)) == null ? void 0 : _a2.endTag) && e._setEndLocation(n, t);
7167
7305
  }
7168
- }, t);
7169
- }
7170
- function comment$1(e, t) {
7171
- let n = e.value, r = {
7172
- type: TokenType.COMMENT,
7173
- data: n,
7174
- location: createParse5Location(e)
7175
- };
7176
- resetTokenizer(t, pointStart(e)), t.parser.currentToken = r, t.parser._processToken(t.parser.currentToken);
7306
+ } else tokenAfterBody(e, t);
7177
7307
  }
7178
- function handleRaw(e, t) {
7179
- if (t.parser.tokenizer.preprocessor.html = "", t.parser.tokenizer.preprocessor.pos = -1, t.parser.tokenizer.preprocessor.lastGapPos = -2, t.parser.tokenizer.preprocessor.gapStack = [], t.parser.tokenizer.preprocessor.skipNextNewLine = false, t.parser.tokenizer.preprocessor.lastChunkWritten = false, t.parser.tokenizer.preprocessor.endOfChunkHit = false, t.parser.tokenizer.preprocessor.isEol = false, setPoint(t, pointStart(e)), t.parser.tokenizer.write(t.options.tagfilter ? e.value.replace(gfmTagfilterExpression, "&lt;$1$2") : e.value, false), t.parser.tokenizer._runParsingLoop(), t.parser.tokenizer.state === 72 || t.parser.tokenizer.state === 78) {
7180
- t.parser.tokenizer.preprocessor.lastChunkWritten = true;
7181
- let e2 = t.parser.tokenizer._consume();
7182
- t.parser.tokenizer._callState(e2);
7183
- }
7308
+ function tokenAfterBody(e, t) {
7309
+ e.insertionMode = InsertionMode.IN_BODY, modeInBody(e, t);
7184
7310
  }
7185
- function unknown(e, t) {
7186
- let n = e;
7187
- if (t.options.passThrough && t.options.passThrough.includes(n.type)) stitch(n, t);
7188
- else {
7189
- let e2 = "";
7190
- throw knownMdxNames.has(n.type) && (e2 = ". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"), Error("Cannot compile `" + n.type + "` node" + e2);
7311
+ function startTagInFrameset(e, t) {
7312
+ switch (t.tagID) {
7313
+ case TAG_ID.HTML:
7314
+ startTagInBody(e, t);
7315
+ break;
7316
+ case TAG_ID.FRAMESET:
7317
+ e._insertElement(t, NS.HTML);
7318
+ break;
7319
+ case TAG_ID.FRAME:
7320
+ e._appendElement(t, NS.HTML), t.ackSelfClosing = true;
7321
+ break;
7322
+ case TAG_ID.NOFRAMES:
7323
+ startTagInHead(e, t);
7324
+ break;
7325
+ default:
7191
7326
  }
7192
7327
  }
7193
- function resetTokenizer(e, t) {
7194
- setPoint(e, t);
7195
- let n = e.parser.tokenizer.currentCharacterToken;
7196
- n && n.location && (n.location.endLine = e.parser.tokenizer.preprocessor.line, n.location.endCol = e.parser.tokenizer.preprocessor.col + 1, n.location.endOffset = e.parser.tokenizer.preprocessor.offset + 1, e.parser.currentToken = n, e.parser._processToken(e.parser.currentToken)), e.parser.tokenizer.paused = false, e.parser.tokenizer.inLoop = false, e.parser.tokenizer.active = false, e.parser.tokenizer.returnState = TokenizerMode.DATA, e.parser.tokenizer.charRefCode = -1, e.parser.tokenizer.consumedAfterSnapshot = -1, e.parser.tokenizer.currentLocation = null, e.parser.tokenizer.currentCharacterToken = null, e.parser.tokenizer.currentToken = null, e.parser.tokenizer.currentAttr = {
7197
- name: "",
7198
- value: ""
7199
- };
7328
+ function endTagInFrameset(e, t) {
7329
+ t.tagID === TAG_ID.FRAMESET && !e.openElements.isRootHtmlElementCurrent() && (e.openElements.pop(), !e.fragmentContext && e.openElements.currentTagId !== TAG_ID.FRAMESET && (e.insertionMode = InsertionMode.AFTER_FRAMESET));
7200
7330
  }
7201
- function setPoint(e, t) {
7202
- if (t && t.offset !== void 0) {
7203
- let n = {
7204
- startLine: t.line,
7205
- startCol: t.column,
7206
- startOffset: t.offset,
7207
- endLine: -1,
7208
- endCol: -1,
7209
- endOffset: -1
7210
- };
7211
- e.parser.tokenizer.preprocessor.lineStartPos = -t.column + 1, e.parser.tokenizer.preprocessor.droppedBufferSize = t.offset, e.parser.tokenizer.preprocessor.line = t.line, e.parser.tokenizer.currentLocation = n;
7331
+ function startTagAfterFrameset(e, t) {
7332
+ switch (t.tagID) {
7333
+ case TAG_ID.HTML:
7334
+ startTagInBody(e, t);
7335
+ break;
7336
+ case TAG_ID.NOFRAMES:
7337
+ startTagInHead(e, t);
7338
+ break;
7339
+ default:
7212
7340
  }
7213
7341
  }
7214
- function startTag(e, t) {
7215
- let n = e.tagName.toLowerCase();
7216
- if (t.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return;
7217
- resetTokenizer(t, pointStart(e));
7218
- let r = t.parser.openElements.current, i = "namespaceURI" in r ? r.namespaceURI : webNamespaces.html;
7219
- i === webNamespaces.html && n === "svg" && (i = webNamespaces.svg);
7220
- let a = toParse5({
7221
- ...e,
7222
- children: []
7223
- }, {
7224
- space: i === webNamespaces.svg ? "svg" : "html"
7225
- }), o = {
7226
- type: TokenType.START_TAG,
7227
- tagName: n,
7228
- tagID: getTagID(n),
7229
- selfClosing: false,
7230
- ackSelfClosing: false,
7231
- attrs: "attrs" in a ? a.attrs : [],
7232
- location: createParse5Location(e)
7233
- };
7234
- t.parser.currentToken = o, t.parser._processToken(t.parser.currentToken), t.parser.tokenizer.lastStartTagName = n;
7342
+ function endTagAfterFrameset(e, t) {
7343
+ t.tagID === TAG_ID.HTML && (e.insertionMode = InsertionMode.AFTER_AFTER_FRAMESET);
7235
7344
  }
7236
- function endTag(e, t) {
7237
- let n = e.tagName.toLowerCase();
7238
- if (!t.parser.tokenizer.inForeignNode && htmlVoidElements.includes(n) || t.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return;
7239
- resetTokenizer(t, pointEnd(e));
7240
- let r = {
7241
- type: TokenType.END_TAG,
7242
- tagName: n,
7243
- tagID: getTagID(n),
7244
- selfClosing: false,
7245
- ackSelfClosing: false,
7246
- attrs: [],
7247
- location: createParse5Location(e)
7248
- };
7249
- t.parser.currentToken = r, t.parser._processToken(t.parser.currentToken), n === t.parser.tokenizer.lastStartTagName && (t.parser.tokenizer.state === TokenizerMode.RCDATA || t.parser.tokenizer.state === TokenizerMode.RAWTEXT || t.parser.tokenizer.state === TokenizerMode.SCRIPT_DATA) && (t.parser.tokenizer.state = TokenizerMode.DATA);
7345
+ function startTagAfterAfterBody(e, t) {
7346
+ t.tagID === TAG_ID.HTML ? startTagInBody(e, t) : tokenAfterAfterBody(e, t);
7250
7347
  }
7251
- function documentMode(e) {
7252
- let t = e.type === "root" ? e.children[0] : e;
7253
- return !!(t && (t.type === "doctype" || t.type === "element" && t.tagName.toLowerCase() === "html"));
7348
+ function tokenAfterAfterBody(e, t) {
7349
+ e.insertionMode = InsertionMode.IN_BODY, modeInBody(e, t);
7254
7350
  }
7255
- function createParse5Location(e) {
7256
- let t = pointStart(e) || {
7257
- line: void 0,
7258
- column: void 0,
7259
- offset: void 0
7260
- }, n = pointEnd(e) || {
7261
- line: void 0,
7262
- column: void 0,
7263
- offset: void 0
7264
- };
7265
- return {
7266
- startLine: t.line,
7267
- startCol: t.column,
7268
- startOffset: t.offset,
7269
- endLine: n.line,
7270
- endCol: n.column,
7271
- endOffset: n.offset
7272
- };
7351
+ function startTagAfterAfterFrameset(e, t) {
7352
+ switch (t.tagID) {
7353
+ case TAG_ID.HTML:
7354
+ startTagInBody(e, t);
7355
+ break;
7356
+ case TAG_ID.NOFRAMES:
7357
+ startTagInHead(e, t);
7358
+ break;
7359
+ default:
7360
+ }
7273
7361
  }
7274
- function cloneWithoutChildren(e) {
7275
- return "children" in e ? esm_default({
7276
- ...e,
7277
- children: []
7278
- }) : esm_default(e);
7362
+ function nullCharacterInForeignContent(e, t) {
7363
+ t.chars = "\uFFFD", e._insertCharacters(t);
7279
7364
  }
7280
- function rehypeRaw(e) {
7281
- return function(t, n) {
7282
- return raw(t, {
7283
- ...e,
7284
- file: n
7285
- });
7286
- };
7365
+ function characterInForeignContent(e, t) {
7366
+ e._insertCharacters(t), e.framesetOk = false;
7287
7367
  }
7288
- var aria = [
7289
- "ariaDescribedBy",
7290
- "ariaLabel",
7291
- "ariaLabelledBy"
7292
- ];
7293
- const defaultSchema = {
7294
- ancestors: {
7295
- tbody: [
7296
- "table"
7297
- ],
7298
- td: [
7299
- "table"
7300
- ],
7301
- th: [
7302
- "table"
7303
- ],
7304
- thead: [
7305
- "table"
7306
- ],
7307
- tfoot: [
7308
- "table"
7309
- ],
7310
- tr: [
7311
- "table"
7312
- ]
7313
- },
7314
- attributes: {
7315
- a: [
7316
- ...aria,
7317
- "dataFootnoteBackref",
7318
- "dataFootnoteRef",
7319
- [
7320
- "className",
7321
- "data-footnote-backref"
7322
- ],
7323
- "href"
7324
- ],
7325
- blockquote: [
7326
- "cite"
7327
- ],
7328
- code: [
7329
- [
7330
- "className",
7331
- /^language-./
7332
- ]
7333
- ],
7334
- del: [
7335
- "cite"
7336
- ],
7337
- div: [
7338
- "itemScope",
7339
- "itemType"
7340
- ],
7341
- dl: [
7342
- ...aria
7343
- ],
7344
- h2: [
7345
- [
7346
- "className",
7347
- "sr-only"
7348
- ]
7349
- ],
7350
- img: [
7351
- ...aria,
7352
- "longDesc",
7353
- "src"
7354
- ],
7355
- input: [
7356
- [
7357
- "disabled",
7358
- true
7359
- ],
7360
- [
7361
- "type",
7362
- "checkbox"
7363
- ]
7364
- ],
7365
- ins: [
7366
- "cite"
7367
- ],
7368
- li: [
7369
- [
7370
- "className",
7371
- "task-list-item"
7372
- ]
7373
- ],
7374
- ol: [
7375
- ...aria,
7376
- [
7377
- "className",
7378
- "contains-task-list"
7379
- ]
7380
- ],
7381
- q: [
7382
- "cite"
7383
- ],
7384
- section: [
7385
- "dataFootnotes",
7386
- [
7387
- "className",
7388
- "footnotes"
7389
- ]
7390
- ],
7391
- source: [
7392
- "srcSet"
7393
- ],
7394
- summary: [
7395
- ...aria
7396
- ],
7397
- table: [
7398
- ...aria
7399
- ],
7400
- ul: [
7401
- ...aria,
7402
- [
7403
- "className",
7404
- "contains-task-list"
7405
- ]
7406
- ],
7407
- "*": "abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width".split(".")
7408
- },
7409
- clobber: [
7410
- "ariaDescribedBy",
7411
- "ariaLabelledBy",
7412
- "id",
7413
- "name"
7414
- ],
7415
- clobberPrefix: "user-content-",
7416
- protocols: {
7417
- cite: [
7418
- "http",
7419
- "https"
7420
- ],
7421
- href: [
7422
- "http",
7423
- "https",
7424
- "irc",
7425
- "ircs",
7426
- "mailto",
7427
- "xmpp"
7428
- ],
7429
- longDesc: [
7430
- "http",
7431
- "https"
7432
- ],
7433
- src: [
7434
- "http",
7435
- "https"
7436
- ]
7437
- },
7438
- required: {
7439
- input: {
7440
- disabled: true,
7441
- type: "checkbox"
7368
+ function popUntilHtmlOrIntegrationPoint(e) {
7369
+ for (; e.treeAdapter.getNamespaceURI(e.openElements.current) !== NS.HTML && e.openElements.currentTagId !== void 0 && !e._isIntegrationPoint(e.openElements.currentTagId, e.openElements.current); ) e.openElements.pop();
7370
+ }
7371
+ function startTagInForeignContent(e, t) {
7372
+ if (causesExit(t)) popUntilHtmlOrIntegrationPoint(e), e._startTagOutsideForeignContent(t);
7373
+ else {
7374
+ let n = e._getAdjustedCurrentElement(), r = e.treeAdapter.getNamespaceURI(n);
7375
+ r === NS.MATHML ? adjustTokenMathMLAttrs(t) : r === NS.SVG && (adjustTokenSVGTagName(t), adjustTokenSVGAttrs(t)), adjustTokenXMLAttrs(t), t.selfClosing ? e._appendElement(t, r) : e._insertElement(t, r), t.ackSelfClosing = true;
7376
+ }
7377
+ }
7378
+ function endTagInForeignContent(e, t) {
7379
+ if (t.tagID === TAG_ID.P || t.tagID === TAG_ID.BR) {
7380
+ popUntilHtmlOrIntegrationPoint(e), e._endTagOutsideForeignContent(t);
7381
+ return;
7382
+ }
7383
+ for (let n = e.openElements.stackTop; n > 0; n--) {
7384
+ let r = e.openElements.items[n];
7385
+ if (e.treeAdapter.getNamespaceURI(r) === NS.HTML) {
7386
+ e._endTagOutsideForeignContent(t);
7387
+ break;
7442
7388
  }
7443
- },
7444
- strip: [
7445
- "script"
7446
- ],
7447
- tagNames: "a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var".split(".")
7448
- };
7449
- var own$4 = {}.hasOwnProperty;
7450
- function sanitize(e, t) {
7451
- let n = {
7452
- type: "root",
7453
- children: []
7454
- }, r = transform({
7455
- schema: t ? {
7456
- ...defaultSchema,
7457
- ...t
7458
- } : defaultSchema,
7459
- stack: []
7460
- }, e);
7461
- return r && (Array.isArray(r) ? r.length === 1 ? n = r[0] : n.children = r : n = r), n;
7389
+ let i = e.treeAdapter.getTagName(r);
7390
+ if (i.toLowerCase() === t.tagName) {
7391
+ t.tagName = i, e.openElements.shortenToLength(n);
7392
+ break;
7393
+ }
7394
+ }
7462
7395
  }
7463
- function transform(e, t) {
7464
- if (t && typeof t == "object") {
7465
- let n = t;
7466
- switch (typeof n.type == "string" ? n.type : "") {
7467
- case "comment":
7468
- return comment(e, n);
7469
- case "doctype":
7470
- return doctype(e, n);
7471
- case "element":
7472
- return element$2(e, n);
7473
- case "root":
7474
- return root$3(e, n);
7475
- case "text":
7476
- return text$6(e, n);
7477
- default:
7396
+ /* @__PURE__ */ new Set([
7397
+ TAG_NAMES.AREA,
7398
+ TAG_NAMES.BASE,
7399
+ TAG_NAMES.BASEFONT,
7400
+ TAG_NAMES.BGSOUND,
7401
+ TAG_NAMES.BR,
7402
+ TAG_NAMES.COL,
7403
+ TAG_NAMES.EMBED,
7404
+ TAG_NAMES.FRAME,
7405
+ TAG_NAMES.HR,
7406
+ TAG_NAMES.IMG,
7407
+ TAG_NAMES.INPUT,
7408
+ TAG_NAMES.KEYGEN,
7409
+ TAG_NAMES.LINK,
7410
+ TAG_NAMES.META,
7411
+ TAG_NAMES.PARAM,
7412
+ TAG_NAMES.SOURCE,
7413
+ TAG_NAMES.TRACK,
7414
+ TAG_NAMES.WBR
7415
+ ]);
7416
+ var gfmTagfilterExpression = /<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi, knownMdxNames = /* @__PURE__ */ new Set([
7417
+ "mdxFlowExpression",
7418
+ "mdxJsxFlowElement",
7419
+ "mdxJsxTextElement",
7420
+ "mdxTextExpression",
7421
+ "mdxjsEsm"
7422
+ ]), parseOptions = {
7423
+ sourceCodeLocationInfo: true,
7424
+ scriptingEnabled: false
7425
+ };
7426
+ function raw(e, t) {
7427
+ let n = documentMode(e), r = zwitch("type", {
7428
+ handlers: {
7429
+ root: root$3,
7430
+ element: element$2,
7431
+ text: text$6,
7432
+ comment,
7433
+ doctype,
7434
+ raw: handleRaw
7435
+ },
7436
+ unknown
7437
+ }), i = {
7438
+ parser: n ? new Parser(parseOptions) : Parser.getFragmentParser(void 0, parseOptions),
7439
+ handle(e2) {
7440
+ r(e2, i);
7441
+ },
7442
+ stitches: false,
7443
+ options: t || {}
7444
+ };
7445
+ r(e, i), resetTokenizer(i, pointStart());
7446
+ let a = fromParse5(n ? i.parser.document : i.parser.getFragment(), {
7447
+ file: i.options.file
7448
+ });
7449
+ return i.stitches && visit(a, "comment", function(e2, t2, n2) {
7450
+ let r2 = e2;
7451
+ if (r2.value.stitch && n2 && t2 !== void 0) {
7452
+ let e3 = n2.children;
7453
+ return e3[t2] = r2.value.stitch, t2;
7478
7454
  }
7479
- }
7455
+ }), a.type === "root" && a.children.length === 1 && a.children[0].type === e.type ? a.children[0] : a;
7480
7456
  }
7481
- function comment(e, t) {
7482
- if (e.schema.allowComments) {
7483
- let e2 = typeof t.value == "string" ? t.value : "", n = e2.indexOf("-->"), r = {
7484
- type: "comment",
7485
- value: n < 0 ? e2 : e2.slice(0, n)
7486
- };
7487
- return patch$1(r, t), r;
7488
- }
7457
+ function all$1(e, t) {
7458
+ let n = -1;
7459
+ if (e) for (; ++n < e.length; ) t.handle(e[n]);
7489
7460
  }
7490
- function doctype(e, t) {
7491
- if (e.schema.allowDoctypes) {
7492
- let e2 = {
7493
- type: "doctype"
7494
- };
7495
- return patch$1(e2, t), e2;
7496
- }
7461
+ function root$3(e, t) {
7462
+ all$1(e.children, t);
7497
7463
  }
7498
7464
  function element$2(e, t) {
7499
- let n = typeof t.tagName == "string" ? t.tagName : "";
7500
- e.stack.push(n);
7501
- let r = children(e, t.children), i = properties(e, t.properties);
7502
- e.stack.pop();
7503
- let a = false;
7504
- if (n && n !== "*" && (!e.schema.tagNames || e.schema.tagNames.includes(n)) && (a = true, e.schema.ancestors && own$4.call(e.schema.ancestors, n))) {
7505
- let t2 = e.schema.ancestors[n], r2 = -1;
7506
- for (a = false; ++r2 < t2.length; ) e.stack.includes(t2[r2]) && (a = true);
7507
- }
7508
- if (!a) return e.schema.strip && !e.schema.strip.includes(n) ? r : void 0;
7509
- let o = {
7510
- type: "element",
7511
- tagName: n,
7512
- properties: i,
7513
- children: r
7514
- };
7515
- return patch$1(o, t), o;
7465
+ startTag(e, t), all$1(e.children, t), endTag(e, t);
7516
7466
  }
7517
- function root$3(e, t) {
7467
+ function text$6(e, t) {
7468
+ t.parser.tokenizer.state > 4 && (t.parser.tokenizer.state = 0);
7518
7469
  let n = {
7519
- type: "root",
7520
- children: children(e, t.children)
7470
+ type: TokenType.CHARACTER,
7471
+ chars: e.value,
7472
+ location: createParse5Location(e)
7521
7473
  };
7522
- return patch$1(n, t), n;
7474
+ resetTokenizer(t, pointStart(e)), t.parser.currentToken = n, t.parser._processToken(t.parser.currentToken);
7523
7475
  }
7524
- function text$6(e, t) {
7476
+ function doctype(e, t) {
7525
7477
  let n = {
7526
- type: "text",
7527
- value: typeof t.value == "string" ? t.value : ""
7478
+ type: TokenType.DOCTYPE,
7479
+ name: "html",
7480
+ forceQuirks: false,
7481
+ publicId: "",
7482
+ systemId: "",
7483
+ location: createParse5Location(e)
7528
7484
  };
7529
- return patch$1(n, t), n;
7485
+ resetTokenizer(t, pointStart(e)), t.parser.currentToken = n, t.parser._processToken(t.parser.currentToken);
7530
7486
  }
7531
- function children(e, t) {
7532
- let n = [];
7533
- if (Array.isArray(t)) {
7534
- let r = t, i = -1;
7535
- for (; ++i < r.length; ) {
7536
- let t2 = transform(e, r[i]);
7537
- t2 && (Array.isArray(t2) ? n.push(...t2) : n.push(t2));
7487
+ function stitch(e, t) {
7488
+ t.stitches = true;
7489
+ let n = cloneWithoutChildren(e);
7490
+ "children" in e && "children" in n && (n.children = raw({
7491
+ type: "root",
7492
+ children: e.children
7493
+ }, t.options).children), comment({
7494
+ type: "comment",
7495
+ value: {
7496
+ stitch: n
7538
7497
  }
7539
- }
7540
- return n;
7498
+ }, t);
7541
7499
  }
7542
- function properties(e, t) {
7543
- let n = e.stack[e.stack.length - 1], r = e.schema.attributes, i = e.schema.required, a = r && own$4.call(r, n) ? r[n] : void 0, o = r && own$4.call(r, "*") ? r["*"] : void 0, l = t && typeof t == "object" ? t : {}, dC = {}, fC;
7544
- for (fC in l) if (own$4.call(l, fC)) {
7545
- let t2 = l[fC], n2 = propertyValue(e, findDefinition(a, fC), fC, t2);
7546
- n2 ?? (n2 = propertyValue(e, findDefinition(o, fC), fC, t2)), n2 != null && (dC[fC] = n2);
7500
+ function comment(e, t) {
7501
+ let n = e.value, r = {
7502
+ type: TokenType.COMMENT,
7503
+ data: n,
7504
+ location: createParse5Location(e)
7505
+ };
7506
+ resetTokenizer(t, pointStart(e)), t.parser.currentToken = r, t.parser._processToken(t.parser.currentToken);
7507
+ }
7508
+ function handleRaw(e, t) {
7509
+ if (t.parser.tokenizer.preprocessor.html = "", t.parser.tokenizer.preprocessor.pos = -1, t.parser.tokenizer.preprocessor.lastGapPos = -2, t.parser.tokenizer.preprocessor.gapStack = [], t.parser.tokenizer.preprocessor.skipNextNewLine = false, t.parser.tokenizer.preprocessor.lastChunkWritten = false, t.parser.tokenizer.preprocessor.endOfChunkHit = false, t.parser.tokenizer.preprocessor.isEol = false, setPoint(t, pointStart(e)), t.parser.tokenizer.write(t.options.tagfilter ? e.value.replace(gfmTagfilterExpression, "&lt;$1$2") : e.value, false), t.parser.tokenizer._runParsingLoop(), t.parser.tokenizer.state === 72 || t.parser.tokenizer.state === 78) {
7510
+ t.parser.tokenizer.preprocessor.lastChunkWritten = true;
7511
+ let e2 = t.parser.tokenizer._consume();
7512
+ t.parser.tokenizer._callState(e2);
7547
7513
  }
7548
- if (i && own$4.call(i, n)) {
7549
- let e2 = i[n];
7550
- for (fC in e2) own$4.call(e2, fC) && !own$4.call(dC, fC) && (dC[fC] = e2[fC]);
7514
+ }
7515
+ function unknown(e, t) {
7516
+ let n = e;
7517
+ if (t.options.passThrough && t.options.passThrough.includes(n.type)) stitch(n, t);
7518
+ else {
7519
+ let e2 = "";
7520
+ throw knownMdxNames.has(n.type) && (e2 = ". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"), Error("Cannot compile `" + n.type + "` node" + e2);
7551
7521
  }
7552
- return dC;
7553
7522
  }
7554
- function propertyValue(e, t, n, r) {
7555
- return t ? Array.isArray(r) ? propertyValueMany(e, t, n, r) : propertyValuePrimitive(e, t, n, r) : void 0;
7523
+ function resetTokenizer(e, t) {
7524
+ setPoint(e, t);
7525
+ let n = e.parser.tokenizer.currentCharacterToken;
7526
+ n && n.location && (n.location.endLine = e.parser.tokenizer.preprocessor.line, n.location.endCol = e.parser.tokenizer.preprocessor.col + 1, n.location.endOffset = e.parser.tokenizer.preprocessor.offset + 1, e.parser.currentToken = n, e.parser._processToken(e.parser.currentToken)), e.parser.tokenizer.paused = false, e.parser.tokenizer.inLoop = false, e.parser.tokenizer.active = false, e.parser.tokenizer.returnState = TokenizerMode.DATA, e.parser.tokenizer.charRefCode = -1, e.parser.tokenizer.consumedAfterSnapshot = -1, e.parser.tokenizer.currentLocation = null, e.parser.tokenizer.currentCharacterToken = null, e.parser.tokenizer.currentToken = null, e.parser.tokenizer.currentAttr = {
7527
+ name: "",
7528
+ value: ""
7529
+ };
7556
7530
  }
7557
- function propertyValueMany(e, t, n, r) {
7558
- let i = -1, a = [];
7559
- for (; ++i < r.length; ) {
7560
- let o = propertyValuePrimitive(e, t, n, r[i]);
7561
- (typeof o == "number" || typeof o == "string") && a.push(o);
7531
+ function setPoint(e, t) {
7532
+ if (t && t.offset !== void 0) {
7533
+ let n = {
7534
+ startLine: t.line,
7535
+ startCol: t.column,
7536
+ startOffset: t.offset,
7537
+ endLine: -1,
7538
+ endCol: -1,
7539
+ endOffset: -1
7540
+ };
7541
+ e.parser.tokenizer.preprocessor.lineStartPos = -t.column + 1, e.parser.tokenizer.preprocessor.droppedBufferSize = t.offset, e.parser.tokenizer.preprocessor.line = t.line, e.parser.tokenizer.currentLocation = n;
7562
7542
  }
7563
- return a;
7564
7543
  }
7565
- function propertyValuePrimitive(e, t, n, r) {
7566
- if (!(typeof r != "boolean" && typeof r != "number" && typeof r != "string") && safeProtocol(e, n, r)) {
7567
- if (typeof t == "object" && t.length > 1) {
7568
- let e2 = false, n2 = 0;
7569
- for (; ++n2 < t.length; ) {
7570
- let i = t[n2];
7571
- if (i && typeof i == "object" && "flags" in i) {
7572
- if (i.test(String(r))) {
7573
- e2 = true;
7574
- break;
7575
- }
7576
- } else if (i === r) {
7577
- e2 = true;
7578
- break;
7579
- }
7580
- }
7581
- if (!e2) return;
7582
- }
7583
- return e.schema.clobber && e.schema.clobberPrefix && e.schema.clobber.includes(n) ? e.schema.clobberPrefix + r : r;
7584
- }
7544
+ function startTag(e, t) {
7545
+ let n = e.tagName.toLowerCase();
7546
+ if (t.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return;
7547
+ resetTokenizer(t, pointStart(e));
7548
+ let r = t.parser.openElements.current, i = "namespaceURI" in r ? r.namespaceURI : webNamespaces.html;
7549
+ i === webNamespaces.html && n === "svg" && (i = webNamespaces.svg);
7550
+ let a = toParse5({
7551
+ ...e,
7552
+ children: []
7553
+ }, {
7554
+ space: i === webNamespaces.svg ? "svg" : "html"
7555
+ }), o = {
7556
+ type: TokenType.START_TAG,
7557
+ tagName: n,
7558
+ tagID: getTagID(n),
7559
+ selfClosing: false,
7560
+ ackSelfClosing: false,
7561
+ attrs: "attrs" in a ? a.attrs : [],
7562
+ location: createParse5Location(e)
7563
+ };
7564
+ t.parser.currentToken = o, t.parser._processToken(t.parser.currentToken), t.parser.tokenizer.lastStartTagName = n;
7585
7565
  }
7586
- function safeProtocol(e, t, n) {
7587
- let r = e.schema.protocols && own$4.call(e.schema.protocols, t) ? e.schema.protocols[t] : void 0;
7588
- if (!r || r.length === 0) return true;
7589
- let i = String(n), a = i.indexOf(":"), o = i.indexOf("?"), l = i.indexOf("#"), dC = i.indexOf("/");
7590
- if (a < 0 || dC > -1 && a > dC || o > -1 && a > o || l > -1 && a > l) return true;
7591
- let fC = -1;
7592
- for (; ++fC < r.length; ) {
7593
- let e2 = r[fC];
7594
- if (a === e2.length && i.slice(0, e2.length) === e2) return true;
7595
- }
7596
- return false;
7566
+ function endTag(e, t) {
7567
+ let n = e.tagName.toLowerCase();
7568
+ if (!t.parser.tokenizer.inForeignNode && htmlVoidElements.includes(n) || t.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return;
7569
+ resetTokenizer(t, pointEnd(e));
7570
+ let r = {
7571
+ type: TokenType.END_TAG,
7572
+ tagName: n,
7573
+ tagID: getTagID(n),
7574
+ selfClosing: false,
7575
+ ackSelfClosing: false,
7576
+ attrs: [],
7577
+ location: createParse5Location(e)
7578
+ };
7579
+ t.parser.currentToken = r, t.parser._processToken(t.parser.currentToken), n === t.parser.tokenizer.lastStartTagName && (t.parser.tokenizer.state === TokenizerMode.RCDATA || t.parser.tokenizer.state === TokenizerMode.RAWTEXT || t.parser.tokenizer.state === TokenizerMode.SCRIPT_DATA) && (t.parser.tokenizer.state = TokenizerMode.DATA);
7597
7580
  }
7598
- function patch$1(e, t) {
7599
- let n = position(t);
7600
- t.data && (e.data = esm_default(t.data)), n && (e.position = n);
7581
+ function documentMode(e) {
7582
+ let t = e.type === "root" ? e.children[0] : e;
7583
+ return !!(t && (t.type === "doctype" || t.type === "element" && t.tagName.toLowerCase() === "html"));
7601
7584
  }
7602
- function findDefinition(e, t) {
7603
- let n, r = -1;
7604
- if (e) for (; ++r < e.length; ) {
7605
- let i = e[r], a = typeof i == "string" ? i : i[0];
7606
- if (a === t) return i;
7607
- a === "data*" && (n = i);
7608
- }
7609
- if (t.length > 4 && t.slice(0, 4).toLowerCase() === "data") return n;
7585
+ function createParse5Location(e) {
7586
+ let t = pointStart(e) || {
7587
+ line: void 0,
7588
+ column: void 0,
7589
+ offset: void 0
7590
+ }, n = pointEnd(e) || {
7591
+ line: void 0,
7592
+ column: void 0,
7593
+ offset: void 0
7594
+ };
7595
+ return {
7596
+ startLine: t.line,
7597
+ startCol: t.column,
7598
+ startOffset: t.offset,
7599
+ endLine: n.line,
7600
+ endCol: n.column,
7601
+ endOffset: n.offset
7602
+ };
7610
7603
  }
7611
- function rehypeSanitize(e) {
7612
- return function(t) {
7613
- return sanitize(t, e);
7604
+ function cloneWithoutChildren(e) {
7605
+ return "children" in e ? esm_default({
7606
+ ...e,
7607
+ children: []
7608
+ }) : esm_default(e);
7609
+ }
7610
+ function rehypeRaw(e) {
7611
+ return function(t, n) {
7612
+ return raw(t, {
7613
+ ...e,
7614
+ file: n
7615
+ });
7614
7616
  };
7615
7617
  }
7616
7618
  function ccount(e, t) {
@@ -19876,10 +19878,10 @@ ${e}</tr>
19876
19878
  })
19877
19879
  ]
19878
19880
  });
19879
- Oo = (0, import_react.lazy)(() => import("./code-block-37QAKDTI-m92Yc8pv.js").then((e) => ({
19881
+ Oo = (0, import_react.lazy)(() => import("./code-block-37QAKDTI-O6IH6wAi.js").then((e) => ({
19880
19882
  default: e.CodeBlock
19881
19883
  })));
19882
- Ao = (0, import_react.lazy)(() => import("./mermaid-4DMBBIKO-DIdL224_.js").then((e) => ({
19884
+ Ao = (0, import_react.lazy)(() => import("./mermaid-4DMBBIKO-Eg3D4FVz.js").then((e) => ({
19883
19885
  default: e.Mermaid
19884
19886
  })));
19885
19887
  qo = /language-([^\s]+)/;
@@ -20229,7 +20231,7 @@ ${e}</tr>
20229
20231
  });
20230
20232
  }, (e, t) => T(e, t));
20231
20233
  Ot.displayName = "MarkdownParagraph";
20232
- let At, qt, zt, he, $t, Ie, Ko, Go, Yo, en, tn, on, nn, He, rn, Ee, De, gn, hn, yn, wn, kn, Wt;
20234
+ let At, qt, zt, he, $t, Ie, Ko, Go, Yo, en, tn, on, nn, He, rn, Ee, De, hn, yn, wn, kn, Wt;
20233
20235
  At = {
20234
20236
  ol: Se,
20235
20237
  li: bt,
@@ -20835,11 +20837,14 @@ ${e}</tr>
20835
20837
  })();
20836
20838
  export {
20837
20839
  __tla,
20838
- tt as a,
20840
+ gn as a,
20841
+ rehypeSanitize as c,
20839
20842
  cr as i,
20843
+ defaultSchema as l,
20840
20844
  ao as n,
20841
- xn as o,
20845
+ tt as o,
20842
20846
  b as r,
20843
- require_cjs as s,
20844
- N as t
20847
+ xn as s,
20848
+ N as t,
20849
+ require_cjs as u
20845
20850
  };