@drghaliasri/butex 6.1.1 → 6.1.3

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.
@@ -1,3 +1,23 @@
1
+ // src/react/matrixPickerCss.ts
2
+ var MATRIX_PICKER_CSS = `
3
+ .butex-widget .matrix-grid-picker,
4
+ .butex-widget .matrix-grid-cell {
5
+ box-sizing: border-box;
6
+ }
7
+ `.trim();
8
+ var MATRIX_PICKER_STYLE_ID = "butex-matrix-picker-css";
9
+ function injectMatrixPickerCss(doc) {
10
+ const d = doc ?? (typeof document !== "undefined" ? document : void 0);
11
+ if (!d || d.getElementById(MATRIX_PICKER_STYLE_ID)) {
12
+ return;
13
+ }
14
+ const style = d.createElement("style");
15
+ style.id = MATRIX_PICKER_STYLE_ID;
16
+ style.textContent = MATRIX_PICKER_CSS;
17
+ d.head.appendChild(style);
18
+ }
19
+ injectMatrixPickerCss();
20
+
1
21
  // src/react-document2/ArticleMetaPanel.tsx
2
22
  import { useEffect, useId, useRef, useState } from "react";
3
23
 
@@ -9325,7 +9345,7 @@ function toDocumentJson2(document2) {
9325
9345
  }
9326
9346
 
9327
9347
  // src/document2/keys.ts
9328
- var DOCUMENT2_KEY_PATTERN = /^[\p{L}\p{M}0-9:._-]+$/u;
9348
+ var DOCUMENT2_KEY_PATTERN = /^[\p{L}\p{M}\p{Nd}:._-]+$/u;
9329
9349
  function normalizeDocument2Key(key) {
9330
9350
  return key.normalize("NFC").trim();
9331
9351
  }
@@ -10185,7 +10205,7 @@ var DOCUMENT2_MESSAGES = {
10185
10205
  editInternalRef: "\u062A\u062D\u0631\u064A\u0631 \u0627\u0644\u0645\u0631\u062C\u0639 \u0627\u0644\u062F\u0627\u062E\u0644\u064A",
10186
10206
  deleteInternalRef: "\u062D\u0630\u0641 \u0627\u0644\u0645\u0631\u062C\u0639 \u0627\u0644\u062F\u0627\u062E\u0644\u064A",
10187
10207
  labelsTitle: "\u0627\u0644\u062A\u0633\u0645\u064A\u0627\u062A \u0648\u0627\u0644\u0645\u0631\u0627\u062C\u0639 \u0627\u0644\u062F\u0627\u062E\u0644\u064A\u0629",
10188
- labelsHelp: "\u0627\u0644\u062A\u0633\u0645\u064A\u0627\u062A \u0644\u0644\u0645\u0631\u0627\u062C\u0639 \u062F\u0627\u062E\u0644 \u0627\u0644\u0645\u0633\u062A\u0646\u062F\u061B \u0627\u0644\u0645\u0631\u0627\u062C\u0639 \u0627\u0644\u0628\u0628\u0644\u064A\u0648\u063A\u0631\u0627\u0641\u064A\u0629 \u0644\u0644\u0627\u0642\u062A\u0628\u0627\u0633\u0627\u062A \u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639.",
10208
+ labelsHelp: "\u0627\u0644\u062A\u0633\u0645\u064A\u0627\u062A \u0644\u0644\u0645\u0631\u0627\u062C\u0639 \u062F\u0627\u062E\u0644 \u0627\u0644\u0645\u0633\u062A\u0646\u062F\u061B \u0648\u0627\u0644\u0627\u0642\u062A\u0628\u0627\u0633\u0627\u062A \u062A\u0633\u062A\u0646\u062F \u0625\u0644\u0649 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u0631\u0627\u062C\u0639.",
10189
10209
  captionToggle: "\u062A\u0639\u0644\u064A\u0642",
10190
10210
  labelToggle: "\u062A\u0633\u0645\u064A\u0629",
10191
10211
  centerParagraph: "\u062A\u0648\u0633\u064A\u0637 \u0627\u0644\u0641\u0642\u0631\u0629",
@@ -10392,6 +10412,15 @@ function document2Messages(locale) {
10392
10412
  return DOCUMENT2_MESSAGES[locale];
10393
10413
  }
10394
10414
 
10415
+ // src/react-document2/xelatexTextValidation.ts
10416
+ var XELATEX_UNSUPPORTED_EMOJI_PATTERN = /[\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Regional_Indicator}\uFE0F\u20E3]/u;
10417
+ function hasXeLatexUnsupportedEmoji(value) {
10418
+ return XELATEX_UNSUPPORTED_EMOJI_PATTERN.test(value);
10419
+ }
10420
+ function unsupportedEmojiMessage(uiLocale) {
10421
+ return uiLocale === "ar" ? "\u0647\u0630\u0627 \u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u062A\u0639\u0628\u064A\u0631\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645." : "This emoji is not supported.";
10422
+ }
10423
+
10395
10424
  // src/react-document2/ArticleMetaPanel.tsx
10396
10425
  import { jsx, jsxs } from "react/jsx-runtime";
10397
10426
  var HIJRI_DAYS = Array.from({ length: 30 }, (_, index) => index + 1);
@@ -10399,6 +10428,20 @@ var HIJRI_YEARS = Array.from(
10399
10428
  { length: HIJRI_YEAR_MAX - HIJRI_YEAR_MIN + 1 },
10400
10429
  (_, index) => HIJRI_YEAR_MIN + index
10401
10430
  );
10431
+ var UNSUPPORTED_EMOJI_STYLE = {
10432
+ borderColor: "var(--butex-document2-error)",
10433
+ background: "var(--butex-document2-error-bg)"
10434
+ };
10435
+ function UnsupportedEmojiWarning({
10436
+ id,
10437
+ show,
10438
+ uiLocale
10439
+ }) {
10440
+ if (!show) {
10441
+ return null;
10442
+ }
10443
+ return /* @__PURE__ */ jsx("p", { id, className: "butex-document2-widget__field-error", children: unsupportedEmojiMessage(uiLocale) });
10444
+ }
10402
10445
  function HijriDateMenu({
10403
10446
  label,
10404
10447
  value,
@@ -10476,6 +10519,12 @@ function ArticleMetaPanel({
10476
10519
  const localRef = useRef(null);
10477
10520
  const resolvedRef = panelRef ?? localRef;
10478
10521
  const formattedDate = formatHijriDate(meta.date, { locale: uiLocale, digitForm });
10522
+ const titleUnsupportedEmoji = hasXeLatexUnsupportedEmoji(meta.title);
10523
+ const authorsUnsupportedEmoji = hasXeLatexUnsupportedEmoji(meta.authors);
10524
+ const abstractUnsupportedEmoji = hasXeLatexUnsupportedEmoji(meta.abstract);
10525
+ const titleErrorId = "butex-document2-meta-title-unsupported-emoji";
10526
+ const authorsErrorId = "butex-document2-meta-authors-unsupported-emoji";
10527
+ const abstractErrorId = "butex-document2-meta-abstract-unsupported-emoji";
10479
10528
  return /* @__PURE__ */ jsxs(
10480
10529
  "section",
10481
10530
  {
@@ -10502,12 +10551,16 @@ function ArticleMetaPanel({
10502
10551
  {
10503
10552
  ref: titleInputRef,
10504
10553
  value: meta.title,
10554
+ "aria-invalid": titleUnsupportedEmoji ? true : void 0,
10555
+ "aria-describedby": titleUnsupportedEmoji ? titleErrorId : void 0,
10556
+ style: titleUnsupportedEmoji ? UNSUPPORTED_EMOJI_STYLE : void 0,
10505
10557
  onChange: (event) => {
10506
10558
  const value = event.currentTarget.value;
10507
10559
  onChange({ title: value });
10508
10560
  }
10509
10561
  }
10510
- )
10562
+ ),
10563
+ /* @__PURE__ */ jsx(UnsupportedEmojiWarning, { id: titleErrorId, show: titleUnsupportedEmoji, uiLocale })
10511
10564
  ] }),
10512
10565
  /* @__PURE__ */ jsxs("label", { className: "butex-document2-widget__article-meta-field", children: [
10513
10566
  /* @__PURE__ */ jsx("span", { children: messages.articleAuthors }),
@@ -10516,12 +10569,16 @@ function ArticleMetaPanel({
10516
10569
  {
10517
10570
  rows: 2,
10518
10571
  value: meta.authors,
10572
+ "aria-invalid": authorsUnsupportedEmoji ? true : void 0,
10573
+ "aria-describedby": authorsUnsupportedEmoji ? authorsErrorId : void 0,
10574
+ style: authorsUnsupportedEmoji ? UNSUPPORTED_EMOJI_STYLE : void 0,
10519
10575
  onChange: (event) => {
10520
10576
  const value = event.currentTarget.value;
10521
10577
  onChange({ authors: value });
10522
10578
  }
10523
10579
  }
10524
- )
10580
+ ),
10581
+ /* @__PURE__ */ jsx(UnsupportedEmojiWarning, { id: authorsErrorId, show: authorsUnsupportedEmoji, uiLocale })
10525
10582
  ] }),
10526
10583
  /* @__PURE__ */ jsxs("div", { className: "butex-document2-widget__article-meta-field", children: [
10527
10584
  /* @__PURE__ */ jsx("span", { children: messages.articleDate }),
@@ -10572,12 +10629,16 @@ function ArticleMetaPanel({
10572
10629
  {
10573
10630
  rows: 3,
10574
10631
  value: meta.abstract,
10632
+ "aria-invalid": abstractUnsupportedEmoji ? true : void 0,
10633
+ "aria-describedby": abstractUnsupportedEmoji ? abstractErrorId : void 0,
10634
+ style: abstractUnsupportedEmoji ? UNSUPPORTED_EMOJI_STYLE : void 0,
10575
10635
  onChange: (event) => {
10576
10636
  const value = event.currentTarget.value;
10577
10637
  onChange({ abstract: value });
10578
10638
  }
10579
10639
  }
10580
- )
10640
+ ),
10641
+ /* @__PURE__ */ jsx(UnsupportedEmojiWarning, { id: abstractErrorId, show: abstractUnsupportedEmoji, uiLocale })
10581
10642
  ] })
10582
10643
  ] }),
10583
10644
  /* @__PURE__ */ jsx("p", { className: "butex-document2-widget__article-meta-fixed", dir: "rtl", children: BUTEX_CLOSING_HAMDALA })
