@univerjs/drawing-ui 0.15.3 → 0.15.4

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,51 +1,51 @@
1
- var Dt = Object.defineProperty;
2
- var Tt = (i, r, e) => r in i ? Dt(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
- var J = (i, r, e) => Tt(i, typeof r != "symbol" ? r + "" : r, e);
4
- import { CommandType as we, UniverInstanceType as Te, ICommandService as ce, LocaleService as re, Inject as Le, Disposable as ke, DrawingTypeEnum as q, checkIfMove as st, toDisposable as pe, IUniverInstanceService as Fe, IURLImageService as Et, ImageSourceType as Ye, Injector as Pt, IConfigService as Nt, Plugin as Ut, merge as Bt, ArrangeTypeEnum as Ce, generateRandomId as xt, debounce as Se } from "@univerjs/core";
5
- import { getDrawingShapeKeyByDrawingSearch as L, SetDrawingSelectedOperation as Ee, IDrawingManagerService as ne, ImageSourceType as Xe, IImageIoService as ot } from "@univerjs/drawing";
6
- import { Group as me, DRAWING_OBJECT_LAYER_INDEX as Pe, RENDER_CLASS_TYPE as Je, IRenderManagerService as ue, Shape as jt, Rect as ct, Canvas as At, Image as We, precisionTo as Ie, CURSOR_TYPE as Ne, Vector2 as Ve, degToRad as qe, getGroupState as Ht, transformObjectOutOfGroup as Lt } from "@univerjs/engine-render";
7
- import { useDependency as A, ComponentManager as kt, IMessageService as $t, IGalleryService as Vt, IDialogService as Gt } from "@univerjs/ui";
8
- import { jsx as v, jsxs as P, Fragment as Wt } from "react/jsx-runtime";
9
- import { DropdownMenu as Zt, clsx as Q, borderClassName as Ft, MessageType as Qe, Select as lt, Button as se, InputNumber as fe, Checkbox as zt } from "@univerjs/design";
10
- import { useRef as ut, createElement as z, forwardRef as ee, useState as j, useEffect as ve } from "react";
11
- import { switchMap as Kt, of as Yt } from "rxjs";
1
+ var Et = Object.defineProperty;
2
+ var Nt = (i, r, e) => r in i ? Et(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
3
+ var J = (i, r, e) => Nt(i, typeof r != "symbol" ? r + "" : r, e);
4
+ import { CommandType as _e, UniverInstanceType as me, ICommandService as ce, LocaleService as re, Inject as Le, Disposable as ke, DrawingTypeEnum as q, checkIfMove as ct, toDisposable as we, IUniverInstanceService as $e, IURLImageService as Pt, ImageSourceType as Ye, Injector as Ut, IConfigService as Bt, Plugin as xt, merge as jt, ArrangeTypeEnum as Ie, generateRandomId as At, debounce as be } from "@univerjs/core";
5
+ import { getDrawingShapeKeyByDrawingSearch as L, SetDrawingSelectedOperation as Ee, IDrawingManagerService as ne, ImageSourceType as Xe, IImageIoService as lt } from "@univerjs/drawing";
6
+ import { Group as ve, DRAWING_OBJECT_LAYER_INDEX as Ne, RENDER_CLASS_TYPE as Je, IRenderManagerService as ue, Shape as Ht, Rect as ut, Canvas as Lt, Image as Ze, precisionTo as ye, CURSOR_TYPE as Pe, Vector2 as Ge, degToRad as qe, getGroupState as kt, transformObjectOutOfGroup as $t } from "@univerjs/engine-render";
7
+ import { useDependency as A, ComponentManager as Vt, IMessageService as Gt, IGalleryService as Wt, IDialogService as Zt } from "@univerjs/ui";
8
+ import { jsx as v, jsxs as N, Fragment as Ft } from "react/jsx-runtime";
9
+ import { DropdownMenu as zt, clsx as Q, borderClassName as Kt, MessageType as Qe, Select as gt, Button as se, InputNumber as fe, Checkbox as Yt } from "@univerjs/design";
10
+ import { useRef as dt, createElement as z, forwardRef as ee, useState as j, useEffect as Ce } from "react";
11
+ import { switchMap as Xt, of as Jt, bufferTime as qt, filter as et, map as tt } from "rxjs";
12
12
  var D = /* @__PURE__ */ ((i) => (i.default = "0", i.left = "1", i.center = "2", i.right = "3", i.top = "4", i.middle = "5", i.bottom = "6", i.horizon = "7", i.vertical = "8", i))(D || {});
13
13
  const ze = {
14
14
  id: "sheet.operation.set-image-align",
15
- type: we.OPERATION,
15
+ type: _e.OPERATION,
16
16
  handler: (i, r) => !0
17
- }, Ze = {
17
+ }, Fe = {
18
18
  id: "sheet.operation.open-image-crop",
19
- type: we.OPERATION,
19
+ type: _e.OPERATION,
20
20
  handler: (i, r) => !0
21
21
  }, oe = {
22
22
  id: "sheet.operation.close-image-crop",
23
- type: we.OPERATION,
23
+ type: _e.OPERATION,
24
24
  handler: (i, r) => !0
25
25
  };
26
26
  var B = /* @__PURE__ */ ((i) => (i.FREE = "0", i.R1_1 = "1", i.R16_9 = "2", i.R9_16 = "3", i.R5_4 = "4", i.R4_5 = "5", i.R4_3 = "6", i.R3_4 = "7", i.R3_2 = "8", i.R2_3 = "9", i))(B || {});
27
27
  const Ue = {
28
28
  id: "sheet.operation.Auto-image-crop",
29
- type: we.OPERATION,
29
+ type: _e.OPERATION,
30
30
  handler: (i, r) => !0
31
- }, gt = {
31
+ }, ht = {
32
32
  id: "sheet.operation.image-reset-size",
33
- type: we.OPERATION,
33
+ type: _e.OPERATION,
34
34
  handler: (i, r) => !0
35
35
  };
36
- function et(i, r, e, t) {
36
+ function rt(i, r, e, t) {
37
37
  const n = t.getDrawingByParam(i);
38
38
  if (n == null)
39
39
  return;
40
40
  const s = L(i), a = e.getObject(s);
41
- if (a && !(a instanceof me))
41
+ if (a && !(a instanceof ve))
42
42
  return;
43
43
  if (a != null) {
44
44
  a.addObject(r);
45
45
  return;
46
46
  }
47
- const o = new me(s);
48
- e.addObject(o, Pe).attachTransformerTo(o), o.addObject(r);
47
+ const o = new ve(s);
48
+ e.addObject(o, Ne).attachTransformerTo(o), o.addObject(r);
49
49
  const { transform: c } = n;
50
50
  c && o.transformByState(
51
51
  {
@@ -55,19 +55,19 @@ function et(i, r, e, t) {
55
55
  }
56
56
  );
57
57
  }
58
- function dt(i, r) {
58
+ function ft(i, r) {
59
59
  var s;
60
60
  const e = r ? i.getUnit(r) : i.getFocusedUnit();
61
61
  if (e == null)
62
62
  return;
63
63
  const t = e.getUnitId();
64
64
  let n;
65
- return e.type === Te.UNIVER_SHEET ? n = (s = e.getActiveSheet()) == null ? void 0 : s.getSheetId() : (e.type === Te.UNIVER_DOC || e.type === Te.UNIVER_SLIDE) && (n = t), { unitId: t, subUnitId: n, current: e };
65
+ return e.type === me.UNIVER_SHEET ? n = (s = e.getActiveSheet()) == null ? void 0 : s.getSheetId() : (e.type === me.UNIVER_DOC || e.type === me.UNIVER_SLIDE) && (n = t), { unitId: t, subUnitId: n, current: e };
66
66
  }
67
- const Xt = "drawing-ui.config", tt = {}, Jt = "COMPONENT_IMAGE_POPUP_MENU";
67
+ const Qt = "drawing-ui.config", nt = {}, er = "COMPONENT_IMAGE_POPUP_MENU";
68
68
  function K({ ref: i, ...r }) {
69
- const { icon: e, id: t, className: n, extend: s, ...a } = r, o = `univerjs-icon univerjs-icon-${t} ${n || ""}`.trim(), c = ut(`_${er()}`);
70
- return ht(e, `${t}`, {
69
+ const { icon: e, id: t, className: n, extend: s, ...a } = r, o = `univerjs-icon univerjs-icon-${t} ${n || ""}`.trim(), c = dt(`_${nr()}`);
70
+ return pt(e, `${t}`, {
71
71
  defIds: e.defIds,
72
72
  idSuffix: c.current
73
73
  }, {
@@ -76,14 +76,14 @@ function K({ ref: i, ...r }) {
76
76
  ...a
77
77
  }, s);
78
78
  }
79
- function ht(i, r, e, t, n) {
79
+ function pt(i, r, e, t, n) {
80
80
  return z(i.tag, {
81
81
  key: r,
82
- ...qt(i, e, n),
82
+ ...tr(i, e, n),
83
83
  ...t
84
- }, (Qt(i, e).children || []).map((s, a) => ht(s, `${r}-${i.tag}-${a}`, e, void 0, n)));
84
+ }, (rr(i, e).children || []).map((s, a) => pt(s, `${r}-${i.tag}-${a}`, e, void 0, n)));
85
85
  }
86
- function qt(i, r, e) {
86
+ function tr(i, r, e) {
87
87
  const t = { ...i.attrs };
88
88
  e != null && e.colorChannel1 && t.fill === "colorChannel1" && (t.fill = e.colorChannel1), i.tag === "mask" && t.id && (t.id = t.id + r.idSuffix), Object.entries(t).forEach(([s, a]) => {
89
89
  s === "mask" && typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, `url(#$1${r.idSuffix})`));
@@ -93,7 +93,7 @@ function qt(i, r, e) {
93
93
  typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, `url(#$1${r.idSuffix})`));
94
94
  })), t;
95
95
  }
96
- function Qt(i, r) {
96
+ function rr(i, r) {
97
97
  var t;
98
98
  const { defIds: e } = r;
99
99
  return !e || e.length === 0 ? i : i.tag === "defs" && ((t = i.children) != null && t.length) ? {
@@ -107,11 +107,11 @@ function Qt(i, r) {
107
107
  } : n)
108
108
  } : i;
109
109
  }
110
- function er() {
110
+ function nr() {
111
111
  return Math.random().toString(36).substring(2, 8);
112
112
  }
113
113
  K.displayName = "UniverIcon";
114
- const tr = {
114
+ const ir = {
115
115
  tag: "svg",
116
116
  attrs: {
117
117
  xmlns: "http://www.w3.org/2000/svg",
@@ -154,15 +154,15 @@ const tr = {
154
154
  }
155
155
  }
156
156
  ]
157
- }, ft = ee(function(r, e) {
157
+ }, mt = ee(function(r, e) {
158
158
  return z(K, Object.assign({}, r, {
159
159
  id: "bottom-icon",
160
160
  ref: e,
161
- icon: tr
161
+ icon: ir
162
162
  }));
163
163
  });
164
- ft.displayName = "BottomIcon";
165
- const rr = {
164
+ mt.displayName = "BottomIcon";
165
+ const ar = {
166
166
  tag: "svg",
167
167
  attrs: {
168
168
  xmlns: "http://www.w3.org/2000/svg",
@@ -203,15 +203,15 @@ const rr = {
203
203
  }
204
204
  }
205
205
  ]
206
- }, pt = ee(function(r, e) {
206
+ }, wt = ee(function(r, e) {
207
207
  return z(K, Object.assign({}, r, {
208
208
  id: "create-copy-icon",
209
209
  ref: e,
210
- icon: rr
210
+ icon: ar
211
211
  }));
212
212
  });
213
- pt.displayName = "CreateCopyIcon";
214
- const nr = {
213
+ wt.displayName = "CreateCopyIcon";
214
+ const sr = {
215
215
  tag: "svg",
216
216
  attrs: {
217
217
  xmlns: "http://www.w3.org/2000/svg",
@@ -229,15 +229,15 @@ const nr = {
229
229
  clipRule: "evenodd"
230
230
  }
231
231
  }]
232
- }, mt = ee(function(r, e) {
232
+ }, vt = ee(function(r, e) {
233
233
  return z(K, Object.assign({}, r, {
234
234
  id: "group-icon",
235
235
  ref: e,
236
- icon: nr
236
+ icon: sr
237
237
  }));
238
238
  });
239
- mt.displayName = "GroupIcon";
240
- const ir = {
239
+ vt.displayName = "GroupIcon";
240
+ const or = {
241
241
  tag: "svg",
242
242
  attrs: {
243
243
  xmlns: "http://www.w3.org/2000/svg",
@@ -255,15 +255,15 @@ const ir = {
255
255
  clipRule: "evenodd"
256
256
  }
257
257
  }]
258
- }, wt = ee(function(r, e) {
258
+ }, _t = ee(function(r, e) {
259
259
  return z(K, Object.assign({}, r, {
260
260
  id: "more-down-icon",
261
261
  ref: e,
262
- icon: ir
262
+ icon: or
263
263
  }));
264
264
  });
265
- wt.displayName = "MoreDownIcon";
266
- const ar = {
265
+ _t.displayName = "MoreDownIcon";
266
+ const cr = {
267
267
  tag: "svg",
268
268
  attrs: {
269
269
  xmlns: "http://www.w3.org/2000/svg",
@@ -287,15 +287,15 @@ const ar = {
287
287
  d: "M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z"
288
288
  }
289
289
  }]
290
- }, vt = ee(function(r, e) {
290
+ }, Ct = ee(function(r, e) {
291
291
  return z(K, Object.assign({}, r, {
292
292
  id: "move-down-icon",
293
293
  ref: e,
294
- icon: ar
294
+ icon: cr
295
295
  }));
296
296
  });
297
- vt.displayName = "MoveDownIcon";
298
- const sr = {
297
+ Ct.displayName = "MoveDownIcon";
298
+ const lr = {
299
299
  tag: "svg",
300
300
  attrs: {
301
301
  xmlns: "http://www.w3.org/2000/svg",
@@ -319,15 +319,15 @@ const sr = {
319
319
  d: "M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z"
320
320
  }
321
321
  }]
322
- }, _t = ee(function(r, e) {
322
+ }, St = ee(function(r, e) {
323
323
  return z(K, Object.assign({}, r, {
324
324
  id: "move-up-icon",
325
325
  ref: e,
326
- icon: sr
326
+ icon: lr
327
327
  }));
328
328
  });
329
- _t.displayName = "MoveUpIcon";
330
- const or = {
329
+ St.displayName = "MoveUpIcon";
330
+ const ur = {
331
331
  tag: "svg",
332
332
  attrs: {
333
333
  xmlns: "http://www.w3.org/2000/svg",
@@ -363,15 +363,15 @@ const or = {
363
363
  }
364
364
  }
365
365
  ]
366
- }, Ct = ee(function(r, e) {
366
+ }, It = ee(function(r, e) {
367
367
  return z(K, Object.assign({}, r, {
368
368
  id: "topmost-icon",
369
369
  ref: e,
370
- icon: or
370
+ icon: ur
371
371
  }));
372
372
  });
373
- Ct.displayName = "TopmostIcon";
374
- const cr = {
373
+ It.displayName = "TopmostIcon";
374
+ const gr = {
375
375
  tag: "svg",
376
376
  attrs: {
377
377
  xmlns: "http://www.w3.org/2000/svg",
@@ -395,15 +395,15 @@ const cr = {
395
395
  clipRule: "evenodd"
396
396
  }
397
397
  }]
398
- }, St = ee(function(r, e) {
398
+ }, bt = ee(function(r, e) {
399
399
  return z(K, Object.assign({}, r, {
400
400
  id: "ungroup-icon",
401
401
  ref: e,
402
- icon: cr
402
+ icon: gr
403
403
  }));
404
404
  });
405
- St.displayName = "UngroupIcon";
406
- const lr = {
405
+ bt.displayName = "UngroupIcon";
406
+ const dr = {
407
407
  tag: "svg",
408
408
  attrs: {
409
409
  xmlns: "http://www.w3.org/2000/svg",
@@ -448,15 +448,15 @@ const lr = {
448
448
  }
449
449
  }
450
450
  ]
451
- }, It = ee(function(r, e) {
451
+ }, yt = ee(function(r, e) {
452
452
  return z(K, Object.assign({}, r, {
453
453
  id: "autofill-double-icon",
454
454
  ref: e,
455
- icon: lr
455
+ icon: dr
456
456
  }));
457
457
  });
458
- It.displayName = "AutofillDoubleIcon";
459
- function ur(i) {
458
+ yt.displayName = "AutofillDoubleIcon";
459
+ function hr(i) {
460
460
  var h;
461
461
  const { popup: r } = i, e = (h = r == null ? void 0 : r.extraProps) == null ? void 0 : h.menuItems;
462
462
  if (!e) return null;
@@ -475,7 +475,7 @@ function ur(i) {
475
475
  onMouseEnter: u,
476
476
  onMouseLeave: l,
477
477
  children: /* @__PURE__ */ v(
478
- Zt,
478
+ zt,
479
479
  {
480
480
  align: "start",
481
481
  items: w.map((p) => ({
@@ -485,21 +485,21 @@ function ur(i) {
485
485
  })),
486
486
  open: s,
487
487
  onOpenChange: g,
488
- children: /* @__PURE__ */ P(
488
+ children: /* @__PURE__ */ N(
489
489
  "div",
490
490
  {
491
- className: Q("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", Ft, {
491
+ className: Q("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", Kt, {
492
492
  "univer-bg-gray-100 dark:!univer-bg-gray-800": s,
493
493
  "univer-bg-white dark:!univer-bg-gray-900": !s
494
494
  }),
495
495
  children: [
496
496
  /* @__PURE__ */ v(
497
- It,
497
+ yt,
498
498
  {
499
499
  className: "univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white"
500
500
  }
501
501
  ),
502
- f && /* @__PURE__ */ v(wt, { className: "dark:!univer-text-white" })
502
+ f && /* @__PURE__ */ v(_t, { className: "dark:!univer-text-white" })
503
503
  ]
504
504
  }
505
505
  )
@@ -508,24 +508,24 @@ function ur(i) {
508
508
  }
509
509
  );
510
510
  }
511
- var gr = Object.getOwnPropertyDescriptor, dr = (i, r, e, t) => {
512
- for (var n = t > 1 ? void 0 : t ? gr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
511
+ var fr = Object.getOwnPropertyDescriptor, pr = (i, r, e, t) => {
512
+ for (var n = t > 1 ? void 0 : t ? fr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
513
513
  (a = i[s]) && (n = a(n) || n);
514
514
  return n;
515
- }, rt = (i, r) => (e, t) => r(e, t, i);
515
+ }, it = (i, r) => (e, t) => r(e, t, i);
516
516
  let Be = class extends ke {
517
517
  constructor(i, r) {
518
518
  super(), this._componentManager = i, this._commandService = r, this._init();
519
519
  }
520
520
  _initCustomComponents() {
521
521
  const i = this._componentManager;
522
- this.disposeWithMe(i.register(Jt, ur));
522
+ this.disposeWithMe(i.register(er, hr));
523
523
  }
524
524
  _initCommands() {
525
525
  [
526
- Ze,
526
+ Fe,
527
527
  oe,
528
- gt,
528
+ ht,
529
529
  ze,
530
530
  Ue
531
531
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
@@ -534,11 +534,11 @@ let Be = class extends ke {
534
534
  this._initCommands(), this._initCustomComponents();
535
535
  }
536
536
  };
537
- Be = dr([
538
- rt(0, Le(kt)),
539
- rt(1, ce)
537
+ Be = pr([
538
+ it(0, Le(Vt)),
539
+ it(1, ce)
540
540
  ], Be);
541
- function $e(i, r) {
541
+ function Ve(i, r) {
542
542
  const e = [];
543
543
  return i.forEach((t) => {
544
544
  const { oKey: n, left: s, top: a, height: o, width: c, angle: u } = t, l = r.getDrawingOKey(n);
@@ -560,11 +560,11 @@ function $e(i, r) {
560
560
  w === q.DRAWING_IMAGE && (h.srcRect = t.srcRect), e.push(h);
561
561
  }), e;
562
562
  }
563
- var hr = Object.getOwnPropertyDescriptor, fr = (i, r, e, t) => {
564
- for (var n = t > 1 ? void 0 : t ? hr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
563
+ var mr = Object.getOwnPropertyDescriptor, wr = (i, r, e, t) => {
564
+ for (var n = t > 1 ? void 0 : t ? mr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
565
565
  (a = i[s]) && (n = a(n) || n);
566
566
  return n;
567
- }, be = (i, r) => (e, t) => r(e, t, i);
567
+ }, Me = (i, r) => (e, t) => r(e, t, i);
568
568
  let xe = class extends ke {
569
569
  constructor(r, e, t, n) {
570
570
  super();
@@ -578,7 +578,7 @@ let xe = class extends ke {
578
578
  this._recoveryImages(), this._drawingAddListener(), this._drawingRemoveListener(), this._drawingUpdateListener(), this._commandExecutedListener(), this._drawingArrangeListener(), this._drawingGroupListener(), this._drawingRefreshListener(), this._drawingVisibleListener();
579
579
  }
580
580
  _recoveryImages() {
581
- const r = this._drawingManagerService.drawingManagerData, e = dt(this._currentUniverService);
581
+ const r = this._drawingManagerService.drawingManagerData, e = ft(this._currentUniverService);
582
582
  if (e == null)
583
583
  return;
584
584
  const { unitId: t, subUnitId: n } = e;
@@ -664,8 +664,8 @@ let xe = class extends ke {
664
664
  p != null && (h.classType === Je.GROUP ? h.transformByState({ left: p.left, top: p.top }) : h.transformByState(p));
665
665
  }), l.length === 0)
666
666
  return;
667
- const g = L({ unitId: n, subUnitId: s, drawingId: a }), d = new me(g);
668
- c.addObject(d, Pe).attachTransformerTo(d), d.addObjects(...l), e.transform && d.transformByState({ left: e.transform.left, top: e.transform.top }), u.clearSelectedObjects(), u.setSelectedControl(d);
667
+ const g = L({ unitId: n, subUnitId: s, drawingId: a }), d = new ve(g);
668
+ c.addObject(d, Ne).attachTransformerTo(d), d.addObjects(...l), e.transform && d.transformByState({ left: e.transform.left, top: e.transform.top }), u.clearSelectedObjects(), u.setSelectedControl(d);
669
669
  }
670
670
  // private _regroupDrawings(drawings: IDrawingSearch[]) {
671
671
  // const renderObject = this._getSceneAndTransformerByDrawingSearch(drawings[0].unitId);
@@ -959,7 +959,7 @@ let xe = class extends ke {
959
959
  if (t == null)
960
960
  return !1;
961
961
  const { transform: s } = t;
962
- return st(s, e == null ? void 0 : e[n]);
962
+ return ct(s, e == null ? void 0 : e[n]);
963
963
  });
964
964
  }
965
965
  // group?.getObjects().forEach((o) => {
@@ -973,14 +973,14 @@ let xe = class extends ke {
973
973
  const e = r.getTransformerByCreate();
974
974
  let t = null;
975
975
  this.disposeWithMe(
976
- pe(
976
+ we(
977
977
  e.changeStart$.subscribe((n) => {
978
978
  const { objects: s } = n, a = Array.from(s.values()), o = [];
979
979
  t = a.map((c) => {
980
980
  const { left: u, top: l, height: g, width: d, angle: f, oKey: w, isInGroup: h } = c, p = this._drawingManagerService.getDrawingOKey(w);
981
- if (h || c instanceof me) {
981
+ if (h || c instanceof ve) {
982
982
  let C = c.ancestorGroup;
983
- if (C == null && c instanceof me && (C = c), C == null)
983
+ if (C == null && c instanceof ve && (C = c), C == null)
984
984
  return null;
985
985
  const _ = this._drawingManagerService.getDrawingOKey(C.oKey);
986
986
  if (_) {
@@ -998,22 +998,22 @@ let xe = class extends ke {
998
998
  })
999
999
  )
1000
1000
  ), this.disposeWithMe(
1001
- pe(
1001
+ we(
1002
1002
  e.changeEnd$.subscribe((n) => {
1003
- const { objects: s } = n, a = this._filterUpdateParams($e(s, this._drawingManagerService), t);
1003
+ const { objects: s } = n, a = this._filterUpdateParams(Ve(s, this._drawingManagerService), t);
1004
1004
  a.length > 0 && this._drawingManagerService.featurePluginUpdateNotification(a);
1005
1005
  })
1006
1006
  )
1007
1007
  );
1008
1008
  }
1009
1009
  };
1010
- xe = fr([
1011
- be(0, Fe),
1012
- be(1, ce),
1013
- be(2, ue),
1014
- be(3, ne)
1010
+ xe = wr([
1011
+ Me(0, $e),
1012
+ Me(1, ce),
1013
+ Me(2, ue),
1014
+ Me(3, ne)
1015
1015
  ], xe);
1016
- class ye extends jt {
1016
+ class Re extends Ht {
1017
1017
  constructor(e, t) {
1018
1018
  t == null && (t = {}), t.transformerConfig = {
1019
1019
  keepRatio: !1,
@@ -1056,7 +1056,7 @@ class ye extends jt {
1056
1056
  const n = this.getScene().getEngine(), { width: s, height: a } = n;
1057
1057
  this._initialCacheCanvas(), (c = this._cacheCanvas) == null || c.clear();
1058
1058
  const o = (u = this._cacheCanvas) == null ? void 0 : u.getContext();
1059
- o != null && (o.save(), ct.drawWith(o, {
1059
+ o != null && (o.save(), ut.drawWith(o, {
1060
1060
  left: 0,
1061
1061
  top: 0,
1062
1062
  width: s,
@@ -1100,7 +1100,7 @@ class ye extends jt {
1100
1100
  return;
1101
1101
  const e = this.getScene();
1102
1102
  if (e == null) return;
1103
- this._cacheCanvas = new At();
1103
+ this._cacheCanvas = new Lt();
1104
1104
  const t = e.getEngine();
1105
1105
  this._cacheCanvas.setSize(t.width, t.height), t.onTransformChange$.subscribeEvent(() => {
1106
1106
  var n;
@@ -1108,8 +1108,8 @@ class ye extends jt {
1108
1108
  });
1109
1109
  }
1110
1110
  }
1111
- var pr = Object.getOwnPropertyDescriptor, mr = (i, r, e, t) => {
1112
- for (var n = t > 1 ? void 0 : t ? pr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1111
+ var vr = Object.getOwnPropertyDescriptor, _r = (i, r, e, t) => {
1112
+ for (var n = t > 1 ? void 0 : t ? vr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1113
1113
  (a = i[s]) && (n = a(n) || n);
1114
1114
  return n;
1115
1115
  }, le = (i, r) => (e, t) => r(e, t, i);
@@ -1138,14 +1138,14 @@ let je = class extends ke {
1138
1138
  return !0;
1139
1139
  this._searchCropObject(l) != null && this._commandService.syncExecuteCommand(oe.id, { isAuto: !0 });
1140
1140
  const d = L({ unitId: a, subUnitId: o, drawingId: c }), f = l.getObject(d);
1141
- if (!(f instanceof We)) {
1141
+ if (!(f instanceof Ze)) {
1142
1142
  this._messageService.show({
1143
1143
  type: Qe.Error,
1144
1144
  content: this._localeService.t("image-cropper.error")
1145
1145
  });
1146
1146
  return;
1147
1147
  }
1148
- f != null && (this._updateCropperObject(t, f), this._commandService.executeCommand(Ze.id, { unitId: a, subUnitId: o, drawingId: c }));
1148
+ f != null && (this._updateCropperObject(t, f), this._commandService.executeCommand(Fe.id, { unitId: a, subUnitId: o, drawingId: c }));
1149
1149
  })
1150
1150
  );
1151
1151
  }
@@ -1155,10 +1155,10 @@ let je = class extends ke {
1155
1155
  o > c ? u = n * c : l = t / c;
1156
1156
  const g = (t - u) / 2, d = (n - l) / 2;
1157
1157
  return {
1158
- left: Ie(g, 1),
1159
- top: Ie(d, 1),
1160
- right: Ie(t - (g + u), 1),
1161
- bottom: Ie(n - (d + l), 1)
1158
+ left: ye(g, 1),
1159
+ top: ye(d, 1),
1160
+ right: ye(t - (g + u), 1),
1161
+ bottom: ye(n - (d + l), 1)
1162
1162
  };
1163
1163
  }
1164
1164
  _updateCropperObject(r, e) {
@@ -1208,7 +1208,7 @@ let je = class extends ke {
1208
1208
  _initOpenCrop() {
1209
1209
  this.disposeWithMe(
1210
1210
  this._commandService.onCommandExecuted((r) => {
1211
- if (r.id !== Ze.id)
1211
+ if (r.id !== Fe.id)
1212
1212
  return;
1213
1213
  const e = r.params;
1214
1214
  if (e == null)
@@ -1221,7 +1221,7 @@ let je = class extends ke {
1221
1221
  const u = L({ unitId: t, subUnitId: n, drawingId: s }), l = o.getObject(u);
1222
1222
  if (l == null)
1223
1223
  return;
1224
- if (!(l instanceof We)) {
1224
+ if (!(l instanceof Ze)) {
1225
1225
  this._messageService.show({
1226
1226
  type: Qe.Error,
1227
1227
  content: this._localeService.t("image-cropper.error")
@@ -1230,7 +1230,7 @@ let je = class extends ke {
1230
1230
  }
1231
1231
  const g = o.getTransformer();
1232
1232
  g == null || g.clearControls();
1233
- const d = new ye(`${u}-crop`, {
1233
+ const d = new Re(`${u}-crop`, {
1234
1234
  srcRect: l.srcRect,
1235
1235
  prstGeom: l.prstGeom,
1236
1236
  applyTransform: l.calculateTransformWithSrcRect()
@@ -1242,7 +1242,7 @@ let je = class extends ke {
1242
1242
  _searchCropObject(r) {
1243
1243
  const e = r.getAllObjectsByOrder();
1244
1244
  for (const t of e)
1245
- if (t instanceof ye)
1245
+ if (t instanceof Re)
1246
1246
  return t;
1247
1247
  }
1248
1248
  _initCloseCrop() {
@@ -1282,8 +1282,8 @@ let je = class extends ke {
1282
1282
  c.setSrcRect({ ...l.srcRectAngle }), c.closeRenderByCropper(), c.makeDirty(!0), o == null || o.dispose();
1283
1283
  })
1284
1284
  );
1285
- const r = this._univerInstanceService.getCurrentTypeOfUnit$(Te.UNIVER_SHEET).pipe(
1286
- Kt((e) => e ? e.activeSheet$ : Yt(null))
1285
+ const r = this._univerInstanceService.getCurrentTypeOfUnit$(me.UNIVER_SHEET).pipe(
1286
+ Xt((e) => e ? e.activeSheet$ : Jt(null))
1287
1287
  );
1288
1288
  this.disposeWithMe(r.subscribe(() => {
1289
1289
  this._commandService.syncExecuteCommand(oe.id);
@@ -1301,7 +1301,7 @@ let je = class extends ke {
1301
1301
  this.disposeWithMe(
1302
1302
  e.changeStart$.subscribe((n) => {
1303
1303
  const { objects: s } = n, a = s.values().next().value;
1304
- if (a == null || !(a instanceof ye))
1304
+ if (a == null || !(a instanceof Re))
1305
1305
  return;
1306
1306
  const { left: o, top: c, height: u, width: l, angle: g } = a;
1307
1307
  t = { left: o, top: c, height: u, width: l, angle: g }, e.clearCopperControl();
@@ -1309,10 +1309,10 @@ let je = class extends ke {
1309
1309
  ), this.disposeWithMe(
1310
1310
  e.changeEnd$.subscribe((n) => {
1311
1311
  const { objects: s } = n, a = s.values().next().value;
1312
- if (a == null || !(a instanceof ye))
1312
+ if (a == null || !(a instanceof Re))
1313
1313
  return;
1314
1314
  const { left: o, top: c, height: u, width: l, angle: g } = a;
1315
- if (!st({ left: o, top: c, height: u, width: l, angle: g }, t))
1315
+ if (!ct({ left: o, top: c, height: u, width: l, angle: g }, t))
1316
1316
  return;
1317
1317
  const d = this._getApplyObjectByCropObject(a);
1318
1318
  if (d == null)
@@ -1325,11 +1325,11 @@ let je = class extends ke {
1325
1325
  _addHoverForImageCopper(r) {
1326
1326
  this.disposeWithMe(
1327
1327
  r.onPointerEnter$.subscribeEvent(() => {
1328
- r.cursor = Ne.MOVE;
1328
+ r.cursor = Pe.MOVE;
1329
1329
  })
1330
1330
  ), this.disposeWithMe(
1331
1331
  r.onPointerLeave$.subscribeEvent(() => {
1332
- r.cursor = Ne.DEFAULT;
1332
+ r.cursor = Pe.DEFAULT;
1333
1333
  })
1334
1334
  );
1335
1335
  }
@@ -1349,12 +1349,12 @@ let je = class extends ke {
1349
1349
  bottom: d - p - s
1350
1350
  }, _ = { ...C };
1351
1351
  if (f !== 0) {
1352
- const I = t + a / 2, R = n + s / 2, T = new Ve(I, R), S = g / 2 + u, b = d / 2 + l, y = new Ve(S, b), O = new Ve(u, l);
1352
+ const I = t + a / 2, R = n + s / 2, T = new Ge(I, R), S = g / 2 + u, b = d / 2 + l, y = new Ge(S, b), O = new Ge(u, l);
1353
1353
  O.rotateByPoint(qe(f), y);
1354
1354
  const M = O.clone();
1355
1355
  M.rotateByPoint(qe(-f), T);
1356
- const N = t - M.x, U = n - M.y;
1357
- _.left = N, _.top = U, _.right = g - N - a, _.bottom = d - U - s;
1356
+ const P = t - M.x, U = n - M.y;
1357
+ _.left = P, _.top = U, _.right = g - P - a, _.bottom = d - U - s;
1358
1358
  }
1359
1359
  return {
1360
1360
  srcRect: C,
@@ -1362,24 +1362,24 @@ let je = class extends ke {
1362
1362
  };
1363
1363
  }
1364
1364
  };
1365
- je = mr([
1365
+ je = _r([
1366
1366
  le(0, ce),
1367
1367
  le(1, ne),
1368
1368
  le(2, ue),
1369
- le(3, Fe),
1370
- le(4, $t),
1369
+ le(3, $e),
1370
+ le(4, Gt),
1371
1371
  le(5, Le(re))
1372
1372
  ], je);
1373
- var wr = Object.getOwnPropertyDescriptor, vr = (i, r, e, t) => {
1374
- for (var n = t > 1 ? void 0 : t ? wr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1373
+ var Cr = Object.getOwnPropertyDescriptor, Sr = (i, r, e, t) => {
1374
+ for (var n = t > 1 ? void 0 : t ? Cr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1375
1375
  (a = i[s]) && (n = a(n) || n);
1376
1376
  return n;
1377
- }, Me = (i, r) => (e, t) => r(e, t, i);
1377
+ }, pe = (i, r) => (e, t) => r(e, t, i);
1378
1378
  let Ae = class {
1379
- constructor(i, r, e, t) {
1380
- this._drawingManagerService = i, this._imageIoService = r, this._galleryService = e, this._urlImageService = t;
1379
+ constructor(i, r, e, t, n) {
1380
+ this._drawingManagerService = i, this._imageIoService = r, this._galleryService = e, this._urlImageService = t, this._univerInstanceService = n;
1381
1381
  }
1382
- // eslint-disable-next-line max-lines-per-function
1382
+ // eslint-disable-next-line max-lines-per-function, complexity
1383
1383
  async renderImages(i, r) {
1384
1384
  const {
1385
1385
  transform: e,
@@ -1399,15 +1399,17 @@ let Ae = class {
1399
1399
  return;
1400
1400
  const w = d && f ? f : [e], h = [];
1401
1401
  for (const p of w) {
1402
- const { left: C, top: _, width: I, height: R, angle: T, flipX: S, flipY: b, skewX: y, skewY: O } = p, M = w.indexOf(p), N = L({ unitId: u, subUnitId: l, drawingId: g }, d ? M : void 0), U = r.getObject(N);
1402
+ const { left: C, top: _, width: I, height: R, angle: T, flipX: S, flipY: b, skewX: y, skewY: O } = p, M = w.indexOf(p), P = L({ unitId: u, subUnitId: l, drawingId: g }, d ? M : void 0), U = r.getObject(P);
1403
1403
  if (U != null) {
1404
1404
  U.transformByState({ left: C, top: _, width: I, height: R, angle: T, flipX: S, flipY: b, skewX: y, skewY: O });
1405
1405
  continue;
1406
1406
  }
1407
- const Z = this._drawingManagerService.getDrawingOrder(u, l), Y = Z.indexOf(g), $ = { ...p, zIndex: Y === -1 ? Z.length - 1 : Y }, _e = this._imageIoService.getImageSourceCache(n, s);
1407
+ if (!this._drawingManagerService.getDrawingVisible() || l !== this._getActiveSheetId())
1408
+ continue;
1409
+ const Z = this._drawingManagerService.getDrawingOrder(u, l), Y = Z.indexOf(g), $ = { ...p, zIndex: Y === -1 ? Z.length - 1 : Y }, Se = this._imageIoService.getImageSourceCache(n, s);
1408
1410
  let te = !1;
1409
- if (_e != null)
1410
- $.image = _e;
1411
+ if (Se != null)
1412
+ $.image = Se;
1411
1413
  else if (s === Xe.UUID)
1412
1414
  try {
1413
1415
  $.url = await this._imageIoService.getImage(n);
@@ -1424,14 +1426,18 @@ let Ae = class {
1424
1426
  te = !0;
1425
1427
  } else
1426
1428
  $.url = n, te = !0;
1427
- if (r.getObject(N))
1429
+ if (r.getObject(P))
1428
1430
  continue;
1429
1431
  $.printable = !0;
1430
- const V = new We(N, $);
1431
- te && this._imageIoService.addImageSourceCache(n, s, V.getNative()), this._drawingManagerService.getDrawingVisible() && (r.addObject(V, Pe), this._drawingManagerService.getDrawingEditable() && r.attachTransformerTo(V), c && et({ drawingId: c, unitId: u, subUnitId: l }, V, r, this._drawingManagerService), o != null && V.setPrstGeom(o), a != null && V.setSrcRect(a), h.push(V));
1432
+ const V = new Ze(P, $);
1433
+ te && this._imageIoService.addImageSourceCache(n, s, V.getNative()), r.addObject(V, Ne), this._drawingManagerService.getDrawingEditable() && r.attachTransformerTo(V), c && rt({ drawingId: c, unitId: u, subUnitId: l }, V, r, this._drawingManagerService), o != null && V.setPrstGeom(o), a != null && V.setSrcRect(a), h.push(V);
1432
1434
  }
1433
1435
  return h;
1434
1436
  }
1437
+ _getActiveSheetId() {
1438
+ var i, r;
1439
+ return (r = (i = this._univerInstanceService.getCurrentUnitOfType(me.UNIVER_SHEET)) == null ? void 0 : i.getActiveSheet()) == null ? void 0 : r.getSheetId();
1440
+ }
1435
1441
  renderFloatDom(i, r) {
1436
1442
  const {
1437
1443
  transform: e,
@@ -1452,12 +1458,12 @@ let Ae = class {
1452
1458
  y.transformByState({ left: f, top: w, width: h, height: p, angle: C, flipX: _, flipY: I, skewX: R, skewY: T });
1453
1459
  continue;
1454
1460
  }
1455
- const O = this._drawingManagerService.getDrawingOrder(s, a), M = O.indexOf(o), N = { ...d, zIndex: M === -1 ? O.length - 1 : M };
1461
+ const O = this._drawingManagerService.getDrawingOrder(s, a), M = O.indexOf(o), P = { ...d, zIndex: M === -1 ? O.length - 1 : M };
1456
1462
  if (r.getObject(b))
1457
1463
  continue;
1458
- N.printable = !1;
1459
- const U = new ct(b, N);
1460
- this._drawingManagerService.getDrawingVisible() && (r.addObject(U, Pe), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && r.attachTransformerTo(U), n && et({ drawingId: n, unitId: s, subUnitId: a }, U, r, this._drawingManagerService), g.push(U));
1464
+ P.printable = !1;
1465
+ const U = new ut(b, P);
1466
+ this._drawingManagerService.getDrawingVisible() && (r.addObject(U, Ne), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && r.attachTransformerTo(U), n && rt({ drawingId: n, unitId: s, subUnitId: a }, U, r, this._drawingManagerService), g.push(U));
1461
1467
  }
1462
1468
  return g;
1463
1469
  }
@@ -1487,14 +1493,15 @@ let Ae = class {
1487
1493
  };
1488
1494
  }
1489
1495
  };
1490
- Ae = vr([
1491
- Me(0, ne),
1492
- Me(1, ot),
1493
- Me(2, Vt),
1494
- Me(3, Et)
1496
+ Ae = Sr([
1497
+ pe(0, ne),
1498
+ pe(1, lt),
1499
+ pe(2, Wt),
1500
+ pe(3, Pt),
1501
+ pe(4, $e)
1495
1502
  ], Ae);
1496
- var _r = Object.getOwnPropertyDescriptor, Cr = (i, r, e, t) => {
1497
- for (var n = t > 1 ? void 0 : t ? _r(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1503
+ var Ir = Object.getOwnPropertyDescriptor, br = (i, r, e, t) => {
1504
+ for (var n = t > 1 ? void 0 : t ? Ir(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1498
1505
  (a = i[s]) && (n = a(n) || n);
1499
1506
  return n;
1500
1507
  }, ae = (i, r) => (e, t) => r(e, t, i);
@@ -1511,7 +1518,7 @@ let He = class extends ke {
1511
1518
  _commandExecutedListener() {
1512
1519
  this.disposeWithMe(
1513
1520
  this._commandService.onCommandExecuted((i) => {
1514
- if (i.id === gt.id) {
1521
+ if (i.id === ht.id) {
1515
1522
  const r = i.params;
1516
1523
  if (r == null)
1517
1524
  return;
@@ -1562,7 +1569,18 @@ let He = class extends ke {
1562
1569
  }
1563
1570
  _drawingAddListener() {
1564
1571
  this.disposeWithMe(
1565
- this._drawingManagerService.add$.subscribe((i) => {
1572
+ this._drawingManagerService.add$.pipe(
1573
+ qt(33),
1574
+ et((i) => i.length > 0),
1575
+ tt((i) => i.flat()),
1576
+ tt((i) => {
1577
+ const r = /* @__PURE__ */ new Map();
1578
+ for (const e of i)
1579
+ r.set(`${e.unitId}|${e.subUnitId}|${e.drawingId}`, e);
1580
+ return [...r.values()];
1581
+ }),
1582
+ et((i) => i.length > 0)
1583
+ ).subscribe((i) => {
1566
1584
  this._insertImages(i);
1567
1585
  })
1568
1586
  );
@@ -1570,7 +1588,7 @@ let He = class extends ke {
1570
1588
  _insertImages(i) {
1571
1589
  i.forEach(async (r) => {
1572
1590
  var c;
1573
- const { unitId: e, subUnitId: t } = r, n = this._getSceneAndTransformerByDrawingSearch(e), s = (c = dt(this._currentUniverService, e)) == null ? void 0 : c.subUnitId;
1591
+ const { unitId: e, subUnitId: t } = r, n = this._getSceneAndTransformerByDrawingSearch(e), s = (c = ft(this._currentUniverService, e)) == null ? void 0 : c.subUnitId;
1574
1592
  if (n == null || s !== t)
1575
1593
  return;
1576
1594
  const a = this._drawingManagerService.getDrawingByParam(r);
@@ -1608,22 +1626,22 @@ let He = class extends ke {
1608
1626
  }
1609
1627
  _addHoverForImage(i) {
1610
1628
  this.disposeWithMe(
1611
- pe(
1629
+ we(
1612
1630
  i.onPointerEnter$.subscribeEvent(() => {
1613
- i.cursor = Ne.GRAB;
1631
+ i.cursor = Pe.GRAB;
1614
1632
  })
1615
1633
  )
1616
1634
  ), this.disposeWithMe(
1617
- pe(
1635
+ we(
1618
1636
  i.onPointerLeave$.subscribeEvent(() => {
1619
- i.cursor = Ne.DEFAULT;
1637
+ i.cursor = Pe.DEFAULT;
1620
1638
  })
1621
1639
  )
1622
1640
  );
1623
1641
  }
1624
1642
  _addDialogForImage(i) {
1625
1643
  this.disposeWithMe(
1626
- pe(
1644
+ we(
1627
1645
  i.onDblclick$.subscribeEvent(() => {
1628
1646
  const r = `${i.oKey}-viewer-dialog`;
1629
1647
  this._drawingRenderService.previewImage(r, i.getNative().src, i.getNativeSize().width, i.getNativeSize().height);
@@ -1632,31 +1650,31 @@ let He = class extends ke {
1632
1650
  );
1633
1651
  }
1634
1652
  };
1635
- He = Cr([
1653
+ He = br([
1636
1654
  ae(0, ce),
1637
1655
  ae(1, ue),
1638
1656
  ae(2, ne),
1639
- ae(3, Gt),
1640
- ae(4, ot),
1641
- ae(5, Fe),
1657
+ ae(3, Zt),
1658
+ ae(4, lt),
1659
+ ae(5, $e),
1642
1660
  ae(6, Le(Ae))
1643
1661
  ], He);
1644
- var Sr = Object.getOwnPropertyDescriptor, Ir = (i, r, e, t) => {
1645
- for (var n = t > 1 ? void 0 : t ? Sr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1662
+ var yr = Object.getOwnPropertyDescriptor, Mr = (i, r, e, t) => {
1663
+ for (var n = t > 1 ? void 0 : t ? yr(r, e) : r, s = i.length - 1, a; s >= 0; s--)
1646
1664
  (a = i[s]) && (n = a(n) || n);
1647
1665
  return n;
1648
- }, nt = (i, r) => (e, t) => r(e, t, i);
1649
- const br = "UNIVER_DRAWING_UI_PLUGIN";
1650
- var Ge;
1651
- let it = (Ge = class extends Ut {
1652
- constructor(i = tt, r, e) {
1666
+ }, at = (i, r) => (e, t) => r(e, t, i);
1667
+ const Rr = "UNIVER_DRAWING_UI_PLUGIN";
1668
+ var We;
1669
+ let st = (We = class extends xt {
1670
+ constructor(i = nt, r, e) {
1653
1671
  super(), this._config = i, this._injector = r, this._configService = e;
1654
- const { menu: t, ...n } = Bt(
1672
+ const { menu: t, ...n } = jt(
1655
1673
  {},
1656
- tt,
1674
+ nt,
1657
1675
  this._config
1658
1676
  );
1659
- t && this._configService.setConfig("menu", t, { merge: !0 }), this._configService.setConfig(Xt, n);
1677
+ t && this._configService.setConfig("menu", t, { merge: !0 }), this._configService.setConfig(Qt, n);
1660
1678
  }
1661
1679
  onStarting() {
1662
1680
  this._initDependencies();
@@ -1673,12 +1691,12 @@ let it = (Ge = class extends Ut {
1673
1691
  [He]
1674
1692
  ].forEach((r) => this._injector.add(r));
1675
1693
  }
1676
- }, J(Ge, "pluginName", br), Ge);
1677
- it = Ir([
1678
- nt(1, Le(Pt)),
1679
- nt(2, Nt)
1680
- ], it);
1681
- const yr = (i) => {
1694
+ }, J(We, "pluginName", Rr), We);
1695
+ st = Mr([
1696
+ at(1, Le(Ut)),
1697
+ at(2, Bt)
1698
+ ], st);
1699
+ const Or = (i) => {
1682
1700
  const r = A(ce), e = A(re), { alignShow: t } = i, [n, s] = j(D.default), a = [
1683
1701
  {
1684
1702
  label: e.t("image-panel.align.default"),
@@ -1734,7 +1752,7 @@ const yr = (i) => {
1734
1752
  alignType: c
1735
1753
  });
1736
1754
  }
1737
- return /* @__PURE__ */ P(
1755
+ return /* @__PURE__ */ N(
1738
1756
  "div",
1739
1757
  {
1740
1758
  className: Q("univer-relative univer-w-full", {
@@ -1752,15 +1770,15 @@ const yr = (i) => {
1752
1770
  "div",
1753
1771
  {
1754
1772
  className: "univer-w-full univer-text-gray-900 dark:!univer-text-white",
1755
- children: /* @__PURE__ */ v(lt, { value: n, options: a, onChange: o })
1773
+ children: /* @__PURE__ */ v(gt, { value: n, options: a, onChange: o })
1756
1774
  }
1757
1775
  ) })
1758
1776
  ]
1759
1777
  }
1760
1778
  );
1761
- }, Mr = (i) => {
1779
+ }, Dr = (i) => {
1762
1780
  const { arrangeShow: r, drawings: e } = i, t = A(re), n = A(ne), [s, a] = j(e);
1763
- ve(() => {
1781
+ Ce(() => {
1764
1782
  const c = n.focus$.subscribe((u) => {
1765
1783
  a(u);
1766
1784
  });
@@ -1772,7 +1790,7 @@ const yr = (i) => {
1772
1790
  const u = s[0].unitId, l = s[0].subUnitId, g = s.map((d) => d.drawingId);
1773
1791
  n.featurePluginOrderUpdateNotification({ unitId: u, subUnitId: l, drawingIds: g, arrangeType: c });
1774
1792
  };
1775
- return /* @__PURE__ */ P(
1793
+ return /* @__PURE__ */ N(
1776
1794
  "div",
1777
1795
  {
1778
1796
  className: Q("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
@@ -1786,38 +1804,38 @@ const yr = (i) => {
1786
1804
  children: /* @__PURE__ */ v("div", { children: t.t("image-panel.arrange.title") })
1787
1805
  }
1788
1806
  ),
1789
- /* @__PURE__ */ P("div", { className: "univer-grid univer-grid-cols-2 univer-gap-2", children: [
1790
- /* @__PURE__ */ P(se, { onClick: () => {
1791
- o(Ce.forward);
1807
+ /* @__PURE__ */ N("div", { className: "univer-grid univer-grid-cols-2 univer-gap-2", children: [
1808
+ /* @__PURE__ */ N(se, { onClick: () => {
1809
+ o(Ie.forward);
1792
1810
  }, children: [
1793
- /* @__PURE__ */ v(_t, {}),
1811
+ /* @__PURE__ */ v(St, {}),
1794
1812
  t.t("image-panel.arrange.forward")
1795
1813
  ] }),
1796
- /* @__PURE__ */ P(se, { onClick: () => {
1797
- o(Ce.backward);
1814
+ /* @__PURE__ */ N(se, { onClick: () => {
1815
+ o(Ie.backward);
1798
1816
  }, children: [
1799
- /* @__PURE__ */ v(vt, {}),
1817
+ /* @__PURE__ */ v(Ct, {}),
1800
1818
  t.t("image-panel.arrange.backward")
1801
1819
  ] }),
1802
- /* @__PURE__ */ P(se, { onClick: () => {
1803
- o(Ce.front);
1820
+ /* @__PURE__ */ N(se, { onClick: () => {
1821
+ o(Ie.front);
1804
1822
  }, children: [
1805
- /* @__PURE__ */ v(Ct, {}),
1823
+ /* @__PURE__ */ v(It, {}),
1806
1824
  t.t("image-panel.arrange.front")
1807
1825
  ] }),
1808
- /* @__PURE__ */ P(se, { onClick: () => {
1809
- o(Ce.back);
1826
+ /* @__PURE__ */ N(se, { onClick: () => {
1827
+ o(Ie.back);
1810
1828
  }, children: [
1811
- /* @__PURE__ */ v(ft, {}),
1829
+ /* @__PURE__ */ v(mt, {}),
1812
1830
  t.t("image-panel.arrange.back")
1813
1831
  ] })
1814
1832
  ] })
1815
1833
  ]
1816
1834
  }
1817
1835
  );
1818
- }, Rr = (i) => {
1836
+ }, Tr = (i) => {
1819
1837
  const r = A(re), e = A(ue), t = A(ne), { hasGroup: n, drawings: s } = i, [a, o] = j(!1), [c, u] = j(!0), [l, g] = j(!0), d = () => {
1820
- const h = t.getFocusDrawings(), { unitId: p, subUnitId: C } = h[0], _ = xt(10), I = Ht(0, 0, h.map((S) => S.transform || {})), R = {
1838
+ const h = t.getFocusDrawings(), { unitId: p, subUnitId: C } = h[0], _ = At(10), I = kt(0, 0, h.map((S) => S.transform || {})), R = {
1821
1839
  unitId: p,
1822
1840
  subUnitId: C,
1823
1841
  drawingId: _,
@@ -1851,14 +1869,14 @@ const yr = (i) => {
1851
1869
  if (R.length === 0)
1852
1870
  return;
1853
1871
  const T = R.map((S) => {
1854
- const { transform: b } = S, { unitId: y, subUnitId: O, drawingId: M } = S, N = Lt(b || {}, I, I.width || 0, I.height || 0);
1872
+ const { transform: b } = S, { unitId: y, subUnitId: O, drawingId: M } = S, P = $t(b || {}, I, I.width || 0, I.height || 0);
1855
1873
  return {
1856
1874
  unitId: y,
1857
1875
  subUnitId: O,
1858
1876
  drawingId: M,
1859
1877
  transform: {
1860
1878
  ...b,
1861
- ...N
1879
+ ...P
1862
1880
  },
1863
1881
  groupId: void 0
1864
1882
  };
@@ -1873,7 +1891,7 @@ const yr = (i) => {
1873
1891
  ).filter((C) => C != null);
1874
1892
  p.length !== 0 && t.featurePluginUngroupUpdateNotification(p);
1875
1893
  };
1876
- return ve(() => {
1894
+ return Ce(() => {
1877
1895
  const h = s[0];
1878
1896
  if (h == null)
1879
1897
  return;
@@ -1883,14 +1901,14 @@ const yr = (i) => {
1883
1901
  const I = _.getTransformerByCreate(), R = I.clearControl$.subscribe((S) => {
1884
1902
  S === !0 && o(!1);
1885
1903
  }), T = I.changeStart$.subscribe((S) => {
1886
- const { objects: b } = S, y = $e(b, t), O = y.filter((Z) => (Z == null ? void 0 : Z.drawingType) === q.DRAWING_GROUP);
1887
- let M = !1, N = !1;
1888
- y.length > 1 && (M = !0), O.length > 0 && (N = !0), o(M || N), u(M), g(N);
1904
+ const { objects: b } = S, y = Ve(b, t), O = y.filter((Z) => (Z == null ? void 0 : Z.drawingType) === q.DRAWING_GROUP);
1905
+ let M = !1, P = !1;
1906
+ y.length > 1 && (M = !0), O.length > 0 && (P = !0), o(M || P), u(M), g(P);
1889
1907
  });
1890
1908
  return () => {
1891
1909
  T.unsubscribe(), R.unsubscribe();
1892
1910
  };
1893
- }, []), /* @__PURE__ */ P(
1911
+ }, []), /* @__PURE__ */ N(
1894
1912
  "div",
1895
1913
  {
1896
1914
  className: Q("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
@@ -1904,8 +1922,8 @@ const yr = (i) => {
1904
1922
  children: /* @__PURE__ */ v("div", { children: r.t("image-panel.group.title") })
1905
1923
  }
1906
1924
  ),
1907
- /* @__PURE__ */ P("div", { className: "univer-flex univer-items-center univer-justify-center univer-gap-2", children: [
1908
- /* @__PURE__ */ P(
1925
+ /* @__PURE__ */ N("div", { className: "univer-flex univer-items-center univer-justify-center univer-gap-2", children: [
1926
+ /* @__PURE__ */ N(
1909
1927
  se,
1910
1928
  {
1911
1929
  className: Q({
@@ -1913,12 +1931,12 @@ const yr = (i) => {
1913
1931
  }),
1914
1932
  onClick: d,
1915
1933
  children: [
1916
- /* @__PURE__ */ v(mt, {}),
1934
+ /* @__PURE__ */ v(vt, {}),
1917
1935
  r.t("image-panel.group.group")
1918
1936
  ]
1919
1937
  }
1920
1938
  ),
1921
- /* @__PURE__ */ P(
1939
+ /* @__PURE__ */ N(
1922
1940
  se,
1923
1941
  {
1924
1942
  className: Q({
@@ -1926,7 +1944,7 @@ const yr = (i) => {
1926
1944
  }),
1927
1945
  onClick: w,
1928
1946
  children: [
1929
- /* @__PURE__ */ v(St, {}),
1947
+ /* @__PURE__ */ v(bt, {}),
1930
1948
  r.t("image-panel.group.unGroup")
1931
1949
  ]
1932
1950
  }
@@ -1935,7 +1953,7 @@ const yr = (i) => {
1935
1953
  ]
1936
1954
  }
1937
1955
  );
1938
- }, Re = 20, Oe = 20, at = [-360, 360], De = 300, Or = (i) => {
1956
+ }, Oe = 20, De = 20, ot = [-360, 360], Te = 300, Er = (i) => {
1939
1957
  var Ke;
1940
1958
  const r = A(re), e = A(ne), t = A(ue), { drawings: n, transformShow: s } = i, a = n[0];
1941
1959
  if (a == null)
@@ -1955,17 +1973,17 @@ const yr = (i) => {
1955
1973
  left: _ = 0,
1956
1974
  top: I = 0,
1957
1975
  angle: R = 0
1958
- } = o, [T, S] = j(p), [b, y] = j(C), [O, M] = j(_), [N, U] = j(I), [Z, Y] = j(R), [$, _e] = j(h.keepRatio), te = (m, E, H, k) => {
1976
+ } = o, [T, S] = j(p), [b, y] = j(C), [O, M] = j(_), [P, U] = j(I), [Z, Y] = j(R), [$, Se] = j(h.keepRatio), te = (m, E, H, k) => {
1959
1977
  const { width: x, height: X } = w, { ancestorLeft: G, ancestorTop: W } = f;
1960
1978
  let F = m, ie = E, de = H, he = k;
1961
- return m + G < 0 && (F = -G), E + W < 0 && (ie = -W), de = x - F - G, de < Re && (de = Re), he = X - ie - W, he < Oe && (he = Oe), m + de + G > x && (F = x - H - G), E + he + W > X && (ie = X - k - W), {
1979
+ return m + G < 0 && (F = -G), E + W < 0 && (ie = -W), de = x - F - G, de < Oe && (de = Oe), he = X - ie - W, he < De && (he = De), m + de + G > x && (F = x - H - G), E + he + W > X && (ie = X - k - W), {
1962
1980
  limitLeft: F,
1963
1981
  limitTop: ie,
1964
1982
  limitWidth: de,
1965
1983
  limitHeight: he
1966
1984
  };
1967
1985
  }, V = (m) => {
1968
- const { objects: E } = m, H = $e(E, e);
1986
+ const { objects: E } = m, H = Ve(E, e);
1969
1987
  if (H.length !== 1)
1970
1988
  return;
1971
1989
  const k = H[0];
@@ -1983,7 +2001,7 @@ const yr = (i) => {
1983
2001
  } = x;
1984
2002
  X != null && S(X), G != null && y(G), W != null && M(W), F != null && U(F), ie != null && Y(ie);
1985
2003
  };
1986
- ve(() => {
2004
+ Ce(() => {
1987
2005
  const m = [
1988
2006
  h.changeStart$.subscribe((E) => {
1989
2007
  V(E);
@@ -2017,55 +2035,55 @@ const yr = (i) => {
2017
2035
  m.forEach((E) => E.unsubscribe());
2018
2036
  };
2019
2037
  }, []);
2020
- const ge = Se((m) => {
2038
+ const ge = be((m) => {
2021
2039
  if (m == null)
2022
2040
  return;
2023
- const { limitWidth: E, limitHeight: H } = te(O, N, m, b);
2041
+ const { limitWidth: E, limitHeight: H } = te(O, P, m, b);
2024
2042
  m = Math.min(m, E);
2025
2043
  const k = { unitId: c, subUnitId: u, drawingId: l, drawingType: g, transform: { width: m } };
2026
2044
  if ($) {
2027
2045
  let x = m / T * b;
2028
- if (x = Math.max(x, Oe), x > H)
2046
+ if (x = Math.max(x, De), x > H)
2029
2047
  return;
2030
2048
  y(x), k.transform.height = x;
2031
2049
  }
2032
2050
  S(m), e.featurePluginUpdateNotification([k]), h.refreshControls().changeNotification();
2033
- }, De), bt = Se((m) => {
2051
+ }, Te), Mt = be((m) => {
2034
2052
  if (m == null)
2035
2053
  return;
2036
- const { limitHeight: E, limitWidth: H } = te(O, N, T, m);
2054
+ const { limitHeight: E, limitWidth: H } = te(O, P, T, m);
2037
2055
  m = Math.min(m, E);
2038
2056
  const k = { unitId: c, subUnitId: u, drawingId: l, drawingType: g, transform: { height: m } };
2039
2057
  if ($) {
2040
2058
  let x = m / b * T;
2041
- if (x = Math.max(x, Re), x > H)
2059
+ if (x = Math.max(x, Oe), x > H)
2042
2060
  return;
2043
2061
  S(x), k.transform.width = x;
2044
2062
  }
2045
2063
  y(m), e.featurePluginUpdateNotification([k]), h.refreshControls().changeNotification();
2046
- }, De), yt = Se((m) => {
2064
+ }, Te), Rt = be((m) => {
2047
2065
  if (m == null)
2048
2066
  return;
2049
- const { limitLeft: E } = te(m, N, T, b);
2067
+ const { limitLeft: E } = te(m, P, T, b);
2050
2068
  m = E;
2051
2069
  const H = { unitId: c, subUnitId: u, drawingId: l, drawingType: g, transform: { left: m } };
2052
2070
  M(m), e.featurePluginUpdateNotification([H]), h.refreshControls().changeNotification();
2053
- }, De), Mt = Se((m) => {
2071
+ }, Te), Ot = be((m) => {
2054
2072
  if (m == null)
2055
2073
  return;
2056
2074
  const { limitTop: E } = te(O, m, T, b);
2057
2075
  m = E;
2058
2076
  const H = { unitId: c, subUnitId: u, drawingId: l, drawingType: g, transform: { top: m } };
2059
2077
  U(m), e.featurePluginUpdateNotification([H]), h.refreshControls().changeNotification();
2060
- }, De), Rt = (m) => {
2078
+ }, Te), Dt = (m) => {
2061
2079
  if (m == null)
2062
2080
  return;
2063
2081
  const E = { unitId: c, subUnitId: u, drawingId: l, drawingType: g, transform: { angle: m } };
2064
2082
  Y(m), e.featurePluginUpdateNotification([E]), h.refreshControls().changeNotification();
2065
- }, Ot = (m) => {
2066
- _e(m), h.keepRatio = m;
2083
+ }, Tt = (m) => {
2084
+ Se(m), h.keepRatio = m;
2067
2085
  };
2068
- return /* @__PURE__ */ P(
2086
+ return /* @__PURE__ */ N(
2069
2087
  "div",
2070
2088
  {
2071
2089
  className: Q("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
@@ -2079,73 +2097,73 @@ const yr = (i) => {
2079
2097
  children: /* @__PURE__ */ v("div", { children: r.t("image-panel.transform.title") })
2080
2098
  }
2081
2099
  ),
2082
- /* @__PURE__ */ P(
2100
+ /* @__PURE__ */ N(
2083
2101
  "div",
2084
2102
  {
2085
2103
  className: "univer-grid univer-grid-cols-3 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2",
2086
2104
  children: [
2087
- /* @__PURE__ */ P("div", { children: [
2105
+ /* @__PURE__ */ N("div", { children: [
2088
2106
  /* @__PURE__ */ v("span", { children: r.t("image-panel.transform.width") }),
2089
2107
  /* @__PURE__ */ v(
2090
2108
  fe,
2091
2109
  {
2092
2110
  precision: 1,
2093
2111
  value: T,
2094
- min: Re,
2112
+ min: Oe,
2095
2113
  onChange: (m) => {
2096
2114
  ge(m);
2097
2115
  }
2098
2116
  }
2099
2117
  )
2100
2118
  ] }),
2101
- /* @__PURE__ */ P("div", { children: [
2119
+ /* @__PURE__ */ N("div", { children: [
2102
2120
  /* @__PURE__ */ v("span", { children: r.t("image-panel.transform.height") }),
2103
2121
  /* @__PURE__ */ v(
2104
2122
  fe,
2105
2123
  {
2106
2124
  precision: 1,
2107
2125
  value: b,
2108
- min: Oe,
2126
+ min: De,
2109
2127
  onChange: (m) => {
2110
- bt(m);
2128
+ Mt(m);
2111
2129
  }
2112
2130
  }
2113
2131
  )
2114
2132
  ] }),
2115
- /* @__PURE__ */ P("div", { children: [
2133
+ /* @__PURE__ */ N("div", { children: [
2116
2134
  /* @__PURE__ */ v("span", { children: r.t("image-panel.transform.lock") }),
2117
- /* @__PURE__ */ v("div", { className: "univer-text-center", children: /* @__PURE__ */ v(zt, { checked: $, onChange: Ot }) })
2135
+ /* @__PURE__ */ v("div", { className: "univer-text-center", children: /* @__PURE__ */ v(Yt, { checked: $, onChange: Tt }) })
2118
2136
  ] })
2119
2137
  ]
2120
2138
  }
2121
2139
  ),
2122
- /* @__PURE__ */ P(
2140
+ /* @__PURE__ */ N(
2123
2141
  "div",
2124
2142
  {
2125
2143
  className: "univer-grid univer-grid-cols-3 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2",
2126
2144
  children: [
2127
- /* @__PURE__ */ P("div", { children: [
2145
+ /* @__PURE__ */ N("div", { children: [
2128
2146
  /* @__PURE__ */ v("span", { children: r.t("image-panel.transform.x") }),
2129
2147
  /* @__PURE__ */ v(fe, { precision: 1, value: O, onChange: (m) => {
2130
- yt(m);
2148
+ Rt(m);
2131
2149
  } })
2132
2150
  ] }),
2133
- /* @__PURE__ */ P("div", { children: [
2151
+ /* @__PURE__ */ N("div", { children: [
2134
2152
  /* @__PURE__ */ v("span", { children: r.t("image-panel.transform.y") }),
2135
- /* @__PURE__ */ v(fe, { precision: 1, value: N, onChange: (m) => {
2136
- Mt(m);
2153
+ /* @__PURE__ */ v(fe, { precision: 1, value: P, onChange: (m) => {
2154
+ Ot(m);
2137
2155
  } })
2138
2156
  ] }),
2139
- /* @__PURE__ */ P("div", { children: [
2157
+ /* @__PURE__ */ N("div", { children: [
2140
2158
  /* @__PURE__ */ v("span", { children: r.t("image-panel.transform.rotate") }),
2141
2159
  /* @__PURE__ */ v(
2142
2160
  fe,
2143
2161
  {
2144
2162
  precision: 1,
2145
2163
  value: Z,
2146
- min: at[0],
2147
- max: at[1],
2148
- onChange: Rt
2164
+ min: ot[0],
2165
+ max: ot[1],
2166
+ onChange: Dt
2149
2167
  }
2150
2168
  )
2151
2169
  ] })
@@ -2155,11 +2173,11 @@ const yr = (i) => {
2155
2173
  ]
2156
2174
  }
2157
2175
  );
2158
- }, Dr = (i) => {
2176
+ }, Nr = (i) => {
2159
2177
  const r = A(ce), e = A(re), { drawings: t, cropperShow: n } = i;
2160
2178
  if (t[0] == null)
2161
2179
  return;
2162
- const [a, o] = j(B.FREE), c = ut(!1), u = [
2180
+ const [a, o] = j(B.FREE), c = dt(!1), u = [
2163
2181
  {
2164
2182
  label: e.t("image-panel.crop.mode"),
2165
2183
  value: B.FREE
@@ -2201,7 +2219,7 @@ const yr = (i) => {
2201
2219
  value: B.R2_3
2202
2220
  }
2203
2221
  ];
2204
- ve(() => {
2222
+ Ce(() => {
2205
2223
  const d = r.onCommandExecuted((f) => {
2206
2224
  if (f.id === oe.id) {
2207
2225
  const w = f.params;
@@ -2222,7 +2240,7 @@ const yr = (i) => {
2222
2240
  cropType: d
2223
2241
  }), c.current = !0;
2224
2242
  };
2225
- return /* @__PURE__ */ P(
2243
+ return /* @__PURE__ */ N(
2226
2244
  "div",
2227
2245
  {
2228
2246
  className: Q("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
@@ -2236,19 +2254,19 @@ const yr = (i) => {
2236
2254
  children: /* @__PURE__ */ v("div", { children: e.t("image-panel.crop.title") })
2237
2255
  }
2238
2256
  ),
2239
- /* @__PURE__ */ P("div", { className: "univer-flex univer-items-center univer-justify-center univer-gap-2", children: [
2240
- /* @__PURE__ */ P(se, { onClick: () => {
2257
+ /* @__PURE__ */ N("div", { className: "univer-flex univer-items-center univer-justify-center univer-gap-2", children: [
2258
+ /* @__PURE__ */ N(se, { onClick: () => {
2241
2259
  g(a);
2242
2260
  }, children: [
2243
- /* @__PURE__ */ v(pt, {}),
2261
+ /* @__PURE__ */ v(wt, {}),
2244
2262
  e.t("image-panel.crop.start")
2245
2263
  ] }),
2246
- /* @__PURE__ */ v(lt, { value: a, options: u, onChange: l })
2264
+ /* @__PURE__ */ v(gt, { value: a, options: u, onChange: l })
2247
2265
  ] })
2248
2266
  ]
2249
2267
  }
2250
2268
  );
2251
- }, Hr = (i) => {
2269
+ }, $r = (i) => {
2252
2270
  const r = A(ne), e = A(ue), t = A(re), { drawings: n, hasArrange: s = !0, hasTransform: a = !0, hasAlign: o = !0, hasCropper: c = !0, hasGroup: u = !0 } = i, l = n[0];
2253
2271
  if (l == null)
2254
2272
  return;
@@ -2256,19 +2274,19 @@ const yr = (i) => {
2256
2274
  if (f == null)
2257
2275
  return;
2258
2276
  const w = f.getTransformerByCreate(), [h, p] = j(!0), [C, _] = j(!0), [I, R] = j(!1), [T, S] = j(!0), [b, y] = j(!1);
2259
- return ve(() => {
2277
+ return Ce(() => {
2260
2278
  const O = w.clearControl$.subscribe((U) => {
2261
2279
  U === !0 && (p(!1), _(!1), R(!1), S(!1), y(!0));
2262
2280
  }), M = w.changeStart$.subscribe((U) => {
2263
- const { objects: Z } = U, Y = $e(Z, r);
2281
+ const { objects: Z } = U, Y = Ve(Z, r);
2264
2282
  Y.length === 0 ? (p(!1), _(!1), R(!1), S(!1), y(!0)) : Y.length === 1 ? (p(!0), _(!0), R(!1), S(!0), y(!1)) : (p(!0), _(!1), R(!0), S(!1), y(!1));
2265
- }), N = r.focus$.subscribe((U) => {
2283
+ }), P = r.focus$.subscribe((U) => {
2266
2284
  U.length === 0 ? (p(!1), _(!1), R(!1), S(!1), y(!0)) : U.length === 1 ? (p(!0), _(!0), R(!1), S(!0), y(!1)) : (p(!0), _(!1), R(!0), S(!1), y(!1));
2267
2285
  });
2268
2286
  return () => {
2269
- M.unsubscribe(), O.unsubscribe(), N.unsubscribe();
2287
+ M.unsubscribe(), O.unsubscribe(), P.unsubscribe();
2270
2288
  };
2271
- }, []), /* @__PURE__ */ P(Wt, { children: [
2289
+ }, []), /* @__PURE__ */ N(Ft, { children: [
2272
2290
  /* @__PURE__ */ v(
2273
2291
  "div",
2274
2292
  {
@@ -2278,26 +2296,26 @@ const yr = (i) => {
2278
2296
  children: /* @__PURE__ */ v("div", { className: "univer-flex univer-h-full univer-items-center univer-justify-center", children: /* @__PURE__ */ v("span", { children: t.t("image-panel.null") }) })
2279
2297
  }
2280
2298
  ),
2281
- /* @__PURE__ */ v(Mr, { arrangeShow: s === !0 ? h : !1, drawings: n }),
2282
- /* @__PURE__ */ v(Or, { transformShow: a === !0 ? C : !1, drawings: n }),
2283
- /* @__PURE__ */ v(yr, { alignShow: o === !0 ? I : !1, drawings: n }),
2284
- /* @__PURE__ */ v(Dr, { cropperShow: c === !0 ? T : !1, drawings: n }),
2285
- /* @__PURE__ */ v(Rr, { hasGroup: u, drawings: n })
2299
+ /* @__PURE__ */ v(Dr, { arrangeShow: s === !0 ? h : !1, drawings: n }),
2300
+ /* @__PURE__ */ v(Er, { transformShow: a === !0 ? C : !1, drawings: n }),
2301
+ /* @__PURE__ */ v(Or, { alignShow: o === !0 ? I : !1, drawings: n }),
2302
+ /* @__PURE__ */ v(Nr, { cropperShow: c === !0 ? T : !1, drawings: n }),
2303
+ /* @__PURE__ */ v(Tr, { hasGroup: u, drawings: n })
2286
2304
  ] });
2287
2305
  };
2288
2306
  export {
2289
2307
  Ue as AutoImageCropOperation,
2290
- Jt as COMPONENT_IMAGE_POPUP_MENU,
2308
+ er as COMPONENT_IMAGE_POPUP_MENU,
2291
2309
  oe as CloseImageCropOperation,
2292
- Hr as DrawingCommonPanel,
2310
+ $r as DrawingCommonPanel,
2293
2311
  Ae as DrawingRenderService,
2294
- ye as ImageCropperObject,
2295
- ur as ImagePopupMenu,
2296
- gt as ImageResetSizeOperation,
2297
- Ze as OpenImageCropOperation,
2312
+ Re as ImageCropperObject,
2313
+ hr as ImagePopupMenu,
2314
+ ht as ImageResetSizeOperation,
2315
+ Fe as OpenImageCropOperation,
2298
2316
  ze as SetDrawingAlignOperation,
2299
- it as UniverDrawingUIPlugin,
2300
- dt as getCurrentUnitInfo,
2301
- $e as getUpdateParams,
2302
- et as insertGroupObject
2317
+ st as UniverDrawingUIPlugin,
2318
+ ft as getCurrentUnitInfo,
2319
+ Ve as getUpdateParams,
2320
+ rt as insertGroupObject
2303
2321
  };