@univerjs/sheets-drawing-ui 0.15.0-insiders.20260107-3d1cfdf → 0.15.0-insiders.20260108-47c73e3

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,33 +1,33 @@
1
- var Jr = Object.defineProperty;
2
- var Zr = (i, t, e) => t in i ? Jr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var Q = (i, t, e) => Zr(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { precisionTo as bt, IRenderManagerService as ee, transformObjectOutOfGroup as qr, getGroupState as Qr, getCurrentTypeOfRenderer as bn, CURSOR_TYPE as ei, RENDER_CLASS_TYPE as ke, Rect as $e, ObjectType as Nn, DRAWING_OBJECT_LAYER_INDEX as qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
5
- import { convertPositionSheetOverGridToAbsolute as ti, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Je, attachRangeWithCoord as dr, SheetCanvasPopManagerService as ni, HoverManagerService as ri, IEditorBridgeService as ii, IAutoFillService as si, EditingRenderController as oi, SetCellEditVisibleOperation as kn, PREDEFINED_HOOK_NAME_PASTE as Le, COPY_TYPE as Re, discreteRangeToRange as $n, virtualizeDiscreteRanges as ai, ISheetClipboardService as ci, SetZoomRatioOperation as xn, SetScrollOperation as di, SheetPrintInterceptorService as li, useHighlightRange as ui, getCurrentRangeDisable$ as hi } from "@univerjs/sheets-ui";
6
- import { CommandType as q, ICommandService as G, IUndoRedoService as Ze, sequenceExecute as lr, DrawingTypeEnum as x, ArrangeTypeEnum as Mt, Inject as A, IContextService as ur, LocaleService as Te, Injector as qe, Disposable as te, createDocumentModelWithStyle as hn, ObjectRelativeFromV as Wn, ObjectRelativeFromH as Bn, WrapTextType as jn, PositionedObjectLayoutType as Fn, BooleanNumber as Ln, BuildTextUtils as gn, ImageSourceType as de, generateRandomId as He, FOCUSING_COMMON_DRAWINGS as Ye, IUniverInstanceService as le, UniverInstanceType as k, Direction as Ie, createIdentifier as gi, IImageIoService as hr, toDisposable as mi, RxDisposable as fi, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ot, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ve, InterceptorEffectEnum as pi, ObjectMatrix as wi, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as _i, IPermissionService as Si, UserManagerService as vi, LifecycleService as Ii, LifecycleStages as Ci, DisposableCollection as yt, fromEventSubject as Ri, Tools as Ge, PRINT_CHART_COMPONENT_KEY as Di, Rectangle as bi, FOCUSING_SHEET as Mi, FOCUSING_FX_BAR_EDITOR as yi, EDITOR_ACTIVATED as Ei, FOCUSING_PANEL_EDITOR as Ti, DependentOn as Oi, IConfigService as Ui, Plugin as Pi, merge as Ai, registerDependencies as Ni, touchDependencies as Qt } from "@univerjs/core";
1
+ var Zr = Object.defineProperty;
2
+ var qr = (i, t, e) => t in i ? Zr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var ie = (i, t, e) => qr(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { precisionTo as bt, IRenderManagerService as ee, transformObjectOutOfGroup as Qr, getGroupState as ei, getCurrentTypeOfRenderer as Dn, CURSOR_TYPE as ti, RENDER_CLASS_TYPE as ke, Rect as $e, ObjectType as An, DRAWING_OBJECT_LAYER_INDEX as Qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
5
+ import { convertPositionSheetOverGridToAbsolute as ni, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Je, attachRangeWithCoord as dr, SheetCanvasPopManagerService as ri, HoverManagerService as ii, IEditorBridgeService as si, IAutoFillService as oi, EditingRenderController as ai, SetCellEditVisibleOperation as Nn, PREDEFINED_HOOK_NAME_PASTE as Le, COPY_TYPE as Re, discreteRangeToRange as kn, virtualizeDiscreteRanges as ci, ISheetClipboardService as di, SetZoomRatioOperation as $n, SetScrollOperation as li, SheetPrintInterceptorService as ui, useHighlightRange as hi, getCurrentRangeDisable$ as gi } from "@univerjs/sheets-ui";
6
+ import { CommandType as q, ICommandService as G, IUndoRedoService as Ze, sequenceExecute as lr, DrawingTypeEnum as x, ArrangeTypeEnum as Mt, Inject as A, IContextService as ur, LocaleService as Te, Injector as qe, IURLImageService as hr, Disposable as te, createDocumentModelWithStyle as un, ObjectRelativeFromV as xn, ObjectRelativeFromH as Wn, WrapTextType as Bn, PositionedObjectLayoutType as jn, BooleanNumber as Fn, BuildTextUtils as hn, ImageSourceType as we, generateRandomId as He, FOCUSING_COMMON_DRAWINGS as Ye, IUniverInstanceService as de, UniverInstanceType as k, Direction as Ie, createIdentifier as mi, IImageIoService as gr, RxDisposable as fi, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ot, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ve, InterceptorEffectEnum as pi, ObjectMatrix as wi, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as _i, IPermissionService as Si, UserManagerService as vi, LifecycleService as Ii, LifecycleStages as Ci, DisposableCollection as yt, fromEventSubject as Ri, Tools as Ge, PRINT_CHART_COMPONENT_KEY as Di, Rectangle as bi, FOCUSING_SHEET as Mi, FOCUSING_FX_BAR_EDITOR as yi, EDITOR_ACTIVATED as Ei, FOCUSING_PANEL_EDITOR as Ti, DependentOn as Oi, IConfigService as Ui, Plugin as Pi, merge as Ai, registerDependencies as Ni, touchDependencies as en } from "@univerjs/core";
7
7
  import { ISheetDrawingService as oe, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as ki } from "@univerjs/sheets-drawing";
8
- import { SheetInterceptorService as Ht, SheetsSelectionsService as ut, SetRangeValuesCommand as Hn, getSheetCommandTarget as se, INTERCEPTOR_POINT as $i, InterceptCellContentPriority as xi, WorkbookViewPermission as Vn, WorksheetViewPermission as Gn, WorkbookEditablePermission as mn, WorksheetEditPermission as fn, SetFrozenMutation as Wi, SetSelectionsOperation as Bi, SetWorksheetRowAutoHeightMutation as gr, COMMAND_LISTENER_SKELETON_CHANGE as ji, InsertRowCommand as mr, InsertColCommand as fr, RemoveRowCommand as pr, RemoveColCommand as wr, DeleteRangeMoveLeftCommand as _r, DeleteRangeMoveUpCommand as Sr, InsertRangeMoveDownCommand as vr, InsertRangeMoveRightCommand as Ir, DeltaRowHeightCommand as pn, SetRowHeightCommand as wn, DeltaColumnWidthCommand as Cr, SetColWidthCommand as Rr, SetRowHiddenCommand as Dr, SetSpecificRowsVisibleCommand as br, SetSpecificColsVisibleCommand as Mr, SetColHiddenCommand as yr, MoveColsCommand as Er, MoveRowsCommand as Tr, MoveRangeCommand as Or, SetRowVisibleMutation as Fi, SetRowHiddenMutation as Li, SetColVisibleMutation as Hi, SetColHiddenMutation as Vi, SetWorksheetRowHeightMutation as Gi, SetWorksheetRowIsAutoHeightMutation as Yi, SetWorksheetColWidthMutation as Xi, SetWorksheetActiveOperation as zi, RangeProtectionPermissionEditPoint as Ki } from "@univerjs/sheets";
9
- import { MessageType as ve, render as Ji, unmount as Zi, FormLayout as en, CheckboxGroup as qi, Checkbox as Yn, Select as Qi, Button as Xn, clsx as es, RadioGroup as ts, Radio as tn } from "@univerjs/design";
10
- import { docDrawingPositionToTransform as zn, ReplaceSnapshotCommand as ns, InnerPasteCommand as rs } from "@univerjs/docs-ui";
11
- import { IImageIoService as is, IDrawingManagerService as ae, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Kn, DRAWING_IMAGE_COUNT_LIMIT as Jn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Zn, getImageSize as nn, SetDrawingSelectedOperation as Vt, DRAWING_IMAGE_WIDTH_LIMIT as qn, DRAWING_IMAGE_HEIGHT_LIMIT as Qn, ImageSourceType as ss, getDrawingShapeKeyByDrawingSearch as De, UniverDrawingPlugin as os } from "@univerjs/drawing";
12
- import { ILocalFileService as as, IMessageService as Ur, IDialogService as Mn, ISidebarService as cs, IClipboardInterfaceService as ds, CanvasFloatDomService as ls, PrintFloatDomSingle as us, ComponentManager as Pr, connectInjector as hs, useDependency as Ce, getMenuHiddenObservable as Gt, MenuItemType as Yt, ContextMenuPosition as rn, ContextMenuGroup as sn, RibbonInsertGroup as gs, KeyCode as Ke, IMenuManagerService as ms, IShortcutService as fs } from "@univerjs/ui";
8
+ import { SheetInterceptorService as Vt, SheetsSelectionsService as ut, SetRangeValuesCommand as Ln, getSheetCommandTarget as se, INTERCEPTOR_POINT as $i, InterceptCellContentPriority as xi, WorkbookViewPermission as Hn, WorksheetViewPermission as Vn, WorkbookEditablePermission as gn, WorksheetEditPermission as mn, SetFrozenMutation as Wi, SetSelectionsOperation as Bi, SetWorksheetRowAutoHeightMutation as mr, COMMAND_LISTENER_SKELETON_CHANGE as ji, InsertRowCommand as fr, InsertColCommand as pr, RemoveRowCommand as wr, RemoveColCommand as _r, DeleteRangeMoveLeftCommand as Sr, DeleteRangeMoveUpCommand as vr, InsertRangeMoveDownCommand as Ir, InsertRangeMoveRightCommand as Cr, DeltaRowHeightCommand as fn, SetRowHeightCommand as pn, DeltaColumnWidthCommand as Rr, SetColWidthCommand as Dr, SetRowHiddenCommand as br, SetSpecificRowsVisibleCommand as Mr, SetSpecificColsVisibleCommand as yr, SetColHiddenCommand as Er, MoveColsCommand as Tr, MoveRowsCommand as Or, MoveRangeCommand as Ur, SetRowVisibleMutation as Fi, SetRowHiddenMutation as Li, SetColVisibleMutation as Hi, SetColHiddenMutation as Vi, SetWorksheetRowHeightMutation as Gi, SetWorksheetRowIsAutoHeightMutation as Yi, SetWorksheetColWidthMutation as Xi, SetWorksheetActiveOperation as zi, RangeProtectionPermissionEditPoint as Ki } from "@univerjs/sheets";
9
+ import { MessageType as ve, render as Ji, unmount as Zi, FormLayout as tn, CheckboxGroup as qi, Checkbox as Gn, Select as Qi, Button as Yn, clsx as es, RadioGroup as ts, Radio as nn } from "@univerjs/design";
10
+ import { docDrawingPositionToTransform as Xn, ReplaceSnapshotCommand as ns, InnerPasteCommand as rs } from "@univerjs/docs-ui";
11
+ import { IImageIoService as is, IDrawingManagerService as ae, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zn, DRAWING_IMAGE_COUNT_LIMIT as Kn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Jn, getImageSize as rn, SetDrawingSelectedOperation as Gt, DRAWING_IMAGE_WIDTH_LIMIT as Zn, DRAWING_IMAGE_HEIGHT_LIMIT as qn, ImageSourceType as ss, getDrawingShapeKeyByDrawingSearch as De, UniverDrawingPlugin as os } from "@univerjs/drawing";
12
+ import { ILocalFileService as as, IMessageService as Pr, IDialogService as bn, ISidebarService as cs, IClipboardInterfaceService as ds, CanvasFloatDomService as ls, PrintFloatDomSingle as us, ComponentManager as Ar, connectInjector as hs, useDependency as Ce, getMenuHiddenObservable as Yt, MenuItemType as Xt, ContextMenuPosition as sn, ContextMenuGroup as on, RibbonInsertGroup as gs, KeyCode as Ke, IMenuManagerService as ms, IShortcutService as fs } from "@univerjs/ui";
13
13
  import { DocDrawingController as ps, UniverDocsDrawingPlugin as ws } from "@univerjs/docs-drawing";
14
- import { ImageCropperObject as _s, COMPONENT_IMAGE_POPUP_MENU as Ss, OpenImageCropOperation as vs, ImageResetSizeOperation as Is, DrawingRenderService as Ar, DrawingCommonPanel as Cs, UniverDrawingUIPlugin as Rs } from "@univerjs/drawing-ui";
15
- import { takeUntil as er, throttleTime as Ds, combineLatest as at, switchMap as pe, EMPTY as _e, tap as tr, map as we, distinctUntilChanged as nr, Subject as on, filter as bs, take as Ms, BehaviorSubject as je, of as _n } from "rxjs";
14
+ import { ImageCropperObject as _s, COMPONENT_IMAGE_POPUP_MENU as Ss, OpenImageCropOperation as vs, ImageResetSizeOperation as Is, DrawingRenderService as Nr, DrawingCommonPanel as Cs, UniverDrawingUIPlugin as Rs } from "@univerjs/drawing-ui";
15
+ import { takeUntil as Qn, throttleTime as Ds, combineLatest as at, switchMap as fe, EMPTY as _e, tap as er, map as pe, distinctUntilChanged as tr, Subject as an, filter as bs, take as Ms, BehaviorSubject as je, of as wn } from "rxjs";
16
16
  import { jsx as L, jsxs as Xe } from "react/jsx-runtime";
17
- import { useMemo as Fe, useState as Ee, useCallback as Et, useEffect as Nr } from "react";
17
+ import { useMemo as Fe, useState as Ee, useCallback as Et, useEffect as kr } from "react";
18
18
  function J(i, t, e) {
19
19
  const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
20
20
  if (c == null)
21
21
  return;
22
- const l = ti(
22
+ const l = ni(
23
23
  c.unitId,
24
24
  c.sheetId,
25
25
  { from: n, to: r },
26
26
  e
27
27
  );
28
- let { left: g, top: h, width: m, height: p } = l;
29
- const f = e.getCurrentSkeleton(), w = f.rowHeaderWidth + f.columnTotalWidth, _ = f.columnHeaderHeight + f.rowTotalHeight;
30
- return g + m > w && (g = w - m), h + p > _ && (h = _ - p), {
28
+ let { left: g, top: h, width: m, height: f } = l;
29
+ const p = e.getCurrentSkeleton(), w = p.rowHeaderWidth + p.columnTotalWidth, S = p.columnHeaderHeight + p.rowTotalHeight;
30
+ return g + m > w && (g = w - m), h + f > S && (h = S - f), {
31
31
  flipY: s,
32
32
  flipX: o,
33
33
  angle: a,
@@ -36,7 +36,7 @@ function J(i, t, e) {
36
36
  left: g,
37
37
  top: h,
38
38
  width: m,
39
- height: p
39
+ height: f
40
40
  };
41
41
  }
42
42
  function j(i, t) {
@@ -81,32 +81,32 @@ const H = {
81
81
  id: "sheet.command.remove-sheet-image",
82
82
  type: q.COMMAND,
83
83
  handler: (i, t) => {
84
- var _, I, R;
85
- const e = i.get(G), n = i.get(Ze), r = i.get(Ht), s = i.get(oe);
84
+ var S, I, D;
85
+ const e = i.get(G), n = i.get(Ze), r = i.get(Vt), s = i.get(oe);
86
86
  if (!t) return !1;
87
87
  const { drawings: o } = t, a = [];
88
88
  o.forEach((v) => {
89
89
  const { unitId: C } = v;
90
90
  a.push(C);
91
91
  });
92
- const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = r.onCommandExecute({ id: ht.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 } };
93
- return lr([...(_ = m.preRedos) != null ? _ : [], p, ...m.redos], e) ? (n.pushUndoRedo({
92
+ const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = r.onCommandExecute({ id: ht.id, params: t }), f = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, p = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
93
+ return lr([...(S = m.preRedos) != null ? S : [], f, ...m.redos], e) ? (n.pushUndoRedo({
94
94
  unitID: u,
95
95
  undoMutations: [
96
96
  ...(I = m.preUndos) != null ? I : [],
97
- f,
97
+ p,
98
98
  ...m.undos,
99
99
  { id: H.id, params: a }
100
100
  ],
101
101
  redoMutations: [
102
- ...(R = m.preRedos) != null ? R : [],
103
- p,
102
+ ...(D = m.preRedos) != null ? D : [],
103
+ f,
104
104
  ...m.redos,
105
105
  { id: H.id, params: a }
106
106
  ]
107
107
  }), !0) : !1;
108
108
  }
109
- }, kr = {
109
+ }, $r = {
110
110
  id: "sheet.command.delete-drawing",
111
111
  type: q.COMMAND,
112
112
  handler: (i) => {
@@ -131,12 +131,12 @@ const H = {
131
131
  function ys(i) {
132
132
  const t = [];
133
133
  return i.forEach((e) => {
134
- const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = Qr(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
135
- const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: p } = l;
134
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = ei(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
135
+ const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: f } = l;
136
136
  return {
137
137
  unitId: h,
138
138
  subUnitId: m,
139
- drawingId: p,
139
+ drawingId: f,
140
140
  transform: {
141
141
  ...g,
142
142
  left: g.left - d.left,
@@ -164,12 +164,12 @@ function Es(i) {
164
164
  if (d == null)
165
165
  return;
166
166
  const u = r.map((l) => {
167
- const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: p } = l, f = qr(g || {}, d, d.width || 0, d.height || 0);
167
+ const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: f } = l, p = Qr(g || {}, d, d.width || 0, d.height || 0);
168
168
  return {
169
169
  unitId: h,
170
170
  subUnitId: m,
171
- drawingId: p,
172
- transform: f,
171
+ drawingId: f,
172
+ transform: p,
173
173
  groupId: void 0
174
174
  };
175
175
  }), c = {
@@ -188,7 +188,7 @@ function Es(i) {
188
188
  });
189
189
  }), t;
190
190
  }
191
- const $r = {
191
+ const xr = {
192
192
  id: "sheet.command.group-sheet-image",
193
193
  type: q.COMMAND,
194
194
  handler: (i, t) => {
@@ -196,8 +196,8 @@ const $r = {
196
196
  if (!t) return !1;
197
197
  const s = [];
198
198
  t.forEach(({ parent: h, children: m }) => {
199
- s.push(h.unitId), m.forEach((p) => {
200
- s.push(p.unitId);
199
+ s.push(h.unitId), m.forEach((f) => {
200
+ s.push(f.unitId);
201
201
  });
202
202
  });
203
203
  const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
@@ -213,31 +213,31 @@ const $r = {
213
213
  ]
214
214
  }), !0) : !1;
215
215
  }
216
- }, Xt = {
216
+ }, zt = {
217
217
  id: "sheet.command.insert-sheet-image",
218
218
  type: q.COMMAND,
219
219
  handler: (i, t) => {
220
- var _, I, R;
221
- const e = i.get(G), n = i.get(Ze), r = i.get(oe), s = i.get(Ht);
220
+ var S, I, D;
221
+ const e = i.get(G), n = i.get(Ze), r = i.get(oe), s = i.get(Vt);
222
222
  if (!t) return !1;
223
- 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: Xt.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 } };
224
- return lr([...(_ = m.preRedos) != null ? _ : [], p, ...m.redos], e) ? (n.pushUndoRedo({
223
+ 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: zt.id, params: t }), f = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, p = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
224
+ return lr([...(S = m.preRedos) != null ? S : [], f, ...m.redos], e) ? (n.pushUndoRedo({
225
225
  unitID: u,
226
226
  undoMutations: [
227
227
  ...(I = m.preUndos) != null ? I : [],
228
- f,
228
+ p,
229
229
  ...m.undos,
230
230
  { id: H.id, params: a }
231
231
  ],
232
232
  redoMutations: [
233
- ...(R = m.preRedos) != null ? R : [],
234
- p,
233
+ ...(D = m.preRedos) != null ? D : [],
234
+ f,
235
235
  ...m.redos,
236
236
  { id: H.id, params: a }
237
237
  ]
238
238
  }), !0) : !1;
239
239
  }
240
- }, xr = {
240
+ }, Wr = {
241
241
  id: "sheet.command.set-drawing-arrange",
242
242
  type: q.COMMAND,
243
243
  handler: (i, t) => {
@@ -258,7 +258,7 @@ const $r = {
258
258
  ]
259
259
  }), !0) : !1;
260
260
  }
261
- }, zt = {
261
+ }, Kt = {
262
262
  id: "sheet.command.set-sheet-image",
263
263
  type: q.COMMAND,
264
264
  handler: (i, t) => {
@@ -277,7 +277,7 @@ const $r = {
277
277
  ]
278
278
  }), !0) : !1;
279
279
  }
280
- }, Wr = {
280
+ }, Br = {
281
281
  id: "sheet.command.ungroup-sheet-image",
282
282
  type: q.COMMAND,
283
283
  handler: (i, t) => {
@@ -285,8 +285,8 @@ const $r = {
285
285
  if (!t) return !1;
286
286
  const s = [];
287
287
  t.forEach(({ parent: h, children: m }) => {
288
- s.push(h.unitId), m.forEach((p) => {
289
- s.push(p.unitId);
288
+ s.push(h.unitId), m.forEach((f) => {
289
+ s.push(f.unitId);
290
290
  });
291
291
  });
292
292
  const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
@@ -307,45 +307,45 @@ var Ts = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
307
307
  for (var r = n > 1 ? void 0 : n ? Ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
308
308
  (o = i[s]) && (r = o(r) || r);
309
309
  return r;
310
- }, ie = (i, t) => (e, n) => t(e, n, i);
310
+ }, Q = (i, t) => (e, n) => t(e, n, i);
311
311
  function Us(i, t, e) {
312
312
  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));
313
313
  return { rotatedWidth: r, rotatedHeight: s };
314
314
  }
315
- function Sn(i, t, e, n, r) {
316
- var _;
315
+ function _n(i, t, e, n, r) {
316
+ var S;
317
317
  const { rotatedHeight: s, rotatedWidth: o } = Us(e, n, r), d = i.get(ee).getRenderById(t.unitId);
318
318
  if (!d)
319
319
  return !1;
320
- const c = (_ = d.with(X).getSkeletonParam(t.subUnitId)) == null ? void 0 : _.skeleton;
320
+ const c = (S = d.with(X).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
321
321
  if (c == null)
322
322
  return !1;
323
- 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, w = !f || Number.isNaN(f) ? 1e-3 : f;
323
+ 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, p = Math.ceil(Math.min(g, h * m)) / o, w = !p || Number.isNaN(p) ? 1e-3 : p;
324
324
  return {
325
325
  width: e * w,
326
326
  height: n * w
327
327
  };
328
328
  }
329
329
  let dt = class extends te {
330
- constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
330
+ constructor(t, e, n, r, s, o, a, d, u, c, l, g, h, m) {
331
331
  super();
332
- Q(this, "_workbookSelections");
333
- 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();
332
+ ie(this, "_workbookSelections");
333
+ 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._urlImageService = m, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
334
334
  }
335
335
  async insertFloatImage() {
336
336
  const t = await this._fileOpenerService.openFile({
337
337
  multiple: !0,
338
- accept: Kn.map((n) => `.${n.replace("image/", "")}`).join(",")
338
+ accept: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
339
339
  }), e = t.length;
340
- return e > Jn ? (this._messageService.show({
340
+ return e > Kn ? (this._messageService.show({
341
341
  type: ve.Error,
342
- content: this._localeService.t("update-status.exceedMaxCount", String(Jn))
342
+ content: this._localeService.t("update-status.exceedMaxCount", String(Kn))
343
343
  }), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
344
344
  }
345
345
  async insertCellImage() {
346
346
  const e = (await this._fileOpenerService.openFile({
347
347
  multiple: !1,
348
- accept: Kn.map((n) => `.${n.replace("image/", "")}`).join(",")
348
+ accept: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
349
349
  }))[0];
350
350
  return e ? (await this._insertCellImage(e), !0) : !1;
351
351
  }
@@ -356,11 +356,11 @@ let dt = class extends te {
356
356
  let e;
357
357
  try {
358
358
  e = await this._imageIoService.saveImage(t);
359
- } catch (_) {
360
- const I = _.message;
359
+ } catch (S) {
360
+ const I = S.message;
361
361
  I === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
362
362
  type: ve.Error,
363
- content: this._localeService.t("update-status.exceedMaxSize", String(Zn / (1024 * 1024)))
363
+ content: this._localeService.t("update-status.exceedMaxSize", String(Jn / (1024 * 1024)))
364
364
  }) : I === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
365
365
  type: ve.Error,
366
366
  content: this._localeService.t("update-status.invalidImageType")
@@ -371,15 +371,15 @@ let dt = class extends te {
371
371
  }
372
372
  if (e == null)
373
373
  return;
374
- 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 nn(u || ""), { width: h, height: m } = this._context.scene;
374
+ 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 rn(u || ""), { width: h, height: m } = this._context.scene;
375
375
  this._imageIoService.addImageSourceCache(d, a, g);
376
- let p = 1;
377
- if (c > qn || l > Qn) {
378
- const _ = qn / c, I = Qn / l;
379
- p = Math.max(_, I);
376
+ let f = 1;
377
+ if (c > Zn || l > qn) {
378
+ const S = Zn / c, I = qn / l;
379
+ f = Math.max(S, I);
380
380
  }
381
- const f = this._getImagePosition(c * p, l * p, h, m);
382
- if (f == null)
381
+ const p = this._getImagePosition(c * f, l * f, h, m);
382
+ if (p == null)
383
383
  return;
384
384
  const w = {
385
385
  unitId: r,
@@ -388,17 +388,17 @@ let dt = class extends te {
388
388
  drawingType: x.DRAWING_IMAGE,
389
389
  imageSourceType: a,
390
390
  source: d,
391
- transform: J(f, this._selectionRenderService, this._skeletonManagerService),
392
- sheetTransform: f
391
+ transform: J(p, this._selectionRenderService, this._skeletonManagerService),
392
+ sheetTransform: p
393
393
  };
394
- return this._commandService.executeCommand(Xt.id, {
394
+ return this._commandService.executeCommand(zt.id, {
395
395
  unitId: r,
396
396
  drawings: [w]
397
397
  });
398
398
  }
399
399
  // eslint-disable-next-line max-lines-per-function
400
400
  async _insertCellImage(t, e) {
401
- var I, R;
401
+ var I, D;
402
402
  let n;
403
403
  try {
404
404
  n = await this._imageIoService.saveImage(t);
@@ -406,7 +406,7 @@ let dt = class extends te {
406
406
  const C = v.message;
407
407
  C === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
408
408
  type: ve.Error,
409
- content: this._localeService.t("update-status.exceedMaxSize", String(Zn / (1024 * 1024)))
409
+ content: this._localeService.t("update-status.exceedMaxSize", String(Jn / (1024 * 1024)))
410
410
  }) : C === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
411
411
  type: ve.Error,
412
412
  content: this._localeService.t("update-status.invalidImageType")
@@ -417,14 +417,14 @@ let dt = class extends te {
417
417
  }
418
418
  if (n == null)
419
419
  return !1;
420
- const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await nn(a || "");
420
+ const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await rn(a || "");
421
421
  this._imageIoService.addImageSourceCache(o, s, c);
422
422
  const l = this._workbookSelections.getCurrentLastSelection();
423
423
  if (!l)
424
424
  return !1;
425
425
  let g = l.primary.actualRow, h = l.primary.actualColumn;
426
426
  l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
427
- const m = hn("", {}), p = Sn(
427
+ const m = un("", {}), f = _n(
428
428
  this._injector,
429
429
  {
430
430
  unitId: this._context.unitId,
@@ -436,19 +436,19 @@ let dt = class extends te {
436
436
  u,
437
437
  0
438
438
  );
439
- if (!p)
439
+ if (!f)
440
440
  return !1;
441
- const f = {
441
+ const p = {
442
442
  size: {
443
- width: p.width,
444
- height: p.height
443
+ width: f.width,
444
+ height: f.height
445
445
  },
446
446
  positionH: {
447
- relativeFrom: Bn.PAGE,
447
+ relativeFrom: Wn.PAGE,
448
448
  posOffset: 0
449
449
  },
450
450
  positionV: {
451
- relativeFrom: Wn.PARAGRAPH,
451
+ relativeFrom: xn.PARAGRAPH,
452
452
  posOffset: 0
453
453
  },
454
454
  angle: 0
@@ -459,19 +459,19 @@ let dt = class extends te {
459
459
  drawingType: x.DRAWING_IMAGE,
460
460
  imageSourceType: s,
461
461
  source: o,
462
- transform: zn(f),
463
- docTransform: f,
464
- behindDoc: Ln.FALSE,
462
+ transform: Xn(p),
463
+ docTransform: p,
464
+ behindDoc: Fn.FALSE,
465
465
  title: "",
466
466
  description: "",
467
- layoutType: Fn.INLINE,
467
+ layoutType: jn.INLINE,
468
468
  // Insert inline drawing by default.
469
- wrapText: jn.BOTH_SIDES,
469
+ wrapText: Bn.BOTH_SIDES,
470
470
  distB: 0,
471
471
  distL: 0,
472
472
  distR: 0,
473
473
  distT: 0
474
- }, _ = gn.drawing.add({
474
+ }, S = hn.drawing.add({
475
475
  documentDataModel: m,
476
476
  drawings: [w],
477
477
  selection: {
@@ -480,10 +480,10 @@ let dt = class extends te {
480
480
  endOffset: 0
481
481
  }
482
482
  });
483
- return _ ? (m.apply(_), this._commandService.syncExecuteCommand(Hn.id, {
483
+ return S ? (m.apply(S), this._commandService.syncExecuteCommand(Ln.id, {
484
484
  value: {
485
485
  [(I = e == null ? void 0 : e.row) != null ? I : g]: {
486
- [(R = e == null ? void 0 : e.col) != null ? R : h]: {
486
+ [(D = e == null ? void 0 : e.col) != null ? D : h]: {
487
487
  p: m.getSnapshot(),
488
488
  t: 1
489
489
  }
@@ -495,73 +495,79 @@ let dt = class extends te {
495
495
  }
496
496
  // eslint-disable-next-line max-lines-per-function
497
497
  async insertCellImageByUrl(t, e) {
498
- var g, h;
499
- const { width: n, height: r, image: s } = await nn(t || "");
500
- this._imageIoService.addImageSourceCache(t, de.URL, s);
501
- const o = this._workbookSelections.getCurrentLastSelection();
502
- if (!o)
498
+ var h, m;
499
+ let n = t;
500
+ try {
501
+ n = await this._urlImageService.getImage(t);
502
+ } catch (f) {
503
+ console.error(`Failed to get image from URLImageService: ${t}`, f);
504
+ }
505
+ const { width: r, height: s, image: o } = await rn(n || "");
506
+ this._imageIoService.addImageSourceCache(t, we.URL, o);
507
+ const a = this._workbookSelections.getCurrentLastSelection();
508
+ if (!a)
503
509
  return !1;
504
- const a = hn("", {}), d = Sn(
510
+ const d = un("", {}), u = _n(
505
511
  this._injector,
506
512
  {
507
513
  unitId: this._context.unitId,
508
514
  subUnitId: this._context.unit.getActiveSheet().getSheetId(),
509
- row: o.primary.actualRow,
510
- col: o.primary.actualColumn
515
+ row: a.primary.actualRow,
516
+ col: a.primary.actualColumn
511
517
  },
512
- n,
513
518
  r,
519
+ s,
514
520
  0
515
521
  );
516
- if (!d)
522
+ if (!u)
517
523
  return !1;
518
- const u = {
524
+ const c = {
519
525
  size: {
520
- width: d.width,
521
- height: d.height
526
+ width: u.width,
527
+ height: u.height
522
528
  },
523
529
  positionH: {
524
- relativeFrom: Bn.PAGE,
530
+ relativeFrom: Wn.PAGE,
525
531
  posOffset: 0
526
532
  },
527
533
  positionV: {
528
- relativeFrom: Wn.PARAGRAPH,
534
+ relativeFrom: xn.PARAGRAPH,
529
535
  posOffset: 0
530
536
  },
531
537
  angle: 0
532
- }, c = {
533
- unitId: a.getUnitId(),
534
- subUnitId: a.getUnitId(),
538
+ }, l = {
539
+ unitId: d.getUnitId(),
540
+ subUnitId: d.getUnitId(),
535
541
  drawingId: He(),
536
542
  drawingType: x.DRAWING_IMAGE,
537
- imageSourceType: de.URL,
543
+ imageSourceType: we.URL,
538
544
  source: t,
539
- transform: zn(u),
540
- docTransform: u,
541
- behindDoc: Ln.FALSE,
545
+ transform: Xn(c),
546
+ docTransform: c,
547
+ behindDoc: Fn.FALSE,
542
548
  title: "",
543
549
  description: "",
544
- layoutType: Fn.INLINE,
550
+ layoutType: jn.INLINE,
545
551
  // Insert inline drawing by default.
546
- wrapText: jn.BOTH_SIDES,
552
+ wrapText: Bn.BOTH_SIDES,
547
553
  distB: 0,
548
554
  distL: 0,
549
555
  distR: 0,
550
556
  distT: 0
551
- }, l = gn.drawing.add({
552
- documentDataModel: a,
553
- drawings: [c],
557
+ }, g = hn.drawing.add({
558
+ documentDataModel: d,
559
+ drawings: [l],
554
560
  selection: {
555
561
  collapsed: !0,
556
562
  startOffset: 0,
557
563
  endOffset: 0
558
564
  }
559
565
  });
560
- return l ? (a.apply(l), this._commandService.syncExecuteCommand(Hn.id, {
566
+ return g ? (d.apply(g), this._commandService.syncExecuteCommand(Ln.id, {
561
567
  value: {
562
- [(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
563
- [(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
564
- p: a.getSnapshot(),
568
+ [(h = e == null ? void 0 : e.row) != null ? h : a.primary.actualRow]: {
569
+ [(m = e == null ? void 0 : e.col) != null ? m : a.primary.actualColumn]: {
570
+ p: d.getSnapshot(),
565
571
  t: 1
566
572
  }
567
573
  }
@@ -591,10 +597,10 @@ let dt = class extends te {
591
597
  return;
592
598
  let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
593
599
  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) {
594
- const f = this._selectionRenderService.getCellWithCoordByOffset(c, l);
595
- if (f == null)
600
+ const p = this._selectionRenderService.getCellWithCoordByOffset(c, l);
601
+ if (p == null)
596
602
  return;
597
- c = f.startX, l = f.startY, d = f.actualColumn, u = f.actualRow;
603
+ c = p.startX, l = p.startY, d = p.actualColumn, u = p.actualRow;
598
604
  }
599
605
  const h = {
600
606
  column: d,
@@ -604,7 +610,7 @@ let dt = class extends te {
604
610
  }, m = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
605
611
  if (m == null)
606
612
  return;
607
- const p = {
613
+ const f = {
608
614
  column: m.actualColumn,
609
615
  columnOffset: c + t - m.startX,
610
616
  row: m.actualRow,
@@ -612,13 +618,13 @@ let dt = class extends te {
612
618
  };
613
619
  return {
614
620
  from: h,
615
- to: p
621
+ to: f
616
622
  };
617
623
  }
618
624
  _updateOrderListener() {
619
625
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
620
626
  const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
621
- this._commandService.executeCommand(xr.id, {
627
+ this._commandService.executeCommand(Wr.id, {
622
628
  unitId: e,
623
629
  subUnitId: n,
624
630
  drawingIds: r,
@@ -645,7 +651,7 @@ let dt = class extends te {
645
651
  sheetTransform: { ...c }
646
652
  };
647
653
  e.push(l);
648
- }), e.length > 0 && this._commandService.executeCommand(zt.id, {
654
+ }), e.length > 0 && this._commandService.executeCommand(Kt.id, {
649
655
  unitId: t[0].unitId,
650
656
  drawings: e
651
657
  }));
@@ -653,11 +659,11 @@ let dt = class extends te {
653
659
  }
654
660
  _groupDrawingListener() {
655
661
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
656
- this._commandService.executeCommand($r.id, t);
662
+ this._commandService.executeCommand(xr.id, t);
657
663
  const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
658
- this._commandService.syncExecuteCommand(Vt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
664
+ this._commandService.syncExecuteCommand(Gt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
659
665
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
660
- this._commandService.executeCommand(Wr.id, t);
666
+ this._commandService.executeCommand(Br.id, t);
661
667
  }));
662
668
  }
663
669
  _focusDrawingListener() {
@@ -669,25 +675,26 @@ let dt = class extends te {
669
675
  }
670
676
  };
671
677
  dt = Os([
672
- ie(1, A(X)),
673
- ie(2, G),
674
- ie(3, Je),
675
- ie(4, is),
676
- ie(5, as),
677
- ie(6, oe),
678
- ie(7, ae),
679
- ie(8, ur),
680
- ie(9, Ur),
681
- ie(10, A(Te)),
682
- ie(11, A(ut)),
683
- ie(12, A(qe))
678
+ Q(1, A(X)),
679
+ Q(2, G),
680
+ Q(3, Je),
681
+ Q(4, is),
682
+ Q(5, as),
683
+ Q(6, oe),
684
+ Q(7, ae),
685
+ Q(8, ur),
686
+ Q(9, Pr),
687
+ Q(10, A(Te)),
688
+ Q(11, A(ut)),
689
+ Q(12, A(qe)),
690
+ Q(13, hr)
684
691
  ], dt);
685
- const Kt = {
692
+ const Jt = {
686
693
  id: "sheet.command.insert-float-image",
687
694
  type: q.COMMAND,
688
695
  handler: async (i, t) => {
689
696
  var o, a;
690
- const e = i.get(le), n = i.get(ee), r = (o = bn(
697
+ const e = i.get(de), n = i.get(ee), r = (o = Dn(
691
698
  k.UNIVER_SHEET,
692
699
  e,
693
700
  n
@@ -701,13 +708,13 @@ const Kt = {
701
708
  } else
702
709
  return (a = r.insertFloatImage()) != null ? a : !1;
703
710
  }
704
- }, yn = {
711
+ }, Mn = {
705
712
  id: "sheet.command.insert-cell-image",
706
713
  type: q.COMMAND,
707
714
  handler: (i) => {
708
715
  var n, r;
709
- const t = i.get(le), e = i.get(ee);
710
- return (r = (n = bn(
716
+ const t = i.get(de), e = i.get(ee);
717
+ return (r = (n = Dn(
711
718
  k.UNIVER_SHEET,
712
719
  t,
713
720
  e
@@ -731,7 +738,7 @@ const Kt = {
731
738
  sheetTransform: j(g, r)
732
739
  };
733
740
  }).filter((c) => c != null);
734
- return e.syncExecuteCommand(zt.id, {
741
+ return e.syncExecuteCommand(Kt.id, {
735
742
  unitId: a,
736
743
  drawings: d
737
744
  }) ? (e.syncExecuteCommand(H.id, [a]), !0) : !1;
@@ -741,26 +748,26 @@ var Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
741
748
  for (var r = n > 1 ? void 0 : n ? Ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
742
749
  (o = i[s]) && (r = o(r) || r);
743
750
  return r;
744
- }, an = (i, t) => (e, n) => t(e, n, i), ye = /* @__PURE__ */ ((i) => (i.CELL_ADDRESS = "cellAddress", i.COLUMN_VALUE = "columnValue", i))(ye || {});
745
- const En = gi("sheets-drawing-ui.batch-save-images.service");
746
- function vn(i) {
751
+ }, Tt = (i, t) => (e, n) => t(e, n, i), ye = /* @__PURE__ */ ((i) => (i.CELL_ADDRESS = "cellAddress", i.COLUMN_VALUE = "columnValue", i))(ye || {});
752
+ const yn = mi("sheets-drawing-ui.batch-save-images.service");
753
+ function Sn(i) {
747
754
  let t = "", e = i;
748
755
  for (; e >= 0; )
749
756
  t = String.fromCharCode(e % 26 + 65) + t, e = Math.floor(e / 26) - 1;
750
757
  return t;
751
758
  }
752
- function At(i, t) {
753
- return `${vn(t)}${i + 1}`;
759
+ function Nt(i, t) {
760
+ return `${Sn(t)}${i + 1}`;
754
761
  }
755
762
  function Ns(i) {
756
- const t = At(i.startRow, i.startColumn), e = At(i.endRow, i.endColumn);
763
+ const t = Nt(i.startRow, i.startColumn), e = Nt(i.endRow, i.endColumn);
757
764
  return t === e ? t : `${t}:${e}`;
758
765
  }
759
- function rr(i) {
766
+ function nr(i) {
760
767
  var t, e, n, r;
761
768
  return !!((e = (t = i == null ? void 0 : i.p) == null ? void 0 : t.drawingsOrder) != null && e.length && ((r = (n = i == null ? void 0 : i.p) == null ? void 0 : n.drawingsOrder) == null ? void 0 : r.length) > 0);
762
769
  }
763
- function ir(i) {
770
+ function rr(i) {
764
771
  var n, r, s;
765
772
  if (!((r = (n = i.p) == null ? void 0 : n.drawingsOrder) != null && r.length) || !((s = i.p) != null && s.drawings))
766
773
  return null;
@@ -768,81 +775,80 @@ function ir(i) {
768
775
  return !e || !("source" in e) || !("imageSourceType" in e) ? null : e;
769
776
  }
770
777
  function cn(i, t) {
771
- if (t === de.BASE64) {
778
+ if (t === we.BASE64) {
772
779
  const e = i.match(/^data:image\/(\w+);/);
773
780
  if (e)
774
781
  return e[1] === "jpeg" ? "jpg" : e[1];
775
782
  }
776
- if (t === de.URL) {
783
+ if (t === we.URL) {
777
784
  const e = i.match(/\.(\w+)(?:\?|$)/);
778
785
  if (e)
779
786
  return e[1].toLowerCase();
780
787
  }
781
788
  return "png";
782
789
  }
783
- async function dn(i, t) {
784
- if (t === de.BASE64)
790
+ async function ir(i, t) {
791
+ if (t === we.BASE64)
785
792
  return (await fetch(i)).blob();
786
- if (t === de.URL)
793
+ if (t === we.URL)
787
794
  return (await fetch(i)).blob();
788
795
  throw new Error("UUID image type requires additional handling");
789
796
  }
790
- let In = class extends te {
791
- constructor(t, e, n) {
792
- super();
793
- Q(this, "_urlImageDownloader", null);
794
- this._univerInstanceService = t, this._selectionService = e, this._imageIoService = n;
797
+ let vn = class extends te {
798
+ constructor(i, t, e, n) {
799
+ super(), this._univerInstanceService = i, this._selectionService = t, this._imageIoService = e, this._urlImageService = n;
795
800
  }
796
- registerURLImageDownloader(t) {
797
- return this._urlImageDownloader = t, mi(() => {
798
- this._urlImageDownloader === t && (this._urlImageDownloader = null);
799
- });
801
+ /**
802
+ * @deprecated Use IURLImageService directly
803
+ */
804
+ registerURLImageDownloader(i) {
805
+ return this._urlImageService.registerURLImageDownloader(i);
800
806
  }
801
807
  getCellImagesInSelection() {
802
- const t = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
808
+ const i = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
809
+ if (!i) return [];
810
+ const t = i.getActiveSheet();
803
811
  if (!t) return [];
804
- const e = t.getActiveSheet();
805
- if (!e) return [];
806
- const n = this._selectionService.getCurrentSelections();
807
- if (!n || n.length === 0) return [];
808
- const r = e.getCellMatrix(), s = [];
809
- for (const o of n) {
810
- const { startRow: a, endRow: d, startColumn: u, endColumn: c } = o.range;
811
- for (let l = a; l <= d; l++)
812
- for (let g = u; g <= c; g++) {
813
- const h = r.getValue(l, g);
814
- if (rr(h)) {
815
- const m = ir(h);
816
- m && s.push({
817
- row: l,
818
- col: g,
819
- cellAddress: At(l, g),
820
- source: m.source,
821
- imageSourceType: m.imageSourceType,
822
- imageId: m.drawingId
812
+ const e = this._selectionService.getCurrentSelections();
813
+ if (!e || e.length === 0) return [];
814
+ const n = t.getCellMatrix(), r = [];
815
+ for (const s of e) {
816
+ const { startRow: o, endRow: a, startColumn: d, endColumn: u } = s.range;
817
+ for (let c = o; c <= a; c++)
818
+ for (let l = d; l <= u; l++) {
819
+ const g = n.getValue(c, l);
820
+ if (nr(g)) {
821
+ const h = rr(g);
822
+ h && r.push({
823
+ row: c,
824
+ col: l,
825
+ cellAddress: Nt(c, l),
826
+ source: h.source,
827
+ imageSourceType: h.imageSourceType,
828
+ imageId: h.drawingId
823
829
  });
824
830
  }
825
831
  }
826
832
  }
827
- return s;
833
+ return r;
828
834
  }
829
- getCellImagesFromRanges(t, e, n) {
830
- const r = this._univerInstanceService.getUnit(t, k.UNIVER_SHEET);
835
+ getCellImagesFromRanges(i, t, e) {
836
+ const n = this._univerInstanceService.getUnit(i, k.UNIVER_SHEET);
837
+ if (!n) return [];
838
+ const r = n.getSheetBySheetId(t);
831
839
  if (!r) return [];
832
- const s = r.getSheetBySheetId(e);
833
- if (!s) return [];
834
- const o = s.getCellMatrix(), a = [];
835
- for (const d of n) {
836
- const { startRow: u, endRow: c, startColumn: l, endColumn: g } = d;
837
- for (let h = u; h <= c; h++)
838
- for (let m = l; m <= g; m++) {
839
- const p = o.getValue(h, m);
840
- if (rr(p)) {
841
- const f = ir(p);
842
- f && a.push({
843
- row: h,
844
- col: m,
845
- cellAddress: At(h, m),
840
+ const s = r.getCellMatrix(), o = [];
841
+ for (const a of e) {
842
+ const { startRow: d, endRow: u, startColumn: c, endColumn: l } = a;
843
+ for (let g = d; g <= u; g++)
844
+ for (let h = c; h <= l; h++) {
845
+ const m = s.getValue(g, h);
846
+ if (nr(m)) {
847
+ const f = rr(m);
848
+ f && o.push({
849
+ row: g,
850
+ col: h,
851
+ cellAddress: Nt(g, h),
846
852
  source: f.source,
847
853
  imageSourceType: f.imageSourceType,
848
854
  imageId: f.drawingId
@@ -850,201 +856,195 @@ let In = class extends te {
850
856
  }
851
857
  }
852
858
  }
853
- return a;
859
+ return o;
854
860
  }
855
861
  getDataColumns() {
856
- var g, h, m, p;
857
- const t = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
862
+ var l, g, h, m;
863
+ const i = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
864
+ if (!i) return [];
865
+ const t = i.getActiveSheet();
858
866
  if (!t) return [];
859
- const e = t.getActiveSheet();
860
- if (!e) return [];
861
- const n = this._selectionService.getCurrentSelections();
862
- if (!n || n.length === 0) return [];
863
- const r = e.getCellMatrix(), s = r.getDataRange();
864
- let o = 1 / 0, a = -1 / 0;
865
- const d = /* @__PURE__ */ new Set();
866
- for (const f of n) {
867
- o = Math.min(o, f.range.startRow), a = Math.max(a, f.range.endRow);
868
- for (let w = f.range.startColumn; w <= f.range.endColumn; w++)
869
- d.add(w);
867
+ const e = this._selectionService.getCurrentSelections();
868
+ if (!e || e.length === 0) return [];
869
+ const n = t.getCellMatrix(), r = n.getDataRange();
870
+ let s = 1 / 0, o = -1 / 0;
871
+ const a = /* @__PURE__ */ new Set();
872
+ for (const f of e) {
873
+ s = Math.min(s, f.range.startRow), o = Math.max(o, f.range.endRow);
874
+ for (let p = f.range.startColumn; p <= f.range.endColumn; p++)
875
+ a.add(p);
870
876
  }
871
- const u = /* @__PURE__ */ new Set();
872
- for (let f = s.startColumn; f <= s.endColumn; f++)
873
- if (!d.has(f))
874
- for (let w = o; w <= a; w++) {
875
- const _ = r.getValue(w, f);
876
- if (_ && (((g = _.v) == null ? void 0 : g.toString()) || ((p = (m = (h = _.p) == null ? void 0 : h.body) == null ? void 0 : m.dataStream) == null ? void 0 : p.trim()) || "")) {
877
- u.add(f);
877
+ const d = /* @__PURE__ */ new Set();
878
+ for (let f = r.startColumn; f <= r.endColumn; f++)
879
+ if (!a.has(f))
880
+ for (let p = s; p <= o; p++) {
881
+ const w = n.getValue(p, f);
882
+ if (w && (((l = w.v) == null ? void 0 : l.toString()) || ((m = (h = (g = w.p) == null ? void 0 : g.body) == null ? void 0 : h.dataStream) == null ? void 0 : m.trim()) || "")) {
883
+ d.add(f);
878
884
  break;
879
885
  }
880
886
  }
881
- const c = [], l = Array.from(u).sort((f, w) => f - w);
882
- for (const f of l)
883
- c.push({
887
+ const u = [], c = Array.from(d).sort((f, p) => f - p);
888
+ for (const f of c)
889
+ u.push({
884
890
  index: f,
885
- label: vn(f)
891
+ label: Sn(f)
886
892
  });
887
- return c;
893
+ return u;
888
894
  }
889
- getDataColumnsForRanges(t, e, n) {
890
- var m, p, f, w;
891
- const r = this._univerInstanceService.getUnit(t, k.UNIVER_SHEET);
895
+ getDataColumnsForRanges(i, t, e) {
896
+ var h, m, f, p;
897
+ const n = this._univerInstanceService.getUnit(i, k.UNIVER_SHEET);
898
+ if (!n) return [];
899
+ const r = n.getSheetBySheetId(t);
892
900
  if (!r) return [];
893
- const s = r.getSheetBySheetId(e);
894
- if (!s) return [];
895
- const o = s.getCellMatrix(), a = o.getDataRange();
896
- let d = 1 / 0, u = -1 / 0;
897
- const c = /* @__PURE__ */ new Set();
898
- for (const _ of n) {
899
- d = Math.min(d, _.startRow), u = Math.max(u, _.endRow);
900
- for (let I = _.startColumn; I <= _.endColumn; I++)
901
- c.add(I);
901
+ const s = r.getCellMatrix(), o = s.getDataRange();
902
+ let a = 1 / 0, d = -1 / 0;
903
+ const u = /* @__PURE__ */ new Set();
904
+ for (const w of e) {
905
+ a = Math.min(a, w.startRow), d = Math.max(d, w.endRow);
906
+ for (let S = w.startColumn; S <= w.endColumn; S++)
907
+ u.add(S);
902
908
  }
903
- const l = /* @__PURE__ */ new Set();
904
- for (let _ = a.startColumn; _ <= a.endColumn; _++)
905
- if (!c.has(_))
906
- for (let I = d; I <= u; I++) {
907
- const R = o.getValue(I, _);
908
- if (R && (((m = R.v) == null ? void 0 : m.toString()) || ((w = (f = (p = R.p) == null ? void 0 : p.body) == null ? void 0 : f.dataStream) == null ? void 0 : w.trim()) || "")) {
909
- l.add(_);
909
+ const c = /* @__PURE__ */ new Set();
910
+ for (let w = o.startColumn; w <= o.endColumn; w++)
911
+ if (!u.has(w))
912
+ for (let S = a; S <= d; S++) {
913
+ const I = s.getValue(S, w);
914
+ if (I && (((h = I.v) == null ? void 0 : h.toString()) || ((p = (f = (m = I.p) == null ? void 0 : m.body) == null ? void 0 : f.dataStream) == null ? void 0 : p.trim()) || "")) {
915
+ c.add(w);
910
916
  break;
911
917
  }
912
918
  }
913
- const g = [], h = Array.from(l).sort((_, I) => _ - I);
914
- for (const _ of h)
915
- g.push({
916
- index: _,
917
- label: vn(_)
919
+ const l = [], g = Array.from(c).sort((w, S) => w - S);
920
+ for (const w of g)
921
+ l.push({
922
+ index: w,
923
+ label: Sn(w)
918
924
  });
919
- return g;
925
+ return l;
920
926
  }
921
927
  getSelectionRangeNotation() {
922
- const t = this._selectionService.getCurrentSelections();
923
- return !t || t.length === 0 ? "" : t.map((e) => Ns(e.range)).join(", ");
928
+ const i = this._selectionService.getCurrentSelections();
929
+ return !i || i.length === 0 ? "" : i.map((t) => Ns(t.range)).join(", ");
924
930
  }
925
931
  getSelectionRowRange() {
926
- const t = this._selectionService.getCurrentSelections();
927
- if (!t || t.length === 0) return null;
928
- let e = 1 / 0, n = -1 / 0;
929
- for (const r of t)
930
- e = Math.min(e, r.range.startRow), n = Math.max(n, r.range.endRow);
931
- return { startRow: e, endRow: n };
932
+ const i = this._selectionService.getCurrentSelections();
933
+ if (!i || i.length === 0) return null;
934
+ let t = 1 / 0, e = -1 / 0;
935
+ for (const n of i)
936
+ t = Math.min(t, n.range.startRow), e = Math.max(e, n.range.endRow);
937
+ return { startRow: t, endRow: e };
932
938
  }
933
939
  getSelectionColumnIndices() {
934
- const t = this._selectionService.getCurrentSelections();
935
- if (!t || t.length === 0) return /* @__PURE__ */ new Set();
936
- const e = /* @__PURE__ */ new Set();
937
- for (const n of t)
938
- for (let r = n.range.startColumn; r <= n.range.endColumn; r++)
939
- e.add(r);
940
- return e;
941
- }
942
- generateFileName(t, e) {
943
- var o, a, d, u;
944
- const n = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET), r = cn(t.source, t.imageSourceType), s = [];
945
- for (const c of e.fileNameParts)
946
- if (c === "cellAddress")
947
- s.push(t.cellAddress);
948
- else if (c === "columnValue" && e.columnIndex !== void 0) {
949
- const l = n == null ? void 0 : n.getActiveSheet();
950
- if (l) {
951
- const h = l.getCellMatrix().getValue(t.row, e.columnIndex);
952
- if (h) {
953
- const m = ((o = h.v) == null ? void 0 : o.toString()) || ((u = (d = (a = h.p) == null ? void 0 : a.body) == null ? void 0 : d.dataStream) == null ? void 0 : u.trim()) || "";
954
- if (m) {
955
- const p = m.replace(/[<>:"/\\|?*]/g, "_").trim();
956
- p && s.push(p);
940
+ const i = this._selectionService.getCurrentSelections();
941
+ if (!i || i.length === 0) return /* @__PURE__ */ new Set();
942
+ const t = /* @__PURE__ */ new Set();
943
+ for (const e of i)
944
+ for (let n = e.range.startColumn; n <= e.range.endColumn; n++)
945
+ t.add(n);
946
+ return t;
947
+ }
948
+ generateFileName(i, t) {
949
+ var s, o, a, d;
950
+ const e = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET), n = cn(i.source, i.imageSourceType), r = [];
951
+ for (const u of t.fileNameParts)
952
+ if (u === "cellAddress")
953
+ r.push(i.cellAddress);
954
+ else if (u === "columnValue" && t.columnIndex !== void 0) {
955
+ const c = e == null ? void 0 : e.getActiveSheet();
956
+ if (c) {
957
+ const g = c.getCellMatrix().getValue(i.row, t.columnIndex);
958
+ if (g) {
959
+ const h = ((s = g.v) == null ? void 0 : s.toString()) || ((d = (a = (o = g.p) == null ? void 0 : o.body) == null ? void 0 : a.dataStream) == null ? void 0 : d.trim()) || "";
960
+ if (h) {
961
+ const m = h.replace(/[<>:"/\\|?*]/g, "_").trim();
962
+ m && r.push(m);
957
963
  }
958
964
  }
959
965
  }
960
966
  }
961
- return s.length === 0 ? `${t.cellAddress}.${r}` : `${s.join("_")}.${r}`;
962
- }
963
- generateFileNameWithContext(t, e, n, r) {
964
- var d, u, c, l;
965
- const s = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), o = cn(t.source, t.imageSourceType), a = [];
966
- for (const g of e.fileNameParts)
967
- if (g === "cellAddress")
968
- a.push(t.cellAddress);
969
- else if (g === "columnValue" && e.columnIndex !== void 0) {
970
- const h = s == null ? void 0 : s.getSheetBySheetId(r);
971
- if (h) {
972
- const p = h.getCellMatrix().getValue(t.row, e.columnIndex);
973
- if (p) {
974
- const f = ((d = p.v) == null ? void 0 : d.toString()) || ((l = (c = (u = p.p) == null ? void 0 : u.body) == null ? void 0 : c.dataStream) == null ? void 0 : l.trim()) || "";
967
+ return r.length === 0 ? `${i.cellAddress}.${n}` : `${r.join("_")}.${n}`;
968
+ }
969
+ generateFileNameWithContext(i, t, e, n) {
970
+ var a, d, u, c;
971
+ const r = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET), s = cn(i.source, i.imageSourceType), o = [];
972
+ for (const l of t.fileNameParts)
973
+ if (l === "cellAddress")
974
+ o.push(i.cellAddress);
975
+ else if (l === "columnValue" && t.columnIndex !== void 0) {
976
+ const g = r == null ? void 0 : r.getSheetBySheetId(n);
977
+ if (g) {
978
+ const m = g.getCellMatrix().getValue(i.row, t.columnIndex);
979
+ if (m) {
980
+ const f = ((a = m.v) == null ? void 0 : a.toString()) || ((c = (u = (d = m.p) == null ? void 0 : d.body) == null ? void 0 : u.dataStream) == null ? void 0 : c.trim()) || "";
975
981
  if (f) {
976
- const w = f.replace(/[<>:"/\\|?*]/g, "_").trim();
977
- w && a.push(w);
982
+ const p = f.replace(/[<>:"/\\|?*]/g, "_").trim();
983
+ p && o.push(p);
978
984
  }
979
985
  }
980
986
  }
981
987
  }
982
- return a.length === 0 ? `${t.cellAddress}.${o}` : `${a.join("_")}.${o}`;
988
+ return o.length === 0 ? `${i.cellAddress}.${s}` : `${o.join("_")}.${s}`;
983
989
  }
984
- async saveImages(t, e) {
985
- var s;
986
- const n = await window.showDirectoryPicker({ mode: "readwrite" }), r = /* @__PURE__ */ new Map();
987
- for (const o of t) {
988
- let a = this.generateFileName(o, e);
989
- const d = a.replace(/\.\w+$/, ""), u = ((s = a.match(/\.\w+$/)) == null ? void 0 : s[0]) || ".png", c = r.get(d) || 0;
990
- c > 0 && (a = `${d}_${c}${u}`), r.set(d, c + 1);
990
+ async saveImages(i, t) {
991
+ var r;
992
+ const e = await window.showDirectoryPicker({ mode: "readwrite" }), n = /* @__PURE__ */ new Map();
993
+ for (const s of i) {
994
+ let o = this.generateFileName(s, t);
995
+ const a = o.replace(/\.\w+$/, ""), d = ((r = o.match(/\.\w+$/)) == null ? void 0 : r[0]) || ".png", u = n.get(a) || 0;
996
+ u > 0 && (o = `${a}_${u}${d}`), n.set(a, u + 1);
991
997
  try {
992
- const l = await this._getImageBlob(o), h = await (await n.getFileHandle(a, { create: !0 })).createWritable();
993
- await h.write(l), await h.close();
994
- } catch (l) {
995
- throw console.error(`Failed to save image ${a}:`, l), l;
998
+ const c = await this._getImageBlob(s), g = await (await e.getFileHandle(o, { create: !0 })).createWritable();
999
+ await g.write(c), await g.close();
1000
+ } catch (c) {
1001
+ throw console.error(`Failed to save image ${o}:`, c), c;
996
1002
  }
997
1003
  }
998
1004
  }
999
- async saveImagesWithContext(t, e, n, r) {
1000
- var a;
1001
- const s = await window.showDirectoryPicker({ mode: "readwrite" }), o = /* @__PURE__ */ new Map();
1002
- for (const d of t) {
1003
- let u = this.generateFileNameWithContext(d, e, n, r);
1004
- const c = u.replace(/\.\w+$/, ""), l = ((a = u.match(/\.\w+$/)) == null ? void 0 : a[0]) || ".png", g = o.get(c) || 0;
1005
- g > 0 && (u = `${c}_${g}${l}`), o.set(c, g + 1);
1005
+ async saveImagesWithContext(i, t, e, n) {
1006
+ var o;
1007
+ const r = await window.showDirectoryPicker({ mode: "readwrite" }), s = /* @__PURE__ */ new Map();
1008
+ for (const a of i) {
1009
+ let d = this.generateFileNameWithContext(a, t, e, n);
1010
+ const u = d.replace(/\.\w+$/, ""), c = ((o = d.match(/\.\w+$/)) == null ? void 0 : o[0]) || ".png", l = s.get(u) || 0;
1011
+ l > 0 && (d = `${u}_${l}${c}`), s.set(u, l + 1);
1006
1012
  try {
1007
- const h = await this._getImageBlob(d), p = await (await s.getFileHandle(u, { create: !0 })).createWritable();
1008
- await p.write(h), await p.close();
1009
- } catch (h) {
1010
- throw console.error(`Failed to save image ${u}:`, h), h;
1013
+ const g = await this._getImageBlob(a), m = await (await r.getFileHandle(d, { create: !0 })).createWritable();
1014
+ await m.write(g), await m.close();
1015
+ } catch (g) {
1016
+ throw console.error(`Failed to save image ${d}:`, g), g;
1011
1017
  }
1012
1018
  }
1013
1019
  }
1014
- async downloadSingleImage(t) {
1015
- const e = cn(t.source, t.imageSourceType), n = `${t.cellAddress}.${e}`;
1020
+ async downloadSingleImage(i) {
1021
+ const t = cn(i.source, i.imageSourceType), e = `${i.cellAddress}.${t}`;
1016
1022
  try {
1017
- const r = await this._getImageBlob(t), s = URL.createObjectURL(r), o = document.createElement("a");
1018
- o.href = s, o.download = n, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(s);
1019
- } catch (r) {
1020
- throw console.error(`Failed to download image ${n}:`, r), r;
1023
+ const n = await this._getImageBlob(i), r = URL.createObjectURL(n), s = document.createElement("a");
1024
+ s.href = r, s.download = e, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(r);
1025
+ } catch (n) {
1026
+ throw console.error(`Failed to download image ${e}:`, n), n;
1021
1027
  }
1022
1028
  }
1023
- async _getImageBlob(t) {
1024
- if (t.imageSourceType === de.UUID) {
1025
- const e = await this._imageIoService.getImage(t.source);
1026
- return dn(e, de.URL);
1029
+ async _getImageBlob(i) {
1030
+ if (i.imageSourceType === we.UUID) {
1031
+ const t = await this._imageIoService.getImage(i.source);
1032
+ return ir(t, we.URL);
1027
1033
  }
1028
- if (t.imageSourceType === de.URL && this._urlImageDownloader)
1029
- try {
1030
- const e = await this._urlImageDownloader(t.source);
1031
- return dn(e, de.BASE64);
1032
- } catch (e) {
1033
- console.error(`Custom downloader failed for ${t.source}, falling back to default fetch:`, e);
1034
- }
1035
- return dn(t.source, t.imageSourceType);
1034
+ return i.imageSourceType === we.URL ? this._urlImageService.downloadImage(i.source) : ir(i.source, i.imageSourceType);
1036
1035
  }
1037
1036
  };
1038
- In = As([
1039
- an(0, le),
1040
- an(1, A(ut)),
1041
- an(2, hr)
1042
- ], In);
1037
+ vn = As([
1038
+ Tt(0, de),
1039
+ Tt(1, A(ut)),
1040
+ Tt(2, gr),
1041
+ Tt(3, hr)
1042
+ ], vn);
1043
1043
  const ze = "sheet.dialog.batch-save-images", ct = {
1044
1044
  id: "sheet.command.save-cell-images",
1045
1045
  type: q.COMMAND,
1046
1046
  handler: async (i) => {
1047
- const t = i.get(Mn), e = i.get(En), n = e.getCellImagesInSelection();
1047
+ const t = i.get(bn), e = i.get(yn), n = e.getCellImagesInSelection();
1048
1048
  if (n.length === 1)
1049
1049
  try {
1050
1050
  return await e.downloadSingleImage(n[0]), !0;
@@ -1065,26 +1065,26 @@ const ze = "sheet.dialog.batch-save-images", ct = {
1065
1065
  onClose: () => t.close(ze)
1066
1066
  }), !0;
1067
1067
  }
1068
- }, Br = "COMPONENT_SHEET_DRAWING_PANEL", jr = {
1068
+ }, jr = "COMPONENT_SHEET_DRAWING_PANEL", Fr = {
1069
1069
  id: "sidebar.operation.sheet-image",
1070
1070
  type: q.COMMAND,
1071
1071
  handler: async (i, t) => {
1072
- const e = i.get(cs), n = i.get(Te), r = i.get(le), s = i.get(G);
1072
+ const e = i.get(cs), n = i.get(Te), r = i.get(de), s = i.get(G);
1073
1073
  return se(r) ? (t.value === "open" ? e.open({
1074
1074
  header: { title: n.t("sheetImage.panel.title") },
1075
- children: { label: Br },
1075
+ children: { label: jr },
1076
1076
  onClose: () => {
1077
- s.syncExecuteCommand(Vt.id, []);
1077
+ s.syncExecuteCommand(Gt.id, []);
1078
1078
  },
1079
1079
  width: 360
1080
1080
  }) : e.close(), !0) : !1;
1081
1081
  }
1082
- }, Fr = {
1082
+ }, Lr = {
1083
1083
  id: "sheet.operation.edit-sheet-image",
1084
1084
  type: q.OPERATION,
1085
1085
  handler: (i, t) => {
1086
1086
  const e = i.get(G);
1087
- return t == null ? !1 : (e.syncExecuteCommand(Vt.id, [t]), e.executeCommand(jr.id, { value: "open" }), !0);
1087
+ return t == null ? !1 : (e.syncExecuteCommand(Gt.id, [t]), e.executeCommand(Fr.id, { value: "open" }), !0);
1088
1088
  }
1089
1089
  }, ks = "sheets-drawing-ui.config", sr = {};
1090
1090
  var $s = Object.getOwnPropertyDescriptor, xs = (i, t, e, n) => {
@@ -1092,14 +1092,14 @@ var $s = Object.getOwnPropertyDescriptor, xs = (i, t, e, n) => {
1092
1092
  (o = i[s]) && (r = o(r) || r);
1093
1093
  return r;
1094
1094
  }, ce = (i, t) => (e, n) => t(e, n, i);
1095
- let Nt = class extends fi {
1095
+ let kt = class extends fi {
1096
1096
  constructor(t, e, n, r, s, o, a, d, u, c) {
1097
1097
  super();
1098
- Q(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
1098
+ ie(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
1099
1099
  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();
1100
1100
  }
1101
1101
  _init() {
1102
- this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(er(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(er(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
1102
+ this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
1103
1103
  }
1104
1104
  _setupLoadingStatus() {
1105
1105
  const t = "image-upload-loading";
@@ -1159,19 +1159,19 @@ let Nt = class extends fi {
1159
1159
  if (m && m.disablePopup)
1160
1160
  return;
1161
1161
  r == null || r.dispose();
1162
- const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
1162
+ const f = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
1163
1163
  r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
1164
1164
  componentKey: Ss,
1165
1165
  direction: "horizontal",
1166
1166
  offset: [2, 0],
1167
1167
  extraProps: {
1168
- menuItems: p || this._getImageMenuItems(c, l, g, h)
1168
+ menuItems: f || this._getImageMenuItems(c, l, g, h)
1169
1169
  }
1170
1170
  }));
1171
1171
  })
1172
1172
  ), this.disposeWithMe(
1173
1173
  n.clearControl$.subscribe(() => {
1174
- r == null || r.dispose(), this._contextService.setContextValue(Ye, !1), this._commandService.syncExecuteCommand(Vt.id, []);
1174
+ r == null || r.dispose(), this._contextService.setContextValue(Ye, !1), this._commandService.syncExecuteCommand(Gt.id, []);
1175
1175
  })
1176
1176
  ), this.disposeWithMe(
1177
1177
  this._contextService.contextChanged$.subscribe((o) => {
@@ -1188,7 +1188,7 @@ let Nt = class extends fi {
1188
1188
  {
1189
1189
  label: "image-popup.edit",
1190
1190
  index: 0,
1191
- commandId: Fr.id,
1191
+ commandId: Lr.id,
1192
1192
  commandParams: { unitId: t, subUnitId: e, drawingId: n },
1193
1193
  disable: r === x.DRAWING_DOM
1194
1194
  },
@@ -1216,34 +1216,34 @@ let Nt = class extends fi {
1216
1216
  ];
1217
1217
  }
1218
1218
  };
1219
- Nt = xs([
1219
+ kt = xs([
1220
1220
  ce(0, A(qe)),
1221
1221
  ce(1, A(Te)),
1222
1222
  ce(2, ae),
1223
- ce(3, A(ni)),
1223
+ ce(3, A(ri)),
1224
1224
  ce(4, ee),
1225
- ce(5, le),
1226
- ce(6, Ur),
1225
+ ce(5, de),
1226
+ ce(6, Pr),
1227
1227
  ce(7, ur),
1228
- ce(8, hr),
1228
+ ce(8, gr),
1229
1229
  ce(9, G)
1230
- ], Nt);
1230
+ ], kt);
1231
1231
  var Ws = Object.getOwnPropertyDescriptor, Bs = (i, t, e, n) => {
1232
1232
  for (var r = n > 1 ? void 0 : n ? Ws(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1233
1233
  (o = i[s]) && (r = o(r) || r);
1234
1234
  return r;
1235
- }, Tt = (i, t) => (e, n) => t(e, n, i);
1236
- let Cn = class extends te {
1235
+ }, Ot = (i, t) => (e, n) => t(e, n, i);
1236
+ let In = class extends te {
1237
1237
  constructor(t, e, n, r, s) {
1238
1238
  super();
1239
- Q(this, "_isSetCursor", !1);
1239
+ ie(this, "_isSetCursor", !1);
1240
1240
  this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
1241
1241
  }
1242
1242
  _initHover() {
1243
1243
  this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Ds(33)).subscribe((t) => {
1244
1244
  var n, r;
1245
1245
  let e = [];
1246
- 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(ei.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
1246
+ 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(ti.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
1247
1247
  }));
1248
1248
  }
1249
1249
  _initImageClick() {
@@ -1257,18 +1257,18 @@ let Cn = class extends te {
1257
1257
  }));
1258
1258
  }
1259
1259
  };
1260
- Cn = Bs([
1261
- Tt(1, A(ri)),
1262
- Tt(2, A(ut)),
1263
- Tt(3, A(Ar)),
1264
- Tt(4, A(X))
1265
- ], Cn);
1260
+ In = Bs([
1261
+ Ot(1, A(ii)),
1262
+ Ot(2, A(ut)),
1263
+ Ot(3, A(Nr)),
1264
+ Ot(4, A(X))
1265
+ ], In);
1266
1266
  var js = Object.getOwnPropertyDescriptor, Fs = (i, t, e, n) => {
1267
1267
  for (var r = n > 1 ? void 0 : n ? js(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1268
1268
  (o = i[s]) && (r = o(r) || r);
1269
1269
  return r;
1270
- }, Ot = (i, t) => (e, n) => t(e, n, i);
1271
- let Rn = class extends te {
1270
+ }, Ut = (i, t) => (e, n) => t(e, n, i);
1271
+ let Cn = class extends te {
1272
1272
  constructor(i, t, e, n, r) {
1273
1273
  super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
1274
1274
  }
@@ -1288,21 +1288,21 @@ let Rn = class extends te {
1288
1288
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
1289
1289
  }
1290
1290
  };
1291
- Rn = Fs([
1292
- Ot(1, oe),
1293
- Ot(2, ae),
1294
- Ot(3, A(Je)),
1295
- Ot(4, A(X))
1296
- ], Rn);
1291
+ Cn = Fs([
1292
+ Ut(1, oe),
1293
+ Ut(2, ae),
1294
+ Ut(3, A(Je)),
1295
+ Ut(4, A(X))
1296
+ ], Cn);
1297
1297
  var Ls = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
1298
1298
  for (var r = n > 1 ? void 0 : n ? Ls(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1299
1299
  (o = i[s]) && (r = o(r) || r);
1300
1300
  return r;
1301
1301
  }, We = (i, t) => (e, n) => t(e, n, i);
1302
- function Lr(i, t, e) {
1302
+ function Hr(i, t, e) {
1303
1303
  var n, r, s, o;
1304
1304
  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) {
1305
- const a = e.p.drawings[e.p.drawingsOrder[0]], d = Sn(
1305
+ const a = e.p.drawings[e.p.drawingsOrder[0]], d = _n(
1306
1306
  i,
1307
1307
  {
1308
1308
  unitId: t.unitId,
@@ -1319,7 +1319,7 @@ function Lr(i, t, e) {
1319
1319
  }
1320
1320
  return !1;
1321
1321
  }
1322
- let kt = class extends te {
1322
+ let $t = class extends te {
1323
1323
  constructor(i, t, e, n, r, s) {
1324
1324
  super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
1325
1325
  }
@@ -1339,27 +1339,27 @@ let kt = class extends te {
1339
1339
  priority: xi.CELL_IMAGE,
1340
1340
  handler: (i, t, e) => {
1341
1341
  var n;
1342
- return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Lr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
1342
+ return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Hr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
1343
1343
  }
1344
1344
  }
1345
1345
  )
1346
1346
  );
1347
1347
  }
1348
1348
  };
1349
- kt = Hs([
1349
+ $t = Hs([
1350
1350
  We(0, G),
1351
- We(1, A(Ht)),
1351
+ We(1, A(Vt)),
1352
1352
  We(2, A(qe)),
1353
1353
  We(3, ae),
1354
1354
  We(4, A(ps)),
1355
- We(5, A(ii))
1356
- ], kt);
1355
+ We(5, A(si))
1356
+ ], $t);
1357
1357
  var Vs = Object.getOwnPropertyDescriptor, Gs = (i, t, e, n) => {
1358
1358
  for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1359
1359
  (o = i[s]) && (r = o(r) || r);
1360
1360
  return r;
1361
1361
  }, or = (i, t) => (e, n) => t(e, n, i);
1362
- let $t = class extends te {
1362
+ let xt = class extends te {
1363
1363
  constructor(i, t) {
1364
1364
  super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
1365
1365
  }
@@ -1369,17 +1369,17 @@ let $t = class extends te {
1369
1369
  id: "sheet-cell-image-autofill",
1370
1370
  onBeforeSubmit: (i, t, e, n) => {
1371
1371
  new wi(n).forValue((r, s, o) => {
1372
- Lr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
1372
+ Hr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
1373
1373
  });
1374
1374
  }
1375
1375
  })
1376
1376
  );
1377
1377
  }
1378
1378
  };
1379
- $t = Gs([
1380
- or(0, A(si)),
1379
+ xt = Gs([
1380
+ or(0, A(oi)),
1381
1381
  or(1, A(qe))
1382
- ], $t);
1382
+ ], xt);
1383
1383
  var Ys = Object.getOwnPropertyDescriptor, Xs = (i, t, e, n) => {
1384
1384
  for (var r = n > 1 ? void 0 : n ? Ys(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1385
1385
  (o = i[s]) && (r = o(r) || r);
@@ -1390,13 +1390,13 @@ const zs = [
1390
1390
  _i,
1391
1391
  Ve
1392
1392
  ];
1393
- let xt = class extends te {
1393
+ let Wt = class extends te {
1394
1394
  constructor(i, t, e, n, r) {
1395
1395
  super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
1396
1396
  }
1397
1397
  _setCellImage(i) {
1398
1398
  var r;
1399
- const t = hn("", {}), e = (r = bn(k.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(oi), n = gn.drawing.add({
1399
+ const t = un("", {}), e = (r = Dn(k.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(ai), n = hn.drawing.add({
1400
1400
  documentDataModel: t,
1401
1401
  drawings: [i],
1402
1402
  selection: {
@@ -1419,12 +1419,12 @@ let xt = class extends te {
1419
1419
  if (zs.includes(o)) {
1420
1420
  if (o !== Ve) {
1421
1421
  const a = () => {
1422
- this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(kn.id, {
1422
+ this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(Nn.id, {
1423
1423
  visible: !1
1424
1424
  });
1425
1425
  };
1426
1426
  ((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
1427
- ` ? (this._commandService.syncExecuteCommand(kn.id, {
1427
+ ` ? (this._commandService.syncExecuteCommand(Nn.id, {
1428
1428
  visible: !1
1429
1429
  }), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
1430
1430
  id: "sheet-cell-image-copy-paste",
@@ -1452,27 +1452,27 @@ let xt = class extends te {
1452
1452
  );
1453
1453
  }
1454
1454
  };
1455
- xt = Xs([
1455
+ Wt = Xs([
1456
1456
  nt(0, G),
1457
- nt(1, le),
1458
- nt(2, Mn),
1457
+ nt(1, de),
1458
+ nt(2, bn),
1459
1459
  nt(3, ee),
1460
1460
  nt(4, A(Te))
1461
- ], xt);
1461
+ ], Wt);
1462
1462
  var Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e, n) => {
1463
1463
  for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1464
1464
  (o = i[s]) && (r = o(r) || r);
1465
1465
  return r;
1466
1466
  }, rt = (i, t) => (e, n) => t(e, n, i);
1467
- const Hr = "image/png";
1467
+ const Vr = "image/png";
1468
1468
  function Zs(i) {
1469
1469
  const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
1470
1470
  for (let s = 0; s < n; s++)
1471
1471
  r[s] = e.charCodeAt(s);
1472
- return new Blob([r], { type: Hr });
1472
+ return new Blob([r], { type: Vr });
1473
1473
  }
1474
1474
  function qs(i) {
1475
- const t = new ClipboardItem({ [Hr]: Zs(i) });
1475
+ const t = new ClipboardItem({ [Vr]: Zs(i) });
1476
1476
  navigator.clipboard.write([t]).catch((e) => {
1477
1477
  console.error("Could not copy image using clipboard API: ", e);
1478
1478
  });
@@ -1493,10 +1493,10 @@ const ar = [
1493
1493
  Le.SPECIAL_PASTE_FORMAT,
1494
1494
  Le.SPECIAL_PASTE_FORMULA
1495
1495
  ];
1496
- let Wt = class extends te {
1496
+ let Bt = class extends te {
1497
1497
  constructor(t, e, n, r, s) {
1498
1498
  super();
1499
- Q(this, "_copyInfo");
1499
+ ie(this, "_copyInfo");
1500
1500
  this._sheetClipboardService = t, this._renderManagerService = e, this._drawingService = n, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
1501
1501
  }
1502
1502
  get _focusedDrawings() {
@@ -1553,7 +1553,7 @@ let Wt = class extends te {
1553
1553
  undos: [],
1554
1554
  redos: [
1555
1555
  {
1556
- id: Kt.id,
1556
+ id: Jt.id,
1557
1557
  params: { files: n }
1558
1558
  }
1559
1559
  ]
@@ -1575,16 +1575,16 @@ let Wt = class extends te {
1575
1575
  const m = c[h];
1576
1576
  if (m.drawingType !== x.DRAWING_IMAGE)
1577
1577
  return;
1578
- const { transform: p } = m;
1579
- if (m.anchorType !== O.Both || !p)
1578
+ const { transform: f } = m;
1579
+ if (m.anchorType !== O.Both || !f)
1580
1580
  return;
1581
- const { left: f = 0, top: w = 0, width: _ = 0, height: I = 0 } = p, { drawingStartX: R, drawingEndX: v, drawingStartY: C, drawingEndY: S } = {
1582
- drawingStartX: f,
1583
- drawingEndX: f + _,
1581
+ const { left: p = 0, top: w = 0, width: S = 0, height: I = 0 } = f, { drawingStartX: D, drawingEndX: v, drawingStartY: C, drawingEndY: _ } = {
1582
+ drawingStartX: p,
1583
+ drawingEndX: p + S,
1584
1584
  drawingStartY: w,
1585
1585
  drawingEndY: w + I
1586
1586
  };
1587
- o <= R && v <= a && d <= C && S <= u && l.push(m);
1587
+ o <= D && v <= a && d <= C && _ <= u && l.push(m);
1588
1588
  }), l.length)
1589
1589
  return {
1590
1590
  copyRange: n,
@@ -1600,26 +1600,26 @@ let Wt = class extends te {
1600
1600
  const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(X), c = d == null ? void 0 : d.with(Je), l = this._copyInfo;
1601
1601
  if (!u || !c)
1602
1602
  return { redos: [], undos: [] };
1603
- const { drawings: g } = l, h = $n(a);
1603
+ const { drawings: g } = l, h = kn(a);
1604
1604
  return this._generateMutations(g, {
1605
1605
  unitId: s,
1606
1606
  subUnitId: o,
1607
1607
  isCut: e === Re.CUT,
1608
- getTransform: (m, p) => {
1609
- var _;
1610
- const f = u.attachRangeWithCoord({
1608
+ getTransform: (m, f) => {
1609
+ var S;
1610
+ const p = u.attachRangeWithCoord({
1611
1611
  startRow: h.startRow,
1612
1612
  endRow: h.endRow,
1613
1613
  startColumn: h.startColumn,
1614
1614
  endColumn: h.endColumn
1615
1615
  }), w = {
1616
1616
  ...m,
1617
- left: f == null ? void 0 : f.startX,
1618
- top: f == null ? void 0 : f.startY
1617
+ left: p == null ? void 0 : p.startX,
1618
+ top: p == null ? void 0 : p.startY
1619
1619
  };
1620
1620
  return {
1621
1621
  transform: w,
1622
- sheetTransform: (_ = j(w, c)) != null ? _ : p
1622
+ sheetTransform: (S = j(w, c)) != null ? S : f
1623
1623
  };
1624
1624
  }
1625
1625
  });
@@ -1644,14 +1644,14 @@ let Wt = class extends te {
1644
1644
  sheetTransform: h.sheetTransform
1645
1645
  };
1646
1646
  if (o) {
1647
- const { undo: p, redo: f, objects: w } = u.getBatchUpdateOp([m]);
1647
+ const { undo: f, redo: p, objects: w } = u.getBatchUpdateOp([m]);
1648
1648
  a.push({
1649
1649
  id: P.id,
1650
1650
  params: {
1651
1651
  unitId: n,
1652
1652
  subUnitId: r,
1653
1653
  type: U.UPDATE,
1654
- op: f,
1654
+ op: p,
1655
1655
  objects: w
1656
1656
  }
1657
1657
  }), d.push({
@@ -1660,13 +1660,13 @@ let Wt = class extends te {
1660
1660
  unitId: n,
1661
1661
  subUnitId: r,
1662
1662
  type: U.UPDATE,
1663
- op: p,
1663
+ op: f,
1664
1664
  objects: w
1665
1665
  }
1666
1666
  });
1667
1667
  } else {
1668
- const { undo: p, redo: f, objects: w } = u.getBatchAddOp([m]);
1669
- a.push({ id: P.id, params: { op: f, unitId: n, subUnitId: r, objects: w, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: w, type: U.REMOVE } });
1668
+ const { undo: f, redo: p, objects: w } = u.getBatchAddOp([m]);
1669
+ a.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: w, type: U.INSERT } }), d.push({ id: P.id, params: { op: f, unitId: n, subUnitId: r, objects: w, type: U.REMOVE } });
1670
1670
  }
1671
1671
  }), { redos: a, undos: d };
1672
1672
  }
@@ -1690,45 +1690,45 @@ let Wt = class extends te {
1690
1690
  const { drawings: c } = this._copyInfo;
1691
1691
  if (!a)
1692
1692
  return this._generateSingleDrawingPasteMutations({
1693
- pasteTo: { unitId: n, subUnitId: r, range: $n(o) },
1693
+ pasteTo: { unitId: n, subUnitId: r, range: kn(o) },
1694
1694
  pasteType: s
1695
1695
  }, d);
1696
- const { ranges: [l, g], mapFunc: h } = ai([a, o]), { row: m, col: p } = h(l.startRow, l.startColumn), { row: f, col: w } = h(g.startRow, g.startColumn), _ = u.attachRangeWithCoord({
1696
+ const { ranges: [l, g], mapFunc: h } = ci([a, o]), { row: m, col: f } = h(l.startRow, l.startColumn), { row: p, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
1697
1697
  startRow: m,
1698
1698
  endRow: m,
1699
- startColumn: p,
1700
- endColumn: p
1699
+ startColumn: f,
1700
+ endColumn: f
1701
1701
  }), I = u.attachRangeWithCoord({
1702
- startRow: f,
1703
- endRow: f,
1702
+ startRow: p,
1703
+ endRow: p,
1704
1704
  startColumn: w,
1705
1705
  endColumn: w
1706
1706
  });
1707
- if (!_ || !I || !this._copyInfo)
1707
+ if (!S || !I || !this._copyInfo)
1708
1708
  return { redos: [], undos: [] };
1709
- const R = I.startX - _.startX, v = I.startY - _.startY, C = f - m, S = w - p;
1709
+ const D = I.startX - S.startX, v = I.startY - S.startY, C = p - m, _ = w - f;
1710
1710
  return this._generateMutations(c, {
1711
1711
  unitId: n,
1712
1712
  subUnitId: r,
1713
- getTransform: (D, E) => {
1713
+ getTransform: (R, E) => {
1714
1714
  var T, M;
1715
1715
  return {
1716
1716
  transform: {
1717
- ...D,
1718
- left: ((T = D == null ? void 0 : D.left) != null ? T : 0) + R,
1719
- top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + v
1717
+ ...R,
1718
+ left: ((T = R == null ? void 0 : R.left) != null ? T : 0) + D,
1719
+ top: ((M = R == null ? void 0 : R.top) != null ? M : 0) + v
1720
1720
  },
1721
1721
  sheetTransform: {
1722
1722
  ...E,
1723
1723
  to: {
1724
1724
  ...E.to,
1725
1725
  row: E.to.row + C,
1726
- column: E.to.column + S
1726
+ column: E.to.column + _
1727
1727
  },
1728
1728
  from: {
1729
1729
  ...E.from,
1730
1730
  row: E.from.row + C,
1731
- column: E.from.column + S
1731
+ column: E.from.column + _
1732
1732
  }
1733
1733
  }
1734
1734
  };
@@ -1737,19 +1737,19 @@ let Wt = class extends te {
1737
1737
  });
1738
1738
  }
1739
1739
  };
1740
- Wt = Js([
1741
- rt(0, ci),
1740
+ Bt = Js([
1741
+ rt(0, di),
1742
1742
  rt(1, ee),
1743
1743
  rt(2, ae),
1744
1744
  rt(3, ds),
1745
1745
  rt(4, G)
1746
- ], Wt);
1746
+ ], Bt);
1747
1747
  var eo = Object.getOwnPropertyDescriptor, to = (i, t, e, n) => {
1748
1748
  for (var r = n > 1 ? void 0 : n ? eo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1749
1749
  (o = i[s]) && (r = o(r) || r);
1750
1750
  return r;
1751
1751
  }, it = (i, t) => (e, n) => t(e, n, i);
1752
- let Bt = class extends te {
1752
+ let jt = class extends te {
1753
1753
  constructor(i, t, e, n, r) {
1754
1754
  super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1755
1755
  }
@@ -1757,16 +1757,16 @@ let Bt = class extends te {
1757
1757
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
1758
1758
  this.disposeWithMe(
1759
1759
  e.pipe(
1760
- pe(([n, r]) => n ? n.activeSheet$.pipe(
1761
- tr((s) => {
1760
+ fe(([n, r]) => n ? n.activeSheet$.pipe(
1761
+ er((s) => {
1762
1762
  if (!s) {
1763
1763
  this._drawingManagerService.setDrawingVisible(!1);
1764
1764
  return;
1765
1765
  }
1766
1766
  const o = n.getUnitId(), a = s.getSheetId();
1767
1767
  this._permissionService.composePermission([
1768
- new Vn(o).id,
1769
- new Gn(o, a).id
1768
+ new Hn(o).id,
1769
+ new Vn(o, a).id
1770
1770
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
1771
1771
  })
1772
1772
  ) : (this._drawingManagerService.setDrawingVisible(!1), _e))
@@ -1786,16 +1786,16 @@ let Bt = class extends te {
1786
1786
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
1787
1787
  this.disposeWithMe(
1788
1788
  e.pipe(
1789
- pe(([n, r]) => n ? n.activeSheet$.pipe(
1790
- tr((s) => {
1789
+ fe(([n, r]) => n ? n.activeSheet$.pipe(
1790
+ er((s) => {
1791
1791
  if (!s) {
1792
1792
  this._drawingManagerService.setDrawingEditable(!1);
1793
1793
  return;
1794
1794
  }
1795
1795
  const o = n.getUnitId(), a = s.getSheetId();
1796
1796
  this._permissionService.composePermission([
1797
- new mn(o).id,
1798
- new fn(o, a).id
1797
+ new gn(o).id,
1798
+ new mn(o, a).id
1799
1799
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
1800
1800
  })
1801
1801
  ) : (this._drawingManagerService.setDrawingEditable(!1), _e))
@@ -1815,8 +1815,8 @@ let Bt = class extends te {
1815
1815
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1816
1816
  this.disposeWithMe(
1817
1817
  at([i, t]).pipe(
1818
- pe(([e, n]) => e ? e.activeSheet$.pipe(
1819
- pe((r) => {
1818
+ fe(([e, n]) => e ? e.activeSheet$.pipe(
1819
+ fe((r) => {
1820
1820
  if (!r)
1821
1821
  return _e;
1822
1822
  const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
@@ -1824,13 +1824,13 @@ let Bt = class extends te {
1824
1824
  return _e;
1825
1825
  const u = d.getTransformerByCreate();
1826
1826
  return this._permissionService.composePermission$([
1827
- new Vn(s).id,
1828
- new Gn(s, o).id
1827
+ new Hn(s).id,
1828
+ new Vn(s, o).id
1829
1829
  ]).pipe(
1830
- we((l) => l.every((g) => g.value)),
1831
- nr()
1830
+ pe((l) => l.every((g) => g.value)),
1831
+ tr()
1832
1832
  ).pipe(
1833
- we((l) => ({
1833
+ pe((l) => ({
1834
1834
  permission: l,
1835
1835
  scene: d,
1836
1836
  transformer: u,
@@ -1863,8 +1863,8 @@ let Bt = class extends te {
1863
1863
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1864
1864
  this.disposeWithMe(
1865
1865
  at([i, t]).pipe(
1866
- pe(([e, n]) => e ? e.activeSheet$.pipe(
1867
- pe((r) => {
1866
+ fe(([e, n]) => e ? e.activeSheet$.pipe(
1867
+ fe((r) => {
1868
1868
  if (!r)
1869
1869
  return _e;
1870
1870
  const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
@@ -1872,13 +1872,13 @@ let Bt = class extends te {
1872
1872
  return _e;
1873
1873
  const u = d.getTransformerByCreate();
1874
1874
  return this._permissionService.composePermission$([
1875
- new mn(s).id,
1876
- new fn(s, o).id
1875
+ new gn(s).id,
1876
+ new mn(s, o).id
1877
1877
  ]).pipe(
1878
- we((l) => l.every((g) => g.value)),
1879
- nr()
1878
+ pe((l) => l.every((g) => g.value)),
1879
+ tr()
1880
1880
  ).pipe(
1881
- we((l) => ({
1881
+ pe((l) => ({
1882
1882
  permission: l,
1883
1883
  scene: d,
1884
1884
  transformer: u,
@@ -1917,20 +1917,20 @@ let Bt = class extends te {
1917
1917
  );
1918
1918
  }
1919
1919
  };
1920
- Bt = to([
1920
+ jt = to([
1921
1921
  it(0, ae),
1922
1922
  it(1, ee),
1923
1923
  it(2, Si),
1924
- it(3, le),
1924
+ it(3, de),
1925
1925
  it(4, A(vi))
1926
- ], Bt);
1926
+ ], jt);
1927
1927
  var no = Object.getOwnPropertyDescriptor, ro = (i, t, e, n) => {
1928
1928
  for (var r = n > 1 ? void 0 : n ? no(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1929
1929
  (o = i[s]) && (r = o(r) || r);
1930
1930
  return r;
1931
1931
  }, be = (i, t) => (e, n) => t(e, n, i);
1932
1932
  const io = "univer-sheet-float-dom-";
1933
- function Vr(i, t, e, n, r, s = !1) {
1933
+ function Gr(i, t, e, n, r, s = !1) {
1934
1934
  const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(cr.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, m = {
1935
1935
  left: !0,
1936
1936
  // left means the left of pic is in a viewMainLeft
@@ -1941,27 +1941,27 @@ function Vr(i, t, e, n, r, s = !1) {
1941
1941
  ...i,
1942
1942
  absolute: m
1943
1943
  };
1944
- const { left: p, right: f, top: w, bottom: _ } = i;
1945
- let { top: I, left: R, viewportScrollX: v, viewportScrollY: C } = d;
1946
- const { boundsOfViewArea: S, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: E } = e, T = {
1944
+ const { left: f, right: p, top: w, bottom: S } = i;
1945
+ let { top: I, left: D, viewportScrollX: v, viewportScrollY: C } = d;
1946
+ const { boundsOfViewArea: _, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: R, columnHeaderHeight: E } = e, T = {
1947
1947
  top: s ? 0 : E,
1948
- left: s ? 0 : D
1948
+ left: s ? 0 : R
1949
1949
  };
1950
- S && (Ge.isDefine(T.top) && (T.top = S.top), Ge.isDefine(T.left) && (T.left = S.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
1950
+ _ && (Ge.isDefine(T.top) && (T.top = _.top), Ge.isDefine(T.left) && (T.left = _.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
1951
1951
  let M = 0, b = 0;
1952
- const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + D, ne = e.rowStartY(l) + E, z = e.colStartX(c) + D;
1952
+ const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + R, ne = e.rowStartY(l) + E, z = e.colStartX(c) + R;
1953
1953
  if (g === 0)
1954
- m.left = !1, M = (p - v) * o, b = (f - v) * o;
1954
+ m.left = !1, M = (f - v) * o, b = (p - v) * o;
1955
1955
  else {
1956
- const K = p - (F - D), W = f - (F - D);
1957
- f < z ? (M = K * o, b = W * o) : p <= z && f >= z ? (M = K * o, b = Math.max(R, (f - v) * o)) : p > z && (m.left = !1, M = Math.max((p - v) * o, R), b = Math.max((f - v) * o, R));
1956
+ const K = f - (F - R), W = p - (F - R);
1957
+ p < z ? (M = K * o, b = W * o) : f <= z && p >= z ? (M = K * o, b = Math.max(D, (p - v) * o)) : f > z && (m.left = !1, M = Math.max((f - v) * o, D), b = Math.max((p - v) * o, D));
1958
1958
  }
1959
1959
  let V = 0, Y = 0;
1960
1960
  if (h === 0)
1961
- m.top = !1, V = (w - C) * a, Y = (_ - C) * a;
1961
+ m.top = !1, V = (w - C) * a, Y = (S - C) * a;
1962
1962
  else {
1963
- const K = w - (N - E), W = _ - (N - E);
1964
- _ < ne ? (V = K * a, Y = W * a) : w <= ne && _ >= ne ? (V = K * a, Y = Math.max(I, (_ - C) * a)) : w > ne && (m.top = !1, V = Math.max((w - C) * a, I), Y = Math.max((_ - C) * a, I));
1963
+ const K = w - (N - E), W = S - (N - E);
1964
+ S < ne ? (V = K * a, Y = W * a) : w <= ne && S >= ne ? (V = K * a, Y = Math.max(I, (S - C) * a)) : w > ne && (m.top = !1, V = Math.max((w - C) * a, I), Y = Math.max((S - C) * a, I));
1965
1965
  }
1966
1966
  return M = Math.max(M, T.left), V = Math.max(V, T.top), b = Math.max(b, T.left), Y = Math.max(Y, T.top), {
1967
1967
  left: M,
@@ -1971,13 +1971,13 @@ function Vr(i, t, e, n, r, s = !1) {
1971
1971
  absolute: m
1972
1972
  };
1973
1973
  }
1974
- const fe = (i, t, e, n, r) => {
1974
+ const me = (i, t, e, n, r) => {
1975
1975
  const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
1976
1976
  left: s,
1977
1977
  right: s + a,
1978
1978
  top: o,
1979
1979
  bottom: o + d
1980
- }, l = Vr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1980
+ }, l = Gr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1981
1981
  return {
1982
1982
  startX: l.left,
1983
1983
  endX: l.right,
@@ -1995,13 +1995,13 @@ let lt = class extends te {
1995
1995
  /**
1996
1996
  * for update dom container position when scrolling and zoom
1997
1997
  */
1998
- Q(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1999
- Q(this, "_transformChange$", new on());
2000
- Q(this, "transformChange$", this._transformChange$.asObservable());
2001
- Q(this, "_add$", new on());
2002
- Q(this, "add$", this._add$.asObservable());
2003
- Q(this, "_remove$", new on());
2004
- Q(this, "remove$", this._remove$.asObservable());
1998
+ ie(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1999
+ ie(this, "_transformChange$", new an());
2000
+ ie(this, "transformChange$", this._transformChange$.asObservable());
2001
+ ie(this, "_add$", new an());
2002
+ ie(this, "add$", this._add$.asObservable());
2003
+ ie(this, "_remove$", new an());
2004
+ ie(this, "remove$", this._remove$.asObservable());
2005
2005
  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();
2006
2006
  }
2007
2007
  _bindScrollEvent() {
@@ -2046,21 +2046,21 @@ let lt = class extends te {
2046
2046
  const m = this._getSceneAndTransformerByDrawingSearch(n);
2047
2047
  if (m == null)
2048
2048
  return;
2049
- const { scene: p, canvas: f } = m;
2049
+ const { scene: f, canvas: p } = m;
2050
2050
  if (l == null)
2051
2051
  return !0;
2052
2052
  if (u !== r)
2053
2053
  return;
2054
- const { left: w, top: _, width: I, height: R, angle: v, flipX: C, flipY: S, skewX: y, skewY: D } = l, E = De({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
2054
+ const { left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: y, skewY: R } = l, E = De({ unitId: n, subUnitId: r, drawingId: s }), T = f.getObject(E);
2055
2055
  if (T != null) {
2056
- T.transformByState({ left: w, top: _, width: I, height: R, angle: v, flipX: C, flipY: S, skewX: y, skewY: D });
2056
+ T.transformByState({ left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: y, skewY: R });
2057
2057
  return;
2058
2058
  }
2059
2059
  const M = {
2060
2060
  left: w,
2061
- top: _,
2061
+ top: S,
2062
2062
  width: I,
2063
- height: R,
2063
+ height: D,
2064
2064
  zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
2065
2065
  }, b = g === x.DRAWING_CHART;
2066
2066
  if (M.rotateEnabled = !1, b) {
@@ -2068,8 +2068,8 @@ let lt = class extends te {
2068
2068
  M.fill = W, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
2069
2069
  }
2070
2070
  const N = new $e(E, M);
2071
- b && N.setObjectType(Nn.CHART), p.addObject(N, qt), a.allowTransform !== !1 && p.attachTransformerTo(N);
2072
- const F = new yt(), ne = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet), z = new je(ne), V = `${io}${He(6)}`, Y = {
2071
+ b && N.setObjectType(An.CHART), f.addObject(N, Qt), a.allowTransform !== !1 && f.attachTransformerTo(N);
2072
+ const F = new yt(), ne = me(N, m.renderUnit.scene, c.skeleton, o.worksheet), z = new je(ne), V = `${io}${He(6)}`, Y = {
2073
2073
  dispose: F,
2074
2074
  rect: N,
2075
2075
  position$: z,
@@ -2084,22 +2084,22 @@ let lt = class extends te {
2084
2084
  domId: V,
2085
2085
  componentKey: a.componentKey,
2086
2086
  onPointerDown: (W) => {
2087
- f.dispatchEvent(new PointerEvent(W.type, W));
2087
+ p.dispatchEvent(new PointerEvent(W.type, W));
2088
2088
  },
2089
2089
  onPointerMove: (W) => {
2090
- f.dispatchEvent(new PointerEvent(W.type, W));
2090
+ p.dispatchEvent(new PointerEvent(W.type, W));
2091
2091
  },
2092
2092
  onPointerUp: (W) => {
2093
- f.dispatchEvent(new PointerEvent(W.type, W));
2093
+ p.dispatchEvent(new PointerEvent(W.type, W));
2094
2094
  },
2095
2095
  onWheel: (W) => {
2096
- f.dispatchEvent(new WheelEvent(W.type, W));
2096
+ p.dispatchEvent(new WheelEvent(W.type, W));
2097
2097
  },
2098
2098
  data: h,
2099
2099
  unitId: n
2100
2100
  });
2101
2101
  const Z = N.onTransformChange$.subscribeEvent(() => {
2102
- const W = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet);
2102
+ const W = me(N, m.renderUnit.scene, c.skeleton, o.worksheet);
2103
2103
  z.next(
2104
2104
  W
2105
2105
  );
@@ -2129,21 +2129,21 @@ let lt = class extends te {
2129
2129
  !r || !o || !a || s.forEach((u) => {
2130
2130
  const c = this._domLayerInfoMap.get(u);
2131
2131
  if (c) {
2132
- const l = fe(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
2132
+ const l = me(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
2133
2133
  c.position$.next(l);
2134
2134
  }
2135
2135
  });
2136
2136
  };
2137
2137
  this.disposeWithMe(
2138
2138
  this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
2139
- pe((e) => e ? e.activeSheet$ : _n(null)),
2140
- we((e) => {
2139
+ fe((e) => e ? e.activeSheet$ : wn(null)),
2140
+ pe((e) => {
2141
2141
  if (!e) return null;
2142
2142
  const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
2143
2143
  return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
2144
2144
  }),
2145
- pe(
2146
- (e) => e ? Ri(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(we(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : _n(null)
2145
+ fe(
2146
+ (e) => e ? Ri(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(pe(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : wn(null)
2147
2147
  )
2148
2148
  ).subscribe((e) => {
2149
2149
  if (!e) return;
@@ -2151,7 +2151,7 @@ let lt = class extends te {
2151
2151
  t(n, r);
2152
2152
  })
2153
2153
  ), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
2154
- if (e.id === xn.id) {
2154
+ if (e.id === $n.id) {
2155
2155
  const n = e.params, { unitId: r } = n;
2156
2156
  Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
2157
2157
  t(r, o);
@@ -2257,7 +2257,7 @@ let lt = class extends te {
2257
2257
  data: d,
2258
2258
  allowTransform: u
2259
2259
  };
2260
- return this._commandService.executeCommand(Xt.id, {
2260
+ return this._commandService.executeCommand(zt.id, {
2261
2261
  unitId: r,
2262
2262
  drawings: [g]
2263
2263
  }), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
@@ -2284,7 +2284,7 @@ let lt = class extends te {
2284
2284
  }
2285
2285
  // eslint-disable-next-line max-lines-per-function, complexity
2286
2286
  addFloatDomToRange(t, e, n, r) {
2287
- var C, S, y;
2287
+ var C, _, y;
2288
2288
  const s = se(this._univerInstanceService, {
2289
2289
  unitId: e.unitId,
2290
2290
  subUnitId: e.subUnitId
@@ -2297,32 +2297,32 @@ let lt = class extends te {
2297
2297
  if (!u) return;
2298
2298
  const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(X).getWorksheetSkeleton(a);
2299
2299
  if (!c) return;
2300
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: p, position$: f } = this._createRangePositionObserver(t, u, c.skeleton);
2301
- if (this._getPosition(p, o) == null)
2300
+ const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: f, position$: p } = this._createRangePositionObserver(t, u, c.skeleton);
2301
+ if (this._getPosition(f, o) == null)
2302
2302
  return;
2303
- const _ = d.scene, { scaleX: I } = _.getAncestorScale(), R = Ut(p, n, I), v = {
2303
+ const S = d.scene, { scaleX: I } = S.getAncestorScale(), D = Pt(f, n, I), v = {
2304
2304
  unitId: o,
2305
2305
  subUnitId: a,
2306
2306
  drawingId: m,
2307
2307
  drawingType: e.type || x.DRAWING_DOM,
2308
2308
  componentKey: l,
2309
2309
  transform: {
2310
- left: R.startX,
2311
- top: R.startY,
2312
- width: R.width,
2313
- height: R.height
2310
+ left: D.startX,
2311
+ top: D.startY,
2312
+ width: D.width,
2313
+ height: D.height
2314
2314
  },
2315
2315
  data: g,
2316
2316
  allowTransform: h
2317
2317
  };
2318
2318
  {
2319
- const { unitId: D, subUnitId: E, drawingId: T } = v, M = se(this._univerInstanceService, { unitId: D, subUnitId: E }), b = v, N = this._univerInstanceService.getUnit(D, k.UNIVER_SHEET);
2319
+ const { unitId: R, subUnitId: E, drawingId: T } = v, M = se(this._univerInstanceService, { unitId: R, subUnitId: E }), b = v, N = this._univerInstanceService.getUnit(R, k.UNIVER_SHEET);
2320
2320
  if (!N)
2321
2321
  return;
2322
2322
  const F = N.getActiveSheet().getSheetId();
2323
2323
  if (!b || !M)
2324
2324
  return;
2325
- const ne = (S = this._renderManagerService.getRenderById(D)) == null ? void 0 : S.with(X);
2325
+ const ne = (_ = this._renderManagerService.getRenderById(R)) == null ? void 0 : _.with(X);
2326
2326
  if (!ne)
2327
2327
  return;
2328
2328
  const z = ne.getWorksheetSkeleton(E);
@@ -2331,15 +2331,15 @@ let lt = class extends te {
2331
2331
  const { transform: V, drawingType: Y, data: Z } = b;
2332
2332
  if (Y !== x.DRAWING_DOM && Y !== x.DRAWING_CHART)
2333
2333
  return;
2334
- const K = this._getSceneAndTransformerByDrawingSearch(D);
2334
+ const K = this._getSceneAndTransformerByDrawingSearch(R);
2335
2335
  if (K == null)
2336
2336
  return;
2337
2337
  const { scene: W, canvas: Oe } = K;
2338
2338
  if (V == null || F !== E)
2339
2339
  return;
2340
- const { left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue } = V, It = De({ unitId: D, subUnitId: E, drawingId: T }), ue = W.getObject(It);
2341
- if (ue != null) {
2342
- ue.transformByState({ left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue });
2340
+ const { left: ft, top: pt, width: wt, height: _t, angle: Zt, flipX: qt, flipY: St, skewX: vt, skewY: Ue } = V, It = De({ unitId: R, subUnitId: E, drawingId: T }), le = W.getObject(It);
2341
+ if (le != null) {
2342
+ le.transformByState({ left: ft, top: pt, width: wt, height: _t, angle: Zt, flipX: qt, flipY: St, skewX: vt, skewY: Ue });
2343
2343
  return;
2344
2344
  }
2345
2345
  const re = {
@@ -2348,28 +2348,28 @@ let lt = class extends te {
2348
2348
  top: pt,
2349
2349
  width: wt,
2350
2350
  height: _t,
2351
- zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
2351
+ zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
2352
2352
  }, Pe = Y === x.DRAWING_CHART;
2353
2353
  if (Pe) {
2354
2354
  const $ = Z ? Z.backgroundColor : "white";
2355
2355
  re.fill = $, re.rotateEnabled = !1, Z && Z.border && (re.stroke = Z.border), re.paintFirst = "stroke", re.strokeWidth = 1, re.borderEnabled = !1, re.radius = 8;
2356
2356
  }
2357
- const he = new $e(It, re);
2358
- Pe && he.setObjectType(Nn.CHART), W.addObject(he, qt), b.allowTransform !== !1 && W.attachTransformerTo(he);
2359
- const ge = new yt(), Ct = W.getMainViewport(), { rowHeaderWidth: Ae, columnHeaderHeight: Qe } = z.skeleton, Rt = {
2357
+ const ue = new $e(It, re);
2358
+ Pe && ue.setObjectType(An.CHART), W.addObject(ue, Qt), b.allowTransform !== !1 && W.attachTransformerTo(ue);
2359
+ const he = new yt(), Ct = W.getMainViewport(), { rowHeaderWidth: Ae, columnHeaderHeight: Qe } = z.skeleton, Rt = {
2360
2360
  top: Qe,
2361
2361
  left: Ae,
2362
2362
  bottom: Ct.bottom,
2363
2363
  right: Ct.right
2364
- }, me = {
2365
- dispose: ge,
2366
- rect: he,
2364
+ }, ge = {
2365
+ dispose: he,
2366
+ rect: ue,
2367
2367
  boundsOfViewArea: Rt,
2368
2368
  domAnchor: n,
2369
- unitId: D,
2369
+ unitId: R,
2370
2370
  subUnitId: E
2371
- }, B = fe(he, K.renderUnit.scene, z.skeleton, M.worksheet, me), Ne = new je(B);
2372
- me.position$ = Ne;
2371
+ }, B = me(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge), Ne = new je(B);
2372
+ ge.position$ = Ne;
2373
2373
  let et = {
2374
2374
  position$: Ne,
2375
2375
  id: T,
@@ -2384,7 +2384,7 @@ let lt = class extends te {
2384
2384
  Oe.dispatchEvent(new WheelEvent($.type, $));
2385
2385
  },
2386
2386
  data: Z,
2387
- unitId: D
2387
+ unitId: R
2388
2388
  };
2389
2389
  e.eventPassThrough && (et = {
2390
2390
  ...et,
@@ -2397,41 +2397,41 @@ let lt = class extends te {
2397
2397
  onPointerUp: ($) => {
2398
2398
  Oe.dispatchEvent(new PointerEvent($.type, $));
2399
2399
  }
2400
- }), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(f.subscribe(($) => {
2401
- var On, Un, Pn, An;
2402
- const Tn = Ut({
2400
+ }), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(p.subscribe(($) => {
2401
+ var Tn, On, Un, Pn;
2402
+ const En = Pt({
2403
2403
  startX: $.startX,
2404
2404
  startY: $.startY,
2405
2405
  endX: $.endX,
2406
2406
  endY: $.endY,
2407
- width: (On = n.width) != null ? On : $.width,
2408
- height: (Un = n.height) != null ? Un : $.height,
2407
+ width: (Tn = n.width) != null ? Tn : $.width,
2408
+ height: (On = n.height) != null ? On : $.height,
2409
2409
  absolute: {
2410
- left: p.absolute.left,
2411
- top: p.absolute.top
2410
+ left: f.absolute.left,
2411
+ top: f.absolute.top
2412
2412
  }
2413
- }, n), Xr = De({ unitId: D, subUnitId: E, drawingId: T }), zr = new $e(Xr, {
2414
- left: Tn.startX,
2415
- top: Tn.startY,
2416
- width: (Pn = n.width) != null ? Pn : $.width,
2417
- height: (An = n.height) != null ? An : $.height,
2418
- zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
2419
- }), Kr = fe(zr, K.renderUnit.scene, z.skeleton, M.worksheet, me);
2420
- Ne.next(Kr);
2413
+ }, n), zr = De({ unitId: R, subUnitId: E, drawingId: T }), Kr = new $e(zr, {
2414
+ left: En.startX,
2415
+ top: En.startY,
2416
+ width: (Un = n.width) != null ? Un : $.width,
2417
+ height: (Pn = n.height) != null ? Pn : $.height,
2418
+ zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
2419
+ }), Jr = me(Kr, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
2420
+ Ne.next(Jr);
2421
2421
  }));
2422
- const tt = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(X);
2422
+ const tt = (y = this._renderManagerService.getRenderById(R)) == null ? void 0 : y.with(X);
2423
2423
  tt == null || tt.currentSkeleton$.subscribe(($) => {
2424
2424
  $ && z.sheetId !== $.sheetId && this._removeDom(m, !0);
2425
2425
  });
2426
- const Dt = he.onTransformChange$.subscribeEvent(() => {
2427
- const $ = fe(he, K.renderUnit.scene, z.skeleton, M.worksheet, me);
2426
+ const Dt = ue.onTransformChange$.subscribeEvent(() => {
2427
+ const $ = me(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
2428
2428
  Ne.next(
2429
2429
  $
2430
2430
  );
2431
2431
  });
2432
- ge.add(() => {
2432
+ he.add(() => {
2433
2433
  this._canvasFloatDomService.removeFloatDom(T);
2434
- }), Dt && ge.add(Dt), this._domLayerInfoMap.set(T, me);
2434
+ }), Dt && he.add(Dt), this._domLayerInfoMap.set(T, ge);
2435
2435
  }
2436
2436
  return {
2437
2437
  id: m,
@@ -2442,7 +2442,7 @@ let lt = class extends te {
2442
2442
  }
2443
2443
  // eslint-disable-next-line max-lines-per-function, complexity
2444
2444
  addFloatDomToColumnHeader(t, e, n, r) {
2445
- var R, v, C;
2445
+ var D, v, C;
2446
2446
  const s = se(this._univerInstanceService, {
2447
2447
  unitId: e.unitId,
2448
2448
  subUnitId: e.subUnitId
@@ -2453,15 +2453,15 @@ let lt = class extends te {
2453
2453
  if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
2454
2454
  const u = this._renderManagerService.getRenderById(o);
2455
2455
  if (!u) return;
2456
- const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(X).getWorksheetSkeleton(a);
2456
+ const c = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(X).getWorksheetSkeleton(a);
2457
2457
  if (!c) return;
2458
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: p, position$: f } = this._createRangePositionObserver({
2458
+ const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: f, position$: p } = this._createRangePositionObserver({
2459
2459
  startRow: 0,
2460
2460
  endRow: 0,
2461
2461
  startColumn: t,
2462
2462
  endColumn: t
2463
- }, u, c.skeleton), w = p;
2464
- if (w.startY = 0, this._getPosition(p, o) == null)
2463
+ }, u, c.skeleton), w = f;
2464
+ if (w.startY = 0, this._getPosition(f, o) == null)
2465
2465
  return;
2466
2466
  const I = {
2467
2467
  unitId: o,
@@ -2479,69 +2479,69 @@ let lt = class extends te {
2479
2479
  allowTransform: h
2480
2480
  };
2481
2481
  {
2482
- const { unitId: S, subUnitId: y, drawingId: D } = I, E = se(this._univerInstanceService, { unitId: S, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(S, k.UNIVER_SHEET);
2482
+ const { unitId: _, subUnitId: y, drawingId: R } = I, E = se(this._univerInstanceService, { unitId: _, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(_, k.UNIVER_SHEET);
2483
2483
  if (!M)
2484
2484
  return;
2485
2485
  const b = M.getActiveSheet().getSheetId();
2486
2486
  if (!T || !E)
2487
2487
  return;
2488
- const N = (v = this._renderManagerService.getRenderById(S)) == null ? void 0 : v.with(X);
2488
+ const N = (v = this._renderManagerService.getRenderById(_)) == null ? void 0 : v.with(X);
2489
2489
  if (!N)
2490
2490
  return;
2491
2491
  const F = N.getWorksheetSkeleton(y);
2492
2492
  if (!F)
2493
2493
  return;
2494
- const { transform: ne, data: z } = T, V = this._getSceneAndTransformerByDrawingSearch(S);
2494
+ const { transform: ne, data: z } = T, V = this._getSceneAndTransformerByDrawingSearch(_);
2495
2495
  if (V == null)
2496
2496
  return;
2497
2497
  const { scene: Y, canvas: Z } = V;
2498
2498
  if (ne == null || b !== y)
2499
2499
  return;
2500
- const { left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt } = ne, St = De({ unitId: S, subUnitId: y, drawingId: D }), vt = Y.getObject(St);
2500
+ const { left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: qt } = ne, St = De({ unitId: _, subUnitId: y, drawingId: R }), vt = Y.getObject(St);
2501
2501
  if (vt != null) {
2502
- vt.transformByState({ left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt });
2502
+ vt.transformByState({ left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: qt });
2503
2503
  return;
2504
2504
  }
2505
- const Ue = Ut({
2505
+ const Ue = Pt({
2506
2506
  startX: w.startX,
2507
2507
  startY: 0,
2508
- endX: p.endX,
2509
- endY: p.endY,
2508
+ endX: f.endX,
2509
+ endY: f.endY,
2510
2510
  width: n.width,
2511
2511
  height: n.height,
2512
2512
  absolute: {
2513
- left: p.absolute.left,
2514
- top: p.absolute.top
2513
+ left: f.absolute.left,
2514
+ top: f.absolute.top
2515
2515
  }
2516
2516
  }, n), It = {
2517
2517
  left: Ue.startX,
2518
2518
  top: Ue.startY,
2519
2519
  width: Ue.width,
2520
2520
  height: Ue.height,
2521
- zIndex: this._drawingManagerService.getDrawingOrder(S, y).length - 1
2522
- }, ue = new $e(St, It);
2523
- Y.addObject(ue, qt), T.allowTransform !== !1 && Y.attachTransformerTo(ue);
2524
- const re = new yt(), Pe = Y.getMainViewport(), he = {
2521
+ zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
2522
+ }, le = new $e(St, It);
2523
+ Y.addObject(le, Qt), T.allowTransform !== !1 && Y.attachTransformerTo(le);
2524
+ const re = new yt(), Pe = Y.getMainViewport(), ue = {
2525
2525
  top: 0,
2526
2526
  //viewMain.top,
2527
2527
  left: Pe.left,
2528
2528
  bottom: Pe.bottom,
2529
2529
  right: Pe.right
2530
- }, ge = {
2530
+ }, he = {
2531
2531
  dispose: re,
2532
- rect: ue,
2532
+ rect: le,
2533
2533
  // position$,
2534
- unitId: S,
2534
+ unitId: _,
2535
2535
  subUnitId: y,
2536
- boundsOfViewArea: he,
2536
+ boundsOfViewArea: ue,
2537
2537
  domAnchor: n,
2538
2538
  scrollDirectionResponse: "HORIZONTAL"
2539
2539
  /* HORIZONTAL */
2540
- }, Ct = fe(ue, V.renderUnit.scene, F.skeleton, E.worksheet, ge), Ae = new je(Ct);
2541
- ge.position$ = Ae;
2540
+ }, Ct = me(le, V.renderUnit.scene, F.skeleton, E.worksheet, he), Ae = new je(Ct);
2541
+ he.position$ = Ae;
2542
2542
  let Qe = {
2543
2543
  position$: Ae,
2544
- id: D,
2544
+ id: R,
2545
2545
  componentKey: T.componentKey,
2546
2546
  onPointerDown: () => {
2547
2547
  },
@@ -2553,7 +2553,7 @@ let lt = class extends te {
2553
2553
  Z.dispatchEvent(new WheelEvent(B.type, B));
2554
2554
  },
2555
2555
  data: z,
2556
- unitId: S
2556
+ unitId: _
2557
2557
  };
2558
2558
  e.eventPassThrough && (Qe = {
2559
2559
  ...Qe,
@@ -2567,14 +2567,14 @@ let lt = class extends te {
2567
2567
  Z.dispatchEvent(new PointerEvent(B.type, B));
2568
2568
  }
2569
2569
  }), this._canvasFloatDomService.addFloatDom(Qe);
2570
- const Rt = ue.onTransformChange$.subscribeEvent(() => {
2571
- const B = fe(ue, V.renderUnit.scene, F.skeleton, E.worksheet, ge);
2570
+ const Rt = le.onTransformChange$.subscribeEvent(() => {
2571
+ const B = me(le, V.renderUnit.scene, F.skeleton, E.worksheet, he);
2572
2572
  Ae.next(
2573
2573
  B
2574
2574
  );
2575
2575
  });
2576
- this.disposeWithMe(f.subscribe((B) => {
2577
- const Ne = Ut({
2576
+ this.disposeWithMe(p.subscribe((B) => {
2577
+ const Ne = Pt({
2578
2578
  startX: B.startX,
2579
2579
  startY: 0,
2580
2580
  endX: B.endX,
@@ -2582,24 +2582,24 @@ let lt = class extends te {
2582
2582
  width: n.width,
2583
2583
  height: n.height,
2584
2584
  absolute: {
2585
- left: p.absolute.left,
2586
- top: p.absolute.top
2585
+ left: f.absolute.left,
2586
+ top: f.absolute.top
2587
2587
  }
2588
- }, n), et = De({ unitId: S, subUnitId: y, drawingId: D }), tt = new $e(et, {
2588
+ }, n), et = De({ unitId: _, subUnitId: y, drawingId: R }), tt = new $e(et, {
2589
2589
  left: Ne.startX,
2590
2590
  top: 0,
2591
2591
  width: n.width,
2592
2592
  height: n.height,
2593
- zIndex: this._drawingManagerService.getDrawingOrder(S, y).length - 1
2594
- }), Dt = fe(tt, V.renderUnit.scene, F.skeleton, E.worksheet, ge);
2593
+ zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
2594
+ }), Dt = me(tt, V.renderUnit.scene, F.skeleton, E.worksheet, he);
2595
2595
  Ae.next(Dt);
2596
2596
  }));
2597
- const me = (C = this._renderManagerService.getRenderById(S)) == null ? void 0 : C.with(X);
2598
- me == null || me.currentSkeleton$.subscribe((B) => {
2597
+ const ge = (C = this._renderManagerService.getRenderById(_)) == null ? void 0 : C.with(X);
2598
+ ge == null || ge.currentSkeleton$.subscribe((B) => {
2599
2599
  B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
2600
2600
  }), re.add(() => {
2601
- this._canvasFloatDomService.removeFloatDom(D);
2602
- }), Rt && re.add(Rt), this._domLayerInfoMap.set(D, ge);
2601
+ this._canvasFloatDomService.removeFloatDom(R);
2602
+ }), Rt && re.add(Rt), this._domLayerInfoMap.set(R, he);
2603
2603
  }
2604
2604
  return {
2605
2605
  id: m,
@@ -2622,18 +2622,18 @@ let lt = class extends te {
2622
2622
  _createRangePositionObserver(t, e, n) {
2623
2623
  let { startRow: r, startColumn: s } = t;
2624
2624
  const o = st(r, s, n), a = new je(o), d = st(t.endRow, t.endColumn, n), u = new je(d), c = () => {
2625
- const f = st(r, s, n), w = st(t.endRow, t.endColumn, n);
2626
- a.next(f), u.next(w);
2625
+ const p = st(r, s, n), w = st(t.endRow, t.endColumn, n);
2626
+ a.next(p), u.next(w);
2627
2627
  }, l = new yt();
2628
- l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((f) => {
2629
- if (f.id === gr.id && f.params.rowsAutoHeightInfo.findIndex((_) => _.row === r) > -1) {
2628
+ l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((p) => {
2629
+ if (p.id === mr.id && p.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
2630
2630
  c();
2631
2631
  return;
2632
2632
  }
2633
- (ji.indexOf(f.id) > -1 || f.id === di.id || f.id === xn.id) && c();
2633
+ (ji.indexOf(p.id) > -1 || p.id === li.id || p.id === $n.id) && c();
2634
2634
  }));
2635
- const g = (f, w) => {
2636
- r = f, s = w, c();
2635
+ const g = (p, w) => {
2636
+ r = p, s = w, c();
2637
2637
  }, h = () => ({
2638
2638
  rotate: 0,
2639
2639
  width: d.right - o.left,
@@ -2647,26 +2647,26 @@ let lt = class extends te {
2647
2647
  endX: d.right,
2648
2648
  endY: d.bottom
2649
2649
  }), m = a.pipe(
2650
- we((f) => {
2650
+ pe((p) => {
2651
2651
  const w = st(t.endRow, t.endColumn, n);
2652
2652
  return {
2653
2653
  rotate: 0,
2654
- width: w.right - f.left,
2655
- height: w.bottom - f.top,
2654
+ width: w.right - p.left,
2655
+ height: w.bottom - p.top,
2656
2656
  absolute: {
2657
2657
  left: !0,
2658
2658
  top: !0
2659
2659
  },
2660
- startX: f.left,
2661
- startY: f.top,
2660
+ startX: p.left,
2661
+ startY: p.top,
2662
2662
  endX: w.right,
2663
2663
  endY: w.bottom
2664
2664
  };
2665
2665
  })
2666
- ), p = h();
2666
+ ), f = h();
2667
2667
  return {
2668
2668
  position$: m,
2669
- position: p,
2669
+ position: f,
2670
2670
  updateRowCol: g,
2671
2671
  topLeftPos$: a,
2672
2672
  rightBottomPos$: u,
@@ -2676,7 +2676,7 @@ let lt = class extends te {
2676
2676
  };
2677
2677
  lt = ro([
2678
2678
  be(0, A(ee)),
2679
- be(1, le),
2679
+ be(1, de),
2680
2680
  be(2, A(G)),
2681
2681
  be(3, ae),
2682
2682
  be(4, A(ls)),
@@ -2692,22 +2692,22 @@ function st(i, t, e) {
2692
2692
  bottom: r.endY
2693
2693
  };
2694
2694
  }
2695
- function Ut(i, t, e) {
2695
+ function Pt(i, t, e) {
2696
2696
  var u, c;
2697
2697
  e = e != null ? e : 1;
2698
2698
  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;
2699
2699
  let a = 0, d = 0;
2700
2700
  if (t) {
2701
2701
  if (t.horizonOffsetAlign === "right") {
2702
- const l = Pt(t.marginX, n * e);
2702
+ const l = At(t.marginX, n * e);
2703
2703
  a = i.endX - l - s;
2704
2704
  } else
2705
- a = i.startX + Pt(t.marginX, n);
2705
+ a = i.startX + At(t.marginX, n);
2706
2706
  if (t.verticalOffsetAlign === "bottom") {
2707
- const l = Pt(t.marginY, r * e);
2707
+ const l = At(t.marginY, r * e);
2708
2708
  d = i.endY - l - o;
2709
2709
  } else
2710
- d = i.startY + Pt(t.marginY, r);
2710
+ d = i.startY + At(t.marginY, r);
2711
2711
  }
2712
2712
  return {
2713
2713
  rotate: 0,
@@ -2723,7 +2723,7 @@ function Ut(i, t, e) {
2723
2723
  }
2724
2724
  };
2725
2725
  }
2726
- function Pt(i, t) {
2726
+ function At(i, t) {
2727
2727
  if (i === void 0) return 0;
2728
2728
  if (typeof i == "number") return i;
2729
2729
  const e = Number.parseFloat(i);
@@ -2731,7 +2731,7 @@ function Pt(i, t) {
2731
2731
  }
2732
2732
  const so = (i) => {
2733
2733
  const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Fe(() => t.map((o) => {
2734
- const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Vr(
2734
+ const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Gr(
2735
2735
  {
2736
2736
  left: c != null ? c : 0,
2737
2737
  right: (c != null ? c : 0) + (a != null ? a : 0),
@@ -2743,7 +2743,7 @@ const so = (i) => {
2743
2743
  r,
2744
2744
  void 0,
2745
2745
  !0
2746
- ), { scaleX: h, scaleY: m } = e.getAncestorScale(), p = {
2746
+ ), { scaleX: h, scaleY: m } = e.getAncestorScale(), f = {
2747
2747
  startX: g.left,
2748
2748
  endX: g.right,
2749
2749
  startY: g.top,
@@ -2752,9 +2752,9 @@ const so = (i) => {
2752
2752
  width: a * h,
2753
2753
  height: d * m,
2754
2754
  absolute: g.absolute
2755
- }, f = {
2756
- position$: new je(p),
2757
- position: p,
2755
+ }, p = {
2756
+ position$: new je(f),
2757
+ position: f,
2758
2758
  id: o.drawingId,
2759
2759
  componentKey: o.componentKey,
2760
2760
  onPointerMove: () => {
@@ -2768,7 +2768,7 @@ const so = (i) => {
2768
2768
  unitId: o.unitId,
2769
2769
  data: o.data
2770
2770
  };
2771
- return [o.drawingId, f];
2771
+ return [o.drawingId, p];
2772
2772
  }), [t, e, n, r]);
2773
2773
  return /* @__PURE__ */ L("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ L(us, { layer: a, id: o, position: a.position }, o)) });
2774
2774
  };
@@ -2777,7 +2777,7 @@ var oo = Object.getOwnPropertyDescriptor, ao = (i, t, e, n) => {
2777
2777
  (o = i[s]) && (r = o(r) || r);
2778
2778
  return r;
2779
2779
  }, Me = (i, t) => (e, n) => t(e, n, i);
2780
- let jt = class extends te {
2780
+ let Ft = class extends te {
2781
2781
  constructor(i, t, e, n, r, s, o) {
2782
2782
  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();
2783
2783
  }
@@ -2812,8 +2812,8 @@ let jt = class extends te {
2812
2812
  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]);
2813
2813
  return g.length ? (g.forEach((h) => {
2814
2814
  if (!h.groupId && h.transform && Ge.isDefine(h.transform.left) && Ge.isDefine(h.transform.top) && Ge.isDefine(h.transform.width) && Ge.isDefine(h.transform.height)) {
2815
- 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 });
2816
- 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);
2815
+ const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
2816
+ m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < f.row && (l.endRow = f.row), l.endColumn < f.column && (l.endColumn = f.column);
2817
2817
  }
2818
2818
  }), e(l)) : e(i);
2819
2819
  }
@@ -2858,22 +2858,21 @@ let jt = class extends te {
2858
2858
  );
2859
2859
  }
2860
2860
  };
2861
- jt = ao([
2862
- Me(0, A(li)),
2863
- Me(1, A(Ar)),
2861
+ Ft = ao([
2862
+ Me(0, A(ui)),
2863
+ Me(1, A(Nr)),
2864
2864
  Me(2, ae),
2865
2865
  Me(3, ee),
2866
2866
  Me(4, A(lt)),
2867
- Me(5, A(Pr)),
2867
+ Me(5, A(Ar)),
2868
2868
  Me(6, A(qe))
2869
- ], jt);
2869
+ ], Ft);
2870
2870
  var co = Object.getOwnPropertyDescriptor, lo = (i, t, e, n) => {
2871
2871
  for (var r = n > 1 ? void 0 : n ? co(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2872
2872
  (o = i[s]) && (r = o(r) || r);
2873
2873
  return r;
2874
2874
  }, Se = (i, t) => (e, n) => t(e, n, i);
2875
2875
  const uo = [
2876
- mr.id,
2877
2876
  fr.id,
2878
2877
  pr.id,
2879
2878
  wr.id,
@@ -2881,9 +2880,9 @@ const uo = [
2881
2880
  Sr.id,
2882
2881
  vr.id,
2883
2882
  Ir.id,
2884
- pn.id,
2885
- wn.id,
2886
2883
  Cr.id,
2884
+ fn.id,
2885
+ pn.id,
2887
2886
  Rr.id,
2888
2887
  Dr.id,
2889
2888
  br.id,
@@ -2891,18 +2890,19 @@ const uo = [
2891
2890
  yr.id,
2892
2891
  Er.id,
2893
2892
  Tr.id,
2894
- Or.id
2893
+ Or.id,
2894
+ Ur.id
2895
2895
  ], ho = [
2896
2896
  Fi.id,
2897
2897
  Li.id,
2898
2898
  Hi.id,
2899
2899
  Vi.id,
2900
2900
  Gi.id,
2901
- gr.id,
2901
+ mr.id,
2902
2902
  Yi.id,
2903
2903
  Xi.id
2904
2904
  ];
2905
- let Dn = class extends te {
2905
+ let Rn = class extends te {
2906
2906
  constructor(i, t, e, n, r, s, o, a, d) {
2907
2907
  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();
2908
2908
  }
@@ -2916,52 +2916,52 @@ let Dn = class extends te {
2916
2916
  if (i.params == null)
2917
2917
  return { redos: [], undos: [] };
2918
2918
  const t = i.id;
2919
- if (t === mr.id)
2919
+ if (t === fr.id)
2920
2920
  return this._moveRowInterceptor(i.params, "insert");
2921
- if ([Er.id, Tr.id, Or.id].includes(t))
2921
+ if ([Tr.id, Or.id, Ur.id].includes(t))
2922
2922
  return this._moveRangeInterceptor(i.params);
2923
- if (t === fr.id)
2924
- return this._moveColInterceptor(i.params, "insert");
2925
2923
  if (t === pr.id)
2926
- return this._moveRowInterceptor(i.params, "remove");
2924
+ return this._moveColInterceptor(i.params, "insert");
2927
2925
  if (t === wr.id)
2926
+ return this._moveRowInterceptor(i.params, "remove");
2927
+ if (t === _r.id)
2928
2928
  return this._moveColInterceptor(i.params, "remove");
2929
- if (t === _r.id) {
2929
+ if (t === Sr.id) {
2930
2930
  const { range: e } = i.params;
2931
2931
  return this._getRangeMoveUndo(
2932
2932
  e,
2933
2933
  0
2934
2934
  /* deleteLeft */
2935
2935
  );
2936
- } else if (t === Sr.id) {
2936
+ } else if (t === vr.id) {
2937
2937
  const { range: e } = i.params;
2938
2938
  return this._getRangeMoveUndo(
2939
2939
  e,
2940
2940
  1
2941
2941
  /* deleteUp */
2942
2942
  );
2943
- } else if (t === vr.id) {
2943
+ } else if (t === Ir.id) {
2944
2944
  const { range: e } = i.params;
2945
2945
  return this._getRangeMoveUndo(
2946
2946
  e,
2947
2947
  2
2948
2948
  /* insertDown */
2949
2949
  );
2950
- } else if (t === Ir.id) {
2950
+ } else if (t === Cr.id) {
2951
2951
  const { range: e } = i.params;
2952
2952
  return this._getRangeMoveUndo(
2953
2953
  e,
2954
2954
  3
2955
2955
  /* insertRight */
2956
2956
  );
2957
- } else if (t === Dr.id || t === br.id) {
2957
+ } else if (t === br.id || t === Mr.id) {
2958
2958
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2959
2959
  return this._getDrawingUndoForRowVisible(n, r, s);
2960
- } else if (t === Mr.id || t === yr.id) {
2960
+ } else if (t === yr.id || t === Er.id) {
2961
2961
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2962
2962
  return this._getDrawingUndoForColVisible(n, r, s);
2963
- } else if (t === pn.id || t === wn.id || t === Cr.id || t === Rr.id) {
2964
- const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === pn.id || t === wn.id;
2963
+ } else if (t === fn.id || t === pn.id || t === Rr.id || t === Dr.id) {
2964
+ const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === fn.id || t === pn.id;
2965
2965
  return this._getDrawingUndoForRowAndColSize(n, r, s, o);
2966
2966
  }
2967
2967
  return { redos: [], undos: [] };
@@ -2993,38 +2993,38 @@ let Dn = class extends te {
2993
2993
  };
2994
2994
  }
2995
2995
  _getUpdateOrDeleteDrawings(i, t, e) {
2996
- 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;
2996
+ 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: f, column: p } = g;
2997
2997
  if (s == null || a == null)
2998
2998
  return {
2999
2999
  updateDrawings: n,
3000
3000
  deleteDrawings: r
3001
3001
  };
3002
- const { startRow: w, endRow: _, startColumn: I, endColumn: R } = i;
3002
+ const { startRow: w, endRow: S, startColumn: I, endColumn: D } = i;
3003
3003
  let v = null, C = null;
3004
- if (t === 0 && h >= w && p <= _)
3005
- if (m >= I && f <= R)
3004
+ if (t === 0 && h >= w && f <= S)
3005
+ if (m >= I && p <= D)
3006
3006
  r.push({ unitId: d, subUnitId: u, drawingId: c });
3007
3007
  else {
3008
- const S = this._shrinkCol(s, a, I, R, o);
3009
- v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
3008
+ const _ = this._shrinkCol(s, a, I, D, o);
3009
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
3010
3010
  }
3011
- else if (t === 1 && m >= I && f <= R)
3012
- if (h >= w && p <= _)
3011
+ else if (t === 1 && m >= I && p <= D)
3012
+ if (h >= w && f <= S)
3013
3013
  r.push({ unitId: d, subUnitId: u, drawingId: c });
3014
3014
  else {
3015
- const S = this._shrinkRow(s, a, w, _, o);
3016
- v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
3015
+ const _ = this._shrinkRow(s, a, w, S, o);
3016
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
3017
3017
  }
3018
3018
  else if (t === 2) {
3019
- const S = this._expandRow(s, a, w, _, o);
3020
- v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
3019
+ const _ = this._expandRow(s, a, w, S, o);
3020
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
3021
3021
  } else if (t === 3) {
3022
- const S = this._expandCol(s, a, I, R, o);
3023
- v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
3022
+ const _ = this._expandCol(s, a, I, D, o);
3023
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
3024
3024
  }
3025
3025
  if (v != null && C != null) {
3026
- const S = J(v, this._selectionRenderService, this._skeletonManagerService);
3027
- n.push({ ...e, sheetTransform: v, transform: S });
3026
+ const _ = J(v, this._selectionRenderService, this._skeletonManagerService);
3027
+ n.push({ ...e, sheetTransform: v, transform: _ });
3028
3028
  }
3029
3029
  return { updateDrawings: n, deleteDrawings: r };
3030
3030
  }
@@ -3043,15 +3043,15 @@ let Dn = class extends te {
3043
3043
  if (m === O.None)
3044
3044
  this._remainDrawingSize(h, r, l);
3045
3045
  else {
3046
- const { from: p, to: f } = g, { row: w, column: _ } = p, { row: I, column: R } = f;
3046
+ const { from: f, to: p } = g, { row: w, column: S } = f, { row: I, column: D } = p;
3047
3047
  for (let v = 0; v < e.length; v++) {
3048
- const C = e[v], { startRow: S, endRow: y, startColumn: D, endColumn: E } = C;
3049
- if (R < D)
3048
+ const C = e[v], { startRow: _, endRow: y, startColumn: R, endColumn: E } = C;
3049
+ if (D < R)
3050
3050
  continue;
3051
3051
  if (m === O.Position) {
3052
3052
  let b = null, N = null;
3053
- if (_ >= D && _ <= E) {
3054
- const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: _, endColumn: E, startRow: p.row, endRow: f.row });
3053
+ if (S >= R && S <= E) {
3054
+ const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: f.row, endRow: p.row });
3055
3055
  if (F == null)
3056
3056
  return;
3057
3057
  N = { ...h, left: F.startX };
@@ -3063,11 +3063,11 @@ let Dn = class extends te {
3063
3063
  this._remainDrawingSize(h, r, l);
3064
3064
  continue;
3065
3065
  }
3066
- if (_ >= D && R <= E)
3066
+ if (S >= R && D <= E)
3067
3067
  continue;
3068
3068
  let T = null, M = null;
3069
- if (_ >= D && _ <= E) {
3070
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: _, endColumn: E, startRow: p.row, endRow: f.row });
3069
+ if (S >= R && S <= E) {
3070
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: f.row, endRow: p.row });
3071
3071
  if (b == null)
3072
3072
  return;
3073
3073
  M = {
@@ -3075,8 +3075,8 @@ let Dn = class extends te {
3075
3075
  left: (b == null ? void 0 : b.startX) || 0,
3076
3076
  width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
3077
3077
  };
3078
- } else if (R >= D && R <= E) {
3079
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: p.row, endRow: f.row });
3078
+ } else if (D >= R && D <= E) {
3079
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: D, startRow: f.row, endRow: p.row });
3080
3080
  if (b == null)
3081
3081
  return;
3082
3082
  M = {
@@ -3084,7 +3084,7 @@ let Dn = class extends te {
3084
3084
  left: b.startX - ((h == null ? void 0 : h.width) || 0)
3085
3085
  };
3086
3086
  } else {
3087
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: E, startRow: p.row, endRow: f.row });
3087
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: E, startRow: f.row, endRow: p.row });
3088
3088
  if (b == null)
3089
3089
  return;
3090
3090
  if (M = {
@@ -3137,15 +3137,15 @@ let Dn = class extends te {
3137
3137
  if (m === O.None)
3138
3138
  this._remainDrawingSize(h, r, l);
3139
3139
  else {
3140
- const { from: p, to: f } = g, { row: w, column: _ } = p, { row: I, column: R } = f;
3140
+ const { from: f, to: p } = g, { row: w, column: S } = f, { row: I, column: D } = p;
3141
3141
  for (let v = 0; v < e.length; v++) {
3142
- const C = e[v], { startRow: S, endRow: y, startColumn: D, endColumn: E } = C;
3143
- if (I < S)
3142
+ const C = e[v], { startRow: _, endRow: y, startColumn: R, endColumn: E } = C;
3143
+ if (I < _)
3144
3144
  continue;
3145
3145
  if (m === O.Position) {
3146
3146
  let b = null, N = null;
3147
- if (w >= S && w <= y) {
3148
- const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: y });
3147
+ if (w >= _ && w <= y) {
3148
+ const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: y });
3149
3149
  if (F == null)
3150
3150
  return;
3151
3151
  N = { ...h, top: F.startY };
@@ -3157,11 +3157,11 @@ let Dn = class extends te {
3157
3157
  this._remainDrawingSize(h, r, l);
3158
3158
  continue;
3159
3159
  }
3160
- if (w >= S && I <= y)
3160
+ if (w >= _ && I <= y)
3161
3161
  continue;
3162
3162
  let T = null, M = null;
3163
- if (w >= S && w <= y) {
3164
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: y });
3163
+ if (w >= _ && w <= y) {
3164
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: y });
3165
3165
  if (b == null)
3166
3166
  return;
3167
3167
  M = {
@@ -3169,8 +3169,8 @@ let Dn = class extends te {
3169
3169
  top: (b == null ? void 0 : b.startY) || 0,
3170
3170
  height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
3171
3171
  };
3172
- } else if (I >= S && I <= y) {
3173
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: S, endRow: I });
3172
+ } else if (I >= _ && I <= y) {
3173
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: I });
3174
3174
  if (b == null)
3175
3175
  return;
3176
3176
  M = {
@@ -3178,7 +3178,7 @@ let Dn = class extends te {
3178
3178
  top: b.startY - ((h == null ? void 0 : h.height) || 0)
3179
3179
  };
3180
3180
  } else {
3181
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: S, endRow: y });
3181
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: y });
3182
3182
  if (b == null)
3183
3183
  return;
3184
3184
  if (M = {
@@ -3217,20 +3217,20 @@ let Dn = class extends te {
3217
3217
  if (c === O.None)
3218
3218
  this._remainDrawingSize(u, s, a);
3219
3219
  else {
3220
- const { from: l, to: g } = d, { row: h, column: m } = l, { row: p, column: f } = g;
3220
+ const { from: l, to: g } = d, { row: h, column: m } = l, { row: f, column: p } = g;
3221
3221
  for (let w = 0; w < e.length; w++) {
3222
- const _ = e[w], { startRow: I, endRow: R, startColumn: v, endColumn: C } = _;
3223
- if (p < I || f < v)
3222
+ const S = e[w], { startRow: I, endRow: D, startColumn: v, endColumn: C } = S;
3223
+ if (f < I || p < v)
3224
3224
  continue;
3225
- if (c === O.Position && (h <= I && p >= R || m <= v && f >= C)) {
3225
+ if (c === O.Position && (h <= I && f >= D || m <= v && p >= C)) {
3226
3226
  this._remainDrawingSize(u, s, a);
3227
3227
  continue;
3228
3228
  }
3229
- const S = J({ ...d }, this._selectionRenderService, this._skeletonManagerService);
3230
- if (S != null) {
3229
+ const _ = J({ ...d }, this._selectionRenderService, this._skeletonManagerService);
3230
+ if (_ != null) {
3231
3231
  s.push({
3232
3232
  ...a,
3233
- transform: S
3233
+ transform: _
3234
3234
  });
3235
3235
  break;
3236
3236
  }
@@ -3251,11 +3251,11 @@ let Dn = class extends te {
3251
3251
  return { unitId: e, subUnitId: n };
3252
3252
  }
3253
3253
  _moveRangeInterceptor(i) {
3254
- var I, R;
3254
+ var I, D;
3255
3255
  const { toRange: t, fromRange: e } = i, n = se(this._univerInstanceService);
3256
3256
  if (!n)
3257
3257
  return { redos: [], undos: [] };
3258
- const { unitId: r, subUnitId: s } = n, o = (R = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(X)) == null ? void 0 : R.getCurrentSkeleton();
3258
+ const { unitId: r, subUnitId: s } = n, o = (D = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(X)) == null ? void 0 : D.getCurrentSkeleton();
3259
3259
  if (!o)
3260
3260
  return { redos: [], undos: [] };
3261
3261
  const a = dr(o, e);
@@ -3266,35 +3266,35 @@ let Dn = class extends te {
3266
3266
  const C = g[v];
3267
3267
  if (C.anchorType !== O.Both)
3268
3268
  return;
3269
- const { transform: S } = C;
3270
- if (!S)
3269
+ const { transform: _ } = C;
3270
+ if (!_)
3271
3271
  return;
3272
- const { left: y = 0, top: D = 0, width: E = 0, height: T = 0 } = S, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: F } = {
3272
+ const { left: y = 0, top: R = 0, width: E = 0, height: T = 0 } = _, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: F } = {
3273
3273
  drawingStartX: y,
3274
3274
  drawingEndX: y + E,
3275
- drawingStartY: D,
3276
- drawingEndY: D + T
3275
+ drawingStartY: R,
3276
+ drawingEndY: R + T
3277
3277
  };
3278
3278
  d <= M && b <= u && c <= N && F <= l && h.push(C);
3279
3279
  });
3280
- const m = [], p = [], f = t.startRow - e.startRow, w = t.startColumn - e.startColumn, _ = h.map((v) => {
3281
- const C = v.sheetTransform, S = {
3282
- to: { ...C.to, row: C.to.row + f, column: C.to.column + w },
3283
- from: { ...C.from, row: C.from.row + f, column: C.from.column + w }
3284
- }, y = J(S, this._selectionRenderService, this._skeletonManagerService);
3280
+ const m = [], f = [], p = t.startRow - e.startRow, w = t.startColumn - e.startColumn, S = h.map((v) => {
3281
+ const C = v.sheetTransform, _ = {
3282
+ to: { ...C.to, row: C.to.row + p, column: C.to.column + w },
3283
+ from: { ...C.from, row: C.from.row + p, column: C.from.column + w }
3284
+ }, y = J(_, this._selectionRenderService, this._skeletonManagerService);
3285
3285
  return {
3286
3286
  unitId: r,
3287
3287
  subUnitId: s,
3288
3288
  drawingId: v.drawingId,
3289
3289
  transform: y,
3290
- sheetTransform: S
3290
+ sheetTransform: _
3291
3291
  };
3292
3292
  });
3293
- if (_.length) {
3294
- const v = this._sheetDrawingService.getBatchUpdateOp(_), { undo: C, redo: S, objects: y } = v;
3295
- m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: S, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
3293
+ if (S.length) {
3294
+ const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: C, redo: _, objects: y } = v;
3295
+ m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: y, type: U.UPDATE } }), f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
3296
3296
  }
3297
- return { redos: m, undos: p };
3297
+ return { redos: m, undos: f };
3298
3298
  }
3299
3299
  _moveRowInterceptor(i, t) {
3300
3300
  const e = this._getUnitIdAndSubUnitId(i, t);
@@ -3302,35 +3302,35 @@ let Dn = class extends te {
3302
3302
  return { redos: [], undos: [] };
3303
3303
  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 = [];
3304
3304
  if (Object.keys(c).forEach((h) => {
3305
- const m = c[h], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
3306
- if (p == null || f == null)
3305
+ const m = c[h], { sheetTransform: f, transform: p, anchorType: w = O.Position } = m;
3306
+ if (f == null || p == null)
3307
3307
  return;
3308
- let _, I;
3308
+ let S, I;
3309
3309
  if (t === "insert") {
3310
- const v = this._expandRow(p, f, o, a, w);
3311
- _ = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
3310
+ const v = this._expandRow(f, p, o, a, w);
3311
+ S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
3312
3312
  } else {
3313
- const { from: v, to: C } = p, { row: S } = v, { row: y } = C;
3314
- if (w === O.Both && S >= o && y <= a)
3313
+ const { from: v, to: C } = f, { row: _ } = v, { row: y } = C;
3314
+ if (w === O.Both && _ >= o && y <= a)
3315
3315
  g.push({ unitId: n, subUnitId: r, drawingId: h });
3316
3316
  else {
3317
- const D = this._shrinkRow(p, f, o, a, w);
3318
- _ = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
3317
+ const R = this._shrinkRow(f, p, o, a, w);
3318
+ S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
3319
3319
  }
3320
3320
  }
3321
- if (!_ || !I)
3321
+ if (!S || !I)
3322
3322
  return;
3323
- const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: _ };
3324
- l.push(R);
3323
+ const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
3324
+ l.push(D);
3325
3325
  }), l.length === 0 && g.length === 0)
3326
3326
  return { redos: [], undos: [] };
3327
3327
  if (l.length > 0) {
3328
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
3329
- 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 } });
3328
+ const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: f, objects: p } = h;
3329
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } });
3330
3330
  }
3331
3331
  if (g.length > 0) {
3332
- const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
3333
- 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 } });
3332
+ const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, f = h.redo, p = h.objects;
3333
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.INSERT } });
3334
3334
  }
3335
3335
  return d.push({ id: H.id, params: [n] }), u.push({ id: H.id, params: [n] }), {
3336
3336
  redos: d,
@@ -3343,35 +3343,35 @@ let Dn = class extends te {
3343
3343
  return { redos: [], undos: [] };
3344
3344
  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 = [];
3345
3345
  if (Object.keys(c).forEach((h) => {
3346
- const m = c[h], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
3347
- if (p == null || f == null)
3346
+ const m = c[h], { sheetTransform: f, transform: p, anchorType: w = O.Position } = m;
3347
+ if (f == null || p == null)
3348
3348
  return;
3349
- let _, I;
3349
+ let S, I;
3350
3350
  if (t === "insert") {
3351
- const v = this._expandCol(p, f, o, a, w);
3352
- _ = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
3351
+ const v = this._expandCol(f, p, o, a, w);
3352
+ S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
3353
3353
  } else {
3354
- const { from: v, to: C } = p, { column: S } = v, { column: y } = C;
3355
- if (w === O.Both && S >= o && y <= a)
3354
+ const { from: v, to: C } = f, { column: _ } = v, { column: y } = C;
3355
+ if (w === O.Both && _ >= o && y <= a)
3356
3356
  g.push({ unitId: n, subUnitId: r, drawingId: h });
3357
3357
  else {
3358
- const D = this._shrinkCol(p, f, o, a, w);
3359
- _ = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
3358
+ const R = this._shrinkCol(f, p, o, a, w);
3359
+ S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
3360
3360
  }
3361
3361
  }
3362
- if (!_ || !I)
3362
+ if (!S || !I)
3363
3363
  return;
3364
- const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: _ };
3365
- l.push(R);
3364
+ const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
3365
+ l.push(D);
3366
3366
  }), l.length === 0 && g.length === 0)
3367
3367
  return { redos: [], undos: [] };
3368
3368
  if (l.length > 0) {
3369
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
3370
- 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 } });
3369
+ const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: f, objects: p } = h;
3370
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } });
3371
3371
  }
3372
3372
  if (g.length > 0) {
3373
- const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
3374
- 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 } });
3373
+ const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, f = h.redo, p = h.objects;
3374
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.INSERT } });
3375
3375
  }
3376
3376
  return d.push({ id: H.id, params: [n] }), u.push({ id: H.id, params: [n] }), { redos: d, undos: u };
3377
3377
  }
@@ -3623,30 +3623,30 @@ let Dn = class extends te {
3623
3623
  const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
3624
3624
  if (u === O.None)
3625
3625
  return !0;
3626
- const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: p } = l;
3627
- for (let f = 0; f < e.length; f++) {
3628
- const w = e[f], { startRow: _, endRow: I, startColumn: R, endColumn: v } = w;
3626
+ const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: f } = l;
3627
+ for (let p = 0; p < e.length; p++) {
3628
+ const w = e[p], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
3629
3629
  if (bi.intersects(
3630
3630
  {
3631
- startRow: _,
3631
+ startRow: S,
3632
3632
  endRow: I,
3633
- startColumn: R,
3633
+ startColumn: D,
3634
3634
  endColumn: v
3635
3635
  },
3636
3636
  {
3637
3637
  startRow: g,
3638
3638
  endRow: m,
3639
3639
  startColumn: h,
3640
- endColumn: p
3640
+ endColumn: f
3641
3641
  }
3642
3642
  ) || g > I || h > v) {
3643
- const C = u === O.Position, S = J(a, this._selectionRenderService, this._skeletonManagerService);
3643
+ const C = u === O.Position, _ = J(a, this._selectionRenderService, this._skeletonManagerService);
3644
3644
  r.push({
3645
3645
  ...o,
3646
3646
  transform: {
3647
- ...S,
3648
- width: C ? d == null ? void 0 : d.width : S == null ? void 0 : S.width,
3649
- height: C ? d == null ? void 0 : d.height : S == null ? void 0 : S.height
3647
+ ..._,
3648
+ width: C ? d == null ? void 0 : d.width : _ == null ? void 0 : _.width,
3649
+ height: C ? d == null ? void 0 : d.height : _ == null ? void 0 : _.height
3650
3650
  }
3651
3651
  });
3652
3652
  break;
@@ -3655,41 +3655,41 @@ let Dn = class extends te {
3655
3655
  }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(H.id, [i]));
3656
3656
  }
3657
3657
  };
3658
- Dn = lo([
3658
+ Rn = lo([
3659
3659
  Se(1, ee),
3660
3660
  Se(2, G),
3661
3661
  Se(3, Je),
3662
3662
  Se(4, A(X)),
3663
- Se(5, A(Ht)),
3663
+ Se(5, A(Vt)),
3664
3664
  Se(6, oe),
3665
3665
  Se(7, ae),
3666
- Se(8, le)
3667
- ], Dn);
3666
+ Se(8, de)
3667
+ ], Rn);
3668
3668
  function go() {
3669
- const i = Ce(Te), t = Ce(Mn), e = Ce(En), [n, r] = Ee([ye.CELL_ADDRESS]), [s, o] = Ee(!1), [a, d] = Ee(null), u = Fe(() => e.getCellImagesInSelection(), [e]), c = Fe(() => e.getDataColumns(), [e]), l = Fe(() => e.getSelectionRowRange(), [e]), g = c.length > 0, h = Fe(() => c.map((C) => ({
3669
+ const i = Ce(Te), t = Ce(bn), e = Ce(yn), [n, r] = Ee([ye.CELL_ADDRESS]), [s, o] = Ee(!1), [a, d] = Ee(null), u = Fe(() => e.getCellImagesInSelection(), [e]), c = Fe(() => e.getDataColumns(), [e]), l = Fe(() => e.getSelectionRowRange(), [e]), g = c.length > 0, h = Fe(() => c.map((C) => ({
3670
3670
  label: C.label,
3671
3671
  value: String(C.index)
3672
- })), [c]), [m, p] = Ee(
3672
+ })), [c]), [m, f] = Ee(
3673
3673
  () => h.length > 0 ? h[0].value : "0"
3674
- ), f = Fe(() => {
3674
+ ), p = Fe(() => {
3675
3675
  if (!n.includes(ye.COLUMN_VALUE) || !l)
3676
3676
  return [];
3677
- const S = Number(m);
3677
+ const _ = Number(m);
3678
3678
  return [{
3679
3679
  startRow: l.startRow,
3680
3680
  endRow: l.endRow,
3681
- startColumn: S,
3682
- endColumn: S
3681
+ startColumn: _,
3682
+ endColumn: _
3683
3683
  }];
3684
3684
  }, [n, m, l]);
3685
- ui(f);
3685
+ hi(p);
3686
3686
  const w = Et((C) => {
3687
3687
  C.length !== 0 && r(C);
3688
- }, []), _ = Et((C) => {
3689
- p(String(C));
3688
+ }, []), S = Et((C) => {
3689
+ f(String(C));
3690
3690
  }, []), I = Et(() => {
3691
3691
  t.close(ze);
3692
- }, [t]), R = Et(async () => {
3692
+ }, [t]), D = Et(async () => {
3693
3693
  if (u.length !== 0) {
3694
3694
  o(!0), d(null);
3695
3695
  try {
@@ -3705,17 +3705,17 @@ function go() {
3705
3705
  }
3706
3706
  }, [e, u, n, m, t, i]), v = n.includes(ye.COLUMN_VALUE);
3707
3707
  return /* @__PURE__ */ Xe("div", { className: "univer-flex univer-flex-col", children: [
3708
- /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
3709
- /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(qi, { value: n, onChange: w, direction: "vertical", children: [
3710
- /* @__PURE__ */ L(Yn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
3711
- g && /* @__PURE__ */ L(Yn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
3708
+ /* @__PURE__ */ L(tn, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
3709
+ /* @__PURE__ */ L(tn, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(qi, { value: n, onChange: w, direction: "vertical", children: [
3710
+ /* @__PURE__ */ L(Gn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
3711
+ g && /* @__PURE__ */ L(Gn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
3712
3712
  ] }) }),
3713
- v && /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
3713
+ v && /* @__PURE__ */ L(tn, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
3714
3714
  Qi,
3715
3715
  {
3716
3716
  value: m,
3717
3717
  options: h,
3718
- onChange: _
3718
+ onChange: S
3719
3719
  }
3720
3720
  ) }),
3721
3721
  a && /* @__PURE__ */ L("div", { className: "univer-text-xs univer-text-red-500", children: a }),
@@ -3724,12 +3724,12 @@ function go() {
3724
3724
  {
3725
3725
  className: "univer-flex univer-justify-end univer-gap-2 univer-border-t univer-border-gray-200 univer-pt-3",
3726
3726
  children: [
3727
- /* @__PURE__ */ L(Xn, { onClick: I, disabled: s, children: i.t("sheetImage.save.cancel") }),
3727
+ /* @__PURE__ */ L(Yn, { onClick: I, disabled: s, children: i.t("sheetImage.save.cancel") }),
3728
3728
  /* @__PURE__ */ L(
3729
- Xn,
3729
+ Yn,
3730
3730
  {
3731
3731
  variant: "primary",
3732
- onClick: R,
3732
+ onClick: D,
3733
3733
  disabled: s || u.length === 0,
3734
3734
  children: s ? i.t("sheetImage.save.saving") : i.t("sheetImage.save.confirm")
3735
3735
  }
@@ -3740,23 +3740,23 @@ function go() {
3740
3740
  ] });
3741
3741
  }
3742
3742
  const mo = (i) => {
3743
- var _;
3743
+ var S;
3744
3744
  const t = Ce(G), e = Ce(Te), n = Ce(ae), r = Ce(ee), { drawings: s } = i, o = s[0];
3745
3745
  if (o == null)
3746
3746
  return;
3747
3747
  const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
3748
3748
  if (u == null)
3749
3749
  return;
3750
- const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (_ = o.anchorType) != null ? _ : O.Position, [m, p] = Ee(h);
3751
- function f(I, R) {
3750
+ const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (S = o.anchorType) != null ? S : O.Position, [m, f] = Ee(h);
3751
+ function p(I, D) {
3752
3752
  const v = [];
3753
3753
  return I.forEach((C) => {
3754
- const { oKey: S } = C, y = R.getDrawingOKey(S);
3754
+ const { oKey: _ } = C, y = D.getDrawingOKey(_);
3755
3755
  if (y == null)
3756
3756
  return v.push(null), !0;
3757
- const { unitId: D, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
3757
+ const { unitId: R, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
3758
3758
  v.push({
3759
- unitId: D,
3759
+ unitId: R,
3760
3760
  subUnitId: E,
3761
3761
  drawingId: T,
3762
3762
  anchorType: b,
@@ -3765,37 +3765,37 @@ const mo = (i) => {
3765
3765
  });
3766
3766
  }), v;
3767
3767
  }
3768
- Nr(() => {
3768
+ kr(() => {
3769
3769
  const I = c.clearControl$.subscribe((v) => {
3770
3770
  v === !0 && g(!1);
3771
- }), R = c.changeStart$.subscribe((v) => {
3771
+ }), D = c.changeStart$.subscribe((v) => {
3772
3772
  var y;
3773
- const { objects: C } = v, S = f(C, n);
3774
- if (S.length === 0)
3773
+ const { objects: C } = v, _ = p(C, n);
3774
+ if (_.length === 0)
3775
3775
  g(!1);
3776
- else if (S.length >= 1) {
3776
+ else if (_.length >= 1) {
3777
3777
  g(!0);
3778
- const D = ((y = S[0]) == null ? void 0 : y.anchorType) || O.Position;
3779
- p(D);
3778
+ const R = ((y = _[0]) == null ? void 0 : y.anchorType) || O.Position;
3779
+ f(R);
3780
3780
  }
3781
3781
  });
3782
3782
  return () => {
3783
- R.unsubscribe(), I.unsubscribe();
3783
+ D.unsubscribe(), I.unsubscribe();
3784
3784
  };
3785
3785
  }, []);
3786
3786
  function w(I) {
3787
- p(I);
3788
- const R = n.getFocusDrawings();
3789
- if (R.length === 0)
3787
+ f(I);
3788
+ const D = n.getFocusDrawings();
3789
+ if (D.length === 0)
3790
3790
  return;
3791
- const v = R.map((C) => ({
3791
+ const v = D.map((C) => ({
3792
3792
  unitId: C.unitId,
3793
3793
  subUnitId: C.subUnitId,
3794
3794
  drawingId: C.drawingId,
3795
3795
  anchorType: I
3796
3796
  }));
3797
- t.executeCommand(zt.id, {
3798
- unitId: R[0].unitId,
3797
+ t.executeCommand(Kt.id, {
3798
+ unitId: D[0].unitId,
3799
3799
  drawings: v
3800
3800
  });
3801
3801
  }
@@ -3814,16 +3814,16 @@ const mo = (i) => {
3814
3814
  }
3815
3815
  ),
3816
3816
  /* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(ts, { value: m, onChange: w, direction: "vertical", children: [
3817
- /* @__PURE__ */ L(tn, { value: O.Both, children: e.t("drawing-anchor.both") }),
3818
- /* @__PURE__ */ L(tn, { value: O.Position, children: e.t("drawing-anchor.position") }),
3819
- /* @__PURE__ */ L(tn, { value: O.None, children: e.t("drawing-anchor.none") })
3817
+ /* @__PURE__ */ L(nn, { value: O.Both, children: e.t("drawing-anchor.both") }),
3818
+ /* @__PURE__ */ L(nn, { value: O.Position, children: e.t("drawing-anchor.position") }),
3819
+ /* @__PURE__ */ L(nn, { value: O.None, children: e.t("drawing-anchor.none") })
3820
3820
  ] }) })
3821
3821
  ]
3822
3822
  }
3823
3823
  );
3824
3824
  }, fo = () => {
3825
3825
  const i = Ce(ae), t = i.getFocusDrawings(), [e, n] = Ee(t);
3826
- return Nr(() => {
3826
+ return kr(() => {
3827
3827
  const r = i.focus$.subscribe((s) => {
3828
3828
  n(s);
3829
3829
  });
@@ -3834,31 +3834,31 @@ const mo = (i) => {
3834
3834
  /* @__PURE__ */ L(Cs, { drawings: e }),
3835
3835
  /* @__PURE__ */ L(mo, { drawings: e })
3836
3836
  ] });
3837
- }, Gr = "sheet.menu.image";
3837
+ }, Yr = "sheet.menu.image";
3838
3838
  function po(i) {
3839
3839
  return {
3840
- id: Gr,
3841
- type: Yt.SUBITEMS,
3840
+ id: Yr,
3841
+ type: Xt.SUBITEMS,
3842
3842
  icon: "AddImageIcon",
3843
3843
  tooltip: "sheetImage.title",
3844
- hidden$: Gt(i, k.UNIVER_SHEET),
3845
- disabled$: hi(i, { workbookTypes: [mn], worksheetTypes: [fn], rangeTypes: [Ki] })
3844
+ hidden$: Yt(i, k.UNIVER_SHEET),
3845
+ disabled$: gi(i, { workbookTypes: [gn], worksheetTypes: [mn], rangeTypes: [Ki] })
3846
3846
  };
3847
3847
  }
3848
3848
  function wo(i) {
3849
3849
  return {
3850
- id: Kt.id,
3850
+ id: Jt.id,
3851
3851
  title: "sheetImage.upload.float",
3852
- type: Yt.BUTTON,
3853
- hidden$: Gt(i, k.UNIVER_SHEET)
3852
+ type: Xt.BUTTON,
3853
+ hidden$: Yt(i, k.UNIVER_SHEET)
3854
3854
  };
3855
3855
  }
3856
3856
  function _o(i) {
3857
3857
  return {
3858
- id: yn.id,
3858
+ id: Mn.id,
3859
3859
  title: "sheetImage.upload.cell",
3860
- type: Yt.BUTTON,
3861
- hidden$: Gt(i, k.UNIVER_SHEET)
3860
+ type: Xt.BUTTON,
3861
+ hidden$: Yt(i, k.UNIVER_SHEET)
3862
3862
  };
3863
3863
  }
3864
3864
  function So(i) {
@@ -3880,12 +3880,12 @@ function vo(i, t) {
3880
3880
  function Io() {
3881
3881
  return "showDirectoryPicker" in window;
3882
3882
  }
3883
- function ln(i) {
3884
- const t = i.get(le), e = i.get(ut), n = at([
3885
- Gt(i, k.UNIVER_SHEET),
3883
+ function dn(i) {
3884
+ const t = i.get(de), e = i.get(ut), n = at([
3885
+ Yt(i, k.UNIVER_SHEET),
3886
3886
  t.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
3887
- pe((r) => r ? e.selectionMoveEnd$.pipe(
3888
- we(() => {
3887
+ fe((r) => r ? e.selectionMoveEnd$.pipe(
3888
+ pe(() => {
3889
3889
  if (!Io())
3890
3890
  return !0;
3891
3891
  const s = e.getCurrentSelections();
@@ -3896,14 +3896,14 @@ function ln(i) {
3896
3896
  return !1;
3897
3897
  return !0;
3898
3898
  })
3899
- ) : _n(!0))
3899
+ ) : wn(!0))
3900
3900
  )
3901
3901
  ]).pipe(
3902
- we(([r, s]) => r || s)
3902
+ pe(([r, s]) => r || s)
3903
3903
  );
3904
3904
  return {
3905
3905
  id: ct.id,
3906
- type: Yt.BUTTON,
3906
+ type: Xt.BUTTON,
3907
3907
  icon: "DownloadImageIcon",
3908
3908
  title: "sheetImage.save.menuLabel",
3909
3909
  hidden$: n
@@ -3911,40 +3911,40 @@ function ln(i) {
3911
3911
  }
3912
3912
  const Co = {
3913
3913
  [gs.MEDIA]: {
3914
- [Gr]: {
3914
+ [Yr]: {
3915
3915
  order: 0,
3916
3916
  menuItemFactory: po,
3917
- [Kt.id]: {
3917
+ [Jt.id]: {
3918
3918
  order: 0,
3919
3919
  menuItemFactory: wo
3920
3920
  },
3921
- [yn.id]: {
3921
+ [Mn.id]: {
3922
3922
  order: 1,
3923
3923
  menuItemFactory: _o
3924
3924
  }
3925
3925
  }
3926
3926
  },
3927
- [rn.MAIN_AREA]: {
3928
- [sn.OTHERS]: {
3927
+ [sn.MAIN_AREA]: {
3928
+ [on.OTHERS]: {
3929
3929
  [ct.id]: {
3930
3930
  order: 10,
3931
- menuItemFactory: ln
3931
+ menuItemFactory: dn
3932
3932
  }
3933
3933
  }
3934
3934
  },
3935
- [rn.COL_HEADER]: {
3936
- [sn.OTHERS]: {
3935
+ [sn.COL_HEADER]: {
3936
+ [on.OTHERS]: {
3937
3937
  [ct.id]: {
3938
3938
  order: 10,
3939
- menuItemFactory: ln
3939
+ menuItemFactory: dn
3940
3940
  }
3941
3941
  }
3942
3942
  },
3943
- [rn.ROW_HEADER]: {
3944
- [sn.OTHERS]: {
3943
+ [sn.ROW_HEADER]: {
3944
+ [on.OTHERS]: {
3945
3945
  [ct.id]: {
3946
3946
  order: 10,
3947
- menuItemFactory: ln
3947
+ menuItemFactory: dn
3948
3948
  }
3949
3949
  }
3950
3950
  }
@@ -3993,7 +3993,7 @@ const Ro = {
3993
3993
  direction: Ie.RIGHT
3994
3994
  }
3995
3995
  }, yo = {
3996
- id: kr.id,
3996
+ id: $r.id,
3997
3997
  description: "shortcut.drawing-delete",
3998
3998
  group: "4_drawing-view",
3999
3999
  // when focusing on any other input tag do not trigger this shortcut
@@ -4006,32 +4006,32 @@ var Eo = Object.getOwnPropertyDescriptor, To = (i, t, e, n) => {
4006
4006
  (o = i[s]) && (r = o(r) || r);
4007
4007
  return r;
4008
4008
  }, Be = (i, t) => (e, n) => t(e, n, i);
4009
- let Ft = class extends te {
4009
+ let Lt = class extends te {
4010
4010
  constructor(i, t, e, n, r, s) {
4011
4011
  super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
4012
4012
  }
4013
4013
  _initCustomComponents() {
4014
4014
  const i = this._componentManager;
4015
- this.disposeWithMe(i.register(Br, fo)), this.disposeWithMe(i.register(ze, go));
4015
+ this.disposeWithMe(i.register(jr, fo)), this.disposeWithMe(i.register(ze, go));
4016
4016
  }
4017
4017
  _initMenus() {
4018
4018
  this._menuManagerService.mergeMenu(Co);
4019
4019
  }
4020
4020
  _initCommands() {
4021
4021
  [
4022
- Kt,
4023
- yn,
4024
- Xt,
4025
- ht,
4022
+ Jt,
4023
+ Mn,
4026
4024
  zt,
4027
- jr,
4028
- H,
4025
+ ht,
4026
+ Kt,
4029
4027
  Fr,
4028
+ H,
4029
+ Lr,
4030
+ xr,
4031
+ Br,
4032
+ gt,
4030
4033
  $r,
4031
4034
  Wr,
4032
- gt,
4033
- kr,
4034
- xr,
4035
4035
  ct
4036
4036
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
4037
4037
  }
@@ -4051,21 +4051,21 @@ let Ft = class extends te {
4051
4051
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
4052
4052
  }
4053
4053
  };
4054
- Ft = To([
4055
- Be(0, A(Pr)),
4054
+ Lt = To([
4055
+ Be(0, A(Ar)),
4056
4056
  Be(1, ms),
4057
4057
  Be(2, G),
4058
4058
  Be(3, fs),
4059
4059
  Be(4, ae),
4060
4060
  Be(5, A(ut))
4061
- ], Ft);
4061
+ ], Lt);
4062
4062
  var Oo = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, Po = (i, t, e) => t in i ? Oo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Ao = (i, t, e, n) => {
4063
4063
  for (var r = n > 1 ? void 0 : n ? Uo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
4064
4064
  (o = i[s]) && (r = o(r) || r);
4065
4065
  return r;
4066
- }, un = (i, t) => (e, n) => t(e, n, i), Yr = (i, t, e) => Po(i, typeof t != "symbol" ? t + "" : t, e);
4066
+ }, ln = (i, t) => (e, n) => t(e, n, i), Xr = (i, t, e) => Po(i, typeof t != "symbol" ? t + "" : t, e);
4067
4067
  const No = "SHEET_IMAGE_UI_PLUGIN";
4068
- let Lt = class extends Pi {
4068
+ let Ht = class extends Pi {
4069
4069
  constructor(i = sr, t, e, n) {
4070
4070
  super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
4071
4071
  const { menu: r, ...s } = Ai(
@@ -4078,80 +4078,80 @@ let Lt = class extends Pi {
4078
4078
  onStarting() {
4079
4079
  Ni(this._injector, [
4080
4080
  [lt],
4081
+ [Lt],
4082
+ [kt],
4081
4083
  [Ft],
4082
- [Nt],
4083
4084
  [jt],
4084
4085
  [Bt],
4085
- [Wt],
4086
- [kt],
4087
4086
  [$t],
4088
4087
  [xt],
4089
- [En, { useClass: In }]
4090
- ]), Qt(this._injector, [
4088
+ [Wt],
4089
+ [yn, { useClass: vn }]
4090
+ ]), en(this._injector, [
4091
4091
  [lt]
4092
4092
  ]);
4093
4093
  }
4094
4094
  onReady() {
4095
- Qt(this._injector, [
4096
- [Wt],
4097
- [xt]
4095
+ en(this._injector, [
4096
+ [Bt],
4097
+ [Wt]
4098
4098
  ]);
4099
4099
  }
4100
4100
  onRendered() {
4101
- this._registerRenderModules(), Qt(this._injector, [
4102
- [Bt],
4101
+ this._registerRenderModules(), en(this._injector, [
4103
4102
  [jt],
4104
4103
  [Ft],
4105
- [kt],
4106
- [$t]
4104
+ [Lt],
4105
+ [$t],
4106
+ [xt]
4107
4107
  ]);
4108
4108
  }
4109
4109
  onSteady() {
4110
- this._injector.get(Nt);
4110
+ this._injector.get(kt);
4111
4111
  }
4112
4112
  _registerRenderModules() {
4113
4113
  [
4114
4114
  [dt],
4115
- [Dn],
4116
4115
  [Rn],
4117
- [Cn]
4116
+ [Cn],
4117
+ [In]
4118
4118
  ].forEach((i) => {
4119
4119
  this.disposeWithMe(this._renderManagerService.registerRenderModule(k.UNIVER_SHEET, i));
4120
4120
  });
4121
4121
  }
4122
4122
  };
4123
- Yr(Lt, "type", k.UNIVER_SHEET);
4124
- Yr(Lt, "pluginName", No);
4125
- Lt = Ao([
4123
+ Xr(Ht, "type", k.UNIVER_SHEET);
4124
+ Xr(Ht, "pluginName", No);
4125
+ Ht = Ao([
4126
4126
  Oi(os, ws, Rs, ki),
4127
- un(1, A(qe)),
4128
- un(2, ee),
4129
- un(3, Ui)
4130
- ], Lt);
4127
+ ln(1, A(qe)),
4128
+ ln(2, ee),
4129
+ ln(3, Ui)
4130
+ ], Ht);
4131
4131
  export {
4132
- In as BatchSaveImagesService,
4132
+ vn as BatchSaveImagesService,
4133
4133
  H as ClearSheetDrawingTransformerOperation,
4134
- kr as DeleteDrawingsCommand,
4135
- Fr as EditSheetDrawingOperation,
4134
+ $r as DeleteDrawingsCommand,
4135
+ Lr as EditSheetDrawingOperation,
4136
4136
  ye as FileNamePart,
4137
- $r as GroupSheetDrawingCommand,
4138
- En as IBatchSaveImagesService,
4139
- Kt as InsertFloatImageCommand,
4140
- Xt as InsertSheetDrawingCommand,
4137
+ xr as GroupSheetDrawingCommand,
4138
+ yn as IBatchSaveImagesService,
4139
+ Jt as InsertFloatImageCommand,
4140
+ zt as InsertSheetDrawingCommand,
4141
4141
  gt as MoveDrawingsCommand,
4142
4142
  ht as RemoveSheetDrawingCommand,
4143
- Gr as SHEETS_IMAGE_MENU_ID,
4143
+ Yr as SHEETS_IMAGE_MENU_ID,
4144
4144
  io as SHEET_FLOAT_DOM_PREFIX,
4145
4145
  ct as SaveCellImagesCommand,
4146
- xr as SetDrawingArrangeCommand,
4147
- zt as SetSheetDrawingCommand,
4146
+ Wr as SetDrawingArrangeCommand,
4147
+ Kt as SetSheetDrawingCommand,
4148
4148
  lt as SheetCanvasFloatDomManagerService,
4149
4149
  mo as SheetDrawingAnchor,
4150
4150
  dt as SheetDrawingUpdateController,
4151
- jr as SidebarSheetDrawingOperation,
4152
- Wr as UngroupSheetDrawingCommand,
4153
- Lt as UniverSheetsDrawingUIPlugin,
4154
- fe as calcSheetFloatDomPosition,
4151
+ Fr as SidebarSheetDrawingOperation,
4152
+ Br as UngroupSheetDrawingCommand,
4153
+ Ht as UniverSheetsDrawingUIPlugin,
4154
+ me as calcSheetFloatDomPosition,
4155
4155
  J as drawingPositionToTransform,
4156
4156
  j as transformToDrawingPosition
4157
4157
  };