@@ -10629,7 +10690,7 @@ function parseJsonDebugInput(text) {
10629
10690
  import { useEffect as useEffect3, useState as useState3 } from "react";
10630
10691
 
10631
10692
  // src/react-document2/InlineField.tsx
10632
- import { useRef as useRef3 } from "react";
10693
+ import { Fragment, useRef as useRef3 } from "react";
10633
10694
 
10634
10695
  // src/react-document2/CiteChip.tsx
10635
10696
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -11314,7 +11375,7 @@ function RefChip({
11314
11375
  }
11315
11376
 
11316
11377
  // src/react-document2/InlineField.tsx
11317
- import { jsx as jsx6 } from "react/jsx-runtime";
11378
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
11318
11379
  function rememberCaret(element, blockId, fieldId, tokenId, onFieldFocus) {
11319
11380
  if (!blockId || !onFieldFocus) {
11320
11381
  return;
@@ -11450,74 +11511,92 @@ function InlineField({
11450
11511
  const backwardArrowKey = documentDirection === "rtl" ? "ArrowRight" : "ArrowLeft";
11451
11512
  return /* @__PURE__ */ jsx6("div", { className: "butex-document2-widget__inline-field", dir: documentDirection, "data-document-direction": documentDirection, children: field.tokens.map((token) => {
11452
11513
  if (token.kind === "text") {
11453
- return /* @__PURE__ */ jsx6(
11454
- "textarea",
11455
- {
11456
- className: "butex-document2-widget__inline-text",
11457
- value: token.text,
11458
- "data-bold": token.style?.bold === true ? "true" : void 0,
11459
- "data-italic": token.style?.italic === true ? "true" : void 0,
11460
- "data-underline": token.style?.underline === true ? "true" : void 0,
11461
- dir: documentDirection,
11462
- "aria-label": messages.text,
11463
- rows: 1,
11464
- "data-field-id": field.id,
11465
- "data-text-token-id": token.id,
11466
- ref: (element) => {
11467
- if (element) {
11468
- textRefs.current.set(token.id, element);
11469
- fitTextareaHeight(element);
11470
- } else {
11471
- textRefs.current.delete(token.id);
11472
- }
11473
- },
11474
- onChange: (event) => {
11475
- onTextChange(field.id, token.id, event.currentTarget.value);
11476
- fitTextareaHeight(event.currentTarget);
11477
- },
11478
- onKeyDown: (event) => {
11479
- const element = event.currentTarget;
11480
- const collapsed = element.selectionStart === element.selectionEnd;
11481
- if (!collapsed) {
11482
- return;
11483
- }
11484
- if (event.key === forwardArrowKey && element.selectionStart === element.value.length) {
11485
- const next = adjacentIslandId(token.id, 1);
11486
- if (next) {
11487
- event.preventDefault();
11488
- if (next.kind === "math") {
11489
- focusMathToken(next.id);
11490
- } else if (next.kind === "cite") {
11491
- focusCiteToken(next.id);
11492
- } else {
11493
- focusRefToken(next.id);
11494
- }
11514
+ const unsupportedEmoji = hasXeLatexUnsupportedEmoji(token.text);
11515
+ const errorId = `butex-document2-unsupported-emoji-${token.id}`;
11516
+ return /* @__PURE__ */ jsxs5(Fragment, { children: [
11517
+ /* @__PURE__ */ jsx6(
11518
+ "textarea",
11519
+ {
11520
+ className: "butex-document2-widget__inline-text",
11521
+ value: token.text,
11522
+ "data-bold": token.style?.bold === true ? "true" : void 0,
11523
+ "data-italic": token.style?.italic === true ? "true" : void 0,
11524
+ "data-underline": token.style?.underline === true ? "true" : void 0,
11525
+ dir: documentDirection,
11526
+ "aria-label": messages.text,
11527
+ "aria-invalid": unsupportedEmoji ? true : void 0,
11528
+ "aria-describedby": unsupportedEmoji ? errorId : void 0,
11529
+ rows: 1,
11530
+ "data-field-id": field.id,
11531
+ "data-text-token-id": token.id,
11532
+ style: unsupportedEmoji ? {
11533
+ borderColor: "var(--butex-document2-error)",
11534
+ background: "var(--butex-document2-error-bg)"
11535
+ } : void 0,
11536
+ ref: (element) => {
11537
+ if (element) {
11538
+ textRefs.current.set(token.id, element);
11539
+ fitTextareaHeight(element);
11540
+ } else {
11541
+ textRefs.current.delete(token.id);
11542
+ }
11543
+ },
11544
+ onChange: (event) => {
11545
+ onTextChange(field.id, token.id, event.currentTarget.value);
11546
+ fitTextareaHeight(event.currentTarget);
11547
+ },
11548
+ onKeyDown: (event) => {
11549
+ const element = event.currentTarget;
11550
+ const collapsed = element.selectionStart === element.selectionEnd;
11551
+ if (!collapsed) {
11552
+ return;
11495
11553
  }
11496
- } else if (event.key === backwardArrowKey && element.selectionStart === 0) {
11497
- const previous = adjacentIslandId(token.id, -1);
11498
- if (previous) {
11499
- event.preventDefault();
11500
- if (previous.kind === "math") {
11501
- focusMathToken(previous.id);
11502
- } else if (previous.kind === "cite") {
11503
- focusCiteToken(previous.id);
11504
- } else {
11505
- focusRefToken(previous.id);
11554
+ if (event.key === forwardArrowKey && element.selectionStart === element.value.length) {
11555
+ const next = adjacentIslandId(token.id, 1);
11556
+ if (next) {
11557
+ event.preventDefault();
11558
+ if (next.kind === "math") {
11559
+ focusMathToken(next.id);
11560
+ } else if (next.kind === "cite") {
11561
+ focusCiteToken(next.id);
11562
+ } else {
11563
+ focusRefToken(next.id);
11564
+ }
11565
+ }
11566
+ } else if (event.key === backwardArrowKey && element.selectionStart === 0) {
11567
+ const previous = adjacentIslandId(token.id, -1);
11568
+ if (previous) {
11569
+ event.preventDefault();
11570
+ if (previous.kind === "math") {
11571
+ focusMathToken(previous.id);
11572
+ } else if (previous.kind === "cite") {
11573
+ focusCiteToken(previous.id);
11574
+ } else {
11575
+ focusRefToken(previous.id);
11576
+ }
11506
11577
  }
11507
11578
  }
11508
- }
11509
- },
11510
- onFocus: (event) => rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus),
11511
- onClick: (event) => rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus),
11512
- onKeyUp: (event) => {
11513
- rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus);
11514
- fitTextareaHeight(event.currentTarget);
11515
- },
11516
- onSelect: (event) => rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus),
11517
- onBlur: () => onFieldBlur?.()
11518
- },
11519
- token.id
11520
- );
11579
+ },
11580
+ onFocus: (event) => rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus),
11581
+ onClick: (event) => rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus),
11582
+ onKeyUp: (event) => {
11583
+ rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus);
11584
+ fitTextareaHeight(event.currentTarget);
11585
+ },
11586
+ onSelect: (event) => rememberCaret(event.currentTarget, blockId, field.id, token.id, onFieldFocus),
11587
+ onBlur: () => onFieldBlur?.()
11588
+ }
11589
+ ),
11590
+ unsupportedEmoji ? /* @__PURE__ */ jsx6(
11591
+ "p",
11592
+ {
11593
+ id: errorId,
11594
+ className: "butex-document2-widget__field-error",
11595
+ style: { flexBasis: "100%" },
11596
+ children: unsupportedEmojiMessage(uiLocale)
11597
+ }
11598
+ ) : null
11599
+ ] }, token.id);
11521
11600
  }
11522
11601
  if (token.kind === "cite") {
11523
11602
  return /* @__PURE__ */ jsx6(
@@ -11618,7 +11697,7 @@ function uiLocaleDirection(locale) {
11618
11697
  }
11619
11698
 
11620
11699
  // src/react-document2/BlockEditor.tsx
11621
- import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
11700
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
11622
11701
  function blockChromeClass(block) {
11623
11702
  const root = "butex-document2-widget__block";
11624
11703
  if (block.kind === "textBlock") {
@@ -11732,8 +11811,8 @@ function FloatMetaEditor({
11732
11811
  labels,
11733
11812
  excludeOwnerId: ownerId
11734
11813
  }) : null;
11735
- return /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__float-meta", children: [
11736
- /* @__PURE__ */ jsxs5("label", { className: "butex-document2-widget__float-meta-toggle", children: [
11814
+ return /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__float-meta", children: [
11815
+ /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__float-meta-toggle", children: [
11737
11816
  /* @__PURE__ */ jsx7(
11738
11817
  "input",
11739
11818
  {
@@ -11747,7 +11826,7 @@ function FloatMetaEditor({
11747
11826
  ),
11748
11827
  /* @__PURE__ */ jsx7("span", { children: messages.captionToggle })
11749
11828
  ] }),
11750
- captionEnabled ? /* @__PURE__ */ jsxs5("label", { className: "butex-document2-widget__refs-field", children: [
11829
+ captionEnabled ? /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__refs-field", children: [
11751
11830
  /* @__PURE__ */ jsx7("span", { children: messages.floatCaption }),
11752
11831
  /* @__PURE__ */ jsx7(
11753
11832
  "input",
@@ -11762,7 +11841,7 @@ function FloatMetaEditor({
11762
11841
  }
11763
11842
  )
11764
11843
  ] }) : null,
11765
- /* @__PURE__ */ jsxs5("label", { className: "butex-document2-widget__float-meta-toggle", children: [
11844
+ /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__float-meta-toggle", children: [
11766
11845
  /* @__PURE__ */ jsx7(
11767
11846
  "input",
11768
11847
  {
@@ -11776,7 +11855,7 @@ function FloatMetaEditor({
11776
11855
  ),
11777
11856
  /* @__PURE__ */ jsx7("span", { children: messages.labelToggle })
11778
11857
  ] }),
11779
- labelEnabled ? /* @__PURE__ */ jsxs5("label", { className: "butex-document2-widget__refs-field", children: [
11858
+ labelEnabled ? /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__refs-field", children: [
11780
11859
  /* @__PURE__ */ jsx7("span", { children: messages.floatLabel }),
11781
11860
  /* @__PURE__ */ jsx7(
11782
11861
  "input",
@@ -11885,23 +11964,23 @@ function ImageAssetEditor({
11885
11964
  document.getElementById(selectId)?.focus();
11886
11965
  }
11887
11966
  }
11888
- const defaultUi = /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__image-editor", children: [
11889
- /* @__PURE__ */ jsx7("div", { className: `butex-document2-widget__image-asset ${hasImage ? "butex-document2-widget__image-asset--filled" : "butex-document2-widget__image-asset--empty"}`, children: hasImage ? /* @__PURE__ */ jsxs5(Fragment, { children: [
11967
+ const defaultUi = /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__image-editor", children: [
11968
+ /* @__PURE__ */ jsx7("div", { className: `butex-document2-widget__image-asset ${hasImage ? "butex-document2-widget__image-asset--filled" : "butex-document2-widget__image-asset--empty"}`, children: hasImage ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
11890
11969
  resolvedUrl ? /* @__PURE__ */ jsx7("img", { className: "butex-document2-widget__image-thumb", src: resolvedUrl, alt: messages.imagePreviewAlt }) : null,
11891
- /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__image-asset-main", children: [
11970
+ /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__image-asset-main", children: [
11892
11971
  /* @__PURE__ */ jsx7("span", { className: "butex-document2-widget__image-asset-title", dir: "ltr", children: block.assetId ?? block.value }),
11893
- /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__image-actions", children: [
11972
+ /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__image-actions", children: [
11894
11973
  /* @__PURE__ */ jsx7("button", { type: "button", onClick: activateImagePicker, disabled: !canUsePicker && !canSelectListedAsset, children: messages.changeImage }),
11895
11974
  /* @__PURE__ */ jsx7("button", { type: "button", className: "butex-document2-widget__button--danger", onClick: () => onClearAsset?.(block.id), children: messages.removeImage })
11896
11975
  ] })
11897
11976
  ] })
11898
- ] }) : /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__image-empty-content", children: [
11977
+ ] }) : /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__image-empty-content", children: [
11899
11978
  /* @__PURE__ */ jsx7("strong", { children: messages.noImageSelected }),
11900
11979
  /* @__PURE__ */ jsx7("button", { type: "button", onClick: activateImagePicker, disabled: !canUsePicker && !canSelectListedAsset, children: messages.chooseImage })
11901
11980
  ] }) }),
11902
- !canUsePicker ? /* @__PURE__ */ jsxs5("label", { className: "butex-document2-widget__image-select", htmlFor: selectId, children: [
11981
+ !canUsePicker ? /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__image-select", htmlFor: selectId, children: [
11903
11982
  /* @__PURE__ */ jsx7("span", { children: messages.selectImageAsset }),
11904
- /* @__PURE__ */ jsxs5(
11983
+ /* @__PURE__ */ jsxs6(
11905
11984
  "select",
11906
11985
  {
11907
11986
  id: selectId,
@@ -11916,7 +11995,7 @@ function ImageAssetEditor({
11916
11995
  }
11917
11996
  )
11918
11997
  ] }) : null,
11919
- /* @__PURE__ */ jsxs5(
11998
+ /* @__PURE__ */ jsxs6(
11920
11999
  "details",
11921
12000
  {
11922
12001
  className: "butex-document2-widget__image-advanced",
@@ -11953,7 +12032,7 @@ function ImageAssetEditor({
11953
12032
  )
11954
12033
  ] });
11955
12034
  if (renderImageBlockEditor) {
11956
- return /* @__PURE__ */ jsx7(Fragment, { children: renderImageBlockEditor({
12035
+ return /* @__PURE__ */ jsx7(Fragment2, { children: renderImageBlockEditor({
11957
12036
  blockId: block.id,
11958
12037
  assetId: block.assetId,
11959
12038
  value: block.value,
@@ -11964,7 +12043,7 @@ function ImageAssetEditor({
11964
12043
  defaultUi
11965
12044
  }) });
11966
12045
  }
11967
- return /* @__PURE__ */ jsx7(Fragment, { children: defaultUi });
12046
+ return /* @__PURE__ */ jsx7(Fragment2, { children: defaultUi });
11968
12047
  }
11969
12048
  function blockSummary(block, referenceCount, messages) {
11970
12049
  if (block.kind === "textBlock") {
@@ -12071,7 +12150,7 @@ function BlockEditor({
12071
12150
  }
12072
12151
  onBlockFocus?.(block.id);
12073
12152
  },
12074
- children: /* @__PURE__ */ jsxs5("span", { className: "butex-document2-widget__block-title", children: [
12153
+ children: /* @__PURE__ */ jsxs6("span", { className: "butex-document2-widget__block-title", children: [
12075
12154
  onToggleSelect ? /* @__PURE__ */ jsx7(
12076
12155
  "input",
12077
12156
  {
@@ -12107,16 +12186,16 @@ function BlockEditor({
12107
12186
  }
12108
12187
  ) : null;
12109
12188
  if (isCollapsed && showChrome) {
12110
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12189
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12111
12190
  header,
12112
12191
  /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__block-summary", children: blockSummary(block, references.length, messages) })
12113
12192
  ] });
12114
12193
  }
12115
12194
  if (block.kind === "textBlock") {
12116
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12195
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12117
12196
  header,
12118
12197
  /* @__PURE__ */ jsx7(InlineField, { field: block.field, ...fieldProps }),
12119
- block.command === "\\paragraph" ? /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__float-meta butex-document2-widget__float-meta--compact", children: /* @__PURE__ */ jsxs5("label", { className: "butex-document2-widget__float-meta-toggle", children: [
12198
+ block.command === "\\paragraph" ? /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__float-meta butex-document2-widget__float-meta--compact", children: /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__float-meta-toggle", children: [
12120
12199
  /* @__PURE__ */ jsx7(
12121
12200
  "input",
12122
12201
  {
@@ -12133,11 +12212,11 @@ function BlockEditor({
12133
12212
  ] });
12134
12213
  }
12135
12214
  if (block.kind === "list") {
12136
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12215
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12137
12216
  header,
12138
- block.items.map((item, index) => /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__field", dir: "rtl", children: [
12217
+ block.items.map((item, index) => /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__field", dir: "rtl", children: [
12139
12218
  /* @__PURE__ */ jsx7("span", { className: "butex-document2-widget__toolbar-label", children: block.command === "\\begin{enumerate}" ? `${messages.item} ${String(index + 1)}` : messages.item }),
12140
- /* @__PURE__ */ jsxs5("div", { className: "butex-document2-widget__list-item-content", dir: documentDirection, children: [
12219
+ /* @__PURE__ */ jsxs6("div", { className: "butex-document2-widget__list-item-content", dir: documentDirection, children: [
12141
12220
  /* @__PURE__ */ jsx7(InlineField, { field: item.field, ...fieldProps }),
12142
12221
  item.blocks.map((child) => /* @__PURE__ */ jsx7(
12143
12222
  BlockEditor,
@@ -12177,14 +12256,14 @@ function BlockEditor({
12177
12256
  ] }),
12178
12257
  onRemoveListItem && block.items.length > 1 ? /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__list-item-actions", children: /* @__PURE__ */ jsx7("button", { type: "button", className: "butex-document2-widget__button--danger", onClick: () => onRemoveListItem(block.id, item.id), children: messages.deleteItem }) }) : null
12179
12258
  ] }, item.id)),
12180
- onAddListItem ? /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__list-footer", children: /* @__PURE__ */ jsxs5("button", { type: "button", onClick: () => onAddListItem(block.id), children: [
12259
+ onAddListItem ? /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__list-footer", children: /* @__PURE__ */ jsxs6("button", { type: "button", onClick: () => onAddListItem(block.id), children: [
12181
12260
  "+ ",
12182
12261
  messages.addItem
12183
12262
  ] }) }) : null
12184
12263
  ] });
12185
12264
  }
12186
12265
  if (block.kind === "table") {
12187
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12266
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12188
12267
  header,
12189
12268
  block.rows.map((row, rowIndex) => /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__row", dir: documentDirection, children: row.map((cell) => /* @__PURE__ */ jsx7("div", { className: "butex-document2-widget__table-cell", dir: documentDirection, children: /* @__PURE__ */ jsx7(InlineField, { field: cell, ...fieldProps }) }, cell.id)) }, rowIndex)),
12190
12269
  /* @__PURE__ */ jsx7(
@@ -12206,7 +12285,7 @@ function BlockEditor({
12206
12285
  ] });
12207
12286
  }
12208
12287
  if (block.kind === "image") {
12209
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12288
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12210
12289
  header,
12211
12290
  /* @__PURE__ */ jsx7(
12212
12291
  ImageAssetEditor,
@@ -12243,10 +12322,10 @@ function BlockEditor({
12243
12322
  ] });
12244
12323
  }
12245
12324
  if (block.kind === "bibliography") {
12246
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12325
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12247
12326
  header,
12248
- /* @__PURE__ */ jsx7("ol", { className: "butex-document2-widget__bibliography-editor", dir: documentDirection, children: referenceList.map((reference, index) => /* @__PURE__ */ jsxs5("li", { children: [
12249
- /* @__PURE__ */ jsxs5("strong", { children: [
12327
+ /* @__PURE__ */ jsx7("ol", { className: "butex-document2-widget__bibliography-editor", dir: documentDirection, children: referenceList.map((reference, index) => /* @__PURE__ */ jsxs6("li", { children: [
12328
+ /* @__PURE__ */ jsxs6("strong", { children: [
12250
12329
  "[",
12251
12330
  formatBibliographyNumber(index + 1, { documentDirection, digitForm }),
12252
12331
  "] ",
@@ -12259,7 +12338,7 @@ function BlockEditor({
12259
12338
  onManageReferences ? /* @__PURE__ */ jsx7("button", { type: "button", onClick: onManageReferences, children: messages.manageReferences }) : null
12260
12339
  ] });
12261
12340
  }
12262
- return /* @__PURE__ */ jsxs5("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12341
+ return /* @__PURE__ */ jsxs6("section", { className: chromeClass, "data-butex-block-source": block.metadata?.source, children: [
12263
12342
  header,
12264
12343
  /* @__PURE__ */ jsx7("pre", { className: "butex-document2-widget__raw", children: block.value })
12265
12344
  ] });
@@ -12267,7 +12346,7 @@ function BlockEditor({
12267
12346
 
12268
12347
  // src/react-document2/CitePickerPopover.tsx
12269
12348
  import { useEffect as useEffect4, useState as useState4 } from "react";
12270
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
12349
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
12271
12350
  function CitePickerPopover({
12272
12351
  open,
12273
12352
  references,
@@ -12292,7 +12371,7 @@ function CitePickerPopover({
12292
12371
  function toggleKey(key) {
12293
12372
  setSelected((current) => current.includes(key) ? current.filter((entry) => entry !== key) : [...current, key]);
12294
12373
  }
12295
- return /* @__PURE__ */ jsx8("div", { className: "butex-document2-widget__cite-picker-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs6(
12374
+ return /* @__PURE__ */ jsx8("div", { className: "butex-document2-widget__cite-picker-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs7(
12296
12375
  "div",
12297
12376
  {
12298
12377
  className: "butex-document2-widget__cite-picker",
@@ -12300,7 +12379,7 @@ function CitePickerPopover({
12300
12379
  "aria-label": messages.citePickerTitle,
12301
12380
  onClick: (event) => event.stopPropagation(),
12302
12381
  children: [
12303
- /* @__PURE__ */ jsxs6("header", { className: "butex-document2-widget__cite-picker-header", children: [
12382
+ /* @__PURE__ */ jsxs7("header", { className: "butex-document2-widget__cite-picker-header", children: [
12304
12383
  /* @__PURE__ */ jsx8("strong", { children: messages.citePickerTitle }),
12305
12384
  /* @__PURE__ */ jsx8("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.close, "aria-label": messages.close, onClick: onClose, children: "\xD7" })
12306
12385
  ] }),
@@ -12308,10 +12387,10 @@ function CitePickerPopover({
12308
12387
  const checked = selected.includes(reference.key);
12309
12388
  const subtitle = [reference.authors, reference.title].filter(Boolean).join(" \u2014 ");
12310
12389
  const numberLabel = formatBibliographyNumber(index + 1, { documentDirection, digitForm });
12311
- return /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsxs6("label", { className: "butex-document2-widget__cite-picker-item", children: [
12390
+ return /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsxs7("label", { className: "butex-document2-widget__cite-picker-item", children: [
12312
12391
  /* @__PURE__ */ jsx8("input", { type: "checkbox", checked, onChange: () => toggleKey(reference.key) }),
12313
- /* @__PURE__ */ jsxs6("span", { children: [
12314
- /* @__PURE__ */ jsxs6("strong", { children: [
12392
+ /* @__PURE__ */ jsxs7("span", { children: [
12393
+ /* @__PURE__ */ jsxs7("strong", { children: [
12315
12394
  "[",
12316
12395
  numberLabel,
12317
12396
  "] ",
@@ -12321,7 +12400,7 @@ function CitePickerPopover({
12321
12400
  ] })
12322
12401
  ] }) }, reference.id);
12323
12402
  }) }),
12324
- /* @__PURE__ */ jsxs6("footer", { className: "butex-document2-widget__cite-picker-footer", children: [
12403
+ /* @__PURE__ */ jsxs7("footer", { className: "butex-document2-widget__cite-picker-footer", children: [
12325
12404
  onManageReferences ? /* @__PURE__ */ jsx8("button", { type: "button", onClick: onManageReferences, children: messages.manageReferences }) : null,
12326
12405
  /* @__PURE__ */ jsx8("button", { type: "button", onClick: onClose, children: messages.close }),
12327
12406
  /* @__PURE__ */ jsx8(
@@ -12345,7 +12424,7 @@ import { useEffect as useEffect6, useRef as useRef5, useState as useState6 } fro
12345
12424
 
12346
12425
  // src/react-document2/TableInsertPopover.tsx
12347
12426
  import { useEffect as useEffect5, useRef as useRef4, useState as useState5 } from "react";
12348
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
12427
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
12349
12428
  function TableInsertPopover({ uiLocale = "ar", onConfirm }) {
12350
12429
  const messages = document2Messages(uiLocale);
12351
12430
  const [open, setOpen] = useState5(false);
@@ -12370,7 +12449,7 @@ function TableInsertPopover({ uiLocale = "ar", onConfirm }) {
12370
12449
  onConfirm(rowCount, colCount);
12371
12450
  setOpen(false);
12372
12451
  }
12373
- return /* @__PURE__ */ jsxs7("div", { className: "butex-document2-widget__table-popover", ref: rootRef, children: [
12452
+ return /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__table-popover", ref: rootRef, children: [
12374
12453
  /* @__PURE__ */ jsx9(
12375
12454
  "button",
12376
12455
  {
@@ -12384,12 +12463,12 @@ function TableInsertPopover({ uiLocale = "ar", onConfirm }) {
12384
12463
  children: "\u229E"
12385
12464
  }
12386
12465
  ),
12387
- open ? /* @__PURE__ */ jsxs7("div", { className: "butex-document2-widget__table-popover-panel", role: "dialog", "aria-label": messages.tableSize, children: [
12388
- /* @__PURE__ */ jsxs7("label", { children: [
12466
+ open ? /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__table-popover-panel", role: "dialog", "aria-label": messages.tableSize, children: [
12467
+ /* @__PURE__ */ jsxs8("label", { children: [
12389
12468
  messages.rows,
12390
12469
  /* @__PURE__ */ jsx9("input", { type: "number", min: 1, max: 20, value: rows, onChange: (event) => setRows(event.currentTarget.value) })
12391
12470
  ] }),
12392
- /* @__PURE__ */ jsxs7("label", { children: [
12471
+ /* @__PURE__ */ jsxs8("label", { children: [
12393
12472
  messages.columns,
12394
12473
  /* @__PURE__ */ jsx9("input", { type: "number", min: 1, max: 10, value: cols, onChange: (event) => setCols(event.currentTarget.value) })
12395
12474
  ] }),
@@ -12399,7 +12478,7 @@ function TableInsertPopover({ uiLocale = "ar", onConfirm }) {
12399
12478
  }
12400
12479
 
12401
12480
  // src/react-document2/DocumentInsertToolbar.tsx
12402
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
12481
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
12403
12482
  var DIGIT_FORMS = ["western", "arabicIndic", "persianIndic"];
12404
12483
  function digitFormLabel(digitForm) {
12405
12484
  if (digitForm === "arabicIndic") {
@@ -12506,12 +12585,12 @@ function DocumentInsertToolbar({
12506
12585
  }
12507
12586
  return messages.westernDigits;
12508
12587
  }
12509
- return /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-insert", children: [
12510
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.undoRedo, children: [
12588
+ return /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-insert", children: [
12589
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.undoRedo, children: [
12511
12590
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: `${messages.undo} (Ctrl+Z)`, "aria-label": messages.undo, disabled: !canUndo, onClick: onUndo, children: "\u21B6" }),
12512
12591
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: `${messages.redo} (Ctrl+Shift+Z)`, "aria-label": messages.redo, disabled: !canRedo, onClick: onRedo, children: "\u21B7" })
12513
12592
  ] }),
12514
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.blockSelection, children: [
12593
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.blockSelection, children: [
12515
12594
  /* @__PURE__ */ jsx10(
12516
12595
  "button",
12517
12596
  {
@@ -12548,13 +12627,13 @@ function DocumentInsertToolbar({
12548
12627
  children: messages.deleteBlock
12549
12628
  }
12550
12629
  ),
12551
- selectionCount > 0 ? /* @__PURE__ */ jsxs8("span", { className: "butex-document2-widget__selection-count", children: [
12630
+ selectionCount > 0 ? /* @__PURE__ */ jsxs9("span", { className: "butex-document2-widget__selection-count", children: [
12552
12631
  selectionCount,
12553
12632
  " ",
12554
12633
  messages.selectedBlockCount
12555
12634
  ] }) : null
12556
12635
  ] }),
12557
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.textFormatting, children: [
12636
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.textFormatting, children: [
12558
12637
  /* @__PURE__ */ jsx10(
12559
12638
  "button",
12560
12639
  {
@@ -12598,7 +12677,7 @@ function DocumentInsertToolbar({
12598
12677
  }
12599
12678
  )
12600
12679
  ] }),
12601
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.structure, children: [
12680
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.structure, children: [
12602
12681
  /* @__PURE__ */ jsx10(
12603
12682
  "button",
12604
12683
  {
@@ -12615,10 +12694,10 @@ function DocumentInsertToolbar({
12615
12694
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn butex-document2-widget__icon-btn--h3", title: messages.addSubsubsection, "aria-label": messages.addSubsubsection, onClick: onAddSubsubsection, children: messages.subsubsectionGlyph }),
12616
12695
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.addParagraph, "aria-label": messages.addParagraph, onClick: onAddParagraph, children: messages.paragraphGlyph })
12617
12696
  ] }),
12618
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.equations, children: [
12697
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.equations, children: [
12619
12698
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: `${messages.inlineEquation} ($\u2026$)`, "aria-label": messages.inlineEquation, disabled: !editableEquations, onClick: onAddInlineEquation, children: /* @__PURE__ */ jsx10("span", { className: "butex-document2-widget__icon-math-inline", "aria-hidden": "true", children: "$=$" }) }),
12620
12699
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: `${messages.displayEquation} (\\[\u2026\\])`, "aria-label": messages.displayEquation, disabled: !editableEquations, onClick: onAddDisplayEquation, children: /* @__PURE__ */ jsx10("span", { className: "butex-document2-widget__icon-math-display", "aria-hidden": "true", children: "\\[\xF7\\]" }) }),
12621
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__digit-form-menu", children: [
12700
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__digit-form-menu", children: [
12622
12701
  /* @__PURE__ */ jsx10(
12623
12702
  "button",
12624
12703
  {
@@ -12649,8 +12728,8 @@ function DocumentInsertToolbar({
12649
12728
  )) }) : null
12650
12729
  ] })
12651
12730
  ] }),
12652
- /* @__PURE__ */ jsx10("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.citations, children: /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__references-menu", ref: referencesMenuRef, children: [
12653
- /* @__PURE__ */ jsxs8(
12731
+ /* @__PURE__ */ jsx10("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.citations, children: /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__references-menu", ref: referencesMenuRef, children: [
12732
+ /* @__PURE__ */ jsxs9(
12654
12733
  "button",
12655
12734
  {
12656
12735
  ref: referencesTriggerRef,
@@ -12668,7 +12747,7 @@ function DocumentInsertToolbar({
12668
12747
  ]
12669
12748
  }
12670
12749
  ),
12671
- referencesMenuOpen ? /* @__PURE__ */ jsxs8(
12750
+ referencesMenuOpen ? /* @__PURE__ */ jsxs9(
12672
12751
  "div",
12673
12752
  {
12674
12753
  className: "butex-document2-widget__references-menu-options",
@@ -12676,23 +12755,23 @@ function DocumentInsertToolbar({
12676
12755
  "aria-label": messages.citations,
12677
12756
  onKeyDown: moveReferenceMenuFocus,
12678
12757
  children: [
12679
- /* @__PURE__ */ jsxs8("button", { type: "button", role: "menuitem", title: messages.insertCitation, onClick: () => runReferenceAction(onInsertCitation), children: [
12758
+ /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", title: messages.insertCitation, onClick: () => runReferenceAction(onInsertCitation), children: [
12680
12759
  /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "[]" }),
12681
12760
  /* @__PURE__ */ jsx10("span", { children: messages.insertCitation })
12682
12761
  ] }),
12683
- /* @__PURE__ */ jsxs8("button", { type: "button", role: "menuitem", title: messages.insertInternalRef, onClick: () => runReferenceAction(onInsertInternalRef), children: [
12762
+ /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", title: messages.insertInternalRef, onClick: () => runReferenceAction(onInsertInternalRef), children: [
12684
12763
  /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "\xA7" }),
12685
12764
  /* @__PURE__ */ jsx10("span", { children: messages.insertInternalRef })
12686
12765
  ] }),
12687
- /* @__PURE__ */ jsxs8("button", { type: "button", role: "menuitem", title: messages.insertBibliography, onClick: () => runReferenceAction(onInsertBibliography), children: [
12766
+ /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", title: messages.insertBibliography, onClick: () => runReferenceAction(onInsertBibliography), children: [
12688
12767
  /* @__PURE__ */ jsx10("span", { className: "butex-document2-widget__icon-bibliography", "aria-hidden": "true", children: /* @__PURE__ */ jsx10("svg", { viewBox: "0 0 16 16", width: "14", height: "14", focusable: "false", children: /* @__PURE__ */ jsx10("path", { fill: "currentColor", d: "M2.2 2.4h7.2c.9 0 1.6.7 1.6 1.6v9.2c0 .5-.6.8-1 .5l-2.2-1.6H2.2c-.9 0-1.6-.7-1.6-1.6V4c0-.9.7-1.6 1.6-1.6zm0 1.2c-.2 0-.4.2-.4.4v6.5c0 .2.2.4.4.4h6.1l1.5 1.1V4c0-.2-.2-.4-.4-.4H2.2zM3.4 5.2h5.2v1H3.4zm0 2.1h4.2v1H3.4zm0 2.1h3.4v1H3.4zM11.4 4.1h2.2c.8 0 1.4.6 1.4 1.4v7.1c0 .4-.5.7-.8.4l-1.7-1.3h-1.1V4.1zm1.2 1.2v5.4l.7.5V5.5c0-.1-.1-.2-.2-.2h-.5z" }) }) }),
12689
12768
  /* @__PURE__ */ jsx10("span", { children: messages.insertBibliography })
12690
12769
  ] }),
12691
- /* @__PURE__ */ jsxs8("button", { type: "button", role: "menuitem", title: messages.manageReferences, onClick: () => runReferenceAction(onManageReferences), children: [
12770
+ /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", title: messages.manageReferences, onClick: () => runReferenceAction(onManageReferences), children: [
12692
12771
  /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "\u2630" }),
12693
12772
  /* @__PURE__ */ jsx10("span", { children: messages.manageReferences })
12694
12773
  ] }),
12695
- /* @__PURE__ */ jsxs8("button", { type: "button", role: "menuitem", title: messages.manageLabels, onClick: () => runReferenceAction(onManageLabels), children: [
12774
+ /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", title: messages.manageLabels, onClick: () => runReferenceAction(onManageLabels), children: [
12696
12775
  /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "\u2317" }),
12697
12776
  /* @__PURE__ */ jsx10("span", { children: messages.manageLabels })
12698
12777
  ] })
@@ -12700,7 +12779,7 @@ function DocumentInsertToolbar({
12700
12779
  }
12701
12780
  ) : null
12702
12781
  ] }) }),
12703
- /* @__PURE__ */ jsxs8("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.lists, children: [
12782
+ /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.lists, children: [
12704
12783
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.bulletedList, "aria-label": messages.bulletedList, onClick: onAddList, children: "\u2022\u2261" }),
12705
12784
  /* @__PURE__ */ jsx10("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.numberedList, "aria-label": messages.numberedList, onClick: onAddEnumerate, children: "1." })
12706
12785
  ] }),
@@ -12710,9 +12789,9 @@ function DocumentInsertToolbar({
12710
12789
  }
12711
12790
 
12712
12791
  // src/react-document2/DocumentPreview.tsx
12713
- import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
12792
+ import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
12714
12793
  function PreviewInlines({ inlines, output }) {
12715
- return /* @__PURE__ */ jsx11(Fragment2, { children: inlines.map((inline, index) => {
12794
+ return /* @__PURE__ */ jsx11(Fragment3, { children: inlines.map((inline, index) => {
12716
12795
  if (inline.kind === "text") {
12717
12796
  let content = /* @__PURE__ */ jsx11("span", { children: inline.text });
12718
12797
  if (inline.style?.bold) {
@@ -12753,8 +12832,8 @@ function PreviewBlock({
12753
12832
  if (!numberLabel && !caption) {
12754
12833
  return null;
12755
12834
  }
12756
- return /* @__PURE__ */ jsxs9("figcaption", { dir: documentDirection, children: [
12757
- numberLabel ? /* @__PURE__ */ jsxs9("span", { className: "butex-document2-widget__preview-float-number", children: [
12835
+ return /* @__PURE__ */ jsxs10("figcaption", { dir: documentDirection, children: [
12836
+ numberLabel ? /* @__PURE__ */ jsxs10("span", { className: "butex-document2-widget__preview-float-number", children: [
12758
12837
  numberLabel,
12759
12838
  caption ? floatCaptionSeparator : ""
12760
12839
  ] }) : null,
@@ -12771,9 +12850,9 @@ function PreviewBlock({
12771
12850
  );
12772
12851
  }
12773
12852
  if (block.kind === "titleBlock") {
12774
- return /* @__PURE__ */ jsxs9("header", { className: "butex-document2-widget__preview-title-block", children: [
12853
+ return /* @__PURE__ */ jsxs10("header", { className: "butex-document2-widget__preview-title-block", children: [
12775
12854
  block.title ? /* @__PURE__ */ jsx11("h1", { className: "butex-document2-widget__preview-article-title", children: block.title }) : null,
12776
- block.authors ? /* @__PURE__ */ jsx11("p", { className: "butex-document2-widget__preview-article-authors", children: block.authors.split("\n").map((line, index) => /* @__PURE__ */ jsxs9("span", { children: [
12855
+ block.authors ? /* @__PURE__ */ jsx11("p", { className: "butex-document2-widget__preview-article-authors", children: block.authors.split("\n").map((line, index) => /* @__PURE__ */ jsxs10("span", { children: [
12777
12856
  index > 0 ? /* @__PURE__ */ jsx11("br", {}) : null,
12778
12857
  line
12779
12858
  ] }, index)) }) : null,
@@ -12781,7 +12860,7 @@ function PreviewBlock({
12781
12860
  ] });
12782
12861
  }
12783
12862
  if (block.kind === "abstract") {
12784
- return /* @__PURE__ */ jsxs9("section", { className: "butex-document2-widget__preview-abstract", "aria-label": messages.articleAbstract, children: [
12863
+ return /* @__PURE__ */ jsxs10("section", { className: "butex-document2-widget__preview-abstract", "aria-label": messages.articleAbstract, children: [
12785
12864
  /* @__PURE__ */ jsx11("h2", { className: "butex-document2-widget__preview-abstract-label", children: messages.articleAbstract }),
12786
12865
  /* @__PURE__ */ jsx11("p", { children: block.text })
12787
12866
  ] });
@@ -12795,7 +12874,7 @@ function PreviewBlock({
12795
12874
  }
12796
12875
  if (block.kind === "list") {
12797
12876
  const Tag = block.ordered ? "ol" : "ul";
12798
- return /* @__PURE__ */ jsx11(Tag, { "data-butex-block-source": source, children: block.items.map((item) => /* @__PURE__ */ jsxs9("li", { children: [
12877
+ return /* @__PURE__ */ jsx11(Tag, { "data-butex-block-source": source, children: block.items.map((item) => /* @__PURE__ */ jsxs10("li", { children: [
12799
12878
  /* @__PURE__ */ jsx11(PreviewInlines, { inlines: item.inlines, output }),
12800
12879
  item.blocks.map((child) => /* @__PURE__ */ jsx11(
12801
12880
  PreviewBlock,
@@ -12815,28 +12894,28 @@ function PreviewBlock({
12815
12894
  return null;
12816
12895
  }
12817
12896
  if (block.kind === "table") {
12818
- return /* @__PURE__ */ jsxs9("figure", { className: "butex-document2-widget__preview-float", "data-butex-block-source": source, children: [
12897
+ return /* @__PURE__ */ jsxs10("figure", { className: "butex-document2-widget__preview-float", "data-butex-block-source": source, children: [
12819
12898
  /* @__PURE__ */ jsx11("table", { children: /* @__PURE__ */ jsx11("tbody", { children: block.rows.map((row, rowIndex) => /* @__PURE__ */ jsx11("tr", { children: row.map((cell, columnIndex) => /* @__PURE__ */ jsx11("td", { children: /* @__PURE__ */ jsx11(PreviewInlines, { inlines: cell, output }) }, columnIndex)) }, rowIndex)) }) }),
12820
12899
  /* @__PURE__ */ jsx11(FloatCaption, { numberLabel: block.numberLabel, caption: block.caption })
12821
12900
  ] });
12822
12901
  }
12823
12902
  if (block.kind === "image") {
12824
12903
  const src = resolveImageUrl ? resolveImageUrl({ assetId: block.assetId, value: block.src }) : block.src;
12825
- return /* @__PURE__ */ jsxs9("figure", { className: "butex-document2-widget__preview-float", "data-butex-block-source": source, children: [
12904
+ return /* @__PURE__ */ jsxs10("figure", { className: "butex-document2-widget__preview-float", "data-butex-block-source": source, children: [
12826
12905
  /* @__PURE__ */ jsx11("img", { src, alt: block.caption ?? "" }),
12827
12906
  /* @__PURE__ */ jsx11(FloatCaption, { numberLabel: block.numberLabel, caption: block.caption })
12828
12907
  ] });
12829
12908
  }
12830
12909
  if (block.kind === "bibliography") {
12831
- return /* @__PURE__ */ jsx11("ol", { className: "butex-document2-widget__preview-bibliography", "data-butex-block-source": source, children: block.items.map((item) => /* @__PURE__ */ jsxs9("li", { children: [
12832
- /* @__PURE__ */ jsxs9("span", { className: "butex-document2-widget__preview-bib-number", children: [
12910
+ return /* @__PURE__ */ jsx11("ol", { className: "butex-document2-widget__preview-bibliography", "data-butex-block-source": source, children: block.items.map((item) => /* @__PURE__ */ jsxs10("li", { children: [
12911
+ /* @__PURE__ */ jsxs10("span", { className: "butex-document2-widget__preview-bib-number", children: [
12833
12912
  item.numberLabel,
12834
12913
  "."
12835
12914
  ] }),
12836
12915
  " ",
12837
- /* @__PURE__ */ jsxs9("span", { children: [
12916
+ /* @__PURE__ */ jsxs10("span", { children: [
12838
12917
  bibliographyEntryBody(item, item.fieldSeparator, { digitForm }),
12839
- item.url ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
12918
+ item.url ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
12840
12919
  " ",
12841
12920
  /* @__PURE__ */ jsx11("a", { href: absoluteHttpHref(item.url), target: "_blank", rel: "noreferrer", children: item.url })
12842
12921
  ] }) : null
@@ -12856,7 +12935,7 @@ function DocumentPreview({
12856
12935
  const messages = document2Messages(uiLocale);
12857
12936
  const resolvedDigitForm = digitForm ?? (documentDirection === "rtl" ? "arabicIndic" : "western");
12858
12937
  const hasBody = blocks.some(isBodyPreviewBlock);
12859
- return /* @__PURE__ */ jsxs9("div", { className: "butex-document2-widget__preview", dir: documentDirection, children: [
12938
+ return /* @__PURE__ */ jsxs10("div", { className: "butex-document2-widget__preview", dir: documentDirection, children: [
12860
12939
  blocks.map((block) => /* @__PURE__ */ jsx11(
12861
12940
  PreviewBlock,
12862
12941
  {
@@ -13886,7 +13965,7 @@ function injectWidgetChromeCss(doc) {
13886
13965
  }
13887
13966
 
13888
13967
  // src/react/ButexEditor.tsx
13889
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
13968
+ import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
13890
13969
  var DIGIT_FORM_OPTIONS = [
13891
13970
  { id: "western", label: "456" },
13892
13971
  { id: "arabicIndic", label: "\u0664\u0665\u0666" },
@@ -13962,7 +14041,7 @@ function renderArabicCommandLabel(command) {
13962
14041
  if (command.id !== "ln") {
13963
14042
  return command.arabicLabel;
13964
14043
  }
13965
- return /* @__PURE__ */ jsxs10("span", { className: "function-command-label-with-sub", "aria-hidden": "true", children: [
14044
+ return /* @__PURE__ */ jsxs11("span", { className: "function-command-label-with-sub", "aria-hidden": "true", children: [
13966
14045
  /* @__PURE__ */ jsx12("span", { className: "function-command-label-with-sub__base", children: command.arabicLabel }),
13967
14046
  /* @__PURE__ */ jsx12("span", { className: "function-command-label-with-sub__sub", children: "\u0647\u0640" })
13968
14047
  ] });
@@ -14240,14 +14319,14 @@ ${arabic || currentMessages.empty}`;
14240
14319
  className: `butex-widget ${className ?? ""}`.trim(),
14241
14320
  dir: uiLocaleDirection(uiLocale),
14242
14321
  lang: uiLocale,
14243
- children: /* @__PURE__ */ jsxs10("div", { className: "butex-widget-layout", children: [
14244
- /* @__PURE__ */ jsxs10("section", { className: "panel", children: [
14245
- /* @__PURE__ */ jsxs10("div", { className: "toolbar", children: [
14246
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-history", role: "group", "aria-label": messages.undoRedo, children: [
14322
+ children: /* @__PURE__ */ jsxs11("div", { className: "butex-widget-layout", children: [
14323
+ /* @__PURE__ */ jsxs11("section", { className: "panel", children: [
14324
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar", children: [
14325
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-history", role: "group", "aria-label": messages.undoRedo, children: [
14247
14326
  /* @__PURE__ */ jsx12("button", { ref: undoBtnRef, id: "btn-undo", type: "button", className: "icon-btn", title: messages.undo, "aria-label": messages.undo, children: "\u21B7" }),
14248
14327
  /* @__PURE__ */ jsx12("button", { ref: redoBtnRef, id: "btn-redo", type: "button", className: "icon-btn", title: messages.redo, "aria-label": messages.redo, children: "\u21B6" })
14249
14328
  ] }),
14250
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-clipboard", role: "group", "aria-label": messages.clipboard, children: [
14329
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-clipboard", role: "group", "aria-label": messages.clipboard, children: [
14251
14330
  /* @__PURE__ */ jsx12("button", { ref: copyBtnRef, id: "btn-copy", type: "button", className: "icon-btn", title: messages.copy, "aria-label": messages.copy, disabled: true, children: "\u29C9" }),
14252
14331
  /* @__PURE__ */ jsx12("button", { ref: cutBtnRef, id: "btn-cut", type: "button", className: "icon-btn", title: messages.cut, "aria-label": messages.cut, disabled: true, children: "\u2702" }),
14253
14332
  /* @__PURE__ */ jsx12(
@@ -14268,8 +14347,8 @@ ${arabic || currentMessages.empty}`;
14268
14347
  )
14269
14348
  ] }),
14270
14349
  /* @__PURE__ */ jsx12("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.editorSettings, children: /* @__PURE__ */ jsx12("button", { className: "icon-btn accent", type: "button", title: messages.toggleSide, "aria-label": messages.toggleSide, onClick: () => runtimeRef.current?.toggleSide(), children: "\u21C4" }) }),
14271
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-structures", role: "group", "aria-label": messages.structures, children: [
14272
- /* @__PURE__ */ jsxs10(
14350
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-structures", role: "group", "aria-label": messages.structures, children: [
14351
+ /* @__PURE__ */ jsxs11(
14273
14352
  "div",
14274
14353
  {
14275
14354
  className: "delimiter-command-menu",
@@ -14293,7 +14372,7 @@ ${arabic || currentMessages.empty}`;
14293
14372
  children: "()"
14294
14373
  }
14295
14374
  ),
14296
- /* @__PURE__ */ jsxs10("div", { className: "delimiter-command-options", role: "listbox", "aria-label": messages.insertDelimiters, hidden: !delimiterMenuOpen, children: [
14375
+ /* @__PURE__ */ jsxs11("div", { className: "delimiter-command-options", role: "listbox", "aria-label": messages.insertDelimiters, hidden: !delimiterMenuOpen, children: [
14297
14376
  /* @__PURE__ */ jsx12(
14298
14377
  "button",
14299
14378
  {
@@ -14355,7 +14434,7 @@ ${arabic || currentMessages.empty}`;
14355
14434
  /* @__PURE__ */ jsx12("button", { id: "insert-frac", className: "icon-btn frac-icon-btn", type: "button", title: messages.insertFraction, "aria-label": messages.insertFraction, onClick: () => {
14356
14435
  runtimeRef.current?.insertFraction();
14357
14436
  focusSurface();
14358
- }, children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-frac-icon", "aria-hidden": "true", children: [
14437
+ }, children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-frac-icon", "aria-hidden": "true", children: [
14359
14438
  /* @__PURE__ */ jsx12("span", { children: "\u0623" }),
14360
14439
  /* @__PURE__ */ jsx12("span", { children: "\u0628" })
14361
14440
  ] }) }),
@@ -14366,26 +14445,26 @@ ${arabic || currentMessages.empty}`;
14366
14445
  /* @__PURE__ */ jsx12("button", { id: "insert-overset", className: "icon-btn", type: "button", title: messages.insertOverset, "aria-label": messages.insertOverset, onClick: () => {
14367
14446
  runtimeRef.current?.insertOverset();
14368
14447
  focusSurface();
14369
- }, children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-accent-icon toolbar-accent-icon--over", "aria-hidden": "true", children: [
14448
+ }, children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-accent-icon toolbar-accent-icon--over", "aria-hidden": "true", children: [
14370
14449
  /* @__PURE__ */ jsx12("span", { children: "\u2217" }),
14371
14450
  /* @__PURE__ */ jsx12("span", { children: "\u25A1" })
14372
14451
  ] }) }),
14373
14452
  /* @__PURE__ */ jsx12("button", { id: "insert-underset", className: "icon-btn", type: "button", title: messages.insertUnderset, "aria-label": messages.insertUnderset, onClick: () => {
14374
14453
  runtimeRef.current?.insertUnderset();
14375
14454
  focusSurface();
14376
- }, children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-accent-icon toolbar-accent-icon--under", "aria-hidden": "true", children: [
14455
+ }, children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-accent-icon toolbar-accent-icon--under", "aria-hidden": "true", children: [
14377
14456
  /* @__PURE__ */ jsx12("span", { children: "\u25A1" }),
14378
14457
  /* @__PURE__ */ jsx12("span", { children: "\u2217" })
14379
14458
  ] }) }),
14380
14459
  /* @__PURE__ */ jsx12("button", { id: "insert-accent-pair", className: "icon-btn", type: "button", title: messages.insertAccentPair, "aria-label": messages.insertAccentPair, onClick: () => {
14381
14460
  runtimeRef.current?.insertAccentPair();
14382
14461
  focusSurface();
14383
- }, children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-accent-icon toolbar-accent-icon--pair", "aria-hidden": "true", children: [
14462
+ }, children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-accent-icon toolbar-accent-icon--pair", "aria-hidden": "true", children: [
14384
14463
  /* @__PURE__ */ jsx12("span", { children: "\u2217" }),
14385
14464
  /* @__PURE__ */ jsx12("span", { children: "\u25A1" }),
14386
14465
  /* @__PURE__ */ jsx12("span", { children: "\u2217" })
14387
14466
  ] }) }),
14388
- /* @__PURE__ */ jsxs10(
14467
+ /* @__PURE__ */ jsxs11(
14389
14468
  "div",
14390
14469
  {
14391
14470
  className: "function-command-menu operator-command-menu",
@@ -14407,7 +14486,7 @@ ${arabic || currentMessages.empty}`;
14407
14486
  "aria-haspopup": "listbox",
14408
14487
  "aria-expanded": accentMenuOpen,
14409
14488
  onClick: () => setAccentMenuOpen((open) => !open),
14410
- children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-accent-icon toolbar-accent-icon--over", "aria-hidden": "true", children: [
14489
+ children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-accent-icon toolbar-accent-icon--over", "aria-hidden": "true", children: [
14411
14490
  /* @__PURE__ */ jsx12("span", { children: "\u02C6" }),
14412
14491
  /* @__PURE__ */ jsx12("span", { children: "\u25A1" })
14413
14492
  ] })
@@ -14435,7 +14514,7 @@ ${arabic || currentMessages.empty}`;
14435
14514
  }
14436
14515
  )
14437
14516
  ] }),
14438
- /* @__PURE__ */ jsx12("div", { className: "toolbar-group toolbar-environments", role: "group", "aria-label": messages.environments, children: /* @__PURE__ */ jsxs10(
14517
+ /* @__PURE__ */ jsx12("div", { className: "toolbar-group toolbar-environments", role: "group", "aria-label": messages.environments, children: /* @__PURE__ */ jsxs11(
14439
14518
  "div",
14440
14519
  {
14441
14520
  className: "matrix-command-menu",
@@ -14456,7 +14535,7 @@ ${arabic || currentMessages.empty}`;
14456
14535
  "aria-haspopup": "dialog",
14457
14536
  "aria-expanded": matrixMenuOpen,
14458
14537
  onClick: () => setMatrixMenuOpen((open) => !open),
14459
- children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-matrix-icon", "aria-hidden": "true", children: [
14538
+ children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-matrix-icon", "aria-hidden": "true", children: [
14460
14539
  /* @__PURE__ */ jsx12("span", {}),
14461
14540
  /* @__PURE__ */ jsx12("span", {}),
14462
14541
  /* @__PURE__ */ jsx12("span", {}),
@@ -14464,7 +14543,7 @@ ${arabic || currentMessages.empty}`;
14464
14543
  ] })
14465
14544
  }
14466
14545
  ),
14467
- /* @__PURE__ */ jsxs10("div", { className: "matrix-command-popover", role: "dialog", "aria-label": messages.insertEnvironment, hidden: !matrixMenuOpen, children: [
14546
+ /* @__PURE__ */ jsxs11("div", { className: "matrix-command-popover", role: "dialog", "aria-label": messages.insertEnvironment, hidden: !matrixMenuOpen, children: [
14468
14547
  /* @__PURE__ */ jsx12("div", { className: "matrix-style-options", role: "listbox", "aria-label": messages.environmentType, children: [
14469
14548
  { id: "matrix", label: messages.matrix },
14470
14549
  { id: "array", label: messages.array },
@@ -14533,8 +14612,8 @@ ${arabic || currentMessages.empty}`;
14533
14612
  );
14534
14613
  })
14535
14614
  ) }),
14536
- /* @__PURE__ */ jsxs10("div", { className: "matrix-custom-size", children: [
14537
- /* @__PURE__ */ jsxs10("label", { children: [
14615
+ /* @__PURE__ */ jsxs11("div", { className: "matrix-custom-size", children: [
14616
+ /* @__PURE__ */ jsxs11("label", { children: [
14538
14617
  messages.row,
14539
14618
  /* @__PURE__ */ jsx12(
14540
14619
  "input",
@@ -14547,7 +14626,7 @@ ${arabic || currentMessages.empty}`;
14547
14626
  }
14548
14627
  )
14549
14628
  ] }),
14550
- /* @__PURE__ */ jsxs10("label", { children: [
14629
+ /* @__PURE__ */ jsxs11("label", { children: [
14551
14630
  messages.column,
14552
14631
  /* @__PURE__ */ jsx12(
14553
14632
  "input",
@@ -14578,10 +14657,10 @@ ${arabic || currentMessages.empty}`;
14578
14657
  }
14579
14658
  )
14580
14659
  ] }),
14581
- /* @__PURE__ */ jsxs10("div", { className: "matrix-edit-actions", "aria-label": messages.editSelectedEnvironment, children: [
14660
+ /* @__PURE__ */ jsxs11("div", { className: "matrix-edit-actions", "aria-label": messages.editSelectedEnvironment, children: [
14582
14661
  envPaletteMode === "matrix" ? /* @__PURE__ */ jsx12("button", { type: "button", title: messages.applySelectedMatrixStyle, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.setMatrixEnvStyle(matrixStyle), children: messages.applyStyle }) : null,
14583
- envPaletteMode === "array" ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
14584
- /* @__PURE__ */ jsxs10("label", { children: [
14662
+ envPaletteMode === "array" ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
14663
+ /* @__PURE__ */ jsxs11("label", { children: [
14585
14664
  messages.column,
14586
14665
  /* @__PURE__ */ jsx12(
14587
14666
  "input",
@@ -14606,19 +14685,19 @@ ${arabic || currentMessages.empty}`;
14606
14685
  alignment.id
14607
14686
  ))
14608
14687
  ] }) : null,
14609
- /* @__PURE__ */ jsxs10("button", { type: "button", title: messages.addRow, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.addMatrixRow(), children: [
14688
+ /* @__PURE__ */ jsxs11("button", { type: "button", title: messages.addRow, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.addMatrixRow(), children: [
14610
14689
  "+",
14611
14690
  messages.row
14612
14691
  ] }),
14613
- /* @__PURE__ */ jsxs10("button", { type: "button", title: messages.removeRow, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.removeMatrixRow(), children: [
14692
+ /* @__PURE__ */ jsxs11("button", { type: "button", title: messages.removeRow, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.removeMatrixRow(), children: [
14614
14693
  "-",
14615
14694
  messages.row
14616
14695
  ] }),
14617
- /* @__PURE__ */ jsxs10("button", { type: "button", title: messages.addColumn, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.addMatrixColumn(), children: [
14696
+ /* @__PURE__ */ jsxs11("button", { type: "button", title: messages.addColumn, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.addMatrixColumn(), children: [
14618
14697
  "+",
14619
14698
  messages.column
14620
14699
  ] }),
14621
- /* @__PURE__ */ jsxs10("button", { type: "button", title: messages.removeColumn, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.removeMatrixColumn(), children: [
14700
+ /* @__PURE__ */ jsxs11("button", { type: "button", title: messages.removeColumn, onMouseDown: (event) => event.preventDefault(), onClick: () => runtimeRef.current?.removeMatrixColumn(), children: [
14622
14701
  "-",
14623
14702
  messages.column
14624
14703
  ] })
@@ -14627,7 +14706,7 @@ ${arabic || currentMessages.empty}`;
14627
14706
  ]
14628
14707
  }
14629
14708
  ) }),
14630
- /* @__PURE__ */ jsx12("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.spaces, children: /* @__PURE__ */ jsxs10(
14709
+ /* @__PURE__ */ jsx12("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.spaces, children: /* @__PURE__ */ jsxs11(
14631
14710
  "div",
14632
14711
  {
14633
14712
  className: `spacing-command-menu spacing-command-menu--${activeEditorSide}`,
@@ -14648,13 +14727,13 @@ ${arabic || currentMessages.empty}`;
14648
14727
  "aria-haspopup": "listbox",
14649
14728
  "aria-expanded": spacingMenuOpen,
14650
14729
  onClick: () => setSpacingMenuOpen((open) => !open),
14651
- children: /* @__PURE__ */ jsxs10("span", { className: "spacing-command-glyph spacing-command-glyph--positive spacing-command-glyph--level-2", "aria-hidden": "true", children: [
14730
+ children: /* @__PURE__ */ jsxs11("span", { className: "spacing-command-glyph spacing-command-glyph--positive spacing-command-glyph--level-2", "aria-hidden": "true", children: [
14652
14731
  /* @__PURE__ */ jsx12("span", { className: "spacing-command-glyph__bar" }),
14653
14732
  /* @__PURE__ */ jsx12("span", { className: "spacing-command-glyph__arrow", children: activeEditorSide === "arabic" ? "\u2190" : "\u2192" })
14654
14733
  ] })
14655
14734
  }
14656
14735
  ),
14657
- /* @__PURE__ */ jsx12("div", { className: "spacing-command-options", role: "listbox", "aria-label": messages.insertSpace, hidden: !spacingMenuOpen, children: SPACING_COMMANDS.map((command) => /* @__PURE__ */ jsxs10(
14736
+ /* @__PURE__ */ jsx12("div", { className: "spacing-command-options", role: "listbox", "aria-label": messages.insertSpace, hidden: !spacingMenuOpen, children: SPACING_COMMANDS.map((command) => /* @__PURE__ */ jsxs11(
14658
14737
  "button",
14659
14738
  {
14660
14739
  type: "button",
@@ -14668,7 +14747,7 @@ ${arabic || currentMessages.empty}`;
14668
14747
  focusSurface();
14669
14748
  },
14670
14749
  children: [
14671
- /* @__PURE__ */ jsxs10("span", { className: `spacing-command-glyph spacing-command-glyph--${command.spacing.direction} spacing-command-glyph--level-${String(command.spacing.level)}`, "aria-hidden": "true", children: [
14750
+ /* @__PURE__ */ jsxs11("span", { className: `spacing-command-glyph spacing-command-glyph--${command.spacing.direction} spacing-command-glyph--level-${String(command.spacing.level)}`, "aria-hidden": "true", children: [
14672
14751
  command.spacing.direction === "negative" ? /* @__PURE__ */ jsx12("span", { className: "spacing-command-glyph__arrow", children: spacingArrow(command, activeEditorSide) }) : null,
14673
14752
  /* @__PURE__ */ jsx12("span", { className: "spacing-command-glyph__bar" }),
14674
14753
  command.spacing.direction === "positive" ? /* @__PURE__ */ jsx12("span", { className: "spacing-command-glyph__arrow", children: spacingArrow(command, activeEditorSide) }) : null
@@ -14681,8 +14760,8 @@ ${arabic || currentMessages.empty}`;
14681
14760
  ]
14682
14761
  }
14683
14762
  ) }),
14684
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-functions", role: "group", "aria-label": messages.functions, children: [
14685
- /* @__PURE__ */ jsxs10(
14763
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-functions", role: "group", "aria-label": messages.functions, children: [
14764
+ /* @__PURE__ */ jsxs11(
14686
14765
  "div",
14687
14766
  {
14688
14767
  className: "function-command-menu",
@@ -14727,7 +14806,7 @@ ${arabic || currentMessages.empty}`;
14727
14806
  ]
14728
14807
  }
14729
14808
  ),
14730
- /* @__PURE__ */ jsxs10(
14809
+ /* @__PURE__ */ jsxs11(
14731
14810
  "div",
14732
14811
  {
14733
14812
  className: "function-command-menu function-command-menu--limits-series",
@@ -14772,7 +14851,7 @@ ${arabic || currentMessages.empty}`;
14772
14851
  ]
14773
14852
  }
14774
14853
  ),
14775
- /* @__PURE__ */ jsxs10(
14854
+ /* @__PURE__ */ jsxs11(
14776
14855
  "div",
14777
14856
  {
14778
14857
  className: "function-command-menu function-command-menu--function2",
@@ -14817,7 +14896,7 @@ ${arabic || currentMessages.empty}`;
14817
14896
  ]
14818
14897
  }
14819
14898
  ),
14820
- /* @__PURE__ */ jsxs10(
14899
+ /* @__PURE__ */ jsxs11(
14821
14900
  "div",
14822
14901
  {
14823
14902
  className: "function-command-menu function-command-menu--derivative",
@@ -14841,7 +14920,7 @@ ${arabic || currentMessages.empty}`;
14841
14920
  children: DERIVATIVE_COMMANDS[0]?.arabicLabel ?? "\u0621"
14842
14921
  }
14843
14922
  ),
14844
- /* @__PURE__ */ jsxs10("div", { className: "function-command-options", role: "listbox", "aria-label": messages.insertDerivative, hidden: !derivativeMenuOpen, children: [
14923
+ /* @__PURE__ */ jsxs11("div", { className: "function-command-options", role: "listbox", "aria-label": messages.insertDerivative, hidden: !derivativeMenuOpen, children: [
14845
14924
  DERIVATIVE_COMMANDS.map((command) => /* @__PURE__ */ jsx12(
14846
14925
  "button",
14847
14926
  {
@@ -14898,7 +14977,7 @@ ${arabic || currentMessages.empty}`;
14898
14977
  ]
14899
14978
  }
14900
14979
  ),
14901
- /* @__PURE__ */ jsxs10(
14980
+ /* @__PURE__ */ jsxs11(
14902
14981
  "div",
14903
14982
  {
14904
14983
  className: "function-command-menu function-command-menu--groups",
@@ -14944,8 +15023,8 @@ ${arabic || currentMessages.empty}`;
14944
15023
  }
14945
15024
  )
14946
15025
  ] }),
14947
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-operators", role: "group", "aria-label": messages.operations, children: [
14948
- /* @__PURE__ */ jsxs10(
15026
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-operators", role: "group", "aria-label": messages.operations, children: [
15027
+ /* @__PURE__ */ jsxs11(
14949
15028
  "div",
14950
15029
  {
14951
15030
  className: "function-command-menu operator-command-menu",
@@ -14990,7 +15069,7 @@ ${arabic || currentMessages.empty}`;
14990
15069
  ]
14991
15070
  }
14992
15071
  ),
14993
- /* @__PURE__ */ jsxs10(
15072
+ /* @__PURE__ */ jsxs11(
14994
15073
  "div",
14995
15074
  {
14996
15075
  className: "function-command-menu operator-command-menu",
@@ -15035,7 +15114,7 @@ ${arabic || currentMessages.empty}`;
15035
15114
  ]
15036
15115
  }
15037
15116
  ),
15038
- /* @__PURE__ */ jsxs10(
15117
+ /* @__PURE__ */ jsxs11(
15039
15118
  "div",
15040
15119
  {
15041
15120
  className: "function-command-menu operator-command-menu",
@@ -15080,7 +15159,7 @@ ${arabic || currentMessages.empty}`;
15080
15159
  ]
15081
15160
  }
15082
15161
  ),
15083
- /* @__PURE__ */ jsxs10(
15162
+ /* @__PURE__ */ jsxs11(
15084
15163
  "div",
15085
15164
  {
15086
15165
  className: "function-command-menu operator-command-menu",
@@ -15125,7 +15204,7 @@ ${arabic || currentMessages.empty}`;
15125
15204
  ]
15126
15205
  }
15127
15206
  ),
15128
- /* @__PURE__ */ jsxs10(
15207
+ /* @__PURE__ */ jsxs11(
15129
15208
  "div",
15130
15209
  {
15131
15210
  className: "function-command-menu operator-command-menu",
@@ -15171,28 +15250,28 @@ ${arabic || currentMessages.empty}`;
15171
15250
  }
15172
15251
  )
15173
15252
  ] }),
15174
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-scripts", role: "group", "aria-label": messages.scripts, children: [
15175
- /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn", type: "button", title: messages.addSuperscript, "aria-label": messages.addSuperscript, onClick: () => runtimeRef.current?.addSup(), children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-script-icon toolbar-script-icon--sup", "aria-hidden": "true", children: [
15253
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-scripts", role: "group", "aria-label": messages.scripts, children: [
15254
+ /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn", type: "button", title: messages.addSuperscript, "aria-label": messages.addSuperscript, onClick: () => runtimeRef.current?.addSup(), children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-script-icon toolbar-script-icon--sup", "aria-hidden": "true", children: [
15176
15255
  /* @__PURE__ */ jsx12("span", { children: "\u0646" }),
15177
15256
  /* @__PURE__ */ jsx12("span", { children: "\u0633" })
15178
15257
  ] }) }),
15179
- /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn", type: "button", title: messages.addSubscript, "aria-label": messages.addSubscript, onClick: () => runtimeRef.current?.addSub(), children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-script-icon toolbar-script-icon--sub", "aria-hidden": "true", children: [
15258
+ /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn", type: "button", title: messages.addSubscript, "aria-label": messages.addSubscript, onClick: () => runtimeRef.current?.addSub(), children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-script-icon toolbar-script-icon--sub", "aria-hidden": "true", children: [
15180
15259
  /* @__PURE__ */ jsx12("span", { children: "\u0646" }),
15181
15260
  /* @__PURE__ */ jsx12("span", { children: "\u0633" })
15182
15261
  ] }) }),
15183
- /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title: messages.removeSuperscript, "aria-label": messages.removeSuperscript, onClick: () => runtimeRef.current?.removeSup(), children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-remove-script-icon toolbar-remove-script-icon--sup", "aria-hidden": "true", children: [
15262
+ /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title: messages.removeSuperscript, "aria-label": messages.removeSuperscript, onClick: () => runtimeRef.current?.removeSup(), children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-remove-script-icon toolbar-remove-script-icon--sup", "aria-hidden": "true", children: [
15184
15263
  /* @__PURE__ */ jsx12("span", { children: "\u0646" }),
15185
15264
  /* @__PURE__ */ jsx12("span", { children: "\xD7" })
15186
15265
  ] }) }),
15187
- /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title: messages.removeSubscript, "aria-label": messages.removeSubscript, onClick: () => runtimeRef.current?.removeSub(), children: /* @__PURE__ */ jsxs10("span", { className: "toolbar-remove-script-icon toolbar-remove-script-icon--sub", "aria-hidden": "true", children: [
15266
+ /* @__PURE__ */ jsx12("button", { className: "icon-btn script-icon-btn remove-script-btn", type: "button", title: messages.removeSubscript, "aria-label": messages.removeSubscript, onClick: () => runtimeRef.current?.removeSub(), children: /* @__PURE__ */ jsxs11("span", { className: "toolbar-remove-script-icon toolbar-remove-script-icon--sub", "aria-hidden": "true", children: [
15188
15267
  /* @__PURE__ */ jsx12("span", { children: "\u0646" }),
15189
15268
  /* @__PURE__ */ jsx12("span", { children: "\xD7" })
15190
15269
  ] }) })
15191
15270
  ] }),
15192
- /* @__PURE__ */ jsxs10("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.inputStyles, children: [
15271
+ /* @__PURE__ */ jsxs11("div", { className: "toolbar-group toolbar-settings", role: "group", "aria-label": messages.inputStyles, children: [
15193
15272
  /* @__PURE__ */ jsx12("button", { className: "icon-btn delete-node-btn", type: "button", title: messages.deleteSelectedStructure, "aria-label": messages.deleteSelectedStructure, onClick: () => runtimeRef.current?.deleteStructure(), children: "\xD7" }),
15194
15273
  /* @__PURE__ */ jsx12("button", { ref: splitTypingBtnRef, id: "toggle-split-leaf-typing", className: "icon-btn ligature-btn", type: "button", title: messages.toggleLetterMerging, "aria-label": messages.toggleLetterMerging, onClick: () => runtimeRef.current?.toggleSplitLeafTyping(), children: "\u0633\u0635\u0639" }),
15195
- /* @__PURE__ */ jsxs10(
15274
+ /* @__PURE__ */ jsxs11(
15196
15275
  "div",
15197
15276
  {
15198
15277
  className: "character-font-menu",
@@ -15240,7 +15319,7 @@ ${arabic || currentMessages.empty}`;
15240
15319
  ]
15241
15320
  }
15242
15321
  ),
15243
- /* @__PURE__ */ jsxs10(
15322
+ /* @__PURE__ */ jsxs11(
15244
15323
  "div",
15245
15324
  {
15246
15325
  className: "digit-form-menu",
@@ -15317,14 +15396,14 @@ ${arabic || currentMessages.empty}`;
15317
15396
  /* @__PURE__ */ jsx12("div", { ref: renderErrorRef, className: "error", hidden: true })
15318
15397
  ] }),
15319
15398
  /* @__PURE__ */ jsx12("section", { className: "panel panel-preview", "aria-label": messages.renderPreview, children: /* @__PURE__ */ jsx12("div", { ref: mathOutputRef, className: "preview-box" }) }),
15320
- debugEnabled ? /* @__PURE__ */ jsxs10("section", { className: "panel", children: [
15321
- /* @__PURE__ */ jsxs10("div", { className: "dev-strip", children: [
15399
+ debugEnabled ? /* @__PURE__ */ jsxs11("section", { className: "panel", children: [
15400
+ /* @__PURE__ */ jsxs11("div", { className: "dev-strip", children: [
15322
15401
  /* @__PURE__ */ jsx12("span", { className: "dev-badge", children: messages.development }),
15323
15402
  /* @__PURE__ */ jsx12("div", { ref: latexLinesRef, className: "ascii" }),
15324
15403
  /* @__PURE__ */ jsx12("div", { ref: passivePreviewRef, className: "passive-preview-text" })
15325
15404
  ] }),
15326
- /* @__PURE__ */ jsxs10("div", { style: { marginTop: 12 }, children: [
15327
- /* @__PURE__ */ jsxs10("div", { className: "debug-head", children: [
15405
+ /* @__PURE__ */ jsxs11("div", { style: { marginTop: 12 }, children: [
15406
+ /* @__PURE__ */ jsxs11("div", { className: "debug-head", children: [
15328
15407
  /* @__PURE__ */ jsx12("button", { type: "button", onClick: () => void copyDebugText(currentMathObjectJsonText()), children: "Copy MathObject JSON" }),
15329
15408
  /* @__PURE__ */ jsx12("button", { type: "button", "aria-expanded": debugImportOpen, onClick: openDebugMathObjectImport, children: "Import MathObject JSON" }),
15330
15409
  /* @__PURE__ */ jsx12(
@@ -15362,7 +15441,7 @@ ${arabic || currentMessages.empty}`;
15362
15441
  }
15363
15442
  )
15364
15443
  ] }),
15365
- debugImportOpen ? /* @__PURE__ */ jsxs10("div", { className: "debug-json-import", children: [
15444
+ debugImportOpen ? /* @__PURE__ */ jsxs11("div", { className: "debug-json-import", children: [
15366
15445
  /* @__PURE__ */ jsx12(
15367
15446
  "textarea",
15368
15447
  {
@@ -15375,7 +15454,7 @@ ${arabic || currentMessages.empty}`;
15375
15454
  }
15376
15455
  }
15377
15456
  ),
15378
- /* @__PURE__ */ jsxs10("div", { className: "debug-head", children: [
15457
+ /* @__PURE__ */ jsxs11("div", { className: "debug-head", children: [
15379
15458
  /* @__PURE__ */ jsx12("button", { type: "button", onClick: applyDebugMathObjectImport, children: "Apply" }),
15380
15459
  /* @__PURE__ */ jsx12(
15381
15460
  "button",
@@ -15402,7 +15481,7 @@ ${arabic || currentMessages.empty}`;
15402
15481
  ButexEditor.displayName = "ButexEditor";
15403
15482
 
15404
15483
  // src/react-document2/EquationDrawer.tsx
15405
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
15484
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
15406
15485
  function keyErrorMessage2(error, messages) {
15407
15486
  if (error === "empty") {
15408
15487
  return messages.keyEmpty;
@@ -15456,7 +15535,7 @@ function EquationDrawer({
15456
15535
  window.addEventListener("keydown", onKeyDown);
15457
15536
  return () => window.removeEventListener("keydown", onKeyDown);
15458
15537
  }, [onClose]);
15459
- return /* @__PURE__ */ jsxs11("div", { className: "butex-document2-widget__equation-modal", role: "presentation", children: [
15538
+ return /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__equation-modal", role: "presentation", children: [
15460
15539
  /* @__PURE__ */ jsx13(
15461
15540
  "button",
15462
15541
  {
@@ -15466,7 +15545,7 @@ function EquationDrawer({
15466
15545
  onClick: onClose
15467
15546
  }
15468
15547
  ),
15469
- /* @__PURE__ */ jsxs11(
15548
+ /* @__PURE__ */ jsxs12(
15470
15549
  "div",
15471
15550
  {
15472
15551
  className: "butex-document2-widget__equation-modal-panel",
@@ -15476,22 +15555,22 @@ function EquationDrawer({
15476
15555
  dir: uiLocaleDirection(uiLocale),
15477
15556
  lang: uiLocale,
15478
15557
  children: [
15479
- /* @__PURE__ */ jsxs11("div", { className: "butex-document2-widget__row", children: [
15558
+ /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__row", children: [
15480
15559
  /* @__PURE__ */ jsx13("strong", { id: "butex-document2-equation-modal-title", children: messages.equationEditorTitle }),
15481
15560
  /* @__PURE__ */ jsx13("button", { type: "button", onClick: onClose, children: messages.close })
15482
15561
  ] }),
15483
- /* @__PURE__ */ jsxs11("div", { className: "butex-document2-widget__row", role: "group", "aria-label": messages.equationType, children: [
15484
- /* @__PURE__ */ jsxs11("button", { type: "button", "aria-pressed": mathMode === "inline", onClick: () => onMathModeChange("inline"), children: [
15562
+ /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__row", role: "group", "aria-label": messages.equationType, children: [
15563
+ /* @__PURE__ */ jsxs12("button", { type: "button", "aria-pressed": mathMode === "inline", onClick: () => onMathModeChange("inline"), children: [
15485
15564
  messages.inline,
15486
15565
  " ($)"
15487
15566
  ] }),
15488
- /* @__PURE__ */ jsxs11("button", { type: "button", "aria-pressed": mathMode === "display", onClick: () => onMathModeChange("display"), children: [
15567
+ /* @__PURE__ */ jsxs12("button", { type: "button", "aria-pressed": mathMode === "display", onClick: () => onMathModeChange("display"), children: [
15489
15568
  messages.displayed,
15490
15569
  " (\\\\[)"
15491
15570
  ] })
15492
15571
  ] }),
15493
- mathMode === "display" ? /* @__PURE__ */ jsxs11("div", { className: "butex-document2-widget__float-meta", children: [
15494
- /* @__PURE__ */ jsxs11("label", { className: "butex-document2-widget__float-meta-toggle", children: [
15572
+ mathMode === "display" ? /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__float-meta", children: [
15573
+ /* @__PURE__ */ jsxs12("label", { className: "butex-document2-widget__float-meta-toggle", children: [
15495
15574
  /* @__PURE__ */ jsx13(
15496
15575
  "input",
15497
15576
  {
@@ -15502,7 +15581,7 @@ function EquationDrawer({
15502
15581
  ),
15503
15582
  /* @__PURE__ */ jsx13("span", { children: messages.labelToggle })
15504
15583
  ] }),
15505
- labelEnabled ? /* @__PURE__ */ jsxs11("label", { className: "butex-document2-widget__refs-field", children: [
15584
+ labelEnabled ? /* @__PURE__ */ jsxs12("label", { className: "butex-document2-widget__refs-field", children: [
15506
15585
  /* @__PURE__ */ jsx13("span", { children: messages.floatLabel }),
15507
15586
  /* @__PURE__ */ jsx13(
15508
15587
  "input",
@@ -15543,7 +15622,7 @@ function EquationDrawer({
15543
15622
  }
15544
15623
  }
15545
15624
  ),
15546
- /* @__PURE__ */ jsxs11("div", { className: "butex-document2-widget__row", children: [
15625
+ /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__row", children: [
15547
15626
  canDelete && onDelete ? /* @__PURE__ */ jsx13("button", { type: "button", className: "butex-document2-widget__button--danger", onClick: onDelete, children: messages.deleteEquation }) : null,
15548
15627
  /* @__PURE__ */ jsx13(
15549
15628
  "button",
@@ -15563,7 +15642,7 @@ function EquationDrawer({
15563
15642
 
15564
15643
  // src/react-document2/LabelsPanel.tsx
15565
15644
  import { useState as useState9 } from "react";
15566
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
15645
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
15567
15646
  function keyErrorMessage3(error, messages) {
15568
15647
  if (error === "empty") {
15569
15648
  return messages.keyEmpty;
@@ -15592,7 +15671,7 @@ function LabelsPanel({
15592
15671
  if (!open) {
15593
15672
  return null;
15594
15673
  }
15595
- return /* @__PURE__ */ jsx14("div", { className: "butex-document2-widget__refs-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs12(
15674
+ return /* @__PURE__ */ jsx14("div", { className: "butex-document2-widget__refs-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs13(
15596
15675
  "div",
15597
15676
  {
15598
15677
  className: "butex-document2-widget__refs-panel",
@@ -15600,7 +15679,7 @@ function LabelsPanel({
15600
15679
  "aria-label": messages.labelsTitle,
15601
15680
  onClick: (event) => event.stopPropagation(),
15602
15681
  children: [
15603
- /* @__PURE__ */ jsxs12("header", { className: "butex-document2-widget__refs-header", children: [
15682
+ /* @__PURE__ */ jsxs13("header", { className: "butex-document2-widget__refs-header", children: [
15604
15683
  /* @__PURE__ */ jsx14("strong", { children: messages.labelsTitle }),
15605
15684
  /* @__PURE__ */ jsx14("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.close, "aria-label": messages.close, onClick: onClose, children: "\xD7" })
15606
15685
  ] }),
@@ -15619,8 +15698,8 @@ function LabelsPanel({
15619
15698
  labels,
15620
15699
  excludeOwnerId: entry.ownerId
15621
15700
  });
15622
- return /* @__PURE__ */ jsxs12("li", { className: "butex-document2-widget__refs-item", children: [
15623
- /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__refs-item-head", children: [
15701
+ return /* @__PURE__ */ jsxs13("li", { className: "butex-document2-widget__refs-item", children: [
15702
+ /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-item-head", children: [
15624
15703
  /* @__PURE__ */ jsx14("strong", { children: title }),
15625
15704
  /* @__PURE__ */ jsx14("span", { className: "butex-document2-widget__refs-item-key", children: entry.key })
15626
15705
  ] }),
@@ -15633,8 +15712,8 @@ function LabelsPanel({
15633
15712
  children: captionPreview
15634
15713
  }
15635
15714
  ),
15636
- /* @__PURE__ */ jsxs12("div", { className: "butex-document2-widget__refs-grid", children: [
15637
- /* @__PURE__ */ jsxs12("label", { className: "butex-document2-widget__refs-field", children: [
15715
+ /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-grid", children: [
15716
+ /* @__PURE__ */ jsxs13("label", { className: "butex-document2-widget__refs-field", children: [
15638
15717
  /* @__PURE__ */ jsx14("span", { children: messages.floatLabel }),
15639
15718
  /* @__PURE__ */ jsx14(
15640
15719
  "input",
@@ -15668,7 +15747,7 @@ function LabelsPanel({
15668
15747
  ),
15669
15748
  entryKeyError !== null ? /* @__PURE__ */ jsx14("p", { className: "butex-document2-widget__field-error", children: entryKeyError === "invalid" ? messages.keyRulesHint : keyErrorMessage3(entryKeyError, messages) }) : null
15670
15749
  ] }),
15671
- entry.kind === "fig" || entry.kind === "tab" ? /* @__PURE__ */ jsxs12("label", { className: "butex-document2-widget__refs-field", children: [
15750
+ entry.kind === "fig" || entry.kind === "tab" ? /* @__PURE__ */ jsxs13("label", { className: "butex-document2-widget__refs-field", children: [
15672
15751
  /* @__PURE__ */ jsx14("span", { children: messages.floatCaption }),
15673
15752
  /* @__PURE__ */ jsx14(
15674
15753
  "input",
@@ -15694,7 +15773,7 @@ function LabelsPanel({
15694
15773
 
15695
15774
  // src/react-document2/ReferencesPanel.tsx
15696
15775
  import { useMemo, useState as useState10 } from "react";
15697
- import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
15776
+ import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
15698
15777
  var EMPTY_DRAFT = {
15699
15778
  key: "",
15700
15779
  authors: "",
@@ -15729,9 +15808,9 @@ function FieldSeparatorToggle({
15729
15808
  messages,
15730
15809
  onChange
15731
15810
  }) {
15732
- return /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-field butex-document2-widget__refs-separator", children: [
15811
+ return /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-field butex-document2-widget__refs-separator", children: [
15733
15812
  /* @__PURE__ */ jsx15("span", { children: messages.referenceFieldSeparator }),
15734
- /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-separator-toggle", role: "group", "aria-label": messages.referenceFieldSeparator, children: [
15813
+ /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-separator-toggle", role: "group", "aria-label": messages.referenceFieldSeparator, children: [
15735
15814
  /* @__PURE__ */ jsx15(
15736
15815
  "button",
15737
15816
  {
@@ -15772,20 +15851,20 @@ function ReferencePreview({
15772
15851
  digitForm
15773
15852
  }) {
15774
15853
  const body = bibliographyEntryBody({ authors, title, venue, year, fieldSeparator }, fieldSeparator, { digitForm });
15775
- return /* @__PURE__ */ jsxs13(
15854
+ return /* @__PURE__ */ jsxs14(
15776
15855
  "div",
15777
15856
  {
15778
15857
  className: "butex-document2-widget__modal-preview",
15779
15858
  dir: uiLocaleDirection(uiLocale),
15780
15859
  "aria-label": messages.referencePreview,
15781
15860
  children: [
15782
- numberLabel ? /* @__PURE__ */ jsxs13("span", { className: "butex-document2-widget__modal-preview-number", children: [
15861
+ numberLabel ? /* @__PURE__ */ jsxs14("span", { className: "butex-document2-widget__modal-preview-number", children: [
15783
15862
  "[",
15784
15863
  numberLabel,
15785
15864
  "] "
15786
15865
  ] }) : null,
15787
15866
  body.length > 0 ? body : /* @__PURE__ */ jsx15("span", { className: "butex-document2-widget__cite-picker-empty", children: "\u2026" }),
15788
- url.trim().length > 0 ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
15867
+ url.trim().length > 0 ? /* @__PURE__ */ jsxs14(Fragment5, { children: [
15789
15868
  " ",
15790
15869
  /* @__PURE__ */ jsx15("span", { className: "butex-document2-widget__modal-preview-url", children: url.trim() })
15791
15870
  ] }) : null
@@ -15821,7 +15900,7 @@ function ReferencesPanel({
15821
15900
  if (!open) {
15822
15901
  return null;
15823
15902
  }
15824
- return /* @__PURE__ */ jsx15("div", { className: "butex-document2-widget__refs-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs13(
15903
+ return /* @__PURE__ */ jsx15("div", { className: "butex-document2-widget__refs-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs14(
15825
15904
  "div",
15826
15905
  {
15827
15906
  className: "butex-document2-widget__refs-panel",
@@ -15829,14 +15908,14 @@ function ReferencesPanel({
15829
15908
  "aria-label": messages.referencesTitle,
15830
15909
  onClick: (event) => event.stopPropagation(),
15831
15910
  children: [
15832
- /* @__PURE__ */ jsxs13("header", { className: "butex-document2-widget__refs-header", children: [
15911
+ /* @__PURE__ */ jsxs14("header", { className: "butex-document2-widget__refs-header", children: [
15833
15912
  /* @__PURE__ */ jsx15("strong", { children: messages.referencesTitle }),
15834
15913
  /* @__PURE__ */ jsx15("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.close, "aria-label": messages.close, onClick: onClose, children: "\xD7" })
15835
15914
  ] }),
15836
- /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-add", children: [
15915
+ /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-add", children: [
15837
15916
  /* @__PURE__ */ jsx15("h3", { children: messages.addReference }),
15838
- /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-grid", children: [
15839
- REFERENCE_FIELDS.map(([field, messageKey]) => /* @__PURE__ */ jsxs13("label", { className: "butex-document2-widget__refs-field", children: [
15917
+ /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-grid", children: [
15918
+ REFERENCE_FIELDS.map(([field, messageKey]) => /* @__PURE__ */ jsxs14("label", { className: "butex-document2-widget__refs-field", children: [
15840
15919
  /* @__PURE__ */ jsx15("span", { children: messages[messageKey] }),
15841
15920
  /* @__PURE__ */ jsx15(
15842
15921
  "input",
@@ -15900,15 +15979,15 @@ function ReferencesPanel({
15900
15979
  excludeReferenceId: reference.id
15901
15980
  });
15902
15981
  const numberLabel = formatBibliographyNumber(index + 1, { documentDirection, digitForm });
15903
- return /* @__PURE__ */ jsxs13("li", { className: "butex-document2-widget__refs-item", children: [
15904
- /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-item-head", children: [
15905
- /* @__PURE__ */ jsxs13("strong", { children: [
15982
+ return /* @__PURE__ */ jsxs14("li", { className: "butex-document2-widget__refs-item", children: [
15983
+ /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-item-head", children: [
15984
+ /* @__PURE__ */ jsxs14("strong", { children: [
15906
15985
  "[",
15907
15986
  numberLabel,
15908
15987
  "] ",
15909
15988
  reference.key
15910
15989
  ] }),
15911
- /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-item-actions", children: [
15990
+ /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-item-actions", children: [
15912
15991
  /* @__PURE__ */ jsx15("button", { type: "button", title: messages.moveUp, "aria-label": messages.moveUp, disabled: index === 0, onClick: () => onMove(reference.id, -1), children: "\u2191" }),
15913
15992
  /* @__PURE__ */ jsx15(
15914
15993
  "button",
@@ -15939,8 +16018,8 @@ function ReferencesPanel({
15939
16018
  digitForm
15940
16019
  }
15941
16020
  ),
15942
- /* @__PURE__ */ jsxs13("div", { className: "butex-document2-widget__refs-grid", children: [
15943
- REFERENCE_FIELDS.map(([field, messageKey]) => /* @__PURE__ */ jsxs13("label", { className: "butex-document2-widget__refs-field", children: [
16021
+ /* @__PURE__ */ jsxs14("div", { className: "butex-document2-widget__refs-grid", children: [
16022
+ REFERENCE_FIELDS.map(([field, messageKey]) => /* @__PURE__ */ jsxs14("label", { className: "butex-document2-widget__refs-field", children: [
15944
16023
  /* @__PURE__ */ jsx15("span", { children: messages[messageKey] }),
15945
16024
  /* @__PURE__ */ jsx15(
15946
16025
  "input",
@@ -15990,7 +16069,7 @@ function ReferencesPanel({
15990
16069
 
15991
16070
  // src/react-document2/RefPickerPopover.tsx
15992
16071
  import { useEffect as useEffect9, useState as useState11 } from "react";
15993
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
16072
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
15994
16073
  function RefPickerPopover({
15995
16074
  open,
15996
16075
  labels,
@@ -16019,7 +16098,7 @@ function RefPickerPopover({
16019
16098
  setSelected([key]);
16020
16099
  setRefCommand(kind === "eq" ? "eqref" : "ref");
16021
16100
  }
16022
- return /* @__PURE__ */ jsx16("div", { className: "butex-document2-widget__cite-picker-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs14(
16101
+ return /* @__PURE__ */ jsx16("div", { className: "butex-document2-widget__cite-picker-backdrop", role: "presentation", onClick: onClose, children: /* @__PURE__ */ jsxs15(
16023
16102
  "div",
16024
16103
  {
16025
16104
  className: "butex-document2-widget__cite-picker",
@@ -16027,7 +16106,7 @@ function RefPickerPopover({
16027
16106
  "aria-label": messages.refPickerTitle,
16028
16107
  onClick: (event) => event.stopPropagation(),
16029
16108
  children: [
16030
- /* @__PURE__ */ jsxs14("header", { className: "butex-document2-widget__cite-picker-header", children: [
16109
+ /* @__PURE__ */ jsxs15("header", { className: "butex-document2-widget__cite-picker-header", children: [
16031
16110
  /* @__PURE__ */ jsx16("strong", { children: messages.refPickerTitle }),
16032
16111
  /* @__PURE__ */ jsx16("button", { type: "button", className: "butex-document2-widget__icon-btn", title: messages.close, "aria-label": messages.close, onClick: onClose, children: "\xD7" })
16033
16112
  ] }),
@@ -16038,10 +16117,10 @@ function RefPickerPopover({
16038
16117
  digitForm,
16039
16118
  documentDirection
16040
16119
  });
16041
- return /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsxs14("label", { className: "butex-document2-widget__cite-picker-item", children: [
16120
+ return /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsxs15("label", { className: "butex-document2-widget__cite-picker-item", children: [
16042
16121
  /* @__PURE__ */ jsx16("input", { type: "radio", name: "butex-ref-key", checked, onChange: () => selectKey(entry.key, entry.kind) }),
16043
- /* @__PURE__ */ jsxs14("span", { children: [
16044
- /* @__PURE__ */ jsxs14("strong", { children: [
16122
+ /* @__PURE__ */ jsxs15("span", { children: [
16123
+ /* @__PURE__ */ jsxs15("strong", { children: [
16045
16124
  title,
16046
16125
  " ",
16047
16126
  /* @__PURE__ */ jsx16("span", { className: "butex-document2-widget__refs-item-key", children: entry.key })
@@ -16050,7 +16129,7 @@ function RefPickerPopover({
16050
16129
  ] })
16051
16130
  ] }) }, `${entry.kind}:${entry.ownerId}`);
16052
16131
  }) }),
16053
- /* @__PURE__ */ jsxs14("footer", { className: "butex-document2-widget__cite-picker-footer", children: [
16132
+ /* @__PURE__ */ jsxs15("footer", { className: "butex-document2-widget__cite-picker-footer", children: [
16054
16133
  onManageLabels ? /* @__PURE__ */ jsx16("button", { type: "button", onClick: onManageLabels, children: messages.manageLabels }) : null,
16055
16134
  /* @__PURE__ */ jsx16("button", { type: "button", onClick: onClose, children: messages.close }),
16056
16135
  /* @__PURE__ */ jsx16(
@@ -17816,7 +17895,7 @@ function injectBuTeXDocument2Styles(doc) {
17816
17895
  }
17817
17896
 
17818
17897
  // src/react-document2/ButexDocumentEditor2.tsx
17819
- import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
17898
+ import { Fragment as Fragment6, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
17820
17899
  function mathDelimiters(mode) {
17821
17900
  return mode === "inline" ? { opening: "$", closing: "$" } : { opening: "\\[", closing: "\\]" };
17822
17901
  }
@@ -18723,8 +18802,8 @@ var ButexDocumentEditor2 = forwardRef2(
18723
18802
  className: ["butex-document2-widget", className].filter(Boolean).join(" "),
18724
18803
  dir: uiLocaleDirection(uiLocale),
18725
18804
  lang: uiLocale,
18726
- children: /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__shell", children: [
18727
- !previewOnly ? /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__toolbar", children: [
18805
+ children: /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__shell", children: [
18806
+ !previewOnly ? /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__toolbar", children: [
18728
18807
  /* @__PURE__ */ jsx17(
18729
18808
  DocumentInsertToolbar,
18730
18809
  {
@@ -18790,17 +18869,17 @@ var ButexDocumentEditor2 = forwardRef2(
18790
18869
  }
18791
18870
  }
18792
18871
  ),
18793
- /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.panels, children: [
18872
+ /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.panels, children: [
18794
18873
  /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": editorOpen, onClick: toggleEditorPanel, children: editorOpen ? messages.hideEditor : messages.editor }),
18795
18874
  /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": previewOpen, onClick: togglePreviewPanel, children: previewOpen ? messages.hidePreview : messages.preview })
18796
18875
  ] }),
18797
- /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.collapseBlocks, children: [
18876
+ /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__toolbar-group", role: "group", "aria-label": messages.collapseBlocks, children: [
18798
18877
  /* @__PURE__ */ jsx17("button", { type: "button", onClick: collapseAllBlocks, children: messages.collapseAll }),
18799
18878
  /* @__PURE__ */ jsx17("button", { type: "button", onClick: openAllBlocks, children: messages.openAll })
18800
18879
  ] })
18801
18880
  ] }) : null,
18802
18881
  error ? /* @__PURE__ */ jsx17("p", { className: "butex-document2-widget__error", children: error }) : null,
18803
- /* @__PURE__ */ jsxs15(
18882
+ /* @__PURE__ */ jsxs16(
18804
18883
  "div",
18805
18884
  {
18806
18885
  className: `butex-document2-widget__layout butex-document2-widget__layout--editor-${showEditorPanel ? "open" : "closed"} butex-document2-widget__layout--preview-${showPreviewPanel ? "open" : "closed"}`,
@@ -18811,7 +18890,7 @@ var ButexDocumentEditor2 = forwardRef2(
18811
18890
  className: "butex-document2-widget__panel butex-document2-widget__editor-panel",
18812
18891
  "aria-label": messages.documentEditor,
18813
18892
  "aria-hidden": !showEditorPanel,
18814
- children: /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__blocks", children: [
18893
+ children: /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__blocks", children: [
18815
18894
  /* @__PURE__ */ jsx17(
18816
18895
  ArticleMetaPanel,
18817
18896
  {
@@ -18920,17 +18999,17 @@ var ButexDocumentEditor2 = forwardRef2(
18920
18999
  ]
18921
19000
  }
18922
19001
  ),
18923
- debugEnabled ? /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__dev", children: [
18924
- debugEnabled && documentNode.diagnostics.length > 0 ? /* @__PURE__ */ jsxs15(Fragment5, { children: [
19002
+ debugEnabled ? /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__dev", children: [
19003
+ debugEnabled && documentNode.diagnostics.length > 0 ? /* @__PURE__ */ jsxs16(Fragment6, { children: [
18925
19004
  /* @__PURE__ */ jsx17("strong", { children: messages.importWarnings }),
18926
19005
  documentNode.diagnostics.map((diagnostic) => /* @__PURE__ */ jsx17("p", { className: "butex-document2-widget__dev-diagnostic", children: formatDocument2Diagnostic(diagnostic, messages) }, `${diagnostic.path}-${diagnostic.message}`))
18927
19006
  ] }) : null,
18928
- /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__dev-actions", children: [
19007
+ /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__dev-actions", children: [
18929
19008
  /* @__PURE__ */ jsx17("button", { type: "button", onClick: () => void copyDebugText(JSON.stringify(documentJson, null, 2)), children: "Copy JSON" }),
18930
19009
  /* @__PURE__ */ jsx17("button", { type: "button", onClick: () => void copyDebugText(latex), children: "Copy TeX" }),
18931
19010
  /* @__PURE__ */ jsx17("button", { type: "button", "aria-expanded": debugImportOpen, onClick: openDebugJsonImport, children: "Import JSON" })
18932
19011
  ] }),
18933
- debugImportOpen ? /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__dev-import", children: [
19012
+ debugImportOpen ? /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__dev-import", children: [
18934
19013
  /* @__PURE__ */ jsx17(
18935
19014
  "textarea",
18936
19015
  {
@@ -18943,7 +19022,7 @@ var ButexDocumentEditor2 = forwardRef2(
18943
19022
  }
18944
19023
  }
18945
19024
  ),
18946
- /* @__PURE__ */ jsxs15("div", { className: "butex-document2-widget__dev-actions", children: [
19025
+ /* @__PURE__ */ jsxs16("div", { className: "butex-document2-widget__dev-actions", children: [
18947
19026
  /* @__PURE__ */ jsx17("button", { type: "button", onClick: applyDebugJsonImport, children: "Apply" }),
18948
19027
  /* @__PURE__ */ jsx17(
18949
19028
  "button",