@univerjs/sheets-thread-comment 0.3.0-alpha.1 → 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 -1
- package/lib/es/index.js +1 -823
- package/lib/types/controllers/sheets-thread-comment-copy-paste.controller.d.ts +1 -1
- package/lib/types/plugin.d.ts +3 -1
- package/lib/umd/index.js +1 -1
- package/package.json +19 -20
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,823 +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 { Inject, Disposable, DisposableCollection, CommandType, IUniverInstanceService, OnLifecycle, LifecycleStages, InterceptorEffectEnum, UniverInstanceType, useDependency, Tools, ICommandService, Range, RANGE_TYPE, DependentOn, Injector, Plugin, IConfigService } from "@univerjs/core";
|
|
6
|
-
import { SheetsSelectionsService, getSheetCommandTarget, SheetInterceptorService, INTERCEPTOR_POINT, WorkbookCommentPermission, WorksheetViewPermission, RangeProtectionPermissionViewPoint, SetWorksheetActiveOperation, RemoveSheetCommand } from "@univerjs/sheets";
|
|
7
|
-
import { SheetsThreadCommentModel, UniverSheetsThreadCommentBasePlugin } from "@univerjs/sheets-thread-comment-base";
|
|
8
|
-
import { SheetsThreadCommentModel as SheetsThreadCommentModel2 } from "@univerjs/sheets-thread-comment-base";
|
|
9
|
-
import { ThreadCommentPanelService, ThreadCommentTree, ThreadCommentPanel, ToggleSheetCommentPanelOperation, THREAD_COMMENT_PANEL, SetActiveCommentOperation, UniverThreadCommentUIPlugin } from "@univerjs/thread-comment-ui";
|
|
10
|
-
import { IThreadCommentMentionDataService, UniverThreadCommentUIPlugin as UniverThreadCommentUIPlugin2 } from "@univerjs/thread-comment-ui";
|
|
11
|
-
import { SheetCanvasPopManagerService, SheetSkeletonManagerService, IMarkSelectionService, whenSheetEditorFocused, getCurrentRangeDisable$, ISheetClipboardService, COPY_TYPE, HoverManagerService, SheetPermissionInterceptorBaseController, ScrollToRangeOperation, IEditorBridgeService } from "@univerjs/sheets-ui";
|
|
12
|
-
import { IZenZoneService, useObservable, KeyCode, MetaKeys, MenuItemType, getMenuHiddenObservable, RibbonStartGroup, ContextMenuPosition, ContextMenuGroup, ComponentManager, IMenuManagerService, IShortcutService } from "@univerjs/ui";
|
|
13
|
-
import { BehaviorSubject, debounceTime, map } from "rxjs";
|
|
14
|
-
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
15
|
-
import React, { forwardRef, useRef, createElement, useMemo, useCallback, useEffect } from "react";
|
|
16
|
-
import { singleReferenceToGrid, serializeRange } from "@univerjs/engine-formula";
|
|
17
|
-
import { IThreadCommentDataSourceService, DeleteCommentMutation, AddCommentMutation, ThreadCommentModel } from "@univerjs/thread-comment";
|
|
18
|
-
import { AddCommentCommand, DeleteCommentCommand, DeleteCommentTreeCommand, IThreadCommentDataSourceService as IThreadCommentDataSourceService2, ResolveCommentCommand, UpdateCommentCommand } from "@univerjs/thread-comment";
|
|
19
|
-
const SHEETS_THREAD_COMMENT_MODAL = "univer.sheet.thread-comment-modal", COMMENT_SINGLE_ICON = "comment-single", SHEETS_THREAD_COMMENT = "SHEET_THREAD_COMMENT";
|
|
20
|
-
var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
21
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
23
|
-
return kind && result && __defProp$7(target, key, result), result;
|
|
24
|
-
}, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$7"), _a;
|
|
25
|
-
let SheetsThreadCommentPopupService = (_a = class extends Disposable {
|
|
26
|
-
constructor(_canvasPopupManagerService, _zenZoneService) {
|
|
27
|
-
super();
|
|
28
|
-
__publicField(this, "_lastPopup", null);
|
|
29
|
-
__publicField(this, "_activePopup");
|
|
30
|
-
__publicField(this, "_activePopup$", new BehaviorSubject(null));
|
|
31
|
-
__publicField(this, "activePopup$", this._activePopup$.asObservable());
|
|
32
|
-
this._canvasPopupManagerService = _canvasPopupManagerService, this._zenZoneService = _zenZoneService, this._initZenVisible(), this.disposeWithMe(() => {
|
|
33
|
-
this._activePopup$.complete();
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
get activePopup() {
|
|
37
|
-
return this._activePopup;
|
|
38
|
-
}
|
|
39
|
-
_initZenVisible() {
|
|
40
|
-
this.disposeWithMe(this._zenZoneService.visible$.subscribe((visible) => {
|
|
41
|
-
visible && this.hidePopup();
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
showPopup(location, onHide) {
|
|
45
|
-
var _a9;
|
|
46
|
-
const { row, col, unitId, subUnitId } = location;
|
|
47
|
-
if (this._activePopup && row === this._activePopup.row && col === this._activePopup.col && unitId === this._activePopup.unitId && subUnitId === ((_a9 = this.activePopup) == null ? void 0 : _a9.subUnitId)) {
|
|
48
|
-
this._activePopup = location, this._activePopup$.next(location);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (this._lastPopup && this._lastPopup.dispose(), this._zenZoneService.visible)
|
|
52
|
-
return;
|
|
53
|
-
this._activePopup = location, this._activePopup$.next(location);
|
|
54
|
-
const popupDisposable = this._canvasPopupManagerService.attachPopupToCell(
|
|
55
|
-
row,
|
|
56
|
-
col,
|
|
57
|
-
{
|
|
58
|
-
componentKey: SHEETS_THREAD_COMMENT_MODAL,
|
|
59
|
-
onClickOutside: /* @__PURE__ */ __name(() => {
|
|
60
|
-
this.hidePopup();
|
|
61
|
-
}, "onClickOutside"),
|
|
62
|
-
direction: "horizontal",
|
|
63
|
-
excludeOutside: [
|
|
64
|
-
...Array.from(document.querySelectorAll(".univer-thread-comment")),
|
|
65
|
-
document.getElementById("thread-comment-add")
|
|
66
|
-
].filter(Boolean)
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
if (!popupDisposable)
|
|
70
|
-
throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");
|
|
71
|
-
const disposableCollection = new DisposableCollection();
|
|
72
|
-
disposableCollection.add(popupDisposable), disposableCollection.add({
|
|
73
|
-
dispose: /* @__PURE__ */ __name(() => {
|
|
74
|
-
onHide == null || onHide();
|
|
75
|
-
}, "dispose")
|
|
76
|
-
}), this._lastPopup = disposableCollection;
|
|
77
|
-
}
|
|
78
|
-
hidePopup() {
|
|
79
|
-
this._activePopup && (this._lastPopup && this._lastPopup.dispose(), this._lastPopup = null, this._activePopup = null, this._activePopup$.next(null));
|
|
80
|
-
}
|
|
81
|
-
persistPopup() {
|
|
82
|
-
!this._activePopup || !this._activePopup.temp || (this._activePopup = {
|
|
83
|
-
...this._activePopup,
|
|
84
|
-
temp: !1
|
|
85
|
-
}, this._activePopup$.next(this._activePopup));
|
|
86
|
-
}
|
|
87
|
-
}, __name(_a, "SheetsThreadCommentPopupService"), _a);
|
|
88
|
-
SheetsThreadCommentPopupService = __decorateClass$7([
|
|
89
|
-
__decorateParam$7(0, Inject(SheetCanvasPopManagerService)),
|
|
90
|
-
__decorateParam$7(1, IZenZoneService)
|
|
91
|
-
], SheetsThreadCommentPopupService);
|
|
92
|
-
const ShowAddSheetCommentModalOperation = {
|
|
93
|
-
type: CommandType.OPERATION,
|
|
94
|
-
id: "sheets.operation.show-comment-modal",
|
|
95
|
-
handler(accessor) {
|
|
96
|
-
var _a9;
|
|
97
|
-
const selectionManagerService = accessor.get(SheetsSelectionsService), univerInstanceService = accessor.get(IUniverInstanceService), sheetsThreadCommentPopupService = accessor.get(SheetsThreadCommentPopupService), threadCommentPanelService = accessor.get(ThreadCommentPanelService), activeCell = (_a9 = selectionManagerService.getCurrentLastSelection()) == null ? void 0 : _a9.primary, model = accessor.get(SheetsThreadCommentModel);
|
|
98
|
-
if (!activeCell)
|
|
99
|
-
return !1;
|
|
100
|
-
const result = getSheetCommandTarget(univerInstanceService);
|
|
101
|
-
if (!result)
|
|
102
|
-
return !1;
|
|
103
|
-
const { workbook, worksheet, unitId, subUnitId } = result, location = {
|
|
104
|
-
workbook,
|
|
105
|
-
worksheet,
|
|
106
|
-
unitId,
|
|
107
|
-
subUnitId,
|
|
108
|
-
row: activeCell.startRow,
|
|
109
|
-
col: activeCell.startColumn
|
|
110
|
-
};
|
|
111
|
-
sheetsThreadCommentPopupService.showPopup(location);
|
|
112
|
-
const rootId = model.getByLocation(unitId, subUnitId, activeCell.startRow, activeCell.startColumn);
|
|
113
|
-
return rootId && threadCommentPanelService.setActiveComment({
|
|
114
|
-
unitId,
|
|
115
|
-
subUnitId,
|
|
116
|
-
commentId: rootId,
|
|
117
|
-
trigger: "context-menu"
|
|
118
|
-
}), !0;
|
|
119
|
-
}
|
|
120
|
-
}, PLUGIN_CONFIG_KEY = "sheets-thread-comment.config", defaultPluginConfig = {};
|
|
121
|
-
var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
122
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
123
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
124
|
-
return kind && result && __defProp$6(target, key, result), result;
|
|
125
|
-
}, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$6"), _a2;
|
|
126
|
-
let SheetsThreadCommentRenderController = (_a2 = class extends Disposable {
|
|
127
|
-
constructor(_sheetInterceptorService, _sheetsThreadCommentModel, _univerInstanceService, _renderManagerService) {
|
|
128
|
-
super(), this._sheetInterceptorService = _sheetInterceptorService, this._sheetsThreadCommentModel = _sheetsThreadCommentModel, this._univerInstanceService = _univerInstanceService, this._renderManagerService = _renderManagerService, this._initViewModelIntercept(), this._initSkeletonChange();
|
|
129
|
-
}
|
|
130
|
-
_initViewModelIntercept() {
|
|
131
|
-
this.disposeWithMe(
|
|
132
|
-
this._sheetInterceptorService.intercept(
|
|
133
|
-
INTERCEPTOR_POINT.CELL_CONTENT,
|
|
134
|
-
{
|
|
135
|
-
effect: InterceptorEffectEnum.Style,
|
|
136
|
-
handler: /* @__PURE__ */ __name((cell, pos, next) => {
|
|
137
|
-
const { row, col, unitId, subUnitId } = pos;
|
|
138
|
-
return this._sheetsThreadCommentModel.showCommentMarker(unitId, subUnitId, row, col) ? next({
|
|
139
|
-
...cell,
|
|
140
|
-
markers: {
|
|
141
|
-
...cell == null ? void 0 : cell.markers,
|
|
142
|
-
tr: {
|
|
143
|
-
color: "#FFBD37",
|
|
144
|
-
size: 6
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}) : next(cell);
|
|
148
|
-
}, "handler"),
|
|
149
|
-
priority: 100
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
_initSkeletonChange() {
|
|
155
|
-
const markSkeletonDirty = /* @__PURE__ */ __name(() => {
|
|
156
|
-
var _a9;
|
|
157
|
-
const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
158
|
-
if (!workbook) return;
|
|
159
|
-
const unitId = workbook.getUnitId(), subUnitId = (_a9 = workbook.getActiveSheet()) == null ? void 0 : _a9.getSheetId();
|
|
160
|
-
if (!subUnitId) {
|
|
161
|
-
console.warn("No active sheet found");
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const currentRender = this._renderManagerService.getRenderById(unitId), skeleton = currentRender == null ? void 0 : currentRender.with(SheetSkeletonManagerService).getOrCreateSkeleton({ sheetId: subUnitId });
|
|
165
|
-
skeleton == null || skeleton.makeDirty(!0), skeleton == null || skeleton.calculate(), currentRender && currentRender.mainComponent.makeForceDirty();
|
|
166
|
-
}, "markSkeletonDirty");
|
|
167
|
-
this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(debounceTime(16)).subscribe((update) => {
|
|
168
|
-
markSkeletonDirty();
|
|
169
|
-
}));
|
|
170
|
-
}
|
|
171
|
-
}, __name(_a2, "SheetsThreadCommentRenderController"), _a2);
|
|
172
|
-
SheetsThreadCommentRenderController = __decorateClass$6([
|
|
173
|
-
OnLifecycle(LifecycleStages.Ready, SheetsThreadCommentRenderController),
|
|
174
|
-
__decorateParam$6(0, Inject(SheetInterceptorService)),
|
|
175
|
-
__decorateParam$6(1, Inject(SheetsThreadCommentModel)),
|
|
176
|
-
__decorateParam$6(2, IUniverInstanceService),
|
|
177
|
-
__decorateParam$6(3, IRenderManagerService)
|
|
178
|
-
], SheetsThreadCommentRenderController);
|
|
179
|
-
var __assign = function() {
|
|
180
|
-
return __assign = Object.assign || function(t) {
|
|
181
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
182
|
-
s = arguments[i];
|
|
183
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
184
|
-
}
|
|
185
|
-
return t;
|
|
186
|
-
}, __assign.apply(this, arguments);
|
|
187
|
-
}, __rest = function(s, e) {
|
|
188
|
-
var t = {};
|
|
189
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
190
|
-
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
191
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
192
|
-
e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
193
|
-
return t;
|
|
194
|
-
}, IconBase = forwardRef(function(props, ref) {
|
|
195
|
-
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()));
|
|
196
|
-
return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
|
|
197
|
-
});
|
|
198
|
-
function render(node, id, runtimeProps, rootProps, extend) {
|
|
199
|
-
return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
|
|
200
|
-
return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
|
|
201
|
-
}));
|
|
202
|
-
}
|
|
203
|
-
__name(render, "render");
|
|
204
|
-
function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
|
|
205
|
-
var attrs = __assign({}, node.attrs);
|
|
206
|
-
extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
|
|
207
|
-
var defIds = runtimeProps.defIds;
|
|
208
|
-
return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a9) {
|
|
209
|
-
var key = _a9[0], value = _a9[1];
|
|
210
|
-
typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
|
|
211
|
-
})), attrs;
|
|
212
|
-
}
|
|
213
|
-
__name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
|
|
214
|
-
function replaceRuntimeIdsInDefs(node, runtimeProps) {
|
|
215
|
-
var _a9, defIds = runtimeProps.defIds;
|
|
216
|
-
return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a9 = node.children) === null || _a9 === void 0) && _a9.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
|
|
217
|
-
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;
|
|
218
|
-
}) }) : node;
|
|
219
|
-
}
|
|
220
|
-
__name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
|
|
221
|
-
function generateShortUuid() {
|
|
222
|
-
return Math.random().toString(36).substring(2, 8);
|
|
223
|
-
}
|
|
224
|
-
__name(generateShortUuid, "generateShortUuid");
|
|
225
|
-
IconBase.displayName = "UniverIcon";
|
|
226
|
-
var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, CommentSingle = forwardRef(function(props, ref) {
|
|
227
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
228
|
-
id: "comment-single",
|
|
229
|
-
ref,
|
|
230
|
-
icon: element
|
|
231
|
-
}));
|
|
232
|
-
});
|
|
233
|
-
CommentSingle.displayName = "CommentSingle";
|
|
234
|
-
const SheetsThreadCommentCell = /* @__PURE__ */ __name(() => {
|
|
235
|
-
const univerInstanceService = useDependency(IUniverInstanceService), sheetsThreadCommentPopupService = useDependency(SheetsThreadCommentPopupService), activePopup = useObservable(sheetsThreadCommentPopupService.activePopup$), sheetThreadCommentModel = useDependency(SheetsThreadCommentModel);
|
|
236
|
-
if (useObservable(sheetThreadCommentModel.commentUpdate$), !activePopup)
|
|
237
|
-
return null;
|
|
238
|
-
const { row, col, unitId, subUnitId, trigger } = activePopup, rootId = sheetThreadCommentModel.getByLocation(unitId, subUnitId, row, col), ref = `${Tools.chatAtABC(col)}${row + 1}`, onClose = /* @__PURE__ */ __name(() => {
|
|
239
|
-
sheetsThreadCommentPopupService.hidePopup();
|
|
240
|
-
}, "onClose"), getSubUnitName = /* @__PURE__ */ __name((id) => {
|
|
241
|
-
var _a9, _b, _c;
|
|
242
|
-
return (_c = (_b = (_a9 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a9.getSheetBySheetId(id)) == null ? void 0 : _b.getName()) != null ? _c : "";
|
|
243
|
-
}, "getSubUnitName");
|
|
244
|
-
return /* @__PURE__ */ React.createElement(
|
|
245
|
-
ThreadCommentTree,
|
|
246
|
-
{
|
|
247
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
248
|
-
sheetsThreadCommentPopupService.persistPopup();
|
|
249
|
-
}, "onClick"),
|
|
250
|
-
prefix: "cell",
|
|
251
|
-
id: rootId,
|
|
252
|
-
unitId,
|
|
253
|
-
subUnitId,
|
|
254
|
-
type: UniverInstanceType.UNIVER_SHEET,
|
|
255
|
-
refStr: ref,
|
|
256
|
-
onClose,
|
|
257
|
-
getSubUnitName,
|
|
258
|
-
autoFocus: trigger === "context-menu"
|
|
259
|
-
}
|
|
260
|
-
);
|
|
261
|
-
}, "SheetsThreadCommentCell"), SheetsThreadCommentPanel = /* @__PURE__ */ __name(() => {
|
|
262
|
-
var _a9;
|
|
263
|
-
const markSelectionService = useDependency(IMarkSelectionService), univerInstanceService = useDependency(IUniverInstanceService), sheetsThreadCommentPopupService = useDependency(SheetsThreadCommentPopupService), workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), unitId = workbook.getUnitId(), commandService = useDependency(ICommandService), subUnitId$ = useMemo(() => workbook.activeSheet$.pipe(map((i) => i == null ? void 0 : i.getSheetId())), [workbook.activeSheet$]), subUnitId = useObservable(subUnitId$, (_a9 = workbook.getActiveSheet()) == null ? void 0 : _a9.getSheetId()), hoverShapeId = useRef(), panelService = useDependency(ThreadCommentPanelService), activeCommentId = useObservable(panelService.activeCommentId$), panelVisible = useObservable(panelService.panelVisible$, panelService.panelVisible), sortComments = useCallback((comments) => {
|
|
264
|
-
const worksheets = workbook.getSheets(), sheetIndex = {};
|
|
265
|
-
worksheets.forEach((sheet, i) => {
|
|
266
|
-
sheetIndex[sheet.getSheetId()] = i;
|
|
267
|
-
});
|
|
268
|
-
const sort = /* @__PURE__ */ __name((comments2) => comments2.map((comment) => {
|
|
269
|
-
var _a10;
|
|
270
|
-
const ref = singleReferenceToGrid(comment.ref), p = [(_a10 = sheetIndex[comment.subUnitId]) != null ? _a10 : 0, ref.row, ref.column];
|
|
271
|
-
return { ...comment, p };
|
|
272
|
-
}).sort((pre, aft) => pre.p[0] === aft.p[0] ? pre.p[1] === aft.p[1] ? pre.p[2] - aft.p[2] : pre.p[1] - aft.p[1] : pre.p[0] - aft.p[0]), "sort");
|
|
273
|
-
return [
|
|
274
|
-
...sort(comments.filter((comment) => !comment.resolved)),
|
|
275
|
-
...sort(comments.filter((comment) => comment.resolved))
|
|
276
|
-
];
|
|
277
|
-
}, [workbook]), showShape = useCallback((comment) => {
|
|
278
|
-
var _a10;
|
|
279
|
-
if (comment.unitId === unitId && comment.subUnitId === subUnitId && !comment.resolved) {
|
|
280
|
-
const { row, column } = singleReferenceToGrid(comment.ref), worksheet = workbook.getSheetBySheetId(comment.subUnitId), mergeInfo = (_a10 = worksheet == null ? void 0 : worksheet.getMergedCell(row, column)) != null ? _a10 : {
|
|
281
|
-
startColumn: column,
|
|
282
|
-
endColumn: column,
|
|
283
|
-
startRow: row,
|
|
284
|
-
endRow: row
|
|
285
|
-
};
|
|
286
|
-
if (!Number.isNaN(row) && !Number.isNaN(column))
|
|
287
|
-
return markSelectionService.addShape({
|
|
288
|
-
range: mergeInfo,
|
|
289
|
-
style: {
|
|
290
|
-
hasAutoFill: !1,
|
|
291
|
-
fill: "rgb(255, 189, 55, 0.35)",
|
|
292
|
-
strokeWidth: 1,
|
|
293
|
-
stroke: "#FFBD37",
|
|
294
|
-
widgets: {}
|
|
295
|
-
},
|
|
296
|
-
primary: null
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}, [markSelectionService, subUnitId, unitId]), getSubUnitName = /* @__PURE__ */ __name((id) => {
|
|
300
|
-
var _a10, _b;
|
|
301
|
-
return (_b = (_a10 = workbook.getSheetBySheetId(id)) == null ? void 0 : _a10.getName()) != null ? _b : "";
|
|
302
|
-
}, "getSubUnitName"), handleAdd = /* @__PURE__ */ __name(() => {
|
|
303
|
-
commandService.executeCommand(ShowAddSheetCommentModalOperation.id);
|
|
304
|
-
}, "handleAdd"), handleHover = /* @__PURE__ */ __name((comment) => {
|
|
305
|
-
activeCommentId && activeCommentId.unitId === comment.unitId && activeCommentId.subUnitId === comment.subUnitId && activeCommentId.commentId === comment.id || (hoverShapeId.current && (markSelectionService.removeShape(hoverShapeId.current), hoverShapeId.current = null), hoverShapeId.current = showShape(comment));
|
|
306
|
-
}, "handleHover"), handleLeave = /* @__PURE__ */ __name(() => {
|
|
307
|
-
hoverShapeId.current && (markSelectionService.removeShape(hoverShapeId.current), hoverShapeId.current = null);
|
|
308
|
-
}, "handleLeave"), handleResolve = /* @__PURE__ */ __name((id, resolved) => {
|
|
309
|
-
resolved && sheetsThreadCommentPopupService.hidePopup();
|
|
310
|
-
}, "handleResolve");
|
|
311
|
-
return useEffect(() => {
|
|
312
|
-
!panelVisible && hoverShapeId.current && markSelectionService.removeShape(hoverShapeId.current);
|
|
313
|
-
}, [markSelectionService, panelVisible]), /* @__PURE__ */ React.createElement(
|
|
314
|
-
ThreadCommentPanel,
|
|
315
|
-
{
|
|
316
|
-
unitId,
|
|
317
|
-
subUnitId$,
|
|
318
|
-
type: UniverInstanceType.UNIVER_SHEET,
|
|
319
|
-
onAdd: handleAdd,
|
|
320
|
-
getSubUnitName,
|
|
321
|
-
onResolve: handleResolve,
|
|
322
|
-
sortComments,
|
|
323
|
-
onItemEnter: handleHover,
|
|
324
|
-
onItemLeave: handleLeave,
|
|
325
|
-
onDeleteComment: /* @__PURE__ */ __name(() => (handleLeave(), !0), "onDeleteComment")
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
}, "SheetsThreadCommentPanel"), threadCommentMenuFactory = /* @__PURE__ */ __name((accessor) => ({
|
|
329
|
-
id: ShowAddSheetCommentModalOperation.id,
|
|
330
|
-
type: MenuItemType.BUTTON,
|
|
331
|
-
icon: COMMENT_SINGLE_ICON,
|
|
332
|
-
title: "sheetThreadComment.menu.addComment",
|
|
333
|
-
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
334
|
-
disabled$: getCurrentRangeDisable$(accessor, {
|
|
335
|
-
workbookTypes: [WorkbookCommentPermission],
|
|
336
|
-
worksheetTypes: [WorksheetViewPermission],
|
|
337
|
-
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
338
|
-
})
|
|
339
|
-
}), "threadCommentMenuFactory"), threadPanelMenuFactory = /* @__PURE__ */ __name((accessor) => ({
|
|
340
|
-
id: ToggleSheetCommentPanelOperation.id,
|
|
341
|
-
type: MenuItemType.BUTTON,
|
|
342
|
-
icon: COMMENT_SINGLE_ICON,
|
|
343
|
-
tooltip: "sheetThreadComment.menu.commentManagement",
|
|
344
|
-
disabled$: getCurrentRangeDisable$(accessor, {
|
|
345
|
-
workbookTypes: [WorkbookCommentPermission],
|
|
346
|
-
worksheetTypes: [WorksheetViewPermission],
|
|
347
|
-
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
348
|
-
}),
|
|
349
|
-
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)
|
|
350
|
-
}), "threadPanelMenuFactory"), AddCommentShortcut = {
|
|
351
|
-
id: ShowAddSheetCommentModalOperation.id,
|
|
352
|
-
binding: KeyCode.M | MetaKeys.CTRL_COMMAND | MetaKeys.ALT,
|
|
353
|
-
preconditions: whenSheetEditorFocused
|
|
354
|
-
}, menuSchema = {
|
|
355
|
-
[RibbonStartGroup.OTHERS]: {
|
|
356
|
-
[ToggleSheetCommentPanelOperation.id]: {
|
|
357
|
-
order: 1,
|
|
358
|
-
menuItemFactory: threadPanelMenuFactory
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
[ContextMenuPosition.MAIN_AREA]: {
|
|
362
|
-
[ContextMenuGroup.OTHERS]: {
|
|
363
|
-
[ShowAddSheetCommentModalOperation.id]: {
|
|
364
|
-
order: 0,
|
|
365
|
-
menuItemFactory: threadCommentMenuFactory
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
371
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
372
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
373
|
-
return kind && result && __defProp$5(target, key, result), result;
|
|
374
|
-
}, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$5"), _a3;
|
|
375
|
-
let SheetsThreadCommentController = (_a3 = class extends Disposable {
|
|
376
|
-
constructor(_menuManagerService, _componentManager, _shortcutService) {
|
|
377
|
-
super(), this._menuManagerService = _menuManagerService, this._componentManager = _componentManager, this._shortcutService = _shortcutService, this._initMenu(), this._initShortcut(), this._initComponent();
|
|
378
|
-
}
|
|
379
|
-
_initShortcut() {
|
|
380
|
-
this._shortcutService.registerShortcut(AddCommentShortcut);
|
|
381
|
-
}
|
|
382
|
-
_initMenu() {
|
|
383
|
-
this._menuManagerService.mergeMenu(menuSchema);
|
|
384
|
-
}
|
|
385
|
-
_initComponent() {
|
|
386
|
-
[
|
|
387
|
-
[SHEETS_THREAD_COMMENT_MODAL, SheetsThreadCommentCell],
|
|
388
|
-
[THREAD_COMMENT_PANEL, SheetsThreadCommentPanel],
|
|
389
|
-
[COMMENT_SINGLE_ICON, CommentSingle]
|
|
390
|
-
].forEach(([key, comp]) => {
|
|
391
|
-
this._componentManager.register(key, comp);
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
}, __name(_a3, "SheetsThreadCommentController"), _a3);
|
|
395
|
-
SheetsThreadCommentController = __decorateClass$5([
|
|
396
|
-
OnLifecycle(LifecycleStages.Starting, SheetsThreadCommentController),
|
|
397
|
-
__decorateParam$5(0, IMenuManagerService),
|
|
398
|
-
__decorateParam$5(1, Inject(ComponentManager)),
|
|
399
|
-
__decorateParam$5(2, IShortcutService)
|
|
400
|
-
], SheetsThreadCommentController);
|
|
401
|
-
var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
402
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
403
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
404
|
-
return kind && result && __defProp$4(target, key, result), result;
|
|
405
|
-
}, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$4");
|
|
406
|
-
const transformRef = /* @__PURE__ */ __name((ref, source, target) => {
|
|
407
|
-
const refObj = singleReferenceToGrid(ref), offsetRow = target.row - source.row, offsetCol = target.column - source.column, targetRange = {
|
|
408
|
-
startColumn: refObj.column + offsetCol,
|
|
409
|
-
startRow: refObj.row + offsetRow,
|
|
410
|
-
endColumn: refObj.column + offsetCol,
|
|
411
|
-
endRow: refObj.row + offsetRow
|
|
412
|
-
};
|
|
413
|
-
return serializeRange(targetRange);
|
|
414
|
-
}, "transformRef");
|
|
415
|
-
var _a4;
|
|
416
|
-
let SheetsThreadCommentCopyPasteController = (_a4 = class extends Disposable {
|
|
417
|
-
constructor(_sheetClipboardService, _sheetsThreadCommentModel, _threadCommentDataSourceService) {
|
|
418
|
-
super();
|
|
419
|
-
__publicField(this, "_copyInfo");
|
|
420
|
-
this._sheetClipboardService = _sheetClipboardService, this._sheetsThreadCommentModel = _sheetsThreadCommentModel, this._threadCommentDataSourceService = _threadCommentDataSourceService, this._initClipboardHook();
|
|
421
|
-
}
|
|
422
|
-
// eslint-disable-next-line max-lines-per-function
|
|
423
|
-
_initClipboardHook() {
|
|
424
|
-
this.disposeWithMe(
|
|
425
|
-
this._sheetClipboardService.addClipboardHook({
|
|
426
|
-
id: SHEETS_THREAD_COMMENT,
|
|
427
|
-
onBeforeCopy: /* @__PURE__ */ __name((unitId, subUnitId, range) => {
|
|
428
|
-
this._copyInfo = {
|
|
429
|
-
unitId,
|
|
430
|
-
subUnitId,
|
|
431
|
-
range
|
|
432
|
-
};
|
|
433
|
-
}, "onBeforeCopy"),
|
|
434
|
-
// eslint-disable-next-line max-lines-per-function
|
|
435
|
-
onPasteCells: /* @__PURE__ */ __name((_pasteFrom, pasteTo, _data, payload) => {
|
|
436
|
-
const { unitId: targetUnitId, subUnitId: targetSubUnitId, range } = pasteTo, targetPos = {
|
|
437
|
-
row: range.rows[0],
|
|
438
|
-
column: range.cols[0]
|
|
439
|
-
};
|
|
440
|
-
if (payload.copyType === COPY_TYPE.CUT && this._copyInfo) {
|
|
441
|
-
const { range: range2, unitId: sourceUnitId, subUnitId: sourceSubUnitId } = this._copyInfo, sourcePos = {
|
|
442
|
-
row: range2.startRow,
|
|
443
|
-
column: range2.startColumn
|
|
444
|
-
};
|
|
445
|
-
if (!(targetUnitId === sourceUnitId && targetSubUnitId === sourceSubUnitId)) {
|
|
446
|
-
const roots = [];
|
|
447
|
-
Range.foreach(range2, (row, col) => {
|
|
448
|
-
const comments = this._sheetsThreadCommentModel.getAllByLocation(sourceUnitId, sourceSubUnitId, row, col);
|
|
449
|
-
this._threadCommentDataSourceService.syncUpdateMutationToColla ? comments.forEach((comment) => {
|
|
450
|
-
roots.push(comment);
|
|
451
|
-
}) : comments.forEach(({ children, ...comment }) => {
|
|
452
|
-
comment.parentId || roots.push(comment);
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
const sourceRedos = [], sourceUndos = [], targetRedos = [], targetUndos = [], handleCommentItem = /* @__PURE__ */ __name((item) => {
|
|
456
|
-
sourceRedos.unshift({
|
|
457
|
-
id: DeleteCommentMutation.id,
|
|
458
|
-
params: {
|
|
459
|
-
unitId: sourceUnitId,
|
|
460
|
-
subUnitId: sourceSubUnitId,
|
|
461
|
-
commentId: item.id
|
|
462
|
-
}
|
|
463
|
-
}), targetRedos.push({
|
|
464
|
-
id: AddCommentMutation.id,
|
|
465
|
-
params: {
|
|
466
|
-
unitId: targetUnitId,
|
|
467
|
-
subUnitId: targetSubUnitId,
|
|
468
|
-
comment: {
|
|
469
|
-
...item,
|
|
470
|
-
ref: transformRef(item.ref, sourcePos, targetPos),
|
|
471
|
-
unitId: targetUnitId,
|
|
472
|
-
subUnitId: targetSubUnitId
|
|
473
|
-
},
|
|
474
|
-
sync: !0
|
|
475
|
-
}
|
|
476
|
-
}), sourceUndos.push({
|
|
477
|
-
id: AddCommentMutation.id,
|
|
478
|
-
params: {
|
|
479
|
-
unitId: sourceUnitId,
|
|
480
|
-
subUnitId: sourceSubUnitId,
|
|
481
|
-
comment: item,
|
|
482
|
-
sync: !0
|
|
483
|
-
}
|
|
484
|
-
}), targetUndos.unshift({
|
|
485
|
-
id: DeleteCommentMutation.id,
|
|
486
|
-
params: {
|
|
487
|
-
unitId: targetUnitId,
|
|
488
|
-
subUnitId: targetSubUnitId,
|
|
489
|
-
commentId: item.id
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
}, "handleCommentItem");
|
|
493
|
-
return roots.forEach((root) => {
|
|
494
|
-
handleCommentItem(root);
|
|
495
|
-
}), {
|
|
496
|
-
redos: [...sourceRedos, ...targetRedos],
|
|
497
|
-
undos: [...targetUndos, ...sourceUndos]
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return {
|
|
502
|
-
redos: [],
|
|
503
|
-
undos: []
|
|
504
|
-
};
|
|
505
|
-
}, "onPasteCells")
|
|
506
|
-
})
|
|
507
|
-
);
|
|
508
|
-
}
|
|
509
|
-
}, __name(_a4, "SheetsThreadCommentCopyPasteController"), _a4);
|
|
510
|
-
SheetsThreadCommentCopyPasteController = __decorateClass$4([
|
|
511
|
-
OnLifecycle(LifecycleStages.Rendered, SheetsThreadCommentCopyPasteController),
|
|
512
|
-
__decorateParam$4(0, Inject(ISheetClipboardService)),
|
|
513
|
-
__decorateParam$4(1, Inject(SheetsThreadCommentModel)),
|
|
514
|
-
__decorateParam$4(2, IThreadCommentDataSourceService)
|
|
515
|
-
], SheetsThreadCommentCopyPasteController);
|
|
516
|
-
var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
517
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
518
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
519
|
-
return kind && result && __defProp$3(target, key, result), result;
|
|
520
|
-
}, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$3"), _a5;
|
|
521
|
-
let SheetsThreadCommentHoverController = (_a5 = class extends Disposable {
|
|
522
|
-
constructor(_hoverManagerService, _sheetsThreadCommentPopupService, _sheetsThreadCommentModel, _sheetPermissionInterceptorBaseController) {
|
|
523
|
-
super(), this._hoverManagerService = _hoverManagerService, this._sheetsThreadCommentPopupService = _sheetsThreadCommentPopupService, this._sheetsThreadCommentModel = _sheetsThreadCommentModel, this._sheetPermissionInterceptorBaseController = _sheetPermissionInterceptorBaseController, this._initHoverEvent();
|
|
524
|
-
}
|
|
525
|
-
_initHoverEvent() {
|
|
526
|
-
this.disposeWithMe(
|
|
527
|
-
this._hoverManagerService.currentCell$.pipe(debounceTime(100)).subscribe((cell) => {
|
|
528
|
-
const currentPopup = this._sheetsThreadCommentPopupService.activePopup;
|
|
529
|
-
if (cell && (currentPopup && currentPopup.temp || !currentPopup)) {
|
|
530
|
-
const { location } = cell, { unitId, subUnitId, row, col } = location, commentId = this._sheetsThreadCommentModel.getByLocation(unitId, subUnitId, row, col);
|
|
531
|
-
if (commentId) {
|
|
532
|
-
if (!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
533
|
-
workbookTypes: [WorkbookCommentPermission],
|
|
534
|
-
worksheetTypes: [WorksheetViewPermission],
|
|
535
|
-
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
536
|
-
}, [{ startRow: row, startColumn: col, endRow: row, endColumn: col }]))
|
|
537
|
-
return;
|
|
538
|
-
const comment = this._sheetsThreadCommentModel.getComment(unitId, subUnitId, commentId);
|
|
539
|
-
comment && !comment.resolved && this._sheetsThreadCommentPopupService.showPopup({
|
|
540
|
-
unitId,
|
|
541
|
-
subUnitId,
|
|
542
|
-
row,
|
|
543
|
-
col,
|
|
544
|
-
commentId,
|
|
545
|
-
temp: !0
|
|
546
|
-
});
|
|
547
|
-
} else
|
|
548
|
-
currentPopup && this._sheetsThreadCommentPopupService.hidePopup();
|
|
549
|
-
}
|
|
550
|
-
})
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
}, __name(_a5, "SheetsThreadCommentHoverController"), _a5);
|
|
554
|
-
SheetsThreadCommentHoverController = __decorateClass$3([
|
|
555
|
-
OnLifecycle(LifecycleStages.Rendered, SheetsThreadCommentHoverController),
|
|
556
|
-
__decorateParam$3(0, Inject(HoverManagerService)),
|
|
557
|
-
__decorateParam$3(1, Inject(SheetsThreadCommentPopupService)),
|
|
558
|
-
__decorateParam$3(2, Inject(SheetsThreadCommentModel)),
|
|
559
|
-
__decorateParam$3(3, Inject(SheetPermissionInterceptorBaseController))
|
|
560
|
-
], SheetsThreadCommentHoverController);
|
|
561
|
-
var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
562
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
563
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
564
|
-
return kind && result && __defProp$2(target, key, result), result;
|
|
565
|
-
}, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a6;
|
|
566
|
-
let SheetsThreadCommentPopupController = (_a6 = class extends Disposable {
|
|
567
|
-
constructor(_commandService, _sheetsThreadCommentPopupService, _sheetsThreadCommentModel, _threadCommentPanelService, _univerInstanceService, _sheetPermissionInterceptorBaseController, _markSelectionService, _sheetSelectionService, _editorBridgeService) {
|
|
568
|
-
super();
|
|
569
|
-
__publicField(this, "_isSwitchToCommenting", !1);
|
|
570
|
-
__publicField(this, "_selectionShapeInfo", null);
|
|
571
|
-
this._commandService = _commandService, this._sheetsThreadCommentPopupService = _sheetsThreadCommentPopupService, this._sheetsThreadCommentModel = _sheetsThreadCommentModel, this._threadCommentPanelService = _threadCommentPanelService, this._univerInstanceService = _univerInstanceService, this._sheetPermissionInterceptorBaseController = _sheetPermissionInterceptorBaseController, this._markSelectionService = _markSelectionService, this._sheetSelectionService = _sheetSelectionService, this._editorBridgeService = _editorBridgeService, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
|
|
572
|
-
}
|
|
573
|
-
_handleSelectionChange(selections, unitId, subUnitId) {
|
|
574
|
-
var _a9, _b;
|
|
575
|
-
const range = (_a9 = selections[0]) == null ? void 0 : _a9.range;
|
|
576
|
-
if (!range)
|
|
577
|
-
return;
|
|
578
|
-
if (((_b = range.rangeType) != null ? _b : RANGE_TYPE.NORMAL) !== RANGE_TYPE.NORMAL || range.endColumn - range.startColumn > 0 || range.endRow - range.startRow > 0) {
|
|
579
|
-
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(SetActiveCommentOperation.id);
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
const row = range.startRow, col = range.startColumn;
|
|
583
|
-
if (!this._sheetsThreadCommentModel.showCommentMarker(unitId, subUnitId, row, col)) {
|
|
584
|
-
this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(SetActiveCommentOperation.id);
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
|
-
const commentId = this._sheetsThreadCommentModel.getByLocation(unitId, subUnitId, row, col);
|
|
588
|
-
commentId && this._commandService.executeCommand(SetActiveCommentOperation.id, {
|
|
589
|
-
unitId,
|
|
590
|
-
subUnitId,
|
|
591
|
-
commentId
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
_initSelectionUpdateListener() {
|
|
595
|
-
this.disposeWithMe(
|
|
596
|
-
this._sheetSelectionService.selectionMoveEnd$.subscribe((selections) => {
|
|
597
|
-
if (this._isSwitchToCommenting)
|
|
598
|
-
return;
|
|
599
|
-
const current = this._sheetSelectionService.currentSelectionParam;
|
|
600
|
-
current && this._handleSelectionChange(selections, current.unitId, current.sheetId);
|
|
601
|
-
})
|
|
602
|
-
);
|
|
603
|
-
}
|
|
604
|
-
_initEditorBridge() {
|
|
605
|
-
this.disposeWithMe(
|
|
606
|
-
this._editorBridgeService.visible$.subscribe((visible) => {
|
|
607
|
-
visible.visible && this._sheetsThreadCommentPopupService.hidePopup();
|
|
608
|
-
})
|
|
609
|
-
);
|
|
610
|
-
}
|
|
611
|
-
_initCommandListener() {
|
|
612
|
-
this._commandService.onCommandExecuted((commandInfo) => {
|
|
613
|
-
if (commandInfo.id === DeleteCommentMutation.id) {
|
|
614
|
-
const params = commandInfo.params, active = this._sheetsThreadCommentPopupService.activePopup;
|
|
615
|
-
if (!active)
|
|
616
|
-
return;
|
|
617
|
-
const { unitId, subUnitId, commentId } = active;
|
|
618
|
-
params.unitId === unitId && params.subUnitId === subUnitId && params.commentId === commentId && this._sheetsThreadCommentPopupService.hidePopup();
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
_initPanelListener() {
|
|
623
|
-
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async (commentInfo) => {
|
|
624
|
-
var _a9;
|
|
625
|
-
if (commentInfo) {
|
|
626
|
-
const { unitId, subUnitId, commentId, trigger } = commentInfo, comment = this._sheetsThreadCommentModel.getComment(unitId, subUnitId, commentId);
|
|
627
|
-
if (!comment || comment.resolved)
|
|
628
|
-
return;
|
|
629
|
-
const currentUnit = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
630
|
-
if (!currentUnit || currentUnit.getUnitId() !== unitId)
|
|
631
|
-
return;
|
|
632
|
-
this._isSwitchToCommenting = !0, ((_a9 = currentUnit.getActiveSheet()) == null ? void 0 : _a9.getSheetId()) !== subUnitId && await this._commandService.executeCommand(SetWorksheetActiveOperation.id, {
|
|
633
|
-
unitId,
|
|
634
|
-
subUnitId
|
|
635
|
-
}), this._isSwitchToCommenting = !1;
|
|
636
|
-
const location = singleReferenceToGrid(comment.ref), { row, column: col } = location;
|
|
637
|
-
if (!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
638
|
-
workbookTypes: [WorkbookCommentPermission],
|
|
639
|
-
worksheetTypes: [WorksheetViewPermission],
|
|
640
|
-
rangeTypes: [RangeProtectionPermissionViewPoint]
|
|
641
|
-
}, [{ startRow: row, startColumn: col, endRow: row, endColumn: col }]))
|
|
642
|
-
return;
|
|
643
|
-
const GAP = 1;
|
|
644
|
-
if (await this._commandService.executeCommand(ScrollToRangeOperation.id, {
|
|
645
|
-
range: {
|
|
646
|
-
startRow: Math.max(location.row - GAP, 0),
|
|
647
|
-
endRow: location.row + GAP,
|
|
648
|
-
startColumn: Math.max(location.column - GAP, 0),
|
|
649
|
-
endColumn: location.column + GAP
|
|
650
|
-
}
|
|
651
|
-
}), this._editorBridgeService.isVisible().visible)
|
|
652
|
-
return;
|
|
653
|
-
this._sheetsThreadCommentPopupService.showPopup({
|
|
654
|
-
unitId,
|
|
655
|
-
subUnitId,
|
|
656
|
-
row: location.row,
|
|
657
|
-
col: location.column,
|
|
658
|
-
commentId: comment.id,
|
|
659
|
-
trigger
|
|
660
|
-
});
|
|
661
|
-
} else
|
|
662
|
-
this._sheetsThreadCommentPopupService.hidePopup();
|
|
663
|
-
}));
|
|
664
|
-
}
|
|
665
|
-
_initMarkSelection() {
|
|
666
|
-
this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(debounceTime(100)).subscribe((activeComment) => {
|
|
667
|
-
var _a9, _b;
|
|
668
|
-
if (!activeComment) {
|
|
669
|
-
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
const { unitId, subUnitId, commentId } = activeComment;
|
|
673
|
-
this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
|
|
674
|
-
const comment = this._sheetsThreadCommentModel.getComment(unitId, subUnitId, commentId);
|
|
675
|
-
if (!comment)
|
|
676
|
-
return;
|
|
677
|
-
const location = singleReferenceToGrid(comment.ref), { row, column } = location;
|
|
678
|
-
if (Number.isNaN(row) || Number.isNaN(column))
|
|
679
|
-
return null;
|
|
680
|
-
const worksheet = (_a9 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a9.getSheetBySheetId(subUnitId), mergeInfo = (_b = worksheet == null ? void 0 : worksheet.getMergedCell(row, column)) != null ? _b : {
|
|
681
|
-
startColumn: column,
|
|
682
|
-
endColumn: column,
|
|
683
|
-
startRow: row,
|
|
684
|
-
endRow: row
|
|
685
|
-
}, shapeId = this._markSelectionService.addShape(
|
|
686
|
-
{
|
|
687
|
-
range: mergeInfo,
|
|
688
|
-
style: {
|
|
689
|
-
hasAutoFill: !1,
|
|
690
|
-
fill: "rgb(255, 189, 55, 0.35)",
|
|
691
|
-
strokeWidth: 1,
|
|
692
|
-
stroke: "#FFBD37",
|
|
693
|
-
widgets: {}
|
|
694
|
-
},
|
|
695
|
-
primary: null
|
|
696
|
-
},
|
|
697
|
-
[],
|
|
698
|
-
-1
|
|
699
|
-
);
|
|
700
|
-
shapeId && (this._selectionShapeInfo = {
|
|
701
|
-
...activeComment,
|
|
702
|
-
shapeId
|
|
703
|
-
});
|
|
704
|
-
}));
|
|
705
|
-
}
|
|
706
|
-
}, __name(_a6, "SheetsThreadCommentPopupController"), _a6);
|
|
707
|
-
SheetsThreadCommentPopupController = __decorateClass$2([
|
|
708
|
-
OnLifecycle(LifecycleStages.Rendered, SheetsThreadCommentPopupController),
|
|
709
|
-
__decorateParam$2(0, ICommandService),
|
|
710
|
-
__decorateParam$2(1, Inject(SheetsThreadCommentPopupService)),
|
|
711
|
-
__decorateParam$2(2, Inject(SheetsThreadCommentModel)),
|
|
712
|
-
__decorateParam$2(3, Inject(ThreadCommentPanelService)),
|
|
713
|
-
__decorateParam$2(4, IUniverInstanceService),
|
|
714
|
-
__decorateParam$2(5, Inject(SheetPermissionInterceptorBaseController)),
|
|
715
|
-
__decorateParam$2(6, IMarkSelectionService),
|
|
716
|
-
__decorateParam$2(7, Inject(SheetsSelectionsService)),
|
|
717
|
-
__decorateParam$2(8, IEditorBridgeService)
|
|
718
|
-
], SheetsThreadCommentPopupController);
|
|
719
|
-
var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
720
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
721
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
722
|
-
return kind && result && __defProp$1(target, key, result), result;
|
|
723
|
-
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a7;
|
|
724
|
-
let ThreadCommentRemoveSheetsController = (_a7 = class extends Disposable {
|
|
725
|
-
constructor(_sheetInterceptorService, _univerInstanceService, _threadCommentModel, _threadCommentDataSourceService) {
|
|
726
|
-
super(), this._sheetInterceptorService = _sheetInterceptorService, this._univerInstanceService = _univerInstanceService, this._threadCommentModel = _threadCommentModel, this._threadCommentDataSourceService = _threadCommentDataSourceService, this._initSheetChange();
|
|
727
|
-
}
|
|
728
|
-
_initSheetChange() {
|
|
729
|
-
this.disposeWithMe(
|
|
730
|
-
this._sheetInterceptorService.interceptCommand({
|
|
731
|
-
getMutations: /* @__PURE__ */ __name((commandInfo) => {
|
|
732
|
-
var _a9;
|
|
733
|
-
if (commandInfo.id === RemoveSheetCommand.id) {
|
|
734
|
-
const params = commandInfo.params, workbook = params.unitId ? this._univerInstanceService.getUnit(params.unitId) : this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
735
|
-
if (!workbook)
|
|
736
|
-
return { redos: [], undos: [] };
|
|
737
|
-
const unitId = workbook.getUnitId(), subUnitId = params.subUnitId || ((_a9 = workbook.getActiveSheet()) == null ? void 0 : _a9.getSheetId());
|
|
738
|
-
if (!subUnitId)
|
|
739
|
-
return { redos: [], undos: [] };
|
|
740
|
-
const { commentMap } = this._threadCommentModel.ensureMap(unitId, subUnitId), comments = Array.from(Object.values(commentMap)).filter((comment) => !comment.parentId), ids = comments.map((comment) => comment.id), shouldSync = this._threadCommentDataSourceService.syncUpdateMutationToColla, redos = ids.map((id) => ({
|
|
741
|
-
id: DeleteCommentMutation.id,
|
|
742
|
-
params: {
|
|
743
|
-
unitId,
|
|
744
|
-
subUnitId,
|
|
745
|
-
commentId: id
|
|
746
|
-
}
|
|
747
|
-
})), undos = comments.map(({ children, ...comment }) => ({
|
|
748
|
-
id: AddCommentMutation.id,
|
|
749
|
-
params: {
|
|
750
|
-
unitId,
|
|
751
|
-
subUnitId,
|
|
752
|
-
comment: {
|
|
753
|
-
...comment,
|
|
754
|
-
children: shouldSync ? children : void 0
|
|
755
|
-
},
|
|
756
|
-
sync: !shouldSync
|
|
757
|
-
}
|
|
758
|
-
}));
|
|
759
|
-
return { redos, undos };
|
|
760
|
-
}
|
|
761
|
-
return { redos: [], undos: [] };
|
|
762
|
-
}, "getMutations")
|
|
763
|
-
})
|
|
764
|
-
);
|
|
765
|
-
}
|
|
766
|
-
}, __name(_a7, "ThreadCommentRemoveSheetsController"), _a7);
|
|
767
|
-
ThreadCommentRemoveSheetsController = __decorateClass$1([
|
|
768
|
-
OnLifecycle(LifecycleStages.Ready, ThreadCommentRemoveSheetsController),
|
|
769
|
-
__decorateParam$1(0, Inject(SheetInterceptorService)),
|
|
770
|
-
__decorateParam$1(1, IUniverInstanceService),
|
|
771
|
-
__decorateParam$1(2, Inject(ThreadCommentModel)),
|
|
772
|
-
__decorateParam$1(3, IThreadCommentDataSourceService)
|
|
773
|
-
], ThreadCommentRemoveSheetsController);
|
|
774
|
-
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) => {
|
|
775
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
776
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
777
|
-
return kind && result && __defProp2(target, key, result), result;
|
|
778
|
-
}, "__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"), _a8;
|
|
779
|
-
let UniverSheetsThreadCommentPlugin = (_a8 = class extends Plugin {
|
|
780
|
-
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
781
|
-
super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this._configService = _configService;
|
|
782
|
-
const { menu, ...rest } = this._config;
|
|
783
|
-
menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
|
|
784
|
-
}
|
|
785
|
-
onStarting() {
|
|
786
|
-
[
|
|
787
|
-
[SheetsThreadCommentController],
|
|
788
|
-
[SheetsThreadCommentRenderController],
|
|
789
|
-
[SheetsThreadCommentCopyPasteController],
|
|
790
|
-
[SheetsThreadCommentHoverController],
|
|
791
|
-
[ThreadCommentRemoveSheetsController],
|
|
792
|
-
[SheetsThreadCommentPopupController],
|
|
793
|
-
[SheetsThreadCommentPopupService]
|
|
794
|
-
].forEach((dep) => {
|
|
795
|
-
this._injector.add(dep);
|
|
796
|
-
}), [ShowAddSheetCommentModalOperation].forEach((command) => {
|
|
797
|
-
this._commandService.registerCommand(command);
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
}, __name(_a8, "UniverSheetsThreadCommentPlugin"), _a8);
|
|
801
|
-
__publicField2(UniverSheetsThreadCommentPlugin, "pluginName", SHEETS_THREAD_COMMENT);
|
|
802
|
-
__publicField2(UniverSheetsThreadCommentPlugin, "type", UniverInstanceType.UNIVER_SHEET);
|
|
803
|
-
UniverSheetsThreadCommentPlugin = __decorateClass([
|
|
804
|
-
DependentOn(UniverThreadCommentUIPlugin, UniverSheetsThreadCommentBasePlugin),
|
|
805
|
-
__decorateParam(1, Inject(Injector)),
|
|
806
|
-
__decorateParam(2, Inject(ICommandService)),
|
|
807
|
-
__decorateParam(3, IConfigService)
|
|
808
|
-
], UniverSheetsThreadCommentPlugin);
|
|
809
|
-
export {
|
|
810
|
-
AddCommentCommand,
|
|
811
|
-
DeleteCommentCommand,
|
|
812
|
-
DeleteCommentTreeCommand,
|
|
813
|
-
IThreadCommentDataSourceService2 as IThreadCommentDataSourceService,
|
|
814
|
-
IThreadCommentMentionDataService,
|
|
815
|
-
ResolveCommentCommand,
|
|
816
|
-
SHEETS_THREAD_COMMENT,
|
|
817
|
-
SheetsThreadCommentModel2 as SheetsThreadCommentModel,
|
|
818
|
-
SheetsThreadCommentPopupService,
|
|
819
|
-
ShowAddSheetCommentModalOperation,
|
|
820
|
-
UniverSheetsThreadCommentPlugin,
|
|
821
|
-
UniverThreadCommentUIPlugin2 as UniverThreadCommentUIPlugin,
|
|
822
|
-
UpdateCommentCommand
|
|
823
|
-
};
|
|
1
|
+
const _0x55ab5e=_0x2896;(function(_0x39ae96,_0x1bc6a0){const _0x4fe46e=_0x2896,_0x6d03a9=_0x39ae96();while(!![]){try{const _0x3440b9=-parseInt(_0x4fe46e(0x116))/0x1*(parseInt(_0x4fe46e(0x109))/0x2)+-parseInt(_0x4fe46e(0x162))/0x3+-parseInt(_0x4fe46e(0x1ad))/0x4+-parseInt(_0x4fe46e(0x12a))/0x5+parseInt(_0x4fe46e(0x10e))/0x6+parseInt(_0x4fe46e(0x197))/0x7+parseInt(_0x4fe46e(0x150))/0x8;if(_0x3440b9===_0x1bc6a0)break;else _0x6d03a9['push'](_0x6d03a9['shift']());}catch(_0x15bbe2){_0x6d03a9['push'](_0x6d03a9['shift']());}}}(_0x5dd9,0x76476));var __defProp=Object[_0x55ab5e(0x126)],__defNormalProp=(_0x495863,_0x8a629d,_0xb30998)=>_0x8a629d in _0x495863?__defProp(_0x495863,_0x8a629d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xb30998}):_0x495863[_0x8a629d]=_0xb30998,__name=(_0xaafe18,_0x4fddeb)=>__defProp(_0xaafe18,_0x55ab5e(0x10f),{'value':_0x4fddeb,'configurable':!0x0}),__publicField=(_0xc2c06f,_0x28bd84,_0x5b3a79)=>__defNormalProp(_0xc2c06f,typeof _0x28bd84!='symbol'?_0x28bd84+'':_0x28bd84,_0x5b3a79);import{Inject,Disposable,DisposableCollection,CommandType,IUniverInstanceService,InterceptorEffectEnum,UniverInstanceType,useDependency,Tools,ICommandService,Range,RANGE_TYPE,DependentOn,Injector,Plugin,IConfigService}from'@univerjs/core';import{SheetsSelectionsService,getSheetCommandTarget,SheetInterceptorService,INTERCEPTOR_POINT,WorkbookCommentPermission,WorksheetViewPermission,RangeProtectionPermissionViewPoint,SetWorksheetActiveOperation,RemoveSheetCommand}from'@univerjs/sheets';import{SheetsThreadCommentModel,UniverSheetsThreadCommentBasePlugin}from'@univerjs/sheets-thread-comment-base';import{SheetsThreadCommentModel as _0x1a43ec}from'@univerjs/sheets-thread-comment-base';import{ThreadCommentPanelService,ThreadCommentTree,ThreadCommentPanel,ToggleSheetCommentPanelOperation,THREAD_COMMENT_PANEL,SetActiveCommentOperation,UniverThreadCommentUIPlugin}from'@univerjs/thread-comment-ui';import{IThreadCommentMentionDataService,UniverThreadCommentUIPlugin as _0x486674}from'@univerjs/thread-comment-ui';import{SheetCanvasPopManagerService,IMarkSelectionService,whenSheetEditorFocused,getCurrentRangeDisable$,ISheetClipboardService,COPY_TYPE,HoverManagerService,SheetPermissionInterceptorBaseController,IEditorBridgeService,ScrollToRangeOperation}from'@univerjs/sheets-ui';import{IZenZoneService,useObservable,KeyCode,MetaKeys,MenuItemType,getMenuHiddenObservable,RibbonStartGroup,ContextMenuPosition,ContextMenuGroup,ComponentManager,IMenuManagerService,IShortcutService}from'@univerjs/ui';import{BehaviorSubject,debounceTime,map}from'rxjs';import{IRenderManagerService}from'@univerjs/engine-render';import _0x457d9c,{forwardRef,useRef,createElement,useMemo,useCallback,useEffect}from'react';function _0x5dd9(){const _0x2e0297=['transformRef','_canvasPopupManagerService','_initShortcut','_markSelectionService','filter','__decorateClass$6','_initHoverEvent','commentUpdate$','927352hCfxmB','idSuffix','type','_sheetSelectionService','_zenZoneService','activePopup','__decorateParam$1','concat','onRendered','subscribe','_selectionShapeInfo','col','__decorateParam$5','CUT','handleAdd','interceptCommand','context-menu','trim','MAIN_AREA','handleResolve','_configService','apply','onBeforeCopy','column','removeShape','querySelectorAll','toString','_commandService','__decorateClass$1','makeForceDirty','persistPopup','dispose','className','_handleSelectionChange','onClick','rgb(255,\x20189,\x2055,\x200.35)','#FFBD37','sheets-thread-comment.config','_initCommandListener','replaceRuntimeIdsAndExtInAttrs','_sheetClipboardService','next','endColumn','getSubUnitName','function','__decorateClass$3','propertyIsEnumerable','visible$','selectionMoveEnd$','_sheetsThreadCommentPopupService','getSheetBySheetId','displayName','univer.sheet.thread-comment-modal','length','addClipboardHook','__decorateClass$5','sheetThreadComment.menu.commentManagement','entries','push','getActiveSheet','onStarting','range','evenodd','panelVisible$','markSkeletonDirty','row','__decorateClass$7','ALT','startRow','symbol','threadPanelMenuFactory','hasOwnProperty','_univerInstanceService','_initClipboardHook','intercept','sheetThreadComment.menu.addComment','_editorBridgeService','1em','359702cjYLBF','children','_lastPopup','SheetsThreadCommentPanel','visible','2357070hgfOcA','name','addShape','_initEditorBridge','disposeWithMe','rangeType','registerCommand','executeCommand','3YYXkZD','activeCommentId$','handler','_injector','startColumn','_copyInfo','_initSelectionUpdateListener','chatAtABC','none','tag','pluginName','__publicField','add','extend','registerShortcut','defIds','defineProperty','url(#$1','getUnitId','_config','2010000EKuJJg','get','sort','__decorateParam$6','M5.83725\x206.78345C6.22188\x206.78345\x206.53368\x207.10742\x206.53368\x207.50706V8.41159C6.53368\x208.81123\x206.22188\x209.13521\x205.83725\x209.13521C5.45263\x209.13521\x205.14082\x208.81123\x205.14082\x208.41159V7.50706C5.14082\x207.10742\x205.45263\x206.78345\x205.83725\x206.78345ZM8.73904\x206.78345C9.12366\x206.78345\x209.43546\x207.10742\x209.43546\x207.50706V8.41159C9.43546\x208.81123\x209.12366\x209.13521\x208.73904\x209.13521C8.35441\x209.13521\x208.04261\x208.81123\x208.04261\x208.41159V7.50706C8.04261\x207.10742\x208.35441\x206.78345\x208.73904\x206.78345ZM11.6408\x206.78345C12.0254\x206.78345\x2012.3372\x207.10742\x2012.3372\x207.50706V8.41159C12.3372\x208.81123\x2012.0254\x209.13521\x2011.6408\x209.13521C11.2562\x209.13521\x2010.9444\x208.81123\x2010.9444\x208.41159V7.50706C10.9444\x207.10742\x2011.2562\x206.78345\x2011.6408\x206.78345Z','currentColor','_threadCommentModel','parentId','getSheetId','UNIVER_SHEET','prototype','OTHERS','path','assign','endRow','foreach','_activePopup','values','syncUpdateMutationToColla','showPopup','fill','getUnit','SheetsThreadCommentHoverController','_initMarkSelection','getRenderById','current','_initMenu','string','render','activeSheet$','icon','getName','resolved','_isSwitchToCommenting','mainComponent','getMutations','unitId','NORMAL','14148120GEDlBF','forEach','__decorateParam$7','__decorateClass$2','[SheetsThreadCommentPopupService]:\x20cannot\x20show\x20popup!','SHEET_THREAD_COMMENT','onClickOutside','getOwnPropertySymbols','_threadCommentPanelService','from','activePopup$','SheetsThreadCommentRenderController','_activePopup$','handleHover','getMergedCell','_initComponent','getOwnPropertyDescriptor','getComment','2742966kvBmjN','Style','primary','_componentManager','params','thread-comment-add','svg','max','SheetsThreadCommentCopyPasteController','indexOf','createElement','_hoverManagerService','ref','_initSkeletonChange','currentSelectionParam','subUnitId','mergeMenu','OPERATION','getCurrentUnitForType','__decorateParam$4','permissionCheckWithRanges','call','comment-single','attrs','handleCommentItem','commentId','activeCommentId','ThreadCommentRemoveSheetsController','SheetsThreadCommentPopupController','shapeId','__decorateClass$4','hidePopup','_sheetInterceptorService','_initZenVisible','temp','register','_initSheetChange','_sheetsThreadCommentModel','asObservable','markers','onReady','UniverSheetsThreadCommentPlugin','_threadCommentDataSourceService','copyType','__decorateClass','_sheetPermissionInterceptorBaseController','CTRL_COMMAND','_renderManagerService','BUTTON','xlink:href','random','_shortcutService','_initPanelListener','2875761Yhpyoh','substring','CommentSingle','getByLocation','setActiveComment','CELL_CONTENT','isNaN','onCommandExecuted','map','currentCell$','sheetId','isVisible','_menuManagerService','pipe'];_0x5dd9=function(){return _0x2e0297;};return _0x5dd9();}import{singleReferenceToGrid,serializeRange}from'@univerjs/engine-formula';import{IThreadCommentDataSourceService,DeleteCommentMutation,AddCommentMutation,ThreadCommentModel}from'@univerjs/thread-comment';import{AddCommentCommand,DeleteCommentCommand,DeleteCommentTreeCommand,IThreadCommentDataSourceService as _0x3bff75,ResolveCommentCommand,UpdateCommentCommand}from'@univerjs/thread-comment';const SHEETS_THREAD_COMMENT_MODAL=_0x55ab5e(0xef),COMMENT_SINGLE_ICON='comment-single',SHEETS_THREAD_COMMENT=_0x55ab5e(0x155);var __defProp$7=Object[_0x55ab5e(0x126)],__getOwnPropDesc$7=Object[_0x55ab5e(0x160)],__decorateClass$7=__name((_0x482948,_0x2eb8d5,_0x453ae5,_0x39dde7)=>{const _0x414298=_0x55ab5e;for(var _0x2ce2ee=_0x39dde7>0x1?void 0x0:_0x39dde7?__getOwnPropDesc$7(_0x2eb8d5,_0x453ae5):_0x2eb8d5,_0x19101c=_0x482948[_0x414298(0xf0)]-0x1,_0x4f150e;_0x19101c>=0x0;_0x19101c--)(_0x4f150e=_0x482948[_0x19101c])&&(_0x2ce2ee=(_0x39dde7?_0x4f150e(_0x2eb8d5,_0x453ae5,_0x2ce2ee):_0x4f150e(_0x2ce2ee))||_0x2ce2ee);return _0x39dde7&&_0x2ce2ee&&__defProp$7(_0x2eb8d5,_0x453ae5,_0x2ce2ee),_0x2ce2ee;},_0x55ab5e(0xfd)),__decorateParam$7=__name((_0x3271b0,_0x3b9c80)=>(_0x234476,_0x53e475)=>_0x3b9c80(_0x234476,_0x53e475,_0x3271b0),_0x55ab5e(0x152)),_a;let SheetsThreadCommentPopupService=(_a=class extends Disposable{constructor(_0x442fa6,_0x1a6b26){const _0x2c0d81=_0x55ab5e;super(),__publicField(this,_0x2c0d81(0x10b),null),__publicField(this,_0x2c0d81(0x13a)),__publicField(this,_0x2c0d81(0x15c),new BehaviorSubject(null)),__publicField(this,_0x2c0d81(0x15a),this[_0x2c0d81(0x15c)][_0x2c0d81(0x188)]()),(this[_0x2c0d81(0x1a6)]=_0x442fa6,this[_0x2c0d81(0x1b1)]=_0x1a6b26,this[_0x2c0d81(0x183)](),this[_0x2c0d81(0x112)](()=>{const _0x261e8a=_0x2c0d81;this[_0x261e8a(0x15c)]['complete']();}));}get[_0x55ab5e(0x1b2)](){const _0x3b5241=_0x55ab5e;return this[_0x3b5241(0x13a)];}[_0x55ab5e(0x183)](){const _0x238ebd=_0x55ab5e;this[_0x238ebd(0x112)](this[_0x238ebd(0x1b1)][_0x238ebd(0xea)]['subscribe'](_0x18bbb7=>{const _0xd7f8ef=_0x238ebd;_0x18bbb7&&this[_0xd7f8ef(0x181)]();}));}['showPopup'](_0x28f282,_0x463af1){const _0x394d65=_0x55ab5e;var _0x392088;const {row:_0x4006c8,col:_0x29f152,unitId:_0x1f9458,subUnitId:_0x1b87b5}=_0x28f282;if(this[_0x394d65(0x13a)]&&_0x4006c8===this[_0x394d65(0x13a)][_0x394d65(0xfc)]&&_0x29f152===this[_0x394d65(0x13a)][_0x394d65(0x1b8)]&&_0x1f9458===this[_0x394d65(0x13a)]['unitId']&&_0x1b87b5===((_0x392088=this[_0x394d65(0x1b2)])==null?void 0x0:_0x392088['subUnitId'])){this[_0x394d65(0x13a)]=_0x28f282,this[_0x394d65(0x15c)]['next'](_0x28f282);return;}if(this[_0x394d65(0x10b)]&&this['_lastPopup']['dispose'](),this['_zenZoneService'][_0x394d65(0x10d)])return;this[_0x394d65(0x13a)]=_0x28f282,this[_0x394d65(0x15c)][_0x394d65(0xe4)](_0x28f282);const _0x578290=this[_0x394d65(0x1a6)]['attachPopupToCell'](_0x4006c8,_0x29f152,{'componentKey':SHEETS_THREAD_COMMENT_MODAL,'onClickOutside':__name(()=>{const _0x2d2058=_0x394d65;this[_0x2d2058(0x181)]();},_0x394d65(0x156)),'direction':'horizontal','excludeOutside':[...Array[_0x394d65(0x159)](document[_0x394d65(0x1c6)]('.univer-thread-comment')),document['getElementById'](_0x394d65(0x167))]['filter'](Boolean)});if(!_0x578290)throw new Error(_0x394d65(0x154));const _0x29ebd9=new DisposableCollection();_0x29ebd9[_0x394d65(0x122)](_0x578290),_0x29ebd9[_0x394d65(0x122)]({'dispose':__name(()=>{_0x463af1==null||_0x463af1();},_0x394d65(0xda))}),this[_0x394d65(0x10b)]=_0x29ebd9;}[_0x55ab5e(0x181)](){const _0x408912=_0x55ab5e;this[_0x408912(0x13a)]&&(this[_0x408912(0x10b)]&&this['_lastPopup'][_0x408912(0xda)](),this['_lastPopup']=null,this[_0x408912(0x13a)]=null,this[_0x408912(0x15c)][_0x408912(0xe4)](null));}[_0x55ab5e(0x1cb)](){const _0x8d0658=_0x55ab5e;!this['_activePopup']||!this['_activePopup'][_0x8d0658(0x184)]||(this['_activePopup']={...this[_0x8d0658(0x13a)],'temp':!0x1},this['_activePopup$'][_0x8d0658(0xe4)](this[_0x8d0658(0x13a)]));}},__name(_a,'SheetsThreadCommentPopupService'),_a);SheetsThreadCommentPopupService=__decorateClass$7([__decorateParam$7(0x0,Inject(SheetCanvasPopManagerService)),__decorateParam$7(0x1,IZenZoneService)],SheetsThreadCommentPopupService);const ShowAddSheetCommentModalOperation={'type':CommandType[_0x55ab5e(0x173)],'id':'sheets.operation.show-comment-modal','handler'(_0x383877){const _0x53f399=_0x55ab5e;var _0x173cb7;const _0x56ec16=_0x383877[_0x53f399(0x12b)](SheetsSelectionsService),_0x4c1875=_0x383877['get'](IUniverInstanceService),_0x421942=_0x383877['get'](SheetsThreadCommentPopupService),_0x2caeb9=_0x383877[_0x53f399(0x12b)](ThreadCommentPanelService),_0x3e17e3=(_0x173cb7=_0x56ec16['getCurrentLastSelection']())==null?void 0x0:_0x173cb7[_0x53f399(0x164)],_0x133f2f=_0x383877['get'](SheetsThreadCommentModel);if(!_0x3e17e3)return!0x1;const _0x9ead5b=getSheetCommandTarget(_0x4c1875);if(!_0x9ead5b)return!0x1;const {workbook:_0x52983f,worksheet:_0x201a5d,unitId:_0x3cac43,subUnitId:_0x1a3b61}=_0x9ead5b,_0x193660={'workbook':_0x52983f,'worksheet':_0x201a5d,'unitId':_0x3cac43,'subUnitId':_0x1a3b61,'row':_0x3e17e3[_0x53f399(0xff)],'col':_0x3e17e3['startColumn']};_0x421942[_0x53f399(0x13d)](_0x193660);const _0x35f64e=_0x133f2f[_0x53f399(0x19a)](_0x3cac43,_0x1a3b61,_0x3e17e3['startRow'],_0x3e17e3[_0x53f399(0x11a)]);return _0x35f64e&&_0x2caeb9[_0x53f399(0x19b)]({'unitId':_0x3cac43,'subUnitId':_0x1a3b61,'commentId':_0x35f64e,'trigger':'context-menu'}),!0x0;}},PLUGIN_CONFIG_KEY=_0x55ab5e(0xe0),defaultPluginConfig={};var __defProp$6=Object[_0x55ab5e(0x126)],__getOwnPropDesc$6=Object[_0x55ab5e(0x160)],__decorateClass$6=__name((_0x3b057f,_0x5be897,_0x356c0e,_0x4943bd)=>{const _0x2da859=_0x55ab5e;for(var _0x23ab86=_0x4943bd>0x1?void 0x0:_0x4943bd?__getOwnPropDesc$6(_0x5be897,_0x356c0e):_0x5be897,_0x3ef7ac=_0x3b057f[_0x2da859(0xf0)]-0x1,_0x50d067;_0x3ef7ac>=0x0;_0x3ef7ac--)(_0x50d067=_0x3b057f[_0x3ef7ac])&&(_0x23ab86=(_0x4943bd?_0x50d067(_0x5be897,_0x356c0e,_0x23ab86):_0x50d067(_0x23ab86))||_0x23ab86);return _0x4943bd&&_0x23ab86&&__defProp$6(_0x5be897,_0x356c0e,_0x23ab86),_0x23ab86;},_0x55ab5e(0x1aa)),__decorateParam$6=__name((_0x18285d,_0x1208f9)=>(_0x52ac7d,_0x205bf3)=>_0x1208f9(_0x52ac7d,_0x205bf3,_0x18285d),_0x55ab5e(0x12d)),_a2;let SheetsThreadCommentRenderController=(_a2=class extends Disposable{constructor(_0x1b1289,_0x1a4aff,_0x57560f,_0x49c153){const _0x53765c=_0x55ab5e;super(),this[_0x53765c(0x182)]=_0x1b1289,this[_0x53765c(0x187)]=_0x1a4aff,this[_0x53765c(0x103)]=_0x57560f,this['_renderManagerService']=_0x49c153,this['_initViewModelIntercept'](),this[_0x53765c(0x16f)]();}['_initViewModelIntercept'](){const _0xbf4e=_0x55ab5e;this[_0xbf4e(0x112)](this[_0xbf4e(0x182)][_0xbf4e(0x105)](INTERCEPTOR_POINT[_0xbf4e(0x19c)],{'effect':InterceptorEffectEnum[_0xbf4e(0x163)],'handler':__name((_0x52e6b6,_0x118dab,_0x497db0)=>{const _0x6247a2=_0xbf4e,{row:_0x5e2e92,col:_0x343aa1,unitId:_0x373142,subUnitId:_0x46d45d}=_0x118dab;return this[_0x6247a2(0x187)]['showCommentMarker'](_0x373142,_0x46d45d,_0x5e2e92,_0x343aa1)?_0x497db0({..._0x52e6b6,'markers':{..._0x52e6b6==null?void 0x0:_0x52e6b6[_0x6247a2(0x189)],'tr':{'color':_0x6247a2(0xdf),'size':0x6}}}):_0x497db0(_0x52e6b6);},_0xbf4e(0x118)),'priority':0x64}));}[_0x55ab5e(0x16f)](){const _0x47d7c4=_0x55ab5e,_0x36efeb=__name(()=>{const _0x1bea6f=_0x2896;var _0x2abe38;const _0x4e3ea6=this[_0x1bea6f(0x103)][_0x1bea6f(0x174)](UniverInstanceType[_0x1bea6f(0x133)]);if(!_0x4e3ea6)return;const _0x176c97=_0x4e3ea6[_0x1bea6f(0x128)](),_0x55a48a=this[_0x1bea6f(0x191)][_0x1bea6f(0x142)](_0x176c97);(_0x2abe38=_0x55a48a==null?void 0x0:_0x55a48a[_0x1bea6f(0x14c)])==null||_0x2abe38[_0x1bea6f(0x1ca)]();},_0x47d7c4(0xfb));this['disposeWithMe'](this[_0x47d7c4(0x187)]['commentUpdate$']['pipe'](debounceTime(0x10))['subscribe'](()=>{_0x36efeb();}));}},__name(_a2,_0x55ab5e(0x15b)),_a2);SheetsThreadCommentRenderController=__decorateClass$6([__decorateParam$6(0x0,Inject(SheetInterceptorService)),__decorateParam$6(0x1,Inject(SheetsThreadCommentModel)),__decorateParam$6(0x2,IUniverInstanceService),__decorateParam$6(0x3,IRenderManagerService)],SheetsThreadCommentRenderController);var __assign=function(){const _0xa7b462=_0x55ab5e;return __assign=Object[_0xa7b462(0x137)]||function(_0x2ba5a6){const _0x33bf06=_0xa7b462;for(var _0x55447d,_0x2e9b45=0x1,_0x49261b=arguments['length'];_0x2e9b45<_0x49261b;_0x2e9b45++){_0x55447d=arguments[_0x2e9b45];for(var _0x3ea024 in _0x55447d)Object['prototype'][_0x33bf06(0x102)]['call'](_0x55447d,_0x3ea024)&&(_0x2ba5a6[_0x3ea024]=_0x55447d[_0x3ea024]);}return _0x2ba5a6;},__assign[_0xa7b462(0x1c2)](this,arguments);},__rest=function(_0x4c3628,_0xaf8e22){const _0xa46065=_0x55ab5e;var _0x4b1b65={};for(var _0x9e46f7 in _0x4c3628)Object['prototype'][_0xa46065(0x102)]['call'](_0x4c3628,_0x9e46f7)&&_0xaf8e22[_0xa46065(0x16b)](_0x9e46f7)<0x0&&(_0x4b1b65[_0x9e46f7]=_0x4c3628[_0x9e46f7]);if(_0x4c3628!=null&&typeof Object[_0xa46065(0x157)]==_0xa46065(0xe7)){for(var _0x52e7d7=0x0,_0x9e46f7=Object[_0xa46065(0x157)](_0x4c3628);_0x52e7d7<_0x9e46f7[_0xa46065(0xf0)];_0x52e7d7++)_0xaf8e22['indexOf'](_0x9e46f7[_0x52e7d7])<0x0&&Object[_0xa46065(0x134)][_0xa46065(0xe9)][_0xa46065(0x177)](_0x4c3628,_0x9e46f7[_0x52e7d7])&&(_0x4b1b65[_0x9e46f7[_0x52e7d7]]=_0x4c3628[_0x9e46f7[_0x52e7d7]]);}return _0x4b1b65;},IconBase=forwardRef(function(_0x455c5b,_0x4c1d10){const _0x2b5ad5=_0x55ab5e;var _0x3f8de5=_0x455c5b[_0x2b5ad5(0x148)],_0x161dd6=_0x455c5b['id'],_0x39d9d5=_0x455c5b[_0x2b5ad5(0xdb)],_0x4df061=_0x455c5b[_0x2b5ad5(0x123)],_0x25af75=__rest(_0x455c5b,['icon','id','className',_0x2b5ad5(0x123)]),_0x261871='univerjs-icon\x20univerjs-icon-'[_0x2b5ad5(0x1b4)](_0x161dd6,'\x20')[_0x2b5ad5(0x1b4)](_0x39d9d5||'')[_0x2b5ad5(0x1be)](),_0x2f317c=useRef('_'[_0x2b5ad5(0x1b4)](generateShortUuid()));return render(_0x3f8de5,''[_0x2b5ad5(0x1b4)](_0x161dd6),{'defIds':_0x3f8de5[_0x2b5ad5(0x125)],'idSuffix':_0x2f317c[_0x2b5ad5(0x143)]},__assign({'ref':_0x4c1d10,'className':_0x261871},_0x25af75),_0x4df061);});function render(_0x521f9b,_0x2440ac,_0x5f2502,_0x1e7d61,_0x268ce3){const _0x1fa54d=_0x55ab5e;return createElement(_0x521f9b[_0x1fa54d(0x11f)],__assign(__assign({'key':_0x2440ac},replaceRuntimeIdsAndExtInAttrs(_0x521f9b,_0x5f2502,_0x268ce3)),_0x1e7d61),(replaceRuntimeIdsInDefs(_0x521f9b,_0x5f2502)[_0x1fa54d(0x10a)]||[])['map'](function(_0x4666f0,_0x7210f3){const _0x32c000=_0x1fa54d;return render(_0x4666f0,''[_0x32c000(0x1b4)](_0x2440ac,'-')[_0x32c000(0x1b4)](_0x521f9b[_0x32c000(0x11f)],'-')[_0x32c000(0x1b4)](_0x7210f3),_0x5f2502,void 0x0,_0x268ce3);}));}__name(render,_0x55ab5e(0x146));function replaceRuntimeIdsAndExtInAttrs(_0x5cc564,_0x40d81c,_0x1779ab){const _0x6b2c28=_0x55ab5e;var _0x4dd942=__assign({},_0x5cc564[_0x6b2c28(0x179)]);_0x1779ab!=null&&_0x1779ab['colorChannel1']&&_0x4dd942[_0x6b2c28(0x13e)]==='colorChannel1'&&(_0x4dd942[_0x6b2c28(0x13e)]=_0x1779ab['colorChannel1']);var _0x593d7f=_0x40d81c['defIds'];return!_0x593d7f||_0x593d7f[_0x6b2c28(0xf0)]===0x0||(_0x5cc564[_0x6b2c28(0x11f)]==='use'&&_0x4dd942[_0x6b2c28(0x193)]&&(_0x4dd942[_0x6b2c28(0x193)]=_0x4dd942['xlink:href']+_0x40d81c['idSuffix']),Object[_0x6b2c28(0xf4)](_0x4dd942)[_0x6b2c28(0x151)](function(_0x2c4173){const _0x4f0981=_0x6b2c28;var _0x158ed0=_0x2c4173[0x0],_0x30d050=_0x2c4173[0x1];typeof _0x30d050=='string'&&(_0x4dd942[_0x158ed0]=_0x30d050['replace'](/url\(#(.*)\)/,_0x4f0981(0x127)['concat'](_0x40d81c[_0x4f0981(0x1ae)],')')));})),_0x4dd942;}__name(replaceRuntimeIdsAndExtInAttrs,_0x55ab5e(0xe2));function replaceRuntimeIdsInDefs(_0x5b92e5,_0x1cd352){const _0x50e396=_0x55ab5e;var _0x51384b,_0x3ef688=_0x1cd352[_0x50e396(0x125)];return!_0x3ef688||_0x3ef688[_0x50e396(0xf0)]===0x0?_0x5b92e5:_0x5b92e5['tag']==='defs'&&(!((_0x51384b=_0x5b92e5[_0x50e396(0x10a)])===null||_0x51384b===void 0x0)&&_0x51384b[_0x50e396(0xf0)])?__assign(__assign({},_0x5b92e5),{'children':_0x5b92e5[_0x50e396(0x10a)][_0x50e396(0x19f)](function(_0xea9e89){const _0x3050ed=_0x50e396;return typeof _0xea9e89[_0x3050ed(0x179)]['id']==_0x3050ed(0x145)&&_0x3ef688&&_0x3ef688[_0x3050ed(0x16b)](_0xea9e89['attrs']['id'])>-0x1?__assign(__assign({},_0xea9e89),{'attrs':__assign(__assign({},_0xea9e89[_0x3050ed(0x179)]),{'id':_0xea9e89[_0x3050ed(0x179)]['id']+_0x1cd352[_0x3050ed(0x1ae)]})}):_0xea9e89;})}):_0x5b92e5;}__name(replaceRuntimeIdsInDefs,'replaceRuntimeIdsInDefs');function generateShortUuid(){const _0x4f044e=_0x55ab5e;return Math[_0x4f044e(0x194)]()[_0x4f044e(0x1c7)](0x24)[_0x4f044e(0x198)](0x2,0x8);}__name(generateShortUuid,'generateShortUuid'),IconBase[_0x55ab5e(0xee)]='UniverIcon';var element={'tag':_0x55ab5e(0x168),'attrs':{'fill':_0x55ab5e(0x11e),'viewBox':'0\x200\x2017\x2017','width':_0x55ab5e(0x108),'height':_0x55ab5e(0x108)},'children':[{'tag':'path','attrs':{'fill':'currentColor','d':_0x55ab5e(0x12e),'fillRule':'evenodd','clipRule':'evenodd'}},{'tag':_0x55ab5e(0x136),'attrs':{'fill':_0x55ab5e(0x12f),'d':'M5.83725\x206.78345C6.22188\x206.78345\x206.53368\x207.10742\x206.53368\x207.50706V8.41159C6.53368\x208.81123\x206.22188\x209.13521\x205.83725\x209.13521\x205.45263\x209.13521\x205.14082\x208.81123\x205.14082\x208.41159V7.50706C5.14082\x207.10742\x205.45263\x206.78345\x205.83725\x206.78345zM8.73904\x206.78345C9.12366\x206.78345\x209.43546\x207.10742\x209.43546\x207.50706V8.41159C9.43546\x208.81123\x209.12366\x209.13521\x208.73904\x209.13521\x208.35441\x209.13521\x208.04261\x208.81123\x208.04261\x208.41159V7.50706C8.04261\x207.10742\x208.35441\x206.78345\x208.73904\x206.78345zM11.6408\x206.78345C12.0254\x206.78345\x2012.3372\x207.10742\x2012.3372\x207.50706V8.41159C12.3372\x208.81123\x2012.0254\x209.13521\x2011.6408\x209.13521\x2011.2562\x209.13521\x2010.9444\x208.81123\x2010.9444\x208.41159V7.50706C10.9444\x207.10742\x2011.2562\x206.78345\x2011.6408\x206.78345z'}},{'tag':_0x55ab5e(0x136),'attrs':{'fill':_0x55ab5e(0x12f),'d':'M1.84351\x203.41861C1.84351\x203.01861\x202.15531\x202.69434\x202.53993\x202.69434H14.9381C15.3228\x202.69434\x2015.6346\x203.01861\x2015.6346\x203.41861V12.4611C15.6346\x2012.8612\x2015.3228\x2013.1854\x2014.9381\x2013.1854H8.82117L6.06643\x2014.6179C5.85054\x2014.7301\x205.59416\x2014.7181\x205.38884\x2014.5862C5.18352\x2014.4542\x205.05855\x2014.2211\x205.05855\x2013.9701V13.1854H2.53993C2.15531\x2013.1854\x201.84351\x2012.8612\x201.84351\x2012.4611L1.84351\x203.41861ZM6.45141\x2012.7982L8.34531\x2012.0135C8.44201\x2011.9632\x208.54864\x2011.9371\x208.65676\x2011.9371H14.2417C14.3522\x2011.9371\x2014.4417\x2011.8475\x2014.4417\x2011.7371V4.14271C14.4417\x204.03225\x2014.3522\x203.94271\x2014.2417\x203.94271H3.23636C3.12591\x203.94271\x203.03636\x204.03225\x203.03636\x204.14271L3.03636\x2011.7371C3.03636\x2011.8475\x203.12591\x2011.9371\x203.23636\x2011.9371L5.75498\x2011.9371C6.1396\x2011.9371\x206.45141\x2012.0611\x206.45141\x2012.4611V12.7982Z','fillRule':_0x55ab5e(0xf9),'clipRule':_0x55ab5e(0xf9)}}]},CommentSingle=forwardRef(function(_0x4f6fc3,_0x27c065){const _0x599d74=_0x55ab5e;return createElement(IconBase,Object['assign']({},_0x4f6fc3,{'id':_0x599d74(0x178),'ref':_0x27c065,'icon':element}));});function _0x2896(_0x51851b,_0x4df4c7){const _0x5dd960=_0x5dd9();return _0x2896=function(_0x2896cb,_0x594b93){_0x2896cb=_0x2896cb-0xda;let _0x84e385=_0x5dd960[_0x2896cb];return _0x84e385;},_0x2896(_0x51851b,_0x4df4c7);}CommentSingle[_0x55ab5e(0xee)]=_0x55ab5e(0x199);const SheetsThreadCommentCell=__name(()=>{const _0x11bebf=_0x55ab5e,_0x2ce520=useDependency(IUniverInstanceService),_0xd7712f=useDependency(SheetsThreadCommentPopupService),_0x219505=useObservable(_0xd7712f[_0x11bebf(0x15a)]),_0x5c014a=useDependency(SheetsThreadCommentModel);if(useObservable(_0x5c014a[_0x11bebf(0x1ac)]),!_0x219505)return null;const {row:_0x5c2f26,col:_0x387374,unitId:_0x2d384e,subUnitId:_0x5b5c33,trigger:_0x27c94f}=_0x219505,_0x4f6deb=_0x5c014a[_0x11bebf(0x19a)](_0x2d384e,_0x5b5c33,_0x5c2f26,_0x387374),_0x43160f=''+Tools[_0x11bebf(0x11d)](_0x387374)+(_0x5c2f26+0x1),_0x4b354d=__name(()=>{_0xd7712f['hidePopup']();},'onClose'),_0x3e566c=__name(_0x7f692c=>{const _0x52bdb7=_0x11bebf;var _0x3f759c,_0x46f9b5,_0x2a7790;return(_0x2a7790=(_0x46f9b5=(_0x3f759c=_0x2ce520[_0x52bdb7(0x174)](UniverInstanceType[_0x52bdb7(0x133)]))==null?void 0x0:_0x3f759c[_0x52bdb7(0xed)](_0x7f692c))==null?void 0x0:_0x46f9b5[_0x52bdb7(0x149)]())!=null?_0x2a7790:'';},_0x11bebf(0xe6));return _0x457d9c[_0x11bebf(0x16c)](ThreadCommentTree,{'onClick':__name(()=>{const _0xe4021c=_0x11bebf;_0xd7712f[_0xe4021c(0x1cb)]();},_0x11bebf(0xdd)),'prefix':'cell','id':_0x4f6deb,'unitId':_0x2d384e,'subUnitId':_0x5b5c33,'type':UniverInstanceType[_0x11bebf(0x133)],'refStr':_0x43160f,'onClose':_0x4b354d,'getSubUnitName':_0x3e566c,'autoFocus':_0x27c94f===_0x11bebf(0x1bd)});},'SheetsThreadCommentCell'),SheetsThreadCommentPanel=__name(()=>{const _0x4293e4=_0x55ab5e;var _0x4f6dca;const _0x240413=useDependency(IMarkSelectionService),_0x463245=useDependency(IUniverInstanceService),_0x4135f8=useDependency(SheetsThreadCommentPopupService),_0xc00aef=_0x463245[_0x4293e4(0x174)](UniverInstanceType['UNIVER_SHEET']),_0x5a5643=_0xc00aef[_0x4293e4(0x128)](),_0x4c6520=useDependency(ICommandService),_0x1bf7b9=useMemo(()=>_0xc00aef[_0x4293e4(0x147)][_0x4293e4(0x1a4)](map(_0x1cbf68=>_0x1cbf68==null?void 0x0:_0x1cbf68[_0x4293e4(0x132)]())),[_0xc00aef[_0x4293e4(0x147)]]),_0x5222db=useObservable(_0x1bf7b9,(_0x4f6dca=_0xc00aef[_0x4293e4(0xf6)]())==null?void 0x0:_0x4f6dca[_0x4293e4(0x132)]()),_0x1a520d=useRef(),_0x512ba8=useDependency(ThreadCommentPanelService),_0x2083d1=useObservable(_0x512ba8[_0x4293e4(0x117)]),_0x524496=useObservable(_0x512ba8[_0x4293e4(0xfa)],_0x512ba8['panelVisible']),_0x5369f2=useCallback(_0x523600=>{const _0x5ccd33=_0x4293e4,_0x40b2ea=_0xc00aef['getSheets'](),_0x40f918={};_0x40b2ea[_0x5ccd33(0x151)]((_0x5b7f07,_0x6b8d5c)=>{const _0x5f2aeb=_0x5ccd33;_0x40f918[_0x5b7f07[_0x5f2aeb(0x132)]()]=_0x6b8d5c;});const _0x41aa31=__name(_0x174c38=>_0x174c38[_0x5ccd33(0x19f)](_0x47d555=>{const _0x59228d=_0x5ccd33;var _0x3e1b93;const _0x27d56f=singleReferenceToGrid(_0x47d555['ref']),_0x152233=[(_0x3e1b93=_0x40f918[_0x47d555[_0x59228d(0x171)]])!=null?_0x3e1b93:0x0,_0x27d56f['row'],_0x27d56f[_0x59228d(0x1c4)]];return{..._0x47d555,'p':_0x152233};})[_0x5ccd33(0x12c)]((_0x68a2e8,_0x232859)=>_0x68a2e8['p'][0x0]===_0x232859['p'][0x0]?_0x68a2e8['p'][0x1]===_0x232859['p'][0x1]?_0x68a2e8['p'][0x2]-_0x232859['p'][0x2]:_0x68a2e8['p'][0x1]-_0x232859['p'][0x1]:_0x68a2e8['p'][0x0]-_0x232859['p'][0x0]),'sort');return[..._0x41aa31(_0x523600[_0x5ccd33(0x1a9)](_0x54e586=>!_0x54e586[_0x5ccd33(0x14a)])),..._0x41aa31(_0x523600[_0x5ccd33(0x1a9)](_0x19c06e=>_0x19c06e['resolved']))];},[_0xc00aef]),_0x259621=useCallback(_0x2bd875=>{const _0x533205=_0x4293e4;var _0x213cdd;if(_0x2bd875[_0x533205(0x14e)]===_0x5a5643&&_0x2bd875[_0x533205(0x171)]===_0x5222db&&!_0x2bd875['resolved']){const {row:_0x3b63ed,column:_0x3e740e}=singleReferenceToGrid(_0x2bd875[_0x533205(0x16e)]),_0x44300e=_0xc00aef['getSheetBySheetId'](_0x2bd875['subUnitId']),_0x6a326b=(_0x213cdd=_0x44300e==null?void 0x0:_0x44300e[_0x533205(0x15e)](_0x3b63ed,_0x3e740e))!=null?_0x213cdd:{'startColumn':_0x3e740e,'endColumn':_0x3e740e,'startRow':_0x3b63ed,'endRow':_0x3b63ed};if(!Number[_0x533205(0x19d)](_0x3b63ed)&&!Number[_0x533205(0x19d)](_0x3e740e))return _0x240413[_0x533205(0x110)]({'range':_0x6a326b,'style':{'hasAutoFill':!0x1,'fill':_0x533205(0xde),'strokeWidth':0x1,'stroke':_0x533205(0xdf),'widgets':{}},'primary':null});}},[_0x240413,_0x5222db,_0x5a5643]),_0x1a9c8f=__name(_0x23d3f3=>{const _0x50a65a=_0x4293e4;var _0x419b44,_0x31a768;return(_0x31a768=(_0x419b44=_0xc00aef[_0x50a65a(0xed)](_0x23d3f3))==null?void 0x0:_0x419b44[_0x50a65a(0x149)]())!=null?_0x31a768:'';},_0x4293e4(0xe6)),_0x2288cb=__name(()=>{const _0x54fad7=_0x4293e4;_0x4c6520[_0x54fad7(0x115)](ShowAddSheetCommentModalOperation['id']);},_0x4293e4(0x1bb)),_0x7b9cb7=__name(_0x5b6def=>{const _0x5f1e29=_0x4293e4;_0x2083d1&&_0x2083d1[_0x5f1e29(0x14e)]===_0x5b6def[_0x5f1e29(0x14e)]&&_0x2083d1[_0x5f1e29(0x171)]===_0x5b6def[_0x5f1e29(0x171)]&&_0x2083d1[_0x5f1e29(0x17b)]===_0x5b6def['id']||(_0x1a520d[_0x5f1e29(0x143)]&&(_0x240413['removeShape'](_0x1a520d[_0x5f1e29(0x143)]),_0x1a520d[_0x5f1e29(0x143)]=null),_0x1a520d[_0x5f1e29(0x143)]=_0x259621(_0x5b6def));},_0x4293e4(0x15d)),_0x4ceff0=__name(()=>{const _0x29f05e=_0x4293e4;_0x1a520d[_0x29f05e(0x143)]&&(_0x240413[_0x29f05e(0x1c5)](_0x1a520d[_0x29f05e(0x143)]),_0x1a520d[_0x29f05e(0x143)]=null);},'handleLeave'),_0x134f50=__name((_0x276e34,_0x94c1a6)=>{const _0x797ee2=_0x4293e4;_0x94c1a6&&_0x4135f8[_0x797ee2(0x181)]();},_0x4293e4(0x1c0));return useEffect(()=>{const _0x3965d2=_0x4293e4;!_0x524496&&_0x1a520d[_0x3965d2(0x143)]&&_0x240413[_0x3965d2(0x1c5)](_0x1a520d['current']);},[_0x240413,_0x524496]),_0x457d9c[_0x4293e4(0x16c)](ThreadCommentPanel,{'unitId':_0x5a5643,'subUnitId$':_0x1bf7b9,'type':UniverInstanceType[_0x4293e4(0x133)],'onAdd':_0x2288cb,'getSubUnitName':_0x1a9c8f,'onResolve':_0x134f50,'sortComments':_0x5369f2,'onItemEnter':_0x7b9cb7,'onItemLeave':_0x4ceff0,'onDeleteComment':__name(()=>(_0x4ceff0(),!0x0),'onDeleteComment')});},_0x55ab5e(0x10c)),threadCommentMenuFactory=__name(_0x3dce57=>({'id':ShowAddSheetCommentModalOperation['id'],'type':MenuItemType[_0x55ab5e(0x192)],'icon':COMMENT_SINGLE_ICON,'title':_0x55ab5e(0x106),'hidden$':getMenuHiddenObservable(_0x3dce57,UniverInstanceType['UNIVER_SHEET']),'disabled$':getCurrentRangeDisable$(_0x3dce57,{'workbookTypes':[WorkbookCommentPermission],'worksheetTypes':[WorksheetViewPermission],'rangeTypes':[RangeProtectionPermissionViewPoint]})}),'threadCommentMenuFactory'),threadPanelMenuFactory=__name(_0x5dfb54=>({'id':ToggleSheetCommentPanelOperation['id'],'type':MenuItemType[_0x55ab5e(0x192)],'icon':COMMENT_SINGLE_ICON,'tooltip':_0x55ab5e(0xf3),'disabled$':getCurrentRangeDisable$(_0x5dfb54,{'workbookTypes':[WorkbookCommentPermission],'worksheetTypes':[WorksheetViewPermission],'rangeTypes':[RangeProtectionPermissionViewPoint]}),'hidden$':getMenuHiddenObservable(_0x5dfb54,UniverInstanceType['UNIVER_SHEET'])}),_0x55ab5e(0x101)),AddCommentShortcut={'id':ShowAddSheetCommentModalOperation['id'],'binding':KeyCode['M']|MetaKeys[_0x55ab5e(0x190)]|MetaKeys[_0x55ab5e(0xfe)],'preconditions':whenSheetEditorFocused},menuSchema={[RibbonStartGroup[_0x55ab5e(0x135)]]:{[ToggleSheetCommentPanelOperation['id']]:{'order':0x1,'menuItemFactory':threadPanelMenuFactory}},[ContextMenuPosition[_0x55ab5e(0x1bf)]]:{[ContextMenuGroup[_0x55ab5e(0x135)]]:{[ShowAddSheetCommentModalOperation['id']]:{'order':0x0,'menuItemFactory':threadCommentMenuFactory}}}};var __defProp$5=Object[_0x55ab5e(0x126)],__getOwnPropDesc$5=Object['getOwnPropertyDescriptor'],__decorateClass$5=__name((_0x3e61f1,_0x3000fd,_0x5ef635,_0x45c8ae)=>{for(var _0x46fec5=_0x45c8ae>0x1?void 0x0:_0x45c8ae?__getOwnPropDesc$5(_0x3000fd,_0x5ef635):_0x3000fd,_0x2cf8b4=_0x3e61f1['length']-0x1,_0x2c0385;_0x2cf8b4>=0x0;_0x2cf8b4--)(_0x2c0385=_0x3e61f1[_0x2cf8b4])&&(_0x46fec5=(_0x45c8ae?_0x2c0385(_0x3000fd,_0x5ef635,_0x46fec5):_0x2c0385(_0x46fec5))||_0x46fec5);return _0x45c8ae&&_0x46fec5&&__defProp$5(_0x3000fd,_0x5ef635,_0x46fec5),_0x46fec5;},_0x55ab5e(0xf2)),__decorateParam$5=__name((_0x136d5f,_0x4c85f6)=>(_0x534e51,_0x407f3f)=>_0x4c85f6(_0x534e51,_0x407f3f,_0x136d5f),_0x55ab5e(0x1b9)),_a3;let SheetsThreadCommentController=(_a3=class extends Disposable{constructor(_0x554c9d,_0x3121bd,_0x38b235){const _0x3e2514=_0x55ab5e;super(),this[_0x3e2514(0x1a3)]=_0x554c9d,this[_0x3e2514(0x165)]=_0x3121bd,this[_0x3e2514(0x195)]=_0x38b235,this[_0x3e2514(0x144)](),this[_0x3e2514(0x1a7)](),this[_0x3e2514(0x15f)]();}[_0x55ab5e(0x1a7)](){const _0x2805b5=_0x55ab5e;this[_0x2805b5(0x195)][_0x2805b5(0x124)](AddCommentShortcut);}[_0x55ab5e(0x144)](){const _0x2bba4c=_0x55ab5e;this['_menuManagerService'][_0x2bba4c(0x172)](menuSchema);}[_0x55ab5e(0x15f)](){const _0x481707=_0x55ab5e;[[SHEETS_THREAD_COMMENT_MODAL,SheetsThreadCommentCell],[THREAD_COMMENT_PANEL,SheetsThreadCommentPanel],[COMMENT_SINGLE_ICON,CommentSingle]][_0x481707(0x151)](([_0x223c50,_0x59b333])=>{const _0xd3514f=_0x481707;this[_0xd3514f(0x165)][_0xd3514f(0x185)](_0x223c50,_0x59b333);});}},__name(_a3,'SheetsThreadCommentController'),_a3);SheetsThreadCommentController=__decorateClass$5([__decorateParam$5(0x0,IMenuManagerService),__decorateParam$5(0x1,Inject(ComponentManager)),__decorateParam$5(0x2,IShortcutService)],SheetsThreadCommentController);var __defProp$4=Object['defineProperty'],__getOwnPropDesc$4=Object[_0x55ab5e(0x160)],__decorateClass$4=__name((_0x1fce6b,_0x557bef,_0x32a0b5,_0x18f6ea)=>{const _0x168df4=_0x55ab5e;for(var _0x1210bc=_0x18f6ea>0x1?void 0x0:_0x18f6ea?__getOwnPropDesc$4(_0x557bef,_0x32a0b5):_0x557bef,_0x81ce47=_0x1fce6b[_0x168df4(0xf0)]-0x1,_0x37dcb3;_0x81ce47>=0x0;_0x81ce47--)(_0x37dcb3=_0x1fce6b[_0x81ce47])&&(_0x1210bc=(_0x18f6ea?_0x37dcb3(_0x557bef,_0x32a0b5,_0x1210bc):_0x37dcb3(_0x1210bc))||_0x1210bc);return _0x18f6ea&&_0x1210bc&&__defProp$4(_0x557bef,_0x32a0b5,_0x1210bc),_0x1210bc;},_0x55ab5e(0x180)),__decorateParam$4=__name((_0x231937,_0x41a37d)=>(_0x41bd40,_0x31d7c5)=>_0x41a37d(_0x41bd40,_0x31d7c5,_0x231937),_0x55ab5e(0x175));const transformRef=__name((_0x3385e0,_0x234915,_0x29cac8)=>{const _0x16ba70=_0x55ab5e,_0x519b76=singleReferenceToGrid(_0x3385e0),_0x3f9331=_0x29cac8[_0x16ba70(0xfc)]-_0x234915[_0x16ba70(0xfc)],_0x39a5ac=_0x29cac8['column']-_0x234915['column'],_0x1c4ca2={'startColumn':_0x519b76[_0x16ba70(0x1c4)]+_0x39a5ac,'startRow':_0x519b76['row']+_0x3f9331,'endColumn':_0x519b76[_0x16ba70(0x1c4)]+_0x39a5ac,'endRow':_0x519b76[_0x16ba70(0xfc)]+_0x3f9331};return serializeRange(_0x1c4ca2);},_0x55ab5e(0x1a5));var _a4;let SheetsThreadCommentCopyPasteController=(_a4=class extends Disposable{constructor(_0x144c92,_0x1f5f73,_0x17d7dc){const _0x45cd28=_0x55ab5e;super(),__publicField(this,'_copyInfo'),(this[_0x45cd28(0xe3)]=_0x144c92,this[_0x45cd28(0x187)]=_0x1f5f73,this['_threadCommentDataSourceService']=_0x17d7dc,this[_0x45cd28(0x104)]());}[_0x55ab5e(0x104)](){const _0xf8eace=_0x55ab5e;this[_0xf8eace(0x112)](this[_0xf8eace(0xe3)][_0xf8eace(0xf1)]({'id':SHEETS_THREAD_COMMENT,'onBeforeCopy':__name((_0x3a553f,_0x5a892b,_0x2c6af4)=>{const _0xcdf349=_0xf8eace;this[_0xcdf349(0x11b)]={'unitId':_0x3a553f,'subUnitId':_0x5a892b,'range':_0x2c6af4};},_0xf8eace(0x1c3)),'onPasteCells':__name((_0x34b410,_0x40eb4f,_0x3ba349,_0x591923)=>{const _0x23f5e4=_0xf8eace,{unitId:_0x3a09fc,subUnitId:_0x21fe74,range:_0x1f1fe6}=_0x40eb4f,_0x207707={'row':_0x1f1fe6['rows'][0x0],'column':_0x1f1fe6['cols'][0x0]};if(_0x591923[_0x23f5e4(0x18d)]===COPY_TYPE[_0x23f5e4(0x1ba)]&&this[_0x23f5e4(0x11b)]){const {range:_0x2a0eba,unitId:_0x491f79,subUnitId:_0x2e1fff}=this[_0x23f5e4(0x11b)],_0x116278={'row':_0x2a0eba[_0x23f5e4(0xff)],'column':_0x2a0eba[_0x23f5e4(0x11a)]};if(!(_0x3a09fc===_0x491f79&&_0x21fe74===_0x2e1fff)){const _0x11bc1d=[];Range[_0x23f5e4(0x139)](_0x2a0eba,(_0x5b10df,_0x20f263)=>{const _0x4d5096=_0x23f5e4,_0x4f44e1=this[_0x4d5096(0x187)]['getAllByLocation'](_0x491f79,_0x2e1fff,_0x5b10df,_0x20f263);this[_0x4d5096(0x18c)][_0x4d5096(0x13c)]?_0x4f44e1[_0x4d5096(0x151)](_0x14deb1=>{const _0x185bca=_0x4d5096;_0x11bc1d[_0x185bca(0xf5)](_0x14deb1);}):_0x4f44e1[_0x4d5096(0x151)](({children:_0x29b218,..._0x5edf72})=>{const _0x3655b8=_0x4d5096;_0x5edf72[_0x3655b8(0x131)]||_0x11bc1d['push'](_0x5edf72);});});const _0x7848f8=[],_0x56b743=[],_0x30cb14=[],_0x19857e=[],_0x3a028a=__name(_0x6b3ec0=>{const _0x12b5a2=_0x23f5e4;_0x7848f8['unshift']({'id':DeleteCommentMutation['id'],'params':{'unitId':_0x491f79,'subUnitId':_0x2e1fff,'commentId':_0x6b3ec0['id']}}),_0x30cb14[_0x12b5a2(0xf5)]({'id':AddCommentMutation['id'],'params':{'unitId':_0x3a09fc,'subUnitId':_0x21fe74,'comment':{..._0x6b3ec0,'ref':transformRef(_0x6b3ec0[_0x12b5a2(0x16e)],_0x116278,_0x207707),'unitId':_0x3a09fc,'subUnitId':_0x21fe74},'sync':!0x0}}),_0x56b743[_0x12b5a2(0xf5)]({'id':AddCommentMutation['id'],'params':{'unitId':_0x491f79,'subUnitId':_0x2e1fff,'comment':_0x6b3ec0,'sync':!0x0}}),_0x19857e['unshift']({'id':DeleteCommentMutation['id'],'params':{'unitId':_0x3a09fc,'subUnitId':_0x21fe74,'commentId':_0x6b3ec0['id']}});},_0x23f5e4(0x17a));return _0x11bc1d['forEach'](_0x3a6d6d=>{_0x3a028a(_0x3a6d6d);}),{'redos':[..._0x7848f8,..._0x30cb14],'undos':[..._0x19857e,..._0x56b743]};}}return{'redos':[],'undos':[]};},'onPasteCells')}));}},__name(_a4,_0x55ab5e(0x16a)),_a4);SheetsThreadCommentCopyPasteController=__decorateClass$4([__decorateParam$4(0x0,Inject(ISheetClipboardService)),__decorateParam$4(0x1,Inject(SheetsThreadCommentModel)),__decorateParam$4(0x2,IThreadCommentDataSourceService)],SheetsThreadCommentCopyPasteController);var __defProp$3=Object['defineProperty'],__getOwnPropDesc$3=Object['getOwnPropertyDescriptor'],__decorateClass$3=__name((_0x70b379,_0x225d09,_0x5c4fa9,_0x2ed3cb)=>{for(var _0x1f6add=_0x2ed3cb>0x1?void 0x0:_0x2ed3cb?__getOwnPropDesc$3(_0x225d09,_0x5c4fa9):_0x225d09,_0x3dd39f=_0x70b379['length']-0x1,_0x203d98;_0x3dd39f>=0x0;_0x3dd39f--)(_0x203d98=_0x70b379[_0x3dd39f])&&(_0x1f6add=(_0x2ed3cb?_0x203d98(_0x225d09,_0x5c4fa9,_0x1f6add):_0x203d98(_0x1f6add))||_0x1f6add);return _0x2ed3cb&&_0x1f6add&&__defProp$3(_0x225d09,_0x5c4fa9,_0x1f6add),_0x1f6add;},_0x55ab5e(0xe8)),__decorateParam$3=__name((_0x2a8c85,_0x4074f0)=>(_0x3a4435,_0x1aa439)=>_0x4074f0(_0x3a4435,_0x1aa439,_0x2a8c85),'__decorateParam$3'),_a5;let SheetsThreadCommentHoverController=(_a5=class extends Disposable{constructor(_0x338f21,_0x279011,_0xb5131d,_0x5aa951){const _0x528510=_0x55ab5e;super(),this[_0x528510(0x16d)]=_0x338f21,this[_0x528510(0xec)]=_0x279011,this[_0x528510(0x187)]=_0xb5131d,this[_0x528510(0x18f)]=_0x5aa951,this['_initHoverEvent']();}[_0x55ab5e(0x1ab)](){const _0x372523=_0x55ab5e;this[_0x372523(0x112)](this[_0x372523(0x16d)][_0x372523(0x1a0)]['pipe'](debounceTime(0x64))[_0x372523(0x1b6)](_0x4b9f9b=>{const _0x28c90e=_0x372523,_0x167933=this[_0x28c90e(0xec)][_0x28c90e(0x1b2)];if(_0x4b9f9b&&(_0x167933&&_0x167933['temp']||!_0x167933)){const {location:_0x4ed1b3}=_0x4b9f9b,{unitId:_0x5e37f7,subUnitId:_0x4f1483,row:_0xe09395,col:_0x59b93f}=_0x4ed1b3,_0x49d1e0=this[_0x28c90e(0x187)][_0x28c90e(0x19a)](_0x5e37f7,_0x4f1483,_0xe09395,_0x59b93f);if(_0x49d1e0){if(!this[_0x28c90e(0x18f)][_0x28c90e(0x176)]({'workbookTypes':[WorkbookCommentPermission],'worksheetTypes':[WorksheetViewPermission],'rangeTypes':[RangeProtectionPermissionViewPoint]},[{'startRow':_0xe09395,'startColumn':_0x59b93f,'endRow':_0xe09395,'endColumn':_0x59b93f}]))return;const _0x401fe2=this['_sheetsThreadCommentModel']['getComment'](_0x5e37f7,_0x4f1483,_0x49d1e0);_0x401fe2&&!_0x401fe2[_0x28c90e(0x14a)]&&this[_0x28c90e(0xec)][_0x28c90e(0x13d)]({'unitId':_0x5e37f7,'subUnitId':_0x4f1483,'row':_0xe09395,'col':_0x59b93f,'commentId':_0x49d1e0,'temp':!0x0});}else _0x167933&&this[_0x28c90e(0xec)][_0x28c90e(0x181)]();}}));}},__name(_a5,_0x55ab5e(0x140)),_a5);SheetsThreadCommentHoverController=__decorateClass$3([__decorateParam$3(0x0,Inject(HoverManagerService)),__decorateParam$3(0x1,Inject(SheetsThreadCommentPopupService)),__decorateParam$3(0x2,Inject(SheetsThreadCommentModel)),__decorateParam$3(0x3,Inject(SheetPermissionInterceptorBaseController))],SheetsThreadCommentHoverController);var __defProp$2=Object[_0x55ab5e(0x126)],__getOwnPropDesc$2=Object[_0x55ab5e(0x160)],__decorateClass$2=__name((_0x572b87,_0x3f3742,_0x55c295,_0x4a5ff2)=>{const _0x2719e3=_0x55ab5e;for(var _0x53f4ad=_0x4a5ff2>0x1?void 0x0:_0x4a5ff2?__getOwnPropDesc$2(_0x3f3742,_0x55c295):_0x3f3742,_0x2581f8=_0x572b87[_0x2719e3(0xf0)]-0x1,_0x3c5d10;_0x2581f8>=0x0;_0x2581f8--)(_0x3c5d10=_0x572b87[_0x2581f8])&&(_0x53f4ad=(_0x4a5ff2?_0x3c5d10(_0x3f3742,_0x55c295,_0x53f4ad):_0x3c5d10(_0x53f4ad))||_0x53f4ad);return _0x4a5ff2&&_0x53f4ad&&__defProp$2(_0x3f3742,_0x55c295,_0x53f4ad),_0x53f4ad;},_0x55ab5e(0x153)),__decorateParam$2=__name((_0x14c0ea,_0xf1ebdc)=>(_0xb9dd88,_0x2c4dd9)=>_0xf1ebdc(_0xb9dd88,_0x2c4dd9,_0x14c0ea),'__decorateParam$2'),_a6;let SheetsThreadCommentPopupController=(_a6=class extends Disposable{constructor(_0x29fb42,_0x5de358,_0x46d0e9,_0x20dacd,_0x287d5f,_0xc8f60b,_0x32c51a,_0x5159b5,_0x4c905b){const _0x4ca829=_0x55ab5e;super(),__publicField(this,'_isSwitchToCommenting',!0x1),__publicField(this,'_selectionShapeInfo',null),(this[_0x4ca829(0x1c8)]=_0x29fb42,this[_0x4ca829(0xec)]=_0x5de358,this[_0x4ca829(0x187)]=_0x46d0e9,this['_threadCommentPanelService']=_0x20dacd,this[_0x4ca829(0x103)]=_0x287d5f,this[_0x4ca829(0x18f)]=_0xc8f60b,this[_0x4ca829(0x1a8)]=_0x32c51a,this['_sheetSelectionService']=_0x5159b5,this[_0x4ca829(0x107)]=_0x4c905b,this[_0x4ca829(0xe1)](),this[_0x4ca829(0x196)](),this[_0x4ca829(0x141)](),this[_0x4ca829(0x11c)](),this[_0x4ca829(0x111)]());}[_0x55ab5e(0xdc)](_0x528d3c,_0x4d0579,_0x2cafdf){const _0x383167=_0x55ab5e;var _0x194729,_0x1590e9;const _0x3accb7=(_0x194729=_0x528d3c[0x0])==null?void 0x0:_0x194729[_0x383167(0xf8)];if(!_0x3accb7)return;if(((_0x1590e9=_0x3accb7[_0x383167(0x113)])!=null?_0x1590e9:RANGE_TYPE[_0x383167(0x14f)])!==RANGE_TYPE[_0x383167(0x14f)]||_0x3accb7[_0x383167(0xe5)]-_0x3accb7[_0x383167(0x11a)]>0x0||_0x3accb7[_0x383167(0x138)]-_0x3accb7[_0x383167(0xff)]>0x0){this[_0x383167(0x158)][_0x383167(0x17c)]&&this['_commandService'][_0x383167(0x115)](SetActiveCommentOperation['id']);return;}const _0x31ddcd=_0x3accb7[_0x383167(0xff)],_0x495cc1=_0x3accb7[_0x383167(0x11a)];if(!this[_0x383167(0x187)]['showCommentMarker'](_0x4d0579,_0x2cafdf,_0x31ddcd,_0x495cc1)){this[_0x383167(0x158)][_0x383167(0x17c)]&&this[_0x383167(0x1c8)][_0x383167(0x115)](SetActiveCommentOperation['id']);return;}const _0x5f37d7=this['_sheetsThreadCommentModel'][_0x383167(0x19a)](_0x4d0579,_0x2cafdf,_0x31ddcd,_0x495cc1);_0x5f37d7&&this['_commandService']['executeCommand'](SetActiveCommentOperation['id'],{'unitId':_0x4d0579,'subUnitId':_0x2cafdf,'commentId':_0x5f37d7});}['_initSelectionUpdateListener'](){const _0x14fdf5=_0x55ab5e;this[_0x14fdf5(0x112)](this[_0x14fdf5(0x1b0)][_0x14fdf5(0xeb)][_0x14fdf5(0x1b6)](_0x243a1b=>{const _0x1a3dd2=_0x14fdf5;if(this[_0x1a3dd2(0x14b)])return;const _0x436127=this[_0x1a3dd2(0x1b0)][_0x1a3dd2(0x170)];_0x436127&&this[_0x1a3dd2(0xdc)](_0x243a1b,_0x436127['unitId'],_0x436127[_0x1a3dd2(0x1a1)]);}));}[_0x55ab5e(0x111)](){const _0x39810a=_0x55ab5e;this[_0x39810a(0x112)](this[_0x39810a(0x107)][_0x39810a(0xea)][_0x39810a(0x1b6)](_0x49c70c=>{const _0x52c609=_0x39810a;_0x49c70c[_0x52c609(0x10d)]&&this[_0x52c609(0xec)][_0x52c609(0x181)]();}));}[_0x55ab5e(0xe1)](){const _0x4e29c8=_0x55ab5e;this[_0x4e29c8(0x1c8)][_0x4e29c8(0x19e)](_0x3a2659=>{const _0x5e275f=_0x4e29c8;if(_0x3a2659['id']===DeleteCommentMutation['id']){const _0x402fff=_0x3a2659['params'],_0x3fbd65=this[_0x5e275f(0xec)][_0x5e275f(0x1b2)];if(!_0x3fbd65)return;const {unitId:_0x2a005e,subUnitId:_0x2e2a40,commentId:_0x4da501}=_0x3fbd65;_0x402fff[_0x5e275f(0x14e)]===_0x2a005e&&_0x402fff[_0x5e275f(0x171)]===_0x2e2a40&&_0x402fff['commentId']===_0x4da501&&this[_0x5e275f(0xec)]['hidePopup']();}});}['_initPanelListener'](){const _0x241616=_0x55ab5e;this[_0x241616(0x112)](this[_0x241616(0x158)]['activeCommentId$'][_0x241616(0x1b6)](async _0xccac2c=>{const _0x586f40=_0x241616;var _0x13ef8e;if(_0xccac2c){const {unitId:_0x171590,subUnitId:_0x56a25b,commentId:_0x7d43ec,trigger:_0x472952}=_0xccac2c,_0x4f7dfd=this[_0x586f40(0x187)][_0x586f40(0x161)](_0x171590,_0x56a25b,_0x7d43ec);if(!_0x4f7dfd||_0x4f7dfd[_0x586f40(0x14a)])return;const _0x1faec8=this[_0x586f40(0x103)]['getCurrentUnitForType'](UniverInstanceType['UNIVER_SHEET']);if(!_0x1faec8||_0x1faec8['getUnitId']()!==_0x171590)return;this[_0x586f40(0x14b)]=!0x0,((_0x13ef8e=_0x1faec8[_0x586f40(0xf6)]())==null?void 0x0:_0x13ef8e[_0x586f40(0x132)]())!==_0x56a25b&&await this[_0x586f40(0x1c8)]['executeCommand'](SetWorksheetActiveOperation['id'],{'unitId':_0x171590,'subUnitId':_0x56a25b}),this[_0x586f40(0x14b)]=!0x1;const _0x54aebe=singleReferenceToGrid(_0x4f7dfd[_0x586f40(0x16e)]),{row:_0x2eda34,column:_0x54e752}=_0x54aebe;if(!this[_0x586f40(0x18f)][_0x586f40(0x176)]({'workbookTypes':[WorkbookCommentPermission],'worksheetTypes':[WorksheetViewPermission],'rangeTypes':[RangeProtectionPermissionViewPoint]},[{'startRow':_0x2eda34,'startColumn':_0x54e752,'endRow':_0x2eda34,'endColumn':_0x54e752}]))return;const _0x2fc91a=0x1;if(await this[_0x586f40(0x1c8)][_0x586f40(0x115)](ScrollToRangeOperation['id'],{'range':{'startRow':Math[_0x586f40(0x169)](_0x54aebe[_0x586f40(0xfc)]-_0x2fc91a,0x0),'endRow':_0x54aebe[_0x586f40(0xfc)]+_0x2fc91a,'startColumn':Math[_0x586f40(0x169)](_0x54aebe['column']-_0x2fc91a,0x0),'endColumn':_0x54aebe['column']+_0x2fc91a}}),this['_editorBridgeService'][_0x586f40(0x1a2)]()[_0x586f40(0x10d)])return;this[_0x586f40(0xec)][_0x586f40(0x13d)]({'unitId':_0x171590,'subUnitId':_0x56a25b,'row':_0x54aebe[_0x586f40(0xfc)],'col':_0x54aebe[_0x586f40(0x1c4)],'commentId':_0x4f7dfd['id'],'trigger':_0x472952});}else this[_0x586f40(0xec)][_0x586f40(0x181)]();}));}[_0x55ab5e(0x141)](){const _0x44f811=_0x55ab5e;this[_0x44f811(0x112)](this[_0x44f811(0x158)][_0x44f811(0x117)][_0x44f811(0x1a4)](debounceTime(0x64))[_0x44f811(0x1b6)](_0x460bc4=>{const _0x5843ce=_0x44f811;var _0x278ef5,_0x4148a4;if(!_0x460bc4){this[_0x5843ce(0x1b7)]&&(this['_markSelectionService'][_0x5843ce(0x1c5)](this[_0x5843ce(0x1b7)][_0x5843ce(0x17f)]),this[_0x5843ce(0x1b7)]=null);return;}const {unitId:_0x590f55,subUnitId:_0x19e95d,commentId:_0x123a7a}=_0x460bc4;this[_0x5843ce(0x1b7)]&&(this['_markSelectionService'][_0x5843ce(0x1c5)](this[_0x5843ce(0x1b7)][_0x5843ce(0x17f)]),this['_selectionShapeInfo']=null);const _0x2ddce2=this[_0x5843ce(0x187)][_0x5843ce(0x161)](_0x590f55,_0x19e95d,_0x123a7a);if(!_0x2ddce2)return;const _0x414cc7=singleReferenceToGrid(_0x2ddce2[_0x5843ce(0x16e)]),{row:_0x1c7a42,column:_0x120529}=_0x414cc7;if(Number[_0x5843ce(0x19d)](_0x1c7a42)||Number[_0x5843ce(0x19d)](_0x120529))return null;const _0x39b734=(_0x278ef5=this[_0x5843ce(0x103)]['getCurrentUnitForType'](UniverInstanceType[_0x5843ce(0x133)]))==null?void 0x0:_0x278ef5['getSheetBySheetId'](_0x19e95d),_0x4a5428=(_0x4148a4=_0x39b734==null?void 0x0:_0x39b734[_0x5843ce(0x15e)](_0x1c7a42,_0x120529))!=null?_0x4148a4:{'startColumn':_0x120529,'endColumn':_0x120529,'startRow':_0x1c7a42,'endRow':_0x1c7a42},_0x4915b4=this[_0x5843ce(0x1a8)][_0x5843ce(0x110)]({'range':_0x4a5428,'style':{'hasAutoFill':!0x1,'fill':'rgb(255,\x20189,\x2055,\x200.35)','strokeWidth':0x1,'stroke':_0x5843ce(0xdf),'widgets':{}},'primary':null},[],-0x1);_0x4915b4&&(this[_0x5843ce(0x1b7)]={..._0x460bc4,'shapeId':_0x4915b4});}));}},__name(_a6,_0x55ab5e(0x17e)),_a6);SheetsThreadCommentPopupController=__decorateClass$2([__decorateParam$2(0x0,ICommandService),__decorateParam$2(0x1,Inject(SheetsThreadCommentPopupService)),__decorateParam$2(0x2,Inject(SheetsThreadCommentModel)),__decorateParam$2(0x3,Inject(ThreadCommentPanelService)),__decorateParam$2(0x4,IUniverInstanceService),__decorateParam$2(0x5,Inject(SheetPermissionInterceptorBaseController)),__decorateParam$2(0x6,IMarkSelectionService),__decorateParam$2(0x7,Inject(SheetsSelectionsService)),__decorateParam$2(0x8,IEditorBridgeService)],SheetsThreadCommentPopupController);var __defProp$1=Object[_0x55ab5e(0x126)],__getOwnPropDesc$1=Object[_0x55ab5e(0x160)],__decorateClass$1=__name((_0x4cfd17,_0x49d042,_0x2d3720,_0x43c761)=>{for(var _0x4b6cee=_0x43c761>0x1?void 0x0:_0x43c761?__getOwnPropDesc$1(_0x49d042,_0x2d3720):_0x49d042,_0x3b2b37=_0x4cfd17['length']-0x1,_0x5b4a5d;_0x3b2b37>=0x0;_0x3b2b37--)(_0x5b4a5d=_0x4cfd17[_0x3b2b37])&&(_0x4b6cee=(_0x43c761?_0x5b4a5d(_0x49d042,_0x2d3720,_0x4b6cee):_0x5b4a5d(_0x4b6cee))||_0x4b6cee);return _0x43c761&&_0x4b6cee&&__defProp$1(_0x49d042,_0x2d3720,_0x4b6cee),_0x4b6cee;},_0x55ab5e(0x1c9)),__decorateParam$1=__name((_0x155139,_0x3df7c1)=>(_0x1e419c,_0x2f958a)=>_0x3df7c1(_0x1e419c,_0x2f958a,_0x155139),_0x55ab5e(0x1b3)),_a7;let ThreadCommentRemoveSheetsController=(_a7=class extends Disposable{constructor(_0x44aae3,_0x27ef54,_0x43a032,_0x137244){const _0x38c6b1=_0x55ab5e;super(),this[_0x38c6b1(0x182)]=_0x44aae3,this[_0x38c6b1(0x103)]=_0x27ef54,this[_0x38c6b1(0x130)]=_0x43a032,this[_0x38c6b1(0x18c)]=_0x137244,this[_0x38c6b1(0x186)]();}[_0x55ab5e(0x186)](){const _0x44976a=_0x55ab5e;this[_0x44976a(0x112)](this[_0x44976a(0x182)][_0x44976a(0x1bc)]({'getMutations':__name(_0x2d78e2=>{const _0x783e5d=_0x44976a;var _0xd6cf23;if(_0x2d78e2['id']===RemoveSheetCommand['id']){const _0x793fca=_0x2d78e2[_0x783e5d(0x166)],_0x4c04e1=_0x793fca[_0x783e5d(0x14e)]?this[_0x783e5d(0x103)][_0x783e5d(0x13f)](_0x793fca[_0x783e5d(0x14e)]):this[_0x783e5d(0x103)][_0x783e5d(0x174)](UniverInstanceType[_0x783e5d(0x133)]);if(!_0x4c04e1)return{'redos':[],'undos':[]};const _0x1c12a4=_0x4c04e1[_0x783e5d(0x128)](),_0x44dd2b=_0x793fca['subUnitId']||((_0xd6cf23=_0x4c04e1[_0x783e5d(0xf6)]())==null?void 0x0:_0xd6cf23[_0x783e5d(0x132)]());if(!_0x44dd2b)return{'redos':[],'undos':[]};const {commentMap:_0x8e61fc}=this['_threadCommentModel']['ensureMap'](_0x1c12a4,_0x44dd2b),_0x1f3eb7=Array['from'](Object[_0x783e5d(0x13b)](_0x8e61fc))['filter'](_0xc64eb4=>!_0xc64eb4[_0x783e5d(0x131)]),_0x65f67d=_0x1f3eb7[_0x783e5d(0x19f)](_0x1a5738=>_0x1a5738['id']),_0x334b7f=this[_0x783e5d(0x18c)][_0x783e5d(0x13c)],_0x1c10aa=_0x65f67d[_0x783e5d(0x19f)](_0x2bbbd8=>({'id':DeleteCommentMutation['id'],'params':{'unitId':_0x1c12a4,'subUnitId':_0x44dd2b,'commentId':_0x2bbbd8}})),_0x2a623d=_0x1f3eb7[_0x783e5d(0x19f)](({children:_0x1a3ca5,..._0x5bda32})=>({'id':AddCommentMutation['id'],'params':{'unitId':_0x1c12a4,'subUnitId':_0x44dd2b,'comment':{..._0x5bda32,'children':_0x334b7f?_0x1a3ca5:void 0x0},'sync':!_0x334b7f}}));return{'redos':_0x1c10aa,'undos':_0x2a623d};}return{'redos':[],'undos':[]};},_0x44976a(0x14d))}));}},__name(_a7,_0x55ab5e(0x17d)),_a7);ThreadCommentRemoveSheetsController=__decorateClass$1([__decorateParam$1(0x0,Inject(SheetInterceptorService)),__decorateParam$1(0x1,IUniverInstanceService),__decorateParam$1(0x2,Inject(ThreadCommentModel)),__decorateParam$1(0x3,IThreadCommentDataSourceService)],ThreadCommentRemoveSheetsController);var __defProp2=Object[_0x55ab5e(0x126)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__defNormalProp2=__name((_0x2c84d0,_0x18f5e9,_0x3ce6dd)=>_0x18f5e9 in _0x2c84d0?__defProp2(_0x2c84d0,_0x18f5e9,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3ce6dd}):_0x2c84d0[_0x18f5e9]=_0x3ce6dd,'__defNormalProp'),__decorateClass=__name((_0x2d27f1,_0x594120,_0x755008,_0xf93732)=>{const _0x5a68c0=_0x55ab5e;for(var _0x25ea2e=_0xf93732>0x1?void 0x0:_0xf93732?__getOwnPropDesc(_0x594120,_0x755008):_0x594120,_0x3ba1ef=_0x2d27f1[_0x5a68c0(0xf0)]-0x1,_0x28bc87;_0x3ba1ef>=0x0;_0x3ba1ef--)(_0x28bc87=_0x2d27f1[_0x3ba1ef])&&(_0x25ea2e=(_0xf93732?_0x28bc87(_0x594120,_0x755008,_0x25ea2e):_0x28bc87(_0x25ea2e))||_0x25ea2e);return _0xf93732&&_0x25ea2e&&__defProp2(_0x594120,_0x755008,_0x25ea2e),_0x25ea2e;},_0x55ab5e(0x18e)),__decorateParam=__name((_0x1a797f,_0x2bfdc7)=>(_0x5a20e4,_0x462d88)=>_0x2bfdc7(_0x5a20e4,_0x462d88,_0x1a797f),'__decorateParam'),__publicField2=__name((_0x3f863c,_0x4c5958,_0x2d6ba8)=>__defNormalProp2(_0x3f863c,typeof _0x4c5958!=_0x55ab5e(0x100)?_0x4c5958+'':_0x4c5958,_0x2d6ba8),_0x55ab5e(0x121)),_a8;let UniverSheetsThreadCommentPlugin=(_a8=class extends Plugin{constructor(_0x54fc09=defaultPluginConfig,_0x58d084,_0x574494,_0x133a3c){const _0x427bfb=_0x55ab5e;super(),this[_0x427bfb(0x129)]=_0x54fc09,this['_injector']=_0x58d084,this[_0x427bfb(0x1c8)]=_0x574494,this[_0x427bfb(0x1c1)]=_0x133a3c;const {menu:_0x443d1d,..._0x2afeaf}=this[_0x427bfb(0x129)];_0x443d1d&&this[_0x427bfb(0x1c1)]['setConfig']('menu',_0x443d1d,{'merge':!0x0}),this[_0x427bfb(0x1c1)]['setConfig'](PLUGIN_CONFIG_KEY,_0x2afeaf);}[_0x55ab5e(0xf7)](){const _0x5c7af9=_0x55ab5e;[[SheetsThreadCommentController],[SheetsThreadCommentRenderController],[SheetsThreadCommentCopyPasteController],[SheetsThreadCommentHoverController],[ThreadCommentRemoveSheetsController],[SheetsThreadCommentPopupController],[SheetsThreadCommentPopupService]][_0x5c7af9(0x151)](_0x4884f5=>{const _0x5f2d68=_0x5c7af9;this[_0x5f2d68(0x119)][_0x5f2d68(0x122)](_0x4884f5);}),[ShowAddSheetCommentModalOperation][_0x5c7af9(0x151)](_0x4be7e0=>{const _0x38f203=_0x5c7af9;this[_0x38f203(0x1c8)][_0x38f203(0x114)](_0x4be7e0);}),this['_injector'][_0x5c7af9(0x12b)](SheetsThreadCommentController);}[_0x55ab5e(0x18a)](){const _0x17e1fb=_0x55ab5e;this[_0x17e1fb(0x119)][_0x17e1fb(0x12b)](SheetsThreadCommentRenderController),this[_0x17e1fb(0x119)]['get'](ThreadCommentRemoveSheetsController);}[_0x55ab5e(0x1b5)](){const _0x3c17e8=_0x55ab5e;this[_0x3c17e8(0x119)][_0x3c17e8(0x12b)](SheetsThreadCommentCopyPasteController),this[_0x3c17e8(0x119)][_0x3c17e8(0x12b)](SheetsThreadCommentHoverController),this[_0x3c17e8(0x119)][_0x3c17e8(0x12b)](SheetsThreadCommentPopupController);}},__name(_a8,_0x55ab5e(0x18b)),_a8);__publicField2(UniverSheetsThreadCommentPlugin,_0x55ab5e(0x120),SHEETS_THREAD_COMMENT),__publicField2(UniverSheetsThreadCommentPlugin,_0x55ab5e(0x1af),UniverInstanceType[_0x55ab5e(0x133)]),UniverSheetsThreadCommentPlugin=__decorateClass([DependentOn(UniverThreadCommentUIPlugin,UniverSheetsThreadCommentBasePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,Inject(ICommandService)),__decorateParam(0x3,IConfigService)],UniverSheetsThreadCommentPlugin);export{AddCommentCommand,DeleteCommentCommand,DeleteCommentTreeCommand,_0x3bff75 as IThreadCommentDataSourceService,IThreadCommentMentionDataService,ResolveCommentCommand,SHEETS_THREAD_COMMENT,_0x1a43ec as SheetsThreadCommentModel,SheetsThreadCommentPopupService,ShowAddSheetCommentModalOperation,UniverSheetsThreadCommentPlugin,_0x486674 as UniverThreadCommentUIPlugin,UpdateCommentCommand};
|