@univerjs/core 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/lib/cjs/index.js +9 -9
  2. package/lib/es/index.js +2025 -244
  3. package/lib/types/common/const.d.ts +1 -1
  4. package/lib/types/common/equal.d.ts +0 -1
  5. package/lib/types/common/error.d.ts +18 -0
  6. package/lib/types/common/interceptor.d.ts +0 -1
  7. package/lib/types/common/unit.d.ts +3 -1
  8. package/lib/types/docs/data-model/document-data-model.d.ts +4 -4
  9. package/lib/types/docs/data-model/empty-snapshot.d.ts +0 -1
  10. package/lib/types/docs/data-model/json-x/json-x.d.ts +2 -2
  11. package/lib/types/docs/data-model/preset-list-type.d.ts +54 -5
  12. package/lib/types/docs/data-model/replacement.d.ts +0 -1
  13. package/lib/types/docs/data-model/text-x/__tests__/transform-position.spec.d.ts +16 -0
  14. package/lib/types/docs/data-model/text-x/__tests__/transform.spec.d.ts +16 -0
  15. package/lib/types/docs/data-model/text-x/action-iterator.d.ts +0 -1
  16. package/lib/types/docs/data-model/text-x/action-types.d.ts +0 -1
  17. package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +2 -3
  18. package/lib/types/docs/data-model/text-x/apply-utils/delete-apply.d.ts +0 -1
  19. package/lib/types/docs/data-model/text-x/apply-utils/insert-apply.d.ts +0 -1
  20. package/lib/types/docs/data-model/text-x/apply-utils/update-apply.d.ts +0 -1
  21. package/lib/types/docs/data-model/text-x/apply.d.ts +0 -1
  22. package/lib/types/docs/data-model/text-x/text-x.d.ts +31 -2
  23. package/lib/types/docs/data-model/text-x/transform-utils.d.ts +2 -0
  24. package/lib/types/docs/data-model/text-x/utils.d.ts +0 -1
  25. package/lib/types/docs/data-model/types.d.ts +12 -10
  26. package/lib/types/index.d.ts +2 -1
  27. package/lib/types/observer/observable.d.ts +0 -1
  28. package/lib/types/services/__tests__/index.d.ts +0 -1
  29. package/lib/types/services/authz-io/authz-io-local.service.d.ts +2 -3
  30. package/lib/types/services/authz-io/type.d.ts +0 -1
  31. package/lib/types/services/command/command.service.d.ts +0 -1
  32. package/lib/types/services/config/config.service.d.ts +0 -1
  33. package/lib/types/services/context/context.d.ts +3 -1
  34. package/lib/types/services/context/context.service.d.ts +0 -1
  35. package/lib/types/services/error/error.service.d.ts +0 -1
  36. package/lib/types/services/instance/instance.service.d.ts +18 -7
  37. package/lib/types/services/lifecycle/lifecycle.d.ts +0 -1
  38. package/lib/types/services/lifecycle/lifecycle.service.d.ts +0 -1
  39. package/lib/types/services/locale/locale.service.d.ts +0 -1
  40. package/lib/types/services/log/log.service.d.ts +0 -1
  41. package/lib/types/services/permission/permission.service.d.ts +0 -1
  42. package/lib/types/services/permission/type.d.ts +0 -1
  43. package/lib/types/services/plugin/plugin-override.d.ts +0 -1
  44. package/lib/types/services/plugin/plugin.d.ts +0 -1
  45. package/lib/types/services/plugin/plugin.service.d.ts +0 -1
  46. package/lib/types/services/resource-loader/resource-loader.service.d.ts +0 -1
  47. package/lib/types/services/resource-loader/type.d.ts +0 -1
  48. package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -7
  49. package/lib/types/services/resource-manager/type.d.ts +8 -5
  50. package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +0 -1
  51. package/lib/types/services/snapshot/snapshot-server.service.d.ts +0 -1
  52. package/lib/types/services/snapshot/snapshot-transform.d.ts +3 -1
  53. package/lib/types/services/snapshot/snapshot-utils.d.ts +0 -1
  54. package/lib/types/services/theme/theme.service.d.ts +0 -1
  55. package/lib/types/services/undoredo/undoredo.service.d.ts +0 -1
  56. package/lib/types/services/user-manager/const.d.ts +0 -1
  57. package/lib/types/shared/after-init-apply.d.ts +0 -1
  58. package/lib/types/shared/check-if-move.d.ts +0 -1
  59. package/lib/types/shared/clipboard.d.ts +0 -1
  60. package/lib/types/shared/color/color.d.ts +0 -1
  61. package/lib/types/shared/common.d.ts +0 -1
  62. package/lib/types/shared/compare.d.ts +0 -1
  63. package/lib/types/shared/doc-tool.d.ts +0 -1
  64. package/lib/types/shared/index.d.ts +1 -0
  65. package/lib/types/shared/lifecycle.d.ts +0 -1
  66. package/lib/types/shared/lru/lru-map.d.ts +0 -1
  67. package/lib/types/shared/numfmt.d.ts +2 -0
  68. package/lib/types/shared/object-matrix-query.d.ts +0 -1
  69. package/lib/types/shared/object-matrix.d.ts +6 -1
  70. package/lib/types/shared/range.d.ts +0 -1
  71. package/lib/types/shared/rectangle.d.ts +0 -1
  72. package/lib/types/shared/rxjs.d.ts +0 -1
  73. package/lib/types/shared/shape.d.ts +6 -0
  74. package/lib/types/shared/tools.d.ts +11 -1
  75. package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +0 -1
  76. package/lib/types/sheets/column-manager.d.ts +0 -1
  77. package/lib/types/sheets/empty-snapshot.d.ts +0 -1
  78. package/lib/types/sheets/range.d.ts +0 -1
  79. package/lib/types/sheets/row-manager.d.ts +0 -1
  80. package/lib/types/sheets/sheet-snapshot-utils.d.ts +0 -1
  81. package/lib/types/sheets/styles.d.ts +0 -1
  82. package/lib/types/sheets/view-model.d.ts +0 -1
  83. package/lib/types/sheets/workbook.d.ts +1 -1
  84. package/lib/types/sheets/worksheet.d.ts +0 -1
  85. package/lib/types/slides/slide-model.d.ts +18 -4
  86. package/lib/types/types/const/const.d.ts +1 -1
  87. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +0 -1
  88. package/lib/types/types/interfaces/i-cell-data.d.ts +0 -1
  89. package/lib/types/types/interfaces/i-cell-validation-data.d.ts +0 -1
  90. package/lib/types/types/interfaces/i-column-data.d.ts +0 -1
  91. package/lib/types/types/interfaces/i-data-validation.d.ts +0 -1
  92. package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +5 -2
  93. package/lib/types/types/interfaces/i-document-data.d.ts +93 -47
  94. package/lib/types/types/interfaces/i-placeholder.d.ts +0 -1
  95. package/lib/types/types/interfaces/i-row-data.d.ts +0 -1
  96. package/lib/types/types/interfaces/i-selection-data.d.ts +0 -1
  97. package/lib/types/types/interfaces/i-shape-properties.d.ts +0 -1
  98. package/lib/types/types/interfaces/i-slide-data.d.ts +0 -1
  99. package/lib/types/types/interfaces/i-style-data.d.ts +0 -1
  100. package/lib/types/types/interfaces/i-univer-data.d.ts +0 -1
  101. package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -6
  102. package/lib/types/types/interfaces/i-worksheet-data.d.ts +0 -1
  103. package/lib/types/univer.d.ts +0 -1
  104. package/lib/umd/index.js +9 -9
  105. package/package.json +11 -7
package/lib/es/index.js CHANGED
@@ -4,6 +4,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
5
  import { Subject, BehaviorSubject, Observable, filter, merge, timer, map, distinctUntilChanged, skip, of, combineLatest } from "rxjs";
6
6
  import { filter as filter$1, debounceTime, first, map as map$1 } from "rxjs/operators";
7
+ import { Tools as Tools$1, normalizeTextRuns as normalizeTextRuns$1 } from "@univerjs/core";
7
8
  import * as React from "react";
8
9
  import React__default, { useState, useEffect, useRef, useMemo, createContext, useCallback, useContext } from "react";
