@univerjs/engine-render 0.21.1 → 0.22.0

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.
package/lib/es/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as EnUs } from "./en-us-ClVoWMyT.js";
2
- import { AlignTypeH, AlignTypeV, BaselineOffset, BooleanNumber, BorderStyleTypes, BulletAlignment, COLORS, CellValueType, ColorKit, ColumnSeparatorType, CustomDecorationType, CustomRangeType, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DataStreamTreeNodeType, DataStreamTreeTokenType, Disposable, DisposableCollection, DocumentDataModel, DocumentFlavor, EventSubject, FontStyleType, GridType, HorizontalAlign, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, ListGlyphType, LocaleService, MOVE_BUFFER_VALUE, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, Range, Rectangle, Registry, SectionType, SheetSkeleton, Skeleton, SpacingRule, TableAlignmentType, TableRowHeightRule, TableTextWrapType, TextDecoration, ThemeService, Tools, UniverInstanceType, VerticalAlign, VerticalAlignmentType, WrapStrategy, WrapTextType, addLinkToDocumentModel, checkParagraphHasIndentByStyle, createIdentifier, deleteContent, extractPureTextFromCell, getCellInfoInMergeData, getColorStyle, horizontalLineSegmentsSubtraction, insertTextToContent, invertColorByMatrix, isClassDependencyItem, isNullCell, isWhiteColor, merge, mergeWith, numberToABC, numberToListABC, registerDependencies, remove, requestImmediateMacroTask, searchArray, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
2
+ import { AlignTypeH, AlignTypeV, BaselineOffset, BooleanNumber, BorderStyleTypes, BulletAlignment, COLORS, CellValueType, ColorKit, ColumnSeparatorType, CustomDecorationType, CustomRangeType, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DataStreamTreeNodeType, DataStreamTreeTokenType, Disposable, DisposableCollection, DocumentDataModel, DocumentFlavor, EventSubject, FontStyleType, GridType, HorizontalAlign, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, ListGlyphType, LocaleService, MOVE_BUFFER_VALUE, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, Range, Rectangle, Registry, SectionType, SheetSkeleton, Skeleton, SpacingRule, TableAlignmentType, TableRowHeightRule, TableTextWrapType, TextDecoration, ThemeService, Tools, UniverInstanceType, VerticalAlign, VerticalAlignmentType, WrapStrategy, WrapTextType, addLinkToDocumentModel, checkParagraphHasIndentByStyle, createIdentifier, deleteContent, extractPureTextFromCell, getCellInfoInMergeData, getColorStyle, getDisplayValueFromCell, horizontalLineSegmentsSubtraction, insertTextToContent, invertColorByMatrix, isClassDependencyItem, isNullCell, isWhiteColor, merge, mergeWith, numberToABC, numberToListABC, registerDependencies, remove, requestImmediateMacroTask, searchArray, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
3
3
  import * as cjk from "cjk-regex";
4
4
  import { BehaviorSubject, Observable, Subject, Subscription, debounceTime, distinctUntilChanged, shareReplay, startWith } from "rxjs";
5
- import { parse } from "opentype.js/dist/opentype.module.js";
5
+ import { parse } from "opentype.js";
6
6
  import { franc } from "franc-min";
7
7
  import { getOverflowAncestors } from "@floating-ui/dom";
8
8
  import { floor, max, min } from "@floating-ui/utils";
@@ -621,7 +621,7 @@ function getSystemHighlightColor() {
621
621
  }
622
622
 
623
623
  //#endregion
624
- //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
624
+ //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
625
625
  function _typeof(o) {
626
626
  "@babel/helpers - typeof";
627
627
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -632,7 +632,7 @@ function _typeof(o) {
632
632
  }
633
633
 
634
634
  //#endregion
635
- //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
635
+ //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
636
636
  function toPrimitive(t, r) {
637
637
  if ("object" != _typeof(t) || !t) return t;
638
638
  var e = t[Symbol.toPrimitive];
@@ -645,14 +645,14 @@ function toPrimitive(t, r) {
645
645
  }
646
646
 
647
647
  //#endregion
648
- //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
648
+ //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
649
649
  function toPropertyKey(t) {
650
650
  var i = toPrimitive(t, "string");
651
651
  return "symbol" == _typeof(i) ? i : i + "";
652
652
  }
653
653
 
654
654
  //#endregion
655
- //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
655
+ //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
656
656
  function _defineProperty(e, r, t) {
657
657
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
658
658
  value: t,
@@ -793,7 +793,10 @@ var FontCache = class {
793
793
  * @returns IMeasureTextCache
794
794
  */
795
795
  static getMeasureText(content, fontString) {
796
- if (!this._context) this._context = document.createElement("canvas").getContext("2d");
796
+ if (!this._context) {
797
+ const canvas = document.createElement("canvas");
798
+ this._context = canvas.getContext("2d");
799
+ }
797
800
  if (!this._context) return {
798
801
  width: 0,
799
802
  fontBoundingBoxAscent: 0,
@@ -961,7 +964,7 @@ function hasListGlyph(glyph) {
961
964
  var _glyphGroup$;
962
965
  const divide = glyph === null || glyph === void 0 ? void 0 : glyph.parent;
963
966
  if (divide == null) return false;
964
- return ((_glyphGroup$ = divide.glyphGroup[0]) === null || _glyphGroup$ === void 0 ? void 0 : _glyphGroup$.glyphType) === GlyphType.LIST;
967
+ return ((_glyphGroup$ = divide.glyphGroup[0]) === null || _glyphGroup$ === void 0 ? void 0 : _glyphGroup$.glyphType) === 2;
965
968
  }
966
969
  function isIndentByGlyph(glyph, body) {
967
970
  const paragraph = getParagraphByGlyph(glyph, body);
@@ -990,7 +993,7 @@ function isFirstGlyph(glyph) {
990
993
  const glyphIndex = glyphGroup.indexOf(glyph);
991
994
  const divideIndex = divides.indexOf(divide);
992
995
  if (divideIndex === 0 && glyphIndex === 0) return true;
993
- if (divideIndex === 0 && glyphIndex === 1 && glyphGroup[0].glyphType === GlyphType.LIST) return true;
996
+ if (divideIndex === 0 && glyphIndex === 1 && glyphGroup[0].glyphType === 2) return true;
994
997
  }
995
998
  return false;
996
999
  }
@@ -1682,22 +1685,22 @@ function drawLineByBorderType(ctx, type, lineWidthBuffer, position) {
1682
1685
  let drawEndX = 0;
1683
1686
  let drawEndY = 0;
1684
1687
  const { startX, startY, endX, endY } = position;
1685
- if (type === BORDER_TYPE.TOP) {
1688
+ if (type === "t") {
1686
1689
  drawStartX = startX - lineWidthBuffer;
1687
1690
  drawStartY = startY;
1688
1691
  drawEndX = endX + lineWidthBuffer;
1689
1692
  drawEndY = startY;
1690
- } else if (type === BORDER_TYPE.BOTTOM) {
1693
+ } else if (type === "b") {
1691
1694
  drawStartX = startX - lineWidthBuffer;
1692
1695
  drawStartY = endY;
1693
1696
  drawEndX = endX - lineWidthBuffer;
1694
1697
  drawEndY = endY;
1695
- } else if (type === BORDER_TYPE.LEFT) {
1698
+ } else if (type === "l") {
1696
1699
  drawStartX = startX;
1697
1700
  drawStartY = startY - lineWidthBuffer;
1698
1701
  drawEndX = startX;
1699
1702
  drawEndY = endY + lineWidthBuffer;
1700
- } else if (type === BORDER_TYPE.RIGHT) {
1703
+ } else if (type === "r") {
1701
1704
  drawStartX = endX;
1702
1705
  drawStartY = startY - lineWidthBuffer;
1703
1706
  drawEndX = endX;
@@ -1716,37 +1719,37 @@ function drawDiagonalSingleLineByBorderType(ctx, type, position) {
1716
1719
  let drawEndY = 0;
1717
1720
  const { startX, startY, endX, endY } = position;
1718
1721
  switch (type) {
1719
- case BORDER_TYPE.TL_BR:
1722
+ case "tl_br":
1720
1723
  drawStartX = startX;
1721
1724
  drawStartY = startY;
1722
1725
  drawEndX = endX;
1723
1726
  drawEndY = endY;
1724
1727
  break;
1725
- case BORDER_TYPE.TL_BC:
1728
+ case "tl_bc":
1726
1729
  drawStartX = startX;
1727
1730
  drawStartY = startY;
1728
1731
  drawEndX = (startX + endX) / 2;
1729
1732
  drawEndY = endY;
1730
1733
  break;
1731
- case BORDER_TYPE.TL_MR:
1734
+ case "tl_mr":
1732
1735
  drawStartX = startX;
1733
1736
  drawStartY = startY;
1734
1737
  drawEndX = endX;
1735
1738
  drawEndY = (startY + endY) / 2;
1736
1739
  break;
1737
- case BORDER_TYPE.BL_TR:
1740
+ case "bl_tr":
1738
1741
  drawStartX = startX;
1739
1742
  drawStartY = endY;
1740
1743
  drawEndX = endX;
1741
1744
  drawEndY = startY;
1742
1745
  break;
1743
- case BORDER_TYPE.ML_TR:
1746
+ case "ml_tr":
1744
1747
  drawStartX = startX;
1745
1748
  drawStartY = (startY + endY) / 2;
1746
1749
  drawEndX = endX;
1747
1750
  drawEndY = startY;
1748
1751
  break;
1749
- case BORDER_TYPE.BC_TR:
1752
+ case "bc_tr":
1750
1753
  drawStartX = (startX + endX) / 2;
1751
1754
  drawStartY = endY;
1752
1755
  drawEndX = endX;
@@ -1770,7 +1773,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
1770
1773
  let drawSecondEndY = 0;
1771
1774
  const { startX, startY, endX, endY } = position;
1772
1775
  switch (type) {
1773
- case BORDER_TYPE.TL_BR:
1776
+ case "tl_br":
1774
1777
  drawFirstStartX = startX;
1775
1778
  drawFirstStartY = startY + 1.5;
1776
1779
  drawFirstEndX = endX - 1.5;
@@ -1780,7 +1783,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
1780
1783
  drawSecondEndX = endX;
1781
1784
  drawSecondEndY = endY - 1.5;
1782
1785
  break;
1783
- case BORDER_TYPE.BL_TR:
1786
+ case "bl_tr":
1784
1787
  drawFirstStartX = startX;
1785
1788
  drawFirstStartY = endY - 1.5;
1786
1789
  drawFirstEndX = endX - 1.5;
@@ -1803,7 +1806,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
1803
1806
  ctx.stroke();
1804
1807
  }
1805
1808
  function drawDiagonalLineByBorderType(ctx, style, type, position) {
1806
- if (style === BorderStyleTypes.DOUBLE && (type === BORDER_TYPE.TL_BR || type === BORDER_TYPE.BL_TR)) drawDiagonalDoubleLineByBorderType(ctx, type, position);
1809
+ if (style === BorderStyleTypes.DOUBLE && (type === "tl_br" || type === "bl_tr")) drawDiagonalDoubleLineByBorderType(ctx, type, position);
1807
1810
  else drawDiagonalSingleLineByBorderType(ctx, type, position);
1808
1811
  }
1809
1812
  function clearLineByBorderType(ctx, type, position) {
@@ -1813,25 +1816,25 @@ function clearLineByBorderType(ctx, type, position) {
1813
1816
  let drawEndY = 0;
1814
1817
  const { startX, startY, endX, endY } = position;
1815
1818
  switch (type) {
1816
- case BORDER_TYPE.TOP:
1819
+ case "t":
1817
1820
  drawStartX = startX;
1818
1821
  drawStartY = startY;
1819
1822
  drawEndX = endX;
1820
1823
  drawEndY = startY;
1821
1824
  break;
1822
- case BORDER_TYPE.BOTTOM:
1825
+ case "b":
1823
1826
  drawStartX = startX;
1824
1827
  drawStartY = endY;
1825
1828
  drawEndX = endX;
1826
1829
  drawEndY = endY;
1827
1830
  break;
1828
- case BORDER_TYPE.LEFT:
1831
+ case "l":
1829
1832
  drawStartX = startX;
1830
1833
  drawStartY = startY;
1831
1834
  drawEndX = startX;
1832
1835
  drawEndY = endY;
1833
1836
  break;
1834
- case BORDER_TYPE.RIGHT:
1837
+ case "r":
1835
1838
  drawStartX = endX;
1836
1839
  drawStartY = startY;
1837
1840
  drawEndX = endX;
@@ -1879,7 +1882,7 @@ function calculateRectRotate(startPoint, centerPoint, radiusCenter, radiusVertex
1879
1882
  return newVector.rotateByPoint(finalAngle, rotationVector).add(offsetPoint).transformCoordinateOnRotate(finalAngle);
1880
1883
  }
1881
1884
  function getRotateOrientation(angle) {
1882
- return angle > 0 ? ORIENTATION_TYPE.DOWN : ORIENTATION_TYPE.UP;
1885
+ return angle > 0 ? 1 : 0;
1883
1886
  }
1884
1887
  function getRotateOffsetAndFarthestHypotenuse(lines, rectWidth, vertexAngle) {
1885
1888
  const rotateTranslateXList = [];
@@ -1894,7 +1897,7 @@ function getRotateOffsetAndFarthestHypotenuse(lines, rectWidth, vertexAngle) {
1894
1897
  const tanTheta = Math.tan(vertexAngle);
1895
1898
  const sinTheta = Math.sin(vertexAngle);
1896
1899
  const cosTheta = Math.cos(vertexAngle);
1897
- if (orientation === ORIENTATION_TYPE.UP) {
1900
+ if (orientation === 0) {
1898
1901
  let cumRectHeight = 0;
1899
1902
  for (let i = 0; i < linesCount; i++) {
1900
1903
  const { lineHeight: rectHeight = 0 } = lines[i];
@@ -2953,7 +2956,7 @@ var BaseObject = class extends Disposable {
2953
2956
  _defineProperty(this, "groupKey", void 0);
2954
2957
  _defineProperty(this, "isInGroup", false);
2955
2958
  _defineProperty(this, "isDrawingObject", false);
2956
- _defineProperty(this, "objectType", ObjectType.UNKNOWN);
2959
+ _defineProperty(this, "objectType", 0);
2957
2960
  _defineProperty(this, "onTransformChange$", new EventSubject());
2958
2961
  _defineProperty(this, "onPointerDown$", new EventSubject());
2959
2962
  _defineProperty(this, "onPointerMove$", new EventSubject());
@@ -2999,7 +3002,7 @@ var BaseObject = class extends Disposable {
2999
3002
  _defineProperty(this, "_visible", true);
3000
3003
  _defineProperty(this, "_debounceParentDirty", true);
3001
3004
  _defineProperty(this, "_transform", new Transform());
3002
- _defineProperty(this, "_cursor", CURSOR_TYPE.DEFAULT);
3005
+ _defineProperty(this, "_cursor", "default");
3003
3006
  _defineProperty(this, "_transformerConfig", void 0);
3004
3007
  _defineProperty(this, "_forceRender", false);
3005
3008
  _defineProperty(this, "_layer", void 0);
@@ -3040,7 +3043,7 @@ var BaseObject = class extends Disposable {
3040
3043
  return this._heightOrigin;
3041
3044
  }
3042
3045
  get classType() {
3043
- return RENDER_CLASS_TYPE.BASE_OBJECT;
3046
+ return "BaseObject";
3044
3047
  }
3045
3048
  get top() {
3046
3049
  return this._top;
@@ -3086,15 +3089,15 @@ var BaseObject = class extends Disposable {
3086
3089
  }
3087
3090
  get ancestorTransform() {
3088
3091
  const parent = this.getParent();
3089
- if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === RENDER_CLASS_TYPE.GROUP) return parent === null || parent === void 0 ? void 0 : parent.ancestorTransform.multiply(this.transform);
3092
+ if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent === null || parent === void 0 ? void 0 : parent.ancestorTransform.multiply(this.transform);
3090
3093
  return this.transform;
3091
3094
  }
3092
3095
  get ancestorGroup() {
3093
3096
  let group = null;
3094
3097
  let parent = this.getParent();
3095
3098
  while (parent != null && parent) {
3096
- if (parent.classType === RENDER_CLASS_TYPE.GROUP) group = parent;
3097
- if (parent.classType === RENDER_CLASS_TYPE.GROUP) parent = parent.getParent();
3099
+ if (parent.classType === "Group") group = parent;
3100
+ if (parent.classType === "Group") parent = parent.getParent();
3098
3101
  else parent = null;
3099
3102
  }
3100
3103
  return group;
@@ -3241,7 +3244,7 @@ var BaseObject = class extends Disposable {
3241
3244
  if (x !== void 0) this.left = x;
3242
3245
  this._setTransForm();
3243
3246
  this.onTransformChange$.emitEvent({
3244
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.translate,
3247
+ type: 0,
3245
3248
  value: {
3246
3249
  top: this._top,
3247
3250
  left: this._left
@@ -3260,7 +3263,7 @@ var BaseObject = class extends Disposable {
3260
3263
  if (height !== void 0) this.height = height;
3261
3264
  this._setTransForm();
3262
3265
  this.onTransformChange$.emitEvent({
3263
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize,
3266
+ type: 1,
3264
3267
  value: {
3265
3268
  width: this._width,
3266
3269
  height: this._height
@@ -3279,7 +3282,7 @@ var BaseObject = class extends Disposable {
3279
3282
  if (scaleY !== void 0) this.scaleY = scaleY;
3280
3283
  this._setTransForm();
3281
3284
  this.onTransformChange$.emitEvent({
3282
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale,
3285
+ type: 2,
3283
3286
  value: {
3284
3287
  scaleX: this._scaleX,
3285
3288
  scaleY: this._scaleY
@@ -3298,7 +3301,7 @@ var BaseObject = class extends Disposable {
3298
3301
  if (skewY !== void 0) this.skewY = skewY;
3299
3302
  this._setTransForm();
3300
3303
  this.onTransformChange$.emitEvent({
3301
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.skew,
3304
+ type: 3,
3302
3305
  value: {
3303
3306
  skewX: this._skewX,
3304
3307
  skewY: this._skewY
@@ -3317,7 +3320,7 @@ var BaseObject = class extends Disposable {
3317
3320
  if (flipY !== void 0) this.flipY = flipY;
3318
3321
  this._setTransForm();
3319
3322
  this.onTransformChange$.emitEvent({
3320
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.flip,
3323
+ type: 4,
3321
3324
  value: {
3322
3325
  flipX: this._flipX,
3323
3326
  flipY: this._flipY
@@ -3345,7 +3348,7 @@ var BaseObject = class extends Disposable {
3345
3348
  });
3346
3349
  this._setTransForm();
3347
3350
  this.onTransformChange$.emitEvent({
3348
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.all,
3351
+ type: 5,
3349
3352
  value: option,
3350
3353
  preValue: preKeys
3351
3354
  });
@@ -3377,7 +3380,7 @@ var BaseObject = class extends Disposable {
3377
3380
  var _this$parent, _this$parent2;
3378
3381
  let { width: realWidth, height: realHeight, left: realLeft, top: realTop } = this;
3379
3382
  let baseBound;
3380
- if (this.isInGroup && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.classType) === RENDER_CLASS_TYPE.GROUP && ((_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.getBaseBound)) baseBound = this.parent.getBaseBound();
3383
+ if (this.isInGroup && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.classType) === "Group" && ((_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.getBaseBound)) baseBound = this.parent.getBaseBound();
3381
3384
  if (baseBound) {
3382
3385
  const parentState = this.getParent();
3383
3386
  const parentBound = {
@@ -3609,7 +3612,7 @@ var BaseObject = class extends Disposable {
3609
3612
  getScene() {
3610
3613
  let parent = this.parent;
3611
3614
  while (parent) {
3612
- if (parent.classType === RENDER_CLASS_TYPE.SCENE) return parent;
3615
+ if (parent.classType === "Scene") return parent;
3613
3616
  parent = parent.getParent();
3614
3617
  }
3615
3618
  return null;
@@ -3626,7 +3629,7 @@ var BaseObject = class extends Disposable {
3626
3629
  getEngine() {
3627
3630
  let parent = this.getParent();
3628
3631
  while (parent != null) {
3629
- if (parent.classType === RENDER_CLASS_TYPE.ENGINE) return parent;
3632
+ if (parent.classType === "Engine") return parent;
3630
3633
  parent = parent.getParent();
3631
3634
  }
3632
3635
  return null;
@@ -3650,7 +3653,7 @@ var BaseObject = class extends Disposable {
3650
3653
  return this.ancestorTransform.invert().applyPoint(coord);
3651
3654
  }
3652
3655
  _setTransForm() {
3653
- this.transform = Transform.create().composeMatrix({
3656
+ const composeResult = Transform.create().composeMatrix({
3654
3657
  left: this.left + this.strokeWidth / 2,
3655
3658
  top: this.top + this.strokeWidth / 2,
3656
3659
  scaleX: this.scaleX,
@@ -3661,6 +3664,7 @@ var BaseObject = class extends Disposable {
3661
3664
  flipX: this.flipX,
3662
3665
  flipY: this.flipY
3663
3666
  });
3667
+ this.transform = composeResult;
3664
3668
  this._makeDirtyMix();
3665
3669
  }
3666
3670
  _makeDirtyMix() {
@@ -4424,7 +4428,7 @@ var Canvas = class {
4424
4428
  this._canvasEle.style.outline = "0";
4425
4429
  const context = this._canvasEle.getContext("2d");
4426
4430
  if (context == null) throw new Error("context is not support");
4427
- if (props.mode === CanvasRenderMode.Printing) this._context = new UniverPrintingContext(context);
4431
+ if (props.mode === 1) this._context = new UniverPrintingContext(context);
4428
4432
  else this._context = new UniverRenderingContext(context, { canvasColorService: props.colorService });
4429
4433
  this.setSize(props.width, props.height, props.pixelRatio);
4430
4434
  }
@@ -4624,7 +4628,7 @@ var SheetComponent = class extends RenderComponent {
4624
4628
  }
4625
4629
  getParentScale() {
4626
4630
  let { scaleX = 1, scaleY = 1 } = this.parent;
4627
- if (this.parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
4631
+ if (this.parent.classType === "SceneViewer") {
4628
4632
  scaleX = this.parent.ancestorScaleX || 1;
4629
4633
  scaleY = this.parent.ancestorScaleY || 1;
4630
4634
  }
@@ -4733,38 +4737,23 @@ let SHEET_VIEWPORT_KEY = /* @__PURE__ */ function(SHEET_VIEWPORT_KEY) {
4733
4737
 
4734
4738
  //#endregion
4735
4739
  //#region src/components/sheets/constants.ts
4736
- /**
4737
- * Copyright 2023-present DreamNum Co., Ltd.
4738
- *
4739
- * Licensed under the Apache License, Version 2.0 (the "License");
4740
- * you may not use this file except in compliance with the License.
4741
- * You may obtain a copy of the License at
4742
- *
4743
- * http://www.apache.org/licenses/LICENSE-2.0
4744
- *
4745
- * Unless required by applicable law or agreed to in writing, software
4746
- * distributed under the License is distributed on an "AS IS" BASIS,
4747
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4748
- * See the License for the specific language governing permissions and
4749
- * limitations under the License.
4750
- */
4751
4740
  const BORDER_Z_INDEX = 50;
4752
4741
  const FONT_EXTENSION_Z_INDEX = 45;
4753
4742
  const BG_Z_INDEX = 21;
4754
4743
  const PRINTING_BG_Z_INDEX = 21;
4755
4744
  const EXPAND_SIZE_FOR_RENDER_OVERFLOW = 20;
4756
4745
  const sheetContentViewportKeys = [
4757
- SHEET_VIEWPORT_KEY.VIEW_MAIN,
4758
- SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP,
4759
- SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP,
4760
- SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT
4746
+ "viewMain",
4747
+ "viewMainLeftTop",
4748
+ "viewMainTop",
4749
+ "viewMainLeft"
4761
4750
  ];
4762
4751
  const sheetHeaderViewportKeys = [
4763
- SHEET_VIEWPORT_KEY.VIEW_ROW_TOP,
4764
- SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM,
4765
- SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT,
4766
- SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT,
4767
- SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP
4752
+ "viewRowTop",
4753
+ "viewRowBottom",
4754
+ "viewColumnLeft",
4755
+ "viewColumnRight",
4756
+ "viewLeftTop"
4768
4757
  ];
4769
4758
  const MEASURE_EXTENT = 1e4;
4770
4759
  const MEASURE_EXTENT_FOR_PARAGRAPH = MEASURE_EXTENT / 10;
@@ -4782,7 +4771,7 @@ const SHEET_EXTENSION_PREFIX = "sheet-ext-";
4782
4771
  var SheetExtension = class extends ComponentExtension {
4783
4772
  constructor(..._args) {
4784
4773
  super(..._args);
4785
- _defineProperty(this, "type", SHEET_EXTENSION_TYPE.GRID);
4774
+ _defineProperty(this, "type", 0);
4786
4775
  }
4787
4776
  isRenderDiffRangesByCell(rangeP, diffRanges) {
4788
4777
  if (diffRanges == null || diffRanges.length === 0) return true;
@@ -5052,7 +5041,7 @@ var Border = class extends SheetExtension {
5052
5041
  let endY = cellEndY;
5053
5042
  let startX = cellStartX;
5054
5043
  let endX = cellEndX;
5055
- if (type !== BORDER_TYPE.TOP && type !== BORDER_TYPE.BOTTOM && type !== BORDER_TYPE.LEFT && type !== BORDER_TYPE.RIGHT) {
5044
+ if (type !== "t" && type !== "b" && type !== "l" && type !== "r") {
5056
5045
  if (isMerged) return true;
5057
5046
  if (isMergedMainCell) {
5058
5047
  startY = mergeInfo.startY;
@@ -5078,7 +5067,7 @@ var Border = class extends SheetExtension {
5078
5067
  endX,
5079
5068
  endY
5080
5069
  });
5081
- if (style === BorderStyleTypes.DOUBLE && (type === BORDER_TYPE.LEFT || type === BORDER_TYPE.RIGHT || type === BORDER_TYPE.TOP || type === BORDER_TYPE.BOTTOM)) this._renderDoubleBorder({
5070
+ if (style === BorderStyleTypes.DOUBLE && (type === "l" || type === "r" || type === "t" || type === "b")) this._renderDoubleBorder({
5082
5071
  renderBorderContext,
5083
5072
  row,
5084
5073
  col,
@@ -5093,16 +5082,16 @@ var Border = class extends SheetExtension {
5093
5082
  }
5094
5083
  _getOverflowExclusion(overflowCache, type, borderRow, borderColumn) {
5095
5084
  let isDraw = false;
5096
- if (type === BORDER_TYPE.TOP || type === BORDER_TYPE.BOTTOM) return isDraw;
5085
+ if (type === "t" || type === "b") return isDraw;
5097
5086
  overflowCache === null || overflowCache === void 0 || overflowCache.forRow((row, rowArray) => {
5098
5087
  if (row !== borderRow) return true;
5099
5088
  rowArray.forEach((column) => {
5100
5089
  const { startColumn, endColumn } = overflowCache.getValue(row, column);
5101
- if (type === BORDER_TYPE.LEFT && borderColumn > startColumn && borderColumn <= endColumn) {
5090
+ if (type === "l" && borderColumn > startColumn && borderColumn <= endColumn) {
5102
5091
  isDraw = true;
5103
5092
  return false;
5104
5093
  }
5105
- if (type === BORDER_TYPE.RIGHT && borderColumn >= startColumn && borderColumn < endColumn) {
5094
+ if (type === "r" && borderColumn >= startColumn && borderColumn < endColumn) {
5106
5095
  isDraw = true;
5107
5096
  return false;
5108
5097
  }
@@ -5162,7 +5151,7 @@ var Border = class extends SheetExtension {
5162
5151
  endXOffset: defaultOffset,
5163
5152
  endYOffset: defaultOffset
5164
5153
  };
5165
- if (type === BORDER_TYPE.LEFT || type === BORDER_TYPE.RIGHT) {
5154
+ if (type === "l" || type === "r") {
5166
5155
  if (topCellBorder.bottom && topCellBorder.bottom.style !== BorderStyleTypes.DOUBLE) {
5167
5156
  outerLineOffsets.startYOffset = 0;
5168
5157
  innerLineOffsets.startYOffset = 0;
@@ -5170,8 +5159,8 @@ var Border = class extends SheetExtension {
5170
5159
  var _leftCellBorder$top, _leftTopCellBorder$bo, _rightCellBorder$top, _rightTopCellBorder$b;
5171
5160
  const leftTopCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col - 1);
5172
5161
  const rightTopCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col + 1);
5173
- if (type === BORDER_TYPE.LEFT && (((_leftCellBorder$top = leftCellBorder.top) === null || _leftCellBorder$top === void 0 ? void 0 : _leftCellBorder$top.style) === BorderStyleTypes.DOUBLE || ((_leftTopCellBorder$bo = leftTopCellBorder.bottom) === null || _leftTopCellBorder$bo === void 0 ? void 0 : _leftTopCellBorder$bo.style) === BorderStyleTypes.DOUBLE) || type === BORDER_TYPE.RIGHT && (((_rightCellBorder$top = rightCellBorder.top) === null || _rightCellBorder$top === void 0 ? void 0 : _rightCellBorder$top.style) === BorderStyleTypes.DOUBLE || ((_rightTopCellBorder$b = rightTopCellBorder.bottom) === null || _rightTopCellBorder$b === void 0 ? void 0 : _rightTopCellBorder$b.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.startYOffset = -defaultOffset;
5174
- else if (type === BORDER_TYPE.LEFT && leftTopCellBorder.bottom && leftTopCellBorder.bottom.style !== BorderStyleTypes.DOUBLE || type === BORDER_TYPE.RIGHT && rightTopCellBorder.bottom && rightTopCellBorder.bottom.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.startYOffset = 0;
5162
+ if (type === "l" && (((_leftCellBorder$top = leftCellBorder.top) === null || _leftCellBorder$top === void 0 ? void 0 : _leftCellBorder$top.style) === BorderStyleTypes.DOUBLE || ((_leftTopCellBorder$bo = leftTopCellBorder.bottom) === null || _leftTopCellBorder$bo === void 0 ? void 0 : _leftTopCellBorder$bo.style) === BorderStyleTypes.DOUBLE) || type === "r" && (((_rightCellBorder$top = rightCellBorder.top) === null || _rightCellBorder$top === void 0 ? void 0 : _rightCellBorder$top.style) === BorderStyleTypes.DOUBLE || ((_rightTopCellBorder$b = rightTopCellBorder.bottom) === null || _rightTopCellBorder$b === void 0 ? void 0 : _rightTopCellBorder$b.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.startYOffset = -defaultOffset;
5163
+ else if (type === "l" && leftTopCellBorder.bottom && leftTopCellBorder.bottom.style !== BorderStyleTypes.DOUBLE || type === "r" && rightTopCellBorder.bottom && rightTopCellBorder.bottom.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.startYOffset = 0;
5175
5164
  else outerLineOffsets.startYOffset = defaultOffset;
5176
5165
  innerLineOffsets.startYOffset = defaultOffset;
5177
5166
  }
@@ -5182,17 +5171,17 @@ var Border = class extends SheetExtension {
5182
5171
  var _leftCellBorder$botto, _leftBottomCellBorder, _rightCellBorder$bott, _rightBottomCellBorde;
5183
5172
  const leftBottomCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col - 1);
5184
5173
  const rightBottomCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col + 1);
5185
- if (type === BORDER_TYPE.LEFT && (((_leftCellBorder$botto = leftCellBorder.bottom) === null || _leftCellBorder$botto === void 0 ? void 0 : _leftCellBorder$botto.style) === BorderStyleTypes.DOUBLE || ((_leftBottomCellBorder = leftBottomCellBorder.top) === null || _leftBottomCellBorder === void 0 ? void 0 : _leftBottomCellBorder.style) === BorderStyleTypes.DOUBLE) || type === BORDER_TYPE.RIGHT && (((_rightCellBorder$bott = rightCellBorder.bottom) === null || _rightCellBorder$bott === void 0 ? void 0 : _rightCellBorder$bott.style) === BorderStyleTypes.DOUBLE || ((_rightBottomCellBorde = rightBottomCellBorder.top) === null || _rightBottomCellBorde === void 0 ? void 0 : _rightBottomCellBorde.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.endYOffset = -defaultOffset;
5186
- else if (type === BORDER_TYPE.LEFT && leftBottomCellBorder.top && leftBottomCellBorder.top.style !== BorderStyleTypes.DOUBLE || type === BORDER_TYPE.RIGHT && rightBottomCellBorder.top && rightBottomCellBorder.top.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.endYOffset = 0;
5174
+ if (type === "l" && (((_leftCellBorder$botto = leftCellBorder.bottom) === null || _leftCellBorder$botto === void 0 ? void 0 : _leftCellBorder$botto.style) === BorderStyleTypes.DOUBLE || ((_leftBottomCellBorder = leftBottomCellBorder.top) === null || _leftBottomCellBorder === void 0 ? void 0 : _leftBottomCellBorder.style) === BorderStyleTypes.DOUBLE) || type === "r" && (((_rightCellBorder$bott = rightCellBorder.bottom) === null || _rightCellBorder$bott === void 0 ? void 0 : _rightCellBorder$bott.style) === BorderStyleTypes.DOUBLE || ((_rightBottomCellBorde = rightBottomCellBorder.top) === null || _rightBottomCellBorde === void 0 ? void 0 : _rightBottomCellBorde.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.endYOffset = -defaultOffset;
5175
+ else if (type === "l" && leftBottomCellBorder.top && leftBottomCellBorder.top.style !== BorderStyleTypes.DOUBLE || type === "r" && rightBottomCellBorder.top && rightBottomCellBorder.top.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.endYOffset = 0;
5187
5176
  else outerLineOffsets.endYOffset = defaultOffset;
5188
5177
  innerLineOffsets.endYOffset = defaultOffset;
5189
5178
  }
5190
5179
  clearLine.startY = startY - defaultOffset;
5191
5180
  clearLine.endY = endY + defaultOffset;
5192
5181
  clearMiddleLine(clearLine);
5193
- if (type === BORDER_TYPE.LEFT && !leftCellBorder.right || type === BORDER_TYPE.RIGHT && !rightCellBorder.left) drawOuterLine(outerLineOffsets);
5182
+ if (type === "l" && !leftCellBorder.right || type === "r" && !rightCellBorder.left) drawOuterLine(outerLineOffsets);
5194
5183
  drawInnerLine(innerLineOffsets);
5195
- } else if (type === BORDER_TYPE.TOP || type === BORDER_TYPE.BOTTOM) {
5184
+ } else if (type === "t" || type === "b") {
5196
5185
  if (leftCellBorder.right && leftCellBorder.right.style !== BorderStyleTypes.DOUBLE) {
5197
5186
  outerLineOffsets.startXOffset = 0;
5198
5187
  innerLineOffsets.startXOffset = 0;
@@ -5200,8 +5189,8 @@ var Border = class extends SheetExtension {
5200
5189
  var _topCellBorder$left, _topLeftCellBorder$ri, _bottomCellBorder$lef, _bottomLeftCellBorder;
5201
5190
  const topLeftCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col - 1);
5202
5191
  const bottomLeftCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col - 1);
5203
- if (type === BORDER_TYPE.TOP && (((_topCellBorder$left = topCellBorder.left) === null || _topCellBorder$left === void 0 ? void 0 : _topCellBorder$left.style) === BorderStyleTypes.DOUBLE || ((_topLeftCellBorder$ri = topLeftCellBorder.right) === null || _topLeftCellBorder$ri === void 0 ? void 0 : _topLeftCellBorder$ri.style) === BorderStyleTypes.DOUBLE) || type === BORDER_TYPE.BOTTOM && (((_bottomCellBorder$lef = bottomCellBorder.left) === null || _bottomCellBorder$lef === void 0 ? void 0 : _bottomCellBorder$lef.style) === BorderStyleTypes.DOUBLE || ((_bottomLeftCellBorder = bottomLeftCellBorder.right) === null || _bottomLeftCellBorder === void 0 ? void 0 : _bottomLeftCellBorder.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.startXOffset = -defaultOffset;
5204
- else if (type === BORDER_TYPE.TOP && topLeftCellBorder.right && topLeftCellBorder.right.style !== BorderStyleTypes.DOUBLE || type === BORDER_TYPE.BOTTOM && bottomLeftCellBorder.right && bottomLeftCellBorder.right.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.startXOffset = 0;
5192
+ if (type === "t" && (((_topCellBorder$left = topCellBorder.left) === null || _topCellBorder$left === void 0 ? void 0 : _topCellBorder$left.style) === BorderStyleTypes.DOUBLE || ((_topLeftCellBorder$ri = topLeftCellBorder.right) === null || _topLeftCellBorder$ri === void 0 ? void 0 : _topLeftCellBorder$ri.style) === BorderStyleTypes.DOUBLE) || type === "b" && (((_bottomCellBorder$lef = bottomCellBorder.left) === null || _bottomCellBorder$lef === void 0 ? void 0 : _bottomCellBorder$lef.style) === BorderStyleTypes.DOUBLE || ((_bottomLeftCellBorder = bottomLeftCellBorder.right) === null || _bottomLeftCellBorder === void 0 ? void 0 : _bottomLeftCellBorder.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.startXOffset = -defaultOffset;
5193
+ else if (type === "t" && topLeftCellBorder.right && topLeftCellBorder.right.style !== BorderStyleTypes.DOUBLE || type === "b" && bottomLeftCellBorder.right && bottomLeftCellBorder.right.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.startXOffset = 0;
5205
5194
  else outerLineOffsets.startXOffset = defaultOffset;
5206
5195
  innerLineOffsets.startXOffset = defaultOffset;
5207
5196
  }
@@ -5212,15 +5201,15 @@ var Border = class extends SheetExtension {
5212
5201
  var _topCellBorder$right, _topRightCellBorder$l, _bottomCellBorder$rig, _bottomRightCellBorde;
5213
5202
  const topRightCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col + 1);
5214
5203
  const bottomRightCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col + 1);
5215
- if (type === BORDER_TYPE.TOP && (((_topCellBorder$right = topCellBorder.right) === null || _topCellBorder$right === void 0 ? void 0 : _topCellBorder$right.style) === BorderStyleTypes.DOUBLE || ((_topRightCellBorder$l = topRightCellBorder.left) === null || _topRightCellBorder$l === void 0 ? void 0 : _topRightCellBorder$l.style) === BorderStyleTypes.DOUBLE) || type === BORDER_TYPE.BOTTOM && (((_bottomCellBorder$rig = bottomCellBorder.right) === null || _bottomCellBorder$rig === void 0 ? void 0 : _bottomCellBorder$rig.style) === BorderStyleTypes.DOUBLE || ((_bottomRightCellBorde = bottomRightCellBorder.left) === null || _bottomRightCellBorde === void 0 ? void 0 : _bottomRightCellBorde.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.endXOffset = -defaultOffset;
5216
- else if (type === BORDER_TYPE.TOP && topRightCellBorder.left && topRightCellBorder.left.style !== BorderStyleTypes.DOUBLE || type === BORDER_TYPE.BOTTOM && bottomRightCellBorder.left && bottomRightCellBorder.left.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.endXOffset = 0;
5204
+ if (type === "t" && (((_topCellBorder$right = topCellBorder.right) === null || _topCellBorder$right === void 0 ? void 0 : _topCellBorder$right.style) === BorderStyleTypes.DOUBLE || ((_topRightCellBorder$l = topRightCellBorder.left) === null || _topRightCellBorder$l === void 0 ? void 0 : _topRightCellBorder$l.style) === BorderStyleTypes.DOUBLE) || type === "b" && (((_bottomCellBorder$rig = bottomCellBorder.right) === null || _bottomCellBorder$rig === void 0 ? void 0 : _bottomCellBorder$rig.style) === BorderStyleTypes.DOUBLE || ((_bottomRightCellBorde = bottomRightCellBorder.left) === null || _bottomRightCellBorde === void 0 ? void 0 : _bottomRightCellBorde.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.endXOffset = -defaultOffset;
5205
+ else if (type === "t" && topRightCellBorder.left && topRightCellBorder.left.style !== BorderStyleTypes.DOUBLE || type === "b" && bottomRightCellBorder.left && bottomRightCellBorder.left.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.endXOffset = 0;
5217
5206
  else outerLineOffsets.endXOffset = defaultOffset;
5218
5207
  innerLineOffsets.endXOffset = defaultOffset;
5219
5208
  }
5220
5209
  clearLine.startX = startX - defaultOffset;
5221
5210
  clearLine.endX = endX + defaultOffset;
5222
5211
  clearMiddleLine(clearLine);
5223
- if (type === BORDER_TYPE.TOP && !topCellBorder.bottom || type === BORDER_TYPE.BOTTOM && !bottomCellBorder.top) drawOuterLine(outerLineOffsets);
5212
+ if (type === "t" && !topCellBorder.bottom || type === "b" && !bottomCellBorder.top) drawOuterLine(outerLineOffsets);
5224
5213
  drawInnerLine(innerLineOffsets);
5225
5214
  }
5226
5215
  }
@@ -5231,10 +5220,10 @@ var Border = class extends SheetExtension {
5231
5220
  let top = null;
5232
5221
  let bottom = null;
5233
5222
  if (cellBorder) {
5234
- if (cellBorder[BORDER_TYPE.LEFT] && Object.prototype.hasOwnProperty.call(cellBorder[BORDER_TYPE.LEFT], "type")) left = cellBorder[BORDER_TYPE.LEFT];
5235
- if (cellBorder[BORDER_TYPE.RIGHT] && Object.prototype.hasOwnProperty.call(cellBorder[BORDER_TYPE.RIGHT], "type")) right = cellBorder[BORDER_TYPE.RIGHT];
5236
- if (cellBorder[BORDER_TYPE.TOP] && Object.prototype.hasOwnProperty.call(cellBorder[BORDER_TYPE.TOP], "type")) top = cellBorder[BORDER_TYPE.TOP];
5237
- if (cellBorder[BORDER_TYPE.BOTTOM] && Object.prototype.hasOwnProperty.call(cellBorder[BORDER_TYPE.BOTTOM], "type")) bottom = cellBorder[BORDER_TYPE.BOTTOM];
5223
+ if (cellBorder["l"] && Object.prototype.hasOwnProperty.call(cellBorder["l"], "type")) left = cellBorder["l"];
5224
+ if (cellBorder["r"] && Object.prototype.hasOwnProperty.call(cellBorder["r"], "type")) right = cellBorder["r"];
5225
+ if (cellBorder["t"] && Object.prototype.hasOwnProperty.call(cellBorder["t"], "type")) top = cellBorder["t"];
5226
+ if (cellBorder["b"] && Object.prototype.hasOwnProperty.call(cellBorder["b"], "type")) bottom = cellBorder["b"];
5238
5227
  }
5239
5228
  return {
5240
5229
  left,
@@ -5493,30 +5482,8 @@ SpreadsheetExtensionRegistry.add(Custom);
5493
5482
 
5494
5483
  //#endregion
5495
5484
  //#region src/components/docs/layout/line-breaker/break.ts
5496
- /**
5497
- * Copyright 2023-present DreamNum Co., Ltd.
5498
- *
5499
- * Licensed under the Apache License, Version 2.0 (the "License");
5500
- * you may not use this file except in compliance with the License.
5501
- * You may obtain a copy of the License at
5502
- *
5503
- * http://www.apache.org/licenses/LICENSE-2.0
5504
- *
5505
- * Unless required by applicable law or agreed to in writing, software
5506
- * distributed under the License is distributed on an "AS IS" BASIS,
5507
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5508
- * See the License for the specific language governing permissions and
5509
- * limitations under the License.
5510
- */
5511
- let BreakPointType = /* @__PURE__ */ function(BreakPointType) {
5512
- BreakPointType["Normal"] = "Normal";
5513
- BreakPointType["Mandatory"] = "Mandatory";
5514
- BreakPointType["Hyphen"] = "Hyphen";
5515
- BreakPointType["Link"] = "Link";
5516
- return BreakPointType;
5517
- }({});
5518
5485
  var Break = class {
5519
- constructor(position, type = BreakPointType.Normal) {
5486
+ constructor(position, type = "Normal") {
5520
5487
  this.position = position;
5521
5488
  this.type = type;
5522
5489
  }
@@ -11194,7 +11161,7 @@ var LineBreaker = class {
11194
11161
  this._nextClass = this._nextCharClass();
11195
11162
  if (this._curClass === 34 || this._curClass === 36 && this._nextClass !== 37) {
11196
11163
  this._curClass = mapFirst(mapClass(this._nextClass));
11197
- return new Break(this._lastPos, BreakPointType.Mandatory);
11164
+ return new Break(this._lastPos, "Mandatory");
11198
11165
  }
11199
11166
  if (this._rule.shouldBreak(this._codePoint, this._lastCodePoint, this._nextClass)) {
11200
11167
  this._curClass = mapFirst(mapClass(this._nextClass));
@@ -11344,100 +11311,115 @@ var DocSimpleSkeleton = class {
11344
11311
  while (true) {
11345
11312
  const breakPoint = this._lineBreaker.nextBreakPoint();
11346
11313
  if (!breakPoint) break;
11347
- const { position } = breakPoint;
11348
- const text = this._text.slice(lastPosition, position);
11349
- const textSize = FontCache.getMeasureText(text, this._fontStyle);
11350
- if (textSize.width + currentLine.width > this._width) if (textSize.width > this._width) {
11351
- if (currentLine.text.length > 0) {
11314
+ const { position, type } = breakPoint;
11315
+ const rawText = this._text.slice(lastPosition, position);
11316
+ const isMandatoryBreak = type === "Mandatory";
11317
+ const text = isMandatoryBreak ? rawText.replace(/[\r\n]+$/, "") : rawText;
11318
+ if (text.length > 0) {
11319
+ const textSize = FontCache.getMeasureText(text, this._fontStyle);
11320
+ if (textSize.width + currentLine.width > this._width) if (textSize.width > this._width) {
11321
+ if (currentLine.text.length > 0) {
11322
+ this._lines.push(currentLine);
11323
+ totalHeight += currentLine.height;
11324
+ if (totalHeight > this._height) break;
11325
+ currentLine = {
11326
+ text: "",
11327
+ width: 0,
11328
+ height: 0,
11329
+ baseline: 0
11330
+ };
11331
+ }
11332
+ let remainingText = text;
11333
+ while (remainingText.length > 0) {
11334
+ let charCount = 0;
11335
+ let lineText = "";
11336
+ let lineWidth = 0;
11337
+ let startGuess = Math.min(this._lastBreakLength, remainingText.length);
11338
+ if (startGuess === 0) startGuess = Math.min(10, remainingText.length);
11339
+ let testText = remainingText.slice(0, startGuess);
11340
+ let testSize = FontCache.getMeasureText(testText, this._fontStyle);
11341
+ if (testSize.width + currentLine.width <= this._width) {
11342
+ charCount = startGuess;
11343
+ for (let i = startGuess + 1; i <= remainingText.length; i++) {
11344
+ testText = remainingText.slice(0, i);
11345
+ testSize = FontCache.getMeasureText(testText, this._fontStyle);
11346
+ if (testSize.width + currentLine.width <= this._width) charCount = i;
11347
+ else break;
11348
+ }
11349
+ } else {
11350
+ charCount = 0;
11351
+ for (let i = startGuess - 1; i >= 1; i--) {
11352
+ testText = remainingText.slice(0, i);
11353
+ testSize = FontCache.getMeasureText(testText, this._fontStyle);
11354
+ if (testSize.width + currentLine.width <= this._width) {
11355
+ charCount = i;
11356
+ break;
11357
+ }
11358
+ }
11359
+ }
11360
+ if (charCount > 0) this._lastBreakLength = charCount;
11361
+ if (charCount > 0) {
11362
+ lineText = remainingText.slice(0, charCount);
11363
+ lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
11364
+ }
11365
+ if (charCount === 0 && currentLine.text.length === 0) {
11366
+ charCount = 1;
11367
+ lineText = remainingText[0];
11368
+ lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
11369
+ }
11370
+ if (charCount > 0) {
11371
+ currentLine.text += lineText;
11372
+ currentLine.width += lineWidth;
11373
+ const textSize = FontCache.getMeasureText(currentLine.text, this._fontStyle);
11374
+ currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
11375
+ currentLine.baseline = textSize.fontBoundingBoxAscent;
11376
+ remainingText = remainingText.slice(charCount);
11377
+ if (remainingText.length > 0) {
11378
+ this._lines.push(currentLine);
11379
+ totalHeight += currentLine.height;
11380
+ if (totalHeight > this._height) break;
11381
+ currentLine = {
11382
+ text: "",
11383
+ width: 0,
11384
+ height: 0,
11385
+ baseline: 0
11386
+ };
11387
+ }
11388
+ } else break;
11389
+ }
11390
+ } else if (currentLine.text.length > 0) {
11352
11391
  this._lines.push(currentLine);
11353
11392
  totalHeight += currentLine.height;
11354
11393
  if (totalHeight > this._height) break;
11355
11394
  currentLine = {
11356
- text: "",
11357
- width: 0,
11358
- height: 0,
11359
- baseline: 0
11395
+ text,
11396
+ width: textSize.width,
11397
+ height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
11398
+ baseline: textSize.fontBoundingBoxAscent
11360
11399
  };
11400
+ } else currentLine = {
11401
+ text,
11402
+ width: textSize.width,
11403
+ height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
11404
+ baseline: textSize.fontBoundingBoxAscent
11405
+ };
11406
+ else {
11407
+ currentLine.text = currentLine.text + text;
11408
+ currentLine.width = currentLine.width + textSize.width;
11409
+ currentLine.baseline = textSize.fontBoundingBoxAscent;
11410
+ currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
11361
11411
  }
11362
- let remainingText = text;
11363
- while (remainingText.length > 0) {
11364
- let charCount = 0;
11365
- let lineText = "";
11366
- let lineWidth = 0;
11367
- let startGuess = Math.min(this._lastBreakLength, remainingText.length);
11368
- if (startGuess === 0) startGuess = Math.min(10, remainingText.length);
11369
- let testText = remainingText.slice(0, startGuess);
11370
- let testSize = FontCache.getMeasureText(testText, this._fontStyle);
11371
- if (testSize.width + currentLine.width <= this._width) {
11372
- charCount = startGuess;
11373
- for (let i = startGuess + 1; i <= remainingText.length; i++) {
11374
- testText = remainingText.slice(0, i);
11375
- testSize = FontCache.getMeasureText(testText, this._fontStyle);
11376
- if (testSize.width + currentLine.width <= this._width) charCount = i;
11377
- else break;
11378
- }
11379
- } else {
11380
- charCount = 0;
11381
- for (let i = startGuess - 1; i >= 1; i--) {
11382
- testText = remainingText.slice(0, i);
11383
- testSize = FontCache.getMeasureText(testText, this._fontStyle);
11384
- if (testSize.width + currentLine.width <= this._width) {
11385
- charCount = i;
11386
- break;
11387
- }
11388
- }
11389
- }
11390
- if (charCount > 0) this._lastBreakLength = charCount;
11391
- if (charCount > 0) {
11392
- lineText = remainingText.slice(0, charCount);
11393
- lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
11394
- }
11395
- if (charCount === 0 && currentLine.text.length === 0) {
11396
- charCount = 1;
11397
- lineText = remainingText[0];
11398
- lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
11399
- }
11400
- if (charCount > 0) {
11401
- currentLine.text += lineText;
11402
- currentLine.width += lineWidth;
11403
- const textSize = FontCache.getMeasureText(currentLine.text, this._fontStyle);
11404
- currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
11405
- currentLine.baseline = textSize.fontBoundingBoxAscent;
11406
- remainingText = remainingText.slice(charCount);
11407
- if (remainingText.length > 0) {
11408
- this._lines.push(currentLine);
11409
- totalHeight += currentLine.height;
11410
- if (totalHeight > this._height) break;
11411
- currentLine = {
11412
- text: "",
11413
- width: 0,
11414
- height: 0,
11415
- baseline: 0
11416
- };
11417
- }
11418
- } else break;
11419
- }
11420
- } else if (currentLine.text.length > 0) {
11412
+ }
11413
+ if (isMandatoryBreak) {
11421
11414
  this._lines.push(currentLine);
11422
11415
  totalHeight += currentLine.height;
11423
11416
  if (totalHeight > this._height) break;
11424
11417
  currentLine = {
11425
- text,
11426
- width: textSize.width,
11427
- height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
11428
- baseline: textSize.fontBoundingBoxAscent
11418
+ text: "",
11419
+ width: 0,
11420
+ height: 0,
11421
+ baseline: 0
11429
11422
  };
11430
- } else currentLine = {
11431
- text,
11432
- width: textSize.width,
11433
- height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
11434
- baseline: textSize.fontBoundingBoxAscent
11435
- };
11436
- else {
11437
- currentLine.text = currentLine.text + text;
11438
- currentLine.width = currentLine.width + textSize.width;
11439
- currentLine.baseline = textSize.fontBoundingBoxAscent;
11440
- currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
11441
11423
  }
11442
11424
  lastPosition = position;
11443
11425
  }
@@ -11513,8 +11495,8 @@ var Shape = class extends BaseObject {
11513
11495
  _defineProperty(this, "_strokeDashArray", void 0);
11514
11496
  _defineProperty(this, "_strokeDashOffset", 0);
11515
11497
  _defineProperty(this, "_strokeMiterLimit", 0);
11516
- _defineProperty(this, "_type", SHAPE_TYPE.RECT);
11517
- _defineProperty(this, "objectType", ObjectType.SHAPE);
11498
+ _defineProperty(this, "_type", "rect");
11499
+ _defineProperty(this, "objectType", 2);
11518
11500
  this._initialProps(props);
11519
11501
  }
11520
11502
  get hoverCursor() {
@@ -11978,12 +11960,12 @@ var Liquid = class {
11978
11960
  const { marginTop: pagePaddingTop = 0, marginBottom: _pagePaddingBottom = 0, marginLeft: pagePaddingLeft = 0, marginRight: _pagePaddingRight = 0 } = page;
11979
11961
  this.translate(-pagePaddingLeft, -pagePaddingTop);
11980
11962
  }
11981
- translatePage(page, type = PageLayoutType.VERTICAL, left = 0, top = 0, _right = 0, _bottom = 0) {
11963
+ translatePage(page, type = 0, left = 0, top = 0, _right = 0, _bottom = 0) {
11982
11964
  const { pageWidth, pageHeight } = page;
11983
11965
  let pageTop = 0;
11984
11966
  let pageLeft = 0;
11985
- if (type === PageLayoutType.VERTICAL) pageTop += pageHeight + top;
11986
- else if (type === PageLayoutType.HORIZONTAL) pageLeft += pageWidth + left;
11967
+ if (type === 0) pageTop += pageHeight + top;
11968
+ else if (type === 1) pageLeft += pageWidth + left;
11987
11969
  this.translate(pageLeft, pageTop);
11988
11970
  return {
11989
11971
  x: pageLeft,
@@ -12288,7 +12270,7 @@ var DocumentViewModel = class DocumentViewModel {
12288
12270
  _defineProperty(this, "_tableCache", /* @__PURE__ */ new Map());
12289
12271
  _defineProperty(this, "_tableNodeCache", /* @__PURE__ */ new Map());
12290
12272
  _defineProperty(this, "_children", []);
12291
- _defineProperty(this, "_editArea", DocumentEditArea.BODY);
12273
+ _defineProperty(this, "_editArea", "BODY");
12292
12274
  _defineProperty(this, "_editAreaChange$", new BehaviorSubject(null));
12293
12275
  _defineProperty(this, "editAreaChange$", this._editAreaChange$.asObservable());
12294
12276
  _defineProperty(this, "_headerTreeMap", /* @__PURE__ */ new Map());
@@ -12528,16 +12510,16 @@ function baseAdjustability(content, width) {
12528
12510
  };
12529
12511
  }
12530
12512
  function createSkeletonWordGlyph(content, config, glyphWidth) {
12531
- return _createSkeletonWordOrLetter(GlyphType.WORD, content, config, glyphWidth);
12513
+ return _createSkeletonWordOrLetter(1, content, config, glyphWidth);
12532
12514
  }
12533
12515
  function createSkeletonLetterGlyph(content, config, glyphWidth, glyphInfo) {
12534
- return _createSkeletonWordOrLetter(GlyphType.LETTER, content, config, glyphWidth, glyphInfo);
12516
+ return _createSkeletonWordOrLetter(0, content, config, glyphWidth, glyphInfo);
12535
12517
  }
12536
12518
  function createSkeletonTabGlyph(config, glyphWidth) {
12537
- return _createSkeletonWordOrLetter(GlyphType.TAB, DataStreamTreeTokenType.TAB, config, glyphWidth);
12519
+ return _createSkeletonWordOrLetter(4, DataStreamTreeTokenType.TAB, config, glyphWidth);
12538
12520
  }
12539
12521
  function createHyphenDashGlyph(config) {
12540
- const dashLetterGlyph = _createSkeletonWordOrLetter(GlyphType.LETTER, "-", config);
12522
+ const dashLetterGlyph = _createSkeletonWordOrLetter(0, "-", config);
12541
12523
  dashLetterGlyph.count = 0;
12542
12524
  return dashLetterGlyph;
12543
12525
  }
@@ -12566,7 +12548,7 @@ function createSkeletonCustomBlockGlyph(config, glyphWidth = 0, glyphHeight = 0,
12566
12548
  left: 0,
12567
12549
  isJustifiable: false,
12568
12550
  adjustability: baseAdjustability(content, 0),
12569
- glyphType: GlyphType.PLACEHOLDER,
12551
+ glyphType: 3,
12570
12552
  streamType: content,
12571
12553
  count: 1,
12572
12554
  drawingId
@@ -12612,7 +12594,7 @@ function _createSkeletonWordOrLetter(glyphType, content, config, glyphWidth, gly
12612
12594
  left: 0,
12613
12595
  isJustifiable: false,
12614
12596
  adjustability: baseAdjustability(content, 0),
12615
- glyphType: GlyphType.PLACEHOLDER,
12597
+ glyphType: 3,
12616
12598
  streamType: content,
12617
12599
  count: 1
12618
12600
  };
@@ -12680,7 +12662,7 @@ function createSkeletonBulletGlyph(glyph, bulletSkeleton, charSpaceApply) {
12680
12662
  left,
12681
12663
  isJustifiable: isJustifiable(content),
12682
12664
  adjustability: baseAdjustability(content, width),
12683
- glyphType: GlyphType.LIST,
12665
+ glyphType: 2,
12684
12666
  streamType: DataStreamTreeTokenType.LETTER,
12685
12667
  count: 0,
12686
12668
  raw: content
@@ -12718,17 +12700,6 @@ function glyphShrinkLeft(glyph, amount) {
12718
12700
 
12719
12701
  //#endregion
12720
12702
  //#region src/components/docs/layout/model/line.ts
12721
- var WrapTextRuler = /* @__PURE__ */ function(WrapTextRuler) {
12722
- WrapTextRuler[WrapTextRuler["BOTH"] = 0] = "BOTH";
12723
- WrapTextRuler[WrapTextRuler["LEFT"] = 1] = "LEFT";
12724
- WrapTextRuler[WrapTextRuler["RIGHT"] = 2] = "RIGHT";
12725
- return WrapTextRuler;
12726
- }(WrapTextRuler || {});
12727
- var AxisType = /* @__PURE__ */ function(AxisType) {
12728
- AxisType[AxisType["X"] = 0] = "X";
12729
- AxisType[AxisType["Y"] = 1] = "Y";
12730
- return AxisType;
12731
- }(AxisType || {});
12732
12703
  function createSkeletonLine(paragraphIndex, lineType, lineBoundingBox, columnWidth, lineIndex = 0, isParagraphStart = false, paragraphConfig, page, headerPage, footerPage) {
12733
12704
  var _page$skeDrawings, _page$skeTables;
12734
12705
  const { lineHeight = 15.6, lineTop = 0, contentHeight = 0, paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0, marginTop = 0, spaceBelowApply = 0 } = lineBoundingBox;
@@ -12920,11 +12891,11 @@ function __getCrossPoint(points, lineTop, lineHeight, columnWidth) {
12920
12891
  width: range.max
12921
12892
  };
12922
12893
  }
12923
- function ___getMaxAndMinAxis(points, axis = AxisType.X) {
12894
+ function ___getMaxAndMinAxis(points, axis = 0) {
12924
12895
  const result = [];
12925
12896
  for (let i = 0; i < points.length; i++) {
12926
12897
  const point = points[i];
12927
- if (axis === AxisType.X) result.push(point.x);
12898
+ if (axis === 0) result.push(point.x);
12928
12899
  else result.push(point.y);
12929
12900
  }
12930
12901
  return {
@@ -12939,8 +12910,8 @@ function __getSplitWidthNoAngle(top, height, left, width, lineTop, lineHeight, c
12939
12910
  let resultLeft = left - distL;
12940
12911
  let resultWidth = width + distL + distR;
12941
12912
  const ruler = ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth);
12942
- if (ruler === WrapTextRuler.LEFT) resultWidth = columnWidth - resultLeft;
12943
- else if (ruler === WrapTextRuler.RIGHT) {
12913
+ if (ruler === 1) resultWidth = columnWidth - resultLeft;
12914
+ else if (ruler === 2) {
12944
12915
  resultLeft = 0;
12945
12916
  resultWidth = left + width + distR;
12946
12917
  }
@@ -12950,11 +12921,11 @@ function __getSplitWidthNoAngle(top, height, left, width, lineTop, lineHeight, c
12950
12921
  };
12951
12922
  }
12952
12923
  function ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth) {
12953
- let ruler = WrapTextRuler.BOTH;
12954
- if (wrapText === WrapTextType.LEFT) ruler = WrapTextRuler.LEFT;
12955
- else if (wrapText === WrapTextType.RIGHT) ruler = WrapTextRuler.RIGHT;
12956
- else if (wrapText === WrapTextType.LARGEST) if (resultLeft > columnWidth - resultLeft - resultWidth) ruler = WrapTextRuler.LEFT;
12957
- else ruler = WrapTextRuler.RIGHT;
12924
+ let ruler = 0;
12925
+ if (wrapText === WrapTextType.LEFT) ruler = 1;
12926
+ else if (wrapText === WrapTextType.RIGHT) ruler = 2;
12927
+ else if (wrapText === WrapTextType.LARGEST) if (resultLeft > columnWidth - resultLeft - resultWidth) ruler = 1;
12928
+ else ruler = 2;
12958
12929
  return ruler;
12959
12930
  }
12960
12931
  function _calculateDivideByDrawings(columnWidth, drawingSplit) {
@@ -13361,7 +13332,7 @@ function getTableIdAndSliceIndex(tableSliceId) {
13361
13332
 
13362
13333
  //#endregion
13363
13334
  //#region src/components/docs/layout/block/paragraph/layout-ruler.ts
13364
- function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = BreakPointType.Normal) {
13335
+ function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal") {
13365
13336
  if (isParagraphFirstShapedText) if (paragraphConfig.bulletSkeleton) {
13366
13337
  const { bulletSkeleton, paragraphStyle = {} } = paragraphConfig;
13367
13338
  const { gridType = GridType.LINES, charSpace = 0, defaultTabStop = 10.5 } = sectionBreakConfig;
@@ -13408,7 +13379,7 @@ function _getConsecutiveHyphenLineCount(divide) {
13408
13379
  let count = 0;
13409
13380
  for (let i = column.lines.length - 1; i >= 0; i--) {
13410
13381
  const line = column.lines[i];
13411
- if (line.divides[line.divides.length - 1].breakType === BreakPointType.Hyphen) count++;
13382
+ if (line.divides[line.divides.length - 1].breakType === "Hyphen") count++;
13412
13383
  else break;
13413
13384
  }
13414
13385
  return count;
@@ -13426,7 +13397,7 @@ function _popHyphenSlice(divide) {
13426
13397
  }
13427
13398
  return glyphGroup;
13428
13399
  }
13429
- function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = BreakPointType.Normal, defaultSpanLineHeight) {
13400
+ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
13430
13401
  const divideInfo = getLastNotFullDivideInfo(getLastPage(pages));
13431
13402
  if (divideInfo) {
13432
13403
  var _divide$glyphGroup;
@@ -13455,12 +13426,12 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
13455
13426
  } else if (hyphenLineCount > consecutiveHyphenLimit) {
13456
13427
  const hyphenSliceGlyphGroup = _popHyphenSlice(divide);
13457
13428
  if (hyphenSliceGlyphGroup.length > 0) {
13458
- updateDivideInfo(divide, { breakType: BreakPointType.Normal });
13459
- _divideOperator(ctx, hyphenSliceGlyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, BreakPointType.Hyphen);
13429
+ updateDivideInfo(divide, { breakType: "Normal" });
13430
+ _divideOperator(ctx, hyphenSliceGlyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, "Hyphen");
13460
13431
  }
13461
13432
  _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
13462
13433
  } else _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
13463
- } else if (isLast && hyphenationZone && hyphenationZone > 0 && preOffsetLeft >= divide.width - hyphenationZone && breakPointType === BreakPointType.Hyphen && divide.breakType === BreakPointType.Normal) {
13434
+ } else if (isLast && hyphenationZone && hyphenationZone > 0 && preOffsetLeft >= divide.width - hyphenationZone && breakPointType === "Hyphen" && divide.breakType === "Normal") {
13464
13435
  updateDivideInfo(divide, { isFull: true });
13465
13436
  _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
13466
13437
  } else {
@@ -13475,7 +13446,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
13475
13446
  const spanGroupCachedLen = spanGroupCached.length;
13476
13447
  let newGlyphGroup = [];
13477
13448
  let startIndex = 1;
13478
- if (spanGroupCachedLen > 2 && spanGroupCached[0].glyphType === GlyphType.LIST) {
13449
+ if (spanGroupCachedLen > 2 && spanGroupCached[0].glyphType === 2) {
13479
13450
  newGlyphGroup = [spanGroupCached[0], spanGroupCached[1]];
13480
13451
  startIndex = 2;
13481
13452
  } else newGlyphGroup = [spanGroupCached[0]];
@@ -13491,7 +13462,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
13491
13462
  }
13492
13463
  } else _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
13493
13464
  }
13494
- function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = BreakPointType.Normal, defaultGlyphLineHeight) {
13465
+ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultGlyphLineHeight) {
13495
13466
  var _originParagraphStyle, _originParagraphStyle2, _skeHeaders$get, _skeFooters$get;
13496
13467
  let lastPage = getLastPage(pages);
13497
13468
  let columnInfo = getLastNotFullColumnInfo(lastPage);
@@ -13568,7 +13539,7 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
13568
13539
  paddingLeft = column.width * leftPercent - .5;
13569
13540
  paddingRight = column.width - paddingLeft - .5;
13570
13541
  }
13571
- const newLine = createSkeletonLine(paragraphIndex, LineType.PARAGRAPH, {
13542
+ const newLine = createSkeletonLine(paragraphIndex, 0, {
13572
13543
  lineHeight,
13573
13544
  contentHeight,
13574
13545
  lineTop: newLineTop,
@@ -13601,7 +13572,7 @@ function __updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDra
13601
13572
  width,
13602
13573
  height,
13603
13574
  angle,
13604
- type: FloatObjectType.IMAGE,
13575
+ type: "IMAGE",
13605
13576
  positionV
13606
13577
  };
13607
13578
  }), column, paragraphIndex);
@@ -13619,7 +13590,7 @@ function __updateWrapTablePosition(ctx, table, lineTop, lineHeight, column, para
13619
13590
  width,
13620
13591
  height,
13621
13592
  angle: 0,
13622
- type: FloatObjectType.TABLE,
13593
+ type: "TABLE",
13623
13594
  positionV: tableSource.position.positionV
13624
13595
  }], column, paragraphIndex);
13625
13596
  table.top = top;
@@ -13775,11 +13746,11 @@ function checkRelativeDrawingNeedRePosition(ctx, floatObject) {
13775
13746
  }
13776
13747
  return false;
13777
13748
  }
13778
- function _columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = BreakPointType.Normal, defaultSpanLineHeight) {
13749
+ function _columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
13779
13750
  if (isColumnFull(getLastPage(pages)) === true) _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
13780
13751
  else _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
13781
13752
  }
13782
- function _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = BreakPointType.Normal, defaultSpanLineHeight) {
13753
+ function _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
13783
13754
  const curSkeletonPage = getLastPage(pages);
13784
13755
  const { skeHeaders, skeFooters } = paragraphConfig;
13785
13756
  pages.push(createSkeletonPage(ctx, sectionBreakConfig, {
@@ -14136,7 +14107,7 @@ function updateBlockIndex(pages, start = -1) {
14136
14107
  const divStartIndex = preDivideStartIndex;
14137
14108
  let divEndIndex = divStartIndex;
14138
14109
  for (const glyph of glyphGroup) {
14139
- const increaseValue = glyph.glyphType === GlyphType.LIST ? 0 : glyph.count;
14110
+ const increaseValue = glyph.glyphType === 2 ? 0 : glyph.count;
14140
14111
  divEndIndex += increaseValue;
14141
14112
  const { ba, bd } = glyph.bBox;
14142
14113
  maxLineAsc = Math.max(maxLineAsc, ba);
@@ -14402,11 +14373,6 @@ function getNullSkeleton() {
14402
14373
  function setPageParent(pages, parent) {
14403
14374
  for (const page of pages) page.parent = parent;
14404
14375
  }
14405
- let FloatObjectType = /* @__PURE__ */ function(FloatObjectType) {
14406
- FloatObjectType["IMAGE"] = "IMAGE";
14407
- FloatObjectType["TABLE"] = "TABLE";
14408
- return FloatObjectType;
14409
- }({});
14410
14376
  const DEFAULT_SECTION_BREAK = {
14411
14377
  columnProperties: [],
14412
14378
  columnSeparatorType: ColumnSeparatorType.NONE,
@@ -14554,7 +14520,7 @@ function getPageFromPath(skeletonData, path) {
14554
14520
  function getHeaderFooterMaxHeight(pageHeight) {
14555
14521
  return (pageHeight - 100) / 2;
14556
14522
  }
14557
- function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, pageNumber = 1, breakType = BreakType.SECTION) {
14523
+ function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, pageNumber = 1, breakType = 0) {
14558
14524
  const page = _getNullPage();
14559
14525
  const { pageNumberStart = 1, pageSize = {
14560
14526
  width: Number.POSITIVE_INFINITY,
@@ -14624,7 +14590,7 @@ function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference,
14624
14590
  sections.push(newSection);
14625
14591
  return page;
14626
14592
  }
14627
- function _getNullPage(type = DocumentSkeletonPageType.BODY, segmentId = "") {
14593
+ function _getNullPage(type = 0, segmentId = "") {
14628
14594
  return {
14629
14595
  sections: [],
14630
14596
  headerId: "",
@@ -14645,7 +14611,7 @@ function _getNullPage(type = DocumentSkeletonPageType.BODY, segmentId = "") {
14645
14611
  marginTop: 0,
14646
14612
  originMarginBottom: 0,
14647
14613
  marginBottom: 0,
14648
- breakType: BreakType.SECTION,
14614
+ breakType: 0,
14649
14615
  st: 0,
14650
14616
  ed: 0,
14651
14617
  skeDrawings: /* @__PURE__ */ new Map(),
@@ -14671,7 +14637,7 @@ function _createSkeletonHeaderFooter(ctx, headerOrFooterViewModel, sectionBreakC
14671
14637
  };
14672
14638
  if (areaPage == null) {
14673
14639
  areaPage = createSkeletonPage(ctx, headerFooterConfig, skeletonResourceReference);
14674
- areaPage.type = isHeader ? DocumentSkeletonPageType.HEADER : DocumentSkeletonPageType.FOOTER;
14640
+ areaPage.type = isHeader ? 1 : 2;
14675
14641
  areaPage.segmentId = segmentId;
14676
14642
  }
14677
14643
  const layoutAnchor = ctx.layoutStartPointer[segmentId];
@@ -14720,7 +14686,7 @@ function createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, avai
14720
14686
  width: pageWidth,
14721
14687
  height: Number.isFinite(availableHeight) ? availableHeight : pageHeight
14722
14688
  } }), skeletonResourceReference);
14723
- areaPage.type = DocumentSkeletonPageType.CELL;
14689
+ areaPage.type = 3;
14724
14690
  areaPage.segmentId = tableId;
14725
14691
  return {
14726
14692
  page: areaPage,
@@ -14732,7 +14698,7 @@ function createSkeletonCellPages(ctx, viewModel, cellNode, sectionBreakConfig, t
14732
14698
  const { page: areaPage, sectionBreakConfig: cellSectionBreakConfig } = createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, availableHeight, maxCellPageHeight);
14733
14699
  const { pages } = dealWithSection(ctx, viewModel, sectionNode, areaPage, cellSectionBreakConfig);
14734
14700
  for (const p of pages) {
14735
- p.type = DocumentSkeletonPageType.CELL;
14701
+ p.type = 3;
14736
14702
  p.segmentId = tableConfig.tableId;
14737
14703
  }
14738
14704
  updateBlockIndex(pages, cellNode.startIndex);
@@ -14931,7 +14897,7 @@ function addHyphenDash(line, viewModel, paragraphNode, sectionBreakConfig, parag
14931
14897
  for (const divide of line.divides) {
14932
14898
  const { glyphGroup, breakType } = divide;
14933
14899
  const lastGlyph = glyphGroup[glyphGroup.length - 1];
14934
- if (lastGlyph && isLetter(lastGlyph.content) && breakType === BreakPointType.Hyphen) {
14900
+ if (lastGlyph && isLetter(lastGlyph.content) && breakType === "Hyphen") {
14935
14901
  const hyphenDashGlyph = createHyphenDashGlyph(getFontConfigFromLastGlyph(lastGlyph, sectionBreakConfig, paragraphStyle));
14936
14902
  hyphenDashGlyph.parent = lastGlyph.parent;
14937
14903
  hyphenDashGlyph.left = lastGlyph.left + lastGlyph.width;
@@ -15256,7 +15222,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
15256
15222
  };
15257
15223
  if (text.endsWith(DataStreamTreeTokenType.PAGE_BREAK)) {
15258
15224
  pushPending();
15259
- allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(allPages[allPages.length - 1]), BreakType.PAGE));
15225
+ allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(allPages[allPages.length - 1]), 1));
15260
15226
  paragraphNonInlineSkeDrawings.clear();
15261
15227
  paragraphInlineSkeDrawings.clear();
15262
15228
  continue;
@@ -15265,7 +15231,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
15265
15231
  const lastPage = allPages[allPages.length - 1];
15266
15232
  const columnInfo = getLastNotFullColumnInfo(lastPage);
15267
15233
  if (columnInfo && !columnInfo.isLast) setColumnFullState(columnInfo.column, true);
15268
- else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), BreakType.COLUMN));
15234
+ else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), 2));
15269
15235
  continue;
15270
15236
  }
15271
15237
  pushPending();
@@ -15273,106 +15239,6 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
15273
15239
  return allPages;
15274
15240
  }
15275
15241
 
15276
- //#endregion
15277
- //#region src/components/docs/layout/hyphenation/lang.ts
15278
- /**
15279
- * Copyright 2023-present DreamNum Co., Ltd.
15280
- *
15281
- * Licensed under the Apache License, Version 2.0 (the "License");
15282
- * you may not use this file except in compliance with the License.
15283
- * You may obtain a copy of the License at
15284
- *
15285
- * http://www.apache.org/licenses/LICENSE-2.0
15286
- *
15287
- * Unless required by applicable law or agreed to in writing, software
15288
- * distributed under the License is distributed on an "AS IS" BASIS,
15289
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15290
- * See the License for the specific language governing permissions and
15291
- * limitations under the License.
15292
- */
15293
- let Lang = /* @__PURE__ */ function(Lang) {
15294
- Lang["Af"] = "af";
15295
- Lang["As"] = "as";
15296
- Lang["Be"] = "be";
15297
- Lang["Bg"] = "bg";
15298
- Lang["Bn"] = "bn";
15299
- Lang["Ca"] = "ca";
15300
- Lang["Cop"] = "cop";
15301
- Lang["Cs"] = "cs";
15302
- Lang["Cu"] = "cu";
15303
- Lang["Cy"] = "cy";
15304
- Lang["Da"] = "da";
15305
- Lang["De1901"] = "de-1901";
15306
- Lang["De1996"] = "de-1996";
15307
- Lang["DeCh1901"] = "de-ch-1901";
15308
- Lang["ElMonoton"] = "el-monoton";
15309
- Lang["ElPolyton"] = "el-polyton";
15310
- Lang["EnGb"] = "en-gb";
15311
- Lang["EnUs"] = "en-us";
15312
- Lang["Es"] = "es";
15313
- Lang["Et"] = "et";
15314
- Lang["Eu"] = "eu";
15315
- Lang["Fi"] = "fi";
15316
- Lang["Fr"] = "fr";
15317
- Lang["Fur"] = "fur";
15318
- Lang["Ga"] = "ga";
15319
- Lang["Gl"] = "gl";
15320
- Lang["Grc"] = "grc";
15321
- Lang["Gu"] = "gu";
15322
- Lang["Hi"] = "hi";
15323
- Lang["Hr"] = "hr";
15324
- Lang["Hsb"] = "hsb";
15325
- Lang["Hu"] = "hu";
15326
- Lang["Hy"] = "hy";
15327
- Lang["Ia"] = "ia";
15328
- Lang["Id"] = "id";
15329
- Lang["Is"] = "is";
15330
- Lang["It"] = "it";
15331
- Lang["Ka"] = "ka";
15332
- Lang["Kmr"] = "kmr";
15333
- Lang["Kn"] = "kn";
15334
- Lang["LaXClassic"] = "la-x-classic";
15335
- Lang["LaXLiturgic"] = "la-x-liturgic";
15336
- Lang["La"] = "la";
15337
- Lang["Lt"] = "lt";
15338
- Lang["Lv"] = "lv";
15339
- Lang["Ml"] = "ml";
15340
- Lang["MnCyrlXLmc"] = "mn-cyrl-x-lmc";
15341
- Lang["MnCyrl"] = "mn-cyrl";
15342
- Lang["Mr"] = "mr";
15343
- Lang["MulEthi"] = "mul-ethi";
15344
- Lang["Nb"] = "nb";
15345
- Lang["Nl"] = "nl";
15346
- Lang["Nn"] = "nn";
15347
- Lang["No"] = "no";
15348
- Lang["Oc"] = "oc";
15349
- Lang["Or"] = "or";
15350
- Lang["Pa"] = "pa";
15351
- Lang["Pi"] = "pi";
15352
- Lang["Pl"] = "pl";
15353
- Lang["Pms"] = "pms";
15354
- Lang["Pt"] = "pt";
15355
- Lang["Rm"] = "rm";
15356
- Lang["Ro"] = "ro";
15357
- Lang["Ru"] = "ru";
15358
- Lang["Sa"] = "sa";
15359
- Lang["ShCyrl"] = "sh-cyrl";
15360
- Lang["ShLatn"] = "sh-latn";
15361
- Lang["Sk"] = "sk";
15362
- Lang["Sl"] = "sl";
15363
- Lang["SrCyrl"] = "sr-cyrl";
15364
- Lang["Sv"] = "sv";
15365
- Lang["Ta"] = "ta";
15366
- Lang["Te"] = "te";
15367
- Lang["Th"] = "th";
15368
- Lang["Tk"] = "tk";
15369
- Lang["Tr"] = "tr";
15370
- Lang["Uk"] = "uk";
15371
- Lang["ZhLatnPinyin"] = "zh-latn-pinyin";
15372
- Lang["UNKNOWN"] = "unknown";
15373
- return Lang;
15374
- }({});
15375
-
15376
15242
  //#endregion
15377
15243
  //#region src/components/docs/layout/line-breaker/enhancers/hyphen-enhancer.ts
15378
15244
  function isUpperCase(word) {
@@ -15399,7 +15265,7 @@ var LineBreakerHyphenEnhancer = class {
15399
15265
  this._nextBreak = this._lineBreaker.nextBreakPoint();
15400
15266
  if (this._nextBreak == null || this._curBreak == null) return null;
15401
15267
  const word = getWord(this.content.slice(this._curBreak.position, this._nextBreak.position));
15402
- if (word.length && !(isUpperCase(word) && this._doNotHyphenateCaps) && this._nextBreak.type !== BreakPointType.Link) {
15268
+ if (word.length && !(isUpperCase(word) && this._doNotHyphenateCaps) && this._nextBreak.type !== "Link") {
15403
15269
  this._isInWord = true;
15404
15270
  this._word = word;
15405
15271
  this._hyphenSlice = this._hyphen.hyphenate(this._word, this._lang);
@@ -15409,7 +15275,7 @@ var LineBreakerHyphenEnhancer = class {
15409
15275
  } else if (this._hyphenIndex < this._hyphenSlice.length - 1) {
15410
15276
  const position = getSlicePosition(this._curBreak.position, this._hyphenSlice, this._hyphenIndex);
15411
15277
  this._hyphenIndex++;
15412
- return new Break(position, BreakPointType.Hyphen);
15278
+ return new Break(position, "Hyphen");
15413
15279
  } else {
15414
15280
  this._isInWord = false;
15415
15281
  this._word = "";
@@ -15422,27 +15288,20 @@ var LineBreakerHyphenEnhancer = class {
15422
15288
 
15423
15289
  //#endregion
15424
15290
  //#region src/components/docs/layout/line-breaker/enhancers/link-enhancer.ts
15425
- var LinkCharType = /* @__PURE__ */ function(LinkCharType) {
15426
- LinkCharType["Alphabetic"] = "Alphabetic";
15427
- LinkCharType["Digit"] = "Digit";
15428
- LinkCharType["Open"] = "Open";
15429
- LinkCharType["Other"] = "Other";
15430
- return LinkCharType;
15431
- }(LinkCharType || {});
15432
15291
  function ofLinkCharType(char) {
15433
- if (/[a-z]/i.test(char)) return LinkCharType.Alphabetic;
15434
- else if (/[0-9]/.test(char)) return LinkCharType.Digit;
15435
- else if (char === "(" || char === "[") return LinkCharType.Open;
15436
- else return LinkCharType.Other;
15292
+ if (/[a-z]/i.test(char)) return "Alphabetic";
15293
+ else if (/[0-9]/.test(char)) return "Digit";
15294
+ else if (char === "(" || char === "[") return "Open";
15295
+ else return "Other";
15437
15296
  }
15438
15297
  function linebreakLink(link) {
15439
15298
  const pieces = [];
15440
15299
  let offset = 0;
15441
- let prevCharType = LinkCharType.Other;
15300
+ let prevCharType = "Other";
15442
15301
  for (let i = 0; i < link.length; i++) {
15443
15302
  const char = link[i];
15444
15303
  const charType = ofLinkCharType(char);
15445
- if (i > 0 && prevCharType !== LinkCharType.Open && (charType === LinkCharType.Other ? charType === LinkCharType.Other : charType !== prevCharType)) {
15304
+ if (i > 0 && prevCharType !== "Open" && (charType === "Other" ? charType === "Other" : charType !== prevCharType)) {
15446
15305
  const piece = link.slice(offset, i);
15447
15306
  if (piece.length < 16) pieces.push(piece);
15448
15307
  else for (let j = 0; j < piece.length; j++) pieces.push(piece[j]);
@@ -15493,7 +15352,7 @@ var LineBreakerLinkEnhancer = class {
15493
15352
  } else if (this._index < this._linkSlice.length - 1) {
15494
15353
  const position = getSlicePosition(this._curBreak.position, this._linkSlice, this._index);
15495
15354
  this._index++;
15496
- return new Break(position, BreakPointType.Link);
15355
+ return new Break(position, "Link");
15497
15356
  } else {
15498
15357
  this._isInLink = false;
15499
15358
  this._link = "";
@@ -15524,59 +15383,35 @@ function tabLineBreakExtension(breaker) {
15524
15383
 
15525
15384
  //#endregion
15526
15385
  //#region src/components/docs/layout/shaping-engine/font-library.ts
15527
- var CompareResult = /* @__PURE__ */ function(CompareResult) {
15528
- CompareResult[CompareResult["EQUAL"] = 0] = "EQUAL";
15529
- CompareResult[CompareResult["GREATER"] = 1] = "GREATER";
15530
- CompareResult[CompareResult["LESS"] = 2] = "LESS";
15531
- return CompareResult;
15532
- }(CompareResult || {});
15533
- var FontStyle = /* @__PURE__ */ function(FontStyle) {
15534
- FontStyle[FontStyle["Normal"] = 0] = "Normal";
15535
- FontStyle[FontStyle["Italic"] = 1] = "Italic";
15536
- FontStyle[FontStyle["Oblique"] = 2] = "Oblique";
15537
- return FontStyle;
15538
- }(FontStyle || {});
15539
- var FontWeight = /* @__PURE__ */ function(FontWeight) {
15540
- FontWeight[FontWeight["THIN"] = 100] = "THIN";
15541
- FontWeight[FontWeight["EXTRALIGHT"] = 200] = "EXTRALIGHT";
15542
- FontWeight[FontWeight["LIGHT"] = 300] = "LIGHT";
15543
- FontWeight[FontWeight["REGULAR"] = 400] = "REGULAR";
15544
- FontWeight[FontWeight["MEDIUM"] = 500] = "MEDIUM";
15545
- FontWeight[FontWeight["SEMIBOLD"] = 600] = "SEMIBOLD";
15546
- FontWeight[FontWeight["BOLD"] = 700] = "BOLD";
15547
- FontWeight[FontWeight["EXTRABOLD"] = 800] = "EXTRABOLD";
15548
- FontWeight[FontWeight["BLACK"] = 900] = "BLACK";
15549
- return FontWeight;
15550
- }(FontWeight || {});
15551
15386
  function getFontInfoFromFontData(fontData) {
15552
15387
  const { family, style: styleString } = fontData;
15553
- let style = FontStyle.Normal;
15554
- let weight = FontWeight.REGULAR;
15555
- if (/italic/i.test(styleString)) style = FontStyle.Italic;
15388
+ let style = 0;
15389
+ let weight = 400;
15390
+ if (/italic/i.test(styleString)) style = 1;
15556
15391
  switch (true) {
15557
15392
  case /thin|hairline/i.test(styleString):
15558
- weight = FontWeight.THIN;
15393
+ weight = 100;
15559
15394
  break;
15560
15395
  case /(extra|ultra) *light/i.test(styleString):
15561
- weight = FontWeight.EXTRALIGHT;
15396
+ weight = 200;
15562
15397
  break;
15563
15398
  case /light/i.test(styleString):
15564
- weight = FontWeight.LIGHT;
15399
+ weight = 300;
15565
15400
  break;
15566
15401
  case /medium/i.test(styleString):
15567
- weight = FontWeight.MEDIUM;
15402
+ weight = 500;
15568
15403
  break;
15569
15404
  case /(semi|demi) *bold/i.test(styleString):
15570
- weight = FontWeight.SEMIBOLD;
15405
+ weight = 600;
15571
15406
  break;
15572
15407
  case /bold/i.test(styleString):
15573
- weight = FontWeight.BOLD;
15408
+ weight = 700;
15574
15409
  break;
15575
15410
  case /(extra|ultra) *bold/i.test(styleString):
15576
- weight = FontWeight.EXTRABOLD;
15411
+ weight = 800;
15577
15412
  break;
15578
15413
  case /black|heavy/i.test(styleString):
15579
- weight = FontWeight.BLACK;
15414
+ weight = 900;
15580
15415
  break;
15581
15416
  }
15582
15417
  return {
@@ -15592,23 +15427,23 @@ function getFontInfoFromTextStyle(style) {
15592
15427
  return {
15593
15428
  family: ff !== null && ff !== void 0 ? ff : "Arial",
15594
15429
  variant: {
15595
- style: it === BooleanNumber.TRUE ? FontStyle.Italic : FontStyle.Normal,
15596
- weight: bl === BooleanNumber.TRUE ? FontWeight.BOLD : FontWeight.REGULAR
15430
+ style: it === BooleanNumber.TRUE ? 1 : 0,
15431
+ weight: bl === BooleanNumber.TRUE ? 700 : 400
15597
15432
  }
15598
15433
  };
15599
15434
  }
15600
15435
  function fontInfoDistance(a, b) {
15601
15436
  let styleDistance = Number.POSITIVE_INFINITY;
15602
15437
  if (a.variant.style === b.variant.style) styleDistance = 0;
15603
- else if (a.variant.style !== FontStyle.Normal && b.variant.style !== FontStyle.Normal) styleDistance = 1;
15438
+ else if (a.variant.style !== 0 && b.variant.style !== 0) styleDistance = 1;
15604
15439
  else styleDistance = 2;
15605
15440
  const weightDistance = Math.abs(a.variant.weight - b.variant.weight);
15606
15441
  return [styleDistance, weightDistance];
15607
15442
  }
15608
15443
  function compareFontInfoDistance(a, b) {
15609
- if (a[0] === b[0] && a[1] === b[1]) return CompareResult.EQUAL;
15610
- if (a[0] === b[0]) return a[1] > b[1] ? CompareResult.GREATER : CompareResult.LESS;
15611
- return a[0] > b[0] ? CompareResult.GREATER : CompareResult.LESS;
15444
+ if (a[0] === b[0] && a[1] === b[1]) return 0;
15445
+ if (a[0] === b[0]) return a[1] > b[1] ? 1 : 2;
15446
+ return a[0] > b[0] ? 1 : 2;
15612
15447
  }
15613
15448
  async function checkLocalFontsPermission() {
15614
15449
  var _window$navigator;
@@ -15663,7 +15498,7 @@ var FontLibrary = class {
15663
15498
  if (bestFont == null) {
15664
15499
  bestFont = fontWithBuffer;
15665
15500
  bestDistance = distance;
15666
- } else if (compareFontInfoDistance(bestDistance, distance) === CompareResult.GREATER) {
15501
+ } else if (compareFontInfoDistance(bestDistance, distance) === 1) {
15667
15502
  bestFont = fontWithBuffer;
15668
15503
  bestDistance = distance;
15669
15504
  }
@@ -15964,7 +15799,7 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
15964
15799
  const lang = languageDetector.detect(content);
15965
15800
  const needHyphen = hyphenConfig(paragraphStyle, sectionBreakConfig);
15966
15801
  const doNotHyphenateCaps = sectionBreakConfig.doNotHyphenateCaps === BooleanNumber.TRUE;
15967
- if (lang !== Lang.UNKNOWN && needHyphen) if (hyphen.hasPattern(lang)) breaker = new LineBreakerHyphenEnhancer(breaker, hyphen, lang, doNotHyphenateCaps);
15802
+ if (lang !== "unknown" && needHyphen) if (hyphen.hasPattern(lang)) breaker = new LineBreakerHyphenEnhancer(breaker, hyphen, lang, doNotHyphenateCaps);
15968
15803
  else hyphen.loadPattern(lang);
15969
15804
  while (bk = breaker.nextBreakPoint()) {
15970
15805
  const word = content.slice(last, bk.position);
@@ -16069,7 +15904,7 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
16069
15904
  shapedTextList.push({
16070
15905
  text: word,
16071
15906
  glyphs: shapedGlyphs,
16072
- breakPointType: shapedGlyphs === lastShapedGlyphs ? bk.type : BreakPointType.Normal
15907
+ breakPointType: shapedGlyphs === lastShapedGlyphs ? bk.type : "Normal"
16073
15908
  });
16074
15909
  }
16075
15910
  last = bk.position;
@@ -16168,84 +16003,84 @@ function _pushPage(allCurrentSkeletonPages, blockSkeletonPages) {
16168
16003
  //#endregion
16169
16004
  //#region src/components/docs/layout/hyphenation/pattern-loaders.gen.ts
16170
16005
  const PATTERN_LOADERS = {
16171
- [Lang.Af]: () => import("./af-I8XQee0A.js"),
16172
- [Lang.As]: () => import("./as-DPw4kbfa.js"),
16173
- [Lang.Be]: () => import("./be-hSu5_2AE.js"),
16174
- [Lang.Bg]: () => import("./bg-eIV91Ges.js"),
16175
- [Lang.Bn]: () => import("./bn-CF0YbkEW.js"),
16176
- [Lang.Ca]: () => import("./ca-D0fayQwW.js"),
16177
- [Lang.Cop]: () => import("./cop-gnNw8zDV.js"),
16178
- [Lang.Cs]: () => import("./cs-cUOdqXi9.js"),
16179
- [Lang.Cu]: () => import("./cu-CJJk_6p3.js"),
16180
- [Lang.Cy]: () => import("./cy-he1_O-US.js"),
16181
- [Lang.Da]: () => import("./da-C_Tc6C75.js"),
16182
- [Lang.De1901]: () => import("./de-1901-D9yvXEO8.js"),
16183
- [Lang.De1996]: () => import("./de-1996-DIBM3qkD.js"),
16184
- [Lang.DeCh1901]: () => import("./de-ch-1901-BEDgpl3-.js"),
16185
- [Lang.ElMonoton]: () => import("./el-monoton-BvjPOyvW.js"),
16186
- [Lang.ElPolyton]: () => import("./el-polyton-DfJ9Eeih.js"),
16187
- [Lang.EnGb]: () => import("./en-gb-DYXoK50H.js"),
16188
- [Lang.EnUs]: () => import("./en-us-ClVoWMyT.js").then((n) => n.n),
16189
- [Lang.Es]: () => import("./es-48latgZ8.js"),
16190
- [Lang.Et]: () => import("./et-UzX1rSXY.js"),
16191
- [Lang.Eu]: () => import("./eu-ijD7H63T.js"),
16192
- [Lang.Fi]: () => import("./fi-DDuxAHu5.js"),
16193
- [Lang.Fr]: () => import("./fr-6wTrAsbK.js"),
16194
- [Lang.Fur]: () => import("./fur-CcIOY8A9.js"),
16195
- [Lang.Ga]: () => import("./ga-B4Qvh5qS.js"),
16196
- [Lang.Gl]: () => import("./gl-D8H7uN6B.js"),
16197
- [Lang.Grc]: () => import("./grc-DFNi6G6p.js"),
16198
- [Lang.Gu]: () => import("./gu-0EahmEdu.js"),
16199
- [Lang.Hi]: () => import("./hi-C2ih9xmB.js"),
16200
- [Lang.Hr]: () => import("./hr-CSbbBNUu.js"),
16201
- [Lang.Hsb]: () => import("./hsb-hKsDwaW_.js"),
16202
- [Lang.Hu]: () => import("./hu-BPixuxjf.js"),
16203
- [Lang.Hy]: () => import("./hy-CTtThTdl.js"),
16204
- [Lang.Ia]: () => import("./ia-CYCjbabb.js"),
16205
- [Lang.Id]: () => import("./id-Cgsp-bEu.js"),
16206
- [Lang.Is]: () => import("./is-D_Awtowh.js"),
16207
- [Lang.It]: () => import("./it-C2qJSkm3.js"),
16208
- [Lang.Ka]: () => import("./ka-DpGw5nvd.js"),
16209
- [Lang.Kmr]: () => import("./kmr-CCdNyB20.js"),
16210
- [Lang.Kn]: () => import("./kn-B4tAUtFU.js"),
16211
- [Lang.La]: () => import("./la-DIUYl8Yo.js"),
16212
- [Lang.LaXClassic]: () => import("./la-x-classic-DsbLrq-C.js"),
16213
- [Lang.LaXLiturgic]: () => import("./la-x-liturgic-Ggenbcb5.js"),
16214
- [Lang.Lt]: () => import("./lt-BcizI7gZ.js"),
16215
- [Lang.Lv]: () => import("./lv-BOgrbf6v.js"),
16216
- [Lang.Ml]: () => import("./ml-CTD7giel.js"),
16217
- [Lang.MnCyrl]: () => import("./mn-cyrl-CDxGttkw.js"),
16218
- [Lang.MnCyrlXLmc]: () => import("./mn-cyrl-x-lmc-kjrnm3ii.js"),
16219
- [Lang.Mr]: () => import("./mr-DttMNydl.js"),
16220
- [Lang.MulEthi]: () => import("./mul-ethi-mmW8ZEm0.js"),
16221
- [Lang.Nb]: () => import("./nb-DCiD6jLz.js"),
16222
- [Lang.Nl]: () => import("./nl-BKWsn_4x.js"),
16223
- [Lang.Nn]: () => import("./nn-b0W3mz5j.js"),
16224
- [Lang.No]: () => import("./no-B3l46gib.js"),
16225
- [Lang.Oc]: () => import("./oc-zkqkXjNo.js"),
16226
- [Lang.Or]: () => import("./or-DEnI_Cls.js"),
16227
- [Lang.Pa]: () => import("./pa-Sh-QSMIs.js"),
16228
- [Lang.Pi]: () => import("./pi-DxMx4Uwd.js"),
16229
- [Lang.Pl]: () => import("./pl-CISKU0vg.js"),
16230
- [Lang.Pms]: () => import("./pms-DUga94hR.js"),
16231
- [Lang.Pt]: () => import("./pt-CzW61i2q.js"),
16232
- [Lang.Rm]: () => import("./rm-C1U6i4AB.js"),
16233
- [Lang.Ro]: () => import("./ro-DSU53KfM.js"),
16234
- [Lang.Ru]: () => import("./ru-gduZDLhv.js"),
16235
- [Lang.Sa]: () => import("./sa-Bney0xbB.js"),
16236
- [Lang.ShCyrl]: () => import("./sh-cyrl-CCByyO89.js"),
16237
- [Lang.ShLatn]: () => import("./sh-latn-CTIiTfzt.js"),
16238
- [Lang.Sk]: () => import("./sk-DK-iy-nO.js"),
16239
- [Lang.Sl]: () => import("./sl-BvzIjkCq.js"),
16240
- [Lang.SrCyrl]: () => import("./sr-cyrl-7T4T5Th1.js"),
16241
- [Lang.Sv]: () => import("./sv-BynygC4t.js"),
16242
- [Lang.Ta]: () => import("./ta-CglfOvwm.js"),
16243
- [Lang.Te]: () => import("./te-Bec4xJud.js"),
16244
- [Lang.Th]: () => import("./th-B67OcLue.js"),
16245
- [Lang.Tk]: () => import("./tk-CYfVPVLR.js"),
16246
- [Lang.Tr]: () => import("./tr-BxhGLs2f.js"),
16247
- [Lang.Uk]: () => import("./uk-CnWqKnI0.js"),
16248
- [Lang.ZhLatnPinyin]: () => import("./zh-latn-pinyin-CKxTJrac.js")
16006
+ ["af"]: () => import("./af-I8XQee0A.js"),
16007
+ ["as"]: () => import("./as-DPw4kbfa.js"),
16008
+ ["be"]: () => import("./be-hSu5_2AE.js"),
16009
+ ["bg"]: () => import("./bg-eIV91Ges.js"),
16010
+ ["bn"]: () => import("./bn-CF0YbkEW.js"),
16011
+ ["ca"]: () => import("./ca-D0fayQwW.js"),
16012
+ ["cop"]: () => import("./cop-gnNw8zDV.js"),
16013
+ ["cs"]: () => import("./cs-cUOdqXi9.js"),
16014
+ ["cu"]: () => import("./cu-CJJk_6p3.js"),
16015
+ ["cy"]: () => import("./cy-he1_O-US.js"),
16016
+ ["da"]: () => import("./da-C_Tc6C75.js"),
16017
+ ["de-1901"]: () => import("./de-1901-D9yvXEO8.js"),
16018
+ ["de-1996"]: () => import("./de-1996-DIBM3qkD.js"),
16019
+ ["de-ch-1901"]: () => import("./de-ch-1901-BEDgpl3-.js"),
16020
+ ["el-monoton"]: () => import("./el-monoton-BvjPOyvW.js"),
16021
+ ["el-polyton"]: () => import("./el-polyton-DfJ9Eeih.js"),
16022
+ ["en-gb"]: () => import("./en-gb-DYXoK50H.js"),
16023
+ ["en-us"]: () => import("./en-us-ClVoWMyT.js").then((n) => n.n),
16024
+ ["es"]: () => import("./es-48latgZ8.js"),
16025
+ ["et"]: () => import("./et-UzX1rSXY.js"),
16026
+ ["eu"]: () => import("./eu-ijD7H63T.js"),
16027
+ ["fi"]: () => import("./fi-DDuxAHu5.js"),
16028
+ ["fr"]: () => import("./fr-6wTrAsbK.js"),
16029
+ ["fur"]: () => import("./fur-CcIOY8A9.js"),
16030
+ ["ga"]: () => import("./ga-B4Qvh5qS.js"),
16031
+ ["gl"]: () => import("./gl-D8H7uN6B.js"),
16032
+ ["grc"]: () => import("./grc-DFNi6G6p.js"),
16033
+ ["gu"]: () => import("./gu-0EahmEdu.js"),
16034
+ ["hi"]: () => import("./hi-C2ih9xmB.js"),
16035
+ ["hr"]: () => import("./hr-CSbbBNUu.js"),
16036
+ ["hsb"]: () => import("./hsb-hKsDwaW_.js"),
16037
+ ["hu"]: () => import("./hu-BPixuxjf.js"),
16038
+ ["hy"]: () => import("./hy-CTtThTdl.js"),
16039
+ ["ia"]: () => import("./ia-CYCjbabb.js"),
16040
+ ["id"]: () => import("./id-Cgsp-bEu.js"),
16041
+ ["is"]: () => import("./is-D_Awtowh.js"),
16042
+ ["it"]: () => import("./it-C2qJSkm3.js"),
16043
+ ["ka"]: () => import("./ka-DpGw5nvd.js"),
16044
+ ["kmr"]: () => import("./kmr-CCdNyB20.js"),
16045
+ ["kn"]: () => import("./kn-B4tAUtFU.js"),
16046
+ ["la"]: () => import("./la-DIUYl8Yo.js"),
16047
+ ["la-x-classic"]: () => import("./la-x-classic-DsbLrq-C.js"),
16048
+ ["la-x-liturgic"]: () => import("./la-x-liturgic-Ggenbcb5.js"),
16049
+ ["lt"]: () => import("./lt-BcizI7gZ.js"),
16050
+ ["lv"]: () => import("./lv-BOgrbf6v.js"),
16051
+ ["ml"]: () => import("./ml-CTD7giel.js"),
16052
+ ["mn-cyrl"]: () => import("./mn-cyrl-CDxGttkw.js"),
16053
+ ["mn-cyrl-x-lmc"]: () => import("./mn-cyrl-x-lmc-kjrnm3ii.js"),
16054
+ ["mr"]: () => import("./mr-DttMNydl.js"),
16055
+ ["mul-ethi"]: () => import("./mul-ethi-mmW8ZEm0.js"),
16056
+ ["nb"]: () => import("./nb-DCiD6jLz.js"),
16057
+ ["nl"]: () => import("./nl-BKWsn_4x.js"),
16058
+ ["nn"]: () => import("./nn-b0W3mz5j.js"),
16059
+ ["no"]: () => import("./no-B3l46gib.js"),
16060
+ ["oc"]: () => import("./oc-zkqkXjNo.js"),
16061
+ ["or"]: () => import("./or-DEnI_Cls.js"),
16062
+ ["pa"]: () => import("./pa-Sh-QSMIs.js"),
16063
+ ["pi"]: () => import("./pi-DxMx4Uwd.js"),
16064
+ ["pl"]: () => import("./pl-CISKU0vg.js"),
16065
+ ["pms"]: () => import("./pms-DUga94hR.js"),
16066
+ ["pt"]: () => import("./pt-CzW61i2q.js"),
16067
+ ["rm"]: () => import("./rm-C1U6i4AB.js"),
16068
+ ["ro"]: () => import("./ro-DSU53KfM.js"),
16069
+ ["ru"]: () => import("./ru-gduZDLhv.js"),
16070
+ ["sa"]: () => import("./sa-Bney0xbB.js"),
16071
+ ["sh-cyrl"]: () => import("./sh-cyrl-CCByyO89.js"),
16072
+ ["sh-latn"]: () => import("./sh-latn-CTIiTfzt.js"),
16073
+ ["sk"]: () => import("./sk-DK-iy-nO.js"),
16074
+ ["sl"]: () => import("./sl-BvzIjkCq.js"),
16075
+ ["sr-cyrl"]: () => import("./sr-cyrl-7T4T5Th1.js"),
16076
+ ["sv"]: () => import("./sv-BynygC4t.js"),
16077
+ ["ta"]: () => import("./ta-CglfOvwm.js"),
16078
+ ["te"]: () => import("./te-Bec4xJud.js"),
16079
+ ["th"]: () => import("./th-B67OcLue.js"),
16080
+ ["tk"]: () => import("./tk-CYfVPVLR.js"),
16081
+ ["tr"]: () => import("./tr-BxhGLs2f.js"),
16082
+ ["uk"]: () => import("./uk-CnWqKnI0.js"),
16083
+ ["zh-latn-pinyin"]: () => import("./zh-latn-pinyin-CKxTJrac.js")
16249
16084
  };
16250
16085
 
16251
16086
  //#endregion
@@ -16295,11 +16130,11 @@ var Hyphen = class Hyphen {
16295
16130
  _defineProperty(this, "_patterns", /* @__PURE__ */ new Map());
16296
16131
  _defineProperty(this, "_hyphenCache", /* @__PURE__ */ new Map());
16297
16132
  this._preloadPatterns();
16298
- this.loadPattern(Lang.EnGb);
16133
+ this.loadPattern("en-gb");
16299
16134
  }
16300
16135
  _preloadPatterns() {
16301
- this._patterns.set(Lang.EnUs, parsePattern(EnUs));
16302
- this._loadExceptionsToCache(Lang.EnUs, EnUs);
16136
+ this._patterns.set("en-us", parsePattern(EnUs));
16137
+ this._loadExceptionsToCache("en-us", EnUs);
16303
16138
  }
16304
16139
  _loadExceptionsToCache(lang, pattern) {
16305
16140
  if (pattern.length < 3) return;
@@ -16390,40 +16225,40 @@ _defineProperty(Hyphen, "_instance", null);
16390
16225
  //#endregion
16391
16226
  //#region src/components/docs/layout/hyphenation/language-detector.ts
16392
16227
  const LANG_MAP_TO_HYPHEN_LANG = {
16393
- spa: Lang.Es,
16394
- eng: Lang.EnUs,
16395
- rus: Lang.Ru,
16396
- ben: Lang.Bn,
16397
- hin: Lang.Hi,
16398
- por: Lang.Pt,
16399
- ind: Lang.Id,
16400
- fra: Lang.Fr,
16401
- deu: Lang.De1901,
16402
- tel: Lang.Te,
16403
- mar: Lang.Mr,
16404
- ita: Lang.It,
16405
- tam: Lang.Ta,
16406
- tur: Lang.Tr,
16407
- guj: Lang.Gu,
16408
- pol: Lang.Pl,
16409
- ukr: Lang.Uk,
16410
- kan: Lang.Kn,
16411
- mal: Lang.Ml,
16412
- ron: Lang.Ro,
16413
- pan: Lang.Pa,
16414
- hrv: Lang.Hr,
16415
- nld: Lang.Nl,
16416
- srp: Lang.SrCyrl,
16417
- tha: Lang.Th,
16418
- uzn: Lang.Kmr,
16419
- zlm: Lang.Ml,
16420
- hun: Lang.Hu,
16421
- ell: Lang.ElMonoton,
16422
- ces: Lang.Cs,
16423
- bel: Lang.Be,
16424
- bul: Lang.Bg,
16425
- swe: Lang.Sv,
16426
- und: Lang.UNKNOWN
16228
+ spa: "es",
16229
+ eng: "en-us",
16230
+ rus: "ru",
16231
+ ben: "bn",
16232
+ hin: "hi",
16233
+ por: "pt",
16234
+ ind: "id",
16235
+ fra: "fr",
16236
+ deu: "de-1901",
16237
+ tel: "te",
16238
+ mar: "mr",
16239
+ ita: "it",
16240
+ tam: "ta",
16241
+ tur: "tr",
16242
+ guj: "gu",
16243
+ pol: "pl",
16244
+ ukr: "uk",
16245
+ kan: "kn",
16246
+ mal: "ml",
16247
+ ron: "ro",
16248
+ pan: "pa",
16249
+ hrv: "hr",
16250
+ nld: "nl",
16251
+ srp: "sr-cyrl",
16252
+ tha: "th",
16253
+ uzn: "kmr",
16254
+ zlm: "ml",
16255
+ hun: "hu",
16256
+ ell: "el-monoton",
16257
+ ces: "cs",
16258
+ bel: "be",
16259
+ bul: "bg",
16260
+ swe: "sv",
16261
+ und: "unknown"
16427
16262
  };
16428
16263
  var LanguageDetector = class LanguageDetector {
16429
16264
  constructor() {
@@ -16437,7 +16272,7 @@ var LanguageDetector = class LanguageDetector {
16437
16272
  var _LANG_MAP_TO_HYPHEN_L;
16438
16273
  let lang = this._detectCache.get(text);
16439
16274
  if (lang) return lang;
16440
- lang = (_LANG_MAP_TO_HYPHEN_L = LANG_MAP_TO_HYPHEN_LANG[franc(text)]) !== null && _LANG_MAP_TO_HYPHEN_L !== void 0 ? _LANG_MAP_TO_HYPHEN_L : Lang.UNKNOWN;
16275
+ lang = (_LANG_MAP_TO_HYPHEN_L = LANG_MAP_TO_HYPHEN_LANG[franc(text)]) !== null && _LANG_MAP_TO_HYPHEN_L !== void 0 ? _LANG_MAP_TO_HYPHEN_L : "unknown";
16441
16276
  this._detectCache.set(text, lang);
16442
16277
  return lang;
16443
16278
  }
@@ -16563,14 +16398,14 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16563
16398
  let pageIndex = -1;
16564
16399
  const path = getPagePath(page);
16565
16400
  switch (pageType) {
16566
- case DocumentSkeletonPageType.HEADER:
16567
- case DocumentSkeletonPageType.FOOTER:
16401
+ case 1:
16402
+ case 2:
16568
16403
  pageIndex = 0;
16569
16404
  break;
16570
- case DocumentSkeletonPageType.BODY:
16405
+ case 0:
16571
16406
  pageIndex = skeletonData.pages.indexOf(page);
16572
16407
  break;
16573
- case DocumentSkeletonPageType.CELL:
16408
+ case 3:
16574
16409
  pageIndex = path[1];
16575
16410
  break;
16576
16411
  default: throw new Error("Invalid page type");
@@ -16609,14 +16444,14 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16609
16444
  const path = getPagePath(page);
16610
16445
  let pageIndex = -1;
16611
16446
  switch (pageType) {
16612
- case DocumentSkeletonPageType.HEADER:
16613
- case DocumentSkeletonPageType.FOOTER:
16447
+ case 1:
16448
+ case 2:
16614
16449
  pageIndex = 0;
16615
16450
  break;
16616
- case DocumentSkeletonPageType.BODY:
16451
+ case 0:
16617
16452
  pageIndex = pages.indexOf(page);
16618
16453
  break;
16619
- case DocumentSkeletonPageType.CELL:
16454
+ case 3:
16620
16455
  pageIndex = path[1];
16621
16456
  break;
16622
16457
  default: throw new Error("Invalid page type");
@@ -16646,15 +16481,15 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16646
16481
  const { divide, line, column, section, segmentPage, pageType, path, isBack } = position;
16647
16482
  let { glyph } = position;
16648
16483
  let skePage = null;
16649
- if (pageType === DocumentSkeletonPageType.HEADER || pageType === DocumentSkeletonPageType.FOOTER) {
16484
+ if (pageType === 1 || pageType === 2) {
16650
16485
  skePage = pages[segmentPage];
16651
16486
  const { headerId, footerId, pageWidth } = skePage;
16652
- if (pageType === DocumentSkeletonPageType.HEADER) {
16487
+ if (pageType === 1) {
16653
16488
  var _skeHeaders$get;
16654
16489
  const skeHeader = (_skeHeaders$get = skeHeaders.get(headerId)) === null || _skeHeaders$get === void 0 ? void 0 : _skeHeaders$get.get(pageWidth);
16655
16490
  if (skeHeader == null) return;
16656
16491
  else skePage = skeHeader;
16657
- } else if (pageType === DocumentSkeletonPageType.FOOTER) {
16492
+ } else if (pageType === 2) {
16658
16493
  var _skeFooters$get;
16659
16494
  const skeFooter = (_skeFooters$get = skeFooters.get(footerId)) === null || _skeFooters$get === void 0 ? void 0 : _skeFooters$get.get(pageWidth);
16660
16495
  if (skeFooter == null) return;
@@ -16664,12 +16499,12 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16664
16499
  if (skePage == null) return;
16665
16500
  const glyphGroup = skePage.sections[section].columns[column].lines[line].divides[divide].glyphGroup;
16666
16501
  glyph = Math.min(glyph, glyphGroup.length - 1);
16667
- if (glyphGroup[glyph].glyphType === GlyphType.LIST) glyph += 1;
16502
+ if (glyphGroup[glyph].glyphType === 2) glyph += 1;
16668
16503
  return glyphGroup[glyph];
16669
16504
  }
16670
16505
  findEditAreaByCoord(coord, pageLayoutType, pageMarginLeft, pageMarginTop) {
16671
16506
  const { x, y } = coord;
16672
- let editArea = DocumentEditArea.BODY;
16507
+ let editArea = "BODY";
16673
16508
  let pageNumber = -1;
16674
16509
  let pageSkeleton = null;
16675
16510
  const skeletonData = this.getSkeletonData();
@@ -16684,19 +16519,19 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16684
16519
  const page = pages[i];
16685
16520
  const { marginTop, marginBottom, pageWidth, pageHeight } = page;
16686
16521
  if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y && y < this._findLiquid.y + marginTop) {
16687
- editArea = DocumentEditArea.HEADER;
16522
+ editArea = "HEADER";
16688
16523
  pageSkeleton = page;
16689
16524
  pageNumber = i;
16690
16525
  break;
16691
16526
  }
16692
16527
  if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y + marginTop && y < this._findLiquid.y + pageHeight - marginBottom) {
16693
- editArea = DocumentEditArea.BODY;
16528
+ editArea = "BODY";
16694
16529
  pageSkeleton = page;
16695
16530
  pageNumber = i;
16696
16531
  break;
16697
16532
  }
16698
16533
  if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y + pageHeight - marginBottom && y < this._findLiquid.y + pageHeight) {
16699
- editArea = DocumentEditArea.FOOTER;
16534
+ editArea = "FOOTER";
16700
16535
  pageSkeleton = page;
16701
16536
  pageNumber = i;
16702
16537
  break;
@@ -16725,16 +16560,16 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16725
16560
  const page = pages[pi];
16726
16561
  const { headerId, footerId, pageWidth } = page;
16727
16562
  let exactMatch = null;
16728
- if (editArea === DocumentEditArea.HEADER || editArea === DocumentEditArea.FOOTER) {
16563
+ if (editArea === "HEADER" || editArea === "FOOTER") {
16729
16564
  var _skeHeaders$get2, _skeFooters$get2;
16730
16565
  const headerSke = (_skeHeaders$get2 = skeHeaders.get(headerId)) === null || _skeHeaders$get2 === void 0 ? void 0 : _skeHeaders$get2.get(pageWidth);
16731
- if (headerSke) exactMatch = this._collectNearestNode(headerSke, DocumentSkeletonPageType.HEADER, page, headerId, pi, cache, x, y, pageLength);
16566
+ if (headerSke) exactMatch = this._collectNearestNode(headerSke, 1, page, headerId, pi, cache, x, y, pageLength);
16732
16567
  const footerSke = (_skeFooters$get2 = skeFooters.get(footerId)) === null || _skeFooters$get2 === void 0 ? void 0 : _skeFooters$get2.get(pageWidth);
16733
16568
  if (footerSke) {
16734
16569
  var _exactMatch;
16735
- exactMatch = (_exactMatch = exactMatch) !== null && _exactMatch !== void 0 ? _exactMatch : this._collectNearestNode(footerSke, DocumentSkeletonPageType.FOOTER, page, footerId, pi, cache, x, y, pageLength);
16570
+ exactMatch = (_exactMatch = exactMatch) !== null && _exactMatch !== void 0 ? _exactMatch : this._collectNearestNode(footerSke, 2, page, footerId, pi, cache, x, y, pageLength);
16736
16571
  }
16737
- } else exactMatch = this._collectNearestNode(page, DocumentSkeletonPageType.BODY, page, "", pi, cache, x, y, pageLength);
16572
+ } else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
16738
16573
  if (exactMatch) return exactMatch;
16739
16574
  this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
16740
16575
  }
@@ -16747,13 +16582,13 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16747
16582
  if (segmentId !== "") {
16748
16583
  var _skeHeaders$get3, _skeFooters$get3;
16749
16584
  const headerSke = (_skeHeaders$get3 = skeHeaders.get(headerId)) === null || _skeHeaders$get3 === void 0 ? void 0 : _skeHeaders$get3.get(pageWidth);
16750
- if (headerSke) exactMatch = this._collectNearestNode(headerSke, DocumentSkeletonPageType.HEADER, page, headerId, pi, cache, x, y, pageLength);
16585
+ if (headerSke) exactMatch = this._collectNearestNode(headerSke, 1, page, headerId, pi, cache, x, y, pageLength);
16751
16586
  const footerSke = (_skeFooters$get3 = skeFooters.get(footerId)) === null || _skeFooters$get3 === void 0 ? void 0 : _skeFooters$get3.get(pageWidth);
16752
16587
  if (footerSke) {
16753
16588
  var _exactMatch2;
16754
- exactMatch = (_exactMatch2 = exactMatch) !== null && _exactMatch2 !== void 0 ? _exactMatch2 : this._collectNearestNode(footerSke, DocumentSkeletonPageType.FOOTER, page, footerId, pi, cache, x, y, pageLength);
16589
+ exactMatch = (_exactMatch2 = exactMatch) !== null && _exactMatch2 !== void 0 ? _exactMatch2 : this._collectNearestNode(footerSke, 2, page, footerId, pi, cache, x, y, pageLength);
16755
16590
  }
16756
- } else exactMatch = this._collectNearestNode(page, DocumentSkeletonPageType.BODY, page, "", pi, cache, x, y, pageLength);
16591
+ } else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
16757
16592
  if (exactMatch) return exactMatch;
16758
16593
  this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
16759
16594
  }
@@ -16767,8 +16602,8 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16767
16602
  }
16768
16603
  const { headerId, pageWidth } = page;
16769
16604
  const segmentSke = segmentId === headerId ? (_skeHeaders$get4 = skeHeaders.get(segmentId)) === null || _skeHeaders$get4 === void 0 ? void 0 : _skeHeaders$get4.get(pageWidth) : (_skeFooters$get4 = skeFooters.get(segmentId)) === null || _skeFooters$get4 === void 0 ? void 0 : _skeFooters$get4.get(pageWidth);
16770
- if (segmentSke) exactMatch = this._collectNearestNode(segmentSke, segmentId === headerId ? DocumentSkeletonPageType.HEADER : DocumentSkeletonPageType.FOOTER, page, segmentId, segmentPage, cache, x, y, pageLength);
16771
- } else exactMatch = this._collectNearestNode(page, DocumentSkeletonPageType.BODY, page, "", pi, cache, x, y, pageLength);
16605
+ if (segmentSke) exactMatch = this._collectNearestNode(segmentSke, segmentId === headerId ? 1 : 2, page, segmentId, segmentPage, cache, x, y, pageLength);
16606
+ } else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
16772
16607
  if (exactMatch) return exactMatch;
16773
16608
  this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
16774
16609
  }
@@ -16780,10 +16615,10 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16780
16615
  this._findLiquid.translateSave();
16781
16616
  const pageLeft = this._findLiquid.x;
16782
16617
  const pageRight = pageLeft + page.pageWidth;
16783
- const pageTop = this._findLiquid.y + (pageType === DocumentSkeletonPageType.FOOTER ? page.pageHeight - segmentPage.pageHeight : 0);
16618
+ const pageTop = this._findLiquid.y + (pageType === 2 ? page.pageHeight - segmentPage.pageHeight : 0);
16784
16619
  const pageBottom = pageTop + segmentPage.pageHeight;
16785
16620
  let pointInPage = x >= pageLeft && x <= pageRight && y >= pageTop && y <= pageBottom;
16786
- if (nestLevel === 0 && pageType === DocumentSkeletonPageType.BODY) {
16621
+ if (nestLevel === 0 && pageType === 0) {
16787
16622
  const isFirstPage = pi === 0;
16788
16623
  const isLastPage = pi === pageLength - 1;
16789
16624
  const halfMarginTop = page.originMarginTop / 2;
@@ -16793,13 +16628,13 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16793
16628
  else pointInPage = y >= pageTop - halfMarginTop && y <= pageBottom + halfMarginTop;
16794
16629
  }
16795
16630
  switch (pageType) {
16796
- case DocumentSkeletonPageType.HEADER:
16631
+ case 1:
16797
16632
  this._findLiquid.translatePagePadding({
16798
16633
  ...segmentPage,
16799
16634
  marginLeft: page.marginLeft
16800
16635
  });
16801
16636
  break;
16802
- case DocumentSkeletonPageType.FOOTER: {
16637
+ case 2: {
16803
16638
  const footerTop = page.pageHeight - segmentPage.height - segmentPage.marginBottom;
16804
16639
  this._findLiquid.translate(page.marginLeft, footerTop);
16805
16640
  break;
@@ -16821,7 +16656,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16821
16656
  for (let i = 0; i < lines.length; i++) {
16822
16657
  const line = lines[i];
16823
16658
  const { divides, type, lineHeight = 0 } = line;
16824
- if (type === LineType.BLOCK) continue;
16659
+ if (type === 1) continue;
16825
16660
  else {
16826
16661
  this._findLiquid.translateSave();
16827
16662
  this._findLiquid.translateLine(line);
@@ -16845,7 +16680,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16845
16680
  if (y >= startY_fin && y <= endY_fin) {
16846
16681
  if (x >= startX_fin && x <= endX_fin) return {
16847
16682
  node: glyph,
16848
- segmentPage: pageType === DocumentSkeletonPageType.BODY ? -1 : pi,
16683
+ segmentPage: pageType === 0 ? -1 : pi,
16849
16684
  segmentId,
16850
16685
  ratioX: x / (startX_fin + endX_fin),
16851
16686
  ratioY: y / (startY_fin + endY_fin)
@@ -16856,7 +16691,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16856
16691
  }
16857
16692
  cache.nearestNodeList.push({
16858
16693
  node: glyph,
16859
- segmentPage: pageType === DocumentSkeletonPageType.BODY ? -1 : pi,
16694
+ segmentPage: pageType === 0 ? -1 : pi,
16860
16695
  segmentId,
16861
16696
  ratioX: x / (startX_fin + endX_fin),
16862
16697
  ratioY: y / (startY_fin + endY_fin)
@@ -16877,7 +16712,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16877
16712
  if (distanceY === nearestNodeDistanceY) {
16878
16713
  cache.nearestNodeList.push({
16879
16714
  node: glyph,
16880
- segmentPage: pageType === DocumentSkeletonPageType.BODY ? -1 : pi,
16715
+ segmentPage: pageType === 0 ? -1 : pi,
16881
16716
  segmentId,
16882
16717
  ratioX: x / (startX_fin + endX_fin),
16883
16718
  ratioY: y / (startY_fin + endY_fin)
@@ -16916,7 +16751,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16916
16751
  const { left: cellLeft } = cell;
16917
16752
  (_this$_findLiquid5 = this._findLiquid) === null || _this$_findLiquid5 === void 0 || _this$_findLiquid5.translateSave();
16918
16753
  (_this$_findLiquid6 = this._findLiquid) === null || _this$_findLiquid6 === void 0 || _this$_findLiquid6.translate(cellLeft, 0);
16919
- exactMatch = (_exactMatch3 = exactMatch) !== null && _exactMatch3 !== void 0 ? _exactMatch3 : this._collectNearestNode(cell, DocumentSkeletonPageType.CELL, cell, segmentId, pi, cache, x, y, pageLength, nestLevel + 1);
16754
+ exactMatch = (_exactMatch3 = exactMatch) !== null && _exactMatch3 !== void 0 ? _exactMatch3 : this._collectNearestNode(cell, 3, cell, segmentId, pi, cache, x, y, pageLength, nestLevel + 1);
16920
16755
  (_this$_findLiquid7 = this._findLiquid) === null || _this$_findLiquid7 === void 0 || _this$_findLiquid7.translateRestore();
16921
16756
  }
16922
16757
  (_this$_findLiquid8 = this._findLiquid) === null || _this$_findLiquid8 === void 0 || _this$_findLiquid8.translateRestore();
@@ -16958,10 +16793,10 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
16958
16793
  const { x: startX, y: startY } = this._findLiquid;
16959
16794
  let endX = -1;
16960
16795
  let endY = -1;
16961
- if (pageLayoutType === PageLayoutType.VERTICAL) {
16796
+ if (pageLayoutType === 0) {
16962
16797
  endX = pageWidth;
16963
16798
  endY = startY + pageHeight;
16964
- } else if (pageLayoutType === PageLayoutType.HORIZONTAL) {
16799
+ } else if (pageLayoutType === 1) {
16965
16800
  endX = startX + pageWidth;
16966
16801
  endY = pageHeight;
16967
16802
  }
@@ -17251,7 +17086,7 @@ function getFontFormat(format) {
17251
17086
  }
17252
17087
 
17253
17088
  //#endregion
17254
- //#region \0@oxc-project+runtime@0.124.0/helpers/decorateParam.js
17089
+ //#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
17255
17090
  function __decorateParam(paramIndex, decorator) {
17256
17091
  return function(target, key) {
17257
17092
  decorator(target, key, paramIndex);
@@ -17259,7 +17094,7 @@ function __decorateParam(paramIndex, decorator) {
17259
17094
  }
17260
17095
 
17261
17096
  //#endregion
17262
- //#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
17097
+ //#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
17263
17098
  function __decorate(decorators, target, key, desc) {
17264
17099
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17265
17100
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -17595,7 +17430,7 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
17595
17430
  const paddingTop = (_style$pd$t = (_style$pd3 = style.pd) === null || _style$pd3 === void 0 ? void 0 : _style$pd3.t) !== null && _style$pd$t !== void 0 ? _style$pd$t : DEFAULT_PADDING_DATA.t;
17596
17431
  const paddingBottom = (_style$pd$b = (_style$pd4 = style.pd) === null || _style$pd4 === void 0 ? void 0 : _style$pd4.b) !== null && _style$pd$b !== void 0 ? _style$pd$b : DEFAULT_PADDING_DATA.b;
17597
17432
  if ((style === null || style === void 0 ? void 0 : style.tb) === WrapStrategy.WRAP) {
17598
- const skeleton = new DocSimpleSkeleton(`${cell.v}`, getFontStyleString(style).fontCache, (style === null || style === void 0 ? void 0 : style.tb) === WrapStrategy.WRAP, colWidth - paddingLeft - paddingRight, Infinity);
17433
+ const skeleton = new DocSimpleSkeleton(getDisplayValueFromCell(cell), getFontStyleString(style).fontCache, (style === null || style === void 0 ? void 0 : style.tb) === WrapStrategy.WRAP, colWidth - paddingLeft - paddingRight, Infinity);
17599
17434
  skeleton.calculate();
17600
17435
  return skeleton.getTotalHeight() + paddingTop + paddingBottom;
17601
17436
  } else {
@@ -17641,14 +17476,14 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
17641
17476
  _calculateColWidth(colIndex) {
17642
17477
  const worksheet = this.worksheet;
17643
17478
  let colWidth = 0;
17644
- const visibleRangeViewMain = this.visibleRangeByViewportKey(SHEET_VIEWPORT_KEY.VIEW_MAIN);
17479
+ const visibleRangeViewMain = this.visibleRangeByViewportKey("viewMain");
17645
17480
  if (!visibleRangeViewMain) return colWidth;
17646
17481
  const { startRow: startRowOfViewMain, endRow: endRowOfViewMain } = visibleRangeViewMain;
17647
17482
  const rowCount = this.worksheet.getRowCount();
17648
17483
  const otherRowIndex = /* @__PURE__ */ new Set();
17649
17484
  otherRowIndex.add(0);
17650
17485
  otherRowIndex.add(rowCount - 1);
17651
- const visibleRangeViewMainTop = this.visibleRangeByViewportKey(SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP);
17486
+ const visibleRangeViewMainTop = this.visibleRangeByViewportKey("viewMainTop");
17652
17487
  if (visibleRangeViewMainTop) {
17653
17488
  const { startRow: startRowOfViewMainTop, endRow: endRowOfViewMainTop } = visibleRangeViewMainTop;
17654
17489
  for (let i = startRowOfViewMainTop; i <= endRowOfViewMainTop; i++) otherRowIndex.add(i);
@@ -18077,22 +17912,22 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
18077
17912
  if (style && style.bd) {
18078
17913
  const mergeRange = options === null || options === void 0 ? void 0 : options.mergeRange;
18079
17914
  if (mergeRange) {
18080
- this._setMergeBorderProps(BORDER_TYPE.TOP, this._stylesCache, mergeRange);
18081
- this._setMergeBorderProps(BORDER_TYPE.BOTTOM, this._stylesCache, mergeRange);
18082
- this._setMergeBorderProps(BORDER_TYPE.LEFT, this._stylesCache, mergeRange);
18083
- this._setMergeBorderProps(BORDER_TYPE.RIGHT, this._stylesCache, mergeRange);
17915
+ this._setMergeBorderProps("t", this._stylesCache, mergeRange);
17916
+ this._setMergeBorderProps("b", this._stylesCache, mergeRange);
17917
+ this._setMergeBorderProps("l", this._stylesCache, mergeRange);
17918
+ this._setMergeBorderProps("r", this._stylesCache, mergeRange);
18084
17919
  } else if (!this.intersectMergeRange(row, col)) {
18085
- this._setBorderProps(row, col, BORDER_TYPE.TOP, style, this._stylesCache);
18086
- this._setBorderProps(row, col, BORDER_TYPE.BOTTOM, style, this._stylesCache);
18087
- this._setBorderProps(row, col, BORDER_TYPE.LEFT, style, this._stylesCache);
18088
- this._setBorderProps(row, col, BORDER_TYPE.RIGHT, style, this._stylesCache);
17920
+ this._setBorderProps(row, col, "t", style, this._stylesCache);
17921
+ this._setBorderProps(row, col, "b", style, this._stylesCache);
17922
+ this._setBorderProps(row, col, "l", style, this._stylesCache);
17923
+ this._setBorderProps(row, col, "r", style, this._stylesCache);
18089
17924
  }
18090
- this._setBorderProps(row, col, BORDER_TYPE.TL_BR, style, this._stylesCache);
18091
- this._setBorderProps(row, col, BORDER_TYPE.TL_BC, style, this._stylesCache);
18092
- this._setBorderProps(row, col, BORDER_TYPE.TL_MR, style, this._stylesCache);
18093
- this._setBorderProps(row, col, BORDER_TYPE.BL_TR, style, this._stylesCache);
18094
- this._setBorderProps(row, col, BORDER_TYPE.ML_TR, style, this._stylesCache);
18095
- this._setBorderProps(row, col, BORDER_TYPE.BC_TR, style, this._stylesCache);
17925
+ this._setBorderProps(row, col, "tl_br", style, this._stylesCache);
17926
+ this._setBorderProps(row, col, "tl_bc", style, this._stylesCache);
17927
+ this._setBorderProps(row, col, "tl_mr", style, this._stylesCache);
17928
+ this._setBorderProps(row, col, "bl_tr", style, this._stylesCache);
17929
+ this._setBorderProps(row, col, "ml_tr", style, this._stylesCache);
17930
+ this._setBorderProps(row, col, "bc_tr", style, this._stylesCache);
18096
17931
  }
18097
17932
  }
18098
17933
  _setBgStylesCache(row, col, style, options) {
@@ -18213,29 +18048,29 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
18213
18048
  let forEnd = mergeRange.endRow;
18214
18049
  let row = mergeRange.startRow;
18215
18050
  let column = mergeRange.startColumn;
18216
- if (type === BORDER_TYPE.TOP) {
18051
+ if (type === "t") {
18217
18052
  row = mergeRange.startRow;
18218
18053
  forStart = mergeRange.startColumn;
18219
18054
  forEnd = mergeRange.endColumn;
18220
- } else if (type === BORDER_TYPE.BOTTOM) {
18055
+ } else if (type === "b") {
18221
18056
  row = mergeRange.endRow;
18222
18057
  forStart = mergeRange.startColumn;
18223
18058
  forEnd = mergeRange.endColumn;
18224
- } else if (type === BORDER_TYPE.LEFT) {
18059
+ } else if (type === "l") {
18225
18060
  column = mergeRange.startColumn;
18226
18061
  forStart = mergeRange.startRow;
18227
18062
  forEnd = mergeRange.endRow;
18228
- } else if (type === BORDER_TYPE.RIGHT) {
18063
+ } else if (type === "r") {
18229
18064
  column = mergeRange.endColumn;
18230
18065
  forStart = mergeRange.startRow;
18231
18066
  forEnd = mergeRange.endRow;
18232
18067
  }
18233
18068
  for (let i = forStart; i <= forEnd; i++) {
18234
18069
  var _cell$themeStyle, _style$bd$type, _style$bd;
18235
- if (type === BORDER_TYPE.TOP) column = i;
18236
- else if (type === BORDER_TYPE.BOTTOM) column = i;
18237
- else if (type === BORDER_TYPE.LEFT) row = i;
18238
- else if (type === BORDER_TYPE.RIGHT) row = i;
18070
+ if (type === "t") column = i;
18071
+ else if (type === "b") column = i;
18072
+ else if (type === "l") row = i;
18073
+ else if (type === "r") row = i;
18239
18074
  const cell = this.worksheet.getCell(row, column);
18240
18075
  if (!cell) break;
18241
18076
  const themeStyleBackground = (_cell$themeStyle = cell.themeStyle) === null || _cell$themeStyle === void 0 ? void 0 : _cell$themeStyle.bd;
@@ -18275,12 +18110,12 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
18275
18110
  * When the top border of a cell and the bottom border of the cell above it (r-1) overlap,
18276
18111
  * if the top border of cell r is white, then the rendering is ignored.
18277
18112
  */
18278
- if (type === BORDER_TYPE.TOP) {
18113
+ if (type === "t") {
18279
18114
  var _borderCache$getValue;
18280
- if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue[BORDER_TYPE.BOTTOM]) && isWhiteColor(rgb)) return;
18281
- } else if (type === BORDER_TYPE.LEFT) {
18115
+ if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue["b"]) && isWhiteColor(rgb)) return;
18116
+ } else if (type === "l") {
18282
18117
  var _borderCache$getValue2;
18283
- if (((_borderCache$getValue2 = borderCache.getValue(r, c - 1)) === null || _borderCache$getValue2 === void 0 ? void 0 : _borderCache$getValue2[BORDER_TYPE.RIGHT]) && isWhiteColor(rgb)) return;
18118
+ if (((_borderCache$getValue2 = borderCache.getValue(r, c - 1)) === null || _borderCache$getValue2 === void 0 ? void 0 : _borderCache$getValue2["r"]) && isWhiteColor(rgb)) return;
18284
18119
  }
18285
18120
  borderCache.getValue(r, c)[type] = {
18286
18121
  type,
@@ -18679,7 +18514,7 @@ var Font = class extends SheetExtension {
18679
18514
  const paddingBottom = (_padding$b = padding.b) !== null && _padding$b !== void 0 ? _padding$b : DEFAULT_PADDING_DATA.b;
18680
18515
  const { vertexAngle = 0, wrapStrategy, cellData } = fontCache;
18681
18516
  if ((cellData === null || cellData === void 0 ? void 0 : cellData.v) === void 0 || (cellData === null || cellData === void 0 ? void 0 : cellData.v) === null) return;
18682
- const text = extractPureTextFromCell(cellData);
18517
+ const text = getDisplayValueFromCell(cellData);
18683
18518
  const { startX, startY, endX, endY } = renderFontCtx;
18684
18519
  const cellWidth = endX - startX - paddingLeft - paddingRight;
18685
18520
  const cellHeight = endY - startY - paddingTop - paddingBottom;
@@ -19127,7 +18962,7 @@ var DocComponent = class extends RenderComponent {
19127
18962
  this._skeleton = _skeleton;
19128
18963
  _defineProperty(this, "pageMarginLeft", 0);
19129
18964
  _defineProperty(this, "pageMarginTop", 0);
19130
- _defineProperty(this, "pageLayoutType", PageLayoutType.VERTICAL);
18965
+ _defineProperty(this, "pageLayoutType", 0);
19131
18966
  this._setConfig(config);
19132
18967
  }
19133
18968
  getSkeleton() {
@@ -19142,7 +18977,7 @@ var DocComponent = class extends RenderComponent {
19142
18977
  if ((config === null || config === void 0 ? void 0 : config.pageMarginTop) != null) this.pageMarginTop = config === null || config === void 0 ? void 0 : config.pageMarginTop;
19143
18978
  else this.pageMarginTop = 14;
19144
18979
  if ((config === null || config === void 0 ? void 0 : config.pageLayoutType) != null) this.pageLayoutType = config === null || config === void 0 ? void 0 : config.pageLayoutType;
19145
- else this.pageLayoutType = PageLayoutType.VERTICAL;
18980
+ else this.pageLayoutType = 0;
19146
18981
  }
19147
18982
  render(mainCtx, bounds) {
19148
18983
  if (!this.visible) {
@@ -19162,7 +18997,7 @@ var DocComponent = class extends RenderComponent {
19162
18997
  scaleY: 1
19163
18998
  };
19164
18999
  let { scaleX = 1, scaleY = 1 } = this.parent;
19165
- if (this.parent.classType === RENDER_CLASS_TYPE.SCENE) {
19000
+ if (this.parent.classType === "Scene") {
19166
19001
  scaleX = this.parent.ancestorScaleX || 1;
19167
19002
  scaleY = this.parent.ancestorScaleY || 1;
19168
19003
  }
@@ -19186,15 +19021,10 @@ var DocComponent = class extends RenderComponent {
19186
19021
 
19187
19022
  //#endregion
19188
19023
  //#region src/components/docs/doc-extension.ts
19189
- let DOCS_EXTENSION_TYPE = /* @__PURE__ */ function(DOCS_EXTENSION_TYPE) {
19190
- DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["SPAN"] = 0] = "SPAN";
19191
- DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["LINE"] = 1] = "LINE";
19192
- return DOCS_EXTENSION_TYPE;
19193
- }({});
19194
19024
  var docExtension = class extends ComponentExtension {
19195
19025
  constructor(..._args) {
19196
19026
  super(..._args);
19197
- _defineProperty(this, "type", DOCS_EXTENSION_TYPE.SPAN);
19027
+ _defineProperty(this, "type", 0);
19198
19028
  _defineProperty(this, "translateX", 0);
19199
19029
  _defineProperty(this, "translateY", 0);
19200
19030
  }
@@ -19289,10 +19119,10 @@ var Border$1 = class extends docExtension {
19289
19119
  _createBorderCache(borderData) {
19290
19120
  const { t, b, l, r } = borderData;
19291
19121
  const borderCache = /* @__PURE__ */ new Map();
19292
- t && borderCache.set(BORDER_TYPE.TOP, t);
19293
- b && borderCache.set(BORDER_TYPE.BOTTOM, b);
19294
- l && borderCache.set(BORDER_TYPE.LEFT, l);
19295
- r && borderCache.set(BORDER_TYPE.RIGHT, r);
19122
+ t && borderCache.set("t", t);
19123
+ b && borderCache.set("b", b);
19124
+ l && borderCache.set("l", l);
19125
+ r && borderCache.set("r", r);
19296
19126
  return borderCache;
19297
19127
  }
19298
19128
  };
@@ -19344,12 +19174,12 @@ var Circle = class Circle extends Shape {
19344
19174
  constructor(key, props) {
19345
19175
  super(key, props);
19346
19176
  _defineProperty(this, "_radius", void 0);
19347
- _defineProperty(this, "objectType", ObjectType.CIRCLE);
19177
+ _defineProperty(this, "objectType", 5);
19348
19178
  this._radius = (props === null || props === void 0 ? void 0 : props.radius) || 10;
19349
19179
  this._setFixBoundingBox();
19350
19180
  this.onTransformChange$.subscribeEvent((changeState) => {
19351
19181
  const { type, value, preValue } = changeState;
19352
- if (type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize || type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.all) {
19182
+ if (type === 1 || type === 5) {
19353
19183
  const value = Math.min(this.width, this.height);
19354
19184
  this._radius = value / 2;
19355
19185
  this.width = value;
@@ -19418,7 +19248,7 @@ const RECT_OBJECT_ARRAY = ["radius"];
19418
19248
  var Rect = class Rect extends Shape {
19419
19249
  constructor(key, props) {
19420
19250
  super(key, props);
19421
- _defineProperty(this, "objectType", ObjectType.RECT);
19251
+ _defineProperty(this, "objectType", 4);
19422
19252
  _defineProperty(this, "_radius", 0);
19423
19253
  _defineProperty(this, "_opacity", 1);
19424
19254
  _defineProperty(this, "_visualHeight", void 0);
@@ -19606,7 +19436,7 @@ var Image$1 = class extends Shape {
19606
19436
  _defineProperty(this, "_renderByCropper", false);
19607
19437
  _defineProperty(this, "_transformCalculateSrcRect", true);
19608
19438
  _defineProperty(this, "_clipService", null);
19609
- _defineProperty(this, "objectType", ObjectType.IMAGE);
19439
+ _defineProperty(this, "objectType", 3);
19610
19440
  _defineProperty(this, "isDrawingObject", true);
19611
19441
  this._props = { ...config };
19612
19442
  if (config.image) {
@@ -19654,7 +19484,7 @@ var Image$1 = class extends Shape {
19654
19484
  return this._clipService;
19655
19485
  }
19656
19486
  get classType() {
19657
- return RENDER_CLASS_TYPE.IMAGE;
19487
+ return "Image";
19658
19488
  }
19659
19489
  transformByStateCloseCropper(option) {
19660
19490
  this._transformCalculateSrcRect = false;
@@ -19872,7 +19702,7 @@ var Image$1 = class extends Shape {
19872
19702
  centerY
19873
19703
  ]);
19874
19704
  const parent = this.getParent();
19875
- const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === RENDER_CLASS_TYPE.GROUP ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
19705
+ const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
19876
19706
  const halfWidth = realWidth / 2;
19877
19707
  const halfHeight = realHeight / 2;
19878
19708
  if (oCoord.x >= -halfWidth - this.strokeWidth / 2 && oCoord.x <= halfWidth + this.strokeWidth / 2 && oCoord.y >= -halfHeight - this.strokeWidth / 2 && oCoord.y <= halfHeight + this.strokeWidth / 2) return true;
@@ -19901,7 +19731,7 @@ var Path = class Path extends Shape {
19901
19731
  this._setFixBoundingBox();
19902
19732
  this.onTransformChange$.subscribeEvent((changeState) => {
19903
19733
  const { type, preValue } = changeState;
19904
- if (type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize || type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.all) {
19734
+ if (type === 1 || type === 5) {
19905
19735
  this._reCalculateCache = true;
19906
19736
  const { left, top, width, height } = this._getSelfRect();
19907
19737
  const { width: preWidth, height: preHeight } = preValue;
@@ -20569,7 +20399,7 @@ var RegularPolygon = class RegularPolygon extends Shape {
20569
20399
  this._setFixBoundingBox();
20570
20400
  this.onTransformChange$.subscribeEvent((changeState) => {
20571
20401
  const { type, value, preValue } = changeState;
20572
- if (type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize || type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.all) this.resizePolygon(preValue);
20402
+ if (type === 1 || type === 5) this.resizePolygon(preValue);
20573
20403
  });
20574
20404
  }
20575
20405
  get pointsGroup() {
@@ -20736,7 +20566,7 @@ var RichText = class extends BaseObject {
20736
20566
  _defineProperty(this, "_bg", void 0);
20737
20567
  _defineProperty(this, "_bd", void 0);
20738
20568
  _defineProperty(this, "_cl", void 0);
20739
- _defineProperty(this, "objectType", ObjectType.RICH_TEXT);
20569
+ _defineProperty(this, "objectType", 1);
20740
20570
  if (props === null || props === void 0 ? void 0 : props.richText) this._documentData = props.richText;
20741
20571
  else if (props) {
20742
20572
  this._fs = props.fs;
@@ -20761,7 +20591,7 @@ var RichText = class extends BaseObject {
20761
20591
  this._initialProps(props);
20762
20592
  this.onTransformChange$.subscribeEvent((changeState) => {
20763
20593
  const { type } = changeState;
20764
- if (type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize || type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.all) {
20594
+ if (type === 1 || type === 5) {
20765
20595
  docModel.updateDocumentDataPageSize(this.width);
20766
20596
  this._documentSkeleton.makeDirty(true);
20767
20597
  this._documentSkeleton.calculate();
@@ -21454,7 +21284,7 @@ var FontAndBaseLine = class extends docExtension {
21454
21284
  ctx.restore();
21455
21285
  } else {
21456
21286
  const CHECKED_GLYPH = "☑";
21457
- if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === GlyphType.LIST) {
21287
+ if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === 2) {
21458
21288
  var _glyph$ts$fs, _glyph$ts;
21459
21289
  const size = Math.ceil(((_glyph$ts$fs = (_glyph$ts = glyph.ts) === null || _glyph$ts === void 0 ? void 0 : _glyph$ts.fs) !== null && _glyph$ts$fs !== void 0 ? _glyph$ts$fs : 12) * 1.2);
21460
21290
  ctx.save();
@@ -21713,7 +21543,7 @@ var Documents = class Documents extends DocComponent {
21713
21543
  const extensions = this.getExtensionsByOrder();
21714
21544
  for (const extension of extensions) extension.clearCache();
21715
21545
  const backgroundExtension = extensions.find((e) => e.uKey === "DefaultDocsBackgroundExtension");
21716
- const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === DOCS_EXTENSION_TYPE.SPAN && e.uKey !== "DefaultDocsBackgroundExtension");
21546
+ const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === 0 && e.uKey !== "DefaultDocsBackgroundExtension");
21717
21547
  let pageTop = 0;
21718
21548
  let pageLeft = 0;
21719
21549
  for (let i = 0, len = pages.length; i < len; i++) {
@@ -21771,8 +21601,8 @@ var Documents = class Documents extends DocComponent {
21771
21601
  const maxLineAsc = asc;
21772
21602
  const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
21773
21603
  const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
21774
- if (type === LineType.BLOCK) {
21775
- for (const extension of extensions) if (extension.type === DOCS_EXTENSION_TYPE.LINE) {
21604
+ if (type === 1) {
21605
+ for (const extension of extensions) if (extension.type === 1) {
21776
21606
  extension.extensionOffset = {
21777
21607
  alignOffset,
21778
21608
  renderConfig
@@ -21882,7 +21712,7 @@ var Documents = class Documents extends DocComponent {
21882
21712
  ctx.save();
21883
21713
  ctx.setLineWidthByPrecision(1);
21884
21714
  ctx.strokeStyle = (_line$borderBottom$co = (_line$borderBottom2 = line.borderBottom) === null || _line$borderBottom2 === void 0 ? void 0 : _line$borderBottom2.color.rgb) !== null && _line$borderBottom$co !== void 0 ? _line$borderBottom$co : "#CDD0D8";
21885
- drawLineByBorderType(ctx, BORDER_TYPE.BOTTOM, 0, {
21715
+ drawLineByBorderType(ctx, "b", 0, {
21886
21716
  startX: x,
21887
21717
  startY: y,
21888
21718
  endX: x + pageWidth - marginLeft - marginRight,
@@ -21918,8 +21748,8 @@ var Documents = class Documents extends DocComponent {
21918
21748
  const maxLineAsc = asc;
21919
21749
  const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
21920
21750
  const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
21921
- if (type === LineType.BLOCK) {
21922
- for (const extension of extensions) if (extension.type === DOCS_EXTENSION_TYPE.LINE) {
21751
+ if (type === 1) {
21752
+ for (const extension of extensions) if (extension.type === 1) {
21923
21753
  extension.extensionOffset = {
21924
21754
  alignOffset,
21925
21755
  renderConfig
@@ -21999,7 +21829,7 @@ var Documents = class Documents extends DocComponent {
21999
21829
  ctx.setLineWidthByPrecision(1);
22000
21830
  ctx.save();
22001
21831
  ctx.strokeStyle = (_borderLeft$color$rgb = borderLeft.color.rgb) !== null && _borderLeft$color$rgb !== void 0 ? _borderLeft$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
22002
- drawLineByBorderType(ctx, BORDER_TYPE.LEFT, 0, {
21832
+ drawLineByBorderType(ctx, "l", 0, {
22003
21833
  startX: x,
22004
21834
  startY: y,
22005
21835
  endX: x + pageWidth,
@@ -22008,7 +21838,7 @@ var Documents = class Documents extends DocComponent {
22008
21838
  ctx.restore();
22009
21839
  ctx.save();
22010
21840
  ctx.strokeStyle = (_borderTop$color$rgb = borderTop.color.rgb) !== null && _borderTop$color$rgb !== void 0 ? _borderTop$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
22011
- drawLineByBorderType(ctx, BORDER_TYPE.TOP, 0, {
21841
+ drawLineByBorderType(ctx, "t", 0, {
22012
21842
  startX: x,
22013
21843
  startY: y,
22014
21844
  endX: x + pageWidth,
@@ -22017,7 +21847,7 @@ var Documents = class Documents extends DocComponent {
22017
21847
  ctx.restore();
22018
21848
  ctx.save();
22019
21849
  ctx.strokeStyle = (_borderRight$color$rg = borderRight.color.rgb) !== null && _borderRight$color$rg !== void 0 ? _borderRight$color$rg : DEFAULT_BORDER_COLOR.color.rgb;
22020
- drawLineByBorderType(ctx, BORDER_TYPE.RIGHT, 0, {
21850
+ drawLineByBorderType(ctx, "r", 0, {
22021
21851
  startX: x,
22022
21852
  startY: y,
22023
21853
  endX: x + pageWidth,
@@ -22026,7 +21856,7 @@ var Documents = class Documents extends DocComponent {
22026
21856
  ctx.restore();
22027
21857
  ctx.save();
22028
21858
  ctx.strokeStyle = (_borderBottom$color$r = borderBottom.color.rgb) !== null && _borderBottom$color$r !== void 0 ? _borderBottom$color$r : DEFAULT_BORDER_COLOR.color.rgb;
22029
- drawLineByBorderType(ctx, BORDER_TYPE.BOTTOM, 0, {
21859
+ drawLineByBorderType(ctx, "b", 0, {
22030
21860
  startX: x,
22031
21861
  startY: y,
22032
21862
  endX: x + pageWidth,
@@ -22055,8 +21885,8 @@ var Documents = class Documents extends DocComponent {
22055
21885
  const maxLineAsc = asc;
22056
21886
  const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
22057
21887
  const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
22058
- if (type === LineType.BLOCK) {
22059
- for (const extension of extensions) if (extension.type === DOCS_EXTENSION_TYPE.LINE) {
21888
+ if (type === 1) {
21889
+ for (const extension of extensions) if (extension.type === 1) {
22060
21890
  extension.extensionOffset = {
22061
21891
  alignOffset,
22062
21892
  renderConfig
@@ -22479,14 +22309,14 @@ var Spreadsheet = class extends SheetComponent {
22479
22309
  _getAncestorSize() {
22480
22310
  const parent = this._getAncestorParent();
22481
22311
  if (!parent) return;
22482
- if (parent.classType === RENDER_CLASS_TYPE.ENGINE) {
22312
+ if (parent.classType === "Engine") {
22483
22313
  const mainCanvas = parent.getCanvas();
22484
22314
  return {
22485
22315
  width: mainCanvas.getWidth(),
22486
22316
  height: mainCanvas.getHeight()
22487
22317
  };
22488
22318
  }
22489
- if (parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) return {
22319
+ if (parent.classType === "SceneViewer") return {
22490
22320
  width: parent.width,
22491
22321
  height: parent.height
22492
22322
  };
@@ -22494,7 +22324,7 @@ var Spreadsheet = class extends SheetComponent {
22494
22324
  _getAncestorParent() {
22495
22325
  let parent = this.parent;
22496
22326
  while (parent) {
22497
- if (parent.classType === RENDER_CLASS_TYPE.ENGINE || parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) return parent;
22327
+ if (parent.classType === "Engine" || parent.classType === "SceneViewer") return parent;
22498
22328
  parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
22499
22329
  }
22500
22330
  }
@@ -22751,9 +22581,9 @@ let IWatermarkTypeEnum = /* @__PURE__ */ function(IWatermarkTypeEnum) {
22751
22581
  function renderWatermark(ctx, config, image, userInfo) {
22752
22582
  const type = config.type;
22753
22583
  const watermarkConfig = config.config;
22754
- if (type === IWatermarkTypeEnum.UserInfo && watermarkConfig.userInfo) renderUserInfoWatermark(ctx, watermarkConfig.userInfo, userInfo);
22755
- else if (type === IWatermarkTypeEnum.Image && watermarkConfig.image) renderImageWatermark(ctx, watermarkConfig.image, image);
22756
- else if (type === IWatermarkTypeEnum.Text && watermarkConfig.text) renderTextWatermark(ctx, watermarkConfig.text);
22584
+ if (type === "userInfo" && watermarkConfig.userInfo) renderUserInfoWatermark(ctx, watermarkConfig.userInfo, userInfo);
22585
+ else if (type === "image" && watermarkConfig.image) renderImageWatermark(ctx, watermarkConfig.image, image);
22586
+ else if (type === "text" && watermarkConfig.text) renderTextWatermark(ctx, watermarkConfig.text);
22757
22587
  }
22758
22588
  function renderUserInfoWatermark(ctx, config, userInfo) {
22759
22589
  const { x, y, repeat, spacingX, spacingY, rotate, opacity, name, fontSize, color, bold, italic, direction } = config;
@@ -22909,7 +22739,7 @@ var Layer = class extends Disposable {
22909
22739
  * @returns {Layer} this
22910
22740
  */
22911
22741
  addObject(o) {
22912
- if (o.classType === RENDER_CLASS_TYPE.GROUP) {
22742
+ if (o.classType === "Group") {
22913
22743
  const objects = o.getObjects();
22914
22744
  for (const object of objects) {
22915
22745
  if (this.scene.getObject(object.oKey)) continue;
@@ -22971,7 +22801,7 @@ var Layer = class extends Disposable {
22971
22801
  * parent is SceneViewer, make it dirty
22972
22802
  */
22973
22803
  const parent = this.scene.getParent();
22974
- if (parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) parent.makeDirty(true);
22804
+ if (parent.classType === "SceneViewer") parent.makeDirty(true);
22975
22805
  return this;
22976
22806
  }
22977
22807
  makeDirtyWithDebounce(state = true) {
@@ -23078,7 +22908,7 @@ var WatermarkLayer = class extends Layer {
23078
22908
  updateConfig(config, user) {
23079
22909
  var _this$_config;
23080
22910
  this._config = config;
23081
- if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) === IWatermarkTypeEnum.Image && this._config.config.image) {
22911
+ if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) === "image" && this._config.config.image) {
23082
22912
  this._image = new Image();
23083
22913
  this._image.src = this._config.config.image.url;
23084
22914
  }
@@ -23116,7 +22946,7 @@ var SceneViewer = class extends BaseObject {
23116
22946
  this._initialProps(props);
23117
22947
  }
23118
22948
  get classType() {
23119
- return RENDER_CLASS_TYPE.SCENE_VIEWER;
22949
+ return "SceneViewer";
23120
22950
  }
23121
22951
  render(mainCtx, bounds) {
23122
22952
  var _this$_activeSubScene;
@@ -23243,7 +23073,7 @@ var Slide = class extends SceneViewer {
23243
23073
  addNavigation() {
23244
23074
  const scene = this.getActiveSubScene();
23245
23075
  if (scene == null || this._navigationEnabled === false) return;
23246
- const leftArrow = new Path(SLIDE_NAVIGATION_KEY.LEFT, {
23076
+ const leftArrow = new Path("__slideNavigationLeft__", {
23247
23077
  data: arrowPath,
23248
23078
  width: 60,
23249
23079
  height: 60,
@@ -23252,7 +23082,7 @@ var Slide = class extends SceneViewer {
23252
23082
  fill: this._getArrowColor(),
23253
23083
  flipX: true
23254
23084
  });
23255
- const rightArrow = new Path(SLIDE_NAVIGATION_KEY.RIGHT, {
23085
+ const rightArrow = new Path("__slideNavigationRight__", {
23256
23086
  data: arrowPath,
23257
23087
  width: 60,
23258
23088
  height: 60,
@@ -23261,11 +23091,11 @@ var Slide = class extends SceneViewer {
23261
23091
  fill: this._getArrowColor()
23262
23092
  });
23263
23093
  const hoverIn = (o, evt) => {
23264
- o.setCursor(CURSOR_TYPE.POINTER);
23094
+ o.setCursor("pointer");
23265
23095
  o.setProps({ fill: this._getArrowColor(true) });
23266
23096
  };
23267
23097
  const hoverOut = (o, evt) => {
23268
- o.setCursor(CURSOR_TYPE.DEFAULT);
23098
+ o.setCursor("default");
23269
23099
  o.setProps({ fill: this._getArrowColor() });
23270
23100
  };
23271
23101
  attachObjectHover(leftArrow, hoverIn, hoverOut);
@@ -23277,8 +23107,8 @@ var Slide = class extends SceneViewer {
23277
23107
  var _scene$getObject, _scene$getObject2;
23278
23108
  const scene = this.getActiveSubScene();
23279
23109
  if (scene == null || this._navigationEnabled === false) return;
23280
- (_scene$getObject = scene.getObject(SLIDE_NAVIGATION_KEY.LEFT)) === null || _scene$getObject === void 0 || _scene$getObject.dispose();
23281
- (_scene$getObject2 = scene.getObject(SLIDE_NAVIGATION_KEY.RIGHT)) === null || _scene$getObject2 === void 0 || _scene$getObject2.dispose();
23110
+ (_scene$getObject = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject === void 0 || _scene$getObject.dispose();
23111
+ (_scene$getObject2 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject2 === void 0 || _scene$getObject2.dispose();
23282
23112
  }
23283
23113
  enableNav() {
23284
23114
  this._navigationEnabled = true;
@@ -23290,15 +23120,15 @@ var Slide = class extends SceneViewer {
23290
23120
  var _scene$getObject3, _scene$getObject4;
23291
23121
  const scene = this.getActiveSubScene();
23292
23122
  if (scene == null || this._navigationEnabled === false) return;
23293
- (_scene$getObject3 = scene.getObject(SLIDE_NAVIGATION_KEY.LEFT)) === null || _scene$getObject3 === void 0 || _scene$getObject3.hide();
23294
- (_scene$getObject4 = scene.getObject(SLIDE_NAVIGATION_KEY.RIGHT)) === null || _scene$getObject4 === void 0 || _scene$getObject4.hide();
23123
+ (_scene$getObject3 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject3 === void 0 || _scene$getObject3.hide();
23124
+ (_scene$getObject4 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject4 === void 0 || _scene$getObject4.hide();
23295
23125
  }
23296
23126
  showNav() {
23297
23127
  var _scene$getObject5, _scene$getObject6;
23298
23128
  const scene = this.getActiveSubScene();
23299
23129
  if (scene == null || this._navigationEnabled === false) return;
23300
- (_scene$getObject5 = scene.getObject(SLIDE_NAVIGATION_KEY.LEFT)) === null || _scene$getObject5 === void 0 || _scene$getObject5.show();
23301
- (_scene$getObject6 = scene.getObject(SLIDE_NAVIGATION_KEY.RIGHT)) === null || _scene$getObject6 === void 0 || _scene$getObject6.show();
23130
+ (_scene$getObject5 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject5 === void 0 || _scene$getObject5.show();
23131
+ (_scene$getObject6 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject6 === void 0 || _scene$getObject6.show();
23302
23132
  }
23303
23133
  renderToThumb(mainCtx, pageId, scaleX = 1, scaleY = 1) {
23304
23134
  const scene = this.getSubScene(pageId);
@@ -23512,7 +23342,7 @@ var Group = class extends BaseObject {
23512
23342
  this.addObjects(...objects);
23513
23343
  }
23514
23344
  get classType() {
23515
- return RENDER_CLASS_TYPE.GROUP;
23345
+ return "Group";
23516
23346
  }
23517
23347
  set cursor(val) {
23518
23348
  this.setCursor(val);
@@ -23632,7 +23462,7 @@ var Group = class extends BaseObject {
23632
23462
  }
23633
23463
  _transformObject(object, groupWidth, groupHeight) {
23634
23464
  const transform = transformObjectOutOfGroup(object.getState(), this.getState(), groupWidth, groupHeight);
23635
- if (object.classType === RENDER_CLASS_TYPE.GROUP) object.transformByState({
23465
+ if (object.classType === "Group") object.transformByState({
23636
23466
  left: transform.left,
23637
23467
  top: transform.top
23638
23468
  });
@@ -23716,7 +23546,7 @@ var DrawingGroupObject = class extends Group {
23716
23546
  centerY
23717
23547
  ]);
23718
23548
  const parent = this.getParent();
23719
- if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === RENDER_CLASS_TYPE.GROUP) return parent.ancestorTransform.multiply(renderTransform);
23549
+ if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent.ancestorTransform.multiply(renderTransform);
23720
23550
  return renderTransform;
23721
23551
  }
23722
23552
  render(ctx, bounds) {
@@ -23747,7 +23577,7 @@ var DrawingGroupObject = class extends Group {
23747
23577
  centerY
23748
23578
  ]);
23749
23579
  const parent = this.getParent();
23750
- const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === RENDER_CLASS_TYPE.GROUP ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
23580
+ const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
23751
23581
  const halfWidth = realWidth / 2;
23752
23582
  const halfHeight = realHeight / 2;
23753
23583
  if (oCoord.x < -halfWidth || oCoord.x > halfWidth || oCoord.y < -halfHeight || oCoord.y > halfHeight) return false;
@@ -23991,7 +23821,7 @@ let Engine = class Engine extends Disposable {
23991
23821
  return this.getCanvas().getHeight();
23992
23822
  }
23993
23823
  get classType() {
23994
- return RENDER_CLASS_TYPE.ENGINE;
23824
+ return "Engine";
23995
23825
  }
23996
23826
  get activeScene() {
23997
23827
  return this._activeScene;
@@ -24061,7 +23891,7 @@ let Engine = class Engine extends Disposable {
24061
23891
  const options = Object.assign({}, {
24062
23892
  elementHeight: 1,
24063
23893
  elementWidth: 1,
24064
- renderMode: CanvasRenderMode.Rendering,
23894
+ renderMode: 0,
24065
23895
  dpr: 1
24066
23896
  }, _options);
24067
23897
  this._canvas = new Canvas({
@@ -24075,7 +23905,7 @@ let Engine = class Engine extends Disposable {
24075
23905
  this._handleKeyboardAction();
24076
23906
  this._handlePointerAction();
24077
23907
  this._handleDragAction();
24078
- if (options.renderMode !== CanvasRenderMode.Printing) this._matchMediaHandler();
23908
+ if (options.renderMode !== 1) this._matchMediaHandler();
24079
23909
  }
24080
23910
  getScenes() {
24081
23911
  return this._scenes;
@@ -24208,7 +24038,7 @@ let Engine = class Engine extends Disposable {
24208
24038
  const preHeight = this.height;
24209
24039
  this.getCanvas().setSize(width, height);
24210
24040
  this.onTransformChange$.emitEvent({
24211
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize,
24041
+ type: 1,
24212
24042
  value: {
24213
24043
  width,
24214
24044
  height
@@ -24354,13 +24184,13 @@ let Engine = class Engine extends Disposable {
24354
24184
  _handleKeyboardAction() {
24355
24185
  const keyboardDownEvent = (evt) => {
24356
24186
  const deviceEvent = evt;
24357
- deviceEvent.deviceType = DeviceType.Keyboard;
24187
+ deviceEvent.deviceType = 1;
24358
24188
  deviceEvent.inputIndex = evt.keyCode;
24359
24189
  this.onInputChanged$.emitEvent(deviceEvent);
24360
24190
  };
24361
24191
  const keyboardUpEvent = (evt) => {
24362
24192
  const deviceEvent = evt;
24363
- deviceEvent.deviceType = DeviceType.Keyboard;
24193
+ deviceEvent.deviceType = 1;
24364
24194
  deviceEvent.inputIndex = evt.keyCode;
24365
24195
  this.onInputChanged$.emitEvent(deviceEvent);
24366
24196
  };
@@ -24385,13 +24215,13 @@ let Engine = class Engine extends Disposable {
24385
24215
  this._pointerMoveEvent = (e) => {
24386
24216
  const evt = e;
24387
24217
  const deviceType = this._getPointerType(evt);
24388
- this._pointerPosRecord[PointerInput.Horizontal] = evt.clientX;
24389
- this._pointerPosRecord[PointerInput.Vertical] = evt.clientY;
24390
- this._pointerPosRecord[PointerInput.DeltaHorizontal] = evt.movementX;
24391
- this._pointerPosRecord[PointerInput.DeltaVertical] = evt.movementY;
24218
+ this._pointerPosRecord[0] = evt.clientX;
24219
+ this._pointerPosRecord[1] = evt.clientY;
24220
+ this._pointerPosRecord[10] = evt.movementX;
24221
+ this._pointerPosRecord[11] = evt.movementY;
24392
24222
  const deviceEvent = evt;
24393
24223
  deviceEvent.deviceType = deviceType;
24394
- deviceEvent.inputIndex = PointerInput.Horizontal;
24224
+ deviceEvent.inputIndex = 0;
24395
24225
  this.onInputChanged$.emitEvent(deviceEvent);
24396
24226
  if (!this._usingSafari) {
24397
24227
  deviceEvent.inputIndex = evt.button + 2;
@@ -24401,23 +24231,23 @@ let Engine = class Engine extends Disposable {
24401
24231
  this._pointerDownEvent = (nativeEvent) => {
24402
24232
  const evt = nativeEvent;
24403
24233
  const deviceType = this._getPointerType(evt);
24404
- const previousHorizontal = this._pointerPosRecord[PointerInput.Horizontal];
24405
- const previousVertical = this._pointerPosRecord[PointerInput.Vertical];
24406
- if (deviceType === DeviceType.Mouse) {
24234
+ const previousHorizontal = this._pointerPosRecord[0];
24235
+ const previousVertical = this._pointerPosRecord[1];
24236
+ if (deviceType === 2) {
24407
24237
  if (this._mouseId === -1) if (evt.pointerId === void 0) this._mouseId = this._isUsingFirefox ? 0 : 1;
24408
24238
  else this._mouseId = evt.pointerId;
24409
24239
  if (!document.pointerLockElement) this._remainCapture = this._mouseId;
24410
24240
  } else if (evt.pointerId && !document.pointerLockElement) this._remainCapture = evt.pointerId;
24411
- this._pointerPosRecord[PointerInput.Horizontal] = evt.clientX;
24412
- this._pointerPosRecord[PointerInput.Vertical] = evt.clientY;
24241
+ this._pointerPosRecord[0] = evt.clientX;
24242
+ this._pointerPosRecord[1] = evt.clientY;
24413
24243
  const deviceEvent = evt;
24414
24244
  deviceEvent.deviceType = deviceType;
24415
24245
  if (previousHorizontal !== evt.clientX) {
24416
- deviceEvent.inputIndex = PointerInput.Horizontal;
24246
+ deviceEvent.inputIndex = 0;
24417
24247
  this.onInputChanged$.emitEvent(deviceEvent);
24418
24248
  }
24419
24249
  if (previousVertical !== evt.clientY) {
24420
- deviceEvent.inputIndex = PointerInput.Vertical;
24250
+ deviceEvent.inputIndex = 1;
24421
24251
  this.onInputChanged$.emitEvent(deviceEvent);
24422
24252
  }
24423
24253
  deviceEvent.inputIndex = evt.button + 2;
@@ -24426,23 +24256,23 @@ let Engine = class Engine extends Disposable {
24426
24256
  this._pointerUpEvent = (_evt) => {
24427
24257
  const evt = _evt;
24428
24258
  const deviceType = this._getPointerType(evt);
24429
- const previousHorizontal = this._pointerPosRecord[PointerInput.Horizontal];
24430
- const previousVertical = this._pointerPosRecord[PointerInput.Vertical];
24431
- this._pointerPosRecord[PointerInput.Horizontal] = evt.clientX;
24432
- this._pointerPosRecord[PointerInput.Vertical] = evt.clientY;
24259
+ const previousHorizontal = this._pointerPosRecord[0];
24260
+ const previousVertical = this._pointerPosRecord[1];
24261
+ this._pointerPosRecord[0] = evt.clientX;
24262
+ this._pointerPosRecord[1] = evt.clientY;
24433
24263
  const deviceEvent = evt;
24434
24264
  deviceEvent.deviceType = deviceType;
24435
24265
  if (previousHorizontal !== evt.clientX) {
24436
- deviceEvent.inputIndex = PointerInput.Horizontal;
24266
+ deviceEvent.inputIndex = 0;
24437
24267
  this.onInputChanged$.emitEvent(deviceEvent);
24438
24268
  }
24439
24269
  if (previousVertical !== evt.clientY) {
24440
- deviceEvent.inputIndex = PointerInput.Vertical;
24270
+ deviceEvent.inputIndex = 1;
24441
24271
  this.onInputChanged$.emitEvent(deviceEvent);
24442
24272
  }
24443
24273
  deviceEvent.inputIndex = evt.button + 2;
24444
24274
  const canvasEle = this.getCanvasElement();
24445
- if (deviceType === DeviceType.Mouse && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
24275
+ if (deviceType === 2 && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
24446
24276
  this._remainCapture = this._mouseId;
24447
24277
  canvasEle.releasePointerCapture(this._mouseId);
24448
24278
  } else if (deviceEvent.pointerId && canvasEle.hasPointerCapture(deviceEvent.pointerId)) {
@@ -24450,7 +24280,7 @@ let Engine = class Engine extends Disposable {
24450
24280
  canvasEle.releasePointerCapture(deviceEvent.pointerId);
24451
24281
  }
24452
24282
  this.onInputChanged$.emitEvent(deviceEvent);
24453
- if (deviceType !== DeviceType.Mouse) this._pointerPosRecord = {};
24283
+ if (deviceType !== 2) this._pointerPosRecord = {};
24454
24284
  };
24455
24285
  this._pointerEnterEvent = (evt) => {
24456
24286
  const deviceType = this._getPointerType(evt);
@@ -24481,15 +24311,15 @@ let Engine = class Engine extends Disposable {
24481
24311
  this._pointerPosRecord = {};
24482
24312
  };
24483
24313
  this._pointerWheelEvent = (evt) => {
24484
- const deviceType = DeviceType.Mouse;
24485
- this._pointerPosRecord[PointerInput.MouseWheelX] = evt.deltaX || 0;
24486
- this._pointerPosRecord[PointerInput.MouseWheelY] = evt.deltaY || evt.wheelDelta || 0;
24487
- this._pointerPosRecord[PointerInput.MouseWheelZ] = evt.deltaZ || 0;
24314
+ const deviceType = 2;
24315
+ this._pointerPosRecord[7] = evt.deltaX || 0;
24316
+ this._pointerPosRecord[8] = evt.deltaY || evt.wheelDelta || 0;
24317
+ this._pointerPosRecord[9] = evt.deltaZ || 0;
24488
24318
  const deviceEvent = evt;
24489
24319
  deviceEvent.deviceType = deviceType;
24490
- if (this._pointerPosRecord[PointerInput.MouseWheelX] !== 0) deviceEvent.currentState = this._pointerPosRecord[PointerInput.MouseWheelX];
24491
- if (this._pointerPosRecord[PointerInput.MouseWheelY] !== 0) deviceEvent.currentState = this._pointerPosRecord[PointerInput.MouseWheelY];
24492
- if (this._pointerPosRecord[PointerInput.MouseWheelZ] !== 0) deviceEvent.currentState = this._pointerPosRecord[PointerInput.MouseWheelZ];
24320
+ if (this._pointerPosRecord[7] !== 0) deviceEvent.currentState = this._pointerPosRecord[7];
24321
+ if (this._pointerPosRecord[8] !== 0) deviceEvent.currentState = this._pointerPosRecord[8];
24322
+ if (this._pointerPosRecord[9] !== 0) deviceEvent.currentState = this._pointerPosRecord[9];
24493
24323
  this.onInputChanged$.emitEvent(deviceEvent);
24494
24324
  };
24495
24325
  const canvasEle = this.getCanvasElement();
@@ -24523,32 +24353,32 @@ let Engine = class Engine extends Disposable {
24523
24353
  this._dragOverEvent = (evt) => {
24524
24354
  evt.preventDefault();
24525
24355
  const deviceType = this._getPointerType(evt);
24526
- const previousHorizontal = this._pointerPosRecord[PointerInput.Horizontal];
24527
- const previousVertical = this._pointerPosRecord[PointerInput.Vertical];
24528
- this._pointerPosRecord[PointerInput.Horizontal] = evt.clientX;
24529
- this._pointerPosRecord[PointerInput.Vertical] = evt.clientY;
24530
- this._pointerPosRecord[PointerInput.DeltaHorizontal] = evt.movementX;
24531
- this._pointerPosRecord[PointerInput.DeltaVertical] = evt.movementY;
24356
+ const previousHorizontal = this._pointerPosRecord[0];
24357
+ const previousVertical = this._pointerPosRecord[1];
24358
+ this._pointerPosRecord[0] = evt.clientX;
24359
+ this._pointerPosRecord[1] = evt.clientY;
24360
+ this._pointerPosRecord[10] = evt.movementX;
24361
+ this._pointerPosRecord[11] = evt.movementY;
24532
24362
  const deviceEvent = evt;
24533
24363
  deviceEvent.deviceType = deviceType;
24534
24364
  if (previousHorizontal !== evt.clientX) {
24535
- deviceEvent.inputIndex = PointerInput.Horizontal;
24536
- deviceEvent.currentState = this._pointerPosRecord[PointerInput.Horizontal];
24365
+ deviceEvent.inputIndex = 0;
24366
+ deviceEvent.currentState = this._pointerPosRecord[0];
24537
24367
  this.onInputChanged$.emitEvent(deviceEvent);
24538
24368
  }
24539
24369
  if (previousVertical !== evt.clientY) {
24540
- deviceEvent.inputIndex = PointerInput.Vertical;
24541
- deviceEvent.currentState = this._pointerPosRecord[PointerInput.Vertical];
24370
+ deviceEvent.inputIndex = 1;
24371
+ deviceEvent.currentState = this._pointerPosRecord[1];
24542
24372
  this.onInputChanged$.emitEvent(deviceEvent);
24543
24373
  }
24544
- if (this._pointerPosRecord[PointerInput.DeltaHorizontal] !== 0) {
24545
- deviceEvent.inputIndex = PointerInput.DeltaHorizontal;
24546
- deviceEvent.currentState = this._pointerPosRecord[PointerInput.DeltaHorizontal];
24374
+ if (this._pointerPosRecord[10] !== 0) {
24375
+ deviceEvent.inputIndex = 10;
24376
+ deviceEvent.currentState = this._pointerPosRecord[10];
24547
24377
  this.onInputChanged$.emitEvent(deviceEvent);
24548
24378
  }
24549
- if (this._pointerPosRecord[PointerInput.DeltaVertical] !== 0) {
24550
- deviceEvent.inputIndex = PointerInput.DeltaVertical;
24551
- deviceEvent.currentState = this._pointerPosRecord[PointerInput.DeltaVertical];
24379
+ if (this._pointerPosRecord[11] !== 0) {
24380
+ deviceEvent.inputIndex = 11;
24381
+ deviceEvent.currentState = this._pointerPosRecord[11];
24552
24382
  this.onInputChanged$.emitEvent(deviceEvent);
24553
24383
  }
24554
24384
  if (!this._usingSafari) {
@@ -24587,8 +24417,8 @@ let Engine = class Engine extends Disposable {
24587
24417
  return passiveSupported;
24588
24418
  }
24589
24419
  _getPointerType(evt) {
24590
- let deviceType = DeviceType.Mouse;
24591
- if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType = DeviceType.Touch;
24420
+ let deviceType = 2;
24421
+ if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType = 3;
24592
24422
  return deviceType;
24593
24423
  }
24594
24424
  _matchMediaHandler() {
@@ -24609,7 +24439,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
24609
24439
  //#endregion
24610
24440
  //#region package.json
24611
24441
  var name = "@univerjs/engine-render";
24612
- var version = "0.21.1";
24442
+ var version = "0.22.0";
24613
24443
 
24614
24444
  //#endregion
24615
24445
  //#region src/config/config.ts
@@ -24804,7 +24634,7 @@ var InputManager = class InputManager extends Disposable {
24804
24634
  if (!engine) return;
24805
24635
  this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
24806
24636
  const evt = eventData;
24807
- if (eventData.deviceType === DeviceType.Keyboard) switch (eventData.type) {
24637
+ if (eventData.deviceType === 1) switch (eventData.type) {
24808
24638
  case "keydown":
24809
24639
  this._onKeyDown(evt);
24810
24640
  break;
@@ -24812,7 +24642,7 @@ var InputManager = class InputManager extends Disposable {
24812
24642
  this._onKeyUp(evt);
24813
24643
  break;
24814
24644
  }
24815
- if (eventData.deviceType === DeviceType.Mouse || eventData.deviceType === DeviceType.Touch) switch (eventData.type) {
24645
+ if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
24816
24646
  case "wheel":
24817
24647
  case "DOMMouseScroll":
24818
24648
  case "mousewheel":
@@ -24834,10 +24664,10 @@ var InputManager = class InputManager extends Disposable {
24834
24664
  if (enableMove) this._onPointerMove(evt);
24835
24665
  break;
24836
24666
  case "pointerup":
24837
- if (enableUp && eventData.inputIndex >= PointerInput.LeftClick && eventData.inputIndex <= PointerInput.RightClick) this._onPointerUp(evt);
24667
+ if (enableUp && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerUp(evt);
24838
24668
  break;
24839
24669
  case "pointerdown":
24840
- if (enableDown && eventData.inputIndex >= PointerInput.LeftClick && eventData.inputIndex <= PointerInput.RightClick) this._onPointerDown(evt);
24670
+ if (enableDown && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerDown(evt);
24841
24671
  break;
24842
24672
  }
24843
24673
  if (eventData.dataTransfer) switch (eventData.type) {
@@ -24845,7 +24675,7 @@ var InputManager = class InputManager extends Disposable {
24845
24675
  if (enableEnter) this._onDragEnter(evt);
24846
24676
  break;
24847
24677
  case "dragover": {
24848
- const validIndex = eventData.inputIndex === PointerInput.Horizontal || eventData.inputIndex === PointerInput.Vertical || eventData.inputIndex === PointerInput.DeltaHorizontal || eventData.inputIndex === PointerInput.DeltaVertical;
24678
+ const validIndex = eventData.inputIndex === 0 || eventData.inputIndex === 1 || eventData.inputIndex === 10 || eventData.inputIndex === 11;
24849
24679
  if (enableMove && validIndex) this._onDragOver(evt);
24850
24680
  break;
24851
24681
  }
@@ -24892,9 +24722,9 @@ var InputManager = class InputManager extends Disposable {
24892
24722
  return !this._isObjectInSceneViewer(currentObject);
24893
24723
  }
24894
24724
  _isObjectInSceneViewer(obj) {
24895
- if (obj && obj.classType === RENDER_CLASS_TYPE.BASE_OBJECT) {
24725
+ if (obj && obj.classType === "BaseObject") {
24896
24726
  const scene = obj.getScene();
24897
- if (scene) return scene.getParent().classType === RENDER_CLASS_TYPE.SCENE_VIEWER;
24727
+ if (scene) return scene.getParent().classType === "SceneViewer";
24898
24728
  }
24899
24729
  return false;
24900
24730
  }
@@ -24961,7 +24791,7 @@ const THRESHOLD_TO_AUTO_MOVE = {
24961
24791
  r: 60
24962
24792
  };
24963
24793
  var ScrollTimer = class ScrollTimer {
24964
- constructor(_scene, _scrollTimerType = ScrollTimerType.ALL, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
24794
+ constructor(_scene, _scrollTimerType = 3, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
24965
24795
  this._scene = _scene;
24966
24796
  this._scrollTimerType = _scrollTimerType;
24967
24797
  this._thresholdAutoMove = _thresholdAutoMove;
@@ -24975,7 +24805,7 @@ var ScrollTimer = class ScrollTimer {
24975
24805
  _defineProperty(this, "_scrollY", 0);
24976
24806
  _defineProperty(this, "_scrollFunction", void 0);
24977
24807
  }
24978
- static create(scene, scrollTimerType = ScrollTimerType.ALL, padding) {
24808
+ static create(scene, scrollTimerType = 3, padding) {
24979
24809
  return new ScrollTimer(scene, scrollTimerType, padding);
24980
24810
  }
24981
24811
  get offsetX() {
@@ -25014,7 +24844,7 @@ var ScrollTimer = class ScrollTimer {
25014
24844
  let x = 0;
25015
24845
  let y = 0;
25016
24846
  let shouldScroll = false;
25017
- if (this._scrollTimerType & ScrollTimerType.X) {
24847
+ if (this._scrollTimerType & 1) {
25018
24848
  if (this._moveX < leftBounding + l) {
25019
24849
  x = this._moveX - leftBounding - l;
25020
24850
  shouldScroll = true;
@@ -25024,7 +24854,7 @@ var ScrollTimer = class ScrollTimer {
25024
24854
  shouldScroll = true;
25025
24855
  }
25026
24856
  }
25027
- if (this._scrollTimerType & ScrollTimerType.Y) {
24857
+ if (this._scrollTimerType & 2) {
25028
24858
  if (this._moveY < topBounding + t) {
25029
24859
  y = this._moveY - topBounding - t;
25030
24860
  shouldScroll = true;
@@ -25067,42 +24897,21 @@ var ScrollTimer = class ScrollTimer {
25067
24897
 
25068
24898
  //#endregion
25069
24899
  //#region src/scene.transformer.ts
25070
- var TransformerManagerType = /* @__PURE__ */ function(TransformerManagerType) {
25071
- TransformerManagerType["RESIZE_LT"] = "__SpreadsheetTransformerResizeLT__";
25072
- TransformerManagerType["RESIZE_CT"] = "__SpreadsheetTransformerResizeCT__";
25073
- TransformerManagerType["RESIZE_RT"] = "__SpreadsheetTransformerResizeRT__";
25074
- TransformerManagerType["RESIZE_LM"] = "__SpreadsheetTransformerResizeLM__";
25075
- TransformerManagerType["RESIZE_RM"] = "__SpreadsheetTransformerResizeRM__";
25076
- TransformerManagerType["RESIZE_LB"] = "__SpreadsheetTransformerResizeLB__";
25077
- TransformerManagerType["RESIZE_CB"] = "__SpreadsheetTransformerResizeCB__";
25078
- TransformerManagerType["RESIZE_RB"] = "__SpreadsheetTransformerResizeRB__";
25079
- TransformerManagerType["OUTLINE"] = "__SpreadsheetTransformerOutline__";
25080
- TransformerManagerType["ROTATE_LINE"] = "__SpreadsheetTransformerRotateLine__";
25081
- TransformerManagerType["ROTATE"] = "__SpreadsheetTransformerRotate__";
25082
- TransformerManagerType["GROUP"] = "__SpreadsheetTransformer__";
25083
- return TransformerManagerType;
25084
- }(TransformerManagerType || {});
25085
24900
  const TransformerManagerTypeArray = [
25086
- TransformerManagerType.RESIZE_LT,
25087
- TransformerManagerType.RESIZE_CT,
25088
- TransformerManagerType.RESIZE_RT,
25089
- TransformerManagerType.RESIZE_LM,
25090
- TransformerManagerType.RESIZE_RM,
25091
- TransformerManagerType.RESIZE_LB,
25092
- TransformerManagerType.RESIZE_CB,
25093
- TransformerManagerType.RESIZE_RB
24901
+ "__SpreadsheetTransformerResizeLT__",
24902
+ "__SpreadsheetTransformerResizeCT__",
24903
+ "__SpreadsheetTransformerResizeRT__",
24904
+ "__SpreadsheetTransformerResizeLM__",
24905
+ "__SpreadsheetTransformerResizeRM__",
24906
+ "__SpreadsheetTransformerResizeLB__",
24907
+ "__SpreadsheetTransformerResizeCB__",
24908
+ "__SpreadsheetTransformerResizeRB__"
25094
24909
  ];
25095
- var MoveObserverType = /* @__PURE__ */ function(MoveObserverType) {
25096
- MoveObserverType[MoveObserverType["MOVE_START"] = 0] = "MOVE_START";
25097
- MoveObserverType[MoveObserverType["MOVING"] = 1] = "MOVING";
25098
- MoveObserverType[MoveObserverType["MOVE_END"] = 2] = "MOVE_END";
25099
- return MoveObserverType;
25100
- }(MoveObserverType || {});
25101
24910
  const DEFAULT_TRANSFORMER_LAYER_INDEX = 2;
25102
24911
  const MINI_WIDTH_LIMIT = 20;
25103
24912
  const MINI_HEIGHT_LIMIT = 20;
25104
24913
  const DEFAULT_CONTROL_PLUS_INDEX = 5e3;
25105
- const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([ObjectType.CHART]);
24914
+ const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([6]);
25106
24915
  /**
25107
24916
  * Transformer constructor. Transformer is a special type of group that allow you transform
25108
24917
  * primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
@@ -25195,7 +25004,7 @@ var Transformer = class extends Disposable {
25195
25004
  changeNotification() {
25196
25005
  this._changing$.next({
25197
25006
  objects: this._selectedObjectMap,
25198
- type: MoveObserverType.MOVE_START
25007
+ type: 0
25199
25008
  });
25200
25009
  return this;
25201
25010
  }
@@ -25340,14 +25149,14 @@ var Transformer = class extends Disposable {
25340
25149
  this._changeStart$.next({
25341
25150
  target: applyObject,
25342
25151
  objects: this._selectedObjectMap,
25343
- type: MoveObserverType.MOVE_START
25152
+ type: 0
25344
25153
  });
25345
25154
  } else {
25346
25155
  this._copperSelectedObject = applyObject;
25347
25156
  this._changeStart$.next({
25348
25157
  target: applyObject,
25349
25158
  objects: new Map([[applyObject.oKey, applyObject]]),
25350
- type: MoveObserverType.MOVE_START
25159
+ type: 0
25351
25160
  });
25352
25161
  }
25353
25162
  this._moveBufferSkip = false;
@@ -25368,14 +25177,14 @@ var Transformer = class extends Disposable {
25368
25177
  const { offsetX, offsetY } = event;
25369
25178
  if (!isCropper) this._changeEnd$.next({
25370
25179
  objects: this._selectedObjectMap,
25371
- type: MoveObserverType.MOVE_END,
25180
+ type: 2,
25372
25181
  offsetX,
25373
25182
  offsetY,
25374
25183
  event
25375
25184
  });
25376
25185
  else this._changeEnd$.next({
25377
25186
  objects: new Map([[applyObject.oKey, applyObject]]),
25378
- type: MoveObserverType.MOVE_END,
25187
+ type: 2,
25379
25188
  offsetX,
25380
25189
  offsetY,
25381
25190
  event
@@ -25459,7 +25268,7 @@ var Transformer = class extends Disposable {
25459
25268
  objects: this._selectedObjectMap,
25460
25269
  moveX: moveLeft,
25461
25270
  moveY: moveTop,
25462
- type: MoveObserverType.MOVING,
25271
+ type: 1,
25463
25272
  offsetX: moveOffsetX,
25464
25273
  offsetY: moveOffsetY
25465
25274
  });
@@ -25473,7 +25282,7 @@ var Transformer = class extends Disposable {
25473
25282
  objects: new Map([[cropper.oKey, cropper]]),
25474
25283
  moveX: moveLeft,
25475
25284
  moveY: moveTop,
25476
- type: MoveObserverType.MOVING,
25285
+ type: 1,
25477
25286
  offsetX: moveOffsetX,
25478
25287
  offsetY: moveOffsetY
25479
25288
  });
@@ -25498,7 +25307,7 @@ var Transformer = class extends Disposable {
25498
25307
  });
25499
25308
  this._changing$.next({
25500
25309
  objects: this._selectedObjectMap,
25501
- type: MoveObserverType.MOVING,
25310
+ type: 1,
25502
25311
  offsetX: moveOffsetX,
25503
25312
  offsetY: moveOffsetY
25504
25313
  });
@@ -25506,12 +25315,12 @@ var Transformer = class extends Disposable {
25506
25315
  this._moveFunc(applyObject, type, x, y, keepRatio, isCropper, isGroup);
25507
25316
  this._changing$.next({
25508
25317
  objects: new Map([[applyObject.oKey, applyObject]]),
25509
- type: MoveObserverType.MOVING,
25318
+ type: 1,
25510
25319
  offsetX: moveOffsetX,
25511
25320
  offsetY: moveOffsetY
25512
25321
  });
25513
25322
  }
25514
- if (!(keepRatio && type !== TransformerManagerType.RESIZE_CT && type !== TransformerManagerType.RESIZE_CB && type !== TransformerManagerType.RESIZE_LM && type !== TransformerManagerType.RESIZE_RM && !isGroup)) {
25323
+ if (!(keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup)) {
25515
25324
  this._startOffsetX = x;
25516
25325
  this._startOffsetY = y;
25517
25326
  }
@@ -25521,17 +25330,17 @@ var Transformer = class extends Disposable {
25521
25330
  const originState = this._startStateMap.get(moveObject.oKey) || {};
25522
25331
  let state = {};
25523
25332
  const { moveLeft, moveTop } = this._getMovePoint(x, y, moveObject);
25524
- if (keepRatio && type !== TransformerManagerType.RESIZE_CT && type !== TransformerManagerType.RESIZE_CB && type !== TransformerManagerType.RESIZE_LM && type !== TransformerManagerType.RESIZE_RM && !isGroup) switch (type) {
25525
- case TransformerManagerType.RESIZE_LT:
25333
+ if (keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup) switch (type) {
25334
+ case "__SpreadsheetTransformerResizeLT__":
25526
25335
  state = this._resizeLeftTop(moveObject, moveLeft, moveTop, originState);
25527
25336
  break;
25528
- case TransformerManagerType.RESIZE_RT:
25337
+ case "__SpreadsheetTransformerResizeRT__":
25529
25338
  state = this._resizeRightTop(moveObject, moveLeft, moveTop, originState);
25530
25339
  break;
25531
- case TransformerManagerType.RESIZE_LB:
25340
+ case "__SpreadsheetTransformerResizeLB__":
25532
25341
  state = this._resizeLeftBottom(moveObject, moveLeft, moveTop, originState);
25533
25342
  break;
25534
- case TransformerManagerType.RESIZE_RB:
25343
+ case "__SpreadsheetTransformerResizeRB__":
25535
25344
  state = this._resizeRightBottom(moveObject, moveLeft, moveTop, originState);
25536
25345
  break;
25537
25346
  }
@@ -25583,37 +25392,37 @@ var Transformer = class extends Disposable {
25583
25392
  height
25584
25393
  };
25585
25394
  switch (type) {
25586
- case TransformerManagerType.RESIZE_LT:
25395
+ case "__SpreadsheetTransformerResizeLT__":
25587
25396
  state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
25588
25397
  state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
25589
25398
  state.left = left + width - state.width;
25590
25399
  state.top = top + height - state.height;
25591
25400
  break;
25592
- case TransformerManagerType.RESIZE_CT:
25401
+ case "__SpreadsheetTransformerResizeCT__":
25593
25402
  state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
25594
25403
  state.top = top + height - state.height;
25595
25404
  break;
25596
- case TransformerManagerType.RESIZE_RT:
25405
+ case "__SpreadsheetTransformerResizeRT__":
25597
25406
  state.width = width + moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width + moveLeft;
25598
25407
  state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
25599
25408
  state.top = top + height - state.height;
25600
25409
  break;
25601
- case TransformerManagerType.RESIZE_LM:
25410
+ case "__SpreadsheetTransformerResizeLM__":
25602
25411
  state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
25603
25412
  state.left = left + width - state.width;
25604
25413
  break;
25605
- case TransformerManagerType.RESIZE_RM:
25414
+ case "__SpreadsheetTransformerResizeRM__":
25606
25415
  state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
25607
25416
  break;
25608
- case TransformerManagerType.RESIZE_LB:
25417
+ case "__SpreadsheetTransformerResizeLB__":
25609
25418
  state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
25610
25419
  state.height = height + moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height + moveTop;
25611
25420
  state.left = state.width <= MINI_WIDTH_LIMIT ? left : left + moveLeft;
25612
25421
  break;
25613
- case TransformerManagerType.RESIZE_CB:
25422
+ case "__SpreadsheetTransformerResizeCB__":
25614
25423
  state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
25615
25424
  break;
25616
- case TransformerManagerType.RESIZE_RB:
25425
+ case "__SpreadsheetTransformerResizeRB__":
25617
25426
  state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
25618
25427
  state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
25619
25428
  break;
@@ -25718,7 +25527,7 @@ var Transformer = class extends Disposable {
25718
25527
  moveTop: moveTopFix
25719
25528
  };
25720
25529
  }
25721
- _attachEventToAnchor(anchor, type = TransformerManagerType.RESIZE_LT, applyObject) {
25530
+ _attachEventToAnchor(anchor, type = "__SpreadsheetTransformerResizeLT__", applyObject) {
25722
25531
  this.disposeWithMe(toDisposable(anchor.onPointerDown$.subscribeEvent((evt, state) => {
25723
25532
  const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
25724
25533
  this._startOffsetX = evtOffsetX;
@@ -25739,7 +25548,7 @@ var Transformer = class extends Disposable {
25739
25548
  this._clearControlMap();
25740
25549
  this._changeStart$.next({
25741
25550
  objects: this._selectedObjectMap,
25742
- type: MoveObserverType.MOVE_START
25551
+ type: 0
25743
25552
  });
25744
25553
  this._selectedObjectMap.forEach((moveObject) => {
25745
25554
  const { width, height, left, top } = moveObject.getState();
@@ -25753,7 +25562,7 @@ var Transformer = class extends Disposable {
25753
25562
  } else {
25754
25563
  this._changeStart$.next({
25755
25564
  objects: new Map([[applyObject.oKey, applyObject]]),
25756
- type: MoveObserverType.MOVE_START
25565
+ type: 0
25757
25566
  });
25758
25567
  const { width, height, left, top } = applyObject.getState();
25759
25568
  this._startStateMap.set(applyObject.oKey, {
@@ -25785,7 +25594,7 @@ var Transformer = class extends Disposable {
25785
25594
  this._recoverySizeBoundary(Array.from(this._selectedObjectMap.values()), ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
25786
25595
  this._changeEnd$.next({
25787
25596
  objects: this._selectedObjectMap,
25788
- type: MoveObserverType.MOVE_END,
25597
+ type: 2,
25789
25598
  offsetX,
25790
25599
  offsetY,
25791
25600
  event
@@ -25794,7 +25603,7 @@ var Transformer = class extends Disposable {
25794
25603
  this._recoverySizeBoundary([applyObject], ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
25795
25604
  this._changeEnd$.next({
25796
25605
  objects: new Map([[applyObject.oKey, applyObject]]),
25797
- type: MoveObserverType.MOVE_END,
25606
+ type: 2,
25798
25607
  offsetX,
25799
25608
  offsetY,
25800
25609
  event
@@ -25832,14 +25641,14 @@ var Transformer = class extends Disposable {
25832
25641
  const viewportActualXY = topScene.getScrollXYInfoByViewport(Vector2.create(evtOffsetX, evtOffsetY));
25833
25642
  this._viewportScrollX = viewportActualXY.x;
25834
25643
  this._viewportScrollY = viewportActualXY.y;
25835
- const cursor = this._getRotateAnchorCursor(TransformerManagerType.ROTATE_LINE);
25644
+ const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotateLine__");
25836
25645
  const { ancestorLeft, ancestorTop, width, height, angle: agentOrigin } = applyObject;
25837
25646
  const centerX = width / 2 + ancestorLeft;
25838
25647
  const centerY = height / 2 + ancestorTop;
25839
25648
  this._clearControlMap();
25840
25649
  this._changeStart$.next({
25841
25650
  objects: this._selectedObjectMap,
25842
- type: MoveObserverType.MOVE_START
25651
+ type: 0
25843
25652
  });
25844
25653
  this._moveBufferSkip = false;
25845
25654
  const topScenePointerMoveSub = topScene.onPointerMove$.subscribeEvent((moveEvt) => {
@@ -25856,7 +25665,7 @@ var Transformer = class extends Disposable {
25856
25665
  const { offsetX, offsetY } = event;
25857
25666
  this._changeEnd$.next({
25858
25667
  objects: this._selectedObjectMap,
25859
- type: MoveObserverType.MOVE_END,
25668
+ type: 2,
25860
25669
  offsetX,
25861
25670
  offsetY,
25862
25671
  event
@@ -25878,7 +25687,7 @@ var Transformer = class extends Disposable {
25878
25687
  this._changing$.next({
25879
25688
  objects: this._selectedObjectMap,
25880
25689
  angle,
25881
- type: MoveObserverType.MOVING,
25690
+ type: 1,
25882
25691
  offsetX: moveOffsetX,
25883
25692
  offsetY: moveOffsetY
25884
25693
  });
@@ -25892,35 +25701,35 @@ var Transformer = class extends Disposable {
25892
25701
  };
25893
25702
  }
25894
25703
  _getRotateAnchorCursor(type) {
25895
- let cursor = CURSOR_TYPE.NORTH_WEST_RESIZE;
25704
+ let cursor = "nw-resize";
25896
25705
  switch (type) {
25897
- case TransformerManagerType.ROTATE:
25898
- cursor = CURSOR_TYPE.MOVE;
25706
+ case "__SpreadsheetTransformerRotate__":
25707
+ cursor = "move";
25899
25708
  break;
25900
- case TransformerManagerType.ROTATE_LINE:
25901
- cursor = CURSOR_TYPE.MOVE;
25709
+ case "__SpreadsheetTransformerRotateLine__":
25710
+ cursor = "move";
25902
25711
  break;
25903
- case TransformerManagerType.RESIZE_LT: break;
25904
- case TransformerManagerType.RESIZE_CT:
25905
- cursor = CURSOR_TYPE.NORTH_RESIZE;
25712
+ case "__SpreadsheetTransformerResizeLT__": break;
25713
+ case "__SpreadsheetTransformerResizeCT__":
25714
+ cursor = "n-resize";
25906
25715
  break;
25907
- case TransformerManagerType.RESIZE_RT:
25908
- cursor = CURSOR_TYPE.NORTH_EAST_RESIZE;
25716
+ case "__SpreadsheetTransformerResizeRT__":
25717
+ cursor = "ne-resize";
25909
25718
  break;
25910
- case TransformerManagerType.RESIZE_LM:
25911
- cursor = CURSOR_TYPE.WEST_RESIZE;
25719
+ case "__SpreadsheetTransformerResizeLM__":
25720
+ cursor = "w-resize";
25912
25721
  break;
25913
- case TransformerManagerType.RESIZE_RM:
25914
- cursor = CURSOR_TYPE.EAST_RESIZE;
25722
+ case "__SpreadsheetTransformerResizeRM__":
25723
+ cursor = "e-resize";
25915
25724
  break;
25916
- case TransformerManagerType.RESIZE_LB:
25917
- cursor = CURSOR_TYPE.SOUTH_WEST_RESIZE;
25725
+ case "__SpreadsheetTransformerResizeLB__":
25726
+ cursor = "sw-resize";
25918
25727
  break;
25919
- case TransformerManagerType.RESIZE_CB:
25920
- cursor = CURSOR_TYPE.SOUTH_RESIZE;
25728
+ case "__SpreadsheetTransformerResizeCB__":
25729
+ cursor = "s-resize";
25921
25730
  break;
25922
- case TransformerManagerType.RESIZE_RB:
25923
- cursor = CURSOR_TYPE.SOUTH_EAST_RESIZE;
25731
+ case "__SpreadsheetTransformerResizeRB__":
25732
+ cursor = "se-resize";
25924
25733
  break;
25925
25734
  }
25926
25735
  return cursor;
@@ -25932,35 +25741,35 @@ var Transformer = class extends Disposable {
25932
25741
  const longEdge = anchorSize;
25933
25742
  const shortEdge = anchorSize / 4;
25934
25743
  switch (type) {
25935
- case TransformerManagerType.RESIZE_LT:
25744
+ case "__SpreadsheetTransformerResizeLT__":
25936
25745
  left += -borderSpacing - borderStrokeWidth;
25937
25746
  top += -borderSpacing - borderStrokeWidth;
25938
25747
  break;
25939
- case TransformerManagerType.RESIZE_CT:
25748
+ case "__SpreadsheetTransformerResizeCT__":
25940
25749
  left += width / 2 - longEdge / 2;
25941
25750
  top += -borderSpacing - borderStrokeWidth;
25942
25751
  break;
25943
- case TransformerManagerType.RESIZE_RT:
25752
+ case "__SpreadsheetTransformerResizeRT__":
25944
25753
  left += width + borderSpacing - borderStrokeWidth - longEdge;
25945
25754
  top += -borderSpacing - borderStrokeWidth;
25946
25755
  break;
25947
- case TransformerManagerType.RESIZE_LM:
25756
+ case "__SpreadsheetTransformerResizeLM__":
25948
25757
  left += borderSpacing - borderStrokeWidth;
25949
25758
  top += height / 2 - longEdge / 2;
25950
25759
  break;
25951
- case TransformerManagerType.RESIZE_RM:
25760
+ case "__SpreadsheetTransformerResizeRM__":
25952
25761
  left += width + borderSpacing - borderStrokeWidth - shortEdge;
25953
25762
  top += height / 2 - longEdge / 2;
25954
25763
  break;
25955
- case TransformerManagerType.RESIZE_LB:
25764
+ case "__SpreadsheetTransformerResizeLB__":
25956
25765
  left += -this.borderSpacing - borderStrokeWidth;
25957
25766
  top += height + borderSpacing - borderStrokeWidth - longEdge;
25958
25767
  break;
25959
- case TransformerManagerType.RESIZE_CB:
25768
+ case "__SpreadsheetTransformerResizeCB__":
25960
25769
  left += width / 2 - longEdge / 2;
25961
25770
  top += height + borderSpacing - borderStrokeWidth - shortEdge;
25962
25771
  break;
25963
- case TransformerManagerType.RESIZE_RB:
25772
+ case "__SpreadsheetTransformerResizeRB__":
25964
25773
  left += width + borderSpacing - borderStrokeWidth - longEdge;
25965
25774
  top += height + borderSpacing - borderStrokeWidth - longEdge;
25966
25775
  break;
@@ -25975,43 +25784,43 @@ var Transformer = class extends Disposable {
25975
25784
  let left = -anchorSize / 2;
25976
25785
  let top = -anchorSize / 2;
25977
25786
  switch (type) {
25978
- case TransformerManagerType.ROTATE:
25787
+ case "__SpreadsheetTransformerRotate__":
25979
25788
  left = width / 2 - rotateSize / 2;
25980
25789
  top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth * 2 - rotateSize;
25981
25790
  break;
25982
- case TransformerManagerType.ROTATE_LINE:
25791
+ case "__SpreadsheetTransformerRotateLine__":
25983
25792
  left = width / 2;
25984
25793
  top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth;
25985
25794
  break;
25986
- case TransformerManagerType.RESIZE_LT:
25795
+ case "__SpreadsheetTransformerResizeLT__":
25987
25796
  left += -borderSpacing - borderStrokeWidth;
25988
25797
  top += -borderSpacing - borderStrokeWidth;
25989
25798
  break;
25990
- case TransformerManagerType.RESIZE_CT:
25799
+ case "__SpreadsheetTransformerResizeCT__":
25991
25800
  left += width / 2;
25992
25801
  top += -borderSpacing - borderStrokeWidth;
25993
25802
  break;
25994
- case TransformerManagerType.RESIZE_RT:
25803
+ case "__SpreadsheetTransformerResizeRT__":
25995
25804
  left += width + borderSpacing - borderStrokeWidth;
25996
25805
  top += -borderSpacing - borderStrokeWidth;
25997
25806
  break;
25998
- case TransformerManagerType.RESIZE_LM:
25807
+ case "__SpreadsheetTransformerResizeLM__":
25999
25808
  left += borderSpacing - borderStrokeWidth;
26000
25809
  top += height / 2;
26001
25810
  break;
26002
- case TransformerManagerType.RESIZE_RM:
25811
+ case "__SpreadsheetTransformerResizeRM__":
26003
25812
  left += width + borderSpacing - borderStrokeWidth;
26004
25813
  top += height / 2;
26005
25814
  break;
26006
- case TransformerManagerType.RESIZE_LB:
25815
+ case "__SpreadsheetTransformerResizeLB__":
26007
25816
  left += -this.borderSpacing - borderStrokeWidth;
26008
25817
  top += height + borderSpacing - borderStrokeWidth;
26009
25818
  break;
26010
- case TransformerManagerType.RESIZE_CB:
25819
+ case "__SpreadsheetTransformerResizeCB__":
26011
25820
  left += width / 2;
26012
25821
  top += height + borderSpacing - borderStrokeWidth;
26013
25822
  break;
26014
- case TransformerManagerType.RESIZE_RB:
25823
+ case "__SpreadsheetTransformerResizeRB__":
26015
25824
  left += width + borderSpacing - borderStrokeWidth;
26016
25825
  top += height + borderSpacing - borderStrokeWidth;
26017
25826
  break;
@@ -26037,7 +25846,7 @@ var Transformer = class extends Disposable {
26037
25846
  left,
26038
25847
  top
26039
25848
  });
26040
- this._attachHover(anchor, cursor, CURSOR_TYPE.DEFAULT);
25849
+ this._attachHover(anchor, cursor, "default");
26041
25850
  return anchor;
26042
25851
  }
26043
25852
  _createCopperResizeAnchor(type, applyObject, zIndex) {
@@ -26059,36 +25868,36 @@ var Transformer = class extends Disposable {
26059
25868
  };
26060
25869
  const longEdge = anchorSize;
26061
25870
  const shortEdge = anchorSize / 4;
26062
- if (cursor === CURSOR_TYPE.EAST_RESIZE) {
25871
+ if (cursor === "e-resize") {
26063
25872
  config.width = shortEdge;
26064
25873
  config.height = longEdge;
26065
25874
  anchor = new Rect(oKey, config);
26066
- } else if (cursor === CURSOR_TYPE.WEST_RESIZE) {
25875
+ } else if (cursor === "w-resize") {
26067
25876
  config.width = shortEdge;
26068
25877
  config.height = longEdge;
26069
25878
  anchor = new Rect(oKey, config);
26070
- } else if (cursor === CURSOR_TYPE.NORTH_RESIZE) {
25879
+ } else if (cursor === "n-resize") {
26071
25880
  config.width = longEdge;
26072
25881
  config.height = shortEdge;
26073
25882
  anchor = new Rect(oKey, config);
26074
- } else if (cursor === CURSOR_TYPE.SOUTH_RESIZE) {
25883
+ } else if (cursor === "s-resize") {
26075
25884
  config.width = longEdge;
26076
25885
  config.height = shortEdge;
26077
25886
  anchor = new Rect(oKey, config);
26078
- } else if (cursor === CURSOR_TYPE.NORTH_EAST_RESIZE) {
25887
+ } else if (cursor === "ne-resize") {
26079
25888
  config.pointsGroup = this._getNorthEastPoints(longEdge, shortEdge);
26080
25889
  anchor = new RegularPolygon(oKey, config);
26081
- } else if (cursor === CURSOR_TYPE.NORTH_WEST_RESIZE) {
25890
+ } else if (cursor === "nw-resize") {
26082
25891
  config.pointsGroup = this._getNorthWestPoints(longEdge, shortEdge);
26083
25892
  anchor = new RegularPolygon(oKey, config);
26084
- } else if (cursor === CURSOR_TYPE.SOUTH_EAST_RESIZE) {
25893
+ } else if (cursor === "se-resize") {
26085
25894
  config.pointsGroup = this._getSouthEastPoints(longEdge, shortEdge);
26086
25895
  anchor = new RegularPolygon(oKey, config);
26087
- } else if (cursor === CURSOR_TYPE.SOUTH_WEST_RESIZE) {
25896
+ } else if (cursor === "sw-resize") {
26088
25897
  config.pointsGroup = this._getSouthWestPoints(longEdge, shortEdge);
26089
25898
  anchor = new RegularPolygon(oKey, config);
26090
25899
  }
26091
- this._attachHover(anchor, cursor, CURSOR_TYPE.DEFAULT);
25900
+ this._attachHover(anchor, cursor, "default");
26092
25901
  return anchor;
26093
25902
  }
26094
25903
  _getNorthEastPoints(longEdge, shortEdge) {
@@ -26215,17 +26024,17 @@ var Transformer = class extends Disposable {
26215
26024
  ]];
26216
26025
  }
26217
26026
  _checkTransformerType(oKey) {
26218
- if (oKey.indexOf(TransformerManagerType.OUTLINE) > -1) return TransformerManagerType.OUTLINE;
26219
- if (oKey.indexOf(TransformerManagerType.ROTATE) > -1) return TransformerManagerType.ROTATE;
26220
- if (oKey.indexOf(TransformerManagerType.ROTATE_LINE) > -1) return TransformerManagerType.ROTATE_LINE;
26221
- if (oKey.indexOf(TransformerManagerType.RESIZE_LT) > -1) return TransformerManagerType.RESIZE_LT;
26222
- if (oKey.indexOf(TransformerManagerType.RESIZE_CT) > -1) return TransformerManagerType.RESIZE_CT;
26223
- if (oKey.indexOf(TransformerManagerType.RESIZE_RT) > -1) return TransformerManagerType.RESIZE_RT;
26224
- if (oKey.indexOf(TransformerManagerType.RESIZE_LM) > -1) return TransformerManagerType.RESIZE_LM;
26225
- if (oKey.indexOf(TransformerManagerType.RESIZE_RM) > -1) return TransformerManagerType.RESIZE_RM;
26226
- if (oKey.indexOf(TransformerManagerType.RESIZE_LB) > -1) return TransformerManagerType.RESIZE_LB;
26227
- if (oKey.indexOf(TransformerManagerType.RESIZE_CB) > -1) return TransformerManagerType.RESIZE_CB;
26228
- if (oKey.indexOf(TransformerManagerType.RESIZE_RB) > -1) return TransformerManagerType.RESIZE_RB;
26027
+ if (oKey.indexOf("__SpreadsheetTransformerOutline__") > -1) return "__SpreadsheetTransformerOutline__";
26028
+ if (oKey.indexOf("__SpreadsheetTransformerRotate__") > -1) return "__SpreadsheetTransformerRotate__";
26029
+ if (oKey.indexOf("__SpreadsheetTransformerRotateLine__") > -1) return "__SpreadsheetTransformerRotateLine__";
26030
+ if (oKey.indexOf("__SpreadsheetTransformerResizeLT__") > -1) return "__SpreadsheetTransformerResizeLT__";
26031
+ if (oKey.indexOf("__SpreadsheetTransformerResizeCT__") > -1) return "__SpreadsheetTransformerResizeCT__";
26032
+ if (oKey.indexOf("__SpreadsheetTransformerResizeRT__") > -1) return "__SpreadsheetTransformerResizeRT__";
26033
+ if (oKey.indexOf("__SpreadsheetTransformerResizeLM__") > -1) return "__SpreadsheetTransformerResizeLM__";
26034
+ if (oKey.indexOf("__SpreadsheetTransformerResizeRM__") > -1) return "__SpreadsheetTransformerResizeRM__";
26035
+ if (oKey.indexOf("__SpreadsheetTransformerResizeLB__") > -1) return "__SpreadsheetTransformerResizeLB__";
26036
+ if (oKey.indexOf("__SpreadsheetTransformerResizeCB__") > -1) return "__SpreadsheetTransformerResizeCB__";
26037
+ if (oKey.indexOf("__SpreadsheetTransformerResizeRB__") > -1) return "__SpreadsheetTransformerResizeRB__";
26229
26038
  }
26230
26039
  _updateControlIterator(func) {
26231
26040
  this._transformerControlMap.forEach((control, oKey) => {
@@ -26290,7 +26099,7 @@ var Transformer = class extends Disposable {
26290
26099
  const layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX;
26291
26100
  const groupElements = [];
26292
26101
  if (borderEnabled && !isCropper) {
26293
- const outline = new Rect(`${TransformerManagerType.OUTLINE}_${zIndex}`, {
26102
+ const outline = new Rect(`__SpreadsheetTransformerOutline___${zIndex}`, {
26294
26103
  zIndex: zIndex - 1,
26295
26104
  evented: false,
26296
26105
  strokeWidth: borderStrokeWidth,
@@ -26300,9 +26109,9 @@ var Transformer = class extends Disposable {
26300
26109
  groupElements.push(outline);
26301
26110
  }
26302
26111
  if (resizeEnabled && !isCropper) {
26303
- const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition(TransformerManagerType.ROTATE_LINE, height, width, applyObject);
26112
+ const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotateLine__", height, width, applyObject);
26304
26113
  if (rotateEnabled) {
26305
- const rotateLine = new Rect(`${TransformerManagerType.ROTATE_LINE}_${zIndex}`, {
26114
+ const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
26306
26115
  zIndex: zIndex - 1,
26307
26116
  evented: false,
26308
26117
  left: lineLeft,
@@ -26312,9 +26121,9 @@ var Transformer = class extends Disposable {
26312
26121
  strokeWidth: borderStrokeWidth,
26313
26122
  stroke: borderStroke
26314
26123
  });
26315
- const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition(TransformerManagerType.ROTATE, height, width, applyObject);
26316
- const cursor = this._getRotateAnchorCursor(TransformerManagerType.ROTATE);
26317
- const rotate = new Rect(`${TransformerManagerType.ROTATE}_${zIndex}`, {
26124
+ const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject);
26125
+ const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotate__");
26126
+ const rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
26318
26127
  zIndex: zIndex - 1,
26319
26128
  left: rotateLeft,
26320
26129
  top: rotateTop,
@@ -26325,7 +26134,7 @@ var Transformer = class extends Disposable {
26325
26134
  stroke: borderStroke
26326
26135
  });
26327
26136
  this._attachEventToRotate(rotate, applyObject);
26328
- this._attachHover(rotate, cursor, CURSOR_TYPE.DEFAULT);
26137
+ this._attachHover(rotate, cursor, "default");
26329
26138
  groupElements.push(rotateLine, rotate);
26330
26139
  }
26331
26140
  }
@@ -26338,7 +26147,7 @@ var Transformer = class extends Disposable {
26338
26147
  this._attachEventToAnchor(anchor, type, applyObject);
26339
26148
  groupElements.push(anchor);
26340
26149
  }
26341
- const transformerControl = new Group(`${TransformerManagerType.GROUP}_${oKey}`, ...groupElements);
26150
+ const transformerControl = new Group(`__SpreadsheetTransformer___${oKey}`, ...groupElements);
26342
26151
  transformerControl.zIndex = zIndex;
26343
26152
  transformerControl.evented = false;
26344
26153
  transformerControl.openSelfSizeMode();
@@ -26366,7 +26175,7 @@ var Transformer = class extends Disposable {
26366
26175
  this._changeStart$.next({
26367
26176
  target: applyObject,
26368
26177
  objects: this._selectedObjectMap,
26369
- type: MoveObserverType.MOVE_START
26178
+ type: 0
26370
26179
  });
26371
26180
  }
26372
26181
  _updateActiveObjectList(applyObject, evt) {
@@ -26416,8 +26225,8 @@ var Scene = class extends Disposable {
26416
26225
  _defineProperty(this, "_evented", true);
26417
26226
  _defineProperty(this, "_layers", []);
26418
26227
  _defineProperty(this, "_viewports", []);
26419
- _defineProperty(this, "_cursor", CURSOR_TYPE.DEFAULT);
26420
- _defineProperty(this, "_defaultCursor", CURSOR_TYPE.DEFAULT);
26228
+ _defineProperty(this, "_cursor", "default");
26229
+ _defineProperty(this, "_defaultCursor", "default");
26421
26230
  _defineProperty(this, "_addObject$", new BehaviorSubject(this));
26422
26231
  _defineProperty(this, "addObject$", this._addObject$.asObservable());
26423
26232
  _defineProperty(this, "onTransformChange$", new EventSubject());
@@ -26463,18 +26272,18 @@ var Scene = class extends Disposable {
26463
26272
  _defineProperty(this, "_capturedObject", null);
26464
26273
  this._sceneKey = sceneKey;
26465
26274
  if (state) this.transformByState(state);
26466
- if (this._parent.classType === RENDER_CLASS_TYPE.ENGINE) {
26275
+ if (this._parent.classType === "Engine") {
26467
26276
  const parent = this._parent;
26468
26277
  parent.addScene(this);
26469
26278
  if (!parent.hasActiveScene()) parent.setActiveScene(sceneKey);
26470
26279
  this._inputManager = new InputManager(this);
26471
- } else if (this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) this._parent.addSubScene(this);
26280
+ } else if (this._parent.classType === "SceneViewer") this._parent.addSubScene(this);
26472
26281
  this.disposeWithMe(toDisposable((_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.onTransformChange$.subscribeEvent((_change) => {
26473
26282
  this._transformHandler();
26474
26283
  })));
26475
26284
  }
26476
26285
  get classType() {
26477
- return RENDER_CLASS_TYPE.SCENE;
26286
+ return "Scene";
26478
26287
  }
26479
26288
  get transform() {
26480
26289
  return this._transform;
@@ -26518,7 +26327,7 @@ var Scene = class extends Disposable {
26518
26327
  get ancestorScaleX() {
26519
26328
  const p = this.getParent();
26520
26329
  let pScale = 1;
26521
- if (p.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) pScale = p.ancestorScaleX;
26330
+ if (p.classType === "SceneViewer") pScale = p.ancestorScaleX;
26522
26331
  return this.scaleX * pScale;
26523
26332
  }
26524
26333
  /**
@@ -26527,7 +26336,7 @@ var Scene = class extends Disposable {
26527
26336
  get ancestorScaleY() {
26528
26337
  const p = this.getParent();
26529
26338
  let pScale = 1;
26530
- if (p.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) pScale = p.ancestorScaleY;
26339
+ if (p.classType === "SceneViewer") pScale = p.ancestorScaleY;
26531
26340
  return this.scaleY * pScale;
26532
26341
  }
26533
26342
  getAncestorScale() {
@@ -26539,13 +26348,13 @@ var Scene = class extends Disposable {
26539
26348
  get ancestorLeft() {
26540
26349
  const p = this.getParent();
26541
26350
  let pOffsetX = 0;
26542
- if (p.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) pOffsetX = p.ancestorLeft;
26351
+ if (p.classType === "SceneViewer") pOffsetX = p.ancestorLeft;
26543
26352
  return pOffsetX;
26544
26353
  }
26545
26354
  get ancestorTop() {
26546
26355
  const p = this.getParent();
26547
26356
  let pOffsetY = 0;
26548
- if (p.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) pOffsetY = p.ancestorTop;
26357
+ if (p.classType === "SceneViewer") pOffsetY = p.ancestorTop;
26549
26358
  return pOffsetY;
26550
26359
  }
26551
26360
  set cursor(val) {
@@ -26553,7 +26362,7 @@ var Scene = class extends Disposable {
26553
26362
  }
26554
26363
  attachControl(options) {
26555
26364
  var _this$_inputManager;
26556
- if (!(this._parent.classType === RENDER_CLASS_TYPE.ENGINE)) return;
26365
+ if (!(this._parent.classType === "Engine")) return;
26557
26366
  (_this$_inputManager = this._inputManager) === null || _this$_inputManager === void 0 || _this$_inputManager.attachControl(options);
26558
26367
  return this;
26559
26368
  }
@@ -26566,7 +26375,7 @@ var Scene = class extends Disposable {
26566
26375
  this._layers.forEach((layer) => {
26567
26376
  layer.makeDirty(state);
26568
26377
  });
26569
- if (this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26378
+ if (this._parent.classType === "SceneViewer") {
26570
26379
  var _this$_parent2;
26571
26380
  (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || _this$_parent2.makeDirty(state);
26572
26381
  }
@@ -26620,7 +26429,7 @@ var Scene = class extends Disposable {
26620
26429
  if (height !== void 0) this.height = height;
26621
26430
  this._transformHandler();
26622
26431
  this.onTransformChange$.emitEvent({
26623
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize,
26432
+ type: 1,
26624
26433
  value: {
26625
26434
  width: this.width,
26626
26435
  height: this.height
@@ -26653,7 +26462,7 @@ var Scene = class extends Disposable {
26653
26462
  this.setScaleValueOnly(scaleX || 1, scaleY || 1);
26654
26463
  this._transformHandler();
26655
26464
  this.onTransformChange$.emitEvent({
26656
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale,
26465
+ type: 2,
26657
26466
  value: {
26658
26467
  scaleX: this.scaleX,
26659
26468
  scaleY: this.scaleY
@@ -26677,7 +26486,7 @@ var Scene = class extends Disposable {
26677
26486
  this.scaleY = precisionTo(this.scaleY, 1);
26678
26487
  this._transformHandler();
26679
26488
  this.onTransformChange$.emitEvent({
26680
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale,
26489
+ type: 2,
26681
26490
  value: {
26682
26491
  scaleX: this.scaleX,
26683
26492
  scaleY: this.scaleY
@@ -26705,7 +26514,7 @@ var Scene = class extends Disposable {
26705
26514
  });
26706
26515
  this._transformHandler();
26707
26516
  this.onTransformChange$.emitEvent({
26708
- type: TRANSFORM_CHANGE_OBSERVABLE_TYPE.all,
26517
+ type: 5,
26709
26518
  value: state,
26710
26519
  preValue: preKeys
26711
26520
  });
@@ -26714,10 +26523,10 @@ var Scene = class extends Disposable {
26714
26523
  return this._parent;
26715
26524
  }
26716
26525
  getEngine() {
26717
- if (this._parent.classType === RENDER_CLASS_TYPE.ENGINE) return this._parent;
26526
+ if (this._parent.classType === "Engine") return this._parent;
26718
26527
  let parent = this._parent;
26719
26528
  while (parent) {
26720
- if (parent.classType === RENDER_CLASS_TYPE.ENGINE) return parent;
26529
+ if (parent.classType === "Engine") return parent;
26721
26530
  parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
26722
26531
  }
26723
26532
  return null;
@@ -27004,18 +26813,18 @@ var Scene = class extends Disposable {
27004
26813
  let parent = this.getParent();
27005
26814
  const parentList = [];
27006
26815
  while (parent) {
27007
- if (parent.classType === RENDER_CLASS_TYPE.SCENE || parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) parentList.push(parent);
26816
+ if (parent.classType === "Scene" || parent.classType === "SceneViewer") parentList.push(parent);
27008
26817
  parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
27009
26818
  }
27010
26819
  parentList.reverse();
27011
- for (const parent of parentList) if (parent.classType === RENDER_CLASS_TYPE.SCENE) {
26820
+ for (const parent of parentList) if (parent.classType === "Scene") {
27012
26821
  const viewPort = parent.getActiveViewportByCoord(coord);
27013
26822
  if (viewPort) {
27014
26823
  const actualX = viewPort.viewportScrollX || 0;
27015
26824
  const actualY = viewPort.viewportScrollY || 0;
27016
26825
  coord = coord.addByPoint(actualX, actualY);
27017
26826
  }
27018
- } else if (parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) coord = parent.transform.clone().invert().applyPoint(coord);
26827
+ } else if (parent.classType === "SceneViewer") coord = parent.transform.clone().invert().applyPoint(coord);
27019
26828
  return coord;
27020
26829
  }
27021
26830
  clearLayer() {
@@ -27093,16 +26902,16 @@ var Scene = class extends Disposable {
27093
26902
  for (let i = 0; i < objectLength; i++) {
27094
26903
  var _testObject$parent;
27095
26904
  const testObject = objectOrder[i];
27096
- if (!testObject.visible || !testObject.evented || testObject.isInGroup && ((_testObject$parent = testObject.parent) === null || _testObject$parent === void 0 ? void 0 : _testObject$parent.classType) === RENDER_CLASS_TYPE.GROUP && testObject.isDrawingObject) continue;
26905
+ if (!testObject.visible || !testObject.evented || testObject.isInGroup && ((_testObject$parent = testObject.parent) === null || _testObject$parent === void 0 ? void 0 : _testObject$parent.classType) === "Group" && testObject.isDrawingObject) continue;
27097
26906
  const svCoord = vecFromSheetContent;
27098
26907
  if (testObject.isHit(svCoord)) {
27099
- if (testObject.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26908
+ if (testObject.classType === "SceneViewer") {
27100
26909
  const pickedObject = testObject.pick(svCoord);
27101
26910
  if (pickedObject) isPickedObject = pickedObject;
27102
26911
  else isPickedObject = testObject.getActiveSubScene();
27103
26912
  } else isPickedObject = testObject;
27104
26913
  break;
27105
- } else if (testObject.classType === RENDER_CLASS_TYPE.SCENE_VIEWER && testObject.allowSelectedClipElement()) {
26914
+ } else if (testObject.classType === "SceneViewer" && testObject.allowSelectedClipElement()) {
27106
26915
  const pickedObject = testObject.pick(svCoord);
27107
26916
  if (pickedObject) {
27108
26917
  isPickedObject = pickedObject;
@@ -27110,12 +26919,12 @@ var Scene = class extends Disposable {
27110
26919
  }
27111
26920
  }
27112
26921
  }
27113
- if (!isPickedObject && this._parent.classType === RENDER_CLASS_TYPE.ENGINE) return this;
26922
+ if (!isPickedObject && this._parent.classType === "Engine") return this;
27114
26923
  return isPickedObject;
27115
26924
  }
27116
26925
  triggerPointerUp(evt) {
27117
26926
  var _this$onPointerUp$$em;
27118
- if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26927
+ if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
27119
26928
  var _this$_parent3;
27120
26929
  (_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 || _this$_parent3.triggerPointerUp(evt);
27121
26930
  return false;
@@ -27124,7 +26933,7 @@ var Scene = class extends Disposable {
27124
26933
  }
27125
26934
  triggerMouseWheel(evt) {
27126
26935
  var _this$onMouseWheel$$e;
27127
- if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26936
+ if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType === "SceneViewer") {
27128
26937
  var _this$_parent4;
27129
26938
  (_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 || _this$_parent4.triggerMouseWheel(evt);
27130
26939
  return false;
@@ -27133,7 +26942,7 @@ var Scene = class extends Disposable {
27133
26942
  }
27134
26943
  triggerSingleClick(evt) {
27135
26944
  var _this$onSingleClick$$;
27136
- if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26945
+ if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
27137
26946
  var _this$_parent5;
27138
26947
  (_this$_parent5 = this._parent) === null || _this$_parent5 === void 0 || _this$_parent5.triggerSingleClick(evt);
27139
26948
  return false;
@@ -27142,7 +26951,7 @@ var Scene = class extends Disposable {
27142
26951
  }
27143
26952
  triggerClick(evt) {
27144
26953
  var _this$onClick$$emitEv;
27145
- if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26954
+ if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType === "SceneViewer") {
27146
26955
  var _this$_parent6;
27147
26956
  (_this$_parent6 = this._parent) === null || _this$_parent6 === void 0 || _this$_parent6.triggerClick(evt);
27148
26957
  return false;
@@ -27151,7 +26960,7 @@ var Scene = class extends Disposable {
27151
26960
  }
27152
26961
  triggerDblclick(evt) {
27153
26962
  var _this$onDblclick$$emi;
27154
- if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26963
+ if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
27155
26964
  var _this$_parent7;
27156
26965
  (_this$_parent7 = this._parent) === null || _this$_parent7 === void 0 || _this$_parent7.triggerDblclick(evt);
27157
26966
  return false;
@@ -27160,7 +26969,7 @@ var Scene = class extends Disposable {
27160
26969
  }
27161
26970
  triggerTripleClick(evt) {
27162
26971
  var _this$onTripleClick$$;
27163
- if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26972
+ if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
27164
26973
  var _this$_parent8;
27165
26974
  (_this$_parent8 = this._parent) === null || _this$_parent8 === void 0 || _this$_parent8.triggerTripleClick(evt);
27166
26975
  return false;
@@ -27169,7 +26978,7 @@ var Scene = class extends Disposable {
27169
26978
  }
27170
26979
  triggerPointerMove(evt) {
27171
26980
  var _this$onPointerMove$$;
27172
- if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26981
+ if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType === "SceneViewer") {
27173
26982
  var _this$_parent9;
27174
26983
  (_this$_parent9 = this._parent) === null || _this$_parent9 === void 0 || _this$_parent9.triggerPointerMove(evt);
27175
26984
  return false;
@@ -27178,7 +26987,7 @@ var Scene = class extends Disposable {
27178
26987
  }
27179
26988
  triggerPointerDown(evt) {
27180
26989
  var _this$onPointerDown$$;
27181
- if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26990
+ if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType === "SceneViewer") {
27182
26991
  var _this$_parent10;
27183
26992
  (_this$_parent10 = this._parent) === null || _this$_parent10 === void 0 || _this$_parent10.triggerPointerDown(evt);
27184
26993
  return false;
@@ -27186,7 +26995,7 @@ var Scene = class extends Disposable {
27186
26995
  return true;
27187
26996
  }
27188
26997
  triggerPointerOut(evt) {
27189
- if (this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
26998
+ if (this._parent.classType === "SceneViewer") {
27190
26999
  var _this$_parent11;
27191
27000
  (_this$_parent11 = this._parent) === null || _this$_parent11 === void 0 || _this$_parent11.triggerPointerOut(evt);
27192
27001
  return false;
@@ -27195,7 +27004,7 @@ var Scene = class extends Disposable {
27195
27004
  }
27196
27005
  triggerPointerLeave(evt) {
27197
27006
  var _this$onPointerLeave$;
27198
- if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27007
+ if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType === "SceneViewer") {
27199
27008
  var _this$_parent12;
27200
27009
  (_this$_parent12 = this._parent) === null || _this$_parent12 === void 0 || _this$_parent12.triggerPointerLeave(evt);
27201
27010
  return false;
@@ -27203,7 +27012,7 @@ var Scene = class extends Disposable {
27203
27012
  return true;
27204
27013
  }
27205
27014
  triggerPointerOver(evt) {
27206
- if (this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27015
+ if (this._parent.classType === "SceneViewer") {
27207
27016
  var _this$_parent13;
27208
27017
  (_this$_parent13 = this._parent) === null || _this$_parent13 === void 0 || _this$_parent13.triggerPointerOver(evt);
27209
27018
  return false;
@@ -27211,7 +27020,7 @@ var Scene = class extends Disposable {
27211
27020
  return true;
27212
27021
  }
27213
27022
  triggerPointerCancel(evt) {
27214
- if (this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27023
+ if (this._parent.classType === "SceneViewer") {
27215
27024
  var _this$_parent14;
27216
27025
  (_this$_parent14 = this._parent) === null || _this$_parent14 === void 0 || _this$_parent14.triggerPointerCancel(evt);
27217
27026
  return false;
@@ -27220,7 +27029,7 @@ var Scene = class extends Disposable {
27220
27029
  }
27221
27030
  triggerPointerEnter(evt) {
27222
27031
  var _this$onPointerEnter$;
27223
- if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27032
+ if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType === "SceneViewer") {
27224
27033
  var _this$_parent15;
27225
27034
  (_this$_parent15 = this._parent) === null || _this$_parent15 === void 0 || _this$_parent15.triggerPointerEnter(evt);
27226
27035
  return false;
@@ -27229,7 +27038,7 @@ var Scene = class extends Disposable {
27229
27038
  }
27230
27039
  triggerDragLeave(evt) {
27231
27040
  var _this$onDragLeave$$em;
27232
- if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27041
+ if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
27233
27042
  var _this$_parent16;
27234
27043
  (_this$_parent16 = this._parent) === null || _this$_parent16 === void 0 || _this$_parent16.triggerDragLeave(evt);
27235
27044
  return false;
@@ -27238,7 +27047,7 @@ var Scene = class extends Disposable {
27238
27047
  }
27239
27048
  triggerDragOver(evt) {
27240
27049
  var _this$onDragOver$$emi;
27241
- if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27050
+ if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
27242
27051
  var _this$_parent17;
27243
27052
  (_this$_parent17 = this._parent) === null || _this$_parent17 === void 0 || _this$_parent17.triggerDragOver(evt);
27244
27053
  return false;
@@ -27247,7 +27056,7 @@ var Scene = class extends Disposable {
27247
27056
  }
27248
27057
  triggerDragEnter(evt) {
27249
27058
  var _this$onDragEnter$$em;
27250
- if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27059
+ if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
27251
27060
  var _this$_parent18;
27252
27061
  (_this$_parent18 = this._parent) === null || _this$_parent18 === void 0 || _this$_parent18.triggerDragEnter(evt);
27253
27062
  return false;
@@ -27256,7 +27065,7 @@ var Scene = class extends Disposable {
27256
27065
  }
27257
27066
  triggerDrop(evt) {
27258
27067
  var _this$onDrop$$emitEve;
27259
- if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
27068
+ if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType === "SceneViewer") {
27260
27069
  var _this$_parent19;
27261
27070
  (_this$_parent19 = this._parent) === null || _this$_parent19 === void 0 || _this$_parent19.triggerDrop(evt);
27262
27071
  return false;
@@ -27269,10 +27078,11 @@ var Scene = class extends Disposable {
27269
27078
  *
27270
27079
  */
27271
27080
  _transformHandler() {
27272
- this.transform = Transform.create().composeMatrix({
27081
+ const composeResult = Transform.create().composeMatrix({
27273
27082
  scaleX: this.scaleX,
27274
27083
  scaleY: this.scaleY
27275
27084
  });
27085
+ this.transform = composeResult;
27276
27086
  this.getViewports().forEach((vp) => {
27277
27087
  vp.resetCanvasSizeAndUpdateScroll();
27278
27088
  });
@@ -28367,7 +28177,7 @@ var Viewport = class {
28367
28177
  });
28368
28178
  if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
28369
28179
  evt.preventDefault();
28370
- if (this._scene.getParent().classType === RENDER_CLASS_TYPE.SCENE_VIEWER) state.stopPropagation();
28180
+ if (this._scene.getParent().classType === "SceneViewer") state.stopPropagation();
28371
28181
  }
28372
28182
  if (this._isWheelPreventDefaultX && this._isWheelPreventDefaultY) evt.preventDefault();
28373
28183
  this._scene.makeDirty(true);
@@ -28725,8 +28535,8 @@ var Viewport = class {
28725
28535
  _drawScrollbar(ctx) {
28726
28536
  if (!this._scrollBar) return;
28727
28537
  const parent = this._scene.getParent();
28728
- if (parent.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) this._scrollBar.render(ctx);
28729
- else if (parent.classType === RENDER_CLASS_TYPE.ENGINE) this._scrollBar.render(ctx);
28538
+ if (parent.classType === "SceneViewer") this._scrollBar.render(ctx);
28539
+ else if (parent.classType === "Engine") this._scrollBar.render(ctx);
28730
28540
  }
28731
28541
  setViewportSize(props) {
28732
28542
  if (Tools.isDefine(props === null || props === void 0 ? void 0 : props.top)) this.top = props.top;