@univerjs/sheets-hyper-link-ui 0.1.14 → 0.1.16

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,53 +1,57 @@
1
- var Jt = Object.defineProperty;
2
- var Qt = (t, e, n) => e in t ? Jt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var H = (t, e, n) => (Qt(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { Disposable as O, UniverInstanceType as M, OnLifecycle as T, LifecycleStages as U, IUniverInstanceService as J, isValidRange as Re, LocaleService as de, Rectangle as oe, ICommandService as F, toDisposable as en, BooleanNumber as tn, ThemeService as nn, createInternalEditorID as rn, DEFAULT_EMPTY_DOCUMENT_VALUE as sn, Tools as ae, CommandType as Te, CellValueType as at, ObjectMatrix as St, Range as qe, Plugin as on, DependentOn as an } from "@univerjs/core";
5
- import { RemoveSheetCommand as cn, SheetInterceptorService as Je, SetSelectionsOperation as ln, NORMAL_SELECTION_PLUGIN_NAME as dn, SetWorksheetActiveOperation as Pe, RefRangeService as un, handleDefaultRangeChangeWithEffectRefCommands as ct, INTERCEPTOR_POINT as pn, getSheetCommandTarget as Ct, SelectionManagerService as Lt, SetRangeValuesMutation as pe, SetRangeValuesUndoMutationFactory as lt, SetRangeValuesCommand as hn, ClearSelectionContentCommand as gn, ClearSelectionAllCommand as mn, WorkbookEditablePermission as Qe, WorksheetEditPermission as et, WorksheetSetCellValuePermission as tt, WorksheetInsertHyperlinkPermission as nt, RangeProtectionPermissionEditPoint as rt } from "@univerjs/sheets";
6
- import { Inject as g, Injector as Ue } from "@wendellhu/redi";
7
- import { RemoveHyperLinkCommand as fn, AddHyperLinkCommand as it, HyperLinkModel as w, RemoveHyperLinkMutation as x, AddHyperLinkMutation as j, UpdateHyperLinkRefMutation as dt, UpdateHyperLinkMutation as Oe, UpdateHyperLinkCommand as It, CancelHyperLinkCommand as _n, UniverSheetsHyperLinkPlugin as vn } from "@univerjs/sheets-hyper-link";
8
- import { deserializeRangeWithSheet as ce, serializeRangeWithSheet as kt, IDefinedNamesService as bt, serializeRange as fe, serializeRangeToRefString as yn } from "@univerjs/engine-formula";
9
- import { MessageType as ie, FormLayout as G, Input as ut, Select as Ve, Button as pt, Tooltip as Fe } from "@univerjs/design";
10
- import { ScrollToCellCommand as Rt, SheetSkeletonManagerService as Sn, SheetCanvasPopManagerService as Cn, HoverManagerService as Ln, whenSheetEditorFocused as In, getCurrentRangeDisable$ as Pt, APPLY_TYPE as he, IAutoFillService as kn, virtualizeDiscreteRanges as Ye, getAutoFillRepeatRange as bn, COPY_TYPE as ht, rangeToDiscreteRange as Rn, PREDEFINED_HOOK_NAME as We, getRepeatRange as Pn, ISheetClipboardService as On, SheetPermissionInterceptorBaseController as wn } from "@univerjs/sheets-ui";
11
- import { IMessageService as Ot, useObservable as En, RangeSelector as Mn, ISidebarService as wt, KeyCode as xn, MetaKeys as jn, MenuItemType as Et, MenuPosition as Mt, getMenuHiddenObservable as xt, MenuGroup as Tn, ComponentManager as Un, IShortcutService as Hn, IMenuService as $n } from "@univerjs/ui";
12
- import { IRenderManagerService as jt } from "@univerjs/engine-render";
13
- import { Subject as Nn, BehaviorSubject as Dn, debounceTime as An } from "rxjs";
14
- import Bn, { forwardRef as W, useRef as Tt, createElement as Z, useState as te, useEffect as Vn, useMemo as Fn } from "react";
15
- import { useDependency as b, useObservable as Wn } from "@wendellhu/redi/react-bindings";
16
- import gt from "clsx";
17
- import { SPECIAL_PASTE_FORMULA as Zn } from "@univerjs/sheets-formula";
18
- var zn = Object.defineProperty, Kn = Object.getOwnPropertyDescriptor, Yn = (t, e, n, r) => {
19
- for (var i = r > 1 ? void 0 : r ? Kn(e, n) : e, s = t.length - 1, o; s >= 0; s--)
20
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
21
- return r && i && zn(e, n, i), i;
22
- }, Ze = (t, e) => (n, r) => e(n, r, t);
23
- let _e = class extends O {
24
- constructor(t, e, n) {
25
- super(), this._sheetInterceptorService = t, this._univerInstanceService = e, this._hyperLinkModel = n, this._initSheetChange();
1
+ var Yt = Object.defineProperty;
2
+ var Gt = (e, t, n) => t in e ? Yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var D = (e, t, n) => Gt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { Disposable as O, UniverInstanceType as w, OnLifecycle as N, LifecycleStages as $, IUniverInstanceService as ue, BooleanNumber as qt, ThemeService as Xt, isValidRange as Ye, LocaleService as pe, RANGE_TYPE as lt, Rectangle as ee, ICommandService as F, DEFAULT_EMPTY_DOCUMENT_VALUE as Jt, createInternalEditorID as Qt, Tools as le, CommandType as je, CellValueType as en, ObjectMatrix as _t, Range as Qe, IPermissionService as tn, Plugin as nn, DependentOn as rn } from "@univerjs/core";
5
+ import { RemoveSheetCommand as on, SheetInterceptorService as et, INTERCEPTOR_POINT as sn, SetSelectionsOperation as an, NORMAL_SELECTION_PLUGIN_NAME as cn, SetWorksheetActiveOperation as we, getSheetCommandTarget as Ct, SelectionManagerService as yt, SetRangeValuesMutation as fe, SetRangeValuesUndoMutationFactory as dt, SetRangeValuesCommand as ln, ClearSelectionContentCommand as dn, ClearSelectionAllCommand as un, ClearSelectionFormatCommand as pn, WorkbookViewPermission as hn, WorksheetViewPermission as mn, RangeProtectionPermissionViewPoint as gn, WorkbookEditablePermission as He, WorksheetEditPermission as Ne, WorksheetInsertHyperlinkPermission as $e, RangeProtectionPermissionEditPoint as Ae, WorkbookCopyPermission as fn, WorksheetCopyPermission as vn, WorksheetSetCellValuePermission as tt } from "@univerjs/sheets";
6
+ import { Inject as h, Injector as Be } from "@wendellhu/redi";
7
+ import { RemoveHyperLinkMutation as M, AddHyperLinkMutation as x, HyperLinkModel as T, ERROR_RANGE as Ge, UpdateHyperLinkCommand as St, AddHyperLinkCommand as Lt, CancelHyperLinkCommand as _n, UniverSheetsHyperLinkPlugin as Cn } from "@univerjs/sheets-hyper-link";
8
+ import { SheetSkeletonManagerService as It, ScrollToRangeOperation as kt, SheetCanvasPopManagerService as yn, HoverManagerService as Sn, SheetPermissionInterceptorBaseController as Pt, whenSheetEditorFocused as Ln, getCurrentRangeDisable$ as bt, APPLY_TYPE as ne, IAutoFillService as In, virtualizeDiscreteRanges as qe, getAutoFillRepeatRange as kn, COPY_TYPE as ut, rangeToDiscreteRange as Pn, PREDEFINED_HOOK_NAME as Fe, getRepeatRange as bn, ISheetClipboardService as Rn } from "@univerjs/sheets-ui";
9
+ import { IRenderManagerService as nt } from "@univerjs/engine-render";
10
+ import { Subject as wn, BehaviorSubject as On, debounceTime as En } from "rxjs";
11
+ import Mn, { forwardRef as Z, useRef as Rt, createElement as z, useState as re, useEffect as xn, useMemo as Tn } from "react";
12
+ import { useDependency as k } from "@wendellhu/redi/react-bindings";
13
+ import pt from "clsx";
14
+ import { MessageType as ae, FormLayout as X, Input as ht, Select as Ze, Button as mt, Tooltip as ve } from "@univerjs/design";
15
+ import { IMessageService as wt, useObservable as Ot, useEvent as Un, RangeSelector as jn, ISidebarService as Et, KeyCode as Hn, MetaKeys as Nn, MenuItemType as Mt, MenuPosition as xt, getMenuHiddenObservable as Tt, MenuGroup as $n, ComponentManager as An, IShortcutService as Bn, IMenuService as Vn } from "@univerjs/ui";
16
+ import { deserializeRangeWithSheet as Oe, serializeRangeWithSheet as Ut, IDefinedNamesService as jt, serializeRangeToRefString as Dn, serializeRange as Wn } from "@univerjs/engine-formula";
17
+ import { SPECIAL_PASTE_FORMULA as Fn } from "@univerjs/sheets-formula";
18
+ var Zn = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Kn = (e, t, n, r) => {
19
+ for (var i = r > 1 ? void 0 : r ? zn(t, n) : t, o = e.length - 1, s; o >= 0; o--)
20
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
21
+ return r && i && Zn(t, n, i), i;
22
+ }, ze = (e, t) => (n, r) => t(n, r, e);
23
+ let Ce = class extends O {
24
+ constructor(e, t, n) {
25
+ super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._hyperLinkModel = n, this._initSheetChange();
26
26
  }
27
27
  _initSheetChange() {
28
28
  this.disposeWithMe(
29
29
  this._sheetInterceptorService.interceptCommand({
30
- getMutations: (t) => {
31
- if (t.id === cn.id) {
32
- const e = t.params, n = e.unitId ? this._univerInstanceService.getUnit(e.unitId) : this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
33
- if (!n)
30
+ getMutations: (e) => {
31
+ var t;
32
+ if (e.id === on.id) {
33
+ const n = e.params, r = n.unitId ? this._univerInstanceService.getUnit(n.unitId) : this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
34
+ if (!r)
35
+ return { redos: [], undos: [] };
36
+ const i = r.getUnitId(), o = n.subUnitId || ((t = r.getActiveSheet()) == null ? void 0 : t.getSheetId());
37
+ if (!o)
34
38
  return { redos: [], undos: [] };
35
- const r = n.getUnitId(), i = e.subUnitId || n.getActiveSheet().getSheetId(), s = this._hyperLinkModel.getSubUnit(r, i), o = s.map((a) => ({
36
- id: fn.id,
39
+ const s = this._hyperLinkModel.getSubUnit(i, o), c = s.map((p) => ({
40
+ id: M.id,
37
41
  params: {
38
- unitId: r,
39
- subUnitId: i,
40
- id: a.id
42
+ unitId: i,
43
+ subUnitId: o,
44
+ id: p.id
41
45
  }
42
- })), c = s.map((a) => ({
43
- id: it.id,
46
+ })), a = s.map((p) => ({
47
+ id: x.id,
44
48
  params: {
45
- unitId: r,
46
- subUnitId: i,
47
- link: a
49
+ unitId: i,
50
+ subUnitId: o,
51
+ link: p
48
52
  }
49
53
  }));
50
- return { redos: o, undos: c };
54
+ return { redos: c, undos: a };
51
55
  }
52
56
  return { redos: [], undos: [] };
53
57
  }
@@ -55,39 +59,219 @@ let _e = class extends O {
55
59
  );
56
60
  }
57
61
  };
58
- _e = Yn([
59
- T(U.Ready, _e),
60
- Ze(0, g(Je)),
61
- Ze(1, J),
62
- Ze(2, g(w))
63
- ], _e);
64
- const st = "SHEET_HYPER_LINK_UI_PLUGIN", Ge = "err";
65
- var Gn = Object.defineProperty, Xn = Object.getOwnPropertyDescriptor, qn = (t, e, n, r) => {
66
- for (var i = r > 1 ? void 0 : r ? Xn(e, n) : e, s = t.length - 1, o; s >= 0; s--)
67
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
68
- return r && i && Gn(e, n, i), i;
69
- }, ne = (t, e) => (n, r) => e(n, r, t);
70
- function Jn(t, e) {
71
- const n = [];
72
- return e.forEach((r) => {
73
- oe.intersects(t, r) && n.push(r);
74
- }), oe.realUnion(t, ...n);
62
+ Ce = Kn([
63
+ N($.Ready, Ce),
64
+ ze(0, h(et)),
65
+ ze(1, ue),
66
+ ze(2, h(T))
67
+ ], Ce);
68
+ var Yn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, Ht = (e, t, n, r) => {
69
+ for (var i = r > 1 ? void 0 : r ? Gn(t, n) : t, o = e.length - 1, s; o >= 0; o--)
70
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
71
+ return r && i && Yn(t, n, i), i;
72
+ }, Q = (e, t) => (n, r) => t(n, r, e);
73
+ let Xe = class extends O {
74
+ constructor(e, t, n, r) {
75
+ super(), this._context = e, this._hyperLinkModel = t, this._sheetSkeletonManagerService = n, this._renderManagerService = r, this._initSkeletonChange();
76
+ }
77
+ _initSkeletonChange() {
78
+ const e = () => {
79
+ var s;
80
+ const t = this._context.unit, n = t.getUnitId(), r = (s = t.getActiveSheet()) == null ? void 0 : s.getSheetId();
81
+ if (!r) {
82
+ console.warn("No active sheet found");
83
+ return;
84
+ }
85
+ const i = this._sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: r }), o = this._renderManagerService.getRenderById(n);
86
+ i == null || i.makeDirty(!0), i == null || i.calculate(), o && o.mainComponent.makeForceDirty();
87
+ };
88
+ this.disposeWithMe(this._hyperLinkModel.linkUpdate$.subscribe(() => {
89
+ e();
90
+ }));
91
+ }
92
+ };
93
+ Xe = Ht([
94
+ Q(1, h(T)),
95
+ Q(2, h(It)),
96
+ Q(3, nt)
97
+ ], Xe);
98
+ let ye = class extends O {
99
+ constructor(e, t, n) {
100
+ super(), this._sheetInterceptorService = e, this._hyperLinkModel = t, this._themeService = n, this._initViewModelIntercept();
101
+ }
102
+ _initViewModelIntercept() {
103
+ this.disposeWithMe(
104
+ this._sheetInterceptorService.intercept(
105
+ sn.CELL_CONTENT,
106
+ {
107
+ handler: (e, t, n) => {
108
+ const { row: r, col: i, unitId: o, subUnitId: s } = t, c = this._hyperLinkModel.getHyperLinkByLocation(o, s, r, i), a = this._themeService.getCurrentTheme();
109
+ return n(c ? {
110
+ ...e,
111
+ interceptorStyle: {
112
+ ul: {
113
+ s: qt.TRUE
114
+ },
115
+ cl: {
116
+ rgb: a.blue500
117
+ }
118
+ }
119
+ } : e);
120
+ },
121
+ priority: 100
122
+ }
123
+ )
124
+ );
125
+ }
126
+ };
127
+ ye = Ht([
128
+ N($.Ready, ye),
129
+ Q(0, h(et)),
130
+ Q(1, h(T)),
131
+ Q(2, h(Xt))
132
+ ], ye);
133
+ var Nt = { exports: {} }, Ve = {};
134
+ /**
135
+ * @license React
136
+ * react-jsx-runtime.production.min.js
137
+ *
138
+ * Copyright (c) Facebook, Inc. and its affiliates.
139
+ *
140
+ * This source code is licensed under the MIT license found in the
141
+ * LICENSE file in the root directory of this source tree.
142
+ */
143
+ var qn = Mn, Xn = Symbol.for("react.element"), Jn = Symbol.for("react.fragment"), Qn = Object.prototype.hasOwnProperty, er = qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, tr = { key: !0, ref: !0, __self: !0, __source: !0 };
144
+ function $t(e, t, n) {
145
+ var r, i = {}, o = null, s = null;
146
+ n !== void 0 && (o = "" + n), t.key !== void 0 && (o = "" + t.key), t.ref !== void 0 && (s = t.ref);
147
+ for (r in t) Qn.call(t, r) && !tr.hasOwnProperty(r) && (i[r] = t[r]);
148
+ if (e && e.defaultProps) for (r in t = e.defaultProps, t) i[r] === void 0 && (i[r] = t[r]);
149
+ return { $$typeof: Xn, type: e, key: o, ref: s, props: i, _owner: er.current };
150
+ }
151
+ Ve.Fragment = Jn;
152
+ Ve.jsx = $t;
153
+ Ve.jsxs = $t;
154
+ Nt.exports = Ve;
155
+ var d = Nt.exports, b = function() {
156
+ return b = Object.assign || function(e) {
157
+ for (var t, n = 1, r = arguments.length; n < r; n++) {
158
+ t = arguments[n];
159
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
160
+ }
161
+ return e;
162
+ }, b.apply(this, arguments);
163
+ }, nr = function(e, t) {
164
+ var n = {};
165
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
166
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
167
+ for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
168
+ t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
169
+ return n;
170
+ }, K = Z(function(e, t) {
171
+ var n = e.icon, r = e.id, i = e.className, o = e.extend, s = nr(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), a = Rt("_".concat(or()));
172
+ return At(n, "".concat(r), { defIds: n.defIds, idSuffix: a.current }, b({ ref: t, className: c }, s), o);
173
+ });
174
+ function At(e, t, n, r, i) {
175
+ return z(e.tag, b(b({ key: t }, rr(e, n, i)), r), (ir(e, n).children || []).map(function(o, s) {
176
+ return At(o, "".concat(t, "-").concat(e.tag, "-").concat(s), n, void 0, i);
177
+ }));
178
+ }
179
+ function rr(e, t, n) {
180
+ var r = b({}, e.attrs);
181
+ n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
182
+ var i = t.defIds;
183
+ return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(o) {
184
+ var s = o[0], c = o[1];
185
+ typeof c == "string" && (r[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
186
+ })), r;
187
+ }
188
+ function ir(e, t) {
189
+ var n, r = t.defIds;
190
+ return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? b(b({}, e), { children: e.children.map(function(i) {
191
+ return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? b(b({}, i), { attrs: b(b({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
192
+ }) }) : e;
193
+ }
194
+ function or() {
195
+ return Math.random().toString(36).substring(2, 8);
196
+ }
197
+ K.displayName = "UniverIcon";
198
+ var sr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Se = Z(function(e, t) {
199
+ return z(K, Object.assign({}, e, {
200
+ id: "all-border-single",
201
+ ref: t,
202
+ icon: sr
203
+ }));
204
+ });
205
+ Se.displayName = "AllBorderSingle";
206
+ var ar = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.02547 12.4251C5.15328 13.7417 6.26305 14.7708 7.61318 14.7708H12.6132C14.0491 14.7708 15.2132 13.6067 15.2132 12.1708V6.1708C15.2132 4.78586 14.1303 3.65383 12.7651 3.57517C12.6373 2.25858 11.5275 1.22949 10.1774 1.22949H5.17739C3.74145 1.22949 2.57739 2.39355 2.57739 3.82949V9.82949C2.57739 11.2144 3.66024 12.3465 5.02547 12.4251ZM11.5535 3.5708H7.61318C6.17724 3.5708 5.01318 4.73486 5.01318 6.1708V11.22C4.31736 11.1387 3.77739 10.5471 3.77739 9.82949V3.82949C3.77739 3.05629 4.40419 2.42949 5.17739 2.42949H10.1774C10.8622 2.42949 11.4322 2.92119 11.5535 3.5708ZM14.0132 6.1708C14.0132 5.3976 13.3864 4.7708 12.6132 4.7708H7.61318C6.83998 4.7708 6.21318 5.3976 6.21318 6.1708V12.1708C6.21318 12.944 6.83998 13.5708 7.61318 13.5708H12.6132C13.3864 13.5708 14.0132 12.944 14.0132 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Bt = Z(function(e, t) {
207
+ return z(K, Object.assign({}, e, {
208
+ id: "copy-single",
209
+ ref: t,
210
+ icon: ar
211
+ }));
212
+ });
213
+ Bt.displayName = "CopySingle";
214
+ var cr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.9564 2.91332C4.91407 1.87102 3.22413 1.87101 2.18182 2.91333L2.18182 2.91333C1.13953 3.95567 1.13952 5.6456 2.18182 6.68791L8.27777 12.7838C9.72408 14.2302 12.069 14.2302 13.5154 12.7839L13.0911 12.3596L13.5154 12.7839C14.9617 11.3375 14.9617 8.99257 13.5154 7.54626L8.39476 2.42566C8.16044 2.19134 7.78054 2.19134 7.54623 2.42566C7.31191 2.65997 7.31191 3.03987 7.54623 3.27419L12.6668 8.39479L13.0911 7.97052L12.6668 8.39479C13.6445 9.37247 13.6445 10.9576 12.6668 11.9353L13.0399 12.3084L12.6668 11.9353C11.6891 12.913 10.104 12.913 9.1263 11.9353L3.03035 5.83938C2.45668 5.26571 2.45667 4.33556 3.03036 3.76184C3.60403 3.18818 4.53416 3.18817 5.10788 3.76185C5.10788 3.76186 5.10788 3.76186 5.10789 3.76186L11.2038 9.8578L11.601 9.46061L11.2038 9.8578C11.3735 10.0275 11.3735 10.3026 11.2038 10.4723L11.2038 10.4723C11.0341 10.642 10.759 10.642 10.5893 10.4723L5.46874 5.35171C5.23442 5.1174 4.85452 5.1174 4.62021 5.35171C4.38589 5.58602 4.38589 5.96592 4.62021 6.20024L9.74078 11.3208C10.3791 11.9591 11.414 11.9591 12.0523 11.3208C12.0523 11.3208 12.0523 11.3208 12.0523 11.3208M12.0523 11.3208C12.6907 10.6825 12.6906 9.64757 12.0523 9.00927L5.95641 2.91333L5.9564 2.91332", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ee = Z(function(e, t) {
215
+ return z(K, Object.assign({}, e, {
216
+ id: "link-single",
217
+ ref: t,
218
+ icon: cr
219
+ }));
220
+ });
221
+ Ee.displayName = "LinkSingle";
222
+ var lr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157 6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449 14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797 11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302zM3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395 4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092 3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721 8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606zM3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332 2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302 13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332z" } }] }, Vt = Z(function(e, t) {
223
+ return z(K, Object.assign({}, e, {
224
+ id: "unlink-single",
225
+ ref: t,
226
+ icon: lr
227
+ }));
228
+ });
229
+ Vt.displayName = "UnlinkSingle";
230
+ var dr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, Dt = Z(function(e, t) {
231
+ return z(K, Object.assign({}, e, {
232
+ id: "write-single",
233
+ ref: t,
234
+ icon: dr
235
+ }));
236
+ });
237
+ Dt.displayName = "WriteSingle";
238
+ var ur = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.36396 1.12549C2.61066 1.12549 2 1.73615 2 2.48945V13.5104C2 14.2637 2.61066 14.8744 3.36396 14.8744H12.457C13.2103 14.8744 13.821 14.2637 13.821 13.5104V5.0992L9.91954 1.12549H3.36396Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M9.91797 1.12549L13.8209 5.09842H10.5846C10.2164 5.09842 9.91797 4.79994 9.91797 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.71926 10.2949L6.28687 12.403C6.17306 12.5705 5.94501 12.614 5.77751 12.5002C5.61002 12.3864 5.56649 12.1584 5.6803 11.9909L7.27596 9.64252L5.85088 7.54519C5.73707 7.37769 5.78059 7.14964 5.94809 7.03583C6.11558 6.92202 6.34363 6.96555 6.45744 7.13304L7.71926 8.9901L8.98108 7.13304C9.09489 6.96555 9.32294 6.92202 9.49044 7.03583C9.65793 7.14964 9.70146 7.37769 9.58765 7.54519L8.16256 9.64252L9.75822 11.9909C9.87203 12.1584 9.82851 12.3864 9.66101 12.5002C9.49351 12.614 9.26547 12.5705 9.15166 12.403L7.71926 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Je = Z(function(e, t) {
239
+ return z(K, Object.assign({}, e, {
240
+ id: "xlsx",
241
+ ref: t,
242
+ icon: ur
243
+ }));
244
+ });
245
+ Je.displayName = "Xlsx";
246
+ var pr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, mr = (e, t, n, r) => {
247
+ for (var i = r > 1 ? void 0 : r ? hr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
248
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
249
+ return r && i && pr(t, n, i), i;
250
+ }, ie = (e, t) => (n, r) => t(n, r, e);
251
+ function gr(e, t) {
252
+ const n = t.getMergeData(), r = t.getMaxColumns() - 1, i = t.getMaxRows() - 1;
253
+ if (r < e.endColumn && (e.endColumn = r), i < e.endRow && (e.endRow = i), e.rangeType === lt.COLUMN || lt.ROW)
254
+ return e;
255
+ const o = [];
256
+ return n.forEach((s) => {
257
+ ee.intersects(e, s) && o.push(s);
258
+ }), ee.realUnion(e, ...o);
75
259
  }
76
- let B = class {
77
- constructor(t, e, n, r, i) {
78
- this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = r, this._localeService = i;
260
+ let W = class {
261
+ constructor(e, t, n, r, i) {
262
+ this._univerInstanceService = e, this._commandService = t, this._definedNamesService = n, this._messageService = r, this._localeService = i;
79
263
  }
80
- _getURLName(t) {
264
+ _getURLName(e) {
81
265
  var c;
82
- const { gid: e, range: n, rangeid: r } = t, i = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
266
+ const { gid: t, range: n, rangeid: r } = e, i = this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
83
267
  if (!i)
84
268
  return null;
85
- const s = e ? i.getSheetBySheetId(e) : i.getActiveSheet(), o = (c = s == null ? void 0 : s.getName()) != null ? c : "";
269
+ const o = t ? i.getSheetBySheetId(t) : i.getActiveSheet(), s = (c = o == null ? void 0 : o.getName()) != null ? c : "";
86
270
  if (n) {
87
- const a = ce(n).range;
88
- return Re(a) && n !== Ge ? {
271
+ const a = Oe(n).range;
272
+ return Ye(a) && n !== Ge ? {
89
273
  type: "range",
90
- name: kt(o, a)
274
+ name: Ut(s, a)
91
275
  } : {
92
276
  type: "range-error",
93
277
  name: this._localeService.t("hyperLink.message.refError")
@@ -103,8 +287,8 @@ let B = class {
103
287
  name: this._localeService.t("hyperLink.message.refError")
104
288
  };
105
289
  }
106
- if (e) {
107
- const a = i.getSheetBySheetId(e);
290
+ if (t) {
291
+ const a = i.getSheetBySheetId(t);
108
292
  return a ? {
109
293
  type: "sheet",
110
294
  name: a.getName()
@@ -115,557 +299,212 @@ let B = class {
115
299
  }
116
300
  return null;
117
301
  }
118
- navigateTo(t) {
119
- const { gid: e, range: n, rangeid: r } = t, i = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
302
+ navigateTo(e) {
303
+ const { gid: t, range: n, rangeid: r } = e, i = this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
120
304
  if (!i)
121
305
  return;
122
- const s = i.getUnitId();
123
- if (r && this.navigateToDefineName(s, r), !!e) {
306
+ const o = i.getUnitId();
307
+ if (r && this.navigateToDefineName(o, r), !!t) {
124
308
  if (n) {
125
- const o = ce(n);
126
- Re(o.range) && n !== Ge && this.navigateToRange(s, e, o.range);
309
+ const s = Oe(n);
310
+ Ye(s.range) && n !== Ge && this.navigateToRange(o, t, s.range);
127
311
  return;
128
312
  }
129
- this.navigateToSheetById(s, e);
313
+ this.navigateToSheetById(o, t);
130
314
  }
131
315
  }
132
- parseHyperLink(t) {
133
- var e, n, r;
134
- if (t != null && t.startsWith("#")) {
135
- const i = new URLSearchParams(t.slice(1)), s = {
136
- gid: (e = i.get("gid")) != null ? e : "",
316
+ parseHyperLink(e) {
317
+ var t, n, r;
318
+ if (e != null && e.startsWith("#")) {
319
+ const i = new URLSearchParams(e.slice(1)), o = {
320
+ gid: (t = i.get("gid")) != null ? t : "",
137
321
  range: (n = i.get("range")) != null ? n : "",
138
322
  rangeid: (r = i.get("rangeid")) != null ? r : ""
139
- }, o = this._getURLName(s);
323
+ }, s = this._getURLName(o);
140
324
  return {
141
- type: (o == null ? void 0 : o.type) || "link",
142
- name: (o == null ? void 0 : o.name) || t,
143
- url: t,
144
- searchObj: s,
325
+ type: (s == null ? void 0 : s.type) || "link",
326
+ name: (s == null ? void 0 : s.name) || e,
327
+ url: e,
328
+ searchObj: o,
145
329
  handler: () => {
146
- this.navigateTo(s);
330
+ this.navigateTo(o);
147
331
  }
148
332
  };
149
333
  } else
150
334
  return {
151
335
  type: "outer",
152
- name: t,
153
- url: t,
336
+ name: e,
337
+ url: e,
154
338
  handler: () => {
155
- this.navigateToOtherWebsite(t);
339
+ this.navigateToOtherWebsite(e);
156
340
  }
157
341
  };
158
342
  }
159
- async navigateToRange(t, e, n) {
160
- const r = await this.navigateToSheetById(t, e);
343
+ async navigateToRange(e, t, n) {
344
+ const r = await this.navigateToSheetById(e, t);
161
345
  if (r) {
162
- const i = Jn(n, r.getMergeData());
346
+ const i = gr(n, r);
163
347
  await this._commandService.executeCommand(
164
- ln.id,
348
+ an.id,
165
349
  {
166
- unitId: t,
167
- subUnitId: e,
168
- pluginName: dn,
350
+ unitId: e,
351
+ subUnitId: t,
352
+ pluginName: cn,
169
353
  selections: [{
170
354
  range: i
171
355
  }]
172
356
  }
173
- ), await this._commandService.executeCommand(Rt.id, {
357
+ ), await this._commandService.executeCommand(kt.id, {
174
358
  range: i
175
359
  });
176
360
  }
177
361
  }
178
- async navigateToSheet(t, e) {
179
- const n = this._univerInstanceService.getUnit(t, M.UNIVER_SHEET);
362
+ async navigateToSheet(e, t) {
363
+ const n = this._univerInstanceService.getUnit(e, w.UNIVER_SHEET);
180
364
  if (!n)
181
365
  return !1;
182
366
  const r = n.getActiveSheet();
183
- if ((r == null ? void 0 : r.getName()) === e)
367
+ if ((r == null ? void 0 : r.getName()) === t)
184
368
  return !0;
185
- const i = n.getSheetBySheetName(e);
369
+ const i = n.getSheetBySheetName(t);
186
370
  if (!i) {
187
371
  this._messageService.show({
188
372
  content: this._localeService.t("hyperLink.message.noSheet"),
189
- type: ie.Error
373
+ type: ae.Error
190
374
  });
191
375
  return;
192
376
  }
193
- const s = i.getSheetId();
194
- return n.getHiddenWorksheets().indexOf(s) > -1 && this._messageService.show({
377
+ const o = i.getSheetId();
378
+ return n.getHiddenWorksheets().indexOf(o) > -1 && this._messageService.show({
195
379
  content: this._localeService.t("hyperLink.message.hiddenSheet"),
196
- type: ie.Error
197
- }), await this._commandService.executeCommand(Pe.id, { unitId: t, subUnitId: s });
380
+ type: ae.Error
381
+ }), await this._commandService.executeCommand(we.id, { unitId: e, subUnitId: o });
198
382
  }
199
- async navigateToSheetById(t, e) {
200
- const n = this._univerInstanceService.getUnit(t, M.UNIVER_SHEET);
383
+ async navigateToSheetById(e, t) {
384
+ const n = this._univerInstanceService.getUnit(e, w.UNIVER_SHEET);
201
385
  if (!n)
202
386
  return !1;
203
387
  const r = n.getActiveSheet();
204
- if (r.getSheetId() === e)
388
+ if (!r)
389
+ return !1;
390
+ if (r.getSheetId() === t)
205
391
  return r;
206
- const i = n.getSheetBySheetId(e);
207
- return i ? n.getHiddenWorksheets().indexOf(e) > -1 ? (this._messageService.show({
392
+ const i = n.getSheetBySheetId(t);
393
+ return i ? n.getHiddenWorksheets().indexOf(t) > -1 ? (this._messageService.show({
208
394
  content: this._localeService.t("hyperLink.message.hiddenSheet"),
209
- type: ie.Error
210
- }), !1) : await this._commandService.executeCommand(Pe.id, { unitId: t, subUnitId: e }) ? i : !1 : (this._messageService.show({
395
+ type: ae.Error
396
+ }), !1) : await this._commandService.executeCommand(we.id, { unitId: e, subUnitId: t }) ? i : !1 : (this._messageService.show({
211
397
  content: this._localeService.t("hyperLink.message.noSheet"),
212
- type: ie.Error
398
+ type: ae.Error
213
399
  }), !1);
214
400
  }
215
- async navigateToDefineName(t, e) {
216
- return this._definedNamesService.focusRange(t, e), !0;
217
- }
218
- async navigateToOtherWebsite(t) {
219
- window.open(t, "_blank", "noopener noreferrer");
401
+ async navigateToDefineName(e, t) {
402
+ return this._definedNamesService.focusRange(e, t), !0;
220
403
  }
221
- };
222
- B = qn([
223
- ne(0, J),
224
- ne(1, F),
225
- ne(2, bt),
226
- ne(3, Ot),
227
- ne(4, g(de))
228
- ], B);
229
- var Qn = Object.defineProperty, er = Object.getOwnPropertyDescriptor, tr = (t, e, n, r) => {
230
- for (var i = r > 1 ? void 0 : r ? er(e, n) : e, s = t.length - 1, o; s >= 0; s--)
231
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
232
- return r && i && Qn(e, n, i), i;
233
- }, ge = (t, e) => (n, r) => e(n, r, t);
234
- let ve = class extends O {
235
- constructor(e, n, r, i) {
236
- super();
237
- H(this, "_disposableMap", /* @__PURE__ */ new Map());
238
- H(this, "_rangeDisableMap", /* @__PURE__ */ new Map());
239
- this._refRangeService = e, this._hyperLinkModel = n, this._resolverService = r, this._univerInstanceService = i, this._initData(), this._initRefRange();
240
- }
241
- _register(e, n, r) {
242
- const i = r.id, s = {
243
- startColumn: r.column,
244
- endColumn: r.column,
245
- startRow: r.row,
246
- endRow: r.row
247
- }, o = (c) => {
248
- const a = ct(s, c);
249
- return a && a.startColumn === s.startColumn && a.startRow === s.startRow ? {
250
- undos: [],
251
- redos: []
252
- } : a ? {
253
- redos: [{
254
- id: dt.id,
255
- params: {
256
- unitId: e,
257
- subUnitId: n,
258
- id: r.id,
259
- row: a.startRow,
260
- column: a.startColumn
261
- }
262
- }],
263
- undos: [{
264
- id: dt.id,
265
- params: {
266
- unitId: e,
267
- subUnitId: n,
268
- id: r.id,
269
- row: s.startRow,
270
- column: s.startColumn
271
- }
272
- }]
273
- } : {
274
- redos: [{
275
- id: x.id,
276
- params: {
277
- unitId: e,
278
- subUnitId: n,
279
- id: r.id
280
- }
281
- }],
282
- undos: [{
283
- id: j.id,
284
- params: {
285
- unitId: e,
286
- subUnitId: n,
287
- link: r
288
- }
289
- }]
290
- };
291
- };
292
- this._disposableMap.set(
293
- i,
294
- this._refRangeService.registerRefRange(s, o, e, n)
295
- );
296
- }
297
- _unregister(e) {
298
- const n = this._disposableMap.get(e);
299
- n == null || n.dispose(), this._disposableMap.delete(e);
300
- }
301
- _registerRange(e, n, r) {
302
- const i = this._resolverService.parseHyperLink(r);
303
- if (i.searchObj && i.searchObj.range && i.searchObj.gid) {
304
- const s = i.searchObj.gid, o = ce(i.searchObj.range).range;
305
- if (Re(o) && i.searchObj.range !== Ge) {
306
- const c = (a) => {
307
- const p = ct(o, a);
308
- return p && fe(p) === fe(o) ? {
309
- redos: [],
310
- undos: []
311
- } : {
312
- redos: [{
313
- id: Oe.id,
314
- params: {
315
- unitId: e,
316
- subUnitId: s,
317
- id: n,
318
- payload: {
319
- payload: `#gid=${s}&range=${p ? fe(p) : "err"}`
320
- }
321
- }
322
- }],
323
- undos: [{
324
- id: Oe.id,
325
- params: {
326
- unitId: e,
327
- subUnitId: s,
328
- id: n,
329
- payload: {
330
- payload: r
331
- }
332
- }
333
- }]
334
- };
335
- };
336
- this._rangeDisableMap.set(n, this._refRangeService.registerRefRange(o, c, e, s));
337
- }
338
- }
339
- }
340
- _unregisterRange(e) {
341
- const n = this._rangeDisableMap.get(e);
342
- n == null || n.dispose(), this._rangeDisableMap.delete(e);
343
- }
344
- _initData() {
345
- this._hyperLinkModel.getAll().forEach((n) => {
346
- n.forEach((r) => {
347
- const { unitId: i, subUnitId: s, links: o } = r;
348
- o.forEach((c) => {
349
- this._register(i, s, c);
350
- });
351
- });
352
- });
353
- }
354
- _initRefRange() {
355
- this.disposeWithMe(
356
- this._hyperLinkModel.linkUpdate$.subscribe((e) => {
357
- switch (e.type) {
358
- case "add": {
359
- this._register(e.unitId, e.subUnitId, e.payload), this._registerRange(e.unitId, e.payload.id, e.payload.payload);
360
- break;
361
- }
362
- case "remove": {
363
- this._unregister(e.payload.id), this._unregisterRange(e.payload.id);
364
- break;
365
- }
366
- case "updateRef": {
367
- const { unitId: n, subUnitId: r, id: i } = e, s = this._hyperLinkModel.getHyperLink(n, r, i);
368
- if (!s)
369
- return;
370
- this._unregister(i), this._register(n, r, s);
371
- break;
372
- }
373
- case "unload": {
374
- const { unitLinks: n } = e;
375
- n.forEach((r) => {
376
- const { links: i } = r;
377
- i.forEach((s) => {
378
- this._unregister(s.id), this._unregisterRange(s.id);
379
- });
380
- });
381
- break;
382
- }
383
- case "update": {
384
- this._unregisterRange(e.id), this._registerRange(e.unitId, e.id, e.payload.payload);
385
- break;
386
- }
387
- }
388
- })
389
- ), this.disposeWithMe(en(() => {
390
- this._disposableMap.forEach((e) => {
391
- e.dispose();
392
- }), this._disposableMap.clear();
393
- }));
394
- }
395
- };
396
- ve = tr([
397
- T(U.Starting, ve),
398
- ge(0, g(un)),
399
- ge(1, g(w)),
400
- ge(2, g(B)),
401
- ge(3, J)
402
- ], ve);
403
- var nr = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, Ut = (t, e, n, r) => {
404
- for (var i = r > 1 ? void 0 : r ? rr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
405
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
406
- return r && i && nr(e, n, i), i;
407
- }, q = (t, e) => (n, r) => e(n, r, t);
408
- let Xe = class extends O {
409
- constructor(t, e, n, r) {
410
- super(), this._context = t, this._hyperLinkModel = e, this._sheetSkeletonManagerService = n, this._renderManagerService = r, this._initSkeletonChange();
411
- }
412
- _initSkeletonChange() {
413
- const t = () => {
414
- const e = this._context.unit, n = e.getUnitId(), r = e.getActiveSheet().getSheetId(), i = this._sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: r }), s = this._renderManagerService.getRenderById(n);
415
- i == null || i.makeDirty(!0), i == null || i.calculate(), s && s.mainComponent.makeForceDirty();
416
- };
417
- this.disposeWithMe(this._hyperLinkModel.linkUpdate$.subscribe(() => {
418
- t();
419
- }));
420
- }
421
- };
422
- Xe = Ut([
423
- q(1, g(w)),
424
- q(2, g(Sn)),
425
- q(3, jt)
426
- ], Xe);
427
- let ye = class extends O {
428
- constructor(t, e, n) {
429
- super(), this._sheetInterceptorService = t, this._hyperLinkModel = e, this._themeService = n, this._initViewModelIntercept();
430
- }
431
- _initViewModelIntercept() {
432
- this.disposeWithMe(
433
- this._sheetInterceptorService.intercept(
434
- pn.CELL_CONTENT,
435
- {
436
- handler: (t, e, n) => {
437
- const { row: r, col: i, unitId: s, subUnitId: o } = e, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, r, i), a = this._themeService.getCurrentTheme();
438
- return n(c ? {
439
- ...t,
440
- interceptorStyle: {
441
- ul: {
442
- s: tn.TRUE
443
- },
444
- cl: {
445
- rgb: a.blue500
446
- }
447
- }
448
- } : t);
449
- },
450
- priority: 100
451
- }
452
- )
453
- );
404
+ async navigateToOtherWebsite(e) {
405
+ window.open(e, "_blank", "noopener noreferrer");
454
406
  }
455
407
  };
456
- ye = Ut([
457
- T(U.Ready, ye),
458
- q(0, g(Je)),
459
- q(1, g(w)),
460
- q(2, g(nn))
461
- ], ye);
462
- var Ht = { exports: {} }, He = {};
463
- /**
464
- * @license React
465
- * react-jsx-runtime.production.min.js
466
- *
467
- * Copyright (c) Facebook, Inc. and its affiliates.
468
- *
469
- * This source code is licensed under the MIT license found in the
470
- * LICENSE file in the root directory of this source tree.
471
- */
472
- var ir = Bn, sr = Symbol.for("react.element"), or = Symbol.for("react.fragment"), ar = Object.prototype.hasOwnProperty, cr = ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, lr = { key: !0, ref: !0, __self: !0, __source: !0 };
473
- function $t(t, e, n) {
474
- var r, i = {}, s = null, o = null;
475
- n !== void 0 && (s = "" + n), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
476
- for (r in e)
477
- ar.call(e, r) && !lr.hasOwnProperty(r) && (i[r] = e[r]);
478
- if (t && t.defaultProps)
479
- for (r in e = t.defaultProps, e)
480
- i[r] === void 0 && (i[r] = e[r]);
481
- return { $$typeof: sr, type: t, key: s, ref: o, props: i, _owner: cr.current };
482
- }
483
- He.Fragment = or;
484
- He.jsx = $t;
485
- He.jsxs = $t;
486
- Ht.exports = He;
487
- var d = Ht.exports, P = function() {
488
- return P = Object.assign || function(t) {
489
- for (var e, n = 1, r = arguments.length; n < r; n++) {
490
- e = arguments[n];
491
- for (var i in e)
492
- Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
493
- }
494
- return t;
495
- }, P.apply(this, arguments);
496
- }, dr = function(t, e) {
497
- var n = {};
498
- for (var r in t)
499
- Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
500
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
501
- for (var i = 0, r = Object.getOwnPropertySymbols(t); i < r.length; i++)
502
- e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
503
- return n;
504
- }, z = W(function(t, e) {
505
- var n = t.icon, r = t.id, i = t.className, s = t.extend, o = dr(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), a = Tt("_".concat(hr()));
506
- return Nt(n, "".concat(r), { defIds: n.defIds, idSuffix: a.current }, P({ ref: e, className: c }, o), s);
507
- });
508
- function Nt(t, e, n, r, i) {
509
- return Z(t.tag, P(P({ key: e }, ur(t, n, i)), r), (pr(t, n).children || []).map(function(s, o) {
510
- return Nt(s, "".concat(e, "-").concat(t.tag, "-").concat(o), n, void 0, i);
511
- }));
512
- }
513
- function ur(t, e, n) {
514
- var r = P({}, t.attrs);
515
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
516
- var i = e.defIds;
517
- return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
518
- var o = s[0], c = s[1];
519
- typeof c == "string" && (r[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
520
- })), r;
521
- }
522
- function pr(t, e) {
523
- var n, r = e.defIds;
524
- return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? P(P({}, t), { children: t.children.map(function(i) {
525
- return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? P(P({}, i), { attrs: P(P({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
526
- }) }) : t;
408
+ W = mr([
409
+ ie(0, ue),
410
+ ie(1, F),
411
+ ie(2, jt),
412
+ ie(3, wt),
413
+ ie(4, h(pe))
414
+ ], W);
415
+ const fr = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi, vr = new RegExp(fr);
416
+ function de(e) {
417
+ return Number.isNaN(+e) ? e.startsWith("http://localhost:3002") || e.startsWith("localhost:3002") ? !0 : !!e.match(vr) : !1;
527
418
  }
528
- function hr() {
529
- return Math.random().toString(36).substring(2, 8);
530
- }
531
- z.displayName = "UniverIcon";
532
- var gr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Dt = W(function(t, e) {
533
- return Z(z, Object.assign({}, t, {
534
- id: "all-border-single",
535
- ref: e,
536
- icon: gr
537
- }));
538
- });
539
- Dt.displayName = "AllBorderSingle";
540
- const ze = Dt;
541
- var mr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.02547 12.4251C5.15328 13.7417 6.26305 14.7708 7.61318 14.7708H12.6132C14.0491 14.7708 15.2132 13.6067 15.2132 12.1708V6.1708C15.2132 4.78586 14.1303 3.65383 12.7651 3.57517C12.6373 2.25858 11.5275 1.22949 10.1774 1.22949H5.17739C3.74145 1.22949 2.57739 2.39355 2.57739 3.82949V9.82949C2.57739 11.2144 3.66024 12.3465 5.02547 12.4251ZM11.5535 3.5708H7.61318C6.17724 3.5708 5.01318 4.73486 5.01318 6.1708V11.22C4.31736 11.1387 3.77739 10.5471 3.77739 9.82949V3.82949C3.77739 3.05629 4.40419 2.42949 5.17739 2.42949H10.1774C10.8622 2.42949 11.4322 2.92119 11.5535 3.5708ZM14.0132 6.1708C14.0132 5.3976 13.3864 4.7708 12.6132 4.7708H7.61318C6.83998 4.7708 6.21318 5.3976 6.21318 6.1708V12.1708C6.21318 12.944 6.83998 13.5708 7.61318 13.5708H12.6132C13.3864 13.5708 14.0132 12.944 14.0132 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, At = W(function(t, e) {
542
- return Z(z, Object.assign({}, t, {
543
- id: "copy-single",
544
- ref: e,
545
- icon: mr
546
- }));
547
- });
548
- At.displayName = "CopySingle";
549
- const fr = At;
550
- var _r = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.9564 2.91332C4.91407 1.87102 3.22413 1.87101 2.18182 2.91333L2.18182 2.91333C1.13953 3.95567 1.13952 5.6456 2.18182 6.68791L8.27777 12.7838C9.72408 14.2302 12.069 14.2302 13.5154 12.7839L13.0911 12.3596L13.5154 12.7839C14.9617 11.3375 14.9617 8.99257 13.5154 7.54626L8.39476 2.42566C8.16044 2.19134 7.78054 2.19134 7.54623 2.42566C7.31191 2.65997 7.31191 3.03987 7.54623 3.27419L12.6668 8.39479L13.0911 7.97052L12.6668 8.39479C13.6445 9.37247 13.6445 10.9576 12.6668 11.9353L13.0399 12.3084L12.6668 11.9353C11.6891 12.913 10.104 12.913 9.1263 11.9353L3.03035 5.83938C2.45668 5.26571 2.45667 4.33556 3.03036 3.76184C3.60403 3.18818 4.53416 3.18817 5.10788 3.76185C5.10788 3.76186 5.10788 3.76186 5.10789 3.76186L11.2038 9.8578L11.601 9.46061L11.2038 9.8578C11.3735 10.0275 11.3735 10.3026 11.2038 10.4723L11.2038 10.4723C11.0341 10.642 10.759 10.642 10.5893 10.4723L5.46874 5.35171C5.23442 5.1174 4.85452 5.1174 4.62021 5.35171C4.38589 5.58602 4.38589 5.96592 4.62021 6.20024L9.74078 11.3208C10.3791 11.9591 11.414 11.9591 12.0523 11.3208C12.0523 11.3208 12.0523 11.3208 12.0523 11.3208M12.0523 11.3208C12.6907 10.6825 12.6906 9.64757 12.0523 9.00927L5.95641 2.91333L5.9564 2.91332", fillRule: "evenodd", clipRule: "evenodd" } }] }, we = W(function(t, e) {
551
- return Z(z, Object.assign({}, t, {
552
- id: "link-single",
553
- ref: e,
554
- icon: _r
555
- }));
556
- });
557
- we.displayName = "LinkSingle";
558
- var vr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157 6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449 14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797 11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302zM3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395 4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092 3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721 8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606zM3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332 2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302 13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332z" } }] }, Bt = W(function(t, e) {
559
- return Z(z, Object.assign({}, t, {
560
- id: "unlink-single",
561
- ref: e,
562
- icon: vr
563
- }));
564
- });
565
- Bt.displayName = "UnlinkSingle";
566
- const yr = Bt;
567
- var Sr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, Vt = W(function(t, e) {
568
- return Z(z, Object.assign({}, t, {
569
- id: "write-single",
570
- ref: e,
571
- icon: Sr
572
- }));
573
- });
574
- Vt.displayName = "WriteSingle";
575
- const Cr = Vt;
576
- var Lr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.36396 1.12549C2.61066 1.12549 2 1.73615 2 2.48945V13.5104C2 14.2637 2.61066 14.8744 3.36396 14.8744H12.457C13.2103 14.8744 13.821 14.2637 13.821 13.5104V5.0992L9.91954 1.12549H3.36396Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M9.91797 1.12549L13.8209 5.09842H10.5846C10.2164 5.09842 9.91797 4.79994 9.91797 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.71926 10.2949L6.28687 12.403C6.17306 12.5705 5.94501 12.614 5.77751 12.5002C5.61002 12.3864 5.56649 12.1584 5.6803 11.9909L7.27596 9.64252L5.85088 7.54519C5.73707 7.37769 5.78059 7.14964 5.94809 7.03583C6.11558 6.92202 6.34363 6.96555 6.45744 7.13304L7.71926 8.9901L8.98108 7.13304C9.09489 6.96555 9.32294 6.92202 9.49044 7.03583C9.65793 7.14964 9.70146 7.37769 9.58765 7.54519L8.16256 9.64252L9.75822 11.9909C9.87203 12.1584 9.82851 12.3864 9.66101 12.5002C9.49351 12.614 9.26547 12.5705 9.15166 12.403L7.71926 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ft = W(function(t, e) {
577
- return Z(z, Object.assign({}, t, {
578
- id: "xlsx",
579
- ref: e,
580
- icon: Lr
581
- }));
582
- });
583
- Ft.displayName = "Xlsx";
584
- const mt = Ft, Ir = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi, kr = new RegExp(Ir);
585
- function le(t) {
586
- return t.startsWith("http://localhost:3002") || t.startsWith("localhost:3002") ? !0 : !!t.match(kr);
419
+ function _r(e) {
420
+ return /^[a-zA-Z]+:\/\//.test(e);
587
421
  }
588
- function Wt(t) {
589
- return /^[a-zA-Z]+:\/\//.test(t);
422
+ function Cr(e) {
423
+ return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e);
590
424
  }
591
- function br(t) {
592
- return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t);
593
- }
594
- function Zt(t) {
595
- return le(t) ? Wt(t) ? t : br(t) ? `mailto://${t}` : `http://${t}` : t;
425
+ function rt(e) {
426
+ if (de(e)) {
427
+ const t = _r(e) ? e : Cr(e) ? `mailto://${e}` : `http://${e}`, n = new URL(t);
428
+ return n.hostname === location.hostname && n.port === location.port && n.protocol === location.protocol && n.pathname === location.pathname && n.hash && !n.search ? n.hash : t;
429
+ }
430
+ return e;
596
431
  }
597
- const Rr = "univer-cell-link-edit-buttons", Pr = {
598
- cellLinkEditButtons: Rr
599
- };
600
- function Or(t) {
601
- if (t === null)
432
+ function yr(e) {
433
+ if (e === null)
602
434
  return "";
603
- if (t != null && t.p) {
604
- const e = t == null ? void 0 : t.p.body;
605
- if (e == null)
435
+ if (e != null && e.p) {
436
+ const t = e == null ? void 0 : e.p.body;
437
+ if (t == null)
606
438
  return "";
607
- const n = e.dataStream;
608
- return n.substring(n.length - 2, n.length) === sn ? n.substring(0, n.length - 2) : n;
439
+ const n = t.dataStream;
440
+ return n.substring(n.length - 2, n.length) === Jt ? n.substring(0, n.length - 2) : n;
609
441
  }
610
- return t == null ? void 0 : t.v;
442
+ return e == null ? void 0 : e.v;
611
443
  }
612
- const Ee = () => {
613
- var ee;
614
- const [t, e] = te(""), [n, r] = te(""), [i, s] = te(
444
+ const Sr = "univer-cell-link-edit-buttons", Lr = {
445
+ cellLinkEditButtons: Sr
446
+ }, Me = () => {
447
+ var te;
448
+ const [e, t] = re(""), [n, r] = re(""), [i, o] = re(
615
449
  "link"
616
450
  /* link */
617
- ), [o, c] = te(""), a = b(de), p = b(bt), h = b(J), _ = b($), l = En(_.currentEditing$), f = b(w), L = b(B), y = b(F), [S, I] = te(!1), v = Tt(!1);
618
- Vn(() => {
619
- var u, m, C;
451
+ ), [s, c] = re(""), a = k(pe), p = k(jt), m = k(ue), f = k(H), l = Ot(f.currentEditing$), g = k(T), S = k(W), v = k(F), [I, V] = re(!1), y = Rt(!1);
452
+ xn(() => {
453
+ var u, C, L;
620
454
  if ((l == null ? void 0 : l.row) !== void 0 && l.column !== void 0) {
621
- const k = f.getHyperLinkByLocation(l.unitId, l.subUnitId, l.row, l.column);
622
- if (k) {
623
- const Be = L.parseHyperLink(k.payload);
624
- if (e(k.id), r(k.display), Be.type === "outer") {
625
- s(
455
+ const _ = g.getHyperLinkByLocationSync(l.unitId, l.subUnitId, l.row, l.column);
456
+ if (_) {
457
+ const ge = S.parseHyperLink(_.payload);
458
+ if (t(_.id), r(_.display), ge.type === "outer") {
459
+ o(
626
460
  "link"
627
461
  /* link */
628
- ), c(Be.url);
462
+ ), c(ge.url), ge.url === _.display && (y.current = !0);
629
463
  return;
630
464
  } else {
631
- const A = Be.searchObj;
632
- if (A.rangeid) {
633
- s(
465
+ const j = ge.searchObj;
466
+ if (j.rangeid) {
467
+ o(
634
468
  "rangeid"
635
469
  /* definedName */
636
- ), c(A.rangeid);
470
+ ), c(j.rangeid);
637
471
  return;
638
472
  }
639
- if (A.range) {
640
- const qt = A.gid && (C = (m = (u = h.getUnit(l.unitId)) == null ? void 0 : u.getSheetBySheetId(A.gid)) == null ? void 0 : m.getName()) != null ? C : "";
641
- s(
473
+ if (j.range) {
474
+ const Kt = j.gid && (L = (C = (u = m.getUnit(l.unitId)) == null ? void 0 : u.getSheetBySheetId(j.gid)) == null ? void 0 : C.getName()) != null ? L : "";
475
+ if (o(
642
476
  "range"
643
477
  /* range */
644
- ), c(kt(qt, ce(A.range).range));
478
+ ), j.range === Ge)
479
+ c("");
480
+ else {
481
+ const ct = Ut(Kt, Oe(j.range).range);
482
+ c(ct), ct === _.display && (y.current = !0);
483
+ }
645
484
  return;
646
485
  }
647
- if (A.gid) {
648
- s(
486
+ if (j.gid) {
487
+ o(
649
488
  "gid"
650
489
  /* sheet */
651
- ), c(A.gid);
490
+ ), c(j.gid);
652
491
  return;
653
492
  }
654
493
  }
655
494
  }
656
- const D = h.getUnit(l.unitId), De = D == null ? void 0 : D.getSheetBySheetId(l.subUnitId), Xt = De == null ? void 0 : De.getCellRaw(l.row, l.column), Ae = Or(Xt);
657
- s(
495
+ const U = m.getUnit(l.unitId), R = U == null ? void 0 : U.getSheetBySheetId(l.subUnitId), zt = R == null ? void 0 : R.getCellRaw(l.row, l.column), We = yr(zt);
496
+ o(
658
497
  "link"
659
498
  /* link */
660
- ), c(""), r((Ae != null ? Ae : "").toString()), e("");
499
+ ), c(""), r((We != null ? We : "").toString()), t("");
661
500
  return;
662
501
  }
663
- s(
502
+ o(
664
503
  "link"
665
504
  /* link */
666
- ), c(""), r(""), e("");
667
- }, [l, f, L, h]);
668
- const K = Fn(() => o, [i]), N = [
505
+ ), c(""), r(""), t("");
506
+ }, [l, g, S, m]);
507
+ const Y = Tn(() => s, [i]), A = [
669
508
  {
670
509
  label: a.t("hyperLink.form.link"),
671
510
  value: "link"
@@ -686,163 +525,169 @@ const Ee = () => {
686
525
  value: "rangeid"
687
526
  /* definedName */
688
527
  }
689
- ], R = h.getCurrentUnitForType(M.UNIVER_SHEET);
690
- if (!R)
528
+ ], P = m.getCurrentUnitForType(w.UNIVER_SHEET);
529
+ if (!P)
691
530
  return;
692
- const Y = R.getHiddenWorksheets(), V = R.getSheets().map((u) => ({ label: u.getName(), value: u.getSheetId() })).filter((u) => Y.indexOf(u.value) === -1), Q = Object.values((ee = p.getDefinedNameMap(R.getUnitId())) != null ? ee : {}).map((u) => ({
531
+ const G = P.getHiddenWorksheets(), B = P.getSheets().map((u) => ({ label: u.getName(), value: u.getSheetId() })).filter((u) => G.indexOf(u.value) === -1), q = Object.values((te = p.getDefinedNameMap(P.getUnitId())) != null ? te : {}).map((u) => ({
693
532
  label: u.name,
694
533
  value: u.id
695
- })), ue = (u, m) => {
534
+ })), he = (u, C) => {
696
535
  if (u === "link")
697
- return Wt(m) ? m : `http://${m}`;
536
+ return rt(C);
698
537
  if (u === "range") {
699
- const C = ce(m), k = R.getSheetBySheetName(C.sheetName);
700
- if (k)
701
- return `#gid=${k.getSheetId()}&range=${fe(C.range)}`;
538
+ const L = Oe(C), _ = P.getSheetBySheetName(L.sheetName);
539
+ if (_)
540
+ return `#gid=${_.getSheetId()}&range=${Wn(L.range)}`;
702
541
  }
703
- return `#${u}=${m}`;
704
- }, Ne = async () => {
705
- l && (t ? await y.executeCommand(It.id, {
542
+ return `#${u}=${C}`;
543
+ }, De = Un((u) => {
544
+ var _;
545
+ const C = u[0];
546
+ if (!C || !Ye(C.range))
547
+ return;
548
+ C.sheetName || (C.sheetName = ((_ = P.getActiveSheet()) == null ? void 0 : _.getName()) || "");
549
+ const L = Dn(C);
550
+ c(L), L && (y.current || !n) && (r(L), y.current = !0);
551
+ }), me = async () => {
552
+ if (l && (e ? await v.executeCommand(St.id, {
706
553
  unitId: l.unitId,
707
554
  subUnitId: l.subUnitId,
708
- id: t,
555
+ id: e,
709
556
  payload: {
710
557
  display: n,
711
- payload: ue(i, o)
558
+ payload: he(i, s)
712
559
  }
713
- }) : await y.executeCommand(it.id, {
560
+ }) : await v.executeCommand(Lt.id, {
714
561
  unitId: l.unitId,
715
562
  subUnitId: l.subUnitId,
716
563
  link: {
717
- id: ae.generateRandomId(),
564
+ id: le.generateRandomId(),
718
565
  row: l.row,
719
566
  column: l.column,
720
- payload: ue(i, o),
567
+ payload: he(i, s),
721
568
  display: n
722
569
  }
723
- })), l && (await y.executeCommand(Pe.id, {
724
- unitId: l.unitId,
725
- subUnitId: l.subUnitId
726
- }), await y.executeCommand(Rt.id, {
727
- range: {
728
- startRow: l.row,
729
- endRow: l.row,
730
- startColumn: l.column,
731
- endColumn: l.column
732
- }
733
- })), y.executeCommand(Me.id);
570
+ })), l) {
571
+ await v.executeCommand(we.id, {
572
+ unitId: l.unitId,
573
+ subUnitId: l.subUnitId
574
+ });
575
+ const u = 5;
576
+ await v.executeCommand(kt.id, {
577
+ range: {
578
+ startRow: Math.max(l.row - u, 0),
579
+ endRow: l.row + u,
580
+ startColumn: Math.max(l.column - u, 0),
581
+ endColumn: l.column + u
582
+ }
583
+ });
584
+ }
585
+ v.executeCommand(xe.id);
734
586
  };
735
587
  return /* @__PURE__ */ d.jsxs("div", { children: [
736
588
  /* @__PURE__ */ d.jsx(
737
- G,
589
+ X,
738
590
  {
739
591
  label: a.t("hyperLink.form.label"),
740
- error: S && !n ? a.t("hyperLink.form.inputError") : "",
592
+ error: I && !n ? a.t("hyperLink.form.inputError") : "",
741
593
  children: /* @__PURE__ */ d.jsx(
742
- ut,
594
+ ht,
743
595
  {
744
596
  value: n,
745
597
  onChange: (u) => {
746
- r(u), v.current = !1;
598
+ r(u), y.current = !1;
747
599
  },
748
600
  placeholder: a.t("hyperLink.form.labelPlaceholder")
749
601
  }
750
602
  )
751
603
  }
752
604
  ),
753
- /* @__PURE__ */ d.jsx(G, { label: a.t("hyperLink.form.type"), children: /* @__PURE__ */ d.jsx(
754
- Ve,
605
+ /* @__PURE__ */ d.jsx(X, { label: a.t("hyperLink.form.type"), children: /* @__PURE__ */ d.jsx(
606
+ Ze,
755
607
  {
756
- options: N,
608
+ options: A,
757
609
  value: i,
758
610
  onChange: (u) => {
759
- s(u), c("");
611
+ o(u), c("");
760
612
  }
761
613
  }
762
614
  ) }),
763
615
  i === "link" && /* @__PURE__ */ d.jsx(
764
- G,
616
+ X,
765
617
  {
766
- error: S ? o ? le(o) ? "" : a.t("hyperLink.form.linkError") : a.t("hyperLink.form.inputError") : "",
618
+ error: I ? s ? de(s) ? "" : a.t("hyperLink.form.linkError") : a.t("hyperLink.form.inputError") : "",
767
619
  children: /* @__PURE__ */ d.jsx(
768
- ut,
620
+ ht,
769
621
  {
770
- value: o,
622
+ value: s,
771
623
  onChange: (u) => {
772
- c(u), u && (v.current || !n) && (r(u), v.current = !0);
624
+ c(u), u && (y.current || !n || n === s) && (r(u), y.current = !0);
773
625
  },
774
626
  placeholder: a.t("hyperLink.form.linkPlaceholder")
775
627
  }
776
628
  )
777
629
  }
778
630
  ),
779
- i === "range" && /* @__PURE__ */ d.jsx(G, { error: S && !o ? a.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ d.jsx(
780
- Mn,
631
+ i === "range" && /* @__PURE__ */ d.jsx(X, { error: I && !s ? a.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ d.jsx(
632
+ jn,
781
633
  {
782
- openForSheetUnitId: R.getUnitId(),
783
- id: rn("hyper-link-edit"),
634
+ openForSheetUnitId: P.getUnitId(),
635
+ id: Qt("hyper-link-edit"),
784
636
  isSingleChoice: !0,
785
- value: K,
786
- onChange: (u) => {
787
- const m = u[0];
788
- if (!m || !Re(m.range))
789
- return;
790
- m.sheetName || (m.sheetName = R.getActiveSheet().getName());
791
- const C = yn(m);
792
- c(C), C && (v.current || !n) && (r(C), v.current = !0);
793
- }
637
+ value: Y,
638
+ onChange: De
794
639
  }
795
640
  ) }),
796
- i === "gid" && /* @__PURE__ */ d.jsx(G, { error: S && !o ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
797
- Ve,
641
+ i === "gid" && /* @__PURE__ */ d.jsx(X, { error: I && !s ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
642
+ Ze,
798
643
  {
799
- options: V,
800
- value: o,
644
+ options: B,
645
+ value: s,
801
646
  onChange: (u) => {
802
- var C;
647
+ var _, U;
803
648
  c(u);
804
- const m = (C = V.find((k) => k.value === u)) == null ? void 0 : C.label;
805
- m && (v.current || !n) && (r(m), v.current = !0);
649
+ const C = (_ = B.find((R) => R.value === u)) == null ? void 0 : _.label, L = (U = B.find((R) => R.value === s)) == null ? void 0 : U.label;
650
+ C && (y.current || !n || n === L) && (r(C), y.current = !0);
806
651
  }
807
652
  }
808
653
  ) }),
809
- i === "rangeid" && /* @__PURE__ */ d.jsx(G, { error: S && !o ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
810
- Ve,
654
+ i === "rangeid" && /* @__PURE__ */ d.jsx(X, { error: I && !s ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
655
+ Ze,
811
656
  {
812
- options: Q,
813
- value: o,
657
+ options: q,
658
+ value: s,
814
659
  onChange: (u) => {
815
- var C;
660
+ var _, U;
816
661
  c(u);
817
- const m = (C = Q.find((k) => k.value === u)) == null ? void 0 : C.label;
818
- m && (v.current || !n) && (r(m), v.current = !0);
662
+ const C = (_ = q.find((R) => R.value === u)) == null ? void 0 : _.label, L = (U = q.find((R) => R.value === s)) == null ? void 0 : U.label;
663
+ C && (y.current || !n || n === L) && (r(C), y.current = !0);
819
664
  }
820
665
  }
821
666
  ) }),
822
- /* @__PURE__ */ d.jsxs("div", { className: Pr.cellLinkEditButtons, children: [
667
+ /* @__PURE__ */ d.jsxs("div", { className: Lr.cellLinkEditButtons, children: [
823
668
  /* @__PURE__ */ d.jsx(
824
- pt,
669
+ mt,
825
670
  {
826
671
  onClick: () => {
827
- l && y.executeCommand(Pe.id, {
672
+ l && v.executeCommand(we.id, {
828
673
  unitId: l.unitId,
829
674
  subUnitId: l.subUnitId
830
- }), y.executeCommand(Me.id);
675
+ }), v.executeCommand(xe.id);
831
676
  },
832
677
  children: a.t("hyperLink.form.cancel")
833
678
  }
834
679
  ),
835
680
  /* @__PURE__ */ d.jsx(
836
- pt,
681
+ mt,
837
682
  {
838
683
  type: "primary",
839
684
  style: { marginLeft: 8 },
840
685
  onClick: async () => {
841
- if (!n || !o || i === "link" && !le(o)) {
842
- I(!0);
686
+ if (!n || !s || i === "link" && !de(s)) {
687
+ V(!0);
843
688
  return;
844
689
  }
845
- Ne();
690
+ me();
846
691
  },
847
692
  children: a.t("hyperLink.form.ok")
848
693
  }
@@ -850,152 +695,158 @@ const Ee = () => {
850
695
  ] })
851
696
  ] });
852
697
  };
853
- Ee.componentKey = "univer.sheet.cell-link-edit";
854
- const ot = {
855
- type: Te.OPERATION,
698
+ Me.componentKey = "univer.sheet.cell-link-edit";
699
+ const it = {
700
+ type: je.OPERATION,
856
701
  id: "sheet.operation.open-hyper-link-sidebar",
857
- handler(t, e) {
858
- if (!e)
702
+ handler(e, t) {
703
+ if (!t)
859
704
  return !1;
860
- const { unitId: n, subUnitId: r, row: i, column: s } = e, o = t.get(w), c = t.get(wt), a = t.get($), p = o.getHyperLinkByLocation(n, r, i, s);
861
- return a.startEditing(e), c.open({
705
+ const { unitId: n, subUnitId: r, row: i, column: o } = t, s = e.get(T), c = e.get(Et), a = e.get(H), p = s.getHyperLinkByLocation(n, r, i, o);
706
+ return a.startEditing(t), c.open({
862
707
  header: {
863
708
  title: p ? "hyperLink.form.editTitle" : "hyperLink.form.addTitle"
864
709
  },
865
710
  children: {
866
- label: Ee.componentKey
711
+ label: Me.componentKey
867
712
  }
868
713
  }), !0;
869
714
  }
870
- }, Me = {
871
- type: Te.OPERATION,
715
+ }, xe = {
716
+ type: je.OPERATION,
872
717
  id: "sheet.operation.close-hyper-link-sidebar",
873
- handler(t) {
874
- const e = t.get(wt), n = t.get($);
875
- return e.close(), n.endEditing(), !0;
718
+ handler(e) {
719
+ const t = e.get(Et), n = e.get(H);
720
+ return t.close(), n.endEditing(), !0;
876
721
  }
877
- }, $e = {
878
- type: Te.OPERATION,
722
+ }, ot = {
723
+ type: je.OPERATION,
879
724
  id: "sheet.operation.insert-hyper-link",
880
- handler(t) {
881
- const e = t.get(J), n = Ct(e);
725
+ handler(e) {
726
+ const t = e.get(ue), n = Ct(t);
882
727
  if (!n)
883
728
  return !1;
884
- const r = t.get(F), s = t.get(Lt).getFirst();
885
- if (!(s != null && s.primary))
729
+ const r = e.get(F), o = e.get(yt).getFirst();
730
+ if (!(o != null && o.primary))
886
731
  return !1;
887
- const o = s.primary.actualRow, c = s.primary.actualColumn;
888
- return r.executeCommand(ot.id, {
732
+ const s = o.primary.startRow, c = o.primary.startColumn;
733
+ return r.executeCommand(it.id, {
889
734
  unitId: n.unitId,
890
735
  subUnitId: n.subUnitId,
891
- row: o,
736
+ row: s,
892
737
  column: c
893
738
  });
894
739
  }
895
- }, zt = {
896
- type: Te.OPERATION,
740
+ }, st = {
741
+ type: je.OPERATION,
897
742
  id: "sheet.operation.insert-hyper-link-toolbar",
898
- handler(t) {
899
- const e = t.get(F);
900
- return t.get($).currentEditing ? e.executeCommand(Me.id) : e.executeCommand($e.id);
743
+ handler(e) {
744
+ const t = e.get(F);
745
+ return e.get(H).currentEditing ? t.executeCommand(xe.id) : t.executeCommand(ot.id);
901
746
  }
902
- }, wr = "univer-cell-link", Er = "univer-cell-link-type", Mr = "univer-cell-link-content", xr = "univer-cell-link-content-error", jr = "univer-cell-link-url", Tr = "univer-cell-link-operations", Ur = "univer-cell-link-operation", Hr = "univer-cell-link-operation-error", E = {
903
- cellLink: wr,
904
- cellLinkType: Er,
905
- cellLinkContent: Mr,
906
- cellLinkContentError: xr,
907
- cellLinkUrl: jr,
908
- cellLinkOperations: Tr,
909
- cellLinkOperation: Ur,
910
- cellLinkOperationError: Hr
911
- }, $r = {
912
- outer: /* @__PURE__ */ d.jsx(we, {}),
913
- link: /* @__PURE__ */ d.jsx(we, {}),
914
- sheet: /* @__PURE__ */ d.jsx(mt, {}),
915
- range: /* @__PURE__ */ d.jsx(ze, {}),
916
- defineName: /* @__PURE__ */ d.jsx(ze, {}),
917
- "range-error": /* @__PURE__ */ d.jsx(ze, {}),
918
- "sheet-error": /* @__PURE__ */ d.jsx(mt, {})
919
- }, xe = () => {
920
- const t = b($), e = b(w), n = b(F), r = b(Ot), i = b(de), s = Wn(t.currentPopup$, t.currentPopup), o = b(B);
921
- if (!s)
747
+ }, Ir = "univer-cell-link", kr = "univer-cell-link-type", Pr = "univer-cell-link-content", br = "univer-cell-link-content-error", Rr = "univer-cell-link-url", wr = "univer-cell-link-operations", Or = "univer-cell-link-operation", Er = "univer-cell-link-operation-error", E = {
748
+ cellLink: Ir,
749
+ cellLinkType: kr,
750
+ cellLinkContent: Pr,
751
+ cellLinkContentError: br,
752
+ cellLinkUrl: Rr,
753
+ cellLinkOperations: wr,
754
+ cellLinkOperation: Or,
755
+ cellLinkOperationError: Er
756
+ }, Mr = {
757
+ outer: /* @__PURE__ */ d.jsx(Ee, {}),
758
+ link: /* @__PURE__ */ d.jsx(Ee, {}),
759
+ sheet: /* @__PURE__ */ d.jsx(Je, {}),
760
+ range: /* @__PURE__ */ d.jsx(Se, {}),
761
+ defineName: /* @__PURE__ */ d.jsx(Se, {}),
762
+ "range-error": /* @__PURE__ */ d.jsx(Se, {}),
763
+ "sheet-error": /* @__PURE__ */ d.jsx(Je, {})
764
+ }, Te = () => {
765
+ const e = k(H), t = k(T), n = k(F), r = k(wt), i = k(pe), o = Ot(e.currentPopup$, e.currentPopup), s = k(W);
766
+ if (!o)
922
767
  return null;
923
- const { unitId: c, subUnitId: a, id: p } = s, h = e.getHyperLink(c, a, p);
924
- if (!h)
768
+ const { unitId: c, subUnitId: a, id: p } = o, m = t.getHyperLink(c, a, p);
769
+ if (!m)
925
770
  return null;
926
- const _ = o.parseHyperLink(h.payload), l = _.type.indexOf("error") > -1;
927
- return /* @__PURE__ */ d.jsxs("div", { className: E.cellLink, onClick: () => t.hideCurrentPopup(), children: [
928
- /* @__PURE__ */ d.jsxs("div", { className: gt(E.cellLinkContent, { [E.cellLinkContentError]: l }), onClick: _.handler, children: [
929
- /* @__PURE__ */ d.jsx("div", { className: E.cellLinkType, children: $r[_.type] }),
930
- /* @__PURE__ */ d.jsx("div", { className: E.cellLinkUrl, children: _.name })
771
+ const f = s.parseHyperLink(m.payload), l = f.type.indexOf("error") > -1;
772
+ return /* @__PURE__ */ d.jsxs("div", { className: E.cellLink, onClick: () => e.hideCurrentPopup(), children: [
773
+ /* @__PURE__ */ d.jsxs("div", { className: pt(E.cellLinkContent, { [E.cellLinkContentError]: l }), onClick: f.handler, children: [
774
+ /* @__PURE__ */ d.jsx("div", { className: E.cellLinkType, children: Mr[f.type] }),
775
+ /* @__PURE__ */ d.jsx(ve, { showIfEllipsis: !0, title: f.name, children: /* @__PURE__ */ d.jsx("span", { className: E.cellLinkUrl, children: f.name }) })
931
776
  ] }),
932
777
  /* @__PURE__ */ d.jsxs("div", { className: E.cellLinkOperations, children: [
933
- /* @__PURE__ */ d.jsx(
778
+ o.copyPermission && /* @__PURE__ */ d.jsx(
934
779
  "div",
935
780
  {
936
- className: gt(E.cellLinkOperation, { [E.cellLinkOperationError]: l }),
781
+ className: pt(E.cellLinkOperation, { [E.cellLinkOperationError]: l }),
937
782
  onClick: () => {
938
783
  if (!l) {
939
- if (_.type !== "outer") {
940
- const f = new URL(window.location.href);
941
- f.hash = _.url.slice(1), navigator.clipboard.writeText(f.href);
784
+ if (f.type !== "outer") {
785
+ const g = new URL(window.location.href);
786
+ g.hash = f.url.slice(1), navigator.clipboard.writeText(g.href);
942
787
  } else
943
- navigator.clipboard.writeText(_.url);
788
+ navigator.clipboard.writeText(f.url);
944
789
  r.show({
945
790
  content: i.t("hyperLink.message.coped"),
946
- type: ie.Info
791
+ type: ae.Info
947
792
  });
948
793
  }
949
794
  },
950
- children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title: i.t("hyperLink.popup.copy"), children: /* @__PURE__ */ d.jsx(fr, {}) })
951
- }
952
- ),
953
- /* @__PURE__ */ d.jsx(
954
- "div",
955
- {
956
- className: E.cellLinkOperation,
957
- onClick: () => {
958
- n.executeCommand(ot.id, {
959
- unitId: c,
960
- subUnitId: a,
961
- row: h.row,
962
- column: h.column
963
- });
964
- },
965
- children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title: i.t("hyperLink.popup.edit"), children: /* @__PURE__ */ d.jsx(Cr, {}) })
795
+ children: /* @__PURE__ */ d.jsx(ve, { placement: "bottom", title: i.t("hyperLink.popup.copy"), children: /* @__PURE__ */ d.jsx(Bt, {}) })
966
796
  }
967
797
  ),
968
- /* @__PURE__ */ d.jsx(
969
- "div",
970
- {
971
- className: E.cellLinkOperation,
972
- onClick: () => {
973
- n.executeCommand(_n.id, {
974
- unitId: c,
975
- subUnitId: a,
976
- id: h.id
977
- });
978
- },
979
- children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title: i.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ d.jsx(yr, {}) })
980
- }
981
- )
798
+ o.editPermission && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
799
+ /* @__PURE__ */ d.jsx(
800
+ "div",
801
+ {
802
+ className: E.cellLinkOperation,
803
+ onClick: () => {
804
+ n.executeCommand(it.id, {
805
+ unitId: c,
806
+ subUnitId: a,
807
+ row: m.row,
808
+ column: m.column
809
+ });
810
+ },
811
+ children: /* @__PURE__ */ d.jsx(ve, { placement: "bottom", title: i.t("hyperLink.popup.edit"), children: /* @__PURE__ */ d.jsx(Dt, {}) })
812
+ }
813
+ ),
814
+ /* @__PURE__ */ d.jsx(
815
+ "div",
816
+ {
817
+ className: E.cellLinkOperation,
818
+ onClick: () => {
819
+ n.executeCommand(_n.id, {
820
+ unitId: c,
821
+ subUnitId: a,
822
+ id: m.id
823
+ });
824
+ },
825
+ children: /* @__PURE__ */ d.jsx(ve, { placement: "bottom", title: i.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ d.jsx(Vt, {}) })
826
+ }
827
+ )
828
+ ] })
982
829
  ] })
983
830
  ] });
984
831
  };
985
- xe.componentKey = "univer.sheet.cell-link-popup";
986
- var Nr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Ar = (t, e, n, r) => {
987
- for (var i = r > 1 ? void 0 : r ? Dr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
988
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
989
- return r && i && Nr(e, n, i), i;
990
- }, ft = (t, e) => (n, r) => e(n, r, t);
991
- let $ = class {
992
- constructor(t, e) {
993
- H(this, "_currentPopup", null);
994
- H(this, "_currentPopup$", new Nn());
995
- H(this, "currentPopup$", this._currentPopup$.asObservable());
996
- H(this, "_currentEditing$", new Dn(null));
997
- H(this, "currentEditing$", this._currentEditing$.asObservable());
998
- this._hyperLinkModel = t, this._sheetCanvasPopManagerService = e;
832
+ Te.componentKey = "univer.sheet.cell-link-popup";
833
+ var xr = Object.defineProperty, Tr = Object.getOwnPropertyDescriptor, Ur = (e, t, n, r) => {
834
+ for (var i = r > 1 ? void 0 : r ? Tr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
835
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
836
+ return r && i && xr(t, n, i), i;
837
+ }, gt = (e, t) => (n, r) => t(n, r, e);
838
+ const jr = (e, t) => e.unitId === t.unitId && e.subUnitId === t.subUnitId && e.row === t.row && e.col === t.col;
839
+ let H = class extends O {
840
+ constructor(t, n) {
841
+ super();
842
+ D(this, "_currentPopup", null);
843
+ D(this, "_currentPopup$", new wn());
844
+ D(this, "currentPopup$", this._currentPopup$.asObservable());
845
+ D(this, "_currentEditing$", new On(null));
846
+ D(this, "currentEditing$", this._currentEditing$.asObservable());
847
+ this._hyperLinkModel = t, this._sheetCanvasPopManagerService = n, this.disposeWithMe(() => {
848
+ this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
849
+ });
999
850
  }
1000
851
  get currentPopup() {
1001
852
  return this._currentPopup;
@@ -1004,20 +855,29 @@ let $ = class {
1004
855
  return this._currentEditing$.getValue();
1005
856
  }
1006
857
  showPopup(t) {
858
+ if (this._currentPopup && jr(t, this._currentPopup))
859
+ return;
1007
860
  this.hideCurrentPopup();
1008
- const { unitId: e, subUnitId: n, row: r, col: i } = t, s = this._hyperLinkModel.getHyperLinkByLocation(e, n, r, i);
861
+ const { unitId: n, subUnitId: r, row: i, col: o } = t, s = this._hyperLinkModel.getHyperLinkByLocation(n, r, i, o);
1009
862
  if (!s)
1010
863
  return;
1011
- const o = this._sheetCanvasPopManagerService.attachPopupToCell(r, i, {
1012
- componentKey: xe.componentKey,
864
+ const c = this._sheetCanvasPopManagerService.attachPopupToCell(i, o, {
865
+ componentKey: Te.componentKey,
1013
866
  direction: "bottom",
1014
- closeOnSelfTarget: !0
867
+ closeOnSelfTarget: !0,
868
+ onClickOutside: () => {
869
+ this.hideCurrentPopup();
870
+ }
1015
871
  });
1016
- o && (this._currentPopup = {
1017
- unitId: e,
1018
- subUnitId: n,
872
+ c && (this._currentPopup = {
873
+ unitId: n,
874
+ subUnitId: r,
1019
875
  id: s.id,
1020
- disposable: o
876
+ disposable: c,
877
+ row: i,
878
+ col: o,
879
+ editPermission: !!t.editPermission,
880
+ copyPermission: !!t.copyPermission
1021
881
  }, this._currentPopup$.next(this._currentPopup));
1022
882
  }
1023
883
  hideCurrentPopup() {
@@ -1031,47 +891,50 @@ let $ = class {
1031
891
  this._currentEditing$.next(null);
1032
892
  }
1033
893
  };
1034
- $ = Ar([
1035
- ft(0, g(w)),
1036
- ft(1, g(Cn))
1037
- ], $);
1038
- var Br = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, Fr = (t, e, n, r) => {
1039
- for (var i = r > 1 ? void 0 : r ? Vr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1040
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1041
- return r && i && Br(e, n, i), i;
1042
- }, re = (t, e) => (n, r) => e(n, r, t);
1043
- let Se = class extends O {
1044
- constructor(t, e, n, r, i) {
1045
- super(), this._sheetInterceptorService = t, this._injector = e, this._hyperLinkModel = n, this._selectionManagerService = r, this._univerInstanceService = i, this._initCommandInterceptor();
894
+ H = Ur([
895
+ gt(0, h(T)),
896
+ gt(1, h(yn))
897
+ ], H);
898
+ var Hr = Object.defineProperty, Nr = Object.getOwnPropertyDescriptor, $r = (e, t, n, r) => {
899
+ for (var i = r > 1 ? void 0 : r ? Nr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
900
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
901
+ return r && i && Hr(t, n, i), i;
902
+ }, oe = (e, t) => (n, r) => t(n, r, e);
903
+ let Le = class extends O {
904
+ constructor(e, t, n, r, i) {
905
+ super(), this._sheetInterceptorService = e, this._injector = t, this._hyperLinkModel = n, this._selectionManagerService = r, this._univerInstanceService = i, this._initCommandInterceptor();
1046
906
  }
1047
907
  _initCommandInterceptor() {
1048
908
  this._initAddHyperLinkCommandInterceptor(), this._initSetRangeValuesCommandInterceptor(), this._initUpdateHyperLinkCommandInterceptor(), this._initClearSelectionCommandInterceptor();
1049
909
  }
1050
910
  _initAddHyperLinkCommandInterceptor() {
1051
911
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
1052
- getMutations: (t) => {
1053
- if (t.id === it.id) {
1054
- const e = t.params, { unitId: n, subUnitId: r, link: i } = e, s = {
1055
- unitId: n,
1056
- subUnitId: r,
912
+ getMutations: (e) => {
913
+ var t;
914
+ if (e.id === Lt.id) {
915
+ const n = e.params, { unitId: r, subUnitId: i, link: o } = n, s = this._getCurrentCell(r, i, o.row, o.column), c = {
916
+ unitId: r,
917
+ subUnitId: i,
1057
918
  cellValue: {
1058
- [i.row]: {
1059
- [i.column]: {
1060
- v: i.display,
1061
- t: at.STRING,
1062
- p: null
919
+ [o.row]: {
920
+ [o.column]: {
921
+ v: o.display,
922
+ // t: CellValueType.STRING, // Setting a link to a number is still a number
923
+ p: null,
924
+ t: (t = s == null ? void 0 : s.t) != null ? t : void 0
925
+ // Keep force string type
1063
926
  }
1064
927
  }
1065
928
  }
1066
929
  };
1067
930
  return {
1068
931
  redos: [{
1069
- id: pe.id,
1070
- params: s
932
+ id: fe.id,
933
+ params: c
1071
934
  }],
1072
935
  undos: [{
1073
- id: pe.id,
1074
- params: lt(this._injector, s)
936
+ id: fe.id,
937
+ params: dt(this._injector, c)
1075
938
  }]
1076
939
  };
1077
940
  }
@@ -1084,18 +947,18 @@ let Se = class extends O {
1084
947
  }
1085
948
  _initUpdateHyperLinkCommandInterceptor() {
1086
949
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
1087
- getMutations: (t) => {
1088
- if (t.id === It.id) {
1089
- const e = t.params, { unitId: n, subUnitId: r, id: i, payload: s } = e, o = this._hyperLinkModel.getHyperLink(n, r, i);
1090
- if (o && o.display !== s.display) {
950
+ getMutations: (e) => {
951
+ if (e.id === St.id) {
952
+ const t = e.params, { unitId: n, subUnitId: r, id: i, payload: o } = t, s = this._hyperLinkModel.getHyperLink(n, r, i);
953
+ if (s && s.display !== o.display) {
1091
954
  const c = {
1092
955
  unitId: n,
1093
956
  subUnitId: r,
1094
957
  cellValue: {
1095
- [o.row]: {
1096
- [o.column]: {
1097
- v: s.display,
1098
- t: at.STRING,
958
+ [s.row]: {
959
+ [s.column]: {
960
+ v: o.display,
961
+ t: en.STRING,
1099
962
  p: null
1100
963
  }
1101
964
  }
@@ -1103,12 +966,12 @@ let Se = class extends O {
1103
966
  };
1104
967
  return {
1105
968
  redos: [{
1106
- id: pe.id,
969
+ id: fe.id,
1107
970
  params: c
1108
971
  }],
1109
972
  undos: [{
1110
- id: pe.id,
1111
- params: lt(this._injector, c)
973
+ id: fe.id,
974
+ params: dt(this._injector, c)
1112
975
  }]
1113
976
  };
1114
977
  }
@@ -1120,86 +983,58 @@ let Se = class extends O {
1120
983
  }
1121
984
  }));
1122
985
  }
1123
- // eslint-disable-next-line max-lines-per-function
1124
986
  _initSetRangeValuesCommandInterceptor() {
1125
987
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
1126
- // eslint-disable-next-line max-lines-per-function
1127
- getMutations: (t) => {
1128
- if (t.id === hn.id) {
1129
- const e = t.params, { unitId: n, subUnitId: r } = e, i = [], s = [];
1130
- return e.cellValue && new St(e.cellValue).forValue((o, c, a) => {
1131
- var f, L, y, S;
1132
- const p = ((S = (y = a == null ? void 0 : a.v) != null ? y : (L = (f = a == null ? void 0 : a.p) == null ? void 0 : f.body) == null ? void 0 : L.dataStream.slice(0, -2)) != null ? S : "").toString(), h = this._hyperLinkModel.getHyperLinkByLocation(n, r, o, c);
1133
- if (!h) {
1134
- if (le(p)) {
1135
- const I = ae.generateRandomId();
1136
- s.push({
1137
- id: x.id,
988
+ getMutations: (e) => {
989
+ if (e.id === ln.id) {
990
+ const t = e.params, { unitId: n, subUnitId: r } = t, i = [], o = [];
991
+ return t.cellValue && new _t(t.cellValue).forValue((s, c, a) => {
992
+ var l, g, S;
993
+ const p = (S = a == null ? void 0 : a.v) != null ? S : (g = (l = a == null ? void 0 : a.p) == null ? void 0 : l.body) == null ? void 0 : g.dataStream.slice(0, -2), m = (p != null ? p : "").toString(), f = this._hyperLinkModel.getHyperLinkByLocation(n, r, s, c);
994
+ if (!f) {
995
+ if (de(m)) {
996
+ const v = le.generateRandomId();
997
+ o.push({
998
+ id: M.id,
1138
999
  params: {
1139
1000
  unitId: n,
1140
1001
  subUnitId: r,
1141
- id: I
1002
+ id: v
1142
1003
  }
1143
1004
  }), i.push({
1144
- id: j.id,
1005
+ id: x.id,
1145
1006
  params: {
1146
1007
  unitId: n,
1147
1008
  subUnitId: r,
1148
1009
  link: {
1149
- id: I,
1150
- row: o,
1010
+ id: v,
1011
+ row: s,
1151
1012
  column: c,
1152
- display: p,
1153
- payload: Zt(p)
1013
+ display: m,
1014
+ payload: rt(m)
1154
1015
  }
1155
1016
  }
1156
1017
  });
1157
1018
  }
1158
1019
  return;
1159
1020
  }
1160
- if (h.display === p)
1161
- return;
1162
- p || (i.push({
1163
- id: x.id,
1021
+ p === "" && (i.push({
1022
+ id: M.id,
1164
1023
  params: {
1165
1024
  unitId: n,
1166
1025
  subUnitId: r,
1167
- id: h.id
1026
+ id: f.id
1168
1027
  }
1169
- }), s.push({
1170
- id: j.id,
1028
+ }), o.push({
1029
+ id: x.id,
1171
1030
  params: {
1172
1031
  unitId: n,
1173
1032
  subUnitId: r,
1174
- link: h
1033
+ link: f
1175
1034
  }
1176
1035
  }));
1177
- const _ = {
1178
- unitId: n,
1179
- subUnitId: r,
1180
- id: h.id,
1181
- payload: {
1182
- payload: h.payload,
1183
- display: p
1184
- }
1185
- }, l = {
1186
- unitId: n,
1187
- subUnitId: r,
1188
- id: h.id,
1189
- payload: {
1190
- payload: h.payload,
1191
- display: h.display
1192
- }
1193
- };
1194
- i.push({
1195
- id: Oe.id,
1196
- params: _
1197
- }), s.push({
1198
- id: Oe.id,
1199
- params: l
1200
- });
1201
1036
  }), {
1202
- undos: s,
1037
+ undos: o,
1203
1038
  redos: i
1204
1039
  };
1205
1040
  }
@@ -1212,32 +1047,32 @@ let Se = class extends O {
1212
1047
  }
1213
1048
  _initClearSelectionCommandInterceptor() {
1214
1049
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
1215
- getMutations: (t) => {
1216
- if (t.id === gn.id || t.id === mn.id) {
1217
- const e = [], n = [], r = this._selectionManagerService.getFirst(), i = Ct(this._univerInstanceService);
1050
+ getMutations: (e) => {
1051
+ if (e.id === dn.id || e.id === un.id || e.id === pn.id) {
1052
+ const t = [], n = [], r = this._selectionManagerService.getFirst(), i = Ct(this._univerInstanceService);
1218
1053
  if (r && i) {
1219
- const { unitId: s, subUnitId: o } = i;
1220
- qe.foreach(r.range, (c, a) => {
1221
- const p = this._hyperLinkModel.getHyperLinkByLocation(s, o, c, a);
1222
- p && (e.push({
1223
- id: x.id,
1054
+ const { unitId: o, subUnitId: s } = i;
1055
+ Qe.foreach(r.range, (c, a) => {
1056
+ const p = this._hyperLinkModel.getHyperLinkByLocation(o, s, c, a);
1057
+ p && (t.push({
1058
+ id: M.id,
1224
1059
  params: {
1225
- unitId: s,
1226
- subUnitId: o,
1060
+ unitId: o,
1061
+ subUnitId: s,
1227
1062
  id: p.id
1228
1063
  }
1229
1064
  }), n.push({
1230
- id: j.id,
1065
+ id: x.id,
1231
1066
  params: {
1232
- unitId: s,
1233
- subUnitId: o,
1067
+ unitId: o,
1068
+ subUnitId: s,
1234
1069
  link: p
1235
1070
  }
1236
1071
  }));
1237
1072
  });
1238
1073
  }
1239
1074
  return {
1240
- redos: e,
1075
+ redos: t,
1241
1076
  undos: n
1242
1077
  };
1243
1078
  }
@@ -1248,477 +1083,502 @@ let Se = class extends O {
1248
1083
  }
1249
1084
  }));
1250
1085
  }
1086
+ _getCurrentCell(e, t, n, r) {
1087
+ var i, o;
1088
+ return (o = (i = this._univerInstanceService.getUnit(e, w.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetId(t)) == null ? void 0 : o.getCell(n, r);
1089
+ }
1251
1090
  };
1252
- Se = Fr([
1253
- T(U.Starting, Se),
1254
- re(0, g(Je)),
1255
- re(1, g(Ue)),
1256
- re(2, g(w)),
1257
- re(3, g(Lt)),
1258
- re(4, J)
1259
- ], Se);
1260
- var Wr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, zr = (t, e, n, r) => {
1261
- for (var i = r > 1 ? void 0 : r ? Zr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1262
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1263
- return r && i && Wr(e, n, i), i;
1264
- }, _t = (t, e) => (n, r) => e(n, r, t);
1265
- let Ce = class extends O {
1266
- constructor(t, e) {
1267
- super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._initHoverListener();
1091
+ Le = $r([
1092
+ N($.Starting, Le),
1093
+ oe(0, h(et)),
1094
+ oe(1, h(Be)),
1095
+ oe(2, h(T)),
1096
+ oe(3, h(yt)),
1097
+ oe(4, ue)
1098
+ ], Le);
1099
+ var Ar = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, Vr = (e, t, n, r) => {
1100
+ for (var i = r > 1 ? void 0 : r ? Br(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1101
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1102
+ return r && i && Ar(t, n, i), i;
1103
+ }, se = (e, t) => (n, r) => t(n, r, e);
1104
+ let Ie = class extends O {
1105
+ constructor(e, t, n, r, i) {
1106
+ super(), this._hoverManagerService = e, this._sheetsHyperLinkPopupService = t, this._renderManagerService = n, this._permissionService = r, this._sheetPermissionInterceptorBaseController = i, this._initHoverListener();
1268
1107
  }
1269
1108
  _initHoverListener() {
1270
1109
  this.disposeWithMe(
1271
- this._hoverManagerService.currentCell$.pipe(An(100)).subscribe((t) => {
1272
- if (!t) {
1110
+ this._hoverManagerService.currentCell$.pipe(En(100)).subscribe((e) => {
1111
+ var f, l;
1112
+ if (!e) {
1273
1113
  this._sheetsHyperLinkPopupService.hideCurrentPopup();
1274
1114
  return;
1275
1115
  }
1276
- this._sheetsHyperLinkPopupService.showPopup(t.location);
1116
+ const t = (l = (f = this._renderManagerService.getRenderById(e.location.unitId)) == null ? void 0 : f.with(It).getUnitSkeleton(e.location.unitId, e.location.subUnitId)) == null ? void 0 : l.skeleton, n = e.location.col, r = e.location.row;
1117
+ let i = r, o = n;
1118
+ if (t && t.overflowCache.forValue((g, S, v) => {
1119
+ ee.contains(v, { startColumn: n, endColumn: n, startRow: r, endRow: r }) && (i = g, o = S);
1120
+ }), !this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1121
+ workbookTypes: [hn],
1122
+ worksheetTypes: [mn],
1123
+ rangeTypes: [gn]
1124
+ }, [{ startRow: r, startColumn: n, endRow: r, endColumn: n }])) {
1125
+ this._sheetsHyperLinkPopupService.hideCurrentPopup();
1126
+ return;
1127
+ }
1128
+ const c = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1129
+ workbookTypes: [He],
1130
+ worksheetTypes: [Ne, $e],
1131
+ rangeTypes: [Ae]
1132
+ }, [{ startRow: r, startColumn: n, endRow: r, endColumn: n }]), a = e.location.unitId, p = e.location.subUnitId, m = this._permissionService.composePermission([new fn(a).id, new vn(a, p).id]).every((g) => g.value);
1133
+ this._sheetsHyperLinkPopupService.showPopup({
1134
+ ...e.location,
1135
+ row: i,
1136
+ col: o,
1137
+ editPermission: c,
1138
+ copyPermission: m
1139
+ });
1277
1140
  })
1278
1141
  );
1279
1142
  }
1280
1143
  };
1281
- Ce = zr([
1282
- T(U.Rendered, Ce),
1283
- _t(0, g(Ln)),
1284
- _t(1, g($))
1285
- ], Ce);
1286
- const Kr = (t) => ({
1287
- id: $e.id,
1288
- type: Et.BUTTON,
1289
- positions: [Mt.CONTEXT_MENU],
1144
+ Ie = Vr([
1145
+ N($.Rendered, Ie),
1146
+ se(0, h(Sn)),
1147
+ se(1, h(H)),
1148
+ se(2, h(nt)),
1149
+ se(3, h(tn)),
1150
+ se(4, h(Pt))
1151
+ ], Ie);
1152
+ const Dr = (e) => ({
1153
+ id: ot.id,
1154
+ type: Mt.BUTTON,
1155
+ positions: [xt.CONTEXT_MENU],
1290
1156
  title: "hyperLink.menu.add",
1291
- hidden$: xt(t, M.UNIVER_SHEET),
1157
+ hidden$: Tt(e, w.UNIVER_SHEET),
1292
1158
  icon: "LinkSingle",
1293
- disabled$: Pt(t, { workbookTypes: [Qe], worksheetTypes: [et, tt, nt], rangeTypes: [rt] })
1294
- }), Yr = (t) => ({
1159
+ disabled$: bt(e, { workbookTypes: [He], worksheetTypes: [Ne, tt, $e], rangeTypes: [Ae] })
1160
+ }), Wr = (e) => ({
1295
1161
  tooltip: "hyperLink.form.addTitle",
1296
- positions: Mt.TOOLBAR_START,
1297
- group: Tn.TOOLBAR_OTHERS,
1298
- id: zt.id,
1299
- type: Et.BUTTON,
1162
+ positions: xt.TOOLBAR_START,
1163
+ group: $n.TOOLBAR_OTHERS,
1164
+ id: st.id,
1165
+ type: Mt.BUTTON,
1300
1166
  icon: "LinkSingle",
1301
- hidden$: xt(t, M.UNIVER_SHEET),
1302
- disabled$: Pt(t, { workbookTypes: [Qe], worksheetTypes: [et, tt, nt], rangeTypes: [rt] })
1303
- }), Kt = {
1304
- id: $e.id,
1305
- binding: xn.K | jn.CTRL_COMMAND,
1306
- preconditions: In
1167
+ hidden$: Tt(e, w.UNIVER_SHEET),
1168
+ disabled$: bt(e, { workbookTypes: [He], worksheetTypes: [Ne, tt, $e], rangeTypes: [Ae] })
1169
+ }), Wt = {
1170
+ id: st.id,
1171
+ binding: Hn.K | Nn.CTRL_COMMAND,
1172
+ preconditions: Ln
1307
1173
  };
1308
- var Gr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, qr = (t, e, n, r) => {
1309
- for (var i = r > 1 ? void 0 : r ? Xr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1310
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1311
- return r && i && Gr(e, n, i), i;
1312
- }, X = (t, e) => (n, r) => e(n, r, t);
1313
- let se = class extends O {
1314
- constructor(t, e, n, r, i, s, o) {
1315
- super(), this._config = t, this._componentManager = e, this._commandService = n, this._localeService = r, this._menuService = i, this._injector = s, this._shortcutService = o, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
1174
+ var Fr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, zr = (e, t, n, r) => {
1175
+ for (var i = r > 1 ? void 0 : r ? Zr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1176
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1177
+ return r && i && Fr(t, n, i), i;
1178
+ }, J = (e, t) => (n, r) => t(n, r, e);
1179
+ let ce = class extends O {
1180
+ constructor(e, t, n, r, i, o, s) {
1181
+ super(), this._config = e, this._componentManager = t, this._commandService = n, this._localeService = r, this._menuService = i, this._injector = o, this._shortcutService = s, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
1316
1182
  }
1317
1183
  _initComponents() {
1318
1184
  [
1319
- [xe, xe.componentKey],
1320
- [Ee, Ee.componentKey],
1321
- [we, "LinkSingle"]
1322
- ].forEach(([t, e]) => {
1323
- this._componentManager.register(e, t);
1185
+ [Te, Te.componentKey],
1186
+ [Me, Me.componentKey],
1187
+ [Ee, "LinkSingle"]
1188
+ ].forEach(([e, t]) => {
1189
+ this._componentManager.register(t, e);
1324
1190
  });
1325
1191
  }
1326
1192
  _initCommands() {
1327
1193
  [
1194
+ it,
1195
+ xe,
1328
1196
  ot,
1329
- Me,
1330
- $e,
1331
- zt
1332
- ].forEach((t) => {
1333
- this._commandService.registerCommand(t);
1197
+ st
1198
+ ].forEach((e) => {
1199
+ this._commandService.registerCommand(e);
1334
1200
  });
1335
1201
  }
1336
1202
  _initMenus() {
1337
- var t, e, n, r;
1338
- this._menuService.addMenuItem(Kr(this._injector), (e = (t = this._config) == null ? void 0 : t.menu) != null ? e : {}), this._menuService.addMenuItem(Yr(this._injector), (r = (n = this._config) == null ? void 0 : n.menu) != null ? r : {});
1203
+ var e, t, n, r;
1204
+ this._menuService.addMenuItem(Dr(this._injector), (t = (e = this._config) == null ? void 0 : e.menu) != null ? t : {}), this._menuService.addMenuItem(Wr(this._injector), (r = (n = this._config) == null ? void 0 : n.menu) != null ? r : {});
1339
1205
  }
1340
1206
  _initShortCut() {
1341
- this._shortcutService.registerShortcut(Kt);
1207
+ this._shortcutService.registerShortcut(Wt);
1342
1208
  }
1343
1209
  };
1344
- se = qr([
1345
- T(U.Ready, se),
1346
- X(1, g(Un)),
1347
- X(2, F),
1348
- X(3, g(de)),
1349
- X(4, $n),
1350
- X(5, g(Ue)),
1351
- X(6, g(Hn))
1352
- ], se);
1353
- var Jr = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, ei = (t, e, n, r) => {
1354
- for (var i = r > 1 ? void 0 : r ? Qr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1355
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1356
- return r && i && Jr(e, n, i), i;
1357
- }, vt = (t, e) => (n, r) => e(n, r, t);
1358
- let Le = class extends O {
1359
- constructor(t, e) {
1360
- super(), this._autoFillService = t, this._hyperLinkModel = e, this._initAutoFill();
1210
+ ce = zr([
1211
+ N($.Ready, ce),
1212
+ J(1, h(An)),
1213
+ J(2, F),
1214
+ J(3, h(pe)),
1215
+ J(4, Vn),
1216
+ J(5, h(Be)),
1217
+ J(6, h(Bn))
1218
+ ], ce);
1219
+ const at = "SHEET_HYPER_LINK_UI_PLUGIN";
1220
+ var Kr = Object.defineProperty, Yr = Object.getOwnPropertyDescriptor, Gr = (e, t, n, r) => {
1221
+ for (var i = r > 1 ? void 0 : r ? Yr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1222
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1223
+ return r && i && Kr(t, n, i), i;
1224
+ }, ft = (e, t) => (n, r) => t(n, r, e);
1225
+ let ke = class extends O {
1226
+ constructor(e, t) {
1227
+ super(), this._autoFillService = e, this._hyperLinkModel = t, this._initAutoFill();
1361
1228
  }
1362
1229
  // eslint-disable-next-line max-lines-per-function
1363
1230
  _initAutoFill() {
1364
- const t = () => ({ redos: [], undos: [] }), e = (r, i) => {
1365
- const { source: s, target: o, unitId: c, subUnitId: a } = r, p = Ye([s, o]), [h, _] = p.ranges, { mapFunc: l } = p, f = {
1366
- row: h.startRow,
1367
- col: h.startColumn
1368
- }, L = bn(h, _), y = [], S = [];
1369
- return L.forEach((I) => {
1370
- const v = I.repeatStartCell, K = I.relativeRange, N = {
1371
- startRow: f.row,
1372
- startColumn: f.col,
1373
- endColumn: f.col,
1374
- endRow: f.row
1375
- }, R = {
1376
- startRow: v.row,
1377
- startColumn: v.col,
1378
- endColumn: v.col,
1379
- endRow: v.row
1231
+ const e = () => ({ redos: [], undos: [] }), t = (r, i) => {
1232
+ const { source: o, target: s, unitId: c, subUnitId: a } = r, p = qe([o, s]), [m, f] = p.ranges, { mapFunc: l } = p, g = {
1233
+ row: m.startRow,
1234
+ col: m.startColumn
1235
+ }, S = kn(m, f), v = [], I = [];
1236
+ return S.forEach((V) => {
1237
+ const y = V.repeatStartCell, Y = V.relativeRange, A = {
1238
+ startRow: g.row,
1239
+ startColumn: g.col,
1240
+ endColumn: g.col,
1241
+ endRow: g.row
1242
+ }, P = {
1243
+ startRow: y.row,
1244
+ startColumn: y.col,
1245
+ endColumn: y.col,
1246
+ endRow: y.row
1380
1247
  };
1381
- qe.foreach(K, (Y, V) => {
1382
- const Q = oe.getPositionRange(
1248
+ Qe.foreach(Y, (G, B) => {
1249
+ const q = ee.getPositionRange(
1383
1250
  {
1384
- startRow: Y,
1385
- startColumn: V,
1386
- endColumn: V,
1387
- endRow: Y
1251
+ startRow: G,
1252
+ startColumn: B,
1253
+ endColumn: B,
1254
+ endRow: G
1388
1255
  },
1389
- N
1390
- ), { row: ue, col: Ne } = l(Q.startRow, Q.startColumn), ee = this._hyperLinkModel.getHyperLinkByLocation(c, a, ue, Ne);
1391
- if (ee) {
1392
- const u = oe.getPositionRange(
1256
+ A
1257
+ ), { row: he, col: De } = l(q.startRow, q.startColumn), me = this._hyperLinkModel.getHyperLinkByLocation(c, a, he, De);
1258
+ if (me) {
1259
+ const te = ee.getPositionRange(
1393
1260
  {
1394
- startRow: Y,
1395
- startColumn: V,
1396
- endColumn: V,
1397
- endRow: Y
1261
+ startRow: G,
1262
+ startColumn: B,
1263
+ endColumn: B,
1264
+ endRow: G
1398
1265
  },
1399
- R
1400
- ), { row: m, col: C } = l(u.startRow, u.startColumn), k = ae.generateRandomId(), D = this._hyperLinkModel.getHyperLinkByLocation(c, a, m, C);
1401
- D && y.push({
1402
- id: x.id,
1266
+ P
1267
+ ), { row: u, col: C } = l(te.startRow, te.startColumn), L = le.generateRandomId(), _ = this._hyperLinkModel.getHyperLinkByLocation(c, a, u, C);
1268
+ _ && v.push({
1269
+ id: M.id,
1403
1270
  params: {
1404
1271
  unitId: c,
1405
1272
  subUnitId: a,
1406
- id: D.id
1273
+ id: _.id
1407
1274
  }
1408
- }), he.COPY === i && (y.push({
1409
- id: j.id,
1275
+ }), (ne.COPY === i || ne.SERIES === i) && (v.push({
1276
+ id: x.id,
1410
1277
  params: {
1411
1278
  unitId: c,
1412
1279
  subUnitId: a,
1413
1280
  link: {
1414
- ...ee,
1415
- id: k,
1416
- row: m,
1281
+ ...me,
1282
+ id: L,
1283
+ row: u,
1417
1284
  column: C
1418
1285
  }
1419
1286
  }
1420
- }), S.push({
1421
- id: x.id,
1287
+ }), I.push({
1288
+ id: M.id,
1422
1289
  params: {
1423
1290
  unitId: c,
1424
1291
  subUnitId: a,
1425
- id: k
1292
+ id: L
1426
1293
  }
1427
- })), D && S.push({
1428
- id: j.id,
1294
+ })), _ && I.push({
1295
+ id: x.id,
1429
1296
  params: {
1430
1297
  unitId: c,
1431
1298
  subUnitId: a,
1432
- link: D
1299
+ link: _
1433
1300
  }
1434
1301
  });
1435
1302
  }
1436
1303
  });
1437
1304
  }), {
1438
- undos: S,
1439
- redos: y
1305
+ undos: I,
1306
+ redos: v
1440
1307
  };
1441
1308
  }, n = {
1442
- id: st,
1443
- onFillData: (r, i, s) => s === he.COPY || s === he.ONLY_FORMAT || s === he.SERIES ? e(r, s) : t()
1309
+ id: at,
1310
+ onFillData: (r, i, o) => o === ne.COPY || o === ne.ONLY_FORMAT || o === ne.SERIES ? t(r, o) : e()
1444
1311
  };
1445
1312
  this.disposeWithMe(this._autoFillService.addHook(n));
1446
1313
  }
1447
1314
  };
1448
- Le = ei([
1449
- T(U.Ready, Le),
1450
- vt(0, kn),
1451
- vt(1, g(w))
1452
- ], Le);
1453
- var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (t, e, n, r) => {
1454
- for (var i = r > 1 ? void 0 : r ? ni(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1455
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1456
- return r && i && ti(e, n, i), i;
1457
- }, me = (t, e) => (n, r) => e(n, r, t);
1458
- let Ie = class extends O {
1459
- constructor(e, n, r, i) {
1315
+ ke = Gr([
1316
+ N($.Ready, ke),
1317
+ ft(0, In),
1318
+ ft(1, h(T))
1319
+ ], ke);
1320
+ var qr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Jr = (e, t, n, r) => {
1321
+ for (var i = r > 1 ? void 0 : r ? Xr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1322
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1323
+ return r && i && qr(t, n, i), i;
1324
+ }, _e = (e, t) => (n, r) => t(n, r, e);
1325
+ let Pe = class extends O {
1326
+ constructor(t, n, r, i) {
1460
1327
  super();
1461
- H(this, "_copyInfo");
1462
- this._sheetClipboardService = e, this._hyperLinkModel = n, this._injector = r, this._resolverService = i, this._initCopyPaste();
1328
+ D(this, "_copyInfo");
1329
+ this._sheetClipboardService = t, this._hyperLinkModel = n, this._injector = r, this._resolverService = i, this._initCopyPaste();
1463
1330
  }
1464
- // eslint-disable-next-line max-lines-per-function
1465
1331
  _initCopyPaste() {
1466
1332
  this._sheetClipboardService.addClipboardHook({
1467
- id: st,
1468
- onBeforeCopy: (e, n, r) => this._collect(e, n, r),
1469
- onPasteCells: (e, n, r, i) => {
1470
- const { copyType: s = ht.COPY, pasteType: o } = i, { range: c } = e || {}, { range: a, unitId: p, subUnitId: h } = n;
1471
- return this._generateMutations(a, { copyType: s, pasteType: o, copyRange: c, unitId: p, subUnitId: h });
1333
+ id: at,
1334
+ onBeforeCopy: (t, n, r) => this._collect(t, n, r),
1335
+ onPasteCells: (t, n, r, i) => {
1336
+ const { copyType: o = ut.COPY, pasteType: s } = i, { range: c } = t || {}, { range: a, unitId: p, subUnitId: m } = n;
1337
+ return this._generateMutations(a, { copyType: o, pasteType: s, copyRange: c, unitId: p, subUnitId: m });
1472
1338
  },
1473
- onPastePlainText: (e, n) => {
1474
- if (le(n)) {
1475
- let r = Zt(n);
1476
- const i = new URL(r), s = n;
1477
- i.hostname === location.hostname && i.port === location.port && i.protocol === location.protocol && i.pathname === location.pathname && i.hash && (r = i.hash);
1478
- const { range: o, unitId: c, subUnitId: a } = e, { ranges: [p], mapFunc: h } = Ye([o]), _ = [], l = [];
1479
- return qe.foreach(p, (f, L) => {
1480
- const { row: y, col: S } = h(f, L), I = this._hyperLinkModel.getHyperLinkByLocation(c, a, y, S);
1481
- I && _.push({
1482
- id: x.id,
1339
+ onPastePlainText: (t, n) => {
1340
+ if (de(n)) {
1341
+ const r = rt(n), { range: i, unitId: o, subUnitId: s } = t, { ranges: [c], mapFunc: a } = qe([i]), p = [], m = [];
1342
+ return Qe.foreach(c, (f, l) => {
1343
+ const { row: g, col: S } = a(f, l), v = this._hyperLinkModel.getHyperLinkByLocation(o, s, g, S);
1344
+ v && p.push({
1345
+ id: M.id,
1483
1346
  params: {
1484
- unitId: c,
1485
- subUnitId: a,
1486
- id: I.id
1347
+ unitId: o,
1348
+ subUnitId: s,
1349
+ id: v.id
1487
1350
  }
1488
1351
  });
1489
- const v = ae.generateRandomId();
1490
- _.push({
1491
- id: j.id,
1352
+ const I = le.generateRandomId();
1353
+ p.push({
1354
+ id: x.id,
1492
1355
  params: {
1493
- unitId: c,
1494
- subUnitId: a,
1356
+ unitId: o,
1357
+ subUnitId: s,
1495
1358
  link: {
1496
- id: v,
1497
- row: y,
1359
+ id: I,
1360
+ row: g,
1498
1361
  column: S,
1499
- display: s,
1500
1362
  payload: r
1501
1363
  }
1502
1364
  }
1503
- }), l.push({
1504
- id: x.id,
1365
+ }), m.push({
1366
+ id: M.id,
1505
1367
  params: {
1506
- unitId: c,
1507
- subUnitId: a,
1508
- id: v
1368
+ unitId: o,
1369
+ subUnitId: s,
1370
+ id: I
1509
1371
  }
1510
- }), I && l.push({
1511
- id: j.id,
1372
+ }), v && m.push({
1373
+ id: x.id,
1512
1374
  params: {
1513
- unitId: c,
1514
- subUnitId: a,
1515
- link: I
1375
+ unitId: o,
1376
+ subUnitId: s,
1377
+ link: v
1516
1378
  }
1517
1379
  });
1518
- }), { redos: _, undos: l };
1380
+ }), { redos: p, undos: m };
1519
1381
  }
1520
1382
  return { undos: [], redos: [] };
1521
1383
  }
1522
1384
  });
1523
1385
  }
1524
- _collect(e, n, r) {
1525
- const i = new St();
1386
+ _collect(t, n, r) {
1387
+ const i = new _t();
1526
1388
  this._copyInfo = {
1527
- unitId: e,
1389
+ unitId: t,
1528
1390
  subUnitId: n,
1529
1391
  matrix: i
1530
1392
  };
1531
- const s = {
1393
+ const o = {
1532
1394
  get: this._injector.get.bind(this._injector)
1533
- }, o = Rn(r, s, e, n);
1534
- if (!o)
1395
+ }, s = Pn(r, o, t, n);
1396
+ if (!s)
1535
1397
  return;
1536
- const { rows: c, cols: a } = o;
1537
- c.forEach((p, h) => {
1538
- a.forEach((_, l) => {
1539
- var L;
1540
- const f = this._hyperLinkModel.getHyperLinkByLocation(e, n, p, _);
1541
- i.setValue(h, l, (L = f == null ? void 0 : f.id) != null ? L : "");
1398
+ const { rows: c, cols: a } = s;
1399
+ c.forEach((p, m) => {
1400
+ a.forEach((f, l) => {
1401
+ var S;
1402
+ const g = this._hyperLinkModel.getHyperLinkByLocation(t, n, p, f);
1403
+ i.setValue(m, l, (S = g == null ? void 0 : g.id) != null ? S : "");
1542
1404
  });
1543
1405
  });
1544
1406
  }
1545
1407
  // eslint-disable-next-line max-lines-per-function
1546
- _generateMutations(e, n) {
1408
+ _generateMutations(t, n) {
1547
1409
  if (!this._copyInfo)
1548
1410
  return { redos: [], undos: [] };
1549
- if (n.copyType === ht.CUT)
1411
+ if (n.copyType === ut.CUT)
1550
1412
  return this._copyInfo = null, { redos: [], undos: [] };
1551
1413
  if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
1552
1414
  return { redos: [], undos: [] };
1553
1415
  if ([
1554
- We.SPECIAL_PASTE_COL_WIDTH,
1555
- We.SPECIAL_PASTE_VALUE,
1556
- We.SPECIAL_PASTE_FORMAT,
1557
- Zn
1416
+ Fe.SPECIAL_PASTE_COL_WIDTH,
1417
+ Fe.SPECIAL_PASTE_VALUE,
1418
+ Fe.SPECIAL_PASTE_FORMAT,
1419
+ Fn
1558
1420
  ].includes(
1559
1421
  n.pasteType
1560
1422
  ))
1561
1423
  return { redos: [], undos: [] };
1562
- const { unitId: r, subUnitId: i } = this._copyInfo, s = [], o = [], { ranges: [c, a], mapFunc: p } = Ye([n.copyRange, e]);
1563
- return Pn(c, a, !0).forEach(({ startRange: _ }) => {
1424
+ const { unitId: r, subUnitId: i } = this._copyInfo, o = [], s = [], { ranges: [c, a], mapFunc: p } = qe([n.copyRange, t]);
1425
+ return bn(c, a, !0).forEach(({ startRange: f }) => {
1564
1426
  var l;
1565
- (l = this._copyInfo) == null || l.matrix.forValue((f, L, y) => {
1566
- const S = oe.getPositionRange(
1427
+ (l = this._copyInfo) == null || l.matrix.forValue((g, S, v) => {
1428
+ const I = ee.getPositionRange(
1567
1429
  {
1568
- startRow: f,
1569
- endRow: f,
1570
- startColumn: L,
1571
- endColumn: L
1430
+ startRow: g,
1431
+ endRow: g,
1432
+ startColumn: S,
1433
+ endColumn: S
1572
1434
  },
1573
- _
1574
- ), I = this._hyperLinkModel.getHyperLink(r, i, y), { row: v, col: K } = p(S.startRow, S.startColumn), N = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, v, K), R = ae.generateRandomId();
1575
- N && s.push({
1576
- id: x.id,
1435
+ f
1436
+ ), V = this._hyperLinkModel.getHyperLink(r, i, v), { row: y, col: Y } = p(I.startRow, I.startColumn), A = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, y, Y), P = le.generateRandomId();
1437
+ A && o.push({
1438
+ id: M.id,
1577
1439
  params: {
1578
1440
  unitId: n.unitId,
1579
1441
  subUnitId: n.subUnitId,
1580
- id: N.id
1442
+ id: A.id
1581
1443
  }
1582
- }), I && (s.push({
1583
- id: j.id,
1444
+ }), V && (o.push({
1445
+ id: x.id,
1584
1446
  params: {
1585
1447
  unitId: n.unitId,
1586
1448
  subUnitId: n.subUnitId,
1587
1449
  link: {
1588
- ...I,
1589
- id: R,
1590
- row: v,
1591
- column: K
1450
+ ...V,
1451
+ id: P,
1452
+ row: y,
1453
+ column: Y
1592
1454
  }
1593
1455
  }
1594
- }), o.push({
1595
- id: x.id,
1456
+ }), s.push({
1457
+ id: M.id,
1596
1458
  params: {
1597
1459
  unitId: n.unitId,
1598
1460
  subUnitId: n.subUnitId,
1599
- id: R
1461
+ id: P
1600
1462
  }
1601
- })), N && o.push({
1602
- id: j.id,
1463
+ })), A && s.push({
1464
+ id: x.id,
1603
1465
  params: {
1604
1466
  unitId: n.unitId,
1605
1467
  subUnitId: n.subUnitId,
1606
- link: N
1468
+ link: A
1607
1469
  }
1608
1470
  });
1609
1471
  });
1610
1472
  }), {
1611
- redos: s,
1612
- undos: o
1473
+ redos: o,
1474
+ undos: s
1613
1475
  };
1614
1476
  }
1615
1477
  };
1616
- Ie = ri([
1617
- T(U.Ready, Ie),
1618
- me(0, On),
1619
- me(1, g(w)),
1620
- me(2, g(Ue)),
1621
- me(3, g(B))
1622
- ], Ie);
1623
- var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, oi = (t, e, n, r) => {
1624
- for (var i = r > 1 ? void 0 : r ? si(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1625
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1626
- return r && i && ii(e, n, i), i;
1627
- }, ai = (t, e) => (n, r) => e(n, r, t);
1628
- let ke = class extends O {
1629
- constructor(t) {
1630
- super(), this._resolverService = t, this._handleInitUrl();
1478
+ Pe = Jr([
1479
+ N($.Ready, Pe),
1480
+ _e(0, Rn),
1481
+ _e(1, h(T)),
1482
+ _e(2, h(Be)),
1483
+ _e(3, h(W))
1484
+ ], Pe);
1485
+ var Qr = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, ti = (e, t, n, r) => {
1486
+ for (var i = r > 1 ? void 0 : r ? ei(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1487
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1488
+ return r && i && Qr(t, n, i), i;
1489
+ }, ni = (e, t) => (n, r) => t(n, r, e);
1490
+ let be = class extends O {
1491
+ constructor(e) {
1492
+ super(), this._resolverService = e, this._handleInitUrl();
1631
1493
  }
1632
1494
  _handleInitUrl() {
1633
- const t = location.hash;
1634
- t && this._resolverService.parseHyperLink(t).handler();
1495
+ const e = location.hash;
1496
+ e && this._resolverService.parseHyperLink(e).handler();
1635
1497
  }
1636
1498
  };
1637
- ke = oi([
1638
- T(U.Rendered, ke),
1639
- ai(0, g(B))
1640
- ], ke);
1641
- var ci = Object.defineProperty, li = Object.getOwnPropertyDescriptor, di = (t, e, n, r) => {
1642
- for (var i = r > 1 ? void 0 : r ? li(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1643
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1644
- return r && i && ci(e, n, i), i;
1645
- }, Ke = (t, e) => (n, r) => e(n, r, t);
1646
- let be = class extends O {
1647
- constructor(t, e, n) {
1648
- super(), this._localeService = t, this._commandService = e, this._sheetPermissionInterceptorBaseController = n, this._commandExecutedListener();
1499
+ be = ti([
1500
+ N($.Rendered, be),
1501
+ ni(0, h(W))
1502
+ ], be);
1503
+ var ri = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, oi = (e, t, n, r) => {
1504
+ for (var i = r > 1 ? void 0 : r ? ii(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1505
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1506
+ return r && i && ri(t, n, i), i;
1507
+ }, Ke = (e, t) => (n, r) => t(n, r, e);
1508
+ let Re = class extends O {
1509
+ constructor(e, t, n) {
1510
+ super(), this._localeService = e, this._commandService = t, this._sheetPermissionInterceptorBaseController = n, this._commandExecutedListener();
1649
1511
  }
1650
1512
  _commandExecutedListener() {
1651
1513
  this.disposeWithMe(
1652
- this._commandService.beforeCommandExecuted((t) => {
1653
- t.id === Kt.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1654
- workbookTypes: [Qe],
1655
- rangeTypes: [rt],
1656
- worksheetTypes: [et, tt, nt]
1514
+ this._commandService.beforeCommandExecuted((e) => {
1515
+ e.id === Wt.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1516
+ workbookTypes: [He],
1517
+ rangeTypes: [Ae],
1518
+ worksheetTypes: [Ne, tt, $e]
1657
1519
  }) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.hyperLinkErr")));
1658
1520
  })
1659
1521
  );
1660
1522
  }
1661
1523
  };
1662
- be = di([
1663
- T(U.Rendered, be),
1664
- Ke(0, g(de)),
1524
+ Re = oi([
1525
+ N($.Rendered, Re),
1526
+ Ke(0, h(pe)),
1665
1527
  Ke(1, F),
1666
- Ke(2, g(wn))
1667
- ], be);
1668
- var Yt = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, pi = (t, e, n) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, hi = (t, e, n, r) => {
1669
- for (var i = r > 1 ? void 0 : r ? ui(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1670
- (o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
1671
- return r && i && Yt(e, n, i), i;
1672
- }, yt = (t, e) => (n, r) => e(n, r, t), Gt = (t, e, n) => (pi(t, typeof e != "symbol" ? e + "" : e, n), n);
1673
- let je = class extends on {
1674
- constructor(t, e, n) {
1675
- super(), this._config = t, this._injector = e, this._renderManagerService = n;
1528
+ Ke(2, h(Pt))
1529
+ ], Re);
1530
+ var Ft = Object.defineProperty, si = Object.getOwnPropertyDescriptor, ai = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ci = (e, t, n, r) => {
1531
+ for (var i = r > 1 ? void 0 : r ? si(t, n) : t, o = e.length - 1, s; o >= 0; o--)
1532
+ (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
1533
+ return r && i && Ft(t, n, i), i;
1534
+ }, vt = (e, t) => (n, r) => t(n, r, e), Zt = (e, t, n) => ai(e, typeof t != "symbol" ? t + "" : t, n);
1535
+ let Ue = class extends nn {
1536
+ constructor(e, t, n) {
1537
+ super(), this._config = e, this._injector = t, this._renderManagerService = n;
1676
1538
  }
1677
- onStarting(t) {
1539
+ onStarting(e) {
1678
1540
  [
1679
- [B],
1680
- [$],
1681
- [_e],
1682
- [ve],
1683
- [ye],
1684
- [Se],
1541
+ [W],
1542
+ [H],
1685
1543
  [Ce],
1544
+ [ye],
1545
+ [Le],
1546
+ [Ie],
1686
1547
  [
1687
- se,
1548
+ ce,
1688
1549
  {
1689
- useFactory: () => this._injector.createInstance(se, this._config)
1550
+ useFactory: () => this._injector.createInstance(ce, this._config)
1690
1551
  }
1691
1552
  ],
1692
- [Le],
1693
- [Ie],
1694
- [be],
1695
- [ke]
1696
- ].forEach((n) => t.add(n)), this._renderManagerService.registerRenderController(M.UNIVER_SHEET, Xe);
1553
+ [ke],
1554
+ [Pe],
1555
+ [Re],
1556
+ [be]
1557
+ ].forEach((n) => e.add(n)), this._renderManagerService.registerRenderController(w.UNIVER_SHEET, Xe);
1697
1558
  }
1698
1559
  };
1699
- Gt(je, "pluginName", st);
1700
- Gt(je, "type", M.UNIVER_SHEET);
1701
- je = hi([
1702
- an(vn),
1703
- yt(1, g(Ue)),
1704
- yt(2, jt)
1705
- ], je);
1560
+ Zt(Ue, "pluginName", at);
1561
+ Zt(Ue, "type", w.UNIVER_SHEET);
1562
+ Ue = ci([
1563
+ rn(Cn),
1564
+ vt(1, h(Be)),
1565
+ vt(2, nt)
1566
+ ], Ue);
1706
1567
  export {
1707
- Me as CloseHyperLinkSidebarOperation,
1708
- $e as InsertHyperLinkOperation,
1709
- Kt as InsertLinkShortcut,
1710
- ot as OpenHyperLinkSidebarOperation,
1711
- Se as SheetHyperLinkSetRangeController,
1712
- ke as SheetHyperLinkUrlController,
1713
- Le as SheetsHyperLinkAutoFillController,
1714
- Ie as SheetsHyperLinkCopyPasteController,
1715
- Ce as SheetsHyperLinkPopupController,
1716
- $ as SheetsHyperLinkPopupService,
1717
- ve as SheetsHyperLinkRefRangeController,
1718
- _e as SheetsHyperLinkRemoveSheetController,
1568
+ xe as CloseHyperLinkSidebarOperation,
1569
+ ot as InsertHyperLinkOperation,
1570
+ Wt as InsertLinkShortcut,
1571
+ it as OpenHyperLinkSidebarOperation,
1572
+ Le as SheetHyperLinkSetRangeController,
1573
+ be as SheetHyperLinkUrlController,
1574
+ ke as SheetsHyperLinkAutoFillController,
1575
+ Pe as SheetsHyperLinkCopyPasteController,
1576
+ Ie as SheetsHyperLinkPopupController,
1577
+ H as SheetsHyperLinkPopupService,
1578
+ Ce as SheetsHyperLinkRemoveSheetController,
1719
1579
  Xe as SheetsHyperLinkRenderController,
1720
1580
  ye as SheetsHyperLinkRenderManagerController,
1721
- B as SheetsHyperLinkResolverService,
1722
- se as SheetsHyperLinkUIController,
1723
- je as UniverSheetsHyperLinkUIPlugin
1581
+ W as SheetsHyperLinkResolverService,
1582
+ ce as SheetsHyperLinkUIController,
1583
+ Ue as UniverSheetsHyperLinkUIPlugin
1724
1584
  };