9
10
  function _mergeNamespaces(n, m) {
@@ -845,7 +846,7 @@ function isCellV(cell) {
845
846
  return cell != null && (typeof cell == "string" || typeof cell == "number" || typeof cell == "boolean");
846
847
  }
847
848
  __name(isCellV, "isCellV");
848
- var DocStyleType = /* @__PURE__ */ ((DocStyleType2) => (DocStyleType2[DocStyleType2.character = 0] = "character", DocStyleType2[DocStyleType2.paragraph = 1] = "paragraph", DocStyleType2[DocStyleType2.table = 2] = "table", DocStyleType2[DocStyleType2.numbering = 3] = "numbering", DocStyleType2))(DocStyleType || {}), FollowNumberWithType = /* @__PURE__ */ ((FollowNumberWithType2) => (FollowNumberWithType2[FollowNumberWithType2.TAB = 0] = "TAB", FollowNumberWithType2[FollowNumberWithType2.SPACE = 1] = "SPACE", FollowNumberWithType2[FollowNumberWithType2.NOTHING = 2] = "NOTHING", FollowNumberWithType2))(FollowNumberWithType || {}), GlyphType = /* @__PURE__ */ ((GlyphType2) => (GlyphType2[GlyphType2.BULLET = 0] = "BULLET", GlyphType2[GlyphType2.NONE = 1] = "NONE", GlyphType2[GlyphType2.DECIMAL = 2] = "DECIMAL", GlyphType2[GlyphType2.DECIMAL_ZERO = 3] = "DECIMAL_ZERO", GlyphType2[GlyphType2.UPPER_LETTER = 4] = "UPPER_LETTER", GlyphType2[GlyphType2.LOWER_LETTER = 5] = "LOWER_LETTER", GlyphType2[GlyphType2.UPPER_ROMAN = 6] = "UPPER_ROMAN", GlyphType2[GlyphType2.LOWER_ROMAN = 7] = "LOWER_ROMAN", GlyphType2[GlyphType2.ORDINAL = 8] = "ORDINAL", GlyphType2[GlyphType2.CARDINAL_TEXT = 9] = "CARDINAL_TEXT", GlyphType2[GlyphType2.ORDINAL_TEXT = 10] = "ORDINAL_TEXT", GlyphType2[GlyphType2.HEX = 11] = "HEX", GlyphType2[GlyphType2.CHICAGO = 12] = "CHICAGO", GlyphType2[GlyphType2.IDEOGRAPH_DIGITAL = 13] = "IDEOGRAPH_DIGITAL", GlyphType2[GlyphType2.JAPANESE_COUNTING = 14] = "JAPANESE_COUNTING", GlyphType2[GlyphType2.AIUEO = 15] = "AIUEO", GlyphType2[GlyphType2.IROHA = 16] = "IROHA", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH = 17] = "DECIMAL_FULL_WIDTH", GlyphType2[GlyphType2.DECIMAL_HALF_WIDTH = 18] = "DECIMAL_HALF_WIDTH", GlyphType2[GlyphType2.JAPANESE_LEGAL = 19] = "JAPANESE_LEGAL", GlyphType2[GlyphType2.JAPANESE_DIGITAL_TEN_THOUSAND = 20] = "JAPANESE_DIGITAL_TEN_THOUSAND", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE = 21] = "DECIMAL_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH2 = 22] = "DECIMAL_FULL_WIDTH2", GlyphType2[GlyphType2.AIUEO_FULL_WIDTH = 23] = "AIUEO_FULL_WIDTH", GlyphType2[GlyphType2.IROHA_FULL_WIDTH = 24] = "IROHA_FULL_WIDTH", GlyphType2[GlyphType2.GANADA = 25] = "GANADA", GlyphType2[GlyphType2.CHOSUNG = 26] = "CHOSUNG", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_FULLSTOP = 27] = "DECIMAL_ENCLOSED_FULLSTOP", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_PAREN = 28] = "DECIMAL_ENCLOSED_PAREN", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE_CHINESE = 29] = "DECIMAL_ENCLOSED_CIRCLE_CHINESE", GlyphType2[GlyphType2.IDEOGRAPH_ENCLOSED_CIRCLE = 30] = "IDEOGRAPH_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.IDEOGRAPH_TRADITIONAL = 31] = "IDEOGRAPH_TRADITIONAL", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC = 32] = "IDEOGRAPH_ZODIAC", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC_TRADITIONAL = 33] = "IDEOGRAPH_ZODIAC_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING = 34] = "TAIWANESE_COUNTING", GlyphType2[GlyphType2.IDEOGRAPH_LEGAL_TRADITIONAL = 35] = "IDEOGRAPH_LEGAL_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING_THOUSAND = 36] = "TAIWANESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.TAIWANESE_DIGITAL = 37] = "TAIWANESE_DIGITAL", GlyphType2[GlyphType2.CHINESE_COUNTING = 38] = "CHINESE_COUNTING", GlyphType2[GlyphType2.CHINESE_LEGAL_SIMPLIFIED = 39] = "CHINESE_LEGAL_SIMPLIFIED", GlyphType2[GlyphType2.CHINESE_COUNTING_THOUSAND = 40] = "CHINESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.KOREAN_DIGITAL = 41] = "KOREAN_DIGITAL", GlyphType2[GlyphType2.KOREAN_COUNTING = 42] = "KOREAN_COUNTING", GlyphType2[GlyphType2.KOREAN_LEGAL = 43] = "KOREAN_LEGAL", GlyphType2[GlyphType2.KOREAN_DIGITAL2 = 44] = "KOREAN_DIGITAL2", GlyphType2[GlyphType2.VIETNAMESE_COUNTING = 45] = "VIETNAMESE_COUNTING", GlyphType2[GlyphType2.RUSSIAN_LOWER = 46] = "RUSSIAN_LOWER", GlyphType2[GlyphType2.RUSSIAN_UPPER = 47] = "RUSSIAN_UPPER", GlyphType2[GlyphType2.NUMBER_IN_DASH = 48] = "NUMBER_IN_DASH", GlyphType2[GlyphType2.HEBREW1 = 49] = "HEBREW1", GlyphType2[GlyphType2.HEBREW2 = 50] = "HEBREW2", GlyphType2[GlyphType2.ARABIC_ALPHA = 51] = "ARABIC_ALPHA", GlyphType2[GlyphType2.ARABIC_ABJAD = 52] = "ARABIC_ABJAD", GlyphType2[GlyphType2.HINDI_VOWELS = 53] = "HINDI_VOWELS", GlyphType2[GlyphType2.HINDI_CONSONANTS = 54] = "HINDI_CONSONANTS", GlyphType2[GlyphType2.HINDI_NUMBERS = 55] = "HINDI_NUMBERS", GlyphType2[GlyphType2.HINDI_COUNTING = 56] = "HINDI_COUNTING", GlyphType2[GlyphType2.THAI_LETTERS = 57] = "THAI_LETTERS", GlyphType2[GlyphType2.THAI_NUMBERS = 58] = "THAI_NUMBERS", GlyphType2[GlyphType2.THAI_COUNTING = 59] = "THAI_COUNTING", GlyphType2[GlyphType2.CUSTOM = 60] = "CUSTOM", GlyphType2))(GlyphType || {}), BulletAlignment = /* @__PURE__ */ ((BulletAlignment2) => (BulletAlignment2[BulletAlignment2.BULLET_ALIGNMENT_UNSPECIFIED = 0] = "BULLET_ALIGNMENT_UNSPECIFIED", BulletAlignment2[BulletAlignment2.START = 1] = "START", BulletAlignment2[BulletAlignment2.CENTER = 2] = "CENTER", BulletAlignment2[BulletAlignment2.END = 3] = "END", BulletAlignment2[BulletAlignment2.BOTH = 4] = "BOTH", BulletAlignment2))(BulletAlignment || {}), CustomRangeType = /* @__PURE__ */ ((CustomRangeType2) => (CustomRangeType2[CustomRangeType2.HYPERLINK = 0] = "HYPERLINK", CustomRangeType2[CustomRangeType2.FIELD = 1] = "FIELD", CustomRangeType2[CustomRangeType2.SDT = 2] = "SDT", CustomRangeType2[CustomRangeType2.BOOKMARK = 3] = "BOOKMARK", CustomRangeType2[CustomRangeType2.COMMENT = 4] = "COMMENT", CustomRangeType2[CustomRangeType2.CUSTOM = 5] = "CUSTOM", CustomRangeType2[CustomRangeType2.MENTION = 6] = "MENTION", CustomRangeType2[CustomRangeType2.UNI_FORMULA = 7] = "UNI_FORMULA", CustomRangeType2))(CustomRangeType || {}), CustomDecorationType = /* @__PURE__ */ ((CustomDecorationType2) => (CustomDecorationType2[CustomDecorationType2.COMMENT = 0] = "COMMENT", CustomDecorationType2))(CustomDecorationType || {}), BlockType = /* @__PURE__ */ ((BlockType2) => (BlockType2[BlockType2.DRAWING = 0] = "DRAWING", BlockType2[BlockType2.CUSTOM = 1] = "CUSTOM", BlockType2))(BlockType || {}), DocumentFlavor = /* @__PURE__ */ ((DocumentFlavor2) => (DocumentFlavor2[DocumentFlavor2.TRADITIONAL = 0] = "TRADITIONAL", DocumentFlavor2[DocumentFlavor2.MODERN = 1] = "MODERN", DocumentFlavor2))(DocumentFlavor || {}), GridType = /* @__PURE__ */ ((GridType2) => (GridType2[GridType2.DEFAULT = 0] = "DEFAULT", GridType2[GridType2.LINES = 1] = "LINES", GridType2[GridType2.LINES_AND_CHARS = 2] = "LINES_AND_CHARS", GridType2[GridType2.SNAP_TO_CHARS = 3] = "SNAP_TO_CHARS", GridType2))(GridType || {}), SectionType = /* @__PURE__ */ ((SectionType2) => (SectionType2[SectionType2.SECTION_TYPE_UNSPECIFIED = 0] = "SECTION_TYPE_UNSPECIFIED", SectionType2[SectionType2.CONTINUOUS = 1] = "CONTINUOUS", SectionType2[SectionType2.NEXT_PAGE = 2] = "NEXT_PAGE", SectionType2[SectionType2.EVEN_PAGE = 3] = "EVEN_PAGE", SectionType2[SectionType2.ODD_PAGE = 4] = "ODD_PAGE", SectionType2))(SectionType || {}), ColumnSeparatorType = /* @__PURE__ */ ((ColumnSeparatorType2) => (ColumnSeparatorType2[ColumnSeparatorType2.COLUMN_SEPARATOR_STYLE_UNSPECIFIED = 0] = "COLUMN_SEPARATOR_STYLE_UNSPECIFIED", ColumnSeparatorType2[ColumnSeparatorType2.NONE = 1] = "NONE", ColumnSeparatorType2[ColumnSeparatorType2.BETWEEN_EACH_COLUMN = 2] = "BETWEEN_EACH_COLUMN", ColumnSeparatorType2))(ColumnSeparatorType || {}), TextDirectionType = /* @__PURE__ */ ((TextDirectionType2) => (TextDirectionType2[TextDirectionType2.NORMAL = 0] = "NORMAL", TextDirectionType2[TextDirectionType2.TBRL = 1] = "TBRL", TextDirectionType2[TextDirectionType2.LRTBV = 2] = "LRTBV", TextDirectionType2))(TextDirectionType || {}), ParagraphElementType = /* @__PURE__ */ ((ParagraphElementType2) => (ParagraphElementType2[ParagraphElementType2.TEXT_RUN = 0] = "TEXT_RUN", ParagraphElementType2[ParagraphElementType2.AUTO_TEXT = 1] = "AUTO_TEXT", ParagraphElementType2[ParagraphElementType2.PAGE_BREAK = 2] = "PAGE_BREAK", ParagraphElementType2[ParagraphElementType2.COLUMN_BREAK = 3] = "COLUMN_BREAK", ParagraphElementType2[ParagraphElementType2.FOOT_NOTE_REFERENCE = 4] = "FOOT_NOTE_REFERENCE", ParagraphElementType2[ParagraphElementType2.HORIZONTAL_RULE = 5] = "HORIZONTAL_RULE", ParagraphElementType2[ParagraphElementType2.EQUATION = 6] = "EQUATION", ParagraphElementType2[ParagraphElementType2.DRAWING = 7] = "DRAWING", ParagraphElementType2[ParagraphElementType2.PERSON = 8] = "PERSON", ParagraphElementType2[ParagraphElementType2.RICH_LINK = 9] = "RICH_LINK", ParagraphElementType2))(ParagraphElementType || {}), WrapTextType = /* @__PURE__ */ ((WrapTextType2) => (WrapTextType2[WrapTextType2.BOTH_SIDES = 0] = "BOTH_SIDES", WrapTextType2[WrapTextType2.LEFT = 1] = "LEFT", WrapTextType2[WrapTextType2.RIGHT = 2] = "RIGHT", WrapTextType2[WrapTextType2.LARGEST = 3] = "LARGEST", WrapTextType2))(WrapTextType || {}), PositionedObjectLayoutType = /* @__PURE__ */ ((PositionedObjectLayoutType2) => (PositionedObjectLayoutType2[PositionedObjectLayoutType2.INLINE = 0] = "INLINE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_NONE = 1] = "WRAP_NONE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_POLYGON = 2] = "WRAP_POLYGON", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_SQUARE = 3] = "WRAP_SQUARE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_THROUGH = 4] = "WRAP_THROUGH", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TIGHT = 5] = "WRAP_TIGHT", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TOP_AND_BOTTOM = 6] = "WRAP_TOP_AND_BOTTOM", PositionedObjectLayoutType2))(PositionedObjectLayoutType || {}), NamedStyleType = /* @__PURE__ */ ((NamedStyleType2) => (NamedStyleType2[NamedStyleType2.NAMED_STYLE_TYPE_UNSPECIFIED = 0] = "NAMED_STYLE_TYPE_UNSPECIFIED", NamedStyleType2[NamedStyleType2.NORMAL_TEXT = 1] = "NORMAL_TEXT", NamedStyleType2[NamedStyleType2.TITLE = 2] = "TITLE", NamedStyleType2[NamedStyleType2.SUBTITLE = 3] = "SUBTITLE", NamedStyleType2[NamedStyleType2.HEADING_1 = 4] = "HEADING_1", NamedStyleType2[NamedStyleType2.HEADING_2 = 5] = "HEADING_2", NamedStyleType2[NamedStyleType2.HEADING_3 = 6] = "HEADING_3", NamedStyleType2[NamedStyleType2.HEADING_4 = 7] = "HEADING_4", NamedStyleType2[NamedStyleType2.HEADING_5 = 8] = "HEADING_5", NamedStyleType2[NamedStyleType2.HEADING_6 = 9] = "HEADING_6", NamedStyleType2))(NamedStyleType || {}), SpacingRule = /* @__PURE__ */ ((SpacingRule2) => (SpacingRule2[SpacingRule2.AUTO = 0] = "AUTO", SpacingRule2[SpacingRule2.AT_LEAST = 1] = "AT_LEAST", SpacingRule2[SpacingRule2.EXACT = 2] = "EXACT", SpacingRule2))(SpacingRule || {}), DashStyleType = /* @__PURE__ */ ((DashStyleType2) => (DashStyleType2[DashStyleType2.DASH_STYLE_UNSPECIFIED = 0] = "DASH_STYLE_UNSPECIFIED", DashStyleType2[DashStyleType2.SOLID = 1] = "SOLID", DashStyleType2[DashStyleType2.DOT = 2] = "DOT", DashStyleType2[DashStyleType2.DASH = 3] = "DASH", DashStyleType2))(DashStyleType || {}), TabStopAlignment = /* @__PURE__ */ ((TabStopAlignment2) => (TabStopAlignment2[TabStopAlignment2.TAB_STOP_ALIGNMENT_UNSPECIFIED = 0] = "TAB_STOP_ALIGNMENT_UNSPECIFIED", TabStopAlignment2[TabStopAlignment2.START = 1] = "START", TabStopAlignment2[TabStopAlignment2.CENTER = 2] = "CENTER", TabStopAlignment2[TabStopAlignment2.END = 3] = "END", TabStopAlignment2))(TabStopAlignment || {}), WidthType = /* @__PURE__ */ ((WidthType2) => (WidthType2.EVENLY_DISTRIBUTED = "0", WidthType2.FIXED_WIDTH = "1", WidthType2))(WidthType || {}), ContentAlignment = /* @__PURE__ */ ((ContentAlignment2) => (ContentAlignment2[ContentAlignment2.CONTENT_ALIGNMENT_UNSPECIFIED = 0] = "CONTENT_ALIGNMENT_UNSPECIFIED", ContentAlignment2[ContentAlignment2.CONTENT_ALIGNMENT_UNSUPPORTED = 1] = "CONTENT_ALIGNMENT_UNSUPPORTED", ContentAlignment2[ContentAlignment2.TOP = 2] = "TOP", ContentAlignment2[ContentAlignment2.MIDDLE = 3] = "MIDDLE", ContentAlignment2[ContentAlignment2.BOTTOM = 4] = "BOTTOM", ContentAlignment2))(ContentAlignment || {}), FontStyleType = /* @__PURE__ */ ((FontStyleType2) => (FontStyleType2.NORMAL = "normal", FontStyleType2.BOLD = "bold", FontStyleType2.ITALIC = "italic", FontStyleType2))(FontStyleType || {}), ObjectRelativeFromH = /* @__PURE__ */ ((ObjectRelativeFromH2) => (ObjectRelativeFromH2[ObjectRelativeFromH2.PAGE = 0] = "PAGE", ObjectRelativeFromH2[ObjectRelativeFromH2.COLUMN = 1] = "COLUMN", ObjectRelativeFromH2[ObjectRelativeFromH2.CHARACTER = 2] = "CHARACTER", ObjectRelativeFromH2[ObjectRelativeFromH2.MARGIN = 3] = "MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.INSIDE_MARGIN = 4] = "INSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.OUTSIDE_MARGIN = 5] = "OUTSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.LEFT_MARGIN = 6] = "LEFT_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.RIGHT_MARGIN = 7] = "RIGHT_MARGIN", ObjectRelativeFromH2))(ObjectRelativeFromH || {}), ObjectRelativeFromV = /* @__PURE__ */ ((ObjectRelativeFromV2) => (ObjectRelativeFromV2[ObjectRelativeFromV2.PAGE = 0] = "PAGE", ObjectRelativeFromV2[ObjectRelativeFromV2.PARAGRAPH = 1] = "PARAGRAPH", ObjectRelativeFromV2[ObjectRelativeFromV2.LINE = 2] = "LINE", ObjectRelativeFromV2[ObjectRelativeFromV2.MARGIN = 3] = "MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.TOP_MARGIN = 4] = "TOP_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.BOTTOM_MARGIN = 5] = "BOTTOM_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.INSIDE_MARGIN = 6] = "INSIDE_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.OUTSIDE_MARGIN = 7] = "OUTSIDE_MARGIN", ObjectRelativeFromV2))(ObjectRelativeFromV || {}), NumberUnitType = /* @__PURE__ */ ((NumberUnitType2) => (NumberUnitType2[NumberUnitType2.POINT = 0] = "POINT", NumberUnitType2[NumberUnitType2.LINE = 1] = "LINE", NumberUnitType2[NumberUnitType2.CHARACTER = 2] = "CHARACTER", NumberUnitType2[NumberUnitType2.PIXEL = 3] = "PIXEL", NumberUnitType2))(NumberUnitType || {}), AlignTypeH = /* @__PURE__ */ ((AlignTypeH2) => (AlignTypeH2[AlignTypeH2.CENTER = 0] = "CENTER", AlignTypeH2[AlignTypeH2.INSIDE = 1] = "INSIDE", AlignTypeH2[AlignTypeH2.LEFT = 2] = "LEFT", AlignTypeH2[AlignTypeH2.OUTSIDE = 3] = "OUTSIDE", AlignTypeH2[AlignTypeH2.RIGHT = 4] = "RIGHT", AlignTypeH2[AlignTypeH2.BOTH = 5] = "BOTH", AlignTypeH2[AlignTypeH2.DISTRIBUTE = 6] = "DISTRIBUTE", AlignTypeH2))(AlignTypeH || {}), AlignTypeV = /* @__PURE__ */ ((AlignTypeV2) => (AlignTypeV2[AlignTypeV2.BOTTOM = 0] = "BOTTOM", AlignTypeV2[AlignTypeV2.CENTER = 1] = "CENTER", AlignTypeV2[AlignTypeV2.INSIDE = 2] = "INSIDE", AlignTypeV2[AlignTypeV2.OUTSIDE = 3] = "OUTSIDE", AlignTypeV2[AlignTypeV2.TOP = 4] = "TOP", AlignTypeV2))(AlignTypeV || {}), characterSpacingControlType = /* @__PURE__ */ ((characterSpacingControlType2) => (characterSpacingControlType2[characterSpacingControlType2.compressPunctuation = 0] = "compressPunctuation", characterSpacingControlType2[characterSpacingControlType2.compressPunctuationAndJapaneseKana = 1] = "compressPunctuationAndJapaneseKana", characterSpacingControlType2[characterSpacingControlType2.doNotCompress = 2] = "doNotCompress", characterSpacingControlType2))(characterSpacingControlType || {}), PageOrientType = /* @__PURE__ */ ((PageOrientType2) => (PageOrientType2[PageOrientType2.PORTRAIT = 0] = "PORTRAIT", PageOrientType2[PageOrientType2.LANDSCAPE = 1] = "LANDSCAPE", PageOrientType2))(PageOrientType || {}), ArrangeTypeEnum = /* @__PURE__ */ ((ArrangeTypeEnum2) => (ArrangeTypeEnum2[ArrangeTypeEnum2.forward = 0] = "forward", ArrangeTypeEnum2[ArrangeTypeEnum2.backward = 1] = "backward", ArrangeTypeEnum2[ArrangeTypeEnum2.front = 2] = "front", ArrangeTypeEnum2[ArrangeTypeEnum2.back = 3] = "back", ArrangeTypeEnum2))(ArrangeTypeEnum || {}), DrawingTypeEnum = /* @__PURE__ */ ((DrawingTypeEnum2) => (DrawingTypeEnum2[DrawingTypeEnum2.UNRECOGNIZED = -1] = "UNRECOGNIZED", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_IMAGE = 0] = "DRAWING_IMAGE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SHAPE = 1] = "DRAWING_SHAPE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_CHART = 2] = "DRAWING_CHART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_TABLE = 3] = "DRAWING_TABLE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SMART_ART = 4] = "DRAWING_SMART_ART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_VIDEO = 5] = "DRAWING_VIDEO", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_GROUP = 6] = "DRAWING_GROUP", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_UNIT = 7] = "DRAWING_UNIT", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_DOM = 8] = "DRAWING_DOM", DrawingTypeEnum2))(DrawingTypeEnum || {}), RANGE_TYPE = /* @__PURE__ */ ((RANGE_TYPE2) => (RANGE_TYPE2[RANGE_TYPE2.NORMAL = 0] = "NORMAL", RANGE_TYPE2[RANGE_TYPE2.ROW = 1] = "ROW", RANGE_TYPE2[RANGE_TYPE2.COLUMN = 2] = "COLUMN", RANGE_TYPE2[RANGE_TYPE2.ALL = 3] = "ALL", RANGE_TYPE2))(RANGE_TYPE || {}), AbsoluteRefType = /* @__PURE__ */ ((AbsoluteRefType2) => (AbsoluteRefType2[AbsoluteRefType2.NONE = 0] = "NONE", AbsoluteRefType2[AbsoluteRefType2.ROW = 1] = "ROW", AbsoluteRefType2[AbsoluteRefType2.COLUMN = 2] = "COLUMN", AbsoluteRefType2[AbsoluteRefType2.ALL = 3] = "ALL", AbsoluteRefType2))(AbsoluteRefType || {});
849
+ var DocStyleType = /* @__PURE__ */ ((DocStyleType2) => (DocStyleType2[DocStyleType2.character = 0] = "character", DocStyleType2[DocStyleType2.paragraph = 1] = "paragraph", DocStyleType2[DocStyleType2.table = 2] = "table", DocStyleType2[DocStyleType2.numbering = 3] = "numbering", DocStyleType2))(DocStyleType || {}), FollowNumberWithType = /* @__PURE__ */ ((FollowNumberWithType2) => (FollowNumberWithType2[FollowNumberWithType2.TAB = 0] = "TAB", FollowNumberWithType2[FollowNumberWithType2.SPACE = 1] = "SPACE", FollowNumberWithType2[FollowNumberWithType2.NOTHING = 2] = "NOTHING", FollowNumberWithType2))(FollowNumberWithType || {}), GlyphType = /* @__PURE__ */ ((GlyphType2) => (GlyphType2[GlyphType2.BULLET = 0] = "BULLET", GlyphType2[GlyphType2.NONE = 1] = "NONE", GlyphType2[GlyphType2.DECIMAL = 2] = "DECIMAL", GlyphType2[GlyphType2.DECIMAL_ZERO = 3] = "DECIMAL_ZERO", GlyphType2[GlyphType2.UPPER_LETTER = 4] = "UPPER_LETTER", GlyphType2[GlyphType2.LOWER_LETTER = 5] = "LOWER_LETTER", GlyphType2[GlyphType2.UPPER_ROMAN = 6] = "UPPER_ROMAN", GlyphType2[GlyphType2.LOWER_ROMAN = 7] = "LOWER_ROMAN", GlyphType2[GlyphType2.ORDINAL = 8] = "ORDINAL", GlyphType2[GlyphType2.CARDINAL_TEXT = 9] = "CARDINAL_TEXT", GlyphType2[GlyphType2.ORDINAL_TEXT = 10] = "ORDINAL_TEXT", GlyphType2[GlyphType2.HEX = 11] = "HEX", GlyphType2[GlyphType2.CHICAGO = 12] = "CHICAGO", GlyphType2[GlyphType2.IDEOGRAPH_DIGITAL = 13] = "IDEOGRAPH_DIGITAL", GlyphType2[GlyphType2.JAPANESE_COUNTING = 14] = "JAPANESE_COUNTING", GlyphType2[GlyphType2.AIUEO = 15] = "AIUEO", GlyphType2[GlyphType2.IROHA = 16] = "IROHA", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH = 17] = "DECIMAL_FULL_WIDTH", GlyphType2[GlyphType2.DECIMAL_HALF_WIDTH = 18] = "DECIMAL_HALF_WIDTH", GlyphType2[GlyphType2.JAPANESE_LEGAL = 19] = "JAPANESE_LEGAL", GlyphType2[GlyphType2.JAPANESE_DIGITAL_TEN_THOUSAND = 20] = "JAPANESE_DIGITAL_TEN_THOUSAND", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE = 21] = "DECIMAL_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.DECIMAL_FULL_WIDTH2 = 22] = "DECIMAL_FULL_WIDTH2", GlyphType2[GlyphType2.AIUEO_FULL_WIDTH = 23] = "AIUEO_FULL_WIDTH", GlyphType2[GlyphType2.IROHA_FULL_WIDTH = 24] = "IROHA_FULL_WIDTH", GlyphType2[GlyphType2.GANADA = 25] = "GANADA", GlyphType2[GlyphType2.CHOSUNG = 26] = "CHOSUNG", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_FULLSTOP = 27] = "DECIMAL_ENCLOSED_FULLSTOP", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_PAREN = 28] = "DECIMAL_ENCLOSED_PAREN", GlyphType2[GlyphType2.DECIMAL_ENCLOSED_CIRCLE_CHINESE = 29] = "DECIMAL_ENCLOSED_CIRCLE_CHINESE", GlyphType2[GlyphType2.IDEOGRAPH_ENCLOSED_CIRCLE = 30] = "IDEOGRAPH_ENCLOSED_CIRCLE", GlyphType2[GlyphType2.IDEOGRAPH_TRADITIONAL = 31] = "IDEOGRAPH_TRADITIONAL", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC = 32] = "IDEOGRAPH_ZODIAC", GlyphType2[GlyphType2.IDEOGRAPH_ZODIAC_TRADITIONAL = 33] = "IDEOGRAPH_ZODIAC_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING = 34] = "TAIWANESE_COUNTING", GlyphType2[GlyphType2.IDEOGRAPH_LEGAL_TRADITIONAL = 35] = "IDEOGRAPH_LEGAL_TRADITIONAL", GlyphType2[GlyphType2.TAIWANESE_COUNTING_THOUSAND = 36] = "TAIWANESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.TAIWANESE_DIGITAL = 37] = "TAIWANESE_DIGITAL", GlyphType2[GlyphType2.CHINESE_COUNTING = 38] = "CHINESE_COUNTING", GlyphType2[GlyphType2.CHINESE_LEGAL_SIMPLIFIED = 39] = "CHINESE_LEGAL_SIMPLIFIED", GlyphType2[GlyphType2.CHINESE_COUNTING_THOUSAND = 40] = "CHINESE_COUNTING_THOUSAND", GlyphType2[GlyphType2.KOREAN_DIGITAL = 41] = "KOREAN_DIGITAL", GlyphType2[GlyphType2.KOREAN_COUNTING = 42] = "KOREAN_COUNTING", GlyphType2[GlyphType2.KOREAN_LEGAL = 43] = "KOREAN_LEGAL", GlyphType2[GlyphType2.KOREAN_DIGITAL2 = 44] = "KOREAN_DIGITAL2", GlyphType2[GlyphType2.VIETNAMESE_COUNTING = 45] = "VIETNAMESE_COUNTING", GlyphType2[GlyphType2.RUSSIAN_LOWER = 46] = "RUSSIAN_LOWER", GlyphType2[GlyphType2.RUSSIAN_UPPER = 47] = "RUSSIAN_UPPER", GlyphType2[GlyphType2.NUMBER_IN_DASH = 48] = "NUMBER_IN_DASH", GlyphType2[GlyphType2.HEBREW1 = 49] = "HEBREW1", GlyphType2[GlyphType2.HEBREW2 = 50] = "HEBREW2", GlyphType2[GlyphType2.ARABIC_ALPHA = 51] = "ARABIC_ALPHA", GlyphType2[GlyphType2.ARABIC_ABJAD = 52] = "ARABIC_ABJAD", GlyphType2[GlyphType2.HINDI_VOWELS = 53] = "HINDI_VOWELS", GlyphType2[GlyphType2.HINDI_CONSONANTS = 54] = "HINDI_CONSONANTS", GlyphType2[GlyphType2.HINDI_NUMBERS = 55] = "HINDI_NUMBERS", GlyphType2[GlyphType2.HINDI_COUNTING = 56] = "HINDI_COUNTING", GlyphType2[GlyphType2.THAI_LETTERS = 57] = "THAI_LETTERS", GlyphType2[GlyphType2.THAI_NUMBERS = 58] = "THAI_NUMBERS", GlyphType2[GlyphType2.THAI_COUNTING = 59] = "THAI_COUNTING", GlyphType2[GlyphType2.CUSTOM = 60] = "CUSTOM", GlyphType2))(GlyphType || {}), BulletAlignment = /* @__PURE__ */ ((BulletAlignment2) => (BulletAlignment2[BulletAlignment2.BULLET_ALIGNMENT_UNSPECIFIED = 0] = "BULLET_ALIGNMENT_UNSPECIFIED", BulletAlignment2[BulletAlignment2.START = 1] = "START", BulletAlignment2[BulletAlignment2.CENTER = 2] = "CENTER", BulletAlignment2[BulletAlignment2.END = 3] = "END", BulletAlignment2[BulletAlignment2.BOTH = 4] = "BOTH", BulletAlignment2))(BulletAlignment || {}), CustomRangeType = /* @__PURE__ */ ((CustomRangeType2) => (CustomRangeType2[CustomRangeType2.HYPERLINK = 0] = "HYPERLINK", CustomRangeType2[CustomRangeType2.FIELD = 1] = "FIELD", CustomRangeType2[CustomRangeType2.SDT = 2] = "SDT", CustomRangeType2[CustomRangeType2.BOOKMARK = 3] = "BOOKMARK", CustomRangeType2[CustomRangeType2.COMMENT = 4] = "COMMENT", CustomRangeType2[CustomRangeType2.CUSTOM = 5] = "CUSTOM", CustomRangeType2[CustomRangeType2.MENTION = 6] = "MENTION", CustomRangeType2[CustomRangeType2.UNI_FORMULA = 7] = "UNI_FORMULA", CustomRangeType2))(CustomRangeType || {}), CustomDecorationType = /* @__PURE__ */ ((CustomDecorationType2) => (CustomDecorationType2[CustomDecorationType2.COMMENT = 0] = "COMMENT", CustomDecorationType2))(CustomDecorationType || {}), BlockType = /* @__PURE__ */ ((BlockType2) => (BlockType2[BlockType2.DRAWING = 0] = "DRAWING", BlockType2[BlockType2.CUSTOM = 1] = "CUSTOM", BlockType2))(BlockType || {}), DocumentFlavor = /* @__PURE__ */ ((DocumentFlavor2) => (DocumentFlavor2[DocumentFlavor2.TRADITIONAL = 0] = "TRADITIONAL", DocumentFlavor2[DocumentFlavor2.MODERN = 1] = "MODERN", DocumentFlavor2))(DocumentFlavor || {}), GridType = /* @__PURE__ */ ((GridType2) => (GridType2[GridType2.DEFAULT = 0] = "DEFAULT", GridType2[GridType2.LINES = 1] = "LINES", GridType2[GridType2.LINES_AND_CHARS = 2] = "LINES_AND_CHARS", GridType2[GridType2.SNAP_TO_CHARS = 3] = "SNAP_TO_CHARS", GridType2))(GridType || {}), SectionType = /* @__PURE__ */ ((SectionType2) => (SectionType2[SectionType2.SECTION_TYPE_UNSPECIFIED = 0] = "SECTION_TYPE_UNSPECIFIED", SectionType2[SectionType2.CONTINUOUS = 1] = "CONTINUOUS", SectionType2[SectionType2.NEXT_PAGE = 2] = "NEXT_PAGE", SectionType2[SectionType2.EVEN_PAGE = 3] = "EVEN_PAGE", SectionType2[SectionType2.ODD_PAGE = 4] = "ODD_PAGE", SectionType2))(SectionType || {}), ColumnSeparatorType = /* @__PURE__ */ ((ColumnSeparatorType2) => (ColumnSeparatorType2[ColumnSeparatorType2.COLUMN_SEPARATOR_STYLE_UNSPECIFIED = 0] = "COLUMN_SEPARATOR_STYLE_UNSPECIFIED", ColumnSeparatorType2[ColumnSeparatorType2.NONE = 1] = "NONE", ColumnSeparatorType2[ColumnSeparatorType2.BETWEEN_EACH_COLUMN = 2] = "BETWEEN_EACH_COLUMN", ColumnSeparatorType2))(ColumnSeparatorType || {}), TextDirectionType = /* @__PURE__ */ ((TextDirectionType2) => (TextDirectionType2[TextDirectionType2.NORMAL = 0] = "NORMAL", TextDirectionType2[TextDirectionType2.TBRL = 1] = "TBRL", TextDirectionType2[TextDirectionType2.LRTBV = 2] = "LRTBV", TextDirectionType2))(TextDirectionType || {}), ParagraphElementType = /* @__PURE__ */ ((ParagraphElementType2) => (ParagraphElementType2[ParagraphElementType2.TEXT_RUN = 0] = "TEXT_RUN", ParagraphElementType2[ParagraphElementType2.AUTO_TEXT = 1] = "AUTO_TEXT", ParagraphElementType2[ParagraphElementType2.PAGE_BREAK = 2] = "PAGE_BREAK", ParagraphElementType2[ParagraphElementType2.COLUMN_BREAK = 3] = "COLUMN_BREAK", ParagraphElementType2[ParagraphElementType2.FOOT_NOTE_REFERENCE = 4] = "FOOT_NOTE_REFERENCE", ParagraphElementType2[ParagraphElementType2.HORIZONTAL_RULE = 5] = "HORIZONTAL_RULE", ParagraphElementType2[ParagraphElementType2.EQUATION = 6] = "EQUATION", ParagraphElementType2[ParagraphElementType2.DRAWING = 7] = "DRAWING", ParagraphElementType2[ParagraphElementType2.PERSON = 8] = "PERSON", ParagraphElementType2[ParagraphElementType2.RICH_LINK = 9] = "RICH_LINK", ParagraphElementType2))(ParagraphElementType || {}), WrapTextType = /* @__PURE__ */ ((WrapTextType2) => (WrapTextType2[WrapTextType2.BOTH_SIDES = 0] = "BOTH_SIDES", WrapTextType2[WrapTextType2.LEFT = 1] = "LEFT", WrapTextType2[WrapTextType2.RIGHT = 2] = "RIGHT", WrapTextType2[WrapTextType2.LARGEST = 3] = "LARGEST", WrapTextType2))(WrapTextType || {}), PositionedObjectLayoutType = /* @__PURE__ */ ((PositionedObjectLayoutType2) => (PositionedObjectLayoutType2[PositionedObjectLayoutType2.INLINE = 0] = "INLINE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_NONE = 1] = "WRAP_NONE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_POLYGON = 2] = "WRAP_POLYGON", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_SQUARE = 3] = "WRAP_SQUARE", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_THROUGH = 4] = "WRAP_THROUGH", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TIGHT = 5] = "WRAP_TIGHT", PositionedObjectLayoutType2[PositionedObjectLayoutType2.WRAP_TOP_AND_BOTTOM = 6] = "WRAP_TOP_AND_BOTTOM", PositionedObjectLayoutType2))(PositionedObjectLayoutType || {}), NamedStyleType = /* @__PURE__ */ ((NamedStyleType2) => (NamedStyleType2[NamedStyleType2.NAMED_STYLE_TYPE_UNSPECIFIED = 0] = "NAMED_STYLE_TYPE_UNSPECIFIED", NamedStyleType2[NamedStyleType2.NORMAL_TEXT = 1] = "NORMAL_TEXT", NamedStyleType2[NamedStyleType2.TITLE = 2] = "TITLE", NamedStyleType2[NamedStyleType2.SUBTITLE = 3] = "SUBTITLE", NamedStyleType2[NamedStyleType2.HEADING_1 = 4] = "HEADING_1", NamedStyleType2[NamedStyleType2.HEADING_2 = 5] = "HEADING_2", NamedStyleType2[NamedStyleType2.HEADING_3 = 6] = "HEADING_3", NamedStyleType2[NamedStyleType2.HEADING_4 = 7] = "HEADING_4", NamedStyleType2[NamedStyleType2.HEADING_5 = 8] = "HEADING_5", NamedStyleType2[NamedStyleType2.HEADING_6 = 9] = "HEADING_6", NamedStyleType2))(NamedStyleType || {}), SpacingRule = /* @__PURE__ */ ((SpacingRule2) => (SpacingRule2[SpacingRule2.AUTO = 0] = "AUTO", SpacingRule2[SpacingRule2.AT_LEAST = 1] = "AT_LEAST", SpacingRule2[SpacingRule2.EXACT = 2] = "EXACT", SpacingRule2))(SpacingRule || {}), DashStyleType = /* @__PURE__ */ ((DashStyleType2) => (DashStyleType2[DashStyleType2.DASH_STYLE_UNSPECIFIED = 0] = "DASH_STYLE_UNSPECIFIED", DashStyleType2[DashStyleType2.SOLID = 1] = "SOLID", DashStyleType2[DashStyleType2.DOT = 2] = "DOT", DashStyleType2[DashStyleType2.DASH = 3] = "DASH", DashStyleType2))(DashStyleType || {}), TabStopAlignment = /* @__PURE__ */ ((TabStopAlignment2) => (TabStopAlignment2[TabStopAlignment2.TAB_STOP_ALIGNMENT_UNSPECIFIED = 0] = "TAB_STOP_ALIGNMENT_UNSPECIFIED", TabStopAlignment2[TabStopAlignment2.START = 1] = "START", TabStopAlignment2[TabStopAlignment2.CENTER = 2] = "CENTER", TabStopAlignment2[TabStopAlignment2.END = 3] = "END", TabStopAlignment2))(TabStopAlignment || {}), TableSizeType = /* @__PURE__ */ ((TableSizeType2) => (TableSizeType2[TableSizeType2.UNSPECIFIED = 0] = "UNSPECIFIED", TableSizeType2[TableSizeType2.SPECIFIED = 1] = "SPECIFIED", TableSizeType2))(TableSizeType || {}), TableAlignmentType = /* @__PURE__ */ ((TableAlignmentType2) => (TableAlignmentType2[TableAlignmentType2.START = 0] = "START", TableAlignmentType2[TableAlignmentType2.CENTER = 1] = "CENTER", TableAlignmentType2[TableAlignmentType2.END = 2] = "END", TableAlignmentType2))(TableAlignmentType || {}), TableLayoutType = /* @__PURE__ */ ((TableLayoutType2) => (TableLayoutType2[TableLayoutType2.AUTO_FIT = 0] = "AUTO_FIT", TableLayoutType2[TableLayoutType2.FIXED = 1] = "FIXED", TableLayoutType2))(TableLayoutType || {}), TableTextWrapType = /* @__PURE__ */ ((TableTextWrapType2) => (TableTextWrapType2[TableTextWrapType2.NONE = 0] = "NONE", TableTextWrapType2[TableTextWrapType2.WRAP = 1] = "WRAP", TableTextWrapType2))(TableTextWrapType || {}), TableCellHeightRule = /* @__PURE__ */ ((TableCellHeightRule2) => (TableCellHeightRule2[TableCellHeightRule2.AUTO = 0] = "AUTO", TableCellHeightRule2[TableCellHeightRule2.AT_LEAST = 1] = "AT_LEAST", TableCellHeightRule2[TableCellHeightRule2.EXACT = 2] = "EXACT", TableCellHeightRule2))(TableCellHeightRule || {}), VerticalAlignmentType = /* @__PURE__ */ ((VerticalAlignmentType2) => (VerticalAlignmentType2[VerticalAlignmentType2.CONTENT_ALIGNMENT_UNSPECIFIED = 0] = "CONTENT_ALIGNMENT_UNSPECIFIED", VerticalAlignmentType2[VerticalAlignmentType2.BOTH = 1] = "BOTH", VerticalAlignmentType2[VerticalAlignmentType2.TOP = 2] = "TOP", VerticalAlignmentType2[VerticalAlignmentType2.CENTER = 3] = "CENTER", VerticalAlignmentType2[VerticalAlignmentType2.BOTTOM = 4] = "BOTTOM", VerticalAlignmentType2))(VerticalAlignmentType || {}), FontStyleType = /* @__PURE__ */ ((FontStyleType2) => (FontStyleType2.NORMAL = "normal", FontStyleType2.BOLD = "bold", FontStyleType2.ITALIC = "italic", FontStyleType2))(FontStyleType || {}), ObjectRelativeFromH = /* @__PURE__ */ ((ObjectRelativeFromH2) => (ObjectRelativeFromH2[ObjectRelativeFromH2.PAGE = 0] = "PAGE", ObjectRelativeFromH2[ObjectRelativeFromH2.COLUMN = 1] = "COLUMN", ObjectRelativeFromH2[ObjectRelativeFromH2.CHARACTER = 2] = "CHARACTER", ObjectRelativeFromH2[ObjectRelativeFromH2.MARGIN = 3] = "MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.INSIDE_MARGIN = 4] = "INSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.OUTSIDE_MARGIN = 5] = "OUTSIDE_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.LEFT_MARGIN = 6] = "LEFT_MARGIN", ObjectRelativeFromH2[ObjectRelativeFromH2.RIGHT_MARGIN = 7] = "RIGHT_MARGIN", ObjectRelativeFromH2))(ObjectRelativeFromH || {}), ObjectRelativeFromV = /* @__PURE__ */ ((ObjectRelativeFromV2) => (ObjectRelativeFromV2[ObjectRelativeFromV2.PAGE = 0] = "PAGE", ObjectRelativeFromV2[ObjectRelativeFromV2.PARAGRAPH = 1] = "PARAGRAPH", ObjectRelativeFromV2[ObjectRelativeFromV2.LINE = 2] = "LINE", ObjectRelativeFromV2[ObjectRelativeFromV2.MARGIN = 3] = "MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.TOP_MARGIN = 4] = "TOP_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.BOTTOM_MARGIN = 5] = "BOTTOM_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.INSIDE_MARGIN = 6] = "INSIDE_MARGIN", ObjectRelativeFromV2[ObjectRelativeFromV2.OUTSIDE_MARGIN = 7] = "OUTSIDE_MARGIN", ObjectRelativeFromV2))(ObjectRelativeFromV || {}), NumberUnitType = /* @__PURE__ */ ((NumberUnitType2) => (NumberUnitType2[NumberUnitType2.POINT = 0] = "POINT", NumberUnitType2[NumberUnitType2.LINE = 1] = "LINE", NumberUnitType2[NumberUnitType2.CHARACTER = 2] = "CHARACTER", NumberUnitType2[NumberUnitType2.PIXEL = 3] = "PIXEL", NumberUnitType2[NumberUnitType2.PERCENT = 4] = "PERCENT", NumberUnitType2))(NumberUnitType || {}), AlignTypeH = /* @__PURE__ */ ((AlignTypeH2) => (AlignTypeH2[AlignTypeH2.CENTER = 0] = "CENTER", AlignTypeH2[AlignTypeH2.INSIDE = 1] = "INSIDE", AlignTypeH2[AlignTypeH2.LEFT = 2] = "LEFT", AlignTypeH2[AlignTypeH2.OUTSIDE = 3] = "OUTSIDE", AlignTypeH2[AlignTypeH2.RIGHT = 4] = "RIGHT", AlignTypeH2[AlignTypeH2.BOTH = 5] = "BOTH", AlignTypeH2[AlignTypeH2.DISTRIBUTE = 6] = "DISTRIBUTE", AlignTypeH2))(AlignTypeH || {}), AlignTypeV = /* @__PURE__ */ ((AlignTypeV2) => (AlignTypeV2[AlignTypeV2.BOTTOM = 0] = "BOTTOM", AlignTypeV2[AlignTypeV2.CENTER = 1] = "CENTER", AlignTypeV2[AlignTypeV2.INSIDE = 2] = "INSIDE", AlignTypeV2[AlignTypeV2.OUTSIDE = 3] = "OUTSIDE", AlignTypeV2[AlignTypeV2.TOP = 4] = "TOP", AlignTypeV2))(AlignTypeV || {}), characterSpacingControlType = /* @__PURE__ */ ((characterSpacingControlType2) => (characterSpacingControlType2[characterSpacingControlType2.compressPunctuation = 0] = "compressPunctuation", characterSpacingControlType2[characterSpacingControlType2.compressPunctuationAndJapaneseKana = 1] = "compressPunctuationAndJapaneseKana", characterSpacingControlType2[characterSpacingControlType2.doNotCompress = 2] = "doNotCompress", characterSpacingControlType2))(characterSpacingControlType || {}), PageOrientType = /* @__PURE__ */ ((PageOrientType2) => (PageOrientType2[PageOrientType2.PORTRAIT = 0] = "PORTRAIT", PageOrientType2[PageOrientType2.LANDSCAPE = 1] = "LANDSCAPE", PageOrientType2))(PageOrientType || {}), ArrangeTypeEnum = /* @__PURE__ */ ((ArrangeTypeEnum2) => (ArrangeTypeEnum2[ArrangeTypeEnum2.forward = 0] = "forward", ArrangeTypeEnum2[ArrangeTypeEnum2.backward = 1] = "backward", ArrangeTypeEnum2[ArrangeTypeEnum2.front = 2] = "front", ArrangeTypeEnum2[ArrangeTypeEnum2.back = 3] = "back", ArrangeTypeEnum2))(ArrangeTypeEnum || {}), DrawingTypeEnum = /* @__PURE__ */ ((DrawingTypeEnum2) => (DrawingTypeEnum2[DrawingTypeEnum2.UNRECOGNIZED = -1] = "UNRECOGNIZED", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_IMAGE = 0] = "DRAWING_IMAGE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SHAPE = 1] = "DRAWING_SHAPE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_CHART = 2] = "DRAWING_CHART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_TABLE = 3] = "DRAWING_TABLE", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_SMART_ART = 4] = "DRAWING_SMART_ART", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_VIDEO = 5] = "DRAWING_VIDEO", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_GROUP = 6] = "DRAWING_GROUP", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_UNIT = 7] = "DRAWING_UNIT", DrawingTypeEnum2[DrawingTypeEnum2.DRAWING_DOM = 8] = "DRAWING_DOM", DrawingTypeEnum2))(DrawingTypeEnum || {}), RANGE_TYPE = /* @__PURE__ */ ((RANGE_TYPE2) => (RANGE_TYPE2[RANGE_TYPE2.NORMAL = 0] = "NORMAL", RANGE_TYPE2[RANGE_TYPE2.ROW = 1] = "ROW", RANGE_TYPE2[RANGE_TYPE2.COLUMN = 2] = "COLUMN", RANGE_TYPE2[RANGE_TYPE2.ALL = 3] = "ALL", RANGE_TYPE2))(RANGE_TYPE || {}), AbsoluteRefType = /* @__PURE__ */ ((AbsoluteRefType2) => (AbsoluteRefType2[AbsoluteRefType2.NONE = 0] = "NONE", AbsoluteRefType2[AbsoluteRefType2.ROW = 1] = "ROW", AbsoluteRefType2[AbsoluteRefType2.COLUMN = 2] = "COLUMN", AbsoluteRefType2[AbsoluteRefType2.ALL = 3] = "ALL", AbsoluteRefType2))(AbsoluteRefType || {});
849
850
  function selectionToArray(range) {
850
851
  return [range.startRow, range.startColumn, range.endRow, range.endColumn];
851
852
  }
@@ -909,7 +910,561 @@ let random = /* @__PURE__ */ __name((bytes) => crypto.getRandomValues(new Uint8A
909
910
  id += urlAlphabet[bytes[size] & 63];
910
911
  return id;
911
912
  }, "nanoid");
