@univerjs/drawing-ui 0.7.0-beta.0 → 0.7.0-nightly.202504301607

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,29 +1,29 @@
1
- var En = Object.defineProperty;
2
- var Bn = (i, t, n) => t in i ? En(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
3
- var ee = (i, t, n) => Bn(i, typeof t != "symbol" ? t + "" : t, n);
4
- import { UniverInstanceType as Oe, DrawingTypeEnum as ne, CommandType as ve, ICommandService as me, LocaleService as te, ArrangeTypeEnum as be, Tools as jn, debounce as Ie, Inject as Le, Disposable as xe, checkIfMove as sn, toDisposable as Ce, IUniverInstanceService as Ke, ImageSourceType as Xe, Injector as Un, IConfigService as An, Plugin as Hn, merge as Ln } from "@univerjs/core";
5
- import { getDrawingShapeKeyByDrawingSearch as G, ImageSourceType as xn, IDrawingManagerService as re, IImageIoService as cn, SetDrawingSelectedOperation as Ne } from "@univerjs/drawing";
6
- import { Group as we, DRAWING_OBJECT_LAYER_INDEX as De, Image as ze, Rect as ln, IRenderManagerService as ue, getGroupState as kn, transformObjectOutOfGroup as Vn, RENDER_CLASS_TYPE as Je, Shape as Gn, Canvas as Wn, precisionTo as ye, CURSOR_TYPE as Te, Vector2 as Ge, degToRad as qe } from "@univerjs/engine-render";
7
- import { IDialogService as gn, useDependency as k, ComponentManager as $n, IMessageService as zn } from "@univerjs/ui";
8
- import { jsxs as j, jsx as u, Fragment as Fn } from "react/jsx-runtime";
9
- import { useState as x, forwardRef as Z, useRef as mn, createElement as X, useEffect as _e } from "react";
10
- import { clsx as B, Select as dn, Button as le, InputNumber as pe, Checkbox as Kn, DropdownMenu as Yn, MessageType as Qe } from "@univerjs/design";
11
- import { switchMap as Zn, of as Xn } from "rxjs";
12
- function en(i, t, n, e) {
13
- const r = e.getDrawingByParam(i);
14
- if (r == null)
1
+ var Pt = Object.defineProperty;
2
+ var jt = (i, r, t) => r in i ? Pt(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
+ var te = (i, r, t) => jt(i, typeof r != "symbol" ? r + "" : r, t);
4
+ import { UniverInstanceType as Ee, DrawingTypeEnum as re, CommandType as Se, ICommandService as he, LocaleService as ie, ArrangeTypeEnum as Ie, Tools as Bt, debounce as Me, Inject as ke, Disposable as Ve, checkIfMove as ct, toDisposable as _e, IUniverInstanceService as Ze, ImageSourceType as qe, Injector as Ut, IConfigService as xt, Plugin as At, merge as Ht } from "@univerjs/core";
5
+ import { getDrawingShapeKeyByDrawingSearch as W, ImageSourceType as Lt, IDrawingManagerService as ae, IImageIoService as lt, SetDrawingSelectedOperation as Te } from "@univerjs/drawing";
6
+ import { Group as Ce, DRAWING_OBJECT_LAYER_INDEX as Pe, Image as Ke, Rect as dt, IRenderManagerService as me, getGroupState as kt, transformObjectOutOfGroup as Vt, RENDER_CLASS_TYPE as Qe, Shape as Wt, Canvas as Gt, precisionTo as Re, CURSOR_TYPE as je, Vector2 as $e, degToRad as et } from "@univerjs/engine-render";
7
+ import { IDialogService as ut, useDependency as k, ComponentManager as $t, IMessageService as zt } from "@univerjs/ui";
8
+ import { jsxs as P, jsx as g, Fragment as Ft } from "react/jsx-runtime";
9
+ import { useState as L, forwardRef as X, useRef as gt, createElement as J, useEffect as be } from "react";
10
+ import { Select as ht, Button as ue, clsx as Y, InputNumber as we, Checkbox as Kt, DropdownMenu as Yt, MessageType as tt } from "@univerjs/design";
11
+ import { switchMap as Zt, of as Xt } from "rxjs";
12
+ function rt(i, r, t, e) {
13
+ const n = e.getDrawingByParam(i);
14
+ if (n == null)
15
15
  return;
16
- const o = G(i), a = n.getObject(o);
17
- if (a && !(a instanceof we))
16
+ const s = W(i), a = t.getObject(s);
17
+ if (a && !(a instanceof Ce))
18
18
  return;
19
19
  if (a != null) {
20
- a.addObject(t);
20
+ a.addObject(r);
21
21
  return;
22
22
  }
23
- const s = new we(o);
24
- n.addObject(s, De).attachTransformerTo(s), s.addObject(t);
25
- const { transform: c } = r;
26
- c && s.transformByState(
23
+ const o = new Ce(s);
24
+ t.addObject(o, Pe).attachTransformerTo(o), o.addObject(r);
25
+ const { transform: c } = n;
26
+ c && o.transformByState(
27
27
  {
28
28
  left: c.left,
29
29
  top: c.top,
@@ -31,208 +31,196 @@ function en(i, t, n, e) {
31
31
  }
32
32
  );
33
33
  }
34
- function un(i, t) {
35
- var o;
36
- const n = t ? i.getUnit(t) : i.getFocusedUnit();
37
- if (n == null)
34
+ function ft(i, r) {
35
+ var s;
36
+ const t = r ? i.getUnit(r) : i.getFocusedUnit();
37
+ if (t == null)
38
38
  return;
39
- const e = n.getUnitId();
40
- let r;
41
- return n.type === Oe.UNIVER_SHEET ? r = (o = n.getActiveSheet()) == null ? void 0 : o.getSheetId() : (n.type === Oe.UNIVER_DOC || n.type === Oe.UNIVER_SLIDE) && (r = e), { unitId: e, subUnitId: r, current: n };
39
+ const e = t.getUnitId();
40
+ let n;
41
+ return t.type === Ee.UNIVER_SHEET ? n = (s = t.getActiveSheet()) == null ? void 0 : s.getSheetId() : (t.type === Ee.UNIVER_DOC || t.type === Ee.UNIVER_SLIDE) && (n = e), { unitId: e, subUnitId: n, current: t };
42
42
  }
43
- const hn = "COMPONENT_IMAGE_VIEWER";
44
- var Jn = Object.getOwnPropertyDescriptor, qn = (i, t, n, e) => {
45
- for (var r = e > 1 ? void 0 : e ? Jn(t, n) : t, o = i.length - 1, a; o >= 0; o--)
46
- (a = i[o]) && (r = a(r) || r);
47
- return r;
48
- }, We = (i, t) => (n, e) => t(n, e, i);
49
- const nn = 50;
50
- let Ee = class {
51
- constructor(i, t, n) {
52
- this._drawingManagerService = i, this._imageIoService = t, this._dialogService = n;
43
+ const mt = "COMPONENT_IMAGE_VIEWER";
44
+ var Jt = Object.getOwnPropertyDescriptor, qt = (i, r, t, e) => {
45
+ for (var n = e > 1 ? void 0 : e ? Jt(r, t) : r, s = i.length - 1, a; s >= 0; s--)
46
+ (a = i[s]) && (n = a(n) || n);
47
+ return n;
48
+ }, ze = (i, r) => (t, e) => r(t, e, i);
49
+ const nt = 50;
50
+ let Be = class {
51
+ constructor(i, r, t) {
52
+ this._drawingManagerService = i, this._imageIoService = r, this._dialogService = t;
53
53
  }
54
54
  // eslint-disable-next-line max-lines-per-function
55
- async renderImages(i, t) {
55
+ async renderImages(i, r) {
56
56
  const {
57
- transform: n,
57
+ transform: t,
58
58
  drawingType: e,
59
- source: r,
60
- imageSourceType: o,
59
+ source: n,
60
+ imageSourceType: s,
61
61
  srcRect: a,
62
- prstGeom: s,
62
+ prstGeom: o,
63
63
  groupId: c,
64
64
  unitId: l,
65
- subUnitId: m,
66
- drawingId: d,
65
+ subUnitId: d,
66
+ drawingId: u,
67
67
  isMultiTransform: h,
68
68
  transforms: f
69
69
  } = i;
70
- if (e !== ne.DRAWING_IMAGE || !this._drawingManagerService.getDrawingVisible() || n == null)
70
+ if (e !== re.DRAWING_IMAGE || !this._drawingManagerService.getDrawingVisible() || t == null)
71
71
  return;
72
- const v = h && f ? f : [n], w = [];
73
- for (const p of v) {
74
- const { left: S, top: _, width: M, height: I, angle: N, flipX: P, flipY: b, skewX: y, skewY: R } = p, O = v.indexOf(p), U = G({ unitId: l, subUnitId: m, drawingId: d }, h ? O : void 0), T = t.getObject(U);
75
- if (T != null) {
76
- T.transformByState({ left: S, top: _, width: M, height: I, angle: N, flipX: P, flipY: b, skewX: y, skewY: R });
72
+ const w = h && f ? f : [t], v = [];
73
+ for (const m of w) {
74
+ const { left: C, top: _, width: R, height: b, angle: N, flipX: I, flipY: S, skewX: y, skewY: M } = m, O = w.indexOf(m), j = W({ unitId: l, subUnitId: d, drawingId: u }, h ? O : void 0), E = r.getObject(j);
75
+ if (E != null) {
76
+ E.transformByState({ left: C, top: _, width: R, height: b, angle: N, flipX: I, flipY: S, skewX: y, skewY: M });
77
77
  continue;
78
78
  }
79
- const ie = this._drawingManagerService.getDrawingOrder(l, m), W = ie.indexOf(d), q = { ...p, zIndex: W === -1 ? ie.length - 1 : W }, Se = this._imageIoService.getImageSourceCache(r, o);
80
- let ae = !1;
81
- if (Se != null)
82
- q.image = Se;
79
+ const se = this._drawingManagerService.getDrawingOrder(l, d), G = se.indexOf(u), Q = { ...m, zIndex: G === -1 ? se.length - 1 : G }, ye = this._imageIoService.getImageSourceCache(n, s);
80
+ let oe = !1;
81
+ if (ye != null)
82
+ Q.image = ye;
83
83
  else {
84
- if (o === xn.UUID)
84
+ if (s === Lt.UUID)
85
85
  try {
86
- q.url = await this._imageIoService.getImage(r);
87
- } catch (Ve) {
88
- console.error(Ve);
86
+ Q.url = await this._imageIoService.getImage(n);
87
+ } catch (Ge) {
88
+ console.error(Ge);
89
89
  continue;
90
90
  }
91
91
  else
92
- q.url = r;
93
- ae = !0;
92
+ Q.url = n;
93
+ oe = !0;
94
94
  }
95
- if (t.getObject(U))
95
+ if (r.getObject(j))
96
96
  continue;
97
- q.printable = !0;
98
- const z = new ze(U, q);
99
- ae && this._imageIoService.addImageSourceCache(r, o, z.getNative()), this._drawingManagerService.getDrawingVisible() && (t.addObject(z, De), this._drawingManagerService.getDrawingEditable() && t.attachTransformerTo(z), c && en({ drawingId: c, unitId: l, subUnitId: m }, z, t, this._drawingManagerService), s != null && z.setPrstGeom(s), a != null && z.setSrcRect(a), w.push(z));
97
+ Q.printable = !0;
98
+ const z = new Ke(j, Q);
99
+ oe && this._imageIoService.addImageSourceCache(n, s, z.getNative()), this._drawingManagerService.getDrawingVisible() && (r.addObject(z, Pe), this._drawingManagerService.getDrawingEditable() && r.attachTransformerTo(z), c && rt({ drawingId: c, unitId: l, subUnitId: d }, z, r, this._drawingManagerService), o != null && z.setPrstGeom(o), a != null && z.setSrcRect(a), v.push(z));
100
100
  }
101
- return w;
101
+ return v;
102
102
  }
103
- renderFloatDom(i, t) {
103
+ renderFloatDom(i, r) {
104
104
  const {
105
- transform: n,
105
+ transform: t,
106
106
  drawingType: e,
107
- groupId: r,
108
- unitId: o,
107
+ groupId: n,
108
+ unitId: s,
109
109
  subUnitId: a,
110
- drawingId: s,
110
+ drawingId: o,
111
111
  isMultiTransform: c,
112
112
  transforms: l
113
113
  } = i;
114
- if (e !== ne.DRAWING_DOM || !this._drawingManagerService.getDrawingVisible() || n == null)
114
+ if (e !== re.DRAWING_DOM || !this._drawingManagerService.getDrawingVisible() || t == null)
115
115
  return;
116
- const m = c && l ? l : [n], d = [];
117
- for (const h of m) {
118
- const { left: f, top: v, width: w, height: p, angle: S, flipX: _, flipY: M, skewX: I, skewY: N } = h, P = m.indexOf(h), b = G({ unitId: o, subUnitId: a, drawingId: s }, c ? P : void 0), y = t.getObject(b);
116
+ const d = c && l ? l : [t], u = [];
117
+ for (const h of d) {
118
+ const { left: f, top: w, width: v, height: m, angle: C, flipX: _, flipY: R, skewX: b, skewY: N } = h, I = d.indexOf(h), S = W({ unitId: s, subUnitId: a, drawingId: o }, c ? I : void 0), y = r.getObject(S);
119
119
  if (y != null) {
120
- y.transformByState({ left: f, top: v, width: w, height: p, angle: S, flipX: _, flipY: M, skewX: I, skewY: N });
120
+ y.transformByState({ left: f, top: w, width: v, height: m, angle: C, flipX: _, flipY: R, skewX: b, skewY: N });
121
121
  continue;
122
122
  }
123
- const R = this._drawingManagerService.getDrawingOrder(o, a), O = R.indexOf(s), U = { ...h, zIndex: O === -1 ? R.length - 1 : O };
124
- if (t.getObject(b))
123
+ const M = this._drawingManagerService.getDrawingOrder(s, a), O = M.indexOf(o), j = { ...h, zIndex: O === -1 ? M.length - 1 : O };
124
+ if (r.getObject(S))
125
125
  continue;
126
- U.printable = !1;
127
- const T = new ln(b, U);
128
- this._drawingManagerService.getDrawingVisible() && (t.addObject(T, De), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && t.attachTransformerTo(T), r && en({ drawingId: r, unitId: o, subUnitId: a }, T, t, this._drawingManagerService), d.push(T));
126
+ j.printable = !1;
127
+ const E = new dt(S, j);
128
+ this._drawingManagerService.getDrawingVisible() && (r.addObject(E, Pe), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && r.attachTransformerTo(E), n && rt({ drawingId: n, unitId: s, subUnitId: a }, E, r, this._drawingManagerService), u.push(E));
129
129
  }
130
- return d;
131
- }
132
- renderDrawing(i, t) {
133
- const n = this._drawingManagerService.getDrawingByParam(i);
134
- if (n != null)
135
- switch (n.drawingType) {
136
- case ne.DRAWING_IMAGE:
137
- return this.renderImages(n, t);
130
+ return u;
131
+ }
132
+ renderDrawing(i, r) {
133
+ const t = this._drawingManagerService.getDrawingByParam(i);
134
+ if (t != null)
135
+ switch (t.drawingType) {
136
+ case re.DRAWING_IMAGE:
137
+ return this.renderImages(t, r);
138
138
  }
139
139
  }
140
- previewImage(i, t, n, e) {
141
- const r = `${i}-viewer-dialog`, o = window.innerWidth - nn, a = window.innerHeight - nn, s = this._adjustImageSize(n, e, o, a), c = this._dialogService.open({
142
- width: Math.max(s.width, 200),
143
- id: r,
140
+ previewImage(i, r, t, e) {
141
+ const n = `${i}-viewer-dialog`, s = window.innerWidth - nt, a = window.innerHeight - nt, o = this._adjustImageSize(t, e, s, a), c = this._dialogService.open({
142
+ width: Math.max(o.width, 200),
143
+ id: n,
144
144
  children: {
145
145
  label: {
146
- name: hn,
146
+ name: mt,
147
147
  props: {
148
- src: t,
149
- width: s.width,
150
- height: s.height
148
+ src: r,
149
+ width: o.width,
150
+ height: o.height
151
151
  }
152
152
  }
153
153
  },
154
154
  destroyOnClose: !0,
155
155
  closable: !1,
156
156
  onClose: () => {
157
- this._dialogService.close(r), c.dispose();
157
+ this._dialogService.close(n), c.dispose();
158
158
  }
159
159
  });
160
160
  }
161
- _adjustImageSize(i, t, n, e) {
162
- if (i <= n && t <= e)
161
+ _adjustImageSize(i, r, t, e) {
162
+ if (i <= t && r <= e)
163
163
  return {
164
164
  width: i,
165
- height: t
165
+ height: r
166
166
  };
167
- const r = n / i, o = e / t, a = Math.min(r, o);
167
+ const n = t / i, s = e / r, a = Math.min(n, s);
168
168
  return {
169
169
  width: Math.floor(i * a),
170
- height: Math.floor(t * a)
170
+ height: Math.floor(r * a)
171
171
  };
172
172
  }
173
173
  };
174
- Ee = qn([
175
- We(0, re),
176
- We(1, cn),
177
- We(2, gn)
178
- ], Ee);
179
- function ke(i, t) {
180
- const n = [];
174
+ Be = qt([
175
+ ze(0, ae),
176
+ ze(1, lt),
177
+ ze(2, ut)
178
+ ], Be);
179
+ function We(i, r) {
180
+ const t = [];
181
181
  return i.forEach((e) => {
182
- const { oKey: r, left: o, top: a, height: s, width: c, angle: l } = e, m = t.getDrawingOKey(r);
183
- if (m == null)
184
- return n.push(null), !0;
185
- const { unitId: d, subUnitId: h, drawingId: f, drawingType: v } = m, w = {
186
- unitId: d,
182
+ const { oKey: n, left: s, top: a, height: o, width: c, angle: l } = e, d = r.getDrawingOKey(n);
183
+ if (d == null)
184
+ return t.push(null), !0;
185
+ const { unitId: u, subUnitId: h, drawingId: f, drawingType: w } = d, v = {
186
+ unitId: u,
187
187
  subUnitId: h,
188
188
  drawingId: f,
189
- drawingType: v,
189
+ drawingType: w,
190
190
  transform: {
191
- left: o,
191
+ left: s,
192
192
  top: a,
193
- height: s,
193
+ height: o,
194
194
  width: c,
195
195
  angle: l
196
196
  }
197
197
  };
198
- v === ne.DRAWING_IMAGE && (w.srcRect = e.srcRect), n.push(w);
199
- }), n;
198
+ w === re.DRAWING_IMAGE && (v.srcRect = e.srcRect), t.push(v);
199
+ }), t;
200
200
  }
201
201
  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 || {});
202
- const Ye = {
202
+ const Xe = {
203
203
  id: "sheet.operation.set-image-align",
204
- type: ve.OPERATION,
205
- handler: (i, t) => !0
206
- }, Qn = "univer-image-common-panel-grid", et = "univer-image-common-panel-border", nt = "univer-image-common-panel-title", tt = "univer-image-common-panel-row", rt = "univer-image-common-panel-row-vertical", it = "univer-image-common-panel-column", at = "univer-image-common-panel-column-center", ot = "univer-image-common-panel-inline", st = "univer-image-common-panel-span2", ct = "univer-image-common-panel-span3", lt = "univer-image-common-panel-input", g = {
207
- imageCommonPanelGrid: Qn,
208
- imageCommonPanelBorder: et,
209
- imageCommonPanelTitle: nt,
210
- imageCommonPanelRow: tt,
211
- imageCommonPanelRowVertical: rt,
212
- imageCommonPanelColumn: it,
213
- imageCommonPanelColumnCenter: at,
214
- imageCommonPanelInline: ot,
215
- imageCommonPanelSpan2: st,
216
- imageCommonPanelSpan3: ct,
217
- imageCommonPanelInput: lt
218
- }, gt = (i) => {
219
- const t = k(me), n = k(te), { alignShow: e } = i, [r, o] = x(D.default), a = [
204
+ type: Se.OPERATION,
205
+ handler: (i, r) => !0
206
+ }, Qt = (i) => {
207
+ const r = k(he), t = k(ie), { alignShow: e } = i, [n, s] = L(D.default), a = [
220
208
  {
221
- label: n.t("image-panel.align.default"),
209
+ label: t.t("image-panel.align.default"),
222
210
  value: D.default
223
211
  },
224
212
  {
225
213
  options: [
226
214
  {
227
- label: n.t("image-panel.align.left"),
215
+ label: t.t("image-panel.align.left"),
228
216
  value: D.left
229
217
  },
230
218
  {
231
- label: n.t("image-panel.align.center"),
219
+ label: t.t("image-panel.align.center"),
232
220
  value: D.center
233
221
  },
234
222
  {
235
- label: n.t("image-panel.align.right"),
223
+ label: t.t("image-panel.align.right"),
236
224
  value: D.right
237
225
  }
238
226
  ]
@@ -240,15 +228,15 @@ const Ye = {
240
228
  {
241
229
  options: [
242
230
  {
243
- label: n.t("image-panel.align.top"),
231
+ label: t.t("image-panel.align.top"),
244
232
  value: D.top
245
233
  },
246
234
  {
247
- label: n.t("image-panel.align.middle"),
235
+ label: t.t("image-panel.align.middle"),
248
236
  value: D.middle
249
237
  },
250
238
  {
251
- label: n.t("image-panel.align.bottom"),
239
+ label: t.t("image-panel.align.bottom"),
252
240
  value: D.bottom
253
241
  }
254
242
  ]
@@ -256,621 +244,667 @@ const Ye = {
256
244
  {
257
245
  options: [
258
246
  {
259
- label: n.t("image-panel.align.horizon"),
247
+ label: t.t("image-panel.align.horizon"),
260
248
  value: D.horizon
261
249
  },
262
250
  {
263
- label: n.t("image-panel.align.vertical"),
251
+ label: t.t("image-panel.align.vertical"),
264
252
  value: D.vertical
265
253
  }
266
254
  ]
267
255
  }
268
256
  ];
269
- function s(l) {
270
- o(l), t.executeCommand(Ye.id, {
257
+ function o(l) {
258
+ s(l), r.executeCommand(Xe.id, {
271
259
  alignType: l
272
260
  });
273
261
  }
274
- const c = (l) => l ? "block" : "none";
275
- return /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: c(e) }, children: [
276
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("image-panel.align.title") }) }) }),
277
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn), children: /* @__PURE__ */ u(dn, { value: r, options: a, onChange: s }) }) })
278
- ] });
262
+ return /* @__PURE__ */ P(
263
+ "div",
264
+ {
265
+ className: `
266
+ univer-relative univer-w-full univer-border-l-0 univer-border-r-0 univer-border-t univer-border-solid
267
+ univer-border-gray-200
268
+ `,
269
+ style: { display: ((l) => l ? "block" : "none")(e) },
270
+ children: [
271
+ /* @__PURE__ */ g(
272
+ "div",
273
+ {
274
+ className: `
275
+ univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
276
+ `,
277
+ children: /* @__PURE__ */ g("div", { className: "univer-w-full univer-text-gray-900", children: /* @__PURE__ */ g("div", { children: t.t("image-panel.align.title") }) })
278
+ }
279
+ ),
280
+ /* @__PURE__ */ g(
281
+ "div",
282
+ {
283
+ className: `
284
+ univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
285
+ `,
286
+ children: /* @__PURE__ */ g("div", { className: "univer-w-full univer-text-gray-900", children: /* @__PURE__ */ g(ht, { value: n, options: a, onChange: o }) })
287
+ }
288
+ )
289
+ ]
290
+ }
291
+ );
279
292
  };
280
293
  var $ = function() {
281
294
  return $ = Object.assign || function(i) {
282
- for (var t, n = 1, e = arguments.length; n < e; n++) {
283
- t = arguments[n];
284
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);
295
+ for (var r, t = 1, e = arguments.length; t < e; t++) {
296
+ r = arguments[t];
297
+ for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (i[n] = r[n]);
285
298
  }
286
299
  return i;
287
300
  }, $.apply(this, arguments);
288
- }, mt = function(i, t) {
289
- var n = {};
290
- for (var e in i) Object.prototype.hasOwnProperty.call(i, e) && t.indexOf(e) < 0 && (n[e] = i[e]);
301
+ }, er = function(i, r) {
302
+ var t = {};
303
+ for (var e in i) Object.prototype.hasOwnProperty.call(i, e) && r.indexOf(e) < 0 && (t[e] = i[e]);
291
304
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
292
- for (var r = 0, e = Object.getOwnPropertySymbols(i); r < e.length; r++)
293
- t.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, e[r]) && (n[e[r]] = i[e[r]]);
294
- return n;
295
- }, J = Z(function(i, t) {
296
- var n = i.icon, e = i.id, r = i.className, o = i.extend, a = mt(i, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(e, " ").concat(r || "").trim(), c = mn("_".concat(ht()));
297
- return fn(n, "".concat(e), { defIds: n.defIds, idSuffix: c.current }, $({ ref: t, className: s }, a), o);
305
+ for (var n = 0, e = Object.getOwnPropertySymbols(i); n < e.length; n++)
306
+ r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(i, e[n]) && (t[e[n]] = i[e[n]]);
307
+ return t;
308
+ }, q = X(function(i, r) {
309
+ var t = i.icon, e = i.id, n = i.className, s = i.extend, a = er(i, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(e, " ").concat(n || "").trim(), c = gt("_".concat(nr()));
310
+ return pt(t, "".concat(e), { defIds: t.defIds, idSuffix: c.current }, $({ ref: r, className: o }, a), s);
298
311
  });
299
- function fn(i, t, n, e, r) {
300
- return X(i.tag, $($({ key: t }, dt(i, n, r)), e), (ut(i, n).children || []).map(function(o, a) {
301
- return fn(o, "".concat(t, "-").concat(i.tag, "-").concat(a), n, void 0, r);
312
+ function pt(i, r, t, e, n) {
313
+ return J(i.tag, $($({ key: r }, tr(i, t, n)), e), (rr(i, t).children || []).map(function(s, a) {
314
+ return pt(s, "".concat(r, "-").concat(i.tag, "-").concat(a), t, void 0, n);
302
315
  }));
303
316
  }
304
- function dt(i, t, n) {
317
+ function tr(i, r, t) {
305
318
  var e = $({}, i.attrs);
306
- n != null && n.colorChannel1 && e.fill === "colorChannel1" && (e.fill = n.colorChannel1), i.tag === "mask" && e.id && (e.id = e.id + t.idSuffix), Object.entries(e).forEach(function(o) {
307
- var a = o[0], s = o[1];
308
- a === "mask" && typeof s == "string" && (e[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
319
+ t != null && t.colorChannel1 && e.fill === "colorChannel1" && (e.fill = t.colorChannel1), i.tag === "mask" && e.id && (e.id = e.id + r.idSuffix), Object.entries(e).forEach(function(s) {
320
+ var a = s[0], o = s[1];
321
+ a === "mask" && typeof o == "string" && (e[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
309
322
  });
310
- var r = t.defIds;
311
- return !r || r.length === 0 || (i.tag === "use" && e["xlink:href"] && (e["xlink:href"] = e["xlink:href"] + t.idSuffix), Object.entries(e).forEach(function(o) {
312
- var a = o[0], s = o[1];
313
- typeof s == "string" && (e[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
323
+ var n = r.defIds;
324
+ return !n || n.length === 0 || (i.tag === "use" && e["xlink:href"] && (e["xlink:href"] = e["xlink:href"] + r.idSuffix), Object.entries(e).forEach(function(s) {
325
+ var a = s[0], o = s[1];
326
+ typeof o == "string" && (e[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
314
327
  })), e;
315
328
  }
316
- function ut(i, t) {
317
- var n, e = t.defIds;
318
- return !e || e.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? $($({}, i), { children: i.children.map(function(r) {
319
- return typeof r.attrs.id == "string" && e && e.indexOf(r.attrs.id) > -1 ? $($({}, r), { attrs: $($({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
329
+ function rr(i, r) {
330
+ var t, e = r.defIds;
331
+ return !e || e.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? $($({}, i), { children: i.children.map(function(n) {
332
+ return typeof n.attrs.id == "string" && e && e.indexOf(n.attrs.id) > -1 ? $($({}, n), { attrs: $($({}, n.attrs), { id: n.attrs.id + r.idSuffix }) }) : n;
320
333
  }) }) : i;
321
334
  }
322
- function ht() {
335
+ function nr() {
323
336
  return Math.random().toString(36).substring(2, 8);
324
337
  }
325
- J.displayName = "UniverIcon";
326
- var ft = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, pn = Z(function(i, t) {
327
- return X(J, Object.assign({}, i, {
338
+ q.displayName = "UniverIcon";
339
+ var ir = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vt = X(function(i, r) {
340
+ return J(q, Object.assign({}, i, {
328
341
  id: "autofill",
329
- ref: t,
330
- icon: ft
342
+ ref: r,
343
+ icon: ir
331
344
  }));
332
345
  });
333
- pn.displayName = "Autofill";
334
- var pt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, Cn = Z(function(i, t) {
335
- return X(J, Object.assign({}, i, {
346
+ vt.displayName = "Autofill";
347
+ var ar = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, wt = X(function(i, r) {
348
+ return J(q, Object.assign({}, i, {
336
349
  id: "bottom-single",
337
- ref: t,
338
- icon: pt
350
+ ref: r,
351
+ icon: ar
339
352
  }));
340
353
  });
341
- Cn.displayName = "BottomSingle";
342
- var Ct = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.97705 7.51296C5.97705 7.18159 6.24568 6.91296 6.57705 6.91296H8.48632C8.81769 6.91296 9.08632 7.18159 9.08632 7.51296 9.08632 7.84433 8.81769 8.11296 8.48632 8.11296H6.57705C6.24568 8.11296 5.97705 7.84433 5.97705 7.51296zM6.57705 9.41028C6.24568 9.41028 5.97705 9.67891 5.97705 10.0103 5.97705 10.3416 6.24568 10.6103 6.57705 10.6103H10.8199C11.1512 10.6103 11.4199 10.3416 11.4199 10.0103 11.4199 9.67891 11.1512 9.41028 10.8199 9.41028H6.57705z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.51074 2.37063C3.51074 1.48697 4.22709 0.77063 5.11074 0.77063H9.80318L9.81294 0.770708C9.97168 0.768161 10.1311 0.82824 10.2511 0.95055L14.4317 5.21408C14.5165 5.30049 14.5697 5.406 14.5917 5.51645C14.6041 5.5644 14.6106 5.61467 14.6106 5.66648V11.6406C14.6106 12.5243 13.8943 13.2406 13.0106 13.2406H5.11074C4.22709 13.2406 3.51074 12.5243 3.51074 11.6406V2.37063ZM10.4032 4.66648V2.81964L12.6063 5.06648H10.8032C10.5823 5.06648 10.4032 4.88739 10.4032 4.66648ZM5.11074 1.97063C4.88983 1.97063 4.71074 2.14972 4.71074 2.37063V11.6406C4.71074 11.8615 4.88983 12.0406 5.11074 12.0406H13.0106C13.2316 12.0406 13.4106 11.8615 13.4106 11.6406V6.26648H10.8032C9.91953 6.26648 9.20318 5.55013 9.20318 4.66648V1.97063H5.11074Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.58916 6.6741C2.58916 6.34273 2.32053 6.0741 1.98916 6.0741C1.65779 6.0741 1.38916 6.34273 1.38916 6.6741V12.6294C1.38916 14.0653 2.55322 15.2294 3.98916 15.2294H9.41408C9.74545 15.2294 10.0141 14.9607 10.0141 14.6294C10.0141 14.298 9.74545 14.0294 9.41408 14.0294H3.98916C3.21596 14.0294 2.58916 13.4026 2.58916 12.6294V6.6741Z" } }] }, wn = Z(function(i, t) {
343
- return X(J, Object.assign({}, i, {
354
+ wt.displayName = "BottomSingle";
355
+ var sr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.97705 7.51296C5.97705 7.18159 6.24568 6.91296 6.57705 6.91296H8.48632C8.81769 6.91296 9.08632 7.18159 9.08632 7.51296 9.08632 7.84433 8.81769 8.11296 8.48632 8.11296H6.57705C6.24568 8.11296 5.97705 7.84433 5.97705 7.51296zM6.57705 9.41028C6.24568 9.41028 5.97705 9.67891 5.97705 10.0103 5.97705 10.3416 6.24568 10.6103 6.57705 10.6103H10.8199C11.1512 10.6103 11.4199 10.3416 11.4199 10.0103 11.4199 9.67891 11.1512 9.41028 10.8199 9.41028H6.57705z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.51074 2.37063C3.51074 1.48697 4.22709 0.77063 5.11074 0.77063H9.80318L9.81294 0.770708C9.97168 0.768161 10.1311 0.82824 10.2511 0.95055L14.4317 5.21408C14.5165 5.30049 14.5697 5.406 14.5917 5.51645C14.6041 5.5644 14.6106 5.61467 14.6106 5.66648V11.6406C14.6106 12.5243 13.8943 13.2406 13.0106 13.2406H5.11074C4.22709 13.2406 3.51074 12.5243 3.51074 11.6406V2.37063ZM10.4032 4.66648V2.81964L12.6063 5.06648H10.8032C10.5823 5.06648 10.4032 4.88739 10.4032 4.66648ZM5.11074 1.97063C4.88983 1.97063 4.71074 2.14972 4.71074 2.37063V11.6406C4.71074 11.8615 4.88983 12.0406 5.11074 12.0406H13.0106C13.2316 12.0406 13.4106 11.8615 13.4106 11.6406V6.26648H10.8032C9.91953 6.26648 9.20318 5.55013 9.20318 4.66648V1.97063H5.11074Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.58916 6.6741C2.58916 6.34273 2.32053 6.0741 1.98916 6.0741C1.65779 6.0741 1.38916 6.34273 1.38916 6.6741V12.6294C1.38916 14.0653 2.55322 15.2294 3.98916 15.2294H9.41408C9.74545 15.2294 10.0141 14.9607 10.0141 14.6294C10.0141 14.298 9.74545 14.0294 9.41408 14.0294H3.98916C3.21596 14.0294 2.58916 13.4026 2.58916 12.6294V6.6741Z" } }] }, _t = X(function(i, r) {
356
+ return J(q, Object.assign({}, i, {
344
357
  id: "create-copy-single",
345
- ref: t,
346
- icon: Ct
358
+ ref: r,
359
+ icon: sr
347
360
  }));
348
361
  });
349
- wn.displayName = "CreateCopySingle";
350
- var wt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.38125 1.16211C6.49759 1.16211 5.78125 1.87845 5.78125 2.76211V5.6377H2.87783C1.99418 5.6377 1.27783 6.35404 1.27783 7.2377V13.2377C1.27783 14.1214 1.99418 14.8377 2.87783 14.8377H8.87783C9.76149 14.8377 10.4778 14.1214 10.4778 13.2377V10.3621H13.3813C14.2649 10.3621 14.9813 9.64577 14.9813 8.76211V2.76211C14.9813 1.87845 14.2649 1.16211 13.3813 1.16211H7.38125ZM10.4778 9.16211H13.3813C13.6022 9.16211 13.7812 8.98302 13.7812 8.76211V2.76211C13.7812 2.5412 13.6022 2.36211 13.3813 2.36211H7.38125C7.16034 2.36211 6.98125 2.5412 6.98125 2.76211V5.6377H8.87783C9.76149 5.6377 10.4778 6.35404 10.4778 7.2377V9.16211ZM6.98125 6.8377H8.87783C9.09875 6.8377 9.27783 7.01678 9.27783 7.2377V9.16211H7.38125C7.16034 9.16211 6.98125 8.98302 6.98125 8.76211V6.8377ZM5.78125 6.8377V8.76211C5.78125 9.64577 6.49759 10.3621 7.38125 10.3621H9.27783V13.2377C9.27783 13.4586 9.09875 13.6377 8.87783 13.6377H2.87783C2.65692 13.6377 2.47783 13.4586 2.47783 13.2377V7.2377C2.47783 7.01678 2.65692 6.8377 2.87783 6.8377H5.78125Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vn = Z(function(i, t) {
351
- return X(J, Object.assign({}, i, {
362
+ _t.displayName = "CreateCopySingle";
363
+ var or = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.38125 1.16211C6.49759 1.16211 5.78125 1.87845 5.78125 2.76211V5.6377H2.87783C1.99418 5.6377 1.27783 6.35404 1.27783 7.2377V13.2377C1.27783 14.1214 1.99418 14.8377 2.87783 14.8377H8.87783C9.76149 14.8377 10.4778 14.1214 10.4778 13.2377V10.3621H13.3813C14.2649 10.3621 14.9813 9.64577 14.9813 8.76211V2.76211C14.9813 1.87845 14.2649 1.16211 13.3813 1.16211H7.38125ZM10.4778 9.16211H13.3813C13.6022 9.16211 13.7812 8.98302 13.7812 8.76211V2.76211C13.7812 2.5412 13.6022 2.36211 13.3813 2.36211H7.38125C7.16034 2.36211 6.98125 2.5412 6.98125 2.76211V5.6377H8.87783C9.76149 5.6377 10.4778 6.35404 10.4778 7.2377V9.16211ZM6.98125 6.8377H8.87783C9.09875 6.8377 9.27783 7.01678 9.27783 7.2377V9.16211H7.38125C7.16034 9.16211 6.98125 8.98302 6.98125 8.76211V6.8377ZM5.78125 6.8377V8.76211C5.78125 9.64577 6.49759 10.3621 7.38125 10.3621H9.27783V13.2377C9.27783 13.4586 9.09875 13.6377 8.87783 13.6377H2.87783C2.65692 13.6377 2.47783 13.4586 2.47783 13.2377V7.2377C2.47783 7.01678 2.65692 6.8377 2.87783 6.8377H5.78125Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ct = X(function(i, r) {
364
+ return J(q, Object.assign({}, i, {
352
365
  id: "group-single",
353
- ref: t,
354
- icon: wt
366
+ ref: r,
367
+ icon: or
355
368
  }));
356
369
  });
357
- vn.displayName = "GroupSingle";
358
- var vt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, _n = Z(function(i, t) {
359
- return X(J, Object.assign({}, i, {
370
+ Ct.displayName = "GroupSingle";
371
+ var cr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, St = X(function(i, r) {
372
+ return J(q, Object.assign({}, i, {
360
373
  id: "more-down-single",
361
- ref: t,
362
- icon: vt
374
+ ref: r,
375
+ icon: cr
363
376
  }));
364
377
  });
365
- _n.displayName = "MoreDownSingle";
366
- var _t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, Sn = Z(function(i, t) {
367
- return X(J, Object.assign({}, i, {
378
+ St.displayName = "MoreDownSingle";
379
+ var lr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, bt = X(function(i, r) {
380
+ return J(q, Object.assign({}, i, {
368
381
  id: "move-down-single",
369
- ref: t,
370
- icon: _t
382
+ ref: r,
383
+ icon: lr
371
384
  }));
372
385
  });
373
- Sn.displayName = "MoveDownSingle";
374
- var St = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, bn = Z(function(i, t) {
375
- return X(J, Object.assign({}, i, {
386
+ bt.displayName = "MoveDownSingle";
387
+ var dr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, yt = X(function(i, r) {
388
+ return J(q, Object.assign({}, i, {
376
389
  id: "move-up-single",
377
- ref: t,
378
- icon: St
390
+ ref: r,
391
+ icon: dr
379
392
  }));
380
393
  });
381
- bn.displayName = "MoveUpSingle";
382
- var bt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, In = Z(function(i, t) {
383
- return X(J, Object.assign({}, i, {
394
+ yt.displayName = "MoveUpSingle";
395
+ var ur = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, It = X(function(i, r) {
396
+ return J(q, Object.assign({}, i, {
384
397
  id: "topmost-single",
385
- ref: t,
386
- icon: bt
398
+ ref: r,
399
+ icon: ur
387
400
  }));
388
401
  });
389
- In.displayName = "TopmostSingle";
390
- var It = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.46855 2.83731C7.46855 2.61639 7.64764 2.4373 7.86855 2.4373H13.8603C14.0812 2.4373 14.2603 2.61639 14.2603 2.8373V9.5049C14.2603 9.72581 14.0812 9.90489 13.8603 9.90489H12.866C12.5346 9.90489 12.266 10.1735 12.266 10.5049C12.266 10.8363 12.5346 11.1049 12.866 11.1049H13.8603C14.7439 11.1049 15.4603 10.3886 15.4603 9.5049V2.8373C15.4603 1.95365 14.7439 1.2373 13.8603 1.2373H7.86855C6.9849 1.2373 6.26855 1.95365 6.26855 2.83731V3.48688C6.26855 3.81825 6.53718 4.08688 6.86855 4.08688C7.19993 4.08688 7.46855 3.81825 7.46855 3.48688V2.83731Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.19888 5.56299C2.31522 5.56299 1.59888 6.27933 1.59888 7.16299V13.163C1.59888 14.0466 2.31522 14.763 3.19888 14.763H9.19888C10.0825 14.763 10.7989 14.0466 10.7989 13.163V7.16299C10.7989 6.27933 10.0825 5.56299 9.19888 5.56299H3.19888ZM2.79888 7.16299C2.79888 6.94207 2.97796 6.76299 3.19888 6.76299H9.19888C9.41979 6.76299 9.59888 6.94207 9.59888 7.16299V13.163C9.59888 13.3839 9.41979 13.563 9.19888 13.563H3.19888C2.97796 13.563 2.79888 13.3839 2.79888 13.163V7.16299Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, yn = Z(function(i, t) {
391
- return X(J, Object.assign({}, i, {
402
+ It.displayName = "TopmostSingle";
403
+ var gr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.46855 2.83731C7.46855 2.61639 7.64764 2.4373 7.86855 2.4373H13.8603C14.0812 2.4373 14.2603 2.61639 14.2603 2.8373V9.5049C14.2603 9.72581 14.0812 9.90489 13.8603 9.90489H12.866C12.5346 9.90489 12.266 10.1735 12.266 10.5049C12.266 10.8363 12.5346 11.1049 12.866 11.1049H13.8603C14.7439 11.1049 15.4603 10.3886 15.4603 9.5049V2.8373C15.4603 1.95365 14.7439 1.2373 13.8603 1.2373H7.86855C6.9849 1.2373 6.26855 1.95365 6.26855 2.83731V3.48688C6.26855 3.81825 6.53718 4.08688 6.86855 4.08688C7.19993 4.08688 7.46855 3.81825 7.46855 3.48688V2.83731Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.19888 5.56299C2.31522 5.56299 1.59888 6.27933 1.59888 7.16299V13.163C1.59888 14.0466 2.31522 14.763 3.19888 14.763H9.19888C10.0825 14.763 10.7989 14.0466 10.7989 13.163V7.16299C10.7989 6.27933 10.0825 5.56299 9.19888 5.56299H3.19888ZM2.79888 7.16299C2.79888 6.94207 2.97796 6.76299 3.19888 6.76299H9.19888C9.41979 6.76299 9.59888 6.94207 9.59888 7.16299V13.163C9.59888 13.3839 9.41979 13.563 9.19888 13.563H3.19888C2.97796 13.563 2.79888 13.3839 2.79888 13.163V7.16299Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Mt = X(function(i, r) {
404
+ return J(q, Object.assign({}, i, {
392
405
  id: "ungroup-single",
393
- ref: t,
394
- icon: It
406
+ ref: r,
407
+ icon: gr
395
408
  }));
396
409
  });
397
- yn.displayName = "UngroupSingle";
398
- const yt = (i) => {
399
- const { arrangeShow: t, drawings: n } = i, e = k(te), r = k(re), o = (l) => l ? "block" : "none", [a, s] = x(n);
400
- _e(() => {
401
- const l = r.focus$.subscribe((m) => {
402
- s(m);
410
+ Mt.displayName = "UngroupSingle";
411
+ const U = "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-between univer-gap-2 univer-flex-no-wrap", B = "univer-w-full univer-text-left univer-text-gray-400", ne = "univer-flex univer-items-center univer-gap-1", hr = (i) => {
412
+ const { arrangeShow: r, drawings: t } = i, e = k(ie), n = k(ae), s = (l) => l ? "block" : "none", [a, o] = L(t);
413
+ be(() => {
414
+ const l = n.focus$.subscribe((d) => {
415
+ o(d);
403
416
  });
404
417
  return () => {
405
418
  l.unsubscribe();
406
419
  };
407
420
  }, []);
408
421
  const c = (l) => {
409
- const m = a[0].unitId, d = a[0].subUnitId, h = a.map((f) => f.drawingId);
410
- r.featurePluginOrderUpdateNotification({ unitId: m, subUnitId: d, drawingIds: h, arrangeType: l });
422
+ const d = a[0].unitId, u = a[0].subUnitId, h = a.map((f) => f.drawingId);
423
+ n.featurePluginOrderUpdateNotification({ unitId: d, subUnitId: u, drawingIds: h, arrangeType: l });
411
424
  };
412
- return /* @__PURE__ */ j("div", { className: g.imageCommonPanelGrid, style: { display: o(t) }, children: [
413
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: e.t("image-panel.arrange.title") }) }) }),
414
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
415
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
416
- c(be.forward);
417
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
418
- /* @__PURE__ */ u(bn, {}),
419
- e.t("image-panel.arrange.forward")
420
- ] }) }) }),
421
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
422
- c(be.backward);
423
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
424
- /* @__PURE__ */ u(Sn, {}),
425
- e.t("image-panel.arrange.backward")
426
- ] }) }) })
427
- ] }),
428
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
429
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
430
- c(be.front);
431
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
432
- /* @__PURE__ */ u(In, {}),
433
- e.t("image-panel.arrange.front")
434
- ] }) }) }),
435
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
436
- c(be.back);
437
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
438
- /* @__PURE__ */ u(Cn, {}),
439
- e.t("image-panel.arrange.back")
440
- ] }) }) })
441
- ] })
442
- ] });
443
- }, Pt = (i) => {
444
- const t = k(te), n = k(ue), e = k(re), { hasGroup: r, drawings: o } = i, [a, s] = x(!1), [c, l] = x(!0), [m, d] = x(!0), h = (p) => p ? "block" : "none", f = () => {
445
- const p = e.getFocusDrawings(), { unitId: S, subUnitId: _ } = p[0], M = jn.generateRandomId(10), I = kn(0, 0, p.map((b) => b.transform || {})), N = {
446
- unitId: S,
425
+ return /* @__PURE__ */ P(
426
+ "div",
427
+ {
428
+ className: "univer-relative univer-mt-5 univer-w-full",
429
+ style: { display: s(r) },
430
+ children: [
431
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: e.t("image-panel.arrange.title") }) }) }),
432
+ /* @__PURE__ */ P("div", { className: U, children: [
433
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
434
+ c(Ie.forward);
435
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
436
+ /* @__PURE__ */ g(yt, {}),
437
+ e.t("image-panel.arrange.forward")
438
+ ] }) }) }),
439
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
440
+ c(Ie.backward);
441
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
442
+ /* @__PURE__ */ g(bt, {}),
443
+ e.t("image-panel.arrange.backward")
444
+ ] }) }) })
445
+ ] }),
446
+ /* @__PURE__ */ P("div", { className: U, children: [
447
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
448
+ c(Ie.front);
449
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
450
+ /* @__PURE__ */ g(It, {}),
451
+ e.t("image-panel.arrange.front")
452
+ ] }) }) }),
453
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
454
+ c(Ie.back);
455
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
456
+ /* @__PURE__ */ g(wt, {}),
457
+ e.t("image-panel.arrange.back")
458
+ ] }) }) })
459
+ ] })
460
+ ]
461
+ }
462
+ );
463
+ }, fr = (i) => {
464
+ const r = k(ie), t = k(me), e = k(ae), { hasGroup: n, drawings: s } = i, [a, o] = L(!1), [c, l] = L(!0), [d, u] = L(!0), h = (m) => m ? "block" : "none", f = () => {
465
+ const m = e.getFocusDrawings(), { unitId: C, subUnitId: _ } = m[0], R = Bt.generateRandomId(10), b = kt(0, 0, m.map((S) => S.transform || {})), N = {
466
+ unitId: C,
447
467
  subUnitId: _,
448
- drawingId: M,
449
- drawingType: ne.DRAWING_GROUP,
450
- transform: I
451
- }, P = p.map((b) => {
452
- const y = b.transform || { left: 0, top: 0 }, { unitId: R, subUnitId: O, drawingId: U } = b;
468
+ drawingId: R,
469
+ drawingType: re.DRAWING_GROUP,
470
+ transform: b
471
+ }, I = m.map((S) => {
472
+ const y = S.transform || { left: 0, top: 0 }, { unitId: M, subUnitId: O, drawingId: j } = S;
453
473
  return {
454
- unitId: R,
474
+ unitId: M,
455
475
  subUnitId: O,
456
- drawingId: U,
476
+ drawingId: j,
457
477
  transform: {
458
478
  ...y,
459
- left: y.left - I.left,
460
- top: y.top - I.top
479
+ left: y.left - b.left,
480
+ top: y.top - b.top
461
481
  },
462
- groupId: M
482
+ groupId: R
463
483
  };
464
484
  });
465
485
  e.featurePluginGroupUpdateNotification([{
466
486
  parent: N,
467
- children: P
487
+ children: I
468
488
  }]);
469
- }, v = (p) => {
470
- if (p.drawingType !== ne.DRAWING_GROUP)
489
+ }, w = (m) => {
490
+ if (m.drawingType !== re.DRAWING_GROUP)
471
491
  return;
472
- const { unitId: S, subUnitId: _, drawingId: M, transform: I = { width: 0, height: 0 } } = p;
473
- if (I == null)
492
+ const { unitId: C, subUnitId: _, drawingId: R, transform: b = { width: 0, height: 0 } } = m;
493
+ if (b == null)
474
494
  return;
475
- const N = e.getDrawingsByGroup({ unitId: S, subUnitId: _, drawingId: M });
495
+ const N = e.getDrawingsByGroup({ unitId: C, subUnitId: _, drawingId: R });
476
496
  if (N.length === 0)
477
497
  return;
478
- const P = N.map((b) => {
479
- const { transform: y } = b, { unitId: R, subUnitId: O, drawingId: U } = b, T = Vn(y || {}, I, I.width || 0, I.height || 0);
498
+ const I = N.map((S) => {
499
+ const { transform: y } = S, { unitId: M, subUnitId: O, drawingId: j } = S, E = Vt(y || {}, b, b.width || 0, b.height || 0);
480
500
  return {
481
- unitId: R,
501
+ unitId: M,
482
502
  subUnitId: O,
483
- drawingId: U,
503
+ drawingId: j,
484
504
  transform: {
485
505
  ...y,
486
- ...T
506
+ ...E
487
507
  },
488
508
  groupId: void 0
489
509
  };
490
510
  });
491
511
  return {
492
- parent: p,
493
- children: P
512
+ parent: m,
513
+ children: I
494
514
  };
495
- }, w = () => {
496
- const S = e.getFocusDrawings().map(
497
- (_) => v(_)
515
+ }, v = () => {
516
+ const C = e.getFocusDrawings().map(
517
+ (_) => w(_)
498
518
  ).filter((_) => _ != null);
499
- S.length !== 0 && e.featurePluginUngroupUpdateNotification(S);
519
+ C.length !== 0 && e.featurePluginUngroupUpdateNotification(C);
500
520
  };
501
- return _e(() => {
502
- const p = o[0];
503
- if (p == null)
521
+ return be(() => {
522
+ const m = s[0];
523
+ if (m == null)
504
524
  return;
505
- const { unitId: S } = p, _ = n.getRenderById(S), M = _ == null ? void 0 : _.scene;
506
- if (M == null)
525
+ const { unitId: C } = m, _ = t.getRenderById(C), R = _ == null ? void 0 : _.scene;
526
+ if (R == null)
507
527
  return;
508
- const I = M.getTransformerByCreate(), N = I.clearControl$.subscribe((b) => {
509
- b === !0 && s(!1);
510
- }), P = I.changeStart$.subscribe((b) => {
511
- const { objects: y } = b, R = ke(y, e), O = R.filter((W) => (W == null ? void 0 : W.drawingType) === ne.DRAWING_GROUP);
512
- let U = !1, T = !1;
513
- R.length > 1 && (U = !0), O.length > 0 && (T = !0), s(U || T), l(U), d(T);
528
+ const b = R.getTransformerByCreate(), N = b.clearControl$.subscribe((S) => {
529
+ S === !0 && o(!1);
530
+ }), I = b.changeStart$.subscribe((S) => {
531
+ const { objects: y } = S, M = We(y, e), O = M.filter((G) => (G == null ? void 0 : G.drawingType) === re.DRAWING_GROUP);
532
+ let j = !1, E = !1;
533
+ M.length > 1 && (j = !0), O.length > 0 && (E = !0), o(j || E), l(j), u(E);
514
534
  });
515
535
  return () => {
516
- P.unsubscribe(), N.unsubscribe();
536
+ I.unsubscribe(), N.unsubscribe();
517
537
  };
518
- }, []), /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: h(r === !0 ? a : !1) }, children: [
519
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: t.t("image-panel.group.title") }) }) }),
520
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
521
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2, g.imageCommonPanelColumnCenter), children: /* @__PURE__ */ u(le, { style: { display: h(c) }, onClick: f, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
522
- /* @__PURE__ */ u(vn, {}),
523
- t.t("image-panel.group.group")
538
+ }, []), /* @__PURE__ */ P("div", { className: "univer-relative univer-mt-5 univer-w-full", style: { display: h(n === !0 ? a : !1) }, children: [
539
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: r.t("image-panel.group.title") }) }) }),
540
+ /* @__PURE__ */ P("div", { className: U, children: [
541
+ /* @__PURE__ */ g("div", { className: Y(ne, "univer-justify-center"), children: /* @__PURE__ */ g(ue, { style: { display: h(c) }, onClick: f, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
542
+ /* @__PURE__ */ g(Ct, {}),
543
+ r.t("image-panel.group.group")
524
544
  ] }) }) }),
525
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2, g.imageCommonPanelColumnCenter), children: /* @__PURE__ */ u(le, { style: { display: h(m) }, onClick: w, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
526
- /* @__PURE__ */ u(yn, {}),
527
- t.t("image-panel.group.unGroup")
545
+ /* @__PURE__ */ g("div", { className: Y(ne, "univer-justify-center"), children: /* @__PURE__ */ g(ue, { style: { display: h(d) }, onClick: v, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
546
+ /* @__PURE__ */ g(Mt, {}),
547
+ r.t("image-panel.group.unGroup")
528
548
  ] }) }) })
529
549
  ] })
530
550
  ] });
531
- }, se = 20, Rt = 20, Mt = [-3600, 3600], Pe = 300, Ot = (i) => {
532
- var Ze;
533
- const t = k(te), n = k(re), e = k(ue), { drawings: r, transformShow: o } = i, a = r[0];
551
+ }, le = 20, mr = 20, pr = [-3600, 3600], Oe = 300, vr = (i) => {
552
+ var Je;
553
+ const r = k(ie), t = k(ae), e = k(me), { drawings: n, transformShow: s } = i, a = n[0];
534
554
  if (a == null)
535
555
  return;
536
- const s = a.transform;
537
- if (s == null)
556
+ const o = a.transform;
557
+ if (o == null)
538
558
  return;
539
- const { unitId: c, subUnitId: l, drawingId: m, drawingType: d } = a, h = e.getRenderById(c), f = h == null ? void 0 : h.scene;
559
+ const { unitId: c, subUnitId: l, drawingId: d, drawingType: u } = a, h = e.getRenderById(c), f = h == null ? void 0 : h.scene;
540
560
  if (f == null)
541
561
  return;
542
- const v = (Ze = f.getEngine()) == null ? void 0 : Ze.activeScene;
543
- if (v == null)
562
+ const w = (Je = f.getEngine()) == null ? void 0 : Je.activeScene;
563
+ if (w == null)
544
564
  return;
545
- const w = f.getTransformerByCreate(), {
546
- width: p = 0,
547
- height: S = 0,
565
+ const v = f.getTransformerByCreate(), {
566
+ width: m = 0,
567
+ height: C = 0,
548
568
  left: _ = 0,
549
- top: M = 0,
550
- angle: I = 0
551
- } = s, [N, P] = x(p), [b, y] = x(S), [R, O] = x(_), [U, T] = x(M), [ie, W] = x(I), [q, Se] = x(w.keepRatio), ae = (C, E, L, V) => {
552
- const { width: H, height: Q } = v, { ancestorLeft: F, ancestorTop: K } = f;
553
- let Y = C, oe = E, he = L, fe = V;
554
- return C + F < 0 && (Y = -F), E + K < 0 && (oe = -K), he = H - Y - F, he < se && (he = se), fe = Q - oe - K, fe < se && (fe = se), C + he + F > H && (Y = H - L - F), E + fe + K > Q && (oe = Q - V - K), {
555
- limitLeft: Y,
556
- limitTop: oe,
557
- limitWidth: he,
558
- limitHeight: fe
569
+ top: R = 0,
570
+ angle: b = 0
571
+ } = o, [N, I] = L(m), [S, y] = L(C), [M, O] = L(_), [j, E] = L(R), [se, G] = L(b), [Q, ye] = L(v.keepRatio), oe = (p, T, H, V) => {
572
+ const { width: A, height: ee } = w, { ancestorLeft: F, ancestorTop: K } = f;
573
+ let Z = p, ce = T, pe = H, ve = V;
574
+ return p + F < 0 && (Z = -F), T + K < 0 && (ce = -K), pe = A - Z - F, pe < le && (pe = le), ve = ee - ce - K, ve < le && (ve = le), p + pe + F > A && (Z = A - H - F), T + ve + K > ee && (ce = ee - V - K), {
575
+ limitLeft: Z,
576
+ limitTop: ce,
577
+ limitWidth: pe,
578
+ limitHeight: ve
559
579
  };
560
- }, z = (C) => {
561
- const { objects: E } = C, L = ke(E, n);
562
- if (L.length !== 1)
580
+ }, z = (p) => {
581
+ const { objects: T } = p, H = We(T, t);
582
+ if (H.length !== 1)
563
583
  return;
564
- const V = L[0];
584
+ const V = H[0];
565
585
  if (V == null)
566
586
  return;
567
- const { transform: H } = V;
568
- if (H == null)
587
+ const { transform: A } = V;
588
+ if (A == null)
569
589
  return;
570
590
  const {
571
- width: Q,
591
+ width: ee,
572
592
  height: F,
573
593
  left: K,
574
- top: Y,
575
- angle: oe
576
- } = H;
577
- Q != null && P(Q), F != null && y(F), K != null && O(K), Y != null && T(Y), oe != null && W(oe);
594
+ top: Z,
595
+ angle: ce
596
+ } = A;
597
+ ee != null && I(ee), F != null && y(F), K != null && O(K), Z != null && E(Z), ce != null && G(ce);
578
598
  };
579
- _e(() => {
580
- const C = [
581
- w.changeStart$.subscribe((E) => {
582
- z(E);
599
+ be(() => {
600
+ const p = [
601
+ v.changeStart$.subscribe((T) => {
602
+ z(T);
583
603
  }),
584
- w.changing$.subscribe((E) => {
585
- z(E);
604
+ v.changing$.subscribe((T) => {
605
+ z(T);
586
606
  }),
587
- w.changeEnd$.subscribe((E) => {
588
- z(E);
607
+ v.changeEnd$.subscribe((T) => {
608
+ z(T);
589
609
  }),
590
- n.focus$.subscribe((E) => {
591
- if (E.length !== 1)
610
+ t.focus$.subscribe((T) => {
611
+ if (T.length !== 1)
592
612
  return;
593
- const L = n.getDrawingByParam(E[0]);
594
- if (L == null)
613
+ const H = t.getDrawingByParam(T[0]);
614
+ if (H == null)
595
615
  return;
596
- const V = L.transform;
616
+ const V = H.transform;
597
617
  if (V == null)
598
618
  return;
599
619
  const {
600
- width: H,
601
- height: Q,
620
+ width: A,
621
+ height: ee,
602
622
  left: F,
603
623
  top: K,
604
- angle: Y
624
+ angle: Z
605
625
  } = V;
606
- H != null && P(H), Q != null && y(Q), F != null && O(F), K != null && T(K), Y != null && W(Y);
626
+ A != null && I(A), ee != null && y(ee), F != null && O(F), K != null && E(K), Z != null && G(Z);
607
627
  })
608
628
  ];
609
629
  return () => {
610
- C.forEach((E) => E.unsubscribe());
630
+ p.forEach((T) => T.unsubscribe());
611
631
  };
612
632
  }, []);
613
- const Ve = Ie((C) => {
614
- if (C == null)
633
+ const Ge = Me((p) => {
634
+ if (p == null)
615
635
  return;
616
- C = Math.max(C, se);
617
- const { limitWidth: E, limitHeight: L } = ae(R, U, C, b);
618
- C = Math.min(C, E);
619
- const V = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { width: C } };
620
- if (q) {
621
- let H = C / N * b;
622
- if (H = Math.max(H, Rt), H > L)
636
+ p = Math.max(p, le);
637
+ const { limitWidth: T, limitHeight: H } = oe(M, j, p, S);
638
+ p = Math.min(p, T);
639
+ const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { width: p } };
640
+ if (Q) {
641
+ let A = p / N * S;
642
+ if (A = Math.max(A, mr), A > H)
623
643
  return;
624
- y(H), V.transform.height = H;
644
+ y(A), V.transform.height = A;
625
645
  }
626
- P(C), n.featurePluginUpdateNotification([V]), w.refreshControls().changeNotification();
627
- }, Pe), Rn = Ie((C) => {
628
- if (C == null)
646
+ I(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
647
+ }, Oe), Ot = Me((p) => {
648
+ if (p == null)
629
649
  return;
630
- C = Math.max(C, se);
631
- const { limitHeight: E, limitWidth: L } = ae(R, U, N, C);
632
- C = Math.min(C, E);
633
- const V = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { height: C } };
634
- if (q) {
635
- let H = C / b * N;
636
- if (H = Math.max(H, se), H > L)
650
+ p = Math.max(p, le);
651
+ const { limitHeight: T, limitWidth: H } = oe(M, j, N, p);
652
+ p = Math.min(p, T);
653
+ const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { height: p } };
654
+ if (Q) {
655
+ let A = p / S * N;
656
+ if (A = Math.max(A, le), A > H)
637
657
  return;
638
- P(H), V.transform.width = H;
658
+ I(A), V.transform.width = A;
639
659
  }
640
- y(C), n.featurePluginUpdateNotification([V]), w.refreshControls().changeNotification();
641
- }, Pe), Mn = Ie((C) => {
642
- if (C == null)
660
+ y(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
661
+ }, Oe), Nt = Me((p) => {
662
+ if (p == null)
643
663
  return;
644
- const { limitLeft: E } = ae(C, U, N, b);
645
- C = E;
646
- const L = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { left: C } };
647
- O(C), n.featurePluginUpdateNotification([L]), w.refreshControls().changeNotification();
648
- }, Pe), On = Ie((C) => {
649
- if (C == null)
664
+ const { limitLeft: T } = oe(p, j, N, S);
665
+ p = T;
666
+ const H = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { left: p } };
667
+ O(p), t.featurePluginUpdateNotification([H]), v.refreshControls().changeNotification();
668
+ }, Oe), Dt = Me((p) => {
669
+ if (p == null)
650
670
  return;
651
- const { limitTop: E } = ae(R, C, N, b);
652
- C = E;
653
- const L = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { top: C } };
654
- T(C), n.featurePluginUpdateNotification([L]), w.refreshControls().changeNotification();
655
- }, Pe), Nn = (C) => {
656
- if (C == null)
671
+ const { limitTop: T } = oe(M, p, N, S);
672
+ p = T;
673
+ const H = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { top: p } };
674
+ E(p), t.featurePluginUpdateNotification([H]), v.refreshControls().changeNotification();
675
+ }, Oe), Et = (p) => {
676
+ if (p == null)
657
677
  return;
658
- const [E, L] = Mt;
659
- C < E && (C = E), C > L && (C = L);
660
- const V = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { angle: C } };
661
- W(C), n.featurePluginUpdateNotification([V]), w.refreshControls().changeNotification();
662
- }, Dn = (C) => {
663
- Se(C), w.keepRatio = C;
664
- }, Tn = (C) => C ? "block" : "none";
665
- return /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: Tn(o) }, children: [
666
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: t.t("image-panel.transform.title") }) }) }),
667
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
668
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
669
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.width") }) }),
670
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: N, onChange: (C) => {
671
- Ve(C);
672
- }, className: g.imageCommonPanelInput }) }) })
673
- ] }) }),
674
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
675
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.height") }) }),
676
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: b, onChange: (C) => {
677
- Rn(C);
678
- }, className: g.imageCommonPanelInput }) }) })
679
- ] }) }),
680
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
681
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.lock") }) }),
682
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelRow, g.imageCommonPanelRowVertical), children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(Kn, { checked: q, onChange: Dn }) }) })
683
- ] }) })
684
- ] }),
685
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
686
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
687
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.x") }) }),
688
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: R, onChange: (C) => {
689
- Mn(C);
690
- }, className: g.imageCommonPanelInput }) }) })
691
- ] }) }),
692
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
693
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.y") }) }),
694
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: U, onChange: (C) => {
695
- On(C);
696
- }, className: g.imageCommonPanelInput }) }) })
697
- ] }) }),
698
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
699
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.rotate") }) }),
700
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: ie, onChange: Nn, className: g.imageCommonPanelInput }) }) })
701
- ] }) })
702
- ] })
703
- ] });
704
- }, Fe = {
678
+ const [T, H] = pr;
679
+ p < T && (p = T), p > H && (p = H);
680
+ const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { angle: p } };
681
+ G(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
682
+ }, Tt = (p) => {
683
+ ye(p), v.keepRatio = p;
684
+ };
685
+ return /* @__PURE__ */ P(
686
+ "div",
687
+ {
688
+ className: `
689
+ univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
690
+ univer-border-t univer-border-solid univer-border-t-gray-200
691
+ `,
692
+ style: { display: ((p) => p ? "block" : "none")(s) },
693
+ children: [
694
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ g("div", { children: r.t("image-panel.transform.title") }) }) }),
695
+ /* @__PURE__ */ P("div", { className: U, children: [
696
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
697
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.width") }) }),
698
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: N, onChange: (p) => {
699
+ Ge(p);
700
+ } }) }) })
701
+ ] }) }),
702
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
703
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.height") }) }),
704
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: S, onChange: (p) => {
705
+ Ot(p);
706
+ } }) }) })
707
+ ] }) }),
708
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
709
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.lock") }) }),
710
+ /* @__PURE__ */ g("div", { className: Y(U, "univer-h-9 univer-items-center univer-justify-center"), children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(Kt, { checked: Q, onChange: Tt }) }) })
711
+ ] }) })
712
+ ] }),
713
+ /* @__PURE__ */ P("div", { className: U, children: [
714
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
715
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.x") }) }),
716
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: M, onChange: (p) => {
717
+ Nt(p);
718
+ } }) }) })
719
+ ] }) }),
720
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
721
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.y") }) }),
722
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: j, onChange: (p) => {
723
+ Dt(p);
724
+ } }) }) })
725
+ ] }) }),
726
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
727
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.rotate") }) }),
728
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: se, onChange: Et }) }) })
729
+ ] }) })
730
+ ] })
731
+ ]
732
+ }
733
+ );
734
+ }, Ye = {
705
735
  id: "sheet.operation.open-image-crop",
706
- type: ve.OPERATION,
707
- handler: (i, t) => !0
736
+ type: Se.OPERATION,
737
+ handler: (i, r) => !0
708
738
  }, ge = {
709
739
  id: "sheet.operation.close-image-crop",
710
- type: ve.OPERATION,
711
- handler: (i, t) => !0
740
+ type: Se.OPERATION,
741
+ handler: (i, r) => !0
712
742
  };
