@univerjs/sheets-hyper-link-ui 0.3.0-alpha.0 → 0.3.0-nightly.202410101606
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/cjs/index.js +1 -9
- package/lib/es/index.js +1 -2550
- package/lib/types/controllers/render-controllers/render.controller.d.ts +4 -8
- package/lib/types/plugin.d.ts +3 -4
- package/lib/types/services/popup.service.d.ts +3 -3
- package/lib/umd/index.js +1 -9
- package/package.json +23 -24
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,2550 +1 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { Tools, Inject, LocaleService, UniverInstanceType, isValidRange, IUniverInstanceService, ICommandService, IConfigService, RANGE_TYPE, Rectangle, OnLifecycle, LifecycleStages, Injector, Disposable, Range, ObjectMatrix, CommandType, IUndoRedoService, BuildTextUtils, DataStreamTreeTokenType, CustomRangeType, TextX, CellValueType, sequenceExecuteAsync, generateRandomId, getBodySlice, useDependency, IContextService, getOriginCellValue, DisposableCollection, createInternalEditorID, FOCUSING_SHEET, DOCS_ZEN_EDITOR_UNIT_ID_KEY, sequenceExecute, DataValidationType, ThemeService, InterceptorEffectEnum, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, IPermissionService, DependentOn, Plugin } from "@univerjs/core";
|
|
6
|
-
import { SheetHyperLinkType, ERROR_RANGE, HyperLinkModel, RemoveHyperLinkMutation, AddHyperLinkMutation, UniverSheetsHyperLinkPlugin } from "@univerjs/sheets-hyper-link";
|
|
7
|
-
import { ScrollToRangeOperation, COPY_TYPE, virtualizeDiscreteRanges, rangeToDiscreteRange, PREDEFINED_HOOK_NAME, getRepeatRange, ISheetClipboardService, SheetSkeletonManagerService, IEditorBridgeService, IMarkSelectionService, SheetCanvasPopManagerService, getEditingCustomRangePosition, getCustomRangePosition, whenSheetEditorFocused, getCurrentRangeDisable$, HoverManagerService, SheetPermissionInterceptorBaseController, HoverRenderController, IAutoFillService, APPLY_TYPE, getAutoFillRepeatRange } from "@univerjs/sheets-ui";
|
|
8
|
-
import { MessageType, FormLayout, Input, Select, Button, Tooltip } from "@univerjs/design";
|
|
9
|
-
import { deserializeRangeWithSheet, serializeRangeWithSheet, serializeRange, IDefinedNamesService, serializeRangeToRefString } from "@univerjs/engine-formula";
|
|
10
|
-
import { SetSelectionsOperation, SetWorksheetActiveOperation, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SheetsSelectionsService, getSheetCommandTarget, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission, RangeProtectionPermissionEditPoint, SheetInterceptorService, RemoveSheetCommand, INTERCEPTOR_POINT, SetRangeValuesCommand, ClearSelectionContentCommand, ClearSelectionAllCommand, ClearSelectionFormatCommand, WorkbookViewPermission, WorksheetViewPermission, RangeProtectionPermissionViewPoint, WorkbookCopyPermission, WorksheetCopyPermission, RefRangeService, handleDefaultRangeChangeWithEffectRefCommands } from "@univerjs/sheets";
|
|
11
|
-
import { IMessageService, useObservable, IZenZoneService, useEvent, KeyCode, MenuItemType, MenuPosition, MenuGroup, MetaKeys, getMenuHiddenObservable, RibbonStartGroup, ContextMenuPosition, ContextMenuGroup, ComponentManager, IShortcutService, IMenuManagerService } from "@univerjs/ui";
|
|
12
|
-
import { DocSelectionManagerService } from "@univerjs/docs";
|
|
13
|
-
import { Subject, BehaviorSubject, map, mergeMap, Observable, debounceTime } from "rxjs";
|
|
14
|
-
import { addCustomRangeBySelectionFactory, replaceSelectionFactory, DocSelectionRenderService, RangeSelector, deleteCustomRangeFactory, DocCanvasPopManagerService, IEditorService, IRangeSelectorService, DocEventManagerService, UniverDocsUIPlugin } from "@univerjs/docs-ui";
|
|
15
|
-
import require$$0, { useState, useMemo, useRef, useEffect, forwardRef, createElement } from "react";
|
|
16
|
-
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
17
|
-
import cs from "clsx";
|
|
18
|
-
const SHEET_HYPER_LINK_UI_PLUGIN = "SHEET_HYPER_LINK_UI_PLUGIN";
|
|
19
|
-
function isLegalLink(link) {
|
|
20
|
-
return Tools.isLegalUrl(link);
|
|
21
|
-
}
|
|
22
|
-
__name(isLegalLink, "isLegalLink");
|
|
23
|
-
function hasProtocol(urlString) {
|
|
24
|
-
return /^[a-zA-Z]+:\/\//.test(urlString);
|
|
25
|
-
}
|
|
26
|
-
__name(hasProtocol, "hasProtocol");
|
|
27
|
-
function isEmail(url) {
|
|
28
|
-
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(url);
|
|
29
|
-
}
|
|
30
|
-
__name(isEmail, "isEmail");
|
|
31
|
-
function serializeUrl(urlStr) {
|
|
32
|
-
if (isLegalLink(urlStr)) {
|
|
33
|
-
const transformedUrl = hasProtocol(urlStr) ? urlStr : isEmail(urlStr) ? `mailto://${urlStr}` : `http://${urlStr}`;
|
|
34
|
-
let url;
|
|
35
|
-
try {
|
|
36
|
-
url = new URL(transformedUrl);
|
|
37
|
-
} catch {
|
|
38
|
-
return urlStr;
|
|
39
|
-
}
|
|
40
|
-
return url.hostname === location.hostname && url.port === location.port && url.protocol === location.protocol && url.pathname === location.pathname && url.hash && !url.search ? url.hash : transformedUrl;
|
|
41
|
-
}
|
|
42
|
-
return urlStr;
|
|
43
|
-
}
|
|
44
|
-
__name(serializeUrl, "serializeUrl");
|
|
45
|
-
const PLUGIN_CONFIG_KEY = "sheets-hyper-link-ui.config", defaultPluginConfig = {};
|
|
46
|
-
var __defProp$c = Object.defineProperty, __getOwnPropDesc$c = Object.getOwnPropertyDescriptor, __decorateClass$c = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
47
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
48
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
49
|
-
return kind && result && __defProp$c(target, key, result), result;
|
|
50
|
-
}, "__decorateClass$c"), __decorateParam$c = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$c");
|
|
51
|
-
function getContainRange(range, worksheet) {
|
|
52
|
-
const mergedCells = worksheet.getMergeData(), maxCol = worksheet.getMaxColumns() - 1, maxRow = worksheet.getMaxRows() - 1;
|
|
53
|
-
if (maxCol < range.endColumn && (range.endColumn = maxCol), maxRow < range.endRow && (range.endRow = maxRow), range.rangeType === RANGE_TYPE.COLUMN || RANGE_TYPE.ROW)
|
|
54
|
-
return range;
|
|
55
|
-
const relativeCells = [];
|
|
56
|
-
return mergedCells.forEach((cell) => {
|
|
57
|
-
Rectangle.intersects(range, cell) && relativeCells.push(cell);
|
|
58
|
-
}), Rectangle.realUnion(range, ...relativeCells);
|
|
59
|
-
}
|
|
60
|
-
__name(getContainRange, "getContainRange");
|
|
61
|
-
var _a;
|
|
62
|
-
let SheetsHyperLinkResolverService = (_a = class {
|
|
63
|
-
constructor(_univerInstanceService, _commandService, _definedNamesService, _messageService, _localeService, _configService) {
|
|
64
|
-
this._univerInstanceService = _univerInstanceService, this._commandService = _commandService, this._definedNamesService = _definedNamesService, this._messageService = _messageService, this._localeService = _localeService, this._configService = _configService;
|
|
65
|
-
}
|
|
66
|
-
_getURLName(params) {
|
|
67
|
-
var _a15;
|
|
68
|
-
const { gid, range, rangeid, unitid } = params, workbook = unitid ? this._univerInstanceService.getUnit(unitid, UniverInstanceType.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), invalidLink = {
|
|
69
|
-
type: SheetHyperLinkType.INVALID,
|
|
70
|
-
name: this._localeService.t("hyperLink.message.refError")
|
|
71
|
-
};
|
|
72
|
-
if (!workbook)
|
|
73
|
-
return invalidLink;
|
|
74
|
-
const sheet = gid ? workbook.getSheetBySheetId(gid) : workbook.getActiveSheet(), sheetName = (_a15 = sheet == null ? void 0 : sheet.getName()) != null ? _a15 : "";
|
|
75
|
-
if (range) {
|
|
76
|
-
if (!sheet) return invalidLink;
|
|
77
|
-
const rangeObj = deserializeRangeWithSheet(range).range;
|
|
78
|
-
return isValidRange(rangeObj, sheet) && range !== ERROR_RANGE ? {
|
|
79
|
-
type: SheetHyperLinkType.RANGE,
|
|
80
|
-
name: serializeRangeWithSheet(sheetName, rangeObj)
|
|
81
|
-
} : invalidLink;
|
|
82
|
-
}
|
|
83
|
-
if (rangeid) {
|
|
84
|
-
const range2 = this._definedNamesService.getValueById(workbook.getUnitId(), rangeid);
|
|
85
|
-
return range2 ? {
|
|
86
|
-
type: SheetHyperLinkType.DEFINE_NAME,
|
|
87
|
-
name: range2.formulaOrRefString
|
|
88
|
-
} : invalidLink;
|
|
89
|
-
}
|
|
90
|
-
if (gid) {
|
|
91
|
-
const worksheet = workbook.getSheetBySheetId(gid);
|
|
92
|
-
return worksheet ? {
|
|
93
|
-
type: SheetHyperLinkType.SHEET,
|
|
94
|
-
name: worksheet.getName()
|
|
95
|
-
} : invalidLink;
|
|
96
|
-
}
|
|
97
|
-
return invalidLink;
|
|
98
|
-
}
|
|
99
|
-
navigateTo(params) {
|
|
100
|
-
const { gid, range, rangeid } = params, workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
101
|
-
if (!workbook)
|
|
102
|
-
return;
|
|
103
|
-
const unitId = workbook.getUnitId();
|
|
104
|
-
if (rangeid && this.navigateToDefineName(unitId, rangeid), !!gid) {
|
|
105
|
-
if (range) {
|
|
106
|
-
const rangeInfo = deserializeRangeWithSheet(range);
|
|
107
|
-
isValidRange(rangeInfo.range) && range !== ERROR_RANGE && this.navigateToRange(unitId, gid, rangeInfo.range);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
this.navigateToSheetById(unitId, gid);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
buildHyperLink(unitId, sheetId, range) {
|
|
114
|
-
return `#${SheetHyperLinkType.SHEET}=${sheetId}${range ? `&${typeof range == "string" ? SheetHyperLinkType.DEFINE_NAME : SheetHyperLinkType.RANGE}=${typeof range == "string" ? range : serializeRange(range)}` : ""}`;
|
|
115
|
-
}
|
|
116
|
-
parseHyperLink(urlStr) {
|
|
117
|
-
var _a15, _b, _c, _d;
|
|
118
|
-
if (urlStr.startsWith("#")) {
|
|
119
|
-
const search = new URLSearchParams(urlStr.slice(1)), searchObj = {
|
|
120
|
-
gid: (_a15 = search.get("gid")) != null ? _a15 : "",
|
|
121
|
-
range: (_b = search.get("range")) != null ? _b : "",
|
|
122
|
-
rangeid: (_c = search.get("rangeid")) != null ? _c : "",
|
|
123
|
-
unitid: (_d = search.get("unitid")) != null ? _d : ""
|
|
124
|
-
}, urlInfo = this._getURLName(searchObj);
|
|
125
|
-
return {
|
|
126
|
-
type: urlInfo.type,
|
|
127
|
-
name: urlInfo.name,
|
|
128
|
-
url: urlStr,
|
|
129
|
-
searchObj,
|
|
130
|
-
handler: /* @__PURE__ */ __name(() => {
|
|
131
|
-
this.navigateTo(searchObj);
|
|
132
|
-
}, "handler")
|
|
133
|
-
};
|
|
134
|
-
} else
|
|
135
|
-
return {
|
|
136
|
-
type: SheetHyperLinkType.URL,
|
|
137
|
-
name: urlStr,
|
|
138
|
-
url: urlStr,
|
|
139
|
-
handler: /* @__PURE__ */ __name(() => {
|
|
140
|
-
this.navigateToOtherWebsite(urlStr);
|
|
141
|
-
}, "handler"),
|
|
142
|
-
searchObj: null
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
async navigateToRange(unitId, subUnitId, range) {
|
|
146
|
-
const worksheet = await this.navigateToSheetById(unitId, subUnitId);
|
|
147
|
-
if (worksheet) {
|
|
148
|
-
const realRange = getContainRange(range, worksheet);
|
|
149
|
-
await this._commandService.executeCommand(
|
|
150
|
-
SetSelectionsOperation.id,
|
|
151
|
-
{
|
|
152
|
-
unitId,
|
|
153
|
-
subUnitId,
|
|
154
|
-
selections: [{
|
|
155
|
-
range: realRange
|
|
156
|
-
}]
|
|
157
|
-
}
|
|
158
|
-
), await this._commandService.executeCommand(ScrollToRangeOperation.id, {
|
|
159
|
-
range: realRange
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
async navigateToSheet(unitId, sheetName) {
|
|
164
|
-
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
165
|
-
if (!workbook)
|
|
166
|
-
return !1;
|
|
167
|
-
const worksheet = workbook.getActiveSheet();
|
|
168
|
-
if ((worksheet == null ? void 0 : worksheet.getName()) === sheetName)
|
|
169
|
-
return !0;
|
|
170
|
-
const targetSheet = workbook.getSheetBySheetName(sheetName);
|
|
171
|
-
if (!targetSheet) {
|
|
172
|
-
this._messageService.show({
|
|
173
|
-
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
174
|
-
type: MessageType.Error
|
|
175
|
-
});
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
const sheetId = targetSheet.getSheetId();
|
|
179
|
-
return workbook.getHiddenWorksheets().indexOf(sheetId) > -1 && this._messageService.show({
|
|
180
|
-
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
181
|
-
type: MessageType.Error
|
|
182
|
-
}), await this._commandService.executeCommand(SetWorksheetActiveOperation.id, { unitId, subUnitId: sheetId });
|
|
183
|
-
}
|
|
184
|
-
async navigateToSheetById(unitId, subUnitId) {
|
|
185
|
-
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
186
|
-
if (!workbook)
|
|
187
|
-
return !1;
|
|
188
|
-
const worksheet = workbook.getActiveSheet();
|
|
189
|
-
if (!worksheet)
|
|
190
|
-
return !1;
|
|
191
|
-
if (worksheet.getSheetId() === subUnitId)
|
|
192
|
-
return worksheet;
|
|
193
|
-
const targetSheet = workbook.getSheetBySheetId(subUnitId);
|
|
194
|
-
return targetSheet ? workbook.getHiddenWorksheets().indexOf(subUnitId) > -1 ? (this._messageService.show({
|
|
195
|
-
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
196
|
-
type: MessageType.Error
|
|
197
|
-
}), !1) : await this._commandService.executeCommand(SetWorksheetActiveOperation.id, { unitId, subUnitId }) ? targetSheet : !1 : (this._messageService.show({
|
|
198
|
-
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
199
|
-
type: MessageType.Error
|
|
200
|
-
}), !1);
|
|
201
|
-
}
|
|
202
|
-
async navigateToDefineName(unitId, rangeid) {
|
|
203
|
-
return this._definedNamesService.focusRange(unitId, rangeid), !0;
|
|
204
|
-
}
|
|
205
|
-
async navigateToOtherWebsite(url) {
|
|
206
|
-
var _a15;
|
|
207
|
-
const config = this._configService.getConfig(PLUGIN_CONFIG_KEY);
|
|
208
|
-
if ((_a15 = config == null ? void 0 : config.urlHandler) != null && _a15.navigateToOtherWebsite)
|
|
209
|
-
return config.urlHandler.navigateToOtherWebsite(url);
|
|
210
|
-
window.open(url, "_blank", "noopener noreferrer");
|
|
211
|
-
}
|
|
212
|
-
}, __name(_a, "SheetsHyperLinkResolverService"), _a);
|
|
213
|
-
SheetsHyperLinkResolverService = __decorateClass$c([
|
|
214
|
-
__decorateParam$c(0, IUniverInstanceService),
|
|
215
|
-
__decorateParam$c(1, ICommandService),
|
|
216
|
-
__decorateParam$c(2, IDefinedNamesService),
|
|
217
|
-
__decorateParam$c(3, IMessageService),
|
|
218
|
-
__decorateParam$c(4, Inject(LocaleService)),
|
|
219
|
-
__decorateParam$c(5, IConfigService)
|
|
220
|
-
], SheetsHyperLinkResolverService);
|
|
221
|
-
var __defProp$b = Object.defineProperty, __getOwnPropDesc$b = Object.getOwnPropertyDescriptor, __decorateClass$b = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
222
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
223
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
224
|
-
return kind && result && __defProp$b(target, key, result), result;
|
|
225
|
-
}, "__decorateClass$b"), __decorateParam$b = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$b"), _a2;
|
|
226
|
-
let SheetsHyperLinkCopyPasteController = (_a2 = class extends Disposable {
|
|
227
|
-
constructor(_sheetClipboardService, _hyperLinkModel, _injector, _resolverService) {
|
|
228
|
-
super();
|
|
229
|
-
__publicField(this, "_plainTextFilter", /* @__PURE__ */ new Set());
|
|
230
|
-
__publicField(this, "_copyInfo");
|
|
231
|
-
this._sheetClipboardService = _sheetClipboardService, this._hyperLinkModel = _hyperLinkModel, this._injector = _injector, this._resolverService = _resolverService, this._initCopyPaste(), this.disposeWithMe(() => {
|
|
232
|
-
this._plainTextFilter.clear();
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
registerPlainTextFilter(filter) {
|
|
236
|
-
this._plainTextFilter.add(filter);
|
|
237
|
-
}
|
|
238
|
-
removePlainTextFilter(filter) {
|
|
239
|
-
this._plainTextFilter.delete(filter);
|
|
240
|
-
}
|
|
241
|
-
/* If return false the process of paste text will be stop */
|
|
242
|
-
_filterPlainText(text) {
|
|
243
|
-
return Array.from(this._plainTextFilter).every((filter) => filter(text));
|
|
244
|
-
}
|
|
245
|
-
_initCopyPaste() {
|
|
246
|
-
this._sheetClipboardService.addClipboardHook({
|
|
247
|
-
id: SHEET_HYPER_LINK_UI_PLUGIN,
|
|
248
|
-
onBeforeCopy: /* @__PURE__ */ __name((unitId, subUnitId, range) => this._collect(unitId, subUnitId, range), "onBeforeCopy"),
|
|
249
|
-
onPasteCells: /* @__PURE__ */ __name((pasteFrom, pasteTo, data, payload) => {
|
|
250
|
-
const { copyType = COPY_TYPE.COPY, pasteType } = payload, { range: copyRange } = pasteFrom || {}, { range: pastedRange, unitId, subUnitId } = pasteTo;
|
|
251
|
-
return this._generateMutations(pastedRange, { copyType, pasteType, copyRange, unitId, subUnitId });
|
|
252
|
-
}, "onPasteCells"),
|
|
253
|
-
onPastePlainText: /* @__PURE__ */ __name((pasteTo, clipText) => {
|
|
254
|
-
const filterResult = this._filterPlainText(clipText);
|
|
255
|
-
if (isLegalLink(clipText) && filterResult) {
|
|
256
|
-
const { range, unitId, subUnitId } = pasteTo, { ranges: [pasteToRange], mapFunc } = virtualizeDiscreteRanges([range]), redos = [], undos = [];
|
|
257
|
-
return Range.foreach(pasteToRange, (originRow, originCol) => {
|
|
258
|
-
const { row, col: column } = mapFunc(originRow, originCol), link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, column);
|
|
259
|
-
link && redos.push({
|
|
260
|
-
id: RemoveHyperLinkMutation.id,
|
|
261
|
-
params: {
|
|
262
|
-
unitId,
|
|
263
|
-
subUnitId,
|
|
264
|
-
id: link.id
|
|
265
|
-
}
|
|
266
|
-
}), link && undos.push({
|
|
267
|
-
id: AddHyperLinkMutation.id,
|
|
268
|
-
params: {
|
|
269
|
-
unitId,
|
|
270
|
-
subUnitId,
|
|
271
|
-
link
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}), { redos, undos };
|
|
275
|
-
}
|
|
276
|
-
return { undos: [], redos: [] };
|
|
277
|
-
}, "onPastePlainText"),
|
|
278
|
-
priority: 99
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
_collect(unitId, subUnitId, range) {
|
|
282
|
-
const matrix = new ObjectMatrix();
|
|
283
|
-
this._copyInfo = {
|
|
284
|
-
unitId,
|
|
285
|
-
subUnitId,
|
|
286
|
-
matrix
|
|
287
|
-
};
|
|
288
|
-
const discreteRange = this._injector.invoke((accessor) => rangeToDiscreteRange(range, accessor, unitId, subUnitId));
|
|
289
|
-
if (!discreteRange)
|
|
290
|
-
return;
|
|
291
|
-
const { rows, cols } = discreteRange;
|
|
292
|
-
rows.forEach((row, rowIndex) => {
|
|
293
|
-
cols.forEach((col, colIndex) => {
|
|
294
|
-
var _a15;
|
|
295
|
-
const link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, col);
|
|
296
|
-
matrix.setValue(rowIndex, colIndex, (_a15 = link == null ? void 0 : link.id) != null ? _a15 : "");
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
// eslint-disable-next-line max-lines-per-function
|
|
301
|
-
_generateMutations(pastedRange, copyInfo) {
|
|
302
|
-
if (!this._copyInfo)
|
|
303
|
-
return { redos: [], undos: [] };
|
|
304
|
-
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !copyInfo.copyRange)
|
|
305
|
-
return { redos: [], undos: [] };
|
|
306
|
-
if ([
|
|
307
|
-
PREDEFINED_HOOK_NAME.SPECIAL_PASTE_COL_WIDTH,
|
|
308
|
-
PREDEFINED_HOOK_NAME.SPECIAL_PASTE_VALUE,
|
|
309
|
-
PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,
|
|
310
|
-
PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMULA
|
|
311
|
-
].includes(
|
|
312
|
-
copyInfo.pasteType
|
|
313
|
-
))
|
|
314
|
-
return { redos: [], undos: [] };
|
|
315
|
-
const { unitId, subUnitId } = this._copyInfo, redos = [], undos = [], { ranges: [vCopyRange, vPastedRange], mapFunc } = virtualizeDiscreteRanges([copyInfo.copyRange, pastedRange]);
|
|
316
|
-
return getRepeatRange(vCopyRange, vPastedRange, !0).forEach(({ startRange }) => {
|
|
317
|
-
var _a15;
|
|
318
|
-
(_a15 = this._copyInfo) == null || _a15.matrix.forValue((row, col, ruleId) => {
|
|
319
|
-
const range = Rectangle.getPositionRange(
|
|
320
|
-
{
|
|
321
|
-
startRow: row,
|
|
322
|
-
endRow: row,
|
|
323
|
-
startColumn: col,
|
|
324
|
-
endColumn: col
|
|
325
|
-
},
|
|
326
|
-
startRange
|
|
327
|
-
), oldLink = this._hyperLinkModel.getHyperLink(unitId, subUnitId, ruleId), { row: startRow, col: startColumn } = mapFunc(range.startRow, range.startColumn), currentLink = this._hyperLinkModel.getHyperLinkByLocation(copyInfo.unitId, copyInfo.subUnitId, startRow, startColumn), id = Tools.generateRandomId();
|
|
328
|
-
currentLink && redos.push({
|
|
329
|
-
id: RemoveHyperLinkMutation.id,
|
|
330
|
-
params: {
|
|
331
|
-
unitId: copyInfo.unitId,
|
|
332
|
-
subUnitId: copyInfo.subUnitId,
|
|
333
|
-
id: currentLink.id
|
|
334
|
-
}
|
|
335
|
-
}), oldLink && (redos.push({
|
|
336
|
-
id: AddHyperLinkMutation.id,
|
|
337
|
-
params: {
|
|
338
|
-
unitId: copyInfo.unitId,
|
|
339
|
-
subUnitId: copyInfo.subUnitId,
|
|
340
|
-
link: {
|
|
341
|
-
...oldLink,
|
|
342
|
-
id,
|
|
343
|
-
row: startRow,
|
|
344
|
-
column: startColumn
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}), undos.push({
|
|
348
|
-
id: RemoveHyperLinkMutation.id,
|
|
349
|
-
params: {
|
|
350
|
-
unitId: copyInfo.unitId,
|
|
351
|
-
subUnitId: copyInfo.subUnitId,
|
|
352
|
-
id
|
|
353
|
-
}
|
|
354
|
-
})), currentLink && undos.push({
|
|
355
|
-
id: AddHyperLinkMutation.id,
|
|
356
|
-
params: {
|
|
357
|
-
unitId: copyInfo.unitId,
|
|
358
|
-
subUnitId: copyInfo.subUnitId,
|
|
359
|
-
link: currentLink
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
});
|
|
363
|
-
}), { redos, undos };
|
|
364
|
-
}
|
|
365
|
-
}, __name(_a2, "SheetsHyperLinkCopyPasteController"), _a2);
|
|
366
|
-
SheetsHyperLinkCopyPasteController = __decorateClass$b([
|
|
367
|
-
OnLifecycle(LifecycleStages.Ready, SheetsHyperLinkCopyPasteController),
|
|
368
|
-
__decorateParam$b(0, ISheetClipboardService),
|
|
369
|
-
__decorateParam$b(1, Inject(HyperLinkModel)),
|
|
370
|
-
__decorateParam$b(2, Inject(Injector)),
|
|
371
|
-
__decorateParam$b(3, Inject(SheetsHyperLinkResolverService))
|
|
372
|
-
], SheetsHyperLinkCopyPasteController);
|
|
373
|
-
var HyperLinkEditSourceType = /* @__PURE__ */ ((HyperLinkEditSourceType2) => (HyperLinkEditSourceType2.EDITING = "editing", HyperLinkEditSourceType2.VIEWING = "viewing", HyperLinkEditSourceType2.ZEN_EDITOR = "zen_mode", HyperLinkEditSourceType2))(HyperLinkEditSourceType || {}), jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
374
|
-
/**
|
|
375
|
-
* @license React
|
|
376
|
-
* react-jsx-runtime.production.min.js
|
|
377
|
-
*
|
|
378
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the MIT license found in the
|
|
381
|
-
* LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/
|
|
383
|
-
var f = require$$0, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
384
|
-
function q(c, a, g) {
|
|
385
|
-
var b, d = {}, e = null, h = null;
|
|
386
|
-
g !== void 0 && (e = "" + g), a.key !== void 0 && (e = "" + a.key), a.ref !== void 0 && (h = a.ref);
|
|
387
|
-
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
388
|
-
if (c && c.defaultProps) for (b in a = c.defaultProps, a) d[b] === void 0 && (d[b] = a[b]);
|
|
389
|
-
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
390
|
-
}
|
|
391
|
-
__name(q, "q");
|
|
392
|
-
reactJsxRuntime_production_min.Fragment = l;
|
|
393
|
-
reactJsxRuntime_production_min.jsx = q;
|
|
394
|
-
reactJsxRuntime_production_min.jsxs = q;
|
|
395
|
-
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
396
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
397
|
-
const AddHyperLinkCommand = {
|
|
398
|
-
type: CommandType.COMMAND,
|
|
399
|
-
id: "sheets.command.add-hyper-link",
|
|
400
|
-
// eslint-disable-next-line max-lines-per-function
|
|
401
|
-
async handler(accessor, params) {
|
|
402
|
-
var _a15;
|
|
403
|
-
if (!params)
|
|
404
|
-
return !1;
|
|
405
|
-
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), { unitId, subUnitId, link } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
406
|
-
if (!currentRender || !workbook)
|
|
407
|
-
return !1;
|
|
408
|
-
const worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId), skeleton = (_a15 = currentRender.with(SheetSkeletonManagerService).getCurrent()) == null ? void 0 : _a15.skeleton;
|
|
409
|
-
if (!worksheet || !skeleton)
|
|
410
|
-
return !1;
|
|
411
|
-
const { payload, display, row, column, id } = link, cellData = worksheet.getCell(row, column), doc = skeleton.getBlankCellDocumentModel(cellData), snapshot = doc.documentModel.getSnapshot(), body = Tools.deepClone(snapshot.body);
|
|
412
|
-
if (!body)
|
|
413
|
-
return !1;
|
|
414
|
-
let textX;
|
|
415
|
-
if (display ? textX = BuildTextUtils.selection.replace({
|
|
416
|
-
selection: {
|
|
417
|
-
startOffset: 0,
|
|
418
|
-
endOffset: body.dataStream.length - 2,
|
|
419
|
-
collapsed: !0
|
|
420
|
-
},
|
|
421
|
-
body: {
|
|
422
|
-
dataStream: `${DataStreamTreeTokenType.CUSTOM_RANGE_START}${display}${DataStreamTreeTokenType.CUSTOM_RANGE_END}`,
|
|
423
|
-
customRanges: [{
|
|
424
|
-
startIndex: 0,
|
|
425
|
-
endIndex: display.length + 1,
|
|
426
|
-
rangeType: CustomRangeType.HYPERLINK,
|
|
427
|
-
rangeId: id,
|
|
428
|
-
properties: {
|
|
429
|
-
url: payload
|
|
430
|
-
// refId: id,
|
|
431
|
-
}
|
|
432
|
-
}]
|
|
433
|
-
},
|
|
434
|
-
doc: doc.documentModel
|
|
435
|
-
}) : textX = BuildTextUtils.customRange.add({
|
|
436
|
-
body,
|
|
437
|
-
range: { startOffset: 0, endOffset: body.dataStream.length - 2, collapsed: !1 },
|
|
438
|
-
rangeId: id,
|
|
439
|
-
rangeType: CustomRangeType.HYPERLINK,
|
|
440
|
-
properties: {
|
|
441
|
-
url: payload,
|
|
442
|
-
refId: id
|
|
443
|
-
}
|
|
444
|
-
}), !textX)
|
|
445
|
-
return !1;
|
|
446
|
-
const newBody = TextX.apply(body, textX.serialize()), rangeValue = {
|
|
447
|
-
...snapshot,
|
|
448
|
-
body: newBody
|
|
449
|
-
}, redoParams = {
|
|
450
|
-
unitId,
|
|
451
|
-
subUnitId,
|
|
452
|
-
cellValue: {
|
|
453
|
-
[link.row]: {
|
|
454
|
-
[link.column]: {
|
|
455
|
-
p: rangeValue,
|
|
456
|
-
t: CellValueType.STRING
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}, redo = {
|
|
461
|
-
id: SetRangeValuesMutation.id,
|
|
462
|
-
params: redoParams
|
|
463
|
-
}, undoParams = SetRangeValuesUndoMutationFactory(accessor, redoParams), undo = {
|
|
464
|
-
id: SetRangeValuesMutation.id,
|
|
465
|
-
params: undoParams
|
|
466
|
-
}, redos = [redo], undos = [undo], modelLink = hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, column);
|
|
467
|
-
return modelLink && (redos.push({
|
|
468
|
-
id: RemoveHyperLinkMutation.id,
|
|
469
|
-
params: {
|
|
470
|
-
unitId,
|
|
471
|
-
subUnitId,
|
|
472
|
-
id: modelLink.id
|
|
473
|
-
}
|
|
474
|
-
}), undos.push({
|
|
475
|
-
id: AddHyperLinkMutation.id,
|
|
476
|
-
params: {
|
|
477
|
-
unitId,
|
|
478
|
-
subUnitId,
|
|
479
|
-
link: modelLink
|
|
480
|
-
}
|
|
481
|
-
})), await sequenceExecuteAsync(redos, commandService) ? (undoRedoService.pushUndoRedo({
|
|
482
|
-
redoMutations: redos,
|
|
483
|
-
undoMutations: undos,
|
|
484
|
-
unitID: unitId
|
|
485
|
-
}), !0) : !1;
|
|
486
|
-
}
|
|
487
|
-
}, AddRichHyperLinkCommand = {
|
|
488
|
-
id: "sheets.command.add-rich-hyper-link",
|
|
489
|
-
type: CommandType.COMMAND,
|
|
490
|
-
handler: /* @__PURE__ */ __name(async (accessor, params) => {
|
|
491
|
-
if (!params)
|
|
492
|
-
return !1;
|
|
493
|
-
const { documentId, link } = params, commandService = accessor.get(ICommandService), textSelectionService = accessor.get(DocSelectionManagerService), newId = generateRandomId(), { payload } = link;
|
|
494
|
-
if (!textSelectionService.getActiveTextRange())
|
|
495
|
-
return !1;
|
|
496
|
-
const replaceSelection = addCustomRangeBySelectionFactory(accessor, {
|
|
497
|
-
unitId: documentId,
|
|
498
|
-
rangeId: newId,
|
|
499
|
-
rangeType: CustomRangeType.HYPERLINK,
|
|
500
|
-
properties: {
|
|
501
|
-
url: payload,
|
|
502
|
-
refId: newId
|
|
503
|
-
}
|
|
504
|
-
});
|
|
505
|
-
return replaceSelection ? commandService.syncExecuteCommand(replaceSelection.id, replaceSelection.params) : !1;
|
|
506
|
-
}, "handler")
|
|
507
|
-
}, UpdateHyperLinkCommand = {
|
|
508
|
-
type: CommandType.COMMAND,
|
|
509
|
-
id: "sheets.command.update-hyper-link",
|
|
510
|
-
// eslint-disable-next-line max-lines-per-function, complexity
|
|
511
|
-
async handler(accessor, params) {
|
|
512
|
-
var _a15, _b, _c, _d;
|
|
513
|
-
if (!params)
|
|
514
|
-
return !1;
|
|
515
|
-
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), { unitId, subUnitId, payload: link, row, column, id } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
516
|
-
if (!currentRender || !workbook)
|
|
517
|
-
return !1;
|
|
518
|
-
const worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId), skeleton = (_a15 = currentRender.with(SheetSkeletonManagerService).getCurrent()) == null ? void 0 : _a15.skeleton;
|
|
519
|
-
if (!worksheet || !skeleton)
|
|
520
|
-
return !1;
|
|
521
|
-
const { payload, display = "" } = link, cellData = worksheet.getCell(row, column);
|
|
522
|
-
if (!cellData)
|
|
523
|
-
return !1;
|
|
524
|
-
const doc = skeleton.getCellDocumentModelWithFormula(cellData);
|
|
525
|
-
if (!(doc != null && doc.documentModel))
|
|
526
|
-
return !1;
|
|
527
|
-
const snapshot = doc.documentModel.getSnapshot(), range = (_c = (_b = snapshot.body) == null ? void 0 : _b.customRanges) == null ? void 0 : _c.find((range2) => range2.rangeId === id);
|
|
528
|
-
if (!range)
|
|
529
|
-
return !1;
|
|
530
|
-
const newId = generateRandomId(), textRun = (_d = getBodySlice(doc.documentModel.getBody(), range.startIndex, range.endIndex + 1).textRuns) == null ? void 0 : _d[0];
|
|
531
|
-
textRun && (textRun.ed = display.length + 1);
|
|
532
|
-
const replaceSelection = replaceSelectionFactory(accessor, {
|
|
533
|
-
unitId,
|
|
534
|
-
body: {
|
|
535
|
-
dataStream: `${DataStreamTreeTokenType.CUSTOM_RANGE_START}${display}${DataStreamTreeTokenType.CUSTOM_RANGE_END}`,
|
|
536
|
-
customRanges: [{
|
|
537
|
-
rangeId: newId,
|
|
538
|
-
rangeType: CustomRangeType.HYPERLINK,
|
|
539
|
-
startIndex: 0,
|
|
540
|
-
endIndex: display.length + 1,
|
|
541
|
-
properties: {
|
|
542
|
-
url: payload
|
|
543
|
-
}
|
|
544
|
-
}],
|
|
545
|
-
textRuns: textRun ? [textRun] : void 0
|
|
546
|
-
},
|
|
547
|
-
selection: {
|
|
548
|
-
startOffset: range.startIndex,
|
|
549
|
-
endOffset: range.endIndex + 1,
|
|
550
|
-
collapsed: !1
|
|
551
|
-
},
|
|
552
|
-
doc: doc.documentModel
|
|
553
|
-
});
|
|
554
|
-
if (!replaceSelection)
|
|
555
|
-
return !1;
|
|
556
|
-
const newBody = TextX.apply(Tools.deepClone(snapshot.body), replaceSelection.textX.serialize()), redo = {
|
|
557
|
-
id: SetRangeValuesMutation.id,
|
|
558
|
-
params: {
|
|
559
|
-
unitId,
|
|
560
|
-
subUnitId,
|
|
561
|
-
cellValue: {
|
|
562
|
-
[row]: {
|
|
563
|
-
[column]: {
|
|
564
|
-
p: {
|
|
565
|
-
...snapshot,
|
|
566
|
-
body: newBody
|
|
567
|
-
},
|
|
568
|
-
t: CellValueType.STRING
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}, undoParams = SetRangeValuesUndoMutationFactory(accessor, redo.params), undo = {
|
|
574
|
-
id: SetRangeValuesMutation.id,
|
|
575
|
-
params: undoParams
|
|
576
|
-
}, redos = [redo], undos = [undo], modelLink = hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, column);
|
|
577
|
-
return modelLink && (redos.push({
|
|
578
|
-
id: RemoveHyperLinkMutation.id,
|
|
579
|
-
params: {
|
|
580
|
-
unitId,
|
|
581
|
-
subUnitId,
|
|
582
|
-
id: modelLink.id
|
|
583
|
-
}
|
|
584
|
-
}), undos.push({
|
|
585
|
-
id: AddHyperLinkMutation.id,
|
|
586
|
-
params: {
|
|
587
|
-
unitId,
|
|
588
|
-
subUnitId,
|
|
589
|
-
link: modelLink
|
|
590
|
-
}
|
|
591
|
-
})), await sequenceExecuteAsync(redos, commandService) ? (undoRedoService.pushUndoRedo({
|
|
592
|
-
redoMutations: redos,
|
|
593
|
-
undoMutations: undos,
|
|
594
|
-
unitID: unitId
|
|
595
|
-
}), !0) : !1;
|
|
596
|
-
}
|
|
597
|
-
}, UpdateRichHyperLinkCommand = {
|
|
598
|
-
type: CommandType.COMMAND,
|
|
599
|
-
id: "sheets.command.update-rich-hyper-link",
|
|
600
|
-
handler: /* @__PURE__ */ __name((accessor, params) => {
|
|
601
|
-
var _a15, _b, _c, _d;
|
|
602
|
-
if (!params)
|
|
603
|
-
return !1;
|
|
604
|
-
const { documentId: unitId, payload, id: rangeId } = params, univerInstanceService = accessor.get(IUniverInstanceService), commandService = accessor.get(ICommandService), doc = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
|
|
605
|
-
if (!doc)
|
|
606
|
-
return !1;
|
|
607
|
-
const range = (_b = (_a15 = doc.getBody()) == null ? void 0 : _a15.customRanges) == null ? void 0 : _b.find((range2) => range2.rangeId === rangeId);
|
|
608
|
-
if (!range)
|
|
609
|
-
return !1;
|
|
610
|
-
const display = (_c = params.payload.display) != null ? _c : "", newId = generateRandomId(), textRun = (_d = getBodySlice(doc.getBody(), range.startIndex, range.endIndex + 1).textRuns) == null ? void 0 : _d[0];
|
|
611
|
-
textRun && (textRun.ed = display.length + 1);
|
|
612
|
-
const replaceSelection = replaceSelectionFactory(accessor, {
|
|
613
|
-
unitId,
|
|
614
|
-
body: {
|
|
615
|
-
dataStream: `${DataStreamTreeTokenType.CUSTOM_RANGE_START}${display}${DataStreamTreeTokenType.CUSTOM_RANGE_END}`,
|
|
616
|
-
customRanges: [{
|
|
617
|
-
rangeId: newId,
|
|
618
|
-
rangeType: CustomRangeType.HYPERLINK,
|
|
619
|
-
startIndex: 0,
|
|
620
|
-
endIndex: display.length + 1,
|
|
621
|
-
properties: {
|
|
622
|
-
url: payload.payload
|
|
623
|
-
}
|
|
624
|
-
}],
|
|
625
|
-
textRuns: textRun ? [textRun] : void 0
|
|
626
|
-
},
|
|
627
|
-
selection: {
|
|
628
|
-
startOffset: range.startIndex,
|
|
629
|
-
endOffset: range.endIndex + 1,
|
|
630
|
-
collapsed: !1
|
|
631
|
-
},
|
|
632
|
-
doc
|
|
633
|
-
});
|
|
634
|
-
return replaceSelection ? commandService.syncExecuteCommand(replaceSelection.id, replaceSelection.params) : !1;
|
|
635
|
-
}, "handler")
|
|
636
|
-
}, _SheetsHyperLinkSidePanelService = class _SheetsHyperLinkSidePanelService extends Disposable {
|
|
637
|
-
constructor() {
|
|
638
|
-
super(...arguments);
|
|
639
|
-
__publicField(this, "_customHyperLinks", /* @__PURE__ */ new Map());
|
|
640
|
-
}
|
|
641
|
-
isBuiltInLinkType(type) {
|
|
642
|
-
return type !== SheetHyperLinkType.URL;
|
|
643
|
-
}
|
|
644
|
-
getOptions() {
|
|
645
|
-
return Array.from(this._customHyperLinks.values()).map(({ option }) => option);
|
|
646
|
-
}
|
|
647
|
-
findCustomHyperLink(link) {
|
|
648
|
-
return Array.from(this._customHyperLinks.values()).find((item) => item.match(link));
|
|
649
|
-
}
|
|
650
|
-
registerCustomHyperLink(customHyperLink) {
|
|
651
|
-
this._customHyperLinks.set(customHyperLink.type, customHyperLink);
|
|
652
|
-
}
|
|
653
|
-
getCustomHyperLink(type) {
|
|
654
|
-
return this._customHyperLinks.get(type);
|
|
655
|
-
}
|
|
656
|
-
removeCustomHyperLink(type) {
|
|
657
|
-
const { _customHyperLinks } = this;
|
|
658
|
-
_customHyperLinks.delete(type);
|
|
659
|
-
}
|
|
660
|
-
dispose() {
|
|
661
|
-
super.dispose(), this._customHyperLinks.clear();
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
__name(_SheetsHyperLinkSidePanelService, "SheetsHyperLinkSidePanelService");
|
|
665
|
-
let SheetsHyperLinkSidePanelService = _SheetsHyperLinkSidePanelService;
|
|
666
|
-
const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell-link-edit-buttons", styles$1 = {
|
|
667
|
-
cellLinkEdit,
|
|
668
|
-
cellLinkEditButtons
|
|
669
|
-
}, CellLinkEdit = /* @__PURE__ */ __name(() => {
|
|
670
|
-
var _a15;
|
|
671
|
-
const [id, setId] = useState(""), [hide, setHide] = useState(!1), [display, setDisplay] = useState(""), [showLabel, setShowLabel] = useState(!0), [type, setType] = useState(SheetHyperLinkType.URL), [payload, setPayload] = useState(""), localeService = useDependency(LocaleService), definedNameService = useDependency(IDefinedNamesService), editorBridgeService = useDependency(IEditorBridgeService), univerInstanceService = useDependency(IUniverInstanceService), popupService = useDependency(SheetsHyperLinkPopupService), editing = useObservable(popupService.currentEditing$), resolverService = useDependency(SheetsHyperLinkResolverService), commandService = useDependency(ICommandService), sidePanelService = useDependency(SheetsHyperLinkSidePanelService), sidePanelOptions = useMemo(() => sidePanelService.getOptions(), [sidePanelService]), zenZoneService = useDependency(IZenZoneService), renderManagerService = useDependency(IRenderManagerService), markSelectionService = useDependency(IMarkSelectionService), textSelectionService = useDependency(DocSelectionManagerService), contextService = useDependency(IContextService), customHyperLinkSidePanel = useMemo(() => {
|
|
672
|
-
if (!sidePanelService.isBuiltInLinkType(type))
|
|
673
|
-
return sidePanelService.getCustomHyperLink(type);
|
|
674
|
-
}, [sidePanelService, type]), [showError, setShowError] = useState(!1), setByPayload = useRef(!1);
|
|
675
|
-
useEffect(() => {
|
|
676
|
-
var _a16, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
677
|
-
if ((editing == null ? void 0 : editing.row) !== void 0 && editing.col !== void 0) {
|
|
678
|
-
const { label, customRange, row, col } = editing;
|
|
679
|
-
let link;
|
|
680
|
-
if (customRange)
|
|
681
|
-
link = {
|
|
682
|
-
id: (_a16 = customRange == null ? void 0 : customRange.rangeId) != null ? _a16 : "",
|
|
683
|
-
display: label != null ? label : "",
|
|
684
|
-
payload: (_c = (_b = customRange == null ? void 0 : customRange.properties) == null ? void 0 : _b.url) != null ? _c : "",
|
|
685
|
-
row,
|
|
686
|
-
column: col
|
|
687
|
-
};
|
|
688
|
-
else if (editing.type === HyperLinkEditSourceType.VIEWING) {
|
|
689
|
-
const workbook2 = univerInstanceService.getUnit(editing.unitId), worksheet = workbook2 == null ? void 0 : workbook2.getSheetBySheetId(editing.subUnitId), cell = worksheet == null ? void 0 : worksheet.getCellRaw(editing.row, editing.col), range = (_f = (_e = (_d = cell == null ? void 0 : cell.p) == null ? void 0 : _d.body) == null ? void 0 : _e.customRanges) == null ? void 0 : _f.find((range2) => {
|
|
690
|
-
var _a17;
|
|
691
|
-
return range2.rangeType === CustomRangeType.HYPERLINK && ((_a17 = range2.properties) == null ? void 0 : _a17.url);
|
|
692
|
-
}), cellValue = `${(_g = getOriginCellValue(cell)) != null ? _g : ""}`;
|
|
693
|
-
cell && (cell.p || cellValue) && setShowLabel(!1), link = {
|
|
694
|
-
id: "",
|
|
695
|
-
display: "",
|
|
696
|
-
payload: (_i = (_h = range == null ? void 0 : range.properties) == null ? void 0 : _h.url) != null ? _i : "",
|
|
697
|
-
row,
|
|
698
|
-
column: col
|
|
699
|
-
};
|
|
700
|
-
} else {
|
|
701
|
-
const doc = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_DOC), selection = textSelectionService.getActiveTextRange(), customRange2 = selection && ((_l = BuildTextUtils.customRange.getCustomRangesInterestsWithRange(selection, (_k = (_j = doc == null ? void 0 : doc.getBody()) == null ? void 0 : _j.customRanges) != null ? _k : [])) == null ? void 0 : _l[0]);
|
|
702
|
-
setShowLabel(!1), link = {
|
|
703
|
-
id: "",
|
|
704
|
-
display: label != null ? label : "",
|
|
705
|
-
payload: (_n = (_m = customRange2 == null ? void 0 : customRange2.properties) == null ? void 0 : _m.url) != null ? _n : "",
|
|
706
|
-
row,
|
|
707
|
-
column: col
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
setId(link.id);
|
|
711
|
-
const customLink = sidePanelService.findCustomHyperLink(link);
|
|
712
|
-
if (customLink) {
|
|
713
|
-
const customLinkInfo = customLink.convert(link);
|
|
714
|
-
setType(customLinkInfo.type), setPayload(customLinkInfo.payload), setDisplay(customLinkInfo.display);
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
setDisplay(link.display);
|
|
718
|
-
const linkInfo = resolverService.parseHyperLink(link.payload);
|
|
719
|
-
switch (setType(linkInfo.type === SheetHyperLinkType.INVALID ? SheetHyperLinkType.RANGE : linkInfo.type), linkInfo.type) {
|
|
720
|
-
case SheetHyperLinkType.URL: {
|
|
721
|
-
setPayload(linkInfo.url), linkInfo.url === link.display && (setByPayload.current = !0);
|
|
722
|
-
break;
|
|
723
|
-
}
|
|
724
|
-
case SheetHyperLinkType.RANGE: {
|
|
725
|
-
const params = linkInfo.searchObj, sheetName = params.gid && (_q = (_p = (_o = univerInstanceService.getUnit(editing.unitId)) == null ? void 0 : _o.getSheetBySheetId(params.gid)) == null ? void 0 : _p.getName()) != null ? _q : "", payload2 = serializeRangeWithSheet(sheetName, deserializeRangeWithSheet(params.range).range);
|
|
726
|
-
setPayload(payload2), payload2 === link.display && (setByPayload.current = !0);
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
case SheetHyperLinkType.SHEET: {
|
|
730
|
-
const params = linkInfo.searchObj;
|
|
731
|
-
setPayload(params.gid);
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
case SheetHyperLinkType.DEFINE_NAME: {
|
|
735
|
-
const params = linkInfo.searchObj;
|
|
736
|
-
setPayload(params.rangeid);
|
|
737
|
-
break;
|
|
738
|
-
}
|
|
739
|
-
default:
|
|
740
|
-
setPayload("");
|
|
741
|
-
break;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}, [editing, resolverService, sidePanelService, textSelectionService, univerInstanceService]), useEffect(() => {
|
|
745
|
-
var _a16;
|
|
746
|
-
let id2 = null;
|
|
747
|
-
if (editing && editing.type === HyperLinkEditSourceType.VIEWING && Tools.isDefine(editing.row) && Tools.isDefine(editing.col)) {
|
|
748
|
-
const worksheet = (_a16 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a16.getSheetBySheetId(editing.subUnitId), mergeInfo = worksheet == null ? void 0 : worksheet.getMergedCell(editing.row, editing.col);
|
|
749
|
-
id2 = markSelectionService.addShape(
|
|
750
|
-
{
|
|
751
|
-
range: mergeInfo != null ? mergeInfo : {
|
|
752
|
-
startColumn: editing.col,
|
|
753
|
-
endColumn: editing.col,
|
|
754
|
-
startRow: editing.row,
|
|
755
|
-
endRow: editing.row
|
|
756
|
-
},
|
|
757
|
-
style: {
|
|
758
|
-
hasAutoFill: !1,
|
|
759
|
-
fill: "rgb(255, 189, 55, 0.35)",
|
|
760
|
-
strokeWidth: 1,
|
|
761
|
-
stroke: "#FFBD37",
|
|
762
|
-
widgets: {}
|
|
763
|
-
},
|
|
764
|
-
primary: null
|
|
765
|
-
},
|
|
766
|
-
[],
|
|
767
|
-
-1
|
|
768
|
-
);
|
|
769
|
-
}
|
|
770
|
-
return () => {
|
|
771
|
-
id2 && markSelectionService.removeShape(id2);
|
|
772
|
-
};
|
|
773
|
-
}, [editing, markSelectionService]);
|
|
774
|
-
const payloadInitial = useMemo(() => payload, [type]);
|
|
775
|
-
useEffect(() => {
|
|
776
|
-
const render2 = renderManagerService.getRenderById(editorBridgeService.getCurrentEditorId()), disposeCollection = new DisposableCollection();
|
|
777
|
-
if (render2) {
|
|
778
|
-
const selectionRenderService = render2.with(DocSelectionRenderService);
|
|
779
|
-
selectionRenderService.setReserveRangesStatus(!0), disposeCollection.add(() => {
|
|
780
|
-
selectionRenderService.setReserveRangesStatus(!1);
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
return () => {
|
|
784
|
-
editorBridgeService.disableForceKeepVisible(), disposeCollection.dispose();
|
|
785
|
-
};
|
|
786
|
-
}, [editorBridgeService, renderManagerService]);
|
|
787
|
-
const linkTypeOptions = [
|
|
788
|
-
{
|
|
789
|
-
label: localeService.t("hyperLink.form.link"),
|
|
790
|
-
value: SheetHyperLinkType.URL
|
|
791
|
-
},
|
|
792
|
-
{
|
|
793
|
-
label: localeService.t("hyperLink.form.range"),
|
|
794
|
-
value: SheetHyperLinkType.RANGE
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
label: localeService.t("hyperLink.form.worksheet"),
|
|
798
|
-
value: SheetHyperLinkType.SHEET
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
label: localeService.t("hyperLink.form.definedName"),
|
|
802
|
-
value: SheetHyperLinkType.DEFINE_NAME
|
|
803
|
-
},
|
|
804
|
-
...sidePanelOptions
|
|
805
|
-
], workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
806
|
-
if (!workbook)
|
|
807
|
-
return;
|
|
808
|
-
const hiddens = workbook.getHiddenWorksheets(), sheetsOption = workbook.getSheets().map((sheet) => ({ label: sheet.getName(), value: sheet.getSheetId() })).filter((opt) => hiddens.indexOf(opt.value) === -1), definedNames = Object.values((_a15 = definedNameService.getDefinedNameMap(workbook.getUnitId())) != null ? _a15 : {}).map((value) => ({
|
|
809
|
-
label: value.name,
|
|
810
|
-
value: value.id
|
|
811
|
-
})), formatUrl = /* @__PURE__ */ __name((type2, payload2) => {
|
|
812
|
-
if (type2 === SheetHyperLinkType.URL)
|
|
813
|
-
return serializeUrl(payload2);
|
|
814
|
-
if (type2 === SheetHyperLinkType.RANGE) {
|
|
815
|
-
const info = deserializeRangeWithSheet(payload2), worksheet = workbook.getSheetBySheetName(info.sheetName);
|
|
816
|
-
if (worksheet)
|
|
817
|
-
return `#gid=${worksheet.getSheetId()}&range=${serializeRange(info.range)}`;
|
|
818
|
-
}
|
|
819
|
-
return `#${type2}=${payload2}`;
|
|
820
|
-
}, "formatUrl"), handleRangeChange = useEvent((newValue) => {
|
|
821
|
-
var _a16;
|
|
822
|
-
const range = newValue[0];
|
|
823
|
-
if (!range || !isValidRange(range.range))
|
|
824
|
-
return;
|
|
825
|
-
range.sheetName || (range.sheetName = ((_a16 = workbook.getActiveSheet()) == null ? void 0 : _a16.getName()) || "");
|
|
826
|
-
const newPayload = serializeRangeToRefString(range);
|
|
827
|
-
setPayload(newPayload), newPayload && (setByPayload.current || !display) && (setDisplay(newPayload), setByPayload.current = !0);
|
|
828
|
-
}), handleSubmit = /* @__PURE__ */ __name(async () => {
|
|
829
|
-
if (showLabel && !display || !payload || type === SheetHyperLinkType.URL && !isLegalLink(payload)) {
|
|
830
|
-
setShowError(!0);
|
|
831
|
-
return;
|
|
832
|
-
}
|
|
833
|
-
if (editing)
|
|
834
|
-
if (id) {
|
|
835
|
-
const commandId = editing.type === HyperLinkEditSourceType.ZEN_EDITOR || editing.type === HyperLinkEditSourceType.EDITING ? UpdateRichHyperLinkCommand.id : UpdateHyperLinkCommand.id;
|
|
836
|
-
await commandService.executeCommand(commandId, {
|
|
837
|
-
id,
|
|
838
|
-
unitId: editing.unitId,
|
|
839
|
-
subUnitId: editing.subUnitId,
|
|
840
|
-
payload: {
|
|
841
|
-
display: showLabel ? display : "",
|
|
842
|
-
payload: formatUrl(type, payload)
|
|
843
|
-
},
|
|
844
|
-
row: editing.row,
|
|
845
|
-
column: editing.col,
|
|
846
|
-
documentId: editing.type === HyperLinkEditSourceType.ZEN_EDITOR ? DOCS_ZEN_EDITOR_UNIT_ID_KEY : editorBridgeService.getCurrentEditorId()
|
|
847
|
-
});
|
|
848
|
-
} else {
|
|
849
|
-
const commandId = editing.type === HyperLinkEditSourceType.ZEN_EDITOR || editing.type === HyperLinkEditSourceType.EDITING ? AddRichHyperLinkCommand.id : AddHyperLinkCommand.id;
|
|
850
|
-
await commandService.executeCommand(commandId, {
|
|
851
|
-
unitId: editing.unitId,
|
|
852
|
-
subUnitId: editing.subUnitId,
|
|
853
|
-
link: {
|
|
854
|
-
id: generateRandomId(),
|
|
855
|
-
row: editing.row,
|
|
856
|
-
column: editing.col,
|
|
857
|
-
payload: formatUrl(type, payload),
|
|
858
|
-
display: showLabel ? display : ""
|
|
859
|
-
},
|
|
860
|
-
documentId: editing.type === HyperLinkEditSourceType.ZEN_EDITOR ? DOCS_ZEN_EDITOR_UNIT_ID_KEY : editorBridgeService.getCurrentEditorId()
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
if ((editing == null ? void 0 : editing.type) === HyperLinkEditSourceType.VIEWING) {
|
|
864
|
-
await commandService.executeCommand(SetWorksheetActiveOperation.id, {
|
|
865
|
-
unitId: editing.unitId,
|
|
866
|
-
subUnitId: editing.subUnitId
|
|
867
|
-
});
|
|
868
|
-
const GAP = 1;
|
|
869
|
-
await commandService.executeCommand(ScrollToRangeOperation.id, {
|
|
870
|
-
range: {
|
|
871
|
-
startRow: Math.max(editing.row - GAP, 0),
|
|
872
|
-
endRow: editing.row + GAP,
|
|
873
|
-
startColumn: Math.max(editing.col - GAP, 0),
|
|
874
|
-
endColumn: editing.col + GAP
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
|
-
commandService.executeCommand(CloseHyperLinkPopupOperation.id);
|
|
879
|
-
}, "handleSubmit");
|
|
880
|
-
return editing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.cellLinkEdit, style: { display: hide ? "none" : "block" }, children: [
|
|
881
|
-
showLabel ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
882
|
-
FormLayout,
|
|
883
|
-
{
|
|
884
|
-
label: localeService.t("hyperLink.form.label"),
|
|
885
|
-
error: showError && !display ? localeService.t("hyperLink.form.inputError") : "",
|
|
886
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
887
|
-
Input,
|
|
888
|
-
{
|
|
889
|
-
value: display,
|
|
890
|
-
onChange: /* @__PURE__ */ __name((v) => {
|
|
891
|
-
setDisplay(v), setByPayload.current = !1;
|
|
892
|
-
}, "onChange"),
|
|
893
|
-
placeholder: localeService.t("hyperLink.form.labelPlaceholder"),
|
|
894
|
-
autoFocus: !0,
|
|
895
|
-
onKeyDown: /* @__PURE__ */ __name((e) => {
|
|
896
|
-
e.keyCode === KeyCode.ENTER && handleSubmit();
|
|
897
|
-
}, "onKeyDown")
|
|
898
|
-
}
|
|
899
|
-
)
|
|
900
|
-
}
|
|
901
|
-
) : null,
|
|
902
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { label: localeService.t("hyperLink.form.type"), contentStyle: { marginBottom: 0 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
903
|
-
Select,
|
|
904
|
-
{
|
|
905
|
-
options: linkTypeOptions,
|
|
906
|
-
value: type,
|
|
907
|
-
onChange: /* @__PURE__ */ __name((newType) => {
|
|
908
|
-
setType(newType), setPayload("");
|
|
909
|
-
}, "onChange")
|
|
910
|
-
}
|
|
911
|
-
) }),
|
|
912
|
-
type === SheetHyperLinkType.URL && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
913
|
-
FormLayout,
|
|
914
|
-
{
|
|
915
|
-
error: showError ? payload ? isLegalLink(payload) ? "" : localeService.t("hyperLink.form.linkError") : localeService.t("hyperLink.form.inputError") : "",
|
|
916
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
917
|
-
Input,
|
|
918
|
-
{
|
|
919
|
-
value: payload,
|
|
920
|
-
onChange: /* @__PURE__ */ __name((newLink) => {
|
|
921
|
-
setPayload(newLink), newLink && (setByPayload.current || !display || display === payload) && (setDisplay(newLink), setByPayload.current = !0);
|
|
922
|
-
}, "onChange"),
|
|
923
|
-
placeholder: localeService.t("hyperLink.form.linkPlaceholder"),
|
|
924
|
-
autoFocus: !showLabel,
|
|
925
|
-
onKeyDown: /* @__PURE__ */ __name((e) => {
|
|
926
|
-
e.keyCode === KeyCode.ENTER && handleSubmit();
|
|
927
|
-
}, "onKeyDown")
|
|
928
|
-
}
|
|
929
|
-
)
|
|
930
|
-
}
|
|
931
|
-
),
|
|
932
|
-
type === SheetHyperLinkType.RANGE && /* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { error: showError && !payload ? localeService.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
933
|
-
RangeSelector,
|
|
934
|
-
{
|
|
935
|
-
openForSheetUnitId: workbook.getUnitId(),
|
|
936
|
-
id: createInternalEditorID("hyper-link-edit"),
|
|
937
|
-
isSingleChoice: !0,
|
|
938
|
-
value: payloadInitial,
|
|
939
|
-
onChange: handleRangeChange,
|
|
940
|
-
disableInput: editing.type === HyperLinkEditSourceType.ZEN_EDITOR,
|
|
941
|
-
onSelectorVisibleChange: /* @__PURE__ */ __name(async (visible) => {
|
|
942
|
-
visible ? (editing.type === HyperLinkEditSourceType.ZEN_EDITOR && (zenZoneService.hide(), contextService.setContextValue(FOCUSING_SHEET, !0)), editing.type !== HyperLinkEditSourceType.VIEWING && editorBridgeService.enableForceKeepVisible(), setHide(!0)) : (await resolverService.navigateToRange(editing.unitId, editing.subUnitId, { startRow: editing.row, endRow: editing.row, startColumn: editing.col, endColumn: editing.col }), editing.type === HyperLinkEditSourceType.ZEN_EDITOR && (await commandService.executeCommand(SetSelectionsOperation.id, {
|
|
943
|
-
unitId: editing.unitId,
|
|
944
|
-
subUnitId: editing.subUnitId,
|
|
945
|
-
selections: [{ range: { startRow: editing.row, endRow: editing.row, startColumn: editing.col, endColumn: editing.col } }]
|
|
946
|
-
}), zenZoneService.show(), contextService.setContextValue(FOCUSING_SHEET, !1)), editorBridgeService.disableForceKeepVisible(), setHide(!1));
|
|
947
|
-
}, "onSelectorVisibleChange")
|
|
948
|
-
}
|
|
949
|
-
) }),
|
|
950
|
-
type === SheetHyperLinkType.SHEET && /* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { error: showError && !payload ? localeService.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
951
|
-
Select,
|
|
952
|
-
{
|
|
953
|
-
options: sheetsOption,
|
|
954
|
-
value: payload,
|
|
955
|
-
onChange: /* @__PURE__ */ __name((newPayload) => {
|
|
956
|
-
var _a16, _b;
|
|
957
|
-
setPayload(newPayload);
|
|
958
|
-
const label = (_a16 = sheetsOption.find((i) => i.value === newPayload)) == null ? void 0 : _a16.label, oldLabel = (_b = sheetsOption.find((i) => i.value === payload)) == null ? void 0 : _b.label;
|
|
959
|
-
label && (setByPayload.current || !display || display === oldLabel) && (setDisplay(label), setByPayload.current = !0);
|
|
960
|
-
}, "onChange")
|
|
961
|
-
}
|
|
962
|
-
) }),
|
|
963
|
-
type === SheetHyperLinkType.DEFINE_NAME && /* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { error: showError && !payload ? localeService.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
964
|
-
Select,
|
|
965
|
-
{
|
|
966
|
-
options: definedNames,
|
|
967
|
-
value: payload,
|
|
968
|
-
onChange: /* @__PURE__ */ __name((newValue) => {
|
|
969
|
-
var _a16, _b;
|
|
970
|
-
setPayload(newValue);
|
|
971
|
-
const label = (_a16 = definedNames.find((i) => i.value === newValue)) == null ? void 0 : _a16.label, oldLabel = (_b = definedNames.find((i) => i.value === payload)) == null ? void 0 : _b.label;
|
|
972
|
-
label && (setByPayload.current || !display || display === oldLabel) && (setDisplay(label), setByPayload.current = !0);
|
|
973
|
-
}, "onChange")
|
|
974
|
-
}
|
|
975
|
-
) }),
|
|
976
|
-
(customHyperLinkSidePanel == null ? void 0 : customHyperLinkSidePanel.Form) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
977
|
-
customHyperLinkSidePanel.Form,
|
|
978
|
-
{
|
|
979
|
-
linkId: id,
|
|
980
|
-
payload,
|
|
981
|
-
display,
|
|
982
|
-
showError,
|
|
983
|
-
setByPayload,
|
|
984
|
-
setDisplay: /* @__PURE__ */ __name((newLink) => {
|
|
985
|
-
setDisplay(newLink), setByPayload.current = !0;
|
|
986
|
-
}, "setDisplay"),
|
|
987
|
-
setPayload
|
|
988
|
-
}
|
|
989
|
-
),
|
|
990
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.cellLinkEditButtons, children: [
|
|
991
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
992
|
-
Button,
|
|
993
|
-
{
|
|
994
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
995
|
-
editing && resolverService.navigateToRange(editing.unitId, editing.subUnitId, { startRow: editing.row, endRow: editing.row, startColumn: editing.col, endColumn: editing.col }), commandService.executeCommand(CloseHyperLinkPopupOperation.id);
|
|
996
|
-
}, "onClick"),
|
|
997
|
-
children: localeService.t("hyperLink.form.cancel")
|
|
998
|
-
}
|
|
999
|
-
),
|
|
1000
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1001
|
-
Button,
|
|
1002
|
-
{
|
|
1003
|
-
type: "primary",
|
|
1004
|
-
style: { marginLeft: 8 },
|
|
1005
|
-
onClick: /* @__PURE__ */ __name(async () => {
|
|
1006
|
-
handleSubmit();
|
|
1007
|
-
}, "onClick"),
|
|
1008
|
-
children: localeService.t("hyperLink.form.ok")
|
|
1009
|
-
}
|
|
1010
|
-
)
|
|
1011
|
-
] })
|
|
1012
|
-
] }) : null;
|
|
1013
|
-
}, "CellLinkEdit");
|
|
1014
|
-
CellLinkEdit.componentKey = "univer.sheet.cell-link-edit";
|
|
1015
|
-
var __assign = function() {
|
|
1016
|
-
return __assign = Object.assign || function(t) {
|
|
1017
|
-
for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
|
|
1018
|
-
s = arguments[i];
|
|
1019
|
-
for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && (t[p2] = s[p2]);
|
|
1020
|
-
}
|
|
1021
|
-
return t;
|
|
1022
|
-
}, __assign.apply(this, arguments);
|
|
1023
|
-
}, __rest = function(s, e) {
|
|
1024
|
-
var t = {};
|
|
1025
|
-
for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && e.indexOf(p2) < 0 && (t[p2] = s[p2]);
|
|
1026
|
-
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1027
|
-
for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++)
|
|
1028
|
-
e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]) && (t[p2[i]] = s[p2[i]]);
|
|
1029
|
-
return t;
|
|
1030
|
-
}, IconBase = forwardRef(function(props, ref) {
|
|
1031
|
-
var icon = props.icon, id = props.id, className = props.className, extend = props.extend, restProps = __rest(props, ["icon", "id", "className", "extend"]), cls = "univerjs-icon univerjs-icon-".concat(id, " ").concat(className || "").trim(), idSuffix = useRef("_".concat(generateShortUuid()));
|
|
1032
|
-
return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
|
|
1033
|
-
});
|
|
1034
|
-
function render(node, id, runtimeProps, rootProps, extend) {
|
|
1035
|
-
return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
|
|
1036
|
-
return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
|
|
1037
|
-
}));
|
|
1038
|
-
}
|
|
1039
|
-
__name(render, "render");
|
|
1040
|
-
function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
|
|
1041
|
-
var attrs = __assign({}, node.attrs);
|
|
1042
|
-
extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
|
|
1043
|
-
var defIds = runtimeProps.defIds;
|
|
1044
|
-
return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a15) {
|
|
1045
|
-
var key = _a15[0], value = _a15[1];
|
|
1046
|
-
typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
|
|
1047
|
-
})), attrs;
|
|
1048
|
-
}
|
|
1049
|
-
__name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
|
|
1050
|
-
function replaceRuntimeIdsInDefs(node, runtimeProps) {
|
|
1051
|
-
var _a15, defIds = runtimeProps.defIds;
|
|
1052
|
-
return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a15 = node.children) === null || _a15 === void 0) && _a15.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
|
|
1053
|
-
return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
|
|
1054
|
-
}) }) : node;
|
|
1055
|
-
}
|
|
1056
|
-
__name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
|
|
1057
|
-
function generateShortUuid() {
|
|
1058
|
-
return Math.random().toString(36).substring(2, 8);
|
|
1059
|
-
}
|
|
1060
|
-
__name(generateShortUuid, "generateShortUuid");
|
|
1061
|
-
IconBase.displayName = "UniverIcon";
|
|
1062
|
-
var element$5 = { 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" } }] }, AllBorderSingle = forwardRef(function(props, ref) {
|
|
1063
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
1064
|
-
id: "all-border-single",
|
|
1065
|
-
ref,
|
|
1066
|
-
icon: element$5
|
|
1067
|
-
}));
|
|
1068
|
-
});
|
|
1069
|
-
AllBorderSingle.displayName = "AllBorderSingle";
|
|
1070
|
-
var element$4 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, CopySingle = forwardRef(function(props, ref) {
|
|
1071
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
1072
|
-
id: "copy-single",
|
|
1073
|
-
ref,
|
|
1074
|
-
icon: element$4
|
|
1075
|
-
}));
|
|
1076
|
-
});
|
|
1077
|
-
CopySingle.displayName = "CopySingle";
|
|
1078
|
-
var element$3 = { 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" } }] }, LinkSingle = forwardRef(function(props, ref) {
|
|
1079
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
1080
|
-
id: "link-single",
|
|
1081
|
-
ref,
|
|
1082
|
-
icon: element$3
|
|
1083
|
-
}));
|
|
1084
|
-
});
|
|
1085
|
-
LinkSingle.displayName = "LinkSingle";
|
|
1086
|
-
var element$2 = { 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" } }] }, UnlinkSingle = forwardRef(function(props, ref) {
|
|
1087
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
1088
|
-
id: "unlink-single",
|
|
1089
|
-
ref,
|
|
1090
|
-
icon: element$2
|
|
1091
|
-
}));
|
|
1092
|
-
});
|
|
1093
|
-
UnlinkSingle.displayName = "UnlinkSingle";
|
|
1094
|
-
var element$1 = { 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" } }] }, WriteSingle = forwardRef(function(props, ref) {
|
|
1095
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
1096
|
-
id: "write-single",
|
|
1097
|
-
ref,
|
|
1098
|
-
icon: element$1
|
|
1099
|
-
}));
|
|
1100
|
-
});
|
|
1101
|
-
WriteSingle.displayName = "WriteSingle";
|
|
1102
|
-
var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Xlsx = forwardRef(function(props, ref) {
|
|
1103
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
1104
|
-
id: "xlsx",
|
|
1105
|
-
ref,
|
|
1106
|
-
icon: element
|
|
1107
|
-
}));
|
|
1108
|
-
});
|
|
1109
|
-
Xlsx.displayName = "Xlsx";
|
|
1110
|
-
const CancelHyperLinkCommand = {
|
|
1111
|
-
type: CommandType.COMMAND,
|
|
1112
|
-
id: "sheets.command.cancel-hyper-link",
|
|
1113
|
-
// eslint-disable-next-line max-lines-per-function
|
|
1114
|
-
handler(accessor, params) {
|
|
1115
|
-
var _a15, _b, _c;
|
|
1116
|
-
if (!params)
|
|
1117
|
-
return !1;
|
|
1118
|
-
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), { unitId, subUnitId, row, column, id } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
1119
|
-
if (!currentRender || !workbook)
|
|
1120
|
-
return !1;
|
|
1121
|
-
const worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId), skeleton = (_a15 = currentRender.with(SheetSkeletonManagerService).getCurrent()) == null ? void 0 : _a15.skeleton;
|
|
1122
|
-
if (!worksheet || !skeleton)
|
|
1123
|
-
return !1;
|
|
1124
|
-
const cellData = worksheet.getCell(row, column);
|
|
1125
|
-
if (!cellData)
|
|
1126
|
-
return !1;
|
|
1127
|
-
const doc = skeleton.getCellDocumentModelWithFormula(cellData);
|
|
1128
|
-
if (!(doc != null && doc.documentModel))
|
|
1129
|
-
return !1;
|
|
1130
|
-
const snapshot = Tools.deepClone(doc.documentModel.getSnapshot());
|
|
1131
|
-
if (!((_c = (_b = snapshot.body) == null ? void 0 : _b.customRanges) == null ? void 0 : _c.find((range2) => range2.rangeId === id)))
|
|
1132
|
-
return !1;
|
|
1133
|
-
const textX = BuildTextUtils.customRange.delete(accessor, { documentDataModel: doc.documentModel, rangeId: id });
|
|
1134
|
-
if (!textX)
|
|
1135
|
-
return !1;
|
|
1136
|
-
const newBody = TextX.apply(snapshot.body, textX.serialize()), redos = [], undos = [], setRangeParams = {
|
|
1137
|
-
unitId,
|
|
1138
|
-
subUnitId,
|
|
1139
|
-
cellValue: {
|
|
1140
|
-
[row]: {
|
|
1141
|
-
[column]: {
|
|
1142
|
-
p: {
|
|
1143
|
-
...snapshot,
|
|
1144
|
-
body: newBody
|
|
1145
|
-
},
|
|
1146
|
-
t: CellValueType.STRING
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
};
|
|
1151
|
-
redos.push({
|
|
1152
|
-
id: SetRangeValuesMutation.id,
|
|
1153
|
-
params: setRangeParams
|
|
1154
|
-
});
|
|
1155
|
-
const undoParams = SetRangeValuesUndoMutationFactory(accessor, setRangeParams);
|
|
1156
|
-
undos.push({
|
|
1157
|
-
id: SetRangeValuesMutation.id,
|
|
1158
|
-
params: undoParams
|
|
1159
|
-
});
|
|
1160
|
-
const link = hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, column);
|
|
1161
|
-
return link && (redos.push({
|
|
1162
|
-
id: RemoveHyperLinkMutation.id,
|
|
1163
|
-
params: {
|
|
1164
|
-
unitId,
|
|
1165
|
-
subUnitId,
|
|
1166
|
-
id
|
|
1167
|
-
}
|
|
1168
|
-
}), undos.push({
|
|
1169
|
-
id: AddHyperLinkMutation.id,
|
|
1170
|
-
params: {
|
|
1171
|
-
unitId,
|
|
1172
|
-
subUnitId,
|
|
1173
|
-
link: {
|
|
1174
|
-
...link
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
})), sequenceExecute(redos, commandService).result ? (undoRedoService.pushUndoRedo({
|
|
1178
|
-
redoMutations: redos,
|
|
1179
|
-
undoMutations: undos,
|
|
1180
|
-
unitID: unitId
|
|
1181
|
-
}), !0) : !1;
|
|
1182
|
-
}
|
|
1183
|
-
}, CancelRichHyperLinkCommand = {
|
|
1184
|
-
type: CommandType.COMMAND,
|
|
1185
|
-
id: "sheets.command.cancel-rich-hyper-link",
|
|
1186
|
-
handler(accessor, params) {
|
|
1187
|
-
var _a15, _b;
|
|
1188
|
-
if (!params)
|
|
1189
|
-
return !1;
|
|
1190
|
-
const { id: linkId, documentId } = params, commandService = accessor.get(ICommandService), doc = accessor.get(IUniverInstanceService).getUnit(documentId, UniverInstanceType.UNIVER_DOC), link = (_b = (_a15 = doc == null ? void 0 : doc.getBody()) == null ? void 0 : _a15.customRanges) == null ? void 0 : _b.find((i) => i.rangeId === linkId);
|
|
1191
|
-
let insert = null;
|
|
1192
|
-
link && link.endIndex === doc.getBody().dataStream.length - 3 && (insert = {
|
|
1193
|
-
dataStream: " "
|
|
1194
|
-
});
|
|
1195
|
-
const doMutation = deleteCustomRangeFactory(accessor, { unitId: documentId, rangeId: linkId, insert });
|
|
1196
|
-
return doMutation ? commandService.syncExecuteCommand(doMutation.id, doMutation.params) : !1;
|
|
1197
|
-
}
|
|
1198
|
-
}, cellLink = "univer-cell-link", cellLinkType = "univer-cell-link-type", cellLinkContent = "univer-cell-link-content", cellLinkContentError = "univer-cell-link-content-error", cellLinkUrl = "univer-cell-link-url", cellLinkOperations = "univer-cell-link-operations", cellLinkOperation = "univer-cell-link-operation", cellLinkOperationError = "univer-cell-link-operation-error", styles = {
|
|
1199
|
-
cellLink,
|
|
1200
|
-
cellLinkType,
|
|
1201
|
-
cellLinkContent,
|
|
1202
|
-
cellLinkContentError,
|
|
1203
|
-
cellLinkUrl,
|
|
1204
|
-
cellLinkOperations,
|
|
1205
|
-
cellLinkOperation,
|
|
1206
|
-
cellLinkOperationError
|
|
1207
|
-
}, iconsMap = {
|
|
1208
|
-
[SheetHyperLinkType.URL]: /* @__PURE__ */ jsxRuntimeExports.jsx(LinkSingle, {}),
|
|
1209
|
-
[SheetHyperLinkType.SHEET]: /* @__PURE__ */ jsxRuntimeExports.jsx(Xlsx, {}),
|
|
1210
|
-
[SheetHyperLinkType.RANGE]: /* @__PURE__ */ jsxRuntimeExports.jsx(AllBorderSingle, {}),
|
|
1211
|
-
[SheetHyperLinkType.DEFINE_NAME]: /* @__PURE__ */ jsxRuntimeExports.jsx(AllBorderSingle, {}),
|
|
1212
|
-
[SheetHyperLinkType.INVALID]: /* @__PURE__ */ jsxRuntimeExports.jsx(AllBorderSingle, {})
|
|
1213
|
-
}, CellLinkPopup = /* @__PURE__ */ __name(() => {
|
|
1214
|
-
var _a15, _b;
|
|
1215
|
-
const popupService = useDependency(SheetsHyperLinkPopupService), commandService = useDependency(ICommandService), messageService = useDependency(IMessageService), localeService = useDependency(LocaleService), [currentPopup, setCurrentPopup] = useState(null), resolverService = useDependency(SheetsHyperLinkResolverService), editorBridgeService = useDependency(IEditorBridgeService);
|
|
1216
|
-
if (useEffect(() => {
|
|
1217
|
-
setCurrentPopup(popupService.currentPopup);
|
|
1218
|
-
const ob = popupService.currentPopup$.subscribe((popup) => {
|
|
1219
|
-
setCurrentPopup(popup);
|
|
1220
|
-
});
|
|
1221
|
-
return () => {
|
|
1222
|
-
ob.unsubscribe();
|
|
1223
|
-
};
|
|
1224
|
-
}, [popupService.currentPopup, popupService.currentPopup$]), !currentPopup)
|
|
1225
|
-
return null;
|
|
1226
|
-
const { unitId, subUnitId, customRange, row, col } = currentPopup;
|
|
1227
|
-
if (!((_a15 = customRange == null ? void 0 : customRange.properties) != null && _a15.url))
|
|
1228
|
-
return null;
|
|
1229
|
-
const linkObj = resolverService.parseHyperLink((_b = customRange.properties.url) != null ? _b : ""), isError = linkObj.type === SheetHyperLinkType.INVALID;
|
|
1230
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.cellLink, onClick: /* @__PURE__ */ __name(() => popupService.hideCurrentPopup(), "onClick"), children: [
|
|
1231
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cs(styles.cellLinkContent, { [styles.cellLinkContentError]: isError }), onClick: linkObj.handler, children: [
|
|
1232
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.cellLinkType, children: iconsMap[linkObj.type] }),
|
|
1233
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { showIfEllipsis: !0, title: linkObj.name, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.cellLinkUrl, children: linkObj.name }) })
|
|
1234
|
-
] }),
|
|
1235
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.cellLinkOperations, children: [
|
|
1236
|
-
currentPopup.copyPermission && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1237
|
-
"div",
|
|
1238
|
-
{
|
|
1239
|
-
className: cs(styles.cellLinkOperation, { [styles.cellLinkOperationError]: isError }),
|
|
1240
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
1241
|
-
if (!isError) {
|
|
1242
|
-
if (linkObj.type !== SheetHyperLinkType.URL) {
|
|
1243
|
-
const url = new URL(window.location.href);
|
|
1244
|
-
url.hash = linkObj.url.slice(1), navigator.clipboard.writeText(url.href);
|
|
1245
|
-
} else
|
|
1246
|
-
navigator.clipboard.writeText(linkObj.url);
|
|
1247
|
-
messageService.show({
|
|
1248
|
-
content: localeService.t("hyperLink.message.coped"),
|
|
1249
|
-
type: MessageType.Info
|
|
1250
|
-
});
|
|
1251
|
-
}
|
|
1252
|
-
}, "onClick"),
|
|
1253
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { placement: "bottom", title: localeService.t("hyperLink.popup.copy"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(CopySingle, {}) })
|
|
1254
|
-
}
|
|
1255
|
-
),
|
|
1256
|
-
currentPopup.editPermission && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1257
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1258
|
-
"div",
|
|
1259
|
-
{
|
|
1260
|
-
className: styles.cellLinkOperation,
|
|
1261
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
1262
|
-
commandService.executeCommand(OpenHyperLinkEditPanelOperation.id, {
|
|
1263
|
-
unitId,
|
|
1264
|
-
subUnitId,
|
|
1265
|
-
row,
|
|
1266
|
-
col,
|
|
1267
|
-
customRangeId: customRange.rangeId,
|
|
1268
|
-
type: currentPopup.type
|
|
1269
|
-
});
|
|
1270
|
-
}, "onClick"),
|
|
1271
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { placement: "bottom", title: localeService.t("hyperLink.popup.edit"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(WriteSingle, {}) })
|
|
1272
|
-
}
|
|
1273
|
-
),
|
|
1274
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1275
|
-
"div",
|
|
1276
|
-
{
|
|
1277
|
-
className: styles.cellLinkOperation,
|
|
1278
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
1279
|
-
const commandId = currentPopup.type === HyperLinkEditSourceType.EDITING || currentPopup.type === HyperLinkEditSourceType.ZEN_EDITOR ? CancelRichHyperLinkCommand.id : CancelHyperLinkCommand.id;
|
|
1280
|
-
commandService.syncExecuteCommand(commandId, {
|
|
1281
|
-
unitId,
|
|
1282
|
-
subUnitId,
|
|
1283
|
-
id: customRange.rangeId,
|
|
1284
|
-
row,
|
|
1285
|
-
column: col,
|
|
1286
|
-
documentId: currentPopup.type === HyperLinkEditSourceType.ZEN_EDITOR ? DOCS_ZEN_EDITOR_UNIT_ID_KEY : editorBridgeService.getCurrentEditorId()
|
|
1287
|
-
}) && popupService.hideCurrentPopup(void 0, !0);
|
|
1288
|
-
}, "onClick"),
|
|
1289
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { placement: "bottom", title: localeService.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(UnlinkSingle, {}) })
|
|
1290
|
-
}
|
|
1291
|
-
)
|
|
1292
|
-
] })
|
|
1293
|
-
] })
|
|
1294
|
-
] });
|
|
1295
|
-
}, "CellLinkPopup");
|
|
1296
|
-
CellLinkPopup.componentKey = "univer.sheet.cell-link-popup";
|
|
1297
|
-
var __defProp$a = Object.defineProperty, __getOwnPropDesc$a = Object.getOwnPropertyDescriptor, __decorateClass$a = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1298
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1299
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1300
|
-
return kind && result && __defProp$a(target, key, result), result;
|
|
1301
|
-
}, "__decorateClass$a"), __decorateParam$a = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$a");
|
|
1302
|
-
const isEqualLink = /* @__PURE__ */ __name((a, b) => {
|
|
1303
|
-
var _a15, _b;
|
|
1304
|
-
return a.unitId === b.unitId && a.subUnitId === b.subUnitId && a.row === b.row && a.col === b.col && ((_a15 = a.customRange) == null ? void 0 : _a15.rangeId) === ((_b = b.customRange) == null ? void 0 : _b.rangeId) && a.type === b.type;
|
|
1305
|
-
}, "isEqualLink");
|
|
1306
|
-
var _a3;
|
|
1307
|
-
let SheetsHyperLinkPopupService = (_a3 = class extends Disposable {
|
|
1308
|
-
constructor(_sheetCanvasPopManagerService, _injector, _univerInstanceService, _editorBridgeService, _textSelectionManagerService, _docCanvasPopManagerService, _editorService, _rangeSelectorService, _zenZoneService) {
|
|
1309
|
-
super();
|
|
1310
|
-
__publicField(this, "_currentPopup", null);
|
|
1311
|
-
__publicField(this, "_currentPopup$", new Subject());
|
|
1312
|
-
__publicField(this, "currentPopup$", this._currentPopup$.asObservable());
|
|
1313
|
-
__publicField(this, "_currentEditingPopup", null);
|
|
1314
|
-
__publicField(this, "_currentEditing$", new BehaviorSubject(null));
|
|
1315
|
-
__publicField(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
1316
|
-
this._sheetCanvasPopManagerService = _sheetCanvasPopManagerService, this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._editorBridgeService = _editorBridgeService, this._textSelectionManagerService = _textSelectionManagerService, this._docCanvasPopManagerService = _docCanvasPopManagerService, this._editorService = _editorService, this._rangeSelectorService = _rangeSelectorService, this._zenZoneService = _zenZoneService, this.disposeWithMe(() => {
|
|
1317
|
-
this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
|
|
1318
|
-
});
|
|
1319
|
-
}
|
|
1320
|
-
get currentPopup() {
|
|
1321
|
-
return this._currentPopup;
|
|
1322
|
-
}
|
|
1323
|
-
get currentEditing() {
|
|
1324
|
-
return this._currentEditing$.getValue();
|
|
1325
|
-
}
|
|
1326
|
-
showPopup(location2) {
|
|
1327
|
-
if (this._currentPopup && isEqualLink(location2, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), location2.type !== HyperLinkEditSourceType.ZEN_EDITOR && this._zenZoneService.visible))
|
|
1328
|
-
return;
|
|
1329
|
-
const currentEditing = this._currentEditing$.getValue();
|
|
1330
|
-
if (currentEditing && isEqualLink(location2, currentEditing))
|
|
1331
|
-
return;
|
|
1332
|
-
const { unitId, subUnitId, row, col, customRangeRect, customRange } = location2;
|
|
1333
|
-
if (!customRange)
|
|
1334
|
-
return;
|
|
1335
|
-
let disposable;
|
|
1336
|
-
const popup = {
|
|
1337
|
-
componentKey: CellLinkPopup.componentKey,
|
|
1338
|
-
direction: "bottom",
|
|
1339
|
-
onClickOutside: /* @__PURE__ */ __name(() => {
|
|
1340
|
-
this.hideCurrentPopup();
|
|
1341
|
-
}, "onClickOutside"),
|
|
1342
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
1343
|
-
this.hideCurrentPopup(location2.type, !0);
|
|
1344
|
-
}, "onClick")
|
|
1345
|
-
};
|
|
1346
|
-
location2.type === HyperLinkEditSourceType.EDITING ? disposable = customRangeRect && this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
|
|
1347
|
-
customRangeRect,
|
|
1348
|
-
popup
|
|
1349
|
-
) : location2.type === HyperLinkEditSourceType.ZEN_EDITOR ? disposable = this._docCanvasPopManagerService.attachPopupToRange(
|
|
1350
|
-
{
|
|
1351
|
-
startOffset: customRange.startIndex,
|
|
1352
|
-
endOffset: customRange.endIndex + 1,
|
|
1353
|
-
collapsed: !1
|
|
1354
|
-
},
|
|
1355
|
-
popup,
|
|
1356
|
-
DOCS_ZEN_EDITOR_UNIT_ID_KEY
|
|
1357
|
-
) : disposable = customRangeRect && this._sheetCanvasPopManagerService.attachPopupByPosition(
|
|
1358
|
-
customRangeRect,
|
|
1359
|
-
popup
|
|
1360
|
-
), disposable && (this._currentPopup = {
|
|
1361
|
-
unitId,
|
|
1362
|
-
subUnitId,
|
|
1363
|
-
disposable,
|
|
1364
|
-
row,
|
|
1365
|
-
col,
|
|
1366
|
-
editPermission: !!location2.editPermission,
|
|
1367
|
-
copyPermission: !!location2.copyPermission,
|
|
1368
|
-
customRange,
|
|
1369
|
-
type: location2.type
|
|
1370
|
-
}, this._currentPopup$.next(this._currentPopup));
|
|
1371
|
-
}
|
|
1372
|
-
hideCurrentPopup(type, force) {
|
|
1373
|
-
var _a15, _b;
|
|
1374
|
-
this._currentPopup && ((!type || type === this._currentPopup.type) && this._currentPopup.disposable.canDispose() || force) && ((_b = (_a15 = this._currentPopup) == null ? void 0 : _a15.disposable) == null || _b.dispose(), this._currentPopup = null, this._currentPopup$.next(null));
|
|
1375
|
-
}
|
|
1376
|
-
_getEditingRange() {
|
|
1377
|
-
var _a15, _b, _c;
|
|
1378
|
-
const visible = this._editorBridgeService.isVisible().visible, state = this._editorBridgeService.getEditCellState();
|
|
1379
|
-
if (visible && state) {
|
|
1380
|
-
const textRange = this._textSelectionManagerService.getActiveTextRange(), body = (_a15 = state.documentLayoutObject.documentModel) == null ? void 0 : _a15.getBody();
|
|
1381
|
-
if (!body)
|
|
1382
|
-
return null;
|
|
1383
|
-
if (!textRange || textRange.collapsed)
|
|
1384
|
-
return {
|
|
1385
|
-
startOffset: 0,
|
|
1386
|
-
endOffset: body.dataStream.length - 2,
|
|
1387
|
-
collapsed: body.dataStream.length - 2 === 0,
|
|
1388
|
-
label: BuildTextUtils.transform.getPlainText(body.dataStream)
|
|
1389
|
-
};
|
|
1390
|
-
const links = BuildTextUtils.customRange.getCustomRangesInterestsWithRange(textRange, (_c = (_b = body.customRanges) == null ? void 0 : _b.filter((i) => i.rangeType === CustomRangeType.HYPERLINK)) != null ? _c : []);
|
|
1391
|
-
let start = textRange.startOffset, end = textRange.endOffset;
|
|
1392
|
-
return links.forEach((link) => {
|
|
1393
|
-
start = Math.min(start, link.startIndex), end = Math.max(end, link.endIndex + 1);
|
|
1394
|
-
}), {
|
|
1395
|
-
startOffset: start,
|
|
1396
|
-
endOffset: end,
|
|
1397
|
-
collapsed: start === end,
|
|
1398
|
-
label: BuildTextUtils.transform.getPlainText(body.dataStream.slice(start, end))
|
|
1399
|
-
};
|
|
1400
|
-
}
|
|
1401
|
-
return null;
|
|
1402
|
-
}
|
|
1403
|
-
get _editPopup() {
|
|
1404
|
-
return {
|
|
1405
|
-
componentKey: CellLinkEdit.componentKey,
|
|
1406
|
-
direction: "bottom",
|
|
1407
|
-
onClickOutside: /* @__PURE__ */ __name(() => {
|
|
1408
|
-
const hyperLinkRangeSelectorId = createInternalEditorID("hyper-link-edit");
|
|
1409
|
-
this._editorService.getFocusId() !== hyperLinkRangeSelectorId && (this._rangeSelectorService.getCurrentSelectorId() === hyperLinkRangeSelectorId && this._rangeSelectorService.selectorModalVisible || this.endEditing());
|
|
1410
|
-
}, "onClickOutside"),
|
|
1411
|
-
hiddenType: "hide"
|
|
1412
|
-
};
|
|
1413
|
-
}
|
|
1414
|
-
startAddEditing(link) {
|
|
1415
|
-
var _a15, _b, _c, _d, _e;
|
|
1416
|
-
const { unitId, subUnitId, type } = link;
|
|
1417
|
-
if (type === HyperLinkEditSourceType.ZEN_EDITOR) {
|
|
1418
|
-
const document = this._univerInstanceService.getUnit(DOCS_ZEN_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
|
|
1419
|
-
if (!document)
|
|
1420
|
-
return;
|
|
1421
|
-
const range = this._textSelectionManagerService.getActiveTextRange();
|
|
1422
|
-
if (!range)
|
|
1423
|
-
return;
|
|
1424
|
-
this._currentEditingPopup = this._docCanvasPopManagerService.attachPopupToRange(
|
|
1425
|
-
range,
|
|
1426
|
-
this._editPopup,
|
|
1427
|
-
DOCS_ZEN_EDITOR_UNIT_ID_KEY
|
|
1428
|
-
);
|
|
1429
|
-
const label = (_a15 = document.getBody()) == null ? void 0 : _a15.dataStream.slice(range.startOffset, range.endOffset - 1);
|
|
1430
|
-
this._currentEditing$.next({
|
|
1431
|
-
...link,
|
|
1432
|
-
label
|
|
1433
|
-
});
|
|
1434
|
-
} else if (type === HyperLinkEditSourceType.EDITING) {
|
|
1435
|
-
const range = this._getEditingRange();
|
|
1436
|
-
range && this._textSelectionManagerService.replaceTextRanges([{ ...range }]), this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
1437
|
-
link.row,
|
|
1438
|
-
link.col,
|
|
1439
|
-
this._editPopup,
|
|
1440
|
-
unitId,
|
|
1441
|
-
subUnitId
|
|
1442
|
-
), this._currentEditing$.next({
|
|
1443
|
-
...link,
|
|
1444
|
-
label: (_b = range == null ? void 0 : range.label) != null ? _b : ""
|
|
1445
|
-
});
|
|
1446
|
-
} else {
|
|
1447
|
-
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
1448
|
-
link.row,
|
|
1449
|
-
link.col,
|
|
1450
|
-
this._editPopup,
|
|
1451
|
-
unitId,
|
|
1452
|
-
subUnitId
|
|
1453
|
-
);
|
|
1454
|
-
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId), cell = worksheet == null ? void 0 : worksheet.getCellRaw(link.row, link.col);
|
|
1455
|
-
this._currentEditing$.next({
|
|
1456
|
-
...link,
|
|
1457
|
-
label: cell != null && cell.p ? BuildTextUtils.transform.getPlainText((_d = (_c = cell.p.body) == null ? void 0 : _c.dataStream) != null ? _d : "") : ((_e = cell == null ? void 0 : cell.v) != null ? _e : "").toString()
|
|
1458
|
-
});
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
startEditing(link) {
|
|
1462
|
-
var _a15, _b, _c, _d, _e, _f;
|
|
1463
|
-
(_a15 = this._currentEditingPopup) == null || _a15.dispose(), this.hideCurrentPopup(void 0, !0);
|
|
1464
|
-
const { unitId, subUnitId } = link;
|
|
1465
|
-
let customRange, label;
|
|
1466
|
-
if (link.type === HyperLinkEditSourceType.ZEN_EDITOR) {
|
|
1467
|
-
const document = this._univerInstanceService.getUnit(DOCS_ZEN_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
|
|
1468
|
-
if (customRange = (_c = (_b = document == null ? void 0 : document.getBody()) == null ? void 0 : _b.customRanges) == null ? void 0 : _c.find((range) => range.rangeId === link.customRangeId), label = customRange ? (_d = document == null ? void 0 : document.getBody()) == null ? void 0 : _d.dataStream.slice(customRange.startIndex + 1, customRange.endIndex) : "", !customRange || !label)
|
|
1469
|
-
return;
|
|
1470
|
-
this._textSelectionManagerService.replaceTextRanges([
|
|
1471
|
-
{
|
|
1472
|
-
startOffset: customRange.startIndex,
|
|
1473
|
-
endOffset: customRange.endIndex + 1
|
|
1474
|
-
}
|
|
1475
|
-
]), this._currentEditingPopup = this._docCanvasPopManagerService.attachPopupToRange(
|
|
1476
|
-
{
|
|
1477
|
-
startOffset: customRange.startIndex,
|
|
1478
|
-
endOffset: customRange.endIndex,
|
|
1479
|
-
collapsed: !1
|
|
1480
|
-
},
|
|
1481
|
-
this._editPopup,
|
|
1482
|
-
DOCS_ZEN_EDITOR_UNIT_ID_KEY
|
|
1483
|
-
);
|
|
1484
|
-
} else if (link.type === HyperLinkEditSourceType.EDITING) {
|
|
1485
|
-
const customRangeInfo = getEditingCustomRangePosition(this._injector, link.unitId, link.subUnitId, link.row, link.col, link.customRangeId);
|
|
1486
|
-
if (!customRangeInfo || !((_e = customRangeInfo.rects) != null && _e.length))
|
|
1487
|
-
return;
|
|
1488
|
-
customRange = customRangeInfo.customRange, label = customRangeInfo.label, this._textSelectionManagerService.replaceTextRanges([
|
|
1489
|
-
{
|
|
1490
|
-
startOffset: customRange.startIndex,
|
|
1491
|
-
endOffset: customRange.endIndex + 1
|
|
1492
|
-
}
|
|
1493
|
-
]), this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
|
|
1494
|
-
customRangeInfo.rects.pop(),
|
|
1495
|
-
this._editPopup,
|
|
1496
|
-
unitId,
|
|
1497
|
-
subUnitId
|
|
1498
|
-
);
|
|
1499
|
-
} else {
|
|
1500
|
-
const customRangeInfo = getCustomRangePosition(this._injector, link.unitId, link.subUnitId, link.row, link.col, link.customRangeId);
|
|
1501
|
-
if (!customRangeInfo || !((_f = customRangeInfo.rects) != null && _f.length))
|
|
1502
|
-
return;
|
|
1503
|
-
customRange = customRangeInfo.customRange, label = customRangeInfo.label, this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupByPosition(
|
|
1504
|
-
customRangeInfo.rects.pop(),
|
|
1505
|
-
this._editPopup,
|
|
1506
|
-
unitId,
|
|
1507
|
-
subUnitId
|
|
1508
|
-
);
|
|
1509
|
-
}
|
|
1510
|
-
this._currentEditing$.next({
|
|
1511
|
-
...link,
|
|
1512
|
-
customRange,
|
|
1513
|
-
label
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
endEditing(type) {
|
|
1517
|
-
var _a15;
|
|
1518
|
-
const current = this._currentEditing$.getValue();
|
|
1519
|
-
current && (!type || type === current.type) && ((_a15 = this._currentEditingPopup) == null || _a15.dispose(), this._currentEditing$.next(null));
|
|
1520
|
-
}
|
|
1521
|
-
}, __name(_a3, "SheetsHyperLinkPopupService"), _a3);
|
|
1522
|
-
SheetsHyperLinkPopupService = __decorateClass$a([
|
|
1523
|
-
__decorateParam$a(0, Inject(SheetCanvasPopManagerService)),
|
|
1524
|
-
__decorateParam$a(1, Inject(Injector)),
|
|
1525
|
-
__decorateParam$a(2, IUniverInstanceService),
|
|
1526
|
-
__decorateParam$a(3, IEditorBridgeService),
|
|
1527
|
-
__decorateParam$a(4, Inject(DocSelectionManagerService)),
|
|
1528
|
-
__decorateParam$a(5, Inject(DocCanvasPopManagerService)),
|
|
1529
|
-
__decorateParam$a(6, IEditorService),
|
|
1530
|
-
__decorateParam$a(7, IRangeSelectorService),
|
|
1531
|
-
__decorateParam$a(8, IZenZoneService)
|
|
1532
|
-
], SheetsHyperLinkPopupService);
|
|
1533
|
-
const getShouldDisableCellLink = /* @__PURE__ */ __name((worksheet, row, col) => {
|
|
1534
|
-
const cell = worksheet.getCell(row, col);
|
|
1535
|
-
if (cell != null && cell.f || cell != null && cell.si)
|
|
1536
|
-
return !0;
|
|
1537
|
-
const disables = [
|
|
1538
|
-
DataValidationType.CHECKBOX,
|
|
1539
|
-
DataValidationType.LIST,
|
|
1540
|
-
DataValidationType.LIST_MULTIPLE
|
|
1541
|
-
];
|
|
1542
|
-
return !!(cell != null && cell.dataValidation && disables.includes(cell.dataValidation.rule.type));
|
|
1543
|
-
}, "getShouldDisableCellLink"), getShouldDisableCurrentCellLink = /* @__PURE__ */ __name((accessor) => {
|
|
1544
|
-
const unit = accessor.get(IUniverInstanceService).getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
1545
|
-
if (!unit)
|
|
1546
|
-
return !0;
|
|
1547
|
-
const worksheet = unit.getActiveSheet(), selections = accessor.get(SheetsSelectionsService).getCurrentSelections();
|
|
1548
|
-
if (!selections.length)
|
|
1549
|
-
return !0;
|
|
1550
|
-
const row = selections[0].range.startRow, col = selections[0].range.startColumn;
|
|
1551
|
-
return getShouldDisableCellLink(worksheet, row, col);
|
|
1552
|
-
}, "getShouldDisableCurrentCellLink"), shouldDisableAddLink = /* @__PURE__ */ __name((accessor) => {
|
|
1553
|
-
var _a15;
|
|
1554
|
-
const textSelectionService = accessor.get(DocSelectionManagerService), univerInstanceService = accessor.get(IUniverInstanceService), textRanges = textSelectionService.getDocRanges();
|
|
1555
|
-
if (!textRanges.length || textRanges.length > 1)
|
|
1556
|
-
return !0;
|
|
1557
|
-
const activeRange = textRanges[0], doc = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_DOC);
|
|
1558
|
-
if (!doc || !activeRange || activeRange.collapsed)
|
|
1559
|
-
return !0;
|
|
1560
|
-
const body = doc.getSelfOrHeaderFooterModel(activeRange.segmentId).getBody(), paragraphs = body == null ? void 0 : body.paragraphs;
|
|
1561
|
-
if (!paragraphs)
|
|
1562
|
-
return !0;
|
|
1563
|
-
for (let i = 0, len = paragraphs.length; i < len; i++) {
|
|
1564
|
-
const p2 = paragraphs[i];
|
|
1565
|
-
if (activeRange.startOffset <= p2.startIndex && activeRange.endOffset > p2.startIndex)
|
|
1566
|
-
return !0;
|
|
1567
|
-
if (p2.startIndex > activeRange.endOffset)
|
|
1568
|
-
break;
|
|
1569
|
-
}
|
|
1570
|
-
return !BuildTextUtils.customRange.getCustomRangesInterestsWithRange(activeRange, (_a15 = body.customRanges) != null ? _a15 : []).every((range) => range.rangeType === CustomRangeType.HYPERLINK);
|
|
1571
|
-
}, "shouldDisableAddLink"), OpenHyperLinkEditPanelOperation = {
|
|
1572
|
-
type: CommandType.OPERATION,
|
|
1573
|
-
id: "sheet.operation.open-hyper-link-edit-panel",
|
|
1574
|
-
handler(accessor, params) {
|
|
1575
|
-
if (!params)
|
|
1576
|
-
return !1;
|
|
1577
|
-
const popupService = accessor.get(SheetsHyperLinkPopupService);
|
|
1578
|
-
return params.customRangeId ? popupService.startEditing(params) : popupService.startAddEditing(params), !0;
|
|
1579
|
-
}
|
|
1580
|
-
}, CloseHyperLinkPopupOperation = {
|
|
1581
|
-
type: CommandType.OPERATION,
|
|
1582
|
-
id: "sheet.operation.close-hyper-link-popup",
|
|
1583
|
-
handler(accessor) {
|
|
1584
|
-
return accessor.get(SheetsHyperLinkPopupService).endEditing(), !0;
|
|
1585
|
-
}
|
|
1586
|
-
}, InsertHyperLinkOperation = {
|
|
1587
|
-
type: CommandType.OPERATION,
|
|
1588
|
-
id: "sheet.operation.insert-hyper-link",
|
|
1589
|
-
handler(accessor) {
|
|
1590
|
-
var _a15;
|
|
1591
|
-
const univerInstanceService = accessor.get(IUniverInstanceService), target = getSheetCommandTarget(univerInstanceService), editorBridgeService = accessor.get(IEditorBridgeService);
|
|
1592
|
-
if (!target)
|
|
1593
|
-
return !1;
|
|
1594
|
-
const commandService = accessor.get(ICommandService), selection = accessor.get(SheetsSelectionsService).getCurrentLastSelection();
|
|
1595
|
-
if (!selection)
|
|
1596
|
-
return !1;
|
|
1597
|
-
const row = selection.range.startRow, col = selection.range.startColumn, visible = editorBridgeService.isVisible(), isZenEditor = ((_a15 = univerInstanceService.getFocusedUnit()) == null ? void 0 : _a15.getUnitId()) === DOCS_ZEN_EDITOR_UNIT_ID_KEY;
|
|
1598
|
-
return commandService.executeCommand(OpenHyperLinkEditPanelOperation.id, {
|
|
1599
|
-
unitId: target.unitId,
|
|
1600
|
-
subUnitId: target.subUnitId,
|
|
1601
|
-
row,
|
|
1602
|
-
col,
|
|
1603
|
-
type: isZenEditor ? HyperLinkEditSourceType.ZEN_EDITOR : visible.visible ? HyperLinkEditSourceType.EDITING : HyperLinkEditSourceType.VIEWING
|
|
1604
|
-
});
|
|
1605
|
-
}
|
|
1606
|
-
}, InsertHyperLinkToolbarOperation = {
|
|
1607
|
-
type: CommandType.OPERATION,
|
|
1608
|
-
id: "sheet.operation.insert-hyper-link-toolbar",
|
|
1609
|
-
handler(accessor) {
|
|
1610
|
-
if (getShouldDisableCurrentCellLink(accessor))
|
|
1611
|
-
return !1;
|
|
1612
|
-
const commandService = accessor.get(ICommandService);
|
|
1613
|
-
return accessor.get(SheetsHyperLinkPopupService).currentEditing ? commandService.executeCommand(CloseHyperLinkPopupOperation.id) : commandService.executeCommand(InsertHyperLinkOperation.id);
|
|
1614
|
-
}
|
|
1615
|
-
}, getLinkDisable$ = /* @__PURE__ */ __name((accessor) => {
|
|
1616
|
-
const disableRange$ = getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }), univerInstanceService = accessor.get(IUniverInstanceService), sheetSelectionService = accessor.get(SheetsSelectionsService), disableCell$ = univerInstanceService.focused$.pipe(
|
|
1617
|
-
map((focused) => focused ? univerInstanceService.getUnit(focused, UniverInstanceType.UNIVER_SHEET) : null),
|
|
1618
|
-
mergeMap((unit) => unit ? unit.activeSheet$ : new Observable((sub) => {
|
|
1619
|
-
sub.next(null);
|
|
1620
|
-
})),
|
|
1621
|
-
mergeMap((sheet) => sheetSelectionService.selectionMoveEnd$.pipe(map((selections) => sheet && { selections, sheet }))),
|
|
1622
|
-
map((sheetWithSelection) => {
|
|
1623
|
-
if (!sheetWithSelection)
|
|
1624
|
-
return !0;
|
|
1625
|
-
const { selections, sheet } = sheetWithSelection;
|
|
1626
|
-
if (!selections.length)
|
|
1627
|
-
return !0;
|
|
1628
|
-
const row = selections[0].range.startRow, col = selections[0].range.startColumn;
|
|
1629
|
-
return getShouldDisableCellLink(sheet, row, col);
|
|
1630
|
-
})
|
|
1631
|
-
);
|
|
1632
|
-
return disableRange$.pipe(mergeMap((disableRange) => disableCell$.pipe(map((disableCell) => disableRange || disableCell))));
|
|
1633
|
-
}, "getLinkDisable$"), getZenLinkDisable$ = /* @__PURE__ */ __name((accessor) => {
|
|
1634
|
-
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
1635
|
-
return univerInstanceService.focused$.pipe(
|
|
1636
|
-
mergeMap((focused) => !focused || focused !== DOCS_ZEN_EDITOR_UNIT_ID_KEY ? new Observable((sub) => sub.next(null)) : accessor.get(DocSelectionManagerService).textSelection$),
|
|
1637
|
-
map((selection) => {
|
|
1638
|
-
if (!selection || selection.unitId !== DOCS_ZEN_EDITOR_UNIT_ID_KEY)
|
|
1639
|
-
return !0;
|
|
1640
|
-
const state = accessor.get(IEditorBridgeService).getEditCellState();
|
|
1641
|
-
if (!state)
|
|
1642
|
-
return !0;
|
|
1643
|
-
const target = getSheetCommandTarget(univerInstanceService, { unitId: state.unitId, subUnitId: state.sheetId });
|
|
1644
|
-
return !(target != null && target.worksheet) || getShouldDisableCellLink(target.worksheet, state.row, state.column) ? !0 : shouldDisableAddLink(accessor);
|
|
1645
|
-
})
|
|
1646
|
-
);
|
|
1647
|
-
}, "getZenLinkDisable$"), linkMenu = {
|
|
1648
|
-
commandId: InsertHyperLinkOperation.id,
|
|
1649
|
-
type: MenuItemType.BUTTON,
|
|
1650
|
-
positions: [MenuPosition.CONTEXT_MENU],
|
|
1651
|
-
title: "hyperLink.menu.add",
|
|
1652
|
-
icon: "LinkSingle"
|
|
1653
|
-
}, genZenEditorMenuId = /* @__PURE__ */ __name((id) => `${id}-zen-editor`, "genZenEditorMenuId"), insertLinkMenuFactory = /* @__PURE__ */ __name((accessor) => ({
|
|
1654
|
-
...linkMenu,
|
|
1655
|
-
id: linkMenu.commandId,
|
|
1656
|
-
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
1657
|
-
disabled$: getLinkDisable$(accessor)
|
|
1658
|
-
// disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })),
|
|
1659
|
-
}), "insertLinkMenuFactory"), zenEditorInsertLinkMenuFactory = /* @__PURE__ */ __name((accessor) => ({
|
|
1660
|
-
...linkMenu,
|
|
1661
|
-
id: genZenEditorMenuId(linkMenu.commandId),
|
|
1662
|
-
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC, DOCS_ZEN_EDITOR_UNIT_ID_KEY),
|
|
1663
|
-
disabled$: getZenLinkDisable$(accessor)
|
|
1664
|
-
}), "zenEditorInsertLinkMenuFactory"), linkToolbarMenu = {
|
|
1665
|
-
tooltip: "hyperLink.form.addTitle",
|
|
1666
|
-
positions: MenuPosition.TOOLBAR_START,
|
|
1667
|
-
group: MenuGroup.TOOLBAR_OTHERS,
|
|
1668
|
-
commandId: InsertHyperLinkToolbarOperation.id,
|
|
1669
|
-
type: MenuItemType.BUTTON,
|
|
1670
|
-
icon: "LinkSingle"
|
|
1671
|
-
}, insertLinkMenuToolbarFactory = /* @__PURE__ */ __name((accessor) => ({
|
|
1672
|
-
...linkToolbarMenu,
|
|
1673
|
-
id: linkToolbarMenu.commandId,
|
|
1674
|
-
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
1675
|
-
disabled$: getLinkDisable$(accessor)
|
|
1676
|
-
}), "insertLinkMenuToolbarFactory"), zenEditorInsertLinkMenuToolbarFactory = /* @__PURE__ */ __name((accessor) => ({
|
|
1677
|
-
...linkToolbarMenu,
|
|
1678
|
-
id: genZenEditorMenuId(linkToolbarMenu.commandId),
|
|
1679
|
-
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC, DOCS_ZEN_EDITOR_UNIT_ID_KEY),
|
|
1680
|
-
disabled$: getZenLinkDisable$(accessor)
|
|
1681
|
-
}), "zenEditorInsertLinkMenuToolbarFactory"), InsertLinkShortcut = {
|
|
1682
|
-
id: InsertHyperLinkToolbarOperation.id,
|
|
1683
|
-
binding: KeyCode.K | MetaKeys.CTRL_COMMAND,
|
|
1684
|
-
preconditions: whenSheetEditorFocused
|
|
1685
|
-
};
|
|
1686
|
-
var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1687
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1688
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1689
|
-
return kind && result && __defProp$9(target, key, result), result;
|
|
1690
|
-
}, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$9"), _a4;
|
|
1691
|
-
let SheetsHyperLinkRemoveSheetController = (_a4 = class extends Disposable {
|
|
1692
|
-
constructor(_sheetInterceptorService, _univerInstanceService, _hyperLinkModel) {
|
|
1693
|
-
super(), this._sheetInterceptorService = _sheetInterceptorService, this._univerInstanceService = _univerInstanceService, this._hyperLinkModel = _hyperLinkModel, this._initSheetChange();
|
|
1694
|
-
}
|
|
1695
|
-
_initSheetChange() {
|
|
1696
|
-
this.disposeWithMe(
|
|
1697
|
-
this._sheetInterceptorService.interceptCommand({
|
|
1698
|
-
getMutations: /* @__PURE__ */ __name((commandInfo) => {
|
|
1699
|
-
var _a15;
|
|
1700
|
-
if (commandInfo.id === RemoveSheetCommand.id) {
|
|
1701
|
-
const params = commandInfo.params, workbook = params.unitId ? this._univerInstanceService.getUnit(params.unitId) : this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
1702
|
-
if (!workbook)
|
|
1703
|
-
return { redos: [], undos: [] };
|
|
1704
|
-
const unitId = workbook.getUnitId(), subUnitId = params.subUnitId || ((_a15 = workbook.getActiveSheet()) == null ? void 0 : _a15.getSheetId());
|
|
1705
|
-
if (!subUnitId)
|
|
1706
|
-
return { redos: [], undos: [] };
|
|
1707
|
-
const links = this._hyperLinkModel.getSubUnit(unitId, subUnitId), redos = links.map((link) => ({
|
|
1708
|
-
id: RemoveHyperLinkMutation.id,
|
|
1709
|
-
params: {
|
|
1710
|
-
unitId,
|
|
1711
|
-
subUnitId,
|
|
1712
|
-
id: link.id
|
|
1713
|
-
}
|
|
1714
|
-
})), undos = links.map((link) => ({
|
|
1715
|
-
id: AddHyperLinkMutation.id,
|
|
1716
|
-
params: {
|
|
1717
|
-
unitId,
|
|
1718
|
-
subUnitId,
|
|
1719
|
-
link
|
|
1720
|
-
}
|
|
1721
|
-
}));
|
|
1722
|
-
return { redos, undos };
|
|
1723
|
-
}
|
|
1724
|
-
return { redos: [], undos: [] };
|
|
1725
|
-
}, "getMutations")
|
|
1726
|
-
})
|
|
1727
|
-
);
|
|
1728
|
-
}
|
|
1729
|
-
}, __name(_a4, "SheetsHyperLinkRemoveSheetController"), _a4);
|
|
1730
|
-
SheetsHyperLinkRemoveSheetController = __decorateClass$9([
|
|
1731
|
-
OnLifecycle(LifecycleStages.Ready, SheetsHyperLinkRemoveSheetController),
|
|
1732
|
-
__decorateParam$9(0, Inject(SheetInterceptorService)),
|
|
1733
|
-
__decorateParam$9(1, IUniverInstanceService),
|
|
1734
|
-
__decorateParam$9(2, Inject(HyperLinkModel))
|
|
1735
|
-
], SheetsHyperLinkRemoveSheetController);
|
|
1736
|
-
var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1737
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1738
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1739
|
-
return kind && result && __defProp$8(target, key, result), result;
|
|
1740
|
-
}, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$8"), _a5;
|
|
1741
|
-
let SheetsHyperLinkRenderController = (_a5 = class extends Disposable {
|
|
1742
|
-
constructor(_context, _hyperLinkModel, _sheetSkeletonManagerService, _renderManagerService) {
|
|
1743
|
-
super(), this._context = _context, this._hyperLinkModel = _hyperLinkModel, this._sheetSkeletonManagerService = _sheetSkeletonManagerService, this._renderManagerService = _renderManagerService, this._initSkeletonChange();
|
|
1744
|
-
}
|
|
1745
|
-
_initSkeletonChange() {
|
|
1746
|
-
const markSkeletonDirty = /* @__PURE__ */ __name(() => {
|
|
1747
|
-
var _a15;
|
|
1748
|
-
const workbook = this._context.unit, unitId = workbook.getUnitId(), subUnitId = (_a15 = workbook.getActiveSheet()) == null ? void 0 : _a15.getSheetId();
|
|
1749
|
-
if (!subUnitId) {
|
|
1750
|
-
console.warn("No active sheet found");
|
|
1751
|
-
return;
|
|
1752
|
-
}
|
|
1753
|
-
const skeleton = this._sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: subUnitId }), currentRender = this._renderManagerService.getRenderById(unitId);
|
|
1754
|
-
skeleton == null || skeleton.makeDirty(!0), skeleton == null || skeleton.calculate(), currentRender && currentRender.mainComponent.makeForceDirty();
|
|
1755
|
-
}, "markSkeletonDirty");
|
|
1756
|
-
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(debounceTime(16)).subscribe(() => {
|
|
1757
|
-
markSkeletonDirty();
|
|
1758
|
-
}));
|
|
1759
|
-
}
|
|
1760
|
-
}, __name(_a5, "SheetsHyperLinkRenderController"), _a5);
|
|
1761
|
-
SheetsHyperLinkRenderController = __decorateClass$8([
|
|
1762
|
-
__decorateParam$8(1, Inject(HyperLinkModel)),
|
|
1763
|
-
__decorateParam$8(2, Inject(SheetSkeletonManagerService)),
|
|
1764
|
-
__decorateParam$8(3, IRenderManagerService)
|
|
1765
|
-
], SheetsHyperLinkRenderController);
|
|
1766
|
-
var _a6;
|
|
1767
|
-
let SheetsHyperLinkRenderManagerController = (_a6 = class extends Disposable {
|
|
1768
|
-
constructor(_sheetInterceptorService, _hyperLinkModel, _themeService) {
|
|
1769
|
-
super(), this._sheetInterceptorService = _sheetInterceptorService, this._hyperLinkModel = _hyperLinkModel, this._themeService = _themeService, this._initViewModelIntercept();
|
|
1770
|
-
}
|
|
1771
|
-
_initViewModelIntercept() {
|
|
1772
|
-
this.disposeWithMe(
|
|
1773
|
-
this._sheetInterceptorService.intercept(
|
|
1774
|
-
INTERCEPTOR_POINT.CELL_CONTENT,
|
|
1775
|
-
{
|
|
1776
|
-
effect: InterceptorEffectEnum.Value,
|
|
1777
|
-
priority: 100,
|
|
1778
|
-
handler: /* @__PURE__ */ __name((cell, pos, next) => {
|
|
1779
|
-
const { row, col, unitId, subUnitId } = pos, link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, col);
|
|
1780
|
-
return next(link ? {
|
|
1781
|
-
...cell,
|
|
1782
|
-
linkUrl: link.payload,
|
|
1783
|
-
linkId: link.id
|
|
1784
|
-
} : cell);
|
|
1785
|
-
}, "handler")
|
|
1786
|
-
}
|
|
1787
|
-
)
|
|
1788
|
-
);
|
|
1789
|
-
}
|
|
1790
|
-
}, __name(_a6, "SheetsHyperLinkRenderManagerController"), _a6);
|
|
1791
|
-
SheetsHyperLinkRenderManagerController = __decorateClass$8([
|
|
1792
|
-
OnLifecycle(LifecycleStages.Ready, SheetsHyperLinkRenderManagerController),
|
|
1793
|
-
__decorateParam$8(0, Inject(SheetInterceptorService)),
|
|
1794
|
-
__decorateParam$8(1, Inject(HyperLinkModel)),
|
|
1795
|
-
__decorateParam$8(2, Inject(ThemeService))
|
|
1796
|
-
], SheetsHyperLinkRenderManagerController);
|
|
1797
|
-
var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1798
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1799
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1800
|
-
return kind && result && __defProp$7(target, key, result), result;
|
|
1801
|
-
}, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$7"), _a7;
|
|
1802
|
-
let SheetHyperLinkSetRangeController = (_a7 = class extends Disposable {
|
|
1803
|
-
constructor(_sheetInterceptorService, _hyperLinkModel, _selectionManagerService, _univerInstanceService, _editorBridgeService, _renderManagerService) {
|
|
1804
|
-
super(), this._sheetInterceptorService = _sheetInterceptorService, this._hyperLinkModel = _hyperLinkModel, this._selectionManagerService = _selectionManagerService, this._univerInstanceService = _univerInstanceService, this._editorBridgeService = _editorBridgeService, this._renderManagerService = _renderManagerService, this._initCommandInterceptor(), this._initAfterEditor();
|
|
1805
|
-
}
|
|
1806
|
-
_initCommandInterceptor() {
|
|
1807
|
-
this._initSetRangeValuesCommandInterceptor(), this._initClearSelectionCommandInterceptor();
|
|
1808
|
-
}
|
|
1809
|
-
_initSetRangeValuesCommandInterceptor() {
|
|
1810
|
-
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1811
|
-
getMutations: /* @__PURE__ */ __name((command) => {
|
|
1812
|
-
if (command.id === SetRangeValuesCommand.id) {
|
|
1813
|
-
const params = command.params, { unitId, subUnitId } = params, redos = [], undos = [];
|
|
1814
|
-
return params.cellValue && new ObjectMatrix(params.cellValue).forValue((row, col) => {
|
|
1815
|
-
const link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, col);
|
|
1816
|
-
link && (redos.push({
|
|
1817
|
-
id: RemoveHyperLinkMutation.id,
|
|
1818
|
-
params: {
|
|
1819
|
-
unitId,
|
|
1820
|
-
subUnitId,
|
|
1821
|
-
id: link.id
|
|
1822
|
-
}
|
|
1823
|
-
}), undos.push({
|
|
1824
|
-
id: AddHyperLinkMutation.id,
|
|
1825
|
-
params: {
|
|
1826
|
-
unitId,
|
|
1827
|
-
subUnitId,
|
|
1828
|
-
link
|
|
1829
|
-
}
|
|
1830
|
-
}));
|
|
1831
|
-
}), {
|
|
1832
|
-
undos,
|
|
1833
|
-
redos
|
|
1834
|
-
};
|
|
1835
|
-
}
|
|
1836
|
-
return {
|
|
1837
|
-
redos: [],
|
|
1838
|
-
undos: []
|
|
1839
|
-
};
|
|
1840
|
-
}, "getMutations")
|
|
1841
|
-
}));
|
|
1842
|
-
}
|
|
1843
|
-
_initClearSelectionCommandInterceptor() {
|
|
1844
|
-
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1845
|
-
getMutations: /* @__PURE__ */ __name((command) => {
|
|
1846
|
-
if (command.id === ClearSelectionContentCommand.id || command.id === ClearSelectionAllCommand.id || command.id === ClearSelectionFormatCommand.id) {
|
|
1847
|
-
const redos = [], undos = [], selection = this._selectionManagerService.getCurrentLastSelection(), target = getSheetCommandTarget(this._univerInstanceService);
|
|
1848
|
-
if (selection && target) {
|
|
1849
|
-
const { unitId, subUnitId } = target;
|
|
1850
|
-
Range.foreach(selection.range, (row, col) => {
|
|
1851
|
-
const link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, col);
|
|
1852
|
-
link && (redos.push({
|
|
1853
|
-
id: RemoveHyperLinkMutation.id,
|
|
1854
|
-
params: {
|
|
1855
|
-
unitId,
|
|
1856
|
-
subUnitId,
|
|
1857
|
-
id: link.id
|
|
1858
|
-
}
|
|
1859
|
-
}), undos.push({
|
|
1860
|
-
id: AddHyperLinkMutation.id,
|
|
1861
|
-
params: {
|
|
1862
|
-
unitId,
|
|
1863
|
-
subUnitId,
|
|
1864
|
-
link
|
|
1865
|
-
}
|
|
1866
|
-
}));
|
|
1867
|
-
});
|
|
1868
|
-
}
|
|
1869
|
-
return {
|
|
1870
|
-
redos,
|
|
1871
|
-
undos
|
|
1872
|
-
};
|
|
1873
|
-
}
|
|
1874
|
-
return {
|
|
1875
|
-
redos: [],
|
|
1876
|
-
undos: []
|
|
1877
|
-
};
|
|
1878
|
-
}, "getMutations")
|
|
1879
|
-
}));
|
|
1880
|
-
}
|
|
1881
|
-
_initAfterEditor() {
|
|
1882
|
-
this.disposeWithMe(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT, {
|
|
1883
|
-
handler: /* @__PURE__ */ __name((cell, context, next) => {
|
|
1884
|
-
if (!cell || cell.p)
|
|
1885
|
-
return next(cell);
|
|
1886
|
-
if (typeof cell.v == "string" && Tools.isLegalUrl(cell.v) && cell.v[cell.v.length - 1] !== " ") {
|
|
1887
|
-
const { unitId, subUnitId } = context, renderer = this._renderManagerService.getRenderById(unitId), skeleton = renderer == null ? void 0 : renderer.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId);
|
|
1888
|
-
if (!skeleton)
|
|
1889
|
-
return next(cell);
|
|
1890
|
-
const doc = skeleton.skeleton.getBlankCellDocumentModel(cell);
|
|
1891
|
-
if (!doc.documentModel)
|
|
1892
|
-
return next(cell);
|
|
1893
|
-
const textX = BuildTextUtils.selection.replace({
|
|
1894
|
-
selection: {
|
|
1895
|
-
startOffset: 0,
|
|
1896
|
-
endOffset: cell.v.length,
|
|
1897
|
-
collapsed: !1
|
|
1898
|
-
},
|
|
1899
|
-
body: {
|
|
1900
|
-
dataStream: `${DataStreamTreeTokenType.CUSTOM_RANGE_START}${cell.v}${DataStreamTreeTokenType.CUSTOM_RANGE_END}`,
|
|
1901
|
-
customRanges: [{
|
|
1902
|
-
startIndex: 0,
|
|
1903
|
-
endIndex: cell.v.length + 1,
|
|
1904
|
-
rangeId: generateRandomId(),
|
|
1905
|
-
rangeType: CustomRangeType.HYPERLINK,
|
|
1906
|
-
properties: {
|
|
1907
|
-
url: cell.v
|
|
1908
|
-
}
|
|
1909
|
-
}]
|
|
1910
|
-
},
|
|
1911
|
-
doc: doc.documentModel
|
|
1912
|
-
});
|
|
1913
|
-
if (!textX)
|
|
1914
|
-
return next(cell);
|
|
1915
|
-
const body = doc.documentModel.getBody();
|
|
1916
|
-
return TextX.apply(body, textX.serialize()), next({
|
|
1917
|
-
...cell,
|
|
1918
|
-
p: {
|
|
1919
|
-
id: DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
|
|
1920
|
-
body,
|
|
1921
|
-
documentStyle: {
|
|
1922
|
-
pageSize: {
|
|
1923
|
-
width: 1 / 0,
|
|
1924
|
-
height: 1 / 0
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
});
|
|
1929
|
-
}
|
|
1930
|
-
return next(cell);
|
|
1931
|
-
}, "handler")
|
|
1932
|
-
}));
|
|
1933
|
-
}
|
|
1934
|
-
}, __name(_a7, "SheetHyperLinkSetRangeController"), _a7);
|
|
1935
|
-
SheetHyperLinkSetRangeController = __decorateClass$7([
|
|
1936
|
-
OnLifecycle(LifecycleStages.Starting, SheetHyperLinkSetRangeController),
|
|
1937
|
-
__decorateParam$7(0, Inject(SheetInterceptorService)),
|
|
1938
|
-
__decorateParam$7(1, Inject(HyperLinkModel)),
|
|
1939
|
-
__decorateParam$7(2, Inject(SheetsSelectionsService)),
|
|
1940
|
-
__decorateParam$7(3, IUniverInstanceService),
|
|
1941
|
-
__decorateParam$7(4, IEditorBridgeService),
|
|
1942
|
-
__decorateParam$7(5, IRenderManagerService)
|
|
1943
|
-
], SheetHyperLinkSetRangeController);
|
|
1944
|
-
var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1945
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1946
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1947
|
-
return kind && result && __defProp$6(target, key, result), result;
|
|
1948
|
-
}, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$6"), _a8;
|
|
1949
|
-
let SheetsHyperLinkPopupController = (_a8 = class extends Disposable {
|
|
1950
|
-
constructor(_hoverManagerService, _sheetsHyperLinkPopupService, _renderManagerService, _permissionService, _sheetPermissionInterceptorBaseController, _commandService, _editorBridgeService, _textSelectionManagerService, _univerInstanceService, _zenZoneService) {
|
|
1951
|
-
super(), this._hoverManagerService = _hoverManagerService, this._sheetsHyperLinkPopupService = _sheetsHyperLinkPopupService, this._renderManagerService = _renderManagerService, this._permissionService = _permissionService, this._sheetPermissionInterceptorBaseController = _sheetPermissionInterceptorBaseController, this._commandService = _commandService, this._editorBridgeService = _editorBridgeService, this._textSelectionManagerService = _textSelectionManagerService, this._univerInstanceService = _univerInstanceService, this._zenZoneService = _zenZoneService, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
|
|
1952
|
-
}
|
|
1953
|
-
_getLinkPermission(location2) {
|
|
1954
|
-
const { unitId, subUnitId, row: currentRow, col: currentCol } = location2, workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1955
|
-
if (!(workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId)))
|
|
1956
|
-
return {
|
|
1957
|
-
viewPermission: !1,
|
|
1958
|
-
editPermission: !1,
|
|
1959
|
-
copyPermission: !1
|
|
1960
|
-
};
|
|
1961
|
-
const viewPermission = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1962
|
-
workbookTypes: [WorkbookViewPermission],
|
|
1963
|
-
worksheetTypes: [WorksheetViewPermission],
|
|
1964
|
-
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
1965
|
-
}, [{ startRow: currentRow, startColumn: currentCol, endRow: currentRow, endColumn: currentCol }]), editPermission = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1966
|
-
workbookTypes: [WorkbookEditablePermission],
|
|
1967
|
-
worksheetTypes: [WorksheetEditPermission, WorksheetInsertHyperlinkPermission],
|
|
1968
|
-
rangeTypes: [RangeProtectionPermissionEditPoint]
|
|
1969
|
-
}, [{ startRow: currentRow, startColumn: currentCol, endRow: currentRow, endColumn: currentCol }]), copyPermission = this._permissionService.composePermission([new WorkbookCopyPermission(unitId).id, new WorksheetCopyPermission(unitId, subUnitId).id]).every((permission) => permission.value);
|
|
1970
|
-
return {
|
|
1971
|
-
viewPermission,
|
|
1972
|
-
editPermission,
|
|
1973
|
-
copyPermission
|
|
1974
|
-
};
|
|
1975
|
-
}
|
|
1976
|
-
_initHoverListener() {
|
|
1977
|
-
this.disposeWithMe(
|
|
1978
|
-
// hover over not editing cell
|
|
1979
|
-
this._hoverManagerService.currentRichText$.pipe(debounceTime(200)).subscribe((currentCell) => {
|
|
1980
|
-
var _a15;
|
|
1981
|
-
if (!currentCell) {
|
|
1982
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1983
|
-
return;
|
|
1984
|
-
}
|
|
1985
|
-
const { unitId, subUnitId, row, col } = currentCell, renderer = this._renderManagerService.getRenderById(unitId);
|
|
1986
|
-
if (!renderer)
|
|
1987
|
-
return;
|
|
1988
|
-
if (!renderer.with(HoverRenderController).active) {
|
|
1989
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup(HyperLinkEditSourceType.VIEWING);
|
|
1990
|
-
return;
|
|
1991
|
-
}
|
|
1992
|
-
const skeleton = (_a15 = renderer == null ? void 0 : renderer.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId)) == null ? void 0 : _a15.skeleton, currentCol = col, currentRow = row;
|
|
1993
|
-
let targetRow = currentRow, targetCol = currentCol;
|
|
1994
|
-
skeleton && skeleton.overflowCache.forValue((row2, col2, value) => {
|
|
1995
|
-
Rectangle.contains(value, { startColumn: currentCol, endColumn: currentCol, startRow: currentRow, endRow: currentRow }) && (targetRow = row2, targetCol = col2);
|
|
1996
|
-
});
|
|
1997
|
-
const { viewPermission, editPermission, copyPermission } = this._getLinkPermission(currentCell);
|
|
1998
|
-
if (!viewPermission || !currentCell.customRange) {
|
|
1999
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
2000
|
-
return;
|
|
2001
|
-
}
|
|
2002
|
-
this._sheetsHyperLinkPopupService.showPopup({
|
|
2003
|
-
row: targetRow,
|
|
2004
|
-
col: targetCol,
|
|
2005
|
-
editPermission,
|
|
2006
|
-
copyPermission,
|
|
2007
|
-
customRange: currentCell.customRange,
|
|
2008
|
-
customRangeRect: currentCell.rect,
|
|
2009
|
-
type: HyperLinkEditSourceType.VIEWING,
|
|
2010
|
-
unitId,
|
|
2011
|
-
subUnitId
|
|
2012
|
-
});
|
|
2013
|
-
})
|
|
2014
|
-
);
|
|
2015
|
-
}
|
|
2016
|
-
_initHoverEditingListener() {
|
|
2017
|
-
let subscribe = null;
|
|
2018
|
-
this.disposeWithMe(
|
|
2019
|
-
this._editorBridgeService.currentEditCellState$.pipe(mergeMap((state) => this._editorBridgeService.visible$.pipe(map((visible) => ({ visible, state }))))).subscribe(({ visible, state }) => {
|
|
2020
|
-
if (!state || state.editorUnitId !== DOCS_NORMAL_EDITOR_UNIT_ID_KEY)
|
|
2021
|
-
return;
|
|
2022
|
-
if (!visible.visible) {
|
|
2023
|
-
subscribe == null || subscribe.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(HyperLinkEditSourceType.EDITING), this._sheetsHyperLinkPopupService.endEditing(HyperLinkEditSourceType.EDITING);
|
|
2024
|
-
return;
|
|
2025
|
-
}
|
|
2026
|
-
const { editorUnitId, unitId, sheetId, row, column } = state, renderer = this._renderManagerService.getRenderById(editorUnitId);
|
|
2027
|
-
if (!renderer)
|
|
2028
|
-
return;
|
|
2029
|
-
const { editPermission, viewPermission, copyPermission } = this._getLinkPermission({ unitId, subUnitId: sheetId, row, col: column }), docEventService = renderer.with(DocEventManagerService);
|
|
2030
|
-
viewPermission && (subscribe == null || subscribe.unsubscribe(), subscribe = docEventService.hoverCustomRanges$.pipe(debounceTime(200)).subscribe((customRanges) => {
|
|
2031
|
-
var _a15, _b;
|
|
2032
|
-
const customRange = customRanges.find((customRange2) => customRange2.range.rangeType === CustomRangeType.HYPERLINK);
|
|
2033
|
-
if (!customRange) {
|
|
2034
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
2035
|
-
return;
|
|
2036
|
-
}
|
|
2037
|
-
const rect = customRange.rects[customRange.rects.length - 1];
|
|
2038
|
-
if (!((_b = (_a15 = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _a15.with(SheetSkeletonManagerService).getWorksheetSkeleton(sheetId)) == null ? void 0 : _b.skeleton) || !rect)
|
|
2039
|
-
return;
|
|
2040
|
-
const canvasClientRect = renderer.engine.getCanvasElement().getBoundingClientRect();
|
|
2041
|
-
this._sheetsHyperLinkPopupService.showPopup({
|
|
2042
|
-
unitId,
|
|
2043
|
-
subUnitId: sheetId,
|
|
2044
|
-
row,
|
|
2045
|
-
col: column,
|
|
2046
|
-
customRange: customRange.range,
|
|
2047
|
-
customRangeRect: {
|
|
2048
|
-
left: rect.left + canvasClientRect.left,
|
|
2049
|
-
top: rect.top + canvasClientRect.top,
|
|
2050
|
-
bottom: rect.bottom + canvasClientRect.top,
|
|
2051
|
-
right: rect.right + canvasClientRect.left
|
|
2052
|
-
},
|
|
2053
|
-
editPermission,
|
|
2054
|
-
copyPermission,
|
|
2055
|
-
type: HyperLinkEditSourceType.EDITING
|
|
2056
|
-
});
|
|
2057
|
-
}));
|
|
2058
|
-
})
|
|
2059
|
-
), this.disposeWithMe(() => {
|
|
2060
|
-
subscribe == null || subscribe.unsubscribe();
|
|
2061
|
-
});
|
|
2062
|
-
}
|
|
2063
|
-
_initZenEditor() {
|
|
2064
|
-
this.disposeWithMe(
|
|
2065
|
-
this._zenZoneService.visible$.subscribe((visible) => {
|
|
2066
|
-
visible && (this._sheetsHyperLinkPopupService.hideCurrentPopup(HyperLinkEditSourceType.VIEWING), this._sheetsHyperLinkPopupService.hideCurrentPopup(HyperLinkEditSourceType.EDITING), this._sheetsHyperLinkPopupService.endEditing(HyperLinkEditSourceType.EDITING), this._sheetsHyperLinkPopupService.hideCurrentPopup(HyperLinkEditSourceType.VIEWING));
|
|
2067
|
-
})
|
|
2068
|
-
), this.disposeWithMe(
|
|
2069
|
-
this._univerInstanceService.focused$.pipe(
|
|
2070
|
-
mergeMap((id) => {
|
|
2071
|
-
const render2 = id === DOCS_ZEN_EDITOR_UNIT_ID_KEY ? this._renderManagerService.getRenderById(id) : null;
|
|
2072
|
-
return render2 ? render2.with(DocEventManagerService).hoverCustomRanges$.pipe(debounceTime(200)) : new Observable((sub) => {
|
|
2073
|
-
sub.next(null);
|
|
2074
|
-
});
|
|
2075
|
-
})
|
|
2076
|
-
).subscribe((value) => {
|
|
2077
|
-
const range = value == null ? void 0 : value.find((range2) => range2.range.rangeType === CustomRangeType.HYPERLINK), state = this._editorBridgeService.getEditCellState();
|
|
2078
|
-
if (range && state) {
|
|
2079
|
-
const { unitId, sheetId, row, column } = state, { editPermission, viewPermission, copyPermission } = this._getLinkPermission({ unitId, subUnitId: sheetId, row, col: column });
|
|
2080
|
-
viewPermission && this._sheetsHyperLinkPopupService.showPopup({
|
|
2081
|
-
type: HyperLinkEditSourceType.ZEN_EDITOR,
|
|
2082
|
-
unitId,
|
|
2083
|
-
subUnitId: sheetId,
|
|
2084
|
-
row,
|
|
2085
|
-
col: column,
|
|
2086
|
-
customRange: range.range,
|
|
2087
|
-
editPermission,
|
|
2088
|
-
copyPermission
|
|
2089
|
-
});
|
|
2090
|
-
} else
|
|
2091
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup(HyperLinkEditSourceType.ZEN_EDITOR);
|
|
2092
|
-
})
|
|
2093
|
-
);
|
|
2094
|
-
}
|
|
2095
|
-
_initTextSelectionListener() {
|
|
2096
|
-
this.disposeWithMe(
|
|
2097
|
-
this._textSelectionManagerService.textSelection$.subscribe((selection) => {
|
|
2098
|
-
selection && selection.unitId === DOCS_NORMAL_EDITOR_UNIT_ID_KEY && this._sheetsHyperLinkPopupService.endEditing(HyperLinkEditSourceType.EDITING);
|
|
2099
|
-
})
|
|
2100
|
-
);
|
|
2101
|
-
}
|
|
2102
|
-
_initCommandListener() {
|
|
2103
|
-
const HIDE_COMMAND_LIST = [ClearSelectionContentCommand.id, ClearSelectionAllCommand.id, ClearSelectionFormatCommand.id];
|
|
2104
|
-
this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
2105
|
-
HIDE_COMMAND_LIST.includes(command.id) && this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
2106
|
-
}));
|
|
2107
|
-
}
|
|
2108
|
-
}, __name(_a8, "SheetsHyperLinkPopupController"), _a8);
|
|
2109
|
-
SheetsHyperLinkPopupController = __decorateClass$6([
|
|
2110
|
-
OnLifecycle(LifecycleStages.Rendered, SheetsHyperLinkPopupController),
|
|
2111
|
-
__decorateParam$6(0, Inject(HoverManagerService)),
|
|
2112
|
-
__decorateParam$6(1, Inject(SheetsHyperLinkPopupService)),
|
|
2113
|
-
__decorateParam$6(2, Inject(IRenderManagerService)),
|
|
2114
|
-
__decorateParam$6(3, Inject(IPermissionService)),
|
|
2115
|
-
__decorateParam$6(4, Inject(SheetPermissionInterceptorBaseController)),
|
|
2116
|
-
__decorateParam$6(5, ICommandService),
|
|
2117
|
-
__decorateParam$6(6, IEditorBridgeService),
|
|
2118
|
-
__decorateParam$6(7, Inject(DocSelectionManagerService)),
|
|
2119
|
-
__decorateParam$6(8, IUniverInstanceService),
|
|
2120
|
-
__decorateParam$6(9, IZenZoneService)
|
|
2121
|
-
], SheetsHyperLinkPopupController);
|
|
2122
|
-
const menuSchema = {
|
|
2123
|
-
[RibbonStartGroup.OTHERS]: {
|
|
2124
|
-
[InsertHyperLinkToolbarOperation.id]: {
|
|
2125
|
-
order: 2,
|
|
2126
|
-
menuItemFactory: insertLinkMenuToolbarFactory
|
|
2127
|
-
},
|
|
2128
|
-
[genZenEditorMenuId(InsertHyperLinkToolbarOperation.id)]: {
|
|
2129
|
-
order: 2,
|
|
2130
|
-
menuItemFactory: zenEditorInsertLinkMenuToolbarFactory
|
|
2131
|
-
}
|
|
2132
|
-
},
|
|
2133
|
-
[ContextMenuPosition.MAIN_AREA]: {
|
|
2134
|
-
[ContextMenuGroup.OTHERS]: {
|
|
2135
|
-
order: 1,
|
|
2136
|
-
[InsertHyperLinkToolbarOperation.id]: {
|
|
2137
|
-
order: 0,
|
|
2138
|
-
menuItemFactory: insertLinkMenuFactory
|
|
2139
|
-
},
|
|
2140
|
-
[genZenEditorMenuId(InsertHyperLinkToolbarOperation.id)]: {
|
|
2141
|
-
order: 0,
|
|
2142
|
-
menuItemFactory: zenEditorInsertLinkMenuFactory
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
};
|
|
2147
|
-
var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2148
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2149
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
2150
|
-
return kind && result && __defProp$5(target, key, result), result;
|
|
2151
|
-
}, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$5"), _a9;
|
|
2152
|
-
let SheetsHyperLinkUIController = (_a9 = class extends Disposable {
|
|
2153
|
-
constructor(_componentManager, _commandService, _menuManagerService, _injector, _shortcutService) {
|
|
2154
|
-
super(), this._componentManager = _componentManager, this._commandService = _commandService, this._menuManagerService = _menuManagerService, this._injector = _injector, this._shortcutService = _shortcutService, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
|
|
2155
|
-
}
|
|
2156
|
-
_initComponents() {
|
|
2157
|
-
[
|
|
2158
|
-
[CellLinkPopup, CellLinkPopup.componentKey],
|
|
2159
|
-
[CellLinkEdit, CellLinkEdit.componentKey],
|
|
2160
|
-
[LinkSingle, "LinkSingle"]
|
|
2161
|
-
].forEach(([comp, key]) => {
|
|
2162
|
-
this._componentManager.register(key, comp);
|
|
2163
|
-
});
|
|
2164
|
-
}
|
|
2165
|
-
_initCommands() {
|
|
2166
|
-
[
|
|
2167
|
-
OpenHyperLinkEditPanelOperation,
|
|
2168
|
-
CloseHyperLinkPopupOperation,
|
|
2169
|
-
InsertHyperLinkOperation,
|
|
2170
|
-
InsertHyperLinkToolbarOperation,
|
|
2171
|
-
AddHyperLinkCommand,
|
|
2172
|
-
UpdateHyperLinkCommand,
|
|
2173
|
-
CancelHyperLinkCommand,
|
|
2174
|
-
UpdateRichHyperLinkCommand,
|
|
2175
|
-
CancelRichHyperLinkCommand,
|
|
2176
|
-
AddRichHyperLinkCommand
|
|
2177
|
-
].forEach((command) => {
|
|
2178
|
-
this._commandService.registerCommand(command);
|
|
2179
|
-
});
|
|
2180
|
-
}
|
|
2181
|
-
_initMenus() {
|
|
2182
|
-
this._menuManagerService.mergeMenu(menuSchema);
|
|
2183
|
-
}
|
|
2184
|
-
_initShortCut() {
|
|
2185
|
-
this._shortcutService.registerShortcut(InsertLinkShortcut);
|
|
2186
|
-
}
|
|
2187
|
-
}, __name(_a9, "SheetsHyperLinkUIController"), _a9);
|
|
2188
|
-
SheetsHyperLinkUIController = __decorateClass$5([
|
|
2189
|
-
OnLifecycle(LifecycleStages.Ready, SheetsHyperLinkUIController),
|
|
2190
|
-
__decorateParam$5(0, Inject(ComponentManager)),
|
|
2191
|
-
__decorateParam$5(1, ICommandService),
|
|
2192
|
-
__decorateParam$5(2, IMenuManagerService),
|
|
2193
|
-
__decorateParam$5(3, Inject(Injector)),
|
|
2194
|
-
__decorateParam$5(4, Inject(IShortcutService))
|
|
2195
|
-
], SheetsHyperLinkUIController);
|
|
2196
|
-
var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2197
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2198
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
2199
|
-
return kind && result && __defProp$4(target, key, result), result;
|
|
2200
|
-
}, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$4"), _a10;
|
|
2201
|
-
let SheetsHyperLinkAutoFillController = (_a10 = class extends Disposable {
|
|
2202
|
-
constructor(_autoFillService, _hyperLinkModel) {
|
|
2203
|
-
super(), this._autoFillService = _autoFillService, this._hyperLinkModel = _hyperLinkModel, this._initAutoFill();
|
|
2204
|
-
}
|
|
2205
|
-
// eslint-disable-next-line max-lines-per-function
|
|
2206
|
-
_initAutoFill() {
|
|
2207
|
-
const noopReturnFunc = /* @__PURE__ */ __name(() => ({ redos: [], undos: [] }), "noopReturnFunc"), generalApplyFunc = /* @__PURE__ */ __name((location2, applyType) => {
|
|
2208
|
-
const { source: sourceRange, target: targetRange, unitId, subUnitId } = location2, virtualRange = virtualizeDiscreteRanges([sourceRange, targetRange]), [vSourceRange, vTargetRange] = virtualRange.ranges, { mapFunc } = virtualRange, sourceStartCell = {
|
|
2209
|
-
row: vSourceRange.startRow,
|
|
2210
|
-
col: vSourceRange.startColumn
|
|
2211
|
-
}, repeats = getAutoFillRepeatRange(vSourceRange, vTargetRange), redos = [], undos = [];
|
|
2212
|
-
return repeats.forEach((repeat) => {
|
|
2213
|
-
const targetStartCell = repeat.repeatStartCell, relativeRange = repeat.relativeRange, sourceRange2 = {
|
|
2214
|
-
startRow: sourceStartCell.row,
|
|
2215
|
-
startColumn: sourceStartCell.col,
|
|
2216
|
-
endColumn: sourceStartCell.col,
|
|
2217
|
-
endRow: sourceStartCell.row
|
|
2218
|
-
}, targetRange2 = {
|
|
2219
|
-
startRow: targetStartCell.row,
|
|
2220
|
-
startColumn: targetStartCell.col,
|
|
2221
|
-
endColumn: targetStartCell.col,
|
|
2222
|
-
endRow: targetStartCell.row
|
|
2223
|
-
};
|
|
2224
|
-
Range.foreach(relativeRange, (row, col) => {
|
|
2225
|
-
const sourcePositionRange = Rectangle.getPositionRange(
|
|
2226
|
-
{
|
|
2227
|
-
startRow: row,
|
|
2228
|
-
startColumn: col,
|
|
2229
|
-
endColumn: col,
|
|
2230
|
-
endRow: row
|
|
2231
|
-
},
|
|
2232
|
-
sourceRange2
|
|
2233
|
-
), { row: sourceRow, col: sourceCol } = mapFunc(sourcePositionRange.startRow, sourcePositionRange.startColumn), link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, sourceRow, sourceCol), targetPositionRange = Rectangle.getPositionRange(
|
|
2234
|
-
{
|
|
2235
|
-
startRow: row,
|
|
2236
|
-
startColumn: col,
|
|
2237
|
-
endColumn: col,
|
|
2238
|
-
endRow: row
|
|
2239
|
-
},
|
|
2240
|
-
targetRange2
|
|
2241
|
-
), { row: targetRow, col: targetCol } = mapFunc(targetPositionRange.startRow, targetPositionRange.startColumn), id = Tools.generateRandomId(), currentLink = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, targetRow, targetCol);
|
|
2242
|
-
currentLink && redos.push({
|
|
2243
|
-
id: RemoveHyperLinkMutation.id,
|
|
2244
|
-
params: {
|
|
2245
|
-
unitId,
|
|
2246
|
-
subUnitId,
|
|
2247
|
-
id: currentLink.id
|
|
2248
|
-
}
|
|
2249
|
-
}), (APPLY_TYPE.COPY === applyType || APPLY_TYPE.SERIES === applyType) && link && (redos.push({
|
|
2250
|
-
id: AddHyperLinkMutation.id,
|
|
2251
|
-
params: {
|
|
2252
|
-
unitId,
|
|
2253
|
-
subUnitId,
|
|
2254
|
-
link: {
|
|
2255
|
-
...link,
|
|
2256
|
-
id,
|
|
2257
|
-
row: targetRow,
|
|
2258
|
-
column: targetCol
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
}), undos.push({
|
|
2262
|
-
id: RemoveHyperLinkMutation.id,
|
|
2263
|
-
params: {
|
|
2264
|
-
unitId,
|
|
2265
|
-
subUnitId,
|
|
2266
|
-
id
|
|
2267
|
-
}
|
|
2268
|
-
})), currentLink && undos.push({
|
|
2269
|
-
id: AddHyperLinkMutation.id,
|
|
2270
|
-
params: {
|
|
2271
|
-
unitId,
|
|
2272
|
-
subUnitId,
|
|
2273
|
-
link: currentLink
|
|
2274
|
-
}
|
|
2275
|
-
});
|
|
2276
|
-
});
|
|
2277
|
-
}), {
|
|
2278
|
-
undos,
|
|
2279
|
-
redos
|
|
2280
|
-
};
|
|
2281
|
-
}, "generalApplyFunc"), hook = {
|
|
2282
|
-
id: SHEET_HYPER_LINK_UI_PLUGIN,
|
|
2283
|
-
onFillData: /* @__PURE__ */ __name((location2, direction, applyType) => applyType === APPLY_TYPE.COPY || applyType === APPLY_TYPE.ONLY_FORMAT || applyType === APPLY_TYPE.SERIES ? generalApplyFunc(location2, applyType) : noopReturnFunc(), "onFillData")
|
|
2284
|
-
};
|
|
2285
|
-
this.disposeWithMe(this._autoFillService.addHook(hook));
|
|
2286
|
-
}
|
|
2287
|
-
}, __name(_a10, "SheetsHyperLinkAutoFillController"), _a10);
|
|
2288
|
-
SheetsHyperLinkAutoFillController = __decorateClass$4([
|
|
2289
|
-
OnLifecycle(LifecycleStages.Ready, SheetsHyperLinkAutoFillController),
|
|
2290
|
-
__decorateParam$4(0, IAutoFillService),
|
|
2291
|
-
__decorateParam$4(1, Inject(HyperLinkModel))
|
|
2292
|
-
], SheetsHyperLinkAutoFillController);
|
|
2293
|
-
var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2294
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2295
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
2296
|
-
return kind && result && __defProp$3(target, key, result), result;
|
|
2297
|
-
}, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$3"), _a11;
|
|
2298
|
-
let SheetHyperLinkUrlController = (_a11 = class extends Disposable {
|
|
2299
|
-
constructor(_resolverService) {
|
|
2300
|
-
super(), this._resolverService = _resolverService, this._handleInitUrl();
|
|
2301
|
-
}
|
|
2302
|
-
_handleInitUrl() {
|
|
2303
|
-
const hash = location.hash;
|
|
2304
|
-
hash && this._resolverService.parseHyperLink(hash).handler();
|
|
2305
|
-
}
|
|
2306
|
-
}, __name(_a11, "SheetHyperLinkUrlController"), _a11);
|
|
2307
|
-
SheetHyperLinkUrlController = __decorateClass$3([
|
|
2308
|
-
OnLifecycle(LifecycleStages.Rendered, SheetHyperLinkUrlController),
|
|
2309
|
-
__decorateParam$3(0, Inject(SheetsHyperLinkResolverService))
|
|
2310
|
-
], SheetHyperLinkUrlController);
|
|
2311
|
-
var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2312
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2313
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
2314
|
-
return kind && result && __defProp$2(target, key, result), result;
|
|
2315
|
-
}, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a12;
|
|
2316
|
-
let SheetsHyperLinkPermissionController = (_a12 = class extends Disposable {
|
|
2317
|
-
constructor(_localeService, _commandService, _sheetPermissionInterceptorBaseController) {
|
|
2318
|
-
super(), this._localeService = _localeService, this._commandService = _commandService, this._sheetPermissionInterceptorBaseController = _sheetPermissionInterceptorBaseController, this._commandExecutedListener();
|
|
2319
|
-
}
|
|
2320
|
-
_commandExecutedListener() {
|
|
2321
|
-
this.disposeWithMe(
|
|
2322
|
-
this._commandService.beforeCommandExecuted((command) => {
|
|
2323
|
-
command.id === InsertLinkShortcut.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
2324
|
-
workbookTypes: [WorkbookEditablePermission],
|
|
2325
|
-
rangeTypes: [RangeProtectionPermissionEditPoint],
|
|
2326
|
-
worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission]
|
|
2327
|
-
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
2328
|
-
})
|
|
2329
|
-
);
|
|
2330
|
-
}
|
|
2331
|
-
}, __name(_a12, "SheetsHyperLinkPermissionController"), _a12);
|
|
2332
|
-
SheetsHyperLinkPermissionController = __decorateClass$2([
|
|
2333
|
-
OnLifecycle(LifecycleStages.Rendered, SheetsHyperLinkPermissionController),
|
|
2334
|
-
__decorateParam$2(0, Inject(LocaleService)),
|
|
2335
|
-
__decorateParam$2(1, ICommandService),
|
|
2336
|
-
__decorateParam$2(2, Inject(SheetPermissionInterceptorBaseController))
|
|
2337
|
-
], SheetsHyperLinkPermissionController);
|
|
2338
|
-
var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2339
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2340
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
2341
|
-
return kind && result && __defProp$1(target, key, result), result;
|
|
2342
|
-
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a13;
|
|
2343
|
-
let SheetsHyperLinkRichTextRefRangeController = (_a13 = class extends Disposable {
|
|
2344
|
-
constructor(_commandService, _univerInstanceService, _refRangeService) {
|
|
2345
|
-
super();
|
|
2346
|
-
__publicField(this, "_refRangeMap", /* @__PURE__ */ new Map());
|
|
2347
|
-
this._commandService = _commandService, this._univerInstanceService = _univerInstanceService, this._refRangeService = _refRangeService, this._initWorkbookLoad(), this._initWorkbookUnload(), this._initSetRangesListener();
|
|
2348
|
-
}
|
|
2349
|
-
_enusreMap(unitId, subUnitId) {
|
|
2350
|
-
let unitMap = this._refRangeMap.get(unitId);
|
|
2351
|
-
unitMap || (unitMap = /* @__PURE__ */ new Map(), this._refRangeMap.set(unitId, unitMap));
|
|
2352
|
-
let subUnitMap = unitMap.get(subUnitId);
|
|
2353
|
-
return subUnitMap || (subUnitMap = new ObjectMatrix(), unitMap.set(subUnitId, subUnitMap)), subUnitMap;
|
|
2354
|
-
}
|
|
2355
|
-
_isLegalRangeUrl(unitId, payload) {
|
|
2356
|
-
var _a15, _b, _c;
|
|
2357
|
-
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
2358
|
-
if (!workbook)
|
|
2359
|
-
return null;
|
|
2360
|
-
if (payload && payload.startsWith("#")) {
|
|
2361
|
-
const search = new URLSearchParams(payload.slice(1)), searchObj = {
|
|
2362
|
-
gid: (_a15 = search.get("gid")) != null ? _a15 : "",
|
|
2363
|
-
range: (_b = search.get("range")) != null ? _b : "",
|
|
2364
|
-
rangeid: (_c = search.get("rangeid")) != null ? _c : ""
|
|
2365
|
-
};
|
|
2366
|
-
if (searchObj.range && searchObj.gid) {
|
|
2367
|
-
const subUnitId = searchObj.gid, worksheet = workbook.getSheetBySheetId(subUnitId);
|
|
2368
|
-
if (!worksheet)
|
|
2369
|
-
return null;
|
|
2370
|
-
const range = deserializeRangeWithSheet(searchObj.range).range;
|
|
2371
|
-
if (isValidRange(range, worksheet) && searchObj.range !== ERROR_RANGE)
|
|
2372
|
-
return range;
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2375
|
-
return null;
|
|
2376
|
-
}
|
|
2377
|
-
_registerRange(unitId, subUnitId, row, col, p2) {
|
|
2378
|
-
var _a15, _b, _c, _d;
|
|
2379
|
-
const map2 = this._enusreMap(unitId, subUnitId), data = Tools.deepClone(p2), handleRangeChange = /* @__PURE__ */ __name((commandInfo) => {
|
|
2380
|
-
var _a16, _b2;
|
|
2381
|
-
const dataCopy = Tools.deepClone(data);
|
|
2382
|
-
(_b2 = (_a16 = dataCopy.body) == null ? void 0 : _a16.customRanges) == null || _b2.forEach((customRange) => {
|
|
2383
|
-
var _a17;
|
|
2384
|
-
if (customRange.rangeType === CustomRangeType.HYPERLINK) {
|
|
2385
|
-
const payload = (_a17 = customRange.properties) == null ? void 0 : _a17.url, range = this._isLegalRangeUrl(unitId, payload);
|
|
2386
|
-
if (range) {
|
|
2387
|
-
const resultRange = handleDefaultRangeChangeWithEffectRefCommands(range, commandInfo), newPayload = `#gid=${subUnitId}&range=${resultRange ? serializeRange(resultRange) : ERROR_RANGE}`;
|
|
2388
|
-
customRange.properties.url = newPayload;
|
|
2389
|
-
}
|
|
2390
|
-
}
|
|
2391
|
-
});
|
|
2392
|
-
const position = handleDefaultRangeChangeWithEffectRefCommands({ startRow: row, endRow: row, startColumn: col, endColumn: col }, commandInfo);
|
|
2393
|
-
return position ? {
|
|
2394
|
-
redos: [{
|
|
2395
|
-
id: SetRangeValuesMutation.id,
|
|
2396
|
-
params: {
|
|
2397
|
-
unitId,
|
|
2398
|
-
subUnitId,
|
|
2399
|
-
cellValue: {
|
|
2400
|
-
[position.startRow]: {
|
|
2401
|
-
[position.startColumn]: {
|
|
2402
|
-
p: dataCopy
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
}
|
|
2407
|
-
}],
|
|
2408
|
-
undos: [
|
|
2409
|
-
{
|
|
2410
|
-
id: SetRangeValuesMutation.id,
|
|
2411
|
-
params: {
|
|
2412
|
-
unitId,
|
|
2413
|
-
subUnitId,
|
|
2414
|
-
cellValue: {
|
|
2415
|
-
[row]: {
|
|
2416
|
-
[col]: {
|
|
2417
|
-
p: data
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
]
|
|
2424
|
-
} : {
|
|
2425
|
-
redos: [],
|
|
2426
|
-
undos: []
|
|
2427
|
-
};
|
|
2428
|
-
}, "handleRangeChange");
|
|
2429
|
-
if ((_b = (_a15 = p2.body) == null ? void 0 : _a15.customRanges) != null && _b.some((customRange) => {
|
|
2430
|
-
var _a16;
|
|
2431
|
-
return customRange.rangeType === CustomRangeType.HYPERLINK && this._isLegalRangeUrl(unitId, (_a16 = customRange.properties) == null ? void 0 : _a16.url);
|
|
2432
|
-
})) {
|
|
2433
|
-
const disposableCollection = new DisposableCollection();
|
|
2434
|
-
(_d = (_c = p2.body) == null ? void 0 : _c.customRanges) == null || _d.forEach((customRange) => {
|
|
2435
|
-
var _a16;
|
|
2436
|
-
if (customRange.rangeType === CustomRangeType.HYPERLINK) {
|
|
2437
|
-
const payload = (_a16 = customRange.properties) == null ? void 0 : _a16.url, range = this._isLegalRangeUrl(unitId, payload);
|
|
2438
|
-
range && disposableCollection.add(this._refRangeService.registerRefRange(range, handleRangeChange, unitId, subUnitId));
|
|
2439
|
-
}
|
|
2440
|
-
}), map2.setValue(row, col, disposableCollection);
|
|
2441
|
-
}
|
|
2442
|
-
}
|
|
2443
|
-
_initWorkbookLoad() {
|
|
2444
|
-
const handleWorkbook = /* @__PURE__ */ __name((workbook) => {
|
|
2445
|
-
const unitId = workbook.getUnitId();
|
|
2446
|
-
workbook.getSheets().forEach((sheet) => {
|
|
2447
|
-
const subUnitId = sheet.getSheetId(), map2 = this._enusreMap(unitId, subUnitId);
|
|
2448
|
-
sheet.getCellMatrix().forValue((row, col, cell) => {
|
|
2449
|
-
const dispose = map2.getValue(row, col);
|
|
2450
|
-
dispose && dispose.dispose(), cell && cell.p && this._registerRange(unitId, subUnitId, row, col, cell.p);
|
|
2451
|
-
});
|
|
2452
|
-
});
|
|
2453
|
-
}, "handleWorkbook");
|
|
2454
|
-
this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => {
|
|
2455
|
-
handleWorkbook(workbook);
|
|
2456
|
-
}), this.disposeWithMe(
|
|
2457
|
-
this._univerInstanceService.unitAdded$.subscribe((unit) => {
|
|
2458
|
-
unit.type === UniverInstanceType.UNIVER_SHEET && handleWorkbook(unit);
|
|
2459
|
-
})
|
|
2460
|
-
);
|
|
2461
|
-
}
|
|
2462
|
-
_initWorkbookUnload() {
|
|
2463
|
-
this._univerInstanceService.unitDisposed$.subscribe((unit) => {
|
|
2464
|
-
if (unit.type === UniverInstanceType.UNIVER_SHEET) {
|
|
2465
|
-
const workbook = unit, unitId = workbook.getUnitId();
|
|
2466
|
-
workbook.getSheets().forEach((sheet) => {
|
|
2467
|
-
const subUnitId = sheet.getSheetId();
|
|
2468
|
-
this._enusreMap(unitId, subUnitId).forValue((row, col, dispose) => {
|
|
2469
|
-
dispose && dispose.dispose();
|
|
2470
|
-
});
|
|
2471
|
-
}), this._refRangeMap.delete(unitId);
|
|
2472
|
-
}
|
|
2473
|
-
});
|
|
2474
|
-
}
|
|
2475
|
-
_initSetRangesListener() {
|
|
2476
|
-
this.disposeWithMe(
|
|
2477
|
-
this._commandService.onCommandExecuted((commandInfo) => {
|
|
2478
|
-
if (commandInfo.id === SetRangeValuesMutation.id) {
|
|
2479
|
-
const params = commandInfo.params, { unitId, subUnitId, cellValue } = params, map2 = this._enusreMap(unitId, subUnitId);
|
|
2480
|
-
cellValue && new ObjectMatrix(cellValue).forValue((row, col, cell) => {
|
|
2481
|
-
const dispose = map2.getValue(row, col);
|
|
2482
|
-
dispose && dispose.dispose(), cell && cell.p && this._registerRange(unitId, subUnitId, row, col, cell.p);
|
|
2483
|
-
});
|
|
2484
|
-
}
|
|
2485
|
-
})
|
|
2486
|
-
);
|
|
2487
|
-
}
|
|
2488
|
-
}, __name(_a13, "SheetsHyperLinkRichTextRefRangeController"), _a13);
|
|
2489
|
-
SheetsHyperLinkRichTextRefRangeController = __decorateClass$1([
|
|
2490
|
-
OnLifecycle(LifecycleStages.Starting, SheetsHyperLinkRichTextRefRangeController),
|
|
2491
|
-
__decorateParam$1(0, ICommandService),
|
|
2492
|
-
__decorateParam$1(1, IUniverInstanceService),
|
|
2493
|
-
__decorateParam$1(2, Inject(RefRangeService))
|
|
2494
|
-
], SheetsHyperLinkRichTextRefRangeController);
|
|
2495
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
2496
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2497
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
2498
|
-
return kind && result && __defProp2(target, key, result), result;
|
|
2499
|
-
}, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), __publicField2 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField"), _a14;
|
|
2500
|
-
let UniverSheetsHyperLinkUIPlugin = (_a14 = class extends Plugin {
|
|
2501
|
-
constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _configService) {
|
|
2502
|
-
super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._configService = _configService;
|
|
2503
|
-
const { menu, ...rest } = this._config;
|
|
2504
|
-
menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
|
|
2505
|
-
}
|
|
2506
|
-
onStarting() {
|
|
2507
|
-
[
|
|
2508
|
-
[SheetsHyperLinkResolverService],
|
|
2509
|
-
[SheetsHyperLinkPopupService],
|
|
2510
|
-
[SheetsHyperLinkSidePanelService],
|
|
2511
|
-
[SheetsHyperLinkRemoveSheetController],
|
|
2512
|
-
[SheetsHyperLinkRenderManagerController],
|
|
2513
|
-
[SheetHyperLinkSetRangeController],
|
|
2514
|
-
[SheetsHyperLinkPopupController],
|
|
2515
|
-
[SheetsHyperLinkUIController],
|
|
2516
|
-
[SheetsHyperLinkAutoFillController],
|
|
2517
|
-
[SheetsHyperLinkCopyPasteController],
|
|
2518
|
-
[SheetsHyperLinkPermissionController],
|
|
2519
|
-
[SheetHyperLinkUrlController],
|
|
2520
|
-
[SheetsHyperLinkRichTextRefRangeController]
|
|
2521
|
-
].forEach((dep) => this._injector.add(dep));
|
|
2522
|
-
}
|
|
2523
|
-
onReady() {
|
|
2524
|
-
[
|
|
2525
|
-
[SheetsHyperLinkRenderController]
|
|
2526
|
-
].forEach((d) => this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, d));
|
|
2527
|
-
}
|
|
2528
|
-
}, __name(_a14, "UniverSheetsHyperLinkUIPlugin"), _a14);
|
|
2529
|
-
__publicField2(UniverSheetsHyperLinkUIPlugin, "pluginName", SHEET_HYPER_LINK_UI_PLUGIN);
|
|
2530
|
-
__publicField2(UniverSheetsHyperLinkUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
|
|
2531
|
-
UniverSheetsHyperLinkUIPlugin = __decorateClass([
|
|
2532
|
-
DependentOn(UniverSheetsHyperLinkPlugin, UniverDocsUIPlugin),
|
|
2533
|
-
__decorateParam(1, Inject(Injector)),
|
|
2534
|
-
__decorateParam(2, IRenderManagerService),
|
|
2535
|
-
__decorateParam(3, IConfigService)
|
|
2536
|
-
], UniverSheetsHyperLinkUIPlugin);
|
|
2537
|
-
export {
|
|
2538
|
-
AddHyperLinkCommand,
|
|
2539
|
-
CancelHyperLinkCommand,
|
|
2540
|
-
CloseHyperLinkPopupOperation,
|
|
2541
|
-
InsertHyperLinkOperation,
|
|
2542
|
-
InsertLinkShortcut,
|
|
2543
|
-
OpenHyperLinkEditPanelOperation,
|
|
2544
|
-
SheetsHyperLinkCopyPasteController,
|
|
2545
|
-
SheetsHyperLinkPopupService,
|
|
2546
|
-
SheetsHyperLinkResolverService,
|
|
2547
|
-
SheetsHyperLinkSidePanelService,
|
|
2548
|
-
UniverSheetsHyperLinkUIPlugin,
|
|
2549
|
-
UpdateHyperLinkCommand
|
|
2550
|
-
};
|
|
1
|
+
const _0x121662=_0x3a7e;(function(_0x58c135,_0x1eac9b){const _0x423ba4=_0x3a7e,_0x21fb98=_0x58c135();while(!![]){try{const _0x5ebd91=parseInt(_0x423ba4(0x3d7))/0x1*(-parseInt(_0x423ba4(0x2c6))/0x2)+-parseInt(_0x423ba4(0x2e0))/0x3+-parseInt(_0x423ba4(0x1d3))/0x4*(-parseInt(_0x423ba4(0x1bd))/0x5)+parseInt(_0x423ba4(0x3ba))/0x6*(parseInt(_0x423ba4(0x1de))/0x7)+-parseInt(_0x423ba4(0x20e))/0x8*(-parseInt(_0x423ba4(0x37f))/0x9)+-parseInt(_0x423ba4(0x230))/0xa+-parseInt(_0x423ba4(0x34d))/0xb*(-parseInt(_0x423ba4(0x20d))/0xc);if(_0x5ebd91===_0x1eac9b)break;else _0x21fb98['push'](_0x21fb98['shift']());}catch(_0x32d587){_0x21fb98['push'](_0x21fb98['shift']());}}}(_0x4837,0x428ed));var __defProp=Object['defineProperty'],__defNormalProp=(_0x52817a,_0x328ce2,_0x19b6a3)=>_0x328ce2 in _0x52817a?__defProp(_0x52817a,_0x328ce2,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x19b6a3}):_0x52817a[_0x328ce2]=_0x19b6a3,__name=(_0x4ac52a,_0x837ab9)=>__defProp(_0x4ac52a,_0x121662(0x33f),{'value':_0x837ab9,'configurable':!0x0}),__publicField=(_0x1edfd7,_0x19f545,_0xe5fa8f)=>__defNormalProp(_0x1edfd7,typeof _0x19f545!=_0x121662(0x2cc)?_0x19f545+'':_0x19f545,_0xe5fa8f);import{Tools,Inject,LocaleService,UniverInstanceType,isValidRange,IUniverInstanceService,ICommandService,IConfigService,RANGE_TYPE,Rectangle,Injector,Disposable,Range,ObjectMatrix,CommandType,IUndoRedoService,BuildTextUtils,DataStreamTreeTokenType,CustomRangeType,TextX,CellValueType,sequenceExecuteAsync,generateRandomId,getBodySlice,useDependency,IContextService,ThemeService,ColorKit,DisposableCollection,createInternalEditorID,FOCUSING_SHEET,DOCS_ZEN_EDITOR_UNIT_ID_KEY,sequenceExecute,useObservable as _0x30f2bd,DataValidationType,IPermissionService,DOCS_NORMAL_EDITOR_UNIT_ID_KEY,InterceptorEffectEnum,DependentOn,Plugin}from'@univerjs/core';import{SheetHyperLinkType,ERROR_RANGE,HyperLinkModel,RemoveHyperLinkMutation,AddHyperLinkMutation,UniverSheetsHyperLinkPlugin}from'@univerjs/sheets-hyper-link';import{ScrollToRangeOperation,COPY_TYPE,virtualizeDiscreteRanges,rangeToDiscreteRange,PREDEFINED_HOOK_NAME,getRepeatRange,ISheetClipboardService,SheetSkeletonManagerService,IEditorBridgeService,IMarkSelectionService,SheetCanvasPopManagerService,getEditingCustomRangePosition,getCustomRangePosition,whenSheetEditorFocused,getCurrentRangeDisable$,IAutoFillService,APPLY_TYPE,getAutoFillRepeatRange,SheetPermissionInterceptorBaseController,HoverManagerService,HoverRenderController}from'@univerjs/sheets-ui';import{MessageType,FormLayout,Input,Select,Button,Tooltip}from'@univerjs/design';import{deserializeRangeWithSheet,serializeRangeWithSheet,serializeRange,IDefinedNamesService,serializeRangeToRefString}from'@univerjs/engine-formula';import{SetSelectionsOperation,SetWorksheetActiveOperation,SetRangeValuesMutation,SetRangeValuesUndoMutationFactory,SheetsSelectionsService,getSheetCommandTarget,WorkbookEditablePermission,WorksheetEditPermission,WorksheetSetCellValuePermission,WorksheetInsertHyperlinkPermission,RangeProtectionPermissionEditPoint,WorkbookViewPermission,WorksheetViewPermission,RangeProtectionPermissionViewPoint,WorkbookCopyPermission,WorksheetCopyPermission,ClearSelectionContentCommand,ClearSelectionAllCommand,ClearSelectionFormatCommand,SheetInterceptorService,RemoveSheetCommand,INTERCEPTOR_POINT,RefRangeService,handleDefaultRangeChangeWithEffectRefCommands,SetRangeValuesCommand}from'@univerjs/sheets';import{IMessageService,useObservable,IZenZoneService,useEvent,KeyCode,MenuItemType,MenuPosition,MenuGroup,MetaKeys,getMenuHiddenObservable,RibbonStartGroup,ContextMenuPosition,ContextMenuGroup,ComponentManager,IShortcutService,IMenuManagerService}from'@univerjs/ui';import{DocSelectionManagerService}from'@univerjs/docs';import{Subject,BehaviorSubject,map,mergeMap,Observable,debounceTime}from'rxjs';import{addCustomRangeBySelectionFactory,replaceSelectionFactory,DocSelectionRenderService,RangeSelector,DocBackScrollRenderController,deleteCustomRangeFactory,DocCanvasPopManagerService,IEditorService,IRangeSelectorService,DocEventManagerService,UniverDocsUIPlugin}from'@univerjs/docs-ui';import _0xd5dee3,{useState,useMemo,useRef,useEffect,forwardRef,createElement}from'react';import{IRenderManagerService}from'@univerjs/engine-render';import _0x5881d5 from'clsx';function isLegalLink(_0x431ae2){const _0x20b2d5=_0x121662;return Tools[_0x20b2d5(0x380)](_0x431ae2);}__name(isLegalLink,_0x121662(0x21a));function hasProtocol(_0x1aceb1){const _0x1356f7=_0x121662;return/^[a-zA-Z]+:\/\//[_0x1356f7(0x31d)](_0x1aceb1);}__name(hasProtocol,_0x121662(0x398));function isEmail(_0x3f00e3){const _0x38ebbe=_0x121662;return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/[_0x38ebbe(0x31d)](_0x3f00e3);}__name(isEmail,_0x121662(0x27d));function serializeUrl(_0x512e17){const _0x47539a=_0x121662;if(isLegalLink(_0x512e17)){const _0x1c851b=hasProtocol(_0x512e17)?_0x512e17:isEmail(_0x512e17)?'mailto://'+_0x512e17:'http://'+_0x512e17;let _0x31abf8;try{_0x31abf8=new URL(_0x1c851b);}catch{return _0x512e17;}return _0x31abf8['hostname']===location[_0x47539a(0x1df)]&&_0x31abf8[_0x47539a(0x3cb)]===location[_0x47539a(0x3cb)]&&_0x31abf8[_0x47539a(0x313)]===location['protocol']&&_0x31abf8['pathname']===location[_0x47539a(0x3d9)]&&_0x31abf8[_0x47539a(0x340)]&&!_0x31abf8['search']?_0x31abf8['hash']:_0x1c851b;}return _0x512e17;}__name(serializeUrl,_0x121662(0x3cc));const PLUGIN_CONFIG_KEY=_0x121662(0x2a7),defaultPluginConfig={};var __defProp$c=Object[_0x121662(0x3c5)],__getOwnPropDesc$c=Object[_0x121662(0x2cd)],__decorateClass$c=__name((_0x64063e,_0x52969a,_0x1518f6,_0x26dee4)=>{const _0x3791e3=_0x121662;for(var _0x2b07ca=_0x26dee4>0x1?void 0x0:_0x26dee4?__getOwnPropDesc$c(_0x52969a,_0x1518f6):_0x52969a,_0x193cc1=_0x64063e[_0x3791e3(0x259)]-0x1,_0x44bbed;_0x193cc1>=0x0;_0x193cc1--)(_0x44bbed=_0x64063e[_0x193cc1])&&(_0x2b07ca=(_0x26dee4?_0x44bbed(_0x52969a,_0x1518f6,_0x2b07ca):_0x44bbed(_0x2b07ca))||_0x2b07ca);return _0x26dee4&&_0x2b07ca&&__defProp$c(_0x52969a,_0x1518f6,_0x2b07ca),_0x2b07ca;},_0x121662(0x348)),__decorateParam$c=__name((_0x5a3d38,_0x5af633)=>(_0x19b0bb,_0x2af55d)=>_0x5af633(_0x19b0bb,_0x2af55d,_0x5a3d38),_0x121662(0x31a));function getContainRange(_0x597ea9,_0xb595d7){const _0x232a72=_0x121662,_0x2042dd=_0xb595d7[_0x232a72(0x3b1)](),_0x294c2f=_0xb595d7[_0x232a72(0x1e4)]()-0x1,_0x269fe=_0xb595d7[_0x232a72(0x3b0)]()-0x1;if(_0x294c2f<_0x597ea9['endColumn']&&(_0x597ea9[_0x232a72(0x1ff)]=_0x294c2f),_0x269fe<_0x597ea9[_0x232a72(0x39f)]&&(_0x597ea9['endRow']=_0x269fe),_0x597ea9[_0x232a72(0x271)]===RANGE_TYPE[_0x232a72(0x228)]||RANGE_TYPE['ROW'])return _0x597ea9;const _0x30e97c=[];return _0x2042dd[_0x232a72(0x3bc)](_0x544f7a=>{const _0x18aeee=_0x232a72;Rectangle[_0x18aeee(0x36e)](_0x597ea9,_0x544f7a)&&_0x30e97c[_0x18aeee(0x2e2)](_0x544f7a);}),Rectangle['realUnion'](_0x597ea9,..._0x30e97c);}__name(getContainRange,_0x121662(0x31b));var _a;let SheetsHyperLinkResolverService=(_a=class{constructor(_0xe0a2fc,_0x48e81b,_0x38161f,_0x4b3bf1,_0x326562,_0x307eef){const _0x23feb7=_0x121662;this[_0x23feb7(0x384)]=_0xe0a2fc,this[_0x23feb7(0x1c1)]=_0x48e81b,this[_0x23feb7(0x334)]=_0x38161f,this[_0x23feb7(0x30e)]=_0x4b3bf1,this[_0x23feb7(0x27e)]=_0x326562,this['_configService']=_0x307eef;}[_0x121662(0x22b)](_0xe4a6e6){const _0x2a98ad=_0x121662;var _0x253c9a;const {gid:_0x12a0d2,range:_0x48fcef,rangeid:_0x52708a,unitid:_0x38a74f}=_0xe4a6e6,_0x3cf010=_0x38a74f?this[_0x2a98ad(0x384)][_0x2a98ad(0x289)](_0x38a74f,UniverInstanceType[_0x2a98ad(0x275)]):this[_0x2a98ad(0x384)][_0x2a98ad(0x344)](UniverInstanceType[_0x2a98ad(0x275)]),_0x3ad6f4={'type':SheetHyperLinkType[_0x2a98ad(0x2d2)],'name':this['_localeService']['t'](_0x2a98ad(0x1c4))};if(!_0x3cf010)return _0x3ad6f4;const _0x3b6ae6=_0x12a0d2?_0x3cf010[_0x2a98ad(0x2c8)](_0x12a0d2):_0x3cf010[_0x2a98ad(0x24c)](),_0x35fb32=(_0x253c9a=_0x3b6ae6==null?void 0x0:_0x3b6ae6[_0x2a98ad(0x2d7)]())!=null?_0x253c9a:'';if(_0x48fcef){if(!_0x3b6ae6)return _0x3ad6f4;const _0x375b03=deserializeRangeWithSheet(_0x48fcef)[_0x2a98ad(0x287)];return isValidRange(_0x375b03,_0x3b6ae6)&&_0x48fcef!==ERROR_RANGE?{'type':SheetHyperLinkType['RANGE'],'name':serializeRangeWithSheet(_0x35fb32,_0x375b03)}:_0x3ad6f4;}if(_0x52708a){const _0x267413=this[_0x2a98ad(0x334)][_0x2a98ad(0x274)](_0x3cf010[_0x2a98ad(0x34e)](),_0x52708a);return _0x267413?{'type':SheetHyperLinkType[_0x2a98ad(0x248)],'name':_0x267413[_0x2a98ad(0x310)]}:_0x3ad6f4;}if(_0x12a0d2){const _0xbabe87=_0x3cf010[_0x2a98ad(0x2c8)](_0x12a0d2);return _0xbabe87?{'type':SheetHyperLinkType[_0x2a98ad(0x3e0)],'name':_0xbabe87[_0x2a98ad(0x2d7)]()}:_0x3ad6f4;}return _0x3ad6f4;}[_0x121662(0x312)](_0x34238d){const _0x5a1a8c=_0x121662,{gid:_0x499978,range:_0x33a7cd,rangeid:_0x1b1beb}=_0x34238d,_0xed4a2b=this[_0x5a1a8c(0x384)][_0x5a1a8c(0x344)](UniverInstanceType[_0x5a1a8c(0x275)]);if(!_0xed4a2b)return;const _0xba0f60=_0xed4a2b['getUnitId']();if(_0x1b1beb&&this[_0x5a1a8c(0x3b5)](_0xba0f60,_0x1b1beb),!!_0x499978){if(_0x33a7cd){const _0x223846=deserializeRangeWithSheet(_0x33a7cd);isValidRange(_0x223846[_0x5a1a8c(0x287)])&&_0x33a7cd!==ERROR_RANGE&&this[_0x5a1a8c(0x34b)](_0xba0f60,_0x499978,_0x223846[_0x5a1a8c(0x287)]);return;}this['navigateToSheetById'](_0xba0f60,_0x499978);}}[_0x121662(0x350)](_0x5a2e4d,_0x3c596c,_0x3ee765){const _0x391e82=_0x121662;return'#'+SheetHyperLinkType[_0x391e82(0x3e0)]+'='+_0x3c596c+(_0x3ee765?'&'+(typeof _0x3ee765==_0x391e82(0x2aa)?SheetHyperLinkType[_0x391e82(0x248)]:SheetHyperLinkType['RANGE'])+'='+(typeof _0x3ee765=='string'?_0x3ee765:serializeRange(_0x3ee765)):'');}[_0x121662(0x326)](_0x14d5b8){const _0x39ebfe=_0x121662;var _0x368248,_0x19ad35,_0x6e1884,_0x53fe30;if(_0x14d5b8[_0x39ebfe(0x1e2)]('#')){const _0x5271d1=new URLSearchParams(_0x14d5b8[_0x39ebfe(0x3d1)](0x1)),_0x9dae64={'gid':(_0x368248=_0x5271d1['get']('gid'))!=null?_0x368248:'','range':(_0x19ad35=_0x5271d1['get'](_0x39ebfe(0x287)))!=null?_0x19ad35:'','rangeid':(_0x6e1884=_0x5271d1['get']('rangeid'))!=null?_0x6e1884:'','unitid':(_0x53fe30=_0x5271d1[_0x39ebfe(0x2e7)]('unitid'))!=null?_0x53fe30:''},_0x565237=this[_0x39ebfe(0x22b)](_0x9dae64);return{'type':_0x565237[_0x39ebfe(0x21c)],'name':_0x565237[_0x39ebfe(0x33f)],'url':_0x14d5b8,'searchObj':_0x9dae64,'handler':__name(()=>{const _0x1fdb54=_0x39ebfe;this[_0x1fdb54(0x312)](_0x9dae64);},_0x39ebfe(0x346))};}else return{'type':SheetHyperLinkType[_0x39ebfe(0x363)],'name':_0x14d5b8,'url':_0x14d5b8,'handler':__name(()=>{this['navigateToOtherWebsite'](_0x14d5b8);},_0x39ebfe(0x346)),'searchObj':null};}async['navigateToRange'](_0x427630,_0x5ae6a4,_0x3e861d){const _0x4dcb24=_0x121662,_0x1eff88=await this[_0x4dcb24(0x26a)](_0x427630,_0x5ae6a4);if(_0x1eff88){const _0x1b09a6=getContainRange(_0x3e861d,_0x1eff88);await this['_commandService'][_0x4dcb24(0x3d5)](SetSelectionsOperation['id'],{'unitId':_0x427630,'subUnitId':_0x5ae6a4,'selections':[{'range':_0x1b09a6}]}),await this['_commandService'][_0x4dcb24(0x3d5)](ScrollToRangeOperation['id'],{'range':_0x1b09a6});}}async['navigateToSheet'](_0x57fa09,_0x1eec64){const _0x497cc9=_0x121662,_0x2c6b95=this[_0x497cc9(0x384)][_0x497cc9(0x289)](_0x57fa09,UniverInstanceType[_0x497cc9(0x275)]);if(!_0x2c6b95)return!0x1;const _0x33385a=_0x2c6b95['getActiveSheet']();if((_0x33385a==null?void 0x0:_0x33385a[_0x497cc9(0x2d7)]())===_0x1eec64)return!0x0;const _0x2324e7=_0x2c6b95[_0x497cc9(0x23c)](_0x1eec64);if(!_0x2324e7){this['_messageService'][_0x497cc9(0x393)]({'content':this['_localeService']['t'](_0x497cc9(0x1ca)),'type':MessageType[_0x497cc9(0x208)]});return;}const _0xc5cee4=_0x2324e7['getSheetId']();return _0x2c6b95[_0x497cc9(0x32b)]()[_0x497cc9(0x211)](_0xc5cee4)>-0x1&&this[_0x497cc9(0x30e)][_0x497cc9(0x393)]({'content':this[_0x497cc9(0x27e)]['t']('hyperLink.message.hiddenSheet'),'type':MessageType[_0x497cc9(0x208)]}),await this[_0x497cc9(0x1c1)][_0x497cc9(0x3d5)](SetWorksheetActiveOperation['id'],{'unitId':_0x57fa09,'subUnitId':_0xc5cee4});}async[_0x121662(0x26a)](_0x31d2b7,_0x4a973c){const _0x103cc9=_0x121662,_0x3e2e78=this[_0x103cc9(0x384)][_0x103cc9(0x289)](_0x31d2b7,UniverInstanceType[_0x103cc9(0x275)]);if(!_0x3e2e78)return!0x1;const _0x16f383=_0x3e2e78['getActiveSheet']();if(!_0x16f383)return!0x1;if(_0x16f383['getSheetId']()===_0x4a973c)return _0x16f383;const _0x589ac8=_0x3e2e78[_0x103cc9(0x2c8)](_0x4a973c);return _0x589ac8?_0x3e2e78[_0x103cc9(0x32b)]()[_0x103cc9(0x211)](_0x4a973c)>-0x1?(this[_0x103cc9(0x30e)][_0x103cc9(0x393)]({'content':this['_localeService']['t'](_0x103cc9(0x31c)),'type':MessageType['Error']}),!0x1):await this[_0x103cc9(0x1c1)][_0x103cc9(0x3d5)](SetWorksheetActiveOperation['id'],{'unitId':_0x31d2b7,'subUnitId':_0x4a973c})?_0x589ac8:!0x1:(this['_messageService'][_0x103cc9(0x393)]({'content':this[_0x103cc9(0x27e)]['t'](_0x103cc9(0x1ca)),'type':MessageType['Error']}),!0x1);}async['navigateToDefineName'](_0x2772a2,_0x442438){const _0x4e6489=_0x121662;return this[_0x4e6489(0x334)][_0x4e6489(0x20a)](_0x2772a2,_0x442438),!0x0;}async[_0x121662(0x308)](_0x340832){const _0x5c9fd0=_0x121662;var _0xa4a199;const _0x5a6a1b=this[_0x5c9fd0(0x1be)][_0x5c9fd0(0x2be)](PLUGIN_CONFIG_KEY);if((_0xa4a199=_0x5a6a1b==null?void 0x0:_0x5a6a1b[_0x5c9fd0(0x364)])!=null&&_0xa4a199[_0x5c9fd0(0x308)])return _0x5a6a1b[_0x5c9fd0(0x364)][_0x5c9fd0(0x308)](_0x340832);window[_0x5c9fd0(0x2af)](_0x340832,_0x5c9fd0(0x281),'noopener\x20noreferrer');}},__name(_a,_0x121662(0x35c)),_a);SheetsHyperLinkResolverService=__decorateClass$c([__decorateParam$c(0x0,IUniverInstanceService),__decorateParam$c(0x1,ICommandService),__decorateParam$c(0x2,IDefinedNamesService),__decorateParam$c(0x3,IMessageService),__decorateParam$c(0x4,Inject(LocaleService)),__decorateParam$c(0x5,IConfigService)],SheetsHyperLinkResolverService);const SHEET_HYPER_LINK_UI_PLUGIN=_0x121662(0x38d);var __defProp$b=Object['defineProperty'],__getOwnPropDesc$b=Object[_0x121662(0x2cd)],__decorateClass$b=__name((_0x54670e,_0x3702bc,_0x1550f9,_0x3b9268)=>{const _0x4ba2aa=_0x121662;for(var _0x2d788c=_0x3b9268>0x1?void 0x0:_0x3b9268?__getOwnPropDesc$b(_0x3702bc,_0x1550f9):_0x3702bc,_0xec8844=_0x54670e[_0x4ba2aa(0x259)]-0x1,_0x5e29ee;_0xec8844>=0x0;_0xec8844--)(_0x5e29ee=_0x54670e[_0xec8844])&&(_0x2d788c=(_0x3b9268?_0x5e29ee(_0x3702bc,_0x1550f9,_0x2d788c):_0x5e29ee(_0x2d788c))||_0x2d788c);return _0x3b9268&&_0x2d788c&&__defProp$b(_0x3702bc,_0x1550f9,_0x2d788c),_0x2d788c;},_0x121662(0x1e3)),__decorateParam$b=__name((_0xf381a5,_0x3df6af)=>(_0x27db29,_0x60a51c)=>_0x3df6af(_0x27db29,_0x60a51c,_0xf381a5),'__decorateParam$b'),_a2;let SheetsHyperLinkCopyPasteController=(_a2=class extends Disposable{constructor(_0x516672,_0x4ac461,_0x392757,_0x43c0f6){const _0x5b90a6=_0x121662;super(),__publicField(this,_0x5b90a6(0x330),new Set()),__publicField(this,_0x5b90a6(0x30c)),(this[_0x5b90a6(0x38a)]=_0x516672,this[_0x5b90a6(0x300)]=_0x4ac461,this['_injector']=_0x392757,this[_0x5b90a6(0x3e2)]=_0x43c0f6,this['_initCopyPaste'](),this[_0x5b90a6(0x39a)](()=>{const _0x30d4ab=_0x5b90a6;this[_0x30d4ab(0x330)][_0x30d4ab(0x2ab)]();}));}[_0x121662(0x3b7)](_0x5dd2df){const _0x258355=_0x121662;this[_0x258355(0x330)][_0x258355(0x2e8)](_0x5dd2df);}[_0x121662(0x1d8)](_0xa61822){const _0xd89125=_0x121662;this[_0xd89125(0x330)][_0xd89125(0x218)](_0xa61822);}[_0x121662(0x2f8)](_0xea402c){const _0x10716b=_0x121662;return Array[_0x10716b(0x2dc)](this['_plainTextFilter'])[_0x10716b(0x33d)](_0x479372=>_0x479372(_0xea402c));}[_0x121662(0x1c6)](){const _0x584c0c=_0x121662;this['_sheetClipboardService'][_0x584c0c(0x35e)]({'id':SHEET_HYPER_LINK_UI_PLUGIN,'onBeforeCopy':__name((_0x5b5fca,_0x42d1ca,_0x12da57)=>this[_0x584c0c(0x339)](_0x5b5fca,_0x42d1ca,_0x12da57),_0x584c0c(0x22c)),'onPasteCells':__name((_0x550978,_0x1fa694,_0x4dc4dd,_0x342624)=>{const {copyType:copyType=COPY_TYPE['COPY'],pasteType:_0x4ca5c0}=_0x342624,{range:_0x18e3fe}=_0x550978||{},{range:_0xd2ac42,unitId:_0x547c7d,subUnitId:_0x40e206}=_0x1fa694;return this['_generateMutations'](_0xd2ac42,{'copyType':copyType,'pasteType':_0x4ca5c0,'copyRange':_0x18e3fe,'unitId':_0x547c7d,'subUnitId':_0x40e206});},_0x584c0c(0x1e7)),'onPastePlainText':__name((_0x54ac10,_0x105d9b)=>{const _0x152893=_0x584c0c,_0x8a630f=this[_0x152893(0x2f8)](_0x105d9b);if(isLegalLink(_0x105d9b)&&_0x8a630f){const {range:_0xd60188,unitId:_0x1fd3eb,subUnitId:_0x203144}=_0x54ac10,{ranges:[_0xc1ff6b],mapFunc:_0x2f023e}=virtualizeDiscreteRanges([_0xd60188]),_0x7c8218=[],_0x52fc88=[];return Range['foreach'](_0xc1ff6b,(_0xf962bb,_0x5c4d35)=>{const _0xa27a98=_0x152893,{row:_0x568a62,col:_0x4030d9}=_0x2f023e(_0xf962bb,_0x5c4d35),_0x3e7574=this[_0xa27a98(0x300)][_0xa27a98(0x249)](_0x1fd3eb,_0x203144,_0x568a62,_0x4030d9);_0x3e7574&&_0x7c8218['push']({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x1fd3eb,'subUnitId':_0x203144,'id':_0x3e7574['id']}}),_0x3e7574&&_0x52fc88[_0xa27a98(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x1fd3eb,'subUnitId':_0x203144,'link':_0x3e7574}});}),{'redos':_0x7c8218,'undos':_0x52fc88};}return{'undos':[],'redos':[]};},'onPastePlainText'),'priority':0x63});}['_collect'](_0x4c3d69,_0x70417b,_0x395c6f){const _0x13972=_0x121662,_0x29787c=new ObjectMatrix();this[_0x13972(0x30c)]={'unitId':_0x4c3d69,'subUnitId':_0x70417b,'matrix':_0x29787c};const _0x3b1509=this[_0x13972(0x297)][_0x13972(0x2db)](_0xbd5023=>rangeToDiscreteRange(_0x395c6f,_0xbd5023,_0x4c3d69,_0x70417b));if(!_0x3b1509)return;const {rows:_0x19fa0a,cols:_0x4a9d00}=_0x3b1509;_0x19fa0a[_0x13972(0x3bc)]((_0x54a2f9,_0x4194bc)=>{const _0x4a2eb1=_0x13972;_0x4a9d00[_0x4a2eb1(0x3bc)]((_0x1d1e8c,_0x20b72a)=>{const _0x29fd3b=_0x4a2eb1;var _0x44714e;const _0x182067=this[_0x29fd3b(0x300)][_0x29fd3b(0x249)](_0x4c3d69,_0x70417b,_0x54a2f9,_0x1d1e8c);_0x29787c[_0x29fd3b(0x242)](_0x4194bc,_0x20b72a,(_0x44714e=_0x182067==null?void 0x0:_0x182067['id'])!=null?_0x44714e:'');});});}[_0x121662(0x2e3)](_0x3e3cf0,_0x245dda){const _0x57d8ec=_0x121662;if(!this[_0x57d8ec(0x30c)])return{'redos':[],'undos':[]};if(!this[_0x57d8ec(0x30c)]||!this[_0x57d8ec(0x30c)][_0x57d8ec(0x327)]['getSizeOf']()||!_0x245dda[_0x57d8ec(0x2a5)])return{'redos':[],'undos':[]};if([PREDEFINED_HOOK_NAME['SPECIAL_PASTE_COL_WIDTH'],PREDEFINED_HOOK_NAME['SPECIAL_PASTE_VALUE'],PREDEFINED_HOOK_NAME[_0x57d8ec(0x352)],PREDEFINED_HOOK_NAME[_0x57d8ec(0x2fa)]][_0x57d8ec(0x3df)](_0x245dda[_0x57d8ec(0x2c2)]))return{'redos':[],'undos':[]};const {unitId:_0x486a9f,subUnitId:_0x31b659}=this['_copyInfo'],_0x29f366=[],_0x3a19ba=[],{ranges:[_0xac671b,_0x543b9f],mapFunc:_0x50673d}=virtualizeDiscreteRanges([_0x245dda[_0x57d8ec(0x2a5)],_0x3e3cf0]);return getRepeatRange(_0xac671b,_0x543b9f,!0x0)[_0x57d8ec(0x3bc)](({startRange:_0x5f0ac0})=>{const _0x189027=_0x57d8ec;var _0x5174fe;(_0x5174fe=this[_0x189027(0x30c)])==null||_0x5174fe[_0x189027(0x327)][_0x189027(0x28b)]((_0x1ff2b2,_0x93d696,_0x265346)=>{const _0x6372b4=_0x189027,_0x22786a=Rectangle[_0x6372b4(0x273)]({'startRow':_0x1ff2b2,'endRow':_0x1ff2b2,'startColumn':_0x93d696,'endColumn':_0x93d696},_0x5f0ac0),_0x10bcfe=this[_0x6372b4(0x300)]['getHyperLink'](_0x486a9f,_0x31b659,_0x265346),{row:_0x47bcb8,col:_0x9c477}=_0x50673d(_0x22786a[_0x6372b4(0x25e)],_0x22786a['startColumn']),_0x2dd55b=this[_0x6372b4(0x300)]['getHyperLinkByLocation'](_0x245dda[_0x6372b4(0x24a)],_0x245dda[_0x6372b4(0x283)],_0x47bcb8,_0x9c477),_0x323ad5=Tools[_0x6372b4(0x378)]();_0x2dd55b&&_0x29f366[_0x6372b4(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x245dda[_0x6372b4(0x24a)],'subUnitId':_0x245dda[_0x6372b4(0x283)],'id':_0x2dd55b['id']}}),_0x10bcfe&&(_0x29f366[_0x6372b4(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x245dda[_0x6372b4(0x24a)],'subUnitId':_0x245dda[_0x6372b4(0x283)],'link':{..._0x10bcfe,'id':_0x323ad5,'row':_0x47bcb8,'column':_0x9c477}}}),_0x3a19ba[_0x6372b4(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x245dda[_0x6372b4(0x24a)],'subUnitId':_0x245dda[_0x6372b4(0x283)],'id':_0x323ad5}})),_0x2dd55b&&_0x3a19ba[_0x6372b4(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x245dda[_0x6372b4(0x24a)],'subUnitId':_0x245dda['subUnitId'],'link':_0x2dd55b}});});}),{'redos':_0x29f366,'undos':_0x3a19ba};}},__name(_a2,'SheetsHyperLinkCopyPasteController'),_a2);SheetsHyperLinkCopyPasteController=__decorateClass$b([__decorateParam$b(0x0,ISheetClipboardService),__decorateParam$b(0x1,Inject(HyperLinkModel)),__decorateParam$b(0x2,Inject(Injector)),__decorateParam$b(0x3,Inject(SheetsHyperLinkResolverService))],SheetsHyperLinkCopyPasteController);var HyperLinkEditSourceType=(_0x1babc9=>(_0x1babc9['EDITING']=_0x121662(0x345),_0x1babc9[_0x121662(0x25d)]='viewing',_0x1babc9['ZEN_EDITOR']=_0x121662(0x37a),_0x1babc9))(HyperLinkEditSourceType||{}),jsxRuntime={'exports':{}},reactJsxRuntime_production_min={},f=_0xd5dee3,k=Symbol['for'](_0x121662(0x26b)),l=Symbol[_0x121662(0x27b)](_0x121662(0x2b1)),m=Object['prototype'][_0x121662(0x1c5)],n=f[_0x121662(0x24e)][_0x121662(0x1fa)],p={'key':!0x0,'ref':!0x0,'__self':!0x0,'__source':!0x0};function q(_0x264356,_0x552eae,_0x2a3220){const _0x2fe985=_0x121662;var _0x16c1af,_0x29e1df={},_0xc03a56=null,_0x152e8a=null;_0x2a3220!==void 0x0&&(_0xc03a56=''+_0x2a3220),_0x552eae[_0x2fe985(0x377)]!==void 0x0&&(_0xc03a56=''+_0x552eae[_0x2fe985(0x377)]),_0x552eae[_0x2fe985(0x1f8)]!==void 0x0&&(_0x152e8a=_0x552eae['ref']);for(_0x16c1af in _0x552eae)m[_0x2fe985(0x2cb)](_0x552eae,_0x16c1af)&&!p[_0x2fe985(0x1c5)](_0x16c1af)&&(_0x29e1df[_0x16c1af]=_0x552eae[_0x16c1af]);if(_0x264356&&_0x264356['defaultProps']){for(_0x16c1af in(_0x552eae=_0x264356[_0x2fe985(0x30a)],_0x552eae))_0x29e1df[_0x16c1af]===void 0x0&&(_0x29e1df[_0x16c1af]=_0x552eae[_0x16c1af]);}return{'$$typeof':k,'type':_0x264356,'key':_0xc03a56,'ref':_0x152e8a,'props':_0x29e1df,'_owner':n[_0x2fe985(0x3af)]};}__name(q,'q'),reactJsxRuntime_production_min[_0x121662(0x268)]=l,reactJsxRuntime_production_min[_0x121662(0x3ab)]=q,reactJsxRuntime_production_min['jsxs']=q,jsxRuntime['exports']=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime[_0x121662(0x1f9)];const AddHyperLinkCommand={'type':CommandType[_0x121662(0x3c6)],'id':'sheets.command.add-hyper-link',async 'handler'(_0x41ad30,_0x297eed){const _0x561129=_0x121662;var _0xc0eb1b;if(!_0x297eed)return!0x1;const _0x49523e=_0x41ad30[_0x561129(0x2e7)](ICommandService),_0x14b737=_0x41ad30[_0x561129(0x2e7)](IUndoRedoService),_0x3ae9b9=_0x41ad30[_0x561129(0x2e7)](IRenderManagerService),_0x141282=_0x41ad30[_0x561129(0x2e7)](IUniverInstanceService),_0x178503=_0x41ad30['get'](HyperLinkModel),{unitId:_0x3b8799,subUnitId:_0x42a614,link:_0x1f00bd}=_0x297eed,_0x48b75d=_0x141282[_0x561129(0x289)](_0x3b8799,UniverInstanceType[_0x561129(0x275)]),_0x526d4d=_0x3ae9b9[_0x561129(0x215)](_0x3b8799);if(!_0x526d4d||!_0x48b75d)return!0x1;const _0x4e95e3=_0x48b75d==null?void 0x0:_0x48b75d[_0x561129(0x2c8)](_0x42a614),_0x11bd5a=(_0xc0eb1b=_0x526d4d[_0x561129(0x1ef)](SheetSkeletonManagerService)[_0x561129(0x202)]())==null?void 0x0:_0xc0eb1b[_0x561129(0x24f)];if(!_0x4e95e3||!_0x11bd5a)return!0x1;const {payload:_0x5e8275,display:_0x144947,row:_0x3a0b0e,column:_0x101834,id:_0xb7ad1f}=_0x1f00bd,_0x2e4adb=_0x4e95e3[_0x561129(0x3dc)](_0x3a0b0e,_0x101834),_0x41050d=_0x11bd5a['getBlankCellDocumentModel'](_0x2e4adb),_0x30de5d=_0x41050d['documentModel'][_0x561129(0x1ce)](),_0xeaa577=Tools[_0x561129(0x361)](_0x30de5d['body']);if(!_0xeaa577)return!0x1;let _0x42ce52;if(_0x144947?_0x42ce52=BuildTextUtils[_0x561129(0x355)]['replace']({'selection':{'startOffset':0x0,'endOffset':_0xeaa577[_0x561129(0x2d9)]['length']-0x2,'collapsed':!0x0},'body':{'dataStream':''+DataStreamTreeTokenType[_0x561129(0x32e)]+_0x144947+DataStreamTreeTokenType[_0x561129(0x321)],'customRanges':[{'startIndex':0x0,'endIndex':_0x144947[_0x561129(0x259)]+0x1,'rangeType':CustomRangeType[_0x561129(0x269)],'rangeId':_0xb7ad1f,'properties':{'url':_0x5e8275}}]},'doc':_0x41050d[_0x561129(0x205)]}):_0x42ce52=BuildTextUtils[_0x561129(0x316)]['add']({'body':_0xeaa577,'range':{'startOffset':0x0,'endOffset':_0xeaa577[_0x561129(0x2d9)][_0x561129(0x259)]-0x2,'collapsed':!0x1},'rangeId':_0xb7ad1f,'rangeType':CustomRangeType[_0x561129(0x269)],'properties':{'url':_0x5e8275,'refId':_0xb7ad1f}}),!_0x42ce52)return!0x1;const _0x538059=TextX[_0x561129(0x1e1)](_0xeaa577,_0x42ce52[_0x561129(0x253)]()),_0x3c8ac4={..._0x30de5d,'body':_0x538059},_0x5e6fb6={'unitId':_0x3b8799,'subUnitId':_0x42a614,'cellValue':{[_0x1f00bd[_0x561129(0x214)]]:{[_0x1f00bd[_0x561129(0x256)]]:{'p':_0x3c8ac4,'t':CellValueType[_0x561129(0x1ee)]}}}},_0x2fc7c8={'id':SetRangeValuesMutation['id'],'params':_0x5e6fb6},_0x463d55=SetRangeValuesUndoMutationFactory(_0x41ad30,_0x5e6fb6),_0x510358={'id':SetRangeValuesMutation['id'],'params':_0x463d55},_0x234782=[_0x2fc7c8],_0xd8a3b3=[_0x510358],_0x57f4f5=_0x178503[_0x561129(0x249)](_0x3b8799,_0x42a614,_0x3a0b0e,_0x101834);return _0x57f4f5&&(_0x234782[_0x561129(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x3b8799,'subUnitId':_0x42a614,'id':_0x57f4f5['id']}}),_0xd8a3b3[_0x561129(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x3b8799,'subUnitId':_0x42a614,'link':_0x57f4f5}})),await sequenceExecuteAsync(_0x234782,_0x49523e)?(_0x14b737[_0x561129(0x3d0)]({'redoMutations':_0x234782,'undoMutations':_0xd8a3b3,'unitID':_0x3b8799}),!0x0):!0x1;}},AddRichHyperLinkCommand={'id':_0x121662(0x3ce),'type':CommandType['COMMAND'],'handler':__name(async(_0x351841,_0x48a9a7)=>{const _0x420eb2=_0x121662;if(!_0x48a9a7)return!0x1;const {documentId:_0x307782,link:_0x431c1f}=_0x48a9a7,_0x459549=_0x351841[_0x420eb2(0x2e7)](ICommandService),_0x1a6e57=_0x351841['get'](DocSelectionManagerService),_0x124a69=generateRandomId(),{payload:_0x2b2433}=_0x431c1f;if(!_0x1a6e57['getActiveTextRange']())return!0x1;const _0x34a103=addCustomRangeBySelectionFactory(_0x351841,{'unitId':_0x307782,'rangeId':_0x124a69,'rangeType':CustomRangeType[_0x420eb2(0x269)],'properties':{'url':_0x2b2433,'refId':_0x124a69}});return _0x34a103?_0x459549[_0x420eb2(0x2c7)](_0x34a103['id'],_0x34a103[_0x420eb2(0x29d)]):!0x1;},_0x121662(0x346))},UpdateHyperLinkCommand={'type':CommandType[_0x121662(0x3c6)],'id':_0x121662(0x35a),async 'handler'(_0x486926,_0x30b108){const _0x1d6a43=_0x121662;var _0x2eb62b,_0x4313b2,_0x26b08d,_0x505f4f;if(!_0x30b108)return!0x1;const _0x19c395=_0x486926['get'](ICommandService),_0x20a11f=_0x486926[_0x1d6a43(0x2e7)](IUndoRedoService),_0x5b7f1f=_0x486926[_0x1d6a43(0x2e7)](IRenderManagerService),_0x302e2f=_0x486926[_0x1d6a43(0x2e7)](IUniverInstanceService),_0x47205e=_0x486926[_0x1d6a43(0x2e7)](HyperLinkModel),{unitId:_0x3f66de,subUnitId:_0x177230,payload:_0x208550,row:_0x5babae,column:_0x3b86d8,id:_0x545db7}=_0x30b108,_0x273f57=_0x302e2f['getUnit'](_0x3f66de,UniverInstanceType[_0x1d6a43(0x275)]),_0x5693ce=_0x5b7f1f[_0x1d6a43(0x215)](_0x3f66de);if(!_0x5693ce||!_0x273f57)return!0x1;const _0x8adee9=_0x273f57==null?void 0x0:_0x273f57['getSheetBySheetId'](_0x177230),_0x461e18=(_0x2eb62b=_0x5693ce[_0x1d6a43(0x1ef)](SheetSkeletonManagerService)[_0x1d6a43(0x202)]())==null?void 0x0:_0x2eb62b[_0x1d6a43(0x24f)];if(!_0x8adee9||!_0x461e18)return!0x1;const {payload:_0x579f5b,display:display=''}=_0x208550,_0x42ded7=_0x8adee9[_0x1d6a43(0x3dc)](_0x5babae,_0x3b86d8);if(!_0x42ded7)return!0x1;const _0x503156=_0x461e18[_0x1d6a43(0x373)](_0x42ded7);if(!(_0x503156!=null&&_0x503156['documentModel']))return!0x1;const _0x32b160=_0x503156[_0x1d6a43(0x205)]['getSnapshot'](),_0x19fcb1=(_0x26b08d=(_0x4313b2=_0x32b160['body'])==null?void 0x0:_0x4313b2['customRanges'])==null?void 0x0:_0x26b08d[_0x1d6a43(0x2ef)](_0x75a159=>_0x75a159[_0x1d6a43(0x2e6)]===_0x545db7);if(!_0x19fcb1)return!0x1;const _0x9521b6=generateRandomId(),_0x2eb7ee=(_0x505f4f=getBodySlice(_0x503156['documentModel']['getBody'](),_0x19fcb1[_0x1d6a43(0x2e9)],_0x19fcb1[_0x1d6a43(0x2bf)]+0x1)[_0x1d6a43(0x284)])==null?void 0x0:_0x505f4f[0x0];_0x2eb7ee&&(_0x2eb7ee['ed']=display['length']+0x1);const _0x4f78fa=replaceSelectionFactory(_0x486926,{'unitId':_0x3f66de,'body':{'dataStream':''+DataStreamTreeTokenType[_0x1d6a43(0x32e)]+display+DataStreamTreeTokenType[_0x1d6a43(0x321)],'customRanges':[{'rangeId':_0x9521b6,'rangeType':CustomRangeType[_0x1d6a43(0x269)],'startIndex':0x0,'endIndex':display['length']+0x1,'properties':{'url':_0x579f5b}}],'textRuns':_0x2eb7ee?[_0x2eb7ee]:void 0x0},'selection':{'startOffset':_0x19fcb1[_0x1d6a43(0x2e9)],'endOffset':_0x19fcb1['endIndex']+0x1,'collapsed':!0x1},'doc':_0x503156[_0x1d6a43(0x205)]});if(!_0x4f78fa)return!0x1;const _0x1ecefc=TextX[_0x1d6a43(0x1e1)](Tools[_0x1d6a43(0x361)](_0x32b160['body']),_0x4f78fa[_0x1d6a43(0x304)][_0x1d6a43(0x253)]()),_0x1c6427={'id':SetRangeValuesMutation['id'],'params':{'unitId':_0x3f66de,'subUnitId':_0x177230,'cellValue':{[_0x5babae]:{[_0x3b86d8]:{'p':{..._0x32b160,'body':_0x1ecefc},'t':CellValueType[_0x1d6a43(0x1ee)]}}}}},_0x3cbbf6=SetRangeValuesUndoMutationFactory(_0x486926,_0x1c6427[_0x1d6a43(0x29d)]),_0x11c1ff={'id':SetRangeValuesMutation['id'],'params':_0x3cbbf6},_0xcb6920=[_0x1c6427],_0x2c8edb=[_0x11c1ff],_0x464679=_0x47205e[_0x1d6a43(0x249)](_0x3f66de,_0x177230,_0x5babae,_0x3b86d8);return _0x464679&&(_0xcb6920['push']({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x3f66de,'subUnitId':_0x177230,'id':_0x464679['id']}}),_0x2c8edb[_0x1d6a43(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x3f66de,'subUnitId':_0x177230,'link':_0x464679}})),await sequenceExecuteAsync(_0xcb6920,_0x19c395)?(_0x20a11f[_0x1d6a43(0x3d0)]({'redoMutations':_0xcb6920,'undoMutations':_0x2c8edb,'unitID':_0x3f66de}),!0x0):!0x1;}},UpdateRichHyperLinkCommand={'type':CommandType[_0x121662(0x3c6)],'id':_0x121662(0x236),'handler':__name((_0x29105a,_0x463431)=>{const _0x5e9b88=_0x121662;var _0x50c5c3,_0x70aac3,_0x1bcaa3,_0x5b74ae;if(!_0x463431)return!0x1;const {documentId:_0x10da70,payload:_0x14aa5e,id:_0x1aba99}=_0x463431,_0x5df316=_0x29105a[_0x5e9b88(0x2e7)](IUniverInstanceService),_0x545699=_0x29105a[_0x5e9b88(0x2e7)](ICommandService),_0x311cf7=_0x5df316[_0x5e9b88(0x289)](_0x10da70,UniverInstanceType['UNIVER_DOC']);if(!_0x311cf7)return!0x1;const _0x3b3090=(_0x70aac3=(_0x50c5c3=_0x311cf7[_0x5e9b88(0x1c2)]())==null?void 0x0:_0x50c5c3['customRanges'])==null?void 0x0:_0x70aac3[_0x5e9b88(0x2ef)](_0x273cbc=>_0x273cbc[_0x5e9b88(0x2e6)]===_0x1aba99);if(!_0x3b3090)return!0x1;const _0x33b52c=(_0x1bcaa3=_0x463431[_0x5e9b88(0x30f)][_0x5e9b88(0x2fe)])!=null?_0x1bcaa3:'',_0x112f11=generateRandomId(),_0x52793b=(_0x5b74ae=getBodySlice(_0x311cf7[_0x5e9b88(0x1c2)](),_0x3b3090[_0x5e9b88(0x2e9)],_0x3b3090[_0x5e9b88(0x2bf)]+0x1)['textRuns'])==null?void 0x0:_0x5b74ae[0x0];_0x52793b&&(_0x52793b['ed']=_0x33b52c['length']+0x1);const _0x32c65e=replaceSelectionFactory(_0x29105a,{'unitId':_0x10da70,'body':{'dataStream':''+DataStreamTreeTokenType[_0x5e9b88(0x32e)]+_0x33b52c+DataStreamTreeTokenType[_0x5e9b88(0x321)],'customRanges':[{'rangeId':_0x112f11,'rangeType':CustomRangeType[_0x5e9b88(0x269)],'startIndex':0x0,'endIndex':_0x33b52c[_0x5e9b88(0x259)]+0x1,'properties':{'url':_0x14aa5e[_0x5e9b88(0x30f)]}}],'textRuns':_0x52793b?[_0x52793b]:void 0x0},'selection':{'startOffset':_0x3b3090[_0x5e9b88(0x2e9)],'endOffset':_0x3b3090[_0x5e9b88(0x2bf)]+0x1,'collapsed':!0x1},'doc':_0x311cf7});return _0x32c65e?_0x545699[_0x5e9b88(0x2c7)](_0x32c65e['id'],_0x32c65e[_0x5e9b88(0x29d)]):!0x1;},_0x121662(0x346))},_SheetsHyperLinkSidePanelService=class _SheetsHyperLinkSidePanelService extends Disposable{constructor(){const _0x23c0ef=_0x121662;super(...arguments),__publicField(this,_0x23c0ef(0x3c8),new Map());}[_0x121662(0x23a)](_0x1c4387){const _0x278f34=_0x121662;return _0x1c4387!==SheetHyperLinkType[_0x278f34(0x363)];}[_0x121662(0x2ed)](){const _0x493a39=_0x121662;return Array[_0x493a39(0x2dc)](this[_0x493a39(0x3c8)][_0x493a39(0x232)]())[_0x493a39(0x3cf)](({option:_0x4d0fd6})=>_0x4d0fd6);}[_0x121662(0x1d4)](_0x37d2e2){const _0x4d3f43=_0x121662;return Array[_0x4d3f43(0x2dc)](this['_customHyperLinks'][_0x4d3f43(0x232)]())[_0x4d3f43(0x2ef)](_0x2dc57c=>_0x2dc57c['match'](_0x37d2e2));}[_0x121662(0x391)](_0x42c500){const _0x138e4f=_0x121662;this[_0x138e4f(0x3c8)][_0x138e4f(0x2f4)](_0x42c500[_0x138e4f(0x21c)],_0x42c500);}[_0x121662(0x3d8)](_0x4b4e39){const _0x13aaf5=_0x121662;return this['_customHyperLinks'][_0x13aaf5(0x2e7)](_0x4b4e39);}['removeCustomHyperLink'](_0x3d0431){const _0x4426dd=_0x121662,{_customHyperLinks:_0x5c3522}=this;_0x5c3522[_0x4426dd(0x218)](_0x3d0431);}['dispose'](){const _0x50199f=_0x121662;super[_0x50199f(0x2c5)](),this['_customHyperLinks']['clear']();}};__name(_SheetsHyperLinkSidePanelService,_0x121662(0x31f));let SheetsHyperLinkSidePanelService=_SheetsHyperLinkSidePanelService;const cellLinkEdit=_0x121662(0x2ca),cellLinkEditButtons=_0x121662(0x383),styles$1={'cellLinkEdit':cellLinkEdit,'cellLinkEditButtons':cellLinkEditButtons},CellLinkEdit=__name(()=>{const _0x49aaf5=_0x121662;var _0x55e2c9;const [_0xba55f7,_0x15582f]=useState(''),[_0x23285f,_0x28c2b9]=useState(!0x1),[_0xcfad55,_0x3f31d8]=useState(''),[_0x2591f8,_0x188783]=useState(!0x0),[_0x428954,_0x34054c]=useState(SheetHyperLinkType[_0x49aaf5(0x363)]),[_0xd8a233,_0x423b6f]=useState(''),_0x153f36=useDependency(LocaleService),_0x56b1b8=useDependency(IDefinedNamesService),_0x1c2342=useDependency(IEditorBridgeService),_0x31c7b1=useDependency(IUniverInstanceService),_0x4d1f05=useDependency(SheetsHyperLinkPopupService),_0x133c28=useObservable(_0x4d1f05[_0x49aaf5(0x2f9)]),_0x4d3607=useDependency(SheetsHyperLinkResolverService),_0x1bfd86=useDependency(ICommandService),_0x204fae=useDependency(SheetsHyperLinkSidePanelService),_0x4054d6=useMemo(()=>_0x204fae[_0x49aaf5(0x2ed)](),[_0x204fae]),_0x5bc8c9=useDependency(IZenZoneService),_0x1e9f4a=useDependency(IRenderManagerService),_0x214068=useDependency(IMarkSelectionService),_0x3f8d7a=useDependency(DocSelectionManagerService),_0x307c5c=useDependency(IContextService),_0x3a8438=useDependency(ThemeService),_0x435480=useDependency(DocSelectionManagerService),_0x20c6ad=useMemo(()=>{const _0x4712fc=_0x49aaf5;if(!_0x204fae[_0x4712fc(0x23a)](_0x428954))return _0x204fae['getCustomHyperLink'](_0x428954);},[_0x204fae,_0x428954]),[_0x4cd26e,_0x4218eb]=useState(!0x1),_0x44f8a8=useRef(!0x1);useEffect(()=>{const _0x11f07b=_0x49aaf5;var _0x29da94,_0x2595f3,_0x4ea5e5,_0x3a435a,_0x2ac3e9,_0x30f2d7,_0x1b29fd,_0x44cb73,_0xe4174e,_0x1e476b,_0x4b4c2b,_0x2736a0,_0x1b75bd,_0x5a43b5,_0x4f5035,_0x123ea1,_0x1b68d8,_0x2aab87;if((_0x133c28==null?void 0x0:_0x133c28[_0x11f07b(0x214)])!==void 0x0&&_0x133c28[_0x11f07b(0x2f3)]!==void 0x0){const {label:_0x311ab8,customRange:_0x416ba2,row:_0x16abf9,col:_0x1d5a83}=_0x133c28;let _0x2320a1;if(_0x416ba2)_0x2320a1={'id':(_0x29da94=_0x416ba2==null?void 0x0:_0x416ba2[_0x11f07b(0x2e6)])!=null?_0x29da94:'','display':_0x311ab8!=null?_0x311ab8:'','payload':(_0x4ea5e5=(_0x2595f3=_0x416ba2==null?void 0x0:_0x416ba2[_0x11f07b(0x38c)])==null?void 0x0:_0x2595f3[_0x11f07b(0x241)])!=null?_0x4ea5e5:'','row':_0x16abf9,'column':_0x1d5a83};else{if(_0x133c28[_0x11f07b(0x21c)]===HyperLinkEditSourceType[_0x11f07b(0x25d)]){const _0x21b722=_0x31c7b1[_0x11f07b(0x289)](_0x133c28['unitId']),_0x5dd292=_0x21b722==null?void 0x0:_0x21b722[_0x11f07b(0x2c8)](_0x133c28[_0x11f07b(0x283)]),_0x162ccd=_0x5dd292==null?void 0x0:_0x5dd292[_0x11f07b(0x325)](_0x133c28['row'],_0x133c28[_0x11f07b(0x2f3)]),_0x3a447c=(_0x30f2d7=(_0x2ac3e9=(_0x3a435a=_0x162ccd==null?void 0x0:_0x162ccd['p'])==null?void 0x0:_0x3a435a[_0x11f07b(0x2b6)])==null?void 0x0:_0x2ac3e9[_0x11f07b(0x37e)])==null?void 0x0:_0x30f2d7['find'](_0x19cb85=>{const _0x6b2bfd=_0x11f07b;var _0x41f4f8;return _0x19cb85[_0x6b2bfd(0x271)]===CustomRangeType[_0x6b2bfd(0x269)]&&((_0x41f4f8=_0x19cb85[_0x6b2bfd(0x38c)])==null?void 0x0:_0x41f4f8[_0x6b2bfd(0x241)]);}),_0xf162d6=_0x162ccd==null?void 0x0:_0x162ccd['v'];_0x162ccd&&(!BuildTextUtils[_0x11f07b(0x2f7)][_0x11f07b(0x3c4)]((_0x44cb73=(_0x1b29fd=_0x162ccd['p'])==null?void 0x0:_0x1b29fd[_0x11f07b(0x2b6)])==null?void 0x0:_0x44cb73['dataStream'])||_0xf162d6)&&_0x188783(!0x1),_0x2320a1={'id':'','display':'','payload':(_0x1e476b=(_0xe4174e=_0x3a447c==null?void 0x0:_0x3a447c[_0x11f07b(0x38c)])==null?void 0x0:_0xe4174e[_0x11f07b(0x241)])!=null?_0x1e476b:'','row':_0x16abf9,'column':_0x1d5a83};}else{const _0xe6c504=_0x31c7b1[_0x11f07b(0x344)](UniverInstanceType['UNIVER_DOC']),_0x1b9a1d=_0x3f8d7a[_0x11f07b(0x255)](),_0x346b9d=_0x1b9a1d&&((_0x1b75bd=BuildTextUtils[_0x11f07b(0x316)][_0x11f07b(0x32f)](_0x1b9a1d,(_0x2736a0=(_0x4b4c2b=_0xe6c504==null?void 0x0:_0xe6c504[_0x11f07b(0x1c2)]())==null?void 0x0:_0x4b4c2b[_0x11f07b(0x37e)])!=null?_0x2736a0:[]))==null?void 0x0:_0x1b75bd[0x0]);_0x188783(!0x1),_0x2320a1={'id':'','display':_0x311ab8!=null?_0x311ab8:'','payload':(_0x4f5035=(_0x5a43b5=_0x346b9d==null?void 0x0:_0x346b9d[_0x11f07b(0x38c)])==null?void 0x0:_0x5a43b5[_0x11f07b(0x241)])!=null?_0x4f5035:'','row':_0x16abf9,'column':_0x1d5a83};}}_0x15582f(_0x2320a1['id']);const _0x33a45c=_0x204fae[_0x11f07b(0x1d4)](_0x2320a1);if(_0x33a45c){const _0x2e4e0c=_0x33a45c[_0x11f07b(0x39b)](_0x2320a1);_0x34054c(_0x2e4e0c[_0x11f07b(0x21c)]),_0x423b6f(_0x2e4e0c[_0x11f07b(0x30f)]),_0x3f31d8(_0x2e4e0c[_0x11f07b(0x2fe)]);return;}_0x3f31d8(_0x2320a1[_0x11f07b(0x2fe)]);const _0x5ddcf9=_0x4d3607[_0x11f07b(0x326)](_0x2320a1[_0x11f07b(0x30f)]);switch(_0x34054c(_0x5ddcf9[_0x11f07b(0x21c)]===SheetHyperLinkType['INVALID']?SheetHyperLinkType[_0x11f07b(0x39c)]:_0x5ddcf9[_0x11f07b(0x21c)]),_0x5ddcf9[_0x11f07b(0x21c)]){case SheetHyperLinkType[_0x11f07b(0x363)]:{_0x423b6f(_0x5ddcf9['url']),_0x5ddcf9[_0x11f07b(0x241)]===_0x2320a1['display']&&(_0x44f8a8['current']=!0x0);break;}case SheetHyperLinkType[_0x11f07b(0x39c)]:{const _0x54d213=_0x5ddcf9['searchObj'],_0x224cf2=_0x54d213[_0x11f07b(0x3bb)]&&(_0x2aab87=(_0x1b68d8=(_0x123ea1=_0x31c7b1[_0x11f07b(0x289)](_0x133c28[_0x11f07b(0x24a)]))==null?void 0x0:_0x123ea1[_0x11f07b(0x2c8)](_0x54d213[_0x11f07b(0x3bb)]))==null?void 0x0:_0x1b68d8['getName']())!=null?_0x2aab87:'',_0x5a8024=serializeRangeWithSheet(_0x224cf2,deserializeRangeWithSheet(_0x54d213['range'])[_0x11f07b(0x287)]);_0x423b6f(_0x5a8024),_0x5a8024===_0x2320a1['display']&&(_0x44f8a8[_0x11f07b(0x3af)]=!0x0);break;}case SheetHyperLinkType[_0x11f07b(0x3e0)]:{const _0xf395cc=_0x5ddcf9['searchObj'];_0x423b6f(_0xf395cc[_0x11f07b(0x3bb)]);break;}case SheetHyperLinkType[_0x11f07b(0x248)]:{const _0x3e473b=_0x5ddcf9[_0x11f07b(0x224)];_0x423b6f(_0x3e473b[_0x11f07b(0x299)]);break;}default:_0x423b6f('');break;}}},[_0x133c28,_0x4d3607,_0x204fae,_0x3f8d7a,_0x31c7b1]),useEffect(()=>{const _0x592146=_0x49aaf5;let _0x263d21=null;if(_0x133c28&&!_0x133c28[_0x592146(0x2d8)]&&_0x133c28[_0x592146(0x21c)]===HyperLinkEditSourceType[_0x592146(0x25d)]&&Tools[_0x592146(0x270)](_0x133c28['row'])&&Tools['isDefine'](_0x133c28[_0x592146(0x2f3)])){const _0x5faf60=_0x31c7b1['getUnit'](_0x133c28['unitId'],UniverInstanceType[_0x592146(0x275)]),_0x4eff7=_0x5faf60==null?void 0x0:_0x5faf60[_0x592146(0x2c8)](_0x133c28[_0x592146(0x283)]),_0x252013=_0x4eff7==null?void 0x0:_0x4eff7[_0x592146(0x37b)](_0x133c28[_0x592146(0x214)],_0x133c28[_0x592146(0x2f3)]),_0x37423b=new ColorKit(_0x3a8438[_0x592146(0x2a8)]()[_0x592146(0x3bd)])[_0x592146(0x37c)]();_0x263d21=_0x214068['addShape']({'range':_0x252013!=null?_0x252013:{'startColumn':_0x133c28[_0x592146(0x2f3)],'endColumn':_0x133c28[_0x592146(0x2f3)],'startRow':_0x133c28[_0x592146(0x214)],'endRow':_0x133c28[_0x592146(0x214)]},'style':{'hasAutoFill':!0x1,'fill':'rgb('+_0x37423b['r']+',\x20'+_0x37423b['g']+',\x20'+_0x37423b['b']+_0x592146(0x260),'strokeWidth':0x1,'stroke':'#FFBD37','widgets':{}},'primary':null},[],-0x1);}return()=>{const _0x6fd019=_0x592146;_0x263d21&&_0x214068[_0x6fd019(0x32c)](_0x263d21);};},[_0x133c28,_0x214068,_0x3a8438,_0x31c7b1]);const _0x321b01=useMemo(()=>_0xd8a233,[_0x428954]);useEffect(()=>{const _0x513f9b=_0x49aaf5,_0x3db0d1=_0x1e9f4a[_0x513f9b(0x215)](_0x1c2342['getCurrentEditorId']()),_0x2fd743=new DisposableCollection();if(_0x3db0d1){const _0x26051d=_0x3db0d1['with'](DocSelectionRenderService);_0x26051d[_0x513f9b(0x306)](!0x0),_0x2fd743[_0x513f9b(0x2e8)](()=>{_0x26051d['setReserveRangesStatus'](!0x1);});}return()=>{const _0x403760=_0x513f9b;_0x1c2342[_0x403760(0x251)](),_0x2fd743[_0x403760(0x2c5)]();};},[_0x1c2342,_0x1e9f4a]);const _0xec9da5=[{'label':_0x153f36['t'](_0x49aaf5(0x21b)),'value':SheetHyperLinkType[_0x49aaf5(0x363)]},{'label':_0x153f36['t'](_0x49aaf5(0x203)),'value':SheetHyperLinkType[_0x49aaf5(0x39c)]},{'label':_0x153f36['t'](_0x49aaf5(0x2da)),'value':SheetHyperLinkType['SHEET']},{'label':_0x153f36['t'](_0x49aaf5(0x2ee)),'value':SheetHyperLinkType[_0x49aaf5(0x248)]},..._0x4054d6],_0x3b1109=_0x31c7b1[_0x49aaf5(0x344)](UniverInstanceType[_0x49aaf5(0x275)]);if(!_0x3b1109)return;const _0x5073de=_0x3b1109[_0x49aaf5(0x32b)](),_0x7c5ece=_0x3b1109[_0x49aaf5(0x221)]()[_0x49aaf5(0x3cf)](_0x174263=>({'label':_0x174263[_0x49aaf5(0x2d7)](),'value':_0x174263[_0x49aaf5(0x1f1)]()}))[_0x49aaf5(0x33e)](_0x27e1af=>_0x5073de[_0x49aaf5(0x211)](_0x27e1af['value'])===-0x1),_0x22c3f2=Object[_0x49aaf5(0x232)]((_0x55e2c9=_0x56b1b8[_0x49aaf5(0x206)](_0x3b1109[_0x49aaf5(0x34e)]()))!=null?_0x55e2c9:{})['map'](_0x4fdf70=>({'label':_0x4fdf70[_0x49aaf5(0x33f)],'value':_0x4fdf70['id']})),_0x40edb7=__name((_0x17f97a,_0x4c013b)=>{const _0xe508b5=_0x49aaf5;if(_0x17f97a===SheetHyperLinkType[_0xe508b5(0x363)])return serializeUrl(_0x4c013b);if(_0x17f97a===SheetHyperLinkType['RANGE']){const _0x5979da=deserializeRangeWithSheet(_0x4c013b),_0x2c4e22=_0x3b1109[_0xe508b5(0x23c)](_0x5979da[_0xe508b5(0x29c)]);if(_0x2c4e22)return'#gid='+_0x2c4e22[_0xe508b5(0x1f1)]()+'&range='+serializeRange(_0x5979da['range']);}return'#'+_0x17f97a+'='+_0x4c013b;},'formatUrl'),_0x520a89=useEvent(_0x9c1582=>{const _0xed4c9c=_0x49aaf5;var _0x31d2be;const _0x479619=_0x9c1582[0x0];if(!_0x479619||!isValidRange(_0x479619[_0xed4c9c(0x287)]))return;_0x479619[_0xed4c9c(0x29c)]||(_0x479619[_0xed4c9c(0x29c)]=((_0x31d2be=_0x3b1109[_0xed4c9c(0x24c)]())==null?void 0x0:_0x31d2be[_0xed4c9c(0x2d7)]())||'');const _0x55bb9f=serializeRangeToRefString(_0x479619);_0x423b6f(_0x55bb9f),_0x55bb9f&&(_0x44f8a8[_0xed4c9c(0x3af)]||!_0xcfad55)&&(_0x3f31d8(_0x55bb9f),_0x44f8a8[_0xed4c9c(0x3af)]=!0x0);}),_0x46ba0f=__name(async()=>{const _0x2d18d0=_0x49aaf5;if(_0x2591f8&&!_0xcfad55||!_0xd8a233||_0x428954===SheetHyperLinkType[_0x2d18d0(0x363)]&&!isLegalLink(_0xd8a233)){_0x4218eb(!0x0);return;}if(_0x133c28){if(_0xba55f7){const _0x597935=_0x133c28['type']===HyperLinkEditSourceType[_0x2d18d0(0x302)]||_0x133c28[_0x2d18d0(0x21c)]===HyperLinkEditSourceType['EDITING']?UpdateRichHyperLinkCommand['id']:UpdateHyperLinkCommand['id'];await _0x1bfd86[_0x2d18d0(0x3d5)](_0x597935,{'id':_0xba55f7,'unitId':_0x133c28[_0x2d18d0(0x24a)],'subUnitId':_0x133c28[_0x2d18d0(0x283)],'payload':{'display':_0x2591f8?_0xcfad55:'','payload':_0x40edb7(_0x428954,_0xd8a233)},'row':_0x133c28[_0x2d18d0(0x214)],'column':_0x133c28[_0x2d18d0(0x2f3)],'documentId':_0x133c28[_0x2d18d0(0x21c)]===HyperLinkEditSourceType['ZEN_EDITOR']?DOCS_ZEN_EDITOR_UNIT_ID_KEY:_0x1c2342[_0x2d18d0(0x3be)]()});}else{const _0x11e738=_0x133c28[_0x2d18d0(0x21c)]===HyperLinkEditSourceType[_0x2d18d0(0x302)]||_0x133c28[_0x2d18d0(0x21c)]===HyperLinkEditSourceType[_0x2d18d0(0x2c3)]?AddRichHyperLinkCommand['id']:AddHyperLinkCommand['id'];await _0x1bfd86[_0x2d18d0(0x3d5)](_0x11e738,{'unitId':_0x133c28[_0x2d18d0(0x24a)],'subUnitId':_0x133c28[_0x2d18d0(0x283)],'link':{'id':generateRandomId(),'row':_0x133c28[_0x2d18d0(0x214)],'column':_0x133c28['col'],'payload':_0x40edb7(_0x428954,_0xd8a233),'display':_0x2591f8?_0xcfad55:''},'documentId':_0x133c28['type']===HyperLinkEditSourceType[_0x2d18d0(0x302)]?DOCS_ZEN_EDITOR_UNIT_ID_KEY:_0x1c2342['getCurrentEditorId']()});}}if((_0x133c28==null?void 0x0:_0x133c28[_0x2d18d0(0x21c)])===HyperLinkEditSourceType[_0x2d18d0(0x25d)]){await _0x1bfd86[_0x2d18d0(0x3d5)](SetWorksheetActiveOperation['id'],{'unitId':_0x133c28[_0x2d18d0(0x24a)],'subUnitId':_0x133c28[_0x2d18d0(0x283)]});const _0x472bd5=0x1;await _0x1bfd86[_0x2d18d0(0x3d5)](ScrollToRangeOperation['id'],{'range':{'startRow':Math[_0x2d18d0(0x2d3)](_0x133c28[_0x2d18d0(0x214)]-_0x472bd5,0x0),'endRow':_0x133c28[_0x2d18d0(0x214)]+_0x472bd5,'startColumn':Math[_0x2d18d0(0x2d3)](_0x133c28['col']-_0x472bd5,0x0),'endColumn':_0x133c28[_0x2d18d0(0x2f3)]+_0x472bd5}});}_0x1bfd86[_0x2d18d0(0x3d5)](CloseHyperLinkPopupOperation['id']);},'handleSubmit');return _0x133c28?jsxRuntimeExports[_0x49aaf5(0x276)](_0x49aaf5(0x353),{'className':styles$1[_0x49aaf5(0x358)],'style':{'display':_0x23285f?'none':_0x49aaf5(0x2f0)},'children':[_0x2591f8?jsxRuntimeExports[_0x49aaf5(0x3ab)](FormLayout,{'label':_0x153f36['t'](_0x49aaf5(0x341)),'error':_0x4cd26e&&!_0xcfad55?_0x153f36['t']('hyperLink.form.inputError'):'','children':jsxRuntimeExports['jsx'](Input,{'value':_0xcfad55,'onChange':__name(_0x20f7ae=>{const _0x410328=_0x49aaf5;_0x3f31d8(_0x20f7ae),_0x44f8a8[_0x410328(0x3af)]=!0x1;},_0x49aaf5(0x295)),'placeholder':_0x153f36['t'](_0x49aaf5(0x3c7)),'autoFocus':!0x0,'onKeyDown':__name(_0x4cd177=>{const _0x35e7ef=_0x49aaf5;_0x4cd177['keyCode']===KeyCode[_0x35e7ef(0x2b4)]&&_0x46ba0f();},_0x49aaf5(0x2ea))})}):null,jsxRuntimeExports['jsx'](FormLayout,{'label':_0x153f36['t']('hyperLink.form.type'),'contentStyle':{'marginBottom':0x0},'children':jsxRuntimeExports[_0x49aaf5(0x3ab)](Select,{'options':_0xec9da5,'value':_0x428954,'onChange':__name(_0x146935=>{_0x34054c(_0x146935),_0x423b6f('');},_0x49aaf5(0x295))})}),_0x428954===SheetHyperLinkType[_0x49aaf5(0x363)]&&jsxRuntimeExports[_0x49aaf5(0x3ab)](FormLayout,{'error':_0x4cd26e?_0xd8a233?isLegalLink(_0xd8a233)?'':_0x153f36['t'](_0x49aaf5(0x2de)):_0x153f36['t'](_0x49aaf5(0x298)):'','children':jsxRuntimeExports['jsx'](Input,{'value':_0xd8a233,'onChange':__name(_0x3e9078=>{const _0x2a0659=_0x49aaf5;_0x423b6f(_0x3e9078),_0x3e9078&&(_0x44f8a8[_0x2a0659(0x3af)]||!_0xcfad55||_0xcfad55===_0xd8a233)&&(_0x3f31d8(_0x3e9078),_0x44f8a8[_0x2a0659(0x3af)]=!0x0);},_0x49aaf5(0x295)),'placeholder':_0x153f36['t'](_0x49aaf5(0x1ea)),'autoFocus':!_0x2591f8,'onKeyDown':__name(_0x4965a8=>{const _0x22f307=_0x49aaf5;_0x4965a8[_0x22f307(0x360)]===KeyCode[_0x22f307(0x2b4)]&&_0x46ba0f();},_0x49aaf5(0x2ea))})}),_0x428954===SheetHyperLinkType[_0x49aaf5(0x39c)]&&jsxRuntimeExports[_0x49aaf5(0x3ab)](FormLayout,{'error':_0x4cd26e&&!_0xd8a233?_0x153f36['t'](_0x49aaf5(0x298)):'','children':jsxRuntimeExports[_0x49aaf5(0x3ab)](RangeSelector,{'openForSheetUnitId':_0x3b1109[_0x49aaf5(0x34e)](),'id':createInternalEditorID('hyper-link-edit'),'isSingleChoice':!0x0,'value':_0x321b01,'onChange':_0x520a89,'dialogOnly':!0x0,'onSelectorVisibleChange':__name(async _0x3c4e11=>{const _0x14b391=_0x49aaf5;var _0xcf4e2,_0x30e909;if(_0x3c4e11)_0x133c28[_0x14b391(0x21c)]===HyperLinkEditSourceType['ZEN_EDITOR']&&(_0x5bc8c9[_0x14b391(0x1fb)](),_0x307c5c[_0x14b391(0x386)](FOCUSING_SHEET,!0x0)),_0x133c28['type']!==HyperLinkEditSourceType[_0x14b391(0x25d)]&&_0x1c2342['enableForceKeepVisible'](),_0x28c2b9(!0x0);else{if(await _0x4d3607[_0x14b391(0x34b)](_0x133c28['unitId'],_0x133c28[_0x14b391(0x283)],{'startRow':_0x133c28[_0x14b391(0x214)],'endRow':_0x133c28[_0x14b391(0x214)],'startColumn':_0x133c28[_0x14b391(0x2f3)],'endColumn':_0x133c28[_0x14b391(0x2f3)]}),_0x133c28[_0x14b391(0x21c)]===HyperLinkEditSourceType['ZEN_EDITOR']){await _0x1bfd86[_0x14b391(0x3d5)](SetSelectionsOperation['id'],{'unitId':_0x133c28['unitId'],'subUnitId':_0x133c28[_0x14b391(0x283)],'selections':[{'range':{'startRow':_0x133c28[_0x14b391(0x214)],'endRow':_0x133c28[_0x14b391(0x214)],'startColumn':_0x133c28[_0x14b391(0x2f3)],'endColumn':_0x133c28[_0x14b391(0x2f3)]}}]}),_0x5bc8c9[_0x14b391(0x393)](),_0x307c5c[_0x14b391(0x386)](FOCUSING_SHEET,!0x1);const _0x268069=(_0xcf4e2=_0x1e9f4a[_0x14b391(0x215)](DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0x0:_0xcf4e2['with'](DocBackScrollRenderController),_0x952492=(_0x30e909=_0x435480[_0x14b391(0x309)]({'unitId':DOCS_ZEN_EDITOR_UNIT_ID_KEY,'subUnitId':DOCS_ZEN_EDITOR_UNIT_ID_KEY}))==null?void 0x0:_0x30e909[0x0];_0x268069&&_0x952492&&setTimeout(()=>{const _0x5e39e3=_0x14b391;_0x268069[_0x5e39e3(0x2c9)](_0x952492),_0x435480[_0x5e39e3(0x1d9)]({'unitId':DOCS_ZEN_EDITOR_UNIT_ID_KEY,'subUnitId':DOCS_ZEN_EDITOR_UNIT_ID_KEY});},0x64);}_0x1c2342[_0x14b391(0x251)](),_0x28c2b9(!0x1);}},_0x49aaf5(0x3b3))})}),_0x428954===SheetHyperLinkType[_0x49aaf5(0x3e0)]&&jsxRuntimeExports[_0x49aaf5(0x3ab)](FormLayout,{'error':_0x4cd26e&&!_0xd8a233?_0x153f36['t'](_0x49aaf5(0x29e)):'','children':jsxRuntimeExports[_0x49aaf5(0x3ab)](Select,{'options':_0x7c5ece,'value':_0xd8a233,'onChange':__name(_0x31398e=>{const _0xf98f3=_0x49aaf5;var _0xc1d140,_0x4bde16;_0x423b6f(_0x31398e);const _0x9e6d06=(_0xc1d140=_0x7c5ece[_0xf98f3(0x2ef)](_0xe7b8e2=>_0xe7b8e2[_0xf98f3(0x201)]===_0x31398e))==null?void 0x0:_0xc1d140['label'],_0xfa63c5=(_0x4bde16=_0x7c5ece['find'](_0x4f022b=>_0x4f022b[_0xf98f3(0x201)]===_0xd8a233))==null?void 0x0:_0x4bde16[_0xf98f3(0x320)];_0x9e6d06&&(_0x44f8a8[_0xf98f3(0x3af)]||!_0xcfad55||_0xcfad55===_0xfa63c5)&&(_0x3f31d8(_0x9e6d06),_0x44f8a8[_0xf98f3(0x3af)]=!0x0);},_0x49aaf5(0x295))})}),_0x428954===SheetHyperLinkType[_0x49aaf5(0x248)]&&jsxRuntimeExports['jsx'](FormLayout,{'error':_0x4cd26e&&!_0xd8a233?_0x153f36['t']('hyperLink.form.selectError'):'','children':jsxRuntimeExports[_0x49aaf5(0x3ab)](Select,{'options':_0x22c3f2,'value':_0xd8a233,'onChange':__name(_0xa86895=>{const _0x5ce21b=_0x49aaf5;var _0x5e5569,_0x78c72c;_0x423b6f(_0xa86895);const _0x495877=(_0x5e5569=_0x22c3f2[_0x5ce21b(0x2ef)](_0x2d263b=>_0x2d263b[_0x5ce21b(0x201)]===_0xa86895))==null?void 0x0:_0x5e5569[_0x5ce21b(0x320)],_0x1d13ae=(_0x78c72c=_0x22c3f2[_0x5ce21b(0x2ef)](_0x3373e3=>_0x3373e3[_0x5ce21b(0x201)]===_0xd8a233))==null?void 0x0:_0x78c72c[_0x5ce21b(0x320)];_0x495877&&(_0x44f8a8[_0x5ce21b(0x3af)]||!_0xcfad55||_0xcfad55===_0x1d13ae)&&(_0x3f31d8(_0x495877),_0x44f8a8[_0x5ce21b(0x3af)]=!0x0);},_0x49aaf5(0x295))})}),(_0x20c6ad==null?void 0x0:_0x20c6ad[_0x49aaf5(0x3de)])&&jsxRuntimeExports[_0x49aaf5(0x3ab)](_0x20c6ad[_0x49aaf5(0x3de)],{'linkId':_0xba55f7,'payload':_0xd8a233,'display':_0xcfad55,'showError':_0x4cd26e,'setByPayload':_0x44f8a8,'setDisplay':__name(_0x54044c=>{const _0x2b2833=_0x49aaf5;_0x3f31d8(_0x54044c),_0x44f8a8[_0x2b2833(0x3af)]=!0x0;},_0x49aaf5(0x1f7)),'setPayload':_0x423b6f}),jsxRuntimeExports[_0x49aaf5(0x276)](_0x49aaf5(0x353),{'className':styles$1['cellLinkEditButtons'],'children':[jsxRuntimeExports[_0x49aaf5(0x3ab)](Button,{'onClick':__name(()=>{const _0x53078b=_0x49aaf5;_0x133c28&&_0x4d3607[_0x53078b(0x34b)](_0x133c28[_0x53078b(0x24a)],_0x133c28['subUnitId'],{'startRow':_0x133c28[_0x53078b(0x214)],'endRow':_0x133c28[_0x53078b(0x214)],'startColumn':_0x133c28[_0x53078b(0x2f3)],'endColumn':_0x133c28[_0x53078b(0x2f3)]}),_0x1bfd86['executeCommand'](CloseHyperLinkPopupOperation['id']);},_0x49aaf5(0x223)),'children':_0x153f36['t'](_0x49aaf5(0x294))}),jsxRuntimeExports['jsx'](Button,{'type':_0x49aaf5(0x261),'style':{'marginLeft':0x8},'onClick':__name(async()=>{_0x46ba0f();},_0x49aaf5(0x223)),'children':_0x153f36['t']('hyperLink.form.ok')})]})]}):null;},_0x121662(0x2b8));CellLinkEdit['componentKey']=_0x121662(0x3b8);var __assign=function(){const _0x112101=_0x121662;return __assign=Object[_0x112101(0x392)]||function(_0x4b8afa){const _0x31ca75=_0x112101;for(var _0x497943,_0x44f174=0x1,_0x1aa805=arguments['length'];_0x44f174<_0x1aa805;_0x44f174++){_0x497943=arguments[_0x44f174];for(var _0x3d8ebd in _0x497943)Object[_0x31ca75(0x213)][_0x31ca75(0x1c5)][_0x31ca75(0x2cb)](_0x497943,_0x3d8ebd)&&(_0x4b8afa[_0x3d8ebd]=_0x497943[_0x3d8ebd]);}return _0x4b8afa;},__assign['apply'](this,arguments);},__rest=function(_0x365b8f,_0x5efb06){const _0x20ae7c=_0x121662;var _0x3306e1={};for(var _0xb02d7e in _0x365b8f)Object[_0x20ae7c(0x213)][_0x20ae7c(0x1c5)]['call'](_0x365b8f,_0xb02d7e)&&_0x5efb06['indexOf'](_0xb02d7e)<0x0&&(_0x3306e1[_0xb02d7e]=_0x365b8f[_0xb02d7e]);if(_0x365b8f!=null&&typeof Object[_0x20ae7c(0x2b9)]==_0x20ae7c(0x28e)){for(var _0x48da1d=0x0,_0xb02d7e=Object[_0x20ae7c(0x2b9)](_0x365b8f);_0x48da1d<_0xb02d7e[_0x20ae7c(0x259)];_0x48da1d++)_0x5efb06[_0x20ae7c(0x211)](_0xb02d7e[_0x48da1d])<0x0&&Object[_0x20ae7c(0x213)]['propertyIsEnumerable'][_0x20ae7c(0x2cb)](_0x365b8f,_0xb02d7e[_0x48da1d])&&(_0x3306e1[_0xb02d7e[_0x48da1d]]=_0x365b8f[_0xb02d7e[_0x48da1d]]);}return _0x3306e1;},IconBase=forwardRef(function(_0x796cea,_0x247629){const _0x1c8592=_0x121662;var _0xa25286=_0x796cea[_0x1c8592(0x220)],_0x3aaf77=_0x796cea['id'],_0x49912f=_0x796cea[_0x1c8592(0x1d7)],_0x210c42=_0x796cea[_0x1c8592(0x399)],_0x5c5a8a=__rest(_0x796cea,['icon','id','className',_0x1c8592(0x399)]),_0xf4c06=_0x1c8592(0x365)[_0x1c8592(0x1c3)](_0x3aaf77,'\x20')[_0x1c8592(0x1c3)](_0x49912f||'')[_0x1c8592(0x372)](),_0x55cb42=useRef('_'['concat'](generateShortUuid()));return render(_0xa25286,''[_0x1c8592(0x1c3)](_0x3aaf77),{'defIds':_0xa25286[_0x1c8592(0x36c)],'idSuffix':_0x55cb42[_0x1c8592(0x3af)]},__assign({'ref':_0x247629,'className':_0xf4c06},_0x5c5a8a),_0x210c42);});function render(_0x52cff7,_0x1437a5,_0x1aa750,_0x2e76bc,_0x4d3c54){const _0x287b5c=_0x121662;return createElement(_0x52cff7[_0x287b5c(0x2c0)],__assign(__assign({'key':_0x1437a5},replaceRuntimeIdsAndExtInAttrs(_0x52cff7,_0x1aa750,_0x4d3c54)),_0x2e76bc),(replaceRuntimeIdsInDefs(_0x52cff7,_0x1aa750)[_0x287b5c(0x1d0)]||[])[_0x287b5c(0x3cf)](function(_0x17ba17,_0x318861){const _0x85a217=_0x287b5c;return render(_0x17ba17,''[_0x85a217(0x1c3)](_0x1437a5,'-')[_0x85a217(0x1c3)](_0x52cff7[_0x85a217(0x2c0)],'-')['concat'](_0x318861),_0x1aa750,void 0x0,_0x4d3c54);}));}__name(render,_0x121662(0x237));function replaceRuntimeIdsAndExtInAttrs(_0x2d9356,_0x4259d6,_0x4fb541){const _0x10fbf8=_0x121662;var _0x2bb2eb=__assign({},_0x2d9356[_0x10fbf8(0x329)]);_0x4fb541!=null&&_0x4fb541[_0x10fbf8(0x23f)]&&_0x2bb2eb[_0x10fbf8(0x338)]===_0x10fbf8(0x23f)&&(_0x2bb2eb[_0x10fbf8(0x338)]=_0x4fb541[_0x10fbf8(0x23f)]);var _0x1f0d75=_0x4259d6[_0x10fbf8(0x36c)];return!_0x1f0d75||_0x1f0d75[_0x10fbf8(0x259)]===0x0||(_0x2d9356[_0x10fbf8(0x2c0)]===_0x10fbf8(0x3ca)&&_0x2bb2eb[_0x10fbf8(0x3d4)]&&(_0x2bb2eb[_0x10fbf8(0x3d4)]=_0x2bb2eb['xlink:href']+_0x4259d6['idSuffix']),Object[_0x10fbf8(0x351)](_0x2bb2eb)[_0x10fbf8(0x3bc)](function(_0x142362){const _0x494a61=_0x10fbf8;var _0x93125e=_0x142362[0x0],_0x17cb7b=_0x142362[0x1];typeof _0x17cb7b=='string'&&(_0x2bb2eb[_0x93125e]=_0x17cb7b['replace'](/url\(#(.*)\)/,_0x494a61(0x323)[_0x494a61(0x1c3)](_0x4259d6[_0x494a61(0x22d)],')')));})),_0x2bb2eb;}__name(replaceRuntimeIdsAndExtInAttrs,'replaceRuntimeIdsAndExtInAttrs');function replaceRuntimeIdsInDefs(_0x26a854,_0x4bdfa3){const _0x4988fc=_0x121662;var _0x324c93,_0x2688b2=_0x4bdfa3[_0x4988fc(0x36c)];return!_0x2688b2||_0x2688b2[_0x4988fc(0x259)]===0x0?_0x26a854:_0x26a854[_0x4988fc(0x2c0)]===_0x4988fc(0x204)&&(!((_0x324c93=_0x26a854[_0x4988fc(0x1d0)])===null||_0x324c93===void 0x0)&&_0x324c93[_0x4988fc(0x259)])?__assign(__assign({},_0x26a854),{'children':_0x26a854[_0x4988fc(0x1d0)]['map'](function(_0x4b9058){const _0x2d6790=_0x4988fc;return typeof _0x4b9058[_0x2d6790(0x329)]['id']=='string'&&_0x2688b2&&_0x2688b2[_0x2d6790(0x211)](_0x4b9058['attrs']['id'])>-0x1?__assign(__assign({},_0x4b9058),{'attrs':__assign(__assign({},_0x4b9058[_0x2d6790(0x329)]),{'id':_0x4b9058[_0x2d6790(0x329)]['id']+_0x4bdfa3[_0x2d6790(0x22d)]})}):_0x4b9058;})}):_0x26a854;}__name(replaceRuntimeIdsInDefs,'replaceRuntimeIdsInDefs');function generateShortUuid(){const _0x1a9472=_0x121662;return Math[_0x1a9472(0x36f)]()[_0x1a9472(0x254)](0x24)[_0x1a9472(0x38b)](0x2,0x8);}__name(generateShortUuid,_0x121662(0x29f)),IconBase[_0x121662(0x207)]=_0x121662(0x3d6);var element$5={'tag':_0x121662(0x245),'attrs':{'fill':_0x121662(0x3bf),'viewBox':_0x121662(0x3ad),'width':_0x121662(0x337),'height':'1em'},'children':[{'tag':_0x121662(0x322),'attrs':{'fill':'currentColor','d':'M7.9999\x201.12915C8.03875\x201.12915\x208.07673\x201.13284\x208.11352\x201.13989H12.2599C13.6958\x201.13989\x2014.8599\x202.30395\x2014.8599\x203.73989V7.88619C14.867\x207.92301\x2014.8707\x207.96102\x2014.8707\x207.9999C14.8707\x208.03878\x2014.867\x208.0768\x2014.8599\x208.11362V12.2599C14.8599\x2013.6958\x2013.6958\x2014.8599\x2012.2599\x2014.8599H8.11362C8.0768\x2014.867\x208.03878\x2014.8707\x207.9999\x2014.8707C7.96102\x2014.8707\x207.92301\x2014.867\x207.88619\x2014.8599H3.73989C2.30396\x2014.8599\x201.13989\x2013.6958\x201.13989\x2012.2599V8.11352C1.13284\x208.07673\x201.12915\x208.03875\x201.12915\x207.9999C1.12915\x207.96106\x201.13284\x207.92308\x201.13989\x207.88629V3.73989C1.13989\x202.30396\x202.30395\x201.13989\x203.73989\x201.13989H7.88629C7.92308\x201.13284\x207.96106\x201.12915\x207.9999\x201.12915ZM2.33989\x208.5999V12.2599C2.33989\x2013.0331\x202.9667\x2013.6599\x203.73989\x2013.6599H7.3999V8.5999H2.33989ZM7.3999\x207.3999H2.33989V3.73989C2.33989\x202.9667\x202.96669\x202.33989\x203.73989\x202.33989H7.3999V7.3999ZM8.5999\x208.5999V13.6599H12.2599C13.0331\x2013.6599\x2013.6599\x2013.0331\x2013.6599\x2012.2599V8.5999H8.5999ZM13.6599\x207.3999H8.5999V2.33989H12.2599C13.0331\x202.33989\x2013.6599\x202.96669\x2013.6599\x203.73989V7.3999Z','fillRule':_0x121662(0x279),'clipRule':_0x121662(0x279)}}]},AllBorderSingle=forwardRef(function(_0x1aaf52,_0x35a900){const _0x32878e=_0x121662;return createElement(IconBase,Object[_0x32878e(0x392)]({},_0x1aaf52,{'id':_0x32878e(0x3a6),'ref':_0x35a900,'icon':element$5}));});AllBorderSingle[_0x121662(0x207)]=_0x121662(0x33a);var element$4={'tag':'svg','attrs':{'fill':'none','viewBox':_0x121662(0x3ad),'width':'1em','height':'1em'},'children':[{'tag':_0x121662(0x322),'attrs':{'fill':_0x121662(0x2e1),'d':_0x121662(0x234),'fillRule':_0x121662(0x279),'clipRule':_0x121662(0x279)}}]},CopySingle=forwardRef(function(_0x4bbf66,_0x18472d){const _0x2df8b0=_0x121662;return createElement(IconBase,Object[_0x2df8b0(0x392)]({},_0x4bbf66,{'id':_0x2df8b0(0x28d),'ref':_0x18472d,'icon':element$4}));});function _0x4837(){const _0x1c95cb=['getCellRaw','parseHyperLink','matrix','startAddEditing','attrs','top','getHiddenWorksheets','removeShape','focused$','CUSTOM_RANGE_START','getCustomRangesInterestsWithRange','_plainTextFilter','WriteSingle','COPY','_shortcutService','_definedNamesService','attachPopupToRange','_initCommandInterceptor','1em','fill','_collect','AllBorderSingle','_selectionManagerService','_componentManager','every','filter','name','hash','hyperLink.form.label','hyperLink.popup.cancel','sheets.command.cancel-rich-hyper-link','getCurrentUnitForType','editing','handler','_initClearSelectionCommandInterceptor','__decorateClass$c','SheetHyperLinkSetRangeController','getEditCellState','navigateToRange','univer-cell-link-operations','601238sHEGxw','getUnitId','currentPopup$','buildHyperLink','entries','SPECIAL_PASTE_FORMAT','div','_initComponents','selection','next','__decorateParam$5','cellLinkEdit','xlsx','sheets.command.update-hyper-link','_getEditingRange','SheetsHyperLinkResolverService','SheetsHyperLinkRenderController','addClipboardHook','_editPopup','keyCode','deepClone','getWorksheetSkeleton','URL','urlHandler','univerjs-icon\x20univerjs-icon-','getSubUnit','attachPopupToCell','hyperLink.form.addTitle','TOOLBAR_START','genZenEditorMenuId','__decorateParam$6','defIds','_initHoverEditingListener','intersects','random','_initSkeletonChange','getMutations','trim','getCellDocumentModelWithFormula','replace','insertLinkMenuFactory','getCurrentLastSelection','key','generateRandomId','sheet.operation.insert-hyper-link-toolbar','zen_mode','getMergedCell','toRgb','_initMenus','customRanges','110673IFrfUo','isLegalUrl','#fff','sheet.operation.close-hyper-link-popup','univer-cell-link-edit-buttons','_univerInstanceService','SERIES','setContextValue','collapsed','_refRangeService','getShouldDisableCurrentCellLink','_sheetClipboardService','substring','properties','SHEET_HYPER_LINK_UI_PLUGIN','_registerRange','univer-cell-link-content-error','UnlinkSingle','registerCustomHyperLink','assign','show','_textSelectionManagerService','noopReturnFunc','getValue','#gid=','hasProtocol','extend','disposeWithMe','convert','RANGE','subscribe','AFTER_CELL_EDIT','endRow','CHECKBOX','_currentEditing$','currentPopup','getBoundingClientRect','getPlainText','interceptor','all-border-single','_initSheetChange','pop','visible$','__decorateClass$4','jsx','UniverSheetsHyperLinkUIPlugin','0\x200\x2016\x2016','_initSetRangesListener','current','getMaxRows','getMergeData','bottom','onSelectorVisibleChange','getBlankCellDocumentModel','navigateToDefineName','_initViewModelIntercept','registerPlainTextFilter','univer.sheet.cell-link-edit','getSelfOrHeaderFooterModel','2934OMmXyT','gid','forEach','hyacinth500','getCurrentEditorId','none','min','_hoverManagerService','#35BD4B','intercept','isEmptyDocument','defineProperty','COMMAND','hyperLink.form.labelPlaceholder','_customHyperLinks','SheetsHyperLinkPopupController','use','port','serializeUrl','mergeMenu','sheets.command.add-rich-hyper-link','map','pushUndoRedo','slice','rects','__decorateClass$8','xlink:href','executeCommand','UniverIcon','14ZoXmuc','getCustomHyperLink','pathname','onContextMenu','commandId','getCell','pipe','Form','includes','SHEET','cellLinkOperationError','_resolverService','cellLinkContentError','asObservable','175nBoyof','_configService','pluginName','copyPermission','_commandService','getBody','concat','hyperLink.message.refError','hasOwnProperty','_initCopyPaste','clipboard','insertLinkMenuToolbarFactory','M12.5935\x203.47302C11.6354\x202.51492\x2010.082\x202.51492\x209.12388\x203.47302L7.83534\x204.76157C7.60102\x204.99588\x207.22112\x204.99588\x206.98681\x204.76157\x206.75249\x204.52725\x206.75249\x204.14735\x206.98681\x203.91304L8.27535\x202.62449C9.70209\x201.19776\x2012.0153\x201.19776\x2013.442\x202.62449\x2014.8688\x204.05123\x2014.8688\x206.36442\x2013.442\x207.79116L12.1535\x209.0797C11.9192\x209.31402\x2011.5393\x209.31402\x2011.3049\x209.0797\x2011.0706\x208.84539\x2011.0706\x208.46549\x2011.3049\x208.23117L12.5935\x206.94263C13.5516\x205.98452\x2013.5516\x204.43113\x2012.5935\x203.47302zM3.40637\x2012.6606C2.44827\x2011.7025\x202.44827\x2010.1491\x203.40637\x209.19102L4.69492\x207.90248C4.92923\x207.66816\x204.92923\x207.28826\x204.69492\x207.05395\x204.4606\x206.81963\x204.0807\x206.81963\x203.84639\x207.05395L2.55784\x208.34249C1.13111\x209.76923\x201.13111\x2012.0824\x202.55784\x2013.5092\x203.98458\x2014.9359\x206.29777\x2014.9359\x207.72451\x2013.5092L9.01305\x2012.2206C9.24737\x2011.9863\x209.24737\x2011.6064\x209.01305\x2011.3721\x208.77874\x2011.1378\x208.39884\x2011.1378\x208.16452\x2011.3721L6.87598\x2012.6606C5.91787\x2013.6187\x204.36448\x2013.6187\x203.40637\x2012.6606zM3.5852\x202.80332C3.35088\x202.569\x202.97098\x202.569\x202.73667\x202.80332\x202.50235\x203.03763\x202.50235\x203.41753\x202.73667\x203.65185L12.4151\x2013.3302C12.6494\x2013.5646\x2013.0293\x2013.5646\x2013.2636\x2013.3302\x2013.4979\x2013.0959\x2013.4979\x2012.716\x2013.2636\x2012.4817L3.5852\x202.80332z','hyperLink.message.noSheet','register','_initShortCut','__decorateParam$4','getSnapshot','isEqualLink','children','componentKey','visible','844PuWTIR','findCustomHyperLink','__decorateParam$a','_initSetRangeValuesCommandInterceptor','className','removePlainTextFilter','refreshSelection','univer-cell-link','onFillData','getInterceptPoints','BUTTON','742gCMwCx','hostname','Info','apply','startsWith','__decorateClass$b','getMaxColumns','_zenZoneService','__decorateClass$3','onPasteCells','right','registerRefRange','hyperLink.form.linkPlaceholder','_permissionService','M3.4535\x201.12549C2.7002\x201.12549\x202.08954\x201.73615\x202.08954\x202.48945V13.5104C2.08954\x2014.2637\x202.7002\x2014.8744\x203.4535\x2014.8744H12.5465C13.2998\x2014.8744\x2013.9105\x2014.2637\x2013.9105\x2013.5104V5.0992L10.0091\x201.12549H3.4535Z','permissionCheckWithRanges','STRING','with','univer-cell-link-operation','getSheetId','_commandExecutedListener','hyper-link-edit','startOffset','documentLayoutObject','ONLY_FORMAT','setDisplay','ref','exports','ReactCurrentOwner','hide','SheetsHyperLinkRenderManagerController','foreach','_sheetPermissionInterceptorBaseController','endColumn','cellValue','value','getCurrent','hyperLink.form.range','defs','documentModel','getDefinedNameMap','displayName','Error','onStarting','focusRange','__decorateClass$5','_initTextSelectionListener','192UMpQoe','320xWpOHM','__decorateClass$6','getCurrentSelectorId','indexOf','_getLinkPermission','prototype','row','getRenderById','cellLinkType','startEditing','delete','_editorService','isLegalLink','hyperLink.form.link','type','sheet.operation.open-hyper-link-edit-panel','interceptCommand','zenEditorInsertLinkMenuFactory','icon','getSheets','startColumn','onClick','searchObj','SheetsHyperLinkRemoveSheetController','_initAfterEditor','engine','COLUMN','__decorateParam$2','left','_getURLName','onBeforeCopy','idSuffix','__publicField','_docCanvasPopManagerService','4006440nBpOQP','Xlsx','values','CellLinkPopup','M4.1302\x2012.4251C4.25802\x2013.7417\x205.36779\x2014.7708\x206.71792\x2014.7708H11.7179C13.1539\x2014.7708\x2014.3179\x2013.6067\x2014.3179\x2012.1708V6.1708C14.3179\x204.78586\x2013.2351\x203.65383\x2011.8698\x203.57517C11.742\x202.25858\x2010.6323\x201.22949\x209.28213\x201.22949H4.28213C2.84619\x201.22949\x201.68213\x202.39355\x201.68213\x203.82949V9.82949C1.68213\x2011.2144\x202.76497\x2012.3465\x204.1302\x2012.4251ZM10.6583\x203.5708H6.71792C5.28198\x203.5708\x204.11792\x204.73486\x204.11792\x206.1708V11.22C3.4221\x2011.1387\x202.88213\x2010.5471\x202.88213\x209.82949V3.82949C2.88213\x203.05629\x203.50893\x202.42949\x204.28213\x202.42949H9.28213C9.96695\x202.42949\x2010.5369\x202.92119\x2010.6583\x203.5708ZM13.1179\x206.1708C13.1179\x205.3976\x2012.4911\x204.7708\x2011.7179\x204.7708H6.71792C5.94472\x204.7708\x205.31792\x205.3976\x205.31792\x206.1708V12.1708C5.31792\x2012.944\x205.94472\x2013.5708\x206.71792\x2013.5708H11.7179C12.4911\x2013.5708\x2013.1179\x2012.944\x2013.1179\x2012.1708V6.1708Z','unitAdded$','sheets.command.update-rich-hyper-link','render','__decorateClass$9','LIST','isBuiltInLinkType','_rangeSelectorService','getSheetBySheetName','_initWorkbookUnload','_currentPopup$','colorChannel1','_sheetCanvasPopManagerService','url','setValue','href','editorUnitId','svg','_currentEditingPopup','endOffset','DEFINE_NAME','getHyperLinkByLocation','unitId','selectionMoveEnd$','getActiveSheet','attachPopupByPosition','__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED','skeleton','disposable','disableForceKeepVisible','_initCommandListener','serialize','toString','getActiveTextRange','column','LIST_MULTIPLE','write-single','length','unsubscribe','writeText','mainComponent','VIEWING','startRow','_refRangeMap',',\x200.12)','primary','0\x200\x2017\x2016','contains','__decorateClass$1','__decorateParam$9','getAllUnitsForType','permission.dialog.hyperLinkErr','Fragment','HYPERLINK','navigateToSheetById','react.element','univer-cell-link-operation-error','MAIN_AREA','currentEditing','markSkeletonDirty','isDefine','rangeType','univer.sheet.cell-link-popup','getPositionRange','getValueById','UNIVER_SHEET','jsxs','unitDisposed$','getZenLinkDisable$','evenodd','sheets.command.cancel-hyper-link','for','segmentId','isEmail','_localeService','_isLegalRangeUrl','addHook','_blank','sheetId','subUnitId','textRuns','__decorateClass$a','hoverCustomRanges$','range','SheetsHyperLinkRichTextRefRangeController','getUnit','paragraphs','forValue','_initZenEditor','copy-single','function','onClickOutside','_handleInitUrl','_initCommands','cellLink','endEditing','hyperLink.form.cancel','onChange','__decorateClass$2','_injector','hyperLink.form.inputError','rangeid','registerCommand','getCanvasElement','sheetName','params','hyperLink.form.selectError','generateShortUuid','univer-cell-link-type','repeatStartCell','_renderManagerService','makeForceDirty','LinkSingle','copyRange','linkUpdate$','sheets-hyper-link-ui.config','getCurrentTheme','__decorateParam$8','string','clear','cellLinkUrl','textSelection$','getShouldDisableCellLink','open','_initHoverListener','react.fragment','location','_context','ENTER','getCellMatrix','body','SheetsHyperLinkPopupService','CellLinkEdit','getOwnPropertySymbols','onCommandExecuted','relativeRange','univer-cell-link-url','cellLinkOperation','getConfig','endIndex','tag','_enusreMap','pasteType','EDITING','showPopup','dispose','30028UtFsKn','syncExecuteCommand','getSheetBySheetId','scrollToRange','univer-cell-link-edit','call','symbol','getOwnPropertyDescriptor','beforeCommandExecuted','registerRenderModule','active','UNIVER_DOC','INVALID','max','-zen-editor','handleRangeChange','editPermission','getName','customRangeId','dataStream','hyperLink.form.worksheet','invoke','from','_currentPopup','hyperLink.form.linkError','CONTEXT_MENU','1626498eKMjkP','currentColor','push','_generateMutations','cellLinkOperations','getFocusId','rangeId','get','add','startIndex','onKeyDown','_menuManagerService','__decorateParam$7','getOptions','hyperLink.form.definedName','find','block','_config','__decorateParam$1','col','set','currentRichText$','_initAutoFill','transform','_filterPlainText','currentEditing$','SPECIAL_PASTE_FORMULA','_editorBridgeService','selectorModalVisible','cellLinkContent','display','0\x200\x2016\x2017','_hyperLinkModel','hideCurrentPopup','ZEN_EDITOR','_sheetsHyperLinkPopupService','textX','getFocusedUnit','setReserveRangesStatus','getLinkDisable$','navigateToOtherWebsite','getTextRanges','defaultProps','setConfig','_copyInfo','_sheetInterceptorService','_messageService','payload','formulaOrRefString','_initWorkbookLoad','navigateTo','protocol','hyperLink.popup.edit','OPERATION','customRange','worksheet','M12.6551\x201.98906C11.7476\x201.08113\x2010.2757\x201.08149\x209.3686\x201.98987L4.82542\x206.53955C4.75087\x206.61421\x204.69336\x206.70411\x204.65682\x206.80309L3.2461\x2010.625C3.16506\x2010.8446\x203.21909\x2011.0912\x203.3845\x2011.2568C3.54991\x2011.4224\x203.79651\x2011.4767\x204.01616\x2011.3959L7.85031\x209.98517C7.94979\x209.94856\x208.04014\x209.89077\x208.11508\x209.81579L12.6552\x205.27327C13.5618\x204.36621\x2013.5618\x202.89607\x2012.6551\x201.98906ZM10.2177\x202.83779C10.6562\x202.39869\x2011.3677\x202.39851\x2011.8064\x202.8374C12.2447\x203.27584\x2012.2447\x203.9865\x2011.8065\x204.42497L7.3392\x208.89457L4.82213\x209.82068L5.74706\x207.31487L10.2177\x202.83779Z','getDocRanges','__decorateParam$c','getContainRange','hyperLink.message.hiddenSheet','test','attachPopupToAbsolutePosition','SheetsHyperLinkSidePanelService','label','CUSTOM_RANGE_END','path','url(#$1','dataValidation'];_0x4837=function(){return _0x1c95cb;};return _0x4837();}CopySingle[_0x121662(0x207)]='CopySingle';var element$3={'tag':_0x121662(0x245),'attrs':{'fill':'none','viewBox':'0\x200\x2016\x2016','width':_0x121662(0x337),'height':_0x121662(0x337)},'children':[{'tag':'path','attrs':{'fill':'currentColor','d':'M5.9564\x202.91332C4.91407\x201.87102\x203.22413\x201.87101\x202.18182\x202.91333L2.18182\x202.91333C1.13953\x203.95567\x201.13952\x205.6456\x202.18182\x206.68791L8.27777\x2012.7838C9.72408\x2014.2302\x2012.069\x2014.2302\x2013.5154\x2012.7839L13.0911\x2012.3596L13.5154\x2012.7839C14.9617\x2011.3375\x2014.9617\x208.99257\x2013.5154\x207.54626L8.39476\x202.42566C8.16044\x202.19134\x207.78054\x202.19134\x207.54623\x202.42566C7.31191\x202.65997\x207.31191\x203.03987\x207.54623\x203.27419L12.6668\x208.39479L13.0911\x207.97052L12.6668\x208.39479C13.6445\x209.37247\x2013.6445\x2010.9576\x2012.6668\x2011.9353L13.0399\x2012.3084L12.6668\x2011.9353C11.6891\x2012.913\x2010.104\x2012.913\x209.1263\x2011.9353L3.03035\x205.83938C2.45668\x205.26571\x202.45667\x204.33556\x203.03036\x203.76184C3.60403\x203.18818\x204.53416\x203.18817\x205.10788\x203.76185C5.10788\x203.76186\x205.10788\x203.76186\x205.10789\x203.76186L11.2038\x209.8578L11.601\x209.46061L11.2038\x209.8578C11.3735\x2010.0275\x2011.3735\x2010.3026\x2011.2038\x2010.4723L11.2038\x2010.4723C11.0341\x2010.642\x2010.759\x2010.642\x2010.5893\x2010.4723L5.46874\x205.35171C5.23442\x205.1174\x204.85452\x205.1174\x204.62021\x205.35171C4.38589\x205.58602\x204.38589\x205.96592\x204.62021\x206.20024L9.74078\x2011.3208C10.3791\x2011.9591\x2011.414\x2011.9591\x2012.0523\x2011.3208C12.0523\x2011.3208\x2012.0523\x2011.3208\x2012.0523\x2011.3208M12.0523\x2011.3208C12.6907\x2010.6825\x2012.6906\x209.64757\x2012.0523\x209.00927L5.95641\x202.91333L5.9564\x202.91332','fillRule':_0x121662(0x279),'clipRule':'evenodd'}}]},LinkSingle=forwardRef(function(_0x572bc0,_0x51170e){return createElement(IconBase,Object['assign']({},_0x572bc0,{'id':'link-single','ref':_0x51170e,'icon':element$3}));});LinkSingle[_0x121662(0x207)]=_0x121662(0x2a4);var element$2={'tag':_0x121662(0x245),'attrs':{'fill':_0x121662(0x3bf),'viewBox':_0x121662(0x2ff),'width':_0x121662(0x337),'height':_0x121662(0x337)},'children':[{'tag':_0x121662(0x322),'attrs':{'fill':_0x121662(0x2e1),'d':_0x121662(0x1c9)}}]},UnlinkSingle=forwardRef(function(_0xe12861,_0x3c2a9a){const _0x4dca2e=_0x121662;return createElement(IconBase,Object[_0x4dca2e(0x392)]({},_0xe12861,{'id':'unlink-single','ref':_0x3c2a9a,'icon':element$2}));});UnlinkSingle['displayName']=_0x121662(0x390);var element$1={'tag':_0x121662(0x245),'attrs':{'fill':_0x121662(0x3bf),'viewBox':_0x121662(0x262),'width':'1em','height':_0x121662(0x337)},'children':[{'tag':_0x121662(0x322),'attrs':{'fill':'currentColor','d':_0x121662(0x318),'fillRule':_0x121662(0x279),'clipRule':_0x121662(0x279)}},{'tag':'path','attrs':{'fill':'currentColor','d':'M1.79238\x2013.2999C1.46101\x2013.2999\x201.19238\x2013.5685\x201.19238\x2013.8999C1.19238\x2014.2313\x201.46101\x2014.4999\x201.79238\x2014.4999H14.4924C14.8238\x2014.4999\x2015.0924\x2014.2313\x2015.0924\x2013.8999C15.0924\x2013.5685\x2014.8238\x2013.2999\x2014.4924\x2013.2999H1.79238Z'}}]},WriteSingle=forwardRef(function(_0x2f36bf,_0x43eb60){const _0xe1cd57=_0x121662;return createElement(IconBase,Object[_0xe1cd57(0x392)]({},_0x2f36bf,{'id':_0xe1cd57(0x258),'ref':_0x43eb60,'icon':element$1}));});WriteSingle[_0x121662(0x207)]=_0x121662(0x331);var element={'tag':_0x121662(0x245),'attrs':{'fill':_0x121662(0x3bf),'viewBox':_0x121662(0x3ad),'width':'1em','height':'1em'},'children':[{'tag':'path','attrs':{'fill':_0x121662(0x3c2),'d':_0x121662(0x1ec)}},{'tag':'path','attrs':{'fill':'#32A846','d':'M10.0075\x201.12549L13.9104\x205.09842H10.6742C10.306\x205.09842\x2010.0075\x204.79994\x2010.0075\x204.43175V1.12549Z'}},{'tag':_0x121662(0x322),'attrs':{'fill':_0x121662(0x381),'d':'M7.8088\x2010.2949L6.3764\x2012.403C6.26259\x2012.5705\x206.03455\x2012.614\x205.86705\x2012.5002C5.69955\x2012.3864\x205.65603\x2012.1584\x205.76984\x2011.9909L7.3655\x209.64252L5.94042\x207.54519C5.82661\x207.37769\x205.87013\x207.14964\x206.03763\x207.03583C6.20512\x206.92202\x206.43317\x206.96555\x206.54698\x207.13304L7.8088\x208.9901L9.07062\x207.13304C9.18443\x206.96555\x209.41248\x206.92202\x209.57997\x207.03583C9.74747\x207.14964\x209.79099\x207.37769\x209.67718\x207.54519L8.2521\x209.64252L9.84776\x2011.9909C9.96157\x2012.1584\x209.91805\x2012.3864\x209.75055\x2012.5002C9.58305\x2012.614\x209.35501\x2012.5705\x209.2412\x2012.403L7.8088\x2010.2949Z','fillRule':_0x121662(0x279),'clipRule':_0x121662(0x279)}}]},Xlsx=forwardRef(function(_0x5c64d5,_0x4eeab1){const _0x4e8981=_0x121662;return createElement(IconBase,Object[_0x4e8981(0x392)]({},_0x5c64d5,{'id':_0x4e8981(0x359),'ref':_0x4eeab1,'icon':element}));});Xlsx[_0x121662(0x207)]=_0x121662(0x231);const CancelHyperLinkCommand={'type':CommandType[_0x121662(0x3c6)],'id':_0x121662(0x27a),'handler'(_0x4292f5,_0x2f076e){const _0x363f38=_0x121662;var _0x4e53af,_0x231b3f,_0x5a4862;if(!_0x2f076e)return!0x1;const _0x40b89=_0x4292f5[_0x363f38(0x2e7)](ICommandService),_0x34fd2a=_0x4292f5[_0x363f38(0x2e7)](IUndoRedoService),_0x29a6b4=_0x4292f5['get'](IRenderManagerService),_0x421728=_0x4292f5[_0x363f38(0x2e7)](IUniverInstanceService),_0x3ac3dc=_0x4292f5[_0x363f38(0x2e7)](HyperLinkModel),{unitId:_0xc4cd3a,subUnitId:_0x4ea01d,row:_0x534961,column:_0x3be2cc,id:_0x2f87e6}=_0x2f076e,_0x3f1c8e=_0x421728[_0x363f38(0x289)](_0xc4cd3a,UniverInstanceType[_0x363f38(0x275)]),_0x4d8a07=_0x29a6b4[_0x363f38(0x215)](_0xc4cd3a);if(!_0x4d8a07||!_0x3f1c8e)return!0x1;const _0x872bfa=_0x3f1c8e==null?void 0x0:_0x3f1c8e[_0x363f38(0x2c8)](_0x4ea01d),_0x156a82=(_0x4e53af=_0x4d8a07['with'](SheetSkeletonManagerService)[_0x363f38(0x202)]())==null?void 0x0:_0x4e53af[_0x363f38(0x24f)];if(!_0x872bfa||!_0x156a82)return!0x1;const _0x58ac8b=_0x872bfa[_0x363f38(0x3dc)](_0x534961,_0x3be2cc);if(!_0x58ac8b)return!0x1;const _0x590af4=_0x156a82[_0x363f38(0x373)](_0x58ac8b);if(!(_0x590af4!=null&&_0x590af4[_0x363f38(0x205)]))return!0x1;const _0x13b26f=Tools['deepClone'](_0x590af4['documentModel']['getSnapshot']());if(!((_0x5a4862=(_0x231b3f=_0x13b26f[_0x363f38(0x2b6)])==null?void 0x0:_0x231b3f[_0x363f38(0x37e)])==null?void 0x0:_0x5a4862[_0x363f38(0x2ef)](_0x513ac0=>_0x513ac0[_0x363f38(0x2e6)]===_0x2f87e6)))return!0x1;const _0x198c4b=BuildTextUtils[_0x363f38(0x316)][_0x363f38(0x218)](_0x4292f5,{'documentDataModel':_0x590af4[_0x363f38(0x205)],'rangeId':_0x2f87e6});if(!_0x198c4b)return!0x1;const _0x37c01e=TextX[_0x363f38(0x1e1)](_0x13b26f[_0x363f38(0x2b6)],_0x198c4b[_0x363f38(0x253)]()),_0x293b81=[],_0x5d9d43=[],_0x5ad1fe={'unitId':_0xc4cd3a,'subUnitId':_0x4ea01d,'cellValue':{[_0x534961]:{[_0x3be2cc]:{'p':{..._0x13b26f,'body':_0x37c01e},'t':CellValueType[_0x363f38(0x1ee)]}}}};_0x293b81[_0x363f38(0x2e2)]({'id':SetRangeValuesMutation['id'],'params':_0x5ad1fe});const _0x284b00=SetRangeValuesUndoMutationFactory(_0x4292f5,_0x5ad1fe);_0x5d9d43['push']({'id':SetRangeValuesMutation['id'],'params':_0x284b00});const _0x28b568=_0x3ac3dc[_0x363f38(0x249)](_0xc4cd3a,_0x4ea01d,_0x534961,_0x3be2cc);return _0x28b568&&(_0x293b81[_0x363f38(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0xc4cd3a,'subUnitId':_0x4ea01d,'id':_0x2f87e6}}),_0x5d9d43['push']({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0xc4cd3a,'subUnitId':_0x4ea01d,'link':{..._0x28b568}}})),sequenceExecute(_0x293b81,_0x40b89)['result']?(_0x34fd2a[_0x363f38(0x3d0)]({'redoMutations':_0x293b81,'undoMutations':_0x5d9d43,'unitID':_0xc4cd3a}),!0x0):!0x1;}},CancelRichHyperLinkCommand={'type':CommandType['COMMAND'],'id':_0x121662(0x343),'handler'(_0x896a9f,_0x5ed6c3){const _0x408b54=_0x121662;var _0x475cde,_0x2581f3;if(!_0x5ed6c3)return!0x1;const {id:_0x345088,documentId:_0x517d61}=_0x5ed6c3,_0x596659=_0x896a9f['get'](ICommandService),_0x56ba9a=_0x896a9f[_0x408b54(0x2e7)](IUniverInstanceService)[_0x408b54(0x289)](_0x517d61,UniverInstanceType[_0x408b54(0x2d1)]),_0x1e8908=(_0x2581f3=(_0x475cde=_0x56ba9a==null?void 0x0:_0x56ba9a[_0x408b54(0x1c2)]())==null?void 0x0:_0x475cde[_0x408b54(0x37e)])==null?void 0x0:_0x2581f3['find'](_0x53e52b=>_0x53e52b[_0x408b54(0x2e6)]===_0x345088);let _0x304733=null;_0x1e8908&&_0x1e8908['endIndex']===_0x56ba9a[_0x408b54(0x1c2)]()[_0x408b54(0x2d9)]['length']-0x3&&(_0x304733={'dataStream':'\x20'});const _0x5a58d4=deleteCustomRangeFactory(_0x896a9f,{'unitId':_0x517d61,'rangeId':_0x345088,'insert':_0x304733});return _0x5a58d4?_0x596659['syncExecuteCommand'](_0x5a58d4['id'],_0x5a58d4[_0x408b54(0x29d)]):!0x1;}},cellLink=_0x121662(0x1da),cellLinkType=_0x121662(0x2a0),cellLinkContent='univer-cell-link-content',cellLinkContentError=_0x121662(0x38f),cellLinkUrl=_0x121662(0x2bc),cellLinkOperations=_0x121662(0x34c),cellLinkOperation=_0x121662(0x1f0),cellLinkOperationError=_0x121662(0x26c),styles={'cellLink':cellLink,'cellLinkType':cellLinkType,'cellLinkContent':cellLinkContent,'cellLinkContentError':cellLinkContentError,'cellLinkUrl':cellLinkUrl,'cellLinkOperations':cellLinkOperations,'cellLinkOperation':cellLinkOperation,'cellLinkOperationError':cellLinkOperationError},iconsMap={[SheetHyperLinkType[_0x121662(0x363)]]:jsxRuntimeExports[_0x121662(0x3ab)](LinkSingle,{}),[SheetHyperLinkType[_0x121662(0x3e0)]]:jsxRuntimeExports[_0x121662(0x3ab)](Xlsx,{}),[SheetHyperLinkType[_0x121662(0x39c)]]:jsxRuntimeExports[_0x121662(0x3ab)](AllBorderSingle,{}),[SheetHyperLinkType[_0x121662(0x248)]]:jsxRuntimeExports['jsx'](AllBorderSingle,{}),[SheetHyperLinkType[_0x121662(0x2d2)]]:jsxRuntimeExports[_0x121662(0x3ab)](AllBorderSingle,{})},CellLinkPopup=__name(()=>{const _0x5402c4=_0x121662;var _0x3547fc,_0x12ec8f;const _0x4734f3=useDependency(SheetsHyperLinkPopupService),_0x44ea41=useDependency(ICommandService),_0x1011ef=useDependency(IMessageService),_0x47078f=useDependency(LocaleService),[_0x4d48e2,_0x395da2]=useState(null),_0x262581=useDependency(SheetsHyperLinkResolverService),_0x37b870=useDependency(IEditorBridgeService),_0x485480=useDependency(IZenZoneService);if(_0x30f2bd(_0x485480[_0x5402c4(0x3a9)]),useEffect(()=>{const _0x33ccd9=_0x5402c4;_0x395da2(_0x4734f3[_0x33ccd9(0x3a2)]);const _0x6d20cc=_0x4734f3['currentPopup$'][_0x33ccd9(0x39d)](_0x2bf180=>{_0x395da2(_0x2bf180);});return()=>{const _0x5434c1=_0x33ccd9;_0x6d20cc[_0x5434c1(0x25a)]();};},[_0x4734f3['currentPopup'],_0x4734f3[_0x5402c4(0x34f)]]),!_0x4d48e2)return null;const {unitId:_0x2bb01d,subUnitId:_0x445e53,customRange:_0x11fcec,row:_0x342dae,col:_0x4ea7f4}=_0x4d48e2;if(!((_0x3547fc=_0x11fcec==null?void 0x0:_0x11fcec[_0x5402c4(0x38c)])!=null&&_0x3547fc['url']))return null;const _0x571e7b=_0x262581[_0x5402c4(0x326)]((_0x12ec8f=_0x11fcec[_0x5402c4(0x38c)]['url'])!=null?_0x12ec8f:''),_0x244d3c=_0x571e7b[_0x5402c4(0x21c)]===SheetHyperLinkType[_0x5402c4(0x2d2)];return jsxRuntimeExports[_0x5402c4(0x276)](_0x5402c4(0x353),{'className':styles[_0x5402c4(0x292)],'onClick':__name(()=>_0x4734f3[_0x5402c4(0x301)](),_0x5402c4(0x223)),'children':[jsxRuntimeExports['jsxs'](_0x5402c4(0x353),{'className':_0x5881d5(styles[_0x5402c4(0x2fd)],{[styles[_0x5402c4(0x1bb)]]:_0x244d3c}),'onClick':__name(()=>{const _0x59e482=_0x5402c4;_0x485480[_0x59e482(0x1d2)]||_0x571e7b['handler']();},'onClick'),'children':[jsxRuntimeExports[_0x5402c4(0x3ab)](_0x5402c4(0x353),{'className':styles[_0x5402c4(0x216)],'children':iconsMap[_0x571e7b[_0x5402c4(0x21c)]]}),jsxRuntimeExports['jsx'](Tooltip,{'showIfEllipsis':!0x0,'title':_0x571e7b[_0x5402c4(0x33f)],'children':jsxRuntimeExports['jsx']('span',{'className':styles[_0x5402c4(0x2ac)],'children':_0x571e7b[_0x5402c4(0x33f)]})})]}),jsxRuntimeExports['jsxs']('div',{'className':styles[_0x5402c4(0x2e4)],'children':[_0x4d48e2[_0x5402c4(0x1c0)]&&jsxRuntimeExports['jsx'](_0x5402c4(0x353),{'className':_0x5881d5(styles['cellLinkOperation'],{[styles[_0x5402c4(0x3e1)]]:_0x244d3c}),'onClick':__name(()=>{const _0x598984=_0x5402c4;if(!_0x244d3c){if(_0x571e7b[_0x598984(0x21c)]!==SheetHyperLinkType[_0x598984(0x363)]){const _0x420868=new URL(window[_0x598984(0x2b2)][_0x598984(0x243)]);_0x420868[_0x598984(0x340)]=_0x571e7b[_0x598984(0x241)][_0x598984(0x3d1)](0x1),navigator[_0x598984(0x1c7)][_0x598984(0x25b)](_0x420868[_0x598984(0x243)]);}else navigator[_0x598984(0x1c7)][_0x598984(0x25b)](_0x571e7b[_0x598984(0x241)]);_0x1011ef[_0x598984(0x393)]({'content':_0x47078f['t']('hyperLink.message.coped'),'type':MessageType[_0x598984(0x1e0)]});}},_0x5402c4(0x223)),'children':jsxRuntimeExports['jsx'](Tooltip,{'placement':_0x5402c4(0x3b2),'title':_0x47078f['t']('hyperLink.popup.copy'),'children':jsxRuntimeExports['jsx'](CopySingle,{})})}),_0x4d48e2[_0x5402c4(0x2d6)]&&jsxRuntimeExports['jsxs'](jsxRuntimeExports['Fragment'],{'children':[jsxRuntimeExports['jsx'](_0x5402c4(0x353),{'className':styles[_0x5402c4(0x2bd)],'onClick':__name(()=>{const _0x13f387=_0x5402c4;_0x44ea41['executeCommand'](OpenHyperLinkEditPanelOperation['id'],{'unitId':_0x2bb01d,'subUnitId':_0x445e53,'row':_0x342dae,'col':_0x4ea7f4,'customRangeId':_0x11fcec['rangeId'],'type':_0x4d48e2[_0x13f387(0x21c)]});},'onClick'),'children':jsxRuntimeExports[_0x5402c4(0x3ab)](Tooltip,{'placement':_0x5402c4(0x3b2),'title':_0x47078f['t'](_0x5402c4(0x314)),'children':jsxRuntimeExports[_0x5402c4(0x3ab)](WriteSingle,{})})}),jsxRuntimeExports['jsx'](_0x5402c4(0x353),{'className':styles[_0x5402c4(0x2bd)],'onClick':__name(()=>{const _0x39d231=_0x5402c4,_0x544744=_0x4d48e2['type']===HyperLinkEditSourceType[_0x39d231(0x2c3)]||_0x4d48e2[_0x39d231(0x21c)]===HyperLinkEditSourceType['ZEN_EDITOR']?CancelRichHyperLinkCommand['id']:CancelHyperLinkCommand['id'];_0x44ea41[_0x39d231(0x2c7)](_0x544744,{'unitId':_0x2bb01d,'subUnitId':_0x445e53,'id':_0x11fcec[_0x39d231(0x2e6)],'row':_0x342dae,'column':_0x4ea7f4,'documentId':_0x4d48e2[_0x39d231(0x21c)]===HyperLinkEditSourceType[_0x39d231(0x302)]?DOCS_ZEN_EDITOR_UNIT_ID_KEY:_0x37b870[_0x39d231(0x3be)]()})&&_0x4734f3[_0x39d231(0x301)](void 0x0,!0x0);},_0x5402c4(0x223)),'children':jsxRuntimeExports[_0x5402c4(0x3ab)](Tooltip,{'placement':_0x5402c4(0x3b2),'title':_0x47078f['t'](_0x5402c4(0x342)),'children':jsxRuntimeExports[_0x5402c4(0x3ab)](UnlinkSingle,{})})})]})]})]});},_0x121662(0x233));CellLinkPopup[_0x121662(0x1d1)]=_0x121662(0x272);var __defProp$a=Object[_0x121662(0x3c5)],__getOwnPropDesc$a=Object[_0x121662(0x2cd)],__decorateClass$a=__name((_0x142b85,_0x38555f,_0x34701b,_0x263f75)=>{const _0x3bffb4=_0x121662;for(var _0x5d33f5=_0x263f75>0x1?void 0x0:_0x263f75?__getOwnPropDesc$a(_0x38555f,_0x34701b):_0x38555f,_0x28780e=_0x142b85[_0x3bffb4(0x259)]-0x1,_0x19ff52;_0x28780e>=0x0;_0x28780e--)(_0x19ff52=_0x142b85[_0x28780e])&&(_0x5d33f5=(_0x263f75?_0x19ff52(_0x38555f,_0x34701b,_0x5d33f5):_0x19ff52(_0x5d33f5))||_0x5d33f5);return _0x263f75&&_0x5d33f5&&__defProp$a(_0x38555f,_0x34701b,_0x5d33f5),_0x5d33f5;},_0x121662(0x285)),__decorateParam$a=__name((_0x5a5d7a,_0x366278)=>(_0x16eca2,_0x33aa48)=>_0x366278(_0x16eca2,_0x33aa48,_0x5a5d7a),_0x121662(0x1d5));function _0x3a7e(_0x1fd266,_0x21ce2b){const _0x4837ef=_0x4837();return _0x3a7e=function(_0x3a7e9c,_0x180dd7){_0x3a7e9c=_0x3a7e9c-0x1bb;let _0x5807ed=_0x4837ef[_0x3a7e9c];return _0x5807ed;},_0x3a7e(_0x1fd266,_0x21ce2b);}const isEqualLink=__name((_0x4d9086,_0x3d1f49)=>{const _0x170552=_0x121662;var _0x32c517,_0x1684d2;return _0x4d9086[_0x170552(0x24a)]===_0x3d1f49[_0x170552(0x24a)]&&_0x4d9086[_0x170552(0x283)]===_0x3d1f49[_0x170552(0x283)]&&_0x4d9086[_0x170552(0x214)]===_0x3d1f49[_0x170552(0x214)]&&_0x4d9086[_0x170552(0x2f3)]===_0x3d1f49[_0x170552(0x2f3)]&&((_0x32c517=_0x4d9086['customRange'])==null?void 0x0:_0x32c517['rangeId'])===((_0x1684d2=_0x3d1f49[_0x170552(0x316)])==null?void 0x0:_0x1684d2['rangeId'])&&_0x4d9086[_0x170552(0x21c)]===_0x3d1f49[_0x170552(0x21c)];},_0x121662(0x1cf));var _a3;let SheetsHyperLinkPopupService=(_a3=class extends Disposable{constructor(_0x4b350e,_0x1e05b8,_0x5ba5fd,_0x18ef6b,_0x392aa4,_0x16423c,_0x3684f2,_0x552903,_0x46dcbf){const _0x3e9e78=_0x121662;super(),__publicField(this,_0x3e9e78(0x2dd),null),__publicField(this,_0x3e9e78(0x23e),new Subject()),__publicField(this,'currentPopup$',this[_0x3e9e78(0x23e)][_0x3e9e78(0x1bc)]()),__publicField(this,_0x3e9e78(0x246),null),__publicField(this,_0x3e9e78(0x3a1),new BehaviorSubject(null)),__publicField(this,_0x3e9e78(0x2f9),this[_0x3e9e78(0x3a1)][_0x3e9e78(0x1bc)]()),(this['_sheetCanvasPopManagerService']=_0x4b350e,this[_0x3e9e78(0x297)]=_0x1e05b8,this[_0x3e9e78(0x384)]=_0x5ba5fd,this[_0x3e9e78(0x2fb)]=_0x18ef6b,this[_0x3e9e78(0x394)]=_0x392aa4,this['_docCanvasPopManagerService']=_0x16423c,this[_0x3e9e78(0x219)]=_0x3684f2,this[_0x3e9e78(0x23b)]=_0x552903,this[_0x3e9e78(0x1e5)]=_0x46dcbf,this[_0x3e9e78(0x39a)](()=>{const _0x2273bd=_0x3e9e78;this[_0x2273bd(0x301)](),this[_0x2273bd(0x293)](),this[_0x2273bd(0x3a1)]['complete'](),this[_0x2273bd(0x23e)]['complete']();}));}get[_0x121662(0x3a2)](){const _0x5c951c=_0x121662;return this[_0x5c951c(0x2dd)];}get[_0x121662(0x26e)](){const _0x2d7b46=_0x121662;return this[_0x2d7b46(0x3a1)][_0x2d7b46(0x396)]();}[_0x121662(0x2c4)](_0x5d601d){const _0xe08f98=_0x121662;if(this[_0xe08f98(0x2dd)]&&isEqualLink(_0x5d601d,this[_0xe08f98(0x2dd)])||(this[_0xe08f98(0x301)](void 0x0,!0x0),_0x5d601d[_0xe08f98(0x21c)]!==HyperLinkEditSourceType['ZEN_EDITOR']&&this['_zenZoneService'][_0xe08f98(0x1d2)]))return;const _0x7a00bd=this[_0xe08f98(0x3a1)][_0xe08f98(0x396)]();if(_0x7a00bd&&isEqualLink(_0x5d601d,_0x7a00bd))return;const {unitId:_0xabd261,subUnitId:_0x52e081,row:_0x18360e,col:_0x56c394,customRangeRect:_0x4d06c9,customRange:_0x1fbb7b}=_0x5d601d;if(!_0x1fbb7b)return;let _0x206179;const _0x325d43={'componentKey':CellLinkPopup[_0xe08f98(0x1d1)],'direction':'bottom','onClickOutside':__name(()=>{const _0x4c3902=_0xe08f98;this[_0x4c3902(0x301)]();},_0xe08f98(0x28f)),'onClick':__name(()=>{const _0x49d128=_0xe08f98;this['hideCurrentPopup'](_0x5d601d[_0x49d128(0x21c)],!0x0);},_0xe08f98(0x223))};_0x5d601d['type']===HyperLinkEditSourceType[_0xe08f98(0x2c3)]?_0x206179=_0x4d06c9&&this[_0xe08f98(0x240)][_0xe08f98(0x31e)](_0x4d06c9,_0x325d43):_0x5d601d[_0xe08f98(0x21c)]===HyperLinkEditSourceType[_0xe08f98(0x302)]?_0x206179=this[_0xe08f98(0x22f)]['attachPopupToRange']({'startOffset':_0x1fbb7b[_0xe08f98(0x2e9)],'endOffset':_0x1fbb7b[_0xe08f98(0x2bf)]+0x1,'collapsed':!0x1},_0x325d43,DOCS_ZEN_EDITOR_UNIT_ID_KEY):_0x206179=_0x4d06c9&&this[_0xe08f98(0x240)][_0xe08f98(0x24d)](_0x4d06c9,_0x325d43),_0x206179&&(this['_currentPopup']={'unitId':_0xabd261,'subUnitId':_0x52e081,'disposable':_0x206179,'row':_0x18360e,'col':_0x56c394,'editPermission':!!_0x5d601d[_0xe08f98(0x2d6)],'copyPermission':!!_0x5d601d[_0xe08f98(0x1c0)],'customRange':_0x1fbb7b,'type':_0x5d601d[_0xe08f98(0x21c)]},this[_0xe08f98(0x23e)][_0xe08f98(0x356)](this['_currentPopup']));}[_0x121662(0x301)](_0x694b7c,_0x22e679){const _0x36fe19=_0x121662;var _0x177a57,_0x18dfde;this[_0x36fe19(0x2dd)]&&((!_0x694b7c||_0x694b7c===this[_0x36fe19(0x2dd)][_0x36fe19(0x21c)])&&this['_currentPopup'][_0x36fe19(0x250)]['canDispose']()||_0x22e679)&&((_0x18dfde=(_0x177a57=this['_currentPopup'])==null?void 0x0:_0x177a57['disposable'])==null||_0x18dfde[_0x36fe19(0x2c5)](),this[_0x36fe19(0x2dd)]=null,this[_0x36fe19(0x23e)][_0x36fe19(0x356)](null));}[_0x121662(0x35b)](){const _0xc0b110=_0x121662;var _0x299378,_0x453933,_0x5bda34;const _0x4a78c2=this[_0xc0b110(0x2fb)]['isVisible']()['visible'],_0x729db6=this[_0xc0b110(0x2fb)][_0xc0b110(0x34a)]();if(_0x4a78c2&&_0x729db6){const _0x2a58de=this['_textSelectionManagerService'][_0xc0b110(0x255)](),_0x3ae8ff=(_0x299378=_0x729db6[_0xc0b110(0x1f5)][_0xc0b110(0x205)])==null?void 0x0:_0x299378[_0xc0b110(0x1c2)]();if(!_0x3ae8ff)return null;if(!_0x2a58de||_0x2a58de[_0xc0b110(0x387)])return{'startOffset':0x0,'endOffset':_0x3ae8ff[_0xc0b110(0x2d9)][_0xc0b110(0x259)]-0x2,'collapsed':_0x3ae8ff[_0xc0b110(0x2d9)][_0xc0b110(0x259)]-0x2===0x0,'label':BuildTextUtils[_0xc0b110(0x2f7)][_0xc0b110(0x3a4)](_0x3ae8ff['dataStream'])};const _0x461f12=BuildTextUtils['customRange'][_0xc0b110(0x32f)](_0x2a58de,(_0x5bda34=(_0x453933=_0x3ae8ff[_0xc0b110(0x37e)])==null?void 0x0:_0x453933[_0xc0b110(0x33e)](_0xbf676c=>_0xbf676c[_0xc0b110(0x271)]===CustomRangeType[_0xc0b110(0x269)]))!=null?_0x5bda34:[]);let _0x35fe3d=_0x2a58de[_0xc0b110(0x1f4)],_0x2e6361=_0x2a58de[_0xc0b110(0x247)];return _0x461f12['forEach'](_0x29851e=>{const _0x54e58c=_0xc0b110;_0x35fe3d=Math[_0x54e58c(0x3c0)](_0x35fe3d,_0x29851e[_0x54e58c(0x2e9)]),_0x2e6361=Math[_0x54e58c(0x2d3)](_0x2e6361,_0x29851e[_0x54e58c(0x2bf)]+0x1);}),{'startOffset':_0x35fe3d,'endOffset':_0x2e6361,'collapsed':_0x35fe3d===_0x2e6361,'label':BuildTextUtils[_0xc0b110(0x2f7)][_0xc0b110(0x3a4)](_0x3ae8ff[_0xc0b110(0x2d9)][_0xc0b110(0x3d1)](_0x35fe3d,_0x2e6361))};}return null;}get[_0x121662(0x35f)](){const _0x3bb57d=_0x121662;return{'componentKey':CellLinkEdit[_0x3bb57d(0x1d1)],'direction':_0x3bb57d(0x3b2),'onClickOutside':__name(()=>{const _0x3df17d=_0x3bb57d,_0xbcb45b=createInternalEditorID(_0x3df17d(0x1f3));this[_0x3df17d(0x219)][_0x3df17d(0x2e5)]()!==_0xbcb45b&&(this[_0x3df17d(0x23b)][_0x3df17d(0x210)]()===_0xbcb45b&&this[_0x3df17d(0x23b)][_0x3df17d(0x2fc)]||this[_0x3df17d(0x293)]());},_0x3bb57d(0x28f)),'onContextMenu':__name(()=>{this['endEditing']();},_0x3bb57d(0x3da)),'hiddenType':_0x3bb57d(0x1fb)};}[_0x121662(0x328)](_0x360825){const _0x2b4db5=_0x121662;var _0x326e2d,_0x3b2df2,_0x7ed53c,_0x2696e1,_0xd08e7a;const {unitId:_0x3c6061,subUnitId:_0x5ecbb4,type:_0xd95158}=_0x360825;if(_0xd95158===HyperLinkEditSourceType[_0x2b4db5(0x302)]){const _0x5db30d=this[_0x2b4db5(0x384)]['getUnit'](DOCS_ZEN_EDITOR_UNIT_ID_KEY,UniverInstanceType[_0x2b4db5(0x2d1)]);if(!_0x5db30d)return;const _0x51268c=this['_textSelectionManagerService'][_0x2b4db5(0x255)]();if(!_0x51268c)return;this[_0x2b4db5(0x246)]=this[_0x2b4db5(0x22f)][_0x2b4db5(0x335)](_0x51268c,this[_0x2b4db5(0x35f)],DOCS_ZEN_EDITOR_UNIT_ID_KEY);const _0x5e3941=(_0x326e2d=_0x5db30d['getBody']())==null?void 0x0:_0x326e2d['dataStream'][_0x2b4db5(0x3d1)](_0x51268c[_0x2b4db5(0x1f4)],_0x51268c[_0x2b4db5(0x247)]-0x1);this[_0x2b4db5(0x3a1)][_0x2b4db5(0x356)]({..._0x360825,'label':_0x5e3941});}else{if(_0xd95158===HyperLinkEditSourceType[_0x2b4db5(0x2c3)]){const _0x14a13e=this[_0x2b4db5(0x35b)]();_0x14a13e&&this[_0x2b4db5(0x394)]['replaceTextRanges']([{..._0x14a13e}]),this[_0x2b4db5(0x246)]=this[_0x2b4db5(0x240)][_0x2b4db5(0x367)](_0x360825[_0x2b4db5(0x214)],_0x360825[_0x2b4db5(0x2f3)],this[_0x2b4db5(0x35f)],_0x3c6061,_0x5ecbb4),this['_currentEditing$'][_0x2b4db5(0x356)]({..._0x360825,'label':(_0x3b2df2=_0x14a13e==null?void 0x0:_0x14a13e['label'])!=null?_0x3b2df2:''});}else{this[_0x2b4db5(0x246)]=this[_0x2b4db5(0x240)][_0x2b4db5(0x367)](_0x360825[_0x2b4db5(0x214)],_0x360825[_0x2b4db5(0x2f3)],this[_0x2b4db5(0x35f)],_0x3c6061,_0x5ecbb4);const _0x28bfa7=this[_0x2b4db5(0x384)][_0x2b4db5(0x289)](_0x3c6061,UniverInstanceType[_0x2b4db5(0x275)]),_0x379691=_0x28bfa7==null?void 0x0:_0x28bfa7[_0x2b4db5(0x2c8)](_0x5ecbb4),_0x1f28d8=_0x379691==null?void 0x0:_0x379691[_0x2b4db5(0x325)](_0x360825[_0x2b4db5(0x214)],_0x360825['col']);this[_0x2b4db5(0x3a1)][_0x2b4db5(0x356)]({..._0x360825,'label':_0x1f28d8!=null&&_0x1f28d8['p']?BuildTextUtils[_0x2b4db5(0x2f7)][_0x2b4db5(0x3a4)]((_0x2696e1=(_0x7ed53c=_0x1f28d8['p'][_0x2b4db5(0x2b6)])==null?void 0x0:_0x7ed53c[_0x2b4db5(0x2d9)])!=null?_0x2696e1:''):((_0xd08e7a=_0x1f28d8==null?void 0x0:_0x1f28d8['v'])!=null?_0xd08e7a:'')[_0x2b4db5(0x254)]()});}}}['startEditing'](_0x4a0424){const _0x3e6ddf=_0x121662;var _0x15e4e0,_0x1726ba,_0x3de1e1,_0x117db0,_0x5c8a03,_0x494a02;(_0x15e4e0=this[_0x3e6ddf(0x246)])==null||_0x15e4e0[_0x3e6ddf(0x2c5)](),this[_0x3e6ddf(0x301)](void 0x0,!0x0);const {unitId:_0x365ac9,subUnitId:_0x36d929}=_0x4a0424;let _0x5c7093,_0x3b2fbb;if(_0x4a0424[_0x3e6ddf(0x21c)]===HyperLinkEditSourceType['ZEN_EDITOR']){const _0xdc2857=this[_0x3e6ddf(0x384)]['getUnit'](DOCS_ZEN_EDITOR_UNIT_ID_KEY,UniverInstanceType[_0x3e6ddf(0x2d1)]);if(_0x5c7093=(_0x3de1e1=(_0x1726ba=_0xdc2857==null?void 0x0:_0xdc2857[_0x3e6ddf(0x1c2)]())==null?void 0x0:_0x1726ba[_0x3e6ddf(0x37e)])==null?void 0x0:_0x3de1e1['find'](_0x3b88d3=>_0x3b88d3[_0x3e6ddf(0x2e6)]===_0x4a0424[_0x3e6ddf(0x2d8)]),_0x3b2fbb=_0x5c7093?(_0x117db0=_0xdc2857==null?void 0x0:_0xdc2857['getBody']())==null?void 0x0:_0x117db0[_0x3e6ddf(0x2d9)]['slice'](_0x5c7093[_0x3e6ddf(0x2e9)]+0x1,_0x5c7093[_0x3e6ddf(0x2bf)]):'',!_0x5c7093||!_0x3b2fbb)return;this[_0x3e6ddf(0x394)]['replaceTextRanges']([{'startOffset':_0x5c7093[_0x3e6ddf(0x2e9)],'endOffset':_0x5c7093[_0x3e6ddf(0x2bf)]+0x1}]),this[_0x3e6ddf(0x246)]=this[_0x3e6ddf(0x22f)]['attachPopupToRange']({'startOffset':_0x5c7093[_0x3e6ddf(0x2e9)],'endOffset':_0x5c7093[_0x3e6ddf(0x2bf)],'collapsed':!0x1},this['_editPopup'],DOCS_ZEN_EDITOR_UNIT_ID_KEY);}else{if(_0x4a0424['type']===HyperLinkEditSourceType[_0x3e6ddf(0x2c3)]){const _0x18564c=getEditingCustomRangePosition(this['_injector'],_0x4a0424[_0x3e6ddf(0x24a)],_0x4a0424[_0x3e6ddf(0x283)],_0x4a0424[_0x3e6ddf(0x214)],_0x4a0424[_0x3e6ddf(0x2f3)],_0x4a0424[_0x3e6ddf(0x2d8)]);if(!_0x18564c||!((_0x5c8a03=_0x18564c['rects'])!=null&&_0x5c8a03[_0x3e6ddf(0x259)]))return;_0x5c7093=_0x18564c[_0x3e6ddf(0x316)],_0x3b2fbb=_0x18564c[_0x3e6ddf(0x320)],this[_0x3e6ddf(0x394)]['replaceTextRanges']([{'startOffset':_0x5c7093['startIndex'],'endOffset':_0x5c7093[_0x3e6ddf(0x2bf)]+0x1}]),this['_currentEditingPopup']=this[_0x3e6ddf(0x240)]['attachPopupToAbsolutePosition'](_0x18564c[_0x3e6ddf(0x3d2)][_0x3e6ddf(0x3a8)](),this['_editPopup'],_0x365ac9,_0x36d929);}else{const _0x2ea1f4=getCustomRangePosition(this[_0x3e6ddf(0x297)],_0x4a0424['unitId'],_0x4a0424[_0x3e6ddf(0x283)],_0x4a0424['row'],_0x4a0424[_0x3e6ddf(0x2f3)],_0x4a0424[_0x3e6ddf(0x2d8)]);if(!_0x2ea1f4||!((_0x494a02=_0x2ea1f4[_0x3e6ddf(0x3d2)])!=null&&_0x494a02[_0x3e6ddf(0x259)]))return;_0x5c7093=_0x2ea1f4[_0x3e6ddf(0x316)],_0x3b2fbb=_0x2ea1f4[_0x3e6ddf(0x320)],this[_0x3e6ddf(0x246)]=this[_0x3e6ddf(0x240)][_0x3e6ddf(0x24d)](_0x2ea1f4[_0x3e6ddf(0x3d2)][_0x3e6ddf(0x3a8)](),this[_0x3e6ddf(0x35f)],_0x365ac9,_0x36d929);}}this['_currentEditing$'][_0x3e6ddf(0x356)]({..._0x4a0424,'customRange':_0x5c7093,'label':_0x3b2fbb});}[_0x121662(0x293)](_0x217c38){const _0x3d8c48=_0x121662;var _0xa7ee34;const _0x106834=this['_currentEditing$'][_0x3d8c48(0x396)]();_0x106834&&(!_0x217c38||_0x217c38===_0x106834[_0x3d8c48(0x21c)])&&((_0xa7ee34=this[_0x3d8c48(0x246)])==null||_0xa7ee34['dispose'](),this['_currentEditing$'][_0x3d8c48(0x356)](null));}},__name(_a3,_0x121662(0x2b7)),_a3);SheetsHyperLinkPopupService=__decorateClass$a([__decorateParam$a(0x0,Inject(SheetCanvasPopManagerService)),__decorateParam$a(0x1,Inject(Injector)),__decorateParam$a(0x2,IUniverInstanceService),__decorateParam$a(0x3,IEditorBridgeService),__decorateParam$a(0x4,Inject(DocSelectionManagerService)),__decorateParam$a(0x5,Inject(DocCanvasPopManagerService)),__decorateParam$a(0x6,IEditorService),__decorateParam$a(0x7,IRangeSelectorService),__decorateParam$a(0x8,IZenZoneService)],SheetsHyperLinkPopupService);const getShouldDisableCellLink=__name((_0x21d54f,_0x19ec0b,_0x520d2d)=>{const _0x50df35=_0x121662,_0x55faf8=_0x21d54f['getCell'](_0x19ec0b,_0x520d2d);if(_0x55faf8!=null&&_0x55faf8['f']||_0x55faf8!=null&&_0x55faf8['si'])return!0x0;const _0x248220=[DataValidationType[_0x50df35(0x3a0)],DataValidationType[_0x50df35(0x239)],DataValidationType[_0x50df35(0x257)]];return!!(_0x55faf8!=null&&_0x55faf8[_0x50df35(0x324)]&&_0x248220[_0x50df35(0x3df)](_0x55faf8[_0x50df35(0x324)]['rule'][_0x50df35(0x21c)]));},_0x121662(0x2ae)),getShouldDisableCurrentCellLink=__name(_0x5debf7=>{const _0x601477=_0x121662,_0x508e7c=_0x5debf7[_0x601477(0x2e7)](IUniverInstanceService)[_0x601477(0x344)](UniverInstanceType[_0x601477(0x275)]);if(!_0x508e7c)return!0x0;const _0x5b880a=_0x508e7c[_0x601477(0x24c)](),_0x4627fc=_0x5debf7[_0x601477(0x2e7)](SheetsSelectionsService)['getCurrentSelections']();if(!_0x4627fc[_0x601477(0x259)])return!0x0;const _0x3b4a6d=_0x4627fc[0x0][_0x601477(0x287)]['startRow'],_0x14ab2f=_0x4627fc[0x0][_0x601477(0x287)][_0x601477(0x222)];return getShouldDisableCellLink(_0x5b880a,_0x3b4a6d,_0x14ab2f);},_0x121662(0x389)),shouldDisableAddLink=__name(_0xcb3bd0=>{const _0x6de143=_0x121662;var _0x164a46;const _0x103dce=_0xcb3bd0['get'](DocSelectionManagerService),_0x4d3bf1=_0xcb3bd0['get'](IUniverInstanceService),_0x3b86eb=_0x103dce[_0x6de143(0x319)]();if(!_0x3b86eb['length']||_0x3b86eb[_0x6de143(0x259)]>0x1)return!0x0;const _0x5d6c3f=_0x3b86eb[0x0],_0x802f2f=_0x4d3bf1[_0x6de143(0x344)](UniverInstanceType[_0x6de143(0x2d1)]);if(!_0x802f2f||!_0x5d6c3f||_0x5d6c3f[_0x6de143(0x387)])return!0x0;const _0xb565f1=_0x802f2f[_0x6de143(0x3b9)](_0x5d6c3f[_0x6de143(0x27c)])[_0x6de143(0x1c2)](),_0x14eaf8=_0xb565f1==null?void 0x0:_0xb565f1[_0x6de143(0x28a)];if(!_0x14eaf8)return!0x0;for(let _0x210678=0x0,_0x5b1377=_0x14eaf8[_0x6de143(0x259)];_0x210678<_0x5b1377;_0x210678++){const _0x47103a=_0x14eaf8[_0x210678];if(_0x5d6c3f[_0x6de143(0x1f4)]<=_0x47103a[_0x6de143(0x2e9)]&&_0x5d6c3f[_0x6de143(0x247)]>_0x47103a['startIndex'])return!0x0;if(_0x47103a['startIndex']>_0x5d6c3f[_0x6de143(0x247)])break;}return!BuildTextUtils[_0x6de143(0x316)]['getCustomRangesInterestsWithRange'](_0x5d6c3f,(_0x164a46=_0xb565f1['customRanges'])!=null?_0x164a46:[])[_0x6de143(0x33d)](_0x5596a9=>_0x5596a9[_0x6de143(0x271)]===CustomRangeType[_0x6de143(0x269)]);},'shouldDisableAddLink'),OpenHyperLinkEditPanelOperation={'type':CommandType['OPERATION'],'id':_0x121662(0x21d),'handler'(_0x46bca7,_0x312502){const _0x101da8=_0x121662;if(!_0x312502)return!0x1;const _0x3ccf47=_0x46bca7[_0x101da8(0x2e7)](SheetsHyperLinkPopupService);return _0x312502[_0x101da8(0x2d8)]?_0x3ccf47[_0x101da8(0x217)](_0x312502):_0x3ccf47['startAddEditing'](_0x312502),!0x0;}},CloseHyperLinkPopupOperation={'type':CommandType[_0x121662(0x315)],'id':_0x121662(0x382),'handler'(_0x329b81){const _0x5ae9b3=_0x121662;return _0x329b81[_0x5ae9b3(0x2e7)](SheetsHyperLinkPopupService)['endEditing'](),!0x0;}},InsertHyperLinkOperation={'type':CommandType[_0x121662(0x315)],'id':'sheet.operation.insert-hyper-link','handler'(_0x8b5b28){const _0x387ceb=_0x121662;var _0x43964c;const _0x41b8a3=_0x8b5b28[_0x387ceb(0x2e7)](IUniverInstanceService),_0x39b103=getSheetCommandTarget(_0x41b8a3),_0x9f88d5=_0x8b5b28[_0x387ceb(0x2e7)](IEditorBridgeService);if(!_0x39b103)return!0x1;const _0x173cc6=_0x8b5b28[_0x387ceb(0x2e7)](ICommandService),_0x2285ee=_0x8b5b28['get'](SheetsSelectionsService)[_0x387ceb(0x376)]();if(!_0x2285ee)return!0x1;const _0x1c63c8=_0x2285ee[_0x387ceb(0x287)][_0x387ceb(0x25e)],_0x10d4d0=_0x2285ee['range'][_0x387ceb(0x222)],_0x39a360=_0x9f88d5['isVisible'](),_0x4a3fc5=((_0x43964c=_0x41b8a3[_0x387ceb(0x305)]())==null?void 0x0:_0x43964c[_0x387ceb(0x34e)]())===DOCS_ZEN_EDITOR_UNIT_ID_KEY;return _0x173cc6[_0x387ceb(0x3d5)](OpenHyperLinkEditPanelOperation['id'],{'unitId':_0x39b103['unitId'],'subUnitId':_0x39b103['subUnitId'],'row':_0x1c63c8,'col':_0x10d4d0,'type':_0x4a3fc5?HyperLinkEditSourceType[_0x387ceb(0x302)]:_0x39a360['visible']?HyperLinkEditSourceType[_0x387ceb(0x2c3)]:HyperLinkEditSourceType[_0x387ceb(0x25d)]});}},InsertHyperLinkToolbarOperation={'type':CommandType[_0x121662(0x315)],'id':_0x121662(0x379),'handler'(_0x32b9f6){const _0x488ab9=_0x121662;if(getShouldDisableCurrentCellLink(_0x32b9f6))return!0x1;const _0xf48eb0=_0x32b9f6[_0x488ab9(0x2e7)](ICommandService);return _0x32b9f6[_0x488ab9(0x2e7)](SheetsHyperLinkPopupService)[_0x488ab9(0x26e)]?_0xf48eb0[_0x488ab9(0x3d5)](CloseHyperLinkPopupOperation['id']):_0xf48eb0[_0x488ab9(0x3d5)](InsertHyperLinkOperation['id']);}},getLinkDisable$=__name(_0x31801c=>{const _0x2f8827=_0x121662,_0x574130=getCurrentRangeDisable$(_0x31801c,{'workbookTypes':[WorkbookEditablePermission],'worksheetTypes':[WorksheetEditPermission,WorksheetSetCellValuePermission,WorksheetInsertHyperlinkPermission],'rangeTypes':[RangeProtectionPermissionEditPoint]}),_0x589358=_0x31801c['get'](IUniverInstanceService),_0x1c1486=_0x31801c[_0x2f8827(0x2e7)](SheetsSelectionsService),_0x343ef3=_0x589358[_0x2f8827(0x32d)][_0x2f8827(0x3dd)](map(_0x470cc1=>_0x470cc1?_0x589358[_0x2f8827(0x289)](_0x470cc1,UniverInstanceType[_0x2f8827(0x275)]):null),mergeMap(_0x231e3c=>_0x231e3c?_0x231e3c['activeSheet$']:new Observable(_0x4a44ff=>{const _0x5a694a=_0x2f8827;_0x4a44ff[_0x5a694a(0x356)](null);})),mergeMap(_0x349fd6=>_0x1c1486[_0x2f8827(0x24b)][_0x2f8827(0x3dd)](map(_0xe7f2be=>_0x349fd6&&{'selections':_0xe7f2be,'sheet':_0x349fd6}))),map(_0xaf31bf=>{const _0x2f2bb0=_0x2f8827;if(!_0xaf31bf)return!0x0;const {selections:_0x474a09,sheet:_0x3ecf76}=_0xaf31bf;if(!_0x474a09[_0x2f2bb0(0x259)])return!0x0;const _0x57e759=_0x474a09[0x0][_0x2f2bb0(0x287)][_0x2f2bb0(0x25e)],_0x267371=_0x474a09[0x0][_0x2f2bb0(0x287)][_0x2f2bb0(0x222)];return getShouldDisableCellLink(_0x3ecf76,_0x57e759,_0x267371);}));return _0x574130[_0x2f8827(0x3dd)](mergeMap(_0xf4fd1a=>_0x343ef3['pipe'](map(_0x14e7b3=>_0xf4fd1a||_0x14e7b3))));},_0x121662(0x307)),getZenLinkDisable$=__name(_0x123fc8=>{const _0x545c8f=_0x121662,_0x5b11d5=_0x123fc8[_0x545c8f(0x2e7)](IUniverInstanceService);return _0x5b11d5[_0x545c8f(0x32d)][_0x545c8f(0x3dd)](mergeMap(_0x4cb0ce=>!_0x4cb0ce||_0x4cb0ce!==DOCS_ZEN_EDITOR_UNIT_ID_KEY?new Observable(_0xcb96e7=>_0xcb96e7[_0x545c8f(0x356)](null)):_0x123fc8[_0x545c8f(0x2e7)](DocSelectionManagerService)[_0x545c8f(0x2ad)]),map(_0x491b54=>{const _0x2e1c2d=_0x545c8f;if(!_0x491b54||_0x491b54[_0x2e1c2d(0x24a)]!==DOCS_ZEN_EDITOR_UNIT_ID_KEY)return!0x0;const _0x2f5ce2=_0x123fc8[_0x2e1c2d(0x2e7)](IEditorBridgeService)['getEditCellState']();if(!_0x2f5ce2)return!0x0;const _0xa4d4b4=getSheetCommandTarget(_0x5b11d5,{'unitId':_0x2f5ce2[_0x2e1c2d(0x24a)],'subUnitId':_0x2f5ce2[_0x2e1c2d(0x282)]});return!(_0xa4d4b4!=null&&_0xa4d4b4[_0x2e1c2d(0x317)])||getShouldDisableCellLink(_0xa4d4b4[_0x2e1c2d(0x317)],_0x2f5ce2[_0x2e1c2d(0x214)],_0x2f5ce2[_0x2e1c2d(0x256)])?!0x0:shouldDisableAddLink(_0x123fc8);}));},_0x121662(0x278)),linkMenu={'commandId':InsertHyperLinkOperation['id'],'type':MenuItemType[_0x121662(0x1dd)],'positions':[MenuPosition[_0x121662(0x2df)]],'title':'hyperLink.menu.add','icon':'LinkSingle'},genZenEditorMenuId=__name(_0x3c0715=>_0x3c0715+_0x121662(0x2d4),_0x121662(0x36a)),insertLinkMenuFactory=__name(_0x228097=>({...linkMenu,'id':linkMenu[_0x121662(0x3db)],'hidden$':getMenuHiddenObservable(_0x228097,UniverInstanceType['UNIVER_SHEET']),'disabled$':getLinkDisable$(_0x228097)}),_0x121662(0x375)),zenEditorInsertLinkMenuFactory=__name(_0x381212=>({...linkMenu,'id':genZenEditorMenuId(linkMenu[_0x121662(0x3db)]),'hidden$':getMenuHiddenObservable(_0x381212,UniverInstanceType['UNIVER_DOC'],DOCS_ZEN_EDITOR_UNIT_ID_KEY),'disabled$':getZenLinkDisable$(_0x381212)}),_0x121662(0x21f)),linkToolbarMenu={'tooltip':_0x121662(0x368),'positions':MenuPosition[_0x121662(0x369)],'group':MenuGroup['TOOLBAR_OTHERS'],'commandId':InsertHyperLinkToolbarOperation['id'],'type':MenuItemType['BUTTON'],'icon':_0x121662(0x2a4)},insertLinkMenuToolbarFactory=__name(_0xa6d0d9=>({...linkToolbarMenu,'id':linkToolbarMenu[_0x121662(0x3db)],'hidden$':getMenuHiddenObservable(_0xa6d0d9,UniverInstanceType['UNIVER_SHEET']),'disabled$':getLinkDisable$(_0xa6d0d9)}),_0x121662(0x1c8)),zenEditorInsertLinkMenuToolbarFactory=__name(_0x4fe4b8=>({...linkToolbarMenu,'id':genZenEditorMenuId(linkToolbarMenu[_0x121662(0x3db)]),'hidden$':getMenuHiddenObservable(_0x4fe4b8,UniverInstanceType[_0x121662(0x2d1)],DOCS_ZEN_EDITOR_UNIT_ID_KEY),'disabled$':getZenLinkDisable$(_0x4fe4b8)}),'zenEditorInsertLinkMenuToolbarFactory'),InsertLinkShortcut={'id':InsertHyperLinkToolbarOperation['id'],'binding':KeyCode['K']|MetaKeys['CTRL_COMMAND'],'preconditions':whenSheetEditorFocused};var __defProp$9=Object['defineProperty'],__getOwnPropDesc$9=Object[_0x121662(0x2cd)],__decorateClass$9=__name((_0x1433ab,_0xc26bbc,_0x365bce,_0x594443)=>{const _0x101e95=_0x121662;for(var _0x4a8a42=_0x594443>0x1?void 0x0:_0x594443?__getOwnPropDesc$9(_0xc26bbc,_0x365bce):_0xc26bbc,_0x2f95d4=_0x1433ab[_0x101e95(0x259)]-0x1,_0x4d1a60;_0x2f95d4>=0x0;_0x2f95d4--)(_0x4d1a60=_0x1433ab[_0x2f95d4])&&(_0x4a8a42=(_0x594443?_0x4d1a60(_0xc26bbc,_0x365bce,_0x4a8a42):_0x4d1a60(_0x4a8a42))||_0x4a8a42);return _0x594443&&_0x4a8a42&&__defProp$9(_0xc26bbc,_0x365bce,_0x4a8a42),_0x4a8a42;},_0x121662(0x238)),__decorateParam$9=__name((_0x495cc2,_0x3f726d)=>(_0x252cdb,_0x349a76)=>_0x3f726d(_0x252cdb,_0x349a76,_0x495cc2),_0x121662(0x265)),_a4;let SheetsHyperLinkAutoFillController=(_a4=class extends Disposable{constructor(_0xdad031,_0x17b70e){const _0x4afd74=_0x121662;super(),this['_autoFillService']=_0xdad031,this[_0x4afd74(0x300)]=_0x17b70e,this[_0x4afd74(0x2f6)]();}[_0x121662(0x2f6)](){const _0x5cd0c3=_0x121662,_0x2ce7fa=__name(()=>({'redos':[],'undos':[]}),_0x5cd0c3(0x395)),_0x5e27d6=__name((_0x2f4e95,_0x425dc9)=>{const _0x246860=_0x5cd0c3,{source:_0x28bd2a,target:_0x44694b,unitId:_0x15b501,subUnitId:_0x38e84b}=_0x2f4e95,_0x4abf7f=virtualizeDiscreteRanges([_0x28bd2a,_0x44694b]),[_0x5208ef,_0xfacd39]=_0x4abf7f['ranges'],{mapFunc:_0x56694a}=_0x4abf7f,_0x14c371={'row':_0x5208ef['startRow'],'col':_0x5208ef[_0x246860(0x222)]},_0x323701=getAutoFillRepeatRange(_0x5208ef,_0xfacd39),_0x495210=[],_0x19c1b8=[];return _0x323701[_0x246860(0x3bc)](_0x5872c5=>{const _0x494ed5=_0x246860,_0x2774ca=_0x5872c5[_0x494ed5(0x2a1)],_0x4f4805=_0x5872c5[_0x494ed5(0x2bb)],_0x2da07c={'startRow':_0x14c371[_0x494ed5(0x214)],'startColumn':_0x14c371['col'],'endColumn':_0x14c371[_0x494ed5(0x2f3)],'endRow':_0x14c371[_0x494ed5(0x214)]},_0x313aba={'startRow':_0x2774ca[_0x494ed5(0x214)],'startColumn':_0x2774ca['col'],'endColumn':_0x2774ca[_0x494ed5(0x2f3)],'endRow':_0x2774ca[_0x494ed5(0x214)]};Range['foreach'](_0x4f4805,(_0x2fb4fe,_0x8a973a)=>{const _0x234fbb=_0x494ed5,_0x407343=Rectangle[_0x234fbb(0x273)]({'startRow':_0x2fb4fe,'startColumn':_0x8a973a,'endColumn':_0x8a973a,'endRow':_0x2fb4fe},_0x2da07c),{row:_0x3442b7,col:_0x267de0}=_0x56694a(_0x407343[_0x234fbb(0x25e)],_0x407343['startColumn']),_0x3b1f3d=this[_0x234fbb(0x300)][_0x234fbb(0x249)](_0x15b501,_0x38e84b,_0x3442b7,_0x267de0),_0x4c243c=Rectangle[_0x234fbb(0x273)]({'startRow':_0x2fb4fe,'startColumn':_0x8a973a,'endColumn':_0x8a973a,'endRow':_0x2fb4fe},_0x313aba),{row:_0x46fb57,col:_0x533f3b}=_0x56694a(_0x4c243c[_0x234fbb(0x25e)],_0x4c243c[_0x234fbb(0x222)]),_0x786946=Tools['generateRandomId'](),_0x202e03=this[_0x234fbb(0x300)][_0x234fbb(0x249)](_0x15b501,_0x38e84b,_0x46fb57,_0x533f3b);_0x202e03&&_0x495210[_0x234fbb(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x15b501,'subUnitId':_0x38e84b,'id':_0x202e03['id']}}),(APPLY_TYPE[_0x234fbb(0x332)]===_0x425dc9||APPLY_TYPE[_0x234fbb(0x385)]===_0x425dc9)&&_0x3b1f3d&&(_0x495210[_0x234fbb(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x15b501,'subUnitId':_0x38e84b,'link':{..._0x3b1f3d,'id':_0x786946,'row':_0x46fb57,'column':_0x533f3b}}}),_0x19c1b8[_0x234fbb(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x15b501,'subUnitId':_0x38e84b,'id':_0x786946}})),_0x202e03&&_0x19c1b8['push']({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x15b501,'subUnitId':_0x38e84b,'link':_0x202e03}});});}),{'undos':_0x19c1b8,'redos':_0x495210};},'generalApplyFunc'),_0x113c5b={'id':SHEET_HYPER_LINK_UI_PLUGIN,'onFillData':__name((_0x344e91,_0xe1cec9,_0x4ac717)=>_0x4ac717===APPLY_TYPE[_0x5cd0c3(0x332)]||_0x4ac717===APPLY_TYPE[_0x5cd0c3(0x1f6)]||_0x4ac717===APPLY_TYPE['SERIES']?_0x5e27d6(_0x344e91,_0x4ac717):_0x2ce7fa(),_0x5cd0c3(0x1db))};this[_0x5cd0c3(0x39a)](this['_autoFillService'][_0x5cd0c3(0x280)](_0x113c5b));}},__name(_a4,'SheetsHyperLinkAutoFillController'),_a4);SheetsHyperLinkAutoFillController=__decorateClass$9([__decorateParam$9(0x0,IAutoFillService),__decorateParam$9(0x1,Inject(HyperLinkModel))],SheetsHyperLinkAutoFillController);var __defProp$8=Object[_0x121662(0x3c5)],__getOwnPropDesc$8=Object[_0x121662(0x2cd)],__decorateClass$8=__name((_0x34461a,_0x488913,_0x8ca484,_0x239920)=>{const _0x430300=_0x121662;for(var _0x30574a=_0x239920>0x1?void 0x0:_0x239920?__getOwnPropDesc$8(_0x488913,_0x8ca484):_0x488913,_0x5aa703=_0x34461a[_0x430300(0x259)]-0x1,_0x150caa;_0x5aa703>=0x0;_0x5aa703--)(_0x150caa=_0x34461a[_0x5aa703])&&(_0x30574a=(_0x239920?_0x150caa(_0x488913,_0x8ca484,_0x30574a):_0x150caa(_0x30574a))||_0x30574a);return _0x239920&&_0x30574a&&__defProp$8(_0x488913,_0x8ca484,_0x30574a),_0x30574a;},_0x121662(0x3d3)),__decorateParam$8=__name((_0x5b834f,_0x371738)=>(_0x58ecbf,_0x47bd38)=>_0x371738(_0x58ecbf,_0x47bd38,_0x5b834f),_0x121662(0x2a9)),_a5;let SheetsHyperLinkPermissionController=(_a5=class extends Disposable{constructor(_0x42b455,_0x37c99f,_0x456058){const _0x5a6dac=_0x121662;super(),this[_0x5a6dac(0x27e)]=_0x42b455,this[_0x5a6dac(0x1c1)]=_0x37c99f,this['_sheetPermissionInterceptorBaseController']=_0x456058,this[_0x5a6dac(0x1f2)]();}['_commandExecutedListener'](){const _0x37e45a=_0x121662;this[_0x37e45a(0x39a)](this[_0x37e45a(0x1c1)][_0x37e45a(0x2ce)](_0x48658d=>{const _0x16bf2e=_0x37e45a;_0x48658d['id']===InsertLinkShortcut['id']&&(this['_sheetPermissionInterceptorBaseController'][_0x16bf2e(0x1ed)]({'workbookTypes':[WorkbookEditablePermission],'rangeTypes':[RangeProtectionPermissionEditPoint],'worksheetTypes':[WorksheetEditPermission,WorksheetSetCellValuePermission,WorksheetInsertHyperlinkPermission]})||this[_0x16bf2e(0x1fe)]['haveNotPermissionHandle'](this[_0x16bf2e(0x27e)]['t'](_0x16bf2e(0x267))));}));}},__name(_a5,'SheetsHyperLinkPermissionController'),_a5);SheetsHyperLinkPermissionController=__decorateClass$8([__decorateParam$8(0x0,Inject(LocaleService)),__decorateParam$8(0x1,ICommandService),__decorateParam$8(0x2,Inject(SheetPermissionInterceptorBaseController))],SheetsHyperLinkPermissionController);var __defProp$7=Object[_0x121662(0x3c5)],__getOwnPropDesc$7=Object[_0x121662(0x2cd)],__decorateClass$7=__name((_0x555b72,_0x2fdddf,_0x246748,_0x5eb2e9)=>{const _0x1a1dd0=_0x121662;for(var _0x34357e=_0x5eb2e9>0x1?void 0x0:_0x5eb2e9?__getOwnPropDesc$7(_0x2fdddf,_0x246748):_0x2fdddf,_0xe464e2=_0x555b72[_0x1a1dd0(0x259)]-0x1,_0x4d9305;_0xe464e2>=0x0;_0xe464e2--)(_0x4d9305=_0x555b72[_0xe464e2])&&(_0x34357e=(_0x5eb2e9?_0x4d9305(_0x2fdddf,_0x246748,_0x34357e):_0x4d9305(_0x34357e))||_0x34357e);return _0x5eb2e9&&_0x34357e&&__defProp$7(_0x2fdddf,_0x246748,_0x34357e),_0x34357e;},'__decorateClass$7'),__decorateParam$7=__name((_0x51d747,_0x587c0c)=>(_0x4245bd,_0x47ac34)=>_0x587c0c(_0x4245bd,_0x47ac34,_0x51d747),_0x121662(0x2ec)),_a6;let SheetsHyperLinkPopupController=(_a6=class extends Disposable{constructor(_0x4994bb,_0x4f3848,_0x41b161,_0x2863e7,_0x3d2567,_0x239832,_0x3e4d3f,_0x37d424,_0x4c6f84,_0x4470b4){const _0x13a727=_0x121662;super(),this[_0x13a727(0x3c1)]=_0x4994bb,this['_sheetsHyperLinkPopupService']=_0x4f3848,this[_0x13a727(0x2a2)]=_0x41b161,this['_permissionService']=_0x2863e7,this[_0x13a727(0x1fe)]=_0x3d2567,this[_0x13a727(0x1c1)]=_0x239832,this[_0x13a727(0x2fb)]=_0x3e4d3f,this[_0x13a727(0x394)]=_0x37d424,this[_0x13a727(0x384)]=_0x4c6f84,this['_zenZoneService']=_0x4470b4,this[_0x13a727(0x2b0)](),this['_initCommandListener'](),this[_0x13a727(0x36d)](),this[_0x13a727(0x20c)](),this[_0x13a727(0x28c)]();}['_getLinkPermission'](_0x16cd1e){const _0x3a2dc1=_0x121662,{unitId:_0x18956c,subUnitId:_0x46259c,row:_0x5bf450,col:_0x506219}=_0x16cd1e,_0xa1e019=this[_0x3a2dc1(0x384)][_0x3a2dc1(0x289)](_0x18956c,UniverInstanceType[_0x3a2dc1(0x275)]);if(!(_0xa1e019==null?void 0x0:_0xa1e019[_0x3a2dc1(0x2c8)](_0x46259c)))return{'viewPermission':!0x1,'editPermission':!0x1,'copyPermission':!0x1};const _0x3bd5a4=this[_0x3a2dc1(0x1fe)][_0x3a2dc1(0x1ed)]({'workbookTypes':[WorkbookViewPermission],'worksheetTypes':[WorksheetViewPermission],'rangeTypes':[RangeProtectionPermissionViewPoint]},[{'startRow':_0x5bf450,'startColumn':_0x506219,'endRow':_0x5bf450,'endColumn':_0x506219}]),_0x2cd125=this[_0x3a2dc1(0x1fe)][_0x3a2dc1(0x1ed)]({'workbookTypes':[WorkbookEditablePermission],'worksheetTypes':[WorksheetEditPermission,WorksheetInsertHyperlinkPermission],'rangeTypes':[RangeProtectionPermissionEditPoint]},[{'startRow':_0x5bf450,'startColumn':_0x506219,'endRow':_0x5bf450,'endColumn':_0x506219}]),_0x305e7c=this[_0x3a2dc1(0x1eb)]['composePermission']([new WorkbookCopyPermission(_0x18956c)['id'],new WorksheetCopyPermission(_0x18956c,_0x46259c)['id']])[_0x3a2dc1(0x33d)](_0x4afbd2=>_0x4afbd2[_0x3a2dc1(0x201)]);return{'viewPermission':_0x3bd5a4,'editPermission':_0x2cd125,'copyPermission':_0x305e7c};}[_0x121662(0x2b0)](){const _0x43e44d=_0x121662;this[_0x43e44d(0x39a)](this['_hoverManagerService'][_0x43e44d(0x2f5)]['pipe'](debounceTime(0xc8))[_0x43e44d(0x39d)](_0x51b212=>{const _0xa6aeb6=_0x43e44d;var _0x48258d;if(!_0x51b212){this[_0xa6aeb6(0x303)][_0xa6aeb6(0x301)]();return;}const {unitId:_0x23be59,subUnitId:_0x4a5724,row:_0x5d5aaa,col:_0x16d1c9}=_0x51b212,_0x574f8d=this[_0xa6aeb6(0x2a2)]['getRenderById'](_0x23be59);if(!_0x574f8d)return;if(!_0x574f8d[_0xa6aeb6(0x1ef)](HoverRenderController)[_0xa6aeb6(0x2d0)]){this[_0xa6aeb6(0x303)][_0xa6aeb6(0x301)](HyperLinkEditSourceType['VIEWING']);return;}const _0x36d97a=(_0x48258d=_0x574f8d==null?void 0x0:_0x574f8d['with'](SheetSkeletonManagerService)['getWorksheetSkeleton'](_0x4a5724))==null?void 0x0:_0x48258d[_0xa6aeb6(0x24f)],_0x2d199e=_0x16d1c9,_0x28b9a3=_0x5d5aaa;let _0x59fbcd=_0x28b9a3,_0x276a54=_0x2d199e;_0x36d97a&&_0x36d97a['overflowCache']['forValue']((_0xfc17e7,_0x92a947,_0x4d5dc4)=>{const _0x2820a1=_0xa6aeb6;Rectangle[_0x2820a1(0x263)](_0x4d5dc4,{'startColumn':_0x2d199e,'endColumn':_0x2d199e,'startRow':_0x28b9a3,'endRow':_0x28b9a3})&&(_0x59fbcd=_0xfc17e7,_0x276a54=_0x92a947);});const {viewPermission:_0x390be9,editPermission:_0x114bc3,copyPermission:_0x90363}=this[_0xa6aeb6(0x212)](_0x51b212);if(!_0x390be9||!_0x51b212[_0xa6aeb6(0x316)]){this['_sheetsHyperLinkPopupService'][_0xa6aeb6(0x301)]();return;}this[_0xa6aeb6(0x303)][_0xa6aeb6(0x2c4)]({'row':_0x59fbcd,'col':_0x276a54,'editPermission':_0x114bc3,'copyPermission':_0x90363,'customRange':_0x51b212['customRange'],'customRangeRect':_0x51b212['rect'],'type':HyperLinkEditSourceType['VIEWING'],'unitId':_0x23be59,'subUnitId':_0x4a5724});}));}[_0x121662(0x36d)](){const _0x57d4a9=_0x121662;let _0x2ee4c7=null;this['disposeWithMe'](this[_0x57d4a9(0x2fb)]['currentEditCellState$'][_0x57d4a9(0x3dd)](mergeMap(_0x34348c=>this['_editorBridgeService'][_0x57d4a9(0x3a9)][_0x57d4a9(0x3dd)](map(_0x241f75=>({'visible':_0x241f75,'state':_0x34348c})))))[_0x57d4a9(0x39d)](({visible:_0x5dc22b,state:_0x4558a9})=>{const _0x5882bc=_0x57d4a9;if(!_0x4558a9||_0x4558a9[_0x5882bc(0x244)]!==DOCS_NORMAL_EDITOR_UNIT_ID_KEY)return;if(!_0x5dc22b[_0x5882bc(0x1d2)]){_0x2ee4c7==null||_0x2ee4c7[_0x5882bc(0x25a)](),this['_sheetsHyperLinkPopupService'][_0x5882bc(0x301)](HyperLinkEditSourceType[_0x5882bc(0x2c3)]),this[_0x5882bc(0x303)][_0x5882bc(0x293)](HyperLinkEditSourceType[_0x5882bc(0x2c3)]);return;}const {editorUnitId:_0x2442b4,unitId:_0x4317b5,sheetId:_0x4a9b04,row:_0x38cc26,column:_0x2f8ba7}=_0x4558a9,_0x4ec1ab=this[_0x5882bc(0x2a2)][_0x5882bc(0x215)](_0x2442b4);if(!_0x4ec1ab)return;const {editPermission:_0x564f89,viewPermission:_0x24b17b,copyPermission:_0x1ae498}=this['_getLinkPermission']({'unitId':_0x4317b5,'subUnitId':_0x4a9b04,'row':_0x38cc26,'col':_0x2f8ba7}),_0x557cad=_0x4ec1ab[_0x5882bc(0x1ef)](DocEventManagerService);_0x24b17b&&(_0x2ee4c7==null||_0x2ee4c7[_0x5882bc(0x25a)](),_0x2ee4c7=_0x557cad[_0x5882bc(0x286)][_0x5882bc(0x3dd)](debounceTime(0xc8))[_0x5882bc(0x39d)](_0x3b18e1=>{const _0x413f50=_0x5882bc;var _0x1b96e0,_0x45edfe;const _0x2d784f=_0x3b18e1['find'](_0x17ea9b=>_0x17ea9b[_0x413f50(0x287)][_0x413f50(0x271)]===CustomRangeType[_0x413f50(0x269)]);if(!_0x2d784f){this[_0x413f50(0x303)][_0x413f50(0x301)]();return;}const _0x4efac8=_0x2d784f['rects'][_0x2d784f[_0x413f50(0x3d2)]['length']-0x1];if(!((_0x45edfe=(_0x1b96e0=this[_0x413f50(0x2a2)]['getRenderById'](_0x4317b5))==null?void 0x0:_0x1b96e0[_0x413f50(0x1ef)](SheetSkeletonManagerService)['getWorksheetSkeleton'](_0x4a9b04))==null?void 0x0:_0x45edfe[_0x413f50(0x24f)])||!_0x4efac8)return;const _0x513658=_0x4ec1ab[_0x413f50(0x227)][_0x413f50(0x29b)]()[_0x413f50(0x3a3)]();this[_0x413f50(0x303)][_0x413f50(0x2c4)]({'unitId':_0x4317b5,'subUnitId':_0x4a9b04,'row':_0x38cc26,'col':_0x2f8ba7,'customRange':_0x2d784f[_0x413f50(0x287)],'customRangeRect':{'left':_0x4efac8['left']+_0x513658[_0x413f50(0x22a)],'top':_0x4efac8[_0x413f50(0x32a)]+_0x513658['top'],'bottom':_0x4efac8[_0x413f50(0x3b2)]+_0x513658[_0x413f50(0x32a)],'right':_0x4efac8[_0x413f50(0x1e8)]+_0x513658[_0x413f50(0x22a)]},'editPermission':_0x564f89,'copyPermission':_0x1ae498,'type':HyperLinkEditSourceType[_0x413f50(0x2c3)]});}));})),this['disposeWithMe'](()=>{_0x2ee4c7==null||_0x2ee4c7['unsubscribe']();});}[_0x121662(0x28c)](){const _0x137c16=_0x121662;this[_0x137c16(0x39a)](this['_zenZoneService'][_0x137c16(0x3a9)][_0x137c16(0x39d)](_0x3aa639=>{const _0x5089c4=_0x137c16;_0x3aa639&&(this[_0x5089c4(0x303)][_0x5089c4(0x301)](HyperLinkEditSourceType[_0x5089c4(0x25d)]),this[_0x5089c4(0x303)][_0x5089c4(0x301)](HyperLinkEditSourceType[_0x5089c4(0x2c3)]),this['_sheetsHyperLinkPopupService'][_0x5089c4(0x293)](HyperLinkEditSourceType[_0x5089c4(0x2c3)]),this['_sheetsHyperLinkPopupService'][_0x5089c4(0x301)](HyperLinkEditSourceType[_0x5089c4(0x25d)]));})),this[_0x137c16(0x39a)](this['_univerInstanceService'][_0x137c16(0x32d)]['pipe'](mergeMap(_0x9f9bc5=>{const _0x295166=_0x137c16,_0x1182fc=_0x9f9bc5===DOCS_ZEN_EDITOR_UNIT_ID_KEY?this[_0x295166(0x2a2)][_0x295166(0x215)](_0x9f9bc5):null;return _0x1182fc?_0x1182fc['with'](DocEventManagerService)[_0x295166(0x286)][_0x295166(0x3dd)](debounceTime(0xc8)):new Observable(_0x129be7=>{const _0x375937=_0x295166;_0x129be7[_0x375937(0x356)](null);});}))[_0x137c16(0x39d)](_0x551d44=>{const _0x4cc214=_0x137c16,_0x53d941=_0x551d44==null?void 0x0:_0x551d44['find'](_0x403b83=>_0x403b83[_0x4cc214(0x287)]['rangeType']===CustomRangeType['HYPERLINK']),_0x531ab7=this['_editorBridgeService'][_0x4cc214(0x34a)]();if(_0x53d941&&_0x531ab7){const {unitId:_0x2da708,sheetId:_0x102b59,row:_0x77cc1c,column:_0x34fe46}=_0x531ab7,{editPermission:_0x47375d,viewPermission:_0x5c297e,copyPermission:_0x4b3c12}=this[_0x4cc214(0x212)]({'unitId':_0x2da708,'subUnitId':_0x102b59,'row':_0x77cc1c,'col':_0x34fe46});_0x5c297e&&this[_0x4cc214(0x303)][_0x4cc214(0x2c4)]({'type':HyperLinkEditSourceType[_0x4cc214(0x302)],'unitId':_0x2da708,'subUnitId':_0x102b59,'row':_0x77cc1c,'col':_0x34fe46,'customRange':_0x53d941['range'],'editPermission':_0x47375d,'copyPermission':_0x4b3c12});}else this[_0x4cc214(0x303)]['hideCurrentPopup'](HyperLinkEditSourceType[_0x4cc214(0x302)]);}));}[_0x121662(0x20c)](){const _0x2c542a=_0x121662;this[_0x2c542a(0x39a)](this[_0x2c542a(0x394)]['textSelection$'][_0x2c542a(0x39d)](_0x25a620=>{const _0x2d088b=_0x2c542a;_0x25a620&&_0x25a620['unitId']===DOCS_NORMAL_EDITOR_UNIT_ID_KEY&&this[_0x2d088b(0x303)][_0x2d088b(0x293)](HyperLinkEditSourceType['EDITING']);}));}[_0x121662(0x252)](){const _0x12f754=_0x121662,_0x1b13dc=[ClearSelectionContentCommand['id'],ClearSelectionAllCommand['id'],ClearSelectionFormatCommand['id']];this[_0x12f754(0x39a)](this[_0x12f754(0x1c1)][_0x12f754(0x2ba)](_0x206fa6=>{const _0xa47976=_0x12f754;_0x1b13dc[_0xa47976(0x3df)](_0x206fa6['id'])&&this['_sheetsHyperLinkPopupService']['hideCurrentPopup']();}));}},__name(_a6,_0x121662(0x3c9)),_a6);SheetsHyperLinkPopupController=__decorateClass$7([__decorateParam$7(0x0,Inject(HoverManagerService)),__decorateParam$7(0x1,Inject(SheetsHyperLinkPopupService)),__decorateParam$7(0x2,Inject(IRenderManagerService)),__decorateParam$7(0x3,Inject(IPermissionService)),__decorateParam$7(0x4,Inject(SheetPermissionInterceptorBaseController)),__decorateParam$7(0x5,ICommandService),__decorateParam$7(0x6,IEditorBridgeService),__decorateParam$7(0x7,Inject(DocSelectionManagerService)),__decorateParam$7(0x8,IUniverInstanceService),__decorateParam$7(0x9,IZenZoneService)],SheetsHyperLinkPopupController);var __defProp$6=Object[_0x121662(0x3c5)],__getOwnPropDesc$6=Object['getOwnPropertyDescriptor'],__decorateClass$6=__name((_0xb2f1ea,_0x5bbeb5,_0x336303,_0x350d93)=>{const _0x56c5b2=_0x121662;for(var _0x298668=_0x350d93>0x1?void 0x0:_0x350d93?__getOwnPropDesc$6(_0x5bbeb5,_0x336303):_0x5bbeb5,_0x162161=_0xb2f1ea[_0x56c5b2(0x259)]-0x1,_0x1e98e9;_0x162161>=0x0;_0x162161--)(_0x1e98e9=_0xb2f1ea[_0x162161])&&(_0x298668=(_0x350d93?_0x1e98e9(_0x5bbeb5,_0x336303,_0x298668):_0x1e98e9(_0x298668))||_0x298668);return _0x350d93&&_0x298668&&__defProp$6(_0x5bbeb5,_0x336303,_0x298668),_0x298668;},_0x121662(0x20f)),__decorateParam$6=__name((_0x463712,_0x51d791)=>(_0x57eb50,_0x158b09)=>_0x51d791(_0x57eb50,_0x158b09,_0x463712),_0x121662(0x36b)),_a7;let SheetsHyperLinkRemoveSheetController=(_a7=class extends Disposable{constructor(_0x53f22a,_0x5cef39,_0x3c22d7){const _0x53ebb2=_0x121662;super(),this['_sheetInterceptorService']=_0x53f22a,this['_univerInstanceService']=_0x5cef39,this['_hyperLinkModel']=_0x3c22d7,this[_0x53ebb2(0x3a7)]();}[_0x121662(0x3a7)](){const _0x264095=_0x121662;this[_0x264095(0x39a)](this[_0x264095(0x30d)][_0x264095(0x21e)]({'getMutations':__name(_0x9cab02=>{const _0x25675b=_0x264095;var _0x2b7fc0;if(_0x9cab02['id']===RemoveSheetCommand['id']){const _0x4a4e00=_0x9cab02['params'],_0x2238dd=_0x4a4e00[_0x25675b(0x24a)]?this[_0x25675b(0x384)][_0x25675b(0x289)](_0x4a4e00['unitId']):this['_univerInstanceService'][_0x25675b(0x344)](UniverInstanceType[_0x25675b(0x275)]);if(!_0x2238dd)return{'redos':[],'undos':[]};const _0x1eb8d0=_0x2238dd[_0x25675b(0x34e)](),_0x5e88fd=_0x4a4e00['subUnitId']||((_0x2b7fc0=_0x2238dd[_0x25675b(0x24c)]())==null?void 0x0:_0x2b7fc0[_0x25675b(0x1f1)]());if(!_0x5e88fd)return{'redos':[],'undos':[]};const _0x55d47a=this[_0x25675b(0x300)][_0x25675b(0x366)](_0x1eb8d0,_0x5e88fd),_0x3cdf3c=_0x55d47a[_0x25675b(0x3cf)](_0x312825=>({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x1eb8d0,'subUnitId':_0x5e88fd,'id':_0x312825['id']}})),_0x926c25=_0x55d47a[_0x25675b(0x3cf)](_0x20d016=>({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x1eb8d0,'subUnitId':_0x5e88fd,'link':_0x20d016}}));return{'redos':_0x3cdf3c,'undos':_0x926c25};}return{'redos':[],'undos':[]};},_0x264095(0x371))}));}},__name(_a7,_0x121662(0x225)),_a7);SheetsHyperLinkRemoveSheetController=__decorateClass$6([__decorateParam$6(0x0,Inject(SheetInterceptorService)),__decorateParam$6(0x1,IUniverInstanceService),__decorateParam$6(0x2,Inject(HyperLinkModel))],SheetsHyperLinkRemoveSheetController);var __defProp$5=Object['defineProperty'],__getOwnPropDesc$5=Object['getOwnPropertyDescriptor'],__decorateClass$5=__name((_0x1fc4d0,_0x1c29db,_0x4b01c3,_0x2c2940)=>{for(var _0x51c296=_0x2c2940>0x1?void 0x0:_0x2c2940?__getOwnPropDesc$5(_0x1c29db,_0x4b01c3):_0x1c29db,_0x5c555b=_0x1fc4d0['length']-0x1,_0x33d622;_0x5c555b>=0x0;_0x5c555b--)(_0x33d622=_0x1fc4d0[_0x5c555b])&&(_0x51c296=(_0x2c2940?_0x33d622(_0x1c29db,_0x4b01c3,_0x51c296):_0x33d622(_0x51c296))||_0x51c296);return _0x2c2940&&_0x51c296&&__defProp$5(_0x1c29db,_0x4b01c3,_0x51c296),_0x51c296;},_0x121662(0x20b)),__decorateParam$5=__name((_0x34dc73,_0xd9aed1)=>(_0x22c2f8,_0x5c7cf5)=>_0xd9aed1(_0x22c2f8,_0x5c7cf5,_0x34dc73),_0x121662(0x357)),_a8;let SheetsHyperLinkRenderController=(_a8=class extends Disposable{constructor(_0x15718d,_0x1e921e){const _0x23f84e=_0x121662;super(),this[_0x23f84e(0x2b3)]=_0x15718d,this[_0x23f84e(0x300)]=_0x1e921e,this[_0x23f84e(0x370)]();}[_0x121662(0x370)](){const _0x472dda=_0x121662,_0x2acc3c=__name(()=>{const _0x5c018d=_0x3a7e;var _0x5433f4;(_0x5433f4=this[_0x5c018d(0x2b3)][_0x5c018d(0x25c)])==null||_0x5433f4[_0x5c018d(0x2a3)]();},_0x472dda(0x26f));this[_0x472dda(0x39a)](this[_0x472dda(0x300)][_0x472dda(0x2a6)]['pipe'](debounceTime(0x10))['subscribe'](()=>{_0x2acc3c();}));}},__name(_a8,_0x121662(0x35d)),_a8);SheetsHyperLinkRenderController=__decorateClass$5([__decorateParam$5(0x1,Inject(HyperLinkModel))],SheetsHyperLinkRenderController);var _a9;let SheetsHyperLinkRenderManagerController=(_a9=class extends Disposable{constructor(_0xd2a4d5,_0x3fa39e){const _0xb2ed25=_0x121662;super(),this[_0xb2ed25(0x30d)]=_0xd2a4d5,this[_0xb2ed25(0x300)]=_0x3fa39e,this[_0xb2ed25(0x3b6)]();}[_0x121662(0x3b6)](){const _0x1a6b56=_0x121662;this[_0x1a6b56(0x39a)](this[_0x1a6b56(0x30d)][_0x1a6b56(0x3c3)](INTERCEPTOR_POINT['CELL_CONTENT'],{'effect':InterceptorEffectEnum['Value'],'priority':0x64,'handler':__name((_0x217b1c,_0x399dda,_0x1a38fa)=>{const _0x73f914=_0x1a6b56,{row:_0x34ee08,col:_0x4ccc8f,unitId:_0x1ad5e1,subUnitId:_0x19750e}=_0x399dda,_0x5d2030=this[_0x73f914(0x300)][_0x73f914(0x249)](_0x1ad5e1,_0x19750e,_0x34ee08,_0x4ccc8f);return _0x1a38fa(_0x5d2030?{..._0x217b1c,'linkUrl':_0x5d2030[_0x73f914(0x30f)],'linkId':_0x5d2030['id']}:_0x217b1c);},_0x1a6b56(0x346))}));}},__name(_a9,_0x121662(0x1fc)),_a9);SheetsHyperLinkRenderManagerController=__decorateClass$5([__decorateParam$5(0x0,Inject(SheetInterceptorService)),__decorateParam$5(0x1,Inject(HyperLinkModel))],SheetsHyperLinkRenderManagerController);var __defProp$4=Object[_0x121662(0x3c5)],__getOwnPropDesc$4=Object['getOwnPropertyDescriptor'],__decorateClass$4=__name((_0x71a5b5,_0x11abe3,_0x49de64,_0x14db15)=>{const _0x503d98=_0x121662;for(var _0x576bef=_0x14db15>0x1?void 0x0:_0x14db15?__getOwnPropDesc$4(_0x11abe3,_0x49de64):_0x11abe3,_0x5df2dd=_0x71a5b5[_0x503d98(0x259)]-0x1,_0x1b09b2;_0x5df2dd>=0x0;_0x5df2dd--)(_0x1b09b2=_0x71a5b5[_0x5df2dd])&&(_0x576bef=(_0x14db15?_0x1b09b2(_0x11abe3,_0x49de64,_0x576bef):_0x1b09b2(_0x576bef))||_0x576bef);return _0x14db15&&_0x576bef&&__defProp$4(_0x11abe3,_0x49de64,_0x576bef),_0x576bef;},_0x121662(0x3aa)),__decorateParam$4=__name((_0xc3d8ff,_0x468c14)=>(_0x4ad051,_0x1c6287)=>_0x468c14(_0x4ad051,_0x1c6287,_0xc3d8ff),_0x121662(0x1cd)),_a10;let SheetsHyperLinkRichTextRefRangeController=(_a10=class extends Disposable{constructor(_0x1bc219,_0x580116,_0x48bed1){const _0x5bdb19=_0x121662;super(),__publicField(this,_0x5bdb19(0x25f),new Map()),(this[_0x5bdb19(0x1c1)]=_0x1bc219,this[_0x5bdb19(0x384)]=_0x580116,this[_0x5bdb19(0x388)]=_0x48bed1,this[_0x5bdb19(0x311)](),this[_0x5bdb19(0x23d)](),this['_initSetRangesListener']());}[_0x121662(0x2c1)](_0x55ae37,_0x4bb769){const _0x588421=_0x121662;let _0x54c0f8=this[_0x588421(0x25f)]['get'](_0x55ae37);_0x54c0f8||(_0x54c0f8=new Map(),this[_0x588421(0x25f)][_0x588421(0x2f4)](_0x55ae37,_0x54c0f8));let _0x48cce5=_0x54c0f8[_0x588421(0x2e7)](_0x4bb769);return _0x48cce5||(_0x48cce5=new ObjectMatrix(),_0x54c0f8['set'](_0x4bb769,_0x48cce5)),_0x48cce5;}['_isLegalRangeUrl'](_0x418b1c,_0x3e9b36){const _0x244d8a=_0x121662;var _0x55ca1d,_0xee6c48,_0x213133;const _0x295758=this['_univerInstanceService']['getUnit'](_0x418b1c,UniverInstanceType['UNIVER_SHEET']);if(!_0x295758)return null;if(_0x3e9b36&&_0x3e9b36[_0x244d8a(0x1e2)]('#')){const _0x521f83=new URLSearchParams(_0x3e9b36['slice'](0x1)),_0x507e4d={'gid':(_0x55ca1d=_0x521f83[_0x244d8a(0x2e7)](_0x244d8a(0x3bb)))!=null?_0x55ca1d:'','range':(_0xee6c48=_0x521f83['get']('range'))!=null?_0xee6c48:'','rangeid':(_0x213133=_0x521f83[_0x244d8a(0x2e7)](_0x244d8a(0x299)))!=null?_0x213133:''};if(_0x507e4d['range']&&_0x507e4d[_0x244d8a(0x3bb)]){const _0x24a7b0=_0x507e4d['gid'],_0x2b259b=_0x295758[_0x244d8a(0x2c8)](_0x24a7b0);if(!_0x2b259b)return null;const _0x5180af=deserializeRangeWithSheet(_0x507e4d[_0x244d8a(0x287)])[_0x244d8a(0x287)];if(isValidRange(_0x5180af,_0x2b259b)&&_0x507e4d['range']!==ERROR_RANGE)return _0x5180af;}}return null;}[_0x121662(0x38e)](_0x1a8089,_0x3a8860,_0x3f4808,_0x40b08c,_0x43d888){const _0x1ec95b=_0x121662;var _0x45949a,_0x4f41e3,_0xdad44,_0x31b02d;const _0x367c7c=this['_enusreMap'](_0x1a8089,_0x3a8860),_0x1b42bb=Tools['deepClone'](_0x43d888),_0x432e56=__name(_0x456149=>{const _0x17191d=_0x3a7e;var _0x2b87e4,_0x50ca6c;const _0x332dda=Tools[_0x17191d(0x361)](_0x1b42bb);(_0x50ca6c=(_0x2b87e4=_0x332dda['body'])==null?void 0x0:_0x2b87e4[_0x17191d(0x37e)])==null||_0x50ca6c[_0x17191d(0x3bc)](_0x284ab3=>{const _0x3893e6=_0x17191d;var _0x5e17fb;if(_0x284ab3[_0x3893e6(0x271)]===CustomRangeType[_0x3893e6(0x269)]){const _0x5c31dc=(_0x5e17fb=_0x284ab3[_0x3893e6(0x38c)])==null?void 0x0:_0x5e17fb[_0x3893e6(0x241)],_0x43fd3e=this['_isLegalRangeUrl'](_0x1a8089,_0x5c31dc);if(_0x43fd3e){const _0xf73b98=handleDefaultRangeChangeWithEffectRefCommands(_0x43fd3e,_0x456149),_0x4166ef=_0x3893e6(0x397)+_0x3a8860+'&range='+(_0xf73b98?serializeRange(_0xf73b98):ERROR_RANGE);_0x284ab3['properties'][_0x3893e6(0x241)]=_0x4166ef;}}});const _0x88dbac=handleDefaultRangeChangeWithEffectRefCommands({'startRow':_0x3f4808,'endRow':_0x3f4808,'startColumn':_0x40b08c,'endColumn':_0x40b08c},_0x456149);return _0x88dbac?{'redos':[{'id':SetRangeValuesMutation['id'],'params':{'unitId':_0x1a8089,'subUnitId':_0x3a8860,'cellValue':{[_0x88dbac[_0x17191d(0x25e)]]:{[_0x88dbac[_0x17191d(0x222)]]:{'p':_0x332dda}}}}}],'undos':[{'id':SetRangeValuesMutation['id'],'params':{'unitId':_0x1a8089,'subUnitId':_0x3a8860,'cellValue':{[_0x3f4808]:{[_0x40b08c]:{'p':_0x1b42bb}}}}}]}:{'redos':[],'undos':[]};},_0x1ec95b(0x2d5));if((_0x4f41e3=(_0x45949a=_0x43d888[_0x1ec95b(0x2b6)])==null?void 0x0:_0x45949a['customRanges'])!=null&&_0x4f41e3['some'](_0x4da231=>{const _0x47fe0f=_0x1ec95b;var _0x3d96f2;return _0x4da231[_0x47fe0f(0x271)]===CustomRangeType[_0x47fe0f(0x269)]&&this[_0x47fe0f(0x27f)](_0x1a8089,(_0x3d96f2=_0x4da231[_0x47fe0f(0x38c)])==null?void 0x0:_0x3d96f2[_0x47fe0f(0x241)]);})){const _0x29274e=new DisposableCollection();(_0x31b02d=(_0xdad44=_0x43d888['body'])==null?void 0x0:_0xdad44[_0x1ec95b(0x37e)])==null||_0x31b02d[_0x1ec95b(0x3bc)](_0x64800f=>{const _0xa1c97b=_0x1ec95b;var _0x3c5821;if(_0x64800f['rangeType']===CustomRangeType[_0xa1c97b(0x269)]){const _0x1f5b18=(_0x3c5821=_0x64800f['properties'])==null?void 0x0:_0x3c5821[_0xa1c97b(0x241)],_0x136eeb=this[_0xa1c97b(0x27f)](_0x1a8089,_0x1f5b18);_0x136eeb&&_0x29274e[_0xa1c97b(0x2e8)](this[_0xa1c97b(0x388)][_0xa1c97b(0x1e9)](_0x136eeb,_0x432e56,_0x1a8089,_0x3a8860));}}),_0x367c7c[_0x1ec95b(0x242)](_0x3f4808,_0x40b08c,_0x29274e);}}[_0x121662(0x311)](){const _0x1974ff=_0x121662,_0x584a9d=__name(_0x4b0df3=>{const _0x92393d=_0x3a7e,_0x53a523=_0x4b0df3[_0x92393d(0x34e)]();_0x4b0df3['getSheets']()[_0x92393d(0x3bc)](_0x46f4b5=>{const _0x599969=_0x92393d,_0x3578ba=_0x46f4b5[_0x599969(0x1f1)](),_0x6d69ea=this['_enusreMap'](_0x53a523,_0x3578ba);_0x46f4b5[_0x599969(0x2b5)]()['forValue']((_0x2b9360,_0x47ee6c,_0x369a39)=>{const _0x54723d=_0x599969,_0x337418=_0x6d69ea[_0x54723d(0x396)](_0x2b9360,_0x47ee6c);_0x337418&&_0x337418['dispose'](),_0x369a39&&_0x369a39['p']&&this[_0x54723d(0x38e)](_0x53a523,_0x3578ba,_0x2b9360,_0x47ee6c,_0x369a39['p']);});});},'handleWorkbook');this[_0x1974ff(0x384)][_0x1974ff(0x266)](UniverInstanceType['UNIVER_SHEET'])[_0x1974ff(0x3bc)](_0x1758f6=>{_0x584a9d(_0x1758f6);}),this[_0x1974ff(0x39a)](this[_0x1974ff(0x384)][_0x1974ff(0x235)][_0x1974ff(0x39d)](_0x3a905d=>{const _0x25afb0=_0x1974ff;_0x3a905d[_0x25afb0(0x21c)]===UniverInstanceType[_0x25afb0(0x275)]&&_0x584a9d(_0x3a905d);}));}[_0x121662(0x23d)](){const _0x40e37e=_0x121662;this[_0x40e37e(0x384)][_0x40e37e(0x277)][_0x40e37e(0x39d)](_0x192938=>{const _0x26bfbb=_0x40e37e;if(_0x192938[_0x26bfbb(0x21c)]===UniverInstanceType[_0x26bfbb(0x275)]){const _0x17cc92=_0x192938,_0x5a142f=_0x17cc92[_0x26bfbb(0x34e)]();_0x17cc92[_0x26bfbb(0x221)]()[_0x26bfbb(0x3bc)](_0x5cf4e3=>{const _0x27a8c9=_0x26bfbb,_0x4b5721=_0x5cf4e3[_0x27a8c9(0x1f1)]();this['_enusreMap'](_0x5a142f,_0x4b5721)[_0x27a8c9(0x28b)]((_0x2dc387,_0x4a6ab1,_0x46eace)=>{const _0x50fe7d=_0x27a8c9;_0x46eace&&_0x46eace[_0x50fe7d(0x2c5)]();});}),this[_0x26bfbb(0x25f)][_0x26bfbb(0x218)](_0x5a142f);}});}[_0x121662(0x3ae)](){const _0x452a21=_0x121662;this[_0x452a21(0x39a)](this[_0x452a21(0x1c1)][_0x452a21(0x2ba)](_0x3f4a2a=>{const _0x807247=_0x452a21;if(_0x3f4a2a['id']===SetRangeValuesMutation['id']){const _0x557b6d=_0x3f4a2a[_0x807247(0x29d)],{unitId:_0x295256,subUnitId:_0x4ed3ce,cellValue:_0x290fb8}=_0x557b6d,_0x32b825=this['_enusreMap'](_0x295256,_0x4ed3ce);_0x290fb8&&new ObjectMatrix(_0x290fb8)['forValue']((_0x499049,_0x158592,_0x6c8c5f)=>{const _0x5c93d2=_0x807247,_0x5097f4=_0x32b825[_0x5c93d2(0x396)](_0x499049,_0x158592);_0x5097f4&&_0x5097f4[_0x5c93d2(0x2c5)](),_0x6c8c5f&&_0x6c8c5f['p']&&this[_0x5c93d2(0x38e)](_0x295256,_0x4ed3ce,_0x499049,_0x158592,_0x6c8c5f['p']);});}}));}},__name(_a10,_0x121662(0x288)),_a10);SheetsHyperLinkRichTextRefRangeController=__decorateClass$4([__decorateParam$4(0x0,ICommandService),__decorateParam$4(0x1,IUniverInstanceService),__decorateParam$4(0x2,Inject(RefRangeService))],SheetsHyperLinkRichTextRefRangeController);var __defProp$3=Object[_0x121662(0x3c5)],__getOwnPropDesc$3=Object[_0x121662(0x2cd)],__decorateClass$3=__name((_0x5b7876,_0x25c03a,_0x1e2e86,_0x1e7913)=>{const _0x3d730e=_0x121662;for(var _0x35bef6=_0x1e7913>0x1?void 0x0:_0x1e7913?__getOwnPropDesc$3(_0x25c03a,_0x1e2e86):_0x25c03a,_0x450a7e=_0x5b7876[_0x3d730e(0x259)]-0x1,_0x18a2e9;_0x450a7e>=0x0;_0x450a7e--)(_0x18a2e9=_0x5b7876[_0x450a7e])&&(_0x35bef6=(_0x1e7913?_0x18a2e9(_0x25c03a,_0x1e2e86,_0x35bef6):_0x18a2e9(_0x35bef6))||_0x35bef6);return _0x1e7913&&_0x35bef6&&__defProp$3(_0x25c03a,_0x1e2e86,_0x35bef6),_0x35bef6;},_0x121662(0x1e6)),__decorateParam$3=__name((_0x56427d,_0xc32bf3)=>(_0x1a4f09,_0x38ebd0)=>_0xc32bf3(_0x1a4f09,_0x38ebd0,_0x56427d),'__decorateParam$3'),_a11;let SheetHyperLinkSetRangeController=(_a11=class extends Disposable{constructor(_0x198a3c,_0x1299ec,_0x35cad7,_0x351914,_0x4bf646,_0x5c88bf){const _0x29636f=_0x121662;super(),this['_sheetInterceptorService']=_0x198a3c,this[_0x29636f(0x300)]=_0x1299ec,this['_selectionManagerService']=_0x35cad7,this['_univerInstanceService']=_0x351914,this[_0x29636f(0x2fb)]=_0x4bf646,this[_0x29636f(0x2a2)]=_0x5c88bf,this[_0x29636f(0x336)](),this[_0x29636f(0x226)]();}['_initCommandInterceptor'](){const _0x415f83=_0x121662;this[_0x415f83(0x1d6)](),this[_0x415f83(0x347)]();}[_0x121662(0x1d6)](){const _0x5d64ce=_0x121662;this[_0x5d64ce(0x39a)](this['_sheetInterceptorService'][_0x5d64ce(0x21e)]({'getMutations':__name(_0x4932cc=>{const _0x4ca8fb=_0x5d64ce;if(_0x4932cc['id']===SetRangeValuesCommand['id']){const _0xa080fc=_0x4932cc[_0x4ca8fb(0x29d)],{unitId:_0x50e700,subUnitId:_0x50231c}=_0xa080fc,_0x39348c=[],_0x3288d4=[];return _0xa080fc['cellValue']&&new ObjectMatrix(_0xa080fc[_0x4ca8fb(0x200)])['forValue']((_0x2e2353,_0x40fe17)=>{const _0x420cfb=_0x4ca8fb,_0x173f27=this[_0x420cfb(0x300)][_0x420cfb(0x249)](_0x50e700,_0x50231c,_0x2e2353,_0x40fe17);_0x173f27&&(_0x39348c['push']({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x50e700,'subUnitId':_0x50231c,'id':_0x173f27['id']}}),_0x3288d4[_0x420cfb(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x50e700,'subUnitId':_0x50231c,'link':_0x173f27}}));}),{'undos':_0x3288d4,'redos':_0x39348c};}return{'redos':[],'undos':[]};},_0x5d64ce(0x371))}));}[_0x121662(0x347)](){const _0x4aa405=_0x121662;this[_0x4aa405(0x39a)](this['_sheetInterceptorService']['interceptCommand']({'getMutations':__name(_0x2b2871=>{const _0x38865e=_0x4aa405;if(_0x2b2871['id']===ClearSelectionContentCommand['id']||_0x2b2871['id']===ClearSelectionAllCommand['id']||_0x2b2871['id']===ClearSelectionFormatCommand['id']){const _0x4b31ed=[],_0x529050=[],_0x193b7b=this[_0x38865e(0x33b)]['getCurrentLastSelection'](),_0x3a4044=getSheetCommandTarget(this['_univerInstanceService']);if(_0x193b7b&&_0x3a4044){const {unitId:_0x5b09ca,subUnitId:_0x20a0a0}=_0x3a4044;Range[_0x38865e(0x1fd)](_0x193b7b[_0x38865e(0x287)],(_0x42c5b3,_0x11f5f2)=>{const _0x3c1bd1=_0x38865e,_0x515522=this['_hyperLinkModel'][_0x3c1bd1(0x249)](_0x5b09ca,_0x20a0a0,_0x42c5b3,_0x11f5f2);_0x515522&&(_0x4b31ed[_0x3c1bd1(0x2e2)]({'id':RemoveHyperLinkMutation['id'],'params':{'unitId':_0x5b09ca,'subUnitId':_0x20a0a0,'id':_0x515522['id']}}),_0x529050[_0x3c1bd1(0x2e2)]({'id':AddHyperLinkMutation['id'],'params':{'unitId':_0x5b09ca,'subUnitId':_0x20a0a0,'link':_0x515522}}));});}return{'redos':_0x4b31ed,'undos':_0x529050};}return{'redos':[],'undos':[]};},_0x4aa405(0x371))}));}['_initAfterEditor'](){const _0x1a0048=_0x121662;this[_0x1a0048(0x39a)](this[_0x1a0048(0x2fb)]['interceptor'][_0x1a0048(0x3c3)](this['_editorBridgeService'][_0x1a0048(0x3a5)][_0x1a0048(0x1dc)]()[_0x1a0048(0x39e)],{'handler':__name((_0x573efa,_0x3f2854,_0x4b3deb)=>{const _0x9dd1f1=_0x1a0048;if(!_0x573efa||_0x573efa['p'])return _0x4b3deb(_0x573efa);if(typeof _0x573efa['v']==_0x9dd1f1(0x2aa)&&Tools['isLegalUrl'](_0x573efa['v'])&&_0x573efa['v'][_0x573efa['v'][_0x9dd1f1(0x259)]-0x1]!=='\x20'){const {unitId:_0x3127dc,subUnitId:_0x239328}=_0x3f2854,_0x533ea7=this[_0x9dd1f1(0x2a2)][_0x9dd1f1(0x215)](_0x3127dc),_0x22ba46=_0x533ea7==null?void 0x0:_0x533ea7[_0x9dd1f1(0x1ef)](SheetSkeletonManagerService)[_0x9dd1f1(0x362)](_0x239328);if(!_0x22ba46)return _0x4b3deb(_0x573efa);const _0x4b266e=_0x22ba46['skeleton'][_0x9dd1f1(0x3b4)](_0x573efa);if(!_0x4b266e[_0x9dd1f1(0x205)])return _0x4b3deb(_0x573efa);const _0xb82661=BuildTextUtils[_0x9dd1f1(0x355)][_0x9dd1f1(0x374)]({'selection':{'startOffset':0x0,'endOffset':_0x573efa['v'][_0x9dd1f1(0x259)],'collapsed':!0x1},'body':{'dataStream':''+DataStreamTreeTokenType[_0x9dd1f1(0x32e)]+_0x573efa['v']+DataStreamTreeTokenType[_0x9dd1f1(0x321)],'customRanges':[{'startIndex':0x0,'endIndex':_0x573efa['v']['length']+0x1,'rangeId':generateRandomId(),'rangeType':CustomRangeType[_0x9dd1f1(0x269)],'properties':{'url':_0x573efa['v']}}]},'doc':_0x4b266e[_0x9dd1f1(0x205)]});if(!_0xb82661)return _0x4b3deb(_0x573efa);const _0x25c4d7=_0x4b266e['documentModel']['getBody']();return TextX[_0x9dd1f1(0x1e1)](_0x25c4d7,_0xb82661['serialize']()),_0x4b3deb({..._0x573efa,'p':{'id':DOCS_NORMAL_EDITOR_UNIT_ID_KEY,'body':_0x25c4d7,'documentStyle':{'pageSize':{'width':0x1/0x0,'height':0x1/0x0}}}});}return _0x4b3deb(_0x573efa);},_0x1a0048(0x346))}));}},__name(_a11,_0x121662(0x349)),_a11);SheetHyperLinkSetRangeController=__decorateClass$3([__decorateParam$3(0x0,Inject(SheetInterceptorService)),__decorateParam$3(0x1,Inject(HyperLinkModel)),__decorateParam$3(0x2,Inject(SheetsSelectionsService)),__decorateParam$3(0x3,IUniverInstanceService),__decorateParam$3(0x4,IEditorBridgeService),__decorateParam$3(0x5,IRenderManagerService)],SheetHyperLinkSetRangeController);const menuSchema={[RibbonStartGroup['OTHERS']]:{[InsertHyperLinkToolbarOperation['id']]:{'order':0x2,'menuItemFactory':insertLinkMenuToolbarFactory},[genZenEditorMenuId(InsertHyperLinkToolbarOperation['id'])]:{'order':0x2,'menuItemFactory':zenEditorInsertLinkMenuToolbarFactory}},[ContextMenuPosition[_0x121662(0x26d)]]:{[ContextMenuGroup['OTHERS']]:{'order':0x1,[InsertHyperLinkToolbarOperation['id']]:{'order':0x0,'menuItemFactory':insertLinkMenuFactory},[genZenEditorMenuId(InsertHyperLinkToolbarOperation['id'])]:{'order':0x0,'menuItemFactory':zenEditorInsertLinkMenuFactory}}}};var __defProp$2=Object[_0x121662(0x3c5)],__getOwnPropDesc$2=Object[_0x121662(0x2cd)],__decorateClass$2=__name((_0x2a1e2e,_0x485467,_0x59e050,_0x3bd296)=>{const _0xfc2f21=_0x121662;for(var _0x8b318b=_0x3bd296>0x1?void 0x0:_0x3bd296?__getOwnPropDesc$2(_0x485467,_0x59e050):_0x485467,_0x12497a=_0x2a1e2e[_0xfc2f21(0x259)]-0x1,_0x1b879f;_0x12497a>=0x0;_0x12497a--)(_0x1b879f=_0x2a1e2e[_0x12497a])&&(_0x8b318b=(_0x3bd296?_0x1b879f(_0x485467,_0x59e050,_0x8b318b):_0x1b879f(_0x8b318b))||_0x8b318b);return _0x3bd296&&_0x8b318b&&__defProp$2(_0x485467,_0x59e050,_0x8b318b),_0x8b318b;},_0x121662(0x296)),__decorateParam$2=__name((_0x1cac7e,_0x2e84d2)=>(_0xe72738,_0x2a863d)=>_0x2e84d2(_0xe72738,_0x2a863d,_0x1cac7e),_0x121662(0x229)),_a12;let SheetsHyperLinkUIController=(_a12=class extends Disposable{constructor(_0x4d77ea,_0x117450,_0x44850e,_0x555a69,_0x28058a){const _0x258f4a=_0x121662;super(),this[_0x258f4a(0x33c)]=_0x4d77ea,this[_0x258f4a(0x1c1)]=_0x117450,this[_0x258f4a(0x2eb)]=_0x44850e,this['_injector']=_0x555a69,this[_0x258f4a(0x333)]=_0x28058a,this[_0x258f4a(0x354)](),this[_0x258f4a(0x291)](),this[_0x258f4a(0x37d)](),this[_0x258f4a(0x1cc)]();}[_0x121662(0x354)](){const _0x185fd6=_0x121662;[[CellLinkPopup,CellLinkPopup[_0x185fd6(0x1d1)]],[CellLinkEdit,CellLinkEdit[_0x185fd6(0x1d1)]],[LinkSingle,'LinkSingle']]['forEach'](([_0x14aab0,_0x23d82b])=>{const _0x591f28=_0x185fd6;this['_componentManager'][_0x591f28(0x1cb)](_0x23d82b,_0x14aab0);});}[_0x121662(0x291)](){const _0x59fe98=_0x121662;[OpenHyperLinkEditPanelOperation,CloseHyperLinkPopupOperation,InsertHyperLinkOperation,InsertHyperLinkToolbarOperation,AddHyperLinkCommand,UpdateHyperLinkCommand,CancelHyperLinkCommand,UpdateRichHyperLinkCommand,CancelRichHyperLinkCommand,AddRichHyperLinkCommand][_0x59fe98(0x3bc)](_0x19dc1a=>{const _0x4e8203=_0x59fe98;this[_0x4e8203(0x1c1)][_0x4e8203(0x29a)](_0x19dc1a);});}[_0x121662(0x37d)](){const _0x2f1fee=_0x121662;this[_0x2f1fee(0x2eb)][_0x2f1fee(0x3cd)](menuSchema);}['_initShortCut'](){const _0x197ba6=_0x121662;this[_0x197ba6(0x333)]['registerShortcut'](InsertLinkShortcut);}},__name(_a12,'SheetsHyperLinkUIController'),_a12);SheetsHyperLinkUIController=__decorateClass$2([__decorateParam$2(0x0,Inject(ComponentManager)),__decorateParam$2(0x1,ICommandService),__decorateParam$2(0x2,IMenuManagerService),__decorateParam$2(0x3,Inject(Injector)),__decorateParam$2(0x4,Inject(IShortcutService))],SheetsHyperLinkUIController);var __defProp$1=Object['defineProperty'],__getOwnPropDesc$1=Object[_0x121662(0x2cd)],__decorateClass$1=__name((_0x1599f5,_0x25218f,_0x3e0307,_0x5ca6c3)=>{for(var _0x2edbae=_0x5ca6c3>0x1?void 0x0:_0x5ca6c3?__getOwnPropDesc$1(_0x25218f,_0x3e0307):_0x25218f,_0xec6769=_0x1599f5['length']-0x1,_0x17b4be;_0xec6769>=0x0;_0xec6769--)(_0x17b4be=_0x1599f5[_0xec6769])&&(_0x2edbae=(_0x5ca6c3?_0x17b4be(_0x25218f,_0x3e0307,_0x2edbae):_0x17b4be(_0x2edbae))||_0x2edbae);return _0x5ca6c3&&_0x2edbae&&__defProp$1(_0x25218f,_0x3e0307,_0x2edbae),_0x2edbae;},_0x121662(0x264)),__decorateParam$1=__name((_0xb3e6d8,_0x1bab23)=>(_0x4ce14a,_0x1ce018)=>_0x1bab23(_0x4ce14a,_0x1ce018,_0xb3e6d8),_0x121662(0x2f2)),_a13;let SheetHyperLinkUrlController=(_a13=class extends Disposable{constructor(_0x46f557){const _0x4115da=_0x121662;super(),this[_0x4115da(0x3e2)]=_0x46f557,this['_handleInitUrl']();}[_0x121662(0x290)](){const _0x1981ee=_0x121662,_0xf7b2b5=location['hash'];_0xf7b2b5&&this['_resolverService'][_0x1981ee(0x326)](_0xf7b2b5)[_0x1981ee(0x346)]();}},__name(_a13,'SheetHyperLinkUrlController'),_a13);SheetHyperLinkUrlController=__decorateClass$1([__decorateParam$1(0x0,Inject(SheetsHyperLinkResolverService))],SheetHyperLinkUrlController);var __defProp2=Object[_0x121662(0x3c5)],__getOwnPropDesc=Object[_0x121662(0x2cd)],__defNormalProp2=__name((_0x1bebfe,_0x364499,_0x1c7ac3)=>_0x364499 in _0x1bebfe?__defProp2(_0x1bebfe,_0x364499,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1c7ac3}):_0x1bebfe[_0x364499]=_0x1c7ac3,'__defNormalProp'),__decorateClass=__name((_0x5ec834,_0xeb0956,_0x5238a3,_0x3591f9)=>{const _0x2eed3f=_0x121662;for(var _0x2e0adf=_0x3591f9>0x1?void 0x0:_0x3591f9?__getOwnPropDesc(_0xeb0956,_0x5238a3):_0xeb0956,_0x2cffc3=_0x5ec834[_0x2eed3f(0x259)]-0x1,_0x200f8d;_0x2cffc3>=0x0;_0x2cffc3--)(_0x200f8d=_0x5ec834[_0x2cffc3])&&(_0x2e0adf=(_0x3591f9?_0x200f8d(_0xeb0956,_0x5238a3,_0x2e0adf):_0x200f8d(_0x2e0adf))||_0x2e0adf);return _0x3591f9&&_0x2e0adf&&__defProp2(_0xeb0956,_0x5238a3,_0x2e0adf),_0x2e0adf;},'__decorateClass'),__decorateParam=__name((_0x32f3e9,_0x111d71)=>(_0x537053,_0x3cb14d)=>_0x111d71(_0x537053,_0x3cb14d,_0x32f3e9),'__decorateParam'),__publicField2=__name((_0x13dcb1,_0x497539,_0x2aa5bd)=>__defNormalProp2(_0x13dcb1,typeof _0x497539!=_0x121662(0x2cc)?_0x497539+'':_0x497539,_0x2aa5bd),_0x121662(0x22e)),_a14;let UniverSheetsHyperLinkUIPlugin=(_a14=class extends Plugin{constructor(_0x1ba5d8=defaultPluginConfig,_0x41173b,_0x168e66){const _0x3cebd6=_0x121662;super(),this[_0x3cebd6(0x2f1)]=_0x1ba5d8,this['_injector']=_0x41173b,this['_configService']=_0x168e66;const {menu:_0x2fc51d,..._0x82b067}=this['_config'];_0x2fc51d&&this[_0x3cebd6(0x1be)][_0x3cebd6(0x30b)]('menu',_0x2fc51d,{'merge':!0x0}),this['_configService'][_0x3cebd6(0x30b)](PLUGIN_CONFIG_KEY,_0x82b067);}[_0x121662(0x209)](){const _0x47b0bb=_0x121662;[[SheetsHyperLinkResolverService],[SheetsHyperLinkPopupService],[SheetsHyperLinkSidePanelService],[SheetsHyperLinkRemoveSheetController],[SheetsHyperLinkRenderManagerController],[SheetHyperLinkSetRangeController],[SheetsHyperLinkPopupController],[SheetsHyperLinkUIController],[SheetsHyperLinkAutoFillController],[SheetsHyperLinkCopyPasteController],[SheetsHyperLinkPermissionController],[SheetHyperLinkUrlController],[SheetsHyperLinkRichTextRefRangeController]][_0x47b0bb(0x3bc)](_0x559f77=>this[_0x47b0bb(0x297)]['add'](_0x559f77)),this['_injector']['get'](SheetsHyperLinkRenderManagerController),this[_0x47b0bb(0x297)][_0x47b0bb(0x2e7)](SheetsHyperLinkRichTextRefRangeController),this[_0x47b0bb(0x297)][_0x47b0bb(0x2e7)](SheetHyperLinkSetRangeController);}['onReady'](){const _0x453cc8=_0x121662;this[_0x453cc8(0x297)]['get'](IRenderManagerService)[_0x453cc8(0x2cf)](UniverInstanceType[_0x453cc8(0x275)],[SheetsHyperLinkRenderController]),this[_0x453cc8(0x297)][_0x453cc8(0x2e7)](SheetsHyperLinkAutoFillController),this[_0x453cc8(0x297)][_0x453cc8(0x2e7)](SheetsHyperLinkCopyPasteController),this[_0x453cc8(0x297)][_0x453cc8(0x2e7)](SheetsHyperLinkRemoveSheetController),this[_0x453cc8(0x297)][_0x453cc8(0x2e7)](SheetsHyperLinkUIController);}['onRendered'](){const _0x1893f1=_0x121662;this['_injector'][_0x1893f1(0x2e7)](SheetsHyperLinkPermissionController),this['_injector'][_0x1893f1(0x2e7)](SheetHyperLinkUrlController),this[_0x1893f1(0x297)][_0x1893f1(0x2e7)](SheetsHyperLinkPopupController);}},__name(_a14,_0x121662(0x3ac)),_a14);__publicField2(UniverSheetsHyperLinkUIPlugin,_0x121662(0x1bf),SHEET_HYPER_LINK_UI_PLUGIN),__publicField2(UniverSheetsHyperLinkUIPlugin,_0x121662(0x21c),UniverInstanceType[_0x121662(0x275)]),UniverSheetsHyperLinkUIPlugin=__decorateClass([DependentOn(UniverSheetsHyperLinkPlugin,UniverDocsUIPlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,IConfigService)],UniverSheetsHyperLinkUIPlugin);export{AddHyperLinkCommand,CancelHyperLinkCommand,CloseHyperLinkPopupOperation,InsertHyperLinkOperation,InsertLinkShortcut,OpenHyperLinkEditPanelOperation,SheetsHyperLinkCopyPasteController,SheetsHyperLinkPopupService,SheetsHyperLinkResolverService,SheetsHyperLinkSidePanelService,UniverSheetsHyperLinkUIPlugin,UpdateHyperLinkCommand};
|