912
- const topLevelDomainSet = /* @__PURE__ */ new Set([
913
+ var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
914
+ function getDefaultExportFromCjs(x) {
915
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
916
+ }
917
+ __name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
918
+ var lodash_mergewith = { exports: {} };
919
+ lodash_mergewith.exports;
920
+ (function(module, exports) {
921
+ var LARGE_ARRAY_SIZE = 200, HASH_UNDEFINED = "__lodash_hash_undefined__", HOT_COUNT = 800, HOT_SPAN = 16, MAX_SAFE_INTEGER = 9007199254740991, argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]", reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, reIsUint = /^(?:0|[1-9]\d*)$/, typedArrayTags = {};
922
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = !0, typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = !1;
923
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")(), freeExports = exports && !exports.nodeType && exports, freeModule = freeExports && !0 && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports, freeProcess = moduleExports && freeGlobal.process, nodeUtil = function() {
924
+ try {
925
+ var types2 = freeModule && freeModule.require && freeModule.require("util").types;
926
+ return types2 || freeProcess && freeProcess.binding && freeProcess.binding("util");
927
+ } catch {
928
+ }
929
+ }(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
930
+ function apply(func, thisArg, args) {
931
+ switch (args.length) {
932
+ case 0:
933
+ return func.call(thisArg);
934
+ case 1:
935
+ return func.call(thisArg, args[0]);
936
+ case 2:
937
+ return func.call(thisArg, args[0], args[1]);
938
+ case 3:
939
+ return func.call(thisArg, args[0], args[1], args[2]);
940
+ }
941
+ return func.apply(thisArg, args);
942
+ }
943
+ __name(apply, "apply");
944
+ function baseTimes(n, iteratee) {
945
+ for (var index2 = -1, result = Array(n); ++index2 < n; )
946
+ result[index2] = iteratee(index2);
947
+ return result;
948
+ }
949
+ __name(baseTimes, "baseTimes");
950
+ function baseUnary(func) {
951
+ return function(value) {
952
+ return func(value);
953
+ };
954
+ }
955
+ __name(baseUnary, "baseUnary");
956
+ function getValue(object, key) {
957
+ return object == null ? void 0 : object[key];
958
+ }
959
+ __name(getValue, "getValue");
960
+ function overArg(func, transform) {
961
+ return function(arg) {
962
+ return func(transform(arg));
963
+ };
964
+ }
965
+ __name(overArg, "overArg");
966
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype, coreJsData = root["__core-js_shared__"], funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, maskSrcKey = function() {
967
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
968
+ return uid ? "Symbol(src)_1." + uid : "";
969
+ }(), nativeObjectToString = objectProto.toString, objectCtorString = funcToString.call(Object), reIsNative = RegExp(
970
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
971
+ ), Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array;
972
+ Buffer2 && Buffer2.allocUnsafe;
973
+ var getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0, defineProperty = function() {
974
+ try {
975
+ var func = getNative(Object, "defineProperty");
976
+ return func({}, "", {}), func;
977
+ } catch {
978
+ }
979
+ }(), nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeMax = Math.max, nativeNow = Date.now, Map2 = getNative(root, "Map"), nativeCreate = getNative(Object, "create"), baseCreate = function() {
980
+ function object() {
981
+ }
982
+ return __name(object, "object"), function(proto) {
983
+ if (!isObject2(proto))
984
+ return {};
985
+ if (objectCreate)
986
+ return objectCreate(proto);
987
+ object.prototype = proto;
988
+ var result = new object();
989
+ return object.prototype = void 0, result;
990
+ };
991
+ }();
992
+ function Hash(entries) {
993
+ var index2 = -1, length = entries == null ? 0 : entries.length;
994
+ for (this.clear(); ++index2 < length; ) {
995
+ var entry = entries[index2];
996
+ this.set(entry[0], entry[1]);
997
+ }
998
+ }
999
+ __name(Hash, "Hash");
1000
+ function hashClear() {
1001
+ this.__data__ = nativeCreate ? nativeCreate(null) : {}, this.size = 0;
1002
+ }
1003
+ __name(hashClear, "hashClear");
1004
+ function hashDelete(key) {
1005
+ var result = this.has(key) && delete this.__data__[key];
1006
+ return this.size -= result ? 1 : 0, result;
1007
+ }
1008
+ __name(hashDelete, "hashDelete");
1009
+ function hashGet(key) {
1010
+ var data = this.__data__;
1011
+ if (nativeCreate) {
1012
+ var result = data[key];
1013
+ return result === HASH_UNDEFINED ? void 0 : result;
1014
+ }
1015
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
1016
+ }
1017
+ __name(hashGet, "hashGet");
1018
+ function hashHas(key) {
1019
+ var data = this.__data__;
1020
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
1021
+ }
1022
+ __name(hashHas, "hashHas");
1023
+ function hashSet(key, value) {
1024
+ var data = this.__data__;
1025
+ return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value, this;
1026
+ }
1027
+ __name(hashSet, "hashSet"), Hash.prototype.clear = hashClear, Hash.prototype.delete = hashDelete, Hash.prototype.get = hashGet, Hash.prototype.has = hashHas, Hash.prototype.set = hashSet;
1028
+ function ListCache(entries) {
1029
+ var index2 = -1, length = entries == null ? 0 : entries.length;
1030
+ for (this.clear(); ++index2 < length; ) {
1031
+ var entry = entries[index2];
1032
+ this.set(entry[0], entry[1]);
1033
+ }
1034
+ }
1035
+ __name(ListCache, "ListCache");
1036
+ function listCacheClear() {
1037
+ this.__data__ = [], this.size = 0;
1038
+ }
1039
+ __name(listCacheClear, "listCacheClear");
1040
+ function listCacheDelete(key) {
1041
+ var data = this.__data__, index2 = assocIndexOf(data, key);
1042
+ if (index2 < 0)
1043
+ return !1;
1044
+ var lastIndex = data.length - 1;
1045
+ return index2 == lastIndex ? data.pop() : splice.call(data, index2, 1), --this.size, !0;
1046
+ }
1047
+ __name(listCacheDelete, "listCacheDelete");
1048
+ function listCacheGet(key) {
1049
+ var data = this.__data__, index2 = assocIndexOf(data, key);
1050
+ return index2 < 0 ? void 0 : data[index2][1];
1051
+ }
1052
+ __name(listCacheGet, "listCacheGet");
1053
+ function listCacheHas(key) {
1054
+ return assocIndexOf(this.__data__, key) > -1;
1055
+ }
1056
+ __name(listCacheHas, "listCacheHas");
1057
+ function listCacheSet(key, value) {
1058
+ var data = this.__data__, index2 = assocIndexOf(data, key);
1059
+ return index2 < 0 ? (++this.size, data.push([key, value])) : data[index2][1] = value, this;
1060
+ }
1061
+ __name(listCacheSet, "listCacheSet"), ListCache.prototype.clear = listCacheClear, ListCache.prototype.delete = listCacheDelete, ListCache.prototype.get = listCacheGet, ListCache.prototype.has = listCacheHas, ListCache.prototype.set = listCacheSet;
1062
+ function MapCache(entries) {
1063
+ var index2 = -1, length = entries == null ? 0 : entries.length;
1064
+ for (this.clear(); ++index2 < length; ) {
1065
+ var entry = entries[index2];
1066
+ this.set(entry[0], entry[1]);
1067
+ }
1068
+ }
1069
+ __name(MapCache, "MapCache");
1070
+ function mapCacheClear() {
1071
+ this.size = 0, this.__data__ = {
1072
+ hash: new Hash(),
1073
+ map: new (Map2 || ListCache)(),
1074
+ string: new Hash()
1075
+ };
1076
+ }
1077
+ __name(mapCacheClear, "mapCacheClear");
1078
+ function mapCacheDelete(key) {
1079
+ var result = getMapData(this, key).delete(key);
1080
+ return this.size -= result ? 1 : 0, result;
1081
+ }
1082
+ __name(mapCacheDelete, "mapCacheDelete");
1083
+ function mapCacheGet(key) {
1084
+ return getMapData(this, key).get(key);
1085
+ }
1086
+ __name(mapCacheGet, "mapCacheGet");
1087
+ function mapCacheHas(key) {
1088
+ return getMapData(this, key).has(key);
1089
+ }
1090
+ __name(mapCacheHas, "mapCacheHas");
1091
+ function mapCacheSet(key, value) {
1092
+ var data = getMapData(this, key), size = data.size;
1093
+ return data.set(key, value), this.size += data.size == size ? 0 : 1, this;
1094
+ }
1095
+ __name(mapCacheSet, "mapCacheSet"), MapCache.prototype.clear = mapCacheClear, MapCache.prototype.delete = mapCacheDelete, MapCache.prototype.get = mapCacheGet, MapCache.prototype.has = mapCacheHas, MapCache.prototype.set = mapCacheSet;
1096
+ function Stack(entries) {
1097
+ var data = this.__data__ = new ListCache(entries);
1098
+ this.size = data.size;
1099
+ }
1100
+ __name(Stack, "Stack");
1101
+ function stackClear() {
1102
+ this.__data__ = new ListCache(), this.size = 0;
1103
+ }
1104
+ __name(stackClear, "stackClear");
1105
+ function stackDelete(key) {
1106
+ var data = this.__data__, result = data.delete(key);
1107
+ return this.size = data.size, result;
1108
+ }
1109
+ __name(stackDelete, "stackDelete");
1110
+ function stackGet(key) {
1111
+ return this.__data__.get(key);
1112
+ }
1113
+ __name(stackGet, "stackGet");
1114
+ function stackHas(key) {
1115
+ return this.__data__.has(key);
1116
+ }
1117
+ __name(stackHas, "stackHas");
1118
+ function stackSet(key, value) {
1119
+ var data = this.__data__;
1120
+ if (data instanceof ListCache) {
1121
+ var pairs = data.__data__;
1122
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1)
1123
+ return pairs.push([key, value]), this.size = ++data.size, this;
1124
+ data = this.__data__ = new MapCache(pairs);
1125
+ }
1126
+ return data.set(key, value), this.size = data.size, this;
1127
+ }
1128
+ __name(stackSet, "stackSet"), Stack.prototype.clear = stackClear, Stack.prototype.delete = stackDelete, Stack.prototype.get = stackGet, Stack.prototype.has = stackHas, Stack.prototype.set = stackSet;
1129
+ function arrayLikeKeys(value, inherited) {
1130
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
1131
+ for (var key in value)
1132
+ skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
1133
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1134
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1135
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
1136
+ isIndex(key, length)) || result.push(key);
1137
+ return result;
1138
+ }
1139
+ __name(arrayLikeKeys, "arrayLikeKeys");
1140
+ function assignMergeValue(object, key, value) {
1141
+ (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) && baseAssignValue(object, key, value);
1142
+ }
1143
+ __name(assignMergeValue, "assignMergeValue");
1144
+ function assignValue(object, key, value) {
1145
+ var objValue = object[key];
1146
+ (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) && baseAssignValue(object, key, value);
1147
+ }
1148
+ __name(assignValue, "assignValue");
1149
+ function assocIndexOf(array, key) {
1150
+ for (var length = array.length; length--; )
1151
+ if (eq(array[length][0], key))
1152
+ return length;
1153
+ return -1;
1154
+ }
1155
+ __name(assocIndexOf, "assocIndexOf");
1156
+ function baseAssignValue(object, key, value) {
1157
+ key == "__proto__" && defineProperty ? defineProperty(object, key, {
1158
+ configurable: !0,
1159
+ enumerable: !0,
1160
+ value,
1161
+ writable: !0
1162
+ }) : object[key] = value;
1163
+ }
1164
+ __name(baseAssignValue, "baseAssignValue");
1165
+ var baseFor = createBaseFor();
1166
+ function baseGetTag(value) {
1167
+ return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
1168
+ }
1169
+ __name(baseGetTag, "baseGetTag");
1170
+ function baseIsArguments(value) {
1171
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1172
+ }
1173
+ __name(baseIsArguments, "baseIsArguments");
1174
+ function baseIsNative(value) {
1175
+ if (!isObject2(value) || isMasked(value))
1176
+ return !1;
1177
+ var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
1178
+ return pattern.test(toSource(value));
1179
+ }
1180
+ __name(baseIsNative, "baseIsNative");
1181
+ function baseIsTypedArray(value) {
1182
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1183
+ }
1184
+ __name(baseIsTypedArray, "baseIsTypedArray");
1185
+ function baseKeysIn(object) {
1186
+ if (!isObject2(object))
1187
+ return nativeKeysIn(object);
1188
+ var isProto = isPrototype(object), result = [];
1189
+ for (var key in object)
1190
+ key == "constructor" && (isProto || !hasOwnProperty.call(object, key)) || result.push(key);
1191
+ return result;
1192
+ }
1193
+ __name(baseKeysIn, "baseKeysIn");
1194
+ function baseMerge(object, source, srcIndex, customizer, stack) {
1195
+ object !== source && baseFor(source, function(srcValue, key) {
1196
+ if (stack || (stack = new Stack()), isObject2(srcValue))
1197
+ baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1198
+ else {
1199
+ var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
1200
+ newValue === void 0 && (newValue = srcValue), assignMergeValue(object, key, newValue);
1201
+ }
1202
+ }, keysIn);
1203
+ }
1204
+ __name(baseMerge, "baseMerge");
1205
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
1206
+ var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
1207
+ if (stacked) {
1208
+ assignMergeValue(object, key, stacked);
1209
+ return;
1210
+ }
1211
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0, isCommon = newValue === void 0;
1212
+ if (isCommon) {
1213
+ var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
1214
+ newValue = srcValue, isArr || isBuff || isTyped ? isArray(objValue) ? newValue = objValue : isArrayLikeObject(objValue) ? newValue = copyArray(objValue) : isBuff ? (isCommon = !1, newValue = cloneBuffer(srcValue)) : isTyped ? (isCommon = !1, newValue = cloneTypedArray(srcValue)) : newValue = [] : isPlainObject(srcValue) || isArguments(srcValue) ? (newValue = objValue, isArguments(objValue) ? newValue = toPlainObject(objValue) : (!isObject2(objValue) || isFunction2(objValue)) && (newValue = initCloneObject(srcValue))) : isCommon = !1;
1215
+ }
1216
+ isCommon && (stack.set(srcValue, newValue), mergeFunc(newValue, srcValue, srcIndex, customizer, stack), stack.delete(srcValue)), assignMergeValue(object, key, newValue);
1217
+ }
1218
+ __name(baseMergeDeep, "baseMergeDeep");
1219
+ function baseRest(func, start) {
1220
+ return setToString(overRest(func, start, identity), func + "");
1221
+ }
1222
+ __name(baseRest, "baseRest");
1223
+ var baseSetToString = defineProperty ? function(func, string) {
1224
+ return defineProperty(func, "toString", {
1225
+ configurable: !0,
1226
+ enumerable: !1,
1227
+ value: constant(string),
1228
+ writable: !0
1229
+ });
1230
+ } : identity;
1231
+ function cloneBuffer(buffer, isDeep) {
1232
+ return buffer.slice();
1233
+ }
1234
+ __name(cloneBuffer, "cloneBuffer");
1235
+ function cloneArrayBuffer(arrayBuffer) {
1236
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1237
+ return new Uint8Array2(result).set(new Uint8Array2(arrayBuffer)), result;
1238
+ }
1239
+ __name(cloneArrayBuffer, "cloneArrayBuffer");
1240
+ function cloneTypedArray(typedArray, isDeep) {
1241
+ var buffer = cloneArrayBuffer(typedArray.buffer);
1242
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1243
+ }
1244
+ __name(cloneTypedArray, "cloneTypedArray");
1245
+ function copyArray(source, array) {
1246
+ var index2 = -1, length = source.length;
1247
+ for (array || (array = Array(length)); ++index2 < length; )
1248
+ array[index2] = source[index2];
1249
+ return array;
1250
+ }
1251
+ __name(copyArray, "copyArray");
1252
+ function copyObject(source, props, object, customizer) {
1253
+ var isNew = !object;
1254
+ object || (object = {});
1255
+ for (var index2 = -1, length = props.length; ++index2 < length; ) {
1256
+ var key = props[index2], newValue = void 0;
1257
+ newValue === void 0 && (newValue = source[key]), isNew ? baseAssignValue(object, key, newValue) : assignValue(object, key, newValue);
1258
+ }
1259
+ return object;
1260
+ }
1261
+ __name(copyObject, "copyObject");
1262
+ function createAssigner(assigner) {
1263
+ return baseRest(function(object, sources) {
1264
+ var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
1265
+ for (customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0, guard && isIterateeCall(sources[0], sources[1], guard) && (customizer = length < 3 ? void 0 : customizer, length = 1), object = Object(object); ++index2 < length; ) {
1266
+ var source = sources[index2];
1267
+ source && assigner(object, source, index2, customizer);
1268
+ }
1269
+ return object;
1270
+ });
1271
+ }
1272
+ __name(createAssigner, "createAssigner");
1273
+ function createBaseFor(fromRight) {
1274
+ return function(object, iteratee, keysFunc) {
1275
+ for (var index2 = -1, iterable = Object(object), props = keysFunc(object), length = props.length; length--; ) {
1276
+ var key = props[++index2];
1277
+ if (iteratee(iterable[key], key, iterable) === !1)
1278
+ break;
1279
+ }
1280
+ return object;
1281
+ };
1282
+ }
1283
+ __name(createBaseFor, "createBaseFor");
1284
+ function getMapData(map2, key) {
1285
+ var data = map2.__data__;
1286
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1287
+ }
1288
+ __name(getMapData, "getMapData");
1289
+ function getNative(object, key) {
1290
+ var value = getValue(object, key);
1291
+ return baseIsNative(value) ? value : void 0;
1292
+ }
1293
+ __name(getNative, "getNative");
1294
+ function getRawTag(value) {
1295
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
1296
+ try {
1297
+ value[symToStringTag] = void 0;
1298
+ var unmasked = !0;
1299
+ } catch {
1300
+ }
1301
+ var result = nativeObjectToString.call(value);
1302
+ return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result;
1303
+ }
1304
+ __name(getRawTag, "getRawTag");
1305
+ function initCloneObject(object) {
1306
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
1307
+ }
1308
+ __name(initCloneObject, "initCloneObject");
1309
+ function isIndex(value, length) {
1310
+ var type2 = typeof value;
1311
+ return length = length == null ? MAX_SAFE_INTEGER : length, !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1312
+ }
1313
+ __name(isIndex, "isIndex");
1314
+ function isIterateeCall(value, index2, object) {
1315
+ if (!isObject2(object))
1316
+ return !1;
1317
+ var type2 = typeof index2;
1318
+ return (type2 == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type2 == "string" && index2 in object) ? eq(object[index2], value) : !1;
1319
+ }
1320
+ __name(isIterateeCall, "isIterateeCall");
1321
+ function isKeyable(value) {
1322
+ var type2 = typeof value;
1323
+ return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
1324
+ }
1325
+ __name(isKeyable, "isKeyable");
1326
+ function isMasked(func) {
1327
+ return !!maskSrcKey && maskSrcKey in func;
1328
+ }
1329
+ __name(isMasked, "isMasked");
1330
+ function isPrototype(value) {
1331
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
1332
+ return value === proto;
1333
+ }
1334
+ __name(isPrototype, "isPrototype");
1335
+ function nativeKeysIn(object) {
1336
+ var result = [];
1337
+ if (object != null)
1338
+ for (var key in Object(object))
1339
+ result.push(key);
1340
+ return result;
1341
+ }
1342
+ __name(nativeKeysIn, "nativeKeysIn");
1343
+ function objectToString(value) {
1344
+ return nativeObjectToString.call(value);
1345
+ }
1346
+ __name(objectToString, "objectToString");
1347
+ function overRest(func, start, transform) {
1348
+ return start = nativeMax(start === void 0 ? func.length - 1 : start, 0), function() {
1349
+ for (var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array(length); ++index2 < length; )
1350
+ array[index2] = args[start + index2];
1351
+ index2 = -1;
1352
+ for (var otherArgs = Array(start + 1); ++index2 < start; )
1353
+ otherArgs[index2] = args[index2];
1354
+ return otherArgs[start] = transform(array), apply(func, this, otherArgs);
1355
+ };
1356
+ }
1357
+ __name(overRest, "overRest");
1358
+ function safeGet(object, key) {
1359
+ if (!(key === "constructor" && typeof object[key] == "function") && key != "__proto__")
1360
+ return object[key];
1361
+ }
1362
+ __name(safeGet, "safeGet");
1363
+ var setToString = shortOut(baseSetToString);
1364
+ function shortOut(func) {
1365
+ var count = 0, lastCalled = 0;
1366
+ return function() {
1367
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
1368
+ if (lastCalled = stamp, remaining > 0) {
1369
+ if (++count >= HOT_COUNT)
1370
+ return arguments[0];
1371
+ } else
1372
+ count = 0;
1373
+ return func.apply(void 0, arguments);
1374
+ };
1375
+ }
1376
+ __name(shortOut, "shortOut");
1377
+ function toSource(func) {
1378
+ if (func != null) {
1379
+ try {
1380
+ return funcToString.call(func);
1381
+ } catch {
1382
+ }
1383
+ try {
1384
+ return func + "";
1385
+ } catch {
1386
+ }
1387
+ }
1388
+ return "";
1389
+ }
1390
+ __name(toSource, "toSource");
1391
+ function eq(value, other) {
1392
+ return value === other || value !== value && other !== other;
1393
+ }
1394
+ __name(eq, "eq");
1395
+ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
1396
+ return arguments;
1397
+ }()) ? baseIsArguments : function(value) {
1398
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1399
+ }, isArray = Array.isArray;
1400
+ function isArrayLike(value) {
1401
+ return value != null && isLength(value.length) && !isFunction2(value);
1402
+ }
1403
+ __name(isArrayLike, "isArrayLike");
1404
+ function isArrayLikeObject(value) {
1405
+ return isObjectLike(value) && isArrayLike(value);
1406
+ }
1407
+ __name(isArrayLikeObject, "isArrayLikeObject");
1408
+ var isBuffer = nativeIsBuffer || stubFalse;
1409
+ function isFunction2(value) {
1410
+ if (!isObject2(value))
1411
+ return !1;
1412
+ var tag = baseGetTag(value);
1413
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1414
+ }
1415
+ __name(isFunction2, "isFunction");
1416
+ function isLength(value) {
1417
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1418
+ }
1419
+ __name(isLength, "isLength");
1420
+ function isObject2(value) {
1421
+ var type2 = typeof value;
1422
+ return value != null && (type2 == "object" || type2 == "function");
1423
+ }
1424
+ __name(isObject2, "isObject");
1425
+ function isObjectLike(value) {
1426
+ return value != null && typeof value == "object";
1427
+ }
1428
+ __name(isObjectLike, "isObjectLike");
1429
+ function isPlainObject(value) {
1430
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag)
1431
+ return !1;
1432
+ var proto = getPrototype(value);
1433
+ if (proto === null)
1434
+ return !0;
1435
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
1436
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
1437
+ }
1438
+ __name(isPlainObject, "isPlainObject");
1439
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1440
+ function toPlainObject(value) {
1441
+ return copyObject(value, keysIn(value));
1442
+ }
1443
+ __name(toPlainObject, "toPlainObject");
1444
+ function keysIn(object) {
1445
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeysIn(object);
1446
+ }
1447
+ __name(keysIn, "keysIn");
1448
+ var mergeWith2 = createAssigner(function(object, source, srcIndex, customizer) {
1449
+ baseMerge(object, source, srcIndex, customizer);
1450
+ });
1451
+ function constant(value) {
1452
+ return function() {
1453
+ return value;
1454
+ };
1455
+ }
1456
+ __name(constant, "constant");
1457
+ function identity(value) {
1458
+ return value;
1459
+ }
1460
+ __name(identity, "identity");
1461
+ function stubFalse() {
1462
+ return !1;
1463
+ }
1464
+ __name(stubFalse, "stubFalse"), module.exports = mergeWith2;
1465
+ })(lodash_mergewith, lodash_mergewith.exports);
1466
+ var lodash_mergewithExports = lodash_mergewith.exports;
1467
+ const mergeWith = /* @__PURE__ */ getDefaultExportFromCjs(lodash_mergewithExports), topLevelDomainSet = /* @__PURE__ */ new Set([
913
1468
  "ac",
914
1469
  "ad",
915
1470
  "ae",
@@ -1646,6 +2201,19 @@ const rmsPrefix = /^-ms-/, rDashAlpha = /-([a-z])/g, alphabets = [
1646
2201
  static clamp(value, min, max) {
1647
2202
  return Math.max(min, Math.min(max, value));
1648
2203
  }
2204
+ /**
2205
+ *
2206
+ *
2207
+ * @static
2208
+ * @param {unknown} object Modify the property while leaving the reference unchanged.
2209
+ * @param {unknown} source The source being merged in object.
2210
+ * @param {(value: unknown, originValue: unknown, key: string, object: unknown, source: unknown, stack: string[]) => {}} [customizer]
2211
+ * @return {*}
2212
+ * @memberof Tools
2213
+ */
2214
+ static mergeWith(object, source, customizer) {
2215
+ return mergeWith(object, source, customizer);
2216
+ }
1649
2217
  };
1650
2218
  __name(_Tools, "Tools");
1651
2219
  let Tools = _Tools;
@@ -2775,6 +3343,21 @@ const _ObjectMatrix = class _ObjectMatrix {
2775
3343
  });
2776
3344
  }), objectMatrix.getData();
2777
3345
  }
