@univerjs/docs-drawing-ui 0.6.1 → 0.6.2-nightly.202503031606

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,25 +1,25 @@
1
1
  var Ct = Object.defineProperty;
2
2
  var Dt = (i, e, n) => e in i ? Ct(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
3
  var Ce = (i, e, n) => Dt(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { Disposable as Xe, UndoCommand as Ot, RedoCommand as Tt, JSONX as q, IUniverInstanceService as Q, ICommandService as z, PositionedObjectLayoutType as H, CommandType as K, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as Pe, TextX as vn, TextXActionType as Z, toDisposable as Le, throttle as On, COLORS as yt, MemoryCursor as Pt, IUndoRedoService as Gn, BuildTextUtils as bt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as Vn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as Mt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Rt, RxDisposable as Nt, SHEET_EDITOR_UNITS as At, LifecycleService as Et, DOCS_ZEN_EDITOR_UNIT_ID_KEY as xt, fromEventSubject as Lt, LifecycleStages as Tn, DependentOn as Bt, Injector as Ut, IConfigService as kt, Plugin as Ft, merge as Ht } from "@univerjs/core";
5
- import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Wt } from "@univerjs/docs-drawing";
6
- import { IDrawingManagerService as Ie, IImageIoService as Gt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as yn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as jt, getImageSize as $t, getDrawingShapeKeyByDrawingSearch as zt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as qt } from "@univerjs/drawing";
7
- import { DrawingCommonPanel as Xt, ImageCropperObject as Kt, COMPONENT_IMAGE_POPUP_MENU as Yt, OpenImageCropOperation as Zt, ImageResetSizeOperation as Qt, UniverDrawingUIPlugin as Jt } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ei, Rect as ni, getColor as ti, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ii } from "@univerjs/engine-render";
9
- import { IMessageService as ri, ILocalFileService as oi, ISidebarService as si, useDependency as we, getMenuHiddenObservable as $n, MenuItemType as zn, RibbonStartGroup as ai, KeyCode as He, ComponentManager as ci, IMenuManagerService as di, IShortcutService as li, UniverUIPlugin as gi } 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 mi, TEXT_RANGE_LAYER_INDEX as ui, getDocObject as fi, getCustomBlockIdsInSelections as hi, docDrawingPositionToTransform as pi, DocCanvasPopManagerService as wi, IEditorService as vi, SetDocZoomRatioOperation as Ii } from "@univerjs/docs-ui";
12
- import { BehaviorSubject as _i, debounceTime as qn, Observable as Si, takeUntil as En, filter as xn } from "rxjs";
13
- import { MessageType as Ln, InputNumber as ke, Select as Bn, Checkbox as Ci, RadioGroup as Un, Radio as ye } from "@univerjs/design";
4
+ import { Disposable as Xe, UndoCommand as Ot, RedoCommand as Tt, JSONX as q, IUniverInstanceService as K, ICommandService as z, PositionedObjectLayoutType as H, CommandType as Y, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as ye, TextX as vn, TextXActionType as Q, toDisposable as Le, throttle as Tn, COLORS as Pt, MemoryCursor as yt, IUndoRedoService as Vn, BuildTextUtils as bt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as jn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as Mt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as In, FOCUSING_UNIVER_EDITOR as Rt, RxDisposable as Nt, SHEET_EDITOR_UNITS as Et, LifecycleService as At, fromEventSubject as xt, LifecycleStages as Pn, DependentOn as Lt, Injector as Bt, IConfigService as Ut, Plugin as kt, merge as Ft } from "@univerjs/core";
5
+ import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Ht } from "@univerjs/docs-drawing";
6
+ import { IDrawingManagerService as Ie, IImageIoService as Wt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Gt, DRAWING_IMAGE_COUNT_LIMIT as yn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as Vt, getImageSize as jt, getDrawingShapeKeyByDrawingSearch as $t, DRAWING_IMAGE_WIDTH_LIMIT as bn, DRAWING_IMAGE_HEIGHT_LIMIT as Mn, UniverDrawingPlugin as zt } from "@univerjs/drawing";
7
+ import { DrawingCommonPanel as qt, ImageCropperObject as Xt, COMPONENT_IMAGE_POPUP_MENU as Kt, OpenImageCropOperation as Yt, ImageResetSizeOperation as Zt, UniverDrawingUIPlugin as Qt } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as $n, PageLayoutType as Rn, DocumentSkeletonPageType as Nn, Vector2 as Jt, Rect as ei, getColor as ni, getCurrentTypeOfRenderer as ti, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ii } from "@univerjs/engine-render";
9
+ import { IMessageService as ri, ILocalFileService as oi, ISidebarService as si, useDependency as we, getMenuHiddenObservable as zn, MenuItemType as qn, RibbonStartGroup as ai, KeyCode as He, ComponentManager as ci, IMenuManagerService as di, IShortcutService as li, UniverUIPlugin as gi } from "@univerjs/ui";
10
+ import { RichTextEditingMutation as J, DocSkeletonManagerService as se, DocSelectionManagerService as _n } from "@univerjs/docs";
11
+ import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as En, getOneTextSelectionRange as An, getAnchorBounding as mi, TEXT_RANGE_LAYER_INDEX as ui, getDocObject as fi, getCustomBlockIdsInSelections as hi, docDrawingPositionToTransform as pi, DocCanvasPopManagerService as wi, IEditorService as vi, SetDocZoomRatioOperation as Ii } from "@univerjs/docs-ui";
12
+ import { BehaviorSubject as _i, debounceTime as Xn, Observable as Si, takeUntil as xn, filter as Ln } from "rxjs";
13
+ import { MessageType as Bn, clsx as j, InputNumber as ke, Select as Un, Checkbox as Ci, RadioGroup as kn, Radio as Pe } from "@univerjs/design";
14
14
  import { jsxs as X, jsx as f } from "react/jsx-runtime";