713
- var A = /* @__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))(A || {});
714
- const Be = {
743
+ var x = /* @__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))(x || {});
744
+ const Ue = {
715
745
  id: "sheet.operation.Auto-image-crop",
716
- type: ve.OPERATION,
717
- handler: (i, t) => !0
718
- }, Nt = (i) => {
719
- const t = k(me), n = k(te), { drawings: e, cropperShow: r } = i;
746
+ type: Se.OPERATION,
747
+ handler: (i, r) => !0
748
+ }, wr = (i) => {
749
+ const r = k(he), t = k(ie), { drawings: e, cropperShow: n } = i;
720
750
  if (e[0] == null)
721
751
  return;
722
- const [a, s] = x(A.FREE), c = mn(!1), l = [
752
+ const [a, o] = L(x.FREE), c = gt(!1), l = [
723
753
  {
724
- label: n.t("image-panel.crop.mode"),
725
- value: A.FREE
754
+ label: t.t("image-panel.crop.mode"),
755
+ value: x.FREE
726
756
  },
727
757
  {
728
758
  label: "1:1",
729
- value: A.R1_1
759
+ value: x.R1_1
730
760
  },
731
761
  {
732
762
  label: "16:9",
733
- value: A.R16_9
763
+ value: x.R16_9
734
764
  },
735
765
  {
736
766
  label: "9:16",
737
- value: A.R9_16
767
+ value: x.R9_16
738
768
  },
739
769
  {
740
770
  label: "5:4",
741
- value: A.R5_4
771
+ value: x.R5_4
742
772
  },
743
773
  {
744
774
  label: "4:5",
745
- value: A.R4_5
775
+ value: x.R4_5
746
776
  },
747
777
  {
748
778
  label: "4:3",
749
- value: A.R4_3
779
+ value: x.R4_3
750
780
  },
751
781
  {
752
782
  label: "3:4",
753
- value: A.R3_4
783
+ value: x.R3_4
754
784
  },
755
785
  {
756
786
  label: "3:2",
757
- value: A.R3_2
787
+ value: x.R3_2
758
788
  },
759
789
  {
760
790
  label: "2:3",
761
- value: A.R2_3
791
+ value: x.R2_3
762
792
  }
763
793
  ];
764
- _e(() => {
765
- const f = t.onCommandExecuted((v) => {
766
- if (v.id === ge.id) {
767
- const w = v.params;
768
- w != null && w.isAuto || (c.current = !1);
794
+ be(() => {
795
+ const f = r.onCommandExecuted((w) => {
796
+ if (w.id === ge.id) {
797
+ const v = w.params;
798
+ v != null && v.isAuto || (c.current = !1);
769
799
  }
770
800
  });
771
801
  return () => {
772
802
  f == null || f.dispose();
773
803
  };
774
804
  }, []);
775
- function m(f) {
776
- s(f), c.current && t.executeCommand(Be.id, {
805
+ function d(f) {
806
+ o(f), c.current && r.executeCommand(Ue.id, {
777
807
  cropType: f
778
808
  });
779
809
  }
780
- const d = (f) => f ? "block" : "none", h = (f) => {
781
- t.executeCommand(Be.id, {
810
+ const u = (f) => f ? "block" : "none", h = (f) => {
811
+ r.executeCommand(Ue.id, {
782
812
  cropType: f
783
813
  }), c.current = !0;
784
814
  };
785
- return /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: d(r) }, children: [
786
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("image-panel.crop.title") }) }) }),
787
- /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelRow, g.imageCommonPanelRowVertical), children: [
788
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
789
- h(a);
790
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
791
- /* @__PURE__ */ u(wn, {}),
792
- n.t("image-panel.crop.start")
793
- ] }) }) }),
794
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(dn, { value: a, options: l, onChange: m }) })
795
- ] })
796
- ] });
797
- }, er = (i) => {
798
- const t = k(re), n = k(ue), e = k(te), { drawings: r, hasArrange: o = !0, hasTransform: a = !0, hasAlign: s = !0, hasCropper: c = !0, hasGroup: l = !0 } = i, m = r[0];
799
- if (m == null)
815
+ return /* @__PURE__ */ P(
816
+ "div",
817
+ {
818
+ className: `
819
+ univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
820
+ univer-border-t univer-border-solid univer-border-t-gray-200
821
+ `,
822
+ style: { display: u(n) },
823
+ children: [
824
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: t.t("image-panel.crop.title") }) }) }),
825
+ /* @__PURE__ */ P("div", { className: U, children: [
826
+ /* @__PURE__ */ g("div", { className: ne, children: /* @__PURE__ */ g(ue, { onClick: () => {
827
+ h(a);
828
+ }, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
829
+ /* @__PURE__ */ g(_t, {}),
830
+ t.t("image-panel.crop.start")
831
+ ] }) }) }),
832
+ /* @__PURE__ */ g("div", { className: ne, children: /* @__PURE__ */ g(ht, { value: a, options: l, onChange: d }) })
833
+ ] })
834
+ ]
835
+ }
836
+ );
837
+ }, $r = (i) => {
838
+ const r = k(ae), t = k(me), e = k(ie), { drawings: n, hasArrange: s = !0, hasTransform: a = !0, hasAlign: o = !0, hasCropper: c = !0, hasGroup: l = !0 } = i, d = n[0];
839
+ if (d == null)
800
840
  return;
801
- const { unitId: d } = m, h = n.getRenderById(d), f = h == null ? void 0 : h.scene;
841
+ const { unitId: u } = d, h = t.getRenderById(u), f = h == null ? void 0 : h.scene;
802
842
  if (f == null)
803
843
  return;
804
- const v = f.getTransformerByCreate(), [w, p] = x(!0), [S, _] = x(!0), [M, I] = x(!1), [N, P] = x(!0), [b, y] = x(!1);
805
- return _e(() => {
806
- const R = v.clearControl$.subscribe((T) => {
807
- T === !0 && (p(!1), _(!1), I(!1), P(!1), y(!0));
808
- }), O = v.changeStart$.subscribe((T) => {
809
- const { objects: ie } = T, W = ke(ie, t);
810
- W.length === 0 ? (p(!1), _(!1), I(!1), P(!1), y(!0)) : W.length === 1 ? (p(!0), _(!0), I(!1), P(!0), y(!1)) : (p(!0), _(!1), I(!0), P(!1), y(!1));
811
- }), U = t.focus$.subscribe((T) => {
812
- T.length === 0 ? (p(!1), _(!1), I(!1), P(!1), y(!0)) : T.length === 1 ? (p(!0), _(!0), I(!1), P(!0), y(!1)) : (p(!0), _(!1), I(!0), P(!1), y(!1));
844
+ const w = f.getTransformerByCreate(), [v, m] = L(!0), [C, _] = L(!0), [R, b] = L(!1), [N, I] = L(!0), [S, y] = L(!1);
845
+ return be(() => {
846
+ const M = w.clearControl$.subscribe((E) => {
847
+ E === !0 && (m(!1), _(!1), b(!1), I(!1), y(!0));
848
+ }), O = w.changeStart$.subscribe((E) => {
849
+ const { objects: se } = E, G = We(se, r);
850
+ G.length === 0 ? (m(!1), _(!1), b(!1), I(!1), y(!0)) : G.length === 1 ? (m(!0), _(!0), b(!1), I(!0), y(!1)) : (m(!0), _(!1), b(!0), I(!1), y(!1));
851
+ }), j = r.focus$.subscribe((E) => {
852
+ E.length === 0 ? (m(!1), _(!1), b(!1), I(!1), y(!0)) : E.length === 1 ? (m(!0), _(!0), b(!1), I(!0), y(!1)) : (m(!0), _(!1), b(!0), I(!1), y(!1));
813
853
  });
814
854
  return () => {
815
- O.unsubscribe(), R.unsubscribe(), U.unsubscribe();
855
+ O.unsubscribe(), M.unsubscribe(), j.unsubscribe();
816
856
  };
817
- }, []), /* @__PURE__ */ j(Fn, { children: [
818
- /* @__PURE__ */ u("div", { style: { display: b === !0 ? "block" : "none", height: "100%" }, children: /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", top: "50%", marginTop: "-100px" }, children: /* @__PURE__ */ u("span", { children: e.t("image-panel.null") }) }) }),
819
- /* @__PURE__ */ u(yt, { arrangeShow: o === !0 ? w : !1, drawings: r }),
820
- /* @__PURE__ */ u(Ot, { transformShow: a === !0 ? S : !1, drawings: r }),
821
- /* @__PURE__ */ u(gt, { alignShow: s === !0 ? M : !1, drawings: r }),
822
- /* @__PURE__ */ u(Nt, { cropperShow: c === !0 ? N : !1, drawings: r }),
823
- /* @__PURE__ */ u(Pt, { hasGroup: l, drawings: r })
857
+ }, []), /* @__PURE__ */ P(Ft, { children: [
858
+ /* @__PURE__ */ g("div", { style: { display: S === !0 ? "block" : "none", height: "100%" }, children: /* @__PURE__ */ g("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", top: "50%", marginTop: "-100px" }, children: /* @__PURE__ */ g("span", { children: e.t("image-panel.null") }) }) }),
859
+ /* @__PURE__ */ g(hr, { arrangeShow: s === !0 ? v : !1, drawings: n }),
860
+ /* @__PURE__ */ g(vr, { transformShow: a === !0 ? C : !1, drawings: n }),
861
+ /* @__PURE__ */ g(Qt, { alignShow: o === !0 ? R : !1, drawings: n }),
862
+ /* @__PURE__ */ g(wr, { cropperShow: c === !0 ? N : !1, drawings: n }),
863
+ /* @__PURE__ */ g(fr, { hasGroup: l, drawings: n })
824
864
  ] });
825
- }, Dt = (i) => {
826
- var w;
827
- const { popup: t } = i, n = (w = t == null ? void 0 : t.extraProps) == null ? void 0 : w.menuItems;
828
- if (!n) return null;
829
- const e = k(me), r = k(te), [o, a] = x(!1), [s, c] = x(!1), l = () => {
865
+ }, _r = (i) => {
866
+ var v;
867
+ const { popup: r } = i, t = (v = r == null ? void 0 : r.extraProps) == null ? void 0 : v.menuItems;
868
+ if (!t) return null;
869
+ const e = k(he), n = k(ie), [s, a] = L(!1), [o, c] = L(!1), l = () => {
830
870
  c(!0);
831
- }, m = () => {
871
+ }, d = () => {
832
872
  c(!1);
833
- }, d = (p) => {
834
- a(p);
835
- }, h = (p) => {
836
- e.executeCommand(p.commandId, p.commandParams), a(!1);
837
- }, f = o || s, v = n.filter((p) => !p.disable);
838
- return /* @__PURE__ */ u(
873
+ }, u = (m) => {
874
+ a(m);
875
+ }, h = (m) => {
876
+ e.executeCommand(m.commandId, m.commandParams), a(!1);
877
+ }, f = s || o, w = t.filter((m) => !m.disable);
878
+ return /* @__PURE__ */ g(
839
879
  "div",
840
880
  {
841
881
  onMouseEnter: l,
842
- onMouseLeave: m,
843
- children: /* @__PURE__ */ u(
844
- Yn,
882
+ onMouseLeave: d,
883
+ children: /* @__PURE__ */ g(
884
+ Yt,
845
885
  {
846
886
  align: "start",
847
- items: v.map((p) => ({
887
+ items: w.map((m) => ({
848
888
  type: "item",
849
- children: r.t(p.label),
850
- onSelect: () => h(p)
889
+ children: n.t(m.label),
890
+ onSelect: () => h(m)
851
891
  })),
852
- open: o,
853
- onOpenChange: d,
854
- children: /* @__PURE__ */ j(
892
+ open: s,
893
+ onOpenChange: u,
894
+ children: /* @__PURE__ */ P(
855
895
  "div",
856
896
  {
857
- className: B(`
897
+ className: Y(`
858
898
  univer-flex univer-items-center univer-gap-2 univer-rounded univer-border univer-border-solid
859
899
  univer-border-gray-200 univer-p-1
860
900
  hover:univer-bg-gray-100
861
901
  `, {
862
- "univer-bg-gray-100": o,
863
- "univer-bg-white": !o
902
+ "univer-bg-gray-100": s,
903
+ "univer-bg-white": !s
864
904
  }),
865
905
  children: [
866
- /* @__PURE__ */ u(
867
- pn,
868
- {
869
- style: { color: "#35322B" },
870
- extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
871
- }
872
- ),
873
- f && /* @__PURE__ */ u(_n, { className: "univer-text-[10px] univer-text-gray-400" })
906
+ /* @__PURE__ */ g(vt, { className: "univer-fill-green-500 univer-text-gray-900" }),
907
+ f && /* @__PURE__ */ g(St, { className: "univer-text-[10px] univer-text-gray-400" })
874
908
  ]
875
909
  }
876
910
  )
@@ -878,61 +912,61 @@ const Be = {
878
912
  )
879
913
  }
880
914
  );
881
- }, Tt = "COMPONENT_IMAGE_POPUP_MENU", Et = "drawing-ui.config", tn = {}, Pn = {
915
+ }, Cr = "COMPONENT_IMAGE_POPUP_MENU", Sr = "drawing-ui.config", it = {}, Rt = {
882
916
  id: "sheet.operation.image-reset-size",
883
- type: ve.OPERATION,
884
- handler: (i, t) => !0
885
- }, Bt = (i) => {
886
- const { src: t } = i;
887
- return t ? /* @__PURE__ */ u("div", { className: "univer-py-2", children: /* @__PURE__ */ u(
917
+ type: Se.OPERATION,
918
+ handler: (i, r) => !0
919
+ }, br = (i) => {
920
+ const { src: r } = i;
921
+ return r ? /* @__PURE__ */ g("div", { className: "univer-py-2", children: /* @__PURE__ */ g(
888
922
  "img",
889
923
  {
890
924
  className: "univer-relative univer-block univer-size-full",
891
- src: t,
925
+ src: r,
892
926
  alt: "Univer Image Viewer"
893
927
  }
894
928
  ) }) : null;
895
929
  };
896
- var jt = Object.getOwnPropertyDescriptor, Ut = (i, t, n, e) => {
897
- for (var r = e > 1 ? void 0 : e ? jt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
898
- (a = i[o]) && (r = a(r) || r);
899
- return r;
900
- }, rn = (i, t) => (n, e) => t(n, e, i);
901
- let je = class extends xe {
902
- constructor(i, t) {
903
- super(), this._componentManager = i, this._commandService = t, this._init();
930
+ var yr = Object.getOwnPropertyDescriptor, Ir = (i, r, t, e) => {
931
+ for (var n = e > 1 ? void 0 : e ? yr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
932
+ (a = i[s]) && (n = a(n) || n);
933
+ return n;
934
+ }, at = (i, r) => (t, e) => r(t, e, i);
935
+ let xe = class extends Ve {
936
+ constructor(i, r) {
937
+ super(), this._componentManager = i, this._commandService = r, this._init();
904
938
  }
905
939
  _initCustomComponents() {
906
940
  const i = this._componentManager;
907
- this.disposeWithMe(i.register(Tt, Dt)), this.disposeWithMe(i.register(hn, Bt));
941
+ this.disposeWithMe(i.register(Cr, _r)), this.disposeWithMe(i.register(mt, br));
908
942
  }
909
943
  _initCommands() {
910
944
  [
911
- Fe,
912
- ge,
913
- Pn,
914
945
  Ye,
915
- Be
946
+ ge,
947
+ Rt,
948
+ Xe,
949
+ Ue
916
950
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
917
951
  }
918
952
  _init() {
919
953
  this._initCommands(), this._initCustomComponents();
920
954
  }
921
955
  };
922
- je = Ut([
923
- rn(0, Le($n)),
924
- rn(1, me)
925
- ], je);
926
- var At = Object.getOwnPropertyDescriptor, Ht = (i, t, n, e) => {
927
- for (var r = e > 1 ? void 0 : e ? At(t, n) : t, o = i.length - 1, a; o >= 0; o--)
928
- (a = i[o]) && (r = a(r) || r);
929
- return r;
930
- }, Re = (i, t) => (n, e) => t(n, e, i);
931
- let Ue = class extends xe {
932
- constructor(t, n, e, r) {
956
+ xe = Ir([
957
+ at(0, ke($t)),
958
+ at(1, he)
959
+ ], xe);
960
+ var Mr = Object.getOwnPropertyDescriptor, Rr = (i, r, t, e) => {
961
+ for (var n = e > 1 ? void 0 : e ? Mr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
962
+ (a = i[s]) && (n = a(n) || n);
963
+ return n;
964
+ }, Ne = (i, r) => (t, e) => r(t, e, i);
965
+ let Ae = class extends Ve {
966
+ constructor(r, t, e, n) {
933
967
  super();
934
- ee(this, "_sceneListenerOnDrawingMap", /* @__PURE__ */ new WeakSet());
935
- this._currentUniverService = t, this._commandService = n, this._renderManagerService = e, this._drawingManagerService = r, this._initialize();
968
+ te(this, "_sceneListenerOnDrawingMap", /* @__PURE__ */ new WeakSet());
969
+ this._currentUniverService = r, this._commandService = t, this._renderManagerService = e, this._drawingManagerService = n, this._initialize();
936
970
  }
937
971
  dispose() {
938
972
  super.dispose();
@@ -941,39 +975,39 @@ let Ue = class extends xe {
941
975
  this._recoveryImages(), this._drawingAddListener(), this._drawingRemoveListener(), this._drawingUpdateListener(), this._commandExecutedListener(), this._drawingArrangeListener(), this._drawingGroupListener(), this._drawingRefreshListener(), this._drawingVisibleListener();
942
976
  }
943
977
  _recoveryImages() {
944
- const t = this._drawingManagerService.drawingManagerData, n = un(this._currentUniverService);
945
- if (n == null)
978
+ const r = this._drawingManagerService.drawingManagerData, t = ft(this._currentUniverService);
979
+ if (t == null)
946
980
  return;
947
- const { unitId: e, subUnitId: r } = n;
948
- Object.keys(t).forEach((o) => {
949
- Object.keys(t[o]).forEach((a) => {
950
- const s = t[o][a].data;
951
- s == null || o !== e || a !== r || Object.keys(s).forEach((c) => {
952
- s[c] && this._insertDrawing([{ unitId: o, subUnitId: a, drawingId: c }]);
981
+ const { unitId: e, subUnitId: n } = t;
982
+ Object.keys(r).forEach((s) => {
983
+ Object.keys(r[s]).forEach((a) => {
984
+ const o = r[s][a].data;
985
+ o == null || s !== e || a !== n || Object.keys(o).forEach((c) => {
986
+ o[c] && this._insertDrawing([{ unitId: s, subUnitId: a, drawingId: c }]);
953
987
  });
954
988
  });
955
989
  });
956
990
  }
957
991
  _commandExecutedListener() {
958
992
  this.disposeWithMe(
959
- this._commandService.onCommandExecuted((t) => {
960
- if (t.id === Ye.id) {
961
- const n = t.params;
962
- if (n == null)
993
+ this._commandService.onCommandExecuted((r) => {
994
+ if (r.id === Xe.id) {
995
+ const t = r.params;
996
+ if (t == null)
963
997
  return;
964
- this._drawingAlign(n);
998
+ this._drawingAlign(t);
965
999
  }
966
1000
  })
967
1001
  );
968
1002
  }
969
1003
  _drawingGroupListener() {
970
1004
  this.disposeWithMe(
971
- this._drawingManagerService.group$.subscribe((t) => {
972
- this._groupDrawings(t);
1005
+ this._drawingManagerService.group$.subscribe((r) => {
1006
+ this._groupDrawings(r);
973
1007
  })
974
1008
  ), this.disposeWithMe(
975
- this._drawingManagerService.ungroup$.subscribe((t) => {
976
- this._ungroupDrawings(t);
1009
+ this._drawingManagerService.ungroup$.subscribe((r) => {
1010
+ this._ungroupDrawings(r);
977
1011
  })
978
1012
  );
979
1013
  }
@@ -997,38 +1031,38 @@ let Ue = class extends xe {
997
1031
  // break;
998
1032
  // }
999
1033
  // }
1000
- _getSceneAndTransformerByDrawingSearch(t) {
1001
- if (t == null)
1034
+ _getSceneAndTransformerByDrawingSearch(r) {
1035
+ if (r == null)
1002
1036
  return;
1003
- const n = this._renderManagerService.getRenderById(t), e = n == null ? void 0 : n.scene;
1037
+ const t = this._renderManagerService.getRenderById(r), e = t == null ? void 0 : t.scene;
1004
1038
  if (e == null)
1005
1039
  return null;
1006
- const r = e.getTransformerByCreate();
1007
- return { scene: e, transformer: r };
1040
+ const n = e.getTransformerByCreate();
1041
+ return { scene: e, transformer: n };
1008
1042
  }
1009
- _groupDrawings(t) {
1010
- t.forEach((n) => {
1011
- this._groupDrawing(n);
1043
+ _groupDrawings(r) {
1044
+ r.forEach((t) => {
1045
+ this._groupDrawing(t);
1012
1046
  });
1013
1047
  }
1014
- _groupDrawing(t) {
1015
- const { parent: n, children: e } = t, { unitId: r, subUnitId: o, drawingId: a } = n, s = this._getSceneAndTransformerByDrawingSearch(n.unitId);
1016
- if (s == null)
1048
+ _groupDrawing(r) {
1049
+ const { parent: t, children: e } = r, { unitId: n, subUnitId: s, drawingId: a } = t, o = this._getSceneAndTransformerByDrawingSearch(t.unitId);
1050
+ if (o == null)
1017
1051
  return;
1018
- const { scene: c, transformer: l } = s;
1052
+ const { scene: c, transformer: l } = o;
1019
1053
  this._commandService.syncExecuteCommand(ge.id);
1020
- const m = [];
1054
+ const d = [];
1021
1055
  if (e.forEach((f) => {
1022
- const v = G(f), w = c.getObjectIncludeInGroup(v);
1023
- if (w == null || m.includes(w))
1056
+ const w = W(f), v = c.getObjectIncludeInGroup(w);
1057
+ if (v == null || d.includes(v))
1024
1058
  return;
1025
- m.push(w);
1026
- const { transform: p } = f;
1027
- p != null && (w.classType === Je.GROUP ? w.transformByState({ left: p.left, top: p.top }) : w.transformByState(p));
1028
- }), m.length === 0)
1059
+ d.push(v);
1060
+ const { transform: m } = f;
1061
+ m != null && (v.classType === Qe.GROUP ? v.transformByState({ left: m.left, top: m.top }) : v.transformByState(m));
1062
+ }), d.length === 0)
1029
1063
  return;
1030
- const d = G({ unitId: r, subUnitId: o, drawingId: a }), h = new we(d);
1031
- c.addObject(h, De).attachTransformerTo(h), h.addObjects(...m), n.transform && h.transformByState({ left: n.transform.left, top: n.transform.top }), l.clearSelectedObjects(), l.setSelectedControl(h);
1064
+ const u = W({ unitId: n, subUnitId: s, drawingId: a }), h = new Ce(u);
1065
+ c.addObject(h, Pe).attachTransformerTo(h), h.addObjects(...d), t.transform && h.transformByState({ left: t.transform.left, top: t.transform.top }), l.clearSelectedObjects(), l.setSelectedControl(h);
1032
1066
  }
1033
1067
  // private _regroupDrawings(drawings: IDrawingSearch[]) {
1034
1068
  // const renderObject = this._getSceneAndTransformerByDrawingSearch(drawings[0].unitId);
@@ -1064,127 +1098,127 @@ let Ue = class extends xe {
1064
1098
  // transformer.clearSelectedObjects();
1065
1099
  // transformer.setSelectedControl(firstGroup);
1066
1100
  // }
1067
- _ungroupDrawings(t) {
1068
- t.forEach((n) => {
1069
- this._ungroupDrawing(n);
1101
+ _ungroupDrawings(r) {
1102
+ r.forEach((t) => {
1103
+ this._ungroupDrawing(t);
1070
1104
  });
1071
1105
  }
1072
- _ungroupDrawing(t) {
1073
- const { parent: n, children: e } = t, r = this._getSceneAndTransformerByDrawingSearch(n.unitId);
1074
- if (r == null)
1106
+ _ungroupDrawing(r) {
1107
+ const { parent: t, children: e } = r, n = this._getSceneAndTransformerByDrawingSearch(t.unitId);
1108
+ if (n == null)
1075
1109
  return;
1076
- const { scene: o, transformer: a } = r;
1077
- e.forEach((d) => {
1078
- const h = G(d), f = o.getObjectIncludeInGroup(h);
1110
+ const { scene: s, transformer: a } = n;
1111
+ e.forEach((u) => {
1112
+ const h = W(u), f = s.getObjectIncludeInGroup(h);
1079
1113
  if (f == null)
1080
1114
  return !0;
1081
1115
  if (f == null)
1082
1116
  return;
1083
- const { transform: v } = d;
1084
- v != null && (f.classType === Je.GROUP ? f.transformByState({ left: v.left, top: v.top }) : f.transformByState(v));
1117
+ const { transform: w } = u;
1118
+ w != null && (f.classType === Qe.GROUP ? f.transformByState({ left: w.left, top: w.top }) : f.transformByState(w));
1085
1119
  });
1086
- const s = G(n), c = o.getObject(s), { width: l, height: m } = c;
1087
- c.getObjects().forEach((d) => {
1088
- c.removeSelfObjectAndTransform(d.oKey, l, m);
1120
+ const o = W(t), c = s.getObject(o), { width: l, height: d } = c;
1121
+ c.getObjects().forEach((u) => {
1122
+ c.removeSelfObjectAndTransform(u.oKey, l, d);
1089
1123
  }), c.dispose(), a.clearSelectedObjects();
1090
1124
  }
1091
- _drawingAlign(t) {
1092
- const { alignType: n } = t, e = this._drawingManagerService.getFocusDrawings();
1093
- if (n === D.default)
1125
+ _drawingAlign(r) {
1126
+ const { alignType: t } = r, e = this._drawingManagerService.getFocusDrawings();
1127
+ if (t === D.default)
1094
1128
  return;
1095
- const r = [];
1096
- let o = Number.POSITIVE_INFINITY, a = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, c = Number.NEGATIVE_INFINITY, l = 0;
1097
- e.forEach((m) => {
1098
- const { unitId: d, subUnitId: h, drawingId: f, drawingType: v } = m, w = this._drawingManagerService.getDrawingByParam({ unitId: d, subUnitId: h, drawingId: f });
1099
- if (w == null || w.transform == null)
1129
+ const n = [];
1130
+ let s = Number.POSITIVE_INFINITY, a = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, c = Number.NEGATIVE_INFINITY, l = 0;
1131
+ e.forEach((d) => {
1132
+ const { unitId: u, subUnitId: h, drawingId: f, drawingType: w } = d, v = this._drawingManagerService.getDrawingByParam({ unitId: u, subUnitId: h, drawingId: f });
1133
+ if (v == null || v.transform == null)
1100
1134
  return;
1101
- r.push({
1102
- unitId: d,
1135
+ n.push({
1136
+ unitId: u,
1103
1137
  subUnitId: h,
1104
1138
  drawingId: f,
1105
- drawingType: v,
1106
- transform: w.transform
1139
+ drawingType: w,
1140
+ transform: v.transform
1107
1141
  });
1108
- const { left: p = 0, top: S = 0, width: _ = 0, height: M = 0 } = w.transform;
1109
- o = Math.min(o, p), a = Math.min(a, S), s = Math.max(s, p + _), c = Math.max(c, S + M), l++;
1110
- }), l !== 0 && (this._sortDrawingTransform(r, n), this._applyAlignType(r, n, o, a, s, c, l));
1142
+ const { left: m = 0, top: C = 0, width: _ = 0, height: R = 0 } = v.transform;
1143
+ s = Math.min(s, m), a = Math.min(a, C), o = Math.max(o, m + _), c = Math.max(c, C + R), l++;
1144
+ }), l !== 0 && (this._sortDrawingTransform(n, t), this._applyAlignType(n, t, s, a, o, c, l));
1111
1145
  }
1112
- _applyAlignType(t, n, e, r, o, a, s) {
1113
- const c = Math.round((o - e) / s * 10) / 10, l = Math.round((a - r) / s * 10) / 10, m = [], d = this._getSceneAndTransformerByDrawingSearch(t[0].unitId);
1114
- if (d == null)
1146
+ _applyAlignType(r, t, e, n, s, a, o) {
1147
+ const c = Math.round((s - e) / o * 10) / 10, l = Math.round((a - n) / o * 10) / 10, d = [], u = this._getSceneAndTransformerByDrawingSearch(r[0].unitId);
1148
+ if (u == null)
1115
1149
  return;
1116
- const { scene: h, transformer: f } = d;
1117
- t.forEach((v, w) => {
1118
- const { unitId: p, subUnitId: S, drawingId: _, transform: M, drawingType: I } = v, { left: N = 0, top: P = 0, width: b = 0, height: y = 0 } = M;
1119
- let R = N, O = P;
1120
- switch (n) {
1150
+ const { scene: h, transformer: f } = u;
1151
+ r.forEach((w, v) => {
1152
+ const { unitId: m, subUnitId: C, drawingId: _, transform: R, drawingType: b } = w, { left: N = 0, top: I = 0, width: S = 0, height: y = 0 } = R;
1153
+ let M = N, O = I;
1154
+ switch (t) {
1121
1155
  case D.left:
1122
- R = e;
1156
+ M = e;
1123
1157
  break;
1124
1158
  case D.center:
1125
- R = e + (o - e) / 2 - b / 2;
1159
+ M = e + (s - e) / 2 - S / 2;
1126
1160
  break;
1127
1161
  case D.right:
1128
- R = o - b;
1162
+ M = s - S;
1129
1163
  break;
1130
1164
  case D.top:
1131
- O = r;
1165
+ O = n;
1132
1166
  break;
1133
1167
  case D.middle:
1134
- O = r + (a - r) / 2 - y / 2;
1168
+ O = n + (a - n) / 2 - y / 2;
1135
1169
  break;
1136
1170
  case D.bottom:
1137
1171
  O = a - y;
1138
1172
  break;
1139
1173
  case D.horizon:
1140
- R = e + c * w;
1174
+ M = e + c * v;
1141
1175
  break;
1142
1176
  case D.vertical:
1143
- O = r + l * w;
1177
+ O = n + l * v;
1144
1178
  break;
1145
1179
  }
1146
- (R !== N || O !== P) && m.push({
1147
- unitId: p,
1148
- subUnitId: S,
1180
+ (M !== N || O !== I) && d.push({
1181
+ unitId: m,
1182
+ subUnitId: C,
1149
1183
  drawingId: _,
1150
- drawingType: I,
1184
+ drawingType: b,
1151
1185
  transform: {
1152
- left: R,
1186
+ left: M,
1153
1187
  top: O
1154
1188
  }
1155
1189
  });
1156
- }), this._drawingManagerService.featurePluginUpdateNotification(m), f.refreshControls().changeNotification();
1190
+ }), this._drawingManagerService.featurePluginUpdateNotification(d), f.refreshControls().changeNotification();
1157
1191
  }
1158
- _sortDrawingTransform(t, n) {
1159
- t.sort((e, r) => {
1160
- const o = e.transform, a = r.transform, {
1161
- left: s = 0,
1192
+ _sortDrawingTransform(r, t) {
1193
+ r.sort((e, n) => {
1194
+ const s = e.transform, a = n.transform, {
1195
+ left: o = 0,
1162
1196
  top: c = 0,
1163
1197
  width: l = 0,
1164
- height: m = 0
1165
- } = o, {
1166
- left: d = 0,
1198
+ height: d = 0
1199
+ } = s, {
1200
+ left: u = 0,
1167
1201
  top: h = 0,
1168
1202
  width: f = 0,
1169
- height: v = 0
1203
+ height: w = 0
1170
1204
  } = a;
1171
- switch (n) {
1205
+ switch (t) {
1172
1206
  case D.left:
1173
- return s - d;
1207
+ return o - u;
1174
1208
  case D.center:
1175
- return s + l / 2 - (d + f / 2);
1209
+ return o + l / 2 - (u + f / 2);
1176
1210
  case D.right:
1177
- return s + l - (d + f);
1211
+ return o + l - (u + f);
1178
1212
  case D.top:
1179
1213
  return c - h;
1180
1214
  case D.middle:
1181
- return c + m / 2 - (h + v / 2);
1215
+ return c + d / 2 - (h + w / 2);
1182
1216
  case D.bottom:
1183
- return c + m - (h + v);
1217
+ return c + d - (h + w);
1184
1218
  case D.horizon:
1185
- return s + l / 2 - (d + f / 2);
1219
+ return o + l / 2 - (u + f / 2);
1186
1220
  case D.vertical:
1187
- return c + m / 2 - (h + v / 2);
1221
+ return c + d / 2 - (h + w / 2);
1188
1222
  default:
1189
1223
  return 0;
1190
1224
  }
@@ -1192,60 +1226,60 @@ let Ue = class extends xe {
1192
1226
  }
1193
1227
  _drawingArrangeListener() {
1194
1228
  this.disposeWithMe(
1195
- this._drawingManagerService.order$.subscribe((t) => {
1196
- this._drawingArrange(t);
1229
+ this._drawingManagerService.order$.subscribe((r) => {
1230
+ this._drawingArrange(r);
1197
1231
  })
1198
1232
  );
1199
1233
  }
1200
- _drawingArrange(t) {
1201
- const { unitId: n, subUnitId: e, drawingIds: r } = t, o = this._getSceneAndTransformerByDrawingSearch(n);
1202
- if (o == null)
1234
+ _drawingArrange(r) {
1235
+ const { unitId: t, subUnitId: e, drawingIds: n } = r, s = this._getSceneAndTransformerByDrawingSearch(t);
1236
+ if (s == null)
1203
1237
  return;
1204
- const { scene: a } = o;
1205
- r.forEach((s) => {
1206
- const c = G({ unitId: n, subUnitId: e, drawingId: s }), l = a.fuzzyMathObjects(c, !0);
1238
+ const { scene: a } = s;
1239
+ n.forEach((o) => {
1240
+ const c = W({ unitId: t, subUnitId: e, drawingId: o }), l = a.fuzzyMathObjects(c, !0);
1207
1241
  if (l == null || l.length === 0)
1208
1242
  return;
1209
- const m = this._drawingManagerService.getDrawingOrder(n, e).indexOf(s);
1210
- for (const d of l)
1211
- d.setProps({ zIndex: m }), d.makeDirty();
1243
+ const d = this._drawingManagerService.getDrawingOrder(t, e).indexOf(o);
1244
+ for (const u of l)
1245
+ u.setProps({ zIndex: d }), u.makeDirty();
1212
1246
  });
1213
1247
  }
1214
1248
  _drawingAddListener() {
1215
1249
  this.disposeWithMe(
1216
- this._drawingManagerService.add$.subscribe((t) => {
1217
- this._insertDrawing(t);
1250
+ this._drawingManagerService.add$.subscribe((r) => {
1251
+ this._insertDrawing(r);
1218
1252
  })
1219
1253
  );
1220
1254
  }
1221
- _insertDrawing(t) {
1222
- const n = [];
1223
- t.forEach((e) => {
1224
- const { unitId: r } = e;
1255
+ _insertDrawing(r) {
1256
+ const t = [];
1257
+ r.forEach((e) => {
1258
+ const { unitId: n } = e;
1225
1259
  if (this._drawingManagerService.getDrawingByParam(e) == null)
1226
1260
  return;
1227
- const a = this._getSceneAndTransformerByDrawingSearch(r);
1261
+ const a = this._getSceneAndTransformerByDrawingSearch(n);
1228
1262
  if (a == null)
1229
1263
  return;
1230
- const { scene: s } = a;
1231
- n.includes(s) || n.push(s);
1232
- }), n.forEach((e) => {
1264
+ const { scene: o } = a;
1265
+ t.includes(o) || t.push(o);
1266
+ }), t.forEach((e) => {
1233
1267
  this._sceneListenerOnDrawingMap.has(e) || (this._addListenerOnDrawing(e), this._sceneListenerOnDrawingMap.add(e));
1234
1268
  });
1235
1269
  }
1236
1270
  _drawingRemoveListener() {
1237
1271
  this.disposeWithMe(
1238
- this._drawingManagerService.remove$.subscribe((t) => {
1239
- t.forEach((n) => {
1240
- var m;
1241
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._getSceneAndTransformerByDrawingSearch(e);
1272
+ this._drawingManagerService.remove$.subscribe((r) => {
1273
+ r.forEach((t) => {
1274
+ var d;
1275
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._getSceneAndTransformerByDrawingSearch(e);
1242
1276
  if (a == null)
1243
1277
  return;
1244
- const { scene: s } = a, c = G({ unitId: e, subUnitId: r, drawingId: o }), l = s.fuzzyMathObjects(c, !0);
1278
+ const { scene: o } = a, c = W({ unitId: e, subUnitId: n, drawingId: s }), l = o.fuzzyMathObjects(c, !0);
1245
1279
  if (l.length > 0) {
1246
- for (const d of l)
1247
- d.dispose();
1248
- (m = s.getTransformer()) == null || m.clearSelectedObjects();
1280
+ for (const u of l)
1281
+ u.dispose();
1282
+ (d = o.getTransformer()) == null || d.clearSelectedObjects();
1249
1283
  }
1250
1284
  });
1251
1285
  })
@@ -1253,76 +1287,76 @@ let Ue = class extends xe {
1253
1287
  }
1254
1288
  _drawingUpdateListener() {
1255
1289
  this.disposeWithMe(
1256
- this._drawingManagerService.update$.subscribe((t) => {
1257
- t.forEach((n) => {
1258
- var b;
1259
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._drawingManagerService.getDrawingByParam(n);
1290
+ this._drawingManagerService.update$.subscribe((r) => {
1291
+ r.forEach((t) => {
1292
+ var S;
1293
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._drawingManagerService.getDrawingByParam(t);
1260
1294
  if (a == null)
1261
1295
  return;
1262
- const { transform: s, drawingType: c } = a, l = this._getSceneAndTransformerByDrawingSearch(e);
1296
+ const { transform: o, drawingType: c } = a, l = this._getSceneAndTransformerByDrawingSearch(e);
1263
1297
  if (l == null)
1264
1298
  return;
1265
- const { scene: m, transformer: d } = l;
1266
- if (s == null)
1299
+ const { scene: d, transformer: u } = l;
1300
+ if (o == null)
1267
1301
  return !0;
1268
- const { left: h = 0, top: f = 0, width: v = 0, height: w = 0, angle: p = 0, flipX: S = !1, flipY: _ = !1, skewX: M = 0, skewY: I = 0 } = s, N = G({ unitId: e, subUnitId: r, drawingId: o }), P = m.getObject(N);
1269
- if (P == null)
1302
+ const { left: h = 0, top: f = 0, width: w = 0, height: v = 0, angle: m = 0, flipX: C = !1, flipY: _ = !1, skewX: R = 0, skewY: b = 0 } = o, N = W({ unitId: e, subUnitId: n, drawingId: s }), I = d.getObject(N);
1303
+ if (I == null)
1270
1304
  return !0;
1271
- P.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX: S, flipY: _, skewX: M, skewY: I }), (b = m.getTransformer()) == null || b.debounceRefreshControls();
1305
+ I.transformByState({ left: h, top: f, width: w, height: v, angle: m, flipX: C, flipY: _, skewX: R, skewY: b }), (S = d.getTransformer()) == null || S.debounceRefreshControls();
1272
1306
  });
1273
1307
  })
1274
1308
  );
1275
1309
  }
1276
1310
  _drawingRefreshListener() {
1277
1311
  this.disposeWithMe(
1278
- this._drawingManagerService.refreshTransform$.subscribe((t) => {
1279
- t.forEach((n) => {
1280
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._getSceneAndTransformerByDrawingSearch(e);
1312
+ this._drawingManagerService.refreshTransform$.subscribe((r) => {
1313
+ r.forEach((t) => {
1314
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._getSceneAndTransformerByDrawingSearch(e);
1281
1315
  if (a == null)
1282
1316
  return;
1283
- const s = this._drawingManagerService.getDrawingByParam(n);
1284
- if (s == null)
1317
+ const o = this._drawingManagerService.getDrawingByParam(t);
1318
+ if (o == null)
1285
1319
  return;
1286
- const { transform: c } = s, { scene: l } = a, m = G({ unitId: e, subUnitId: r, drawingId: o }), d = l.getObject(m);
1287
- if (d == null || c == null)
1320
+ const { transform: c } = o, { scene: l } = a, d = W({ unitId: e, subUnitId: n, drawingId: s }), u = l.getObject(d);
1321
+ if (u == null || c == null)
1288
1322
  return !0;
1289
1323
  const {
1290
1324
  left: h = 0,
1291
1325
  top: f = 0,
1292
- width: v = 0,
1293
- height: w = 0,
1294
- angle: p = 0,
1295
- flipX: S = !1,
1326
+ width: w = 0,
1327
+ height: v = 0,
1328
+ angle: m = 0,
1329
+ flipX: C = !1,
1296
1330
  flipY: _ = !1,
1297
- skewX: M = 0,
1298
- skewY: I = 0
1331
+ skewX: R = 0,
1332
+ skewY: b = 0
1299
1333
  } = c;
1300
- d.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX: S, flipY: _, skewX: M, skewY: I });
1334
+ u.transformByState({ left: h, top: f, width: w, height: v, angle: m, flipX: C, flipY: _, skewX: R, skewY: b });
1301
1335
  });
1302
1336
  })
1303
1337
  );
1304
1338
  }
1305
1339
  _drawingVisibleListener() {
1306
1340
  this.disposeWithMe(
1307
- this._drawingManagerService.visible$.subscribe((t) => {
1308
- t.forEach((n) => {
1309
- const { unitId: e, subUnitId: r, drawingId: o, visible: a } = n, s = this._getSceneAndTransformerByDrawingSearch(e);
1310
- if (s == null)
1341
+ this._drawingManagerService.visible$.subscribe((r) => {
1342
+ r.forEach((t) => {
1343
+ const { unitId: e, subUnitId: n, drawingId: s, visible: a } = t, o = this._getSceneAndTransformerByDrawingSearch(e);
1344
+ if (o == null)
1311
1345
  return;
1312
- const { scene: c } = s, l = G({ unitId: e, subUnitId: r, drawingId: o }), m = c.getObject(l);
1313
- if (m == null)
1346
+ const { scene: c } = o, l = W({ unitId: e, subUnitId: n, drawingId: s }), d = c.getObject(l);
1347
+ if (d == null)
1314
1348
  return !0;
1315
- a ? m.show() : m.hide();
1349
+ a ? d.show() : d.hide();
1316
1350
  });
1317
1351
  })
1318
1352
  );
1319
1353
  }
1320
- _filterUpdateParams(t, n) {
1321
- return t.filter((e, r) => {
1354
+ _filterUpdateParams(r, t) {
1355
+ return r.filter((e, n) => {
1322
1356
  if (e == null)
1323
1357
  return !1;
1324
- const { transform: o } = e;
1325
- return sn(o, n == null ? void 0 : n[r]);
1358
+ const { transform: s } = e;
1359
+ return ct(s, t == null ? void 0 : t[n]);
1326
1360
  });
1327
1361
  }
1328
1362
  // group?.getObjects().forEach((o) => {
@@ -1332,52 +1366,52 @@ let Ue = class extends xe {
1332
1366
  // drawings.push({ unitId, subUnitId, drawingId });
1333
1367
  // }
1334
1368
  // });
1335
- _addListenerOnDrawing(t) {
1336
- const n = t.getTransformerByCreate();
1369
+ _addListenerOnDrawing(r) {
1370
+ const t = r.getTransformerByCreate();
1337
1371
  let e = null;
1338
1372
  this.disposeWithMe(
1339
- Ce(
1340
- n.changeStart$.subscribe((r) => {
1341
- const { objects: o } = r, a = Array.from(o.values()), s = [];
1373
+ _e(
1374
+ t.changeStart$.subscribe((n) => {
1375
+ const { objects: s } = n, a = Array.from(s.values()), o = [];
1342
1376
  e = a.map((c) => {
1343
- const { left: l, top: m, height: d, width: h, angle: f, oKey: v, isInGroup: w } = c, p = this._drawingManagerService.getDrawingOKey(v);
1344
- if (w || c instanceof we) {
1345
- let S = c.ancestorGroup;
1346
- if (S == null && c instanceof we && (S = c), S == null)
1377
+ const { left: l, top: d, height: u, width: h, angle: f, oKey: w, isInGroup: v } = c, m = this._drawingManagerService.getDrawingOKey(w);
1378
+ if (v || c instanceof Ce) {
1379
+ let C = c.ancestorGroup;
1380
+ if (C == null && c instanceof Ce && (C = c), C == null)
1347
1381
  return null;
1348
- const _ = this._drawingManagerService.getDrawingOKey(S.oKey);
1382
+ const _ = this._drawingManagerService.getDrawingOKey(C.oKey);
1349
1383
  if (_) {
1350
- const { unitId: M, subUnitId: I, drawingId: N } = _;
1351
- s.push({ unitId: M, subUnitId: I, drawingId: N });
1352
- const { left: P, top: b, height: y, width: R, angle: O } = S;
1353
- return { left: P, top: b, height: y, width: R, angle: O };
1384
+ const { unitId: R, subUnitId: b, drawingId: N } = _;
1385
+ o.push({ unitId: R, subUnitId: b, drawingId: N });
1386
+ const { left: I, top: S, height: y, width: M, angle: O } = C;
1387
+ return { left: I, top: S, height: y, width: M, angle: O };
1354
1388
  }
1355
- } else if (p != null) {
1356
- const { unitId: S, subUnitId: _, drawingId: M } = p;
1357
- return s.push({ unitId: S, subUnitId: _, drawingId: M }), { left: l, top: m, height: d, width: h, angle: f };
1389
+ } else if (m != null) {
1390
+ const { unitId: C, subUnitId: _, drawingId: R } = m;
1391
+ return o.push({ unitId: C, subUnitId: _, drawingId: R }), { left: l, top: d, height: u, width: h, angle: f };
1358
1392
  }
1359
1393
  return null;
1360
- }).filter((c) => c != null), s.length > 0 ? this._commandService.syncExecuteCommand(Ne.id, s) : this._commandService.syncExecuteCommand(Ne.id, []);
1394
+ }).filter((c) => c != null), o.length > 0 ? this._commandService.syncExecuteCommand(Te.id, o) : this._commandService.syncExecuteCommand(Te.id, []);
1361
1395
  })
1362
1396
  )
1363
1397
  ), this.disposeWithMe(
1364
- Ce(
1365
- n.changeEnd$.subscribe((r) => {
1366
- const { objects: o } = r, a = this._filterUpdateParams(ke(o, this._drawingManagerService), e);
1398
+ _e(
1399
+ t.changeEnd$.subscribe((n) => {
1400
+ const { objects: s } = n, a = this._filterUpdateParams(We(s, this._drawingManagerService), e);
1367
1401
  a.length > 0 && this._drawingManagerService.featurePluginUpdateNotification(a);
1368
1402
  })
1369
1403
  )
1370
1404
  );
1371
1405
  }
1372
1406
  };
1373
- Ue = Ht([
1374
- Re(0, Ke),
1375
- Re(1, me),
1376
- Re(2, ue),
1377
- Re(3, re)
1378
- ], Ue);
1379
- class Me extends Gn {
1380
- constructor(n, e) {
1407
+ Ae = Rr([
1408
+ Ne(0, Ze),
1409
+ Ne(1, he),
1410
+ Ne(2, me),
1411
+ Ne(3, ae)
1412
+ ], Ae);
1413
+ class De extends Wt {
1414
+ constructor(t, e) {
1381
1415
  e == null && (e = {}), e.transformerConfig = {
1382
1416
  keepRatio: !1,
1383
1417
  isCropper: !0,
@@ -1385,362 +1419,362 @@ class Me extends Gn {
1385
1419
  anchorStroke: "rgb(255, 255, 255)",
1386
1420
  anchorSize: 24
1387
1421
  };
1388
- super(n, e);
1389
- ee(this, "_srcRect");
1390
- ee(this, "_prstGeom");
1391
- ee(this, "_applyTransform");
1392
- ee(this, "_dragPadding", 8);
1393
- ee(this, "_cacheCanvas");
1422
+ super(t, e);
1423
+ te(this, "_srcRect");
1424
+ te(this, "_prstGeom");
1425
+ te(this, "_applyTransform");
1426
+ te(this, "_dragPadding", 8);
1427
+ te(this, "_cacheCanvas");
1394
1428
  e != null && e.srcRect && (this._srcRect = e.srcRect), e != null && e.prstGeom && (this._prstGeom = e.prstGeom), e != null && e.applyTransform && (this._applyTransform = e.applyTransform), e != null && e.dragPadding && (this._dragPadding = e.dragPadding), this._applyProps();
1395
1429
  }
1396
- refreshSrcRect(n, e) {
1397
- this._srcRect = n, this._applyTransform = e, this._applyProps();
1430
+ refreshSrcRect(t, e) {
1431
+ this._srcRect = t, this._applyTransform = e, this._applyProps();
1398
1432
  }
1399
1433
  get srcRect() {
1400
1434
  return this._srcRect;
1401
1435
  }
1402
1436
  dispose() {
1403
- var n;
1404
- super.dispose(), (n = this._cacheCanvas) == null || n.dispose(), this._srcRect = null;
1437
+ var t;
1438
+ super.dispose(), (t = this._cacheCanvas) == null || t.dispose(), this._srcRect = null;
1405
1439
  }
1406
- isHit(n) {
1407
- const e = this.getInverseCoord(n);
1440
+ isHit(t) {
1441
+ const e = this.getInverseCoord(t);
1408
1442
  return e.x >= -this.strokeWidth / 2 && e.x <= this.width + this.strokeWidth / 2 && e.y >= -this.strokeWidth / 2 && e.y <= this.height + this.strokeWidth / 2 && !this._inSurround(e);
1409
1443
  }
1410
- _inSurround(n) {
1444
+ _inSurround(t) {
1411
1445
  const e = this._dragPadding;
1412
- return n.x >= e - this.strokeWidth / 2 && n.x <= this.width + this.strokeWidth / 2 - e && n.y >= e - this.strokeWidth / 2 && n.y <= this.height + this.strokeWidth / 2 - e;
1446
+ return t.x >= e - this.strokeWidth / 2 && t.x <= this.width + this.strokeWidth / 2 - e && t.y >= e - this.strokeWidth / 2 && t.y <= this.height + this.strokeWidth / 2 - e;
1413
1447
  }
1414
- render(n, e) {
1415
- return this.visible ? (n.save(), this._draw(n), n.restore(), this.makeDirty(!1), this) : (this.makeDirty(!1), this);
1448
+ render(t, e) {
1449
+ return this.visible ? (t.save(), this._draw(t), t.restore(), this.makeDirty(!1), this) : (this.makeDirty(!1), this);
1416
1450
  }
1417
- _draw(n) {
1451
+ _draw(t) {
1418
1452
  var c, l;
1419
- const r = this.getScene().getEngine(), { width: o, height: a } = r;
1453
+ const n = this.getScene().getEngine(), { width: s, height: a } = n;
1420
1454
  this._initialCacheCanvas(), (c = this._cacheCanvas) == null || c.clear();
1421
- const s = (l = this._cacheCanvas) == null ? void 0 : l.getContext();
1422
- s != null && (s.save(), ln.drawWith(s, {
1455
+ const o = (l = this._cacheCanvas) == null ? void 0 : l.getContext();
1456
+ o != null && (o.save(), dt.drawWith(o, {
1423
1457
  left: 0,
1424
1458
  top: 0,
1425
- width: o,
1459
+ width: s,
1426
1460
  height: a,
1427
1461
  fill: "rgba(0, 0, 0, 0.5)"
1428
- }), s.setTransform(n.getTransform()), this._clipForApplyObject(s), this._applyCache(n), s.restore());
1462
+ }), o.setTransform(t.getTransform()), this._clipForApplyObject(o), this._applyCache(t), o.restore());
1429
1463
  }
1430
- _clipForApplyObject(n) {
1464
+ _clipForApplyObject(t) {
1431
1465
  let e = 0;
1432
- if (this._prstGeom != null && (e = 1), n.globalCompositeOperation = "destination-out", n.beginPath(), e === 0) {
1433
- const r = this.transform.getMatrix();
1434
- n.transform(r[0], r[1], r[2], r[3], r[4], r[5]), n.rect(0, 0, this.width, this.height), n.fill();
1466
+ if (this._prstGeom != null && (e = 1), t.globalCompositeOperation = "destination-out", t.beginPath(), e === 0) {
1467
+ const n = this.transform.getMatrix();
1468
+ t.transform(n[0], n[1], n[2], n[3], n[4], n[5]), t.rect(0, 0, this.width, this.height), t.fill();
1435
1469
  }
1436
1470
  }
1437
1471
  _applyProps() {
1438
1472
  if (this._applyTransform == null)
1439
1473
  return;
1440
- let n = 0, e = 0, r = 0, o = 0;
1441
- const { left: a = 0, top: s = 0, width: c = 0, height: l = 0, angle: m } = this._applyTransform;
1474
+ let t = 0, e = 0, n = 0, s = 0;
1475
+ const { left: a = 0, top: o = 0, width: c = 0, height: l = 0, angle: d } = this._applyTransform;
1442
1476
  if (this._srcRect != null) {
1443
- const { left: f = 0, top: v = 0, right: w = 0, bottom: p = 0 } = this._srcRect;
1444
- n = f, e = v, r = w, o = p;
1477
+ const { left: f = 0, top: w = 0, right: v = 0, bottom: m = 0 } = this._srcRect;
1478
+ t = f, e = w, n = v, s = m;
1445
1479
  }
1446
- const d = a + n, h = s + e;
1480
+ const u = a + t, h = o + e;
1447
1481
  this.transformByState({
1448
- left: d,
1482
+ left: u,
1449
1483
  top: h,
1450
- width: a + c - r - d,
1451
- height: s + l - o - h,
1452
- angle: m
1484
+ width: a + c - n - u,
1485
+ height: o + l - s - h,
1486
+ angle: d
1453
1487
  });
1454
1488
  }
1455
- _applyCache(n) {
1456
- if (!n || this._cacheCanvas == null)
1489
+ _applyCache(t) {
1490
+ if (!t || this._cacheCanvas == null)
1457
1491
  return;
1458
1492
  const e = this._cacheCanvas.getContext();
1459
- e.save(), n.save(), n.setTransform(1, 0, 0, 1, 0, 0), e.setTransform(1, 0, 0, 1, 0, 0), n.drawImage(this._cacheCanvas.getCanvasEle(), 0, 0), n.restore(), e.restore();
1493
+ e.save(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0), e.setTransform(1, 0, 0, 1, 0, 0), t.drawImage(this._cacheCanvas.getCanvasEle(), 0, 0), t.restore(), e.restore();
1460
1494
  }
1461
1495
  _initialCacheCanvas() {
1462
1496
  if (this._cacheCanvas != null)
1463
1497
  return;
1464
- const n = this.getScene();
1465
- if (n == null) return;
1466
- this._cacheCanvas = new Wn();
1467
- const e = n.getEngine();
1498
+ const t = this.getScene();
1499
+ if (t == null) return;
1500
+ this._cacheCanvas = new Gt();
1501
+ const e = t.getEngine();
1468
1502
  this._cacheCanvas.setSize(e.width, e.height), e.onTransformChange$.subscribeEvent(() => {
1469
- var r;
1470
- (r = this._cacheCanvas) == null || r.setSize(e.width, e.height), this.makeDirty(!0);
1503
+ var n;
1504
+ (n = this._cacheCanvas) == null || n.setSize(e.width, e.height), this.makeDirty(!0);
1471
1505
  });
1472
1506
  }
1473
1507
  }
1474
- var Lt = Object.getOwnPropertyDescriptor, xt = (i, t, n, e) => {
1475
- for (var r = e > 1 ? void 0 : e ? Lt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
1476
- (a = i[o]) && (r = a(r) || r);
1477
- return r;
1478
- }, de = (i, t) => (n, e) => t(n, e, i);
1479
- let Ae = class extends xe {
1480
- constructor(t, n, e, r, o, a) {
1508
+ var Or = Object.getOwnPropertyDescriptor, Nr = (i, r, t, e) => {
1509
+ for (var n = e > 1 ? void 0 : e ? Or(r, t) : r, s = i.length - 1, a; s >= 0; s--)
1510
+ (a = i[s]) && (n = a(n) || n);
1511
+ return n;
1512
+ }, fe = (i, r) => (t, e) => r(t, e, i);
1513
+ let He = class extends Ve {
1514
+ constructor(r, t, e, n, s, a) {
1481
1515
  super();
1482
- ee(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
1483
- this._commandService = t, this._drawingManagerService = n, this._renderManagerService = e, this._univerInstanceService = r, this._messageService = o, this._localeService = a, this._init();
1516
+ te(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
1517
+ this._commandService = r, this._drawingManagerService = t, this._renderManagerService = e, this._univerInstanceService = n, this._messageService = s, this._localeService = a, this._init();
1484
1518
  }
1485
1519
  _init() {
1486
1520
  this._initOpenCrop(), this._initCloseCrop(), this._initAutoCrop();
1487
1521
  }
1488
1522
  _initAutoCrop() {
1489
1523
  this.disposeWithMe(
1490
- this._commandService.onCommandExecuted((t) => {
1491
- if (t.id !== Be.id)
1524
+ this._commandService.onCommandExecuted((r) => {
1525
+ if (r.id !== Ue.id)
1492
1526
  return;
1493
- const n = t.params;
1494
- if (n == null)
1527
+ const t = r.params;
1528
+ if (t == null)
1495
1529
  return;
1496
- const { cropType: e } = n, r = this._drawingManagerService.getFocusDrawings();
1497
- if (r.length !== 1)
1530
+ const { cropType: e } = t, n = this._drawingManagerService.getFocusDrawings();
1531
+ if (n.length !== 1)
1498
1532
  return;
1499
- const o = r[0], { unitId: a, subUnitId: s, drawingId: c } = o, l = this._renderManagerService.getRenderById(a), m = l == null ? void 0 : l.scene;
1500
- if (m == null)
1533
+ const s = n[0], { unitId: a, subUnitId: o, drawingId: c } = s, l = this._renderManagerService.getRenderById(a), d = l == null ? void 0 : l.scene;
1534
+ if (d == null)
1501
1535
  return !0;
1502
- this._searchCropObject(m) != null && this._commandService.syncExecuteCommand(ge.id, { isAuto: !0 });
1503
- const h = G({ unitId: a, subUnitId: s, drawingId: c }), f = m.getObject(h);
1504
- if (!(f instanceof ze)) {
1536
+ this._searchCropObject(d) != null && this._commandService.syncExecuteCommand(ge.id, { isAuto: !0 });
1537
+ const h = W({ unitId: a, subUnitId: o, drawingId: c }), f = d.getObject(h);
1538
+ if (!(f instanceof Ke)) {
1505
1539
  this._messageService.show({
1506
- type: Qe.Error,
1540
+ type: tt.Error,
1507
1541
  content: this._localeService.t("image-cropper.error")
1508
1542
  });
1509
1543
  return;
1510
1544
  }
1511
- f != null && (this._updateCropperObject(e, f), this._commandService.executeCommand(Fe.id, { unitId: a, subUnitId: s, drawingId: c }));
1545
+ f != null && (this._updateCropperObject(e, f), this._commandService.executeCommand(Ye.id, { unitId: a, subUnitId: o, drawingId: c }));
1512
1546
  })
1513
1547
  );
1514
1548
  }
1515
- _calculateSrcRectByRatio(t, n, e, r, o, a) {
1516
- const s = e / r, c = o / a;
1517
- let l = e, m = r;
1518
- s > c ? l = r * c : m = e / c;
1519
- const d = (e - l) / 2, h = (r - m) / 2;
1549
+ _calculateSrcRectByRatio(r, t, e, n, s, a) {
1550
+ const o = e / n, c = s / a;
1551
+ let l = e, d = n;
1552
+ o > c ? l = n * c : d = e / c;
1553
+ const u = (e - l) / 2, h = (n - d) / 2;
1520
1554
  return {
1521
- left: ye(d, 1),
1522
- top: ye(h, 1),
1523
- right: ye(e - (d + l), 1),
1524
- bottom: ye(r - (h + m), 1)
1555
+ left: Re(u, 1),
1556
+ top: Re(h, 1),
1557
+ right: Re(e - (u + l), 1),
1558
+ bottom: Re(n - (h + d), 1)
1525
1559
  };
1526
1560
  }
1527
- _updateCropperObject(t, n) {
1528
- const { left: e, top: r, width: o, height: a } = n.calculateTransformWithSrcRect();
1529
- let s;
1530
- switch (t) {
1531
- case A.R1_1:
1532
- s = this._calculateSrcRectByRatio(e, r, o, a, 1, 1);
1561
+ _updateCropperObject(r, t) {
1562
+ const { left: e, top: n, width: s, height: a } = t.calculateTransformWithSrcRect();
1563
+ let o;
1564
+ switch (r) {
1565
+ case x.R1_1:
1566
+ o = this._calculateSrcRectByRatio(e, n, s, a, 1, 1);
1533
1567
  break;
1534
- case A.R16_9:
1535
- s = this._calculateSrcRectByRatio(e, r, o, a, 16, 9);
1568
+ case x.R16_9:
1569
+ o = this._calculateSrcRectByRatio(e, n, s, a, 16, 9);
1536
1570
  break;
1537
- case A.R9_16:
1538
- s = this._calculateSrcRectByRatio(e, r, o, a, 9, 16);
1571
+ case x.R9_16:
1572
+ o = this._calculateSrcRectByRatio(e, n, s, a, 9, 16);
1539
1573
  break;
1540
- case A.R5_4:
1541
- s = this._calculateSrcRectByRatio(e, r, o, a, 5, 4);
1574
+ case x.R5_4:
1575
+ o = this._calculateSrcRectByRatio(e, n, s, a, 5, 4);
1542
1576
  break;
1543
- case A.R4_5:
1544
- s = this._calculateSrcRectByRatio(e, r, o, a, 4, 5);
1577
+ case x.R4_5:
1578
+ o = this._calculateSrcRectByRatio(e, n, s, a, 4, 5);
1545
1579
  break;
1546
- case A.R4_3:
1547
- s = this._calculateSrcRectByRatio(e, r, o, a, 4, 3);
1580
+ case x.R4_3:
1581
+ o = this._calculateSrcRectByRatio(e, n, s, a, 4, 3);
1548
1582
  break;
1549
- case A.R3_4:
1550
- s = this._calculateSrcRectByRatio(e, r, o, a, 3, 4);
1583
+ case x.R3_4:
1584
+ o = this._calculateSrcRectByRatio(e, n, s, a, 3, 4);
1551
1585
  break;
1552
- case A.R3_2:
1553
- s = this._calculateSrcRectByRatio(e, r, o, a, 3, 2);
1586
+ case x.R3_2:
1587
+ o = this._calculateSrcRectByRatio(e, n, s, a, 3, 2);
1554
1588
  break;
1555
- case A.R2_3:
1556
- s = this._calculateSrcRectByRatio(e, r, o, a, 2, 3);
1589
+ case x.R2_3:
1590
+ o = this._calculateSrcRectByRatio(e, n, s, a, 2, 3);
1557
1591
  break;
1558
- case A.FREE:
1592
+ case x.FREE:
1559
1593
  }
1560
- if (s == null)
1594
+ if (o == null)
1561
1595
  return;
1562
- n.setSrcRect(s);
1563
- const { left: c = 0, top: l = 0, bottom: m = 0, right: d = 0 } = s;
1564
- n.transformByStateCloseCropper({
1596
+ t.setSrcRect(o);
1597
+ const { left: c = 0, top: l = 0, bottom: d = 0, right: u = 0 } = o;
1598
+ t.transformByStateCloseCropper({
1565
1599
  left: e + c,
1566
- top: r + l,
1567
- width: o - d - c,
1568
- height: a - m - l
1600
+ top: n + l,
1601
+ width: s - u - c,
1602
+ height: a - d - l
1569
1603
  });
1570
1604
  }
1571
1605
  _initOpenCrop() {
1572
1606
  this.disposeWithMe(
1573
- this._commandService.onCommandExecuted((t) => {
1574
- if (t.id !== Fe.id)
1607
+ this._commandService.onCommandExecuted((r) => {
1608
+ if (r.id !== Ye.id)
1575
1609
  return;
1576
- const n = t.params;
1577
- if (n == null)
1610
+ const t = r.params;
1611
+ if (t == null)
1578
1612
  return;
1579
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._renderManagerService.getRenderById(e), s = a == null ? void 0 : a.scene;
1580
- if (s == null)
1613
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._renderManagerService.getRenderById(e), o = a == null ? void 0 : a.scene;
1614
+ if (o == null)
1581
1615
  return !0;
1582
- if (this._sceneListenerOnImageMap.has(s) || (this._addListenerOnImage(s), this._sceneListenerOnImageMap.add(s)), this._drawingManagerService.getDrawingByParam({ unitId: e, subUnitId: r, drawingId: o }) == null)
1616
+ if (this._sceneListenerOnImageMap.has(o) || (this._addListenerOnImage(o), this._sceneListenerOnImageMap.add(o)), this._drawingManagerService.getDrawingByParam({ unitId: e, subUnitId: n, drawingId: s }) == null)
1583
1617
  return;
1584
- const l = G({ unitId: e, subUnitId: r, drawingId: o }), m = s.getObject(l);
1585
- if (m == null)
1618
+ const l = W({ unitId: e, subUnitId: n, drawingId: s }), d = o.getObject(l);
1619
+ if (d == null)
1586
1620
  return;
1587
- if (!(m instanceof ze)) {
1621
+ if (!(d instanceof Ke)) {
1588
1622
  this._messageService.show({
1589
- type: Qe.Error,
1623
+ type: tt.Error,
1590
1624
  content: this._localeService.t("image-cropper.error")
1591
1625
  });
1592
1626
  return;
1593
1627
  }
1594
- const d = s.getTransformer();
1595
- d == null || d.clearControls();
1596
- const h = new Me(`${l}-crop`, {
1597
- srcRect: m.srcRect,
1598
- prstGeom: m.prstGeom,
1599
- applyTransform: m.calculateTransformWithSrcRect()
1628
+ const u = o.getTransformer();
1629
+ u == null || u.clearControls();
1630
+ const h = new De(`${l}-crop`, {
1631
+ srcRect: d.srcRect,
1632
+ prstGeom: d.prstGeom,
1633
+ applyTransform: d.calculateTransformWithSrcRect()
1600
1634
  });
1601
- s.addObject(h, m.getLayerIndex() + 1).attachTransformerTo(h), d == null || d.createControlForCopper(h), this._addHoverForImageCopper(h), m.openRenderByCropper(), d == null || d.refreshControls(), h.makeDirty(!0), this._commandService.syncExecuteCommand(Ne.id, [{ unitId: e, subUnitId: r, drawingId: o }]);
1635
+ o.addObject(h, d.getLayerIndex() + 1).attachTransformerTo(h), u == null || u.createControlForCopper(h), this._addHoverForImageCopper(h), d.openRenderByCropper(), u == null || u.refreshControls(), h.makeDirty(!0), this._commandService.syncExecuteCommand(Te.id, [{ unitId: e, subUnitId: n, drawingId: s }]);
1602
1636
  })
1603
1637
  );
1604
1638
  }
1605
- _searchCropObject(t) {
1606
- const n = t.getAllObjectsByOrder();
1607
- for (const e of n)
1608
- if (e instanceof Me)
1639
+ _searchCropObject(r) {
1640
+ const t = r.getAllObjectsByOrder();
1641
+ for (const e of t)
1642
+ if (e instanceof De)
1609
1643
  return e;
1610
1644
  }
1611
1645
  _initCloseCrop() {
1612
1646
  this.disposeWithMe(
1613
- this._commandService.onCommandExecuted((n) => {
1614
- if (n.id !== ge.id)
1647
+ this._commandService.onCommandExecuted((t) => {
1648
+ if (t.id !== ge.id)
1615
1649
  return;
1616
1650
  const e = this._univerInstanceService.getFocusedUnit();
1617
1651
  if (e == null)
1618
1652
  return;
1619
- const r = e.getUnitId(), o = this._renderManagerService.getRenderById(r), a = o == null ? void 0 : o.scene;
1653
+ const n = e.getUnitId(), s = this._renderManagerService.getRenderById(n), a = s == null ? void 0 : s.scene;
1620
1654
  if (a == null)
1621
1655
  return !0;
1622
- const s = this._searchCropObject(a);
1623
- if (s == null)
1656
+ const o = this._searchCropObject(a);
1657
+ if (o == null)
1624
1658
  return;
1625
- const c = this._getApplyObjectByCropObject(s);
1659
+ const c = this._getApplyObjectByCropObject(o);
1626
1660
  if (c == null)
1627
1661
  return;
1628
1662
  const l = a.getTransformerByCreate();
1629
- l.detachFrom(s), l.clearCopperControl();
1630
- const m = this._getSrcRectByTransformState(c, s), d = this._drawingManagerService.getDrawingOKey(c.oKey);
1631
- if (d != null) {
1632
- const { left: h, top: f, height: v, width: w } = s;
1663
+ l.detachFrom(o), l.clearCopperControl();
1664
+ const d = this._getSrcRectByTransformState(c, o), u = this._drawingManagerService.getDrawingOKey(c.oKey);
1665
+ if (u != null) {
1666
+ const { left: h, top: f, height: w, width: v } = o;
1633
1667
  this._drawingManagerService.featurePluginUpdateNotification([{
1634
- ...d,
1668
+ ...u,
1635
1669
  transform: {
1636
- ...d.transform,
1670
+ ...u.transform,
1637
1671
  left: h,
1638
1672
  top: f,
1639
- height: v,
1640
- width: w
1673
+ height: w,
1674
+ width: v
1641
1675
  },
1642
- srcRect: m.srcRectAngle
1676
+ srcRect: d.srcRectAngle
1643
1677
  }]);
1644
1678
  }
1645
- c.setSrcRect({ ...m.srcRectAngle }), c.closeRenderByCropper(), c.makeDirty(!0), s == null || s.dispose();
1679
+ c.setSrcRect({ ...d.srcRectAngle }), c.closeRenderByCropper(), c.makeDirty(!0), o == null || o.dispose();
1646
1680
  })
1647
1681
  );
1648
- const t = this._univerInstanceService.getCurrentTypeOfUnit$(Oe.UNIVER_SHEET).pipe(
1649
- Zn((n) => n ? n.activeSheet$ : Xn(null))
1682
+ const r = this._univerInstanceService.getCurrentTypeOfUnit$(Ee.UNIVER_SHEET).pipe(
1683
+ Zt((t) => t ? t.activeSheet$ : Xt(null))
1650
1684
  );
1651
- this.disposeWithMe(t.subscribe(() => {
1685
+ this.disposeWithMe(r.subscribe(() => {
1652
1686
  this._commandService.syncExecuteCommand(ge.id);
1653
1687
  }));
1654
1688
  }
1655
- _getApplyObjectByCropObject(t) {
1656
- const n = t.oKey, e = n.slice(0, n.length - 5), r = t.getScene();
1657
- if (!r) return null;
1658
- const o = r.getObject(e);
1659
- return o == null ? null : o;
1689
+ _getApplyObjectByCropObject(r) {
1690
+ const t = r.oKey, e = t.slice(0, t.length - 5), n = r.getScene();
1691
+ if (!n) return null;
1692
+ const s = n.getObject(e);
1693
+ return s == null ? null : s;
1660
1694
  }
1661
- _addListenerOnImage(t) {
1662
- const n = t.getTransformerByCreate();
1695
+ _addListenerOnImage(r) {
1696
+ const t = r.getTransformerByCreate();
1663
1697
  let e = null;
1664
1698
  this.disposeWithMe(
1665
- n.changeStart$.subscribe((r) => {
1666
- const { objects: o } = r, a = o.values().next().value;
1667
- if (a == null || !(a instanceof Me))
1699
+ t.changeStart$.subscribe((n) => {
1700
+ const { objects: s } = n, a = s.values().next().value;
1701
+ if (a == null || !(a instanceof De))
1668
1702
  return;
1669
- const { left: s, top: c, height: l, width: m, angle: d } = a;
1670
- e = { left: s, top: c, height: l, width: m, angle: d }, n.clearCopperControl();
1703
+ const { left: o, top: c, height: l, width: d, angle: u } = a;
1704
+ e = { left: o, top: c, height: l, width: d, angle: u }, t.clearCopperControl();
1671
1705
  })
1672
1706
  ), this.disposeWithMe(
1673
- n.changeEnd$.subscribe((r) => {
1674
- const { objects: o } = r, a = o.values().next().value;
1675
- if (a == null || !(a instanceof Me))
1707
+ t.changeEnd$.subscribe((n) => {
1708
+ const { objects: s } = n, a = s.values().next().value;
1709
+ if (a == null || !(a instanceof De))
1676
1710
  return;
1677
- const { left: s, top: c, height: l, width: m, angle: d } = a;
1678
- if (!sn({ left: s, top: c, height: l, width: m, angle: d }, e))
1711
+ const { left: o, top: c, height: l, width: d, angle: u } = a;
1712
+ if (!ct({ left: o, top: c, height: l, width: d, angle: u }, e))
1679
1713
  return;
1680
1714
  const h = this._getApplyObjectByCropObject(a);
1681
1715
  if (h == null)
1682
1716
  return;
1683
1717
  const f = this._getSrcRectByTransformState(h, a);
1684
- a.refreshSrcRect(f.srcRect, h.getState()), n.createControlForCopper(a);
1718
+ a.refreshSrcRect(f.srcRect, h.getState()), t.createControlForCopper(a);
1685
1719
  })
1686
- ), this._endCropListener(t);
1720
+ ), this._endCropListener(r);
1687
1721
  }
1688
- _addHoverForImageCopper(t) {
1722
+ _addHoverForImageCopper(r) {
1689
1723
  this.disposeWithMe(
1690
- t.onPointerEnter$.subscribeEvent(() => {
1691
- t.cursor = Te.MOVE;
1724
+ r.onPointerEnter$.subscribeEvent(() => {
1725
+ r.cursor = je.MOVE;
1692
1726
  })
1693
1727
  ), this.disposeWithMe(
1694
- t.onPointerLeave$.subscribeEvent(() => {
1695
- t.cursor = Te.DEFAULT;
1728
+ r.onPointerLeave$.subscribeEvent(() => {
1729
+ r.cursor = je.DEFAULT;
1696
1730
  })
1697
1731
  );
1698
1732
  }
1699
- _endCropListener(t) {
1700
- const n = t.getTransformerByCreate();
1733
+ _endCropListener(r) {
1734
+ const t = r.getTransformerByCreate();
1701
1735
  this.disposeWithMe(
1702
- n.clearControl$.subscribe((e) => {
1736
+ t.clearControl$.subscribe((e) => {
1703
1737
  e === !0 && this._commandService.syncExecuteCommand(ge.id);
1704
1738
  })
1705
1739
  );
1706
1740
  }
1707
- _getSrcRectByTransformState(t, n) {
1708
- const { left: e, top: r, height: o, width: a, strokeWidth: s, angle: c } = n, { left: l, top: m, width: d, height: h, angle: f, strokeWidth: v } = t, w = e - l, p = r - m, S = {
1709
- left: w,
1710
- top: p,
1711
- right: d - w - a,
1712
- bottom: h - p - o
1713
- }, _ = { ...S };
1741
+ _getSrcRectByTransformState(r, t) {
1742
+ const { left: e, top: n, height: s, width: a, strokeWidth: o, angle: c } = t, { left: l, top: d, width: u, height: h, angle: f, strokeWidth: w } = r, v = e - l, m = n - d, C = {
1743
+ left: v,
1744
+ top: m,
1745
+ right: u - v - a,
1746
+ bottom: h - m - s
1747
+ }, _ = { ...C };
1714
1748
  if (f !== 0) {
1715
- const M = e + a / 2, I = r + o / 2, N = new Ge(M, I), P = d / 2 + l, b = h / 2 + m, y = new Ge(P, b), R = new Ge(l, m);
1716
- R.rotateByPoint(qe(f), y);
1717
- const O = R.clone();
1718
- O.rotateByPoint(qe(-f), N);
1719
- const U = e - O.x, T = r - O.y;
1720
- _.left = U, _.top = T, _.right = d - U - a, _.bottom = h - T - o;
1749
+ const R = e + a / 2, b = n + s / 2, N = new $e(R, b), I = u / 2 + l, S = h / 2 + d, y = new $e(I, S), M = new $e(l, d);
1750
+ M.rotateByPoint(et(f), y);
1751
+ const O = M.clone();
1752
+ O.rotateByPoint(et(-f), N);
1753
+ const j = e - O.x, E = n - O.y;
1754
+ _.left = j, _.top = E, _.right = u - j - a, _.bottom = h - E - s;
1721
1755
  }
1722
1756
  return {
1723
- srcRect: S,
1757
+ srcRect: C,
1724
1758
  srcRectAngle: _
1725
1759
  };
1726
1760
  }
1727
1761
  };
1728
- Ae = xt([
1729
- de(0, me),
1730
- de(1, re),
1731
- de(2, ue),
1732
- de(3, Ke),
1733
- de(4, zn),
1734
- de(5, Le(te))
1735
- ], Ae);
1736
- var kt = Object.getOwnPropertyDescriptor, Vt = (i, t, n, e) => {
1737
- for (var r = e > 1 ? void 0 : e ? kt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
1738
- (a = i[o]) && (r = a(r) || r);
1739
- return r;
1740
- }, ce = (i, t) => (n, e) => t(n, e, i);
1741
- let He = class extends xe {
1742
- constructor(i, t, n, e, r, o, a) {
1743
- super(), this._commandService = i, this._renderManagerService = t, this._drawingManagerService = n, this._dialogService = e, this._imageIoService = r, this._currentUniverService = o, this._drawingRenderService = a, this._initialize();
1762
+ He = Nr([
1763
+ fe(0, he),
1764
+ fe(1, ae),
1765
+ fe(2, me),
1766
+ fe(3, Ze),
1767
+ fe(4, zt),
1768
+ fe(5, ke(ie))
1769
+ ], He);
1770
+ var Dr = Object.getOwnPropertyDescriptor, Er = (i, r, t, e) => {
1771
+ for (var n = e > 1 ? void 0 : e ? Dr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
1772
+ (a = i[s]) && (n = a(n) || n);
1773
+ return n;
1774
+ }, de = (i, r) => (t, e) => r(t, e, i);
1775
+ let Le = class extends Ve {
1776
+ constructor(i, r, t, e, n, s, a) {
1777
+ super(), this._commandService = i, this._renderManagerService = r, this._drawingManagerService = t, this._dialogService = e, this._imageIoService = n, this._currentUniverService = s, this._drawingRenderService = a, this._initialize();
1744
1778
  }
1745
1779
  dispose() {
1746
1780
  super.dispose();
@@ -1751,11 +1785,11 @@ let He = class extends xe {
1751
1785
  _commandExecutedListener() {
1752
1786
  this.disposeWithMe(
1753
1787
  this._commandService.onCommandExecuted((i) => {
1754
- if (i.id === Pn.id) {
1755
- const t = i.params;
1756
- if (t == null)
1788
+ if (i.id === Rt.id) {
1789
+ const r = i.params;
1790
+ if (r == null)
1757
1791
  return;
1758
- this._resetImageSize(t);
1792
+ this._resetImageSize(r);
1759
1793
  }
1760
1794
  })
1761
1795
  );
@@ -1763,32 +1797,32 @@ let He = class extends xe {
1763
1797
  _getSceneAndTransformerByDrawingSearch(i) {
1764
1798
  if (i == null)
1765
1799
  return;
1766
- const t = this._renderManagerService.getRenderById(i), n = t == null ? void 0 : t.scene;
1767
- if (n == null)
1800
+ const r = this._renderManagerService.getRenderById(i), t = r == null ? void 0 : r.scene;
1801
+ if (t == null)
1768
1802
  return null;
1769
- const e = n.getTransformerByCreate();
1770
- return { scene: n, transformer: e };
1803
+ const e = t.getTransformerByCreate();
1804
+ return { scene: t, transformer: e };
1771
1805
  }
1772
1806
  _resetImageSize(i) {
1773
- const t = [], n = [];
1807
+ const r = [], t = [];
1774
1808
  i.forEach((e) => {
1775
- const { unitId: r, subUnitId: o, drawingId: a } = e, s = this._getSceneAndTransformerByDrawingSearch(r);
1776
- if (s == null)
1809
+ const { unitId: n, subUnitId: s, drawingId: a } = e, o = this._getSceneAndTransformerByDrawingSearch(n);
1810
+ if (o == null)
1777
1811
  return;
1778
- const { scene: c } = s, l = G({ unitId: r, subUnitId: o, drawingId: a }), m = c.getObject(l);
1779
- if (m == null)
1780
- return !0;
1781
- const d = this._drawingManagerService.getDrawingByParam(e);
1812
+ const { scene: c } = o, l = W({ unitId: n, subUnitId: s, drawingId: a }), d = c.getObject(l);
1782
1813
  if (d == null)
1783
1814
  return !0;
1784
- if (d.drawingType !== ne.DRAWING_IMAGE)
1815
+ const u = this._drawingManagerService.getDrawingByParam(e);
1816
+ if (u == null)
1817
+ return !0;
1818
+ if (u.drawingType !== re.DRAWING_IMAGE)
1785
1819
  return;
1786
- m.resetSize();
1787
- const { width: h, height: f } = m.getNativeSize();
1788
- n.includes(c) === !1 && n.push(c), t.push({
1789
- ...d,
1820
+ d.resetSize();
1821
+ const { width: h, height: f } = d.getNativeSize();
1822
+ t.includes(c) === !1 && t.push(c), r.push({
1823
+ ...u,
1790
1824
  transform: {
1791
- ...d.transform,
1825
+ ...u.transform,
1792
1826
  height: f,
1793
1827
  width: h,
1794
1828
  angle: 0
@@ -1796,9 +1830,9 @@ let He = class extends xe {
1796
1830
  srcRect: null,
1797
1831
  prstGeom: null
1798
1832
  });
1799
- }), this._drawingManagerService.featurePluginUpdateNotification(t), n.forEach((e) => {
1833
+ }), this._drawingManagerService.featurePluginUpdateNotification(r), t.forEach((e) => {
1800
1834
  e.getTransformerByCreate().refreshControls().changeNotification();
1801
- }), this._commandService.syncExecuteCommand(Ne.id, i);
1835
+ }), this._commandService.syncExecuteCommand(Te.id, i);
1802
1836
  }
1803
1837
  _drawingAddListener() {
1804
1838
  this.disposeWithMe(
@@ -1808,127 +1842,127 @@ let He = class extends xe {
1808
1842
  );
1809
1843
  }
1810
1844
  _insertImages(i) {
1811
- i.forEach(async (t) => {
1845
+ i.forEach(async (r) => {
1812
1846
  var c;
1813
- const { unitId: n, subUnitId: e } = t, r = this._getSceneAndTransformerByDrawingSearch(n), o = (c = un(this._currentUniverService, n)) == null ? void 0 : c.subUnitId;
1814
- if (r == null || o !== e)
1847
+ const { unitId: t, subUnitId: e } = r, n = this._getSceneAndTransformerByDrawingSearch(t), s = (c = ft(this._currentUniverService, t)) == null ? void 0 : c.subUnitId;
1848
+ if (n == null || s !== e)
1815
1849
  return;
1816
- const a = this._drawingManagerService.getDrawingByParam(t);
1850
+ const a = this._drawingManagerService.getDrawingByParam(r);
1817
1851
  if (a == null)
1818
1852
  return;
1819
- const s = await this._drawingRenderService.renderImages(a, r.scene);
1820
- if (this._drawingManagerService.refreshTransform([a]), !(s == null || s.length === 0))
1821
- for (const l of s)
1853
+ const o = await this._drawingRenderService.renderImages(a, n.scene);
1854
+ if (this._drawingManagerService.refreshTransform([a]), !(o == null || o.length === 0))
1855
+ for (const l of o)
1822
1856
  this._addHoverForImage(l), this._addDialogForImage(l);
1823
1857
  });
1824
1858
  }
1825
1859
  _imageUpdateListener() {
1826
1860
  this.disposeWithMe(
1827
1861
  this._drawingManagerService.update$.subscribe((i) => {
1828
- i.forEach((t) => {
1829
- const { unitId: n, subUnitId: e, drawingId: r } = t, o = this._drawingManagerService.getDrawingByParam(t);
1830
- if (o == null)
1862
+ i.forEach((r) => {
1863
+ const { unitId: t, subUnitId: e, drawingId: n } = r, s = this._drawingManagerService.getDrawingByParam(r);
1864
+ if (s == null)
1831
1865
  return;
1832
- const { transform: a, drawingType: s, srcRect: c, prstGeom: l, source: m, imageSourceType: d } = o;
1833
- if (s !== ne.DRAWING_IMAGE)
1866
+ const { transform: a, drawingType: o, srcRect: c, prstGeom: l, source: d, imageSourceType: u } = s;
1867
+ if (o !== re.DRAWING_IMAGE)
1834
1868
  return;
1835
- const h = this._getSceneAndTransformerByDrawingSearch(n);
1869
+ const h = this._getSceneAndTransformerByDrawingSearch(t);
1836
1870
  if (h == null)
1837
1871
  return;
1838
- const { scene: f, transformer: v } = h;
1872
+ const { scene: f, transformer: w } = h;
1839
1873
  if (a == null)
1840
1874
  return !0;
1841
- const w = G({ unitId: n, subUnitId: e, drawingId: r }), p = f.getObject(w);
1842
- if (p == null)
1875
+ const v = W({ unitId: t, subUnitId: e, drawingId: n }), m = f.getObject(v);
1876
+ if (m == null)
1843
1877
  return !0;
1844
- p.setSrcRect(c), p.setPrstGeom(l), m != null && m.length > 0 && (d === Xe.BASE64 || d === Xe.URL) && p.changeSource(m);
1878
+ m.setSrcRect(c), m.setPrstGeom(l), d != null && d.length > 0 && (u === qe.BASE64 || u === qe.URL) && m.changeSource(d);
1845
1879
  });
1846
1880
  })
1847
1881
  );
1848
1882
  }
1849
1883
  _addHoverForImage(i) {
1850
1884
  this.disposeWithMe(
1851
- Ce(
1885
+ _e(
1852
1886
  i.onPointerEnter$.subscribeEvent(() => {
1853
- i.cursor = Te.GRAB;
1887
+ i.cursor = je.GRAB;
1854
1888
  })
1855
1889
  )
1856
1890
  ), this.disposeWithMe(
1857
- Ce(
1891
+ _e(
1858
1892
  i.onPointerLeave$.subscribeEvent(() => {
1859
- i.cursor = Te.DEFAULT;
1893
+ i.cursor = je.DEFAULT;
1860
1894
  })
1861
1895
  )
1862
1896
  );
1863
1897
  }
1864
1898
  _addDialogForImage(i) {
1865
1899
  this.disposeWithMe(
1866
- Ce(
1900
+ _e(
1867
1901
  i.onDblclick$.subscribeEvent(() => {
1868
- const t = `${i.oKey}-viewer-dialog`;
1869
- this._drawingRenderService.previewImage(t, i.getNative().src, i.getNativeSize().width, i.getNativeSize().height);
1902
+ const r = `${i.oKey}-viewer-dialog`;
1903
+ this._drawingRenderService.previewImage(r, i.getNative().src, i.getNativeSize().width, i.getNativeSize().height);
1870
1904
  })
1871
1905
  )
1872
1906
  );
1873
1907
  }
1874
1908
  };
1875
- He = Vt([
1876
- ce(0, me),
1877
- ce(1, ue),
1878
- ce(2, re),
1879
- ce(3, gn),
1880
- ce(4, cn),
1881
- ce(5, Ke),
1882
- ce(6, Le(Ee))
1883
- ], He);
1884
- var Gt = Object.getOwnPropertyDescriptor, Wt = (i, t, n, e) => {
1885
- for (var r = e > 1 ? void 0 : e ? Gt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
1886
- (a = i[o]) && (r = a(r) || r);
1887
- return r;
1888
- }, an = (i, t) => (n, e) => t(n, e, i);
1889
- const $t = "UNIVER_DRAWING_UI_PLUGIN";
1890
- var $e;
1891
- let on = ($e = class extends Hn {
1892
- constructor(i = tn, t, n) {
1893
- super(), this._config = i, this._injector = t, this._configService = n;
1894
- const { menu: e, ...r } = Ln(
1909
+ Le = Er([
1910
+ de(0, he),
1911
+ de(1, me),
1912
+ de(2, ae),
1913
+ de(3, ut),
1914
+ de(4, lt),
1915
+ de(5, Ze),
1916
+ de(6, ke(Be))
1917
+ ], Le);
1918
+ var Tr = Object.getOwnPropertyDescriptor, Pr = (i, r, t, e) => {
1919
+ for (var n = e > 1 ? void 0 : e ? Tr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
1920
+ (a = i[s]) && (n = a(n) || n);
1921
+ return n;
1922
+ }, st = (i, r) => (t, e) => r(t, e, i);
1923
+ const jr = "UNIVER_DRAWING_UI_PLUGIN";
1924
+ var Fe;
1925
+ let ot = (Fe = class extends At {
1926
+ constructor(i = it, r, t) {
1927
+ super(), this._config = i, this._injector = r, this._configService = t;
1928
+ const { menu: e, ...n } = Ht(
1895
1929
  {},
1896
- tn,
1930
+ it,
1897
1931
  this._config
1898
1932
  );
1899
- e && this._configService.setConfig("menu", e, { merge: !0 }), this._configService.setConfig(Et, r);
1933
+ e && this._configService.setConfig("menu", e, { merge: !0 }), this._configService.setConfig(Sr, n);
1900
1934
  }
1901
1935
  onStarting() {
1902
1936
  this._initDependencies();
1903
1937
  }
1904
1938
  onRendered() {
1905
- this._injector.get(Ue), this._injector.get(je), this._injector.get(Ae), this._injector.get(He);
1939
+ this._injector.get(Ae), this._injector.get(xe), this._injector.get(He), this._injector.get(Le);
1906
1940
  }
1907
1941
  _initDependencies() {
1908
1942
  [
1909
- [Ee],
1910
- [Ue],
1911
- [je],
1943
+ [Be],
1912
1944
  [Ae],
1913
- [He]
1914
- ].forEach((t) => this._injector.add(t));
1915
- }
1916
- }, ee($e, "pluginName", $t), $e);
1917
- on = Wt([
1918
- an(1, Le(Un)),
1919
- an(2, An)
1920
- ], on);
1945
+ [xe],
1946
+ [He],
1947
+ [Le]
1948
+ ].forEach((r) => this._injector.add(r));
1949
+ }
1950
+ }, te(Fe, "pluginName", jr), Fe);
1951
+ ot = Pr([
1952
+ st(1, ke(Ut)),
1953
+ st(2, xt)
1954
+ ], ot);
1921
1955
  export {
1922
- Be as AutoImageCropOperation,
1923
- Tt as COMPONENT_IMAGE_POPUP_MENU,
1956
+ Ue as AutoImageCropOperation,
1957
+ Cr as COMPONENT_IMAGE_POPUP_MENU,
1924
1958
  ge as CloseImageCropOperation,
1925
- er as DrawingCommonPanel,
1926
- Ee as DrawingRenderService,
1927
- Me as ImageCropperObject,
1928
- Dt as ImagePopupMenu,
1929
- Pn as ImageResetSizeOperation,
1930
- Fe as OpenImageCropOperation,
1931
- Ye as SetDrawingAlignOperation,
1932
- on as UniverDrawingUIPlugin,
1933
- ke as getUpdateParams
1959
+ $r as DrawingCommonPanel,
1960
+ Be as DrawingRenderService,
1961
+ De as ImageCropperObject,
1962
+ _r as ImagePopupMenu,
1963
+ Rt as ImageResetSizeOperation,
1964
+ Ye as OpenImageCropOperation,
1965
+ Xe as SetDrawingAlignOperation,
1966
+ ot as UniverDrawingUIPlugin,
1967
+ We as getUpdateParams
1934
1968
  };