3346
+ /**
3347
+ * the function can only be used in all the row and column are positive integer
3348
+ * @description the positive integer in V8 Object is stored in a fast memory space and it is sorted when we get the keys
3349
+ * @returns {IRange} the start and end scope of the matrix
3350
+ */
3351
+ getStartEndScope() {
3352
+ let startRow = 1 / 0, endRow = -1 / 0, startColumn = 1 / 0, endColumn = -1 / 0;
3353
+ const rows = Object.keys(this._matrix);
3354
+ rows.length > 0 && (startRow = +rows[0], endRow = +rows[rows.length - 1]);
3355
+ for (const row of rows) {
3356
+ const columns = Object.keys(this._matrix[row]);
3357
+ columns.length > 0 && (startColumn = Math.min(startColumn, +columns[0]), endColumn = Math.max(endColumn, +columns[columns.length - 1]));
3358
+ }
3359
+ return { startRow, endRow, startColumn, endColumn };
3360
+ }
2778
3361
  getDataRange() {
2779
3362
  let startRow = 0, startColumn = 0, endColumn = 0, endRow = -1, initRow = !1, initColumn = !1;
2780
3363
  return this.forEach((rowIndex, row) => {
@@ -3173,7 +3756,765 @@ function covertTextRunToHtml(dataStream, textRun) {
3173
3756
  return it === BooleanNumber.TRUE && (html = `<i>${html}</i>`), va === BaselineOffset.SUPERSCRIPT ? html = `<sup>${html}</sup>` : va === BaselineOffset.SUBSCRIPT && (html = `<sub>${html}</sub>`), (ul == null ? void 0 : ul.s) === BooleanNumber.TRUE && (html = `<u>${html}</u>`), (st == null ? void 0 : st.s) === BooleanNumber.TRUE && (html = `<s>${html}</s>`), bl === BooleanNumber.TRUE && (html = `<strong>${html}</strong>`), ff && style.push(`font-family: ${ff}`), cl && style.push(`color: ${cl.rgb}`), fs && style.push(`font-size: ${fs}pt`), ol && style.push("text-decoration: overline"), bg && style.push(`background: ${bg.rgb}`), style.length ? `<span style="${style.join("; ")};">${html}</span>` : html;
3174
3757
  }
3175
3758
  __name(covertTextRunToHtml, "covertTextRunToHtml");
3176
- const DEFAULT_RANGE_ARRAY = {
3759
+ var numfmt$1 = { exports: {} };
3760
+ (function(module, exports) {
3761
+ (function(e, t) {
3762
+ module.exports = t();
3763
+ })(typeof self < "u" ? self : commonjsGlobal, function() {
3764
+ return function() {
3765
+ var e = { d: /* @__PURE__ */ __name(function(t2, n2) {
3766
+ for (var a2 in n2) e.o(n2, a2) && !e.o(t2, a2) && Object.defineProperty(t2, a2, { enumerable: !0, get: n2[a2] });
3767
+ }, "d"), o: /* @__PURE__ */ __name(function(e2, t2) {
3768
+ return Object.prototype.hasOwnProperty.call(e2, t2);
3769
+ }, "o") }, t = {};
3770
+ e.d(t, { default: /* @__PURE__ */ __name(function() {
3771
+ return pe;
3772
+ }, "default") });
3773
+ var n = { 1078: "af", 1052: "sq", 1118: "am", 5121: "ar_DZ", 15361: "ar_BH", 3073: "ar_EG", 2049: "ar_IQ", 11265: "ar_JO", 13313: "ar_KW", 12289: "ar_LB", 4097: "ar_LY", 6145: "ar_MA", 8193: "ar_OM", 16385: "ar_QA", 1025: "ar_SA", 10241: "ar_SY", 7169: "ar_TN", 14337: "ar_AE", 9217: "ar_YE", 1067: "hy", 1101: "as", 2092: "az_AZ", 1068: "az_AZ", 1069: "eu", 1059: "be", 2117: "bn", 1093: "bn_IN", 5146: "bs", 1026: "bg", 1109: "my", 1027: "ca", 2052: "zh_CN", 3076: "zh_HK", 5124: "zh_MO", 4100: "zh_SG", 1028: "zh_TW", 1050: "hr", 1029: "cs", 1030: "da", 1125: "dv", 2067: "nl_BE", 1043: "nl_NL", 1126: "bin", 3081: "en_AU", 10249: "en_BZ", 4105: "en_CA", 9225: "en_CB", 2057: "en_GB", 16393: "en_IN", 6153: "en_IE", 8201: "en_JM", 5129: "en_NZ", 13321: "en_PH", 7177: "en_ZA", 11273: "en_TT", 1033: "en_US", 12297: "en_ZW", 1061: "et", 1071: "mk", 1080: "fo", 1065: "fa", 1124: "fil", 1035: "fi", 2060: "fr_BE", 11276: "fr_CM", 3084: "fr_CA", 9228: "fr_CG", 12300: "fr_CI", 1036: "fr_FR", 5132: "fr_LU", 13324: "fr_ML", 6156: "fr_MC", 14348: "fr_MA", 10252: "fr_SN", 4108: "fr_CH", 7180: "fr", 1122: "fy_NL", 2108: "gd_IE", 1084: "gd", 1110: "gl", 1079: "ka", 3079: "de_AT", 1031: "de_DE", 5127: "de_LI", 4103: "de_LU", 2055: "de_CH", 1032: "el", 1140: "gn", 1095: "gu", 1279: "en", 1037: "he", 1081: "hi", 1038: "hu", 1039: "is", 1136: "ig_NG", 1057: "id", 1040: "it_IT", 2064: "it_CH", 1041: "ja", 1099: "kn", 1120: "ks", 1087: "kk", 1107: "km", 1111: "kok", 1042: "ko", 1088: "ky", 1108: "lo", 1142: "la", 1062: "lv", 1063: "lt", 2110: "ms_BN", 1086: "ms_MY", 1100: "ml", 1082: "mt", 1112: "mni", 1153: "mi", 1102: "mr", 1104: "mn", 2128: "mn", 1121: "ne", 1044: "no_NO", 2068: "no_NO", 1096: "or", 1045: "pl", 1046: "pt_BR", 2070: "pt_PT", 1094: "pa", 1047: "rm", 2072: "ro_MO", 1048: "ro_RO", 1049: "ru", 2073: "ru_MO", 1083: "se", 1103: "sa", 3098: "sr_SP", 2074: "sr_SP", 1072: "st", 1074: "tn", 1113: "sd", 1115: "si", 1051: "sk", 1060: "sl", 1143: "so", 1070: "sb", 11274: "es_AR", 16394: "es_BO", 13322: "es_CL", 9226: "es_CO", 5130: "es_CR", 7178: "es_DO", 12298: "es_EC", 17418: "es_SV", 4106: "es_GT", 18442: "es_HN", 2058: "es_MX", 19466: "es_NI", 6154: "es_PA", 15370: "es_PY", 10250: "es_PE", 20490: "es_PR", 1034: "es_ES", 14346: "es_UY", 8202: "es_VE", 1089: "sw", 2077: "sv_FI", 1053: "sv_SE", 1114: "syc", 1064: "tg", 1097: "ta", 1092: "tt", 1098: "te", 1054: "th", 1105: "bo", 1073: "ts", 1055: "tr", 1090: "tk", 1058: "uk", 1056: "ur", 2115: "uz_UZ", 1091: "uz_UZ", 1075: "ve", 1066: "vi", 1106: "cy", 1076: "xh", 1085: "yi", 1077: "zu" };
3774
+ const a = /^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i, r = {}, i = { group: " ", decimal: ".", positive: "+", negative: "-", percent: "%", exponent: "E", nan: "NaN", infinity: "∞", ampm: ["AM", "PM"], mmmm6: ["Muharram", "Safar", "Rabiʻ I", "Rabiʻ II", "Jumada I", "Jumada II", "Rajab", "Shaʻban", "Ramadan", "Shawwal", "Dhuʻl-Qiʻdah", "Dhuʻl-Hijjah"], mmm6: ["Muh.", "Saf.", "Rab. I", "Rab. II", "Jum. I", "Jum. II", "Raj.", "Sha.", "Ram.", "Shaw.", "Dhuʻl-Q.", "Dhuʻl-H."], mmmm: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], mmm: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dddd: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ddd: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] };
3775
+ function s(e2) {
3776
+ const t2 = a.exec(e2);
3777
+ if (!t2) throw new SyntaxError("Malformed locale: ".concat(e2));
3778
+ return { lang: t2[1] + (t2[2] ? "_" + t2[2] : ""), language: t2[1], territory: t2[2] || "", codeset: t2[3] || "", modifier: t2[4] || "" };
3779
+ }
3780
+ __name(s, "s");
3781
+ function o(e2) {
3782
+ if (typeof e2 == "number") return n[65535 & e2] || null;
3783
+ const t2 = parseInt(e2, 16);
3784
+ return isFinite(t2) && n[65535 & t2] ? n[65535 & t2] || null : a.test(e2) ? e2 : null;
3785
+ }
3786
+ __name(o, "o");
3787
+ function l2(e2) {
3788
+ const t2 = o(e2);
3789
+ let n2 = null;
3790
+ if (t2) {
3791
+ const e3 = s(t2);
3792
+ n2 = r[e3.lang] || r[e3.language] || null;
3793
+ }
3794
+ return n2;
3795
+ }
3796
+ __name(l2, "l");
3797
+ function d(e2) {
3798
+ return Object.assign({}, i, e2);
3799
+ }
3800
+ __name(d, "d");
3801
+ function m(e2, t2) {
3802
+ const n2 = typeof t2 == "object" ? t2 : s(t2);
3803
+ return r[n2.lang] = d(e2), n2.language === n2.lang || r[n2.language] || (r[n2.language] = d(e2)), r[n2.lang];
3804
+ }
3805
+ __name(m, "m");
3806
+ const u = d({ group: "," });
3807
+ function c(e2, t2) {
3808
+ if (typeof e2 != "number") return e2;
3809
+ if (e2 < 0) return -c(-e2, t2);
3810
+ if (t2) {
3811
+ const n2 = 10 ** (t2 || 0) || 1;
3812
+ return c(e2 * n2, 0) / n2;
3813
+ }
3814
+ return Math.round(e2);
3815
+ }
3816
+ __name(c, "c"), u.isDefault = !0, m({ group: ",", ampm: ["上午", "下午"], mmmm: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], ddd: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"] }, "zh_CN"), m({ group: ",", nan: "非數值", ampm: ["上午", "下午"], mmmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], ddd: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"] }, "zh_TW"), m({ group: ",", ampm: ["午前", "午後"], mmmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], mmm: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], dddd: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], ddd: ["日", "月", "火", "水", "木", "金", "土"] }, "ja"), m({ group: ",", ampm: ["오전", "오후"], mmmm: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], mmm: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], dddd: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"], ddd: ["일", "월", "화", "수", "목", "금", "토"] }, "ko"), m({ group: ",", ampm: ["ก่อนเที่ยง", "หลังเที่ยง"], mmmm: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"], mmm: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."], dddd: ["วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์"], ddd: ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."] }, "th"), m({ decimal: ",", ampm: ["dop.", "odp."], mmmm: ["ledna", "února", "března", "dubna", "května", "června", "července", "srpna", "září", "října", "listopadu", "prosince"], mmm: ["led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro"], dddd: ["neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"], ddd: ["ne", "po", "út", "st", "čt", "pá", "so"] }, "cs"), m({ group: ".", decimal: ",", mmmm: ["januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], ddd: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."] }, "da"), m({ group: ".", decimal: ",", ampm: ["a.m.", "p.m."], mmmm: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], ddd: ["zo", "ma", "di", "wo", "do", "vr", "za"] }, "nl"), m({ group: "," }, "en"), m({ decimal: ",", nan: "epäluku", ampm: ["ap.", "ip."], mmmm: ["tammikuuta", "helmikuuta", "maaliskuuta", "huhtikuuta", "toukokuuta", "kesäkuuta", "heinäkuuta", "elokuuta", "syyskuuta", "lokakuuta", "marraskuuta", "joulukuuta"], mmm: ["tammik.", "helmik.", "maalisk.", "huhtik.", "toukok.", "kesäk.", "heinäk.", "elok.", "syysk.", "lokak.", "marrask.", "jouluk."], dddd: ["sunnuntaina", "maanantaina", "tiistaina", "keskiviikkona", "torstaina", "perjantaina", "lauantaina"], ddd: ["su", "ma", "ti", "ke", "to", "pe", "la"] }, "fi"), m({ group: " ", decimal: ",", mmmm: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], mmm: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."], dddd: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], ddd: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."] }, "fr"), m({ group: ".", decimal: ",", mmmm: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], mmm: ["Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sept.", "Okt.", "Nov.", "Dez."], dddd: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], ddd: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."] }, "de"), m({ group: ".", decimal: ",", ampm: ["π.μ.", "μ.μ."], mmmm: ["Ιανουαρίου", "Φεβρουαρίου", "Μαρτίου", "Απριλίου", "Μαΐου", "Ιουνίου", "Ιουλίου", "Αυγούστου", "Σεπτεμβρίου", "Οκτωβρίου", "Νοεμβρίου", "Δεκεμβρίου"], mmm: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαΐ", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"], dddd: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"], ddd: ["Κυρ", "Δευ", "Τρί", "Τετ", "Πέμ", "Παρ", "Σάβ"] }, "el"), m({ decimal: ",", ampm: ["de.", "du."], mmmm: ["január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"], mmm: ["jan.", "febr.", "márc.", "ápr.", "máj.", "jún.", "júl.", "aug.", "szept.", "okt.", "nov.", "dec."], dddd: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"], ddd: ["V", "H", "K", "Sze", "Cs", "P", "Szo"] }, "hu"), m({ group: ".", decimal: ",", ampm: ["f.h.", "e.h."], mmmm: ["janúar", "febrúar", "mars", "apríl", "maí", "júní", "júlí", "ágúst", "september", "október", "nóvember", "desember"], mmm: ["jan.", "feb.", "mar.", "apr.", "maí", "jún.", "júl.", "ágú.", "sep.", "okt.", "nóv.", "des."], dddd: ["sunnudagur", "mánudagur", "þriðjudagur", "miðvikudagur", "fimmtudagur", "föstudagur", "laugardagur"], ddd: ["sun.", "mán.", "þri.", "mið.", "fim.", "fös.", "lau."] }, "is"), m({ group: ".", decimal: ",", mmmm: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], mmm: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des"], dddd: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"], ddd: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"] }, "id"), m({ group: ".", decimal: ",", mmmm: ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"], mmm: ["gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic"], dddd: ["domenica", "lunedì", "martedì", "mercoledì", "giovedì", "venerdì", "sabato"], ddd: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"] }, "it"), m({ decimal: ",", ampm: ["a.m.", "p.m."], mmmm: ["januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember"], mmm: ["jan.", "feb.", "mar.", "apr.", "mai", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "des."], dddd: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], ddd: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."] }, "nb"), m({ decimal: ",", mmmm: ["stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia"], mmm: ["sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru"], dddd: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"], ddd: ["niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob."] }, "pl"), m({ group: ".", decimal: ",", mmmm: ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"], mmm: ["jan.", "fev.", "mar.", "abr.", "mai.", "jun.", "jul.", "ago.", "set.", "out.", "nov.", "dez."], dddd: ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"], ddd: ["dom.", "seg.", "ter.", "qua.", "qui.", "sex.", "sáb."] }, "pt"), m({ decimal: ",", nan: "не число", mmmm: ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"], mmm: ["янв.", "февр.", "мар.", "апр.", "мая", "июн.", "июл.", "авг.", "сент.", "окт.", "нояб.", "дек."], dddd: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], ddd: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"] }, "ru"), m({ decimal: ",", mmmm: ["januára", "februára", "marca", "apríla", "mája", "júna", "júla", "augusta", "septembra", "októbra", "novembra", "decembra"], mmm: ["jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec"], dddd: ["nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota"], ddd: ["ne", "po", "ut", "st", "št", "pi", "so"] }, "sk"), m({ group: ".", decimal: ",", ampm: ["a. m.", "p. m."], mmmm: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], mmm: ["ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."], dddd: ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], ddd: ["dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."] }, "es"), m({ decimal: ",", ampm: ["fm", "em"], mmmm: ["januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december"], mmm: ["jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec."], dddd: ["söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag"], ddd: ["sön", "mån", "tis", "ons", "tors", "fre", "lör"] }, "sv"), m({ group: ".", decimal: ",", ampm: ["ÖÖ", "ÖS"], mmmm: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], mmm: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], dddd: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], ddd: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"] }, "tr");
3817
+ function p(e2, t2, n2) {
3818
+ const a2 = e2 < 0 ? -1 : 1, r2 = 10 ** (t2 || 2), i2 = 10 ** (n2 || 2);
3819
+ let s2, o2, l3 = Math.abs(e2), d2 = 0, m2 = 0, u2 = 0, c2 = 1;
3820
+ if ((e2 = l3) % 1 == 0) o2 = [e2 * a2, 1];
3821
+ else if (e2 < 1e-19) o2 = [a2, 1e19];
3822
+ else if (e2 > 1e19) o2 = [1e19 * a2, 1];
3823
+ else {
3824
+ do
3825
+ if (l3 = 1 / (l3 - Math.floor(l3)), s2 = c2, c2 = c2 * Math.floor(l3) + d2, d2 = s2, m2 = u2, u2 = Math.floor(e2 * c2 + 0.5), u2 >= r2 || c2 >= i2) return [a2 * m2, d2];
3826
+ while (Math.abs(e2 - u2 / c2) >= 1e-10 && l3 !== Math.floor(l3));
3827
+ o2 = [a2 * u2, c2];
3828
+ }
3829
+ return o2;
3830
+ }
3831
+ __name(p, "p");
3832
+ const f = { overflow: "######", dateErrorThrows: !1, dateErrorNumber: !0, dateSpanLarge: !0, leap1900: !0, nbsp: !0, throws: !0, invalid: "######", locale: "", ignoreTimezone: !1 }, g = Object.assign({}, f);
3833
+ function h(e2) {
3834
+ if (e2 === null && (e2 = f), e2) {
3835
+ for (const t2 in e2) if (t2 in f) {
3836
+ const n2 = e2[t2];
3837
+ g[t2] = n2 == null ? f[t2] : n2;
3838
+ }
3839
+ }
3840
+ return { ...g };
3841
+ }
3842
+ __name(h, "h");
3843
+ const y = { "#": "", 0: "0", "?": " " }, _ = { "@": "text", "-": "minus", "+": "plus" }, b = ["#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#000", "#FFF", "#F00", "#0F0", "#00F", "#FF0", "#F0F", "#0FF", "#800", "#080", "#008", "#880", "#808", "#088", "#CCC", "#888", "#99F", "#936", "#FFC", "#CFF", "#606", "#F88", "#06C", "#CCF", "#008", "#F0F", "#FF0", "#0FF", "#808", "#800", "#088", "#00F", "#0CF", "#CFF", "#CFC", "#FF9", "#9CF", "#F9C", "#C9F", "#FC9", "#36F", "#3CC", "#9C0", "#FC0"], j = ["¤", "$", "£", "¥", "֏", "؋", "৳", "฿", "៛", "₡", "₦", "₩", "₪", "₫", "€", "₭", "₮", "₱", "₲", "₴", "₸", "₹", "₺", "₼", "₽", "₾", "₿"], v = new RegExp("[" + j.join("") + "]");
3844
+ function M2(e2, t2, n2) {
3845
+ return t2[n2 + "_max"] = e2.length, t2[n2 + "_min"] = e2.replace(/#/g, "").length, t2;
3846
+ }
3847
+ __name(M2, "M");
3848
+ const k = {};
3849
+ function x(e2) {
3850
+ if (!(e2 in k)) {
3851
+ const t2 = [], n2 = e2.replace(/^[#,]+/, "").replace(/[1-9]\d*/g, (e3) => "?".repeat(e3.length));
3852
+ for (let e3 = 0; e3 < n2.length; e3++) {
3853
+ const a2 = n2.charAt(e3);
3854
+ t2[e3] = a2 in y ? y[a2] : a2;
3855
+ }
3856
+ k[e2] = t2.join("");
3857
+ }
3858
+ return k[e2];
3859
+ }
3860
+ __name(x, "x");
3861
+ function F(e2, t2) {
3862
+ typeof e2 == "string" && (e2 = { type: "string", value: e2 = e2.replace(/ /g, y["?"]) }), t2.push(e2);
3863
+ }
3864
+ __name(F, "F");
3865
+ function z(e2) {
3866
+ const t2 = [], n2 = { scale: 1, percent: !1, text: !1, date: 0, date_eval: !1, date_system: 1, sec_decimals: 0, general: !1, clock: 24, int_pattern: [], frac_pattern: [], man_pattern: [], den_pattern: [], num_pattern: [], tokens: t2 };
3867
+ let a2 = e2 + "", r2 = "int", i2 = !1, s2 = null;
3868
+ const l3 = [];
3869
+ let d2, m2, u2 = !1;
3870
+ for (; a2 && !i2; ) {
3871
+ if (d2 = /^General/i.exec(a2)) n2.general = !0, F({ type: "general" }, t2);
3872
+ else if (r2 === "int" && (d2 = /^[#?0]+(?:,[#?0]+)*/.exec(a2)) || r2 === "den" && (d2 = /^[#?\d]+/.exec(a2)) || (d2 = /^[#?0]+/.exec(a2))) n2[r2 + "_pattern"].push(d2[0]), s2 = { type: r2, num: d2[0] }, F(s2, t2);
3873
+ else if ((d2 = /^\//.exec(a2)) && n2[r2 + "_pattern"].length) {
3874
+ if (!s2) throw new SyntaxError("Missing a numerator in pattern ".concat(e2));
3875
+ n2.fractions = !0, n2.num_pattern.push(n2[r2 + "_pattern"].pop()), s2.type = "num", r2 = "den", F({ type: "div" }, t2);
3876
+ } else if (d2 = /^,+/.exec(a2)) {
3877
+ const e3 = a2.charAt(1) in y;
3878
+ m2.slice(-1) in y && (d2[0].length > 1 || !e3) ? n2.scale = 1e-3 ** d2[0].length : n2.dec_fractions || F(d2[0], t2);
3879
+ } else {
3880
+ if (d2 = /^;/.exec(a2)) {
3881
+ i2 = !0;
3882
+ break;
3883
+ }
3884
+ if (d2 = /^[@+-]/.exec(a2)) d2[0] === "@" && (n2.text = !0), F({ type: _[d2[0]] }, t2);
3885
+ else if (d2 = /^(?:\[(h+|m+|s+)\])/i.exec(a2)) {
3886
+ const e3 = d2[1].toLowerCase(), a3 = e3[0], r3 = { type: "", size: 0, date: 1, raw: d2[0], pad: e3.length };
3887
+ a3 === "h" ? (r3.size = 16, r3.type = "hour-elap") : a3 === "m" ? (r3.size = 32, r3.type = "min-elap") : (r3.size = 64, r3.type = "sec-elap"), n2.date = n2.date | r3.size, l3.push(r3), F(r3, t2);
3888
+ } else if (d2 = /^(?:B2)/i.exec(a2)) u2 || (n2.date_system = 6);
3889
+ else if (d2 = /^(?:B1)/i.exec(a2)) u2 || (n2.date_system = 1);
3890
+ else if (d2 = /^(?:([hHmMsSyYbBdDegG])\1*)/.exec(a2)) {
3891
+ const e3 = { type: "", size: 0, date: 1, raw: d2[0] }, a3 = d2[0].toLowerCase(), r3 = a3[0];
3892
+ if (a3 === "y" || a3 === "yy") e3.size = 2, e3.type = "year-short";
3893
+ else if (r3 === "y" || r3 === "e") e3.size = 2, e3.type = "year";
3894
+ else if (a3 === "b" || a3 === "bb") e3.size = 2, e3.type = "b-year-short";
3895
+ else if (r3 === "b") e3.size = 2, e3.type = "b-year";
3896
+ else if (a3 === "d" || a3 === "dd") e3.size = 8, e3.type = "day", e3.pad = /dd/.test(a3);
3897
+ else if (a3 === "ddd") e3.size = 8, e3.type = "weekday-short";
3898
+ else if (r3 === "d") e3.size = 8, e3.type = "weekday";
3899
+ else if (r3 === "h") e3.size = 16, e3.type = "hour", e3.pad = /hh/i.test(a3);
3900
+ else if (r3 === "m") {
3901
+ a3.length === 3 ? (e3.size = 4, e3.type = "monthname-short") : a3.length === 5 ? (e3.size = 4, e3.type = "monthname-single") : a3.length >= 4 && (e3.size = 4, e3.type = "monthname");
3902
+ const t3 = l3[l3.length - 1];
3903
+ !e3.type && t3 && !t3.used && 80 & t3.size && (t3.used = !0, e3.size = 32, e3.type = "min", e3.pad = /mm/.test(a3)), e3.type || (e3.size = 4, e3.type = "month", e3.pad = /mm/.test(a3), e3.indeterminate = !0);
3904
+ } else if (r3 === "s") {
3905
+ e3.size = 64, e3.type = "sec", e3.pad = /ss/.test(a3);
3906
+ const t3 = l3[l3.length - 1];
3907
+ t3 && 32 & t3.size ? e3.used = !0 : t3 && t3.indeterminate && (delete t3.indeterminate, t3.size = 32, t3.type = "min", e3.used = !0);
3908
+ }
3909
+ n2.date = n2.date | e3.size, n2.date_eval = !0, l3.push(e3), F(e3, t2);
3910
+ } else if (d2 = /^(?:AM\/PM|am\/pm|A\/P)/.exec(a2)) n2.clock = 12, n2.date = 16 | n2.date, n2.date_eval = !0, F({ type: "am", short: d2[0] === "A/P" }, t2);
3911
+ else if (n2.date && (d2 = /^\.0{1,3}/i.exec(a2))) {
3912
+ const e3 = d2[0].length - 1, a3 = [64, 128, 256, 512][e3];
3913
+ n2.date = n2.date | a3, n2.date_eval = !0, n2.sec_decimals = Math.max(n2.sec_decimals, e3), F({ type: "subsec", size: a3, decimals: e3, date: 1, raw: d2[0] }, t2);
3914
+ } else if ((d2 = /^\\(.)/.exec(a2)) || (d2 = /^"([^"]*?)"/.exec(a2))) F(d2[1], t2);
3915
+ else if (d2 = /^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(a2)) n2.condition = [d2[1], parseFloat(d2[2], 10)];
3916
+ else if (d2 = /^\[\$([^\]]+)\]/.exec(a2)) {
3917
+ const e3 = d2[1].split("-"), a3 = e3.length < 2 ? "" : e3[e3.length - 1], r3 = e3[0];
3918
+ r3 && F(r3, t2);
3919
+ const i3 = o(a3);
3920
+ i3 && (n2.locale = i3);
3921
+ const s3 = parseInt(a3, 16);
3922
+ isFinite(s3) && 16711680 & s3 && (s3 >> 16 & 255) === 6 && (n2.date_system = 6), u2 = !0;
3923
+ } else if (d2 = /^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(a2)) n2.color = d2[2] ? b[parseInt(d2[2], 10)] || "#000" : d2[1].toLowerCase();
3924
+ else if (!(d2 = /^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(a2))) {
3925
+ if (d2 = /^%/.exec(a2)) n2.scale = 100, n2.percent = !0, F("%", t2);
3926
+ else if (d2 = /^_(\\.|.)/.exec(a2)) F(" ", t2);
3927
+ else if (d2 = /^\./.exec(a2)) F({ type: "point", value: d2[0] }, t2), n2.dec_fractions = !0, r2 = "frac";
3928
+ else if (d2 = /^[Ee]([+-]?|(?=[0#?]))/.exec(a2)) n2.exponential = !0, n2.exp_plus = d2[1] === "+", r2 = "man", F({ type: "exp", plus: d2[1] === "+" }, t2);
3929
+ else if (!(d2 = /^\*(\\.|.)/.exec(a2))) {
3930
+ if (d2 = /^[BENn[]/.exec(a2)) throw new SyntaxError("Unexpected char ".concat(a2.charAt(0), " in pattern ").concat(e2));
3931
+ a2[0] === "(" && (n2.parens = !0), d2 = [a2[0]], F(d2[0], t2);
3932
+ }
3933
+ }
3934
+ }
3935
+ m2 = d2[0], a2 = a2.slice(d2 ? d2[0].length : 1);
3936
+ }
3937
+ if (n2.pattern = e2.slice(0, e2.length - a2.length), /^((?:\[[^\]]+\])+)(;|$)/.test(n2.pattern) && !/^\[(?:h+|m+|s+)\]/.test(n2.pattern) && F({ type: "text" }, t2), n2.fractions && n2.dec_fractions || n2.fractions && n2.exponential) throw new SyntaxError("Invalid pattern: ".concat(n2.pattern));
3938
+ const c2 = n2.int_pattern.join("");
3939
+ if (n2.grouping = c2.indexOf(",") >= 0, n2.grouping) {
3940
+ const e3 = c2.split(","), t3 = e3.length;
3941
+ t3 === 2 ? (n2.group_pri = e3[1].length, n2.group_sec = n2.group_pri) : t3 > 2 && (n2.group_pri = e3[t3 - 1].length, n2.group_sec = e3[t3 - 2].length);
3942
+ } else n2.group_pri = 0, n2.group_sec = 0;
3943
+ M2(c2.replace(/[,]/g, ""), n2, "int"), M2(n2.frac_pattern.join(""), n2, "frac"), M2(n2.man_pattern.join(""), n2, "man");
3944
+ let p2 = n2.num_pattern.join(""), f2 = n2.den_pattern.join("");
3945
+ const g2 = /\?/.test(f2) || /\?/.test(p2);
3946
+ return f2 = f2.replace(/\d/g, g2 ? "?" : "#"), g2 && (f2 = f2.replace(/#$/g, "?")), M2(p2, n2, "num"), M2(f2, n2, "den"), g2 && (p2 = p2.replace(/#$/g, "?")), n2.int_padding = x(n2.int_pattern.join("")), n2.man_padding = x(n2.man_pattern.join("")), n2.num_padding = x(p2), n2.den_padding = x(f2), n2.den_pattern.length && (n2.denominator = parseInt(n2.den_pattern.join("").replace(/\D/g, ""), 10)), n2.integer = !!n2.int_pattern.join("").length, n2.fractions && t2.forEach((e3, n3) => {
3947
+ const a3 = t2[n3 + 1];
3948
+ e3.type === "string" && a3 && (a3.type === "num" ? e3.rule = "num+int" : a3.type === "div" ? e3.rule = "num" : a3.type === "den" && (e3.rule = "den"));
3949
+ }), n2;
3950
+ }
3951
+ __name(z, "z");
3952
+ const w = /* @__PURE__ */ __name((e2) => {
3953
+ const t2 = e2.condition;
3954
+ t2 && t2[1] < 0 && (t2[0] === "<" || t2[0] === "<=" || t2[0] === "=") || e2.tokens.unshift({ type: "minus", volatile: !0 });
3955
+ }, "w");
3956
+ function D(e2) {
3957
+ const t2 = [];
3958
+ let n2, a2 = !1, r2 = null, i2 = e2, s2 = 0, l3 = !1, d2 = 0, m2 = 0;
3959
+ do {
3960
+ if (l3 = z(i2), (l3.date || l3.general) && (l3.int_pattern.length || l3.frac_pattern.length || l3.scale !== 1 || l3.text)) throw new Error("Illegal format");
3961
+ if (l3.condition && (m2++, a2 = !0), l3.text) {
3962
+ if (r2) throw new Error("Unexpected partition");
3963
+ r2 = l3;
3964
+ }
3965
+ l3.locale && (n2 = o(l3.locale)), t2.push(l3), s2 = i2.charAt(l3.pattern.length) === ";" ? 1 : 0, i2 = i2.slice(l3.pattern.length + s2), d2++;
3966
+ } while (s2 && d2 < 4 && m2 < 3);
3967
+ if (s2) throw new Error("Unexpected partition");
3968
+ if (m2 > 2) throw new Error("Unexpected condition");
3969
+ const u2 = t2[3];
3970
+ if (u2 && (u2.int_pattern.length || u2.frac_pattern.length || u2.date)) throw new Error("Unexpected partition");
3971
+ if (a2) {
3972
+ const e3 = t2.length;
3973
+ if (e3 === 1 && (t2[1] = z("General"), t2[1].generated = !0), e3 < 3) {
3974
+ const e4 = t2[0], n3 = t2[1];
3975
+ if (w(e4), n3.condition) w(n3);
3976
+ else {
3977
+ const t3 = e4.condition;
3978
+ (t3[0] === "=" || t3[1] >= 0 && (t3[0] === ">" || t3[0] === ">=")) && n3.tokens.unshift({ type: "minus", volatile: !0 });
3979
+ }
3980
+ } else t2.forEach(w);
3981
+ } else {
3982
+ if (t2.length < 4 && r2) for (let e3 = 0, n3 = t2.length; e3 < n3; e3++) t2[e3] === r2 && t2.splice(e3, 1);
3983
+ if (t2.length < 1 && r2 && (t2[0] = z("General"), t2[0].generated = !0), t2.length < 2) {
3984
+ const e3 = z(t2[0].pattern);
3985
+ e3.tokens.unshift({ type: "minus", volatile: !0 }), e3.generated = !0, t2.push(e3);
3986
+ }
3987
+ if (t2.length < 3) {
3988
+ const e3 = z(t2[0].pattern);
3989
+ e3.generated = !0, t2.push(e3);
3990
+ }
3991
+ if (t2.length < 4) if (r2) t2.push(r2);
3992
+ else {
3993
+ const e3 = z("@");
3994
+ e3.generated = !0, t2.push(e3);
3995
+ }
3996
+ t2[0].condition = [">", 0], t2[1].condition = ["<", 0], t2[2].condition = null;
3997
+ }
3998
+ return { pattern: e2, partitions: t2, locale: n2 };
3999
+ }
4000
+ __name(D, "D");
4001
+ const S = Math.floor;
4002
+ function C(e2) {
4003
+ if ((!(arguments.length > 1 && arguments[1] !== void 0) || arguments[1]) && e2 >= 0) {
4004
+ if (e2 === 0) return [1900, 1, 0];
4005
+ if (e2 === 60) return [1900, 2, 29];
4006
+ if (e2 < 60) return [1900, e2 < 32 ? 1 : 2, (e2 - 1) % 31 + 1];
4007
+ }
4008
+ let n2 = e2 + 68569 + 2415019;
4009
+ const a2 = S(4 * n2 / 146097);
4010
+ n2 -= S((146097 * a2 + 3) / 4);
4011
+ const r2 = S(4e3 * (n2 + 1) / 1461001);
4012
+ n2 = n2 - S(1461 * r2 / 4) + 31;
4013
+ const i2 = S(80 * n2 / 2447), s2 = n2 - S(2447 * i2 / 80);
4014
+ n2 = S(i2 / 11);
4015
+ const o2 = i2 + 2 - 12 * n2;
4016
+ return [0 | 100 * (a2 - 49) + r2 + n2, 0 | o2, 0 | s2];
4017
+ }
4018
+ __name(C, "C");
4019
+ function E(e2) {
4020
+ return C(e2 + 1462);
4021
+ }
4022
+ __name(E, "E");
4023
+ function A(e2) {
4024
+ if (e2 === 60) throw new Error("#VALUE!");
4025
+ if (e2 <= 1) return [1317, 8, 29];
4026
+ if (e2 < 60) return [1317, e2 < 32 ? 9 : 10, 1 + (e2 - 2) % 30];
4027
+ const t2 = 10631 / 30, n2 = 0.1335;
4028
+ let a2 = e2 + 466935;
4029
+ const r2 = S(a2 / 10631);
4030
+ a2 -= 10631 * r2;
4031
+ const i2 = S((a2 - n2) / t2);
4032
+ a2 -= S(i2 * t2 + n2);
4033
+ const s2 = S((a2 + 28.5001) / 29.5);
4034
+ return s2 === 13 ? [30 * r2 + i2, 12, 30] : [30 * r2 + i2, s2, a2 - S(29.5001 * s2 - 29)];
4035
+ }
4036
+ __name(A, "A");
4037
+ function Y(e2) {
4038
+ let t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n2 = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2];
4039
+ const a2 = S(e2);
4040
+ return t2 === 6 ? A(a2) : t2 === -1 ? E(a2) : C(a2, n2);
4041
+ }
4042
+ __name(Y, "Y");
4043
+ const T = Math.floor, N2 = 86400;
4044
+ function P(e2, t2) {
4045
+ let n2 = null;
4046
+ if (Array.isArray(e2)) {
4047
+ const [t3, a2, r2, i2, s2, o2] = e2;
4048
+ n2 = Date.UTC(t3, a2 == null ? 0 : a2 - 1, r2 != null ? r2 : 1, i2 || 0, s2 || 0, o2 || 0);
4049
+ } else if (e2 instanceof Date && (n2 = 1 * e2, !t2 || !t2.ignoreTimezone)) {
4050
+ const t3 = /* @__PURE__ */ new Date();
4051
+ t3.setUTCFullYear(e2.getFullYear(), e2.getMonth(), e2.getDate()), t3.setUTCHours(e2.getHours(), e2.getMinutes(), e2.getSeconds(), e2.getMilliseconds()), n2 = 1 * t3;
4052
+ }
4053
+ if (n2 != null && isFinite(n2)) {
4054
+ const e3 = n2 / 864e5;
4055
+ return e3 - (e3 <= -25509 ? -25568 : -25569);
4056
+ }
4057
+ return e2;
4058
+ }
4059
+ __name(P, "P");
4060
+ function I2(e2, t2) {
4061
+ let n2 = 0 | e2;
4062
+ const a2 = N2 * (e2 - n2);
4063
+ let r2 = T(a2);
4064
+ a2 - r2 > 0.9999 && (r2 += 1, r2 === N2 && (r2 = 0, n2 += 1));
4065
+ const i2 = r2 < 0 ? N2 + r2 : r2, [s2, o2, l3] = Y(e2, 0, t2 && t2.leap1900), d2 = T(i2 / 60 / 60) % 60, m2 = T(i2 / 60) % 60, u2 = T(i2) % 60;
4066
+ if (t2 && t2.nativeDate) {
4067
+ const e3 = /* @__PURE__ */ new Date(0);
4068
+ return e3.setUTCFullYear(s2, o2 - 1, l3), e3.setUTCHours(d2, m2, u2), e3;
4069
+ }
4070
+ return [s2, o2, l3, d2, m2, u2];
4071
+ }
4072
+ __name(I2, "I");
4073
+ function O(e2) {
4074
+ return !!(e2[0] && e2[0].percent || e2[1] && e2[1].percent || e2[2] && e2[2].percent || e2[3] && e2[3].percent);
4075
+ }
4076
+ __name(O, "O");
4077
+ function J(e2) {
4078
+ return !!(e2[0] && e2[0].date || e2[1] && e2[1].date || e2[2] && e2[2].date || e2[3] && e2[3].date);
4079
+ }
4080
+ __name(J, "J");
4081
+ function L2(e2) {
4082
+ const [t2, n2, a2, r2] = e2;
4083
+ return !(t2 && !t2.generated || n2 && !n2.generated || a2 && !a2.generated || !r2 || !r2.text || r2.generated);
4084
+ }
4085
+ __name(L2, "L");
4086
+ const U = { text: 15, datetime: 10.8, date: 10.8, time: 10.8, percent: 10.6, currency: 10.4, grouped: 10.2, scientific: 6, number: 4, fraction: 2, general: 0, error: 0 }, R = [["DMY", 1], ["DM", 2], ["MY", 3], ["MDY", 4], ["MD", 5], ["hmsa", 6], ["hma", 7], ["hms", 8], ["hm", 9]], G = { total: 1, sign: 0, period: 0, int: 1, frac: 0 }, H2 = /* @__PURE__ */ __name((e2, t2) => e2.replace(/\./, t2.decimal), "H");
4087
+ function B(e2, t2, n2, a2) {
4088
+ const r2 = 0 | n2;
4089
+ if (typeof n2 == "string") e2.push(n2);
4090
+ else if (n2 === r2) e2.push(Math.abs(r2));
4091
+ else {
4092
+ const t3 = Math.abs(n2);
4093
+ let r3 = t3 ? Math.floor(Math.log10(t3)) : 0, i2 = r3 < 0 ? t3 * 10 ** -r3 : t3 / 10 ** r3;
4094
+ i2 === 10 && (i2 = 1, r3++);
4095
+ const s2 = function(e3) {
4096
+ let t4 = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
4097
+ const n3 = Math.abs(e3);
4098
+ if (!n3) return G;
4099
+ const a3 = t4 && e3 < 0 ? 1 : 0, r4 = Math.floor(n3), i3 = Math.floor(Math.log10(n3) + 1);
4100
+ let s3 = 0, o3 = 0;
4101
+ if (r4 !== n3) {
4102
+ s3 = 1;
4103
+ const e4 = String(c(i3 < 0 ? n3 * 10 ** -i3 : n3 / 10 ** i3, 15));
4104
+ let t5 = e4.length, a4 = !0, r5 = 0;
4105
+ for (; r5 <= e4.length; ) {
4106
+ if (e4[r5] === ".") {
4107
+ t5--;
4108
+ break;
4109
+ }
4110
+ e4[r5] === "0" && a4 ? t5-- : a4 = !1, r5++;
4111
+ }
4112
+ o3 = t5 - i3, o3 < 0 && (o3 = 0, s3 = 0);
4113
+ }
4114
+ return { total: a3 + Math.max(i3, 1) + s3 + o3, digits: Math.max(i3, 0) + o3, sign: a3, period: s3, int: Math.max(i3, 1), frac: o3 };
4115
+ }(t3), o2 = /* @__PURE__ */ __name(() => {
4116
+ const t4 = Math.abs(r3);
4117
+ let n3;
4118
+ n3 = i2 === 1 ? i2 : c(i2, 5), e2.push(H2(n3 + "", a2), a2.exponent, r3 < 0 ? a2.negative : a2.positive, t4 < 10 ? "0" : "", t4);
4119
+ }, "o");
4120
+ if (r3 >= -4 && r3 <= -1) {
4121
+ const n3 = t3.toPrecision(10 + r3).replace(/\.?0+$/, "");
4122
+ e2.push(H2(n3, a2));
4123
+ } else if (r3 === 10) {
4124
+ const n3 = t3.toFixed(10).slice(0, 12).replace(/\.$/, "");
4125
+ e2.push(H2(n3, a2));
4126
+ } else if (Math.abs(r3) <= 9) if (s2.total <= 11) {
4127
+ const n3 = c(t3, 9).toFixed(s2.frac);
4128
+ e2.push(H2(n3, a2));
4129
+ } else r3 === 9 ? e2.push(Math.floor(t3)) : r3 >= 0 && r3 < 9 ? e2.push(c(t3, 9 - r3)) : o2();
4130
+ else s2.total >= 12 ? o2() : Math.floor(t3) === t3 ? e2.push(Math.floor(t3)) : e2.push(H2(c(t3, 9).toFixed(s2.frac), a2));
4131
+ }
4132
+ return e2;
4133
+ }
4134
+ __name(B, "B");
4135
+ const $ = 86400, W = { int: "integer", frac: "fraction", man: "mantissa", num: "numerator", den: "denominator" }, Z = /* @__PURE__ */ __name(function(e2) {
4136
+ let t2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
4137
+ const n2 = Math.floor(Math.log10(e2));
4138
+ return t2 > 1 ? Math.floor(n2 / t2) * t2 : n2;
4139
+ }, "Z");
4140
+ function K(e2, t2, n2, a2) {
4141
+ let r2 = "", i2 = "", s2 = "", o2 = "", l3 = "", d2 = 0, m2 = 0 | e2, f2 = 0, g2 = 0, h2 = 1, _2 = 0, b2 = 0, j2 = 0, v2 = 0, M3 = 0, k2 = 0;
4142
+ const x2 = a2 || u;
4143
+ if (!t2.text && isFinite(t2.scale) && t2.scale !== 1 && (e2 = function(e3) {
4144
+ if (e3 === 0) return e3;
4145
+ const t3 = Math.ceil(Math.log10(e3 < 0 ? -e3 : e3)), n3 = 10 ** (16 - Math.floor(t3));
4146
+ return Math.round(e3 * n3) / n3;
4147
+ }(e2 * t2.scale)), t2.exponential) {
4148
+ let n3 = Math.abs(e2);
4149
+ if (n3) {
4150
+ const e3 = 10 ** -Z(n3, t2.int_max), a3 = c(n3 * e3, t2.frac_max) / e3;
4151
+ d2 = Z(a3, t2.int_max);
4152
+ }
4153
+ n3 /= 10 ** d2, e2 = e2 < 0 ? -n3 : n3, r2 += Math.abs(d2);
4154
+ }
4155
+ if (t2.integer) {
4156
+ const n3 = Math.abs(c(e2, t2.fractions ? 1 : t2.frac_max));
4157
+ l3 += n3 < 1 ? "" : Math.floor(n3);
4158
+ }
4159
+ if (t2.grouping) {
4160
+ let e3 = "", n3 = l3.length;
4161
+ for (n3 > t2.group_pri && (n3 -= t2.group_pri, e3 = x2.group + l3.slice(n3, n3 + t2.group_pri) + e3); n3 > t2.group_sec; ) n3 -= t2.group_sec, e3 = x2.group + l3.slice(n3, n3 + t2.group_sec) + e3;
4162
+ l3 = n3 ? l3.slice(0, n3) + e3 : e3;
4163
+ }
4164
+ t2.dec_fractions && (o2 = String(c(e2, t2.frac_max)).split(".")[1] || "");
4165
+ let F2 = !1;
4166
+ if (t2.fractions) {
4167
+ const n3 = Math.abs(t2.integer ? e2 % 1 : e2);
4168
+ if (n3) if (F2 = !0, isFinite(t2.denominator)) s2 += t2.denominator, i2 += c(n3 * t2.denominator), i2 === "0" && (i2 = "", s2 = "", F2 = !1, l3 || (l3 = "0"));
4169
+ else {
4170
+ const e3 = p(n3, t2.integer ? t2.num_max : 1 / 0, t2.den_max);
4171
+ i2 += e3[0], s2 += e3[1], t2.integer && i2 === "0" && (l3 || (l3 = "0"), i2 = "", s2 = "", F2 = !1);
4172
+ }
4173
+ }
4174
+ if (t2.date) {
4175
+ m2 = Math.trunc(e2);
4176
+ const a3 = $ * (e2 - m2);
4177
+ if (f2 = Math.floor(a3), k2 = a3 - f2, Math.abs(k2) < 1e-6 ? k2 = 0 : k2 > 0.9999 && (k2 = 0, f2 += 1, f2 === $ && (f2 = 0, m2 += 1)), k2) {
4178
+ const e3 = 512 & t2.date || 256 & t2.date || 128 & t2.date;
4179
+ (e3 === 512 && k2 > 0.9995 || e3 === 256 && k2 > 0.995 || e3 === 128 && k2 > 0.95 || !e3 && k2 >= 0.5) && (f2++, k2 = 0);
4180
+ }
4181
+ if (m2 || t2.date_system) {
4182
+ const a4 = Y(e2, t2.date_system, n2.leap1900);
4183
+ g2 = a4[0], h2 = a4[1], _2 = a4[2];
4184
+ }
4185
+ if (f2) {
4186
+ const e3 = f2 < 0 ? $ + f2 : f2;
4187
+ M3 = Math.floor(e3) % 60, v2 = Math.floor(e3 / 60) % 60, j2 = Math.floor(e3 / 60 / 60) % 60;
4188
+ }
4189
+ if (b2 = (6 + m2) % 7, t2.date_eval && (z2 = e2, w2 = m2 + f2 / $, n2.dateSpanLarge ? z2 < -694324 || w2 >= 35830291 : z2 < 0 || w2 >= 2958466)) {
4190
+ if (n2.dateErrorThrows) throw new Error("Date out of bounds");
4191
+ return n2.dateErrorNumber ? B(e2 < 0 ? [x2.negative] : [], 0, e2, x2).join("") : n2.overflow;
4192
+ }
4193
+ }
4194
+ var z2, w2;
4195
+ if (t2.int_padding && (l3 = t2.int_padding.length === 1 ? l3 || t2.int_padding : t2.int_padding.substring(0, t2.int_padding.length - l3.length) + l3), t2.num_padding && (i2 = t2.num_padding.length === 1 ? i2 || t2.num_padding : t2.num_padding.substring(0, t2.num_padding.length - i2.length) + i2), t2.den_padding && (s2 = t2.den_padding.length === 1 ? s2 || t2.den_padding : s2 + t2.den_padding.slice(s2.length)), t2.man_padding) {
4196
+ const e3 = t2.exp_plus ? "+" : "";
4197
+ r2 = t2.man_padding.length === 1 ? (d2 < 0 ? "-" : e3) + (r2 || t2.man_padding) : (d2 < 0 ? "-" : e3) + t2.man_padding.slice(0, t2.man_padding.length - r2.length) + r2;
4198
+ }
4199
+ const D2 = [];
4200
+ let S2 = 0;
4201
+ const C2 = { int: 0, frac: 0, man: 0, num: 0, den: 0 };
4202
+ for (let d3 = 0, u2 = t2.tokens.length; d3 < u2; d3++) {
4203
+ const u3 = t2.tokens[d3], c2 = u3.num ? u3.num.length : 0;
4204
+ if (u3.type === "string") u3.rule ? u3.rule === "num" ? F2 ? D2.push(u3.value) : (t2.num_min > 0 || t2.den_min > 0) && D2.push(u3.value.replace(/./g, y["?"])) : u3.rule === "num+int" ? F2 && l3 ? D2.push(u3.value) : t2.den_min > 0 && (l3 || t2.num_min) && D2.push(u3.value.replace(/./g, y["?"])) : u3.rule === "den" && (F2 ? D2.push(u3.value) : (t2.den_min > 0 || t2.den_min > 0) && D2.push(u3.value.replace(/./g, y["?"]))) : D2.push(u3.value);
4205
+ else if (u3.type === "error") D2.push(n2.invalid);
4206
+ else if (u3.type === "point") D2.push(t2.date ? u3.value : x2.decimal);
4207
+ else if (u3.type === "general") B(D2, 0, e2, x2);
4208
+ else if (u3.type === "exp") D2.push(x2.exponent);
4209
+ else if (u3.type === "minus") u3.volatile && t2.date || u3.volatile && (e2 >= 0 || typeof e2 != "number") || (u3.volatile && !t2.fractions && (t2.integer || t2.dec_fractions) ? (e2 < 0 && l3 && l3 !== "0" || o2) && D2.push(x2.negative) : D2.push(x2.negative));
4210
+ else if (u3.type === "plus") D2.push(x2.positive);
4211
+ else if (u3.type === "text") D2.push(e2);
4212
+ else if (u3.type === "div") F2 ? D2.push("/") : t2.num_min > 0 || t2.den_min > 0 ? D2.push(y["?"]) : D2.push(y["#"]);
4213
+ else if (u3.type === "int") if (t2.int_pattern.length === 1) D2.push(l3);
4214
+ else {
4215
+ const e3 = S2 ? t2.int_pattern.join("").length - C2.int : 1 / 0, n3 = S2 === t2.int_pattern.length - 1 ? 0 : t2.int_pattern.join("").length - (C2.int + u3.num.length);
4216
+ D2.push(l3.substring(l3.length - e3, l3.length - n3)), S2++, C2.int += u3.num.length;
4217
+ }
4218
+ else if (u3.type === "frac") {
4219
+ const e3 = C2.frac;
4220
+ for (let t3 = 0; t3 < c2; t3++) D2.push(o2[t3 + e3] || y[u3.num[t3]]);
4221
+ C2.frac += c2;
4222
+ } else if (u3.type in W) t2[u3.type + "_pattern"].length === 1 ? (u3.type === "int" && D2.push(l3), u3.type === "frac" && D2.push(o2), u3.type === "man" && D2.push(r2), u3.type === "num" && D2.push(i2), u3.type === "den" && D2.push(s2)) : (D2.push(W[u3.type].slice(C2[u3.type], C2[u3.type] + c2)), C2[u3.type] += c2);
4223
+ else if (u3.type === "year") g2 < 0 && D2.push(x2.negative), D2.push(String(Math.abs(g2)).padStart(4, "0"));
4224
+ else if (u3.type === "year-short") {
4225
+ const e3 = g2 % 100;
4226
+ D2.push(e3 < 10 ? "0" : "", e3);
4227
+ } else if (u3.type === "month") D2.push(u3.pad && h2 < 10 ? "0" : "", h2);
4228
+ else if (u3.type === "monthname-single") t2.date_system === 6 ? D2.push(x2.mmmm6[h2 - 1].charAt(0)) : D2.push(x2.mmmm[h2 - 1].charAt(0));
4229
+ else if (u3.type === "monthname-short") t2.date_system === 6 ? D2.push(x2.mmm6[h2 - 1]) : D2.push(x2.mmm[h2 - 1]);
4230
+ else if (u3.type === "monthname") t2.date_system === 6 ? D2.push(x2.mmmm6[h2 - 1]) : D2.push(x2.mmmm[h2 - 1]);
4231
+ else if (u3.type === "weekday-short") D2.push(x2.ddd[b2]);
4232
+ else if (u3.type === "weekday") D2.push(x2.dddd[b2]);
4233
+ else if (u3.type === "day") D2.push(u3.pad && _2 < 10 ? "0" : "", _2);
4234
+ else if (u3.type === "hour") {
4235
+ const e3 = j2 % t2.clock || (t2.clock < 24 ? t2.clock : 0);
4236
+ D2.push(u3.pad && e3 < 10 ? "0" : "", e3);
4237
+ } else if (u3.type === "min") D2.push(u3.pad && v2 < 10 ? "0" : "", v2);
4238
+ else if (u3.type === "sec") D2.push(u3.pad && M3 < 10 ? "0" : "", M3);
4239
+ else if (u3.type === "subsec") {
4240
+ D2.push(x2.decimal);
4241
+ const e3 = k2.toFixed(t2.sec_decimals);
4242
+ D2.push(e3.slice(2, 2 + u3.decimals));
4243
+ } else if (u3.type === "am") {
4244
+ const e3 = j2 < 12 ? 0 : 1;
4245
+ u3.short && !a2 ? D2.push("AP"[e3]) : D2.push(x2.ampm[e3]);
4246
+ } else if (u3.type === "hour-elap") {
4247
+ e2 < 0 && D2.push(x2.negative);
4248
+ const t3 = 24 * m2 + Math.floor(Math.abs(f2) / 3600);
4249
+ D2.push(String(Math.abs(t3)).padStart(u3.pad, "0"));
4250
+ } else if (u3.type === "min-elap") {
4251
+ e2 < 0 && D2.push(x2.negative);
4252
+ const t3 = 1440 * m2 + Math.floor(Math.abs(f2) / 60);
4253
+ D2.push(String(Math.abs(t3)).padStart(u3.pad, "0"));
4254
+ } else if (u3.type === "sec-elap") {
4255
+ e2 < 0 && D2.push(x2.negative);
4256
+ const t3 = m2 * $ + Math.abs(f2);
4257
+ D2.push(String(Math.abs(t3)).padStart(u3.pad, "0"));
4258
+ } else if (u3.type === "b-year") D2.push(g2 + 543);
4259
+ else if (u3.type === "b-year-short") {
4260
+ const e3 = (g2 + 543) % 100;
4261
+ D2.push(e3 < 10 ? "0" : "", e3);
4262
+ }
4263
+ }
4264
+ return n2.nbsp ? D2.join("") : D2.join("").replace(/\u00a0/g, " ");
4265
+ }
4266
+ __name(K, "K");
4267
+ function q(e2, t2) {
4268
+ for (let n2 = 0; n2 < 3; n2++) {
4269
+ const a2 = t2[n2];
4270
+ if (a2) {
4271
+ let t3;
4272
+ if (a2.condition) {
4273
+ const n3 = a2.condition[0], r2 = a2.condition[1];
4274
+ n3 === "=" ? t3 = e2 === r2 : n3 === ">" ? t3 = e2 > r2 : n3 === "<" ? t3 = e2 < r2 : n3 === ">=" ? t3 = e2 >= r2 : n3 === "<=" ? t3 = e2 <= r2 : n3 === "<>" && (t3 = e2 !== r2);
4275
+ } else t3 = !0;
4276
+ if (t3) return a2;
4277
+ }
4278
+ }
4279
+ }
4280
+ __name(q, "q");
4281
+ const V = z("@"), Q = "black", X = {};
4282
+ function ee(e2, t2) {
4283
+ if (e2) {
4284
+ const n2 = e2[0];
4285
+ t2[n2] = t2[n2] || {}, ee(e2.slice(1), t2[n2]);
4286
+ } else t2.$ = !0;
4287
+ }
4288
+ __name(ee, "ee"), ["d-F-y", "d-F-Y", "d-M-y", "d-M-Y", "F-d-y", "F-d-Y", "F-j-y", "F-j-Y", "j-F-y", "j-F-Y", "j-M-y", "j-M-Y", "M-d-y", "M-d-Y", "M-j-y", "M-j-Y", "m-d-y", "m-d-Y", "m-j-y", "m-j-Y", "n-d-y", "n-d-Y", "n-j-y", "n-j-Y", "y-F-d", "y-F-j", "y-M-d", "y-M-j", "Y-F-d", "Y-F-j", "Y-M-d", "Y-m-d", "Y-M-j", "Y-m-j", "Y-n-d", "Y-n-j", "j-F", "j-M", "d-F", "d-M", "n-d", "n-j", "n-Y", "m-d", "m-j", "m-Y", "M-Y", "M-y", "F-y", "F-Y", "Y-M", "Y-n", "Y-m", "Y-F", "Y-M"].forEach((e2) => {
4289
+ ee(e2, X), ee(e2 + " x", X), ee(e2 + " l", X), ee(e2 + " l x", X), ee("l " + e2, X), ee("l " + e2 + " x", X), ee(e2 + " D", X), ee(e2 + " D x", X), ee("D " + e2, X), ee("D " + e2 + " x", X);
4290
+ });
4291
+ const te = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, ne = { january: 1, february: 2, march: 3, april: 4, june: 6, july: 7, august: 8, september: 9, october: 10, november: 11, december: 12 }, ae = { sunday: "l", monday: "l", tuesday: "l", wednesday: "l", thursday: "l", friday: "l", saturday: "l", sun: "D", mon: "D", tue: "D", wed: "D", thu: "D", fri: "D", sat: "D" }, re = (/* @__PURE__ */ new Date()).getUTCFullYear();
4292
+ function ie(e2) {
4293
+ const t2 = new RegExp("^([\\s+%" + j.join("") + "(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%" + j.join("") + ")]*)$").exec(e2);
4294
+ if (t2) {
4295
+ const [, e3, n2, a2, r2, i2] = t2;
4296
+ let s2 = 1, o2 = "", l3 = !1, d2 = !1, m2 = !1, u2 = !1, c2 = !1, p2 = null, f2 = !1, g2 = parseFloat(n2.replace(/,/g, ""));
4297
+ if (!isFinite(g2)) return null;
4298
+ for (let t3 = 0; t3 < e3.length; t3++) {
4299
+ const n3 = e3[t3];
4300
+ if (n3 === "-") {
4301
+ if (l3 || d2) return null;
4302
+ l3 = !0, s2 = -1;
4303
+ } else if (v.test(n3)) {
4304
+ if (c2) return null;
4305
+ c2 = !0, p2 = n3;
4306
+ } else if (n3 === "(") {
4307
+ if (d2 || l3) return null;
4308
+ d2 = !0, s2 = -1;
4309
+ } else if (n3 === "%") {
4310
+ if (u2) return null;
4311
+ u2 = !0;
4312
+ }
4313
+ }
4314
+ for (let e4 = 0; e4 < i2.length; e4++) {
4315
+ const t3 = i2[e4];
4316
+ if (v.test(t3)) {
4317
+ if (c2) return null;
4318
+ c2 = !0, p2 = t3, f2 = !0;
4319
+ } else if (t3 === ")") {
4320
+ if (m2 || !d2) return null;
4321
+ m2 = !0;
4322
+ } else if (t3 === "%") {
4323
+ if (u2) return null;
4324
+ u2 = !0;
4325
+ }
4326
+ }
4327
+ if (r2) {
4328
+ if (u2 || c2) return null;
4329
+ o2 = "0.00E+00";
4330
+ } else if (u2) {
4331
+ if (c2) return null;
4332
+ o2 = a2.includes(".") ? "0.00%" : "0%", g2 *= 0.01;
4333
+ } else if (c2) {
4334
+ const e4 = a2.includes(".") ? "#,##0.00" : "#,##0";
4335
+ o2 = f2 ? e4 + p2 : p2 + e4;
4336
+ } else a2.includes(",") && (o2 = a2.includes(".") ? "#,##0.00" : "#,##0");
4337
+ const h2 = { v: g2 * s2 };
4338
+ return o2 && (h2.z = o2), h2;
4339
+ }
4340
+ }
4341
+ __name(ie, "ie");
4342
+ const se = /* @__PURE__ */ __name((e2, t2, n2) => {
4343
+ const a2 = n2.path || "", r2 = Object.keys(t2);
4344
+ for (let i2 = 0; i2 < r2.length; i2++) {
4345
+ let s2;
4346
+ const o2 = r2[i2];
4347
+ if (t2[o2]) {
4348
+ if (o2 === "$" || o2 === "€") e2 || (s2 = n2);
4349
+ else if (o2 === "-") {
4350
+ const r3 = /^(\s*([./-]|,\s)\s*|\s+)/.exec(e2);
4351
+ if (r3) {
4352
+ const i3 = r3[1] === "-" || r3[1] === "/" || r3[1] === "." ? r3[1] : " ";
4353
+ if (!n2.sep || n2.sep === i3) {
4354
+ const l3 = r3[0].replace(/\s+/g, " ");
4355
+ s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, sep: i3, path: a2 + l3 });
4356
+ }
4357
+ }
4358
+ } else if (o2 === " ") {
4359
+ const r3 = /^[,.]?\s+/.exec(e2);
4360
+ if (r3) {
4361
+ const i3 = r3[0].replace(/\s+/g, " ");
4362
+ s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, path: a2 + i3 });
4363
+ }
4364
+ } else if (o2 === "j" || o2 === "d") {
4365
+ const r3 = /^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e2);
4366
+ r3 && (s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, day: r3[0], path: a2 + o2 }));
4367
+ } else if (o2 === "n" || o2 === "m") {
4368
+ const r3 = /^(0?[1-9]|1[012])\b/.exec(e2);
4369
+ r3 && (s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, month: +r3[0], _mon: r3[0], path: a2 + o2 }));
4370
+ } else if (o2 === "F" || o2 === "M") {
4371
+ const r3 = /^([a-z]{3,9})\b/i.exec(e2), i3 = r3 && (o2 === "F" ? ne : te)[r3[0].toLowerCase()];
4372
+ i3 && (s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, month: i3, _mon: r3[0], path: a2 + o2 }));
4373
+ } else if (o2 === "l" || o2 === "D") {
4374
+ const r3 = /^([a-z]{3,9})\b/i.exec(e2);
4375
+ (r3 && ae[r3[0].toLowerCase()]) === o2 && (s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, path: a2 + o2 }));
4376
+ } else if (o2 === "y") {
4377
+ const r3 = /^\d\d\b/.exec(e2);
4378
+ if (r3) {
4379
+ const i3 = +r3[0] >= 30 ? +r3[0] + 1900 : +r3[0] + 2e3;
4380
+ s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, year: i3, path: a2 + o2 });
4381
+ }
4382
+ } else if (o2 === "Y") {
4383
+ const r3 = /^\d\d\d\d\b/.exec(e2);
4384
+ r3 && (s2 = se(e2.slice(r3[0].length), t2[o2], { ...n2, year: +r3[0], path: a2 + o2 }));
4385
+ } else {
4386
+ if (o2 !== "x") throw new Error('Unknown date token "'.concat(o2, '"'));
4387
+ {
4388
+ const r3 = le(e2);
4389
+ r3 && (s2 = se("", t2[o2], { ...n2, time: r3.v, tf: r3.z, path: a2 + o2 }));
4390
+ }
4391
+ }
4392
+ if (s2) return s2;
4393
+ }
4394
+ }
4395
+ }, "se");
4396
+ function oe(e2, t2) {
4397
+ const n2 = se(e2.trim(), X, { path: "" });
4398
+ if (n2) {
4399
+ var a2;
4400
+ if (n2.sep === "." && n2.path.length === 3) return null;
4401
+ const e3 = +((a2 = n2.year) !== null && a2 !== void 0 ? a2 : re);
4402
+ if (n2.day || (n2.day = 1), !function(e4, t3, n3) {
4403
+ if (n3 < 1 || t3 < 1 || t3 > 12) return !1;
4404
+ if (t3 === 2) {
4405
+ if (n3 > (e4 % 4 == 0 && e4 % 100 != 0 || e4 % 400 == 0 || e4 === 1900 ? 29 : 28)) return !1;
4406
+ } else if ((t3 === 4 || t3 === 6 || t3 === 9 || t3 === 11) && n3 > 30 || (t3 === 1 || t3 === 3 || t3 === 5 || t3 === 7 || t3 === 8 || t3 === 10 || t3 === 12) && n3 > 31) return !1;
4407
+ return !0;
4408
+ }(e3, n2.month, n2.day)) return null;
4409
+ let r2 = -1 / 0;
4410
+ if (e3 < 1900) return null;
4411
+ e3 <= 1900 && n2.month <= 2 ? r2 = 25568 : e3 < 1e4 && (r2 = 25569);
4412
+ const i2 = Date.UTC(e3, n2.month - 1, n2.day) / 864e5 + r2 + (n2.time || 0);
4413
+ if (i2 >= 0 && i2 <= 2958465) {
4414
+ const e4 = n2._mon[0] === "0" || n2.day[0] === "0" || n2._mon.length === 2 && n2.day.length === 2, a3 = n2.path.replace(/[jdlDnmMFyYx-]/g, (t3) => t3 === "j" || t3 === "d" ? e4 ? "dd" : "d" : t3 === "D" ? "ddd" : t3 === "l" ? "dddd" : t3 === "n" || t3 === "m" ? e4 ? "mm" : "m" : t3 === "M" ? "mmm" : t3 === "F" ? "mmmm" : t3 === "y" ? "yy" : t3 === "x" ? n2.tf || "" : t3 === "Y" ? "yyyy" : t3);
4415
+ return t2 && t2.nativeDate ? { v: I2(i2, t2), z: a3 } : { v: i2, z: a3 };
4416
+ }
4417
+ }
4418
+ return null;
4419
+ }
4420
+ __name(oe, "oe");
4421
+ function le(e2) {
4422
+ const t2 = /^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(e2);
4423
+ if (t2) {
4424
+ const [, e3, n2, a2, r2, i2] = t2;
4425
+ if (r2 && !a2 || !i2 && !n2 && !a2) return null;
4426
+ let s2 = 1 * (e3 || 0);
4427
+ if (i2) {
4428
+ if (s2 >= 13) return null;
4429
+ i2[0] !== "p" && i2[0] !== "P" || (s2 += 12);
4430
+ }
4431
+ return { v: (60 * s2 * 60 + 60 * (1 * (n2 || 0)) + 1 * (a2 || 0) + 1 * (r2 || 0)) / 86400, z: (e3.length === 2 ? "hh" : "h") + ":mm" + (a2 ? ":ss" : "") + (i2 ? " AM/PM" : "") };
4432
+ }
4433
+ return null;
4434
+ }
4435
+ __name(le, "le");
4436
+ function de(e2) {
4437
+ return /^\s*true\s*$/i.test(e2) ? { v: !0 } : /^\s*false\s*$/i.test(e2) ? { v: !1 } : null;
4438
+ }
4439
+ __name(de, "de");
4440
+ const me = {};
4441
+ function ue(e2, t2) {
4442
+ const { pattern: n2, partitions: a2, locale: r2 } = e2, i2 = /* @__PURE__ */ __name((e3) => {
4443
+ const n3 = Object.assign({}, h(), t2, e3);
4444
+ return r2 && (n3.locale = r2), n3;
4445
+ }, "i"), s2 = /* @__PURE__ */ __name((e3, t3) => {
4446
+ const n3 = i2(t3);
4447
+ return function(e4, t4, n4) {
4448
+ const a3 = l2(n4.locale), r3 = t4[3] ? t4[3] : V;
4449
+ if (typeof e4 == "boolean" && (e4 = e4 ? "TRUE" : "FALSE"), e4 == null) return "";
4450
+ if (typeof e4 != "number") return K(e4, r3, n4, a3);
4451
+ if (!isFinite(e4)) {
4452
+ const t5 = a3 || u;
4453
+ return isNaN(e4) ? t5.nan : (e4 < 0 ? t5.negative : "") + t5.infinity;
4454
+ }
4455
+ const i3 = q(e4, t4);
4456
+ return i3 ? K(e4, i3, n4, a3) : n4.overflow;
4457
+ }(P(e3, n3), a2, n3);
4458
+ }, "s");
4459
+ s2.color = (e3, t3) => function(e4, t4) {
4460
+ if (typeof e4 != "number" || !isFinite(e4)) return (t4[3] ? t4[3].color : V.color) || Q;
4461
+ const n3 = q(e4, t4);
4462
+ return n3 && n3.color || Q;
4463
+ }(P(e3, i2(t3)), a2);
4464
+ const o2 = function(e3) {
4465
+ var t3;
4466
+ let n3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
4467
+ const [a3, r3] = e3, i3 = a3.frac_max, s3 = { type: "general", isDate: J(e3), isText: L2(e3), isPercent: O(e3), maxDecimals: a3.general ? 9 : i3, scale: (t3 = a3.scale) !== null && t3 !== void 0 ? t3 : 1, color: 0, parentheses: 0, grouped: a3.grouping ? 1 : 0, _partitions: e3 }, o3 = !s3.isDate && !s3.isText && !a3.error && a3.tokens.some((e4) => e4.type === "string" && (n3 ? e4.value === n3 : v.test(e4.value)));
4468
+ let l3 = "G", d2 = i3 >= 0 ? Math.min(15, i3) : "", m2 = "", u2 = "";
4469
+ if (r3 && r3.color && (u2 = "-", s3.color = 1), a3.parens && (m2 = "()", s3.parentheses = 1), o3) l3 = "C", s3.type = "currency";
4470
+ else if (a3.error) s3.type = "error", s3.maxDecimals = 0;
4471
+ else if (s3.isDate) {
4472
+ let e4 = 0, t4 = 0, n4 = "";
4473
+ a3.tokens.forEach((a4) => {
4474
+ const r5 = a4.type;
4475
+ /^(b-)?year/.test(r5) ? (n4 += "Y", t4++) : r5.startsWith("month") ? (n4 += "M", t4++) : /^(week)?day/.test(r5) ? (n4 += "D", t4++) : r5 !== "hour" && r5 !== "min" && r5 !== "sec" && r5 !== "am" || (n4 += r5[0], e4++);
4476
+ }), s3.type = "date", t4 && e4 ? s3.type = "datetime" : !t4 && e4 && (s3.type = "time");
4477
+ const r4 = R.find((e5) => n4.startsWith(e5[0]));
4478
+ l3 = r4 ? "D" : "G", d2 = r4 ? r4[1] : "";
4479
+ } else s3.isText ? (l3 = "G", s3.type = "text", d2 = "", s3.maxDecimals = 0) : a3.general ? (l3 = "G", s3.type = "general", d2 = "") : a3.fractions ? (l3 = "G", s3.type = "fraction", d2 = "") : a3.exponential ? (l3 = "S", s3.type = "scientific") : s3.isPercent ? (l3 = "P", s3.type = "percent") : a3.grouping ? (l3 = ",", s3.type = "grouped") : (a3.int_max || i3) && (l3 = "F", s3.type = "number");
4480
+ return s3.code = l3 + d2 + u2 + m2, s3.level = U[s3.type], Object.freeze(s3);
4481
+ }(a2, (t2 || {}).currency) || new SyntaxError();
4482
+ return s2.info = o2, s2.dateInfo = function(e3) {
4483
+ const [t3] = e3;
4484
+ return { year: !!(2 & t3.date), month: !!(4 & t3.date), day: !!(8 & t3.date), hours: !!(16 & t3.date), minutes: !!(32 & t3.date), seconds: !!(64 & t3.date), clockType: t3.clock === 12 ? 12 : 24 };
4485
+ }(a2), s2.isPercent = () => !!o2.isPercent, s2.isDate = () => !!o2.isDate, s2.isText = () => !!o2.isText, s2.pattern = n2, e2.error && (s2.error = e2.error), s2.options = i2, s2.locale = r2 || t2 && t2.locale || "", Object.freeze(s2);
4486
+ }
4487
+ __name(ue, "ue");
4488
+ function ce(e2, t2) {
4489
+ e2 || (e2 = "General");
4490
+ let n2 = null;
4491
+ return me[e2] ? n2 = me[e2] : (n2 = Object.assign({}, h(), t2).throws ? D(e2) : function(e3) {
4492
+ try {
4493
+ return D(e3);
4494
+ } catch (t3) {
4495
+ const n3 = { tokens: [{ type: "error" }], error: t3.message };
4496
+ return { pattern: e3, partitions: [n3, n3, n3, n3], error: t3.message, locale: null };
4497
+ }
4498
+ }(e2), n2.error || (me[e2] = n2)), ue(n2, t2);
4499
+ }
4500
+ __name(ce, "ce"), ce.isDate = (e2) => ce(e2, { throws: !1 }).isDate(), ce.isPercent = (e2) => ce(e2, { throws: !1 }).isPercent(), ce.isText = (e2) => ce(e2, { throws: !1 }).isText(), ce.getInfo = (e2, t2) => ce(e2, { ...t2, throws: !1 }).info, ce.getDateInfo = (e2, t2) => ce(e2, { ...t2, throws: !1 }).dateInfo, ce.dateToSerial = P, ce.dateFromSerial = I2, ce.options = h, ce.dec2frac = p, ce.round = c, ce.codeToLocale = n, ce.parseLocale = s, ce.getLocale = l2, ce.addLocale = (e2, t2) => {
4501
+ const n2 = s(t2);
4502
+ return delete me[n2.lang], delete me[n2.language], m(e2, n2);
4503
+ }, ce.format = function(e2, t2, n2) {
4504
+ let a2 = arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
4505
+ const r2 = n2 && typeof n2 == "object" ? n2 : { locale: n2, throws: !a2 };
4506
+ return ce(e2, r2)(P(t2, r2), r2);
4507
+ }, ce.is_date = ce.isDate, ce.parseNumber = ie, ce.parseDate = oe, ce.parseTime = le, ce.parseBool = de, ce.parseValue = function(e2, t2) {
4508
+ var n2, a2, r2;
4509
+ return (n2 = (a2 = (r2 = ie(e2)) !== null && r2 !== void 0 ? r2 : oe(e2, t2)) !== null && a2 !== void 0 ? a2 : le(e2)) !== null && n2 !== void 0 ? n2 : de(e2);
4510
+ };
4511
+ var pe = ce;
4512
+ return t = t.default;
4513
+ }();
4514
+ });
4515
+ })(numfmt$1);
4516
+ var numfmtExports = numfmt$1.exports, numfmt = numfmtExports;
4517
+ const index$2 = /* @__PURE__ */ getDefaultExportFromCjs(numfmt), DEFAULT_RANGE_ARRAY = {
3177
4518
  sheetId: "",
3178
4519
  range: {
3179
4520
  startRow: -1,
@@ -3280,7 +4621,8 @@ const DEFAULT_RANGE_ARRAY = {
3280
4621
  r: 0,
3281
4622
  b: 0,
3282
4623
  l: 0
3283
- }
4624
+ },
4625
+ n: null
3284
4626
  }, DEFAULT_SLIDE = {
3285
4627
  id: "default_slide",
3286
4628
  title: "defaultSlide",
@@ -4461,7 +5803,10 @@ var IdleValue = (
4461
5803
  var accessor = {
4462
5804
  get: /* @__PURE__ */ __name(function(id, quantityOrLookup, lookUp) {
4463
5805
  return _this._get(id, quantityOrLookup, lookUp);
4464
- }, "get")
5806
+ }, "get"),
5807
+ has: /* @__PURE__ */ __name(function(id) {
5808
+ return _this.has(id);
5809
+ }, "has")
4465
5810
  };