15
- import { forwardRef as Xn, useRef as Di, createElement as Kn, useState as re, useEffect as _n } from "react";
16
- const Oi = "docs-drawing-ui.config", kn = {};
17
- var Ti = Object.getOwnPropertyDescriptor, yi = (i, e, n, t) => {
15
+ import { forwardRef as Kn, useRef as Di, createElement as Yn, useState as re, useEffect as Sn } from "react";
16
+ const Oi = "docs-drawing-ui.config", Fn = {};
17
+ var Ti = Object.getOwnPropertyDescriptor, Pi = (i, e, n, t) => {
18
18
  for (var r = t > 1 ? void 0 : t ? Ti(e, n) : e, o = i.length - 1, s; o >= 0; o--)
19
19
  (s = i[o]) && (r = s(r) || r);
20
20
  return r;
21
21
  }, Ve = (i, e) => (n, t) => e(n, t, i);
22
- function Pi(i) {
22
+ function yi(i) {
23
23
  var t, r, o, s;
24
24
  if (q.isNoop(i) || !Array.isArray(i))
25
25
  return null;
@@ -69,7 +69,7 @@ let rn = class extends Xe {
69
69
  this._commandService.beforeCommandExecuted((i) => {
70
70
  if (i.id !== J.id)
71
71
  return;
72
- const e = i.params, { unitId: n, actions: t } = e, r = Pi(t);
72
+ const e = i.params, { unitId: n, actions: t } = e, r = yi(t);
73
73
  if (r != null)
74
74
  for (const { type: o, drawingId: s, drawing: a } of r)
75
75
  o === "add" ? this._addDrawings(n, [a]) : this._removeDrawings(n, [s]);
@@ -125,8 +125,8 @@ let rn = class extends Xe {
125
125
  t.orderNotification(o), r.orderNotification(o);
126
126
  }
127
127
  };
128
- rn = yi([
129
- Ve(0, Q),
128
+ rn = Pi([
129
+ Ve(0, K),
130
130
  Ve(1, z),
131
131
  Ve(2, Ie),
132
132
  Ve(3, Be),
@@ -149,7 +149,7 @@ const Mi = {
149
149
  inFrontOfText: H.WRAP_NONE,
150
150
  behindText: H.WRAP_NONE
151
151
  };
152
- function Yn(i, e, n, t, r, o, s) {
152
+ function Zn(i, e, n, t, r, o, s) {
153
153
  var p, h;
154
154
  const a = new vn(), d = q.getInstance(), c = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
155
155
  if (l == null || m == null)
@@ -158,10 +158,10 @@ function Yn(i, e, n, t, r, o, s) {
158
158
  if (g != null) {
159
159
  if (t = Math.min(m.dataStream.length - 2, t), i === e) {
160
160
  if (t < g ? (t > 0 && a.push({
161
- t: Z.RETAIN,
161
+ t: Q.RETAIN,
162
162
  len: t
163
163
  }), a.push({
164
- t: Z.INSERT,
164
+ t: Q.INSERT,
165
165
  body: {
166
166
  dataStream: "\b",
167
167
  customBlocks: [{
@@ -171,22 +171,22 @@ function Yn(i, e, n, t, r, o, s) {
171
171
  },
172
172
  len: 1
173
173
  }), a.push({
174
- t: Z.RETAIN,
174
+ t: Q.RETAIN,
175
175
  len: g - t
176
176
  }), a.push({
177
- t: Z.DELETE,
177
+ t: Q.DELETE,
178
178
  len: 1
179
179
  })) : (g > 0 && a.push({
180
- t: Z.RETAIN,
180
+ t: Q.RETAIN,
181
181
  len: g
182
182
  }), a.push({
183
- t: Z.DELETE,
183
+ t: Q.DELETE,
184
184
  len: 1
185
185
  }), t - g - 1 > 0 && a.push({
186
- t: Z.RETAIN,
186
+ t: Q.RETAIN,
187
187
  len: t - g - 1
188
188
  }), a.push({
189
- t: Z.INSERT,
189
+ t: Q.INSERT,
190
190
  body: {
191
191
  dataStream: "\b",
192
192
  customBlocks: [{
@@ -201,18 +201,18 @@ function Yn(i, e, n, t, r, o, s) {
201
201
  }
202
202
  } else {
203
203
  g > 0 && a.push({
204
- t: Z.RETAIN,
204
+ t: Q.RETAIN,
205
205
  len: g
206
206
  }), a.push({
207
- t: Z.DELETE,
207
+ t: Q.DELETE,
208
208
  len: 1
209
209
  });
210
210
  let v = ze(o, e), w = d.editOp(a.serialize(), v);
211
211
  c.push(w), a.empty(), t > 0 && a.push({
212
- t: Z.RETAIN,
212
+ t: Q.RETAIN,
213
213
  len: t
214
214
  }), a.push({
215
- t: Z.INSERT,
215
+ t: Q.INSERT,
216
216
  body: {
217
217
  dataStream: "\b",
218
218
  customBlocks: [{
@@ -226,15 +226,15 @@ function Yn(i, e, n, t, r, o, s) {
226
226
  return c;
227
227
  }
228
228
  }
229
- const Zn = {
229
+ const Qn = {
230
230
  id: "doc.command.update-doc-drawing-wrapping-style",
231
- type: K.COMMAND,
231
+ type: Y.COMMAND,
232
232
  // eslint-disable-next-line max-lines-per-function, complexity
233
233
  handler: (i, e) => {
234
- var A, U;
234
+ var E, U;
235
235
  if (e == null)
236
236
  return !1;
237
- const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r), c = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
237
+ const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(K), d = i.get(ee).getRenderById(r), c = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
238
238
  if (g == null || c == null || m == null || l == null)
239
239
  return !1;
240
240
  const p = l.getEditArea(), h = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = c, O = q.getInstance(), D = [], { drawings: T = {} } = g.getSnapshot();
@@ -247,23 +247,23 @@ const Zn = {
247
247
  if (t === "behindText" || t === "inFrontOfText") {
248
248
  const C = T[I].behindDoc, R = t === "behindText" ? oe.TRUE : oe.FALSE;
249
249
  if (C !== R) {
250
- const y = O.replaceOp(["drawings", I, "behindDoc"], C, R);
251
- D.push(y);
250
+ const P = O.replaceOp(["drawings", I, "behindDoc"], C, R);
251
+ D.push(P);
252
252
  }
253
253
  }
254
254
  if (t === "inline")
255
255
  continue;
256
256
  let x = null, G = 0, _ = 0;
257
257
  for (const C of v) {
258
- const { headerId: R, footerId: y, marginTop: B, marginLeft: k, marginBottom: b, pageWidth: E, pageHeight: $ } = C;
258
+ const { headerId: R, footerId: P, marginTop: B, marginLeft: k, marginBottom: b, pageWidth: A, pageHeight: $ } = C;
259
259
  switch (p) {
260
260
  case Fe.HEADER: {
261
- const F = (A = w.get(R)) == null ? void 0 : A.get(E);
261
+ const F = (E = w.get(R)) == null ? void 0 : E.get(A);
262
262
  F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = F.marginTop, _ = k);
263
263
  break;
264
264
  }
265
265
  case Fe.FOOTER: {
266
- const F = (U = S.get(y)) == null ? void 0 : U.get(E);
266
+ const F = (U = S.get(P)) == null ? void 0 : U.get(A);
267
267
  F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = $ - b + F.marginTop, _ = k);
268
268
  break;
269
269
  }
@@ -276,23 +276,23 @@ const Zn = {
276
276
  break;
277
277
  }
278
278
  if (x != null) {
279
- const { aTop: C, aLeft: R } = x, y = T[I].docTransform.positionH;
279
+ const { aTop: C, aLeft: R } = x, P = T[I].docTransform.positionH;
280
280
  let B = R;
281
- y.relativeFrom === ne.MARGIN ? B -= _ : y.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
281
+ P.relativeFrom === ne.MARGIN ? B -= _ : P.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
282
282
  const k = {
283
- relativeFrom: y.relativeFrom,
283
+ relativeFrom: P.relativeFrom,
284
284
  posOffset: B
285
285
  };
286
- if (y.posOffset !== k.posOffset) {
287
- const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], y, k);
286
+ if (P.posOffset !== k.posOffset) {
287
+ const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], P, k);
288
288
  D.push(F);
289
289
  }
290
290
  const b = T[I].docTransform.positionV;
291
- let E = C;
292
- b.relativeFrom === V.PAGE ? E += G : b.relativeFrom === V.LINE ? E -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (E -= x.blockAnchorTop);
291
+ let A = C;
292
+ b.relativeFrom === V.PAGE ? A += G : b.relativeFrom === V.LINE ? A -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (A -= x.blockAnchorTop);
293
293
  const $ = {
294
294
  relativeFrom: b.relativeFrom,
295
- posOffset: E
295
+ posOffset: A
296
296
  };
297
297
  if (b.posOffset !== $.posOffset) {
298
298
  const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], b, $);
@@ -309,16 +309,16 @@ const Zn = {
309
309
  }
310
310
  };
311
311
  M.params.actions = D.reduce((N, I) => q.compose(N, I), null);
312
- const P = o.syncExecuteCommand(M.id, M.params);
313
- return h.refreshControls(), !!P;
312
+ const y = o.syncExecuteCommand(M.id, M.params);
313
+ return h.refreshControls(), !!y;
314
314
  }
315
- }, Qn = {
315
+ }, Jn = {
316
316
  id: "doc.command.update-doc-drawing-distance",
317
- type: K.COMMAND,
317
+ type: Y.COMMAND,
318
318
  handler: (i, e) => {
319
319
  if (e == null)
320
320
  return !1;
321
- const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
321
+ const n = i.get(z), r = i.get(K).getCurrentUniverDocInstance();
322
322
  if (r == null)
323
323
  return !1;
324
324
  const { drawings: o, dist: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
@@ -342,13 +342,13 @@ const Zn = {
342
342
  };
343
343
  return m.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(m.id, m.params);
344
344
  }
345
- }, Jn = {
345
+ }, et = {
346
346
  id: "doc.command.update-doc-drawing-wrap-text",
347
- type: K.COMMAND,
347
+ type: Y.COMMAND,
348
348
  handler: (i, e) => {
349
349
  if (e == null)
350
350
  return !1;
351
- const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
351
+ const n = i.get(z), r = i.get(K).getCurrentUniverDocInstance();
352
352
  if (r == null)
353
353
  return !1;
354
354
  const { drawings: o, wrapText: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
@@ -371,11 +371,11 @@ const Zn = {
371
371
  }
372
372
  }, qe = {
373
373
  id: "doc.command.update-drawing-doc-transform",
374
- type: K.COMMAND,
374
+ type: Y.COMMAND,
375
375
  handler: (i, e) => {
376
376
  if (e == null)
377
377
  return !1;
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
+ const n = i.get(z), t = i.get(K), o = i.get(ee).getRenderById(e.unitId), s = o == null ? void 0 : o.scene;
379
379
  if (s == null)
380
380
  return !1;
381
381
  const a = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
@@ -384,7 +384,7 @@ const Zn = {
384
384
  const { drawings: c, unitId: l } = e, m = q.getInstance(), g = [], { drawings: p = {} } = d.getSnapshot();
385
385
  for (const w of c) {
386
386
  const { drawingId: S, key: O, value: D } = w, T = p[S].docTransform[O];
387
- if (!Pe.diffValue(T, D)) {
387
+ if (!ye.diffValue(T, D)) {
388
388
  const M = m.replaceOp(["drawings", S, "docTransform", O], T, D);
389
389
  g.push(M);
390
390
  }
@@ -402,9 +402,9 @@ const Zn = {
402
402
  const v = n.syncExecuteCommand(h.id, h.params);
403
403
  return a.refreshControls(), !!v;
404
404
  }
405
- }, et = {
405
+ }, nt = {
406
406
  id: "doc.command.move-inline-drawing",
407
- type: K.COMMAND,
407
+ type: Y.COMMAND,
408
408
  handler: (i, e) => {
409
409
  var U, N;
410
410
  if (e == null)
@@ -412,13 +412,13 @@ const Zn = {
412
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, a = o == null ? void 0 : o.with(se).getSkeleton();
413
413
  if (s == null || t == null)
414
414
  return !1;
415
- const d = s.getTransformerByCreate(), c = i.get(z), m = i.get(Q).getCurrentUniverDocInstance();
415
+ const d = s.getTransformerByCreate(), c = i.get(z), m = i.get(K).getCurrentUniverDocInstance();
416
416
  if (m == null)
417
417
  return !1;
418
418
  const { drawing: g, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
419
419
  if (S)
420
420
  return r.refreshDrawings(a), d.refreshControls(), !0;
421
- const O = [], { drawingId: D } = g, T = (N = t.getSegment()) != null ? N : "", M = Yn(
421
+ const O = [], { drawingId: D } = g, T = (N = t.getSegment()) != null ? N : "", M = Zn(
422
422
  v,
423
423
  T,
424
424
  w,
@@ -430,7 +430,7 @@ const Zn = {
430
430
  if (M == null || M.length === 0)
431
431
  return r.refreshDrawings(a), d.refreshControls(), !1;
432
432
  O.push(...M);
433
- const P = {
433
+ const y = {
434
434
  id: J.id,
435
435
  params: {
436
436
  unitId: p,
@@ -438,13 +438,13 @@ const Zn = {
438
438
  textRanges: null
439
439
  }
440
440
  };
441
- P.params.actions = O.reduce((I, L) => q.compose(I, L), null);
442
- const A = c.syncExecuteCommand(P.id, P.params);
443
- return d.refreshControls(), !!A;
441
+ y.params.actions = O.reduce((I, L) => q.compose(I, L), null);
442
+ const E = c.syncExecuteCommand(y.id, y.params);
443
+ return d.refreshControls(), !!E;
444
444
  }
445
- }, nt = {
445
+ }, tt = {
446
446
  id: "doc.command.transform-non-inline-drawing",
447
- type: K.COMMAND,
447
+ type: Y.COMMAND,
448
448
  // eslint-disable-next-line max-lines-per-function
449
449
  handler: (i, e) => {
450
450
  var x, G;
@@ -453,10 +453,10 @@ const Zn = {
453
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;
454
454
  if (o == null || t == null)
455
455
  return !1;
456
- const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(Q).getCurrentUniverDocInstance();
456
+ const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(K).getCurrentUniverDocInstance();
457
457
  if (c == null)
458
458
  return !1;
459
- const { drawing: l, unitId: m, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Yn(
459
+ const { drawing: l, unitId: m, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Zn(
460
460
  h,
461
461
  O,
462
462
  v,
@@ -468,20 +468,20 @@ const Zn = {
468
468
  if (D == null)
469
469
  return !1;
470
470
  D.length > 0 && w.push(...D);
471
- const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(), P = M[S].docTransform, { positionH: A, positionV: U, size: N, angle: I } = P;
472
- if (!Pe.diffValue(A, p.positionH)) {
473
- const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], A, p.positionH);
471
+ const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(), y = M[S].docTransform, { positionH: E, positionV: U, size: N, angle: I } = y;
472
+ if (!ye.diffValue(E, p.positionH)) {
473
+ const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], E, p.positionH);
474
474
  w.push(_);
475
475
  }
476
- if (!Pe.diffValue(U, p.positionV)) {
476
+ if (!ye.diffValue(U, p.positionV)) {
477
477
  const _ = T.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
478
478
  w.push(_);
479
479
  }
480
- if (!Pe.diffValue(N, p.size)) {
480
+ if (!ye.diffValue(N, p.size)) {
481
481
  const _ = T.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
482
482
  w.push(_);
483
483
  }
484
- if (!Pe.diffValue(I, p.angle)) {
484
+ if (!ye.diffValue(I, p.angle)) {
485
485
  const _ = T.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
486
486
  w.push(_);
487
487
  }
@@ -504,15 +504,15 @@ var Ri = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
504
504
  (s = i[o]) && (r = s(r) || r);
505
505
  return r;
506
506
  }, Qe = (i, e) => (n, t) => e(n, t, i);
507
- const Ai = "__InlineDrawingAnchor__";
508
- function Fn(i) {
507
+ const Ei = "__InlineDrawingAnchor__";
508
+ function Hn(i) {
509
509
  const { path: e } = i;
510
510
  return e.some((n) => n === "cells");
511
511
  }
512
512
  let on = class extends Xe {
513
513
  constructor(e, n, t, r) {
514
514
  super();
515
- Ce(this, "_liquid", new jn());
515
+ Ce(this, "_liquid", new $n());
516
516
  Ce(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
517
517
  // Use to cache the drawings is under transforming or scaling.
518
518
  Ce(this, "_transformerCache", /* @__PURE__ */ new Map());
@@ -563,8 +563,8 @@ let on = class extends Xe {
563
563
  })
564
564
  )
565
565
  );
566
- const t = On(this._updateMultipleDrawingDocTransform.bind(this), 50);
567
- On(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
566
+ const t = Tn(this._updateMultipleDrawingDocTransform.bind(this), 50);
567
+ Tn(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
568
568
  Le(
569
569
  n.changing$.subscribe((o) => {
570
570
  const { objects: s, offsetX: a, offsetY: d } = o;
@@ -632,20 +632,20 @@ let on = class extends Xe {
632
632
  key: "angle",
633
633
  value: c
634
634
  }), v !== d || w !== a) {
635
- const P = d - v, A = a - w;
636
- P !== 0 && n.push({
635
+ const y = d - v, E = a - w;
636
+ y !== 0 && n.push({
637
637
  drawingId: g.drawingId,
638
638
  key: "positionV",
639
639
  value: {
640
640
  relativeFrom: h.docTransform.positionV.relativeFrom,
641
- posOffset: h.docTransform.positionV.posOffset + P
641
+ posOffset: h.docTransform.positionV.posOffset + y
642
642
  }
643
- }), A !== 0 && n.push({
643
+ }), E !== 0 && n.push({
644
644
  drawingId: g.drawingId,
645
645
  key: "positionH",
646
646
  value: {
647
647
  relativeFrom: h.docTransform.positionH.relativeFrom,
648
- posOffset: h.docTransform.positionH.posOffset + A
648
+ posOffset: h.docTransform.positionH.posOffset + E
649
649
  }
650
650
  });
651
651
  }
@@ -676,7 +676,7 @@ let on = class extends Xe {
676
676
  if (r == null)
677
677
  return;
678
678
  const { mainComponent: s, scene: a } = r, d = s, c = a.getViewports()[0], {
679
- pageLayoutType: l = Mn.VERTICAL,
679
+ pageLayoutType: l = Rn.VERTICAL,
680
680
  pageMarginLeft: m,
681
681
  pageMarginTop: g
682
682
  } = d.getOffsetConfig();
@@ -687,58 +687,52 @@ let on = class extends Xe {
687
687
  const D = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Me);
688
688
  if (D == null)
689
689
  return;
690
- const T = o == null ? void 0 : o.findNodeByCoord(
691
- O,
692
- l,
693
- m,
694
- g,
695
- {
696
- strict: !1,
697
- segmentId: D.getSegment(),
698
- segmentPage: D.getSegmentPage()
699
- }
700
- );
690
+ const T = o == null ? void 0 : o.findNodeByCoord(O, l, m, g, {
691
+ strict: !1,
692
+ segmentId: D.getSegment(),
693
+ segmentPage: D.getSegmentPage()
694
+ });
701
695
  if (T) {
702
- const { node: _, ratioX: C, segmentPage: R, segmentId: y } = T;
703
- h = C < S, p = _, v = R, w = y;
696
+ const { node: _, ratioX: C, segmentPage: R, segmentId: P } = T;
697
+ h = C < S, p = _, v = R, w = P;
704
698
  }
705
699
  if (p == null)
706
700
  return;
707
- const M = o == null ? void 0 : o.findPositionByGlyph(p, v), P = this._getDocObject();
708
- if (M == null || o == null || P == null || Fn(M))
701
+ const M = o == null ? void 0 : o.findPositionByGlyph(p, v), y = this._getDocObject();
702
+ if (M == null || o == null || y == null || Hn(M))
709
703
  return;
710
- const A = {
704
+ const E = {
711
705
  ...M,
712
706
  isBack: h
713
- }, U = P.document.getOffsetConfig(), N = new Nn(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(A, A), { startOffset: W } = (G = An(I)) != null ? G : {};
707
+ }, U = y.document.getOffsetConfig(), N = new En(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(E, E), { startOffset: W } = (G = An(I)) != null ? G : {};
714
708
  if (W != null)
715
709
  return { offset: W, contentBoxPointGroup: L, segmentId: w, segmentPage: v };
716
710
  }
717
711
  // eslint-disable-next-line max-lines-per-function, complexity
718
712
  _getDrawingAnchor(e, n) {
719
- var _e, Se, de, De, Oe, Ne, Ae, Te, le, ge, Ee;
713
+ var _e, Se, de, De, Oe, Ne, Ee, Te, le, ge, Ae;
720
714
  const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(se).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
721
715
  if (o == null || t == null)
722
716
  return;
723
- const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: l } = t, m = c, g = l.getViewports()[0], { pageLayoutType: p = Mn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = m.getOffsetConfig(), { left: O, top: D, angle: T } = n;
724
- let { width: M, height: P } = n;
725
- const { positionV: A, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
726
- M = Math.min(M, N), P = Math.min(P, I);
717
+ const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: l } = t, m = c, g = l.getViewports()[0], { pageLayoutType: p = Rn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = m.getOffsetConfig(), { left: O, top: D, angle: T } = n;
718
+ let { width: M, height: y } = n;
719
+ const { positionV: E, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
720
+ M = Math.min(M, N), y = Math.min(y, I);
727
721
  let L = null, W = "", x = -1;
728
722
  const G = !1, _ = {
729
723
  ...e.docTransform,
730
724
  size: {
731
725
  width: M,
732
- height: P
726
+ height: y
733
727
  },
734
728
  angle: T
735
- }, { x: C, y: R } = l.getViewportScrollXY(g), y = this._getTransformCoordForDocumentOffset(m, g, O - C, D - R);
736
- if (y == null)
729
+ }, { x: C, y: R } = l.getViewportScrollXY(g), P = this._getTransformCoordForDocumentOffset(m, g, O - C, D - R);
730
+ if (P == null)
737
731
  return;
738
732
  const B = (_e = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : _e.with(Me);
739
733
  if (B == null)
740
734
  return;
741
- const k = r == null ? void 0 : r.findNodeByCoord(y, p, h, v, {
735
+ const k = r == null ? void 0 : r.findNodeByCoord(P, p, h, v, {
742
736
  strict: !1,
743
737
  segmentId: B.getSegment(),
744
738
  segmentPage: B.getSegmentPage()
@@ -749,32 +743,32 @@ let on = class extends Xe {
749
743
  }
750
744
  if (L == null)
751
745
  return;
752
- const b = (Se = L.parent) == null ? void 0 : Se.parent, E = b == null ? void 0 : b.parent, $ = (de = E == null ? void 0 : E.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : E == null ? void 0 : E.lines[0], F = (De = E == null ? void 0 : E.parent) == null ? void 0 : De.parent;
753
- if (b == null || E == null || $ == null || F == null)
746
+ const b = (Se = L.parent) == null ? void 0 : Se.parent, A = b == null ? void 0 : b.parent, $ = (de = A == null ? void 0 : A.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : A == null ? void 0 : A.lines[0], F = (De = A == null ? void 0 : A.parent) == null ? void 0 : De.parent;
747
+ if (b == null || A == null || $ == null || F == null)
754
748
  return;
755
749
  this._liquid.reset();
756
- const Y = F.type;
750
+ const Z = F.type;
757
751
  for (const pe of s) {
758
- const { headerId: mn, footerId: un, pageHeight: It, pageWidth: Cn, marginLeft: Dn, marginBottom: _t } = pe, St = s.indexOf(pe);
752
+ const { headerId: mn, footerId: un, pageHeight: It, pageWidth: Dn, marginLeft: On, marginBottom: _t } = pe, St = s.indexOf(pe);
759
753
  if (x > -1 && St === x) {
760
- switch (Y) {
761
- case Rn.HEADER: {
762
- const Ge = (Oe = a.get(mn)) == null ? void 0 : Oe.get(Cn);
754
+ switch (Z) {
755
+ case Nn.HEADER: {
756
+ const Ge = (Oe = a.get(mn)) == null ? void 0 : Oe.get(Dn);
763
757
  if (Ge)
764
758
  this._liquid.translatePagePadding({
765
759
  marginTop: Ge.marginTop,
766
- marginLeft: Dn
760
+ marginLeft: On
767
761
  });
768
762
  else
769
763
  throw new Error("header skeleton not found");
770
764
  break;
771
765
  }
772
- case Rn.FOOTER: {
773
- const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Cn);
766
+ case Nn.FOOTER: {
767
+ const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Dn);
774
768
  if (Ge)
775
769
  this._liquid.translatePagePadding({
776
770
  marginTop: It - _t + Ge.marginTop,
777
- marginLeft: Dn
771
+ marginLeft: On
778
772
  });
779
773
  else
780
774
  throw new Error("footer skeleton not found");
@@ -787,7 +781,7 @@ let on = class extends Xe {
787
781
  break;
788
782
  this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, p, h, v);
789
783
  }
790
- switch (A.relativeFrom === V.LINE ? L = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ae = $.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
784
+ switch (E.relativeFrom === V.LINE ? L = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ee = $.divides) == null ? void 0 : Ee[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
791
785
  relativeFrom: U.relativeFrom,
792
786
  posOffset: O - this._liquid.x - w
793
787
  }, U.relativeFrom) {
@@ -796,14 +790,14 @@ let on = class extends Xe {
796
790
  break;
797
791
  }
798
792
  case ne.COLUMN: {
799
- _.positionH.posOffset = O - this._liquid.x - w - E.left;
793
+ _.positionH.posOffset = O - this._liquid.x - w - A.left;
800
794
  break;
801
795
  }
802
796
  }
803
797
  switch (_.positionV = {
804
- relativeFrom: A.relativeFrom,
798
+ relativeFrom: E.relativeFrom,
805
799
  posOffset: D - this._liquid.y - S
806
- }, A.relativeFrom) {
800
+ }, E.relativeFrom) {
807
801
  case V.PAGE: {
808
802
  _.positionV.posOffset = D - this._liquid.y - S - F.marginTop;
809
803
  break;
@@ -820,12 +814,12 @@ let on = class extends Xe {
820
814
  if (L == null)
821
815
  return;
822
816
  const ae = r == null ? void 0 : r.findPositionByGlyph(L, x), Ue = this._getDocObject();
823
- if (ae == null || r == null || Ue == null || Fn(ae))
817
+ if (ae == null || r == null || Ue == null || Hn(ae))
824
818
  return;
825
819
  const Re = {
826
820
  ...ae,
827
821
  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 : {};
822
+ }, We = Ue.document.getOffsetConfig(), ce = new En(We, r), { cursorList: te } = ce.getRangePointData(Re, Re), { startOffset: ie } = (Ae = An(te)) != null ? Ae : {};
829
823
  if (ie != null)
830
824
  return { offset: ie, docTransform: _, segmentId: W, segmentPage: x };
831
825
  }
@@ -854,7 +848,7 @@ let on = class extends Xe {
854
848
  // Update inline drawing when use transformer to move it.
855
849
  _moveInlineDrawing(e, n, t) {
856
850
  const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage: a } = r != null ? r : {};
857
- return this._commandService.executeCommand(et.id, {
851
+ return this._commandService.executeCommand(nt.id, {
858
852
  unitId: e.unitId,
859
853
  subUnitId: e.unitId,
860
854
  drawing: e,
@@ -880,17 +874,17 @@ let on = class extends Xe {
880
874
  let O = o;
881
875
  this._liquid.reset();
882
876
  for (const D of m) {
883
- const { marginBottom: T, pageHeight: M } = D, P = m.indexOf(D), A = m[P + 1];
884
- if (A == null)
877
+ const { marginBottom: T, pageHeight: M } = D, y = m.indexOf(D), E = m[y + 1];
878
+ if (E == null)
885
879
  continue;
886
- if (Pe.hasIntersectionBetweenTwoRanges(
880
+ if (ye.hasIntersectionBetweenTwoRanges(
887
881
  o,
888
882
  o + a,
889
883
  this._liquid.y + h + M - T,
890
- this._liquid.y + h + M + S + A.marginTop
884
+ this._liquid.y + h + M + S + E.marginTop
891
885
  )) {
892
886
  const N = o + a / 2, I = this._liquid.y + h + M + S / 2;
893
- N < I ? O = Math.min(o, this._liquid.y + h + M - T - a) : O = Math.max(o, this._liquid.y + h + M + S + A.marginTop);
887
+ N < I ? O = Math.min(o, this._liquid.y + h + M - T - a) : O = Math.max(o, this._liquid.y + h + M + S + E.marginTop);
894
888
  }
895
889
  this._liquid.translatePage(D, v, w, S);
896
890
  }
@@ -907,7 +901,7 @@ let on = class extends Xe {
907
901
  if (t && r.top !== n.top)
908
902
  return;
909
903
  const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: a, segmentId: d, segmentPage: c } = o != null ? o : {};
910
- return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(nt.id, {
904
+ return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(tt.id, {
911
905
  unitId: e.unitId,
912
906
  subUnitId: e.unitId,
913
907
  drawing: e,
@@ -927,7 +921,7 @@ let on = class extends Xe {
927
921
  return { scene: t, transformer: r };
928
922
  }
929
923
  _getTransformCoordForDocumentOffset(e, n, t, r) {
930
- const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ei.FromArray([t, r]));
924
+ const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(Jt.FromArray([t, r]));
931
925
  if (s)
932
926
  return o.clone().invert().applyPoint(s);
933
927
  }
@@ -943,12 +937,12 @@ let on = class extends Xe {
943
937
  this._anchorShape.transformByState({ left: p, top: h, height: g }), this._anchorShape.show();
944
938
  return;
945
939
  }
946
- const v = 6, w = new ni(Ai + Pe.generateRandomId(v), {
940
+ const v = 6, w = new ei(Ei + ye.generateRandomId(v), {
947
941
  left: p,
948
942
  top: h,
949
943
  height: g,
950
944
  strokeWidth: 2,
951
- stroke: ti(yt.darkGray, 1),
945
+ stroke: ni(Pt.darkGray, 1),
952
946
  evented: !1
953
947
  });
954
948
  this._anchorShape = w, o.addObject(w, ui);
@@ -987,7 +981,7 @@ let on = class extends Xe {
987
981
  };
988
982
  on = Ni([
989
983
  Qe(0, z),
990
- Qe(1, Q),
984
+ Qe(1, K),
991
985
  Qe(2, Ie),
992
986
  Qe(3, ee)
993
987
  ], on);
@@ -999,20 +993,20 @@ var he = function() {
999
993
  }
1000
994
  return i;
1001
995
  }, he.apply(this, arguments);
1002
- }, Ei = function(i, e) {
996
+ }, Ai = function(i, e) {
1003
997
  var n = {};
1004
998
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
1005
999
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
1006
1000
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
1007
1001
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
1008
1002
  return n;
1009
- }, tt = Xn(function(i, e) {
1010
- var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Ei(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Di("_".concat(Bi()));
1011
- return it(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: a }, s), o);
1003
+ }, it = Kn(function(i, e) {
1004
+ var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Ai(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Di("_".concat(Bi()));
1005
+ return rt(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: a }, s), o);
1012
1006
  });
1013
- function it(i, e, n, t, r) {
1014
- return Kn(i.tag, he(he({ key: e }, xi(i, n, r)), t), (Li(i, n).children || []).map(function(o, s) {
1015
- return it(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1007
+ function rt(i, e, n, t, r) {
1008
+ return Yn(i.tag, he(he({ key: e }, xi(i, n, r)), t), (Li(i, n).children || []).map(function(o, s) {
1009
+ return rt(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1016
1010
  }));
1017
1011
  }
1018
1012
  function xi(i, e, n) {
@@ -1036,25 +1030,25 @@ function Li(i, e) {
1036
1030
  function Bi() {
1037
1031
  return Math.random().toString(36).substring(2, 8);
1038
1032
  }
1039
- tt.displayName = "UniverIcon";
1040
- var Ui = { 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) {
1041
- return Kn(tt, Object.assign({}, i, {
1033
+ it.displayName = "UniverIcon";
1034
+ var Ui = { 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" } }] }, ot = Kn(function(i, e) {
1035
+ return Yn(it, Object.assign({}, i, {
1042
1036
  id: "add-image-single",
1043
1037
  ref: e,
1044
1038
  icon: Ui
1045
1039
  }));
1046
1040
  });
1047
- rt.displayName = "AddImageSingle";
1048
- const Sn = {
1041
+ ot.displayName = "AddImageSingle";
1042
+ const Cn = {
1049
1043
  id: "doc.command.remove-doc-image",
1050
- type: K.COMMAND,
1044
+ type: Y.COMMAND,
1051
1045
  // eslint-disable-next-line max-lines-per-function
1052
1046
  handler: (i, e) => {
1053
- var M, P, A, U;
1054
- const n = i.get(z), t = i.get(Q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
1047
+ var M, y, E, U;
1048
+ const n = i.get(z), t = i.get(K), r = i.get(ee), o = t.getCurrentUniverDocInstance();
1055
1049
  if (e == null || o == null)
1056
1050
  return !1;
1057
- const s = r.getRenderById(e.unitId).with(Me), { drawings: a } = e, d = (M = s.getSegment()) != null ? M : "", c = new vn(), l = q.getInstance(), m = (A = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? A : [], g = a.map((N) => m.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new Pt();
1051
+ const s = r.getRenderById(e.unitId).with(Me), { drawings: a } = e, d = (M = s.getSegment()) != null ? M : "", c = new vn(), l = q.getInstance(), m = (E = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? E : [], g = a.map((N) => m.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new yt();
1058
1052
  h.reset();
1059
1053
  const v = g[0].startIndex, w = [
1060
1054
  {
@@ -1072,10 +1066,10 @@ const Sn = {
1072
1066
  for (const N of g) {
1073
1067
  const { startIndex: I } = N;
1074
1068
  I > h.cursor && c.push({
1075
- t: Z.RETAIN,
1069
+ t: Q.RETAIN,
1076
1070
  len: I - h.cursor
1077
1071
  }), c.push({
1078
- t: Z.DELETE,
1072
+ t: Q.DELETE,
1079
1073
  len: 1
1080
1074
  }), h.moveCursorTo(I + 1);
1081
1075
  }
@@ -1087,9 +1081,9 @@ const Sn = {
1087
1081
  }
1088
1082
  return S.params.actions = O.reduce((N, I) => q.compose(N, I), null), !!n.syncExecuteCommand(S.id, S.params);
1089
1083
  }
1090
- }, ot = {
1084
+ }, st = {
1091
1085
  id: "doc.command.delete-drawing",
1092
- type: K.COMMAND,
1086
+ type: Y.COMMAND,
1093
1087
  handler: (i) => {
1094
1088
  const e = i.get(z), t = i.get(Be).getFocusDrawings();
1095
1089
  if (t.length === 0)
@@ -1103,16 +1097,16 @@ const Sn = {
1103
1097
  drawingType: l
1104
1098
  };
1105
1099
  });
1106
- return e.executeCommand(Sn.id, {
1100
+ return e.executeCommand(Cn.id, {
1107
1101
  unitId: r,
1108
1102
  drawings: o
1109
1103
  });
1110
1104
  }
1111
- }, st = {
1105
+ }, at = {
1112
1106
  id: "doc.command.group-doc-image",
1113
- type: K.COMMAND,
1107
+ type: Y.COMMAND,
1114
1108
  handler: (i, e) => {
1115
- i.get(z), i.get(Gn);
1109
+ i.get(z), i.get(Vn);
1116
1110
  const n = i.get(Be);
1117
1111
  if (!e) return !1;
1118
1112
  const t = [];
@@ -1124,25 +1118,25 @@ const Sn = {
1124
1118
  const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: a, redo: d, objects: c } = r;
1125
1119
  return !1;
1126
1120
  }
1127
- }, at = {
1121
+ }, ct = {
1128
1122
  id: "doc.command.insert-doc-image",
1129
- type: K.COMMAND,
1123
+ type: Y.COMMAND,
1130
1124
  // eslint-disable-next-line max-lines-per-function
1131
1125
  handler: (i, e) => {
1132
- var P, A, U, N;
1126
+ var y, E, U, N;
1133
1127
  if (e == null)
1134
1128
  return !1;
1135
- const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
1129
+ const n = i.get(z), t = i.get(_n), r = i.get(K), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
1136
1130
  if (o == null || s == null)
1137
1131
  return !1;
1138
1132
  const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
1139
1133
  if (g == null)
1140
1134
  return !1;
1141
- const p = new vn(), h = q.getInstance(), v = [], w = (A = (P = s.getSnapshot().drawingsOrder) == null ? void 0 : P.length) != null ? A : 0;
1135
+ const p = new vn(), h = q.getInstance(), v = [], w = (E = (y = s.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? E : 0;
1142
1136
  let S = 0;
1143
1137
  if (c)
1144
1138
  l > 0 && p.push({
1145
- t: Z.RETAIN,
1139
+ t: Q.RETAIN,
1146
1140
  len: l
1147
1141
  });
1148
1142
  else {
@@ -1154,12 +1148,12 @@ const Sn = {
1154
1148
  const C = W[_], R = x.indexOf(_);
1155
1149
  if (C == null || R < 0)
1156
1150
  continue;
1157
- const y = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
1158
- v.push(y), v.push(B), S++;
1151
+ const P = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
1152
+ v.push(P), v.push(B), S++;
1159
1153
  }
1160
1154
  }
1161
1155
  p.push({
1162
- t: Z.INSERT,
1156
+ t: Q.INSERT,
1163
1157
  body: {
1164
1158
  dataStream: "\b".repeat(d.length),
1165
1159
  customBlocks: d.map((I, L) => ({
@@ -1185,9 +1179,9 @@ const Sn = {
1185
1179
  };
1186
1180
  return T.params.actions = v.reduce((I, L) => q.compose(I, L), null), !!n.syncExecuteCommand(T.id, T.params);
1187
1181
  }
1188
- }, ct = {
1182
+ }, dt = {
1189
1183
  id: "doc.command.set-drawing-arrange",
1190
- type: K.COMMAND,
1184
+ type: Y.COMMAND,
1191
1185
  handler: (i, e) => {
1192
1186
  const n = i.get(z), t = i.get(Be);
1193
1187
  if (e == null)
@@ -1200,7 +1194,7 @@ const Sn = {
1200
1194
  if (l == null)
1201
1195
  return !1;
1202
1196
  const m = [];
1203
- let g = Pe.deepClone(l);
1197
+ let g = ye.deepClone(l);
1204
1198
  g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
1205
1199
  const p = {
1206
1200
  id: J.id,
@@ -1212,11 +1206,11 @@ const Sn = {
1212
1206
  };
1213
1207
  return p.params.actions = m.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
1214
1208
  }
1215
- }, dt = {
1209
+ }, lt = {
1216
1210
  id: "doc.command.ungroup-doc-image",
1217
- type: K.COMMAND,
1211
+ type: Y.COMMAND,
1218
1212
  handler: (i, e) => {
1219
- i.get(z), i.get(Gn);
1213
+ i.get(z), i.get(Vn);
1220
1214
  const n = i.get(Be);
1221
1215
  if (!e) return !1;
1222
1216
  const t = [];
@@ -1241,10 +1235,10 @@ let sn = class extends Xe {
1241
1235
  async insertDocImage() {
1242
1236
  const i = await this._fileOpenerService.openFile({
1243
1237
  multiple: !0,
1244
- accept: Vt.map((n) => `.${n.replace("image/", "")}`).join(",")
1238
+ accept: Gt.map((n) => `.${n.replace("image/", "")}`).join(",")
1245
1239
  }), e = i.length;
1246
1240
  return e > yn ? (this._messageService.show({
1247
- type: Ln.Error,
1241
+ type: Bn.Error,
1248
1242
  content: this._localeService.t("update-status.exceedMaxCount", String(yn))
1249
1243
  }), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
1250
1244
  }
@@ -1258,7 +1252,7 @@ let sn = class extends Xe {
1258
1252
  let s = "";
1259
1253
  switch (o) {
1260
1254
  case hn.ERROR_EXCEED_SIZE:
1261
- s = this._localeService.t("update-status.exceedMaxSize", String(jt / (1024 * 1024)));
1255
+ s = this._localeService.t("update-status.exceedMaxSize", String(Vt / (1024 * 1024)));
1262
1256
  break;
1263
1257
  case hn.ERROR_IMAGE_TYPE:
1264
1258
  s = this._localeService.t("update-status.invalidImageType");
@@ -1268,7 +1262,7 @@ let sn = class extends Xe {
1268
1262
  break;
1269
1263
  }
1270
1264
  this._messageService.show({
1271
- type: Ln.Error,
1265
+ type: Bn.Error,
1272
1266
  content: s
1273
1267
  });
1274
1268
  }
@@ -1278,11 +1272,11 @@ let sn = class extends Xe {
1278
1272
  for (const r of e) {
1279
1273
  if (r == null)
1280
1274
  continue;
1281
- const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await $t(d || "");
1275
+ const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await jt(d || "");
1282
1276
  this._imageIoService.addImageSourceCache(o, s, m);
1283
1277
  let g = 1;
1284
- if (c > Pn || l > bn) {
1285
- const w = Pn / c, S = bn / l;
1278
+ if (c > bn || l > Mn) {
1279
+ const w = bn / c, S = Mn / l;
1286
1280
  g = Math.min(w, S);
1287
1281
  }
1288
1282
  const p = this._getImagePosition(c * g, l * g);
@@ -1310,7 +1304,7 @@ let sn = class extends Xe {
1310
1304
  };
1311
1305
  this._isInsertInHeaderFooter() && (h.isMultiTransform = oe.TRUE, h.transforms = h.transform ? [h.transform] : null), t.push(h);
1312
1306
  }
1313
- this._commandService.executeCommand(at.id, {
1307
+ this._commandService.executeCommand(ct.id, {
1314
1308
  unitId: n,
1315
1309
  drawings: t
1316
1310
  });
@@ -1343,7 +1337,7 @@ let sn = class extends Xe {
1343
1337
  _updateOrderListener() {
1344
1338
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
1345
1339
  const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: r } = i;
1346
- this._commandService.executeCommand(ct.id, {
1340
+ this._commandService.executeCommand(dt.id, {
1347
1341
  unitId: e,
1348
1342
  subUnitId: n,
1349
1343
  drawingIds: t,
@@ -1353,9 +1347,9 @@ let sn = class extends Xe {
1353
1347
  }
1354
1348
  _groupDrawingListener() {
1355
1349
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
1356
- this._commandService.executeCommand(st.id, i);
1350
+ this._commandService.executeCommand(at.id, i);
1357
1351
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
1358
- this._commandService.executeCommand(dt.id, i);
1352
+ this._commandService.executeCommand(lt.id, i);
1359
1353
  });
1360
1354
  }
1361
1355
  _getCurrentSceneAndTransformer() {
@@ -1368,7 +1362,7 @@ let sn = class extends Xe {
1368
1362
  _transformDrawingListener() {
1369
1363
  const i = this._getCurrentSceneAndTransformer();
1370
1364
  if (i && i.transformer)
1371
- this.disposeWithMe(i.transformer.changeEnd$.pipe(qn(30)).subscribe((e) => {
1365
+ this.disposeWithMe(i.transformer.changeEnd$.pipe(Xn(30)).subscribe((e) => {
1372
1366
  this._docSelectionManagerService.refreshSelection();
1373
1367
  }));
1374
1368
  else
@@ -1416,7 +1410,7 @@ let sn = class extends Xe {
1416
1410
  return;
1417
1411
  const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Fe.BODY;
1418
1412
  for (const d of Object.keys(o)) {
1419
- const c = o[d], l = zt({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
1413
+ const c = o[d], l = $t({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
1420
1414
  if (m.length)
1421
1415
  for (const g of m)
1422
1416
  e.detachTransformerFrom(g), g.setOpacity(0.5), (s && c.isMultiTransform !== oe.TRUE || !s && c.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
@@ -1452,42 +1446,43 @@ let sn = class extends Xe {
1452
1446
  };
1453
1447
  sn = Fi([
1454
1448
  me(1, z),
1455
- me(2, ve(In)),
1449
+ me(2, ve(_n)),
1456
1450
  me(3, ee),
1457
- me(4, Gt),
1451
+ me(4, Wt),
1458
1452
  me(5, Be),
1459
1453
  me(6, Ie),
1460
- me(7, Vn),
1454
+ me(7, jn),
1461
1455
  me(8, ri),
1462
1456
  me(9, ve(ln)),
1463
1457
  me(10, ve(Me)),
1464
1458
  me(11, ve(gn)),
1465
1459
  me(12, oi)
1466
1460
  ], sn);
1467
- const lt = {
1461
+ const gt = {
1468
1462
  id: "doc.command.insert-float-image",
1469
- type: K.COMMAND,
1463
+ type: Y.COMMAND,
1470
1464
  handler: (i) => {
1471
- var n, t;
1472
- return (t = (n = i.get(ee).getCurrentTypeOfRenderer(be.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
1465
+ var t, r;
1466
+ const e = i.get(K), n = i.get(ee);
1467
+ return (r = (t = ti(be.UNIVER_DOC, e, n)) == null ? void 0 : t.with(sn).insertDocImage()) != null ? r : !1;
1473
1468
  }
1474
1469
  }, Ke = {
1475
1470
  id: "doc.command.move-drawing",
1476
- type: K.COMMAND,
1471
+ type: Y.COMMAND,
1477
1472
  handler: (i, e) => {
1478
- const n = i.get(z), t = i.get(Be), r = i.get(Q), o = i.get(ee), { direction: s } = e, a = t.getFocusDrawings();
1473
+ const n = i.get(z), t = i.get(Be), r = i.get(K), o = i.get(ee), { direction: s } = e, a = t.getFocusDrawings();
1479
1474
  if (a.length === 0)
1480
1475
  return !1;
1481
1476
  const d = a[0].unitId, c = o.getRenderById(d), l = c == null ? void 0 : c.scene;
1482
1477
  if (l == null)
1483
1478
  return !1;
1484
1479
  const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = a.map((v) => {
1485
- var P, A, U, N, I;
1486
- const { drawingId: w } = v, S = (P = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : P[w];
1480
+ var y, E, U, N, I;
1481
+ const { drawingId: w } = v, S = (y = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : y[w];
1487
1482
  if (S == null || S.layoutType === H.INLINE)
1488
1483
  return null;
1489
1484
  const { positionH: O, positionV: D } = S.docTransform, T = { ...O }, M = { ...D };
1490
- 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 ? T.posOffset = ((N = T.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (T.posOffset = ((I = T.posOffset) != null ? I : 0) + 2), {
1485
+ return s === fe.UP ? M.posOffset = ((E = M.posOffset) != null ? E : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ? T.posOffset = ((N = T.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (T.posOffset = ((I = T.posOffset) != null ? I : 0) + 2), {
1491
1486
  drawingId: w,
1492
1487
  key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
1493
1488
  value: s === fe.UP || s === fe.DOWN ? M : T
@@ -1504,7 +1499,7 @@ const lt = {
1504
1499
  }
1505
1500
  }, Hi = {
1506
1501
  id: "doc.operation.clear-drawing-transformer",
1507
- type: K.MUTATION,
1502
+ type: Y.MUTATION,
1508
1503
  handler: (i, e) => {
1509
1504
  const n = i.get(ee);
1510
1505
  return e.forEach((t) => {
@@ -1512,16 +1507,16 @@ const lt = {
1512
1507
  (o = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || o.debounceRefreshControls();
1513
1508
  }), !0;
1514
1509
  }
1515
- }, gt = "COMPONENT_DOC_DRAWING_PANEL", mt = {
1510
+ }, mt = "COMPONENT_DOC_DRAWING_PANEL", ut = {
1516
1511
  id: "sidebar.operation.doc-image",
1517
- type: K.COMMAND,
1512
+ type: Y.COMMAND,
1518
1513
  handler: async (i, e) => {
1519
1514
  const n = i.get(si), t = i.get(ln), r = i.get(Ie);
1520
1515
  switch (e.value) {
1521
1516
  case "open":
1522
1517
  n.open({
1523
1518
  header: { title: t.t("docImage.panel.title") },
1524
- children: { label: gt },
1519
+ children: { label: mt },
1525
1520
  onClose: () => {
1526
1521
  r.focusDrawing(null);
1527
1522
  },
@@ -1535,28 +1530,14 @@ const lt = {
1535
1530
  }
1536
1531
  return !0;
1537
1532
  }
1538
- }, ut = {
1533
+ }, ft = {
1539
1534
  id: "doc.operation.edit-doc-image",
1540
- type: K.OPERATION,
1535
+ type: Y.OPERATION,
1541
1536
  handler: (i, e) => {
1542
1537
  const n = i.get(Ie), t = i.get(z);
1543
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(mt.id, { value: "open" }), !0);
1538
+ return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(ut.id, { value: "open" }), !0);
1544
1539
  }
1545
- };
1546
- function ft(i) {
1547
- var e, n, t = "";
1548
- if (typeof i == "string" || typeof i == "number") t += i;
1549
- else if (typeof i == "object") if (Array.isArray(i)) {
1550
- var r = i.length;
1551
- for (e = 0; e < r; e++) i[e] && (n = ft(i[e])) && (t && (t += " "), t += n);
1552
- } else for (n in i) i[n] && (t && (t += " "), t += n);
1553
- return t;
1554
- }
1555
- function j() {
1556
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
1557
- return t;
1558
- }
1559
- const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", Vi = "univer-image-common-panel-border", ji = "univer-image-common-panel-title", $i = "univer-image-common-panel-subtitle", zi = "univer-image-common-panel-row", qi = "univer-image-common-panel-column", Xi = "univer-image-common-panel-span2", Ki = "univer-image-common-panel-input", u = {
1540
+ }, Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", Vi = "univer-image-common-panel-border", ji = "univer-image-common-panel-title", $i = "univer-image-common-panel-subtitle", zi = "univer-image-common-panel-row", qi = "univer-image-common-panel-column", Xi = "univer-image-common-panel-span2", Ki = "univer-image-common-panel-input", u = {
1560
1541
  imageCommonPanel: Wi,
1561
1542
  imageCommonPanelGrid: Gi,
1562
1543
  imageCommonPanelBorder: Vi,
@@ -1566,8 +1547,8 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1566
1547
  imageCommonPanelColumn: qi,
1567
1548
  imageCommonPanelSpan2: Xi,
1568
1549
  imageCommonPanelInput: Ki
1569
- }, Hn = -1e3, Wn = 1e3, Yi = (i) => {
1570
- const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
1550
+ }, Wn = -1e3, Gn = 1e3, Yi = (i) => {
1551
+ const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(K), { drawings: s } = i, a = s[0];
1571
1552
  if (a == null)
1572
1553
  return;
1573
1554
  const { unitId: d } = a, c = o.getUniverDocInstance(d), l = c == null ? void 0 : c.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), g = m == null ? void 0 : m.scene;
@@ -1603,23 +1584,23 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1603
1584
  }), [T, M] = re({
1604
1585
  relativeFrom: V.PAGE,
1605
1586
  posOffset: 0
1606
- }), [P, A] = re(!0), [U, N] = re(!0);
1587
+ }), [y, E] = re(!0), [U, N] = re(!0);
1607
1588
  function I(C, R) {
1608
1589
  var b;
1609
1590
  C === "positionH" ? D(R) : M(R);
1610
- const y = t.getFocusDrawings();
1611
- if (y.length === 0)
1591
+ const P = t.getFocusDrawings();
1592
+ if (P.length === 0)
1612
1593
  return;
1613
- const B = y.map((E) => ({
1614
- unitId: E.unitId,
1615
- subUnitId: E.subUnitId,
1616
- drawingId: E.drawingId
1594
+ const B = P.map((A) => ({
1595
+ unitId: A.unitId,
1596
+ subUnitId: A.subUnitId,
1597
+ drawingId: A.drawingId
1617
1598
  }));
1618
1599
  e.executeCommand(qe.id, {
1619
- unitId: y[0].unitId,
1620
- subUnitId: y[0].unitId,
1621
- drawings: B.map((E) => ({
1622
- drawingId: E.drawingId,
1600
+ unitId: P[0].unitId,
1601
+ subUnitId: P[0].unitId,
1602
+ drawings: B.map((A) => ({
1603
+ drawingId: A.drawingId,
1623
1604
  key: C,
1624
1605
  value: R
1625
1606
  }))
@@ -1629,20 +1610,20 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1629
1610
  }
1630
1611
  function L(C) {
1631
1612
  var ie, _e, Se;
1632
- const R = O.relativeFrom, y = O.posOffset, B = Number(C);
1613
+ const R = O.relativeFrom, P = O.posOffset, B = Number(C);
1633
1614
  if (R === B)
1634
1615
  return;
1635
1616
  const k = t.getFocusDrawings();
1636
1617
  if (k.length === 0)
1637
1618
  return;
1638
- const b = k[0].drawingId, E = k[0].unitId;
1619
+ const b = k[0].drawingId, A = k[0].unitId;
1639
1620
  let $ = null, F = 0;
1640
- const Y = (ie = r.getRenderById(E)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
1621
+ const Z = (ie = r.getRenderById(A)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Z == null ? void 0 : Z.getSkeletonData();
1641
1622
  if (ae == null)
1642
1623
  return;
1643
1624
  const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
1644
1625
  for (const de of Ue) {
1645
- const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth: Te } = de;
1626
+ const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ee, pageWidth: Te } = de;
1646
1627
  if (Oe.has(b)) {
1647
1628
  $ = Oe.get(b), F = De;
1648
1629
  break;
@@ -1652,7 +1633,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1652
1633
  $ = le == null ? void 0 : le.skeDrawings.get(b), F = De;
1653
1634
  break;
1654
1635
  }
1655
- const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(Te);
1636
+ const ge = (Se = We.get(Ee)) == null ? void 0 : Se.get(Te);
1656
1637
  if (ge != null && ge.skeDrawings.has(b)) {
1657
1638
  $ = ge == null ? void 0 : ge.skeDrawings.get(b), F = De;
1658
1639
  break;
@@ -1664,60 +1645,60 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1664
1645
  R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= F), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += F : ne.PAGE;
1665
1646
  const te = {
1666
1647
  relativeFrom: B,
1667
- posOffset: (y != null ? y : 0) - ce
1648
+ posOffset: (P != null ? P : 0) - ce
1668
1649
  };
1669
1650
  I("positionH", te);
1670
1651
  }
1671
1652
  function W(C) {
1672
- var Oe, Ne, Ae, Te, le, ge;
1673
- const R = T.relativeFrom, y = T.posOffset, B = Number(C);
1653
+ var Oe, Ne, Ee, Te, le, ge;
1654
+ const R = T.relativeFrom, P = T.posOffset, B = Number(C);
1674
1655
  if (R === B)
1675
1656
  return;
1676
1657
  const k = t.getFocusDrawings();
1677
1658
  if (k.length === 0)
1678
1659
  return;
1679
- const { drawingId: b, unitId: E } = k[0], $ = o.getUniverDocInstance(E), F = (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 = (Te = (Ae = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Te.find((Ee) => Ee.blockId === b);
1680
- if (Re == null || F == null || Y == null)
1660
+ const { drawingId: b, unitId: A } = k[0], $ = o.getUniverDocInstance(A), F = (Oe = r.getRenderById(A)) == null ? void 0 : Oe.with(se).getSkeleton(), Z = (Ne = r.getRenderById(A)) == null ? void 0 : Ne.with(Me), ae = Z == null ? void 0 : Z.getSegment(), Ue = Z == null ? void 0 : Z.getSegmentPage(), Re = (Te = (Ee = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ee.customBlocks) == null ? void 0 : Te.find((Ae) => Ae.blockId === b);
1661
+ if (Re == null || F == null || Z == null)
1681
1662
  return;
1682
- const { startIndex: We } = Re, ce = F.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;
1663
+ const { startIndex: We } = Re, ce = F.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((Ae) => Ae.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ae.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
1683
1664
  if (ce == null || te == null || _e == null || ie == null || Se == null)
1684
1665
  return;
1685
1666
  let de = 0;
1686
1667
  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
1668
  const De = {
1688
1669
  relativeFrom: B,
1689
- posOffset: (y != null ? y : 0) - de
1670
+ posOffset: (P != null ? P : 0) - de
1690
1671
  };
1691
1672
  I("positionV", De);
1692
1673
  }
1693
1674
  function x(C) {
1694
- var E;
1695
- const R = c == null ? void 0 : c.getSnapshot(), y = (E = R == null ? void 0 : R.drawings) == null ? void 0 : E[C.drawingId];
1696
- if (y == null)
1675
+ var A;
1676
+ const R = c == null ? void 0 : c.getSnapshot(), P = (A = R == null ? void 0 : R.drawings) == null ? void 0 : A[C.drawingId];
1677
+ if (P == null)
1697
1678
  return;
1698
- const { layoutType: B } = y, {
1679
+ const { layoutType: B } = P, {
1699
1680
  positionH: k,
1700
1681
  positionV: b
1701
- } = y.docTransform;
1702
- D(k), M(b), S(B === H.INLINE), A(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
1682
+ } = P.docTransform;
1683
+ D(k), M(b), S(B === H.INLINE), E(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
1703
1684
  }
1704
1685
  function G() {
1705
1686
  const C = t.getFocusDrawings();
1706
1687
  C.length !== 0 && x(C[0]);
1707
1688
  }
1708
1689
  function _(C) {
1709
- A(C), W(String(C ? V.PARAGRAPH : V.PAGE));
1690
+ E(C), W(String(C ? V.PARAGRAPH : V.PAGE));
1710
1691
  }
1711
- return _n(() => {
1692
+ return Sn(() => {
1712
1693
  G();
1713
- const C = t.focus$.subscribe((y) => {
1714
- if (y.length === 0) {
1694
+ const C = t.focus$.subscribe((P) => {
1695
+ if (P.length === 0) {
1715
1696
  N(!1);
1716
1697
  return;
1717
1698
  }
1718
- N(!0), x(y[0]);
1719
- }), R = e.onCommandExecuted(async (y) => {
1720
- y.id === J.id && G();
1699
+ N(!0), x(P[0]);
1700
+ }), R = e.onCommandExecuted(async (P) => {
1701
+ P.id === J.id && G();
1721
1702
  });
1722
1703
  return () => {
1723
1704
  C.unsubscribe(), R.dispose();
@@ -1731,8 +1712,8 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1731
1712
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1732
1713
  ke,
1733
1714
  {
1734
- min: Hn,
1735
- max: Wn,
1715
+ min: Wn,
1716
+ max: Gn,
1736
1717
  precision: 1,
1737
1718
  disabled: w,
1738
1719
  value: O.posOffset,
@@ -1749,7 +1730,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1749
1730
  /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1750
1731
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
1751
1732
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1752
- Bn,
1733
+ Un,
1753
1734
  {
1754
1735
  value: String(O.relativeFrom),
1755
1736
  disabled: w,
@@ -1766,8 +1747,8 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1766
1747
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1767
1748
  ke,
1768
1749
  {
1769
- min: Hn,
1770
- max: Wn,
1750
+ min: Wn,
1751
+ max: Gn,
1771
1752
  precision: 1,
1772
1753
  disabled: w,
1773
1754
  value: T.posOffset,
@@ -1784,7 +1765,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1784
1765
  /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1785
1766
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
1786
1767
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1787
- Bn,
1768
+ Un,
1788
1769
  {
1789
1770
  disabled: w,
1790
1771
  value: String(T.relativeFrom),
@@ -1795,16 +1776,16 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1795
1776
  ] }) })
1796
1777
  ] }),
1797
1778
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
1798
- /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(Ci, { disabled: w, checked: P, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
1779
+ /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(Ci, { disabled: w, checked: y, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
1799
1780
  ] });
1800
1781
  }, Je = 0, en = 100, Zi = (i) => {
1801
- const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
1782
+ const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(K), { drawings: s } = i, a = s[0];
1802
1783
  if (a == null)
1803
1784
  return null;
1804
1785
  const { unitId: d } = a, c = o.getUniverDocInstance(d), l = r.getRenderById(d);
1805
1786
  if ((l == null ? void 0 : l.scene) == null)
1806
1787
  return null;
1807
- const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [P, A] = re({
1788
+ const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [y, E] = re({
1808
1789
  distT: 0,
1809
1790
  distL: 0,
1810
1791
  distB: 0,
@@ -1815,14 +1796,14 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1815
1796
  const C = t.getFocusDrawings();
1816
1797
  if (C.length === 0)
1817
1798
  return;
1818
- const { unitId: R, subUnitId: y } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: E }) => ({
1799
+ const { unitId: R, subUnitId: P } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: A }) => ({
1819
1800
  unitId: k,
1820
1801
  subUnitId: b,
1821
- drawingId: E
1802
+ drawingId: A
1822
1803
  }));
1823
- e.executeCommand(Zn.id, {
1804
+ e.executeCommand(Qn.id, {
1824
1805
  unitId: R,
1825
- subUnitId: y,
1806
+ subUnitId: P,
1826
1807
  drawings: B,
1827
1808
  wrappingStyle: _
1828
1809
  });
@@ -1832,12 +1813,12 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1832
1813
  const C = t.getFocusDrawings();
1833
1814
  if (C.length === 0)
1834
1815
  return;
1835
- const R = C.map((y) => ({
1836
- unitId: y.unitId,
1837
- subUnitId: y.subUnitId,
1838
- drawingId: y.drawingId
1816
+ const R = C.map((P) => ({
1817
+ unitId: P.unitId,
1818
+ subUnitId: P.subUnitId,
1819
+ drawingId: P.drawingId
1839
1820
  }));
1840
- e.executeCommand(Jn.id, {
1821
+ e.executeCommand(et.id, {
1841
1822
  unitId: C[0].unitId,
1842
1823
  subUnitId: C[0].unitId,
1843
1824
  drawings: R,
@@ -1847,19 +1828,19 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1847
1828
  function W(_, C) {
1848
1829
  if (_ == null)
1849
1830
  return;
1850
- const R = { ...P, [C]: _ };
1851
- A(R);
1852
- const y = t.getFocusDrawings();
1853
- if (y.length === 0)
1831
+ const R = { ...y, [C]: _ };
1832
+ E(R);
1833
+ const P = t.getFocusDrawings();
1834
+ if (P.length === 0)
1854
1835
  return;
1855
- const B = y.map((k) => ({
1836
+ const B = P.map((k) => ({
1856
1837
  unitId: k.unitId,
1857
1838
  subUnitId: k.subUnitId,
1858
1839
  drawingId: k.drawingId
1859
1840
  }));
1860
- e.executeCommand(Qn.id, {
1861
- unitId: y[0].unitId,
1862
- subUnitId: y[0].unitId,
1841
+ e.executeCommand(Jn.id, {
1842
+ unitId: P[0].unitId,
1843
+ subUnitId: P[0].unitId,
1863
1844
  drawings: B,
1864
1845
  dist: {
1865
1846
  [C]: _
@@ -1871,26 +1852,26 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1871
1852
  _.length !== 0 && G(_[0]);
1872
1853
  }
1873
1854
  function G(_) {
1874
- var Y, ae;
1875
- const C = (ae = (Y = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : Y.drawings) == null ? void 0 : ae[_.drawingId];
1855
+ var Z, ae;
1856
+ const C = (ae = (Z = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : Z.drawings) == null ? void 0 : ae[_.drawingId];
1876
1857
  if (C == null)
1877
1858
  return;
1878
1859
  const {
1879
1860
  distT: R = 0,
1880
- distL: y = 0,
1861
+ distL: P = 0,
1881
1862
  distB: B = 0,
1882
1863
  distR: k = 0,
1883
1864
  layoutType: b = H.INLINE,
1884
- behindDoc: E = oe.FALSE,
1865
+ behindDoc: A = oe.FALSE,
1885
1866
  wrapText: $ = $e.BOTH_SIDES
1886
1867
  } = C;
1887
- if (A({
1868
+ if (E({
1888
1869
  distT: R,
1889
- distL: y,
1870
+ distL: P,
1890
1871
  distB: B,
1891
1872
  distR: k
1892
1873
  }), M($), p(b !== H.WRAP_SQUARE), b === H.WRAP_NONE || b === H.INLINE ? v(!0) : v(!1), b === H.WRAP_NONE || b === H.INLINE || b === H.WRAP_TOP_AND_BOTTOM ? S(!0) : S(!1), b === H.WRAP_NONE)
1893
- E === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
1874
+ A === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
1894
1875
  else
1895
1876
  switch (b) {
1896
1877
  case H.INLINE:
@@ -1906,7 +1887,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1906
1887
  throw new Error(`Unsupported layout type: ${b}`);
1907
1888
  }
1908
1889
  }
1909
- return _n(() => {
1890
+ return Sn(() => {
1910
1891
  x();
1911
1892
  const _ = t.focus$.subscribe((R) => {
1912
1893
  if (R.length === 0) {
@@ -1923,18 +1904,18 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1923
1904
  }, []), /* @__PURE__ */ X("div", { className: j(u.imageCommonPanelGrid, u.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
1924
1905
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
1925
1906
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
1926
- /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { value: O, onChange: I, direction: "vertical", children: [
1927
- /* @__PURE__ */ f(ye, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
1928
- /* @__PURE__ */ f(ye, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
1929
- /* @__PURE__ */ f(ye, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
1930
- /* @__PURE__ */ f(ye, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
1931
- /* @__PURE__ */ f(ye, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
1907
+ /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(kn, { value: O, onChange: I, direction: "vertical", children: [
1908
+ /* @__PURE__ */ f(Pe, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
1909
+ /* @__PURE__ */ f(Pe, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
1910
+ /* @__PURE__ */ f(Pe, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
1911
+ /* @__PURE__ */ f(Pe, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
1912
+ /* @__PURE__ */ f(Pe, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
1932
1913
  ] }) }) }),
1933
1914
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
1934
- /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { disabled: g, value: T, onChange: L, direction: "horizontal", children: [
1935
- /* @__PURE__ */ f(ye, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
1936
- /* @__PURE__ */ f(ye, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
1937
- /* @__PURE__ */ f(ye, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
1915
+ /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(kn, { disabled: g, value: T, onChange: L, direction: "horizontal", children: [
1916
+ /* @__PURE__ */ f(Pe, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
1917
+ /* @__PURE__ */ f(Pe, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
1918
+ /* @__PURE__ */ f(Pe, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
1938
1919
  ] }) }) }),
1939
1920
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
1940
1921
  /* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
@@ -1947,7 +1928,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1947
1928
  max: en,
1948
1929
  disabled: h,
1949
1930
  precision: 1,
1950
- value: P.distT,
1931
+ value: y.distT,
1951
1932
  onChange: (_) => {
1952
1933
  W(_, "distT");
1953
1934
  },
@@ -1964,7 +1945,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1964
1945
  max: en,
1965
1946
  disabled: w,
1966
1947
  precision: 1,
1967
- value: P.distL,
1948
+ value: y.distL,
1968
1949
  onChange: (_) => {
1969
1950
  W(_, "distL");
1970
1951
  },
@@ -1983,7 +1964,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1983
1964
  max: en,
1984
1965
  disabled: h,
1985
1966
  precision: 1,
1986
- value: P.distB,
1967
+ value: y.distB,
1987
1968
  onChange: (_) => {
1988
1969
  W(_, "distB");
1989
1970
  },
@@ -2000,7 +1981,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2000
1981
  max: en,
2001
1982
  disabled: w,
2002
1983
  precision: 1,
2003
- value: P.distR,
1984
+ value: y.distR,
2004
1985
  onChange: (_) => {
2005
1986
  W(_, "distR");
2006
1987
  },
@@ -2012,7 +1993,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2012
1993
  ] });
2013
1994
  }, Qi = () => {
2014
1995
  const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
2015
- return _n(() => {
1996
+ return Sn(() => {
2016
1997
  const r = i.focus$.subscribe((o) => {
2017
1998
  t(o);
2018
1999
  });
@@ -2020,12 +2001,12 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2020
2001
  r.unsubscribe();
2021
2002
  };
2022
2003
  }, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: u.imageCommonPanel, children: [
2023
- /* @__PURE__ */ f(Xt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2004
+ /* @__PURE__ */ f(qt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2024
2005
  /* @__PURE__ */ f(Zi, { drawings: n }),
2025
2006
  /* @__PURE__ */ f(Yi, { drawings: n })
2026
2007
  ] });
2027
- }, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id, Ji = (i) => {
2028
- const e = i.get(In), n = i.get(Q);
2008
+ }, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = gt.id, Ji = (i) => {
2009
+ const e = i.get(_n), n = i.get(K);
2029
2010
  return new Si((t) => {
2030
2011
  const r = e.textSelection$.subscribe(() => {
2031
2012
  var s;
@@ -2051,19 +2032,19 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2051
2032
  function er(i) {
2052
2033
  return {
2053
2034
  id: pt,
2054
- type: zn.SUBITEMS,
2035
+ type: qn.SUBITEMS,
2055
2036
  icon: ht,
2056
2037
  tooltip: "docImage.title",
2057
2038
  disabled$: Ji(i),
2058
- hidden$: $n(i, be.UNIVER_DOC)
2039
+ hidden$: zn(i, be.UNIVER_DOC, void 0, In)
2059
2040
  };
2060
2041
  }
2061
2042
  function nr(i) {
2062
2043
  return {
2063
2044
  id: wt,
2064
2045
  title: "docImage.upload.float",
2065
- type: zn.BUTTON,
2066
- hidden$: $n(i, be.UNIVER_DOC)
2046
+ type: qn.BUTTON,
2047
+ hidden$: zn(i, be.UNIVER_DOC, void 0, In)
2067
2048
  };
2068
2049
  }
2069
2050
  const tr = {
@@ -2122,7 +2103,7 @@ const ir = {
2122
2103
  direction: fe.RIGHT
2123
2104
  }
2124
2105
  }, ar = {
2125
- id: ot.id,
2106
+ id: st.id,
2126
2107
  description: "shortcut.doc.drawing-delete",
2127
2108
  group: "4_doc-drawing-view",
2128
2109
  // when focusing on any other input tag do not trigger this shortcut
@@ -2141,30 +2122,30 @@ let an = class extends Xe {
2141
2122
  }
2142
2123
  _initCustomComponents() {
2143
2124
  const i = this._componentManager;
2144
- this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt, Qi));
2125
+ this.disposeWithMe(i.register(ht, ot)), this.disposeWithMe(i.register(mt, Qi));
2145
2126
  }
2146
2127
  _initMenus() {
2147
2128
  this._menuManagerService.mergeMenu(tr);
2148
2129
  }
2149
2130
  _initCommands() {
2150
2131
  [
2151
- lt,
2152
- at,
2153
- Zn,
2132
+ gt,
2133
+ ct,
2154
2134
  Qn,
2155
2135
  Jn,
2156
- qe,
2157
2136
  et,
2137
+ qe,
2158
2138
  nt,
2159
- Sn,
2160
- mt,
2161
- Hi,
2139
+ tt,
2140
+ Cn,
2162
2141
  ut,
2163
- st,
2164
- dt,
2142
+ Hi,
2143
+ ft,
2144
+ at,
2145
+ lt,
2165
2146
  Ke,
2166
- ot,
2167
- ct
2147
+ st,
2148
+ dt
2168
2149
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2169
2150
  }
2170
2151
  _initShortcuts() {
@@ -2201,7 +2182,7 @@ let cn = class extends Nt {
2201
2182
  this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
2202
2183
  }
2203
2184
  _init() {
2204
- this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
2185
+ this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(xn(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(xn(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
2205
2186
  }
2206
2187
  _dispose(e) {
2207
2188
  const n = e.getUnitId();
@@ -2216,7 +2197,7 @@ let cn = class extends Nt {
2216
2197
  _hasCropObject(e) {
2217
2198
  const n = e.getAllObjects();
2218
2199
  for (const t of n)
2219
- if (t instanceof Kt)
2200
+ if (t instanceof Xt)
2220
2201
  return !0;
2221
2202
  return !1;
2222
2203
  }
@@ -2247,7 +2228,7 @@ let cn = class extends Nt {
2247
2228
  const { unitId: l, subUnitId: m, drawingId: g } = c, p = this._canvasPopManagerService.attachPopupToObject(
2248
2229
  a,
2249
2230
  {
2250
- componentKey: Yt,
2231
+ componentKey: Kt,
2251
2232
  direction: "horizontal",
2252
2233
  offset: [2, 0],
2253
2234
  extraProps: {
@@ -2288,21 +2269,21 @@ let cn = class extends Nt {
2288
2269
  {
2289
2270
  label: "image-popup.edit",
2290
2271
  index: 0,
2291
- commandId: ut.id,
2272
+ commandId: ft.id,
2292
2273
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2293
- disable: !!At.includes(e)
2274
+ disable: !!Et.includes(e)
2294
2275
  },
2295
2276
  {
2296
2277
  label: "image-popup.delete",
2297
2278
  index: 1,
2298
- commandId: Sn.id,
2279
+ commandId: Cn.id,
2299
2280
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
2300
2281
  disable: !1
2301
2282
  },
2302
2283
  {
2303
2284
  label: "image-popup.crop",
2304
2285
  index: 2,
2305
- commandId: Zt.id,
2286
+ commandId: Yt.id,
2306
2287
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2307
2288
  disable: !0
2308
2289
  // TODO: @JOCS, feature is not ready.
@@ -2310,7 +2291,7 @@ let cn = class extends Nt {
2310
2291
  {
2311
2292
  label: "image-popup.reset",
2312
2293
  index: 3,
2313
- commandId: Qt.id,
2294
+ commandId: Zt.id,
2314
2295
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
2315
2296
  disable: !0
2316
2297
  // TODO: @JOCS, feature is not ready.
@@ -2322,8 +2303,8 @@ cn = gr([
2322
2303
  je(0, Ie),
2323
2304
  je(1, ve(wi)),
2324
2305
  je(2, ee),
2325
- je(3, Q),
2326
- je(4, Vn)
2306
+ je(3, K),
2307
+ je(4, jn)
2327
2308
  ], cn);
2328
2309
  var mr = Object.getOwnPropertyDescriptor, ur = (i, e, n, t) => {
2329
2310
  for (var r = t > 1 ? void 0 : t ? mr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
@@ -2333,7 +2314,7 @@ var mr = Object.getOwnPropertyDescriptor, ur = (i, e, n, t) => {
2333
2314
  let wn = class extends Xe {
2334
2315
  constructor(e, n, t, r, o, s, a, d) {
2335
2316
  super();
2336
- Ce(this, "_liquid", new jn());
2317
+ Ce(this, "_liquid", new $n());
2337
2318
  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();
2338
2319
  }
2339
2320
  _initialize() {
@@ -2357,7 +2338,7 @@ let wn = class extends Xe {
2357
2338
  const a = this._docSkeletonManagerService.getSkeleton();
2358
2339
  if (a == null)
2359
2340
  return;
2360
- if (this._editorService.isEditor(o) && o !== xt) {
2341
+ if (this._editorService.isEditor(o) && o !== In) {
2361
2342
  s == null || s.makeDirty();
2362
2343
  return;
2363
2344
  }
@@ -2368,9 +2349,9 @@ let wn = class extends Xe {
2368
2349
  }
2369
2350
  _initResize() {
2370
2351
  this.disposeWithMe(
2371
- Lt(this._context.engine.onTransformChange$).pipe(
2372
- xn((e) => e.type === ii.resize),
2373
- qn(16)
2352
+ xt(this._context.engine.onTransformChange$).pipe(
2353
+ Ln((e) => e.type === ii.resize),
2354
+ Xn(16)
2374
2355
  ).subscribe(() => {
2375
2356
  var t;
2376
2357
  const e = this._docSkeletonManagerService.getSkeleton(), { scene: n } = this._context;
@@ -2386,9 +2367,9 @@ let wn = class extends Xe {
2386
2367
  const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: p } = n, h = {};
2387
2368
  this._liquid.reset();
2388
2369
  for (let T = 0, M = m.length; T < M; T++) {
2389
- const P = m[T], { headerId: A, footerId: U, pageWidth: N } = P;
2390
- if (A) {
2391
- const I = (O = g.get(A)) == null ? void 0 : O.get(N);
2370
+ const y = m[T], { headerId: E, footerId: U, pageWidth: N } = y;
2371
+ if (E) {
2372
+ const I = (O = g.get(E)) == null ? void 0 : O.get(N);
2392
2373
  I && this._calculateDrawingPosition(
2393
2374
  r,
2394
2375
  I,
@@ -2396,7 +2377,7 @@ let wn = class extends Xe {
2396
2377
  a,
2397
2378
  h,
2398
2379
  I.marginTop,
2399
- P.marginLeft
2380
+ y.marginLeft
2400
2381
  );
2401
2382
  }
2402
2383
  if (U) {
@@ -2407,11 +2388,11 @@ let wn = class extends Xe {
2407
2388
  s,
2408
2389
  a,
2409
2390
  h,
2410
- P.pageHeight - P.marginBottom + I.marginTop,
2411
- P.marginLeft
2391
+ y.pageHeight - y.marginBottom + I.marginTop,
2392
+ y.marginLeft
2412
2393
  );
2413
2394
  }
2414
- this._calculateDrawingPosition(r, P, s, a, h, P.marginTop, P.marginLeft), this._liquid.translatePage(P, d, c, l);
2395
+ this._calculateDrawingPosition(r, y, s, a, h, y.marginTop, y.marginLeft), this._liquid.translatePage(y, d, c, l);
2415
2396
  }
2416
2397
  const v = Object.values(h), w = v.filter((T) => !T.isMultiTransform), S = v.filter((T) => T.isMultiTransform);
2417
2398
  w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
@@ -2461,9 +2442,9 @@ let wn = class extends Xe {
2461
2442
  const n = this._docSkeletonManagerService.getSkeleton();
2462
2443
  n != null && (this._refreshDrawing(n), this._drawingManagerService.initializeNotification(this._context.unitId));
2463
2444
  };
2464
- this._lifecycleService.stage === Tn.Steady ? setTimeout(() => {
2445
+ this._lifecycleService.stage === Pn.Steady ? setTimeout(() => {
2465
2446
  e();
2466
- }, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Tn.Steady)).subscribe(e);
2447
+ }, 1e3) : this._lifecycleService.lifecycle$.pipe(Ln((n) => n === Pn.Steady)).subscribe(e);
2467
2448
  }
2468
2449
  };
2469
2450
  wn = ur([
@@ -2472,8 +2453,8 @@ wn = ur([
2472
2453
  xe(3, vi),
2473
2454
  xe(4, Ie),
2474
2455
  xe(5, ve(gn)),
2475
- xe(6, Q),
2476
- xe(7, ve(Et))
2456
+ xe(6, K),
2457
+ xe(7, ve(At))
2477
2458
  ], wn);
2478
2459
  var fr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (i, e, n) => e in i ? fr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, wr = (i, e, n, t) => {
2479
2460
  for (var r = t > 1 ? void 0 : t ? hr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
@@ -2481,12 +2462,12 @@ var fr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (i, e
2481
2462
  return r;
2482
2463
  }, pn = (i, e) => (n, t) => e(n, t, i), vt = (i, e, n) => pr(i, typeof e != "symbol" ? e + "" : e, n);
2483
2464
  const vr = "DOC_DRAWING_UI_PLUGIN";
2484
- let dn = class extends Ft {
2485
- constructor(i = kn, e, n, t) {
2465
+ let dn = class extends kt {
2466
+ constructor(i = Fn, e, n, t) {
2486
2467
  super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
2487
- const { ...r } = Ht(
2468
+ const { ...r } = Ft(
2488
2469
  {},
2489
- kn,
2470
+ Fn,
2490
2471
  this._config
2491
2472
  );
2492
2473
  this._configService.setConfig(Oi, r);
@@ -2513,23 +2494,23 @@ let dn = class extends Ft {
2513
2494
  vt(dn, "type", be.UNIVER_DOC);
2514
2495
  vt(dn, "pluginName", vr);
2515
2496
  dn = wr([
2516
- Bt(Jt, qt, Wt, gi),
2517
- pn(1, ve(Ut)),
2497
+ Lt(Qt, zt, Ht, gi),
2498
+ pn(1, ve(Bt)),
2518
2499
  pn(2, ee),
2519
- pn(3, kt)
2500
+ pn(3, Ut)
2520
2501
  ], dn);
2521
2502
  export {
2522
2503
  Hi as ClearDocDrawingTransformerOperation,
2523
2504
  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,
2505
+ st as DeleteDocDrawingsCommand,
2506
+ ft as EditDocDrawingOperation,
2507
+ at as GroupDocDrawingCommand,
2508
+ ct as InsertDocDrawingCommand,
2509
+ gt as InsertDocImageCommand,
2529
2510
  Ke as MoveDocDrawingsCommand,
2530
- Sn as RemoveDocDrawingCommand,
2531
- ct as SetDocDrawingArrangeCommand,
2532
- mt as SidebarDocDrawingOperation,
2533
- dt as UngroupDocDrawingCommand,
2511
+ Cn as RemoveDocDrawingCommand,
2512
+ dt as SetDocDrawingArrangeCommand,
2513
+ ut as SidebarDocDrawingOperation,
2514
+ lt as UngroupDocDrawingCommand,
2534
2515
  dn as UniverDocsDrawingUIPlugin
2535
2516
  };