@univerjs/docs-drawing-ui 0.5.5 → 0.6.0-alpha.0

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,37 +1,38 @@
1
- var Pt = Object.defineProperty;
2
- var Tt = (i, e, n) => e in i ? Pt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var Se = (i, e, n) => Tt(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { Disposable as Xe, UndoCommand as yt, RedoCommand as bt, IUniverInstanceService as J, ICommandService as z, JSONX as q, PositionedObjectLayoutType as k, CommandType as X, BooleanNumber as re, ObjectRelativeFromH as ee, ObjectRelativeFromV as G, Tools as Pe, TextX as In, TextXActionType as Y, toDisposable as Ae, throttle as xn, COLORS as Mt, MemoryCursor as Rt, IUndoRedoService as $n, BuildTextUtils as Nt, ArrangeTypeEnum as Je, Inject as we, LocaleService as ln, DrawingTypeEnum as Et, WrapTextType as $e, FOCUSING_COMMON_DRAWINGS as tn, IContextService as zn, UniverInstanceType as Te, Direction as ue, useDependency as pe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as At, RxDisposable as jt, SHEET_EDITOR_UNITS as Lt, LifecycleService as Bt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ut, fromEventSubject as Ft, LifecycleStages as Pn, DependentOn as kt, Injector as Ht, Plugin as Wt, merge as Gt, IConfigService as Vt } from "@univerjs/core";
5
- import { IDocDrawingService as je, UniverDocsDrawingPlugin as $t } from "@univerjs/docs-drawing";
6
- import { IDrawingManagerService as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zt, DRAWING_IMAGE_COUNT_LIMIT as Tn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as qt, getImageSize as Xt, getDrawingShapeKeyByDrawingSearch as Kt, IImageIoService as Yt, DRAWING_IMAGE_WIDTH_LIMIT as yn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as Jt } from "@univerjs/drawing";
7
- import { DrawingCommonPanel as Zt, ImageCropperObject as Qt, COMPONENT_IMAGE_POPUP_MENU as ei, OpenImageCropOperation as ni, ImageResetSizeOperation as ti, UniverDrawingUIPlugin as ii } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as Q, DocumentEditArea as Ue, Liquid as qn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ri, Rect as oi, getColor as si, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ai } from "@univerjs/engine-render";
9
- import { IMessageService as ci, ILocalFileService as di, ISidebarService as li, MenuItemType as Xn, getMenuHiddenObservable as Kn, RibbonStartGroup as gi, KeyCode as Fe, ComponentManager as mi, IMenuManagerService as ui, IShortcutService as fi, UniverUIPlugin as hi } from "@univerjs/ui";
10
- import { RichTextEditingMutation as Z, DocSkeletonManagerService as oe, DocSelectionManagerService as _n } from "@univerjs/docs";
11
- import { DocSelectionRenderService as ye, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as En, getAnchorBounding as pi, TEXT_RANGE_LAYER_INDEX as wi, getDocObject as vi, getCustomBlockIdsInSelections as Ii, docDrawingPositionToTransform as _i, DocCanvasPopManagerService as Si, IEditorService as Ci, SetDocZoomRatioOperation as Di } from "@univerjs/docs-ui";
12
- import { BehaviorSubject as Oi, debounceTime as Yn, Observable as xi, takeUntil as An, filter as jn } from "rxjs";
13
- import { MessageType as Ln, InputNumber as Be, Select as Bn, Checkbox as Pi, RadioGroup as Un, Radio as xe } from "@univerjs/design";
14
- import Ti, { forwardRef as Jn, useRef as yi, createElement as Zn, useState as ie, useEffect as Sn } from "react";
15
- const bi = "docs-drawing-ui.config", Fn = {};
16
- var Mi = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
17
- for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, o = i.length - 1, s; o >= 0; o--)
1
+ var Dt = Object.defineProperty;
2
+ var Ot = (i, e, n) => e in i ? Dt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
+ var Ce = (i, e, n) => Ot(i, typeof e != "symbol" ? e + "" : e, n);
4
+ import { Disposable as Xe, UndoCommand as Pt, RedoCommand as Tt, IUniverInstanceService as Q, ICommandService as z, JSONX as q, PositionedObjectLayoutType as H, CommandType as K, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as be, TextX as vn, TextXActionType as Z, toDisposable as Le, throttle as On, COLORS as bt, MemoryCursor as yt, IUndoRedoService as Gn, BuildTextUtils as Mt, ArrangeTypeEnum as Ze, Inject as ve, LocaleService as ln, DrawingTypeEnum as Rt, WrapTextType as $e, FOCUSING_COMMON_DRAWINGS as tn, IContextService as Vn, UniverInstanceType as ye, Direction as fe, useDependency as we, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Nt, RxDisposable as At, SHEET_EDITOR_UNITS as Et, LifecycleService as xt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Lt, fromEventSubject as Bt, LifecycleStages as Pn, DependentOn as Ut, Injector as Ft, Plugin as kt, merge as Ht, IConfigService as Wt } from "@univerjs/core";
5
+ import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Gt } from "@univerjs/docs-drawing";
6
+ import { IDrawingManagerService as Ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as Tn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as jt, getImageSize as $t, getDrawingShapeKeyByDrawingSearch as zt, IImageIoService as qt, DRAWING_IMAGE_WIDTH_LIMIT as bn, DRAWING_IMAGE_HEIGHT_LIMIT as yn, UniverDrawingPlugin as Xt } from "@univerjs/drawing";
7
+ import { DrawingCommonPanel as Kt, ImageCropperObject as Yt, COMPONENT_IMAGE_POPUP_MENU as Zt, OpenImageCropOperation as Qt, ImageResetSizeOperation as Jt, UniverDrawingUIPlugin as ei } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as ee, DocumentEditArea as ke, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ni, Rect as ti, getColor as ii, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ri } from "@univerjs/engine-render";
9
+ import { IMessageService as oi, ILocalFileService as si, ISidebarService as ai, MenuItemType as $n, getMenuHiddenObservable as zn, RibbonStartGroup as ci, KeyCode as He, ComponentManager as di, IMenuManagerService as li, IShortcutService as gi, UniverUIPlugin as mi } from "@univerjs/ui";
10
+ import { RichTextEditingMutation as J, DocSkeletonManagerService as se, DocSelectionManagerService as In } from "@univerjs/docs";
11
+ import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as An, getAnchorBounding as ui, TEXT_RANGE_LAYER_INDEX as fi, getDocObject as hi, getCustomBlockIdsInSelections as pi, docDrawingPositionToTransform as wi, DocCanvasPopManagerService as vi, IEditorService as Ii, SetDocZoomRatioOperation as _i } from "@univerjs/docs-ui";
12
+ import { BehaviorSubject as Si, debounceTime as qn, Observable as Ci, takeUntil as En, filter as xn } from "rxjs";
13
+ import { MessageType as Ln, InputNumber as Fe, Select as Bn, Checkbox as Di, RadioGroup as Un, Radio as Te } from "@univerjs/design";
14
+ import { jsxs as X, jsx as f } from "react/jsx-runtime";
15
+ import { forwardRef as Xn, useRef as Oi, createElement as Kn, useState as re, useEffect as _n } from "react";
16
+ const Pi = "docs-drawing-ui.config", Fn = {};
17
+ var Ti = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, yi = (i, e, n, t) => {
18
+ for (var r = t > 1 ? void 0 : t ? bi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
18
19
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
19
- return t && r && Mi(e, n, r), r;
20
- }, We = (i, e) => (n, t) => e(n, t, i);
21
- function Ei(i) {
20
+ return t && r && Ti(e, n, r), r;
21
+ }, Ve = (i, e) => (n, t) => e(n, t, i);
22
+ function Mi(i) {
22
23
  var t, r, o, s;
23
24
  if (q.isNoop(i) || !Array.isArray(i))
24
25
  return null;
25
- const e = i.find((a) => Array.isArray(a) && (a == null ? void 0 : a[0]) === "drawings");
26
+ const e = i.find((c) => Array.isArray(c) && (c == null ? void 0 : c[0]) === "drawings");
26
27
  if (e == null || !Array.isArray(e) || e.length < 3 || typeof e[1] == "string" && typeof e[2] != "object" || Array.isArray(e[1]) && typeof e[1][1] != "object")
27
28
  return null;
28
29
  const n = [];
29
30
  if (Array.isArray(e == null ? void 0 : e[1]))
30
- for (const a of e)
31
- Array.isArray(a) && n.push({
32
- type: (t = a == null ? void 0 : a[1]) != null && t.i ? "add" : "remove",
33
- drawingId: a == null ? void 0 : a[0],
34
- drawing: (r = a == null ? void 0 : a[1]) == null ? void 0 : r.i
31
+ for (const c of e)
32
+ Array.isArray(c) && n.push({
33
+ type: (t = c == null ? void 0 : c[1]) != null && t.i ? "add" : "remove",
34
+ drawingId: c == null ? void 0 : c[0],
35
+ drawing: (r = c == null ? void 0 : c[1]) == null ? void 0 : r.i
35
36
  });
36
37
  else
37
38
  n.push({
@@ -41,7 +42,7 @@ function Ei(i) {
41
42
  });
42
43
  return n;
43
44
  }
44
- function Ai(i) {
45
+ function Ri(i) {
45
46
  if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
46
47
  return [];
47
48
  const e = [];
@@ -66,24 +67,24 @@ let rn = class extends Xe {
66
67
  _commandExecutedListener() {
67
68
  this.disposeWithMe(
68
69
  this._commandService.beforeCommandExecuted((i) => {
69
- if (i.id !== Z.id)
70
+ if (i.id !== J.id)
70
71
  return;
71
- const e = i.params, { unitId: n, actions: t } = e, r = Ei(t);
72
+ const e = i.params, { unitId: n, actions: t } = e, r = Mi(t);
72
73
  if (r != null)
73
- for (const { type: o, drawingId: s, drawing: a } of r)
74
- o === "add" ? this._addDrawings(n, [a]) : this._removeDrawings(n, [s]);
74
+ for (const { type: o, drawingId: s, drawing: c } of r)
75
+ o === "add" ? this._addDrawings(n, [c]) : this._removeDrawings(n, [s]);
75
76
  })
76
77
  ), this.disposeWithMe(
77
78
  this._commandService.onCommandExecuted((i) => {
78
- if (i.id !== Z.id)
79
+ if (i.id !== J.id)
79
80
  return;
80
81
  const e = i.params, { unitId: n, actions: t } = e;
81
- Ai(t).length > 0 && this._updateDrawingsOrder(n);
82
+ Ri(t).length > 0 && this._updateDrawingsOrder(n);
82
83
  })
83
84
  ), this.disposeWithMe(
84
85
  this._commandService.onCommandExecuted((i) => {
85
86
  var s;
86
- if (i.id !== yt.id && i.id !== bt.id)
87
+ if (i.id !== Pt.id && i.id !== Tt.id)
87
88
  return;
88
89
  const e = (s = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : s.getUnitId(), n = this._drawingManagerService.getFocusDrawings();
89
90
  if (e == null || n.length === 0)
@@ -96,16 +97,16 @@ let rn = class extends Xe {
96
97
  );
97
98
  }
98
99
  _addDrawings(i, e) {
99
- const n = this._drawingManagerService, t = this._docDrawingService, r = this._docDrawingService.getBatchAddOp(e), { subUnitId: o, redo: s, objects: a } = r;
100
- n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.addNotification(a), t.addNotification(a);
100
+ const n = this._drawingManagerService, t = this._docDrawingService, r = this._docDrawingService.getBatchAddOp(e), { subUnitId: o, redo: s, objects: c } = r;
101
+ n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.addNotification(c), t.addNotification(c);
101
102
  }
102
103
  _removeDrawings(i, e) {
103
104
  const n = this._drawingManagerService, t = this._docDrawingService, r = this._docDrawingService.getBatchRemoveOp(e.map((d) => ({
104
105
  unitId: i,
105
106
  subUnitId: i,
106
107
  drawingId: d
107
- }))), { subUnitId: o, redo: s, objects: a } = r;
108
- n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.removeNotification(a), t.removeNotification(a);
108
+ }))), { subUnitId: o, redo: s, objects: c } = r;
109
+ n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.removeNotification(c), t.removeNotification(c);
109
110
  }
110
111
  _updateDrawingsOrder(i) {
111
112
  const e = this._univerInstanceService.getUniverDocInstance(i);
@@ -124,43 +125,43 @@ let rn = class extends Xe {
124
125
  t.orderNotification(o), r.orderNotification(o);
125
126
  }
126
127
  };
127
- rn = Ni([
128
- We(0, J),
129
- We(1, z),
130
- We(2, ve),
131
- We(3, je),
132
- We(4, Q)
128
+ rn = yi([
129
+ Ve(0, Q),
130
+ Ve(1, z),
131
+ Ve(2, Ie),
132
+ Ve(3, Be),
133
+ Ve(4, ee)
133
134
  ], rn);
134
135
  class gn {
135
136
  constructor() {
136
- Se(this, "_refreshDrawings$", new Oi(null));
137
- Se(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
137
+ Ce(this, "_refreshDrawings$", new Si(null));
138
+ Ce(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
138
139
  }
139
140
  refreshDrawings(e) {
140
141
  this._refreshDrawings$.next(e);
141
142
  }
142
143
  }
143
- var me = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(me || {});
144
- const ji = {
145
- inline: k.INLINE,
146
- wrapSquare: k.WRAP_SQUARE,
147
- wrapTopAndBottom: k.WRAP_TOP_AND_BOTTOM,
148
- inFrontOfText: k.WRAP_NONE,
149
- behindText: k.WRAP_NONE
144
+ var ue = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(ue || {});
145
+ const Ni = {
146
+ inline: H.INLINE,
147
+ wrapSquare: H.WRAP_SQUARE,
148
+ wrapTopAndBottom: H.WRAP_TOP_AND_BOTTOM,
149
+ inFrontOfText: H.WRAP_NONE,
150
+ behindText: H.WRAP_NONE
150
151
  };
151
- function Qn(i, e, n, t, r, o, s) {
152
+ function Yn(i, e, n, t, r, o, s) {
152
153
  var p, h;
153
- const a = new In(), d = q.getInstance(), c = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), u = o.getSelfOrHeaderFooterModel(i).getBody();
154
+ const c = new vn(), d = q.getInstance(), a = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), u = o.getSelfOrHeaderFooterModel(i).getBody();
154
155
  if (l == null || u == null)
155
156
  return;
156
- const m = (h = (p = l.customBlocks) == null ? void 0 : p.find((v) => v.blockId === r)) == null ? void 0 : h.startIndex;
157
- if (m != null) {
157
+ const g = (h = (p = l.customBlocks) == null ? void 0 : p.find((v) => v.blockId === r)) == null ? void 0 : h.startIndex;
158
+ if (g != null) {
158
159
  if (t = Math.min(u.dataStream.length - 2, t), i === e) {
159
- if (t < m ? (t > 0 && a.push({
160
- t: Y.RETAIN,
160
+ if (t < g ? (t > 0 && c.push({
161
+ t: Z.RETAIN,
161
162
  len: t
162
- }), a.push({
163
- t: Y.INSERT,
163
+ }), c.push({
164
+ t: Z.INSERT,
164
165
  body: {
165
166
  dataStream: "\b",
166
167
  customBlocks: [{
@@ -169,23 +170,23 @@ function Qn(i, e, n, t, r, o, s) {
169
170
  }]
170
171
  },
171
172
  len: 1
172
- }), a.push({
173
- t: Y.RETAIN,
174
- len: m - t
175
- }), a.push({
176
- t: Y.DELETE,
173
+ }), c.push({
174
+ t: Z.RETAIN,
175
+ len: g - t
176
+ }), c.push({
177
+ t: Z.DELETE,
177
178
  len: 1
178
- })) : (m > 0 && a.push({
179
- t: Y.RETAIN,
180
- len: m
181
- }), a.push({
182
- t: Y.DELETE,
179
+ })) : (g > 0 && c.push({
180
+ t: Z.RETAIN,
181
+ len: g
182
+ }), c.push({
183
+ t: Z.DELETE,
183
184
  len: 1
184
- }), t - m - 1 > 0 && a.push({
185
- t: Y.RETAIN,
186
- len: t - m - 1
187
- }), a.push({
188
- t: Y.INSERT,
185
+ }), t - g - 1 > 0 && c.push({
186
+ t: Z.RETAIN,
187
+ len: t - g - 1
188
+ }), c.push({
189
+ t: Z.INSERT,
189
190
  body: {
190
191
  dataStream: "\b",
191
192
  customBlocks: [{
@@ -194,24 +195,24 @@ function Qn(i, e, n, t, r, o, s) {
194
195
  }]
195
196
  },
196
197
  len: 1
197
- })), t !== m) {
198
- const v = ze(o, e), w = d.editOp(a.serialize(), v);
199
- c.push(w);
198
+ })), t !== g) {
199
+ const v = ze(o, e), w = d.editOp(c.serialize(), v);
200
+ a.push(w);
200
201
  }
201
202
  } else {
202
- m > 0 && a.push({
203
- t: Y.RETAIN,
204
- len: m
205
- }), a.push({
206
- t: Y.DELETE,
203
+ g > 0 && c.push({
204
+ t: Z.RETAIN,
205
+ len: g
206
+ }), c.push({
207
+ t: Z.DELETE,
207
208
  len: 1
208
209
  });
209
- let v = ze(o, e), w = d.editOp(a.serialize(), v);
210
- c.push(w), a.empty(), t > 0 && a.push({
211
- t: Y.RETAIN,
210
+ let v = ze(o, e), w = d.editOp(c.serialize(), v);
211
+ a.push(w), c.empty(), t > 0 && c.push({
212
+ t: Z.RETAIN,
212
213
  len: t
213
- }), a.push({
214
- t: Y.INSERT,
214
+ }), c.push({
215
+ t: Z.INSERT,
215
216
  body: {
216
217
  dataStream: "\b",
217
218
  customBlocks: [{
@@ -220,176 +221,176 @@ function Qn(i, e, n, t, r, o, s) {
220
221
  }]
221
222
  },
222
223
  len: 1
223
- }), v = ze(o, i), w = d.editOp(a.serialize(), v), c.push(w), s.setSegment(i), s.setSegmentPage(n);
224
+ }), v = ze(o, i), w = d.editOp(c.serialize(), v), a.push(w), s.setSegment(i), s.setSegmentPage(n);
224
225
  }
225
- return c;
226
+ return a;
226
227
  }
227
228
  }
228
- const et = {
229
+ const Zn = {
229
230
  id: "doc.command.update-doc-drawing-wrapping-style",
230
- type: X.COMMAND,
231
+ type: K.COMMAND,
231
232
  // eslint-disable-next-line max-lines-per-function, complexity
232
233
  handler: (i, e) => {
233
- var N, B;
234
+ var A, U;
234
235
  if (e == null)
235
236
  return !1;
236
- const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(J), d = i.get(Q).getRenderById(r), c = d == null ? void 0 : d.with(oe).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(oe).getViewModel(), u = d == null ? void 0 : d.scene, m = s.getCurrentUniverDocInstance();
237
- if (m == null || c == null || u == null || l == null)
237
+ const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r), a = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(), u = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
238
+ if (g == null || a == null || u == null || l == null)
238
239
  return !1;
239
- const p = l.getEditArea(), h = u.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = c, O = q.getInstance(), D = [], { drawings: x = {} } = m.getSnapshot();
240
- for (const R of n) {
241
- const { drawingId: I } = R, j = x[I].layoutType, H = ji[t];
242
- if (j !== H) {
243
- const C = O.replaceOp(["drawings", I, "layoutType"], j, H);
240
+ const p = l.getEditArea(), h = u.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = a, O = q.getInstance(), D = [], { drawings: P = {} } = g.getSnapshot();
241
+ for (const N of n) {
242
+ const { drawingId: I } = N, L = P[I].layoutType, W = Ni[t];
243
+ if (L !== W) {
244
+ const C = O.replaceOp(["drawings", I, "layoutType"], L, W);
244
245
  D.push(C);
245
246
  }
246
247
  if (t === "behindText" || t === "inFrontOfText") {
247
- const C = x[I].behindDoc, M = t === "behindText" ? re.TRUE : re.FALSE;
248
- if (C !== M) {
249
- const P = O.replaceOp(["drawings", I, "behindDoc"], C, M);
250
- D.push(P);
248
+ const C = P[I].behindDoc, R = t === "behindText" ? oe.TRUE : oe.FALSE;
249
+ if (C !== R) {
250
+ const T = O.replaceOp(["drawings", I, "behindDoc"], C, R);
251
+ D.push(T);
251
252
  }
252
253
  }
253
254
  if (t === "inline")
254
255
  continue;
255
- let A = null, W = 0, _ = 0;
256
+ let x = null, G = 0, _ = 0;
256
257
  for (const C of v) {
257
- const { headerId: M, footerId: P, marginTop: L, marginLeft: U, marginBottom: y, pageWidth: E, pageHeight: $ } = C;
258
+ const { headerId: R, footerId: T, marginTop: B, marginLeft: F, marginBottom: y, pageWidth: E, pageHeight: $ } = C;
258
259
  switch (p) {
259
- case Ue.HEADER: {
260
- const F = (N = w.get(M)) == null ? void 0 : N.get(E);
261
- F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), W = F.marginTop, _ = U);
260
+ case ke.HEADER: {
261
+ const k = (A = w.get(R)) == null ? void 0 : A.get(E);
262
+ k != null && k.skeDrawings.has(I) && (x = k.skeDrawings.get(I), G = k.marginTop, _ = F);
262
263
  break;
263
264
  }
264
- case Ue.FOOTER: {
265
- const F = (B = S.get(P)) == null ? void 0 : B.get(E);
266
- F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), W = $ - y + F.marginTop, _ = U);
265
+ case ke.FOOTER: {
266
+ const k = (U = S.get(T)) == null ? void 0 : U.get(E);
267
+ k != null && k.skeDrawings.has(I) && (x = k.skeDrawings.get(I), G = $ - y + k.marginTop, _ = F);
267
268
  break;
268
269
  }
269
- case Ue.BODY: {
270
- C.skeDrawings.has(I) && (A = C.skeDrawings.get(I), W = L, _ = U);
270
+ case ke.BODY: {
271
+ C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ = F);
271
272
  break;
272
273
  }
273
274
  }
274
- if (A != null)
275
+ if (x != null)
275
276
  break;
276
277
  }
277
- if (A != null) {
278
- const { aTop: C, aLeft: M } = A, P = x[I].docTransform.positionH;
279
- let L = M;
280
- P.relativeFrom === ee.MARGIN ? L -= _ : P.relativeFrom === ee.COLUMN && (L -= A.columnLeft);
281
- const U = {
282
- relativeFrom: P.relativeFrom,
283
- posOffset: L
278
+ if (x != null) {
279
+ const { aTop: C, aLeft: R } = x, T = P[I].docTransform.positionH;
280
+ let B = R;
281
+ T.relativeFrom === ne.MARGIN ? B -= _ : T.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
282
+ const F = {
283
+ relativeFrom: T.relativeFrom,
284
+ posOffset: B
284
285
  };
285
- if (P.posOffset !== U.posOffset) {
286
- const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], P, U);
287
- D.push(F);
286
+ if (T.posOffset !== F.posOffset) {
287
+ const k = O.replaceOp(["drawings", I, "docTransform", "positionH"], T, F);
288
+ D.push(k);
288
289
  }
289
- const y = x[I].docTransform.positionV;
290
+ const y = P[I].docTransform.positionV;
290
291
  let E = C;
291
- y.relativeFrom === G.PAGE ? E += W : y.relativeFrom === G.LINE ? E -= A.lineTop : y.relativeFrom === G.PARAGRAPH && (E -= A.blockAnchorTop);
292
+ y.relativeFrom === V.PAGE ? E += G : y.relativeFrom === V.LINE ? E -= x.lineTop : y.relativeFrom === V.PARAGRAPH && (E -= x.blockAnchorTop);
292
293
  const $ = {
293
294
  relativeFrom: y.relativeFrom,
294
295
  posOffset: E
295
296
  };
296
297
  if (y.posOffset !== $.posOffset) {
297
- const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], y, $);
298
- D.push(F);
298
+ const k = O.replaceOp(["drawings", I, "docTransform", "positionV"], y, $);
299
+ D.push(k);
299
300
  }
300
301
  }
301
302
  }
302
- const b = {
303
- id: Z.id,
303
+ const M = {
304
+ id: J.id,
304
305
  params: {
305
306
  unitId: r,
306
307
  actions: [],
307
308
  textRanges: null
308
309
  }
309
310
  };
310
- b.params.actions = D.reduce((R, I) => q.compose(R, I), null);
311
- const T = o.syncExecuteCommand(b.id, b.params);
312
- return h.refreshControls(), !!T;
311
+ M.params.actions = D.reduce((N, I) => q.compose(N, I), null);
312
+ const b = o.syncExecuteCommand(M.id, M.params);
313
+ return h.refreshControls(), !!b;
313
314
  }
314
- }, nt = {
315
+ }, Qn = {
315
316
  id: "doc.command.update-doc-drawing-distance",
316
- type: X.COMMAND,
317
+ type: K.COMMAND,
317
318
  handler: (i, e) => {
318
319
  if (e == null)
319
320
  return !1;
320
- const n = i.get(z), r = i.get(J).getCurrentUniverDocInstance();
321
+ const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
321
322
  if (r == null)
322
323
  return !1;
323
- const { drawings: o, dist: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
324
+ const { drawings: o, dist: s, unitId: c } = e, d = q.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
324
325
  for (const p of o) {
325
326
  const { drawingId: h } = p;
326
327
  for (const [v, w] of Object.entries(s)) {
327
328
  const S = l[h][v];
328
329
  if (S !== w) {
329
330
  const O = d.replaceOp(["drawings", h, v], S, w);
330
- c.push(O);
331
+ a.push(O);
331
332
  }
332
333
  }
333
334
  }
334
335
  const u = {
335
- id: Z.id,
336
+ id: J.id,
336
337
  params: {
337
- unitId: a,
338
+ unitId: c,
338
339
  actions: [],
339
340
  textRanges: null
340
341
  }
341
342
  };
342
- return u.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
343
+ return u.params.actions = a.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
343
344
  }
344
- }, tt = {
345
+ }, Jn = {
345
346
  id: "doc.command.update-doc-drawing-wrap-text",
346
- type: X.COMMAND,
347
+ type: K.COMMAND,
347
348
  handler: (i, e) => {
348
349
  if (e == null)
349
350
  return !1;
350
- const n = i.get(z), r = i.get(J).getCurrentUniverDocInstance();
351
+ const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
351
352
  if (r == null)
352
353
  return !1;
353
- const { drawings: o, wrapText: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
354
+ const { drawings: o, wrapText: s, unitId: c } = e, d = q.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
354
355
  for (const p of o) {
355
356
  const { drawingId: h } = p, v = l[h].wrapText;
356
357
  if (v !== s) {
357
358
  const w = d.replaceOp(["drawings", h, "wrapText"], v, s);
358
- c.push(w);
359
+ a.push(w);
359
360
  }
360
361
  }
361
362
  const u = {
362
- id: Z.id,
363
+ id: J.id,
363
364
  params: {
364
- unitId: a,
365
+ unitId: c,
365
366
  actions: [],
366
367
  textRanges: null
367
368
  }
368
369
  };
369
- return u.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
370
+ return u.params.actions = a.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
370
371
  }
371
372
  }, qe = {
372
373
  id: "doc.command.update-drawing-doc-transform",
373
- type: X.COMMAND,
374
+ type: K.COMMAND,
374
375
  handler: (i, e) => {
375
376
  if (e == null)
376
377
  return !1;
377
- const n = i.get(z), t = i.get(J), o = i.get(Q).getRenderById(e.unitId), s = o == null ? void 0 : o.scene;
378
+ const n = i.get(z), t = i.get(Q), o = i.get(ee).getRenderById(e.unitId), s = o == null ? void 0 : o.scene;
378
379
  if (s == null)
379
380
  return !1;
380
- const a = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
381
+ const c = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
381
382
  if (d == null)
382
383
  return !1;
383
- const { drawings: c, unitId: l } = e, u = q.getInstance(), m = [], { drawings: p = {} } = d.getSnapshot();
384
- for (const w of c) {
385
- const { drawingId: S, key: O, value: D } = w, x = p[S].docTransform[O];
386
- if (!Pe.diffValue(x, D)) {
387
- const b = u.replaceOp(["drawings", S, "docTransform", O], x, D);
388
- m.push(b);
384
+ const { drawings: a, unitId: l } = e, u = q.getInstance(), g = [], { drawings: p = {} } = d.getSnapshot();
385
+ for (const w of a) {
386
+ const { drawingId: S, key: O, value: D } = w, P = p[S].docTransform[O];
387
+ if (!be.diffValue(P, D)) {
388
+ const M = u.replaceOp(["drawings", S, "docTransform", O], P, D);
389
+ g.push(M);
389
390
  }
390
391
  }
391
392
  const h = {
392
- id: Z.id,
393
+ id: J.id,
393
394
  params: {
394
395
  unitId: l,
395
396
  actions: [],
@@ -397,95 +398,95 @@ const et = {
397
398
  debounce: !0
398
399
  }
399
400
  };
400
- h.params.actions = m.reduce((w, S) => q.compose(w, S), null);
401
+ h.params.actions = g.reduce((w, S) => q.compose(w, S), null);
401
402
  const v = n.syncExecuteCommand(h.id, h.params);
402
- return a.refreshControls(), !!v;
403
+ return c.refreshControls(), !!v;
403
404
  }
404
- }, it = {
405
+ }, et = {
405
406
  id: "doc.command.move-inline-drawing",
406
- type: X.COMMAND,
407
+ type: K.COMMAND,
407
408
  handler: (i, e) => {
408
- var B, R;
409
+ var U, N;
409
410
  if (e == null)
410
411
  return !1;
411
- const n = i.get(Q), t = (B = n.getRenderById(e.unitId)) == null ? void 0 : B.with(ye), r = i.get(gn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, a = o == null ? void 0 : o.with(oe).getSkeleton();
412
+ const n = i.get(ee), t = (U = n.getRenderById(e.unitId)) == null ? void 0 : U.with(Me), r = i.get(gn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, c = o == null ? void 0 : o.with(se).getSkeleton();
412
413
  if (s == null || t == null)
413
414
  return !1;
414
- const d = s.getTransformerByCreate(), c = i.get(z), u = i.get(J).getCurrentUniverDocInstance();
415
+ const d = s.getTransformerByCreate(), a = i.get(z), u = i.get(Q).getCurrentUniverDocInstance();
415
416
  if (u == null)
416
417
  return !1;
417
- const { drawing: m, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
418
+ const { drawing: g, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
418
419
  if (S)
419
- return r.refreshDrawings(a), d.refreshControls(), !0;
420
- const O = [], { drawingId: D } = m, x = (R = t.getSegment()) != null ? R : "", b = Qn(
420
+ return r.refreshDrawings(c), d.refreshControls(), !0;
421
+ const O = [], { drawingId: D } = g, P = (N = t.getSegment()) != null ? N : "", M = Yn(
421
422
  v,
422
- x,
423
+ P,
423
424
  w,
424
425
  h,
425
426
  D,
426
427
  u,
427
428
  t
428
429
  );
429
- if (b == null || b.length === 0)
430
- return r.refreshDrawings(a), d.refreshControls(), !1;
431
- O.push(...b);
432
- const T = {
433
- id: Z.id,
430
+ if (M == null || M.length === 0)
431
+ return r.refreshDrawings(c), d.refreshControls(), !1;
432
+ O.push(...M);
433
+ const b = {
434
+ id: J.id,
434
435
  params: {
435
436
  unitId: p,
436
437
  actions: [],
437
438
  textRanges: null
438
439
  }
439
440
  };
440
- T.params.actions = O.reduce((I, j) => q.compose(I, j), null);
441
- const N = c.syncExecuteCommand(T.id, T.params);
442
- return d.refreshControls(), !!N;
441
+ b.params.actions = O.reduce((I, L) => q.compose(I, L), null);
442
+ const A = a.syncExecuteCommand(b.id, b.params);
443
+ return d.refreshControls(), !!A;
443
444
  }
444
- }, rt = {
445
+ }, nt = {
445
446
  id: "doc.command.transform-non-inline-drawing",
446
- type: X.COMMAND,
447
+ type: K.COMMAND,
447
448
  // eslint-disable-next-line max-lines-per-function
448
449
  handler: (i, e) => {
449
- var A, W;
450
+ var x, G;
450
451
  if (e == null)
451
452
  return !1;
452
- const n = i.get(Q), t = (A = n.getRenderById(e.unitId)) == null ? void 0 : A.with(ye), r = n.getRenderById(e.unitId), o = r == null ? void 0 : r.scene;
453
+ const n = i.get(ee), t = (x = n.getRenderById(e.unitId)) == null ? void 0 : x.with(Me), r = n.getRenderById(e.unitId), o = r == null ? void 0 : r.scene;
453
454
  if (o == null || t == null)
454
455
  return !1;
455
- const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(J).getCurrentUniverDocInstance();
456
- if (c == null)
456
+ const s = o.getTransformerByCreate(), c = i.get(z), a = i.get(Q).getCurrentUniverDocInstance();
457
+ if (a == null)
457
458
  return !1;
458
- const { drawing: l, unitId: u, offset: m, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (W = t.getSegment()) != null ? W : "", D = Qn(
459
+ const { drawing: l, unitId: u, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Yn(
459
460
  h,
460
461
  O,
461
462
  v,
462
- m,
463
+ g,
463
464
  S,
464
- c,
465
+ a,
465
466
  t
466
467
  );
467
468
  if (D == null)
468
469
  return !1;
469
470
  D.length > 0 && w.push(...D);
470
- const x = q.getInstance(), { drawings: b = {} } = c.getSnapshot(), T = b[S].docTransform, { positionH: N, positionV: B, size: R, angle: I } = T;
471
- if (!Pe.diffValue(N, p.positionH)) {
472
- const _ = x.replaceOp(["drawings", S, "docTransform", "positionH"], N, p.positionH);
471
+ const P = q.getInstance(), { drawings: M = {} } = a.getSnapshot(), b = M[S].docTransform, { positionH: A, positionV: U, size: N, angle: I } = b;
472
+ if (!be.diffValue(A, p.positionH)) {
473
+ const _ = P.replaceOp(["drawings", S, "docTransform", "positionH"], A, p.positionH);
473
474
  w.push(_);
474
475
  }
475
- if (!Pe.diffValue(B, p.positionV)) {
476
- const _ = x.replaceOp(["drawings", S, "docTransform", "positionV"], B, p.positionV);
476
+ if (!be.diffValue(U, p.positionV)) {
477
+ const _ = P.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
477
478
  w.push(_);
478
479
  }
479
- if (!Pe.diffValue(R, p.size)) {
480
- const _ = x.replaceOp(["drawings", S, "docTransform", "size"], R, p.size);
480
+ if (!be.diffValue(N, p.size)) {
481
+ const _ = P.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
481
482
  w.push(_);
482
483
  }
483
- if (!Pe.diffValue(I, p.angle)) {
484
- const _ = x.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
484
+ if (!be.diffValue(I, p.angle)) {
485
+ const _ = P.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
485
486
  w.push(_);
486
487
  }
487
- const j = {
488
- id: Z.id,
488
+ const L = {
489
+ id: J.id,
489
490
  params: {
490
491
  unitId: u,
491
492
  actions: [],
@@ -493,17 +494,17 @@ const et = {
493
494
  debounce: !0
494
495
  }
495
496
  };
496
- j.params.actions = w.reduce((_, C) => q.compose(_, C), null);
497
- const H = a.syncExecuteCommand(j.id, j.params);
498
- return s.refreshControls(), !!H;
497
+ L.params.actions = w.reduce((_, C) => q.compose(_, C), null);
498
+ const W = c.syncExecuteCommand(L.id, L.params);
499
+ return s.refreshControls(), !!W;
499
500
  }
500
501
  };
501
- var Li = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Ui = (i, e, n, t) => {
502
- for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
502
+ var Ai = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
503
+ for (var r = t > 1 ? void 0 : t ? Ei(e, n) : e, o = i.length - 1, s; o >= 0; o--)
503
504
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
504
- return t && r && Li(e, n, r), r;
505
- }, Ze = (i, e) => (n, t) => e(n, t, i);
506
- const Fi = "__InlineDrawingAnchor__";
505
+ return t && r && Ai(e, n, r), r;
506
+ }, Qe = (i, e) => (n, t) => e(n, t, i);
507
+ const Li = "__InlineDrawingAnchor__";
507
508
  function kn(i) {
508
509
  const { path: e } = i;
509
510
  return e.some((n) => n === "cells");
@@ -511,11 +512,11 @@ function kn(i) {
511
512
  let on = class extends Xe {
512
513
  constructor(e, n, t, r) {
513
514
  super();
514
- Se(this, "_liquid", new qn());
515
- Se(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
515
+ Ce(this, "_liquid", new jn());
516
+ Ce(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
516
517
  // Use to cache the drawings is under transforming or scaling.
517
- Se(this, "_transformerCache", /* @__PURE__ */ new Map());
518
- Se(this, "_anchorShape");
518
+ Ce(this, "_transformerCache", /* @__PURE__ */ new Map());
519
+ Ce(this, "_anchorShape");
519
520
  this._commandService = e, this._univerInstanceService = n, this._drawingManagerService = t, this._renderManagerService = r, this._init();
520
521
  }
521
522
  _init() {
@@ -540,20 +541,20 @@ let on = class extends Xe {
540
541
  if (n == null)
541
542
  return;
542
543
  this.disposeWithMe(
543
- Ae(
544
+ Le(
544
545
  n.changeStart$.subscribe((o) => {
545
- var a;
546
+ var c;
546
547
  this._transformerCache.clear();
547
548
  const { objects: s } = o;
548
549
  for (const d of s.values()) {
549
- const { oKey: c, width: l, height: u, left: m, top: p, angle: h } = d, v = this._drawingManagerService.getDrawingOKey(c);
550
+ const { oKey: a, width: l, height: u, left: g, top: p, angle: h } = d, v = this._drawingManagerService.getDrawingOKey(a);
550
551
  if (v == null)
551
552
  continue;
552
- const w = this._univerInstanceService.getUniverDocInstance(v.unitId), S = (a = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : a[v.drawingId];
553
- (S == null ? void 0 : S.layoutType) === k.INLINE && d.setOpacity(0.2), S != null && this._transformerCache.set(v.drawingId, {
553
+ const w = this._univerInstanceService.getUniverDocInstance(v.unitId), S = (c = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : c[v.drawingId];
554
+ (S == null ? void 0 : S.layoutType) === H.INLINE && d.setOpacity(0.2), S != null && this._transformerCache.set(v.drawingId, {
554
555
  drawing: S,
555
556
  top: p,
556
- left: m,
557
+ left: g,
557
558
  width: l,
558
559
  height: u,
559
560
  angle: h
@@ -562,40 +563,40 @@ let on = class extends Xe {
562
563
  })
563
564
  )
564
565
  );
565
- const t = xn(this._updateMultipleDrawingDocTransform.bind(this), 50);
566
- xn(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
567
- Ae(
566
+ const t = On(this._updateMultipleDrawingDocTransform.bind(this), 50);
567
+ On(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
568
+ Le(
568
569
  n.changing$.subscribe((o) => {
569
- const { objects: s, offsetX: a, offsetY: d } = o;
570
+ const { objects: s, offsetX: c, offsetY: d } = o;
570
571
  if (s.size > 1)
571
572
  t(s);
572
573
  else if (s.size === 1) {
573
- const c = this._transformerCache.values().next().value, l = s.values().next().value, { width: u, height: m, top: p, left: h, angle: v } = l;
574
- if (c && u === c.width && m === c.height && p === c.top && h === c.left && v === c.angle)
574
+ const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: u, height: g, top: p, left: h, angle: v } = l;
575
+ if (a && u === a.width && g === a.height && p === a.top && h === a.left && v === a.angle)
575
576
  return;
576
- c && (c.drawing.layoutType, k.INLINE), c && c.drawing.layoutType === k.INLINE && a != null && d != null && this._updateInlineDrawingAnchor(c.drawing, a, d);
577
+ a && (a.drawing.layoutType, H.INLINE), a && a.drawing.layoutType === H.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
577
578
  }
578
579
  })
579
580
  )
580
581
  ), this.disposeWithMe(
581
- Ae(
582
+ Le(
582
583
  // eslint-disable-next-line complexity
583
584
  n.changeEnd$.subscribe((o) => {
584
- const { objects: s, offsetX: a, offsetY: d } = o;
585
- for (const c of s.values()) {
586
- const l = this._drawingManagerService.getDrawingOKey(c.oKey);
585
+ const { objects: s, offsetX: c, offsetY: d } = o;
586
+ for (const a of s.values()) {
587
+ const l = this._drawingManagerService.getDrawingOKey(a.oKey);
587
588
  if (l == null)
588
589
  continue;
589
590
  const u = this._transformerCache.get(l == null ? void 0 : l.drawingId);
590
- (u == null ? void 0 : u.drawing.layoutType) === k.INLINE && c.setOpacity(1);
591
+ (u == null ? void 0 : u.drawing.layoutType) === H.INLINE && a.setOpacity(1);
591
592
  }
592
593
  if (this._anchorShape && this._anchorShape.hide(), s.size > 1)
593
594
  this._updateMultipleDrawingDocTransform(s);
594
595
  else if (s.size === 1) {
595
- const c = this._transformerCache.values().next().value, l = s.values().next().value, { width: u, height: m, top: p, left: h, angle: v } = l;
596
- if (c && u === c.width && m === c.height && p === c.top && h === c.left && v === c.angle)
596
+ const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: u, height: g, top: p, left: h, angle: v } = l;
597
+ if (a && u === a.width && g === a.height && p === a.top && h === a.left && v === a.angle)
597
598
  return;
598
- c && c.drawing.layoutType === k.INLINE ? u !== c.width || m !== c.height || v !== c.angle ? this._updateDrawingSize(c, l) : a != null && d != null && this._moveInlineDrawing(c.drawing, a, d) : c && this._nonInlineDrawingTransform(c.drawing, l);
599
+ a && a.drawing.layoutType === H.INLINE ? u !== a.width || g !== a.height || v !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
599
600
  }
600
601
  this._transformerCache.clear();
601
602
  })
@@ -609,42 +610,42 @@ let on = class extends Xe {
609
610
  const n = [];
610
611
  let t, r;
611
612
  for (const o of e.values()) {
612
- const { oKey: s, left: a, top: d, angle: c } = o;
613
+ const { oKey: s, left: c, top: d, angle: a } = o;
613
614
  let { width: l, height: u } = o;
614
- const m = this._drawingManagerService.getDrawingOKey(s);
615
- if (m == null)
615
+ const g = this._drawingManagerService.getDrawingOKey(s);
616
+ if (g == null)
616
617
  continue;
617
- t == null && (t = m.unitId), r == null && (r = m.subUnitId);
618
- const p = this._transformerCache.get(m.drawingId);
618
+ t == null && (t = g.unitId), r == null && (r = g.subUnitId);
619
+ const p = this._transformerCache.get(g.drawingId);
619
620
  if (p == null)
620
621
  continue;
621
- const { drawing: h, top: v, left: w, width: S, height: O, angle: D } = p, { width: x, height: b } = this._getPageContentSize(h);
622
- if (l = Math.min(l, x), u = Math.min(u, b), (S !== l || O !== u) && n.push({
623
- drawingId: m.drawingId,
622
+ const { drawing: h, top: v, left: w, width: S, height: O, angle: D } = p, { width: P, height: M } = this._getPageContentSize(h);
623
+ if (l = Math.min(l, P), u = Math.min(u, M), (S !== l || O !== u) && n.push({
624
+ drawingId: g.drawingId,
624
625
  key: "size",
625
626
  value: {
626
627
  width: l,
627
628
  height: u
628
629
  }
629
- }), D !== c && n.push({
630
- drawingId: m.drawingId,
630
+ }), D !== a && n.push({
631
+ drawingId: g.drawingId,
631
632
  key: "angle",
632
- value: c
633
- }), v !== d || w !== a) {
634
- const T = d - v, N = a - w;
635
- T !== 0 && n.push({
636
- drawingId: m.drawingId,
633
+ value: a
634
+ }), v !== d || w !== c) {
635
+ const b = d - v, A = c - w;
636
+ b !== 0 && n.push({
637
+ drawingId: g.drawingId,
637
638
  key: "positionV",
638
639
  value: {
639
640
  relativeFrom: h.docTransform.positionV.relativeFrom,
640
- posOffset: h.docTransform.positionV.posOffset + T
641
+ posOffset: h.docTransform.positionV.posOffset + b
641
642
  }
642
- }), N !== 0 && n.push({
643
- drawingId: m.drawingId,
643
+ }), A !== 0 && n.push({
644
+ drawingId: g.drawingId,
644
645
  key: "positionH",
645
646
  value: {
646
647
  relativeFrom: h.docTransform.positionH.relativeFrom,
647
- posOffset: h.docTransform.positionH.posOffset + N
648
+ posOffset: h.docTransform.positionH.posOffset + A
648
649
  }
649
650
  });
650
651
  }
@@ -670,110 +671,110 @@ let on = class extends Xe {
670
671
  r != null && this._createOrUpdateInlineAnchor(e.unitId, r);
671
672
  }
672
673
  _getInlineDrawingAnchor(e, n, t) {
673
- var A, W;
674
- const r = this._renderManagerService.getRenderById(e.unitId), o = r == null ? void 0 : r.with(oe).getSkeleton();
674
+ var x, G;
675
+ const r = this._renderManagerService.getRenderById(e.unitId), o = r == null ? void 0 : r.with(se).getSkeleton();
675
676
  if (r == null)
676
677
  return;
677
- const { mainComponent: s, scene: a } = r, d = s, c = a.getViewports()[0], {
678
+ const { mainComponent: s, scene: c } = r, d = s, a = c.getViewports()[0], {
678
679
  pageLayoutType: l = Mn.VERTICAL,
679
680
  pageMarginLeft: u,
680
- pageMarginTop: m
681
+ pageMarginTop: g
681
682
  } = d.getOffsetConfig();
682
683
  let p = null, h = !1, v = -1, w = "";
683
- const S = 0.5, O = this._getTransformCoordForDocumentOffset(d, c, n, t);
684
+ const S = 0.5, O = this._getTransformCoordForDocumentOffset(d, a, n, t);
684
685
  if (O == null)
685
686
  return;
686
- const D = (A = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : A.with(ye);
687
+ const D = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Me);
687
688
  if (D == null)
688
689
  return;
689
- const x = o == null ? void 0 : o.findNodeByCoord(
690
+ const P = o == null ? void 0 : o.findNodeByCoord(
690
691
  O,
691
692
  l,
692
693
  u,
693
- m,
694
+ g,
694
695
  {
695
696
  strict: !1,
696
697
  segmentId: D.getSegment(),
697
698
  segmentPage: D.getSegmentPage()
698
699
  }
699
700
  );
700
- if (x) {
701
- const { node: _, ratioX: C, segmentPage: M, segmentId: P } = x;
702
- h = C < S, p = _, v = M, w = P;
701
+ if (P) {
702
+ const { node: _, ratioX: C, segmentPage: R, segmentId: T } = P;
703
+ h = C < S, p = _, v = R, w = T;
703
704
  }
704
705
  if (p == null)
705
706
  return;
706
- const b = o == null ? void 0 : o.findPositionByGlyph(p, v), T = this._getDocObject();
707
- if (b == null || o == null || T == null || kn(b))
707
+ const M = o == null ? void 0 : o.findPositionByGlyph(p, v), b = this._getDocObject();
708
+ if (M == null || o == null || b == null || kn(M))
708
709
  return;
709
- const N = {
710
- ...b,
710
+ const A = {
711
+ ...M,
711
712
  isBack: h
712
- }, B = T.document.getOffsetConfig(), R = new Nn(B, o), { cursorList: I, contentBoxPointGroup: j } = R.getRangePointData(N, N), { startOffset: H } = (W = En(I)) != null ? W : {};
713
- if (H != null)
714
- return { offset: H, contentBoxPointGroup: j, segmentId: w, segmentPage: v };
713
+ }, U = b.document.getOffsetConfig(), N = new Nn(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(A, A), { startOffset: W } = (G = An(I)) != null ? G : {};
714
+ if (W != null)
715
+ return { offset: W, contentBoxPointGroup: L, segmentId: w, segmentPage: v };
715
716
  }
716
717
  // eslint-disable-next-line max-lines-per-function, complexity
717
718
  _getDrawingAnchor(e, n) {
718
- var Ie, _e, ce, Ce, De, Me, Re, Oe, de, le, Ne;
719
- const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(oe).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
719
+ var _e, Se, de, De, Oe, Ne, Ae, Pe, le, ge, Ee;
720
+ const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(se).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
720
721
  if (o == null || t == null)
721
722
  return;
722
- const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: l } = t, u = c, m = l.getViewports()[0], { pageLayoutType: p = Mn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = u.getOffsetConfig(), { left: O, top: D, angle: x } = n;
723
- let { width: b, height: T } = n;
724
- const { positionV: N, positionH: B } = e.docTransform, { width: R, height: I } = this._getPageContentSize(e);
725
- b = Math.min(b, R), T = Math.min(T, I);
726
- let j = null, H = "", A = -1;
727
- const W = !1, _ = {
723
+ const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene: l } = t, u = a, g = l.getViewports()[0], { pageLayoutType: p = Mn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = u.getOffsetConfig(), { left: O, top: D, angle: P } = n;
724
+ let { width: M, height: b } = n;
725
+ const { positionV: A, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
726
+ M = Math.min(M, N), b = Math.min(b, I);
727
+ let L = null, W = "", x = -1;
728
+ const G = !1, _ = {
728
729
  ...e.docTransform,
729
730
  size: {
730
- width: b,
731
- height: T
731
+ width: M,
732
+ height: b
732
733
  },
733
- angle: x
734
- }, { x: C, y: M } = l.getViewportScrollXY(m), P = this._getTransformCoordForDocumentOffset(u, m, O - C, D - M);
735
- if (P == null)
734
+ angle: P
735
+ }, { x: C, y: R } = l.getViewportScrollXY(g), T = this._getTransformCoordForDocumentOffset(u, g, O - C, D - R);
736
+ if (T == null)
736
737
  return;
737
- const L = (Ie = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : Ie.with(ye);
738
- if (L == null)
738
+ const B = (_e = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : _e.with(Me);
739
+ if (B == null)
739
740
  return;
740
- const U = r == null ? void 0 : r.findNodeByCoord(P, p, h, v, {
741
+ const F = r == null ? void 0 : r.findNodeByCoord(T, p, h, v, {
741
742
  strict: !1,
742
- segmentId: L.getSegment(),
743
- segmentPage: L.getSegmentPage()
743
+ segmentId: B.getSegment(),
744
+ segmentPage: B.getSegmentPage()
744
745
  });
745
- if (U) {
746
- const { node: he, segmentPage: mn, segmentId: un } = U;
747
- j = he, A = mn, H = un;
746
+ if (F) {
747
+ const { node: pe, segmentPage: mn, segmentId: un } = F;
748
+ L = pe, x = mn, W = un;
748
749
  }
749
- if (j == null)
750
+ if (L == null)
750
751
  return;
751
- const y = (_e = j.parent) == null ? void 0 : _e.parent, E = y == null ? void 0 : y.parent, $ = (ce = E == null ? void 0 : E.lines.find((he) => he.paragraphIndex === (y == null ? void 0 : y.paragraphIndex) && he.paragraphStart)) != null ? ce : E == null ? void 0 : E.lines[0], F = (Ce = E == null ? void 0 : E.parent) == null ? void 0 : Ce.parent;
752
- if (y == null || E == null || $ == null || F == null)
752
+ const y = (Se = L.parent) == null ? void 0 : Se.parent, E = y == null ? void 0 : y.parent, $ = (de = E == null ? void 0 : E.lines.find((pe) => pe.paragraphIndex === (y == null ? void 0 : y.paragraphIndex) && pe.paragraphStart)) != null ? de : E == null ? void 0 : E.lines[0], k = (De = E == null ? void 0 : E.parent) == null ? void 0 : De.parent;
753
+ if (y == null || E == null || $ == null || k == null)
753
754
  return;
754
755
  this._liquid.reset();
755
- const K = F.type;
756
- for (const he of s) {
757
- const { headerId: mn, footerId: un, pageHeight: Dt, pageWidth: Dn, marginLeft: On, marginBottom: Ot } = he, xt = s.indexOf(he);
758
- if (A > -1 && xt === A) {
759
- switch (K) {
756
+ const Y = k.type;
757
+ for (const pe of s) {
758
+ const { headerId: mn, footerId: un, pageHeight: _t, pageWidth: Cn, marginLeft: Dn, marginBottom: St } = pe, Ct = s.indexOf(pe);
759
+ if (x > -1 && Ct === x) {
760
+ switch (Y) {
760
761
  case Rn.HEADER: {
761
- const He = (De = a.get(mn)) == null ? void 0 : De.get(Dn);
762
- if (He)
762
+ const Ge = (Oe = c.get(mn)) == null ? void 0 : Oe.get(Cn);
763
+ if (Ge)
763
764
  this._liquid.translatePagePadding({
764
- marginTop: He.marginTop,
765
- marginLeft: On
765
+ marginTop: Ge.marginTop,
766
+ marginLeft: Dn
766
767
  });
767
768
  else
768
769
  throw new Error("header skeleton not found");
769
770
  break;
770
771
  }
771
772
  case Rn.FOOTER: {
772
- const He = (Me = d.get(un)) == null ? void 0 : Me.get(Dn);
773
- if (He)
773
+ const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Cn);
774
+ if (Ge)
774
775
  this._liquid.translatePagePadding({
775
- marginTop: Dt - Ot + He.marginTop,
776
- marginLeft: On
776
+ marginTop: _t - St + Ge.marginTop,
777
+ marginLeft: Dn
777
778
  });
778
779
  else
779
780
  throw new Error("footer skeleton not found");
@@ -782,56 +783,56 @@ let on = class extends Xe {
782
783
  }
783
784
  break;
784
785
  }
785
- if (this._liquid.translatePagePadding(he), he === F)
786
+ if (this._liquid.translatePagePadding(pe), pe === k)
786
787
  break;
787
- this._liquid.restorePagePadding(he), this._liquid.translatePage(he, p, h, v);
788
+ this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, p, h, v);
788
789
  }
789
- switch (N.relativeFrom === G.LINE ? j = y.divides[0].glyphGroup[0] : j = (le = (de = (Oe = (Re = $.divides) == null ? void 0 : Re[0]) == null ? void 0 : Oe.glyphGroup) == null ? void 0 : de[0]) != null ? le : j, _.positionH = {
790
- relativeFrom: B.relativeFrom,
790
+ switch (A.relativeFrom === V.LINE ? L = y.divides[0].glyphGroup[0] : L = (ge = (le = (Pe = (Ae = $.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Pe.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
791
+ relativeFrom: U.relativeFrom,
791
792
  posOffset: O - this._liquid.x - w
792
- }, B.relativeFrom) {
793
- case ee.MARGIN: {
794
- _.positionH.posOffset = O - this._liquid.x - w - F.marginLeft;
793
+ }, U.relativeFrom) {
794
+ case ne.MARGIN: {
795
+ _.positionH.posOffset = O - this._liquid.x - w - k.marginLeft;
795
796
  break;
796
797
  }
797
- case ee.COLUMN: {
798
+ case ne.COLUMN: {
798
799
  _.positionH.posOffset = O - this._liquid.x - w - E.left;
799
800
  break;
800
801
  }
801
802
  }
802
803
  switch (_.positionV = {
803
- relativeFrom: N.relativeFrom,
804
+ relativeFrom: A.relativeFrom,
804
805
  posOffset: D - this._liquid.y - S
805
- }, N.relativeFrom) {
806
- case G.PAGE: {
807
- _.positionV.posOffset = D - this._liquid.y - S - F.marginTop;
806
+ }, A.relativeFrom) {
807
+ case V.PAGE: {
808
+ _.positionV.posOffset = D - this._liquid.y - S - k.marginTop;
808
809
  break;
809
810
  }
810
- case G.LINE: {
811
+ case V.LINE: {
811
812
  _.positionV.posOffset = D - this._liquid.y - S - y.top;
812
813
  break;
813
814
  }
814
- case G.PARAGRAPH: {
815
+ case V.PARAGRAPH: {
815
816
  _.positionV.posOffset = D - this._liquid.y - S - $.top;
816
817
  break;
817
818
  }
818
819
  }
819
- if (j == null)
820
+ if (L == null)
820
821
  return;
821
- const se = r == null ? void 0 : r.findPositionByGlyph(j, A), Le = this._getDocObject();
822
- if (se == null || r == null || Le == null || kn(se))
822
+ const ae = r == null ? void 0 : r.findPositionByGlyph(L, x), Ue = this._getDocObject();
823
+ if (ae == null || r == null || Ue == null || kn(ae))
823
824
  return;
824
- const be = {
825
- ...se,
826
- isBack: W
827
- }, ke = Le.document.getOffsetConfig(), ae = new Nn(ke, r), { cursorList: ne } = ae.getRangePointData(be, be), { startOffset: te } = (Ne = En(ne)) != null ? Ne : {};
828
- if (te != null)
829
- return { offset: te, docTransform: _, segmentId: H, segmentPage: A };
825
+ const Re = {
826
+ ...ae,
827
+ isBack: G
828
+ }, We = Ue.document.getOffsetConfig(), ce = new Nn(We, r), { cursorList: te } = ce.getRangePointData(Re, Re), { startOffset: ie } = (Ee = An(te)) != null ? Ee : {};
829
+ if (ie != null)
830
+ return { offset: ie, docTransform: _, segmentId: W, segmentPage: x };
830
831
  }
831
832
  // Update drawing when use transformer to resize it.
832
833
  _updateDrawingSize(e, n) {
833
- const t = [], { drawing: r, width: o, height: s, angle: a } = e, { unitId: d, subUnitId: c } = r;
834
- let { width: l, height: u, angle: m } = n;
834
+ const t = [], { drawing: r, width: o, height: s, angle: c } = e, { unitId: d, subUnitId: a } = r;
835
+ let { width: l, height: u, angle: g } = n;
835
836
  const { width: p, height: h } = this._getPageContentSize(r);
836
837
  l = Math.min(p, l), u = Math.min(h, u), (l !== o || u !== s) && t.push({
837
838
  drawingId: r.drawingId,
@@ -840,56 +841,56 @@ let on = class extends Xe {
840
841
  width: l,
841
842
  height: u
842
843
  }
843
- }), m !== a && t.push({
844
+ }), g !== c && t.push({
844
845
  drawingId: r.drawingId,
845
846
  key: "angle",
846
- value: m
847
- }), t.length > 0 && d && c && this._commandService.executeCommand(qe.id, {
847
+ value: g
848
+ }), t.length > 0 && d && a && this._commandService.executeCommand(qe.id, {
848
849
  unitId: d,
849
- subUnitId: c,
850
+ subUnitId: a,
850
851
  drawings: t
851
852
  });
852
853
  }
853
854
  // Update inline drawing when use transformer to move it.
854
855
  _moveInlineDrawing(e, n, t) {
855
- const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage: a } = r != null ? r : {};
856
- return this._commandService.executeCommand(it.id, {
856
+ const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage: c } = r != null ? r : {};
857
+ return this._commandService.executeCommand(et.id, {
857
858
  unitId: e.unitId,
858
859
  subUnitId: e.unitId,
859
860
  drawing: e,
860
861
  offset: o,
861
862
  segmentId: s,
862
- segmentPage: a,
863
+ segmentPage: c,
863
864
  needRefreshDrawings: o == null
864
865
  });
865
866
  }
866
867
  // Limit the drawing to the page area, mainly in the vertical direction,
867
868
  // and the upper and lower limits cannot exceed the page margin area.
868
869
  _limitDrawingInPage(e, n) {
869
- const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: a, angle: d } = n, c = t == null ? void 0 : t.with(oe).getSkeleton(), l = c == null ? void 0 : c.getSkeletonData(), { pages: u } = l != null ? l : {};
870
+ const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: c, angle: d } = n, a = t == null ? void 0 : t.with(se).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: u } = l != null ? l : {};
870
871
  if (l == null || t == null || u == null)
871
872
  return {
872
873
  left: r,
873
874
  top: o,
874
875
  width: s,
875
- height: a,
876
+ height: c,
876
877
  angle: d
877
878
  };
878
- const { mainComponent: m } = t, p = m, { top: h, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: S } = p;
879
+ const { mainComponent: g } = t, p = g, { top: h, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: S } = p;
879
880
  let O = o;
880
881
  this._liquid.reset();
881
882
  for (const D of u) {
882
- const { marginBottom: x, pageHeight: b } = D, T = u.indexOf(D), N = u[T + 1];
883
- if (N == null)
883
+ const { marginBottom: P, pageHeight: M } = D, b = u.indexOf(D), A = u[b + 1];
884
+ if (A == null)
884
885
  continue;
885
- if (Pe.hasIntersectionBetweenTwoRanges(
886
+ if (be.hasIntersectionBetweenTwoRanges(
886
887
  o,
887
- o + a,
888
- this._liquid.y + h + b - x,
889
- this._liquid.y + h + b + S + N.marginTop
888
+ o + c,
889
+ this._liquid.y + h + M - P,
890
+ this._liquid.y + h + M + S + A.marginTop
890
891
  )) {
891
- const R = o + a / 2, I = this._liquid.y + h + b + S / 2;
892
- R < I ? O = Math.min(o, this._liquid.y + h + b - x - a) : O = Math.max(o, this._liquid.y + h + b + S + N.marginTop);
892
+ const N = o + c / 2, I = this._liquid.y + h + M + S / 2;
893
+ N < I ? O = Math.min(o, this._liquid.y + h + M - P - c) : O = Math.max(o, this._liquid.y + h + M + S + A.marginTop);
893
894
  }
894
895
  this._liquid.translatePage(D, v, w, S);
895
896
  }
@@ -897,23 +898,23 @@ let on = class extends Xe {
897
898
  left: r,
898
899
  top: O,
899
900
  width: s,
900
- height: a,
901
+ height: c,
901
902
  angle: d
902
903
  };
903
904
  }
904
905
  _nonInlineDrawingTransform(e, n, t = !1) {
905
- const r = e.isMultiTransform === re.TRUE ? n : this._limitDrawingInPage(e, n);
906
+ const r = e.isMultiTransform === oe.TRUE ? n : this._limitDrawingInPage(e, n);
906
907
  if (t && r.top !== n.top)
907
908
  return;
908
- const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: a, segmentId: d, segmentPage: c } = o != null ? o : {};
909
- return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(rt.id, {
909
+ const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: c, segmentId: d, segmentPage: a } = o != null ? o : {};
910
+ return s == null || c == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(nt.id, {
910
911
  unitId: e.unitId,
911
912
  subUnitId: e.unitId,
912
913
  drawing: e,
913
914
  offset: s,
914
- docTransform: a,
915
+ docTransform: c,
915
916
  segmentId: d,
916
- segmentPage: c
917
+ segmentPage: a
917
918
  });
918
919
  }
919
920
  _getSceneAndTransformerByDrawingSearch(e) {
@@ -926,7 +927,7 @@ let on = class extends Xe {
926
927
  return { scene: t, transformer: r };
927
928
  }
928
929
  _getTransformCoordForDocumentOffset(e, n, t, r) {
929
- const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ri.FromArray([t, r]));
930
+ const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ni.FromArray([t, r]));
930
931
  if (s)
931
932
  return o.clone().invert().applyPoint(s);
932
933
  }
@@ -935,47 +936,47 @@ let on = class extends Xe {
935
936
  if (t == null)
936
937
  return;
937
938
  const { mainComponent: r, scene: o } = t, s = r, {
938
- docsLeft: a,
939
+ docsLeft: c,
939
940
  docsTop: d
940
- } = s.getOffsetConfig(), c = pi(n), { left: l, top: u, height: m } = c, p = l + a, h = u + d;
941
+ } = s.getOffsetConfig(), a = ui(n), { left: l, top: u, height: g } = a, p = l + c, h = u + d;
941
942
  if (this._anchorShape) {
942
- this._anchorShape.transformByState({ left: p, top: h, height: m }), this._anchorShape.show();
943
+ this._anchorShape.transformByState({ left: p, top: h, height: g }), this._anchorShape.show();
943
944
  return;
944
945
  }
945
- const v = 6, w = new oi(Fi + Pe.generateRandomId(v), {
946
+ const v = 6, w = new ti(Li + be.generateRandomId(v), {
946
947
  left: p,
947
948
  top: h,
948
- height: m,
949
+ height: g,
949
950
  strokeWidth: 2,
950
- stroke: si(Mt.darkGray, 1),
951
+ stroke: ii(bt.darkGray, 1),
951
952
  evented: !1
952
953
  });
953
- this._anchorShape = w, o.addObject(w, wi);
954
+ this._anchorShape = w, o.addObject(w, fi);
954
955
  }
955
956
  _getDocObject() {
956
- return vi(this._univerInstanceService, this._renderManagerService);
957
+ return hi(this._univerInstanceService, this._renderManagerService);
957
958
  }
958
959
  _getPageContentSize(e) {
959
- const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(oe).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
960
+ const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(se).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
960
961
  if (s == null || n == null)
961
962
  return {
962
963
  width: r,
963
964
  height: o
964
965
  };
965
- const { pages: a } = s;
966
+ const { pages: c } = s;
966
967
  let d = null;
967
- for (const c of a) {
968
- const { skeDrawings: l } = c;
968
+ for (const a of c) {
969
+ const { skeDrawings: l } = a;
969
970
  if (l.has(e.drawingId)) {
970
- d = c;
971
+ d = a;
971
972
  break;
972
973
  }
973
974
  }
974
975
  if (d) {
975
- const { pageWidth: c, pageHeight: l, marginLeft: u, marginBottom: m, marginRight: p, marginTop: h } = d;
976
+ const { pageWidth: a, pageHeight: l, marginLeft: u, marginBottom: g, marginRight: p, marginTop: h } = d;
976
977
  return {
977
- width: Math.max(r, c - u - p),
978
- height: Math.max(o, l - h - m)
978
+ width: Math.max(r, a - u - p),
979
+ height: Math.max(o, l - h - g)
979
980
  };
980
981
  } else
981
982
  return {
@@ -984,132 +985,132 @@ let on = class extends Xe {
984
985
  };
985
986
  }
986
987
  };
987
- on = Ui([
988
- Ze(0, z),
989
- Ze(1, J),
990
- Ze(2, ve),
991
- Ze(3, Q)
988
+ on = xi([
989
+ Qe(0, z),
990
+ Qe(1, Q),
991
+ Qe(2, Ie),
992
+ Qe(3, ee)
992
993
  ], on);
993
- var fe = function() {
994
- return fe = Object.assign || function(i) {
994
+ var he = function() {
995
+ return he = Object.assign || function(i) {
995
996
  for (var e, n = 1, t = arguments.length; n < t; n++) {
996
997
  e = arguments[n];
997
998
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
998
999
  }
999
1000
  return i;
1000
- }, fe.apply(this, arguments);
1001
- }, ki = function(i, e) {
1001
+ }, he.apply(this, arguments);
1002
+ }, Bi = function(i, e) {
1002
1003
  var n = {};
1003
1004
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
1004
1005
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
1005
1006
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
1006
1007
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
1007
1008
  return n;
1008
- }, ot = Jn(function(i, e) {
1009
- var n = i.icon, t = i.id, r = i.className, o = i.extend, s = ki(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = yi("_".concat(Gi()));
1010
- return st(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, fe({ ref: e, className: a }, s), o);
1009
+ }, tt = Xn(function(i, e) {
1010
+ var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Bi(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Oi("_".concat(ki()));
1011
+ return it(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: c }, s), o);
1011
1012
  });
1012
- function st(i, e, n, t, r) {
1013
- return Zn(i.tag, fe(fe({ key: e }, Hi(i, n, r)), t), (Wi(i, n).children || []).map(function(o, s) {
1014
- return st(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1013
+ function it(i, e, n, t, r) {
1014
+ return Kn(i.tag, he(he({ key: e }, Ui(i, n, r)), t), (Fi(i, n).children || []).map(function(o, s) {
1015
+ return it(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1015
1016
  }));
1016
1017
  }
1017
- function Hi(i, e, n) {
1018
- var t = fe({}, i.attrs);
1018
+ function Ui(i, e, n) {
1019
+ var t = he({}, i.attrs);
1019
1020
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
1020
1021
  var r = e.defIds;
1021
1022
  return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(o) {
1022
- var s = o[0], a = o[1];
1023
- typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1023
+ var s = o[0], c = o[1];
1024
+ typeof c == "string" && (t[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1024
1025
  })), t;
1025
1026
  }
1026
- function Wi(i, e) {
1027
+ function Fi(i, e) {
1027
1028
  var n, t = e.defIds;
1028
- return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? fe(fe({}, i), { children: i.children.map(function(r) {
1029
- return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? fe(fe({}, r), { attrs: fe(fe({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
1029
+ return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? he(he({}, i), { children: i.children.map(function(r) {
1030
+ return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? he(he({}, r), { attrs: he(he({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
1030
1031
  }) }) : i;
1031
1032
  }
1032
- function Gi() {
1033
+ function ki() {
1033
1034
  return Math.random().toString(36).substring(2, 8);
1034
1035
  }
1035
- ot.displayName = "UniverIcon";
1036
- var Vi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, at = Jn(function(i, e) {
1037
- return Zn(ot, Object.assign({}, i, {
1036
+ tt.displayName = "UniverIcon";
1037
+ var Hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, rt = Xn(function(i, e) {
1038
+ return Kn(tt, Object.assign({}, i, {
1038
1039
  id: "add-image-single",
1039
1040
  ref: e,
1040
- icon: Vi
1041
+ icon: Hi
1041
1042
  }));
1042
1043
  });
1043
- at.displayName = "AddImageSingle";
1044
- const Cn = {
1044
+ rt.displayName = "AddImageSingle";
1045
+ const Sn = {
1045
1046
  id: "doc.command.remove-doc-image",
1046
- type: X.COMMAND,
1047
+ type: K.COMMAND,
1047
1048
  // eslint-disable-next-line max-lines-per-function
1048
1049
  handler: (i, e) => {
1049
- var b, T, N, B;
1050
- const n = i.get(z), t = i.get(J), r = i.get(Q), o = t.getCurrentUniverDocInstance();
1050
+ var M, b, A, U;
1051
+ const n = i.get(z), t = i.get(Q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
1051
1052
  if (e == null || o == null)
1052
1053
  return !1;
1053
- const s = r.getRenderById(e.unitId).with(ye), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new In(), l = q.getInstance(), u = (N = (T = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : T.customBlocks) != null ? N : [], m = a.map((R) => u.find((I) => I.blockId === R.drawingId)).filter((R) => !!R).sort((R, I) => R.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new Rt();
1054
+ const s = r.getRenderById(e.unitId).with(Me), { drawings: c } = e, d = (M = s.getSegment()) != null ? M : "", a = new vn(), l = q.getInstance(), u = (A = (b = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : b.customBlocks) != null ? A : [], g = c.map((N) => u.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = c[0].unitId, h = new yt();
1054
1055
  h.reset();
1055
- const v = m[0].startIndex, w = [
1056
+ const v = g[0].startIndex, w = [
1056
1057
  {
1057
1058
  startOffset: v,
1058
1059
  endOffset: v
1059
1060
  }
1060
1061
  ], S = {
1061
- id: Z.id,
1062
+ id: J.id,
1062
1063
  params: {
1063
1064
  unitId: p,
1064
1065
  actions: [],
1065
1066
  textRanges: w
1066
1067
  }
1067
1068
  }, O = [];
1068
- for (const R of m) {
1069
- const { startIndex: I } = R;
1070
- I > h.cursor && c.push({
1071
- t: Y.RETAIN,
1069
+ for (const N of g) {
1070
+ const { startIndex: I } = N;
1071
+ I > h.cursor && a.push({
1072
+ t: Z.RETAIN,
1072
1073
  len: I - h.cursor
1073
- }), c.push({
1074
- t: Y.DELETE,
1074
+ }), a.push({
1075
+ t: Z.DELETE,
1075
1076
  len: 1
1076
1077
  }), h.moveCursorTo(I + 1);
1077
1078
  }
1078
1079
  const D = ze(o, d);
1079
- O.push(l.editOp(c.serialize(), D));
1080
- for (const R of m) {
1081
- const { blockId: I } = R, j = ((B = o.getDrawings()) != null ? B : {})[I], A = o.getDrawingsOrder().indexOf(I), W = l.removeOp(["drawings", I], j), _ = l.removeOp(["drawingsOrder", A], I);
1082
- O.push(W), O.push(_);
1080
+ O.push(l.editOp(a.serialize(), D));
1081
+ for (const N of g) {
1082
+ const { blockId: I } = N, L = ((U = o.getDrawings()) != null ? U : {})[I], x = o.getDrawingsOrder().indexOf(I), G = l.removeOp(["drawings", I], L), _ = l.removeOp(["drawingsOrder", x], I);
1083
+ O.push(G), O.push(_);
1083
1084
  }
1084
- return S.params.actions = O.reduce((R, I) => q.compose(R, I), null), !!n.syncExecuteCommand(S.id, S.params);
1085
+ return S.params.actions = O.reduce((N, I) => q.compose(N, I), null), !!n.syncExecuteCommand(S.id, S.params);
1085
1086
  }
1086
- }, ct = {
1087
+ }, ot = {
1087
1088
  id: "doc.command.delete-drawing",
1088
- type: X.COMMAND,
1089
+ type: K.COMMAND,
1089
1090
  handler: (i) => {
1090
- const e = i.get(z), t = i.get(je).getFocusDrawings();
1091
+ const e = i.get(z), t = i.get(Be).getFocusDrawings();
1091
1092
  if (t.length === 0)
1092
1093
  return !1;
1093
1094
  const { unitId: r } = t[0], o = t.map((s) => {
1094
- const { unitId: a, subUnitId: d, drawingId: c, drawingType: l } = s;
1095
+ const { unitId: c, subUnitId: d, drawingId: a, drawingType: l } = s;
1095
1096
  return {
1096
- unitId: a,
1097
+ unitId: c,
1097
1098
  subUnitId: d,
1098
- drawingId: c,
1099
+ drawingId: a,
1099
1100
  drawingType: l
1100
1101
  };
1101
1102
  });
1102
- return e.executeCommand(Cn.id, {
1103
+ return e.executeCommand(Sn.id, {
1103
1104
  unitId: r,
1104
1105
  drawings: o
1105
1106
  });
1106
1107
  }
1107
- }, dt = {
1108
+ }, st = {
1108
1109
  id: "doc.command.group-doc-image",
1109
- type: X.COMMAND,
1110
+ type: K.COMMAND,
1110
1111
  handler: (i, e) => {
1111
- i.get(z), i.get($n);
1112
- const n = i.get(je);
1112
+ i.get(z), i.get(Gn);
1113
+ const n = i.get(Be);
1113
1114
  if (!e) return !1;
1114
1115
  const t = [];
1115
1116
  return e.forEach(({ parent: r, children: o }) => {
@@ -1118,46 +1119,46 @@ const Cn = {
1118
1119
  });
1119
1120
  }), n.getGroupDrawingOp(e), !1;
1120
1121
  }
1121
- }, lt = {
1122
+ }, at = {
1122
1123
  id: "doc.command.insert-doc-image",
1123
- type: X.COMMAND,
1124
+ type: K.COMMAND,
1124
1125
  // eslint-disable-next-line max-lines-per-function
1125
1126
  handler: (i, e) => {
1126
- var T, N, B, R;
1127
+ var b, A, U, N;
1127
1128
  if (e == null)
1128
1129
  return !1;
1129
- const n = i.get(z), t = i.get(_n), r = i.get(J), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
1130
+ const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
1130
1131
  if (o == null || s == null)
1131
1132
  return !1;
1132
- const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: l, segmentId: u } = o, m = s.getSelfOrHeaderFooterModel(u).getBody();
1133
- if (m == null)
1133
+ const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId: u } = o, g = s.getSelfOrHeaderFooterModel(u).getBody();
1134
+ if (g == null)
1134
1135
  return !1;
1135
- const p = new In(), h = q.getInstance(), v = [], w = (N = (T = s.getSnapshot().drawingsOrder) == null ? void 0 : T.length) != null ? N : 0;
1136
+ const p = new vn(), h = q.getInstance(), v = [], w = (A = (b = s.getSnapshot().drawingsOrder) == null ? void 0 : b.length) != null ? A : 0;
1136
1137
  let S = 0;
1137
- if (c)
1138
+ if (a)
1138
1139
  l > 0 && p.push({
1139
- t: Y.RETAIN,
1140
+ t: Z.RETAIN,
1140
1141
  len: l
1141
1142
  });
1142
1143
  else {
1143
- const I = Nt.selection.delete([o], m, 0, null, !1);
1144
+ const I = Mt.selection.delete([o], g, 0, null, !1);
1144
1145
  p.push(...I);
1145
- const j = Ii(m, [o]), H = (B = s.getDrawings()) != null ? B : {}, A = (R = s.getDrawingsOrder()) != null ? R : [], W = j.sort((_, C) => A.indexOf(_) > A.indexOf(C) ? -1 : A.indexOf(_) < A.indexOf(C) ? 1 : 0);
1146
- if (W.length > 0)
1147
- for (const _ of W) {
1148
- const C = H[_], M = A.indexOf(_);
1149
- if (C == null || M < 0)
1146
+ const L = pi(g, [o]), W = (U = s.getDrawings()) != null ? U : {}, x = (N = s.getDrawingsOrder()) != null ? N : [], G = L.sort((_, C) => x.indexOf(_) > x.indexOf(C) ? -1 : x.indexOf(_) < x.indexOf(C) ? 1 : 0);
1147
+ if (G.length > 0)
1148
+ for (const _ of G) {
1149
+ const C = W[_], R = x.indexOf(_);
1150
+ if (C == null || R < 0)
1150
1151
  continue;
1151
- const P = h.removeOp(["drawings", _], C), L = h.removeOp(["drawingsOrder", M], _);
1152
- v.push(P), v.push(L), S++;
1152
+ const T = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
1153
+ v.push(T), v.push(B), S++;
1153
1154
  }
1154
1155
  }
1155
1156
  p.push({
1156
- t: Y.INSERT,
1157
+ t: Z.INSERT,
1157
1158
  body: {
1158
1159
  dataStream: "\b".repeat(d.length),
1159
- customBlocks: d.map((I, j) => ({
1160
- startIndex: j,
1160
+ customBlocks: d.map((I, L) => ({
1161
+ startIndex: L,
1161
1162
  blockId: I.drawingId
1162
1163
  }))
1163
1164
  },
@@ -1166,38 +1167,38 @@ const Cn = {
1166
1167
  const O = ze(s, u), D = h.editOp(p.serialize(), O);
1167
1168
  v.push(D);
1168
1169
  for (const I of d) {
1169
- const { drawingId: j } = I, H = h.insertOp(["drawings", j], I), A = h.insertOp(["drawingsOrder", w - S], j);
1170
- v.push(H), v.push(A);
1170
+ const { drawingId: L } = I, W = h.insertOp(["drawings", L], I), x = h.insertOp(["drawingsOrder", w - S], L);
1171
+ v.push(W), v.push(x);
1171
1172
  }
1172
- const x = {
1173
- id: Z.id,
1173
+ const P = {
1174
+ id: J.id,
1174
1175
  params: {
1175
- unitId: a,
1176
+ unitId: c,
1176
1177
  actions: [],
1177
1178
  textRanges: []
1178
1179
  }
1179
1180
  };
1180
- return x.params.actions = v.reduce((I, j) => q.compose(I, j), null), !!n.syncExecuteCommand(x.id, x.params);
1181
+ return P.params.actions = v.reduce((I, L) => q.compose(I, L), null), !!n.syncExecuteCommand(P.id, P.params);
1181
1182
  }
1182
- }, gt = {
1183
+ }, ct = {
1183
1184
  id: "doc.command.set-drawing-arrange",
1184
- type: X.COMMAND,
1185
+ type: K.COMMAND,
1185
1186
  handler: (i, e) => {
1186
- const n = i.get(z), t = i.get(je);
1187
+ const n = i.get(z), t = i.get(Be);
1187
1188
  if (e == null)
1188
1189
  return !1;
1189
- const { unitId: r, subUnitId: o, drawingIds: s, arrangeType: a } = e, d = { unitId: r, subUnitId: o, drawingIds: s };
1190
- let c;
1191
- if (a === Je.forward ? c = t.getForwardDrawingsOp(d) : a === Je.backward ? c = t.getBackwardDrawingOp(d) : a === Je.front ? c = t.getFrontDrawingsOp(d) : a === Je.back && (c = t.getBackDrawingsOp(d)), c == null)
1190
+ const { unitId: r, subUnitId: o, drawingIds: s, arrangeType: c } = e, d = { unitId: r, subUnitId: o, drawingIds: s };
1191
+ let a;
1192
+ if (c === Ze.forward ? a = t.getForwardDrawingsOp(d) : c === Ze.backward ? a = t.getBackwardDrawingOp(d) : c === Ze.front ? a = t.getFrontDrawingsOp(d) : c === Ze.back && (a = t.getBackDrawingsOp(d)), a == null)
1192
1193
  return !1;
1193
- const { redo: l } = c;
1194
+ const { redo: l } = a;
1194
1195
  if (l == null)
1195
1196
  return !1;
1196
1197
  const u = [];
1197
- let m = Pe.deepClone(l);
1198
- m = m.slice(3), m.unshift("drawingsOrder"), u.push(m);
1198
+ let g = be.deepClone(l);
1199
+ g = g.slice(3), g.unshift("drawingsOrder"), u.push(g);
1199
1200
  const p = {
1200
- id: Z.id,
1201
+ id: J.id,
1201
1202
  params: {
1202
1203
  unitId: r,
1203
1204
  actions: [],
@@ -1206,12 +1207,12 @@ const Cn = {
1206
1207
  };
1207
1208
  return p.params.actions = u.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
1208
1209
  }
1209
- }, mt = {
1210
+ }, dt = {
1210
1211
  id: "doc.command.ungroup-doc-image",
1211
- type: X.COMMAND,
1212
+ type: K.COMMAND,
1212
1213
  handler: (i, e) => {
1213
- i.get(z), i.get($n);
1214
- const n = i.get(je);
1214
+ i.get(z), i.get(Gn);
1215
+ const n = i.get(Be);
1215
1216
  if (!e) return !1;
1216
1217
  const t = [];
1217
1218
  return e.forEach(({ parent: r, children: o }) => {
@@ -1221,19 +1222,19 @@ const Cn = {
1221
1222
  }), n.getUngroupDrawingOp(e), !1;
1222
1223
  }
1223
1224
  };
1224
- var $i = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, qi = (i, e, n, t) => {
1225
- for (var r = t > 1 ? void 0 : t ? zi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
1225
+ var Wi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
1226
+ for (var r = t > 1 ? void 0 : t ? Gi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
1226
1227
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
1227
- return t && r && $i(e, n, r), r;
1228
- }, ge = (i, e) => (n, t) => e(n, t, i);
1228
+ return t && r && Wi(e, n, r), r;
1229
+ }, me = (i, e) => (n, t) => e(n, t, i);
1229
1230
  let sn = class extends Xe {
1230
- constructor(i, e, n, t, r, o, s, a, d, c, l, u, m) {
1231
- super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = a, this._messageService = d, this._localeService = c, this._docSelectionRenderService = l, this._docRefreshDrawingsService = u, this._fileOpenerService = m, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
1231
+ constructor(i, e, n, t, r, o, s, c, d, a, l, u, g) {
1232
+ super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = c, this._messageService = d, this._localeService = a, this._docSelectionRenderService = l, this._docRefreshDrawingsService = u, this._fileOpenerService = g, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
1232
1233
  }
1233
1234
  async insertDocImage() {
1234
1235
  const i = await this._fileOpenerService.openFile({
1235
1236
  multiple: !0,
1236
- accept: zt.map((n) => `.${n.replace("image/", "")}`).join(",")
1237
+ accept: Vt.map((n) => `.${n.replace("image/", "")}`).join(",")
1237
1238
  }), e = i.length;
1238
1239
  return e > Tn ? (this._messageService.show({
1239
1240
  type: Ln.Error,
@@ -1250,7 +1251,7 @@ let sn = class extends Xe {
1250
1251
  let s = "";
1251
1252
  switch (o) {
1252
1253
  case hn.ERROR_EXCEED_SIZE:
1253
- s = this._localeService.t("update-status.exceedMaxSize", String(qt / (1024 * 1024)));
1254
+ s = this._localeService.t("update-status.exceedMaxSize", String(jt / (1024 * 1024)));
1254
1255
  break;
1255
1256
  case hn.ERROR_IMAGE_TYPE:
1256
1257
  s = this._localeService.t("update-status.invalidImageType");
@@ -1270,29 +1271,29 @@ let sn = class extends Xe {
1270
1271
  for (const r of e) {
1271
1272
  if (r == null)
1272
1273
  continue;
1273
- const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: u } = await Xt(d || "");
1274
+ const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height: l, image: u } = await $t(d || "");
1274
1275
  this._imageIoService.addImageSourceCache(o, s, u);
1275
- let m = 1;
1276
- if (c > yn || l > bn) {
1277
- const w = yn / c, S = bn / l;
1278
- m = Math.min(w, S);
1276
+ let g = 1;
1277
+ if (a > bn || l > yn) {
1278
+ const w = bn / a, S = yn / l;
1279
+ g = Math.min(w, S);
1279
1280
  }
1280
- const p = this._getImagePosition(c * m, l * m);
1281
+ const p = this._getImagePosition(a * g, l * g);
1281
1282
  if (p == null)
1282
1283
  return;
1283
1284
  const h = {
1284
1285
  unitId: n,
1285
1286
  subUnitId: n,
1286
1287
  drawingId: o,
1287
- drawingType: Et.DRAWING_IMAGE,
1288
+ drawingType: Rt.DRAWING_IMAGE,
1288
1289
  imageSourceType: s,
1289
- source: a,
1290
- transform: _i(p),
1290
+ source: c,
1291
+ transform: wi(p),
1291
1292
  docTransform: p,
1292
- behindDoc: re.FALSE,
1293
+ behindDoc: oe.FALSE,
1293
1294
  title: "",
1294
1295
  description: "",
1295
- layoutType: k.INLINE,
1296
+ layoutType: H.INLINE,
1296
1297
  // Insert inline drawing by default.
1297
1298
  wrapText: $e.BOTH_SIDES,
1298
1299
  distB: 0,
@@ -1300,17 +1301,17 @@ let sn = class extends Xe {
1300
1301
  distR: 0,
1301
1302
  distT: 0
1302
1303
  };
1303
- this._isInsertInHeaderFooter() && (h.isMultiTransform = re.TRUE, h.transforms = h.transform ? [h.transform] : null), t.push(h);
1304
+ this._isInsertInHeaderFooter() && (h.isMultiTransform = oe.TRUE, h.transforms = h.transform ? [h.transform] : null), t.push(h);
1304
1305
  }
1305
- this._commandService.executeCommand(lt.id, {
1306
+ this._commandService.executeCommand(at.id, {
1306
1307
  unitId: n,
1307
1308
  drawings: t
1308
1309
  });
1309
1310
  }
1310
1311
  _isInsertInHeaderFooter() {
1311
1312
  var t;
1312
- const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(oe).getViewModel(), n = e == null ? void 0 : e.getEditArea();
1313
- return n === Ue.HEADER || n === Ue.FOOTER;
1313
+ const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(se).getViewModel(), n = e == null ? void 0 : e.getEditArea();
1314
+ return n === ke.HEADER || n === ke.FOOTER;
1314
1315
  }
1315
1316
  _getImagePosition(i, e) {
1316
1317
  const n = this._docSelectionRenderService.getActiveTextRange(), t = (n == null ? void 0 : n.getAbsolutePosition()) || {
@@ -1323,11 +1324,11 @@ let sn = class extends Xe {
1323
1324
  height: e
1324
1325
  },
1325
1326
  positionH: {
1326
- relativeFrom: ee.PAGE,
1327
+ relativeFrom: ne.PAGE,
1327
1328
  posOffset: t.left
1328
1329
  },
1329
1330
  positionV: {
1330
- relativeFrom: G.PARAGRAPH,
1331
+ relativeFrom: V.PARAGRAPH,
1331
1332
  posOffset: 0
1332
1333
  },
1333
1334
  angle: 0
@@ -1336,7 +1337,7 @@ let sn = class extends Xe {
1336
1337
  _updateOrderListener() {
1337
1338
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
1338
1339
  const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: r } = i;
1339
- this._commandService.executeCommand(gt.id, {
1340
+ this._commandService.executeCommand(ct.id, {
1340
1341
  unitId: e,
1341
1342
  subUnitId: n,
1342
1343
  drawingIds: t,
@@ -1346,9 +1347,9 @@ let sn = class extends Xe {
1346
1347
  }
1347
1348
  _groupDrawingListener() {
1348
1349
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
1349
- this._commandService.executeCommand(dt.id, i);
1350
+ this._commandService.executeCommand(st.id, i);
1350
1351
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
1351
- this._commandService.executeCommand(mt.id, i);
1352
+ this._commandService.executeCommand(dt.id, i);
1352
1353
  });
1353
1354
  }
1354
1355
  _getCurrentSceneAndTransformer() {
@@ -1361,7 +1362,7 @@ let sn = class extends Xe {
1361
1362
  _transformDrawingListener() {
1362
1363
  const i = this._getCurrentSceneAndTransformer();
1363
1364
  if (i && i.transformer)
1364
- this.disposeWithMe(i.transformer.changeEnd$.pipe(Yn(30)).subscribe((e) => {
1365
+ this.disposeWithMe(i.transformer.changeEnd$.pipe(qn(30)).subscribe((e) => {
1365
1366
  this._docSelectionManagerService.refreshSelection();
1366
1367
  }));
1367
1368
  else
@@ -1389,35 +1390,35 @@ let sn = class extends Xe {
1389
1390
  );
1390
1391
  }
1391
1392
  _findSegmentIdByDrawingId(i) {
1392
- var s, a, d;
1393
+ var s, c, d;
1393
1394
  const { unit: e } = this._context, { body: n, headers: t = {}, footers: r = {} } = e.getSnapshot();
1394
- if (((s = n == null ? void 0 : n.customBlocks) != null ? s : []).some((c) => c.blockId === i))
1395
+ if (((s = n == null ? void 0 : n.customBlocks) != null ? s : []).some((a) => a.blockId === i))
1395
1396
  return "";
1396
- for (const c of Object.keys(t))
1397
- if ((a = t[c].body.customBlocks) != null && a.some((l) => l.blockId === i))
1398
- return c;
1399
- for (const c of Object.keys(r))
1400
- if ((d = r[c].body.customBlocks) != null && d.some((l) => l.blockId === i))
1401
- return c;
1397
+ for (const a of Object.keys(t))
1398
+ if ((c = t[a].body.customBlocks) != null && c.some((l) => l.blockId === i))
1399
+ return a;
1400
+ for (const a of Object.keys(r))
1401
+ if ((d = r[a].body.customBlocks) != null && d.some((l) => l.blockId === i))
1402
+ return a;
1402
1403
  return "";
1403
1404
  }
1404
1405
  // Update drawings edit status and opacity. You can not edit header footer images when you are editing body. and vice verse.
1405
1406
  _updateDrawingsEditStatus() {
1406
- var a;
1407
- const { unit: i, scene: e, unitId: n } = this._context, t = (a = this._renderManagerSrv.getRenderById(n)) == null ? void 0 : a.with(oe).getViewModel();
1407
+ var c;
1408
+ const { unit: i, scene: e, unitId: n } = this._context, t = (c = this._renderManagerSrv.getRenderById(n)) == null ? void 0 : c.with(se).getViewModel();
1408
1409
  if (t == null || i == null)
1409
1410
  return;
1410
- const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Ue.BODY;
1411
+ const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === ke.BODY;
1411
1412
  for (const d of Object.keys(o)) {
1412
- const c = o[d], l = Kt({ unitId: n, drawingId: c.drawingId, subUnitId: n }), u = e.fuzzyMathObjects(l, !0);
1413
+ const a = o[d], l = zt({ unitId: n, drawingId: a.drawingId, subUnitId: n }), u = e.fuzzyMathObjects(l, !0);
1413
1414
  if (u.length)
1414
- for (const m of u)
1415
- e.detachTransformerFrom(m), m.setOpacity(0.5), (s && c.isMultiTransform !== re.TRUE || !s && c.isMultiTransform === re.TRUE) && (e.attachTransformerTo(m), m.setOpacity(1));
1415
+ for (const g of u)
1416
+ e.detachTransformerFrom(g), g.setOpacity(0.5), (s && a.isMultiTransform !== oe.TRUE || !s && a.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
1416
1417
  }
1417
1418
  }
1418
1419
  _editAreaChangeListener() {
1419
1420
  var n;
1420
- const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(oe).getViewModel();
1421
+ const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(se).getViewModel();
1421
1422
  e != null && (this._updateDrawingsEditStatus(), this.disposeWithMe(
1422
1423
  e.editAreaChange$.subscribe(() => {
1423
1424
  this._updateDrawingsEditStatus();
@@ -1428,7 +1429,7 @@ let sn = class extends Xe {
1428
1429
  });
1429
1430
  }), this.disposeWithMe(
1430
1431
  this._commandService.onCommandExecuted(async (t) => {
1431
- t.id === Z.id && queueMicrotask(() => {
1432
+ t.id === J.id && queueMicrotask(() => {
1432
1433
  this._updateDrawingsEditStatus();
1433
1434
  });
1434
1435
  })
@@ -1437,53 +1438,53 @@ let sn = class extends Xe {
1437
1438
  _setDrawingSelections(i) {
1438
1439
  var r, o;
1439
1440
  const { unit: e } = this._context, n = (o = (r = e.getSnapshot().body) == null ? void 0 : r.customBlocks) != null ? o : [], t = i.map((s) => {
1440
- const a = s.drawingId, d = n.find((c) => c.blockId === a);
1441
+ const c = s.drawingId, d = n.find((a) => a.blockId === c);
1441
1442
  return d ? d.startIndex : null;
1442
1443
  }).filter((s) => s !== null).map((s) => ({ startOffset: s, endOffset: s + 1 }));
1443
1444
  this._docSelectionManagerService.replaceDocRanges(t);
1444
1445
  }
1445
1446
  };
1446
- sn = qi([
1447
- ge(1, z),
1448
- ge(2, we(_n)),
1449
- ge(3, Q),
1450
- ge(4, Yt),
1451
- ge(5, je),
1452
- ge(6, ve),
1453
- ge(7, zn),
1454
- ge(8, ci),
1455
- ge(9, we(ln)),
1456
- ge(10, we(ye)),
1457
- ge(11, we(gn)),
1458
- ge(12, di)
1447
+ sn = Vi([
1448
+ me(1, z),
1449
+ me(2, ve(In)),
1450
+ me(3, ee),
1451
+ me(4, qt),
1452
+ me(5, Be),
1453
+ me(6, Ie),
1454
+ me(7, Vn),
1455
+ me(8, oi),
1456
+ me(9, ve(ln)),
1457
+ me(10, ve(Me)),
1458
+ me(11, ve(gn)),
1459
+ me(12, si)
1459
1460
  ], sn);
1460
- const ut = {
1461
+ const lt = {
1461
1462
  id: "doc.command.insert-float-image",
1462
- type: X.COMMAND,
1463
+ type: K.COMMAND,
1463
1464
  handler: (i) => {
1464
1465
  var n, t;
1465
- return (t = (n = i.get(Q).getCurrentTypeOfRenderer(Te.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
1466
+ return (t = (n = i.get(ee).getCurrentTypeOfRenderer(ye.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
1466
1467
  }
1467
1468
  }, Ke = {
1468
1469
  id: "doc.command.move-drawing",
1469
- type: X.COMMAND,
1470
+ type: K.COMMAND,
1470
1471
  handler: (i, e) => {
1471
- const n = i.get(z), t = i.get(je), r = i.get(J), o = i.get(Q), { direction: s } = e, a = t.getFocusDrawings();
1472
- if (a.length === 0)
1472
+ const n = i.get(z), t = i.get(Be), r = i.get(Q), o = i.get(ee), { direction: s } = e, c = t.getFocusDrawings();
1473
+ if (c.length === 0)
1473
1474
  return !1;
1474
- const d = a[0].unitId, c = o.getRenderById(d), l = c == null ? void 0 : c.scene;
1475
+ const d = c[0].unitId, a = o.getRenderById(d), l = a == null ? void 0 : a.scene;
1475
1476
  if (l == null)
1476
1477
  return !1;
1477
- const u = l.getTransformerByCreate(), m = r.getUniverDocInstance(d), p = a.map((v) => {
1478
- var T, N, B, R, I;
1479
- const { drawingId: w } = v, S = (T = m == null ? void 0 : m.getSnapshot().drawings) == null ? void 0 : T[w];
1480
- if (S == null || S.layoutType === k.INLINE)
1478
+ const u = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = c.map((v) => {
1479
+ var b, A, U, N, I;
1480
+ const { drawingId: w } = v, S = (b = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : b[w];
1481
+ if (S == null || S.layoutType === H.INLINE)
1481
1482
  return null;
1482
- const { positionH: O, positionV: D } = S.docTransform, x = { ...O }, b = { ...D };
1483
- return s === ue.UP ? b.posOffset = ((N = b.posOffset) != null ? N : 0) - 2 : s === ue.DOWN ? b.posOffset = ((B = b.posOffset) != null ? B : 0) + 2 : s === ue.LEFT ? x.posOffset = ((R = x.posOffset) != null ? R : 0) - 2 : s === ue.RIGHT && (x.posOffset = ((I = x.posOffset) != null ? I : 0) + 2), {
1483
+ const { positionH: O, positionV: D } = S.docTransform, P = { ...O }, M = { ...D };
1484
+ return s === fe.UP ? M.posOffset = ((A = M.posOffset) != null ? A : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ? P.posOffset = ((N = P.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (P.posOffset = ((I = P.posOffset) != null ? I : 0) + 2), {
1484
1485
  drawingId: w,
1485
- key: s === ue.UP || s === ue.DOWN ? "positionV" : "positionH",
1486
- value: s === ue.UP || s === ue.DOWN ? b : x
1486
+ key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
1487
+ value: s === fe.UP || s === fe.DOWN ? M : P
1487
1488
  };
1488
1489
  }).filter((v) => v != null);
1489
1490
  if (p.length === 0)
@@ -1495,26 +1496,26 @@ const ut = {
1495
1496
  });
1496
1497
  return u.refreshControls(), !!h;
1497
1498
  }
1498
- }, Xi = {
1499
+ }, ji = {
1499
1500
  id: "doc.operation.clear-drawing-transformer",
1500
- type: X.MUTATION,
1501
+ type: K.MUTATION,
1501
1502
  handler: (i, e) => {
1502
- const n = i.get(Q);
1503
+ const n = i.get(ee);
1503
1504
  return e.forEach((t) => {
1504
1505
  var r, o;
1505
1506
  (o = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || o.debounceRefreshControls();
1506
1507
  }), !0;
1507
1508
  }
1508
- }, ft = "COMPONENT_DOC_DRAWING_PANEL", ht = {
1509
+ }, gt = "COMPONENT_DOC_DRAWING_PANEL", mt = {
1509
1510
  id: "sidebar.operation.doc-image",
1510
- type: X.COMMAND,
1511
+ type: K.COMMAND,
1511
1512
  handler: async (i, e) => {
1512
- const n = i.get(li), t = i.get(ln), r = i.get(ve);
1513
+ const n = i.get(ai), t = i.get(ln), r = i.get(Ie);
1513
1514
  switch (e.value) {
1514
1515
  case "open":
1515
1516
  n.open({
1516
1517
  header: { title: t.t("docImage.panel.title") },
1517
- children: { label: ft },
1518
+ children: { label: gt },
1518
1519
  onClose: () => {
1519
1520
  r.focusDrawing(null);
1520
1521
  },
@@ -1528,239 +1529,210 @@ const ut = {
1528
1529
  }
1529
1530
  return !0;
1530
1531
  }
1531
- }, pt = {
1532
+ }, ut = {
1532
1533
  id: "doc.operation.edit-doc-image",
1533
- type: X.OPERATION,
1534
+ type: K.OPERATION,
1534
1535
  handler: (i, e) => {
1535
- const n = i.get(ve), t = i.get(z);
1536
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(ht.id, { value: "open" }), !0);
1536
+ const n = i.get(Ie), t = i.get(z);
1537
+ return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(mt.id, { value: "open" }), !0);
1537
1538
  }
1538
1539
  };
1539
- var pn = { exports: {} }, Ge = {};
1540
- /**
1541
- * @license React
1542
- * react-jsx-runtime.production.min.js
1543
- *
1544
- * Copyright (c) Facebook, Inc. and its affiliates.
1545
- *
1546
- * This source code is licensed under the MIT license found in the
1547
- * LICENSE file in the root directory of this source tree.
1548
- */
1549
- var Hn;
1550
- function Ki() {
1551
- if (Hn) return Ge;
1552
- Hn = 1;
1553
- var i = Ti, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
1554
- function s(a, d, c) {
1555
- var l, u = {}, m = null, p = null;
1556
- c !== void 0 && (m = "" + c), d.key !== void 0 && (m = "" + d.key), d.ref !== void 0 && (p = d.ref);
1557
- for (l in d) t.call(d, l) && !o.hasOwnProperty(l) && (u[l] = d[l]);
1558
- if (a && a.defaultProps) for (l in d = a.defaultProps, d) u[l] === void 0 && (u[l] = d[l]);
1559
- return { $$typeof: e, type: a, key: m, ref: p, props: u, _owner: r.current };
1560
- }
1561
- return Ge.Fragment = n, Ge.jsx = s, Ge.jsxs = s, Ge;
1562
- }
1563
- var Wn;
1564
- function Yi() {
1565
- return Wn || (Wn = 1, pn.exports = Ki()), pn.exports;
1566
- }
1567
- var g = Yi();
1568
- function wt(i) {
1540
+ function ft(i) {
1569
1541
  var e, n, t = "";
1570
1542
  if (typeof i == "string" || typeof i == "number") t += i;
1571
1543
  else if (typeof i == "object") if (Array.isArray(i)) {
1572
1544
  var r = i.length;
1573
- for (e = 0; e < r; e++) i[e] && (n = wt(i[e])) && (t && (t += " "), t += n);
1545
+ for (e = 0; e < r; e++) i[e] && (n = ft(i[e])) && (t && (t += " "), t += n);
1574
1546
  } else for (n in i) i[n] && (t && (t += " "), t += n);
1575
1547
  return t;
1576
1548
  }
1577
- function V() {
1578
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = wt(i)) && (t && (t += " "), t += e);
1549
+ function j() {
1550
+ for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
1579
1551
  return t;
1580
1552
  }
1581
- const Ji = "univer-image-common-panel", Zi = "univer-image-common-panel-grid", Qi = "univer-image-common-panel-border", er = "univer-image-common-panel-title", nr = "univer-image-common-panel-subtitle", tr = "univer-image-common-panel-row", ir = "univer-image-common-panel-row-vertical", rr = "univer-image-common-panel-column", or = "univer-image-common-panel-column-center", sr = "univer-image-common-panel-inline", ar = "univer-image-common-panel-span2", cr = "univer-image-common-panel-span3", dr = "univer-image-common-panel-input", lr = "univer-sheet-image-menu", gr = "univer-sheet-image-menu-input", f = {
1582
- imageCommonPanel: Ji,
1583
- imageCommonPanelGrid: Zi,
1584
- imageCommonPanelBorder: Qi,
1585
- imageCommonPanelTitle: er,
1586
- imageCommonPanelSubtitle: nr,
1587
- imageCommonPanelRow: tr,
1588
- imageCommonPanelRowVertical: ir,
1589
- imageCommonPanelColumn: rr,
1590
- imageCommonPanelColumnCenter: or,
1591
- imageCommonPanelInline: sr,
1592
- imageCommonPanelSpan2: ar,
1593
- imageCommonPanelSpan3: cr,
1594
- imageCommonPanelInput: dr,
1595
- sheetImageMenu: lr,
1596
- sheetImageMenuInput: gr
1597
- }, Gn = -1e3, Vn = 1e3, mr = (i) => {
1598
- const e = pe(z), n = pe(ln), t = pe(ve), r = pe(Q), o = pe(J), { drawings: s } = i, a = s[0];
1599
- if (a == null)
1553
+ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", qi = "univer-image-common-panel-border", Xi = "univer-image-common-panel-title", Ki = "univer-image-common-panel-subtitle", Yi = "univer-image-common-panel-row", Zi = "univer-image-common-panel-row-vertical", Qi = "univer-image-common-panel-column", Ji = "univer-image-common-panel-column-center", er = "univer-image-common-panel-inline", nr = "univer-image-common-panel-span2", tr = "univer-image-common-panel-span3", ir = "univer-image-common-panel-input", rr = "univer-sheet-image-menu", or = "univer-sheet-image-menu-input", m = {
1554
+ imageCommonPanel: $i,
1555
+ imageCommonPanelGrid: zi,
1556
+ imageCommonPanelBorder: qi,
1557
+ imageCommonPanelTitle: Xi,
1558
+ imageCommonPanelSubtitle: Ki,
1559
+ imageCommonPanelRow: Yi,
1560
+ imageCommonPanelRowVertical: Zi,
1561
+ imageCommonPanelColumn: Qi,
1562
+ imageCommonPanelColumnCenter: Ji,
1563
+ imageCommonPanelInline: er,
1564
+ imageCommonPanelSpan2: nr,
1565
+ imageCommonPanelSpan3: tr,
1566
+ imageCommonPanelInput: ir,
1567
+ sheetImageMenu: rr,
1568
+ sheetImageMenuInput: or
1569
+ }, Hn = -1e3, Wn = 1e3, sr = (i) => {
1570
+ const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
1571
+ if (c == null)
1600
1572
  return;
1601
- const { unitId: d } = a, c = o.getUniverDocInstance(d), l = c == null ? void 0 : c.getSnapshot().documentStyle.documentFlavor, u = r.getRenderById(d), m = u == null ? void 0 : u.scene;
1602
- if (m == null)
1573
+ const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, u = r.getRenderById(d), g = u == null ? void 0 : u.scene;
1574
+ if (g == null)
1603
1575
  return;
1604
- const p = m.getTransformerByCreate(), h = [{
1576
+ const p = g.getTransformerByCreate(), h = [{
1605
1577
  label: n.t("image-position.column"),
1606
- value: String(ee.COLUMN)
1578
+ value: String(ne.COLUMN)
1607
1579
  }, {
1608
1580
  label: n.t("image-position.page"),
1609
- value: String(ee.PAGE)
1581
+ value: String(ne.PAGE)
1610
1582
  }, {
1611
1583
  label: n.t("image-position.margin"),
1612
- value: String(ee.MARGIN)
1584
+ value: String(ne.MARGIN)
1613
1585
  }], v = [{
1614
1586
  label: n.t("image-position.line"),
1615
- value: String(G.LINE),
1587
+ value: String(V.LINE),
1616
1588
  disabled: l === fn.MODERN
1617
1589
  }, {
1618
1590
  label: n.t("image-position.page"),
1619
- value: String(G.PAGE),
1591
+ value: String(V.PAGE),
1620
1592
  disabled: l === fn.MODERN
1621
1593
  }, {
1622
1594
  label: n.t("image-position.margin"),
1623
- value: String(G.MARGIN),
1595
+ value: String(V.MARGIN),
1624
1596
  disabled: l === fn.MODERN
1625
1597
  }, {
1626
1598
  label: n.t("image-position.paragraph"),
1627
- value: String(G.PARAGRAPH)
1628
- }], [w, S] = ie(!0), [O, D] = ie({
1629
- relativeFrom: ee.PAGE,
1599
+ value: String(V.PARAGRAPH)
1600
+ }], [w, S] = re(!0), [O, D] = re({
1601
+ relativeFrom: ne.PAGE,
1630
1602
  posOffset: 0
1631
- }), [x, b] = ie({
1632
- relativeFrom: G.PAGE,
1603
+ }), [P, M] = re({
1604
+ relativeFrom: V.PAGE,
1633
1605
  posOffset: 0
1634
- }), [T, N] = ie(!0), [B, R] = ie(!0);
1635
- function I(C, M) {
1606
+ }), [b, A] = re(!0), [U, N] = re(!0);
1607
+ function I(C, R) {
1636
1608
  var y;
1637
- C === "positionH" ? D(M) : b(M);
1638
- const P = t.getFocusDrawings();
1639
- if (P.length === 0)
1609
+ C === "positionH" ? D(R) : M(R);
1610
+ const T = t.getFocusDrawings();
1611
+ if (T.length === 0)
1640
1612
  return;
1641
- const L = P.map((E) => ({
1613
+ const B = T.map((E) => ({
1642
1614
  unitId: E.unitId,
1643
1615
  subUnitId: E.subUnitId,
1644
1616
  drawingId: E.drawingId
1645
1617
  }));
1646
1618
  e.executeCommand(qe.id, {
1647
- unitId: P[0].unitId,
1648
- subUnitId: P[0].unitId,
1649
- drawings: L.map((E) => ({
1619
+ unitId: T[0].unitId,
1620
+ subUnitId: T[0].unitId,
1621
+ drawings: B.map((E) => ({
1650
1622
  drawingId: E.drawingId,
1651
1623
  key: C,
1652
- value: M
1624
+ value: R
1653
1625
  }))
1654
1626
  });
1655
- const U = (y = r.getRenderById(d)) == null ? void 0 : y.with(ye);
1656
- U && U.blur(), p.refreshControls();
1627
+ const F = (y = r.getRenderById(d)) == null ? void 0 : y.with(Me);
1628
+ F && F.blur(), p.refreshControls();
1657
1629
  }
1658
- function j(C) {
1659
- var te, Ie, _e;
1660
- const M = O.relativeFrom, P = O.posOffset, L = Number(C);
1661
- if (M === L)
1630
+ function L(C) {
1631
+ var ie, _e, Se;
1632
+ const R = O.relativeFrom, T = O.posOffset, B = Number(C);
1633
+ if (R === B)
1662
1634
  return;
1663
- const U = t.getFocusDrawings();
1664
- if (U.length === 0)
1635
+ const F = t.getFocusDrawings();
1636
+ if (F.length === 0)
1665
1637
  return;
1666
- const y = U[0].drawingId, E = U[0].unitId;
1667
- let $ = null, F = 0;
1668
- const K = (te = r.getRenderById(E)) == null ? void 0 : te.with(oe).getSkeleton(), se = K == null ? void 0 : K.getSkeletonData();
1669
- if (se == null)
1638
+ const y = F[0].drawingId, E = F[0].unitId;
1639
+ let $ = null, k = 0;
1640
+ const Y = (ie = r.getRenderById(E)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
1641
+ if (ae == null)
1670
1642
  return;
1671
- const { pages: Le, skeHeaders: be, skeFooters: ke } = se;
1672
- for (const ce of Le) {
1673
- const { marginLeft: Ce, skeDrawings: De, headerId: Me, footerId: Re, pageWidth: Oe } = ce;
1674
- if (De.has(y)) {
1675
- $ = De.get(y), F = Ce;
1643
+ const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
1644
+ for (const de of Ue) {
1645
+ const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth: Pe } = de;
1646
+ if (Oe.has(y)) {
1647
+ $ = Oe.get(y), k = De;
1676
1648
  break;
1677
1649
  }
1678
- const de = (Ie = be.get(Me)) == null ? void 0 : Ie.get(Oe);
1679
- if (de != null && de.skeDrawings.has(y)) {
1680
- $ = de == null ? void 0 : de.skeDrawings.get(y), F = Ce;
1650
+ const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(Pe);
1651
+ if (le != null && le.skeDrawings.has(y)) {
1652
+ $ = le == null ? void 0 : le.skeDrawings.get(y), k = De;
1681
1653
  break;
1682
1654
  }
1683
- const le = (_e = ke.get(Re)) == null ? void 0 : _e.get(Oe);
1684
- if (le != null && le.skeDrawings.has(y)) {
1685
- $ = le == null ? void 0 : le.skeDrawings.get(y), F = Ce;
1655
+ const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(Pe);
1656
+ if (ge != null && ge.skeDrawings.has(y)) {
1657
+ $ = ge == null ? void 0 : ge.skeDrawings.get(y), k = De;
1686
1658
  break;
1687
1659
  }
1688
1660
  }
1689
1661
  if ($ == null)
1690
1662
  return;
1691
- let ae = 0;
1692
- M === ee.COLUMN ? ae -= $.columnLeft : M === ee.MARGIN && (ae -= F), L === ee.COLUMN ? ae += $.columnLeft : L === ee.MARGIN ? ae += F : ee.PAGE;
1693
- const ne = {
1694
- relativeFrom: L,
1695
- posOffset: (P != null ? P : 0) - ae
1663
+ let ce = 0;
1664
+ R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= k), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += k : ne.PAGE;
1665
+ const te = {
1666
+ relativeFrom: B,
1667
+ posOffset: (T != null ? T : 0) - ce
1696
1668
  };
1697
- I("positionH", ne);
1669
+ I("positionH", te);
1698
1670
  }
1699
- function H(C) {
1700
- var De, Me, Re, Oe, de, le;
1701
- const M = x.relativeFrom, P = x.posOffset, L = Number(C);
1702
- if (M === L)
1671
+ function W(C) {
1672
+ var Oe, Ne, Ae, Pe, le, ge;
1673
+ const R = P.relativeFrom, T = P.posOffset, B = Number(C);
1674
+ if (R === B)
1703
1675
  return;
1704
- const U = t.getFocusDrawings();
1705
- if (U.length === 0)
1676
+ const F = t.getFocusDrawings();
1677
+ if (F.length === 0)
1706
1678
  return;
1707
- const { drawingId: y, unitId: E } = U[0], $ = o.getUniverDocInstance(E), F = (De = r.getRenderById(E)) == null ? void 0 : De.with(oe).getSkeleton(), K = (Me = r.getRenderById(E)) == null ? void 0 : Me.with(ye), se = K == null ? void 0 : K.getSegment(), Le = K == null ? void 0 : K.getSegmentPage(), be = (Oe = (Re = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(se).getBody()) == null ? void 0 : Re.customBlocks) == null ? void 0 : Oe.find((Ne) => Ne.blockId === y);
1708
- if (be == null || F == null || K == null)
1679
+ const { drawingId: y, unitId: E } = F[0], $ = o.getUniverDocInstance(E), k = (Oe = r.getRenderById(E)) == null ? void 0 : Oe.with(se).getSkeleton(), Y = (Ne = r.getRenderById(E)) == null ? void 0 : Ne.with(Me), ae = Y == null ? void 0 : Y.getSegment(), Ue = Y == null ? void 0 : Y.getSegmentPage(), Re = (Pe = (Ae = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Pe.find((Ee) => Ee.blockId === y);
1680
+ if (Re == null || k == null || Y == null)
1709
1681
  return;
1710
- const { startIndex: ke } = be, ae = F.findNodeByCharIndex(ke, se, Le), ne = (de = ae == null ? void 0 : ae.parent) == null ? void 0 : de.parent, te = ne == null ? void 0 : ne.parent, Ie = te == null ? void 0 : te.lines.find((Ne) => Ne.paragraphIndex === (ne == null ? void 0 : ne.paragraphIndex) && Ne.paragraphStart), _e = (le = te == null ? void 0 : te.parent) == null ? void 0 : le.parent;
1711
- if (ae == null || ne == null || Ie == null || te == null || _e == null)
1682
+ const { startIndex: We } = Re, ce = k.findNodeByCharIndex(We, ae, Ue), te = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, ie = te == null ? void 0 : te.parent, _e = ie == null ? void 0 : ie.lines.find((Ee) => Ee.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ee.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
1683
+ if (ce == null || te == null || _e == null || ie == null || Se == null)
1712
1684
  return;
1713
- let ce = 0;
1714
- M === G.PARAGRAPH ? ce -= Ie.top : M === G.LINE ? ce -= ne.top : M === G.PAGE && (ce += _e.marginTop), L === G.PARAGRAPH ? ce += Ie.top : L === G.LINE ? ce += ne.top : L === G.PAGE && (ce -= _e.marginTop);
1715
- const Ce = {
1716
- relativeFrom: L,
1717
- posOffset: (P != null ? P : 0) - ce
1685
+ let de = 0;
1686
+ R === V.PARAGRAPH ? de -= _e.top : R === V.LINE ? de -= te.top : R === V.PAGE && (de += Se.marginTop), B === V.PARAGRAPH ? de += _e.top : B === V.LINE ? de += te.top : B === V.PAGE && (de -= Se.marginTop);
1687
+ const De = {
1688
+ relativeFrom: B,
1689
+ posOffset: (T != null ? T : 0) - de
1718
1690
  };
1719
- I("positionV", Ce);
1691
+ I("positionV", De);
1720
1692
  }
1721
- function A(C) {
1693
+ function x(C) {
1722
1694
  var E;
1723
- const M = c == null ? void 0 : c.getSnapshot(), P = (E = M == null ? void 0 : M.drawings) == null ? void 0 : E[C.drawingId];
1724
- if (P == null)
1695
+ const R = a == null ? void 0 : a.getSnapshot(), T = (E = R == null ? void 0 : R.drawings) == null ? void 0 : E[C.drawingId];
1696
+ if (T == null)
1725
1697
  return;
1726
- const { layoutType: L } = P, {
1727
- positionH: U,
1698
+ const { layoutType: B } = T, {
1699
+ positionH: F,
1728
1700
  positionV: y
1729
- } = P.docTransform;
1730
- D(U), b(y), S(L === k.INLINE), N(y.relativeFrom === G.PARAGRAPH || y.relativeFrom === G.LINE);
1701
+ } = T.docTransform;
1702
+ D(F), M(y), S(B === H.INLINE), A(y.relativeFrom === V.PARAGRAPH || y.relativeFrom === V.LINE);
1731
1703
  }
1732
- function W() {
1704
+ function G() {
1733
1705
  const C = t.getFocusDrawings();
1734
- C.length !== 0 && A(C[0]);
1706
+ C.length !== 0 && x(C[0]);
1735
1707
  }
1736
1708
  function _(C) {
1737
- N(C), H(String(C ? G.PARAGRAPH : G.PAGE));
1709
+ A(C), W(String(C ? V.PARAGRAPH : V.PAGE));
1738
1710
  }
1739
- return Sn(() => {
1740
- W();
1741
- const C = t.focus$.subscribe((P) => {
1742
- if (P.length === 0) {
1743
- R(!1);
1711
+ return _n(() => {
1712
+ G();
1713
+ const C = t.focus$.subscribe((T) => {
1714
+ if (T.length === 0) {
1715
+ N(!1);
1744
1716
  return;
1745
1717
  }
1746
- R(!0), A(P[0]);
1747
- }), M = e.onCommandExecuted(async (P) => {
1748
- P.id === Z.id && W();
1718
+ N(!0), x(T[0]);
1719
+ }), R = e.onCommandExecuted(async (T) => {
1720
+ T.id === J.id && G();
1749
1721
  });
1750
1722
  return () => {
1751
- C.unsubscribe(), M.dispose();
1723
+ C.unsubscribe(), R.dispose();
1752
1724
  };
1753
- }, []), /* @__PURE__ */ g.jsxs("div", { className: V(f.imageCommonPanelGrid, f.imageCommonPanelBorder), style: { display: B ? "block" : "none" }, children: [
1754
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelTitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-position.title") }) }) }),
1755
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-position.horizontal") }) }) }),
1756
- /* @__PURE__ */ g.jsxs("div", { className: f.imageCommonPanelRow, children: [
1757
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
1758
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
1759
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
1760
- Be,
1725
+ }, []), /* @__PURE__ */ X("div", { className: j(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
1726
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.title") }) }) }),
1727
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.horizontal") }) }) }),
1728
+ /* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
1729
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1730
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
1731
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1732
+ Fe,
1761
1733
  {
1762
- min: Gn,
1763
- max: Vn,
1734
+ min: Hn,
1735
+ max: Wn,
1764
1736
  precision: 1,
1765
1737
  disabled: w,
1766
1738
  value: O.posOffset,
@@ -1770,299 +1742,299 @@ const Ji = "univer-image-common-panel", Zi = "univer-image-common-panel-grid", Q
1770
1742
  posOffset: C
1771
1743
  });
1772
1744
  },
1773
- className: f.imageCommonPanelInput
1745
+ className: m.imageCommonPanelInput
1774
1746
  }
1775
1747
  ) }) })
1776
1748
  ] }) }),
1777
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
1778
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
1779
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
1749
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1750
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
1751
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1780
1752
  Bn,
1781
1753
  {
1782
1754
  value: String(O.relativeFrom),
1783
1755
  disabled: w,
1784
1756
  options: h,
1785
- onChange: j
1757
+ onChange: L
1786
1758
  }
1787
1759
  ) }) })
1788
1760
  ] }) })
1789
1761
  ] }),
1790
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-position.vertical") }) }) }),
1791
- /* @__PURE__ */ g.jsxs("div", { className: f.imageCommonPanelRow, children: [
1792
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
1793
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
1794
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
1795
- Be,
1762
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.vertical") }) }) }),
1763
+ /* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
1764
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1765
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
1766
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1767
+ Fe,
1796
1768
  {
1797
- min: Gn,
1798
- max: Vn,
1769
+ min: Hn,
1770
+ max: Wn,
1799
1771
  precision: 1,
1800
1772
  disabled: w,
1801
- value: x.posOffset,
1773
+ value: P.posOffset,
1802
1774
  onChange: (C) => {
1803
1775
  I("positionV", {
1804
- relativeFrom: x.relativeFrom,
1776
+ relativeFrom: P.relativeFrom,
1805
1777
  posOffset: C
1806
1778
  });
1807
1779
  },
1808
- className: f.imageCommonPanelInput
1780
+ className: m.imageCommonPanelInput
1809
1781
  }
1810
1782
  ) }) })
1811
1783
  ] }) }),
1812
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
1813
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
1814
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
1784
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1785
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
1786
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1815
1787
  Bn,
1816
1788
  {
1817
1789
  disabled: w,
1818
- value: String(x.relativeFrom),
1790
+ value: String(P.relativeFrom),
1819
1791
  options: v,
1820
- onChange: H
1792
+ onChange: W
1821
1793
  }
1822
1794
  ) }) })
1823
1795
  ] }) })
1824
1796
  ] }),
1825
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-position.options") }) }) }),
1826
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(Pi, { disabled: w, checked: T, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
1797
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
1798
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(Di, { disabled: w, checked: b, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
1827
1799
  ] });
1828
- }, Qe = 0, en = 100, ur = (i) => {
1829
- const e = pe(z), n = pe(ln), t = pe(ve), r = pe(Q), o = pe(J), { drawings: s } = i, a = s[0];
1830
- if (a == null)
1800
+ }, Je = 0, en = 100, ar = (i) => {
1801
+ const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
1802
+ if (c == null)
1831
1803
  return null;
1832
- const { unitId: d } = a, c = o.getUniverDocInstance(d), l = r.getRenderById(d);
1804
+ const { unitId: d } = c, a = o.getUniverDocInstance(d), l = r.getRenderById(d);
1833
1805
  if ((l == null ? void 0 : l.scene) == null)
1834
1806
  return null;
1835
- const [m, p] = ie(!0), [h, v] = ie(!0), [w, S] = ie(!0), [O, D] = ie(me.INLINE), [x, b] = ie(""), [T, N] = ie({
1807
+ const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [P, M] = re(""), [b, A] = re({
1836
1808
  distT: 0,
1837
1809
  distL: 0,
1838
1810
  distB: 0,
1839
1811
  distR: 0
1840
- }), [B, R] = ie(!0);
1812
+ }), [U, N] = re(!0);
1841
1813
  function I(_) {
1842
1814
  D(_);
1843
1815
  const C = t.getFocusDrawings();
1844
1816
  if (C.length === 0)
1845
1817
  return;
1846
- const { unitId: M, subUnitId: P } = C[0], L = C.map(({ unitId: U, subUnitId: y, drawingId: E }) => ({
1847
- unitId: U,
1818
+ const { unitId: R, subUnitId: T } = C[0], B = C.map(({ unitId: F, subUnitId: y, drawingId: E }) => ({
1819
+ unitId: F,
1848
1820
  subUnitId: y,
1849
1821
  drawingId: E
1850
1822
  }));
1851
- e.executeCommand(et.id, {
1852
- unitId: M,
1853
- subUnitId: P,
1854
- drawings: L,
1823
+ e.executeCommand(Zn.id, {
1824
+ unitId: R,
1825
+ subUnitId: T,
1826
+ drawings: B,
1855
1827
  wrappingStyle: _
1856
1828
  });
1857
1829
  }
1858
- function j(_) {
1859
- b(_);
1830
+ function L(_) {
1831
+ M(_);
1860
1832
  const C = t.getFocusDrawings();
1861
1833
  if (C.length === 0)
1862
1834
  return;
1863
- const M = C.map((P) => ({
1864
- unitId: P.unitId,
1865
- subUnitId: P.subUnitId,
1866
- drawingId: P.drawingId
1835
+ const R = C.map((T) => ({
1836
+ unitId: T.unitId,
1837
+ subUnitId: T.subUnitId,
1838
+ drawingId: T.drawingId
1867
1839
  }));
1868
- e.executeCommand(tt.id, {
1840
+ e.executeCommand(Jn.id, {
1869
1841
  unitId: C[0].unitId,
1870
1842
  subUnitId: C[0].unitId,
1871
- drawings: M,
1843
+ drawings: R,
1872
1844
  wrapText: _
1873
1845
  });
1874
1846
  }
1875
- function H(_, C) {
1847
+ function W(_, C) {
1876
1848
  if (_ == null)
1877
1849
  return;
1878
- const M = { ...T, [C]: _ };
1879
- N(M);
1880
- const P = t.getFocusDrawings();
1881
- if (P.length === 0)
1850
+ const R = { ...b, [C]: _ };
1851
+ A(R);
1852
+ const T = t.getFocusDrawings();
1853
+ if (T.length === 0)
1882
1854
  return;
1883
- const L = P.map((U) => ({
1884
- unitId: U.unitId,
1885
- subUnitId: U.subUnitId,
1886
- drawingId: U.drawingId
1855
+ const B = T.map((F) => ({
1856
+ unitId: F.unitId,
1857
+ subUnitId: F.subUnitId,
1858
+ drawingId: F.drawingId
1887
1859
  }));
1888
- e.executeCommand(nt.id, {
1889
- unitId: P[0].unitId,
1890
- subUnitId: P[0].unitId,
1891
- drawings: L,
1860
+ e.executeCommand(Qn.id, {
1861
+ unitId: T[0].unitId,
1862
+ subUnitId: T[0].unitId,
1863
+ drawings: B,
1892
1864
  dist: {
1893
1865
  [C]: _
1894
1866
  }
1895
1867
  });
1896
1868
  }
1897
- function A() {
1869
+ function x() {
1898
1870
  const _ = t.getFocusDrawings();
1899
- _.length !== 0 && W(_[0]);
1871
+ _.length !== 0 && G(_[0]);
1900
1872
  }
1901
- function W(_) {
1902
- var K, se;
1903
- const C = (se = (K = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : K.drawings) == null ? void 0 : se[_.drawingId];
1873
+ function G(_) {
1874
+ var Y, ae;
1875
+ const C = (ae = (Y = a == null ? void 0 : a.getSnapshot()) == null ? void 0 : Y.drawings) == null ? void 0 : ae[_.drawingId];
1904
1876
  if (C == null)
1905
1877
  return;
1906
1878
  const {
1907
- distT: M = 0,
1908
- distL: P = 0,
1909
- distB: L = 0,
1910
- distR: U = 0,
1911
- layoutType: y = k.INLINE,
1912
- behindDoc: E = re.FALSE,
1879
+ distT: R = 0,
1880
+ distL: T = 0,
1881
+ distB: B = 0,
1882
+ distR: F = 0,
1883
+ layoutType: y = H.INLINE,
1884
+ behindDoc: E = oe.FALSE,
1913
1885
  wrapText: $ = $e.BOTH_SIDES
1914
1886
  } = C;
1915
- if (N({
1916
- distT: M,
1917
- distL: P,
1918
- distB: L,
1919
- distR: U
1920
- }), b($), p(y !== k.WRAP_SQUARE), y === k.WRAP_NONE || y === k.INLINE ? v(!0) : v(!1), y === k.WRAP_NONE || y === k.INLINE || y === k.WRAP_TOP_AND_BOTTOM ? S(!0) : S(!1), y === k.WRAP_NONE)
1921
- E === re.TRUE ? D(me.BEHIND_TEXT) : D(me.IN_FRONT_OF_TEXT);
1887
+ if (A({
1888
+ distT: R,
1889
+ distL: T,
1890
+ distB: B,
1891
+ distR: F
1892
+ }), M($), p(y !== H.WRAP_SQUARE), y === H.WRAP_NONE || y === H.INLINE ? v(!0) : v(!1), y === H.WRAP_NONE || y === H.INLINE || y === H.WRAP_TOP_AND_BOTTOM ? S(!0) : S(!1), y === H.WRAP_NONE)
1893
+ E === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
1922
1894
  else
1923
1895
  switch (y) {
1924
- case k.INLINE:
1925
- D(me.INLINE);
1896
+ case H.INLINE:
1897
+ D(ue.INLINE);
1926
1898
  break;
1927
- case k.WRAP_SQUARE:
1928
- D(me.WRAP_SQUARE);
1899
+ case H.WRAP_SQUARE:
1900
+ D(ue.WRAP_SQUARE);
1929
1901
  break;
1930
- case k.WRAP_TOP_AND_BOTTOM:
1931
- D(me.WRAP_TOP_AND_BOTTOM);
1902
+ case H.WRAP_TOP_AND_BOTTOM:
1903
+ D(ue.WRAP_TOP_AND_BOTTOM);
1932
1904
  break;
1933
1905
  default:
1934
1906
  throw new Error(`Unsupported layout type: ${y}`);
1935
1907
  }
1936
1908
  }
1937
- return Sn(() => {
1938
- A();
1939
- const _ = t.focus$.subscribe((M) => {
1940
- if (M.length === 0) {
1941
- R(!1);
1909
+ return _n(() => {
1910
+ x();
1911
+ const _ = t.focus$.subscribe((R) => {
1912
+ if (R.length === 0) {
1913
+ N(!1);
1942
1914
  return;
1943
1915
  }
1944
- R(!0), W(M[0]);
1945
- }), C = e.onCommandExecuted(async (M) => {
1946
- M.id === Z.id && A();
1916
+ N(!0), G(R[0]);
1917
+ }), C = e.onCommandExecuted(async (R) => {
1918
+ R.id === J.id && x();
1947
1919
  });
1948
1920
  return () => {
1949
1921
  _.unsubscribe(), C.dispose();
1950
1922
  };
1951
- }, []), /* @__PURE__ */ g.jsxs("div", { className: V(f.imageCommonPanelGrid, f.imageCommonPanelBorder), style: { display: B ? "block" : "none" }, children: [
1952
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelTitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-text-wrap.title") }) }) }),
1953
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
1954
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelRow), children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn), children: /* @__PURE__ */ g.jsxs(Un, { value: O, onChange: I, direction: "vertical", children: [
1955
- /* @__PURE__ */ g.jsx(xe, { value: me.INLINE, children: n.t("image-text-wrap.inline") }),
1956
- /* @__PURE__ */ g.jsx(xe, { value: me.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
1957
- /* @__PURE__ */ g.jsx(xe, { value: me.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
1958
- /* @__PURE__ */ g.jsx(xe, { value: me.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
1959
- /* @__PURE__ */ g.jsx(xe, { value: me.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
1923
+ }, []), /* @__PURE__ */ X("div", { className: j(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
1924
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
1925
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
1926
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { value: O, onChange: I, direction: "vertical", children: [
1927
+ /* @__PURE__ */ f(Te, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
1928
+ /* @__PURE__ */ f(Te, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
1929
+ /* @__PURE__ */ f(Te, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
1930
+ /* @__PURE__ */ f(Te, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
1931
+ /* @__PURE__ */ f(Te, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
1960
1932
  ] }) }) }),
1961
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
1962
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelRow), children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn), children: /* @__PURE__ */ g.jsxs(Un, { disabled: m, value: x, onChange: j, direction: "horizontal", children: [
1963
- /* @__PURE__ */ g.jsx(xe, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
1964
- /* @__PURE__ */ g.jsx(xe, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
1965
- /* @__PURE__ */ g.jsx(xe, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
1933
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
1934
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { disabled: g, value: P, onChange: L, direction: "horizontal", children: [
1935
+ /* @__PURE__ */ f(Te, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
1936
+ /* @__PURE__ */ f(Te, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
1937
+ /* @__PURE__ */ f(Te, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
1966
1938
  ] }) }) }),
1967
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSubtitle), children: /* @__PURE__ */ g.jsx("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
1968
- /* @__PURE__ */ g.jsxs("div", { className: f.imageCommonPanelRow, children: [
1969
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
1970
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
1971
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
1972
- Be,
1939
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
1940
+ /* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
1941
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1942
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
1943
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1944
+ Fe,
1973
1945
  {
1974
- min: Qe,
1946
+ min: Je,
1975
1947
  max: en,
1976
1948
  disabled: h,
1977
1949
  precision: 1,
1978
- value: T.distT,
1950
+ value: b.distT,
1979
1951
  onChange: (_) => {
1980
- H(_, "distT");
1952
+ W(_, "distT");
1981
1953
  },
1982
- className: f.imageCommonPanelInput
1954
+ className: m.imageCommonPanelInput
1983
1955
  }
1984
1956
  ) }) })
1985
1957
  ] }) }),
1986
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
1987
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
1988
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
1989
- Be,
1958
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1959
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
1960
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1961
+ Fe,
1990
1962
  {
1991
- min: Qe,
1963
+ min: Je,
1992
1964
  max: en,
1993
1965
  disabled: w,
1994
1966
  precision: 1,
1995
- value: T.distL,
1967
+ value: b.distL,
1996
1968
  onChange: (_) => {
1997
- H(_, "distL");
1969
+ W(_, "distL");
1998
1970
  },
1999
- className: f.imageCommonPanelInput
1971
+ className: m.imageCommonPanelInput
2000
1972
  }
2001
1973
  ) }) })
2002
1974
  ] }) })
2003
1975
  ] }),
2004
- /* @__PURE__ */ g.jsxs("div", { className: f.imageCommonPanelRow, children: [
2005
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
2006
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
2007
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
2008
- Be,
1976
+ /* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
1977
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1978
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
1979
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1980
+ Fe,
2009
1981
  {
2010
- min: Qe,
1982
+ min: Je,
2011
1983
  max: en,
2012
1984
  disabled: h,
2013
1985
  precision: 1,
2014
- value: T.distB,
1986
+ value: b.distB,
2015
1987
  onChange: (_) => {
2016
- H(_, "distB");
1988
+ W(_, "distB");
2017
1989
  },
2018
- className: f.imageCommonPanelInput
1990
+ className: m.imageCommonPanelInput
2019
1991
  }
2020
1992
  ) }) })
2021
1993
  ] }) }),
2022
- /* @__PURE__ */ g.jsx("div", { className: V(f.imageCommonPanelColumn, f.imageCommonPanelSpan2), children: /* @__PURE__ */ g.jsxs("label", { children: [
2023
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
2024
- /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelRow, children: /* @__PURE__ */ g.jsx("div", { className: f.imageCommonPanelColumn, children: /* @__PURE__ */ g.jsx(
2025
- Be,
1994
+ /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1995
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
1996
+ /* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1997
+ Fe,
2026
1998
  {
2027
- min: Qe,
1999
+ min: Je,
2028
2000
  max: en,
2029
2001
  disabled: w,
2030
2002
  precision: 1,
2031
- value: T.distR,
2003
+ value: b.distR,
2032
2004
  onChange: (_) => {
2033
- H(_, "distR");
2005
+ W(_, "distR");
2034
2006
  },
2035
- className: f.imageCommonPanelInput
2007
+ className: m.imageCommonPanelInput
2036
2008
  }
2037
2009
  ) }) })
2038
2010
  ] }) })
2039
2011
  ] })
2040
2012
  ] });
2041
- }, fr = () => {
2042
- const i = pe(ve), e = i.getFocusDrawings(), [n, t] = ie(e);
2043
- return Sn(() => {
2013
+ }, cr = () => {
2014
+ const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
2015
+ return _n(() => {
2044
2016
  const r = i.focus$.subscribe((o) => {
2045
2017
  t(o);
2046
2018
  });
2047
2019
  return () => {
2048
2020
  r.unsubscribe();
2049
2021
  };
2050
- }, []), !!(n != null && n.length) && /* @__PURE__ */ g.jsxs("div", { className: f.imageCommonPanel, children: [
2051
- /* @__PURE__ */ g.jsx(Zt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2052
- /* @__PURE__ */ g.jsx(ur, { drawings: n }),
2053
- /* @__PURE__ */ g.jsx(mr, { drawings: n })
2022
+ }, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: m.imageCommonPanel, children: [
2023
+ /* @__PURE__ */ f(Kt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2024
+ /* @__PURE__ */ f(ar, { drawings: n }),
2025
+ /* @__PURE__ */ f(sr, { drawings: n })
2054
2026
  ] });
2055
- }, vt = "addition-and-subtraction-single", It = "doc.menu.image", _t = ut.id, hr = (i) => {
2056
- const e = i.get(_n), n = i.get(J);
2057
- return new xi((t) => {
2027
+ }, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id, dr = (i) => {
2028
+ const e = i.get(In), n = i.get(Q);
2029
+ return new Ci((t) => {
2058
2030
  const r = e.textSelection$.subscribe(() => {
2059
2031
  var s;
2060
2032
  const o = e.getActiveTextRange();
2061
2033
  if (o) {
2062
- const { segmentId: a, startOffset: d, endOffset: c } = o, l = n.getCurrentUniverDocInstance(), u = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : s.tables;
2063
- if (u && u.length && u.some((m) => {
2064
- const { startIndex: p, endIndex: h } = m;
2065
- return d >= p && d < h || c >= p && c < h;
2034
+ const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(), u = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : s.tables;
2035
+ if (u && u.length && u.some((g) => {
2036
+ const { startIndex: p, endIndex: h } = g;
2037
+ return d >= p && d < h || a >= p && a < h;
2066
2038
  })) {
2067
2039
  t.next(!0);
2068
2040
  return;
@@ -2076,92 +2048,92 @@ const Ji = "univer-image-common-panel", Zi = "univer-image-common-panel-grid", Q
2076
2048
  return () => r.unsubscribe();
2077
2049
  });
2078
2050
  };
2079
- function pr(i) {
2051
+ function lr(i) {
2080
2052
  return {
2081
- id: It,
2082
- type: Xn.SUBITEMS,
2083
- icon: vt,
2053
+ id: pt,
2054
+ type: $n.SUBITEMS,
2055
+ icon: ht,
2084
2056
  tooltip: "docImage.title",
2085
- disabled$: hr(i),
2086
- hidden$: Kn(i, Te.UNIVER_DOC)
2057
+ disabled$: dr(i),
2058
+ hidden$: zn(i, ye.UNIVER_DOC)
2087
2059
  };
2088
2060
  }
2089
- function wr(i) {
2061
+ function gr(i) {
2090
2062
  return {
2091
- id: _t,
2063
+ id: wt,
2092
2064
  title: "docImage.upload.float",
2093
- type: Xn.BUTTON,
2094
- hidden$: Kn(i, Te.UNIVER_DOC)
2065
+ type: $n.BUTTON,
2066
+ hidden$: zn(i, ye.UNIVER_DOC)
2095
2067
  };
2096
2068
  }
2097
- const vr = {
2098
- [gi.LAYOUT]: {
2099
- [It]: {
2069
+ const mr = {
2070
+ [ci.LAYOUT]: {
2071
+ [pt]: {
2100
2072
  order: 0,
2101
- menuItemFactory: pr,
2102
- [_t]: {
2073
+ menuItemFactory: lr,
2074
+ [wt]: {
2103
2075
  order: 0,
2104
- menuItemFactory: wr
2076
+ menuItemFactory: gr
2105
2077
  }
2106
2078
  }
2107
2079
  }
2108
2080
  };
2109
2081
  function Ye(i) {
2110
- return i.getContextValue(At) && i.getContextValue(tn);
2082
+ return i.getContextValue(Nt) && i.getContextValue(tn);
2111
2083
  }
2112
- const Ir = {
2084
+ const ur = {
2113
2085
  id: Ke.id,
2114
2086
  description: "shortcut.doc.drawing-move-down",
2115
2087
  group: "4_doc-drawing-view",
2116
- binding: Fe.ARROW_DOWN,
2088
+ binding: He.ARROW_DOWN,
2117
2089
  priority: 100,
2118
2090
  preconditions: Ye,
2119
2091
  staticParameters: {
2120
- direction: ue.DOWN
2092
+ direction: fe.DOWN
2121
2093
  }
2122
- }, _r = {
2094
+ }, fr = {
2123
2095
  id: Ke.id,
2124
2096
  description: "shortcut.doc.drawing-move-up",
2125
2097
  group: "4_doc-drawing-view",
2126
- binding: Fe.ARROW_UP,
2098
+ binding: He.ARROW_UP,
2127
2099
  priority: 100,
2128
2100
  preconditions: Ye,
2129
2101
  staticParameters: {
2130
- direction: ue.UP
2102
+ direction: fe.UP
2131
2103
  }
2132
- }, Sr = {
2104
+ }, hr = {
2133
2105
  id: Ke.id,
2134
2106
  description: "shortcut.doc.drawing-move-left",
2135
2107
  group: "4_doc-drawing-view",
2136
- binding: Fe.ARROW_LEFT,
2108
+ binding: He.ARROW_LEFT,
2137
2109
  priority: 100,
2138
2110
  preconditions: Ye,
2139
2111
  staticParameters: {
2140
- direction: ue.LEFT
2112
+ direction: fe.LEFT
2141
2113
  }
2142
- }, Cr = {
2114
+ }, pr = {
2143
2115
  id: Ke.id,
2144
2116
  description: "shortcut.doc.drawing-move-right",
2145
2117
  group: "4_doc-drawing-view",
2146
- binding: Fe.ARROW_RIGHT,
2118
+ binding: He.ARROW_RIGHT,
2147
2119
  priority: 100,
2148
2120
  preconditions: Ye,
2149
2121
  staticParameters: {
2150
- direction: ue.RIGHT
2122
+ direction: fe.RIGHT
2151
2123
  }
2152
- }, Dr = {
2153
- id: ct.id,
2124
+ }, wr = {
2125
+ id: ot.id,
2154
2126
  description: "shortcut.doc.drawing-delete",
2155
2127
  group: "4_doc-drawing-view",
2156
2128
  // when focusing on any other input tag do not trigger this shortcut
2157
2129
  preconditions: Ye,
2158
- binding: Fe.DELETE,
2159
- mac: Fe.BACKSPACE
2130
+ binding: He.DELETE,
2131
+ mac: He.BACKSPACE
2160
2132
  };
2161
- var Or = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, Pr = (i, e, n, t) => {
2162
- for (var r = t > 1 ? void 0 : t ? xr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2133
+ var vr = Object.defineProperty, Ir = Object.getOwnPropertyDescriptor, _r = (i, e, n, t) => {
2134
+ for (var r = t > 1 ? void 0 : t ? Ir(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2163
2135
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
2164
- return t && r && Or(e, n, r), r;
2136
+ return t && r && vr(e, n, r), r;
2165
2137
  }, nn = (i, e) => (n, t) => e(n, t, i);
2166
2138
  let an = class extends Xe {
2167
2139
  constructor(i, e, n, t) {
@@ -2169,40 +2141,40 @@ let an = class extends Xe {
2169
2141
  }
2170
2142
  _initCustomComponents() {
2171
2143
  const i = this._componentManager;
2172
- this.disposeWithMe(i.register(vt, at)), this.disposeWithMe(i.register(ft, fr));
2144
+ this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt, cr));
2173
2145
  }
2174
2146
  _initMenus() {
2175
- this._menuManagerService.mergeMenu(vr);
2147
+ this._menuManagerService.mergeMenu(mr);
2176
2148
  }
2177
2149
  _initCommands() {
2178
2150
  [
2179
- ut,
2180
2151
  lt,
2152
+ at,
2153
+ Zn,
2154
+ Qn,
2155
+ Jn,
2156
+ qe,
2181
2157
  et,
2182
2158
  nt,
2183
- tt,
2184
- qe,
2185
- it,
2186
- rt,
2187
- Cn,
2188
- ht,
2189
- Xi,
2190
- pt,
2191
- dt,
2159
+ Sn,
2192
2160
  mt,
2161
+ ji,
2162
+ ut,
2163
+ st,
2164
+ dt,
2193
2165
  Ke,
2194
- ct,
2195
- gt
2166
+ ot,
2167
+ ct
2196
2168
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2197
2169
  }
2198
2170
  _initShortcuts() {
2199
2171
  [
2200
2172
  // sheet drawing shortcuts
2201
- Ir,
2202
- _r,
2203
- Sr,
2204
- Cr,
2205
- Dr
2173
+ ur,
2174
+ fr,
2175
+ hr,
2176
+ pr,
2177
+ wr
2206
2178
  ].forEach((i) => {
2207
2179
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
2208
2180
  });
@@ -2211,25 +2183,25 @@ let an = class extends Xe {
2211
2183
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
2212
2184
  }
2213
2185
  };
2214
- an = Pr([
2215
- nn(0, we(mi)),
2216
- nn(1, ui),
2186
+ an = _r([
2187
+ nn(0, ve(di)),
2188
+ nn(1, li),
2217
2189
  nn(2, z),
2218
- nn(3, fi)
2190
+ nn(3, gi)
2219
2191
  ], an);
2220
- var Tr = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, br = (i, e, n, t) => {
2221
- for (var r = t > 1 ? void 0 : t ? yr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2192
+ var Sr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Dr = (i, e, n, t) => {
2193
+ for (var r = t > 1 ? void 0 : t ? Cr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2222
2194
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
2223
- return t && r && Tr(e, n, r), r;
2224
- }, Ve = (i, e) => (n, t) => e(n, t, i);
2225
- let cn = class extends jt {
2195
+ return t && r && Sr(e, n, r), r;
2196
+ }, je = (i, e) => (n, t) => e(n, t, i);
2197
+ let cn = class extends At {
2226
2198
  constructor(e, n, t, r, o) {
2227
2199
  super();
2228
- Se(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
2200
+ Ce(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
2229
2201
  this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
2230
2202
  }
2231
2203
  _init() {
2232
- this._univerInstanceService.getCurrentTypeOfUnit$(Te.UNIVER_DOC).pipe(An(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Te.UNIVER_DOC).pipe(An(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Te.UNIVER_DOC).forEach((e) => this._create(e));
2204
+ this._univerInstanceService.getCurrentTypeOfUnit$(ye.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(ye.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(ye.UNIVER_DOC).forEach((e) => this._create(e));
2233
2205
  }
2234
2206
  _dispose(e) {
2235
2207
  const n = e.getUnitId();
@@ -2244,7 +2216,7 @@ let cn = class extends jt {
2244
2216
  _hasCropObject(e) {
2245
2217
  const n = e.getAllObjects();
2246
2218
  for (const t of n)
2247
- if (t instanceof Qt)
2219
+ if (t instanceof Yt)
2248
2220
  return !0;
2249
2221
  return !1;
2250
2222
  }
@@ -2259,52 +2231,52 @@ let cn = class extends jt {
2259
2231
  return;
2260
2232
  const r = [];
2261
2233
  this.disposeWithMe(
2262
- Ae(
2234
+ Le(
2263
2235
  t.createControl$.subscribe(() => {
2264
2236
  if (this._hasCropObject(n))
2265
2237
  return;
2266
2238
  const s = t.getSelectedObjectMap();
2267
2239
  if (r.forEach((w) => w.dispose()), r.length = 0, s.size > 1)
2268
2240
  return;
2269
- const a = s.values().next().value;
2270
- if (!a)
2271
- return;
2272
- const d = a.oKey, c = this._drawingManagerService.getDrawingOKey(d);
2241
+ const c = s.values().next().value;
2273
2242
  if (!c)
2274
2243
  return;
2275
- const { unitId: l, subUnitId: u, drawingId: m } = c, p = this._canvasPopManagerService.attachPopupToObject(
2276
- a,
2244
+ const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
2245
+ if (!a)
2246
+ return;
2247
+ const { unitId: l, subUnitId: u, drawingId: g } = a, p = this._canvasPopManagerService.attachPopupToObject(
2248
+ c,
2277
2249
  {
2278
- componentKey: ei,
2250
+ componentKey: Zt,
2279
2251
  direction: "horizontal",
2280
2252
  offset: [2, 0],
2281
2253
  extraProps: {
2282
- menuItems: this._getImageMenuItems(l, u, m)
2254
+ menuItems: this._getImageMenuItems(l, u, g)
2283
2255
  }
2284
2256
  },
2285
2257
  l
2286
2258
  );
2287
- r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId === u && w.drawingId === m) && this._drawingManagerService.focusDrawing([{
2259
+ r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId === u && w.drawingId === g) && this._drawingManagerService.focusDrawing([{
2288
2260
  unitId: l,
2289
2261
  subUnitId: u,
2290
- drawingId: m
2262
+ drawingId: g
2291
2263
  }]);
2292
2264
  })
2293
2265
  )
2294
2266
  ), this.disposeWithMe(
2295
- Ae(
2267
+ Le(
2296
2268
  t.clearControl$.subscribe(() => {
2297
2269
  r.forEach((s) => s.dispose()), r.length = 0, this._contextService.setContextValue(tn, !1), this._drawingManagerService.focusDrawing(null);
2298
2270
  })
2299
2271
  )
2300
2272
  ), this.disposeWithMe(
2301
- Ae(
2273
+ Le(
2302
2274
  t.changing$.subscribe(() => {
2303
2275
  r.forEach((s) => s.dispose()), r.length = 0;
2304
2276
  })
2305
2277
  )
2306
2278
  ), this.disposeWithMe(
2307
- Ae(
2279
+ Le(
2308
2280
  t.changeStart$.subscribe(() => {
2309
2281
  r.forEach((s) => s.dispose()), r.length = 0;
2310
2282
  })
@@ -2316,21 +2288,21 @@ let cn = class extends jt {
2316
2288
  {
2317
2289
  label: "image-popup.edit",
2318
2290
  index: 0,
2319
- commandId: pt.id,
2291
+ commandId: ut.id,
2320
2292
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2321
- disable: !!Lt.includes(e)
2293
+ disable: !!Et.includes(e)
2322
2294
  },
2323
2295
  {
2324
2296
  label: "image-popup.delete",
2325
2297
  index: 1,
2326
- commandId: Cn.id,
2298
+ commandId: Sn.id,
2327
2299
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
2328
2300
  disable: !1
2329
2301
  },
2330
2302
  {
2331
2303
  label: "image-popup.crop",
2332
2304
  index: 2,
2333
- commandId: ni.id,
2305
+ commandId: Qt.id,
2334
2306
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2335
2307
  disable: !0
2336
2308
  // TODO: @JOCS, feature is not ready.
@@ -2338,7 +2310,7 @@ let cn = class extends jt {
2338
2310
  {
2339
2311
  label: "image-popup.reset",
2340
2312
  index: 3,
2341
- commandId: ti.id,
2313
+ commandId: Jt.id,
2342
2314
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
2343
2315
  disable: !0
2344
2316
  // TODO: @JOCS, feature is not ready.
@@ -2346,23 +2318,23 @@ let cn = class extends jt {
2346
2318
  ];
2347
2319
  }
2348
2320
  };
2349
- cn = br([
2350
- Ve(0, ve),
2351
- Ve(1, we(Si)),
2352
- Ve(2, Q),
2353
- Ve(3, J),
2354
- Ve(4, zn)
2321
+ cn = Dr([
2322
+ je(0, Ie),
2323
+ je(1, ve(vi)),
2324
+ je(2, ee),
2325
+ je(3, Q),
2326
+ je(4, Vn)
2355
2327
  ], cn);
2356
- var Mr = Object.defineProperty, Rr = Object.getOwnPropertyDescriptor, Nr = (i, e, n, t) => {
2357
- for (var r = t > 1 ? void 0 : t ? Rr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2328
+ var Or = Object.defineProperty, Pr = Object.getOwnPropertyDescriptor, Tr = (i, e, n, t) => {
2329
+ for (var r = t > 1 ? void 0 : t ? Pr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2358
2330
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
2359
- return t && r && Mr(e, n, r), r;
2360
- }, Ee = (i, e) => (n, t) => e(n, t, i);
2361
- let vn = class extends Xe {
2362
- constructor(e, n, t, r, o, s, a, d) {
2331
+ return t && r && Or(e, n, r), r;
2332
+ }, xe = (i, e) => (n, t) => e(n, t, i);
2333
+ let wn = class extends Xe {
2334
+ constructor(e, n, t, r, o, s, c, d) {
2363
2335
  super();
2364
- Se(this, "_liquid", new qn());
2365
- this._context = e, this._docSkeletonManagerService = n, this._commandService = t, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService = a, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
2336
+ Ce(this, "_liquid", new jn());
2337
+ this._context = e, this._docSkeletonManagerService = n, this._commandService = t, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService = c, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
2366
2338
  }
2367
2339
  _initialize() {
2368
2340
  this._initialRenderRefresh(), this._drawingInitializeListener(), this._initResize();
@@ -2375,30 +2347,30 @@ let vn = class extends Xe {
2375
2347
  });
2376
2348
  }
2377
2349
  _commandExecutedListener() {
2378
- const e = [Z.id, Di.id];
2350
+ const e = [J.id, _i.id];
2379
2351
  this.disposeWithMe(
2380
2352
  this._commandService.onCommandExecuted((n) => {
2381
2353
  if (e.includes(n.id)) {
2382
2354
  const t = n.params, { unitId: r } = t, { unitId: o, mainComponent: s } = this._context;
2383
2355
  if (r !== o)
2384
2356
  return;
2385
- const a = this._docSkeletonManagerService.getSkeleton();
2386
- if (a == null)
2357
+ const c = this._docSkeletonManagerService.getSkeleton();
2358
+ if (c == null)
2387
2359
  return;
2388
- if (this._editorService.isEditor(o) && o !== Ut) {
2360
+ if (this._editorService.isEditor(o) && o !== Lt) {
2389
2361
  s == null || s.makeDirty();
2390
2362
  return;
2391
2363
  }
2392
- this._refreshDrawing(a);
2364
+ this._refreshDrawing(c);
2393
2365
  }
2394
2366
  })
2395
2367
  );
2396
2368
  }
2397
2369
  _initResize() {
2398
2370
  this.disposeWithMe(
2399
- Ft(this._context.engine.onTransformChange$).pipe(
2400
- jn((e) => e.type === ai.resize),
2401
- Yn(16)
2371
+ Bt(this._context.engine.onTransformChange$).pipe(
2372
+ xn((e) => e.type === ri.resize),
2373
+ qn(16)
2402
2374
  ).subscribe(() => {
2403
2375
  var t;
2404
2376
  const e = this._docSkeletonManagerService.getSkeleton(), { scene: n } = this._context;
@@ -2411,63 +2383,63 @@ let vn = class extends Xe {
2411
2383
  const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
2412
2384
  if (!n)
2413
2385
  return;
2414
- const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: l } = o, { pages: u, skeHeaders: m, skeFooters: p } = n, h = {};
2386
+ const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages: u, skeHeaders: g, skeFooters: p } = n, h = {};
2415
2387
  this._liquid.reset();
2416
- for (let x = 0, b = u.length; x < b; x++) {
2417
- const T = u[x], { headerId: N, footerId: B, pageWidth: R } = T;
2418
- if (N) {
2419
- const I = (O = m.get(N)) == null ? void 0 : O.get(R);
2388
+ for (let P = 0, M = u.length; P < M; P++) {
2389
+ const b = u[P], { headerId: A, footerId: U, pageWidth: N } = b;
2390
+ if (A) {
2391
+ const I = (O = g.get(A)) == null ? void 0 : O.get(N);
2420
2392
  I && this._calculateDrawingPosition(
2421
2393
  r,
2422
2394
  I,
2423
2395
  s,
2424
- a,
2396
+ c,
2425
2397
  h,
2426
2398
  I.marginTop,
2427
- T.marginLeft
2399
+ b.marginLeft
2428
2400
  );
2429
2401
  }
2430
- if (B) {
2431
- const I = (D = p.get(B)) == null ? void 0 : D.get(R);
2402
+ if (U) {
2403
+ const I = (D = p.get(U)) == null ? void 0 : D.get(N);
2432
2404
  I && this._calculateDrawingPosition(
2433
2405
  r,
2434
2406
  I,
2435
2407
  s,
2436
- a,
2408
+ c,
2437
2409
  h,
2438
- T.pageHeight - T.marginBottom + I.marginTop,
2439
- T.marginLeft
2410
+ b.pageHeight - b.marginBottom + I.marginTop,
2411
+ b.marginLeft
2440
2412
  );
2441
2413
  }
2442
- this._calculateDrawingPosition(r, T, s, a, h, T.marginTop, T.marginLeft), this._liquid.translatePage(T, d, c, l);
2414
+ this._calculateDrawingPosition(r, b, s, c, h, b.marginTop, b.marginLeft), this._liquid.translatePage(b, d, a, l);
2443
2415
  }
2444
- const v = Object.values(h), w = v.filter((x) => !x.isMultiTransform), S = v.filter((x) => x.isMultiTransform);
2416
+ const v = Object.values(h), w = v.filter((P) => !P.isMultiTransform), S = v.filter((P) => P.isMultiTransform);
2445
2417
  w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
2446
2418
  }
2447
2419
  _handleMultiDrawingsTransform(e) {
2448
2420
  const { scene: n, unitId: t } = this._context, r = n.getTransformerByCreate();
2449
2421
  e.forEach((d) => {
2450
- const c = this._drawingManagerService.getDrawingByParam(d);
2451
- c != null && (c.transform = d.transform, c.transforms = d.transforms, c.isMultiTransform = d.isMultiTransform);
2422
+ const a = this._drawingManagerService.getDrawingByParam(d);
2423
+ a != null && (a.transform = d.transform, a.transforms = d.transforms, a.isMultiTransform = d.isMultiTransform);
2452
2424
  });
2453
- const s = [...r.getSelectedObjectMap().keys()], a = Object.values(this._drawingManagerService.getDrawingData(t, t)).filter((d) => d.isMultiTransform === re.TRUE);
2454
- this._drawingManagerService.removeNotification(a), e.length > 0 && this._drawingManagerService.addNotification(e);
2425
+ const s = [...r.getSelectedObjectMap().keys()], c = Object.values(this._drawingManagerService.getDrawingData(t, t)).filter((d) => d.isMultiTransform === oe.TRUE);
2426
+ this._drawingManagerService.removeNotification(c), e.length > 0 && this._drawingManagerService.addNotification(e);
2455
2427
  for (const d of s) {
2456
- const c = n.getObject(d);
2457
- c && r.setSelectedControl(c);
2428
+ const a = n.getObject(d);
2429
+ a && r.setSelectedControl(a);
2458
2430
  }
2459
2431
  }
2460
- _calculateDrawingPosition(e, n, t, r, o, s, a) {
2432
+ _calculateDrawingPosition(e, n, t, r, o, s, c) {
2461
2433
  const { skeDrawings: d } = n;
2462
2434
  this._liquid.translatePagePadding({
2463
2435
  marginTop: s,
2464
- marginLeft: a
2465
- }), d.forEach((c) => {
2466
- const { aLeft: l, aTop: u, height: m, width: p, angle: h, drawingId: v, drawingOrigin: w } = c, S = w.layoutType === k.WRAP_NONE && w.behindDoc === re.TRUE, { isMultiTransform: O = re.FALSE } = w, D = {
2436
+ marginLeft: c
2437
+ }), d.forEach((a) => {
2438
+ const { aLeft: l, aTop: u, height: g, width: p, angle: h, drawingId: v, drawingOrigin: w } = a, S = w.layoutType === H.WRAP_NONE && w.behindDoc === oe.TRUE, { isMultiTransform: O = oe.FALSE } = w, D = {
2467
2439
  left: l + t + this._liquid.x,
2468
2440
  top: u + r + this._liquid.y,
2469
2441
  width: p,
2470
- height: m,
2442
+ height: g,
2471
2443
  angle: h
2472
2444
  };
2473
2445
  o[v] == null ? o[v] = {
@@ -2478,10 +2450,10 @@ let vn = class extends Xe {
2478
2450
  transform: D,
2479
2451
  transforms: [D],
2480
2452
  isMultiTransform: O
2481
- } : O === re.TRUE && o[v].transforms.push(D);
2453
+ } : O === oe.TRUE && o[v].transforms.push(D);
2482
2454
  }), this._liquid.restorePagePadding({
2483
2455
  marginTop: s,
2484
- marginLeft: a
2456
+ marginLeft: c
2485
2457
  });
2486
2458
  }
2487
2459
  _drawingInitializeListener() {
@@ -2491,33 +2463,33 @@ let vn = class extends Xe {
2491
2463
  };
2492
2464
  this._lifecycleService.stage === Pn.Steady ? setTimeout(() => {
2493
2465
  e();
2494
- }, 1e3) : this._lifecycleService.lifecycle$.pipe(jn((n) => n === Pn.Steady)).subscribe(e);
2466
+ }, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Pn.Steady)).subscribe(e);
2495
2467
  }
2496
2468
  };
2497
- vn = Nr([
2498
- Ee(1, we(oe)),
2499
- Ee(2, z),
2500
- Ee(3, Ci),
2501
- Ee(4, ve),
2502
- Ee(5, we(gn)),
2503
- Ee(6, J),
2504
- Ee(7, we(Bt))
2505
- ], vn);
2506
- var St = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, Ar = (i, e, n) => e in i ? St(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, jr = (i, e, n, t) => {
2507
- for (var r = t > 1 ? void 0 : t ? Er(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2469
+ wn = Tr([
2470
+ xe(1, ve(se)),
2471
+ xe(2, z),
2472
+ xe(3, Ii),
2473
+ xe(4, Ie),
2474
+ xe(5, ve(gn)),
2475
+ xe(6, Q),
2476
+ xe(7, ve(xt))
2477
+ ], wn);
2478
+ var vt = Object.defineProperty, br = Object.getOwnPropertyDescriptor, yr = (i, e, n) => e in i ? vt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Mr = (i, e, n, t) => {
2479
+ for (var r = t > 1 ? void 0 : t ? br(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2508
2480
  (s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
2509
- return t && r && St(e, n, r), r;
2510
- }, wn = (i, e) => (n, t) => e(n, t, i), Ct = (i, e, n) => Ar(i, typeof e != "symbol" ? e + "" : e, n);
2511
- const Lr = "DOC_DRAWING_UI_PLUGIN";
2512
- let dn = class extends Wt {
2481
+ return t && r && vt(e, n, r), r;
2482
+ }, pn = (i, e) => (n, t) => e(n, t, i), It = (i, e, n) => yr(i, typeof e != "symbol" ? e + "" : e, n);
2483
+ const Rr = "DOC_DRAWING_UI_PLUGIN";
2484
+ let dn = class extends kt {
2513
2485
  constructor(i = Fn, e, n, t) {
2514
2486
  super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
2515
- const { ...r } = Gt(
2487
+ const { ...r } = Ht(
2516
2488
  {},
2517
2489
  Fn,
2518
2490
  this._config
2519
2491
  );
2520
- this._configService.setConfig(bi, r);
2492
+ this._configService.setConfig(Pi, r);
2521
2493
  }
2522
2494
  onStarting() {
2523
2495
  [
@@ -2531,33 +2503,33 @@ let dn = class extends Wt {
2531
2503
  onReady() {
2532
2504
  [
2533
2505
  [sn],
2534
- [vn]
2535
- ].forEach((i) => this._renderManagerSrv.registerRenderModule(Te.UNIVER_DOC, i)), this._injector.get(rn), this._injector.get(an), this._injector.get(on);
2506
+ [wn]
2507
+ ].forEach((i) => this._renderManagerSrv.registerRenderModule(ye.UNIVER_DOC, i)), this._injector.get(rn), this._injector.get(an), this._injector.get(on);
2536
2508
  }
2537
2509
  onRendered() {
2538
2510
  this._injector.get(cn);
2539
2511
  }
2540
2512
  };
2541
- Ct(dn, "type", Te.UNIVER_DOC);
2542
- Ct(dn, "pluginName", Lr);
2543
- dn = jr([
2544
- kt(ii, Jt, $t, hi),
2545
- wn(1, we(Ht)),
2546
- wn(2, Q),
2547
- wn(3, Vt)
2513
+ It(dn, "type", ye.UNIVER_DOC);
2514
+ It(dn, "pluginName", Rr);
2515
+ dn = Mr([
2516
+ Ut(ei, Xt, Gt, mi),
2517
+ pn(1, ve(Ft)),
2518
+ pn(2, ee),
2519
+ pn(3, Wt)
2548
2520
  ], dn);
2549
2521
  export {
2550
- Xi as ClearDocDrawingTransformerOperation,
2551
- It as DOCS_IMAGE_MENU_ID,
2552
- ct as DeleteDocDrawingsCommand,
2553
- pt as EditDocDrawingOperation,
2554
- dt as GroupDocDrawingCommand,
2555
- lt as InsertDocDrawingCommand,
2556
- ut as InsertDocImageCommand,
2522
+ ji as ClearDocDrawingTransformerOperation,
2523
+ pt as DOCS_IMAGE_MENU_ID,
2524
+ ot as DeleteDocDrawingsCommand,
2525
+ ut as EditDocDrawingOperation,
2526
+ st as GroupDocDrawingCommand,
2527
+ at as InsertDocDrawingCommand,
2528
+ lt as InsertDocImageCommand,
2557
2529
  Ke as MoveDocDrawingsCommand,
2558
- Cn as RemoveDocDrawingCommand,
2559
- gt as SetDocDrawingArrangeCommand,
2560
- ht as SidebarDocDrawingOperation,
2561
- mt as UngroupDocDrawingCommand,
2530
+ Sn as RemoveDocDrawingCommand,
2531
+ ct as SetDocDrawingArrangeCommand,
2532
+ mt as SidebarDocDrawingOperation,
2533
+ dt as UngroupDocDrawingCommand,
2562
2534
  dn as UniverDocsDrawingUIPlugin
2563
2535
  };