@univerjs/sheets-drawing-ui 0.6.3 → 0.6.4-nightly.202503111607

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,44 +1,44 @@
1
- var $r = Object.defineProperty;
2
- var xr = (i, n, e) => n in i ? $r(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
3
- var Q = (i, n, e) => xr(i, typeof n != "symbol" ? n + "" : n, e);
4
- import { CommandType as te, ICommandService as G, IUndoRedoService as Ge, sequenceExecute as Hn, LocaleService as xt, IUniverInstanceService as Ce, Inject as N, Injector as tt, IContextService as zn, RxDisposable as Lr, UniverInstanceType as F, toDisposable as Fr, FOCUSING_COMMON_DRAWINGS as Fe, DrawingTypeEnum as x, Disposable as le, ArrangeTypeEnum as mt, createDocumentModelWithStyle as Sn, ObjectRelativeFromV as In, ObjectRelativeFromH as Cn, WrapTextType as bn, PositionedObjectLayoutType as Dn, BooleanNumber as Rn, BuildTextUtils as Mn, ImageSourceType as yn, generateRandomId as Et, Range as Yr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as wt, InterceptorEffectEnum as Gr, ObjectMatrix as Xr, Tools as Ee, IPermissionService as Vr, UserManagerService as Hr, Rectangle as zr, Direction as Ie, FOCUSING_FX_BAR_EDITOR as Kr, EDITOR_ACTIVATED as Zr, FOCUSING_PANEL_EDITOR as Jr, LifecycleService as qr, LifecycleStages as Qr, DisposableCollection as _t, fromEventSubject as ei, DependentOn as ti, IConfigService as ni, Plugin as ri, merge as ii, registerDependencies as si, touchDependencies as zt } from "@univerjs/core";
5
- import { DocDrawingController as oi, UniverDocsDrawingPlugin as ai } from "@univerjs/docs-drawing";
6
- import { SetDrawingSelectedOperation as Lt, IImageIoService as Kn, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as Tn, ImageUploadStatusType as We, DRAWING_IMAGE_ALLOW_SIZE as On, getImageSize as Kt, DRAWING_IMAGE_WIDTH_LIMIT as Un, DRAWING_IMAGE_HEIGHT_LIMIT as Pn, ImageSourceType as ci, getDrawingShapeKeyByDrawingSearch as be, UniverDrawingPlugin as di } from "@univerjs/drawing";
7
- import { ImageCropperObject as li, COMPONENT_IMAGE_POPUP_MENU as ui, OpenImageCropOperation as hi, ImageResetSizeOperation as gi, DrawingRenderService as Zn, DrawingCommonPanel as fi, UniverDrawingUIPlugin as mi } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as ne, precisionTo as vt, transformObjectOutOfGroup as pi, getGroupState as wi, DeviceInputEventType as _i, getCurrentTypeOfRenderer as Jn, RENDER_CLASS_TYPE as je, Rect as $e, ObjectType as An, DRAWING_OBJECT_LAYER_INDEX as Zt, SHEET_VIEWPORT_KEY as qn } from "@univerjs/engine-render";
9
- import { ISheetDrawingService as ae, DrawingApplyType as P, SetDrawingApplyMutation as A, SheetDrawingAnchorType as U, UniverSheetsDrawingPlugin as vi } from "@univerjs/sheets-drawing";
10
- import { SheetCanvasPopManagerService as Si, convertPositionSheetOverGridToAbsolute as Ii, ISheetSelectionRenderService as Xe, SheetSkeletonManagerService as V, attachRangeWithCoord as Qn, IEditorBridgeService as Ci, SetCellEditVisibleOperation as bi, IAutoFillService as Di, HoverManagerService as Ri, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as De, discreteRangeToRange as Nn, virtualizeDiscreteRanges as Mi, ISheetClipboardService as yi, SheetPrintInterceptorService as Ei, getCurrentRangeDisable$ as Ti, SetZoomRatioOperation as kn, SetScrollOperation as Oi } from "@univerjs/sheets-ui";
11
- import { ISidebarService as Ui, useDependency as Te, IUIPartsService as Pi, BuiltInUIPart as Ai, connectInjector as Ni, ILocalFileService as ki, IMessageService as Bi, IClipboardInterfaceService as Wi, getMenuHiddenObservable as ln, MenuItemType as un, RibbonStartGroup as ji, KeyCode as Ye, ComponentManager as $i, IMenuManagerService as xi, IShortcutService as Li, CanvasFloatDomService as Fi } from "@univerjs/ui";
12
- import { takeUntil as Bn, combineLatest as St, switchMap as Se, EMPTY as pe, tap as Wn, map as Oe, distinctUntilChanged as jn, Subject as Jt, filter as Yi, take as Gi, BehaviorSubject as Ze, of as $n } from "rxjs";
13
- import { SheetInterceptorService as Ft, getSheetCommandTarget as H, SheetsSelectionsService as hn, SetRangeValuesCommand as xn, SetWorksheetRowHeightMutation as er, SetWorksheetColWidthMutation as tr, SetWorksheetRowIsAutoHeightMutation as Xi, SetWorksheetRowAutoHeightMutation as nr, AddWorksheetMergeMutation as Vi, RemoveWorksheetMergeMutation as Hi, AFTER_CELL_EDIT as zi, INTERCEPTOR_POINT as Ki, InterceptCellContentPriority as Zi, WorkbookViewPermission as Ln, WorksheetViewPermission as Fn, WorkbookEditablePermission as en, WorksheetEditPermission as tn, InsertRowCommand as rr, InsertColCommand as ir, RemoveRowCommand as sr, RemoveColCommand as or, DeleteRangeMoveLeftCommand as ar, DeleteRangeMoveUpCommand as cr, InsertRangeMoveDownCommand as dr, InsertRangeMoveRightCommand as lr, DeltaRowHeightCommand as nn, SetRowHeightCommand as rn, DeltaColumnWidthCommand as ur, SetColWidthCommand as hr, SetRowHiddenCommand as gr, SetSpecificRowsVisibleCommand as fr, SetSpecificColsVisibleCommand as mr, SetColHiddenCommand as pr, MoveColsCommand as wr, MoveRowsCommand as _r, MoveRangeCommand as vr, SetRowVisibleMutation as Ji, SetRowHiddenMutation as qi, SetColVisibleMutation as Qi, SetColHiddenMutation as es, SetWorksheetActiveOperation as ts, RangeProtectionPermissionEditPoint as ns, SetFrozenMutation as rs, COMMAND_LISTENER_SKELETON_CHANGE as is } from "@univerjs/sheets";
14
- import { jsx as ee, jsxs as Tt } from "react/jsx-runtime";
15
- import ss, { useEffect as gn, forwardRef as Sr, useRef as os, createElement as Ir, useState as sn } from "react";
16
- import { docDrawingPositionToTransform as Yn, ReplaceSnapshotCommand as as } from "@univerjs/docs-ui";
17
- import { MessageType as Re, clsx as It, RadioGroup as cs, Radio as qt } from "@univerjs/design";
18
- const ds = "sheets-drawing-ui.config", Gn = {}, L = {
1
+ var Br = Object.defineProperty;
2
+ var Wr = (i, t, e) => t in i ? Br(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var q = (i, t, e) => Wr(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { CommandType as ee, ICommandService as G, IUndoRedoService as Ge, sequenceExecute as Vn, LocaleService as $t, IUniverInstanceService as Ee, Inject as N, Injector as tt, IContextService as Hn, RxDisposable as jr, UniverInstanceType as F, toDisposable as xr, FOCUSING_COMMON_DRAWINGS as Fe, DrawingTypeEnum as $, Disposable as le, ArrangeTypeEnum as mt, createDocumentModelWithStyle as vn, ObjectRelativeFromV as Sn, ObjectRelativeFromH as In, WrapTextType as Cn, PositionedObjectLayoutType as Dn, BooleanNumber as bn, BuildTextUtils as Rn, ImageSourceType as Mn, generateRandomId as Tt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as wt, InterceptorEffectEnum as $r, ObjectMatrix as Lr, Tools as Me, IPermissionService as Fr, UserManagerService as Yr, Rectangle as Gr, Direction as Ie, FOCUSING_FX_BAR_EDITOR as Xr, EDITOR_ACTIVATED as Vr, FOCUSING_PANEL_EDITOR as Hr, LifecycleService as zr, LifecycleStages as Kr, DisposableCollection as _t, fromEventSubject as Zr, DependentOn as Jr, IConfigService as qr, Plugin as Qr, merge as ei, registerDependencies as ti, touchDependencies as zt } from "@univerjs/core";
5
+ import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
6
+ import { SetDrawingSelectedOperation as Lt, IImageIoService as zn, IDrawingManagerService as se, DRAWING_IMAGE_ALLOW_IMAGE_LIST as yn, DRAWING_IMAGE_COUNT_LIMIT as Tn, ImageUploadStatusType as Be, DRAWING_IMAGE_ALLOW_SIZE as En, getImageSize as Kt, DRAWING_IMAGE_WIDTH_LIMIT as On, DRAWING_IMAGE_HEIGHT_LIMIT as Un, ImageSourceType as ii, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as si } from "@univerjs/drawing";
7
+ import { ImageCropperObject as oi, COMPONENT_IMAGE_POPUP_MENU as ai, OpenImageCropOperation as ci, ImageResetSizeOperation as di, DrawingRenderService as Kn, DrawingCommonPanel as li, UniverDrawingUIPlugin as ui } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as te, precisionTo as vt, transformObjectOutOfGroup as hi, getGroupState as gi, DeviceInputEventType as fi, getCurrentTypeOfRenderer as Zn, RENDER_CLASS_TYPE as We, Rect as je, ObjectType as Pn, DRAWING_OBJECT_LAYER_INDEX as Zt, SHEET_VIEWPORT_KEY as Jn } from "@univerjs/engine-render";
9
+ import { ISheetDrawingService as oe, DrawingApplyType as P, SetDrawingApplyMutation as A, SheetDrawingAnchorType as U, UniverSheetsDrawingPlugin as mi } from "@univerjs/sheets-drawing";
10
+ import { SheetCanvasPopManagerService as pi, convertPositionSheetOverGridToAbsolute as wi, ISheetSelectionRenderService as Xe, SheetSkeletonManagerService as V, attachRangeWithCoord as qn, IEditorBridgeService as _i, SetCellEditVisibleOperation as vi, IAutoFillService as Si, HoverManagerService as Ii, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as De, discreteRangeToRange as An, virtualizeDiscreteRanges as Ci, ISheetClipboardService as Di, SheetPrintInterceptorService as bi, getCurrentRangeDisable$ as Ri, SetZoomRatioOperation as Nn, SetScrollOperation as Mi } from "@univerjs/sheets-ui";
11
+ import { ISidebarService as yi, useDependency as ye, IUIPartsService as Ti, BuiltInUIPart as Ei, connectInjector as Oi, ILocalFileService as Ui, IMessageService as Pi, IClipboardInterfaceService as Ai, getMenuHiddenObservable as dn, MenuItemType as ln, RibbonStartGroup as Ni, KeyCode as Ye, ComponentManager as ki, IMenuManagerService as Bi, IShortcutService as Wi, CanvasFloatDomService as ji } from "@univerjs/ui";
12
+ import { takeUntil as kn, combineLatest as St, switchMap as Se, EMPTY as pe, tap as Bn, map as Te, distinctUntilChanged as Wn, Subject as Jt, filter as xi, take as $i, BehaviorSubject as Ze, of as jn } from "rxjs";
13
+ import { SheetInterceptorService as Ft, getSheetCommandTarget as de, SheetsSelectionsService as un, SetRangeValuesCommand as xn, INTERCEPTOR_POINT as Li, InterceptCellContentPriority as Fi, WorkbookViewPermission as $n, WorksheetViewPermission as Ln, WorkbookEditablePermission as en, WorksheetEditPermission as tn, InsertRowCommand as Qn, InsertColCommand as er, RemoveRowCommand as tr, RemoveColCommand as nr, DeleteRangeMoveLeftCommand as rr, DeleteRangeMoveUpCommand as ir, InsertRangeMoveDownCommand as sr, InsertRangeMoveRightCommand as or, DeltaRowHeightCommand as nn, SetRowHeightCommand as rn, DeltaColumnWidthCommand as ar, SetColWidthCommand as cr, SetRowHiddenCommand as dr, SetSpecificRowsVisibleCommand as lr, SetSpecificColsVisibleCommand as ur, SetColHiddenCommand as hr, MoveColsCommand as gr, MoveRowsCommand as fr, MoveRangeCommand as mr, SetRowVisibleMutation as Yi, SetRowHiddenMutation as Gi, SetColVisibleMutation as Xi, SetColHiddenMutation as Vi, SetWorksheetRowHeightMutation as Hi, SetWorksheetColWidthMutation as zi, SetWorksheetActiveOperation as Ki, RangeProtectionPermissionEditPoint as Zi, SetFrozenMutation as Ji, SetWorksheetRowAutoHeightMutation as qi, COMMAND_LISTENER_SKELETON_CHANGE as Qi } from "@univerjs/sheets";
14
+ import { jsx as Q, jsxs as Et } from "react/jsx-runtime";
15
+ import es, { useEffect as hn, forwardRef as pr, useRef as ts, createElement as wr, useState as sn } from "react";
16
+ import { docDrawingPositionToTransform as Fn, ReplaceSnapshotCommand as ns } from "@univerjs/docs-ui";
17
+ import { MessageType as be, clsx as It, RadioGroup as rs, Radio as qt } from "@univerjs/design";
18
+ const is = "sheets-drawing-ui.config", Yn = {}, L = {
19
19
  id: "sheet.operation.clear-drawing-transformer",
20
- type: te.MUTATION,
21
- handler: (i, n) => {
22
- const e = i.get(ne);
23
- return n.forEach((t) => {
20
+ type: ee.MUTATION,
21
+ handler: (i, t) => {
22
+ const e = i.get(te);
23
+ return t.forEach((n) => {
24
24
  var r, s;
25
- (s = (r = e.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
25
+ (s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
26
26
  }), !0;
27
27
  }
28
28
  }, nt = {
29
29
  id: "sheet.command.remove-sheet-image",
30
- type: te.COMMAND,
31
- handler: (i, n) => {
32
- var S, C, b;
33
- const e = i.get(G), t = i.get(Ge), r = i.get(Ft), s = i.get(ae);
34
- if (!n) return !1;
35
- const { drawings: o } = n, a = [];
30
+ type: ee.COMMAND,
31
+ handler: (i, t) => {
32
+ var S, C, D;
33
+ const e = i.get(G), n = i.get(Ge), r = i.get(Ft), s = i.get(oe);
34
+ if (!t) return !1;
35
+ const { drawings: o } = t, a = [];
36
36
  o.forEach((v) => {
37
- const { unitId: D } = v;
38
- a.push(D);
37
+ const { unitId: b } = v;
38
+ a.push(b);
39
39
  });
40
- const c = s.getBatchRemoveOp(o), { unitId: u, subUnitId: l, undo: d, redo: g, objects: h } = c, f = r.onCommandExecute({ id: nt.id, params: n }), p = { id: A.id, params: { unitId: u, subUnitId: l, op: g, objects: h, type: P.REMOVE } }, m = { id: A.id, params: { unitId: u, subUnitId: l, op: d, objects: h, type: P.INSERT } };
41
- return Hn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (t.pushUndoRedo({
40
+ const c = s.getBatchRemoveOp(o), { unitId: u, subUnitId: l, undo: d, redo: g, objects: h } = c, f = r.onCommandExecute({ id: nt.id, params: t }), p = { id: A.id, params: { unitId: u, subUnitId: l, op: g, objects: h, type: P.REMOVE } }, m = { id: A.id, params: { unitId: u, subUnitId: l, op: d, objects: h, type: P.INSERT } };
41
+ return Vn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (n.pushUndoRedo({
42
42
  unitID: u,
43
43
  undoMutations: [
44
44
  ...(C = f.preUndos) != null ? C : [],
@@ -47,24 +47,24 @@ const ds = "sheets-drawing-ui.config", Gn = {}, L = {
47
47
  { id: L.id, params: a }
48
48
  ],
49
49
  redoMutations: [
50
- ...(b = f.preRedos) != null ? b : [],
50
+ ...(D = f.preRedos) != null ? D : [],
51
51
  p,
52
52
  ...f.redos,
53
53
  { id: L.id, params: a }
54
54
  ]
55
55
  }), !0) : !1;
56
56
  }
57
- }, Cr = "COMPONENT_SHEET_DRAWING_PANEL", br = {
57
+ }, _r = "COMPONENT_SHEET_DRAWING_PANEL", vr = {
58
58
  id: "sidebar.operation.sheet-image",
59
- type: te.COMMAND,
60
- handler: async (i, n) => {
61
- const e = i.get(Ui), t = i.get(xt), r = i.get(Ce), s = i.get(G);
62
- if (!H(r)) return !1;
63
- switch (n.value) {
59
+ type: ee.COMMAND,
60
+ handler: async (i, t) => {
61
+ const e = i.get(yi), n = i.get($t), r = i.get(Ee), s = i.get(G);
62
+ if (!de(r)) return !1;
63
+ switch (t.value) {
64
64
  case "open":
65
65
  e.open({
66
- header: { title: t.t("sheetImage.panel.title") },
67
- children: { label: Cr },
66
+ header: { title: n.t("sheetImage.panel.title") },
67
+ children: { label: _r },
68
68
  onClose: () => {
69
69
  s.syncExecuteCommand(Lt.id, []);
70
70
  },
@@ -78,78 +78,78 @@ const ds = "sheets-drawing-ui.config", Gn = {}, L = {
78
78
  }
79
79
  return !0;
80
80
  }
81
- }, Dr = {
81
+ }, Sr = {
82
82
  id: "sheet.operation.edit-sheet-image",
83
- type: te.OPERATION,
84
- handler: (i, n) => {
83
+ type: ee.OPERATION,
84
+ handler: (i, t) => {
85
85
  const e = i.get(G);
86
- return n == null ? !1 : (e.syncExecuteCommand(Lt.id, [n]), e.executeCommand(br.id, { value: "open" }), !0);
87
- }
88
- }, ls = "univer-upload-loading", us = "univer-upload-loading-body", hs = "univer-upload-loading-body-animation", gs = "univer-upload-loading-body-text", Ct = {
89
- uploadLoading: ls,
90
- uploadLoadingBody: us,
91
- uploadLoadingBodyAnimation: hs,
92
- uploadLoadingBodyText: gs
93
- }, fs = () => {
94
- const i = Te(Kn), n = Te(xt), [e, t] = ss.useState(0);
95
- return gn(() => {
86
+ return t == null ? !1 : (e.syncExecuteCommand(Lt.id, [t]), e.executeCommand(vr.id, { value: "open" }), !0);
87
+ }
88
+ }, ss = "univer-upload-loading", os = "univer-upload-loading-body", as = "univer-upload-loading-body-animation", cs = "univer-upload-loading-body-text", Ct = {
89
+ uploadLoading: ss,
90
+ uploadLoadingBody: os,
91
+ uploadLoadingBodyAnimation: as,
92
+ uploadLoadingBodyText: cs
93
+ }, ds = () => {
94
+ const i = ye(zn), t = ye($t), [e, n] = es.useState(0);
95
+ return hn(() => {
96
96
  const r = i.change$.subscribe((s) => {
97
- t(s);
97
+ n(s);
98
98
  });
99
99
  return () => {
100
100
  r.unsubscribe();
101
101
  };
102
- }, [i]), /* @__PURE__ */ ee("div", { style: { display: e > 0 ? "block" : "none" }, className: Ct.uploadLoading, children: /* @__PURE__ */ Tt("div", { className: Ct.uploadLoadingBody, children: [
103
- /* @__PURE__ */ ee("div", { className: Ct.uploadLoadingBodyAnimation }),
104
- /* @__PURE__ */ ee("div", { className: Ct.uploadLoadingBodyText, children: `${n.t("uploadLoading.loading")}: ${e}` })
102
+ }, [i]), /* @__PURE__ */ Q("div", { style: { display: e > 0 ? "block" : "none" }, className: Ct.uploadLoading, children: /* @__PURE__ */ Et("div", { className: Ct.uploadLoadingBody, children: [
103
+ /* @__PURE__ */ Q("div", { className: Ct.uploadLoadingBodyAnimation }),
104
+ /* @__PURE__ */ Q("div", { className: Ct.uploadLoadingBodyText, children: `${t.t("uploadLoading.loading")}: ${e}` })
105
105
  ] }) });
106
106
  };
107
- var ms = Object.getOwnPropertyDescriptor, ps = (i, n, e, t) => {
108
- for (var r = t > 1 ? void 0 : t ? ms(n, e) : n, s = i.length - 1, o; s >= 0; s--)
107
+ var ls = Object.getOwnPropertyDescriptor, us = (i, t, e, n) => {
108
+ for (var r = n > 1 ? void 0 : n ? ls(t, e) : t, s = i.length - 1, o; s >= 0; s--)
109
109
  (o = i[s]) && (r = o(r) || r);
110
110
  return r;
111
- }, we = (i, n) => (e, t) => n(e, t, i);
112
- let Ot = class extends Lr {
113
- constructor(n, e, t, r, s, o, a, c) {
111
+ }, we = (i, t) => (e, n) => t(e, n, i);
112
+ let Ot = class extends jr {
113
+ constructor(t, e, n, r, s, o, a, c) {
114
114
  super();
115
- Q(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
116
- this._injector = n, this._drawingManagerService = e, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = c, this._init();
115
+ q(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
116
+ this._injector = t, this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = c, this._init();
117
117
  }
118
118
  _init() {
119
- this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Bn(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Bn(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((n) => this._create(n)), this._uiPartsService.registerComponent(Ai.CONTENT, () => Ni(fs, this._injector));
119
+ this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(kn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(kn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._uiPartsService.registerComponent(Ei.CONTENT, () => Oi(ds, this._injector));
120
120
  }
121
- _dispose(n) {
122
- const e = n.getUnitId();
121
+ _dispose(t) {
122
+ const e = t.getUnitId();
123
123
  this._renderManagerService.removeRender(e);
124
124
  }
125
- _create(n) {
126
- if (!n)
125
+ _create(t) {
126
+ if (!t)
127
127
  return;
128
- const e = n.getUnitId();
128
+ const e = t.getUnitId();
129
129
  this._renderManagerService.has(e) && !this._initImagePopupMenu.has(e) && (this._popupMenuListener(e), this._initImagePopupMenu.add(e));
130
130
  }
131
- _hasCropObject(n) {
132
- const e = n.getAllObjectsByOrder();
133
- for (const t of e)
134
- if (t instanceof li)
131
+ _hasCropObject(t) {
132
+ const e = t.getAllObjectsByOrder();
133
+ for (const n of e)
134
+ if (n instanceof oi)
135
135
  return !0;
136
136
  return !1;
137
137
  }
138
- _popupMenuListener(n) {
138
+ _popupMenuListener(t) {
139
139
  var s;
140
- const e = (s = this._renderManagerService.getRenderById(n)) == null ? void 0 : s.scene;
140
+ const e = (s = this._renderManagerService.getRenderById(t)) == null ? void 0 : s.scene;
141
141
  if (!e)
142
142
  return;
143
- const t = e.getTransformerByCreate();
144
- if (!t)
143
+ const n = e.getTransformerByCreate();
144
+ if (!n)
145
145
  return;
146
146
  let r;
147
147
  this.disposeWithMe(
148
- Fr(
149
- t.createControl$.subscribe(() => {
148
+ xr(
149
+ n.createControl$.subscribe(() => {
150
150
  if (this._contextService.setContextValue(Fe, !0), this._hasCropObject(e))
151
151
  return;
152
- const o = t.getSelectedObjectMap();
152
+ const o = n.getSelectedObjectMap();
153
153
  if (o.size > 1) {
154
154
  r == null || r.dispose();
155
155
  return;
@@ -166,7 +166,7 @@ let Ot = class extends Lr {
166
166
  r == null || r.dispose();
167
167
  const p = this._canvasPopManagerService.getFeatureMenu(l, d, g, h);
168
168
  r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
169
- componentKey: ui,
169
+ componentKey: ai,
170
170
  direction: "horizontal",
171
171
  offset: [2, 0],
172
172
  extraProps: {
@@ -176,7 +176,7 @@ let Ot = class extends Lr {
176
176
  })
177
177
  )
178
178
  ), this.disposeWithMe(
179
- t.clearControl$.subscribe(() => {
179
+ n.clearControl$.subscribe(() => {
180
180
  r == null || r.dispose(), this._contextService.setContextValue(Fe, !1), this._commandService.syncExecuteCommand(Lt.id, []);
181
181
  })
182
182
  ), this.disposeWithMe(
@@ -184,62 +184,62 @@ let Ot = class extends Lr {
184
184
  o[Fe] === !1 && (r == null || r.dispose());
185
185
  })
186
186
  ), this.disposeWithMe(
187
- t.changing$.subscribe(() => {
187
+ n.changing$.subscribe(() => {
188
188
  r == null || r.dispose();
189
189
  })
190
190
  );
191
191
  }
192
- _getImageMenuItems(n, e, t, r) {
192
+ _getImageMenuItems(t, e, n, r) {
193
193
  return [
194
194
  {
195
195
  label: "image-popup.edit",
196
196
  index: 0,
197
- commandId: Dr.id,
198
- commandParams: { unitId: n, subUnitId: e, drawingId: t },
199
- disable: r === x.DRAWING_DOM
197
+ commandId: Sr.id,
198
+ commandParams: { unitId: t, subUnitId: e, drawingId: n },
199
+ disable: r === $.DRAWING_DOM
200
200
  },
201
201
  {
202
202
  label: "image-popup.delete",
203
203
  index: 1,
204
204
  commandId: nt.id,
205
- commandParams: { unitId: n, drawings: [{ unitId: n, subUnitId: e, drawingId: t }] },
205
+ commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
206
206
  disable: !1
207
207
  },
208
208
  {
209
209
  label: "image-popup.crop",
210
210
  index: 2,
211
- commandId: hi.id,
212
- commandParams: { unitId: n, subUnitId: e, drawingId: t },
213
- disable: r === x.DRAWING_DOM
211
+ commandId: ci.id,
212
+ commandParams: { unitId: t, subUnitId: e, drawingId: n },
213
+ disable: r === $.DRAWING_DOM
214
214
  },
215
215
  {
216
216
  label: "image-popup.reset",
217
217
  index: 3,
218
- commandId: gi.id,
219
- commandParams: [{ unitId: n, subUnitId: e, drawingId: t }],
220
- disable: r === x.DRAWING_DOM
218
+ commandId: di.id,
219
+ commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
220
+ disable: r === $.DRAWING_DOM
221
221
  }
222
222
  ];
223
223
  }
224
224
  };
225
- Ot = ps([
225
+ Ot = us([
226
226
  we(0, N(tt)),
227
- we(1, oe),
228
- we(2, N(Si)),
229
- we(3, ne),
230
- we(4, Ce),
231
- we(5, zn),
232
- we(6, N(Pi)),
227
+ we(1, se),
228
+ we(2, N(pi)),
229
+ we(3, te),
230
+ we(4, Ee),
231
+ we(5, Hn),
232
+ we(6, N(Ti)),
233
233
  we(7, G)
234
234
  ], Ot);
235
- function z(i, n, e) {
236
- const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: c = 0, skewY: u = 0 } = i, l = e.getCurrent();
235
+ function H(i, t, e) {
236
+ const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: c = 0, skewY: u = 0 } = i, l = e.getCurrent();
237
237
  if (l == null)
238
238
  return;
239
- const d = Ii(
239
+ const d = wi(
240
240
  l.unitId,
241
241
  l.sheetId,
242
- { from: t, to: r },
242
+ { from: n, to: r },
243
243
  e
244
244
  );
245
245
  let { left: g, top: h, width: f, height: p } = d;
@@ -256,23 +256,23 @@ function z(i, n, e) {
256
256
  height: p
257
257
  };
258
258
  }
259
- function $(i, n) {
260
- const { left: e = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: c = 0, skewX: u = 0, skewY: l = 0 } = i, d = n.getCellWithCoordByOffset(e, t);
259
+ function x(i, t) {
260
+ const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: c = 0, skewX: u = 0, skewY: l = 0 } = i, d = t.getCellWithCoordByOffset(e, n);
261
261
  if (d == null)
262
262
  return;
263
263
  const g = {
264
264
  column: d.actualColumn,
265
265
  columnOffset: vt(e - d.startX, 1),
266
266
  row: d.actualRow,
267
- rowOffset: vt(t - d.startY, 1)
268
- }, h = n.getCellWithCoordByOffset(e + r, t + s);
267
+ rowOffset: vt(n - d.startY, 1)
268
+ }, h = t.getCellWithCoordByOffset(e + r, n + s);
269
269
  if (h == null)
270
270
  return;
271
271
  const f = {
272
272
  column: h.actualColumn,
273
273
  columnOffset: vt(e + r - h.startX, 1),
274
274
  row: h.actualRow,
275
- rowOffset: vt(t + s - h.startY, 1)
275
+ rowOffset: vt(n + s - h.startY, 1)
276
276
  };
277
277
  return {
278
278
  flipY: o,
@@ -284,14 +284,14 @@ function $(i, n) {
284
284
  to: f
285
285
  };
286
286
  }
287
- var ws = Object.getOwnPropertyDescriptor, _s = (i, n, e, t) => {
288
- for (var r = t > 1 ? void 0 : t ? ws(n, e) : n, s = i.length - 1, o; s >= 0; s--)
287
+ var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
288
+ for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
289
289
  (o = i[s]) && (r = o(r) || r);
290
290
  return r;
291
- }, bt = (i, n) => (e, t) => n(e, t, i);
291
+ }, Dt = (i, t) => (e, n) => t(e, n, i);
292
292
  let on = class extends le {
293
- constructor(i, n, e, t, r) {
294
- super(), this._context = i, this._sheetDrawingService = n, this._drawingManagerService = e, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
293
+ constructor(i, t, e, n, r) {
294
+ super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
295
295
  }
296
296
  _init() {
297
297
  this._drawingInitializeListener();
@@ -299,26 +299,26 @@ let on = class extends le {
299
299
  _drawingInitializeListener() {
300
300
  this._sheetDrawingService.initializeNotification(this._context.unitId);
301
301
  const i = this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId);
302
- for (const n in i) {
303
- const e = i[n];
304
- for (const t in e.data) {
305
- const r = e.data[t];
306
- r.transform = z(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
302
+ for (const t in i) {
303
+ const e = i[t];
304
+ for (const n in e.data) {
305
+ const r = e.data[n];
306
+ r.transform = H(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
307
307
  }
308
308
  }
309
309
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
310
310
  }
311
311
  };
312
- on = _s([
313
- bt(1, ae),
314
- bt(2, oe),
315
- bt(3, N(Xe)),
316
- bt(4, N(V))
312
+ on = gs([
313
+ Dt(1, oe),
314
+ Dt(2, se),
315
+ Dt(3, N(Xe)),
316
+ Dt(4, N(V))
317
317
  ], on);
318
- function vs(i) {
319
- const n = [];
318
+ function fs(i) {
319
+ const t = [];
320
320
  return i.forEach((e) => {
321
- const { parent: t, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = t, c = wi(0, 0, r.map((d) => d.transform || {})), u = r.map((d) => {
321
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, c = gi(0, 0, r.map((d) => d.transform || {})), u = r.map((d) => {
322
322
  const g = d.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = d;
323
323
  return {
324
324
  unitId: h,
@@ -335,23 +335,23 @@ function vs(i) {
335
335
  unitId: s,
336
336
  subUnitId: o,
337
337
  drawingId: a,
338
- drawingType: x.DRAWING_GROUP,
338
+ drawingType: $.DRAWING_GROUP,
339
339
  transform: c
340
340
  };
341
- n.push({
341
+ t.push({
342
342
  parent: l,
343
343
  children: u
344
344
  });
345
- }), n;
345
+ }), t;
346
346
  }
347
- function Ss(i) {
348
- const n = [];
347
+ function ms(i) {
348
+ const t = [];
349
349
  return i.forEach((e) => {
350
- const { parent: t, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: c = { width: 0, height: 0 } } = t;
350
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: c = { width: 0, height: 0 } } = n;
351
351
  if (c == null)
352
352
  return;
353
353
  const u = r.map((d) => {
354
- const { transform: g } = d, { unitId: h, subUnitId: f, drawingId: p } = d, m = pi(g || {}, c, c.width || 0, c.height || 0);
354
+ const { transform: g } = d, { unitId: h, subUnitId: f, drawingId: p } = d, m = hi(g || {}, c, c.width || 0, c.height || 0);
355
355
  return {
356
356
  unitId: h,
357
357
  subUnitId: f,
@@ -363,35 +363,35 @@ function Ss(i) {
363
363
  unitId: s,
364
364
  subUnitId: o,
365
365
  drawingId: a,
366
- drawingType: x.DRAWING_GROUP,
366
+ drawingType: $.DRAWING_GROUP,
367
367
  transform: {
368
368
  left: 0,
369
369
  top: 0
370
370
  }
371
371
  };
372
- n.push({
372
+ t.push({
373
373
  parent: l,
374
374
  children: u
375
375
  });
376
- }), n;
376
+ }), t;
377
377
  }
378
- const Rr = {
378
+ const Ir = {
379
379
  id: "sheet.command.group-sheet-image",
380
- type: te.COMMAND,
381
- handler: (i, n) => {
382
- const e = i.get(G), t = i.get(Ge), r = i.get(ae);
383
- if (!n) return !1;
380
+ type: ee.COMMAND,
381
+ handler: (i, t) => {
382
+ const e = i.get(G), n = i.get(Ge), r = i.get(oe);
383
+ if (!t) return !1;
384
384
  const s = [];
385
- n.forEach(({ parent: h, children: f }) => {
385
+ t.forEach(({ parent: h, children: f }) => {
386
386
  s.push(h.unitId), f.forEach((p) => {
387
387
  s.push(p.unitId);
388
388
  });
389
389
  });
390
- const o = r.getGroupDrawingOp(n), { unitId: a, subUnitId: c, undo: u, redo: l, objects: d } = o;
391
- return e.syncExecuteCommand(A.id, { op: l, unitId: a, subUnitId: c, objects: d, type: P.GROUP }) ? (t.pushUndoRedo({
390
+ const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: c, undo: u, redo: l, objects: d } = o;
391
+ return e.syncExecuteCommand(A.id, { op: l, unitId: a, subUnitId: c, objects: d, type: P.GROUP }) ? (n.pushUndoRedo({
392
392
  unitID: a,
393
393
  undoMutations: [
394
- { id: A.id, params: { op: u, unitId: a, subUnitId: c, objects: Ss(d), type: P.UNGROUP } },
394
+ { id: A.id, params: { op: u, unitId: a, subUnitId: c, objects: ms(d), type: P.UNGROUP } },
395
395
  { id: L.id, params: s }
396
396
  ],
397
397
  redoMutations: [
@@ -402,13 +402,13 @@ const Rr = {
402
402
  }
403
403
  }, Yt = {
404
404
  id: "sheet.command.insert-sheet-image",
405
- type: te.COMMAND,
406
- handler: (i, n) => {
407
- var S, C, b;
408
- const e = i.get(G), t = i.get(Ge), r = i.get(ae), s = i.get(Ft);
409
- if (!n) return !1;
410
- const o = n.drawings, a = o.map((v) => v.unitId), c = r.getBatchAddOp(o), { unitId: u, subUnitId: l, undo: d, redo: g, objects: h } = c, f = s.onCommandExecute({ id: Yt.id, params: n }), p = { id: A.id, params: { op: g, unitId: u, subUnitId: l, objects: h, type: P.INSERT } }, m = { id: A.id, params: { op: d, unitId: u, subUnitId: l, objects: h, type: P.REMOVE } };
411
- return Hn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (t.pushUndoRedo({
405
+ type: ee.COMMAND,
406
+ handler: (i, t) => {
407
+ var S, C, D;
408
+ const e = i.get(G), n = i.get(Ge), r = i.get(oe), s = i.get(Ft);
409
+ if (!t) return !1;
410
+ const o = t.drawings, a = o.map((v) => v.unitId), c = r.getBatchAddOp(o), { unitId: u, subUnitId: l, undo: d, redo: g, objects: h } = c, f = s.onCommandExecute({ id: Yt.id, params: t }), p = { id: A.id, params: { op: g, unitId: u, subUnitId: l, objects: h, type: P.INSERT } }, m = { id: A.id, params: { op: d, unitId: u, subUnitId: l, objects: h, type: P.REMOVE } };
411
+ return Vn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (n.pushUndoRedo({
412
412
  unitID: u,
413
413
  undoMutations: [
414
414
  ...(C = f.preUndos) != null ? C : [],
@@ -417,25 +417,25 @@ const Rr = {
417
417
  { id: L.id, params: a }
418
418
  ],
419
419
  redoMutations: [
420
- ...(b = f.preRedos) != null ? b : [],
420
+ ...(D = f.preRedos) != null ? D : [],
421
421
  p,
422
422
  ...f.redos,
423
423
  { id: L.id, params: a }
424
424
  ]
425
425
  }), !0) : !1;
426
426
  }
427
- }, Mr = {
427
+ }, Cr = {
428
428
  id: "sheet.command.set-drawing-arrange",
429
- type: te.COMMAND,
430
- handler: (i, n) => {
431
- const e = i.get(G), t = i.get(Ge);
432
- if (!n) return !1;
433
- const r = i.get(ae), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: c } = n, u = { unitId: s, subUnitId: o, drawingIds: a };
429
+ type: ee.COMMAND,
430
+ handler: (i, t) => {
431
+ const e = i.get(G), n = i.get(Ge);
432
+ if (!t) return !1;
433
+ const r = i.get(oe), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: c } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
434
434
  let l;
435
435
  if (c === mt.forward ? l = r.getForwardDrawingsOp(u) : c === mt.backward ? l = r.getBackwardDrawingOp(u) : c === mt.front ? l = r.getFrontDrawingsOp(u) : c === mt.back && (l = r.getBackDrawingsOp(u)), l == null)
436
436
  return !1;
437
437
  const { objects: d, redo: g, undo: h } = l;
438
- return e.syncExecuteCommand(A.id, { op: g, unitId: s, subUnitId: o, objects: d, type: P.ARRANGE }) ? (t.pushUndoRedo({
438
+ return e.syncExecuteCommand(A.id, { op: g, unitId: s, subUnitId: o, objects: d, type: P.ARRANGE }) ? (n.pushUndoRedo({
439
439
  unitID: s,
440
440
  undoMutations: [
441
441
  { id: A.id, params: { op: h, unitId: s, subUnitId: o, objects: d, type: P.ARRANGE } }
@@ -447,12 +447,12 @@ const Rr = {
447
447
  }
448
448
  }, Gt = {
449
449
  id: "sheet.command.set-sheet-image",
450
- type: te.COMMAND,
451
- handler: (i, n) => {
452
- const e = i.get(G), t = i.get(Ge), r = i.get(ae);
453
- if (!n) return !1;
454
- const { drawings: s } = n, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: c, undo: u, redo: l, objects: d } = o;
455
- return e.syncExecuteCommand(A.id, { unitId: a, subUnitId: c, op: l, objects: d, type: P.UPDATE }) ? (t.pushUndoRedo({
450
+ type: ee.COMMAND,
451
+ handler: (i, t) => {
452
+ const e = i.get(G), n = i.get(Ge), r = i.get(oe);
453
+ if (!t) return !1;
454
+ const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: c, undo: u, redo: l, objects: d } = o;
455
+ return e.syncExecuteCommand(A.id, { unitId: a, subUnitId: c, op: l, objects: d, type: P.UPDATE }) ? (n.pushUndoRedo({
456
456
  unitID: a,
457
457
  undoMutations: [
458
458
  { id: A.id, params: { unitId: a, subUnitId: c, op: u, objects: d, type: P.UPDATE } },
@@ -464,23 +464,23 @@ const Rr = {
464
464
  ]
465
465
  }), !0) : !1;
466
466
  }
467
- }, yr = {
467
+ }, Dr = {
468
468
  id: "sheet.command.ungroup-sheet-image",
469
- type: te.COMMAND,
470
- handler: (i, n) => {
471
- const e = i.get(G), t = i.get(Ge), r = i.get(ae);
472
- if (!n) return !1;
469
+ type: ee.COMMAND,
470
+ handler: (i, t) => {
471
+ const e = i.get(G), n = i.get(Ge), r = i.get(oe);
472
+ if (!t) return !1;
473
473
  const s = [];
474
- n.forEach(({ parent: h, children: f }) => {
474
+ t.forEach(({ parent: h, children: f }) => {
475
475
  s.push(h.unitId), f.forEach((p) => {
476
476
  s.push(p.unitId);
477
477
  });
478
478
  });
479
- const o = r.getUngroupDrawingOp(n), { unitId: a, subUnitId: c, undo: u, redo: l, objects: d } = o;
480
- return e.syncExecuteCommand(A.id, { op: l, unitId: a, subUnitId: c, objects: d, type: P.UNGROUP }) ? (t.pushUndoRedo({
479
+ const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: c, undo: u, redo: l, objects: d } = o;
480
+ return e.syncExecuteCommand(A.id, { op: l, unitId: a, subUnitId: c, objects: d, type: P.UNGROUP }) ? (n.pushUndoRedo({
481
481
  unitID: a,
482
482
  undoMutations: [
483
- { id: A.id, params: { op: u, unitId: a, subUnitId: c, objects: vs(d), type: P.GROUP } },
483
+ { id: A.id, params: { op: u, unitId: a, subUnitId: c, objects: fs(d), type: P.GROUP } },
484
484
  { id: L.id, params: s }
485
485
  ],
486
486
  redoMutations: [
@@ -490,79 +490,79 @@ const Rr = {
490
490
  }), !0) : !1;
491
491
  }
492
492
  };
493
- var Is = Object.getOwnPropertyDescriptor, Cs = (i, n, e, t) => {
494
- for (var r = t > 1 ? void 0 : t ? Is(n, e) : n, s = i.length - 1, o; s >= 0; s--)
493
+ var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
494
+ for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
495
495
  (o = i[s]) && (r = o(r) || r);
496
496
  return r;
497
- }, ie = (i, n) => (e, t) => n(e, t, i);
498
- function bs(i, n, e) {
499
- const t = e * Math.PI / 180, r = Math.abs(i * Math.cos(t)) + Math.abs(n * Math.sin(t)), s = Math.abs(i * Math.sin(t)) + Math.abs(n * Math.cos(t));
497
+ }, re = (i, t) => (e, n) => t(e, n, i);
498
+ function _s(i, t, e) {
499
+ const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
500
500
  return { rotatedWidth: r, rotatedHeight: s };
501
501
  }
502
- function an(i, n, e, t, r) {
502
+ function an(i, t, e, n, r) {
503
503
  var S;
504
- const { rotatedHeight: s, rotatedWidth: o } = bs(e, t, r), c = i.get(ne).getRenderById(n.unitId);
504
+ const { rotatedHeight: s, rotatedWidth: o } = _s(e, n, r), c = i.get(te).getRenderById(t.unitId);
505
505
  if (!c)
506
506
  return !1;
507
- const l = (S = c.with(V).getSkeletonParam(n.subUnitId)) == null ? void 0 : S.skeleton;
507
+ const l = (S = c.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
508
508
  if (l == null)
509
509
  return !1;
510
- const d = l.getCellByIndex(n.row, n.col), g = d.mergeInfo.endX - d.mergeInfo.startX - 2, h = d.mergeInfo.endY - d.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, w = !m || Number.isNaN(m) ? 1e-3 : m;
510
+ const d = l.getCellByIndex(t.row, t.col), g = d.mergeInfo.endX - d.mergeInfo.startX - 2, h = d.mergeInfo.endY - d.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, w = !m || Number.isNaN(m) ? 1e-3 : m;
511
511
  return {
512
512
  width: e * w,
513
- height: t * w
513
+ height: n * w
514
514
  };
515
515
  }
516
516
  let et = class extends le {
517
- constructor(n, e, t, r, s, o, a, c, u, l, d, g, h) {
517
+ constructor(t, e, n, r, s, o, a, c, u, l, d, g, h) {
518
518
  super();
519
- Q(this, "_workbookSelections");
520
- this._context = n, this._skeletonManagerService = e, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = c, this._contextService = u, this._messageService = l, this._localeService = d, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
519
+ q(this, "_workbookSelections");
520
+ this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = c, this._contextService = u, this._messageService = l, this._localeService = d, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
521
521
  }
522
522
  async insertFloatImage() {
523
- const n = await this._fileOpenerService.openFile({
523
+ const t = await this._fileOpenerService.openFile({
524
524
  multiple: !0,
525
- accept: En.map((t) => `.${t.replace("image/", "")}`).join(",")
526
- }), e = n.length;
525
+ accept: yn.map((n) => `.${n.replace("image/", "")}`).join(",")
526
+ }), e = t.length;
527
527
  return e > Tn ? (this._messageService.show({
528
- type: Re.Error,
528
+ type: be.Error,
529
529
  content: this._localeService.t("update-status.exceedMaxCount", String(Tn))
530
- }), !1) : e === 0 ? !1 : (n.forEach(async (t) => await this.insertFloatImageByFile(t)), !0);
530
+ }), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
531
531
  }
532
532
  async insertCellImage() {
533
533
  const e = (await this._fileOpenerService.openFile({
534
534
  multiple: !1,
535
- accept: En.map((t) => `.${t.replace("image/", "")}`).join(",")
535
+ accept: yn.map((n) => `.${n.replace("image/", "")}`).join(",")
536
536
  }))[0];
537
537
  return e ? (await this._insertCellImage(e), !0) : !1;
538
538
  }
539
- insertCellImageByFile(n, e) {
540
- return this._insertCellImage(n, e);
539
+ insertCellImageByFile(t, e) {
540
+ return this._insertCellImage(t, e);
541
541
  }
542
- async insertFloatImageByFile(n) {
542
+ async insertFloatImageByFile(t) {
543
543
  let e;
544
544
  try {
545
- e = await this._imageIoService.saveImage(n);
545
+ e = await this._imageIoService.saveImage(t);
546
546
  } catch (S) {
547
547
  const C = S.message;
548
- C === We.ERROR_EXCEED_SIZE ? this._messageService.show({
549
- type: Re.Error,
550
- content: this._localeService.t("update-status.exceedMaxSize", String(On / (1024 * 1024)))
551
- }) : C === We.ERROR_IMAGE_TYPE ? this._messageService.show({
552
- type: Re.Error,
548
+ C === Be.ERROR_EXCEED_SIZE ? this._messageService.show({
549
+ type: be.Error,
550
+ content: this._localeService.t("update-status.exceedMaxSize", String(En / (1024 * 1024)))
551
+ }) : C === Be.ERROR_IMAGE_TYPE ? this._messageService.show({
552
+ type: be.Error,
553
553
  content: this._localeService.t("update-status.invalidImageType")
554
- }) : C === We.ERROR_IMAGE && this._messageService.show({
555
- type: Re.Error,
554
+ }) : C === Be.ERROR_IMAGE && this._messageService.show({
555
+ type: be.Error,
556
556
  content: this._localeService.t("update-status.invalidImage")
557
557
  });
558
558
  }
559
559
  if (e == null)
560
560
  return;
561
- const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: a, source: c, base64Cache: u } = e, { width: l, height: d, image: g } = await Kt(u || ""), { width: h, height: f } = this._context.scene;
561
+ const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: c, base64Cache: u } = e, { width: l, height: d, image: g } = await Kt(u || ""), { width: h, height: f } = this._context.scene;
562
562
  this._imageIoService.addImageSourceCache(c, a, g);
563
563
  let p = 1;
564
- if (l > Un || d > Pn) {
565
- const S = Un / l, C = Pn / d;
564
+ if (l > On || d > Un) {
565
+ const S = On / l, C = Un / d;
566
566
  p = Math.max(S, C);
567
567
  }
568
568
  const m = this._getImagePosition(l * p, d * p, h, f);
@@ -572,10 +572,10 @@ let et = class extends le {
572
572
  unitId: r,
573
573
  subUnitId: s,
574
574
  drawingId: o,
575
- drawingType: x.DRAWING_IMAGE,
575
+ drawingType: $.DRAWING_IMAGE,
576
576
  imageSourceType: a,
577
577
  source: c,
578
- transform: z(m, this._selectionRenderService, this._skeletonManagerService),
578
+ transform: H(m, this._selectionRenderService, this._skeletonManagerService),
579
579
  sheetTransform: m
580
580
  };
581
581
  return this._commandService.executeCommand(Yt.id, {
@@ -584,32 +584,32 @@ let et = class extends le {
584
584
  });
585
585
  }
586
586
  // eslint-disable-next-line max-lines-per-function
587
- async _insertCellImage(n, e) {
587
+ async _insertCellImage(t, e) {
588
588
  var w, S;
589
- let t;
589
+ let n;
590
590
  try {
591
- t = await this._imageIoService.saveImage(n);
591
+ n = await this._imageIoService.saveImage(t);
592
592
  } catch (C) {
593
- const b = C.message;
594
- b === We.ERROR_EXCEED_SIZE ? this._messageService.show({
595
- type: Re.Error,
596
- content: this._localeService.t("update-status.exceedMaxSize", String(On / (1024 * 1024)))
597
- }) : b === We.ERROR_IMAGE_TYPE ? this._messageService.show({
598
- type: Re.Error,
593
+ const D = C.message;
594
+ D === Be.ERROR_EXCEED_SIZE ? this._messageService.show({
595
+ type: be.Error,
596
+ content: this._localeService.t("update-status.exceedMaxSize", String(En / (1024 * 1024)))
597
+ }) : D === Be.ERROR_IMAGE_TYPE ? this._messageService.show({
598
+ type: be.Error,
599
599
  content: this._localeService.t("update-status.invalidImageType")
600
- }) : b === We.ERROR_IMAGE && this._messageService.show({
601
- type: Re.Error,
600
+ }) : D === Be.ERROR_IMAGE && this._messageService.show({
601
+ type: be.Error,
602
602
  content: this._localeService.t("update-status.invalidImage")
603
603
  });
604
604
  }
605
- if (t == null)
605
+ if (n == null)
606
606
  return !1;
607
- const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = t, { width: c, height: u, image: l } = await Kt(a || "");
607
+ const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: c, height: u, image: l } = await Kt(a || "");
608
608
  this._imageIoService.addImageSourceCache(o, s, l);
609
609
  const d = this._workbookSelections.getCurrentLastSelection();
610
610
  if (!d)
611
611
  return !1;
612
- const g = Sn("", {}), h = an(
612
+ const g = vn("", {}), h = an(
613
613
  this._injector,
614
614
  {
615
615
  unitId: this._context.unitId,
@@ -629,11 +629,11 @@ let et = class extends le {
629
629
  height: h.height
630
630
  },
631
631
  positionH: {
632
- relativeFrom: Cn.PAGE,
632
+ relativeFrom: In.PAGE,
633
633
  posOffset: 0
634
634
  },
635
635
  positionV: {
636
- relativeFrom: In.PARAGRAPH,
636
+ relativeFrom: Sn.PARAGRAPH,
637
637
  posOffset: 0
638
638
  },
639
639
  angle: 0
@@ -641,22 +641,22 @@ let et = class extends le {
641
641
  unitId: g.getUnitId(),
642
642
  subUnitId: g.getUnitId(),
643
643
  drawingId: r,
644
- drawingType: x.DRAWING_IMAGE,
644
+ drawingType: $.DRAWING_IMAGE,
645
645
  imageSourceType: s,
646
646
  source: o,
647
- transform: Yn(f),
647
+ transform: Fn(f),
648
648
  docTransform: f,
649
- behindDoc: Rn.FALSE,
649
+ behindDoc: bn.FALSE,
650
650
  title: "",
651
651
  description: "",
652
652
  layoutType: Dn.INLINE,
653
653
  // Insert inline drawing by default.
654
- wrapText: bn.BOTH_SIDES,
654
+ wrapText: Cn.BOTH_SIDES,
655
655
  distB: 0,
656
656
  distL: 0,
657
657
  distR: 0,
658
658
  distT: 0
659
- }, m = Mn.drawing.add({
659
+ }, m = Rn.drawing.add({
660
660
  documentDataModel: g,
661
661
  drawings: [p],
662
662
  selection: {
@@ -679,14 +679,14 @@ let et = class extends le {
679
679
  })) : !1;
680
680
  }
681
681
  // eslint-disable-next-line max-lines-per-function
682
- async insertCellImageByUrl(n, e) {
682
+ async insertCellImageByUrl(t, e) {
683
683
  var g, h;
684
- const { width: t, height: r, image: s } = await Kt(n || "");
685
- this._imageIoService.addImageSourceCache(n, yn.URL, s);
684
+ const { width: n, height: r, image: s } = await Kt(t || "");
685
+ this._imageIoService.addImageSourceCache(t, Mn.URL, s);
686
686
  const o = this._workbookSelections.getCurrentLastSelection();
687
687
  if (!o)
688
688
  return !1;
689
- const a = Sn("", {}), c = an(
689
+ const a = vn("", {}), c = an(
690
690
  this._injector,
691
691
  {
692
692
  unitId: this._context.unitId,
@@ -694,7 +694,7 @@ let et = class extends le {
694
694
  row: o.primary.actualRow,
695
695
  col: o.primary.actualColumn
696
696
  },
697
- t,
697
+ n,
698
698
  r,
699
699
  0
700
700
  );
@@ -706,34 +706,34 @@ let et = class extends le {
706
706
  height: c.height
707
707
  },
708
708
  positionH: {
709
- relativeFrom: Cn.PAGE,
709
+ relativeFrom: In.PAGE,
710
710
  posOffset: 0
711
711
  },
712
712
  positionV: {
713
- relativeFrom: In.PARAGRAPH,
713
+ relativeFrom: Sn.PARAGRAPH,
714
714
  posOffset: 0
715
715
  },
716
716
  angle: 0
717
717
  }, l = {
718
718
  unitId: a.getUnitId(),
719
719
  subUnitId: a.getUnitId(),
720
- drawingId: Et(),
721
- drawingType: x.DRAWING_IMAGE,
722
- imageSourceType: yn.URL,
723
- source: n,
724
- transform: Yn(u),
720
+ drawingId: Tt(),
721
+ drawingType: $.DRAWING_IMAGE,
722
+ imageSourceType: Mn.URL,
723
+ source: t,
724
+ transform: Fn(u),
725
725
  docTransform: u,
726
- behindDoc: Rn.FALSE,
726
+ behindDoc: bn.FALSE,
727
727
  title: "",
728
728
  description: "",
729
729
  layoutType: Dn.INLINE,
730
730
  // Insert inline drawing by default.
731
- wrapText: bn.BOTH_SIDES,
731
+ wrapText: Cn.BOTH_SIDES,
732
732
  distB: 0,
733
733
  distL: 0,
734
734
  distR: 0,
735
735
  distT: 0
736
- }, d = Mn.drawing.add({
736
+ }, d = Rn.drawing.add({
737
737
  documentDataModel: a,
738
738
  drawings: [l],
739
739
  selection: {
@@ -756,13 +756,13 @@ let et = class extends le {
756
756
  })) : !1;
757
757
  }
758
758
  _getUnitInfo() {
759
- const n = this._context.unit, e = n.getActiveSheet(), t = n.getUnitId(), r = e.getSheetId();
759
+ const t = this._context.unit, e = t.getActiveSheet(), n = t.getUnitId(), r = e.getSheetId();
760
760
  return {
761
- unitId: t,
761
+ unitId: n,
762
762
  subUnitId: r
763
763
  };
764
764
  }
765
- _getImagePosition(n, e, t, r) {
765
+ _getImagePosition(t, e, n, r) {
766
766
  const s = this._workbookSelections.getCurrentSelections();
767
767
  let o = {
768
768
  startRow: 0,
@@ -771,11 +771,11 @@ let et = class extends le {
771
771
  endColumn: 0
772
772
  };
773
773
  s && s.length > 0 && (o = s[s.length - 1].range);
774
- const a = Qn(this._skeletonManagerService.getCurrent().skeleton, o);
774
+ const a = qn(this._skeletonManagerService.getCurrent().skeleton, o);
775
775
  if (a == null)
776
776
  return;
777
777
  let { startColumn: c, startRow: u, startX: l, startY: d } = a, g = !1;
778
- if (l + n > t && (l = t - n, l < 0 && (l = 0, n = t), g = !0), d + e > r && (d = r - e, d < 0 && (d = 0, e = r), g = !0), g) {
778
+ if (l + t > n && (l = n - t, l < 0 && (l = 0, t = n), g = !0), d + e > r && (d = r - e, d < 0 && (d = 0, e = r), g = !0), g) {
779
779
  const m = this._selectionRenderService.getCellWithCoordByOffset(l, d);
780
780
  if (m == null)
781
781
  return;
@@ -786,12 +786,12 @@ let et = class extends le {
786
786
  columnOffset: 0,
787
787
  row: u,
788
788
  rowOffset: 0
789
- }, f = this._selectionRenderService.getCellWithCoordByOffset(l + n, d + e);
789
+ }, f = this._selectionRenderService.getCellWithCoordByOffset(l + t, d + e);
790
790
  if (f == null)
791
791
  return;
792
792
  const p = {
793
793
  column: f.actualColumn,
794
- columnOffset: l + n - f.startX,
794
+ columnOffset: l + t - f.startX,
795
795
  row: f.actualRow,
796
796
  rowOffset: d + e - f.startY
797
797
  };
@@ -801,87 +801,87 @@ let et = class extends le {
801
801
  };
802
802
  }
803
803
  _updateOrderListener() {
804
- this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((n) => {
805
- const { unitId: e, subUnitId: t, drawingIds: r, arrangeType: s } = n;
806
- this._commandService.executeCommand(Mr.id, {
804
+ this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
805
+ const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
806
+ this._commandService.executeCommand(Cr.id, {
807
807
  unitId: e,
808
- subUnitId: t,
808
+ subUnitId: n,
809
809
  drawingIds: r,
810
810
  arrangeType: s
811
811
  });
812
812
  }));
813
813
  }
814
814
  _updateImageListener() {
815
- this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((n) => {
815
+ this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((t) => {
816
816
  const e = [];
817
- n.length !== 0 && (n.forEach((t) => {
818
- const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: c } = t;
817
+ t.length !== 0 && (t.forEach((n) => {
818
+ const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: c } = n;
819
819
  if (c == null)
820
820
  return;
821
821
  const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
822
822
  if (u == null || u.unitId !== this._context.unitId)
823
823
  return;
824
- const l = $({ ...u.transform, ...c }, this._selectionRenderService);
824
+ const l = x({ ...u.transform, ...c }, this._selectionRenderService);
825
825
  if (l == null)
826
826
  return;
827
827
  const d = {
828
- ...t,
829
- transform: { ...u.transform, ...c, ...z(l, this._selectionRenderService, this._skeletonManagerService) },
828
+ ...n,
829
+ transform: { ...u.transform, ...c, ...H(l, this._selectionRenderService, this._skeletonManagerService) },
830
830
  sheetTransform: { ...l }
831
831
  };
832
832
  e.push(d);
833
833
  }), e.length > 0 && this._commandService.executeCommand(Gt.id, {
834
- unitId: n[0].unitId,
834
+ unitId: t[0].unitId,
835
835
  drawings: e
836
836
  }));
837
837
  }));
838
838
  }
839
839
  _groupDrawingListener() {
840
- this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((n) => {
841
- this._commandService.executeCommand(Rr.id, n);
842
- const { unitId: e, subUnitId: t, drawingId: r } = n[0].parent;
843
- this._commandService.syncExecuteCommand(Lt.id, [{ unitId: e, subUnitId: t, drawingId: r }]);
844
- })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((n) => {
845
- this._commandService.executeCommand(yr.id, n);
840
+ this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
841
+ this._commandService.executeCommand(Ir.id, t);
842
+ const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
843
+ this._commandService.syncExecuteCommand(Lt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
844
+ })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
845
+ this._commandService.executeCommand(Dr.id, t);
846
846
  }));
847
847
  }
848
848
  _focusDrawingListener() {
849
849
  this.disposeWithMe(
850
- this._drawingManagerService.focus$.subscribe((n) => {
851
- n == null || n.length === 0 ? (this._contextService.setContextValue(Fe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Fe, !0), this._sheetDrawingService.focusDrawing(n));
850
+ this._drawingManagerService.focus$.subscribe((t) => {
851
+ t == null || t.length === 0 ? (this._contextService.setContextValue(Fe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Fe, !0), this._sheetDrawingService.focusDrawing(t));
852
852
  })
853
853
  );
854
854
  }
855
855
  };
856
- et = Cs([
857
- ie(1, N(V)),
858
- ie(2, G),
859
- ie(3, Xe),
860
- ie(4, Kn),
861
- ie(5, ki),
862
- ie(6, ae),
863
- ie(7, oe),
864
- ie(8, zn),
865
- ie(9, Bi),
866
- ie(10, N(xt)),
867
- ie(11, N(hn)),
868
- ie(12, N(tt))
856
+ et = ws([
857
+ re(1, N(V)),
858
+ re(2, G),
859
+ re(3, Xe),
860
+ re(4, zn),
861
+ re(5, Ui),
862
+ re(6, oe),
863
+ re(7, se),
864
+ re(8, Hn),
865
+ re(9, Pi),
866
+ re(10, N($t)),
867
+ re(11, N(un)),
868
+ re(12, N(tt))
869
869
  ], et);
870
- var Ds = Object.getOwnPropertyDescriptor, Rs = (i, n, e, t) => {
871
- for (var r = t > 1 ? void 0 : t ? Ds(n, e) : n, s = i.length - 1, o; s >= 0; s--)
870
+ var vs = Object.getOwnPropertyDescriptor, Ss = (i, t, e, n) => {
871
+ for (var r = n > 1 ? void 0 : n ? vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
872
872
  (o = i[s]) && (r = o(r) || r);
873
873
  return r;
874
- }, Me = (i, n) => (e, t) => n(e, t, i);
875
- function cn(i, n, e) {
876
- var t, r, s, o;
877
- if (((r = (t = e == null ? void 0 : e.p) == null ? void 0 : t.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
874
+ }, xe = (i, t) => (e, n) => t(e, n, i);
875
+ function br(i, t, e) {
876
+ var n, r, s, o;
877
+ if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
878
878
  const a = e.p.drawings[e.p.drawingsOrder[0]], c = an(
879
879
  i,
880
880
  {
881
- unitId: n.unitId,
882
- subUnitId: n.subUnitId,
883
- row: n.row,
884
- col: n.col
881
+ unitId: t.unitId,
882
+ subUnitId: t.subUnitId,
883
+ row: t.row,
884
+ col: t.col
885
885
  },
886
886
  a.docTransform.size.width,
887
887
  a.docTransform.size.height,
@@ -893,214 +893,172 @@ function cn(i, n, e) {
893
893
  return !1;
894
894
  }
895
895
  let Ut = class extends le {
896
- constructor(i, n, e, t, r, s, o) {
897
- super(), this._commandService = i, this._sheetInterceptorService = n, this._univerInstanceService = e, this._injector = t, this._drawingManagerService = r, this._docDrawingController = s, this._editorBridgeService = o, this._initHandleResize(), this._handleInitEditor(), this._handleWriteCell(), this._initCellContentInterceptor(), this._initDisableEdit();
896
+ constructor(i, t, e, n, r, s) {
897
+ super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor(), this._initDisableEdit();
898
898
  }
899
899
  _initDisableEdit() {
900
900
  this.disposeWithMe(this._commandService.beforeCommandExecuted((i) => {
901
- var n, e, t;
902
- if (i.id === bi.id) {
901
+ var t, e, n;
902
+ if (i.id === vi.id) {
903
903
  const r = i.params, { visible: s, eventType: o } = r;
904
- if (s && o === _i.Dblclick) {
904
+ if (s && o === fi.Dblclick) {
905
905
  const a = this._editorBridgeService.getEditCellState();
906
- if (((t = (e = (n = a == null ? void 0 : a.documentLayoutObject.documentModel) == null ? void 0 : n.getDrawingsOrder()) == null ? void 0 : e.length) != null ? t : 0) > 0)
906
+ if (((n = (e = (t = a == null ? void 0 : a.documentLayoutObject.documentModel) == null ? void 0 : t.getDrawingsOrder()) == null ? void 0 : e.length) != null ? n : 0) > 0)
907
907
  throw new Error("Can not edit when there are drawings.");
908
908
  }
909
909
  }
910
910
  }));
911
911
  }
912
- _initHandleResize() {
913
- this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
914
- let n, e = [];
915
- if (i.id === er.id) {
916
- const t = i.params;
917
- e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
918
- } else if (i.id === tr.id) {
919
- const t = i.params;
920
- e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
921
- } else if (i.id === Xi.id) {
922
- const t = i.params;
923
- e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
924
- } else if (i.id === nr.id) {
925
- const t = i.params;
926
- n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), e = t.rowsAutoHeightInfo.map((r) => ({
927
- startRow: r.row,
928
- endRow: r.row,
929
- startColumn: 0,
930
- endColumn: 9999
931
- }));
932
- } else if (i.id === Vi.id) {
933
- const t = i.params;
934
- e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
935
- } else if (i.id === Hi.id) {
936
- const t = i.params;
937
- e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
938
- }
939
- n && e.length && e.forEach((t) => {
940
- const r = Yr.transformRange(t, n.worksheet);
941
- for (let s = r.startRow; s <= r.endRow; s++)
942
- for (let o = r.startColumn; o <= r.endColumn; o++)
943
- cn(this._injector, { unitId: n.unitId, subUnitId: n.subUnitId, row: s, col: o }, n.worksheet.getCellRaw(s, o));
944
- });
945
- }));
946
- }
947
912
  _handleInitEditor() {
948
913
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
949
914
  i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(pt), this._docDrawingController.loadDrawingDataForUnit(pt), this._drawingManagerService.initializeNotification(pt)) : this._drawingManagerService.removeDrawingDataForUnit(pt);
950
915
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
951
- i.id === as.id && i.params.unitId === wt && (this._drawingManagerService.removeDrawingDataForUnit(wt), this._docDrawingController.loadDrawingDataForUnit(wt), this._drawingManagerService.initializeNotification(wt));
952
- }));
953
- }
954
- _handleWriteCell() {
955
- this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(zi, {
956
- priority: 9999,
957
- handler: (i, n, e) => (cn(this._injector, { unitId: n.unitId, subUnitId: n.subUnitId, row: n.row, col: n.col }, i), e(i))
916
+ i.id === ns.id && i.params.unitId === wt && (this._drawingManagerService.removeDrawingDataForUnit(wt), this._docDrawingController.loadDrawingDataForUnit(wt), this._drawingManagerService.initializeNotification(wt));
958
917
  }));
959
918
  }
960
919
  _initCellContentInterceptor() {
961
920
  this.disposeWithMe(
962
921
  this._sheetInterceptorService.intercept(
963
- Ki.CELL_CONTENT,
922
+ Li.CELL_CONTENT,
964
923
  {
965
- effect: Gr.Style,
966
- priority: Zi.CELL_IMAGE,
967
- handler: (i, n, e) => {
968
- var t;
969
- return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), e(i);
924
+ effect: $r.Style,
925
+ priority: Fi.CELL_IMAGE,
926
+ handler: (i, t, e) => {
927
+ var n;
928
+ return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, br(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
970
929
  }
971
930
  }
972
931
  )
973
932
  );
974
933
  }
975
934
  };
976
- Ut = Rs([
977
- Me(0, G),
978
- Me(1, N(Ft)),
979
- Me(2, Ce),
980
- Me(3, N(tt)),
981
- Me(4, oe),
982
- Me(5, N(oi)),
983
- Me(6, N(Ci))
935
+ Ut = Ss([
936
+ xe(0, G),
937
+ xe(1, N(Ft)),
938
+ xe(2, N(tt)),
939
+ xe(3, se),
940
+ xe(4, N(ni)),
941
+ xe(5, N(_i))
984
942
  ], Ut);
985
- var Ms = Object.getOwnPropertyDescriptor, ys = (i, n, e, t) => {
986
- for (var r = t > 1 ? void 0 : t ? Ms(n, e) : n, s = i.length - 1, o; s >= 0; s--)
943
+ var Is = Object.getOwnPropertyDescriptor, Cs = (i, t, e, n) => {
944
+ for (var r = n > 1 ? void 0 : n ? Is(t, e) : t, s = i.length - 1, o; s >= 0; s--)
987
945
  (o = i[s]) && (r = o(r) || r);
988
946
  return r;
989
- }, Xn = (i, n) => (e, t) => n(e, t, i);
947
+ }, Gn = (i, t) => (e, n) => t(e, n, i);
990
948
  let Pt = class extends le {
991
- constructor(i, n) {
992
- super(), this._autoFillService = i, this._injector = n, this._initAutoFillHooks();
949
+ constructor(i, t) {
950
+ super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
993
951
  }
994
952
  _initAutoFillHooks() {
995
953
  this.disposeWithMe(
996
954
  this._autoFillService.addHook({
997
955
  id: "sheet-cell-image-autofill",
998
- onBeforeSubmit: (i, n, e, t) => {
999
- new Xr(t).forValue((r, s, o) => {
1000
- cn(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
956
+ onBeforeSubmit: (i, t, e, n) => {
957
+ new Lr(n).forValue((r, s, o) => {
958
+ br(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
1001
959
  });
1002
960
  }
1003
961
  })
1004
962
  );
1005
963
  }
1006
964
  };
1007
- Pt = ys([
1008
- Xn(0, N(Di)),
1009
- Xn(1, N(tt))
965
+ Pt = Cs([
966
+ Gn(0, N(Si)),
967
+ Gn(1, N(tt))
1010
968
  ], Pt);
1011
- var Es = Object.getOwnPropertyDescriptor, Ts = (i, n, e, t) => {
1012
- for (var r = t > 1 ? void 0 : t ? Es(n, e) : n, s = i.length - 1, o; s >= 0; s--)
969
+ var Ds = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
970
+ for (var r = n > 1 ? void 0 : n ? Ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1013
971
  (o = i[s]) && (r = o(r) || r);
1014
972
  return r;
1015
- }, Dt = (i, n) => (e, t) => n(e, t, i);
973
+ }, bt = (i, t) => (e, n) => t(e, n, i);
1016
974
  let At = class extends le {
1017
- constructor(n, e, t, r) {
975
+ constructor(t, e, n, r) {
1018
976
  super();
1019
- Q(this, "_isSetCursor", !1);
1020
- this._hoverManagerService = n, this._renderManagerService = e, this._selectionsService = t, this._drawingRenderService = r;
977
+ q(this, "_isSetCursor", !1);
978
+ this._hoverManagerService = t, this._renderManagerService = e, this._selectionsService = n, this._drawingRenderService = r;
1021
979
  }
1022
980
  _initHover() {
1023
981
  }
1024
982
  _initImageClick() {
1025
983
  }
1026
984
  };
1027
- At = Ts([
1028
- Dt(0, N(Ri)),
1029
- Dt(1, N(ne)),
1030
- Dt(2, N(hn)),
1031
- Dt(3, N(Zn))
985
+ At = bs([
986
+ bt(0, N(Ii)),
987
+ bt(1, N(te)),
988
+ bt(2, N(un)),
989
+ bt(3, N(Kn))
1032
990
  ], At);
1033
991
  const Xt = {
1034
992
  id: "sheet.command.insert-float-image",
1035
- type: te.COMMAND,
1036
- handler: async (i, n) => {
993
+ type: ee.COMMAND,
994
+ handler: async (i, t) => {
1037
995
  var o, a;
1038
- const e = i.get(Ce), t = i.get(ne), r = (o = Jn(
996
+ const e = i.get(Ee), n = i.get(te), r = (o = Zn(
1039
997
  F.UNIVER_SHEET,
1040
998
  e,
1041
- t
999
+ n
1042
1000
  )) == null ? void 0 : o.with(et);
1043
1001
  if (!r)
1044
1002
  return !1;
1045
- const s = n == null ? void 0 : n.files;
1003
+ const s = t == null ? void 0 : t.files;
1046
1004
  if (s) {
1047
1005
  const c = s.map((u) => r.insertFloatImageByFile(u));
1048
1006
  return (await Promise.all(c)).every((u) => u);
1049
1007
  } else
1050
1008
  return (a = r.insertFloatImage()) != null ? a : !1;
1051
1009
  }
1052
- }, fn = {
1010
+ }, gn = {
1053
1011
  id: "sheet.command.insert-cell-image",
1054
- type: te.COMMAND,
1012
+ type: ee.COMMAND,
1055
1013
  handler: (i) => {
1056
- var t, r;
1057
- const n = i.get(Ce), e = i.get(ne);
1058
- return (r = (t = Jn(
1014
+ var n, r;
1015
+ const t = i.get(Ee), e = i.get(te);
1016
+ return (r = (n = Zn(
1059
1017
  F.UNIVER_SHEET,
1060
- n,
1018
+ t,
1061
1019
  e
1062
- )) == null ? void 0 : t.with(et).insertCellImage()) != null ? r : !1;
1020
+ )) == null ? void 0 : n.with(et).insertCellImage()) != null ? r : !1;
1063
1021
  }
1064
1022
  };
1065
- var Os = Object.getOwnPropertyDescriptor, Us = (i, n, e, t) => {
1066
- for (var r = t > 1 ? void 0 : t ? Os(n, e) : n, s = i.length - 1, o; s >= 0; s--)
1023
+ var Rs = Object.getOwnPropertyDescriptor, Ms = (i, t, e, n) => {
1024
+ for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1067
1025
  (o = i[s]) && (r = o(r) || r);
1068
1026
  return r;
1069
- }, Je = (i, n) => (e, t) => n(e, t, i);
1070
- const Er = "image/png";
1071
- function Ps(i) {
1072
- const n = i.split(","), e = atob(n[1]), t = e.length, r = new Uint8Array(t);
1073
- for (let s = 0; s < t; s++)
1027
+ }, Je = (i, t) => (e, n) => t(e, n, i);
1028
+ const Rr = "image/png";
1029
+ function ys(i) {
1030
+ const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
1031
+ for (let s = 0; s < n; s++)
1074
1032
  r[s] = e.charCodeAt(s);
1075
- return new Blob([r], { type: Er });
1033
+ return new Blob([r], { type: Rr });
1076
1034
  }
1077
- function As(i) {
1078
- const n = new ClipboardItem({ [Er]: Ps(i) });
1079
- navigator.clipboard.write([n]).catch((e) => {
1035
+ function Ts(i) {
1036
+ const t = new ClipboardItem({ [Rr]: ys(i) });
1037
+ navigator.clipboard.write([t]).catch((e) => {
1080
1038
  console.error("Could not copy image using clipboard API: ", e);
1081
1039
  });
1082
1040
  }
1083
- function Ns() {
1041
+ function Es() {
1084
1042
  function i() {
1085
- const t = document.createElement("input");
1086
- return t.style.position = "absolute", t.style.height = "1px", t.style.width = "1px", t.style.opacity = "0", t;
1043
+ const n = document.createElement("input");
1044
+ return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
1087
1045
  }
1088
- const n = document.activeElement, e = i();
1046
+ const t = document.activeElement, e = i();
1089
1047
  return document.body.appendChild(e), e.focus(), () => {
1090
- e.blur(), document.body.removeChild(e), n instanceof HTMLElement && n.focus();
1048
+ e.blur(), document.body.removeChild(e), t instanceof HTMLElement && t.focus();
1091
1049
  };
1092
1050
  }
1093
- const Vn = [
1051
+ const Xn = [
1094
1052
  Le.SPECIAL_PASTE_COL_WIDTH,
1095
1053
  Le.SPECIAL_PASTE_VALUE,
1096
1054
  Le.SPECIAL_PASTE_FORMAT,
1097
1055
  Le.SPECIAL_PASTE_FORMULA
1098
1056
  ];
1099
1057
  let Nt = class extends le {
1100
- constructor(n, e, t, r, s) {
1058
+ constructor(t, e, n, r, s) {
1101
1059
  super();
1102
- Q(this, "_copyInfo");
1103
- this._sheetClipboardService = n, this._renderManagerService = e, this._drawingService = t, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
1060
+ q(this, "_copyInfo");
1061
+ this._sheetClipboardService = t, this._renderManagerService = e, this._drawingService = n, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
1104
1062
  }
1105
1063
  get _focusedDrawings() {
1106
1064
  return this._drawingService.getFocusDrawings();
@@ -1109,20 +1067,20 @@ let Nt = class extends le {
1109
1067
  _initCopyPaste() {
1110
1068
  this._sheetClipboardService.addClipboardHook({
1111
1069
  id: "SHEET_IMAGE_UI_PLUGIN",
1112
- onBeforeCopy: (n, e, t, r) => {
1070
+ onBeforeCopy: (t, e, n, r) => {
1113
1071
  const s = this._focusedDrawings;
1114
1072
  if (s.length > 0) {
1115
1073
  const [o] = s;
1116
1074
  if (r === De.CUT) {
1117
1075
  const c = {
1118
- unitId: n,
1076
+ unitId: t,
1119
1077
  drawings: [o]
1120
1078
  };
1121
1079
  this._commandService.executeCommand(nt.id, c);
1122
1080
  }
1123
1081
  setTimeout(() => {
1124
- const c = Ns();
1125
- o.drawingType === x.DRAWING_IMAGE && o.imageSourceType === ci.BASE64 ? As(o.source) : this._clipboardInterfaceService.writeText(""), c();
1082
+ const c = Es();
1083
+ o.drawingType === $.DRAWING_IMAGE && o.imageSourceType === ii.BASE64 ? Ts(o.source) : this._clipboardInterfaceService.writeText(""), c();
1126
1084
  }, 200);
1127
1085
  const a = {
1128
1086
  unitId: o.unitId,
@@ -1131,30 +1089,30 @@ let Nt = class extends le {
1131
1089
  };
1132
1090
  this._copyInfo = a;
1133
1091
  } else {
1134
- const o = this._createDrawingsCopyInfoByRange(n, e, t);
1092
+ const o = this._createDrawingsCopyInfoByRange(t, e, n);
1135
1093
  this._copyInfo = o;
1136
1094
  }
1137
1095
  },
1138
- onPasteCells: (n, e, t, r) => {
1096
+ onPasteCells: (t, e, n, r) => {
1139
1097
  if (!this._copyInfo)
1140
1098
  return { redos: [], undos: [] };
1141
- const { copyType: s = De.COPY, pasteType: o } = r, { range: a } = n || {}, { range: c, unitId: u, subUnitId: l } = e;
1099
+ const { copyType: s = De.COPY, pasteType: o } = r, { range: a } = t || {}, { range: c, unitId: u, subUnitId: l } = e;
1142
1100
  return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: l, pasteRange: c }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, De.COPY);
1143
1101
  },
1144
- onPastePlainText: (n, e) => ({ undos: [], redos: [] }),
1145
- onPasteUnrecognized: (n) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: Le.DEFAULT_PASTE }, De.COPY) : { undos: [], redos: [] },
1146
- onPasteFiles: (n, e) => {
1102
+ onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
1103
+ onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, De.COPY) : { undos: [], redos: [] },
1104
+ onPasteFiles: (t, e) => {
1147
1105
  if (this._copyInfo)
1148
- return this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: Le.DEFAULT_PASTE }, De.COPY);
1106
+ return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, De.COPY);
1149
1107
  {
1150
- const t = e.filter((r) => r.type.includes("image"));
1151
- if (t.length)
1108
+ const n = e.filter((r) => r.type.includes("image"));
1109
+ if (n.length)
1152
1110
  return {
1153
1111
  undos: [],
1154
1112
  redos: [
1155
1113
  {
1156
1114
  id: Xt.id,
1157
- params: { files: t }
1115
+ params: { files: n }
1158
1116
  }
1159
1117
  ]
1160
1118
  };
@@ -1163,41 +1121,41 @@ let Nt = class extends le {
1163
1121
  }
1164
1122
  });
1165
1123
  }
1166
- _createDrawingsCopyInfoByRange(n, e, t) {
1124
+ _createDrawingsCopyInfoByRange(t, e, n) {
1167
1125
  var g;
1168
- const r = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(V);
1126
+ const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(V);
1169
1127
  if (!r) return;
1170
- const s = r.attachRangeWithCoord(t);
1128
+ const s = r.attachRangeWithCoord(n);
1171
1129
  if (!s)
1172
1130
  return;
1173
- const { startX: o, endX: a, startY: c, endY: u } = s, l = this._drawingService.getDrawingData(n, e), d = this._focusedDrawings.slice();
1131
+ const { startX: o, endX: a, startY: c, endY: u } = s, l = this._drawingService.getDrawingData(t, e), d = this._focusedDrawings.slice();
1174
1132
  if (Object.keys(l).forEach((h) => {
1175
1133
  const f = l[h], { transform: p } = f;
1176
1134
  if (f.anchorType !== U.Both || !p)
1177
1135
  return;
1178
- const { left: m = 0, top: w = 0, width: S = 0, height: C = 0 } = p, { drawingStartX: b, drawingEndX: v, drawingStartY: D, drawingEndY: _ } = {
1136
+ const { left: m = 0, top: w = 0, width: S = 0, height: C = 0 } = p, { drawingStartX: D, drawingEndX: v, drawingStartY: b, drawingEndY: _ } = {
1179
1137
  drawingStartX: m,
1180
1138
  drawingEndX: m + S,
1181
1139
  drawingStartY: w,
1182
1140
  drawingEndY: w + C
1183
1141
  };
1184
- o <= b && v <= a && c <= D && _ <= u && d.push(f);
1142
+ o <= D && v <= a && c <= b && _ <= u && d.push(f);
1185
1143
  }), d.length)
1186
1144
  return {
1187
- copyRange: t,
1145
+ copyRange: n,
1188
1146
  drawings: d,
1189
- unitId: n,
1147
+ unitId: t,
1190
1148
  subUnitId: e
1191
1149
  };
1192
1150
  }
1193
- _generateSingleDrawingPasteMutations(n, e) {
1194
- const { pasteType: t, pasteTo: r } = n;
1195
- if (Vn.includes(t))
1151
+ _generateSingleDrawingPasteMutations(t, e) {
1152
+ const { pasteType: n, pasteTo: r } = t;
1153
+ if (Xn.includes(n))
1196
1154
  return { redos: [], undos: [] };
1197
1155
  const { unitId: s, subUnitId: o, range: a } = r, c = this._renderManagerService.getRenderById(s), u = c == null ? void 0 : c.with(V), l = c == null ? void 0 : c.with(Xe), d = this._copyInfo;
1198
1156
  if (!u || !l)
1199
1157
  return { redos: [], undos: [] };
1200
- const { drawings: g } = d, h = Nn(a);
1158
+ const { drawings: g } = d, h = An(a);
1201
1159
  return this._generateMutations(g, {
1202
1160
  unitId: s,
1203
1161
  subUnitId: o,
@@ -1216,27 +1174,27 @@ let Nt = class extends le {
1216
1174
  };
1217
1175
  return {
1218
1176
  transform: w,
1219
- sheetTransform: (S = $(w, l)) != null ? S : p
1177
+ sheetTransform: (S = x(w, l)) != null ? S : p
1220
1178
  };
1221
1179
  }
1222
1180
  });
1223
1181
  }
1224
- _generateMutations(n, e) {
1182
+ _generateMutations(t, e) {
1225
1183
  const {
1226
- unitId: t,
1184
+ unitId: n,
1227
1185
  subUnitId: r,
1228
1186
  getTransform: s,
1229
1187
  isCut: o
1230
1188
  } = e, a = [], c = [], { _drawingService: u } = this;
1231
- return n.forEach((l) => {
1189
+ return t.forEach((l) => {
1232
1190
  const { transform: d, sheetTransform: g } = l;
1233
1191
  if (!d)
1234
1192
  return;
1235
1193
  const h = s(d, g), f = {
1236
1194
  ...l,
1237
- unitId: t,
1195
+ unitId: n,
1238
1196
  subUnitId: r,
1239
- drawingId: o ? l.drawingId : Ee.generateRandomId(),
1197
+ drawingId: o ? l.drawingId : Me.generateRandomId(),
1240
1198
  transform: h.transform,
1241
1199
  sheetTransform: h.sheetTransform
1242
1200
  };
@@ -1245,7 +1203,7 @@ let Nt = class extends le {
1245
1203
  a.push({
1246
1204
  id: A.id,
1247
1205
  params: {
1248
- unitId: t,
1206
+ unitId: n,
1249
1207
  subUnitId: r,
1250
1208
  type: P.UPDATE,
1251
1209
  op: m,
@@ -1254,7 +1212,7 @@ let Nt = class extends le {
1254
1212
  }), c.push({
1255
1213
  id: A.id,
1256
1214
  params: {
1257
- unitId: t,
1215
+ unitId: n,
1258
1216
  subUnitId: r,
1259
1217
  type: P.UPDATE,
1260
1218
  op: p,
@@ -1263,34 +1221,34 @@ let Nt = class extends le {
1263
1221
  });
1264
1222
  } else {
1265
1223
  const { undo: p, redo: m, objects: w } = u.getBatchAddOp([f]);
1266
- a.push({ id: A.id, params: { op: m, unitId: t, subUnitId: r, objects: w, type: P.INSERT } }), c.push({ id: A.id, params: { op: p, unitId: t, subUnitId: r, objects: w, type: P.REMOVE } });
1224
+ a.push({ id: A.id, params: { op: m, unitId: n, subUnitId: r, objects: w, type: P.INSERT } }), c.push({ id: A.id, params: { op: p, unitId: n, subUnitId: r, objects: w, type: P.REMOVE } });
1267
1225
  }
1268
1226
  }), { redos: a, undos: c };
1269
1227
  }
1270
1228
  // eslint-disable-next-line max-lines-per-function
1271
- _generateRangeDrawingsPasteMutations(n, e) {
1272
- var T;
1229
+ _generateRangeDrawingsPasteMutations(t, e) {
1230
+ var E;
1273
1231
  const {
1274
- unitId: t,
1232
+ unitId: n,
1275
1233
  subUnitId: r,
1276
1234
  pasteType: s,
1277
1235
  pasteRange: o
1278
- } = n, {
1236
+ } = t, {
1279
1237
  copyRange: a,
1280
1238
  copyType: c
1281
1239
  } = e;
1282
- if (Vn.includes(s))
1240
+ if (Xn.includes(s))
1283
1241
  return { redos: [], undos: [] };
1284
- const u = (T = this._renderManagerService.getRenderById(t)) == null ? void 0 : T.with(V);
1242
+ const u = (E = this._renderManagerService.getRenderById(n)) == null ? void 0 : E.with(V);
1285
1243
  if (!u || !this._copyInfo)
1286
1244
  return { redos: [], undos: [] };
1287
1245
  const { drawings: l } = this._copyInfo;
1288
1246
  if (!a)
1289
1247
  return this._generateSingleDrawingPasteMutations({
1290
- pasteTo: { unitId: t, subUnitId: r, range: Nn(o) },
1248
+ pasteTo: { unitId: n, subUnitId: r, range: An(o) },
1291
1249
  pasteType: s
1292
1250
  }, c);
1293
- const { ranges: [d, g], mapFunc: h } = Mi([a, o]), { row: f, col: p } = h(d.startRow, d.startColumn), { row: m, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
1251
+ const { ranges: [d, g], mapFunc: h } = Ci([a, o]), { row: f, col: p } = h(d.startRow, d.startColumn), { row: m, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
1294
1252
  startRow: f,
1295
1253
  endRow: f,
1296
1254
  startColumn: p,
@@ -1303,28 +1261,28 @@ let Nt = class extends le {
1303
1261
  });
1304
1262
  if (!S || !C || !this._copyInfo)
1305
1263
  return { redos: [], undos: [] };
1306
- const b = C.startX - S.startX, v = C.startY - S.startY, D = m - f, _ = w - p;
1264
+ const D = C.startX - S.startX, v = C.startY - S.startY, b = m - f, _ = w - p;
1307
1265
  return this._generateMutations(l, {
1308
- unitId: t,
1266
+ unitId: n,
1309
1267
  subUnitId: r,
1310
1268
  getTransform: (M, y) => {
1311
- var E, I;
1269
+ var T, I;
1312
1270
  return {
1313
1271
  transform: {
1314
1272
  ...M,
1315
- left: ((E = M == null ? void 0 : M.left) != null ? E : 0) + b,
1273
+ left: ((T = M == null ? void 0 : M.left) != null ? T : 0) + D,
1316
1274
  top: ((I = M == null ? void 0 : M.top) != null ? I : 0) + v
1317
1275
  },
1318
1276
  sheetTransform: {
1319
1277
  ...y,
1320
1278
  to: {
1321
1279
  ...y.to,
1322
- row: y.to.row + D,
1280
+ row: y.to.row + b,
1323
1281
  column: y.to.column + _
1324
1282
  },
1325
1283
  from: {
1326
1284
  ...y.from,
1327
- row: y.from.row + D,
1285
+ row: y.from.row + b,
1328
1286
  column: y.from.column + _
1329
1287
  }
1330
1288
  }
@@ -1334,85 +1292,85 @@ let Nt = class extends le {
1334
1292
  });
1335
1293
  }
1336
1294
  };
1337
- Nt = Us([
1338
- Je(0, yi),
1339
- Je(1, ne),
1340
- Je(2, oe),
1341
- Je(3, Wi),
1295
+ Nt = Ms([
1296
+ Je(0, Di),
1297
+ Je(1, te),
1298
+ Je(2, se),
1299
+ Je(3, Ai),
1342
1300
  Je(4, G)
1343
1301
  ], Nt);
1344
- var ks = Object.getOwnPropertyDescriptor, Bs = (i, n, e, t) => {
1345
- for (var r = t > 1 ? void 0 : t ? ks(n, e) : n, s = i.length - 1, o; s >= 0; s--)
1302
+ var Os = Object.getOwnPropertyDescriptor, Us = (i, t, e, n) => {
1303
+ for (var r = n > 1 ? void 0 : n ? Os(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1346
1304
  (o = i[s]) && (r = o(r) || r);
1347
1305
  return r;
1348
- }, qe = (i, n) => (e, t) => n(e, t, i);
1306
+ }, qe = (i, t) => (e, n) => t(e, n, i);
1349
1307
  let kt = class extends le {
1350
- constructor(i, n, e, t, r) {
1351
- super(), this._drawingManagerService = i, this._renderManagerService = n, this._permissionService = e, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1308
+ constructor(i, t, e, n, r) {
1309
+ super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1352
1310
  }
1353
1311
  _initDrawingVisible() {
1354
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$, e = St([i, n]);
1312
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
1355
1313
  this.disposeWithMe(
1356
1314
  e.pipe(
1357
- Se(([t, r]) => t ? t.activeSheet$.pipe(
1358
- Wn((s) => {
1315
+ Se(([n, r]) => n ? n.activeSheet$.pipe(
1316
+ Bn((s) => {
1359
1317
  if (!s) {
1360
1318
  this._drawingManagerService.setDrawingVisible(!1);
1361
1319
  return;
1362
1320
  }
1363
- const o = t.getUnitId(), a = s.getSheetId();
1321
+ const o = n.getUnitId(), a = s.getSheetId();
1364
1322
  this._permissionService.composePermission([
1365
- new Ln(o).id,
1366
- new Fn(o, a).id
1367
- ]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(t, s);
1323
+ new $n(o).id,
1324
+ new Ln(o, a).id
1325
+ ]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
1368
1326
  })
1369
1327
  ) : (this._drawingManagerService.setDrawingVisible(!1), pe))
1370
1328
  ).subscribe()
1371
1329
  );
1372
1330
  }
1373
- _handleDrawingVisibilityFalse(i, n) {
1331
+ _handleDrawingVisibilityFalse(i, t) {
1374
1332
  this._drawingManagerService.setDrawingVisible(!1);
1375
- const e = i.getUnitId(), t = n.getSheetId(), r = this._drawingManagerService.getDrawingData(e, t), s = Object.values(r), o = this._renderManagerService.getRenderById(e), a = o == null ? void 0 : o.scene;
1333
+ const e = i.getUnitId(), n = t.getSheetId(), r = this._drawingManagerService.getDrawingData(e, n), s = Object.values(r), o = this._renderManagerService.getRenderById(e), a = o == null ? void 0 : o.scene;
1376
1334
  if (!a)
1377
1335
  return;
1378
1336
  a.getAllObjectsByOrder().forEach((u) => {
1379
- u.classType === je.IMAGE && s.some((l) => u.oKey.includes(l.drawingId)) && a.removeObject(u);
1337
+ u.classType === We.IMAGE && s.some((l) => u.oKey.includes(l.drawingId)) && a.removeObject(u);
1380
1338
  });
1381
1339
  }
1382
1340
  _initDrawingEditable() {
1383
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$, e = St([i, n]);
1341
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
1384
1342
  this.disposeWithMe(
1385
1343
  e.pipe(
1386
- Se(([t, r]) => t ? t.activeSheet$.pipe(
1387
- Wn((s) => {
1344
+ Se(([n, r]) => n ? n.activeSheet$.pipe(
1345
+ Bn((s) => {
1388
1346
  if (!s) {
1389
1347
  this._drawingManagerService.setDrawingEditable(!1);
1390
1348
  return;
1391
1349
  }
1392
- const o = t.getUnitId(), a = s.getSheetId();
1350
+ const o = n.getUnitId(), a = s.getSheetId();
1393
1351
  this._permissionService.composePermission([
1394
1352
  new en(o).id,
1395
1353
  new tn(o, a).id
1396
- ]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(t, s);
1354
+ ]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
1397
1355
  })
1398
1356
  ) : (this._drawingManagerService.setDrawingEditable(!1), pe))
1399
1357
  ).subscribe()
1400
1358
  );
1401
1359
  }
1402
- _handleDrawingEditableFalse(i, n) {
1360
+ _handleDrawingEditableFalse(i, t) {
1403
1361
  this._drawingManagerService.setDrawingEditable(!1);
1404
- const e = i.getUnitId(), t = n.getSheetId(), r = this._drawingManagerService.getDrawingData(e, t), s = Object.values(r), o = this._renderManagerService.getRenderById(e), a = o == null ? void 0 : o.scene;
1362
+ const e = i.getUnitId(), n = t.getSheetId(), r = this._drawingManagerService.getDrawingData(e, n), s = Object.values(r), o = this._renderManagerService.getRenderById(e), a = o == null ? void 0 : o.scene;
1405
1363
  if (!a)
1406
1364
  return;
1407
1365
  a.getAllObjectsByOrder().forEach((u) => {
1408
- u.classType === je.IMAGE && s.some((l) => u.oKey.includes(l.drawingId)) && a.detachTransformerFrom(u);
1366
+ u.classType === We.IMAGE && s.some((l) => u.oKey.includes(l.drawingId)) && a.detachTransformerFrom(u);
1409
1367
  });
1410
1368
  }
1411
1369
  _initViewPermissionChange() {
1412
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$;
1370
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1413
1371
  this.disposeWithMe(
1414
- St([i, n]).pipe(
1415
- Se(([e, t]) => e ? e.activeSheet$.pipe(
1372
+ St([i, t]).pipe(
1373
+ Se(([e, n]) => e ? e.activeSheet$.pipe(
1416
1374
  Se((r) => {
1417
1375
  if (!r)
1418
1376
  return pe;
@@ -1421,13 +1379,13 @@ let kt = class extends le {
1421
1379
  return pe;
1422
1380
  const u = c.getTransformerByCreate();
1423
1381
  return this._permissionService.composePermission$([
1424
- new Ln(s).id,
1425
- new Fn(s, o).id
1382
+ new $n(s).id,
1383
+ new Ln(s, o).id
1426
1384
  ]).pipe(
1427
- Oe((d) => d.every((g) => g.value)),
1428
- jn()
1385
+ Te((d) => d.every((g) => g.value)),
1386
+ Wn()
1429
1387
  ).pipe(
1430
- Oe((d) => ({
1388
+ Te((d) => ({
1431
1389
  permission: d,
1432
1390
  scene: c,
1433
1391
  transformer: u,
@@ -1438,16 +1396,16 @@ let kt = class extends le {
1438
1396
  })
1439
1397
  ) : pe)
1440
1398
  ).subscribe({
1441
- next: ({ permission: e, scene: t, transformer: r, unitId: s, subUnitId: o }) => {
1399
+ next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1442
1400
  this._drawingManagerService.setDrawingVisible(e);
1443
- const a = t.getAllObjectsByOrder(), c = this._drawingManagerService.getDrawingData(s, o), u = Object.values(c);
1401
+ const a = n.getAllObjectsByOrder(), c = this._drawingManagerService.getDrawingData(s, o), u = Object.values(c);
1444
1402
  e ? this._drawingManagerService.addNotification(u) : (a.forEach((l) => {
1445
- l.classType === je.IMAGE && u.some((d) => l.oKey.includes(d.drawingId)) && t.removeObject(l);
1403
+ l.classType === We.IMAGE && u.some((d) => l.oKey.includes(d.drawingId)) && n.removeObject(l);
1446
1404
  }), r.clearSelectedObjects());
1447
1405
  },
1448
1406
  complete: () => {
1449
1407
  this._drawingManagerService.setDrawingVisible(!0);
1450
- const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET), t = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = t == null ? void 0 : t.getSheetId();
1408
+ const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
1451
1409
  if (!r || !s)
1452
1410
  return;
1453
1411
  const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
@@ -1457,10 +1415,10 @@ let kt = class extends le {
1457
1415
  );
1458
1416
  }
1459
1417
  _initEditPermissionChange() {
1460
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$;
1418
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1461
1419
  this.disposeWithMe(
1462
- St([i, n]).pipe(
1463
- Se(([e, t]) => e ? e.activeSheet$.pipe(
1420
+ St([i, t]).pipe(
1421
+ Se(([e, n]) => e ? e.activeSheet$.pipe(
1464
1422
  Se((r) => {
1465
1423
  if (!r)
1466
1424
  return pe;
@@ -1472,10 +1430,10 @@ let kt = class extends le {
1472
1430
  new en(s).id,
1473
1431
  new tn(s, o).id
1474
1432
  ]).pipe(
1475
- Oe((d) => d.every((g) => g.value)),
1476
- jn()
1433
+ Te((d) => d.every((g) => g.value)),
1434
+ Wn()
1477
1435
  ).pipe(
1478
- Oe((d) => ({
1436
+ Te((d) => ({
1479
1437
  permission: d,
1480
1438
  scene: c,
1481
1439
  transformer: u,
@@ -1486,57 +1444,57 @@ let kt = class extends le {
1486
1444
  })
1487
1445
  ) : pe)
1488
1446
  ).subscribe({
1489
- next: ({ permission: e, scene: t, transformer: r, unitId: s, subUnitId: o }) => {
1447
+ next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1490
1448
  this._drawingManagerService.setDrawingEditable(e);
1491
- const a = t.getAllObjectsByOrder(), c = this._drawingManagerService.getDrawingData(s, o), u = Object.values(c);
1449
+ const a = n.getAllObjectsByOrder(), c = this._drawingManagerService.getDrawingData(s, o), u = Object.values(c);
1492
1450
  e ? (a.forEach((l) => {
1493
- l.classType === je.IMAGE && u.some((d) => l.oKey.includes(d.drawingId)) && t.attachTransformerTo(l);
1451
+ l.classType === We.IMAGE && u.some((d) => l.oKey.includes(d.drawingId)) && n.attachTransformerTo(l);
1494
1452
  }), this._drawingManagerService.addNotification(u)) : (a.forEach((l) => {
1495
- l.classType === je.IMAGE && u.some((d) => l.oKey.includes(d.drawingId)) && t.detachTransformerFrom(l);
1453
+ l.classType === We.IMAGE && u.some((d) => l.oKey.includes(d.drawingId)) && n.detachTransformerFrom(l);
1496
1454
  }), r.clearSelectedObjects());
1497
1455
  },
1498
1456
  complete: () => {
1499
1457
  const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
1500
1458
  if (!e)
1501
1459
  return;
1502
- const t = e.getUnitId(), r = e.getActiveSheet();
1460
+ const n = e.getUnitId(), r = e.getActiveSheet();
1503
1461
  if (!r)
1504
1462
  return;
1505
- const s = r.getSheetId(), o = this._renderManagerService.getRenderById(t), a = o == null ? void 0 : o.scene;
1463
+ const s = r.getSheetId(), o = this._renderManagerService.getRenderById(n), a = o == null ? void 0 : o.scene;
1506
1464
  if (!a)
1507
1465
  return;
1508
- const c = this._drawingManagerService.getDrawingData(t, s), u = Object.values(c);
1466
+ const c = this._drawingManagerService.getDrawingData(n, s), u = Object.values(c);
1509
1467
  this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((d) => {
1510
- d.classType === je.IMAGE && u.some((g) => d.oKey.includes(g.drawingId)) && a.detachTransformerFrom(d);
1468
+ d.classType === We.IMAGE && u.some((g) => d.oKey.includes(g.drawingId)) && a.detachTransformerFrom(d);
1511
1469
  });
1512
1470
  }
1513
1471
  })
1514
1472
  );
1515
1473
  }
1516
1474
  };
1517
- kt = Bs([
1518
- qe(0, oe),
1519
- qe(1, ne),
1520
- qe(2, Vr),
1521
- qe(3, Ce),
1522
- qe(4, N(Hr))
1475
+ kt = Us([
1476
+ qe(0, se),
1477
+ qe(1, te),
1478
+ qe(2, Fr),
1479
+ qe(3, Ee),
1480
+ qe(4, N(Yr))
1523
1481
  ], kt);
1524
- var Ws = Object.getOwnPropertyDescriptor, js = (i, n, e, t) => {
1525
- for (var r = t > 1 ? void 0 : t ? Ws(n, e) : n, s = i.length - 1, o; s >= 0; s--)
1482
+ var Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
1483
+ for (var r = n > 1 ? void 0 : n ? Ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1526
1484
  (o = i[s]) && (r = o(r) || r);
1527
1485
  return r;
1528
- }, Rt = (i, n) => (e, t) => n(e, t, i);
1486
+ }, Rt = (i, t) => (e, n) => t(e, n, i);
1529
1487
  let Bt = class extends le {
1530
- constructor(i, n, e, t) {
1531
- super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = n, this._drawingManagerService = e, this._renderManagerService = t, this._initPrinting();
1488
+ constructor(i, t, e, n) {
1489
+ super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._initPrinting();
1532
1490
  }
1533
1491
  _initPrinting() {
1534
1492
  this.disposeWithMe(
1535
1493
  this._sheetPrintInterceptorService.interceptor.intercept(
1536
1494
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
1537
1495
  {
1538
- handler: (i, n, e) => {
1539
- const { unitId: t, scene: r, subUnitId: s } = n, o = this._drawingManagerService.getDrawingDataForUnit(t), a = o == null ? void 0 : o[s];
1496
+ handler: (i, t, e) => {
1497
+ const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
1540
1498
  return a && a.order.forEach((c) => {
1541
1499
  this._drawingRenderService.renderDrawing(a.data[c], r);
1542
1500
  }), e();
@@ -1547,19 +1505,19 @@ let Bt = class extends le {
1547
1505
  this._sheetPrintInterceptorService.interceptor.intercept(
1548
1506
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_RANGE,
1549
1507
  {
1550
- handler: (i, n, e) => {
1551
- const { unitId: t, subUnitId: r } = n, s = this._renderManagerService.getRenderById(t);
1508
+ handler: (i, t, e) => {
1509
+ const { unitId: n, subUnitId: r } = t, s = this._renderManagerService.getRenderById(n);
1552
1510
  if (!s)
1553
1511
  return e(i);
1554
1512
  const o = s.with(V).getSkeletonParam(r);
1555
1513
  if (!o)
1556
1514
  return e(i);
1557
- const a = this._drawingManagerService.getDrawingDataForUnit(t), c = a == null ? void 0 : a[n.subUnitId];
1515
+ const a = this._drawingManagerService.getDrawingDataForUnit(n), c = a == null ? void 0 : a[t.subUnitId];
1558
1516
  if (!c)
1559
1517
  return e(i);
1560
- const { scaleX: u, scaleY: l } = s.scene, d = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = c.order.map((h) => c.data[h]).filter((h) => h.drawingType !== x.DRAWING_DOM);
1518
+ const { scaleX: u, scaleY: l } = s.scene, d = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = c.order.map((h) => c.data[h]).filter((h) => h.drawingType !== $.DRAWING_DOM);
1561
1519
  return g.length ? (g.forEach((h) => {
1562
- if (!h.groupId && h.transform && Ee.isDefine(h.transform.left) && Ee.isDefine(h.transform.top) && Ee.isDefine(h.transform.width) && Ee.isDefine(h.transform.height)) {
1520
+ if (!h.groupId && h.transform && Me.isDefine(h.transform.left) && Me.isDefine(h.transform.top) && Me.isDefine(h.transform.width) && Me.isDefine(h.transform.height)) {
1563
1521
  const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, l, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, l, { x: 0, y: 0 });
1564
1522
  f.column < d.startColumn && (d.startColumn = f.column), f.row < d.startRow && (d.startRow = f.row), d.endRow < p.row && (d.endRow = p.row), d.endColumn < p.column && (d.endColumn = p.column);
1565
1523
  }
@@ -1570,189 +1528,189 @@ let Bt = class extends le {
1570
1528
  );
1571
1529
  }
1572
1530
  };
1573
- Bt = js([
1574
- Rt(0, N(Ei)),
1575
- Rt(1, N(Zn)),
1576
- Rt(2, oe),
1577
- Rt(3, ne)
1531
+ Bt = As([
1532
+ Rt(0, N(bi)),
1533
+ Rt(1, N(Kn)),
1534
+ Rt(2, se),
1535
+ Rt(3, te)
1578
1536
  ], Bt);
1579
- var $s = Object.getOwnPropertyDescriptor, xs = (i, n, e, t) => {
1580
- for (var r = t > 1 ? void 0 : t ? $s(n, e) : n, s = i.length - 1, o; s >= 0; s--)
1537
+ var Ns = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
1538
+ for (var r = n > 1 ? void 0 : n ? Ns(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1581
1539
  (o = i[s]) && (r = o(r) || r);
1582
1540
  return r;
1583
- }, _e = (i, n) => (e, t) => n(e, t, i);
1584
- const Ls = [
1541
+ }, _e = (i, t) => (e, n) => t(e, n, i);
1542
+ const Bs = [
1543
+ Qn.id,
1544
+ er.id,
1545
+ tr.id,
1546
+ nr.id,
1585
1547
  rr.id,
1586
1548
  ir.id,
1587
1549
  sr.id,
1588
1550
  or.id,
1551
+ nn.id,
1552
+ rn.id,
1589
1553
  ar.id,
1590
1554
  cr.id,
1591
1555
  dr.id,
1592
1556
  lr.id,
1593
- nn.id,
1594
- rn.id,
1595
1557
  ur.id,
1596
1558
  hr.id,
1597
1559
  gr.id,
1598
1560
  fr.id,
1599
- mr.id,
1600
- pr.id,
1601
- wr.id,
1602
- _r.id,
1603
- vr.id
1604
- ], Fs = [
1605
- Ji.id,
1606
- qi.id,
1607
- Qi.id,
1608
- es.id,
1609
- er.id,
1610
- tr.id
1561
+ mr.id
1562
+ ], Ws = [
1563
+ Yi.id,
1564
+ Gi.id,
1565
+ Xi.id,
1566
+ Vi.id,
1567
+ Hi.id,
1568
+ zi.id
1611
1569
  ];
1612
- let dn = class extends le {
1613
- constructor(i, n, e, t, r, s, o, a, c) {
1614
- super(), this._context = i, this._renderManagerService = n, this._commandService = e, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = c, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1570
+ let cn = class extends le {
1571
+ constructor(i, t, e, n, r, s, o, a, c) {
1572
+ super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = c, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1615
1573
  }
1616
1574
  _sheetInterceptorListener() {
1617
1575
  this.disposeWithMe(
1618
1576
  this._sheetInterceptorService.interceptCommand({
1619
1577
  getMutations: (i) => {
1620
- if (!Ls.includes(i.id))
1578
+ if (!Bs.includes(i.id))
1621
1579
  return { redos: [], undos: [] };
1622
1580
  if (i.params == null)
1623
1581
  return { redos: [], undos: [] };
1624
- const n = i.id;
1625
- if (n === rr.id)
1582
+ const t = i.id;
1583
+ if (t === Qn.id)
1626
1584
  return this._moveRowInterceptor(i.params, "insert");
1627
- if ([wr.id, _r.id, vr.id].includes(n))
1585
+ if ([gr.id, fr.id, mr.id].includes(t))
1628
1586
  return this._moveRangeInterceptor(i.params);
1629
- if (n === ir.id)
1587
+ if (t === er.id)
1630
1588
  return this._moveColInterceptor(i.params, "insert");
1631
- if (n === sr.id)
1589
+ if (t === tr.id)
1632
1590
  return this._moveRowInterceptor(i.params, "remove");
1633
- if (n === or.id)
1591
+ if (t === nr.id)
1634
1592
  return this._moveColInterceptor(i.params, "remove");
1635
- if (n === ar.id) {
1593
+ if (t === rr.id) {
1636
1594
  const { range: e } = i.params;
1637
1595
  return this._getRangeMoveUndo(
1638
1596
  e,
1639
1597
  0
1640
1598
  /* deleteLeft */
1641
1599
  );
1642
- } else if (n === cr.id) {
1600
+ } else if (t === ir.id) {
1643
1601
  const { range: e } = i.params;
1644
1602
  return this._getRangeMoveUndo(
1645
1603
  e,
1646
1604
  1
1647
1605
  /* deleteUp */
1648
1606
  );
1649
- } else if (n === dr.id) {
1607
+ } else if (t === sr.id) {
1650
1608
  const { range: e } = i.params;
1651
1609
  return this._getRangeMoveUndo(
1652
1610
  e,
1653
1611
  2
1654
1612
  /* insertDown */
1655
1613
  );
1656
- } else if (n === lr.id) {
1614
+ } else if (t === or.id) {
1657
1615
  const { range: e } = i.params;
1658
1616
  return this._getRangeMoveUndo(
1659
1617
  e,
1660
1618
  3
1661
1619
  /* insertRight */
1662
1620
  );
1663
- } else if (n === gr.id || n === fr.id) {
1664
- const e = i.params, { unitId: t, subUnitId: r, ranges: s } = e;
1665
- return this._getDrawingUndoForRowVisible(t, r, s);
1666
- } else if (n === mr.id || n === pr.id) {
1667
- const e = i.params, { unitId: t, subUnitId: r, ranges: s } = e;
1668
- return this._getDrawingUndoForColVisible(t, r, s);
1669
- } else if (n === nn.id || n === rn.id || n === ur.id || n === hr.id) {
1670
- const e = i.params, { unitId: t, subUnitId: r, ranges: s } = e, o = n === nn.id || n === rn.id;
1671
- return this._getDrawingUndoForRowAndColSize(t, r, s, o);
1621
+ } else if (t === dr.id || t === lr.id) {
1622
+ const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
1623
+ return this._getDrawingUndoForRowVisible(n, r, s);
1624
+ } else if (t === ur.id || t === hr.id) {
1625
+ const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
1626
+ return this._getDrawingUndoForColVisible(n, r, s);
1627
+ } else if (t === nn.id || t === rn.id || t === ar.id || t === cr.id) {
1628
+ const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === nn.id || t === rn.id;
1629
+ return this._getDrawingUndoForRowAndColSize(n, r, s, o);
1672
1630
  }
1673
1631
  return { redos: [], undos: [] };
1674
1632
  }
1675
1633
  })
1676
1634
  );
1677
1635
  }
1678
- _getRangeMoveUndo(i, n) {
1679
- const e = H(this._univerInstanceService);
1636
+ _getRangeMoveUndo(i, t) {
1637
+ const e = de(this._univerInstanceService);
1680
1638
  if (e == null)
1681
1639
  return { redos: [], undos: [] };
1682
- const t = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), c = [], u = [];
1640
+ const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), c = [], u = [];
1683
1641
  if (Object.keys(a).forEach((l) => {
1684
- const d = a[l], { updateDrawings: g, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, n, d);
1642
+ const d = a[l], { updateDrawings: g, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, t, d);
1685
1643
  c.push(...g), u.push(...h);
1686
1644
  }), c.length === 0 && u.length === 0)
1687
1645
  return { redos: [], undos: [] };
1688
1646
  if (c.length > 0) {
1689
1647
  const l = this._sheetDrawingService.getBatchUpdateOp(c), { undo: d, redo: g, objects: h } = l;
1690
- s.push({ id: A.id, params: { unitId: t, subUnitId: r, op: g, objects: h, type: P.UPDATE } }), o.push({ id: A.id, params: { unitId: t, subUnitId: r, op: d, objects: h, type: P.UPDATE } });
1648
+ s.push({ id: A.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: P.UPDATE } }), o.push({ id: A.id, params: { unitId: n, subUnitId: r, op: d, objects: h, type: P.UPDATE } });
1691
1649
  }
1692
1650
  if (u.length > 0) {
1693
1651
  const l = this._sheetDrawingService.getBatchRemoveOp(u), d = l.undo, g = l.redo, h = l.objects;
1694
- s.push({ id: A.id, params: { unitId: t, subUnitId: r, op: g, objects: h, type: P.REMOVE } }), o.push({ id: A.id, params: { unitId: t, subUnitId: r, op: d, objects: h, type: P.INSERT } });
1652
+ s.push({ id: A.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: P.REMOVE } }), o.push({ id: A.id, params: { unitId: n, subUnitId: r, op: d, objects: h, type: P.INSERT } });
1695
1653
  }
1696
- return s.push({ id: L.id, params: [t] }), o.push({ id: L.id, params: [t] }), {
1654
+ return s.push({ id: L.id, params: [n] }), o.push({ id: L.id, params: [n] }), {
1697
1655
  redos: s,
1698
1656
  undos: o
1699
1657
  };
1700
1658
  }
1701
- _getUpdateOrDeleteDrawings(i, n, e) {
1702
- const t = [], r = [], { sheetTransform: s, anchorType: o = U.Position, transform: a, unitId: c, subUnitId: u, drawingId: l } = e, { from: d, to: g } = s, { row: h, column: f } = d, { row: p, column: m } = g;
1659
+ _getUpdateOrDeleteDrawings(i, t, e) {
1660
+ const n = [], r = [], { sheetTransform: s, anchorType: o = U.Position, transform: a, unitId: c, subUnitId: u, drawingId: l } = e, { from: d, to: g } = s, { row: h, column: f } = d, { row: p, column: m } = g;
1703
1661
  if (s == null || a == null)
1704
1662
  return {
1705
- updateDrawings: t,
1663
+ updateDrawings: n,
1706
1664
  deleteDrawings: r
1707
1665
  };
1708
- const { startRow: w, endRow: S, startColumn: C, endColumn: b } = i;
1709
- let v = null, D = null;
1710
- if (n === 0 && h >= w && p <= S)
1711
- if (f >= C && m <= b)
1666
+ const { startRow: w, endRow: S, startColumn: C, endColumn: D } = i;
1667
+ let v = null, b = null;
1668
+ if (t === 0 && h >= w && p <= S)
1669
+ if (f >= C && m <= D)
1712
1670
  r.push({ unitId: c, subUnitId: u, drawingId: l });
1713
1671
  else {
1714
- const _ = this._shrinkCol(s, a, C, b, o);
1715
- v = _ == null ? void 0 : _.newSheetTransform, D = _ == null ? void 0 : _.newTransform;
1672
+ const _ = this._shrinkCol(s, a, C, D, o);
1673
+ v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
1716
1674
  }
1717
- else if (n === 1 && f >= C && m <= b)
1675
+ else if (t === 1 && f >= C && m <= D)
1718
1676
  if (h >= w && p <= S)
1719
1677
  r.push({ unitId: c, subUnitId: u, drawingId: l });
1720
1678
  else {
1721
1679
  const _ = this._shrinkRow(s, a, w, S, o);
1722
- v = _ == null ? void 0 : _.newSheetTransform, D = _ == null ? void 0 : _.newTransform;
1680
+ v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
1723
1681
  }
1724
- else if (n === 2) {
1682
+ else if (t === 2) {
1725
1683
  const _ = this._expandRow(s, a, w, S, o);
1726
- v = _ == null ? void 0 : _.newSheetTransform, D = _ == null ? void 0 : _.newTransform;
1727
- } else if (n === 3) {
1728
- const _ = this._expandCol(s, a, C, b, o);
1729
- v = _ == null ? void 0 : _.newSheetTransform, D = _ == null ? void 0 : _.newTransform;
1684
+ v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
1685
+ } else if (t === 3) {
1686
+ const _ = this._expandCol(s, a, C, D, o);
1687
+ v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
1730
1688
  }
1731
- if (v != null && D != null) {
1732
- const _ = z(v, this._selectionRenderService, this._skeletonManagerService);
1733
- t.push({ ...e, sheetTransform: v, transform: _ });
1689
+ if (v != null && b != null) {
1690
+ const _ = H(v, this._selectionRenderService, this._skeletonManagerService);
1691
+ n.push({ ...e, sheetTransform: v, transform: _ });
1734
1692
  }
1735
- return { updateDrawings: t, deleteDrawings: r };
1693
+ return { updateDrawings: n, deleteDrawings: r };
1736
1694
  }
1737
- _remainDrawingSize(i, n, e) {
1738
- const t = $({ ...i }, this._selectionRenderService);
1739
- t != null && n.push({
1695
+ _remainDrawingSize(i, t, e) {
1696
+ const n = x({ ...i }, this._selectionRenderService);
1697
+ n != null && t.push({
1740
1698
  ...e,
1741
- sheetTransform: t
1699
+ sheetTransform: n
1742
1700
  });
1743
1701
  }
1744
1702
  // eslint-disable-next-line max-lines-per-function
1745
- _getDrawingUndoForColVisible(i, n, e) {
1746
- const t = this._drawingManagerService.getDrawingData(i, n), r = [], s = [];
1747
- if (Object.keys(t).forEach((l) => {
1748
- const d = t[l], { sheetTransform: g, transform: h, anchorType: f = U.Position } = d;
1703
+ _getDrawingUndoForColVisible(i, t, e) {
1704
+ const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
1705
+ if (Object.keys(n).forEach((l) => {
1706
+ const d = n[l], { sheetTransform: g, transform: h, anchorType: f = U.Position } = d;
1749
1707
  if (f === U.None)
1750
1708
  this._remainDrawingSize(h, r, d);
1751
1709
  else {
1752
- const { from: p, to: m } = g, { row: w, column: S } = p, { row: C, column: b } = m;
1710
+ const { from: p, to: m } = g, { row: w, column: S } = p, { row: C, column: D } = m;
1753
1711
  for (let v = 0; v < e.length; v++) {
1754
- const D = e[v], { startRow: _, endRow: T, startColumn: M, endColumn: y } = D;
1755
- if (b < M)
1712
+ const b = e[v], { startRow: _, endRow: E, startColumn: M, endColumn: y } = b;
1713
+ if (D < M)
1756
1714
  continue;
1757
1715
  if (f === U.Position) {
1758
1716
  let R = null, O = null;
@@ -1762,16 +1720,16 @@ let dn = class extends le {
1762
1720
  return;
1763
1721
  O = { ...h, left: B.startX };
1764
1722
  }
1765
- if (O != null && (R = $(O, this._selectionRenderService), R != null && O != null)) {
1723
+ if (O != null && (R = x(O, this._selectionRenderService), R != null && O != null)) {
1766
1724
  r.push({ ...d, sheetTransform: R, transform: O });
1767
1725
  break;
1768
1726
  }
1769
1727
  this._remainDrawingSize(h, r, d);
1770
1728
  continue;
1771
1729
  }
1772
- if (S >= M && b <= y)
1730
+ if (S >= M && D <= y)
1773
1731
  continue;
1774
- let E = null, I = null;
1732
+ let T = null, I = null;
1775
1733
  if (S >= M && S <= y) {
1776
1734
  const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: m.row });
1777
1735
  if (R == null)
@@ -1781,8 +1739,8 @@ let dn = class extends le {
1781
1739
  left: (R == null ? void 0 : R.startX) || 0,
1782
1740
  width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
1783
1741
  };
1784
- } else if (b >= M && b <= y) {
1785
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: b, startRow: p.row, endRow: m.row });
1742
+ } else if (D >= M && D <= y) {
1743
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: D, startRow: p.row, endRow: m.row });
1786
1744
  if (R == null)
1787
1745
  return;
1788
1746
  I = {
@@ -1796,13 +1754,13 @@ let dn = class extends le {
1796
1754
  if (I = {
1797
1755
  ...h,
1798
1756
  width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
1799
- }, E = $(I, this._selectionRenderService), E != null && I != null) {
1800
- s.push({ ...d, sheetTransform: E, transform: I });
1757
+ }, T = x(I, this._selectionRenderService), T != null && I != null) {
1758
+ s.push({ ...d, sheetTransform: T, transform: I });
1801
1759
  break;
1802
1760
  }
1803
1761
  }
1804
- if (I != null && (E = $(I, this._selectionRenderService)), I != null && E != null) {
1805
- r.push({ ...d, sheetTransform: E, transform: I });
1762
+ if (I != null && (T = x(I, this._selectionRenderService)), I != null && T != null) {
1763
+ r.push({ ...d, sheetTransform: T, transform: I });
1806
1764
  break;
1807
1765
  } else
1808
1766
  this._remainDrawingSize(h, r, d);
@@ -1810,9 +1768,9 @@ let dn = class extends le {
1810
1768
  }
1811
1769
  }), r.length === 0 && s.length === 0)
1812
1770
  return { redos: [], undos: [] };
1813
- const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, n, r), c = [], u = [];
1771
+ const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), c = [], u = [];
1814
1772
  if (s.length > 0) {
1815
- const { redos: l, undos: d } = this._createUndoAndRedoMutation(i, n, s);
1773
+ const { redos: l, undos: d } = this._createUndoAndRedoMutation(i, t, s);
1816
1774
  c.push(...l), u.push(...d);
1817
1775
  }
1818
1776
  return {
@@ -1822,12 +1780,12 @@ let dn = class extends le {
1822
1780
  preUndos: u
1823
1781
  };
1824
1782
  }
1825
- _createUndoAndRedoMutation(i, n, e) {
1826
- const t = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = t, a = [
1827
- { id: A.id, params: { unitId: i, subUnitId: n, op: s, objects: o, type: P.UPDATE } },
1783
+ _createUndoAndRedoMutation(i, t, e) {
1784
+ const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
1785
+ { id: A.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: P.UPDATE } },
1828
1786
  { id: L.id, params: [i] }
1829
1787
  ], c = [
1830
- { id: A.id, params: { unitId: i, subUnitId: n, op: r, objects: o, type: P.UPDATE } },
1788
+ { id: A.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: P.UPDATE } },
1831
1789
  { id: L.id, params: [i] }
1832
1790
  ];
1833
1791
  return {
@@ -1836,38 +1794,38 @@ let dn = class extends le {
1836
1794
  };
1837
1795
  }
1838
1796
  // eslint-disable-next-line max-lines-per-function
1839
- _getDrawingUndoForRowVisible(i, n, e) {
1840
- const t = this._drawingManagerService.getDrawingData(i, n), r = [], s = [];
1841
- if (Object.keys(t).forEach((l) => {
1842
- const d = t[l], { sheetTransform: g, transform: h, anchorType: f = U.Position } = d;
1797
+ _getDrawingUndoForRowVisible(i, t, e) {
1798
+ const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
1799
+ if (Object.keys(n).forEach((l) => {
1800
+ const d = n[l], { sheetTransform: g, transform: h, anchorType: f = U.Position } = d;
1843
1801
  if (f === U.None)
1844
1802
  this._remainDrawingSize(h, r, d);
1845
1803
  else {
1846
- const { from: p, to: m } = g, { row: w, column: S } = p, { row: C, column: b } = m;
1804
+ const { from: p, to: m } = g, { row: w, column: S } = p, { row: C, column: D } = m;
1847
1805
  for (let v = 0; v < e.length; v++) {
1848
- const D = e[v], { startRow: _, endRow: T, startColumn: M, endColumn: y } = D;
1806
+ const b = e[v], { startRow: _, endRow: E, startColumn: M, endColumn: y } = b;
1849
1807
  if (C < _)
1850
1808
  continue;
1851
1809
  if (f === U.Position) {
1852
1810
  let R = null, O = null;
1853
- if (w >= _ && w <= T) {
1854
- const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: T });
1811
+ if (w >= _ && w <= E) {
1812
+ const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: E });
1855
1813
  if (B == null)
1856
1814
  return;
1857
1815
  O = { ...h, top: B.startY };
1858
1816
  }
1859
- if (O != null && (R = $(O, this._selectionRenderService), R != null && O != null)) {
1817
+ if (O != null && (R = x(O, this._selectionRenderService), R != null && O != null)) {
1860
1818
  r.push({ ...d, sheetTransform: R, transform: O });
1861
1819
  break;
1862
1820
  }
1863
1821
  this._remainDrawingSize(h, r, d);
1864
1822
  continue;
1865
1823
  }
1866
- if (w >= _ && C <= T)
1824
+ if (w >= _ && C <= E)
1867
1825
  continue;
1868
- let E = null, I = null;
1869
- if (w >= _ && w <= T) {
1870
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: T });
1826
+ let T = null, I = null;
1827
+ if (w >= _ && w <= E) {
1828
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: E });
1871
1829
  if (R == null)
1872
1830
  return;
1873
1831
  I = {
@@ -1875,7 +1833,7 @@ let dn = class extends le {
1875
1833
  top: (R == null ? void 0 : R.startY) || 0,
1876
1834
  height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
1877
1835
  };
1878
- } else if (C >= _ && C <= T) {
1836
+ } else if (C >= _ && C <= E) {
1879
1837
  const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: C });
1880
1838
  if (R == null)
1881
1839
  return;
@@ -1884,19 +1842,19 @@ let dn = class extends le {
1884
1842
  top: R.startY - ((h == null ? void 0 : h.height) || 0)
1885
1843
  };
1886
1844
  } else {
1887
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: T });
1845
+ const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: E });
1888
1846
  if (R == null)
1889
1847
  return;
1890
1848
  if (I = {
1891
1849
  ...h,
1892
1850
  height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
1893
- }, E = $(I, this._selectionRenderService), E != null && I != null) {
1894
- s.push({ ...d, sheetTransform: E, transform: I });
1851
+ }, T = x(I, this._selectionRenderService), T != null && I != null) {
1852
+ s.push({ ...d, sheetTransform: T, transform: I });
1895
1853
  break;
1896
1854
  }
1897
1855
  }
1898
- if (I != null && (E = $(I, this._selectionRenderService)), I != null && E != null) {
1899
- r.push({ ...d, sheetTransform: E, transform: I });
1856
+ if (I != null && (T = x(I, this._selectionRenderService)), I != null && T != null) {
1857
+ r.push({ ...d, sheetTransform: T, transform: I });
1900
1858
  break;
1901
1859
  } else
1902
1860
  this._remainDrawingSize(h, r, d);
@@ -1904,9 +1862,9 @@ let dn = class extends le {
1904
1862
  }
1905
1863
  }), r.length === 0 && s.length === 0)
1906
1864
  return { redos: [], undos: [] };
1907
- const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, n, r), c = [], u = [];
1865
+ const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), c = [], u = [];
1908
1866
  if (s.length > 0) {
1909
- const { redos: l, undos: d } = this._createUndoAndRedoMutation(i, n, s);
1867
+ const { redos: l, undos: d } = this._createUndoAndRedoMutation(i, t, s);
1910
1868
  c.push(...l), u.push(...d);
1911
1869
  }
1912
1870
  return {
@@ -1916,8 +1874,8 @@ let dn = class extends le {
1916
1874
  preUndos: u
1917
1875
  };
1918
1876
  }
1919
- _getDrawingUndoForRowAndColSize(i, n, e, t) {
1920
- const r = this._drawingManagerService.getDrawingData(i, n), s = [];
1877
+ _getDrawingUndoForRowAndColSize(i, t, e, n) {
1878
+ const r = this._drawingManagerService.getDrawingData(i, t), s = [];
1921
1879
  return Object.keys(r).forEach((o) => {
1922
1880
  const a = r[o], { sheetTransform: c, transform: u, anchorType: l = U.Position } = a;
1923
1881
  if (l === U.None)
@@ -1925,14 +1883,14 @@ let dn = class extends le {
1925
1883
  else {
1926
1884
  const { from: d, to: g } = c, { row: h, column: f } = d, { row: p, column: m } = g;
1927
1885
  for (let w = 0; w < e.length; w++) {
1928
- const S = e[w], { startRow: C, endRow: b, startColumn: v, endColumn: D } = S;
1886
+ const S = e[w], { startRow: C, endRow: D, startColumn: v, endColumn: b } = S;
1929
1887
  if (p < C || m < v)
1930
1888
  continue;
1931
- if (l === U.Position && (h <= C && p >= b || f <= v && m >= D)) {
1889
+ if (l === U.Position && (h <= C && p >= D || f <= v && m >= b)) {
1932
1890
  this._remainDrawingSize(u, s, a);
1933
1891
  continue;
1934
1892
  }
1935
- const _ = z({ ...c }, this._selectionRenderService, this._skeletonManagerService);
1893
+ const _ = H({ ...c }, this._selectionRenderService, this._skeletonManagerService);
1936
1894
  if (_ != null) {
1937
1895
  s.push({
1938
1896
  ...a,
@@ -1942,83 +1900,83 @@ let dn = class extends le {
1942
1900
  }
1943
1901
  }
1944
1902
  }
1945
- }), s.length === 0 ? { redos: [], undos: [] } : this._createUndoAndRedoMutation(i, n, s);
1903
+ }), s.length === 0 ? { redos: [], undos: [] } : this._createUndoAndRedoMutation(i, t, s);
1946
1904
  }
1947
- _getUnitIdAndSubUnitId(i, n) {
1948
- let e, t;
1949
- if (n === "insert")
1950
- e = i.unitId, t = i.subUnitId;
1905
+ _getUnitIdAndSubUnitId(i, t) {
1906
+ let e, n;
1907
+ if (t === "insert")
1908
+ e = i.unitId, n = i.subUnitId;
1951
1909
  else {
1952
- const r = H(this._univerInstanceService);
1910
+ const r = de(this._univerInstanceService);
1953
1911
  if (r == null)
1954
1912
  return;
1955
- e = r.unitId, t = r.subUnitId;
1913
+ e = r.unitId, n = r.subUnitId;
1956
1914
  }
1957
- return { unitId: e, subUnitId: t };
1915
+ return { unitId: e, subUnitId: n };
1958
1916
  }
1959
1917
  _moveRangeInterceptor(i) {
1960
- var C, b;
1961
- const { toRange: n, fromRange: e } = i, t = H(this._univerInstanceService);
1962
- if (!t)
1918
+ var C, D;
1919
+ const { toRange: t, fromRange: e } = i, n = de(this._univerInstanceService);
1920
+ if (!n)
1963
1921
  return { redos: [], undos: [] };
1964
- const { unitId: r, subUnitId: s } = t, o = (b = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(V)) == null ? void 0 : b.getCurrentSkeleton();
1922
+ const { unitId: r, subUnitId: s } = n, o = (D = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(V)) == null ? void 0 : D.getCurrentSkeleton();
1965
1923
  if (!o)
1966
1924
  return { redos: [], undos: [] };
1967
- const a = Qn(o, e);
1925
+ const a = qn(o, e);
1968
1926
  if (!a)
1969
1927
  return { redos: [], undos: [] };
1970
1928
  const { startX: c, endX: u, startY: l, endY: d } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
1971
1929
  Object.keys(g).forEach((v) => {
1972
- const D = g[v];
1973
- if (D.anchorType !== U.Both)
1930
+ const b = g[v];
1931
+ if (b.anchorType !== U.Both)
1974
1932
  return;
1975
- const { transform: _ } = D;
1933
+ const { transform: _ } = b;
1976
1934
  if (!_)
1977
1935
  return;
1978
- const { left: T = 0, top: M = 0, width: y = 0, height: E = 0 } = _, { drawingStartX: I, drawingEndX: R, drawingStartY: O, drawingEndY: B } = {
1979
- drawingStartX: T,
1980
- drawingEndX: T + y,
1936
+ const { left: E = 0, top: M = 0, width: y = 0, height: T = 0 } = _, { drawingStartX: I, drawingEndX: R, drawingStartY: O, drawingEndY: B } = {
1937
+ drawingStartX: E,
1938
+ drawingEndX: E + y,
1981
1939
  drawingStartY: M,
1982
- drawingEndY: M + E
1940
+ drawingEndY: M + T
1983
1941
  };
1984
- c <= I && R <= u && l <= O && B <= d && h.push(D);
1942
+ c <= I && R <= u && l <= O && B <= d && h.push(b);
1985
1943
  });
1986
- const f = [], p = [], m = n.startRow - e.startRow, w = n.startColumn - e.startColumn, S = h.map((v) => {
1987
- const D = v.sheetTransform, _ = {
1988
- to: { ...D.to, row: D.to.row + m, column: D.to.column + w },
1989
- from: { ...D.from, row: D.from.row + m, column: D.from.column + w }
1990
- }, T = z(_, this._selectionRenderService, this._skeletonManagerService);
1944
+ const f = [], p = [], m = t.startRow - e.startRow, w = t.startColumn - e.startColumn, S = h.map((v) => {
1945
+ const b = v.sheetTransform, _ = {
1946
+ to: { ...b.to, row: b.to.row + m, column: b.to.column + w },
1947
+ from: { ...b.from, row: b.from.row + m, column: b.from.column + w }
1948
+ }, E = H(_, this._selectionRenderService, this._skeletonManagerService);
1991
1949
  return {
1992
1950
  unitId: r,
1993
1951
  subUnitId: s,
1994
1952
  drawingId: v.drawingId,
1995
- transform: T,
1953
+ transform: E,
1996
1954
  sheetTransform: _
1997
1955
  };
1998
1956
  });
1999
1957
  if (S.length) {
2000
- const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: D, redo: _, objects: T } = v;
2001
- f.push({ id: A.id, params: { unitId: r, subUnitId: s, op: _, objects: T, type: P.UPDATE } }), p.push({ id: A.id, params: { unitId: r, subUnitId: s, op: D, objects: T, type: P.UPDATE } });
1958
+ const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: b, redo: _, objects: E } = v;
1959
+ f.push({ id: A.id, params: { unitId: r, subUnitId: s, op: _, objects: E, type: P.UPDATE } }), p.push({ id: A.id, params: { unitId: r, subUnitId: s, op: b, objects: E, type: P.UPDATE } });
2002
1960
  }
2003
1961
  return { redos: f, undos: p };
2004
1962
  }
2005
- _moveRowInterceptor(i, n) {
2006
- const e = this._getUnitIdAndSubUnitId(i, n);
1963
+ _moveRowInterceptor(i, t) {
1964
+ const e = this._getUnitIdAndSubUnitId(i, t);
2007
1965
  if (e == null)
2008
1966
  return { redos: [], undos: [] };
2009
- const { unitId: t, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, c = [], u = [], l = this._sheetDrawingService.getDrawingData(t, r), d = [], g = [];
1967
+ const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, c = [], u = [], l = this._sheetDrawingService.getDrawingData(n, r), d = [], g = [];
2010
1968
  if (Object.keys(l).forEach((h) => {
2011
1969
  const f = l[h], { sheetTransform: p, transform: m, anchorType: w = U.Position } = f;
2012
1970
  if (p == null || m == null)
2013
1971
  return;
2014
1972
  let S, C;
2015
- if (n === "insert") {
1973
+ if (t === "insert") {
2016
1974
  const v = this._expandRow(p, m, o, a, w);
2017
1975
  S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
2018
1976
  } else {
2019
- const { from: v, to: D } = p, { row: _ } = v, { row: T } = D;
2020
- if (w === U.Both && _ >= o && T <= a)
2021
- g.push({ unitId: t, subUnitId: r, drawingId: h });
1977
+ const { from: v, to: b } = p, { row: _ } = v, { row: E } = b;
1978
+ if (w === U.Both && _ >= o && E <= a)
1979
+ g.push({ unitId: n, subUnitId: r, drawingId: h });
2022
1980
  else {
2023
1981
  const M = this._shrinkRow(p, m, o, a, w);
2024
1982
  S = M == null ? void 0 : M.newSheetTransform, C = M == null ? void 0 : M.newTransform;
@@ -2026,40 +1984,40 @@ let dn = class extends le {
2026
1984
  }
2027
1985
  if (!S || !C)
2028
1986
  return;
2029
- const b = { unitId: t, subUnitId: r, drawingId: h, transform: C, sheetTransform: S };
2030
- d.push(b);
1987
+ const D = { unitId: n, subUnitId: r, drawingId: h, transform: C, sheetTransform: S };
1988
+ d.push(D);
2031
1989
  }), d.length === 0 && g.length === 0)
2032
1990
  return { redos: [], undos: [] };
2033
1991
  if (d.length > 0) {
2034
1992
  const h = this._sheetDrawingService.getBatchUpdateOp(d), { undo: f, redo: p, objects: m } = h;
2035
- c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.UPDATE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.UPDATE } });
1993
+ c.push({ id: A.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: P.UPDATE } }), u.push({ id: A.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: P.UPDATE } });
2036
1994
  }
2037
1995
  if (g.length > 0) {
2038
1996
  const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
2039
- c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.REMOVE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.INSERT } });
1997
+ c.push({ id: A.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: P.REMOVE } }), u.push({ id: A.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: P.INSERT } });
2040
1998
  }
2041
- return c.push({ id: L.id, params: [t] }), u.push({ id: L.id, params: [t] }), {
1999
+ return c.push({ id: L.id, params: [n] }), u.push({ id: L.id, params: [n] }), {
2042
2000
  redos: c,
2043
2001
  undos: u
2044
2002
  };
2045
2003
  }
2046
- _moveColInterceptor(i, n) {
2047
- const e = this._getUnitIdAndSubUnitId(i, n);
2004
+ _moveColInterceptor(i, t) {
2005
+ const e = this._getUnitIdAndSubUnitId(i, t);
2048
2006
  if (e == null)
2049
2007
  return { redos: [], undos: [] };
2050
- const { unitId: t, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, c = [], u = [], l = this._sheetDrawingService.getDrawingData(t, r), d = [], g = [];
2008
+ const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, c = [], u = [], l = this._sheetDrawingService.getDrawingData(n, r), d = [], g = [];
2051
2009
  if (Object.keys(l).forEach((h) => {
2052
2010
  const f = l[h], { sheetTransform: p, transform: m, anchorType: w = U.Position } = f;
2053
2011
  if (p == null || m == null)
2054
2012
  return;
2055
2013
  let S, C;
2056
- if (n === "insert") {
2014
+ if (t === "insert") {
2057
2015
  const v = this._expandCol(p, m, o, a, w);
2058
2016
  S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
2059
2017
  } else {
2060
- const { from: v, to: D } = p, { column: _ } = v, { column: T } = D;
2061
- if (w === U.Both && _ >= o && T <= a)
2062
- g.push({ unitId: t, subUnitId: r, drawingId: h });
2018
+ const { from: v, to: b } = p, { column: _ } = v, { column: E } = b;
2019
+ if (w === U.Both && _ >= o && E <= a)
2020
+ g.push({ unitId: n, subUnitId: r, drawingId: h });
2063
2021
  else {
2064
2022
  const M = this._shrinkCol(p, m, o, a, w);
2065
2023
  S = M == null ? void 0 : M.newSheetTransform, C = M == null ? void 0 : M.newTransform;
@@ -2067,87 +2025,87 @@ let dn = class extends le {
2067
2025
  }
2068
2026
  if (!S || !C)
2069
2027
  return;
2070
- const b = { unitId: t, subUnitId: r, drawingId: h, transform: C, sheetTransform: S };
2071
- d.push(b);
2028
+ const D = { unitId: n, subUnitId: r, drawingId: h, transform: C, sheetTransform: S };
2029
+ d.push(D);
2072
2030
  }), d.length === 0 && g.length === 0)
2073
2031
  return { redos: [], undos: [] };
2074
2032
  if (d.length > 0) {
2075
2033
  const h = this._sheetDrawingService.getBatchUpdateOp(d), { undo: f, redo: p, objects: m } = h;
2076
- c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.UPDATE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.UPDATE } });
2034
+ c.push({ id: A.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: P.UPDATE } }), u.push({ id: A.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: P.UPDATE } });
2077
2035
  }
2078
2036
  if (g.length > 0) {
2079
2037
  const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
2080
- c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.REMOVE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.INSERT } });
2038
+ c.push({ id: A.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: P.REMOVE } }), u.push({ id: A.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: P.INSERT } });
2081
2039
  }
2082
- return c.push({ id: L.id, params: [t] }), u.push({ id: L.id, params: [t] }), { redos: c, undos: u };
2040
+ return c.push({ id: L.id, params: [n] }), u.push({ id: L.id, params: [n] }), { redos: c, undos: u };
2083
2041
  }
2084
- _expandCol(i, n, e, t, r = U.Position) {
2085
- const s = t - e + 1, { from: o, to: a } = i, { column: c } = o, { column: u } = a;
2042
+ _expandCol(i, t, e, n, r = U.Position) {
2043
+ const s = n - e + 1, { from: o, to: a } = i, { column: c } = o, { column: u } = a;
2086
2044
  if (r === U.None)
2087
2045
  return {
2088
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2089
- newTransform: n
2046
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2047
+ newTransform: t
2090
2048
  };
2091
2049
  let l = null, d = null;
2092
2050
  if (c >= e) {
2093
- const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: t, startRow: o.row, endRow: a.row });
2051
+ const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
2094
2052
  if (g == null)
2095
2053
  return;
2096
- d = { ...n, left: (n.left || 0) + g.endX - g.startX }, l = $(d, this._selectionRenderService);
2097
- } else if (u >= t)
2054
+ d = { ...t, left: (t.left || 0) + g.endX - g.startX }, l = x(d, this._selectionRenderService);
2055
+ } else if (u >= n)
2098
2056
  if (r === U.Both)
2099
2057
  l = {
2100
2058
  from: { ...o },
2101
2059
  to: { ...a, column: u + s }
2102
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2060
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2103
2061
  else
2104
2062
  return {
2105
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2106
- newTransform: n
2063
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2064
+ newTransform: t
2107
2065
  };
2108
2066
  return l != null && d != null ? {
2109
2067
  newSheetTransform: l,
2110
2068
  newTransform: d
2111
2069
  } : null;
2112
2070
  }
2113
- _shrinkCol(i, n, e, t, r = U.Position) {
2114
- const s = t - e + 1, { from: o, to: a } = i, { column: c } = o, { column: u } = a;
2071
+ _shrinkCol(i, t, e, n, r = U.Position) {
2072
+ const s = n - e + 1, { from: o, to: a } = i, { column: c } = o, { column: u } = a;
2115
2073
  if (r === U.None)
2116
2074
  return {
2117
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2118
- newTransform: n
2075
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2076
+ newTransform: t
2119
2077
  };
2120
2078
  let l = null, d = null;
2121
- if (c > t)
2079
+ if (c > n)
2122
2080
  l = {
2123
2081
  from: { ...o, column: c - s },
2124
2082
  to: { ...a, column: u - s }
2125
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2083
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2126
2084
  else {
2127
- if (c >= e && u <= t)
2085
+ if (c >= e && u <= n)
2128
2086
  return null;
2129
- if (c < e && u > t)
2087
+ if (c < e && u > n)
2130
2088
  if (r === U.Both)
2131
2089
  l = {
2132
2090
  from: { ...o },
2133
2091
  to: { ...a, column: u - s }
2134
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2092
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2135
2093
  else
2136
2094
  return {
2137
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2138
- newTransform: n
2095
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2096
+ newTransform: t
2139
2097
  };
2140
- else if (c >= e && c <= t) {
2098
+ else if (c >= e && c <= n) {
2141
2099
  if (c === e)
2142
- d = { ...n, left: (n.left || 0) - i.from.columnOffset };
2100
+ d = { ...t, left: (t.left || 0) - i.from.columnOffset };
2143
2101
  else {
2144
2102
  const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: c - 1, startRow: o.row, endRow: a.row });
2145
2103
  if (g == null)
2146
2104
  return;
2147
- d = { ...n, left: (n.left || 0) - g.endX + g.startX - i.from.columnOffset };
2105
+ d = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
2148
2106
  }
2149
- l = $(d, this._selectionRenderService);
2150
- } else if (u >= e && u <= t && r === U.Both) {
2107
+ l = x(d, this._selectionRenderService);
2108
+ } else if (u >= e && u <= n && r === U.Both) {
2151
2109
  const g = this._skeletonManagerService.attachRangeWithCoord({
2152
2110
  startColumn: e - 1,
2153
2111
  endColumn: e - 1,
@@ -2159,7 +2117,7 @@ let dn = class extends le {
2159
2117
  l = {
2160
2118
  from: { ...o },
2161
2119
  to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
2162
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2120
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2163
2121
  }
2164
2122
  }
2165
2123
  return l != null && d != null ? {
@@ -2167,20 +2125,20 @@ let dn = class extends le {
2167
2125
  newTransform: d
2168
2126
  } : null;
2169
2127
  }
2170
- _expandRow(i, n, e, t, r = U.Position) {
2171
- const s = t - e + 1, { from: o, to: a } = i, { row: c } = o, { row: u } = a;
2128
+ _expandRow(i, t, e, n, r = U.Position) {
2129
+ const s = n - e + 1, { from: o, to: a } = i, { row: c } = o, { row: u } = a;
2172
2130
  if (r === U.None)
2173
2131
  return {
2174
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2175
- newTransform: n
2132
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2133
+ newTransform: t
2176
2134
  };
2177
2135
  let l = null, d = null;
2178
2136
  if (c >= e) {
2179
- const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: t, startColumn: o.column, endColumn: a.column });
2137
+ const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
2180
2138
  if (g == null)
2181
2139
  return;
2182
- d = { ...n, top: (n.top || 0) + g.endY - g.startY }, l = $(d, this._selectionRenderService);
2183
- } else if (u >= t)
2140
+ d = { ...t, top: (t.top || 0) + g.endY - g.startY }, l = x(d, this._selectionRenderService);
2141
+ } else if (u >= n)
2184
2142
  if (r === U.Both)
2185
2143
  l = {
2186
2144
  from: { ...o },
@@ -2188,62 +2146,62 @@ let dn = class extends le {
2188
2146
  ...a,
2189
2147
  row: u + s
2190
2148
  }
2191
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2149
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2192
2150
  else
2193
2151
  return {
2194
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2195
- newTransform: n
2152
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2153
+ newTransform: t
2196
2154
  };
2197
2155
  return l != null && d != null ? {
2198
2156
  newSheetTransform: l,
2199
2157
  newTransform: d
2200
2158
  } : null;
2201
2159
  }
2202
- _shrinkRow(i, n, e, t, r = U.Position) {
2203
- const s = t - e + 1, { from: o, to: a } = i, { row: c } = o, { row: u } = a;
2160
+ _shrinkRow(i, t, e, n, r = U.Position) {
2161
+ const s = n - e + 1, { from: o, to: a } = i, { row: c } = o, { row: u } = a;
2204
2162
  if (r === U.None)
2205
2163
  return {
2206
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2207
- newTransform: n
2164
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2165
+ newTransform: t
2208
2166
  };
2209
2167
  let l = null, d = null;
2210
- if (c > t)
2168
+ if (c > n)
2211
2169
  l = {
2212
2170
  from: { ...o, row: c - s },
2213
2171
  to: { ...a, row: u - s }
2214
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2172
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2215
2173
  else {
2216
- if (c >= e && u <= t)
2174
+ if (c >= e && u <= n)
2217
2175
  return null;
2218
- if (c < e && u > t)
2176
+ if (c < e && u > n)
2219
2177
  if (r === U.Both)
2220
2178
  l = {
2221
2179
  from: { ...o },
2222
2180
  to: { ...a, row: u - s }
2223
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2181
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2224
2182
  else
2225
2183
  return {
2226
- newSheetTransform: $({ ...n }, this._selectionRenderService),
2227
- newTransform: n
2184
+ newSheetTransform: x({ ...t }, this._selectionRenderService),
2185
+ newTransform: t
2228
2186
  };
2229
- else if (c >= e && c <= t) {
2187
+ else if (c >= e && c <= n) {
2230
2188
  if (c === e)
2231
- d = { ...n, top: (n.top || 0) - i.from.rowOffset };
2189
+ d = { ...t, top: (t.top || 0) - i.from.rowOffset };
2232
2190
  else {
2233
2191
  const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: c - 1, startColumn: o.column, endColumn: a.column });
2234
2192
  if (g == null)
2235
2193
  return;
2236
- d = { ...n, top: (n.top || 0) - g.endY + g.startY - i.from.rowOffset };
2194
+ d = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
2237
2195
  }
2238
- l = $(d, this._selectionRenderService);
2239
- } else if (u >= e && u <= t && r === U.Both) {
2196
+ l = x(d, this._selectionRenderService);
2197
+ } else if (u >= e && u <= n && r === U.Both) {
2240
2198
  const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
2241
2199
  if (g == null)
2242
2200
  return;
2243
2201
  l = {
2244
2202
  from: { ...o },
2245
2203
  to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
2246
- }, d = z(l, this._selectionRenderService, this._skeletonManagerService);
2204
+ }, d = H(l, this._selectionRenderService, this._skeletonManagerService);
2247
2205
  }
2248
2206
  }
2249
2207
  return l != null && d != null ? {
@@ -2257,17 +2215,17 @@ let dn = class extends le {
2257
2215
  // but the skeleton changes like other render modules. These two signals are not equivalent.
2258
2216
  // As a temp solution, I subscribed to activate$ here.
2259
2217
  this._commandService.onCommandExecuted((i) => {
2260
- if (i.id === ts.id) {
2261
- const { unitId: n, subUnitId: e } = i.params;
2262
- this._updateDrawings(n, e);
2218
+ if (i.id === Ki.id) {
2219
+ const { unitId: t, subUnitId: e } = i.params;
2220
+ this._updateDrawings(t, e);
2263
2221
  }
2264
2222
  })
2265
2223
  ), this.disposeWithMe(
2266
2224
  this._context.activated$.subscribe((i) => {
2267
- const { unit: n, unitId: e } = this._context;
2225
+ const { unit: t, unitId: e } = this._context;
2268
2226
  if (i) {
2269
- const t = n.getActiveSheet().getSheetId();
2270
- this._updateDrawings(e, t);
2227
+ const n = t.getActiveSheet().getSheetId();
2228
+ this._updateDrawings(e, n);
2271
2229
  } else
2272
2230
  this._clearDrawings(e);
2273
2231
  })
@@ -2275,60 +2233,60 @@ let dn = class extends le {
2275
2233
  }
2276
2234
  _clearDrawings(i) {
2277
2235
  setTimeout(() => {
2278
- const n = this._drawingManagerService.drawingManagerData, e = [];
2279
- Object.keys(n).forEach((t) => {
2280
- const r = n[t];
2236
+ const t = this._drawingManagerService.drawingManagerData, e = [];
2237
+ Object.keys(t).forEach((n) => {
2238
+ const r = t[n];
2281
2239
  r != null && Object.keys(r).forEach((s) => {
2282
2240
  const o = r[s].data;
2283
2241
  o != null && Object.keys(o).forEach((a) => {
2284
- t === i && e.push(o[a]);
2242
+ n === i && e.push(o[a]);
2285
2243
  });
2286
2244
  });
2287
2245
  }), this._drawingManagerService.removeNotification(e);
2288
2246
  });
2289
2247
  }
2290
- _updateDrawings(i, n) {
2248
+ _updateDrawings(i, t) {
2291
2249
  setTimeout(() => {
2292
- const e = this._drawingManagerService.drawingManagerData, t = [], r = [];
2250
+ const e = this._drawingManagerService.drawingManagerData, n = [], r = [];
2293
2251
  Object.keys(e).forEach((s) => {
2294
2252
  const o = e[s];
2295
2253
  o != null && Object.keys(o).forEach((a) => {
2296
2254
  const c = o[a].data;
2297
2255
  c != null && Object.keys(c).forEach((u) => {
2298
- if (s === i && a === n) {
2256
+ if (s === i && a === t) {
2299
2257
  const l = c[u];
2300
- l.transform = z(l.sheetTransform, this._selectionRenderService, this._skeletonManagerService), t.push(c[u]);
2258
+ l.transform = H(l.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(c[u]);
2301
2259
  } else
2302
2260
  r.push(c[u]);
2303
2261
  });
2304
2262
  });
2305
- }), this._drawingManagerService.removeNotification(r), this._drawingManagerService.addNotification(t);
2263
+ }), this._drawingManagerService.removeNotification(r), this._drawingManagerService.addNotification(n);
2306
2264
  }, 0);
2307
2265
  }
2308
2266
  _sheetRefreshListener() {
2309
2267
  this.disposeWithMe(
2310
2268
  this._commandService.onCommandExecuted((i) => {
2311
- Fs.includes(i.id) && requestIdleCallback(() => {
2312
- const n = i.params, { unitId: e, subUnitId: t, ranges: r } = n;
2313
- this._refreshDrawingTransform(e, t, r);
2269
+ Ws.includes(i.id) && requestIdleCallback(() => {
2270
+ const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
2271
+ this._refreshDrawingTransform(e, n, r);
2314
2272
  });
2315
2273
  })
2316
2274
  );
2317
2275
  }
2318
- _refreshDrawingTransform(i, n, e) {
2319
- const t = this._drawingManagerService.getDrawingData(i, n), r = [];
2320
- Object.keys(t).forEach((s) => {
2321
- const o = t[s], { sheetTransform: a, transform: c, anchorType: u = U.Position } = o;
2276
+ _refreshDrawingTransform(i, t, e) {
2277
+ const n = this._drawingManagerService.getDrawingData(i, t), r = [];
2278
+ Object.keys(n).forEach((s) => {
2279
+ const o = n[s], { sheetTransform: a, transform: c, anchorType: u = U.Position } = o;
2322
2280
  if (u === U.None)
2323
2281
  return !0;
2324
2282
  const { from: l, to: d } = a, { row: g, column: h } = l, { row: f, column: p } = d;
2325
2283
  for (let m = 0; m < e.length; m++) {
2326
- const w = e[m], { startRow: S, endRow: C, startColumn: b, endColumn: v } = w;
2327
- if (zr.intersects(
2284
+ const w = e[m], { startRow: S, endRow: C, startColumn: D, endColumn: v } = w;
2285
+ if (Gr.intersects(
2328
2286
  {
2329
2287
  startRow: S,
2330
2288
  endRow: C,
2331
- startColumn: b,
2289
+ startColumn: D,
2332
2290
  endColumn: v
2333
2291
  },
2334
2292
  {
@@ -2338,13 +2296,13 @@ let dn = class extends le {
2338
2296
  endColumn: p
2339
2297
  }
2340
2298
  ) || g > C || h > v) {
2341
- const D = u === U.Position, _ = z(a, this._selectionRenderService, this._skeletonManagerService);
2299
+ const b = u === U.Position, _ = H(a, this._selectionRenderService, this._skeletonManagerService);
2342
2300
  r.push({
2343
2301
  ...o,
2344
2302
  transform: {
2345
2303
  ..._,
2346
- width: D ? c == null ? void 0 : c.width : _ == null ? void 0 : _.width,
2347
- height: D ? c == null ? void 0 : c.height : _ == null ? void 0 : _.height
2304
+ width: b ? c == null ? void 0 : c.width : _ == null ? void 0 : _.width,
2305
+ height: b ? c == null ? void 0 : c.height : _ == null ? void 0 : _.height
2348
2306
  }
2349
2307
  });
2350
2308
  break;
@@ -2353,78 +2311,78 @@ let dn = class extends le {
2353
2311
  }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(L.id, [i]));
2354
2312
  }
2355
2313
  };
2356
- dn = xs([
2357
- _e(1, ne),
2314
+ cn = ks([
2315
+ _e(1, te),
2358
2316
  _e(2, G),
2359
2317
  _e(3, Xe),
2360
2318
  _e(4, N(V)),
2361
2319
  _e(5, N(Ft)),
2362
- _e(6, ae),
2363
- _e(7, oe),
2364
- _e(8, Ce)
2365
- ], dn);
2366
- var se = function() {
2367
- return se = Object.assign || function(i) {
2368
- for (var n, e = 1, t = arguments.length; e < t; e++) {
2369
- n = arguments[e];
2370
- for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (i[r] = n[r]);
2320
+ _e(6, oe),
2321
+ _e(7, se),
2322
+ _e(8, Ee)
2323
+ ], cn);
2324
+ var ie = function() {
2325
+ return ie = Object.assign || function(i) {
2326
+ for (var t, e = 1, n = arguments.length; e < n; e++) {
2327
+ t = arguments[e];
2328
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);
2371
2329
  }
2372
2330
  return i;
2373
- }, se.apply(this, arguments);
2374
- }, Ys = function(i, n) {
2331
+ }, ie.apply(this, arguments);
2332
+ }, js = function(i, t) {
2375
2333
  var e = {};
2376
- for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && n.indexOf(t) < 0 && (e[t] = i[t]);
2334
+ for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
2377
2335
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
2378
- for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
2379
- n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (e[t[r]] = i[t[r]]);
2336
+ for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
2337
+ t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
2380
2338
  return e;
2381
- }, Tr = Sr(function(i, n) {
2382
- var e = i.icon, t = i.id, r = i.className, s = i.extend, o = Ys(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), c = os("_".concat(Vs()));
2383
- return Or(e, "".concat(t), { defIds: e.defIds, idSuffix: c.current }, se({ ref: n, className: a }, o), s);
2339
+ }, Mr = pr(function(i, t) {
2340
+ var e = i.icon, n = i.id, r = i.className, s = i.extend, o = js(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), c = ts("_".concat(Ls()));
2341
+ return yr(e, "".concat(n), { defIds: e.defIds, idSuffix: c.current }, ie({ ref: t, className: a }, o), s);
2384
2342
  });
2385
- function Or(i, n, e, t, r) {
2386
- return Ir(i.tag, se(se({ key: n }, Gs(i, e, r)), t), (Xs(i, e).children || []).map(function(s, o) {
2387
- return Or(s, "".concat(n, "-").concat(i.tag, "-").concat(o), e, void 0, r);
2343
+ function yr(i, t, e, n, r) {
2344
+ return wr(i.tag, ie(ie({ key: t }, xs(i, e, r)), n), ($s(i, e).children || []).map(function(s, o) {
2345
+ return yr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
2388
2346
  }));
2389
2347
  }
2390
- function Gs(i, n, e) {
2391
- var t = se({}, i.attrs);
2392
- e != null && e.colorChannel1 && t.fill === "colorChannel1" && (t.fill = e.colorChannel1), i.tag === "mask" && t.id && (t.id = t.id + n.idSuffix), Object.entries(t).forEach(function(s) {
2348
+ function xs(i, t, e) {
2349
+ var n = ie({}, i.attrs);
2350
+ e != null && e.colorChannel1 && n.fill === "colorChannel1" && (n.fill = e.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
2393
2351
  var o = s[0], a = s[1];
2394
- o === "mask" && typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
2352
+ o === "mask" && typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
2395
2353
  });
2396
- var r = n.defIds;
2397
- return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + n.idSuffix), Object.entries(t).forEach(function(s) {
2354
+ var r = t.defIds;
2355
+ return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(s) {
2398
2356
  var o = s[0], a = s[1];
2399
- typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
2400
- })), t;
2357
+ typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
2358
+ })), n;
2401
2359
  }
2402
- function Xs(i, n) {
2403
- var e, t = n.defIds;
2404
- return !t || t.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? se(se({}, i), { children: i.children.map(function(r) {
2405
- return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? se(se({}, r), { attrs: se(se({}, r.attrs), { id: r.attrs.id + n.idSuffix }) }) : r;
2360
+ function $s(i, t) {
2361
+ var e, n = t.defIds;
2362
+ return !n || n.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? ie(ie({}, i), { children: i.children.map(function(r) {
2363
+ return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? ie(ie({}, r), { attrs: ie(ie({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
2406
2364
  }) }) : i;
2407
2365
  }
2408
- function Vs() {
2366
+ function Ls() {
2409
2367
  return Math.random().toString(36).substring(2, 8);
2410
2368
  }
2411
- Tr.displayName = "UniverIcon";
2412
- var Hs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Ur = Sr(function(i, n) {
2413
- return Ir(Tr, Object.assign({}, i, {
2369
+ Mr.displayName = "UniverIcon";
2370
+ var Fs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Tr = pr(function(i, t) {
2371
+ return wr(Mr, Object.assign({}, i, {
2414
2372
  id: "add-image-single",
2415
- ref: n,
2416
- icon: Hs
2373
+ ref: t,
2374
+ icon: Fs
2417
2375
  }));
2418
2376
  });
2419
- Ur.displayName = "AddImageSingle";
2420
- const Pr = {
2377
+ Tr.displayName = "AddImageSingle";
2378
+ const Er = {
2421
2379
  id: "sheet.command.delete-drawing",
2422
- type: te.COMMAND,
2380
+ type: ee.COMMAND,
2423
2381
  handler: (i) => {
2424
- const n = i.get(G), t = i.get(ae).getFocusDrawings();
2425
- if (t.length === 0)
2382
+ const t = i.get(G), n = i.get(oe).getFocusDrawings();
2383
+ if (n.length === 0)
2426
2384
  return !1;
2427
- const r = t[0].unitId, s = t.map((o) => {
2385
+ const r = n[0].unitId, s = n.map((o) => {
2428
2386
  const { unitId: a, subUnitId: c, drawingId: u, drawingType: l } = o;
2429
2387
  return {
2430
2388
  unitId: a,
@@ -2433,16 +2391,16 @@ const Pr = {
2433
2391
  drawingType: l
2434
2392
  };
2435
2393
  });
2436
- return n.executeCommand(nt.id, {
2394
+ return t.executeCommand(nt.id, {
2437
2395
  unitId: r,
2438
2396
  drawings: s
2439
2397
  });
2440
2398
  }
2441
2399
  }, rt = {
2442
2400
  id: "sheet.command.move-drawing",
2443
- type: te.COMMAND,
2444
- handler: (i, n) => {
2445
- const e = i.get(G), t = i.get(ae), r = i.get(Xe), { direction: s } = n, o = t.getFocusDrawings();
2401
+ type: ee.COMMAND,
2402
+ handler: (i, t) => {
2403
+ const e = i.get(G), n = i.get(oe), r = i.get(Xe), { direction: s } = t, o = n.getFocusDrawings();
2446
2404
  if (o.length === 0)
2447
2405
  return !1;
2448
2406
  const a = o[0].unitId, c = o.map((l) => {
@@ -2453,7 +2411,7 @@ const Pr = {
2453
2411
  return s === Ie.UP ? g.top = f - 1 : s === Ie.DOWN ? g.top = f + 1 : s === Ie.LEFT ? g.left = h - 1 : s === Ie.RIGHT && (g.left = h + 1), {
2454
2412
  ...l,
2455
2413
  transform: g,
2456
- sheetTransform: $(g, r)
2414
+ sheetTransform: x(g, r)
2457
2415
  };
2458
2416
  }).filter((l) => l != null);
2459
2417
  return e.syncExecuteCommand(Gt.id, {
@@ -2461,142 +2419,142 @@ const Pr = {
2461
2419
  drawings: c
2462
2420
  }) ? (e.syncExecuteCommand(L.id, [a]), !0) : !1;
2463
2421
  }
2464
- }, Ar = "addition-and-subtraction-single", Nr = "sheet.menu.image";
2465
- function zs(i) {
2422
+ }, Or = "addition-and-subtraction-single", Ur = "sheet.menu.image";
2423
+ function Ys(i) {
2466
2424
  return {
2467
- id: Nr,
2468
- type: un.SUBITEMS,
2469
- icon: Ar,
2425
+ id: Ur,
2426
+ type: ln.SUBITEMS,
2427
+ icon: Or,
2470
2428
  tooltip: "sheetImage.title",
2471
- hidden$: ln(i, F.UNIVER_SHEET),
2472
- disabled$: Ti(i, { workbookTypes: [en], worksheetTypes: [tn], rangeTypes: [ns] })
2429
+ hidden$: dn(i, F.UNIVER_SHEET),
2430
+ disabled$: Ri(i, { workbookTypes: [en], worksheetTypes: [tn], rangeTypes: [Zi] })
2473
2431
  };
2474
2432
  }
2475
- function Ks(i) {
2433
+ function Gs(i) {
2476
2434
  return {
2477
2435
  id: Xt.id,
2478
2436
  title: "sheetImage.upload.float",
2479
- type: un.BUTTON,
2480
- hidden$: ln(i, F.UNIVER_SHEET)
2437
+ type: ln.BUTTON,
2438
+ hidden$: dn(i, F.UNIVER_SHEET)
2481
2439
  };
2482
2440
  }
2483
- function Zs(i) {
2441
+ function Xs(i) {
2484
2442
  return {
2485
- id: fn.id,
2443
+ id: gn.id,
2486
2444
  title: "sheetImage.upload.cell",
2487
- type: un.BUTTON,
2488
- hidden$: ln(i, F.UNIVER_SHEET)
2445
+ type: ln.BUTTON,
2446
+ hidden$: dn(i, F.UNIVER_SHEET)
2489
2447
  };
2490
2448
  }
2491
- const Js = "univer-image-common-panel", qs = "univer-image-common-panel-grid", Qs = "univer-image-common-panel-border", eo = "univer-image-common-panel-title", to = "univer-image-common-panel-row", no = "univer-image-common-panel-column", ve = {
2492
- imageCommonPanel: Js,
2493
- imageCommonPanelGrid: qs,
2494
- imageCommonPanelBorder: Qs,
2495
- imageCommonPanelTitle: eo,
2496
- imageCommonPanelRow: to,
2497
- imageCommonPanelColumn: no
2498
- }, ro = (i) => {
2449
+ const Vs = "univer-image-common-panel", Hs = "univer-image-common-panel-grid", zs = "univer-image-common-panel-border", Ks = "univer-image-common-panel-title", Zs = "univer-image-common-panel-row", Js = "univer-image-common-panel-column", ve = {
2450
+ imageCommonPanel: Vs,
2451
+ imageCommonPanelGrid: Hs,
2452
+ imageCommonPanelBorder: zs,
2453
+ imageCommonPanelTitle: Ks,
2454
+ imageCommonPanelRow: Zs,
2455
+ imageCommonPanelColumn: Js
2456
+ }, qs = (i) => {
2499
2457
  var C;
2500
- const n = Te(G), e = Te(xt), t = Te(oe), r = Te(ne), { drawings: s } = i, o = s[0];
2458
+ const t = ye(G), e = ye($t), n = ye(se), r = ye(te), { drawings: s } = i, o = s[0];
2501
2459
  if (o == null)
2502
2460
  return;
2503
2461
  const { unitId: a } = o, c = r.getRenderById(a), u = c == null ? void 0 : c.scene;
2504
2462
  if (u == null)
2505
2463
  return;
2506
2464
  const l = u.getTransformerByCreate(), [d, g] = sn(!0), h = (C = o.anchorType) != null ? C : U.Position, [f, p] = sn(h);
2507
- function m(b, v) {
2508
- const D = [];
2509
- return b.forEach((_) => {
2510
- const { oKey: T } = _, M = v.getDrawingOKey(T);
2465
+ function m(D, v) {
2466
+ const b = [];
2467
+ return D.forEach((_) => {
2468
+ const { oKey: E } = _, M = v.getDrawingOKey(E);
2511
2469
  if (M == null)
2512
- return D.push(null), !0;
2513
- const { unitId: y, subUnitId: E, drawingId: I, drawingType: R, anchorType: O, sheetTransform: B } = M;
2514
- D.push({
2470
+ return b.push(null), !0;
2471
+ const { unitId: y, subUnitId: T, drawingId: I, drawingType: R, anchorType: O, sheetTransform: B } = M;
2472
+ b.push({
2515
2473
  unitId: y,
2516
- subUnitId: E,
2474
+ subUnitId: T,
2517
2475
  drawingId: I,
2518
2476
  anchorType: O,
2519
2477
  sheetTransform: B,
2520
2478
  drawingType: R
2521
2479
  });
2522
- }), D;
2480
+ }), b;
2523
2481
  }
2524
- gn(() => {
2525
- const b = l.clearControl$.subscribe((D) => {
2526
- D === !0 && g(!1);
2527
- }), v = l.changeStart$.subscribe((D) => {
2482
+ hn(() => {
2483
+ const D = l.clearControl$.subscribe((b) => {
2484
+ b === !0 && g(!1);
2485
+ }), v = l.changeStart$.subscribe((b) => {
2528
2486
  var M;
2529
- const { objects: _ } = D, T = m(_, t);
2530
- if (T.length === 0)
2487
+ const { objects: _ } = b, E = m(_, n);
2488
+ if (E.length === 0)
2531
2489
  g(!1);
2532
- else if (T.length >= 1) {
2490
+ else if (E.length >= 1) {
2533
2491
  g(!0);
2534
- const y = ((M = T[0]) == null ? void 0 : M.anchorType) || U.Position;
2492
+ const y = ((M = E[0]) == null ? void 0 : M.anchorType) || U.Position;
2535
2493
  p(y);
2536
2494
  }
2537
2495
  });
2538
2496
  return () => {
2539
- v.unsubscribe(), b.unsubscribe();
2497
+ v.unsubscribe(), D.unsubscribe();
2540
2498
  };
2541
2499
  }, []);
2542
- function w(b) {
2543
- p(b);
2544
- const v = t.getFocusDrawings();
2500
+ function w(D) {
2501
+ p(D);
2502
+ const v = n.getFocusDrawings();
2545
2503
  if (v.length === 0)
2546
2504
  return;
2547
- const D = v.map((_) => ({
2505
+ const b = v.map((_) => ({
2548
2506
  unitId: _.unitId,
2549
2507
  subUnitId: _.subUnitId,
2550
2508
  drawingId: _.drawingId,
2551
- anchorType: b
2509
+ anchorType: D
2552
2510
  }));
2553
- n.executeCommand(Gt.id, {
2511
+ t.executeCommand(Gt.id, {
2554
2512
  unitId: v[0].unitId,
2555
- drawings: D
2513
+ drawings: b
2556
2514
  });
2557
2515
  }
2558
- const S = (b) => b ? "block" : "none";
2559
- return /* @__PURE__ */ Tt("div", { className: It(ve.imageCommonPanelGrid, ve.imageCommonPanelBorder), style: { display: S(d) }, children: [
2560
- /* @__PURE__ */ ee("div", { className: ve.imageCommonPanelRow, children: /* @__PURE__ */ ee("div", { className: It(ve.imageCommonPanelColumn, ve.imageCommonPanelTitle), children: /* @__PURE__ */ ee("div", { children: e.t("drawing-anchor.title") }) }) }),
2561
- /* @__PURE__ */ ee("div", { className: It(ve.imageCommonPanelRow), children: /* @__PURE__ */ ee("div", { className: It(ve.imageCommonPanelColumn), children: /* @__PURE__ */ Tt(cs, { value: f, onChange: w, direction: "vertical", children: [
2562
- /* @__PURE__ */ ee(qt, { value: U.Both, children: e.t("drawing-anchor.both") }),
2563
- /* @__PURE__ */ ee(qt, { value: U.Position, children: e.t("drawing-anchor.position") }),
2564
- /* @__PURE__ */ ee(qt, { value: U.None, children: e.t("drawing-anchor.none") })
2516
+ const S = (D) => D ? "block" : "none";
2517
+ return /* @__PURE__ */ Et("div", { className: It(ve.imageCommonPanelGrid, ve.imageCommonPanelBorder), style: { display: S(d) }, children: [
2518
+ /* @__PURE__ */ Q("div", { className: ve.imageCommonPanelRow, children: /* @__PURE__ */ Q("div", { className: It(ve.imageCommonPanelColumn, ve.imageCommonPanelTitle), children: /* @__PURE__ */ Q("div", { children: e.t("drawing-anchor.title") }) }) }),
2519
+ /* @__PURE__ */ Q("div", { className: It(ve.imageCommonPanelRow), children: /* @__PURE__ */ Q("div", { className: It(ve.imageCommonPanelColumn), children: /* @__PURE__ */ Et(rs, { value: f, onChange: w, direction: "vertical", children: [
2520
+ /* @__PURE__ */ Q(qt, { value: U.Both, children: e.t("drawing-anchor.both") }),
2521
+ /* @__PURE__ */ Q(qt, { value: U.Position, children: e.t("drawing-anchor.position") }),
2522
+ /* @__PURE__ */ Q(qt, { value: U.None, children: e.t("drawing-anchor.none") })
2565
2523
  ] }) }) })
2566
2524
  ] });
2567
- }, io = () => {
2568
- const i = Te(oe), n = i.getFocusDrawings(), [e, t] = sn(n);
2569
- return gn(() => {
2525
+ }, Qs = () => {
2526
+ const i = ye(se), t = i.getFocusDrawings(), [e, n] = sn(t);
2527
+ return hn(() => {
2570
2528
  const r = i.focus$.subscribe((s) => {
2571
- t(s);
2529
+ n(s);
2572
2530
  });
2573
2531
  return () => {
2574
2532
  r.unsubscribe();
2575
2533
  };
2576
- }, []), !!(e != null && e.length) && /* @__PURE__ */ Tt("div", { className: ve.imageCommonPanel, children: [
2577
- /* @__PURE__ */ ee(fi, { drawings: e }),
2578
- /* @__PURE__ */ ee(ro, { drawings: e })
2534
+ }, []), !!(e != null && e.length) && /* @__PURE__ */ Et("div", { className: ve.imageCommonPanel, children: [
2535
+ /* @__PURE__ */ Q(li, { drawings: e }),
2536
+ /* @__PURE__ */ Q(qs, { drawings: e })
2579
2537
  ] });
2580
- }, so = {
2581
- [ji.FORMULAS_INSERT]: {
2582
- [Nr]: {
2538
+ }, eo = {
2539
+ [Ni.FORMULAS_INSERT]: {
2540
+ [Ur]: {
2583
2541
  order: 3,
2584
- menuItemFactory: zs,
2542
+ menuItemFactory: Ys,
2585
2543
  [Xt.id]: {
2586
2544
  order: 0,
2587
- menuItemFactory: Ks
2545
+ menuItemFactory: Gs
2588
2546
  },
2589
- [fn.id]: {
2547
+ [gn.id]: {
2590
2548
  order: 1,
2591
- menuItemFactory: Zs
2549
+ menuItemFactory: Xs
2592
2550
  }
2593
2551
  }
2594
2552
  }
2595
2553
  };
2596
2554
  function it(i) {
2597
- return !i.getContextValue(Kr) && !i.getContextValue(Zr) && !i.getContextValue(Jr) && i.getContextValue(Fe);
2555
+ return !i.getContextValue(Xr) && !i.getContextValue(Vr) && !i.getContextValue(Hr) && i.getContextValue(Fe);
2598
2556
  }
2599
- const oo = {
2557
+ const to = {
2600
2558
  id: rt.id,
2601
2559
  description: "shortcut.sheet.drawing-move-down",
2602
2560
  group: "4_sheet-drawing-view",
@@ -2606,7 +2564,7 @@ const oo = {
2606
2564
  staticParameters: {
2607
2565
  direction: Ie.DOWN
2608
2566
  }
2609
- }, ao = {
2567
+ }, no = {
2610
2568
  id: rt.id,
2611
2569
  description: "shortcut.sheet.drawing-move-up",
2612
2570
  group: "4_sheet-drawing-view",
@@ -2616,7 +2574,7 @@ const oo = {
2616
2574
  staticParameters: {
2617
2575
  direction: Ie.UP
2618
2576
  }
2619
- }, co = {
2577
+ }, ro = {
2620
2578
  id: rt.id,
2621
2579
  description: "shortcut.sheet.drawing-move-left",
2622
2580
  group: "4_sheet-drawing-view",
@@ -2626,7 +2584,7 @@ const oo = {
2626
2584
  staticParameters: {
2627
2585
  direction: Ie.LEFT
2628
2586
  }
2629
- }, lo = {
2587
+ }, io = {
2630
2588
  id: rt.id,
2631
2589
  description: "shortcut.sheet.drawing-move-right",
2632
2590
  group: "4_sheet-drawing-view",
@@ -2636,8 +2594,8 @@ const oo = {
2636
2594
  staticParameters: {
2637
2595
  direction: Ie.RIGHT
2638
2596
  }
2639
- }, uo = {
2640
- id: Pr.id,
2597
+ }, so = {
2598
+ id: Er.id,
2641
2599
  description: "shortcut.sheet.drawing-delete",
2642
2600
  group: "4_sheet-drawing-view",
2643
2601
  // when focusing on any other input tag do not trigger this shortcut
@@ -2645,47 +2603,47 @@ const oo = {
2645
2603
  binding: Ye.DELETE,
2646
2604
  mac: Ye.BACKSPACE
2647
2605
  };
2648
- var ho = Object.getOwnPropertyDescriptor, go = (i, n, e, t) => {
2649
- for (var r = t > 1 ? void 0 : t ? ho(n, e) : n, s = i.length - 1, o; s >= 0; s--)
2606
+ var oo = Object.getOwnPropertyDescriptor, ao = (i, t, e, n) => {
2607
+ for (var r = n > 1 ? void 0 : n ? oo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2650
2608
  (o = i[s]) && (r = o(r) || r);
2651
2609
  return r;
2652
- }, xe = (i, n) => (e, t) => n(e, t, i);
2610
+ }, $e = (i, t) => (e, n) => t(e, n, i);
2653
2611
  let Wt = class extends le {
2654
- constructor(i, n, e, t, r, s) {
2655
- super(), this._componentManager = i, this._menuManagerService = n, this._commandService = e, this._shortcutService = t, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
2612
+ constructor(i, t, e, n, r, s) {
2613
+ super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
2656
2614
  }
2657
2615
  _initCustomComponents() {
2658
2616
  const i = this._componentManager;
2659
- this.disposeWithMe(i.register(Ar, Ur)), this.disposeWithMe(i.register(Cr, io));
2617
+ this.disposeWithMe(i.register(Or, Tr)), this.disposeWithMe(i.register(_r, Qs));
2660
2618
  }
2661
2619
  _initMenus() {
2662
- this._menuManagerService.mergeMenu(so);
2620
+ this._menuManagerService.mergeMenu(eo);
2663
2621
  }
2664
2622
  _initCommands() {
2665
2623
  [
2666
2624
  Xt,
2667
- fn,
2625
+ gn,
2668
2626
  Yt,
2669
2627
  nt,
2670
2628
  Gt,
2671
- br,
2629
+ vr,
2672
2630
  L,
2631
+ Sr,
2632
+ Ir,
2673
2633
  Dr,
2674
- Rr,
2675
- yr,
2676
2634
  rt,
2677
- Pr,
2678
- Mr
2635
+ Er,
2636
+ Cr
2679
2637
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2680
2638
  }
2681
2639
  _initShortcuts() {
2682
2640
  [
2683
2641
  // sheet drawing shortcuts
2684
- oo,
2685
- ao,
2686
- co,
2687
- lo,
2688
- uo
2642
+ to,
2643
+ no,
2644
+ ro,
2645
+ io,
2646
+ so
2689
2647
  ].forEach((i) => {
2690
2648
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
2691
2649
  });
@@ -2694,21 +2652,21 @@ let Wt = class extends le {
2694
2652
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
2695
2653
  }
2696
2654
  };
2697
- Wt = go([
2698
- xe(0, N($i)),
2699
- xe(1, xi),
2700
- xe(2, G),
2701
- xe(3, Li),
2702
- xe(4, oe),
2703
- xe(5, N(hn))
2655
+ Wt = ao([
2656
+ $e(0, N(ki)),
2657
+ $e(1, Bi),
2658
+ $e(2, G),
2659
+ $e(3, Wi),
2660
+ $e(4, se),
2661
+ $e(5, N(un))
2704
2662
  ], Wt);
2705
- var fo = Object.getOwnPropertyDescriptor, mo = (i, n, e, t) => {
2706
- for (var r = t > 1 ? void 0 : t ? fo(n, e) : n, s = i.length - 1, o; s >= 0; s--)
2663
+ var co = Object.getOwnPropertyDescriptor, lo = (i, t, e, n) => {
2664
+ for (var r = n > 1 ? void 0 : n ? co(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2707
2665
  (o = i[s]) && (r = o(r) || r);
2708
2666
  return r;
2709
- }, ye = (i, n) => (e, t) => n(e, t, i);
2710
- function po(i, n, e, t, r) {
2711
- const { scaleX: s, scaleY: o } = n.getAncestorScale(), a = n.getViewport(qn.VIEW_MAIN), c = t.getFreeze(), { startColumn: u, startRow: l, xSplit: d, ySplit: g } = c, h = {
2667
+ }, Re = (i, t) => (e, n) => t(e, n, i);
2668
+ function uo(i, t, e, n, r) {
2669
+ const { scaleX: s, scaleY: o } = t.getAncestorScale(), a = t.getViewport(Jn.VIEW_MAIN), c = n.getFreeze(), { startColumn: u, startRow: l, xSplit: d, ySplit: g } = c, h = {
2712
2670
  left: !0,
2713
2671
  // left means the left of pic is in a viewMainLeft
2714
2672
  top: !0
@@ -2719,42 +2677,42 @@ function po(i, n, e, t, r) {
2719
2677
  absolute: h
2720
2678
  };
2721
2679
  const { left: f, right: p, top: m, bottom: w } = i;
2722
- let { top: S, left: C, viewportScrollX: b, viewportScrollY: v } = a;
2723
- const { boundsOfViewArea: D, scrollDirectionResponse: _ } = r || {}, { rowHeaderWidth: T, columnHeaderHeight: M } = e, y = {
2680
+ let { top: S, left: C, viewportScrollX: D, viewportScrollY: v } = a;
2681
+ const { boundsOfViewArea: b, scrollDirectionResponse: _ } = r || {}, { rowHeaderWidth: E, columnHeaderHeight: M } = e, y = {
2724
2682
  top: M,
2725
- left: T
2683
+ left: E
2726
2684
  };
2727
- D && (Ee.isDefine(y.top) && (y.top = D.top), Ee.isDefine(y.left) && (y.left = D.left)), _ === "HORIZONTAL" && (v = 0), _ === "VERTICAL" && (b = 0);
2728
- let E = 0, I = 0;
2729
- const R = e.rowStartY(l - g) + M, O = e.colStartX(u - d) + T, B = e.rowStartY(l) + M, K = e.colStartX(u) + T;
2685
+ b && (Me.isDefine(y.top) && (y.top = b.top), Me.isDefine(y.left) && (y.left = b.left)), _ === "HORIZONTAL" && (v = 0), _ === "VERTICAL" && (D = 0);
2686
+ let T = 0, I = 0;
2687
+ const R = e.rowStartY(l - g) + M, O = e.colStartX(u - d) + E, B = e.rowStartY(l) + M, z = e.colStartX(u) + E;
2730
2688
  if (d === 0)
2731
- h.left = !1, E = (f - b) * s, I = (p - b) * s;
2689
+ h.left = !1, T = (f - D) * s, I = (p - D) * s;
2732
2690
  else {
2733
- const X = f - (O - T), J = p - (O - T);
2734
- p < K ? (E = X * s, I = J * s) : f <= K && p >= K ? (E = X * s, I = Math.max(C, (p - b) * s)) : f > K && (h.left = !1, E = Math.max((f - b) * s, C), I = Math.max((p - b) * s, C));
2691
+ const X = f - (O - E), Z = p - (O - E);
2692
+ p < z ? (T = X * s, I = Z * s) : f <= z && p >= z ? (T = X * s, I = Math.max(C, (p - D) * s)) : f > z && (h.left = !1, T = Math.max((f - D) * s, C), I = Math.max((p - D) * s, C));
2735
2693
  }
2736
- let Z = 0, Y = 0;
2694
+ let K = 0, Y = 0;
2737
2695
  if (g === 0)
2738
- h.top = !1, Z = (m - v) * o, Y = (w - v) * o;
2696
+ h.top = !1, K = (m - v) * o, Y = (w - v) * o;
2739
2697
  else {
2740
- const X = m - (R - M), J = w - (R - M);
2741
- w < B ? (Z = X * o, Y = J * o) : m <= B && w >= B ? (Z = X * o, Y = Math.max(S, (w - v) * o)) : m > B && (h.top = !1, Z = Math.max((m - v) * o, S), Y = Math.max((w - v) * o, S));
2698
+ const X = m - (R - M), Z = w - (R - M);
2699
+ w < B ? (K = X * o, Y = Z * o) : m <= B && w >= B ? (K = X * o, Y = Math.max(S, (w - v) * o)) : m > B && (h.top = !1, K = Math.max((m - v) * o, S), Y = Math.max((w - v) * o, S));
2742
2700
  }
2743
- return E = Math.max(E, y.left), Z = Math.max(Z, y.top), I = Math.max(I, y.left), Y = Math.max(Y, y.top), {
2744
- left: E,
2701
+ return T = Math.max(T, y.left), K = Math.max(K, y.top), I = Math.max(I, y.left), Y = Math.max(Y, y.top), {
2702
+ left: T,
2745
2703
  right: I,
2746
- top: Z,
2704
+ top: K,
2747
2705
  bottom: Y,
2748
2706
  absolute: h
2749
2707
  };
2750
2708
  }
2751
- const fe = (i, n, e, t, r) => {
2752
- const { scene: s } = n, { left: o, top: a, width: c, height: u, angle: l } = i, d = {
2709
+ const fe = (i, t, e, n, r) => {
2710
+ const { scene: s } = t, { left: o, top: a, width: c, height: u, angle: l } = i, d = {
2753
2711
  left: o,
2754
2712
  right: o + c,
2755
2713
  top: a,
2756
2714
  bottom: a + u
2757
- }, g = po(d, s, e, t, r), { scaleX: h, scaleY: f } = s.getAncestorScale();
2715
+ }, g = uo(d, s, e, n, r), { scaleX: h, scaleY: f } = s.getAncestorScale();
2758
2716
  return {
2759
2717
  startX: g.left,
2760
2718
  endX: g.right,
@@ -2767,27 +2725,27 @@ const fe = (i, n, e, t, r) => {
2767
2725
  };
2768
2726
  };
2769
2727
  let jt = class extends le {
2770
- constructor(n, e, t, r, s, o, a) {
2728
+ constructor(t, e, n, r, s, o, a) {
2771
2729
  super();
2772
2730
  /**
2773
2731
  * for update dom container position when scrolling and zoom
2774
2732
  */
2775
- Q(this, "_domLayerMap", /* @__PURE__ */ new Map());
2733
+ q(this, "_domLayerMap", /* @__PURE__ */ new Map());
2776
2734
  /**
2777
2735
  * for update dom container position when scrolling and zoom
2778
2736
  */
2779
- Q(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2780
- Q(this, "_transformChange$", new Jt());
2781
- Q(this, "transformChange$", this._transformChange$.asObservable());
2782
- Q(this, "_add$", new Jt());
2783
- Q(this, "add$", this._add$.asObservable());
2784
- Q(this, "_remove$", new Jt());
2785
- Q(this, "remove$", this._remove$.asObservable());
2786
- Q(this, "_hooks", []);
2787
- this._renderManagerService = n, this._univerInstanceService = e, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2737
+ q(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2738
+ q(this, "_transformChange$", new Jt());
2739
+ q(this, "transformChange$", this._transformChange$.asObservable());
2740
+ q(this, "_add$", new Jt());
2741
+ q(this, "add$", this._add$.asObservable());
2742
+ q(this, "_remove$", new Jt());
2743
+ q(this, "remove$", this._remove$.asObservable());
2744
+ q(this, "_hooks", []);
2745
+ this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2788
2746
  }
2789
2747
  _bindScrollEvent() {
2790
- this._lifecycleService.lifecycle$.pipe(Yi((n) => n === Qr.Rendered), Gi(1)).subscribe(() => {
2748
+ this._lifecycleService.lifecycle$.pipe(xi((t) => t === Kr.Rendered), $i(1)).subscribe(() => {
2791
2749
  this._scrollUpdateListener();
2792
2750
  });
2793
2751
  }
@@ -2796,48 +2754,48 @@ let jt = class extends le {
2796
2754
  * @param unitId
2797
2755
  * @param subUnitId
2798
2756
  */
2799
- _ensureMap(n, e) {
2800
- let t = this._domLayerMap.get(n);
2801
- t || (t = /* @__PURE__ */ new Map(), this._domLayerMap.set(n, t));
2802
- let r = t.get(e);
2803
- return r || (r = /* @__PURE__ */ new Map(), t.set(e, r)), r;
2757
+ _ensureMap(t, e) {
2758
+ let n = this._domLayerMap.get(t);
2759
+ n || (n = /* @__PURE__ */ new Map(), this._domLayerMap.set(t, n));
2760
+ let r = n.get(e);
2761
+ return r || (r = /* @__PURE__ */ new Map(), n.set(e, r)), r;
2804
2762
  }
2805
- getFloatDomInfo(n) {
2806
- return this._domLayerInfoMap.get(n);
2763
+ getFloatDomInfo(t) {
2764
+ return this._domLayerInfoMap.get(t);
2807
2765
  }
2808
- _getSceneAndTransformerByDrawingSearch(n) {
2809
- if (n == null)
2766
+ _getSceneAndTransformerByDrawingSearch(t) {
2767
+ if (t == null)
2810
2768
  return;
2811
- const e = this._renderManagerService.getRenderById(n), t = e == null ? void 0 : e.scene;
2812
- if (e == null || t == null)
2769
+ const e = this._renderManagerService.getRenderById(t), n = e == null ? void 0 : e.scene;
2770
+ if (e == null || n == null)
2813
2771
  return null;
2814
- const r = t.getTransformerByCreate(), s = e.engine.getCanvasElement();
2815
- return { scene: t, transformer: r, renderUnit: e, canvas: s };
2772
+ const r = n.getTransformerByCreate(), s = e.engine.getCanvasElement();
2773
+ return { scene: n, transformer: r, renderUnit: e, canvas: s };
2816
2774
  }
2817
- _getFloatDomProps(n) {
2775
+ _getFloatDomProps(t) {
2818
2776
  let e;
2819
- return this._hooks.forEach((t) => {
2820
- e = t.onGetFloatDomProps(n);
2777
+ return this._hooks.forEach((n) => {
2778
+ e = n.onGetFloatDomProps(t);
2821
2779
  }), e;
2822
2780
  }
2823
2781
  _drawingAddListener() {
2824
2782
  this.disposeWithMe(
2825
- this._drawingManagerService.add$.subscribe((n) => {
2826
- n.forEach((e) => {
2827
- var J, ce, q;
2828
- const { unitId: t, subUnitId: r, drawingId: s } = e, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), c = this._univerInstanceService.getUnit(t, F.UNIVER_SHEET);
2783
+ this._drawingManagerService.add$.subscribe((t) => {
2784
+ t.forEach((e) => {
2785
+ var Z, ae, J;
2786
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = de(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), c = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
2829
2787
  if (!c)
2830
2788
  return;
2831
2789
  const u = c.getActiveSheet().getSheetId();
2832
2790
  if (!a || !o)
2833
2791
  return;
2834
- const l = (J = this._renderManagerService.getRenderById(t)) == null ? void 0 : J.with(V).getSkeletonParam(r);
2792
+ const l = (Z = this._renderManagerService.getRenderById(n)) == null ? void 0 : Z.with(V).getSkeletonParam(r);
2835
2793
  if (!l)
2836
2794
  return;
2837
2795
  const { transform: d, drawingType: g, data: h } = a;
2838
- if (g !== x.DRAWING_DOM && g !== x.DRAWING_CHART)
2796
+ if (g !== $.DRAWING_DOM && g !== $.DRAWING_CHART)
2839
2797
  return;
2840
- const f = this._getSceneAndTransformerByDrawingSearch(t);
2798
+ const f = this._getSceneAndTransformerByDrawingSearch(n);
2841
2799
  if (f == null)
2842
2800
  return;
2843
2801
  const { scene: p, canvas: m } = f;
@@ -2845,29 +2803,29 @@ let jt = class extends le {
2845
2803
  return !0;
2846
2804
  if (u !== r)
2847
2805
  return;
2848
- const { left: w, top: S, width: C, height: b, angle: v, flipX: D, flipY: _, skewX: T, skewY: M } = d, y = be({ unitId: t, subUnitId: r, drawingId: s }), E = p.getObject(y);
2849
- if (E != null) {
2850
- E.transformByState({ left: w, top: S, width: C, height: b, angle: v, flipX: D, flipY: _, skewX: T, skewY: M });
2806
+ const { left: w, top: S, width: C, height: D, angle: v, flipX: b, flipY: _, skewX: E, skewY: M } = d, y = Ce({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(y);
2807
+ if (T != null) {
2808
+ T.transformByState({ left: w, top: S, width: C, height: D, angle: v, flipX: b, flipY: _, skewX: E, skewY: M });
2851
2809
  return;
2852
2810
  }
2853
2811
  const I = {
2854
2812
  left: w,
2855
2813
  top: S,
2856
2814
  width: C,
2857
- height: b,
2858
- zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
2859
- }, R = g === x.DRAWING_CHART;
2815
+ height: D,
2816
+ zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
2817
+ }, R = g === $.DRAWING_CHART;
2860
2818
  if (R) {
2861
2819
  const W = h ? h.backgroundColor : "white";
2862
2820
  I.fill = W, I.rotateEnabled = !1, h && h.border && (I.stroke = h.border), I.paintFirst = "stroke", I.strokeWidth = 1, I.borderEnabled = !1, I.radius = 8;
2863
2821
  }
2864
- const O = new $e(y, I);
2865
- R && O.setObjectType(An.CHART), p.addObject(O, Zt), a.allowTransform !== !1 && p.attachTransformerTo(O);
2866
- const B = this._ensureMap(t, r), K = new _t(), Z = fe(O, f.renderUnit, l.skeleton, o.worksheet), Y = new Ze(Z), me = {
2867
- dispose: K,
2822
+ const O = new je(y, I);
2823
+ R && O.setObjectType(Pn.CHART), p.addObject(O, Zt), a.allowTransform !== !1 && p.attachTransformerTo(O);
2824
+ const B = this._ensureMap(n, r), z = new _t(), K = fe(O, f.renderUnit, l.skeleton, o.worksheet), Y = new Ze(K), me = {
2825
+ dispose: z,
2868
2826
  rect: O,
2869
2827
  position$: Y,
2870
- unitId: t,
2828
+ unitId: n,
2871
2829
  subUnitId: r
2872
2830
  };
2873
2831
  this._canvasFloatDomService.addFloatDom({
@@ -2886,9 +2844,9 @@ let jt = class extends le {
2886
2844
  onWheel: (W) => {
2887
2845
  m.dispatchEvent(new WheelEvent(W.type, W));
2888
2846
  },
2889
- props: (q = (ce = B.get(s)) == null ? void 0 : ce.props) != null ? q : this._getFloatDomProps(s),
2847
+ props: (J = (ae = B.get(s)) == null ? void 0 : ae.props) != null ? J : this._getFloatDomProps(s),
2890
2848
  data: h,
2891
- unitId: t
2849
+ unitId: n
2892
2850
  });
2893
2851
  const X = O.onTransformChange$.subscribeEvent(() => {
2894
2852
  const W = fe(O, f.renderUnit, l.skeleton, o.worksheet);
@@ -2896,17 +2854,17 @@ let jt = class extends le {
2896
2854
  W
2897
2855
  );
2898
2856
  });
2899
- K.add(() => {
2857
+ z.add(() => {
2900
2858
  this._canvasFloatDomService.removeFloatDom(s);
2901
- }), X && K.add(X), this._domLayerInfoMap.set(s, me), B.set(s, {
2859
+ }), X && z.add(X), this._domLayerInfoMap.set(s, me), B.set(s, {
2902
2860
  ...B.get(s)
2903
2861
  });
2904
2862
  });
2905
2863
  })
2906
2864
  ), this.disposeWithMe(
2907
- this._drawingManagerService.remove$.subscribe((n) => {
2908
- n.forEach((e) => {
2909
- const { unitId: t, subUnitId: r, drawingId: s } = e, o = be({ unitId: t, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(t);
2865
+ this._drawingManagerService.remove$.subscribe((t) => {
2866
+ t.forEach((e) => {
2867
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ce({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
2910
2868
  if (a == null)
2911
2869
  return;
2912
2870
  const { transformer: c, scene: u } = a, l = u.getObject(o);
@@ -2916,9 +2874,9 @@ let jt = class extends le {
2916
2874
  );
2917
2875
  }
2918
2876
  _scrollUpdateListener() {
2919
- const n = (e, t) => {
2877
+ const t = (e, n) => {
2920
2878
  var u;
2921
- const r = this._getSceneAndTransformerByDrawingSearch(e), s = this._ensureMap(e, t), o = Array.from(s.keys()), a = H(this._univerInstanceService, { unitId: e, subUnitId: t }), c = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.with(V).getSkeletonParam(t);
2879
+ const r = this._getSceneAndTransformerByDrawingSearch(e), s = this._ensureMap(e, n), o = Array.from(s.keys()), a = de(this._univerInstanceService, { unitId: e, subUnitId: n }), c = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.with(V).getSkeletonParam(n);
2922
2880
  !r || !a || !c || o.forEach((l) => {
2923
2881
  const d = this._domLayerInfoMap.get(l);
2924
2882
  if (d) {
@@ -2929,44 +2887,44 @@ let jt = class extends le {
2929
2887
  };
2930
2888
  this.disposeWithMe(
2931
2889
  this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
2932
- Se((e) => e ? e.activeSheet$ : $n(null)),
2933
- Oe((e) => {
2890
+ Se((e) => e ? e.activeSheet$ : jn(null)),
2891
+ Te((e) => {
2934
2892
  if (!e) return null;
2935
- const t = e.getUnitId(), r = this._renderManagerService.getRenderById(t);
2936
- return r ? { render: r, unitId: t, subUnitId: e.getSheetId() } : null;
2893
+ const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
2894
+ return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
2937
2895
  }),
2938
2896
  Se(
2939
- (e) => e ? ei(e.render.scene.getViewport(qn.VIEW_MAIN).onScrollAfter$).pipe(Oe(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : $n(null)
2897
+ (e) => e ? Zr(e.render.scene.getViewport(Jn.VIEW_MAIN).onScrollAfter$).pipe(Te(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : jn(null)
2940
2898
  )
2941
2899
  ).subscribe((e) => {
2942
2900
  if (!e) return;
2943
- const { unitId: t, subUnitId: r } = e;
2944
- n(t, r);
2901
+ const { unitId: n, subUnitId: r } = e;
2902
+ t(n, r);
2945
2903
  })
2946
2904
  ), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
2947
- var t, r;
2948
- if (e.id === kn.id) {
2905
+ var n, r;
2906
+ if (e.id === Nn.id) {
2949
2907
  const s = e.params, { unitId: o } = s;
2950
- Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((c) => {
2951
- n(o, c);
2908
+ Array.from((r = (n = this._domLayerMap.get(o)) == null ? void 0 : n.keys()) != null ? r : []).forEach((c) => {
2909
+ t(o, c);
2952
2910
  });
2953
- } else if (e.id === rs.id) {
2911
+ } else if (e.id === Ji.id) {
2954
2912
  const { unitId: s, subUnitId: o } = e.params;
2955
- n(s, o);
2913
+ t(s, o);
2956
2914
  }
2957
2915
  }));
2958
2916
  }
2959
- _getPosition(n, e) {
2917
+ _getPosition(t, e) {
2960
2918
  var g;
2961
- const { startX: t, endX: r, startY: s, endY: o } = n, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Xe);
2919
+ const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Xe);
2962
2920
  if (a == null)
2963
2921
  return;
2964
- const c = a.getCellWithCoordByOffset(t, s);
2922
+ const c = a.getCellWithCoordByOffset(n, s);
2965
2923
  if (c == null)
2966
2924
  return;
2967
2925
  const u = {
2968
2926
  column: c.actualColumn,
2969
- columnOffset: t - c.startX,
2927
+ columnOffset: n - c.startX,
2970
2928
  row: c.actualRow,
2971
2929
  rowOffset: s - c.startY
2972
2930
  }, l = a.getCellWithCoordByOffset(r, o);
@@ -2985,13 +2943,13 @@ let jt = class extends le {
2985
2943
  }
2986
2944
  _featureUpdateListener() {
2987
2945
  this.disposeWithMe(
2988
- this._drawingManagerService.update$.subscribe((n) => {
2989
- n.forEach((e) => {
2990
- const t = this._drawingManagerService.getDrawingByParam(e);
2991
- if (!t || t.drawingType !== x.DRAWING_DOM && t.drawingType !== x.DRAWING_CHART)
2946
+ this._drawingManagerService.update$.subscribe((t) => {
2947
+ t.forEach((e) => {
2948
+ const n = this._drawingManagerService.getDrawingByParam(e);
2949
+ if (!n || n.drawingType !== $.DRAWING_DOM && n.drawingType !== $.DRAWING_CHART)
2992
2950
  return;
2993
2951
  const r = {
2994
- ...t.transform
2952
+ ...n.transform
2995
2953
  };
2996
2954
  this._transformChange$.next({ id: e.drawingId, value: r });
2997
2955
  });
@@ -3000,37 +2958,37 @@ let jt = class extends le {
3000
2958
  }
3001
2959
  _deleteListener() {
3002
2960
  this.disposeWithMe(
3003
- this._drawingManagerService.remove$.subscribe((n) => {
3004
- n.forEach((e) => {
2961
+ this._drawingManagerService.remove$.subscribe((t) => {
2962
+ t.forEach((e) => {
3005
2963
  this._removeDom(e.drawingId);
3006
2964
  });
3007
2965
  })
3008
2966
  );
3009
2967
  }
3010
- updateFloatDomProps(n, e, t, r) {
3011
- const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(n);
2968
+ updateFloatDomProps(t, e, n, r) {
2969
+ const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
3012
2970
  if (s && o) {
3013
- const { scene: a } = o, c = be({ unitId: n, subUnitId: e, drawingId: t }), u = a.getObject(c);
3014
- u && u instanceof $e && u.setProps(r);
2971
+ const { scene: a } = o, c = Ce({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(c);
2972
+ u && u instanceof je && u.setProps(r);
3015
2973
  }
3016
2974
  }
3017
2975
  // CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
3018
- addFloatDomToPosition(n, e) {
3019
- const t = H(this._univerInstanceService, {
3020
- unitId: n.unitId,
3021
- subUnitId: n.subUnitId
2976
+ addFloatDomToPosition(t, e) {
2977
+ const n = de(this._univerInstanceService, {
2978
+ unitId: t.unitId,
2979
+ subUnitId: t.subUnitId
3022
2980
  });
3023
- if (!t)
2981
+ if (!n)
3024
2982
  throw new Error("cannot find current target!");
3025
- const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: a, data: c, allowTransform: u = !0 } = n, l = e != null ? e : Et(), d = this._getPosition(o, r);
2983
+ const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: c, allowTransform: u = !0 } = t, l = e != null ? e : Tt(), d = this._getPosition(o, r);
3026
2984
  if (d == null)
3027
2985
  return;
3028
- this._ensureMap(r, s).set(l, n);
2986
+ this._ensureMap(r, s).set(l, t);
3029
2987
  const h = {
3030
2988
  unitId: r,
3031
2989
  subUnitId: s,
3032
2990
  drawingId: l,
3033
- drawingType: n.type || x.DRAWING_DOM,
2991
+ drawingType: t.type || $.DRAWING_DOM,
3034
2992
  componentKey: a,
3035
2993
  sheetTransform: d,
3036
2994
  transform: {
@@ -3052,34 +3010,34 @@ let jt = class extends le {
3052
3010
  }
3053
3011
  };
3054
3012
  }
3055
- _removeDom(n, e = !1) {
3056
- const t = this._domLayerInfoMap.get(n);
3057
- if (!t)
3013
+ _removeDom(t, e = !1) {
3014
+ const n = this._domLayerInfoMap.get(t);
3015
+ if (!n)
3058
3016
  return;
3059
- const { unitId: r, subUnitId: s } = t;
3060
- this._domLayerInfoMap.delete(n), t.dispose.dispose();
3017
+ const { unitId: r, subUnitId: s } = n;
3018
+ this._domLayerInfoMap.delete(t), n.dispose.dispose();
3061
3019
  const o = this._getSceneAndTransformerByDrawingSearch(r);
3062
- if (o && o.scene.removeObject(t.rect), e) {
3063
- this._ensureMap(r, s).delete(n);
3064
- const c = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: n });
3020
+ if (o && o.scene.removeObject(n.rect), e) {
3021
+ this._ensureMap(r, s).delete(t);
3022
+ const c = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: t });
3065
3023
  if (!c)
3066
3024
  return;
3067
3025
  const u = this._sheetDrawingService.getBatchRemoveOp([c]), { redo: l, objects: d } = u;
3068
3026
  this._commandService.syncExecuteCommand(A.id, { unitId: r, subUnitId: s, op: l, objects: d, type: P.REMOVE });
3069
3027
  }
3070
3028
  }
3071
- addHook(n) {
3072
- return this._hooks.push(n), {
3029
+ addHook(t) {
3030
+ return this._hooks.push(t), {
3073
3031
  dispose: () => {
3074
- const e = this._hooks.findIndex((t) => t === n);
3032
+ const e = this._hooks.findIndex((n) => n === t);
3075
3033
  this._hooks.splice(e, 1);
3076
3034
  }
3077
3035
  };
3078
3036
  }
3079
3037
  // eslint-disable-next-line max-lines-per-function, complexity
3080
- addFloatDomToRange(n, e, t, r) {
3081
- var _, T, M, y, E;
3082
- const s = H(this._univerInstanceService, {
3038
+ addFloatDomToRange(t, e, n, r) {
3039
+ var _, E, M, y, T;
3040
+ const s = de(this._univerInstanceService, {
3083
3041
  unitId: e.unitId,
3084
3042
  subUnitId: e.subUnitId
3085
3043
  });
@@ -3091,15 +3049,15 @@ let jt = class extends le {
3091
3049
  if (!u) return;
3092
3050
  const l = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(V).getWorksheetSkeleton(a);
3093
3051
  if (!l) return;
3094
- const { componentKey: d, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Et(), { position: p, position$: m } = this._createRangePositionObserver(n, u, l.skeleton);
3052
+ const { componentKey: d, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Tt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, l.skeleton);
3095
3053
  if (this._getPosition(p, o) == null)
3096
3054
  return;
3097
3055
  this._ensureMap(o, a).set(f, e);
3098
- const C = c.scene, { scaleX: b } = C.getAncestorScale(), v = Mt(p, t, b), D = {
3056
+ const C = c.scene, { scaleX: D } = C.getAncestorScale(), v = Mt(p, n, D), b = {
3099
3057
  unitId: o,
3100
3058
  subUnitId: a,
3101
3059
  drawingId: f,
3102
- drawingType: e.type || x.DRAWING_DOM,
3060
+ drawingType: e.type || $.DRAWING_DOM,
3103
3061
  componentKey: d,
3104
3062
  transform: {
3105
3063
  left: v.startX,
@@ -3111,64 +3069,64 @@ let jt = class extends le {
3111
3069
  allowTransform: h
3112
3070
  };
3113
3071
  {
3114
- const { unitId: I, subUnitId: R, drawingId: O } = D, B = H(this._univerInstanceService, { unitId: I, subUnitId: R }), K = D, Z = this._univerInstanceService.getUnit(I, F.UNIVER_SHEET);
3115
- if (!Z)
3072
+ const { unitId: I, subUnitId: R, drawingId: O } = b, B = de(this._univerInstanceService, { unitId: I, subUnitId: R }), z = b, K = this._univerInstanceService.getUnit(I, F.UNIVER_SHEET);
3073
+ if (!K)
3116
3074
  return;
3117
- const Y = Z.getActiveSheet().getSheetId();
3118
- if (!K || !B)
3075
+ const Y = K.getActiveSheet().getSheetId();
3076
+ if (!z || !B)
3119
3077
  return;
3120
- const me = (T = this._renderManagerService.getRenderById(I)) == null ? void 0 : T.with(V);
3078
+ const me = (E = this._renderManagerService.getRenderById(I)) == null ? void 0 : E.with(V);
3121
3079
  if (!me)
3122
3080
  return;
3123
3081
  const X = me.getWorksheetSkeleton(R);
3124
3082
  if (!X)
3125
3083
  return;
3126
- const { transform: J, drawingType: ce, data: q } = K;
3127
- if (ce !== x.DRAWING_DOM && ce !== x.DRAWING_CHART)
3084
+ const { transform: Z, drawingType: ae, data: J } = z;
3085
+ if (ae !== $.DRAWING_DOM && ae !== $.DRAWING_CHART)
3128
3086
  return;
3129
3087
  const W = this._getSceneAndTransformerByDrawingSearch(I);
3130
3088
  if (W == null)
3131
3089
  return;
3132
- const { scene: Ue, canvas: Pe } = W;
3133
- if (J == null || Y !== R)
3090
+ const { scene: Oe, canvas: Ue } = W;
3091
+ if (Z == null || Y !== R)
3134
3092
  return;
3135
- const { left: st, top: ot, width: at, height: ct, angle: Vt, flipX: Ht, flipY: dt, skewX: lt, skewY: Ae } = J, ut = be({ unitId: I, subUnitId: R, drawingId: O }), ue = Ue.getObject(ut);
3093
+ const { left: st, top: ot, width: at, height: ct, angle: Vt, flipX: Ht, flipY: dt, skewX: lt, skewY: Pe } = Z, ut = Ce({ unitId: I, subUnitId: R, drawingId: O }), ue = Oe.getObject(ut);
3136
3094
  if (ue != null) {
3137
- ue.transformByState({ left: st, top: ot, width: at, height: ct, angle: Vt, flipX: Ht, flipY: dt, skewX: lt, skewY: Ae });
3095
+ ue.transformByState({ left: st, top: ot, width: at, height: ct, angle: Vt, flipX: Ht, flipY: dt, skewX: lt, skewY: Pe });
3138
3096
  return;
3139
3097
  }
3140
- const re = {
3098
+ const ne = {
3141
3099
  left: st,
3142
3100
  // from floatDomParam.transform
3143
3101
  top: ot,
3144
3102
  width: at,
3145
3103
  height: ct,
3146
3104
  zIndex: this._drawingManagerService.getDrawingOrder(I, R).length - 1
3147
- }, Ne = ce === x.DRAWING_CHART;
3148
- if (Ne) {
3149
- const k = q ? q.backgroundColor : "white";
3150
- re.fill = k, re.rotateEnabled = !1, q && q.border && (re.stroke = q.border), re.paintFirst = "stroke", re.strokeWidth = 1, re.borderEnabled = !1, re.radius = 8;
3105
+ }, Ae = ae === $.DRAWING_CHART;
3106
+ if (Ae) {
3107
+ const k = J ? J.backgroundColor : "white";
3108
+ ne.fill = k, ne.rotateEnabled = !1, J && J.border && (ne.stroke = J.border), ne.paintFirst = "stroke", ne.strokeWidth = 1, ne.borderEnabled = !1, ne.radius = 8;
3151
3109
  }
3152
- const de = new $e(ut, re);
3153
- Ne && de.setObjectType(An.CHART), Ue.addObject(de, Zt), K.allowTransform !== !1 && Ue.attachTransformerTo(de);
3154
- const Ve = this._ensureMap(I, R), he = new _t(), ht = Ue.getMainViewport(), { rowHeaderWidth: ke, columnHeaderHeight: He } = X.skeleton, gt = {
3110
+ const ce = new je(ut, ne);
3111
+ Ae && ce.setObjectType(Pn.CHART), Oe.addObject(ce, Zt), z.allowTransform !== !1 && Oe.attachTransformerTo(ce);
3112
+ const Ve = this._ensureMap(I, R), he = new _t(), ht = Oe.getMainViewport(), { rowHeaderWidth: Ne, columnHeaderHeight: He } = X.skeleton, gt = {
3155
3113
  top: He,
3156
- left: ke,
3114
+ left: Ne,
3157
3115
  bottom: ht.bottom,
3158
3116
  right: ht.right
3159
3117
  }, ge = {
3160
3118
  dispose: he,
3161
- rect: de,
3119
+ rect: ce,
3162
3120
  boundsOfViewArea: gt,
3163
- domAnchor: t,
3121
+ domAnchor: n,
3164
3122
  unitId: I,
3165
3123
  subUnitId: R
3166
- }, j = fe(de, W.renderUnit, X.skeleton, B.worksheet, ge), Be = new Ze(j);
3167
- ge.position$ = Be;
3124
+ }, j = fe(ce, W.renderUnit, X.skeleton, B.worksheet, ge), ke = new Ze(j);
3125
+ ge.position$ = ke;
3168
3126
  let ze = {
3169
- position$: Be,
3127
+ position$: ke,
3170
3128
  id: O,
3171
- componentKey: K.componentKey,
3129
+ componentKey: z.componentKey,
3172
3130
  onPointerDown: () => {
3173
3131
  },
3174
3132
  onPointerMove: () => {
@@ -3176,52 +3134,52 @@ let jt = class extends le {
3176
3134
  onPointerUp: () => {
3177
3135
  },
3178
3136
  onWheel: (k) => {
3179
- Pe.dispatchEvent(new WheelEvent(k.type, k));
3137
+ Ue.dispatchEvent(new WheelEvent(k.type, k));
3180
3138
  },
3181
3139
  props: (y = (M = Ve.get(O)) == null ? void 0 : M.props) != null ? y : this._getFloatDomProps(O),
3182
- data: q,
3140
+ data: J,
3183
3141
  unitId: I
3184
3142
  };
3185
3143
  e.eventPassThrough && (ze = {
3186
3144
  ...ze,
3187
3145
  onPointerDown: (k) => {
3188
- Pe.dispatchEvent(new PointerEvent(k.type, k));
3146
+ Ue.dispatchEvent(new PointerEvent(k.type, k));
3189
3147
  },
3190
3148
  onPointerMove: (k) => {
3191
- Pe.dispatchEvent(new PointerEvent(k.type, k));
3149
+ Ue.dispatchEvent(new PointerEvent(k.type, k));
3192
3150
  },
3193
3151
  onPointerUp: (k) => {
3194
- Pe.dispatchEvent(new PointerEvent(k.type, k));
3152
+ Ue.dispatchEvent(new PointerEvent(k.type, k));
3195
3153
  }
3196
3154
  }), this._canvasFloatDomService.addFloatDom(ze), this.disposeWithMe(m.subscribe((k) => {
3197
- var pn, wn, _n, vn;
3198
- const mn = Mt({
3155
+ var mn, pn, wn, _n;
3156
+ const fn = Mt({
3199
3157
  startX: k.startX,
3200
3158
  startY: k.startY,
3201
3159
  endX: k.endX,
3202
3160
  endY: k.endY,
3203
- width: (pn = t.width) != null ? pn : k.width,
3204
- height: (wn = t.height) != null ? wn : k.height,
3161
+ width: (mn = n.width) != null ? mn : k.width,
3162
+ height: (pn = n.height) != null ? pn : k.height,
3205
3163
  absolute: {
3206
3164
  left: p.absolute.left,
3207
3165
  top: p.absolute.top
3208
3166
  }
3209
- }, t), Br = be({ unitId: I, subUnitId: R, drawingId: O }), Wr = new $e(Br, {
3210
- left: mn.startX,
3211
- top: mn.startY,
3212
- width: (_n = t.width) != null ? _n : k.width,
3213
- height: (vn = t.height) != null ? vn : k.height,
3167
+ }, n), Ar = Ce({ unitId: I, subUnitId: R, drawingId: O }), Nr = new je(Ar, {
3168
+ left: fn.startX,
3169
+ top: fn.startY,
3170
+ width: (wn = n.width) != null ? wn : k.width,
3171
+ height: (_n = n.height) != null ? _n : k.height,
3214
3172
  zIndex: this._drawingManagerService.getDrawingOrder(I, R).length - 1
3215
- }), jr = fe(Wr, W.renderUnit, X.skeleton, B.worksheet, ge);
3216
- Be.next(jr);
3173
+ }), kr = fe(Nr, W.renderUnit, X.skeleton, B.worksheet, ge);
3174
+ ke.next(kr);
3217
3175
  }));
3218
- const Ke = (E = this._renderManagerService.getRenderById(I)) == null ? void 0 : E.with(V);
3176
+ const Ke = (T = this._renderManagerService.getRenderById(I)) == null ? void 0 : T.with(V);
3219
3177
  Ke == null || Ke.currentSkeleton$.subscribe((k) => {
3220
3178
  k && X.sheetId !== k.sheetId && this._removeDom(f, !0);
3221
3179
  });
3222
- const ft = de.onTransformChange$.subscribeEvent(() => {
3223
- const k = fe(de, W.renderUnit, X.skeleton, B.worksheet, ge);
3224
- Be.next(
3180
+ const ft = ce.onTransformChange$.subscribeEvent(() => {
3181
+ const k = fe(ce, W.renderUnit, X.skeleton, B.worksheet, ge);
3182
+ ke.next(
3225
3183
  k
3226
3184
  );
3227
3185
  });
@@ -3238,9 +3196,9 @@ let jt = class extends le {
3238
3196
  }
3239
3197
  };
3240
3198
  }
3241
- addFloatDomToColumnHeader(n, e, t, r) {
3242
- var v, D, _, T, M;
3243
- const s = H(this._univerInstanceService, {
3199
+ addFloatDomToColumnHeader(t, e, n, r) {
3200
+ var v, b, _, E, M;
3201
+ const s = de(this._univerInstanceService, {
3244
3202
  unitId: e.unitId,
3245
3203
  subUnitId: e.subUnitId
3246
3204
  });
@@ -3252,20 +3210,20 @@ let jt = class extends le {
3252
3210
  if (!u) return;
3253
3211
  const l = (v = this._renderManagerService.getRenderById(o)) == null ? void 0 : v.with(V).getWorksheetSkeleton(a);
3254
3212
  if (!l) return;
3255
- const { componentKey: d, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Et(), { position: p, position$: m } = this._createRangePositionObserver({
3213
+ const { componentKey: d, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Tt(), { position: p, position$: m } = this._createRangePositionObserver({
3256
3214
  startRow: 0,
3257
3215
  endRow: 0,
3258
- startColumn: n,
3259
- endColumn: n
3216
+ startColumn: t,
3217
+ endColumn: t
3260
3218
  }, u, l.skeleton), w = p;
3261
3219
  if (w.startY = 0, this._getPosition(p, o) == null)
3262
3220
  return;
3263
3221
  this._ensureMap(o, a).set(f, e);
3264
- const b = {
3222
+ const D = {
3265
3223
  unitId: o,
3266
3224
  subUnitId: a,
3267
3225
  drawingId: f,
3268
- drawingType: e.type || x.DRAWING_DOM,
3226
+ drawingType: e.type || $.DRAWING_DOM,
3269
3227
  componentKey: d,
3270
3228
  transform: {
3271
3229
  left: w.startX,
@@ -3277,68 +3235,68 @@ let jt = class extends le {
3277
3235
  allowTransform: h
3278
3236
  };
3279
3237
  {
3280
- const { unitId: y, subUnitId: E, drawingId: I } = b, R = H(this._univerInstanceService, { unitId: y, subUnitId: E }), O = b, B = this._univerInstanceService.getUnit(y, F.UNIVER_SHEET);
3238
+ const { unitId: y, subUnitId: T, drawingId: I } = D, R = de(this._univerInstanceService, { unitId: y, subUnitId: T }), O = D, B = this._univerInstanceService.getUnit(y, F.UNIVER_SHEET);
3281
3239
  if (!B)
3282
3240
  return;
3283
- const K = B.getActiveSheet().getSheetId();
3241
+ const z = B.getActiveSheet().getSheetId();
3284
3242
  if (!O || !R)
3285
3243
  return;
3286
- const Z = (D = this._renderManagerService.getRenderById(y)) == null ? void 0 : D.with(V);
3287
- if (!Z)
3244
+ const K = (b = this._renderManagerService.getRenderById(y)) == null ? void 0 : b.with(V);
3245
+ if (!K)
3288
3246
  return;
3289
- const Y = Z.getWorksheetSkeleton(E);
3247
+ const Y = K.getWorksheetSkeleton(T);
3290
3248
  if (!Y)
3291
3249
  return;
3292
- const { transform: me, data: X } = O, J = this._getSceneAndTransformerByDrawingSearch(y);
3293
- if (J == null)
3250
+ const { transform: me, data: X } = O, Z = this._getSceneAndTransformerByDrawingSearch(y);
3251
+ if (Z == null)
3294
3252
  return;
3295
- const { scene: ce, canvas: q } = J;
3296
- if (me == null || K !== E)
3253
+ const { scene: ae, canvas: J } = Z;
3254
+ if (me == null || z !== T)
3297
3255
  return;
3298
- const { left: W, top: Ue, width: Pe, height: st, angle: ot, flipX: at, flipY: ct, skewX: Vt, skewY: Ht } = me, dt = be({ unitId: y, subUnitId: E, drawingId: I }), lt = ce.getObject(dt);
3256
+ const { left: W, top: Oe, width: Ue, height: st, angle: ot, flipX: at, flipY: ct, skewX: Vt, skewY: Ht } = me, dt = Ce({ unitId: y, subUnitId: T, drawingId: I }), lt = ae.getObject(dt);
3299
3257
  if (lt != null) {
3300
- lt.transformByState({ left: W, top: Ue, width: Pe, height: st, angle: ot, flipX: at, flipY: ct, skewX: Vt, skewY: Ht });
3258
+ lt.transformByState({ left: W, top: Oe, width: Ue, height: st, angle: ot, flipX: at, flipY: ct, skewX: Vt, skewY: Ht });
3301
3259
  return;
3302
3260
  }
3303
- const Ae = Mt({
3261
+ const Pe = Mt({
3304
3262
  startX: w.startX,
3305
3263
  startY: 0,
3306
3264
  endX: p.endX,
3307
3265
  endY: p.endY,
3308
- width: t.width,
3309
- height: t.height,
3266
+ width: n.width,
3267
+ height: n.height,
3310
3268
  absolute: {
3311
3269
  left: p.absolute.left,
3312
3270
  top: p.absolute.top
3313
3271
  }
3314
- }, t), ut = {
3315
- left: Ae.startX,
3316
- top: Ae.startY,
3317
- width: Ae.width,
3318
- height: Ae.height,
3319
- zIndex: this._drawingManagerService.getDrawingOrder(y, E).length - 1
3320
- }, ue = new $e(dt, ut);
3321
- ce.addObject(ue, Zt), O.allowTransform !== !1 && ce.attachTransformerTo(ue);
3322
- const re = this._ensureMap(y, E), Ne = new _t(), de = ce.getMainViewport(), Ve = {
3272
+ }, n), ut = {
3273
+ left: Pe.startX,
3274
+ top: Pe.startY,
3275
+ width: Pe.width,
3276
+ height: Pe.height,
3277
+ zIndex: this._drawingManagerService.getDrawingOrder(y, T).length - 1
3278
+ }, ue = new je(dt, ut);
3279
+ ae.addObject(ue, Zt), O.allowTransform !== !1 && ae.attachTransformerTo(ue);
3280
+ const ne = this._ensureMap(y, T), Ae = new _t(), ce = ae.getMainViewport(), Ve = {
3323
3281
  top: 0,
3324
3282
  //viewMain.top,
3325
- left: de.left,
3326
- bottom: de.bottom,
3327
- right: de.right
3283
+ left: ce.left,
3284
+ bottom: ce.bottom,
3285
+ right: ce.right
3328
3286
  }, he = {
3329
- dispose: Ne,
3287
+ dispose: Ae,
3330
3288
  rect: ue,
3331
3289
  // position$,
3332
3290
  unitId: y,
3333
- subUnitId: E,
3291
+ subUnitId: T,
3334
3292
  boundsOfViewArea: Ve,
3335
- domAnchor: t,
3293
+ domAnchor: n,
3336
3294
  scrollDirectionResponse: "HORIZONTAL"
3337
3295
  /* HORIZONTAL */
3338
- }, ht = fe(ue, J.renderUnit, Y.skeleton, R.worksheet, he), ke = new Ze(ht);
3339
- he.position$ = ke;
3296
+ }, ht = fe(ue, Z.renderUnit, Y.skeleton, R.worksheet, he), Ne = new Ze(ht);
3297
+ he.position$ = Ne;
3340
3298
  let He = {
3341
- position$: ke,
3299
+ position$: Ne,
3342
3300
  id: I,
3343
3301
  componentKey: O.componentKey,
3344
3302
  onPointerDown: () => {
@@ -3348,58 +3306,58 @@ let jt = class extends le {
3348
3306
  onPointerUp: () => {
3349
3307
  },
3350
3308
  onWheel: (j) => {
3351
- q.dispatchEvent(new WheelEvent(j.type, j));
3309
+ J.dispatchEvent(new WheelEvent(j.type, j));
3352
3310
  },
3353
- props: (T = (_ = re.get(I)) == null ? void 0 : _.props) != null ? T : this._getFloatDomProps(I),
3311
+ props: (E = (_ = ne.get(I)) == null ? void 0 : _.props) != null ? E : this._getFloatDomProps(I),
3354
3312
  data: X,
3355
3313
  unitId: y
3356
3314
  };
3357
3315
  e.eventPassThrough && (He = {
3358
3316
  ...He,
3359
3317
  onPointerDown: (j) => {
3360
- q.dispatchEvent(new PointerEvent(j.type, j));
3318
+ J.dispatchEvent(new PointerEvent(j.type, j));
3361
3319
  },
3362
3320
  onPointerMove: (j) => {
3363
- q.dispatchEvent(new PointerEvent(j.type, j));
3321
+ J.dispatchEvent(new PointerEvent(j.type, j));
3364
3322
  },
3365
3323
  onPointerUp: (j) => {
3366
- q.dispatchEvent(new PointerEvent(j.type, j));
3324
+ J.dispatchEvent(new PointerEvent(j.type, j));
3367
3325
  }
3368
3326
  }), this._canvasFloatDomService.addFloatDom(He);
3369
3327
  const gt = ue.onTransformChange$.subscribeEvent(() => {
3370
- const j = fe(ue, J.renderUnit, Y.skeleton, R.worksheet, he);
3371
- ke.next(
3328
+ const j = fe(ue, Z.renderUnit, Y.skeleton, R.worksheet, he);
3329
+ Ne.next(
3372
3330
  j
3373
3331
  );
3374
3332
  });
3375
3333
  this.disposeWithMe(m.subscribe((j) => {
3376
- const Be = Mt({
3334
+ const ke = Mt({
3377
3335
  startX: j.startX,
3378
3336
  startY: 0,
3379
3337
  endX: j.endX,
3380
3338
  endY: j.endY,
3381
- width: t.width,
3382
- height: t.height,
3339
+ width: n.width,
3340
+ height: n.height,
3383
3341
  absolute: {
3384
3342
  left: p.absolute.left,
3385
3343
  top: p.absolute.top
3386
3344
  }
3387
- }, t), ze = be({ unitId: y, subUnitId: E, drawingId: I }), Ke = new $e(ze, {
3388
- left: Be.startX,
3345
+ }, n), ze = Ce({ unitId: y, subUnitId: T, drawingId: I }), Ke = new je(ze, {
3346
+ left: ke.startX,
3389
3347
  top: 0,
3390
- width: t.width,
3391
- height: t.height,
3392
- zIndex: this._drawingManagerService.getDrawingOrder(y, E).length - 1
3393
- }), ft = fe(Ke, J.renderUnit, Y.skeleton, R.worksheet, he);
3394
- ke.next(ft);
3348
+ width: n.width,
3349
+ height: n.height,
3350
+ zIndex: this._drawingManagerService.getDrawingOrder(y, T).length - 1
3351
+ }), ft = fe(Ke, Z.renderUnit, Y.skeleton, R.worksheet, he);
3352
+ Ne.next(ft);
3395
3353
  }));
3396
3354
  const ge = (M = this._renderManagerService.getRenderById(y)) == null ? void 0 : M.with(V);
3397
3355
  ge == null || ge.currentSkeleton$.subscribe((j) => {
3398
3356
  j && l.sheetId !== j.sheetId && this._removeDom(f, !0);
3399
- }), Ne.add(() => {
3357
+ }), Ae.add(() => {
3400
3358
  this._canvasFloatDomService.removeFloatDom(I);
3401
- }), gt && Ne.add(gt), this._domLayerInfoMap.set(I, he), re.set(I, {
3402
- ...re.get(I)
3359
+ }), gt && Ae.add(gt), this._domLayerInfoMap.set(I, he), ne.set(I, {
3360
+ ...ne.get(I)
3403
3361
  });
3404
3362
  }
3405
3363
  return {
@@ -3419,18 +3377,18 @@ let jt = class extends le {
3419
3377
  * @param activeViewport
3420
3378
  * @returns position of cell to canvas.
3421
3379
  */
3422
- _createRangePositionObserver(n, e, t) {
3423
- let { startRow: r, startColumn: s } = n;
3424
- const o = Qe(r, s, t), a = new Ze(o), c = Qe(n.endRow, n.endColumn, t), u = new Ze(c), l = () => {
3425
- const m = Qe(r, s, t), w = Qe(n.endRow, n.endColumn, t);
3380
+ _createRangePositionObserver(t, e, n) {
3381
+ let { startRow: r, startColumn: s } = t;
3382
+ const o = Qe(r, s, n), a = new Ze(o), c = Qe(t.endRow, t.endColumn, n), u = new Ze(c), l = () => {
3383
+ const m = Qe(r, s, n), w = Qe(t.endRow, t.endColumn, n);
3426
3384
  a.next(m), u.next(w);
3427
3385
  }, d = new _t();
3428
3386
  d.add(e.engine.clientRect$.subscribe(() => l())), d.add(this._commandService.onCommandExecuted((m) => {
3429
- if (m.id === nr.id && m.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3387
+ if (m.id === qi.id && m.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3430
3388
  l();
3431
3389
  return;
3432
3390
  }
3433
- (is.indexOf(m.id) > -1 || m.id === Oi.id || m.id === kn.id) && l();
3391
+ (Qi.indexOf(m.id) > -1 || m.id === Mi.id || m.id === Nn.id) && l();
3434
3392
  }));
3435
3393
  const g = (m, w) => {
3436
3394
  r = m, s = w, l();
@@ -3447,8 +3405,8 @@ let jt = class extends le {
3447
3405
  endX: c.right,
3448
3406
  endY: c.bottom
3449
3407
  }), f = a.pipe(
3450
- Oe((m) => {
3451
- const w = Qe(n.endRow, n.endColumn, t);
3408
+ Te((m) => {
3409
+ const w = Qe(t.endRow, t.endColumn, n);
3452
3410
  return {
3453
3411
  rotate: 0,
3454
3412
  width: w.right - m.left,
@@ -3474,17 +3432,17 @@ let jt = class extends le {
3474
3432
  };
3475
3433
  }
3476
3434
  };
3477
- jt = mo([
3478
- ye(0, N(ne)),
3479
- ye(1, Ce),
3480
- ye(2, N(G)),
3481
- ye(3, oe),
3482
- ye(4, N(Fi)),
3483
- ye(5, ae),
3484
- ye(6, N(qr))
3435
+ jt = lo([
3436
+ Re(0, N(te)),
3437
+ Re(1, Ee),
3438
+ Re(2, N(G)),
3439
+ Re(3, se),
3440
+ Re(4, N(ji)),
3441
+ Re(5, oe),
3442
+ Re(6, N(zr))
3485
3443
  ], jt);
3486
- function Qe(i, n, e) {
3487
- const t = e.getCellWithCoordByIndex(i, n), r = t.isMergedMainCell ? t.mergeInfo : t;
3444
+ function Qe(i, t, e) {
3445
+ const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
3488
3446
  return {
3489
3447
  left: r.startX,
3490
3448
  right: r.endX,
@@ -3492,22 +3450,22 @@ function Qe(i, n, e) {
3492
3450
  bottom: r.endY
3493
3451
  };
3494
3452
  }
3495
- function Mt(i, n, e) {
3453
+ function Mt(i, t, e) {
3496
3454
  var u, l;
3497
3455
  e = e != null ? e : 1;
3498
- const t = i.endX - i.startX, r = i.endY - i.startY, s = (u = n == null ? void 0 : n.width) != null ? u : t, o = (l = n == null ? void 0 : n.height) != null ? l : r;
3456
+ const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (l = t == null ? void 0 : t.height) != null ? l : r;
3499
3457
  let a = 0, c = 0;
3500
- if (n) {
3501
- if (n.horizonOffsetAlign === "right") {
3502
- const d = yt(n.marginX, t * e);
3458
+ if (t) {
3459
+ if (t.horizonOffsetAlign === "right") {
3460
+ const d = yt(t.marginX, n * e);
3503
3461
  a = i.endX - d - s;
3504
3462
  } else
3505
- a = i.startX + yt(n.marginX, t);
3506
- if (n.verticalOffsetAlign === "bottom") {
3507
- const d = yt(n.marginY, r * e);
3463
+ a = i.startX + yt(t.marginX, n);
3464
+ if (t.verticalOffsetAlign === "bottom") {
3465
+ const d = yt(t.marginY, r * e);
3508
3466
  c = i.endY - d - o;
3509
3467
  } else
3510
- c = i.startY + yt(n.marginY, r);
3468
+ c = i.startY + yt(t.marginY, r);
3511
3469
  }
3512
3470
  return {
3513
3471
  rotate: 0,
@@ -3523,30 +3481,30 @@ function Mt(i, n, e) {
3523
3481
  }
3524
3482
  };
3525
3483
  }
3526
- function yt(i, n) {
3484
+ function yt(i, t) {
3527
3485
  if (i === void 0) return 0;
3528
3486
  if (typeof i == "number") return i;
3529
3487
  const e = Number.parseFloat(i);
3530
- return n * e / 100;
3488
+ return t * e / 100;
3531
3489
  }
3532
- var wo = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, vo = (i, n, e) => n in i ? wo(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e, So = (i, n, e, t) => {
3533
- for (var r = t > 1 ? void 0 : t ? _o(n, e) : n, s = i.length - 1, o; s >= 0; s--)
3490
+ var ho = Object.defineProperty, go = Object.getOwnPropertyDescriptor, fo = (i, t, e) => t in i ? ho(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, mo = (i, t, e, n) => {
3491
+ for (var r = n > 1 ? void 0 : n ? go(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3534
3492
  (o = i[s]) && (r = o(r) || r);
3535
3493
  return r;
3536
- }, Qt = (i, n) => (e, t) => n(e, t, i), kr = (i, n, e) => vo(i, typeof n != "symbol" ? n + "" : n, e);
3537
- const Io = "SHEET_IMAGE_UI_PLUGIN";
3538
- let $t = class extends ri {
3539
- constructor(i = Gn, n, e, t) {
3540
- super(), this._config = i, this._injector = n, this._renderManagerService = e, this._configService = t;
3541
- const { menu: r, ...s } = ii(
3494
+ }, Qt = (i, t) => (e, n) => t(e, n, i), Pr = (i, t, e) => fo(i, typeof t != "symbol" ? t + "" : t, e);
3495
+ const po = "SHEET_IMAGE_UI_PLUGIN";
3496
+ let xt = class extends Qr {
3497
+ constructor(i = Yn, t, e, n) {
3498
+ super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
3499
+ const { menu: r, ...s } = ei(
3542
3500
  {},
3543
- Gn,
3501
+ Yn,
3544
3502
  this._config
3545
3503
  );
3546
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(ds, s);
3504
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(is, s);
3547
3505
  }
3548
3506
  onStarting() {
3549
- si(this._injector, [
3507
+ ti(this._injector, [
3550
3508
  [jt],
3551
3509
  [Wt],
3552
3510
  [Ot],
@@ -3581,36 +3539,36 @@ let $t = class extends ri {
3581
3539
  _registerRenderModules() {
3582
3540
  [
3583
3541
  [et],
3584
- [dn],
3542
+ [cn],
3585
3543
  [on]
3586
3544
  ].forEach((i) => {
3587
3545
  this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
3588
3546
  });
3589
3547
  }
3590
3548
  };
3591
- kr($t, "type", F.UNIVER_SHEET);
3592
- kr($t, "pluginName", Io);
3593
- $t = So([
3594
- ti(di, ai, mi, vi),
3549
+ Pr(xt, "type", F.UNIVER_SHEET);
3550
+ Pr(xt, "pluginName", po);
3551
+ xt = mo([
3552
+ Jr(si, ri, ui, mi),
3595
3553
  Qt(1, N(tt)),
3596
- Qt(2, ne),
3597
- Qt(3, ni)
3598
- ], $t);
3554
+ Qt(2, te),
3555
+ Qt(3, qr)
3556
+ ], xt);
3599
3557
  export {
3600
3558
  L as ClearSheetDrawingTransformerOperation,
3601
- Pr as DeleteDrawingsCommand,
3602
- Dr as EditSheetDrawingOperation,
3603
- Rr as GroupSheetDrawingCommand,
3559
+ Er as DeleteDrawingsCommand,
3560
+ Sr as EditSheetDrawingOperation,
3561
+ Ir as GroupSheetDrawingCommand,
3604
3562
  Xt as InsertFloatImageCommand,
3605
3563
  Yt as InsertSheetDrawingCommand,
3606
3564
  rt as MoveDrawingsCommand,
3607
3565
  nt as RemoveSheetDrawingCommand,
3608
- Nr as SHEETS_IMAGE_MENU_ID,
3609
- Mr as SetDrawingArrangeCommand,
3566
+ Ur as SHEETS_IMAGE_MENU_ID,
3567
+ Cr as SetDrawingArrangeCommand,
3610
3568
  Gt as SetSheetDrawingCommand,
3611
3569
  jt as SheetCanvasFloatDomManagerService,
3612
3570
  et as SheetDrawingUpdateController,
3613
- br as SidebarSheetDrawingOperation,
3614
- yr as UngroupSheetDrawingCommand,
3615
- $t as UniverSheetsDrawingUIPlugin
3571
+ vr as SidebarSheetDrawingOperation,
3572
+ Dr as UngroupSheetDrawingCommand,
3573
+ xt as UniverSheetsDrawingUIPlugin
3616
3574
  };