@univerjs/sheets-drawing-ui 0.7.0-beta.0 → 0.7.0-beta.1

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