4466
5811
  return cb.apply(void 0, __spreadArray$1([accessor], args, !1));
4467
5812
  }, Injector2.prototype.has = function(id) {
@@ -4514,7 +5859,7 @@ var IdleValue = (
4514
5859
  return this.resolvedDependencyCollection.add(id, thing), thing;
4515
5860
  }, Injector2.prototype._resolveClass = function(id, item, shouldCache) {
4516
5861
  var _this = this;
4517
- shouldCache === void 0 && (shouldCache = !0), item.useClass;
5862
+ shouldCache === void 0 && (shouldCache = !0);
4518
5863
  var thing;
4519
5864
  if (item.lazy) {
4520
5865
  var idle_1 = new IdleValue(function() {
@@ -4962,6 +6307,13 @@ const ILogService = createIdentifier("univer.log"), _DesktopLogService = class _
4962
6307
  };
4963
6308
  __name(_DesktopLogService, "DesktopLogService");
4964
6309
  let DesktopLogService = _DesktopLogService;
6310
+ const _CustomCommandExecutionError = class _CustomCommandExecutionError extends Error {
6311
+ constructor(message) {
6312
+ super(message), this.name = "CustomCommandExecutionError";
6313
+ }
6314
+ };
6315
+ __name(_CustomCommandExecutionError, "CustomCommandExecutionError");
6316
+ let CustomCommandExecutionError = _CustomCommandExecutionError;
4965
6317
  var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
4966
6318
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
4967
6319
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
@@ -5052,32 +6404,38 @@ let CommandService = (_a2 = class extends Disposable {
5052
6404
  }
5053
6405
  throw new Error(`[CommandService]: command "${id}" is not registered.`);
5054
6406
  } catch (error) {
6407
+ if (error instanceof CustomCommandExecutionError)
6408
+ return !1;
5055
6409
  throw this._logService.error(error), error;
5056
6410
  }
5057
6411
  }
5058
6412
  syncExecuteCommand(id, params, options) {
5059
6413
  var _a13;
5060
- const item = this._commandRegistry.getCommand(id);
5061
- if (item) {
5062
- const [command] = item, commandInfo = {
5063
- id: command.id,
5064
- type: command.type,
5065
- params
5066
- };
5067
- if (command.type === 2) {
5068
- const triggerCommand = findLast(
5069
- this._commandExecutionStack,
5070
- (item2) => item2.type === 0
5071
- /* COMMAND */
5072
- );
5073
- triggerCommand && (commandInfo.params = (_a13 = commandInfo.params) != null ? _a13 : {}, commandInfo.params.trigger = triggerCommand.id);
6414
+ try {
6415
+ const item = this._commandRegistry.getCommand(id);
6416
+ if (item) {
6417
+ const [command] = item, commandInfo = {
6418
+ id: command.id,
6419
+ type: command.type,
6420
+ params
6421
+ };
6422
+ if (command.type === 2) {
6423
+ const triggerCommand = findLast(
6424
+ this._commandExecutionStack,
6425
+ (item2) => item2.type === 0
6426
+ /* COMMAND */
6427
+ );
6428
+ triggerCommand && (commandInfo.params = (_a13 = commandInfo.params) != null ? _a13 : {}, commandInfo.params.trigger = triggerCommand.id);
6429
+ }
6430
+ const stackItemDisposable = this._pushCommandExecutionStack(commandInfo);
6431
+ this._beforeCommandExecutionListeners.forEach((listener) => listener(commandInfo, options));
6432
+ const result = this._syncExecute(command, params, options);
6433
+ return this._commandExecutedListeners.forEach((listener) => listener(commandInfo, options)), stackItemDisposable.dispose(), result;
5074
6434
  }
5075
- const stackItemDisposable = this._pushCommandExecutionStack(commandInfo);
5076
- this._beforeCommandExecutionListeners.forEach((listener) => listener(commandInfo, options));
5077
- const result = this._syncExecute(command, params, options);
5078
- return this._commandExecutedListeners.forEach((listener) => listener(commandInfo, options)), stackItemDisposable.dispose(), result;
6435
+ throw new Error(`[CommandService]: command "${id}" is not registered.`);
6436
+ } catch (error) {
6437
+ throw this._logService.error(error), error;
5079
6438
  }
5080
- throw new Error(`[CommandService]: command "${id}" is not registered.`);
5081
6439
  }
5082
6440
  _pushCommandExecutionStack(stackItem) {
5083
6441
  return this._commandExecutionStack.push(stackItem), toDisposable(() => remove(this._commandExecutionStack, stackItem));
@@ -5210,12 +6568,12 @@ const afterInitApply = /* @__PURE__ */ __name((commandService) => new Promise((r
5210
6568
  res();
5211
6569
  });
5212
6570
  }), "afterInitApply");
5213
- var N = /* @__PURE__ */ ((E) => (E[E.UNDEFINED = 0] = "UNDEFINED", E[E.OK = 1] = "OK", E[E.INTERNAL_ERROR = 2] = "INTERNAL_ERROR", E[E.PERMISSION_DENIED = 3] = "PERMISSION_DENIED", E[E.NOT_FOUND = 4] = "NOT_FOUND", E[E.UNAUTHENTICATED = 5] = "UNAUTHENTICATED", E[E.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", E[E.INVALID_ARGUMENT = 7] = "INVALID_ARGUMENT", E[E.TOO_MANY_REQUESTS = 8] = "TOO_MANY_REQUESTS", E[E.COMPLETION_FINISHED = 9] = "COMPLETION_FINISHED", E[E.CHANGESET_REVISION_CONFILICT = 5001] = "CHANGESET_REVISION_CONFILICT", E[E.SNAPSHOT_INVALID_SNAPSHOT = 6001] = "SNAPSHOT_INVALID_SNAPSHOT", E[E.SNAPSHOT_HAS_BEEN_REMOVED = 6002] = "SNAPSHOT_HAS_BEEN_REMOVED", E[E.APPLY_REJECT = 7001] = "APPLY_REJECT", E[E.APPLY_NON_SEQUENTIAL_REVISION = 7002] = "APPLY_NON_SEQUENTIAL_REVISION", E[E.APPLY_REVISION_CONFILICT = 7003] = "APPLY_REVISION_CONFILICT", E[E.APPLY_PERMISSION_DENIED = 7004] = "APPLY_PERMISSION_DENIED", E[E.CONNECTOR_DATA_TOO_LARGE = 8001] = "CONNECTOR_DATA_TOO_LARGE", E[E.LICENSE_MAX_UNITS_EXCEEDED = 9001] = "LICENSE_MAX_UNITS_EXCEEDED", E[E.LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED = 9002] = "LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED", E[E.LICENSE_IMPORT_SIZE_EXCEEDED = 9003] = "LICENSE_IMPORT_SIZE_EXCEEDED", E[E.LICENSE_EXPORT_SIZE_EXCEEDED = 9004] = "LICENSE_EXPORT_SIZE_EXCEEDED", E[E.LICENSE_DISTRO_REJECTED = 9005] = "LICENSE_DISTRO_REJECTED", E[E.YUUMI_UNABLE_LOAD_URL = 10001] = "YUUMI_UNABLE_LOAD_URL", E[E.YUUMI_URL_COL_OUT_OF_RANGE = 10002] = "YUUMI_URL_COL_OUT_OF_RANGE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(N || {});
5214
- function T(E) {
6571
+ var N = /* @__PURE__ */ ((E) => (E[E.UNDEFINED = 0] = "UNDEFINED", E[E.OK = 1] = "OK", E[E.INTERNAL_ERROR = 2] = "INTERNAL_ERROR", E[E.PERMISSION_DENIED = 3] = "PERMISSION_DENIED", E[E.NOT_FOUND = 4] = "NOT_FOUND", E[E.UNAUTHENTICATED = 5] = "UNAUTHENTICATED", E[E.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", E[E.INVALID_ARGUMENT = 7] = "INVALID_ARGUMENT", E[E.TOO_MANY_REQUESTS = 8] = "TOO_MANY_REQUESTS", E[E.COMPLETION_FINISHED = 9] = "COMPLETION_FINISHED", E[E.CHANGESET_REVISION_CONFILICT = 5001] = "CHANGESET_REVISION_CONFILICT", E[E.SNAPSHOT_INVALID_SNAPSHOT = 6001] = "SNAPSHOT_INVALID_SNAPSHOT", E[E.SNAPSHOT_HAS_BEEN_REMOVED = 6002] = "SNAPSHOT_HAS_BEEN_REMOVED", E[E.APPLY_REJECT = 7001] = "APPLY_REJECT", E[E.APPLY_NON_SEQUENTIAL_REVISION = 7002] = "APPLY_NON_SEQUENTIAL_REVISION", E[E.APPLY_REVISION_CONFILICT = 7003] = "APPLY_REVISION_CONFILICT", E[E.APPLY_PERMISSION_DENIED = 7004] = "APPLY_PERMISSION_DENIED", E[E.CONNECTOR_DATA_TOO_LARGE = 8001] = "CONNECTOR_DATA_TOO_LARGE", E[E.LICENSE_MAX_UNITS_EXCEEDED = 9001] = "LICENSE_MAX_UNITS_EXCEEDED", E[E.LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED = 9002] = "LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED", E[E.LICENSE_IMPORT_SIZE_EXCEEDED = 9003] = "LICENSE_IMPORT_SIZE_EXCEEDED", E[E.LICENSE_EXPORT_SIZE_EXCEEDED = 9004] = "LICENSE_EXPORT_SIZE_EXCEEDED", E[E.LICENSE_DISTRO_REJECTED = 9005] = "LICENSE_DISTRO_REJECTED", E[E.YUUMI_UNABLE_LOAD_URL = 10001] = "YUUMI_UNABLE_LOAD_URL", E[E.YUUMI_URL_COL_OUT_OF_RANGE = 10002] = "YUUMI_URL_COL_OUT_OF_RANGE", E[E.YUUMI_RATE_OVER_LIMIT = 10003] = "YUUMI_RATE_OVER_LIMIT", E[E.YUUMI_SUBSCRIPTION_NOT_FOUND = 10004] = "YUUMI_SUBSCRIPTION_NOT_FOUND", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(N || {});
6572
+ function H(E) {
5215
6573
  return !!(E && E.code && E.code !== N.OK && E.code !== "OK");
5216
6574
  }
5217
- __name(T, "T");
5218
- var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), L = /* @__PURE__ */ ((E) => (E[E.SomeCollaborator = 0] = "SomeCollaborator", E[E.AllCollaborator = 1] = "AllCollaborator", E[E.OneSelf = 2] = "OneSelf", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {}), l = /* @__PURE__ */ ((E) => (E[E.Reader = 0] = "Reader", E[E.Editor = 1] = "Editor", E[E.Owner = 2] = "Owner", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l || {}), G = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(G || {});
6575
+ __name(H, "H");
6576
+ var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), L = /* @__PURE__ */ ((E) => (E[E.SomeCollaborator = 0] = "SomeCollaborator", E[E.AllCollaborator = 1] = "AllCollaborator", E[E.OneSelf = 2] = "OneSelf", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {}), M = /* @__PURE__ */ ((E) => (E[E.Reader = 0] = "Reader", E[E.Editor = 1] = "Editor", E[E.Owner = 2] = "Owner", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(M || {}), l = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l || {});
5219
6577
  const _UnitModel = class _UnitModel extends Disposable {
5220
6578
  };
5221
6579
  __name(_UnitModel, "UnitModel");
@@ -5259,97 +6617,220 @@ const _RegistryAsMap = class _RegistryAsMap {
5259
6617
  };
5260
6618
  __name(_RegistryAsMap, "RegistryAsMap");
5261
6619
  let RegistryAsMap = _RegistryAsMap;
5262
- var DataStreamTreeNodeType = /* @__PURE__ */ ((DataStreamTreeNodeType2) => (DataStreamTreeNodeType2[DataStreamTreeNodeType2.PARAGRAPH = 0] = "PARAGRAPH", DataStreamTreeNodeType2[DataStreamTreeNodeType2.SECTION_BREAK = 1] = "SECTION_BREAK", DataStreamTreeNodeType2[DataStreamTreeNodeType2.TABLE = 2] = "TABLE", DataStreamTreeNodeType2[DataStreamTreeNodeType2.TABLE_ROW = 3] = "TABLE_ROW", DataStreamTreeNodeType2[DataStreamTreeNodeType2.TABLE_CELL = 4] = "TABLE_CELL", DataStreamTreeNodeType2[DataStreamTreeNodeType2.CUSTOM_BLOCK = 5] = "CUSTOM_BLOCK", DataStreamTreeNodeType2))(DataStreamTreeNodeType || {}), DataStreamTreeTokenType = /* @__PURE__ */ ((DataStreamTreeTokenType2) => (DataStreamTreeTokenType2.PARAGRAPH = "\r", DataStreamTreeTokenType2.SECTION_BREAK = `
5263
- `, DataStreamTreeTokenType2.TABLE_START = "", DataStreamTreeTokenType2.TABLE_ROW_START = "\x1B", DataStreamTreeTokenType2.TABLE_CELL_START = "", DataStreamTreeTokenType2.TABLE_CELL_END = "", DataStreamTreeTokenType2.TABLE_ROW_END = "", DataStreamTreeTokenType2.TABLE_END = "", DataStreamTreeTokenType2.CUSTOM_RANGE_START = "", DataStreamTreeTokenType2.CUSTOM_RANGE_END = "", DataStreamTreeTokenType2.COLUMN_BREAK = "\v", DataStreamTreeTokenType2.PAGE_BREAK = "\f", DataStreamTreeTokenType2.DOCS_END = "\0", DataStreamTreeTokenType2.TAB = " ", DataStreamTreeTokenType2.CUSTOM_BLOCK = "\b", DataStreamTreeTokenType2.LETTER = "", DataStreamTreeTokenType2.SPACE = " ", DataStreamTreeTokenType2))(DataStreamTreeTokenType || {}), PresetListType = /* @__PURE__ */ ((PresetListType2) => (PresetListType2.BULLET_LIST = "BULLET_LIST", PresetListType2.ORDER_LIST = "ORDER_LIST", PresetListType2))(PresetListType || {});
5264
- const PRESET_LIST_TYPE = {
6620
+ var DataStreamTreeNodeType = /* @__PURE__ */ ((DataStreamTreeNodeType2) => (DataStreamTreeNodeType2.PARAGRAPH = "PARAGRAPH", DataStreamTreeNodeType2.SECTION_BREAK = "SECTION_BREAK", DataStreamTreeNodeType2.TABLE = "TABLE", DataStreamTreeNodeType2.TABLE_ROW = "TABLE_ROW", DataStreamTreeNodeType2.TABLE_CELL = "TABLE_CELL", DataStreamTreeNodeType2.CUSTOM_BLOCK = "CUSTOM_BLOCK", DataStreamTreeNodeType2))(DataStreamTreeNodeType || {}), DataStreamTreeTokenType = /* @__PURE__ */ ((DataStreamTreeTokenType2) => (DataStreamTreeTokenType2.PARAGRAPH = "\r", DataStreamTreeTokenType2.SECTION_BREAK = `
6621
+ `, DataStreamTreeTokenType2.TABLE_START = "", DataStreamTreeTokenType2.TABLE_ROW_START = "\x1B", DataStreamTreeTokenType2.TABLE_CELL_START = "", DataStreamTreeTokenType2.TABLE_CELL_END = "", DataStreamTreeTokenType2.TABLE_ROW_END = "", DataStreamTreeTokenType2.TABLE_END = "", DataStreamTreeTokenType2.CUSTOM_RANGE_START = "", DataStreamTreeTokenType2.CUSTOM_RANGE_END = "", DataStreamTreeTokenType2.COLUMN_BREAK = "\v", DataStreamTreeTokenType2.PAGE_BREAK = "\f", DataStreamTreeTokenType2.DOCS_END = "\0", DataStreamTreeTokenType2.TAB = " ", DataStreamTreeTokenType2.CUSTOM_BLOCK = "\b", DataStreamTreeTokenType2.LETTER = "", DataStreamTreeTokenType2.SPACE = " ", DataStreamTreeTokenType2))(DataStreamTreeTokenType || {});
6622
+ function makeCustomRangeStream(stream) {
6623
+ return `${stream}`;
6624
+ }
6625
+ __name(makeCustomRangeStream, "makeCustomRangeStream");
6626
+ var QuickListType = /* @__PURE__ */ ((QuickListType2) => (QuickListType2.ORDER_LIST_QUICK_1 = "1.", QuickListType2.ORDER_LIST_QUICK_2 = "a)", QuickListType2.ORDER_LIST_QUICK_3 = "a.", QuickListType2.ORDER_LIST_QUICK_4 = "i.", QuickListType2.ORDER_LIST_QUICK_5 = "A.", QuickListType2.ORDER_LIST_QUICK_6 = "I.", QuickListType2.ORDER_LIST_QUICK_7 = "01.", QuickListType2))(QuickListType || {}), PresetListType = /* @__PURE__ */ ((PresetListType2) => (PresetListType2.BULLET_LIST = "BULLET_LIST", PresetListType2.BULLET_LIST_1 = "BULLET_LIST_1", PresetListType2.BULLET_LIST_2 = "BULLET_LIST_2", PresetListType2.BULLET_LIST_3 = "BULLET_LIST_3", PresetListType2.BULLET_LIST_4 = "BULLET_LIST_4", PresetListType2.BULLET_LIST_5 = "BULLET_LIST_5", PresetListType2.ORDER_LIST = "ORDER_LIST", PresetListType2.ORDER_LIST_1 = "ORDER_LIST_1", PresetListType2.ORDER_LIST_2 = "ORDER_LIST_2", PresetListType2.ORDER_LIST_3 = "ORDER_LIST_3", PresetListType2.ORDER_LIST_4 = "ORDER_LIST_4", PresetListType2.ORDER_LIST_5 = "ORDER_LIST_5", PresetListType2.ORDER_LIST_QUICK_2 = "ORDER_LIST_QUICK_2", PresetListType2.ORDER_LIST_QUICK_3 = "ORDER_LIST_QUICK_3", PresetListType2.ORDER_LIST_QUICK_4 = "ORDER_LIST_QUICK_4", PresetListType2.ORDER_LIST_QUICK_5 = "ORDER_LIST_QUICK_5", PresetListType2.ORDER_LIST_QUICK_6 = "ORDER_LIST_QUICK_6", PresetListType2.CHECK_LIST = "CHECK_LIST", PresetListType2.CHECK_LIST_CHECKED = "CHECK_LIST_CHECKED", PresetListType2))(PresetListType || {});
6627
+ const orderListSymbolMap = {
6628
+ "a)": { glyphFormat: " %1)", glyphType: GlyphType.DECIMAL },
6629
+ "1.": { glyphFormat: " %1.", glyphType: GlyphType.DECIMAL },
6630
+ "a.": { glyphFormat: " %1.", glyphType: GlyphType.LOWER_LETTER },
6631
+ "A.": { glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER },
6632
+ "i.": { glyphFormat: " %1.", glyphType: GlyphType.LOWER_ROMAN },
6633
+ "I.": { glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER }
6634
+ }, bulletListFactory = /* @__PURE__ */ __name((symbols) => [
6635
+ ...symbols,
6636
+ ...symbols,
6637
+ ...symbols
6638
+ ].map((templateSymbol, i) => ({
6639
+ glyphFormat: ` %${i + 1}`,
6640
+ glyphSymbol: templateSymbol,
6641
+ bulletAlignment: BulletAlignment.START,
6642
+ textStyle: {
6643
+ fs: 12
6644
+ },
6645
+ startNumber: 0,
6646
+ paragraphProperties: {
6647
+ hanging: { v: 21 },
6648
+ indentStart: { v: 21 * (i + 1) }
6649
+ }
6650
+ })), "bulletListFactory"), orderListFactory = /* @__PURE__ */ __name((options) => options.map((format, i) => ({
6651
+ ...format,
6652
+ bulletAlignment: BulletAlignment.START,
6653
+ textStyle: {
6654
+ fs: 12
6655
+ },
6656
+ startNumber: 0,
6657
+ paragraphProperties: {
6658
+ hanging: { v: 21 },
6659
+ indentStart: { v: 21 * (i + 1) }
6660
+ }
6661
+ })), "orderListFactory"), checkListFactory = /* @__PURE__ */ __name((symbol, textStyle) => Array(9).fill(0).map((_, i) => ({
6662
+ glyphFormat: ` %${i + 1}`,
6663
+ glyphSymbol: symbol,
6664
+ bulletAlignment: BulletAlignment.START,
6665
+ textStyle: {
6666
+ fs: 16
6667
+ },
6668
+ startNumber: 0,
6669
+ paragraphProperties: {
6670
+ hanging: { v: 21 },
6671
+ indentStart: { v: 21 * (i + 1) },
6672
+ textStyle
6673
+ }
6674
+ })), "checkListFactory"), PRESET_LIST_TYPE = {
5265
6675
  BULLET_LIST: {
5266
6676
  listType: "BULLET_LIST",
5267
- nestingLevel: [
5268
- {
5269
- bulletAlignment: BulletAlignment.START,
5270
- glyphFormat: " %0",
5271
- textStyle: {
5272
- fs: 12
5273
- },
5274
- startNumber: 0,
5275
- glyphSymbol: "●",
5276
- paragraphProperties: {
5277
- hanging: { v: 21 },
5278
- indentStart: { v: 21 }
5279
- }
5280
- },
5281
- {
5282
- bulletAlignment: BulletAlignment.START,
5283
- glyphFormat: " %1",
5284
- textStyle: {
5285
- fs: 12
5286
- },
5287
- startNumber: 0,
5288
- glyphSymbol: "■",
5289
- paragraphProperties: {
5290
- hanging: { v: 21 },
5291
- indentStart: { v: 42 }
5292
- }
5293
- },
5294
- {
5295
- bulletAlignment: BulletAlignment.START,
5296
- glyphFormat: " %1",
5297
- textStyle: {
5298
- fs: 12
5299
- },
5300
- startNumber: 0,
5301
- glyphSymbol: "◆",
5302
- paragraphProperties: {
5303
- hanging: { v: 21 },
5304
- indentStart: { v: 63 }
5305
- }
5306
- }
5307
- ]
6677
+ nestingLevel: bulletListFactory(["●", "○", "■"])
6678
+ },
6679
+ BULLET_LIST_1: {
6680
+ listType: "BULLET_LIST",
6681
+ nestingLevel: bulletListFactory(["❖", "➢", "■"])
6682
+ },
6683
+ BULLET_LIST_2: {
6684
+ listType: "BULLET_LIST",
6685
+ nestingLevel: bulletListFactory(["✔", "●", "◆"])
6686
+ },
6687
+ BULLET_LIST_3: {
6688
+ listType: "BULLET_LIST",
6689
+ nestingLevel: bulletListFactory(["■", "◆", "○"])
6690
+ },
6691
+ BULLET_LIST_4: {
6692
+ listType: "BULLET_LIST",
6693
+ nestingLevel: bulletListFactory(["✧", "○", "■"])
6694
+ },
6695
+ BULLET_LIST_5: {
6696
+ listType: "BULLET_LIST",
6697
+ nestingLevel: bulletListFactory(["➢", "○", "◆"])
5308
6698
  },
5309
6699
  ORDER_LIST: {
5310
6700
  listType: "ORDER_LIST",
5311
- nestingLevel: [
5312
- {
5313
- bulletAlignment: BulletAlignment.START,
5314
- glyphFormat: " %1.",
5315
- textStyle: {
5316
- fs: 12
5317
- },
5318
- startNumber: 0,
5319
- glyphType: GlyphType.DECIMAL,
5320
- paragraphProperties: {
5321
- hanging: { v: 21 },
5322
- indentStart: { v: 21 }
5323
- }
5324
- },
6701
+ nestingLevel: orderListFactory([
6702
+ { glyphFormat: " %1.", glyphType: GlyphType.DECIMAL },
6703
+ { glyphFormat: " %2.", glyphType: GlyphType.LOWER_LETTER },
6704
+ { glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
6705
+ { glyphFormat: " %4.", glyphType: GlyphType.DECIMAL },
6706
+ { glyphFormat: " %5.", glyphType: GlyphType.LOWER_LETTER },
6707
+ { glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
6708
+ { glyphFormat: " %7.", glyphType: GlyphType.DECIMAL },
6709
+ { glyphFormat: " %8.", glyphType: GlyphType.LOWER_LETTER },
6710
+ { glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
6711
+ ])
6712
+ },
6713
+ ORDER_LIST_1: {
6714
+ listType: "ORDER_LIST",
6715
+ nestingLevel: orderListFactory([
6716
+ { glyphFormat: " %1)", glyphType: GlyphType.DECIMAL },
6717
+ { glyphFormat: " %2)", glyphType: GlyphType.LOWER_LETTER },
6718
+ { glyphFormat: " %3)", glyphType: GlyphType.LOWER_ROMAN },
6719
+ { glyphFormat: " %4)", glyphType: GlyphType.DECIMAL },
6720
+ { glyphFormat: " %5)", glyphType: GlyphType.LOWER_LETTER },
6721
+ { glyphFormat: " %6)", glyphType: GlyphType.LOWER_ROMAN },
6722
+ { glyphFormat: " %7)", glyphType: GlyphType.DECIMAL },
6723
+ { glyphFormat: " %8)", glyphType: GlyphType.LOWER_LETTER },
6724
+ { glyphFormat: " %9)", glyphType: GlyphType.LOWER_ROMAN }
6725
+ ])
6726
+ },
6727
+ ORDER_LIST_2: {
6728
+ listType: "ORDER_LIST",
6729
+ nestingLevel: orderListFactory([
6730
+ " %1.",
6731
+ " %1.%2.",
6732
+ " %1.%2.%3.",
6733
+ " %1.%2.%3.%4.",
6734
+ " %1.%2.%3.%4.%5.",
6735
+ " %1.%2.%3.%4.%5.%6.",
6736
+ " %1.%2.%3.%4.%5.%6.%7."
6737
+ ].map((format) => ({ glyphFormat: format, glyphType: GlyphType.DECIMAL })))
6738
+ },
6739
+ ORDER_LIST_3: {
6740
+ listType: "ORDER_LIST",
6741
+ nestingLevel: orderListFactory([
6742
+ { glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER },
6743
+ { glyphFormat: " %2.", glyphType: GlyphType.LOWER_LETTER },
6744
+ { glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
6745
+ { glyphFormat: " %4.", glyphType: GlyphType.UPPER_LETTER },
6746
+ { glyphFormat: " %5.", glyphType: GlyphType.LOWER_LETTER },
6747
+ { glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
6748
+ { glyphFormat: " %7.", glyphType: GlyphType.UPPER_LETTER },
6749
+ { glyphFormat: " %8.", glyphType: GlyphType.LOWER_LETTER },
6750
+ { glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
6751
+ ])
6752
+ },
6753
+ ORDER_LIST_4: {
6754
+ listType: "ORDER_LIST",
6755
+ nestingLevel: orderListFactory([
6756
+ { glyphFormat: " %1.", glyphType: GlyphType.UPPER_LETTER },
6757
+ { glyphFormat: " %2.", glyphType: GlyphType.DECIMAL },
6758
+ { glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
6759
+ { glyphFormat: " %4.", glyphType: GlyphType.UPPER_LETTER },
6760
+ { glyphFormat: " %5.", glyphType: GlyphType.DECIMAL },
6761
+ { glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
6762
+ { glyphFormat: " %7.", glyphType: GlyphType.UPPER_LETTER },
6763
+ { glyphFormat: " %8.", glyphType: GlyphType.DECIMAL },
6764
+ { glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
6765
+ ])
6766
+ },
6767
+ ORDER_LIST_5: {
6768
+ listType: "ORDER_LIST",
6769
+ nestingLevel: orderListFactory([
6770
+ { glyphFormat: " %1.", glyphType: GlyphType.DECIMAL_ZERO },
6771
+ { glyphFormat: " %2.", glyphType: GlyphType.LOWER_LETTER },
6772
+ { glyphFormat: " %3.", glyphType: GlyphType.LOWER_ROMAN },
6773
+ { glyphFormat: " %4.", glyphType: GlyphType.DECIMAL_ZERO },
6774
+ { glyphFormat: " %5.", glyphType: GlyphType.LOWER_LETTER },
6775
+ { glyphFormat: " %6.", glyphType: GlyphType.LOWER_ROMAN },
6776
+ { glyphFormat: " %7.", glyphType: GlyphType.DECIMAL_ZERO },
6777
+ { glyphFormat: " %8.", glyphType: GlyphType.LOWER_LETTER },
6778
+ { glyphFormat: " %9.", glyphType: GlyphType.LOWER_ROMAN }
6779
+ ])
6780
+ },
6781
+ CHECK_LIST: {
6782
+ listType: "CHECK_LIST",
6783
+ nestingLevel: checkListFactory(
6784
+ "☐",
5325
6785
  {
5326
- bulletAlignment: BulletAlignment.START,
5327
- glyphFormat: " %1.%2)",
5328
- textStyle: {
5329
- fs: 12
5330
- },
5331
- startNumber: 0,
5332
- glyphType: GlyphType.DECIMAL,
5333
- paragraphProperties: {
5334
- hanging: { v: 21 },
5335
- indentStart: { v: 42 }
6786
+ st: {
6787
+ s: BooleanNumber.FALSE
5336
6788
  }
5337
- },
6789
+ }
6790
+ )
6791
+ },
6792
+ CHECK_LIST_CHECKED: {
6793
+ listType: "CHECK_LIST_CHECKED",
6794
+ nestingLevel: checkListFactory(
6795
+ "☑",
5338
6796
  {
5339
- bulletAlignment: BulletAlignment.START,
5340
- glyphFormat: " %1.%2.%3.",
5341
- textStyle: {
5342
- fs: 12
5343
- },
5344
- startNumber: 0,
5345
- glyphType: GlyphType.DECIMAL,
5346
- paragraphProperties: {
5347
- hanging: { v: 21 },
5348
- indentStart: { v: 63 }
6797
+ st: {
6798
+ s: BooleanNumber.TRUE
5349
6799
  }
5350
6800
  }
5351
- ]
5352
- }
6801
+ )
6802
+ }
6803
+ }, generateOrderList = /* @__PURE__ */ __name((opt) => {
6804
+ const { glyphFormat, glyphType } = opt, data = Tools.deepClone(PRESET_LIST_TYPE.ORDER_LIST);
6805
+ return data.nestingLevel[0].glyphFormat = glyphFormat, data.nestingLevel[0].glyphType = glyphType, data;
6806
+ }, "generateOrderList"), QUICK_LIST_TYPE = {
6807
+ ORDER_LIST_QUICK_2: generateOrderList(orderListSymbolMap[
6808
+ "a)"
6809
+ /* ORDER_LIST_QUICK_2 */
6810
+ ]),
6811
+ ORDER_LIST_QUICK_3: generateOrderList(orderListSymbolMap[
6812
+ "a."
6813
+ /* ORDER_LIST_QUICK_3 */
6814
+ ]),
6815
+ ORDER_LIST_QUICK_4: generateOrderList(orderListSymbolMap[
6816
+ "i."
6817
+ /* ORDER_LIST_QUICK_4 */
6818
+ ]),
6819
+ ORDER_LIST_QUICK_6: generateOrderList(orderListSymbolMap[
6820
+ "I."
6821
+ /* ORDER_LIST_QUICK_6 */
6822
+ ])
6823
+ };
6824
+ Object.assign(PRESET_LIST_TYPE, QUICK_LIST_TYPE);
6825
+ const QuickListTypeMap = {
6826
+ "1.": "ORDER_LIST",
6827
+ "a)": "ORDER_LIST_QUICK_2",
6828
+ "a.": "ORDER_LIST_QUICK_3",
6829
+ "i.": "ORDER_LIST_QUICK_4",
6830
+ "A.": "ORDER_LIST_3",
6831
+ "I.": "ORDER_LIST_QUICK_6",
6832
+ "01.": "ORDER_LIST_5"
6833
+ /* ORDER_LIST_5 */
5353
6834
  };
5354
6835
  function normalizeTextRuns(textRuns) {
5355
6836
  const results = [];
@@ -5487,7 +6968,7 @@ function insertTables(body, insertBody, textLength, currentIndex) {
5487
6968
  return;
5488
6969
  for (let i = 0, len = tables.length; i < len; i++) {
5489
6970
  const table = tables[i], { startIndex, endIndex } = table;
5490
- startIndex > currentIndex ? (table.startIndex += textLength, table.endIndex += textLength) : endIndex >= currentIndex - 1 && (table.endIndex += textLength);
6971
+ startIndex > currentIndex ? (table.startIndex += textLength, table.endIndex += textLength) : endIndex > currentIndex && (table.endIndex += textLength);
5491
6972
  }
5492
6973
  const insertTables2 = insertBody.tables;
5493
6974
  if (insertTables2) {
@@ -5515,8 +6996,12 @@ function insertCustomRanges(body, insertBody, textLength, currentIndex) {
5515
6996
  for (let i = 0, len = insertBody.customRanges.length; i < len; i++) {
5516
6997
  const customRange = insertBody.customRanges[i], oldCustomRange = customRangeMap[customRange.rangeId];
5517
6998
  if (customRange.startIndex += currentIndex, customRange.endIndex += currentIndex, oldCustomRange) {
5518
- if (oldCustomRange.startIndex <= customRange.startIndex && oldCustomRange.endIndex >= customRange.endIndex || body.dataStream[oldCustomRange.startIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_START && body.dataStream[oldCustomRange.endIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_END)
6999
+ if (oldCustomRange.startIndex <= customRange.startIndex && oldCustomRange.endIndex >= customRange.endIndex)
7000
+ continue;
7001
+ if (body.dataStream[oldCustomRange.startIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_START && body.dataStream[oldCustomRange.endIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_END) {
7002
+ insertCustomRanges2.push(customRange);
5519
7003
  continue;
7004
+ }
5520
7005
  if (body.dataStream[oldCustomRange.startIndex] === DataStreamTreeTokenType.CUSTOM_RANGE_START) {
5521
7006
  oldCustomRange.endIndex = customRange.endIndex;
5522
7007
  continue;
@@ -5692,7 +7177,8 @@ function deleteTables(body, textLength, currentIndex) {
5692
7177
  continue;
5693
7178
  } else if (st <= startIndex && ed >= endIndex) {
5694
7179
  const segments = horizontalLineSegmentsSubtraction(st, ed, startIndex, endIndex);
5695
- table.startIndex = segments[0], table.endIndex = segments[1];
7180
+ if (table.startIndex = segments[0], table.endIndex = segments[1], table.startIndex === table.endIndex)
7181
+ continue;
5696
7182
  } else endIndex < st && (table.startIndex -= textLength, table.endIndex -= textLength);
5697
7183
  newTables.push(table);
5698
7184
  }
@@ -5811,7 +7297,7 @@ function coverTextRuns(updateDataTextRuns, removeTextRuns, coverType) {
5811
7297
  }
5812
7298
  pushPendingAndReturnStatus();
5813
7299
  const tempTopTextRun = newUpdateTextRuns[newUpdateTextRuns.length - 1], updateLastTextRun = updateDataTextRuns[updateLength - 1], removeLastTextRun = removeTextRuns[removeLength - 1];
5814
- return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns(newUpdateTextRuns);
7300
+ return tempTopTextRun && tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns(newUpdateTextRuns);
5815
7301
  }
5816
7302
  __name(coverTextRuns, "coverTextRuns");
5817
7303
  function updateParagraphs(body, updateBody, textLength, currentIndex, coverType) {
@@ -5972,7 +7458,7 @@ function updateCustomDecorations(body, updateBody, textLength, currentIndex, cov
5972
7458
  __name(updateCustomDecorations, "updateCustomDecorations");
5973
7459
  var SliceBodyType = /* @__PURE__ */ ((SliceBodyType2) => (SliceBodyType2[SliceBodyType2.copy = 0] = "copy", SliceBodyType2[SliceBodyType2.cut = 1] = "cut", SliceBodyType2))(SliceBodyType || {});
5974
7460
  function getBodySlice(body, startOffset, endOffset, returnEmptyTextRun = !1, type2 = 1) {
5975
- const { dataStream, textRuns = [], paragraphs = [], customBlocks = [] } = body, docBody = {
7461
+ const { dataStream, textRuns = [], paragraphs = [], customBlocks = [], tables = [] } = body, docBody = {
5976
7462
  dataStream: dataStream.slice(startOffset, endOffset)
5977
7463
  }, newTextRuns = [];
5978
7464
  for (const textRun of textRuns) {
@@ -5999,6 +7485,16 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyTextRun = !1, typ
5999
7485
  ed: endOffset - startOffset,
6000
7486
  ts: {}
6001
7487
  }]);
7488
+ const newTables = [];
7489
+ for (const table of tables) {
7490
+ const clonedTable = Tools.deepClone(table), { startIndex, endIndex } = clonedTable;
7491
+ startIndex >= startOffset && endIndex <= endOffset && newTables.push({
7492
+ ...clonedTable,
7493
+ startIndex: startIndex - startOffset,
7494
+ endIndex: endIndex - startOffset
7495
+ });
7496
+ }
7497
+ newTables.length && (docBody.tables = newTables);
6002
7498
  const newParagraphs = [];
6003
7499
  for (const paragraph of paragraphs) {
6004
7500
  const { startIndex } = paragraph;
@@ -6022,7 +7518,7 @@ function getBodySlice(body, startOffset, endOffset, returnEmptyTextRun = !1, typ
6022
7518
  }
6023
7519
  __name(getBodySlice, "getBodySlice");
6024
7520
  function normalizeBody(body) {
6025
- const { dataStream, textRuns, paragraphs, customRanges, customDecorations } = body;
7521
+ const { dataStream, textRuns, paragraphs, customRanges, customDecorations, tables } = body;
6026
7522
  let leftOffset = 0, rightOffset = 0;
6027
7523
  customRanges == null || customRanges.forEach((range) => {
6028
7524
  range.startIndex < 0 && (leftOffset = Math.max(leftOffset, -range.startIndex)), range.endIndex > dataStream.length - 1 && (rightOffset = Math.max(rightOffset, range.endIndex - dataStream.length + 1));
@@ -6036,13 +7532,16 @@ function normalizeBody(body) {
6036
7532
  range.startIndex += leftOffset, range.endIndex += leftOffset;
6037
7533
  }), customDecorations == null || customDecorations.forEach((d) => {
6038
7534
  d.startIndex += leftOffset, d.endIndex += rightOffset;
7535
+ }), tables == null || tables.forEach((table) => {
7536
+ table.startIndex += leftOffset, table.endIndex += rightOffset;
6039
7537
  }), {
6040
7538
  ...body,
6041
7539
  dataStream: newData,
6042
7540
  textRuns,
6043
7541
  paragraphs,
6044
7542
  customRanges,
6045
- customDecorations
7543
+ customDecorations,
7544
+ tables
6046
7545
  };
6047
7546
  }
6048
7547
  __name(normalizeBody, "normalizeBody");
@@ -6163,11 +7662,6 @@ function getEmptySnapshot$1(unitID = Tools.generateRandomId(6), locale = LocaleT
6163
7662
  };
6164
7663
  }
6165
7664
  __name(getEmptySnapshot$1, "getEmptySnapshot$1");
6166
- var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
6167
- function getDefaultExportFromCjs(x) {
6168
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
6169
- }
6170
- __name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
6171
7665
  var dist$1 = {}, json1_release = {}, deepEqual$1 = {};
6172
7666
  Object.defineProperty(deepEqual$1, "__esModule", { value: !0 });
6173
7667
  function eqObj(a, b) {
@@ -7769,28 +9263,144 @@ __name(insertApply, "insertApply");
7769
9263
  function textXApply(doc, actions) {
7770
9264
  const memoryCursor = new MemoryCursor();
7771
9265
  return memoryCursor.reset(), actions.forEach((action) => {
7772
- switch (action = Tools.deepClone(action), action.t) {
9266
+ const clonedAction = Tools.deepClone(action);
9267
+ switch (clonedAction.t) {
7773
9268
  case TextXActionType.RETAIN: {
7774
- const { coverType, body, len } = action;
9269
+ const { coverType, body, len } = clonedAction;
7775
9270
  body != null && updateApply(doc, body, len, memoryCursor.cursor, coverType), memoryCursor.moveCursor(len);
7776
9271
  break;
7777
9272
  }
7778
9273
  case TextXActionType.INSERT: {
7779
- const { body, len } = action;
9274
+ const { body, len } = clonedAction;
7780
9275
  insertApply(doc, body, len, memoryCursor.cursor), memoryCursor.moveCursor(len);
7781
9276
  break;
7782
9277
  }
7783
9278
  case TextXActionType.DELETE: {
7784
- const { len } = action;
9279
+ const { len } = clonedAction;
7785
9280
  deleteApply(doc, len, memoryCursor.cursor);
7786
9281
  break;
7787
9282
  }
7788
9283
  default:
7789
- throw new Error(`Unknown action type for action: ${action}.`);
9284
+ throw new Error(`Unknown action type for action: ${clonedAction}.`);
7790
9285
  }
7791
9286
  }), doc;
7792
9287
  }
7793
9288
  __name(textXApply, "textXApply");
9289
+ function transformTextRuns(originTextRuns, targetTextRuns, transformType) {
9290
+ if (originTextRuns.length === 0)
9291
+ return targetTextRuns;
9292
+ targetTextRuns = Tools$1.deepClone(targetTextRuns), originTextRuns = Tools$1.deepClone(originTextRuns);
9293
+ const newUpdateTextRuns = [], updateLength = targetTextRuns.length, removeLength = originTextRuns.length;
9294
+ let updateIndex = 0, removeIndex = 0, pending = null;
9295
+ function pushPendingAndReturnStatus() {
9296
+ return pending ? (newUpdateTextRuns.push(pending), pending = null, !0) : !1;
9297
+ }
9298
+ for (__name(pushPendingAndReturnStatus, "pushPendingAndReturnStatus"); updateIndex < updateLength && removeIndex < removeLength; ) {
9299
+ const { st: updateSt, ed: updateEd, ts: targetStyle } = targetTextRuns[updateIndex], { st: removeSt, ed: removeEd, ts: originStyle, sId } = originTextRuns[removeIndex];
9300
+ let newTs = {};
9301
+ if (transformType === 0)
9302
+ newTs = { ...targetStyle };
9303
+ else if (newTs = { ...targetStyle }, originStyle) {
9304
+ const keys = Object.keys(originStyle);
9305
+ for (const key of keys)
9306
+ newTs[key] && delete newTs[key];
9307
+ }
9308
+ if (updateEd < removeSt)
9309
+ pushPendingAndReturnStatus() || newUpdateTextRuns.push(targetTextRuns[updateIndex]), updateIndex++;
9310
+ else if (removeEd < updateSt)
9311
+ pushPendingAndReturnStatus() || newUpdateTextRuns.push(originTextRuns[removeIndex]), removeIndex++;
9312
+ else {
9313
+ const newTextRun = {
9314
+ st: Math.min(updateSt, removeSt),
9315
+ ed: Math.max(updateSt, removeSt),
9316
+ ts: updateSt < removeSt ? { ...targetStyle } : { ...originStyle },
9317
+ sId: updateSt < removeSt ? void 0 : sId
9318
+ };
9319
+ newTextRun.ed > newTextRun.st && newUpdateTextRuns.push(), newUpdateTextRuns.push({
9320
+ st: Math.max(updateSt, removeSt),
9321
+ ed: Math.min(updateEd, removeEd),
9322
+ ts: newTs,
9323
+ sId
9324
+ }), updateEd < removeEd ? (updateIndex++, originTextRuns[removeIndex].st = updateEd, originTextRuns[removeIndex].st === originTextRuns[removeIndex].ed && removeIndex++) : (removeIndex++, targetTextRuns[updateIndex].st = removeEd, targetTextRuns[updateIndex].st === targetTextRuns[updateIndex].ed && updateIndex++);
9325
+ const pendingTextRun = {
9326
+ st: Math.min(updateEd, removeEd),
9327
+ ed: Math.max(updateEd, removeEd),
9328
+ ts: updateEd < removeEd ? { ...originStyle } : { ...targetStyle },
9329
+ sId: updateEd < removeEd ? sId : void 0
9330
+ };
9331
+ pending = pendingTextRun.ed > pendingTextRun.st ? pendingTextRun : null;
9332
+ }
9333
+ }
9334
+ pushPendingAndReturnStatus();
9335
+ const tempTopTextRun = newUpdateTextRuns[newUpdateTextRuns.length - 1], updateLastTextRun = targetTextRuns[updateLength - 1], removeLastTextRun = originTextRuns[removeLength - 1];
9336
+ return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns$1(newUpdateTextRuns);
9337
+ }
9338
+ __name(transformTextRuns, "transformTextRuns");
9339
+ function transformParagraph(originParagraph, targetParagraph, transformType) {
9340
+ const paragraph = {
9341
+ startIndex: targetParagraph.startIndex
9342
+ };
9343
+ if (targetParagraph.paragraphStyle) {
9344
+ if (originParagraph.paragraphStyle == null)
9345
+ paragraph.paragraphStyle = {
9346
+ ...targetParagraph.paragraphStyle
9347
+ };
9348
+ else if (paragraph.paragraphStyle = {
9349
+ ...targetParagraph.paragraphStyle
9350
+ }, transformType === 1) {
9351
+ const keys = Object.keys(originParagraph.paragraphStyle);
9352
+ for (const key of keys)
9353
+ paragraph.paragraphStyle[key] && delete paragraph.paragraphStyle[key];
9354
+ }
9355
+ }
9356
+ return targetParagraph.bullet && (originParagraph.bullet == null || transformType === 0) && (paragraph.bullet = {
9357
+ ...targetParagraph.bullet
9358
+ }), paragraph;
9359
+ }
9360
+ __name(transformParagraph, "transformParagraph");
9361
+ function transformBody(thisAction, otherAction, priority = !1) {
9362
+ const { body: thisBody } = thisAction, { body: otherBody } = otherAction;
9363
+ if (thisBody == null || thisBody.dataStream !== "" || otherBody == null || otherBody.dataStream !== "")
9364
+ throw new Error("Data stream is not supported in transform.");
9365
+ const retBody = {
9366
+ dataStream: ""
9367
+ }, { textRuns: thisTextRuns = [], paragraphs: thisParagraphs = [] } = thisBody, { textRuns: otherTextRuns = [], paragraphs: otherParagraphs = [] } = otherBody;
9368
+ let textRuns = [];
9369
+ priority ? textRuns = transformTextRuns(
9370
+ thisTextRuns,
9371
+ otherTextRuns,
9372
+ 1
9373
+ /* COVER_ONLY_NOT_EXISTED */
9374
+ ) : textRuns = transformTextRuns(
9375
+ thisTextRuns,
9376
+ otherTextRuns,
9377
+ 0
9378
+ /* COVER */
9379
+ ), textRuns.length && (retBody.textRuns = textRuns);
9380
+ const paragraphs = [];
9381
+ let thisIndex = 0, otherIndex = 0;
9382
+ for (; thisIndex < thisParagraphs.length && otherIndex < otherParagraphs.length; ) {
9383
+ const thisParagraph = thisParagraphs[thisIndex], otherParagraph = otherParagraphs[otherIndex], { startIndex: thisStart } = thisParagraph, { startIndex: otherStart } = otherParagraph;
9384
+ if (thisStart === otherStart) {
9385
+ let paragraph = {
9386
+ startIndex: thisStart
9387
+ };
9388
+ priority ? paragraph = transformParagraph(
9389
+ thisParagraph,
9390
+ otherParagraph,
9391
+ 1
9392
+ /* COVER_ONLY_NOT_EXISTED */
9393
+ ) : paragraph = transformParagraph(
9394
+ thisParagraph,
9395
+ otherParagraph,
9396
+ 0
9397
+ /* COVER */
9398
+ ), paragraphs.push(paragraph), thisIndex++, otherIndex++;
9399
+ } else thisStart < otherStart ? thisIndex++ : (paragraphs.push(Tools$1.deepClone(otherParagraph)), otherIndex++);
9400
+ }
9401
+ return otherIndex < otherParagraphs.length && paragraphs.push(...otherParagraphs.slice(otherIndex)), paragraphs.length && (retBody.paragraphs = paragraphs), retBody;
9402
+ }
9403
+ __name(transformBody, "transformBody");
7794
9404
  function onlyHasDataStream(body) {
7795
9405
  return Object.keys(body).length === 1;
7796
9406
  }
@@ -7821,9 +9431,74 @@ const _TextX = class _TextX {
7821
9431
  }
7822
9432
  return textX.trimEndUselessRetainAction(), textX.serialize();
7823
9433
  }
7824
- // `transform` is implemented in univer-pro in class TextXPro. do not use this method in TextX.
7825
- static transform(_thisActions, _otherActions, _priority) {
7826
- throw new Error("transform is not implemented in TextX");
9434
+ /**
9435
+ * |(this↓ \| other→) | **insert** | **retain** | **delete** |
9436
+ * | ---------------- | ---------- | ---------- | ---------- |
9437
+ * | **insert** | Case 1 | Case 2 | Case 2 |
9438
+ * | **retain** | Case 1 | Case 5 | Case 4 |
9439
+ * | **delete** | Case 1 | Case 3 | Case 3 |
9440
+ *
9441
+ * Case 1: When the other action type is an insert operation,
9442
+ * the insert operation is retained regardless of the type of action this action
9443
+ * Case 2: When this action type is an insert operation and the other action type is a
9444
+ * non-insert operation, you need to retain the length of this action insert
9445
+ * Case 3: When this action is a delete operation, there are two scenarios:
9446
+ * 1) When other is a delete operation, since it is a delete operation, this has
9447
+ * already been deleted, so the target does not need to be in delete, and it can
9448
+ * be continued directly
9449
+ * 2) When other is the retain operation, although this action delete occurs first,
9450
+ * the delete priority is higher, so the delete operation is retained, and the origin
9451
+ * delete has been applied, so it is directly continued
9452
+ * Case 4: other is the delete operation, this is the retain operation, and the target delete operation
9453
+ * is kept
9454
+ * Case 5: When both other and this are retain operations
9455
+ * 1) If the other body attribute does not exist, directly retain length
9456
+ * 2) If the other body property exists, then execute the TransformBody logic to override it
9457
+ */
9458
+ // priority - if true, this actions takes priority over other, that is, this actions are considered to happen "first".
9459
+ static transform(thisActions, otherActions, priority = "right") {
9460
+ return this._transform(otherActions, thisActions, priority === "left" ? "right" : "left");
9461
+ }
9462
+ static _transform(thisActions, otherActions, priority = "right") {
9463
+ var _a13;
9464
+ const thisIter = new ActionIterator(thisActions), otherIter = new ActionIterator(otherActions), textX = new _TextX();
9465
+ for (; thisIter.hasNext() || otherIter.hasNext(); )
9466
+ if (thisIter.peekType() === TextXActionType.INSERT && (priority === "left" || otherIter.peekType() !== TextXActionType.INSERT)) {
9467
+ const thisAction = thisIter.next();
9468
+ textX.retain(thisAction.len, (_a13 = thisAction.segmentId) != null ? _a13 : "");
9469
+ } else if (otherIter.peekType() === TextXActionType.INSERT)
9470
+ textX.push(otherIter.next());
9471
+ else {
9472
+ const length = Math.min(thisIter.peekLength(), otherIter.peekLength()), thisAction = thisIter.next(length), otherAction = otherIter.next(length);
9473
+ if (thisAction.t === TextXActionType.DELETE)
9474
+ continue;
9475
+ if (otherAction.t === TextXActionType.DELETE) {
9476
+ textX.push(otherAction);
9477
+ continue;
9478
+ }
9479
+ thisAction.body == null || otherAction.body == null ? textX.push(otherAction) : textX.push({
9480
+ ...otherAction,
9481
+ body: transformBody(thisAction, otherAction, priority === "left")
9482
+ });
9483
+ }
9484
+ return textX.trimEndUselessRetainAction(), textX.serialize();
9485
+ }
9486
+ /**
9487
+ * Used to transform selection. Why not named transformSelection?
9488
+ * Because Univer Doc supports multiple Selections in one document, user need to encapsulate transformSelections at the application layer.
9489
+ */
9490
+ static transformPosition(thisActions, index2, priority = !1) {
9491
+ const thisIter = new ActionIterator(thisActions);
9492
+ let offset = 0;
9493
+ for (; thisIter.hasNext() && offset <= index2; ) {
9494
+ const length = thisIter.peekLength(), nextType = thisIter.peekType();
9495
+ if (thisIter.next(), nextType === TextXActionType.DELETE) {
9496
+ index2 -= Math.min(length, index2 - offset);
9497
+ continue;
9498
+ } else nextType === TextXActionType.INSERT && (offset < index2 || !priority) && (index2 += length);
9499
+ offset += length;
9500
+ }
9501
+ return index2;
7827
9502
  }
7828
9503
  static isNoop(actions) {
7829
9504
  return actions.length === 0;
@@ -7959,7 +9634,7 @@ Object.defineProperty(TextX, "name", {
7959
9634
  const _JSONX = class _JSONX {
7960
9635
  static registerSubtype(subType) {
7961
9636
  var _a13;
7962
- this._subTypes.has(subType.name) && ((_a13 = this._subTypes.get(subType.name)) == null ? void 0 : _a13.id) !== TextX.id || (this._subTypes.set(subType.name, subType), dist$1.type.registerSubtype(subType));
9637
+ subType == null || this._subTypes.has(subType.name) && ((_a13 = this._subTypes.get(subType.name)) == null ? void 0 : _a13.id) !== TextX.id || (this._subTypes.set(subType.name, subType), dist$1.type.registerSubtype(subType));
7963
9638
  }
7964
9639
  static apply(doc, actions) {
7965
9640
  if (!dist$1.type.isNoop(actions))
@@ -7968,9 +9643,12 @@ const _JSONX = class _JSONX {
7968
9643
  static compose(thisActions, otherActions) {
7969
9644
  return dist$1.type.compose(thisActions, otherActions);
7970
9645
  }
7971
- // Do not use transform in JsonX, pls use transform in JsonXPro.
7972
- static transform(_thisActions, _otherActions, _priority) {
7973
- throw new Error("transform is not implemented in JsonX");
9646
+ static transform(thisActions, otherActions, priority) {
9647
+ return dist$1.type.transform(thisActions, otherActions, priority);
9648
+ }
9649
+ // Use to transform cursor position, just call TextXPro.transformPosition.
9650
+ static transformPosition(thisActions, index2, priority = "right") {
9651
+ return thisActions && thisActions.length === 2 && thisActions[0] === "body" && thisActions[1].et === TextX.name ? TextX.transformPosition(thisActions[1].e, index2, priority === "left") : index2;
7974
9652
  }
7975
9653
  static invertWithDoc(actions, doc) {
7976
9654
  return dist$1.type.invertWithDoc(actions, doc);
@@ -8009,14 +9687,20 @@ const DEFAULT_DOC = {
8009
9687
  documentStyle: {}
8010
9688
  }, _DocumentDataModelSimple = class _DocumentDataModelSimple extends UnitModel {
8011
9689
  constructor(snapshot) {
9690
+ var _a13;
8012
9691
  super();
8013
9692
  __publicField(this, "type", I.UNIVER_DOC);
9693
+ __publicField(this, "_name$", new BehaviorSubject(""));
9694
+ __publicField(this, "name$", this._name$.asObservable());
8014
9695
  __publicField(this, "snapshot");
8015
- this.snapshot = { ...DEFAULT_DOC, ...snapshot };
9696
+ this.snapshot = { ...DEFAULT_DOC, ...snapshot }, this._name$.next((_a13 = this.snapshot.title) != null ? _a13 : "No Title");
8016
9697
  }
8017
9698
  getUnitId() {
8018
9699
  throw new Error("Method not implemented.");
8019
9700
  }
9701
+ setName(name) {
9702
+ this.snapshot.title = name, this._name$.next(name);
9703
+ }
8020
9704
  get drawings() {
8021
9705
  return this.snapshot.drawings;
8022
9706
  }
@@ -8098,14 +9782,9 @@ const _DocumentDataModel = class _DocumentDataModel extends DocumentDataModelSim
8098
9782
  __publicField(this, "_unitId");
8099
9783
  __publicField(this, "headerModelMap", /* @__PURE__ */ new Map());
8100
9784
  __publicField(this, "footerModelMap", /* @__PURE__ */ new Map());
8101
- __publicField(this, "_name$", new BehaviorSubject(""));
8102
- __publicField(this, "name$", this._name$.asObservable());
8103
9785
  const UNIT_ID_LENGTH = 6;
8104
9786
  this._unitId = (_a13 = this.snapshot.id) != null ? _a13 : Tools.generateRandomId(UNIT_ID_LENGTH), this._initializeHeaderFooterModel(), this._name$.next((_b2 = this.snapshot.title) != null ? _b2 : "");
8105
9787
  }
8106
- setName(name) {
8107
- this.snapshot.title = name, this._name$.next(name);
8108
- }
8109
9788
  dispose() {
8110
9789
  super.dispose(), this.headerModelMap.forEach((header) => {
8111
9790
  header.dispose();
@@ -9011,7 +10690,7 @@ function extractPureTextFromCell(cell) {
9011
10690
  return typeof rawValue == "string" ? cell.t === CellValueType.BOOLEAN ? rawValue.toUpperCase() : rawValue.replace(/[\r\n]/g, "") : typeof rawValue == "number" ? cell.t === CellValueType.BOOLEAN ? rawValue ? "TRUE" : "FALSE" : rawValue.toString() : typeof rawValue == "boolean" ? rawValue ? "TRUE" : "FALSE" : "";
9012
10691
  }
9013
10692
  __name(extractPureTextFromCell, "extractPureTextFromCell");
9014
- const version = "0.2.6";
10693
+ const version = "0.2.8";
9015
10694
  function getEmptySnapshot(unitID = "", locale = LocaleType.ZH_CN, name = "") {
9016
10695
  return {
9017
10696
  id: unitID,
@@ -9089,6 +10768,7 @@ let Workbook = (_a3 = class extends UnitModel {
9089
10768
  getSnapshot() {
9090
10769
  return this._snapshot;
9091
10770
  }
10771
+ /** @deprecated use use name property instead */
9092
10772
  getName() {
9093
10773
  return this._snapshot.name;
9094
10774
  }
@@ -9277,9 +10957,11 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
9277
10957
  __publicField(this, "type", I.UNIVER_SLIDE);
9278
10958
  __publicField(this, "_activePage$", new BehaviorSubject(null));
9279
10959
  __publicField(this, "activePage$", this._activePage$.asObservable());
10960
+ __publicField(this, "_name$");
10961
+ __publicField(this, "name$");
9280
10962
  __publicField(this, "_snapshot");
9281
10963
  __publicField(this, "_unitId");
9282
- this._snapshot = { ...DEFAULT_SLIDE, ...snapshot }, this._unitId = (_a13 = this._snapshot.id) != null ? _a13 : Tools.generateRandomId(6);
10964
+ this._snapshot = { ...DEFAULT_SLIDE, ...snapshot }, this._unitId = (_a13 = this._snapshot.id) != null ? _a13 : Tools.generateRandomId(6), this._name$ = new BehaviorSubject(this._snapshot.title), this.name$ = this._name$.asObservable();
9283
10965
  }
9284
10966
  get _activePage() {
9285
10967
  var _a13, _b2;
@@ -9290,6 +10972,10 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
9290
10972
  }
9291
10973
  return activePage;
9292
10974
  }
10975
+ setName(name) {
10976
+ var _a13;
10977
+ this._snapshot.title = name, this._name$.next(name), this._unitId = (_a13 = this._snapshot.id) != null ? _a13 : generateRandomId(6);
10978
+ }
9293
10979
  getContainer() {
9294
10980
  return this._snapshot.container;
9295
10981
  }
@@ -9322,13 +11008,14 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
9322
11008
  getPageSize() {
9323
11009
  return this._snapshot.pageSize;
9324
11010
  }
9325
- addPage() {
11011
+ getBlankPage() {
11012
+ const id = generateRandomId(6);
9326
11013
  return {
9327
- id: "cover_1",
11014
+ id,
9328
11015
  pageType: PageType.SLIDE,
9329
11016
  zIndex: 10,
9330
- title: "cover",
9331
- description: "this is first page, cover",
11017
+ title: id,
11018
+ description: "",
9332
11019
  pageBackgroundFill: {
9333
11020
  rgb: "rgb(255,255,255)"
9334
11021
  },
@@ -9344,10 +11031,17 @@ const _SlideDataModel = class _SlideDataModel extends UnitModel {
9344
11031
  updatePage(pageId, page) {
9345
11032
  this._snapshot.body && (this._snapshot.body.pages[pageId] = page);
9346
11033
  }
11034
+ appendPage(page) {
11035
+ var _a13;
11036
+ if (!this._snapshot.body) return;
11037
+ this._snapshot.body.pages[page.id] = page;
11038
+ const activePage = this._activePage, index2 = this._snapshot.body.pageOrder.indexOf((_a13 = activePage == null ? void 0 : activePage.id) != null ? _a13 : "");
11039
+ this._snapshot.body.pageOrder.splice(index2 + 1, 0, page.id);
11040
+ }
9347
11041
  };
9348
11042
  __name(_SlideDataModel, "SlideDataModel");
9349
11043
  let SlideDataModel = _SlideDataModel;
9350
- const FOCUSING_SHEET = "FOCUSING_SHEET", FOCUSING_DOC = "FOCUSING_DOC", FOCUSING_SLIDE = "FOCUSING_SLIDE", FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN", EDITOR_ACTIVATED = "EDITOR_ACTIVATED", FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA", FOCUSING_FORMULA_EDITOR = "FOCUSING_FORMULA_EDITOR", FOCUSING_UNIVER_EDITOR = "FOCUSING_UNIVER_EDITOR", FOCUSING_EDITOR_STANDALONE = "FOCUSING_EDITOR_INPUT_FORMULA", FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE = "FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE", FOCUSING_COMMON_DRAWINGS = "FOCUSING_COMMON_DRAWINGS";
11044
+ const FOCUSING_UNIT = "FOCUSING_UNIT", FOCUSING_SHEET = "FOCUSING_SHEET", FOCUSING_DOC = "FOCUSING_DOC", FOCUSING_SLIDE = "FOCUSING_SLIDE", FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN", EDITOR_ACTIVATED = "EDITOR_ACTIVATED", FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA", FOCUSING_FX_BAR_EDITOR = "FOCUSING_FX_BAR_EDITOR", FOCUSING_UNIVER_EDITOR = "FOCUSING_UNIVER_EDITOR", FOCUSING_EDITOR_STANDALONE = "FOCUSING_EDITOR_INPUT_FORMULA", FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE = "FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE", FOCUSING_COMMON_DRAWINGS = "FOCUSING_COMMON_DRAWINGS", FORMULA_EDITOR_ACTIVATED = "FORMULA_EDITOR_ACTIVATED";
9351
11045
  var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
9352
11046
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
9353
11047
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
@@ -9378,8 +11072,8 @@ let UniverInstanceService = (_a4 = class extends Disposable {
9378
11072
  __setCreateHandler(handler) {
9379
11073
  this._createHandler = handler;
9380
11074
  }
9381
- createUnit(type2, data) {
9382
- return this._createHandler(type2, data, this._ctorByType.get(type2));
11075
+ createUnit(type2, data, options) {
11076
+ return this._createHandler(type2, data, this._ctorByType.get(type2), options);
9383
11077
  }
9384
11078
  registerCtorForType(type2, ctor) {
9385
11079
  return this._ctorByType.set(type2, ctor), {
@@ -9402,9 +11096,6 @@ let UniverInstanceService = (_a4 = class extends Disposable {
9402
11096
  if (!result) throw new Error(`[UniverInstanceService]: no document with unitId ${unitId}!`);
9403
11097
  this._currentUnits.set(result[1], result[0]), this._currentUnits$.next(this._currentUnits);
9404
11098
  }
9405
- _removeCurrentUnitForType(type2) {
9406
- this._currentUnits.set(type2, null), this._currentUnits$.next(this._currentUnits);
9407
- }
9408
11099
  getTypeOfUnitAdded$(type2) {
9409
11100
  return this._unitAdded$.pipe(filter((unit) => unit.type === type2));
9410
11101
  }
@@ -9415,9 +11106,14 @@ let UniverInstanceService = (_a4 = class extends Disposable {
9415
11106
  *
9416
11107
  * @param unit The unit to be added.
9417
11108
  */
9418
- __addUnit(unit) {
11109
+ __addUnit(unit, options) {
11110
+ var _a13;
9419
11111
  const type2 = unit.type;
9420
- this._unitsByType.has(type2) || this._unitsByType.set(type2, []), this._unitsByType.get(type2).push(unit), this._unitAdded$.next(unit), this.setCurrentUnitForType(unit.getUnitId());
11112
+ this._unitsByType.has(type2) || this._unitsByType.set(type2, []);
11113
+ const units = this._unitsByType.get(type2), newUnitId = unit.getUnitId();
11114
+ if (units.findIndex((u) => u.getUnitId() === newUnitId) !== -1)
11115
+ throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${newUnitId}.`);
11116
+ units.push(unit), this._unitAdded$.next(unit), ((_a13 = options == null ? void 0 : options.makeCurrent) == null || _a13) && this.setCurrentUnitForType(unit.getUnitId());
9421
11117
  }
9422
11118
  getTypeOfUnitDisposed$(type2) {
9423
11119
  return this.unitDisposed$.pipe(filter((unit) => unit.type === type2));
@@ -9454,21 +11150,28 @@ let UniverInstanceService = (_a4 = class extends Disposable {
9454
11150
  return id ? (_a13 = this._getUnitById(id)) == null ? void 0 : _a13[0] : null;
9455
11151
  }
9456
11152
  focusUnit(id) {
9457
- this._focused$.next(id), this.focused instanceof Workbook ? (this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !0), this._contextService.setContextValue(FOCUSING_SLIDE, !1)) : this.focused instanceof DocumentDataModel ? (this._contextService.setContextValue(FOCUSING_DOC, !0), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !1)) : this.focused instanceof SlideDataModel && (this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !0));
11153
+ this._focused$.next(id), this.focused instanceof Workbook ? (this._contextService.setContextValue(FOCUSING_UNIT, !0), this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !0), this._contextService.setContextValue(FOCUSING_SLIDE, !1), this.setCurrentUnitForType(id)) : this.focused instanceof DocumentDataModel ? (this._contextService.setContextValue(FOCUSING_UNIT, !0), this._contextService.setContextValue(FOCUSING_DOC, !0), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !1), this.setCurrentUnitForType(id)) : this.focused instanceof SlideDataModel ? (this._contextService.setContextValue(FOCUSING_UNIT, !0), this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !0), this.setCurrentUnitForType(id)) : (this._contextService.setContextValue(FOCUSING_UNIT, !1), this._contextService.setContextValue(FOCUSING_DOC, !1), this._contextService.setContextValue(FOCUSING_SHEET, !1), this._contextService.setContextValue(FOCUSING_SLIDE, !1));
9458
11154
  }
9459
11155
  getFocusedUnit() {
9460
11156
  return this.focused;
9461
11157
  }
9462
11158
  getUnitType(unitId) {
9463
11159
  const result = this._getUnitById(unitId);
9464
- if (!result) throw new Error(`[UniverInstanceService]: No document with unitId ${unitId}`);
9465
- return result[1];
11160
+ return result ? result[1] : I.UNRECOGNIZED;
9466
11161
  }
9467
11162
  disposeUnit(unitId) {
9468
11163
  const result = this._getUnitById(unitId);
9469
11164
  if (!result) return !1;
9470
11165
  const [unit, type2] = result, units = this._unitsByType.get(type2), index2 = units.indexOf(unit);
9471
- return units.splice(index2, 1), this._removeCurrentUnitForType(type2), this._focused$.next(null), this._unitDisposed$.next(unit), !0;
11166
+ return units.splice(index2, 1), this._tryRemoveCurrentUnitForType(unitId, type2), this._tryBlurUnitOnRemoval(unitId), this._unitDisposed$.next(unit), !0;
11167
+ }
11168
+ _tryRemoveCurrentUnitForType(unitId, type2) {
11169
+ const current = this.getCurrentUnitForType(type2);
11170
+ (current == null ? void 0 : current.getUnitId()) === unitId && (this._currentUnits.set(type2, null), this._currentUnits$.next(this._currentUnits));
11171
+ }
11172
+ _tryBlurUnitOnRemoval(unitId) {
11173
+ var _a13;
11174
+ ((_a13 = this.focused) == null ? void 0 : _a13.getUnitId()) === unitId && this._focused$.next(null);
9472
11175
  }
9473
11176
  _getUnitById(unitId) {
9474
11177
  for (const [type2, units] of this._unitsByType) {
@@ -9682,7 +11385,7 @@ const _PermissionService = class _PermissionService extends Disposable {
9682
11385
  if (!permissionPoint)
9683
11386
  return;
9684
11387
  const subject = permissionPoint.getValue();
9685
- subject.value = value, subject.status = PermissionStatus.DONE, permissionPoint.next({ ...subject }), this._permissionPointUpdate$.next(subject);
11388
+ subject.value = value, subject.status = PermissionStatus.DONE, permissionPoint.next(subject), this._permissionPointUpdate$.next(subject);
9686
11389
  }
9687
11390
  clearPermissionMap() {
9688
11391
  this._permissionPointMap.clear();
@@ -9738,8 +11441,8 @@ const _ResourceManagerService = class _ResourceManagerService extends Disposable
9738
11441
  getAllResourceHooks() {
9739
11442
  return [...this._resourceMap.values()];
9740
11443
  }
9741
- getResources(unitId) {
9742
- return this.getAllResourceHooks().map((resourceHook) => {
11444
+ getResources(unitId, type2) {
11445
+ return type2 ? this.getResourcesByType(unitId, type2) : this.getAllResourceHooks().map((resourceHook) => {
9743
11446
  const data = resourceHook.toJson(unitId);
9744
11447
  return {
9745
11448
  name: resourceHook.pluginName,
@@ -9789,7 +11492,16 @@ const _ResourceManagerService = class _ResourceManagerService extends Disposable
9789
11492
  };
9790
11493
  __name(_ResourceManagerService, "ResourceManagerService");
9791
11494
  let ResourceManagerService = _ResourceManagerService;
9792
- const IResourceManagerService = createIdentifier("resource-manager-service");
11495
+ const IResourceManagerService = createIdentifier("core.resource-manager.service"), PREFIX = "__INTERNAL_EDITOR__", DOCS_NORMAL_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_NORMAL`, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_FORMULA_BAR`, DOCS_ZEN_EDITOR_UNIT_ID_KEY = `${PREFIX}ZEN_EDITOR`, DEFAULT_EMPTY_DOCUMENT_VALUE = `\r
11496
+ `;
11497
+ function createInternalEditorID(id) {
11498
+ return `${PREFIX}${id}`;
11499
+ }
11500
+ __name(createInternalEditorID, "createInternalEditorID");
11501
+ function isInternalEditorID(id) {
11502
+ return id.startsWith(PREFIX);
11503
+ }
11504
+ __name(isInternalEditorID, "isInternalEditorID");
9793
11505
  var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
9794
11506
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
9795
11507
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
@@ -9799,7 +11511,7 @@ let ResourceLoaderService = (_a7 = class extends Disposable {
9799
11511
  constructor(_resourceManagerService, _univerInstanceService) {
9800
11512
  super();
9801
11513
  __publicField(this, "saveWorkbook", /* @__PURE__ */ __name((workbook) => {
9802
- const unitId = workbook.getUnitId(), resources = this._resourceManagerService.getResources(unitId) || [], snapshot = workbook.getSnapshot();
11514
+ const unitId = workbook.getUnitId(), resources = this._resourceManagerService.getResources(unitId, I.UNIVER_SHEET), snapshot = workbook.getSnapshot();
9803
11515
  return snapshot.resources = resources, snapshot;
9804
11516
  }, "saveWorkbook"));
9805
11517
  this._resourceManagerService = _resourceManagerService, this._univerInstanceService = _univerInstanceService, this._init();
@@ -9838,26 +11550,27 @@ let ResourceLoaderService = (_a7 = class extends Disposable {
9838
11550
  }
9839
11551
  });
9840
11552
  }, "handleHookAdd");
9841
- this._resourceManagerService.getAllResourceHooks().forEach((hook) => {
9842
- handleHookAdd(hook);
9843
- }), this.disposeWithMe(this._resourceManagerService.register$.subscribe((hook) => {
9844
- handleHookAdd(hook);
9845
- })), this.disposeWithMe(
9846
- toDisposable(
9847
- this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_SHEET).subscribe((workbook) => {
9848
- this._resourceManagerService.loadResources(workbook.getUnitId(), workbook.getSnapshot().resources);
9849
- })
9850
- )
11553
+ this._resourceManagerService.getAllResourceHooks().forEach((hook) => handleHookAdd(hook)), this.disposeWithMe(this._resourceManagerService.register$.subscribe((hook) => handleHookAdd(hook))), this.disposeWithMe(
11554
+ this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_SHEET).subscribe((workbook) => {
11555
+ this._resourceManagerService.loadResources(workbook.getUnitId(), workbook.getSnapshot().resources);
11556
+ })
9851
11557
  ), this.disposeWithMe(
9852
- toDisposable(
9853
- this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_SHEET).subscribe((workbook) => {
9854
- this._resourceManagerService.unloadResources(workbook.getUnitId());
9855
- })
9856
- )
11558
+ this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_DOC).subscribe((doc) => {
11559
+ const unitId = doc.getUnitId();
11560
+ isInternalEditorID(unitId) || this._resourceManagerService.loadResources(doc.getUnitId(), doc.getSnapshot().resources);
11561
+ })
11562
+ ), this.disposeWithMe(
11563
+ this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_SHEET).subscribe((workbook) => {
11564
+ this._resourceManagerService.unloadResources(workbook.getUnitId());
11565
+ })
11566
+ ), this.disposeWithMe(
11567
+ this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_DOC).subscribe((doc) => {
11568
+ this._resourceManagerService.unloadResources(doc.getUnitId());
11569
+ })
9857
11570
  );
9858
11571
  }
9859
11572
  saveDoc(doc) {
9860
- const unitId = doc.getUnitId(), resources = this._resourceManagerService.getResourcesByType(unitId, I.UNIVER_DOC) || [], snapshot = doc.getSnapshot();
11573
+ const unitId = doc.getUnitId(), resources = this._resourceManagerService.getResources(unitId, I.UNIVER_DOC), snapshot = doc.getSnapshot();
9861
11574
  return snapshot.resources = resources, snapshot;
9862
11575
  }
9863
11576
  }, __name(_a7, "ResourceLoaderService"), _a7);
@@ -9886,16 +11599,6 @@ const _ThemeService = class _ThemeService extends Disposable {
9886
11599
  };
9887
11600
  __name(_ThemeService, "ThemeService");
9888
11601
  let ThemeService = _ThemeService;
9889
- const PREFIX = "__INTERNAL_EDITOR__", DOCS_NORMAL_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_NORMAL`, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = `${PREFIX}DOCS_FORMULA_BAR`, DOCS_ZEN_EDITOR_UNIT_ID_KEY = "__defaultDocumentZenEditorSpecialUnitId_20231218__", DEFAULT_EMPTY_DOCUMENT_VALUE = `\r
9890
- `;
9891
- function createInternalEditorID(id) {
9892
- return `${PREFIX}${id}`;
9893
- }
9894
- __name(createInternalEditorID, "createInternalEditorID");
9895
- function isInternalEditorID(id) {
9896
- return id.startsWith(PREFIX);
9897
- }
9898
- __name(isInternalEditorID, "isInternalEditorID");
9899
11602
  var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
9900
11603
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
9901
11604
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
@@ -10038,7 +11741,7 @@ let LocalUndoRedoService = (_a8 = class extends Disposable {
10038
11741
  _getFocusedUnitId() {
10039
11742
  var _a13, _b2, _c, _d;
10040
11743
  let unitID = "";
10041
- const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET), isFocusFormulaEditor = this._contextService.getContextValue(FOCUSING_FORMULA_EDITOR), isFocusEditor = this._contextService.getContextValue(EDITOR_ACTIVATED);
11744
+ const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET), isFocusFormulaEditor = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR), isFocusEditor = this._contextService.getContextValue(EDITOR_ACTIVATED);
10042
11745
  return isFocusSheet ? isFocusFormulaEditor ? unitID = DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : isFocusEditor ? unitID = DOCS_NORMAL_EDITOR_UNIT_ID_KEY : unitID = (_b2 = (_a13 = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : _a13.getUnitId()) != null ? _b2 : "" : unitID = (_d = (_c = this._univerInstanceService.getFocusedUnit()) == null ? void 0 : _c.getUnitId()) != null ? _d : "", unitID;
10043
11746
  }
10044
11747
  }, __name(_a8, "LocalUndoRedoService"), _a8);
@@ -10289,10 +11992,10 @@ function mergeOverrideWithDependencies(dependencies, override) {
10289
11992
  }
10290
11993
  __name(mergeOverrideWithDependencies, "mergeOverrideWithDependencies");
10291
11994
  const nameMap = {
10292
- [l.Editor]: "Editor",
10293
- [l.Owner]: "Owner",
10294
- [l.Reader]: "Reader",
10295
- [l.UNRECOGNIZED]: "UNRECOGNIZED"
11995
+ [M.Editor]: "Editor",
11996
+ [M.Owner]: "Owner",
11997
+ [M.Reader]: "Reader",
11998
+ [M.UNRECOGNIZED]: "UNRECOGNIZED"
10296
11999
  }, createDefaultUser = /* @__PURE__ */ __name((type2) => type2 ? {
10297
12000
  userID: `${nameMap[type2]}_${Tools.generateRandomId(8)}`,
10298
12001
  name: nameMap[type2],
@@ -10363,7 +12066,7 @@ let AuthzIoLocalService = (_a12 = class {
10363
12066
  }
10364
12067
  _initDefaultUser() {
10365
12068
  const currentUser = this._userManagerService.getCurrentUser();
10366
- currentUser && currentUser.userID || this._userManagerService.setCurrentUser(createDefaultUser(l.Owner));
12069
+ currentUser && currentUser.userID || this._userManagerService.setCurrentUser(createDefaultUser(M.Owner));
10367
12070
  }
10368
12071
  _getRole(type2) {
10369
12072
  const user = this._userManagerService.getCurrentUser();
@@ -10393,51 +12096,25 @@ let AuthzIoLocalService = (_a12 = class {
10393
12096
  async create(config) {
10394
12097
  const id = Tools.generateRandomId(8);
10395
12098
  switch (config.objectType) {
10396
- case G.SelectRange: {
12099
+ case l.SelectRange: {
10397
12100
  const params = config.selectRangeObject;
10398
12101
  this._permissionMap.set(id, { ...params, objectType: config.objectType });
10399
12102
  break;
10400
12103
  }
10401
- case G.Worksheet: {
12104
+ case l.Worksheet: {
10402
12105
  const params = config.worksheetObject;
10403
12106
  this._permissionMap.set(id, { ...params, objectType: config.objectType, readScope: L.SomeCollaborator });
10404
12107
  }
10405
12108
  }
10406
12109
  return id;
10407
12110
  }
10408
- async allowed(config) {
10409
- var _a13;
10410
- if (this._permissionMap.has(config.objectID)) {
10411
- const rule = this._permissionMap.get(config.objectID);
10412
- if (rule && rule.objectType === G.Worksheet)
10413
- return (_a13 = rule == null ? void 0 : rule.strategies) == null ? void 0 : _a13.map((s) => ({
10414
- action: s.action,
10415
- allowed: s.role === l.Editor
10416
- }));
10417
- }
10418
- return config.actions.map((a) => ({
10419
- action: a,
10420
- allowed: this._getRole(l.Owner) || this._getRole(l.Editor)
10421
- }));
12111
+ async allowed(_config) {
12112
+ return Promise.resolve([]);
10422
12113
  }
10423
- async batchAllowed(config) {
10424
- const user = this._userManagerService.getCurrentUser(), defaultValue = config.map((item) => ({
10425
- unitID: item.unitID,
10426
- objectID: item.objectID,
10427
- actions: item.actions.map((action) => ({
10428
- action,
10429
- allowed: !1
10430
- }))
10431
- }));
10432
- return user && (isDevRole(user.userID, l.Owner) || isDevRole(user.userID, l.Editor)) ? config.map((item) => ({
10433
- unitID: item.unitID,
10434
- objectID: item.objectID,
10435
- actions: item.actions.map((action) => ({
10436
- action,
10437
- allowed: !0
10438
- }))
10439
- })) : defaultValue;
12114
+ async batchAllowed(_config) {
12115
+ return Promise.resolve([]);
10440
12116
  }
12117
+ // eslint-disable-next-line max-lines-per-function
10441
12118
  async list(config) {
10442
12119
  const result = [];
10443
12120
  return config.objectIDs.forEach((objectID) => {
@@ -10449,12 +12126,69 @@ let AuthzIoLocalService = (_a12 = class {
10449
12126
  objectType: rule.objectType,
10450
12127
  name: rule.name,
10451
12128
  shareOn: !1,
10452
- shareRole: l.Owner,
10453
- // TODO: @gggpound
12129
+ shareRole: M.Owner,
10454
12130
  shareScope: -1,
10455
- creator: createDefaultUser(l.Owner),
10456
- strategies: [],
10457
- actions: config.actions.map((a) => ({ action: a, allowed: this._getRole(l.Owner) || this._getRole(l.Editor) }))
12131
+ creator: createDefaultUser(M.Owner),
12132
+ // mock data
12133
+ strategies: [
12134
+ {
12135
+ action: 6,
12136
+ role: 1
12137
+ },
12138
+ {
12139
+ action: 16,
12140
+ role: 1
12141
+ },
12142
+ {
12143
+ action: 17,
12144
+ role: 1
12145
+ },
12146
+ {
12147
+ action: 18,
12148
+ role: 1
12149
+ },
12150
+ {
12151
+ action: 19,
12152
+ role: 1
12153
+ },
12154
+ {
12155
+ action: 33,
12156
+ role: 1
12157
+ },
12158
+ {
12159
+ action: 34,
12160
+ role: 1
12161
+ },
12162
+ {
12163
+ action: 35,
12164
+ role: 1
12165
+ },
12166
+ {
12167
+ action: 36,
12168
+ role: 1
12169
+ },
12170
+ {
12171
+ action: 37,
12172
+ role: 1
12173
+ },
12174
+ {
12175
+ action: 38,
12176
+ role: 1
12177
+ },
12178
+ {
12179
+ action: 39,
12180
+ role: 1
12181
+ },
12182
+ {
12183
+ action: 40,
12184
+ role: 1
12185
+ },
12186
+ {
12187
+ action: 41,
12188
+ role: 1
12189
+ }
12190
+ ],
12191
+ actions: config.actions.map((a) => ({ action: a, allowed: this._getRole(M.Owner) || this._getRole(M.Editor) }))
10458
12192
  };
10459
12193
  result.push(item);
10460
12194
  }
@@ -10538,14 +12272,14 @@ const IAuthzIoService = createIdentifier("IAuthzIoIoService"), _Univer = class _
10538
12272
  this._univerInstanceService.registerCtorForType(I.UNIVER_SHEET, Workbook), this._univerInstanceService.registerCtorForType(I.UNIVER_DOC, DocumentDataModel), this._univerInstanceService.registerCtorForType(I.UNIVER_SLIDE, SlideDataModel);
10539
12273
  const univerInstanceService = injector.get(IUniverInstanceService);
10540
12274
  univerInstanceService.__setCreateHandler(
10541
- (type2, data, ctor) => {
12275
+ (type2, data, ctor, options) => {
10542
12276
  if (!this._startedTypes.has(type2)) {
10543
12277
  this._pluginService.startPluginForType(type2), this._startedTypes.add(type2);
10544
12278
  const model2 = injector.createInstance(ctor, data);
10545
- return univerInstanceService.__addUnit(model2), this._tryProgressToReady(), model2;
12279
+ return univerInstanceService.__addUnit(model2, options), this._tryProgressToReady(), model2;
10546
12280
  }
10547
12281
  const model = injector.createInstance(ctor, data);
10548
- return univerInstanceService.__addUnit(model), model;
12282
+ return univerInstanceService.__addUnit(model, options), model;
10549
12283
  }
10550
12284
  );
10551
12285
  }
@@ -10955,6 +12689,27 @@ function serializeCellDataSlice(slice) {
10955
12689
  return textEncoder.encode(JSON.stringify(data));
10956
12690
  }
10957
12691
  __name(serializeCellDataSlice, "serializeCellDataSlice");
12692
+ async function generateTempDocumentSnapshot(_context, document2, unitID, rev) {
12693
+ var _a13;
12694
+ const documentMeta = {
12695
+ unitID: document2.id,
12696
+ rev,
12697
+ creator: "",
12698
+ name: (_a13 = document2.title) != null ? _a13 : "",
12699
+ resources: document2.resources || [],
12700
+ originalMeta: encodeDocOriginalMeta(document2)
12701
+ };
12702
+ return {
12703
+ snapshot: {
12704
+ unitID,
12705
+ rev: documentMeta.rev,
12706
+ type: I.UNIVER_DOC,
12707
+ workbook: void 0,
12708
+ doc: documentMeta
12709
+ }
12710
+ };
12711
+ }
12712
+ __name(generateTempDocumentSnapshot, "generateTempDocumentSnapshot");
10958
12713
  async function generateTemporarySnap(context, workbook, unitID, rev, snapshotService) {
10959
12714
  const blockMeta = {}, sheetMetas = {};
10960
12715
  if (!await Promise.all(
@@ -11073,7 +12828,7 @@ async function transformWorkbookDataToSnapshot(context, workbook, unitID, rev, s
11073
12828
  type: I.UNIVER_SHEET,
11074
12829
  snapshot
11075
12830
  });
11076
- if (T(saveResult.error))
12831
+ if (H(saveResult.error))
11077
12832
  throw new Error(
11078
12833
  `transformWorkbookDataToSnapshot(): Failed to save snapshot.
11079
12834
  ErrorCode: ${(_a13 = saveResult.error) == null ? void 0 : _a13.code}:${(_b2 = saveResult.error) == null ? void 0 : _b2.message}`
@@ -11141,7 +12896,17 @@ function transformSnapshotToDocumentData(snapshot) {
11141
12896
  const documentMeta = snapshot.doc;
11142
12897
  if (documentMeta == null)
11143
12898
  throw new Error("transformSnapshotToDocumentData(): snapshot.doc is undefined.");
11144
- const { unitID, rev, name, originalMeta, resources = [] } = documentMeta, { body, documentStyle = {}, settings = {}, drawings = {}, drawingsOrder = [] } = decodeDocOriginalMeta(originalMeta);
12899
+ const { unitID, rev, name, originalMeta, resources = [] } = documentMeta, {
12900
+ body,
12901
+ documentStyle = {},
12902
+ settings = {},
12903
+ drawings = {},
12904
+ drawingsOrder = [],
12905
+ tableSource = {},
12906
+ headers = {},
12907
+ footers = {},
12908
+ lists = {}
12909
+ } = decodeDocOriginalMeta(originalMeta);
11145
12910
  return {
11146
12911
  id: unitID,
11147
12912
  rev,
@@ -11152,7 +12917,11 @@ function transformSnapshotToDocumentData(snapshot) {
11152
12917
  settings,
11153
12918
  drawings,
11154
12919
  drawingsOrder,
11155
- resources
12920
+ resources,
12921
+ tableSource,
12922
+ headers,
12923
+ footers,
12924
+ lists
11156
12925
  };
11157
12926
  }
11158
12927
  __name(transformSnapshotToDocumentData, "transformSnapshotToDocumentData");
@@ -11176,7 +12945,7 @@ async function transformDocumentDataToSnapshot(context, document2, unitID, rev,
11176
12945
  type: I.UNIVER_DOC,
11177
12946
  snapshot
11178
12947
  });
11179
- if (T(saveResult.error))
12948
+ if (H(saveResult.error))
11180
12949
  throw new Error(
11181
12950
  `transformDocumentDataToSnapshot(): Failed to save snapshot.
11182
12951
  ErrorCode: ${(_b2 = saveResult.error) == null ? void 0 : _b2.code}:${(_c = saveResult.error) == null ? void 0 : _c.message}`
@@ -11191,7 +12960,7 @@ async function getSheetBlocksFromSnapshot(snapshot, snapshotService) {
11191
12960
  if (!workbookMeta)
11192
12961
  throw new Error("Workbook metadata is not available");
11193
12962
  const blocks = [], promises = [];
11194
- return Object.entries(workbookMeta.blockMeta).forEach(([sheetID, blocksOfSheet]) => {
12963
+ return Object.entries(workbookMeta.blockMeta).forEach(([_, blocksOfSheet]) => {
11195
12964
  const blockPromises = blocksOfSheet.blocks.map(async (blockID) => {
11196
12965
  const params = {
11197
12966
  unitID: workbookMeta.unitID,
@@ -11243,9 +13012,9 @@ export {
11243
13012
  CommandType,
11244
13013
  CommonHideTypes,
11245
13014
  ConfigService,
11246
- ContentAlignment,
11247
13015
  ContextService,
11248
13016
  CopyPasteType,
13017
+ CustomCommandExecutionError,
11249
13018
  CustomDecorationType,
11250
13019
  CustomRangeType,
11251
13020
  DEFAULT_CELL,
@@ -11304,11 +13073,13 @@ export {
11304
13073
  FOCUSING_EDITOR_BUT_HIDDEN,
11305
13074
  FOCUSING_EDITOR_INPUT_FORMULA,
11306
13075
  FOCUSING_EDITOR_STANDALONE,
11307
- FOCUSING_FORMULA_EDITOR,
13076
+ FOCUSING_FX_BAR_EDITOR,
11308
13077
  FOCUSING_SHEET,
11309
13078
  FOCUSING_SLIDE,
13079
+ FOCUSING_UNIT,
11310
13080
  FOCUSING_UNIVER_EDITOR,
11311
13081
  FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,
13082
+ FORMULA_EDITOR_ACTIVATED,
11312
13083
  FollowNumberWithType,
11313
13084
  FontItalic,
11314
13085
  FontStyleType,
@@ -11372,6 +13143,8 @@ export {
11372
13143
  PresetListType,
11373
13144
  ProtectionType,
11374
13145
  Quantity,
13146
+ QuickListType,
13147
+ QuickListTypeMap,
11375
13148
  RANGE_TYPE,
11376
13149
  RCDisposable,
11377
13150
  RGBA_PAREN,
@@ -11405,6 +13178,11 @@ export {
11405
13178
  Styles,
11406
13179
  THEME_COLORS,
11407
13180
  TabStopAlignment,
13181
+ TableAlignmentType,
13182
+ TableCellHeightRule,
13183
+ TableLayoutType,
13184
+ TableSizeType,
13185
+ TableTextWrapType,
11408
13186
  TextDecoration,
11409
13187
  TextDirection,
11410
13188
  TextDirectionType,
@@ -11425,7 +13203,7 @@ export {
11425
13203
  UserManagerService,
11426
13204
  ValueIterator,
11427
13205
  VerticalAlign,
11428
- WidthType,
13206
+ VerticalAlignmentType,
11429
13207
  WithDependency,
11430
13208
  WithNew,
11431
13209
  Workbook,
@@ -11466,6 +13244,7 @@ export {
11466
13244
  fromEventSubject,
11467
13245
  fromObservable,
11468
13246
  generateRandomId,
13247
+ generateTempDocumentSnapshot,
11469
13248
  generateTemporarySnap,
11470
13249
  getArrayLength,
11471
13250
  getBodySlice,
@@ -11514,6 +13293,7 @@ export {
11514
13293
  makeArray,
11515
13294
  makeCellRangeToRangeData,
11516
13295
  makeCellToSelection,
13296
+ makeCustomRangeStream,
11517
13297
  mergeOverrideWithDependencies,
11518
13298
  mergeSets,
11519
13299
  mergeWorksheetSnapshotWithDefault,
@@ -11524,6 +13304,7 @@ export {
11524
13304
  normalizeTextRuns,
11525
13305
  numberToABC,
11526
13306
  numberToListABC,
13307
+ index$2 as numfmt,
11527
13308
  orderSearchArray,
11528
13309
  queryObjectMatrix,
11529
13310
  remove,