@univerjs/preset-sheets-thread-comment 0.5.0-nightly.202411230627 → 0.5.1-nightly.202412041606

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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@univerjs/sheets-thread-comment"),o=require("@univerjs/sheets-thread-comment-ui"),i=require("@univerjs/thread-comment-ui"),m=require("@univerjs-pro/thread-comment-datasource");require("@univerjs/sheets-thread-comment/facade");function s(r={}){const{collaboration:t}=r,e=[i.UniverThreadCommentUIPlugin,n.UniverSheetsThreadCommentPlugin,o.UniverSheetsThreadCommentUIPlugin];return t&&e.push(m.UniverThreadCommentDataSourcePlugin),{plugins:e}}exports.UniverSheetsThreadCommentPreset=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@univerjs-pro/thread-comment-datasource"),o=require("@univerjs/sheets-thread-comment"),i=require("@univerjs/sheets-thread-comment-ui"),m=require("@univerjs/thread-comment-ui");require("@univerjs/sheets-thread-comment/facade");function s(r={}){const{collaboration:t}=r,e=[m.UniverThreadCommentUIPlugin,o.UniverSheetsThreadCommentPlugin,i.UniverSheetsThreadCommentUIPlugin];return t&&e.push(n.UniverThreadCommentDataSourcePlugin),{plugins:e}}exports.UniverSheetsThreadCommentPreset=s;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("@univerjs/core"),r=require("@univerjs/sheets-thread-comment-ui/locale/fr-FR"),s=require("@univerjs/thread-comment-ui/locale/fr-FR"),t=e.Tools.deepMerge({},r,s);module.exports=t;
package/lib/es/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { UniverSheetsThreadCommentPlugin as n } from "@univerjs/sheets-thread-comment";
2
- import { UniverSheetsThreadCommentUIPlugin as t } from "@univerjs/sheets-thread-comment-ui";
3
- import { UniverThreadCommentUIPlugin as m } from "@univerjs/thread-comment-ui";
4
- import { UniverThreadCommentDataSourcePlugin as i } from "@univerjs-pro/thread-comment-datasource";
1
+ import { UniverThreadCommentDataSourcePlugin as n } from "@univerjs-pro/thread-comment-datasource";
2
+ import { UniverSheetsThreadCommentPlugin as t } from "@univerjs/sheets-thread-comment";
3
+ import { UniverSheetsThreadCommentUIPlugin as m } from "@univerjs/sheets-thread-comment-ui";
4
+ import { UniverThreadCommentUIPlugin as i } from "@univerjs/thread-comment-ui";
5
5
  import "@univerjs/sheets-thread-comment/facade";
6
6
  function l(r = {}) {
7
7
  const { collaboration: o } = r, e = [
8
- m,
9
- n,
10
- t
8
+ i,
9
+ t,
10
+ m
11
11
  ];
12
- return o && e.push(i), { plugins: e };
12
+ return o && e.push(n), { plugins: e };
13
13
  }
14
14
  export {
15
15
  l as UniverSheetsThreadCommentPreset
@@ -0,0 +1,11 @@
1
+ import { Tools as e } from "@univerjs/core";
2
+ import r from "@univerjs/sheets-thread-comment-ui/locale/fr-FR";
3
+ import o from "@univerjs/thread-comment-ui/locale/fr-FR";
4
+ const s = e.deepMerge(
5
+ {},
6
+ r,
7
+ o
8
+ );
9
+ export {
10
+ s as default
11
+ };
@@ -1,16 +1,5 @@
1
- import { IPreset } from './types';
2
- import '@univerjs/sheets-thread-comment/facade';
3
- import '@univerjs/thread-comment-ui/lib/index.css';
4
- export interface IUniverSheetsThreadCommentPresetConfig {
5
- /**
6
- * If you would like to use comment with Univer's first-party collaboration features,
7
- * please set this option to `true`.
8
- */
9
- collaboration?: boolean;
10
- }
11
- /**
12
- * This preset add thread comment features into your application.
13
- *
14
- * @param {Partial<IUniverSheetsThreadCommentPresetConfig>} config - The configuration object.
15
- */
16
- export declare function UniverSheetsThreadCommentPreset(config?: Partial<IUniverSheetsThreadCommentPresetConfig>): IPreset;
1
+ export * from './umd';
2
+ export * from '@univerjs-pro/thread-comment-datasource';
3
+ export * from '@univerjs/sheets-thread-comment';
4
+ export * from '@univerjs/sheets-thread-comment-ui';
5
+ export * from '@univerjs/thread-comment-ui';
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { IPreset } from './types';
2
+ import '@univerjs/sheets-thread-comment/facade';
3
+ import '@univerjs/thread-comment-ui/lib/index.css';
4
+ export interface IUniverSheetsThreadCommentPresetConfig {
5
+ /**
6
+ * If you would like to use comment with Univer's first-party collaboration features,
7
+ * please set this option to `true`.
8
+ */
9
+ collaboration?: boolean;
10
+ }
11
+ /**
12
+ * This preset add thread comment features into your application.
13
+ *
14
+ * @param {Partial<IUniverSheetsThreadCommentPresetConfig>} config - The configuration object.
15
+ */
16
+ export declare function UniverSheetsThreadCommentPreset(config?: Partial<IUniverSheetsThreadCommentPresetConfig>): IPreset;
package/lib/umd/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
  // @univerjs/thread-comment-ui/index
10
- (function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverThreadCommentUi={},c.UniverCore,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React,c.UniverDesign,c.UniverDocs,c.UniverDocsUi,c.UniverEngineRender))})(this,function(c,o,b,k,ne,h,_,Ne,Oe,Me){"use strict";var mt=Object.defineProperty;var ct=(c,o,b)=>o in c?mt(c,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[o]=b;var K=(c,o,b)=>ct(c,typeof o!="symbol"?o+"":o,b);var Re=Object.defineProperty,we=Object.getOwnPropertyDescriptor,De=(r,e,t,n)=>{for(var i=n>1?void 0:n?we(e,t):e,s=r.length-1,l;s>=0;s--)(l=r[s])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&Re(e,t,i),i},me=(r,e)=>(t,n)=>e(t,n,r);c.ThreadCommentPanelService=class extends o.Disposable{constructor(t,n){super();K(this,"_panelVisible",!1);K(this,"_panelVisible$",new ne.BehaviorSubject(!1));K(this,"_activeCommentId");K(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));K(this,"panelVisible$",this._panelVisible$.asObservable());K(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=n,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},c.ThreadCommentPanelService=De([me(0,o.Inject(k.ISidebarService)),me(1,o.IUniverInstanceService)],c.ThreadCommentPanelService);const ce="thread-comment-panel",He="UNIVER_THREAD_COMMENT_UI_PLUGIN",he={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(r){const e=r.get(k.ISidebarService),t=r.get(c.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:ce},width:330}),t.setPanelVisible(!0)),!0}},W={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(r,e){return r.get(c.ThreadCommentPanelService).setActiveComment(e),!0}},Ae="thread-comment-ui.config",Le={};var ue=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,Ve=(r,e,t)=>e in r?ue(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Be=(r,e,t,n)=>{for(var i=n>1?void 0:n?ke(e,t):e,s=r.length-1,l;s>=0;s--)(l=r[s])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&ue(e,t,i),i},le=(r,e)=>(t,n)=>e(t,n,r),ve=(r,e,t)=>Ve(r,typeof e!="symbol"?e+"":e,t);c.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=Le,t,n,i){super(),this._config=e,this._injector=t,this._commandService=n,this._configService=i;const{menu:s,...l}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(Ae,l)}onStarting(){var e;o.mergeOverrideWithDependencies([[c.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[he,W].forEach(t=>{this._commandService.registerCommand(t)})}},ve(c.UniverThreadCommentUIPlugin,"pluginName",He),ve(c.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),c.UniverThreadCommentUIPlugin=Be([o.DependentOn(b.UniverThreadCommentPlugin),le(1,o.Inject(o.Injector)),le(2,o.ICommandService),le(3,o.IConfigService)],c.UniverThreadCommentUIPlugin);var Ce={exports:{}},re={};/**
10
+ (function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverThreadCommentUi={},c.UniverCore,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React,c.UniverDesign,c.UniverDocs,c.UniverDocsUi,c.UniverEngineRender))})(this,function(c,o,_,k,re,h,E,Re,Oe,Me){"use strict";var st=Object.defineProperty;var dt=(c,o,_)=>o in c?st(c,o,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[o]=_;var G=(c,o,_)=>dt(c,typeof o!="symbol"?o+"":o,_);var we=Object.defineProperty,De=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?De(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&we(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);c.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();G(this,"_panelVisible",!1);G(this,"_panelVisible$",new re.BehaviorSubject(!1));G(this,"_activeCommentId");G(this,"_activeCommentId$",new re.BehaviorSubject(void 0));G(this,"panelVisible$",this._panelVisible$.asObservable());G(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(re.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},c.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],c.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(c.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},W={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(c.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};var ve=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Be=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Fe=(n,e,t,r)=>{for(var i=r>1?void 0:r?Ve(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&ve(e,t,i),i},le=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Be(n,typeof e!="symbol"?e+"":e,t);c.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:s,...l}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(Le,l)}onStarting(){var e;o.mergeOverrideWithDependencies([[c.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,W].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(c.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(c.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),c.UniverThreadCommentUIPlugin=Fe([o.DependentOn(_.UniverThreadCommentPlugin),le(1,o.Inject(o.Injector)),le(2,o.ICommandService),le(3,o.IConfigService)],c.UniverThreadCommentUIPlugin);var me={exports:{}},Y={};/**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
13
13
  *
@@ -15,13 +15,13 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var Fe=h,We=Symbol.for("react.element"),ze=Symbol.for("react.fragment"),Ze=Object.prototype.hasOwnProperty,Ge=Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0};function fe(r,e,t){var n,i={},s=null,l=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(l=e.ref);for(n in e)Ze.call(e,n)&&!Ke.hasOwnProperty(n)&&(i[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:We,type:r,key:s,ref:l,props:i,_owner:Ge.current}}re.Fragment=ze,re.jsx=fe,re.jsxs=fe,Ce.exports=re;var a=Ce.exports,O=function(){return O=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},O.apply(this,arguments)},Ye=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},z=h.forwardRef(function(r,e){var t=r.icon,n=r.id,i=r.className,s=r.extend,l=Ye(r,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),p=h.useRef("_".concat(Xe()));return pe(t,"".concat(n),{defIds:t.defIds,idSuffix:p.current},O({ref:e,className:C},l),s)});function pe(r,e,t,n,i){return h.createElement(r.tag,O(O({key:e},Je(r,t,i)),n),(Qe(r,t).children||[]).map(function(s,l){return pe(s,"".concat(e,"-").concat(r.tag,"-").concat(l),t,void 0,i)}))}function Je(r,e,t){var n=O({},r.attrs);t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(s){var l=s[0],C=s[1];typeof C=="string"&&(n[l]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Qe(r,e){var t,n=e.defIds;return!n||n.length===0?r:r.tag==="defs"&&(!((t=r.children)===null||t===void 0)&&t.length)?O(O({},r),{children:r.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?O(O({},i),{attrs:O(O({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):r}function Xe(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var qe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ge=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"delete-single",ref:e,icon:qe}))});ge.displayName="DeleteSingle";var $e={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Ie=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"increase-single",ref:e,icon:$e}))});Ie.displayName="IncreaseSingle";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},Se=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"more-horizontal-single",ref:e,icon:et}))});Se.displayName="MoreHorizontalSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},xe=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"reply-to-comment-single",ref:e,icon:tt}))});xe.displayName="ReplyToCommentSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ye=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"resolved-single",ref:e,icon:nt}))});ye.displayName="ResolvedSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},be=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"solve-single",ref:e,icon:rt}))});be.displayName="SolveSingle";function Te(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(t=Te(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function it(){for(var r,e,t=0,n="",i=arguments.length;t<i;t++)(r=arguments[t])&&(e=Te(r))&&(n&&(n+=" "),n+=e);return n}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},ot=r=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,n=0;const i=[];for(;(t=e.exec(r))!==null;)t.index>n&&i.push({type:"text",content:r.substring(n,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),n=e.lastIndex;return n<r.length&&i.push({type:"text",content:r.substring(n)}),i},at=r=>r.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),je=r=>{const{dataStream:e,customRanges:t}=r,n=e.length-2,i=[];let s=0;return t==null||t.forEach(l=>{s<l.startIndex&&i.push({type:"text",content:e.slice(s,l.startIndex)}),i.push({type:"mention",content:{label:e.slice(l.startIndex,l.endIndex).slice(1,-1),id:l.rangeId}}),s=l.endIndex}),i.push({type:"text",content:e.slice(s,n)}),i},_e=r=>{let e="";const t=[];return r.forEach(n=>{switch(n.type){case"text":e+=n.content;break;case"mention":{const i=e.length;e+=`${n.content.label}`;const s=e.length;t.push({rangeId:n.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:s,properties:{}});break}}}),e+=`
19
- \r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},st=(r,e,t,n,i)=>{var l,C;const s=(l=r.raw)==null?void 0:l.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[s?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:s}):null,a.jsx("div",{children:(C=r.display)!=null?C:r.id})]})},Ue=h.forwardRef((r,e)=>{var V;const{comment:t,onSave:n,id:i,onCancel:s,autoFocus:l,unitId:C}=r,p=o.useDependency(o.IMentionIOService),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,y]=h.useState({...t}),[U,f]=h.useState(!1),S=h.useRef(null),D=o.useDependency(Ne.DocSelectionManagerService),P=(V=o.useDependency(Me.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:V.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(u){var x;y({...t,text:u,attachments:[]}),(x=S.current)==null||x.inputElement.focus()}}));const g=()=>{var u;I.text&&(n==null||n({...I,text:I.text}),f(!1),y({text:void 0}),(u=S.current)==null||u.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:u=>u.preventDefault(),children:[a.jsx(_.Mentions,{ref:S,autoFocus:l,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?at(je(I.text)):"",onChange:u=>{u.target.value||y({...t,text:void 0}),y==null||y({...t,text:_e(ot(u.target.value))})},onFocus:()=>{const u=D.getActiveTextRange();u&&u.collapsed&&(P==null||P.removeAllRanges()),P==null||P.blur(),f(!0)},children:a.jsx(_.Mention,{trigger:"@",data:(u,x)=>p.list({search:u,unitId:C}).then(m=>m.list.map(H=>H.mentions.map(T=>({id:T.objectId,display:T.label,raw:T}))).flat()).then(x),displayTransform:(u,x)=>`@${x} `,renderSuggestion:st},"@")}),U?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{s==null||s(),f(!1),y({text:void 0}),w.executeCommand(W.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:g,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Pe="__mock__",dt=r=>{const{item:e,unitId:t,subUnitId:n,editing:i,onEditingChange:s,onReply:l,resolved:C,isRoot:p,onClose:w,onDeleteComment:M}=r,I=o.useDependency(o.ICommandService),y=o.useDependency(o.LocaleService),U=o.useDependency(o.UserManagerService),f=U.getUser(e.personId),S=k.useObservable(U.currentUser$),D=(S==null?void 0:S.userID)===e.personId,j=e.id===Pe,[P,g]=h.useState(!1),V=()=>{(M==null?void 0:M(e))!==!1&&(I.executeCommand(p?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:n,commentId:e.id}),p&&(w==null||w()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>g(!1),onMouseEnter:()=>g(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:f==null?void 0:f.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(f==null?void 0:f.name)||" "}),a.jsxs("div",{children:[j||C?null:P?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>l(f),children:a.jsx(xe,{})}):null,D&&!j&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>s==null?void 0:s(!0),children:y.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:V,children:y.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(Se,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Ue,{id:e.id,comment:e,onCancel:()=>s==null?void 0:s(!1),autoFocus:!0,unitId:t,subUnitId:n,onSave:({text:u,attachments:x})=>{s==null||s(!1),I.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:n,payload:{commentId:e.id,text:u,attachments:x}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:je(e.text).map((u,x)=>{switch(u.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",u.content.label," "]},x);default:return u.content}})})]})},Ee=r=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:n,refStr:i,showEdit:s=!0,onClick:l,showHighlight:C,onClose:p,getSubUnitName:w,prefix:M,autoFocus:I,onMouseEnter:y,onMouseLeave:U,onAddComment:f,onDeleteComment:S,onResolve:D}=r,j=o.useDependency(b.ThreadCommentModel),[P,g]=h.useState(!1),[V,u]=h.useState(""),x=h.useMemo(()=>j.commentUpdate$.pipe(ne.debounceTime(16)),[j]);k.useObservable(x);const m=e?j.getCommentWithChildren(t,n,e):null,H=o.useDependency(o.ICommandService),T=o.useDependency(o.UserManagerService),A=m==null?void 0:m.root.resolved,R=k.useObservable(T.currentUser$),Q=h.useRef(null),X=[...m?[m.root]:[{id:Pe,text:{dataStream:`
20
- \r`},personId:(ae=R==null?void 0:R.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:n,threadId:""}],...($=m==null?void 0:m.children)!=null?$:[]],Z=h.useRef(null),B=E=>{E.stopPropagation(),A?H.executeCommand(W.id,{unitId:t,subUnitId:n,commentId:e}):H.executeCommand(W.id),H.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:n,commentId:e,resolved:!A}),D==null||D(!A)},q=E=>{E.stopPropagation(),H.executeCommand(W.id),!(m!=null&&m.root&&(S==null?void 0:S(m.root))===!1)&&(H.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:n,commentId:e}),p==null||p())};h.useEffect(()=>U==null?void 0:U(),[]);const F=w((ee=m==null?void 0:m.root.subUnitId)!=null?ee:n),oe=s&&!V&&!A,Y=`${i||(m==null?void 0:m.root.ref)||""}${F?" · ":""}${F}`;return a.jsxs("div",{className:it(v.threadComment,{[v.threadCommentActive]:!A&&(C||P||M==="cell")}),onClick:l,id:`${M}-${t}-${n}-${e}`,onMouseEnter:()=>{y==null||y(),g(!0)},onMouseLeave:()=>{U==null||U(),g(!1)},children:[!A&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),m?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:B,className:v.threadCommentIcon,style:{color:A?"rgb(var(--green-500))":""},children:A?a.jsx(ye,{}):a.jsx(be,{})}),(R==null?void 0:R.userID)===m.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(ge,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:Z,children:X.map(E=>a.jsx(dt,{onClose:p,unitId:t,subUnitId:n,item:E,isRoot:E.id===(m==null?void 0:m.root.id),editing:V===E.id,resolved:m==null?void 0:m.root.resolved,onEditingChange:L=>{u(L?E.id:"")},onReply:L=>{L&&requestAnimationFrame(()=>{var d;(d=Q.current)==null||d.reply(_e([{type:"mention",content:{id:L.userID,label:L.name}}]))})},onAddComment:f,onDeleteComment:S},E.id))}),oe?a.jsx("div",{children:a.jsx(Ue,{ref:Q,unitId:t,subUnitId:n,onSave:async({text:E,attachments:L})=>{const d={text:E,attachments:L,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:R==null?void 0:R.userID,parentId:m==null?void 0:m.root.id,unitId:t,subUnitId:n,threadId:m==null?void 0:m.root.threadId};(f==null?void 0:f(d))!==!1&&(await H.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:n,comment:d}),Z.current&&(Z.current.scrollTop=Z.current.scrollHeight))},autoFocus:I||!m,onCancel:()=>{m||p==null||p()}},`${I}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},lt=r=>{const{unitId:e,subUnitId$:t,type:n,onAdd:i,getSubUnitName:s,onResolve:l,sortComments:C,onItemLeave:p,onItemEnter:w,disableAdd:M,tempComment:I,onAddComment:y,onDeleteComment:U,showComments:f}=r,[S,D]=h.useState("all"),[j,P]=h.useState("all"),g=o.useDependency(o.LocaleService),V=o.useDependency(o.UserManagerService),u=o.useDependency(b.ThreadCommentModel),[x,m]=h.useState(()=>u.getUnit(e)),H=o.useDependency(c.ThreadCommentPanelService),T=k.useObservable(H.activeCommentId$),A=k.useObservable(u.commentUpdate$),R=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),Z="panel",B=k.useObservable(V.currentUser$),q=h.useMemo(()=>{var de;const d=S==="all"?x:(de=x.filter(N=>N.subUnitId===Q))!=null?de:[],te=C!=null?C:N=>N,se=d.map(N=>{var G;return{...N.root,children:(G=N.children)!=null?G:[],users:N.relativeUsers}});if(f){const N=new Map;return se.forEach(G=>{N.set(G.id,G)}),[...f,""].map(G=>N.get(G)).filter(Boolean)}else return te(se)},[f,S,x,C,Q]),F=h.useMemo(()=>[...q.filter(d=>!d.resolved),...q.filter(d=>d.resolved)],[q]),oe=h.useMemo(()=>j==="resolved"?F.filter(d=>d.resolved):j==="unsolved"?F.filter(d=>!d.resolved):j==="concern_me"&&B!=null&&B.userID?F.filter(d=>d==null?void 0:d.users.has(B.userID)):F,[F,B==null?void 0:B.userID,j]),Y=I?[I,...oe]:oe,ae=Y.filter(d=>!d.resolved),$=Y.filter(d=>d.resolved),ee=j!=="all"||S!=="all",E=()=>{P("all"),D("all")};h.useEffect(()=>{e&&m(u.getUnit(e))},[e,u,A]),h.useEffect(()=>{var N;if(!T)return;if(!X.current){X.current=!0;return}const{unitId:d,subUnitId:te,commentId:se}=T,de=`${Z}-${d}-${te}-${se}`;(N=document.getElementById(de))==null||N.scrollIntoView({block:"center"})},[T]);const L=d=>a.jsx(Ee,{prefix:Z,getSubUnitName:s,id:d.id,unitId:d.unitId,subUnitId:d.subUnitId,refStr:d.ref,type:n,showEdit:(T==null?void 0:T.commentId)===d.id,showHighlight:(T==null?void 0:T.commentId)===d.id,onClick:()=>{X.current=!1,d.resolved?R.executeCommand(W.id):R.executeCommand(W.id,{unitId:d.unitId,subUnitId:d.subUnitId,commentId:d.id,temp:!1})},onMouseEnter:()=>w==null?void 0:w(d),onMouseLeave:()=>p==null?void 0:p(d),onAddComment:y,onDeleteComment:U,onResolve:te=>l==null?void 0:l(d.id,te)},d.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[n===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:d=>D(d),options:[{value:"current",label:g.t("threadCommentUI.filter.sheet.current")},{value:"all",label:g.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:j,onChange:d=>P(d),options:[{value:"all",label:g.t("threadCommentUI.filter.status.all")},{value:"resolved",label:g.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:g.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:g.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(L),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(L),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?g.t("threadCommentUI.panel.filterEmpty"):g.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:E,type:"link",children:g.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:M,children:[a.jsx(Ie,{}),g.t("threadCommentUI.panel.addComment")]})]})]})};c.SetActiveCommentOperation=W,c.THREAD_COMMENT_PANEL=ce,c.ThreadCommentPanel=lt,c.ThreadCommentTree=Ee,c.ToggleSheetCommentPanelOperation=he,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
18
+ */var fe;function We(){if(fe)return Y;fe=1;var n=h,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(C,u,U){var f,p={},I=null,T=null;U!==void 0&&(I=""+U),u.key!==void 0&&(I=""+u.key),u.ref!==void 0&&(T=u.ref);for(f in u)r.call(u,f)&&!s.hasOwnProperty(f)&&(p[f]=u[f]);if(C&&C.defaultProps)for(f in u=C.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:C,key:I,ref:T,props:p,_owner:i.current}}return Y.Fragment=t,Y.jsx=l,Y.jsxs=l,Y}var pe;function ze(){return pe||(pe=1,me.exports=We()),me.exports}var a=ze(),M=function(){return M=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},M.apply(this,arguments)},Ze=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,s=n.extend,l=Ze(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),u=h.useRef("_".concat(Ke()));return ge(t,"".concat(r),{defIds:t.defIds,idSuffix:u.current},M({ref:e,className:C},l),s)});function ge(n,e,t,r,i){return h.createElement(n.tag,M(M({key:e},Je(n,t,i)),r),(Ge(n,t).children||[]).map(function(s,l){return ge(s,"".concat(e,"-").concat(n.tag,"-").concat(l),t,void 0,i)}))}function Je(n,e,t){var r=M({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(s){var l=s[0],C=s[1];typeof C=="string"&&(r[l]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function Ge(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?M(M({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?M(M({},i),{attrs:M(M({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function Ke(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var Ye={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:Ye}))});Ie.displayName="DeleteSingle";var Qe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:Qe}))});xe.displayName="IncreaseSingle";var Xe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:Xe}))});Se.displayName="MoreHorizontalSingle";var qe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:qe}))});ye.displayName="ReplyToCommentSingle";var $e={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:$e}))});be.displayName="ResolvedSingle";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:et}))});Te.displayName="SolveSingle";function _e(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=_e(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function tt(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=_e(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},nt=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},rt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),je=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let s=0;return t==null||t.forEach(l=>{s<l.startIndex&&i.push({type:"text",content:e.slice(s,l.startIndex)}),i.push({type:"mention",content:{label:e.slice(l.startIndex,l.endIndex).slice(1,-1),id:l.rangeId}}),s=l.endIndex}),i.push({type:"text",content:e.slice(s,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const s=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:s,properties:{}});break}}}),e+=`
19
+ \r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},it=(n,e,t,r,i)=>{var l,C;const s=(l=n.raw)==null?void 0:l.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[s?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:s}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var V;const{comment:t,onSave:r,id:i,onCancel:s,autoFocus:l,unitId:C}=n,u=o.useDependency(o.IMentionIOService),U=o.useDependency(o.ICommandService),f=o.useDependency(o.LocaleService),[p,I]=h.useState({...t}),[T,x]=h.useState(!1),y=h.useRef(null),D=o.useDependency(Re.DocSelectionManagerService),N=(V=o.useDependency(Me.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:V.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(v){var b;I({...t,text:v,attachments:[]}),(b=y.current)==null||b.inputElement.focus()}}));const S=()=>{var v;p.text&&(r==null||r({...p,text:p.text}),x(!1),I({text:void 0}),(v=y.current)==null||v.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:v=>v.preventDefault(),children:[a.jsx(E.Mentions,{ref:y,autoFocus:l,style:{width:"100%"},placeholder:f.t("threadCommentUI.editor.placeholder"),value:p!=null&&p.text?rt(je(p.text)):"",onChange:v=>{v.target.value||I({...t,text:void 0}),I==null||I({...t,text:Ue(nt(v.target.value))})},onFocus:()=>{const v=D.getActiveTextRange();v&&v.collapsed&&(N==null||N.removeAllRanges()),N==null||N.blur(),x(!0)},children:a.jsx(E.Mention,{trigger:"@",data:(v,b)=>u.list({search:v,unitId:C}).then(m=>m.list.map(H=>H.mentions.map(j=>({id:j.objectId,display:j.label,raw:j}))).flat()).then(b),displayTransform:(v,b)=>`@${b} `,renderSuggestion:it},"@")}),T?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(E.Button,{style:{marginRight:12},onClick:()=>{s==null||s(),x(!1),I({text:void 0}),U.executeCommand(W.id)},children:f.t("threadCommentUI.editor.cancel")}),a.jsx(E.Button,{type:"primary",disabled:!p.text,onClick:S,children:f.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),g={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ot=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:s,onReply:l,resolved:C,isRoot:u,onClose:U,onDeleteComment:f}=n,p=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),T=o.useDependency(o.UserManagerService),x=T.getUser(e.personId),y=k.useObservable(T.currentUser$),D=(y==null?void 0:y.userID)===e.personId,P=e.id===Ee,[N,S]=h.useState(!1),V=()=>{(f==null?void 0:f(e))!==!1&&(p.executeCommand(u?_.DeleteCommentTreeCommand.id:_.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),u&&(U==null||U()))};return a.jsxs("div",{className:g.threadCommentItem,onMouseLeave:()=>S(!1),onMouseEnter:()=>S(!0),children:[a.jsx("img",{className:g.threadCommentItemHead,src:x==null?void 0:x.avatar}),a.jsxs("div",{className:g.threadCommentItemTitle,children:[a.jsx("div",{className:g.threadCommentUsername,children:(x==null?void 0:x.name)||" "}),a.jsxs("div",{children:[P||C?null:N?a.jsx("div",{className:g.threadCommentIcon,onClick:()=>l(x),children:a.jsx(ye,{})}):null,D&&!P&&!C?a.jsx(E.Dropdown,{overlay:a.jsxs(E.Menu,{children:[a.jsx(E.MenuItem,{onClick:()=>s==null?void 0:s(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(E.MenuItem,{onClick:V,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:g.threadCommentIcon,children:a.jsx(Se,{})})}):null]})]}),a.jsx("div",{className:g.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>s==null?void 0:s(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:v,attachments:b})=>{s==null||s(!1),p.executeCommand(_.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:v,attachments:b}})}}):a.jsx("div",{className:g.threadCommentItemContent,children:je(e.text).map((v,b)=>{switch(v.type){case"mention":return a.jsxs("a",{className:g.threadCommentItemAt,children:["@",v.content.label," "]},b);default:return v.content}})})]})},Ne=n=>{var ae,ee,te;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:s=!0,onClick:l,showHighlight:C,onClose:u,getSubUnitName:U,prefix:f,autoFocus:p,onMouseEnter:I,onMouseLeave:T,onAddComment:x,onDeleteComment:y,onResolve:D}=n,P=o.useDependency(_.ThreadCommentModel),[N,S]=h.useState(!1),[V,v]=h.useState(""),b=h.useMemo(()=>P.commentUpdate$.pipe(re.debounceTime(16)),[P]);k.useObservable(b);const m=e?P.getCommentWithChildren(t,r,e):null,H=o.useDependency(o.ICommandService),j=o.useDependency(o.UserManagerService),A=m==null?void 0:m.root.resolved,w=k.useObservable(j.currentUser$),X=h.useRef(null),q=[...m?[m.root]:[{id:Ee,text:{dataStream:`
20
+ \r`},personId:(ae=w==null?void 0:w.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...(ee=m==null?void 0:m.children)!=null?ee:[]],Z=h.useRef(null),B=R=>{R.stopPropagation(),A?H.executeCommand(W.id,{unitId:t,subUnitId:r,commentId:e}):H.executeCommand(W.id),H.executeCommand(_.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!A}),D==null||D(!A)},$=R=>{R.stopPropagation(),H.executeCommand(W.id),!(m!=null&&m.root&&(y==null?void 0:y(m.root))===!1)&&(H.executeCommand(_.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),u==null||u())};h.useEffect(()=>T==null?void 0:T(),[]);const F=U((te=m==null?void 0:m.root.subUnitId)!=null?te:r),oe=s&&!V&&!A,K=`${i||(m==null?void 0:m.root.ref)||""}${F?" · ":""}${F}`;return a.jsxs("div",{className:tt(g.threadComment,{[g.threadCommentActive]:!A&&(C||N||f==="cell")}),onClick:l,id:`${f}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),S(!0)},onMouseLeave:()=>{T==null||T(),S(!1)},children:[!A&&C?a.jsx("div",{className:g.threadCommentHighlight}):null,a.jsxs("div",{className:g.threadCommentTitle,children:[a.jsxs("div",{className:g.threadCommentTitlePosition,children:[a.jsx("div",{className:g.threadCommentTitleHighlight}),a.jsx(E.Tooltip,{showIfEllipsis:!0,title:K,children:a.jsx("div",{className:g.threadCommentTitlePositionText,children:K})})]}),m?a.jsxs("div",{className:g.threadCommentIconContainer,children:[a.jsx("div",{onClick:B,className:g.threadCommentIcon,style:{color:A?"rgb(var(--green-500))":""},children:A?a.jsx(be,{}):a.jsx(Te,{})}),(w==null?void 0:w.userID)===m.root.personId?a.jsx("div",{className:g.threadCommentIcon,onClick:$,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:g.threadCommentContent,ref:Z,children:q.map(R=>a.jsx(ot,{onClose:u,unitId:t,subUnitId:r,item:R,isRoot:R.id===(m==null?void 0:m.root.id),editing:V===R.id,resolved:m==null?void 0:m.root.resolved,onEditingChange:L=>{v(L?R.id:"")},onReply:L=>{L&&requestAnimationFrame(()=>{var d;(d=X.current)==null||d.reply(Ue([{type:"mention",content:{id:L.userID,label:L.name}}]))})},onAddComment:x,onDeleteComment:y},R.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:X,unitId:t,subUnitId:r,onSave:async({text:R,attachments:L})=>{const d={text:R,attachments:L,dT:_.getDT(),id:o.generateRandomId(),ref:i,personId:w==null?void 0:w.userID,parentId:m==null?void 0:m.root.id,unitId:t,subUnitId:r,threadId:m==null?void 0:m.root.threadId};(x==null?void 0:x(d))!==!1&&(await H.executeCommand(_.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:d}),Z.current&&(Z.current.scrollTop=Z.current.scrollHeight))},autoFocus:p||!m,onCancel:()=>{m||u==null||u()}},`${p}`)}):null]})},Q={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},at=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:s,onResolve:l,sortComments:C,onItemLeave:u,onItemEnter:U,disableAdd:f,tempComment:p,onAddComment:I,onDeleteComment:T,showComments:x}=n,[y,D]=h.useState("all"),[P,N]=h.useState("all"),S=o.useDependency(o.LocaleService),V=o.useDependency(o.UserManagerService),v=o.useDependency(_.ThreadCommentModel),[b,m]=h.useState(()=>v.getUnit(e)),H=o.useDependency(c.ThreadCommentPanelService),j=k.useObservable(H.activeCommentId$),A=k.useObservable(v.commentUpdate$),w=o.useDependency(o.ICommandService),X=k.useObservable(t),q=h.useRef(!0),Z="panel",B=k.useObservable(V.currentUser$),$=h.useMemo(()=>{var de;const d=y==="all"?b:(de=b.filter(O=>O.subUnitId===X))!=null?de:[],ne=C!=null?C:O=>O,se=d.map(O=>{var J;return{...O.root,children:(J=O.children)!=null?J:[],users:O.relativeUsers}});if(x){const O=new Map;return se.forEach(J=>{O.set(J.id,J)}),[...x,""].map(J=>O.get(J)).filter(Boolean)}else return ne(se)},[x,y,b,C,X]),F=h.useMemo(()=>[...$.filter(d=>!d.resolved),...$.filter(d=>d.resolved)],[$]),oe=h.useMemo(()=>P==="resolved"?F.filter(d=>d.resolved):P==="unsolved"?F.filter(d=>!d.resolved):P==="concern_me"&&B!=null&&B.userID?F.filter(d=>d==null?void 0:d.users.has(B.userID)):F,[F,B==null?void 0:B.userID,P]),K=p?[p,...oe]:oe,ae=K.filter(d=>!d.resolved),ee=K.filter(d=>d.resolved),te=P!=="all"||y!=="all",R=()=>{N("all"),D("all")};h.useEffect(()=>{e&&m(v.getUnit(e))},[e,v,A]),h.useEffect(()=>{var O;if(!j)return;if(!q.current){q.current=!0;return}const{unitId:d,subUnitId:ne,commentId:se}=j,de=`${Z}-${d}-${ne}-${se}`;(O=document.getElementById(de))==null||O.scrollIntoView({block:"center"})},[j]);const L=d=>a.jsx(Ne,{prefix:Z,getSubUnitName:s,id:d.id,unitId:d.unitId,subUnitId:d.subUnitId,refStr:d.ref,type:r,showEdit:(j==null?void 0:j.commentId)===d.id,showHighlight:(j==null?void 0:j.commentId)===d.id,onClick:()=>{q.current=!1,d.resolved?w.executeCommand(W.id):w.executeCommand(W.id,{unitId:d.unitId,subUnitId:d.subUnitId,commentId:d.id,temp:!1})},onMouseEnter:()=>U==null?void 0:U(d),onMouseLeave:()=>u==null?void 0:u(d),onAddComment:I,onDeleteComment:T,onResolve:ne=>l==null?void 0:l(d.id,ne)},d.id);return a.jsxs("div",{className:Q.threadCommentPanel,children:[a.jsxs("div",{className:Q.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(E.Select,{borderless:!0,value:y,onChange:d=>D(d),options:[{value:"current",label:S.t("threadCommentUI.filter.sheet.current")},{value:"all",label:S.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(E.Select,{borderless:!0,value:P,onChange:d=>N(d),options:[{value:"all",label:S.t("threadCommentUI.filter.status.all")},{value:"resolved",label:S.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:S.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:S.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(L),ee.length?a.jsx("div",{className:Q.threadCommentPanelSolved,children:"已解决"}):null,ee.map(L),K.length?null:a.jsxs("div",{className:Q.threadCommentPanelEmpty,children:[te?S.t("threadCommentUI.panel.filterEmpty"):S.t("threadCommentUI.panel.empty"),te?a.jsx(E.Button,{onClick:R,type:"link",children:S.t("threadCommentUI.panel.reset")}):a.jsxs(E.Button,{id:"thread-comment-add",className:Q.threadCommentPanelAdd,type:"primary",onClick:i,disabled:f,children:[a.jsx(xe,{}),S.t("threadCommentUI.panel.addComment")]})]})]})};c.SetActiveCommentOperation=W,c.THREAD_COMMENT_PANEL=he,c.ThreadCommentPanel=at,c.ThreadCommentTree=Ne,c.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
21
21
 
22
22
 
23
23
  // @univerjs/sheets-thread-comment-ui/index
24
- (function(c,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/engine-render"),require("react"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-thread-comment","@univerjs/thread-comment-ui","@univerjs/sheets-ui","@univerjs/ui","rxjs","@univerjs/engine-render","react","@univerjs/engine-formula","@univerjs/thread-comment"],a):(c=typeof globalThis<"u"?globalThis:c||self,a(c.UniverSheetsThreadCommentUi={},c.UniverCore,c.UniverSheets,c.UniverSheetsThreadComment,c.UniverThreadCommentUi,c.UniverSheetsUi,c.UniverUi,c.rxjs,c.UniverEngineRender,c.React,c.UniverEngineFormula,c.UniverThreadComment))})(this,function(c,a,p,A,P,I,f,k,re,E,$,C){"use strict";var st=Object.defineProperty;var at=(c,a,p)=>a in c?st(c,a,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[a]=p;var N=(c,a,p)=>at(c,typeof a!="symbol"?a+"":a,p);const ie="univer.sheet.thread-comment-modal",J="comment-single",Q="SHEET_THREAD_COMMENT";var ve=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,_e=(i,t,r,e)=>{for(var n=e>1?void 0:e?Se(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&ve(t,r,n),n},oe=(i,t)=>(r,e)=>t(r,e,i);c.SheetsThreadCommentPopupService=class extends a.Disposable{constructor(r,e){super();N(this,"_lastPopup",null);N(this,"_activePopup");N(this,"_activePopup$",new k.BehaviorSubject(null));N(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=r,this._zenZoneService=e,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(r=>{r&&this.hidePopup()}))}showPopup(r,e){var l;const{row:n,col:o,unitId:s,subUnitId:d}=r;if(this._activePopup&&n===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&d===((l=this.activePopup)==null?void 0:l.subUnitId)){this._activePopup=r,this._activePopup$.next(r);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=r,this._activePopup$.next(r);const u=this._canvasPopupManagerService.attachPopupToCell(n,o,{componentKey:ie,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!u)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const m=new a.DisposableCollection;m.add(u),m.add({dispose:()=>{e==null||e()}}),this._lastPopup=m}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}},c.SheetsThreadCommentPopupService=_e([oe(0,a.Inject(I.SheetCanvasPopManagerService)),oe(1,f.IZenZoneService)],c.SheetsThreadCommentPopupService);const B={type:a.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(i){var g;const t=i.get(p.SheetsSelectionsService),r=i.get(a.IUniverInstanceService),e=i.get(c.SheetsThreadCommentPopupService),n=i.get(P.ThreadCommentPanelService),o=(g=t.getCurrentLastSelection())==null?void 0:g.primary,s=i.get(A.SheetsThreadCommentModel);if(!o)return!1;const d=p.getSheetCommandTarget(r);if(!d)return!1;const{workbook:u,worksheet:m,unitId:l,subUnitId:h}=d,v={workbook:u,worksheet:m,unitId:l,subUnitId:h,row:o.startRow,col:o.startColumn};e.showPopup(v);const _=s.getByLocation(l,h,o.startRow,o.startColumn);return _&&n.setActiveComment({unitId:l,subUnitId:h,commentId:_,trigger:"context-menu"}),!0}},fe="sheets-thread-comment.config",Ce={};var Ie=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Pe=(i,t,r,e)=>{for(var n=e>1?void 0:e?ge(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&Ie(t,r,n),n},L=(i,t)=>(r,e)=>t(r,e,i);let x=class extends a.Disposable{constructor(i,t,r,e){super(),this._sheetInterceptorService=i,this._sheetsThreadCommentModel=t,this._univerInstanceService=r,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(p.INTERCEPTOR_POINT.CELL_CONTENT,{effect:a.InterceptorEffectEnum.Style,handler:(i,t,r)=>{const{row:e,col:n,unitId:o,subUnitId:s}=t;return this._sheetsThreadCommentModel.showCommentMarker(o,s,e,n)?r({...i,markers:{...i==null?void 0:i.markers,tr:{color:"#FFBD37",size:6}}}):r(i)},priority:100}))}_initSkeletonChange(){const i=()=>{var n;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!t)return;const r=t.getUnitId(),e=this._renderManagerService.getRenderById(r);(n=e==null?void 0:e.mainComponent)==null||n.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(k.debounceTime(16)).subscribe(()=>{i()}))}};x=Pe([L(0,a.Inject(p.SheetInterceptorService)),L(1,a.Inject(A.SheetsThreadCommentModel)),L(2,a.IUniverInstanceService),L(3,re.IRenderManagerService)],x);var y=function(){return y=Object.assign||function(i){for(var t,r=1,e=arguments.length;r<e;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},y.apply(this,arguments)},Te=function(i,t){var r={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&t.indexOf(e)<0&&(r[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(i);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(i,e[n])&&(r[e[n]]=i[e[n]]);return r},se=E.forwardRef(function(i,t){var r=i.icon,e=i.id,n=i.className,o=i.extend,s=Te(i,["icon","id","className","extend"]),d="univerjs-icon univerjs-icon-".concat(e," ").concat(n||"").trim(),u=E.useRef("_".concat(Me()));return ae(r,"".concat(e),{defIds:r.defIds,idSuffix:u.current},y({ref:t,className:d},s),o)});function ae(i,t,r,e,n){return E.createElement(i.tag,y(y({key:t},be(i,r,n)),e),(ye(i,r).children||[]).map(function(o,s){return ae(o,"".concat(t,"-").concat(i.tag,"-").concat(s),r,void 0,n)}))}function be(i,t,r){var e=y({},i.attrs);r!=null&&r.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=r.colorChannel1);var n=t.defIds;return!n||n.length===0||(i.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+t.idSuffix),Object.entries(e).forEach(function(o){var s=o[0],d=o[1];typeof d=="string"&&(e[s]=d.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),e}function ye(i,t){var r,e=t.defIds;return!e||e.length===0?i:i.tag==="defs"&&(!((r=i.children)===null||r===void 0)&&r.length)?y(y({},i),{children:i.children.map(function(n){return typeof n.attrs.id=="string"&&e&&e.indexOf(n.attrs.id)>-1?y(y({},n),{attrs:y(y({},n.attrs),{id:n.attrs.id+t.idSuffix})}):n})}):i}function Me(){return Math.random().toString(36).substring(2,8)}se.displayName="UniverIcon";var we={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"}}]},ce=E.forwardRef(function(i,t){return E.createElement(se,Object.assign({},i,{id:"comment-single",ref:t,icon:we}))});ce.displayName="CommentSingle";var de={exports:{}},W={};/**
24
+ (function(d,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-thread-comment"),require("@univerjs/thread-comment-ui"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("@univerjs/engine-render"),require("@univerjs/engine-formula"),require("@univerjs/thread-comment"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-thread-comment","@univerjs/thread-comment-ui","@univerjs/sheets-ui","@univerjs/ui","rxjs","@univerjs/engine-render","@univerjs/engine-formula","@univerjs/thread-comment","react"],a):(d=typeof globalThis<"u"?globalThis:d||self,a(d.UniverSheetsThreadCommentUi={},d.UniverCore,d.UniverSheets,d.UniverSheetsThreadComment,d.UniverThreadCommentUi,d.UniverSheetsUi,d.UniverUi,d.rxjs,d.UniverEngineRender,d.UniverEngineFormula,d.UniverThreadComment,d.React))})(this,function(d,a,v,A,P,I,f,k,ie,$,C,E){"use strict";var rt=Object.defineProperty;var it=(d,a,v)=>a in d?rt(d,a,{enumerable:!0,configurable:!0,writable:!0,value:v}):d[a]=v;var N=(d,a,v)=>it(d,typeof a!="symbol"?a+"":a,v);const oe="univer.sheet.thread-comment-modal",K="comment-single",Q="SHEET_THREAD_COMMENT";var Se=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,fe=(i,t,n,e)=>{for(var r=e>1?void 0:e?_e(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Se(t,n,r),r},se=(i,t)=>(n,e)=>t(n,e,i);d.SheetsThreadCommentPopupService=class extends a.Disposable{constructor(n,e){super();N(this,"_lastPopup",null);N(this,"_activePopup");N(this,"_activePopup$",new k.BehaviorSubject(null));N(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=n,this._zenZoneService=e,this._initZenVisible(),this.disposeWithMe(()=>{this._activePopup$.complete()})}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(n=>{n&&this.hidePopup()}))}showPopup(n,e){var m;const{row:r,col:o,unitId:s,subUnitId:c}=n;if(this._activePopup&&r===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&c===((m=this.activePopup)==null?void 0:m.subUnitId)){this._activePopup=n,this._activePopup$.next(n);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=n,this._activePopup$.next(n);const u=this._canvasPopupManagerService.attachPopupToCell(r,o,{componentKey:oe,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!u)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const h=new a.DisposableCollection;h.add(u),h.add({dispose:()=>{e==null||e()}}),this._lastPopup=h}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}},d.SheetsThreadCommentPopupService=fe([se(0,a.Inject(I.SheetCanvasPopManagerService)),se(1,f.IZenZoneService)],d.SheetsThreadCommentPopupService);const B={type:a.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(i){var g;const t=i.get(v.SheetsSelectionsService),n=i.get(a.IUniverInstanceService),e=i.get(d.SheetsThreadCommentPopupService),r=i.get(P.ThreadCommentPanelService),o=(g=t.getCurrentLastSelection())==null?void 0:g.primary,s=i.get(A.SheetsThreadCommentModel);if(!o)return!1;const c=v.getSheetCommandTarget(n);if(!c)return!1;const{workbook:u,worksheet:h,unitId:m,subUnitId:l}=c,p={workbook:u,worksheet:h,unitId:m,subUnitId:l,row:o.startRow,col:o.startColumn};e.showPopup(p);const S=s.getByLocation(m,l,o.startRow,o.startColumn);return S&&r.setActiveComment({unitId:m,subUnitId:l,commentId:S,trigger:"context-menu"}),!0}},Ce="sheets-thread-comment.config",Ie={};var ge=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Te=(i,t,n,e)=>{for(var r=e>1?void 0:e?Pe(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&ge(t,n,r),r},L=(i,t)=>(n,e)=>t(n,e,i);let W=class extends a.Disposable{constructor(i,t,n,e){super(),this._sheetInterceptorService=i,this._sheetsThreadCommentModel=t,this._univerInstanceService=n,this._renderManagerService=e,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(v.INTERCEPTOR_POINT.CELL_CONTENT,{effect:a.InterceptorEffectEnum.Style,handler:(i,t,n)=>{const{row:e,col:r,unitId:o,subUnitId:s}=t;return this._sheetsThreadCommentModel.showCommentMarker(o,s,e,r)?n({...i,markers:{...i==null?void 0:i.markers,tr:{color:"#FFBD37",size:6}}}):n(i)},priority:100}))}_initSkeletonChange(){const i=()=>{var r;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!t)return;const n=t.getUnitId(),e=this._renderManagerService.getRenderById(n);(r=e==null?void 0:e.mainComponent)==null||r.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(k.debounceTime(16)).subscribe(()=>{i()}))}};W=Te([L(0,a.Inject(v.SheetInterceptorService)),L(1,a.Inject(A.SheetsThreadCommentModel)),L(2,a.IUniverInstanceService),L(3,ie.IRenderManagerService)],W);var be=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Me=(i,t,n,e)=>{for(var r=e>1?void 0:e?ye(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&be(t,n,r),r},X=(i,t)=>(n,e)=>t(n,e,i);const we=(i,t,n)=>{const e=$.singleReferenceToGrid(i),r=n.row-t.row,o=n.column-t.column,s={startColumn:e.column+o,startRow:e.row+r,endColumn:e.column+o,endRow:e.row+r};return $.serializeRange(s)};let F=class extends a.Disposable{constructor(t,n,e){super();N(this,"_copyInfo");this._sheetClipboardService=t,this._sheetsThreadCommentModel=n,this._threadCommentDataSourceService=e,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Q,onBeforeCopy:(t,n,e)=>{this._copyInfo={unitId:t,subUnitId:n,range:e}},onPasteCells:(t,n,e,r)=>{const{unitId:o,subUnitId:s,range:c}=n,u={row:c.rows[0],column:c.cols[0]};if(r.copyType===I.COPY_TYPE.CUT&&this._copyInfo){const{range:h,unitId:m,subUnitId:l}=this._copyInfo,p={row:h.startRow,column:h.startColumn};if(!(o===m&&s===l)){const S=[];a.Range.foreach(h,(w,_)=>{const R=this._sheetsThreadCommentModel.getAllByLocation(m,l,w,_);this._threadCommentDataSourceService.syncUpdateMutationToColla?R.forEach(T=>{S.push(T)}):R.forEach(({children:T,...j})=>{j.parentId||S.push(j)})});const g=[],M=[],V=[],H=[],re=w=>{g.unshift({id:C.DeleteCommentMutation.id,params:{unitId:m,subUnitId:l,commentId:w.id}}),V.push({id:C.AddCommentMutation.id,params:{unitId:o,subUnitId:s,comment:{...w,ref:we(w.ref,p,u),unitId:o,subUnitId:s},sync:!0}}),M.push({id:C.AddCommentMutation.id,params:{unitId:m,subUnitId:l,comment:w,sync:!0}}),H.unshift({id:C.DeleteCommentMutation.id,params:{unitId:o,subUnitId:s,commentId:w.id}})};return S.forEach(w=>{re(w)}),{redos:[...g,...V],undos:[...H,...M]}}}return{redos:[],undos:[]}}}))}};F=Me([X(0,a.Inject(I.ISheetClipboardService)),X(1,a.Inject(A.SheetsThreadCommentModel)),X(2,C.IThreadCommentDataSourceService)],F);var Re=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,Oe=(i,t,n,e)=>{for(var r=e>1?void 0:e?Ee(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Re(t,n,r),r},G=(i,t)=>(n,e)=>t(n,e,i);let Z=class extends a.Disposable{constructor(i,t,n,e){super(),this._hoverManagerService=i,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=n,this._sheetPermissionInterceptorBaseController=e,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(k.debounceTime(100)).subscribe(i=>{const t=this._sheetsThreadCommentPopupService.activePopup;if(i&&(t&&t.temp||!t)){const{location:n}=i,{unitId:e,subUnitId:r,row:o,col:s}=n,c=this._sheetsThreadCommentModel.getByLocation(e,r,o,s);if(c){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}]))return;const h=this._sheetsThreadCommentModel.getComment(e,r,c);h&&!h.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:r,row:o,col:s,commentId:c,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};Z=Oe([G(0,a.Inject(I.HoverManagerService)),G(1,a.Inject(d.SheetsThreadCommentPopupService)),G(2,a.Inject(A.SheetsThreadCommentModel)),G(3,a.Inject(I.SheetPermissionInterceptorBaseController))],Z);var Ue=Object.defineProperty,je=Object.getOwnPropertyDescriptor,De=(i,t,n,e)=>{for(var r=e>1?void 0:e?je(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Ue(t,n,r),r},U=(i,t)=>(n,e)=>t(n,e,i);let z=class extends a.Disposable{constructor(t,n,e,r,o,s,c,u,h,m){super();N(this,"_isSwitchToCommenting",!1);N(this,"_selectionShapeInfo",null);this._commandService=t,this._sheetsThreadCommentPopupService=n,this._sheetsThreadCommentModel=e,this._threadCommentPanelService=r,this._univerInstanceService=o,this._sheetPermissionInterceptorBaseController=s,this._markSelectionService=c,this._sheetSelectionService=u,this._editorBridgeService=h,this._renderManagerService=m,this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(t,n,e){var p,S,g;const r=(p=t[0])==null?void 0:p.range,o=this._renderManagerService.getRenderById(n),s=(S=o==null?void 0:o.with(I.SheetSkeletonManagerService).getWorksheetSkeleton(e))==null?void 0:S.skeleton;if(!s||!r)return;const c=s.getCellWithCoordByIndex(r.startRow,r.startColumn);if((((g=r.rangeType)!=null?g:a.RANGE_TYPE.NORMAL)!==a.RANGE_TYPE.NORMAL||r.endColumn-r.startColumn>0||r.endRow-r.startRow>0)&&!((c.isMerged||c.isMergedMainCell)&&a.Rectangle.equals(c.mergeInfo,r))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const h=c.actualRow,m=c.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,e,h,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const l=this._sheetsThreadCommentModel.getByLocation(n,e,h,m);l&&this._commandService.executeCommand(P.SetActiveCommentOperation.id,{unitId:n,subUnitId:e,commentId:l})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(t=>{if(this._isSwitchToCommenting)return;const n=this._sheetSelectionService.currentSelectionParam;n&&this._handleSelectionChange(t,n.unitId,n.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(t=>{t.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(t=>{if(t.id===C.DeleteCommentMutation.id){const n=t.params,e=this._sheetsThreadCommentPopupService.activePopup;if(!e)return;const{unitId:r,subUnitId:o,commentId:s}=e;n.unitId===r&&n.subUnitId===o&&n.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async t=>{var n;if(t){const{unitId:e,subUnitId:r,commentId:o,trigger:s}=t,c=this._sheetsThreadCommentModel.getComment(e,r,o);if(!c||c.resolved)return;const u=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!u||u.getUnitId()!==e)return;this._isSwitchToCommenting=!0,((n=u.getActiveSheet())==null?void 0:n.getSheetId())!==r&&await this._commandService.executeCommand(v.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:r}),this._isSwitchToCommenting=!1;const l=$.singleReferenceToGrid(c.ref),{row:p,column:S}=l;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]},[{startRow:p,startColumn:S,endRow:p,endColumn:S}]))return;const M=1;if(await this._commandService.executeCommand(I.ScrollToRangeOperation.id,{range:{startRow:Math.max(l.row-M,0),endRow:l.row+M,startColumn:Math.max(l.column-M,0),endColumn:l.column+M}}),this._editorBridgeService.isVisible().visible)return;this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:r,row:l.row,col:l.column,commentId:c.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(k.debounceTime(100)).subscribe(t=>{var p,S;if(!t){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}const{unitId:n,subUnitId:e,commentId:r}=t;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);const o=this._sheetsThreadCommentModel.getComment(n,e,r);if(!o)return;const s=$.singleReferenceToGrid(o.ref),{row:c,column:u}=s;if(Number.isNaN(c)||Number.isNaN(u))return null;const h=(p=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:p.getSheetBySheetId(e),m=(S=h==null?void 0:h.getMergedCell(c,u))!=null?S:{startColumn:u,endColumn:u,startRow:c,endRow:c},l=this._markSelectionService.addShape({range:m,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null},[],-1);l&&(this._selectionShapeInfo={...t,shapeId:l})}))}};z=De([U(0,a.ICommandService),U(1,a.Inject(d.SheetsThreadCommentPopupService)),U(2,a.Inject(A.SheetsThreadCommentModel)),U(3,a.Inject(P.ThreadCommentPanelService)),U(4,a.IUniverInstanceService),U(5,a.Inject(I.SheetPermissionInterceptorBaseController)),U(6,I.IMarkSelectionService),U(7,a.Inject(v.SheetsSelectionsService)),U(8,I.IEditorBridgeService),U(9,ie.IRenderManagerService)],z);var Ne=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,Ve=(i,t,n,e)=>{for(var r=e>1?void 0:e?Ae(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Ne(t,n,r),r},q=(i,t)=>(n,e)=>t(n,e,i);let Y=class extends a.Disposable{constructor(i,t,n,e){super(),this._sheetInterceptorService=i,this._univerInstanceService=t,this._threadCommentModel=n,this._threadCommentDataSourceService=e,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{var t;if(i.id===v.RemoveSheetCommand.id){const n=i.params,e=n.unitId?this._univerInstanceService.getUnit(n.unitId):this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!e)return{redos:[],undos:[]};const r=e.getUnitId(),o=n.subUnitId||((t=e.getActiveSheet())==null?void 0:t.getSheetId());if(!o)return{redos:[],undos:[]};const s=this._threadCommentModel.ensureMap(r,o),c=Array.from(s.values()).filter(p=>!p.parentId),u=c.map(p=>p.id),h=this._threadCommentDataSourceService.syncUpdateMutationToColla,m=u.map(p=>({id:C.DeleteCommentMutation.id,params:{unitId:r,subUnitId:o,commentId:p}})),l=c.map(({children:p,...S})=>({id:C.AddCommentMutation.id,params:{unitId:r,subUnitId:o,comment:{...S,children:h?p:void 0},sync:!h}}));return{redos:m,undos:l}}return{redos:[],undos:[]}}}))}};Y=Ve([q(0,a.Inject(v.SheetInterceptorService)),q(1,a.IUniverInstanceService),q(2,a.Inject(C.ThreadCommentModel)),q(3,C.IThreadCommentDataSourceService)],Y);var y=function(){return y=Object.assign||function(i){for(var t,n=1,e=arguments.length;n<e;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},y.apply(this,arguments)},$e=function(i,t){var n={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&t.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(i);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(i,e[r])&&(n[e[r]]=i[e[r]]);return n},ae=E.forwardRef(function(i,t){var n=i.icon,e=i.id,r=i.className,o=i.extend,s=$e(i,["icon","id","className","extend"]),c="univerjs-icon univerjs-icon-".concat(e," ").concat(r||"").trim(),u=E.useRef("_".concat(xe()));return ce(n,"".concat(e),{defIds:n.defIds,idSuffix:u.current},y({ref:t,className:c},s),o)});function ce(i,t,n,e,r){return E.createElement(i.tag,y(y({key:t},Be(i,n,r)),e),(ke(i,n).children||[]).map(function(o,s){return ce(o,"".concat(t,"-").concat(i.tag,"-").concat(s),n,void 0,r)}))}function Be(i,t,n){var e=y({},i.attrs);n!=null&&n.colorChannel1&&e.fill==="colorChannel1"&&(e.fill=n.colorChannel1);var r=t.defIds;return!r||r.length===0||(i.tag==="use"&&e["xlink:href"]&&(e["xlink:href"]=e["xlink:href"]+t.idSuffix),Object.entries(e).forEach(function(o){var s=o[0],c=o[1];typeof c=="string"&&(e[s]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),e}function ke(i,t){var n,e=t.defIds;return!e||e.length===0?i:i.tag==="defs"&&(!((n=i.children)===null||n===void 0)&&n.length)?y(y({},i),{children:i.children.map(function(r){return typeof r.attrs.id=="string"&&e&&e.indexOf(r.attrs.id)>-1?y(y({},r),{attrs:y(y({},r.attrs),{id:r.attrs.id+t.idSuffix})}):r})}):i}function xe(){return Math.random().toString(36).substring(2,8)}ae.displayName="UniverIcon";var He={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"}}]},ue=E.forwardRef(function(i,t){return E.createElement(ae,Object.assign({},i,{id:"comment-single",ref:t,icon:He}))});ue.displayName="CommentSingle";var ee={exports:{}},x={};/**
25
25
  * @license React
26
26
  * react-jsx-runtime.production.min.js
27
27
  *
@@ -29,11 +29,11 @@
29
29
  *
30
30
  * This source code is licensed under the MIT license found in the
31
31
  * LICENSE file in the root directory of this source tree.
32
- */var Oe=E,Ee=Symbol.for("react.element"),Re=Symbol.for("react.fragment"),Ue=Object.prototype.hasOwnProperty,je=Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,De={key:!0,ref:!0,__self:!0,__source:!0};function ue(i,t,r){var e,n={},o=null,s=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(e in t)Ue.call(t,e)&&!De.hasOwnProperty(e)&&(n[e]=t[e]);if(i&&i.defaultProps)for(e in t=i.defaultProps,t)n[e]===void 0&&(n[e]=t[e]);return{$$typeof:Ee,type:i,key:o,ref:s,props:n,_owner:je.current}}W.Fragment=Re,W.jsx=ue,W.jsxs=ue,de.exports=W;var me=de.exports;const Ne=()=>{const i=a.useDependency(a.IUniverInstanceService),t=a.useDependency(c.SheetsThreadCommentPopupService),r=f.useObservable(t.activePopup$),e=a.useDependency(A.SheetsThreadCommentModel);if(f.useObservable(e.commentUpdate$),!r)return null;const{row:n,col:o,unitId:s,subUnitId:d,trigger:u}=r,m=e.getByLocation(s,d,n,o),l=`${a.Tools.chatAtABC(o)}${n+1}`,h=()=>{t.hidePopup()},v=_=>{var g,M,V;return(V=(M=(g=i.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:g.getSheetBySheetId(_))==null?void 0:M.getName())!=null?V:""};return me.jsx(P.ThreadCommentTree,{onClick:()=>{t.persistPopup()},prefix:"cell",id:m,unitId:s,subUnitId:d,type:a.UniverInstanceType.UNIVER_SHEET,refStr:l,onClose:h,getSubUnitName:v,autoFocus:u==="context-menu"})},Ae=()=>{var w;const i=a.useDependency(I.IMarkSelectionService),t=a.useDependency(a.IUniverInstanceService),r=a.useDependency(c.SheetsThreadCommentPopupService),e=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),n=e.getUnitId(),o=a.useDependency(a.ICommandService),s=E.useMemo(()=>e.activeSheet$.pipe(k.map(S=>S==null?void 0:S.getSheetId())),[e.activeSheet$]),d=f.useObservable(s,(w=e.getActiveSheet())==null?void 0:w.getSheetId()),u=E.useRef(),m=a.useDependency(P.ThreadCommentPanelService),l=f.useObservable(m.activeCommentId$),h=f.useObservable(m.panelVisible$,m.panelVisible),v=E.useCallback(S=>{const O=e.getSheets(),T={};O.forEach((R,b)=>{T[R.getSheetId()]=b});const j=R=>R.map(b=>{var pe;const D=$.singleReferenceToGrid(b.ref),ot=[(pe=T[b.subUnitId])!=null?pe:0,D.row,D.column];return{...b,p:ot}}).sort((b,D)=>b.p[0]===D.p[0]?b.p[1]===D.p[1]?b.p[2]-D.p[2]:b.p[1]-D.p[1]:b.p[0]-D.p[0]);return[...j(S.filter(R=>!R.resolved)),...j(S.filter(R=>R.resolved))]},[e]),_=E.useCallback(S=>{var O;if(S.unitId===n&&S.subUnitId===d&&!S.resolved){const{row:T,column:j}=$.singleReferenceToGrid(S.ref),R=e.getSheetBySheetId(S.subUnitId),b=(O=R==null?void 0:R.getMergedCell(T,j))!=null?O:{startColumn:j,endColumn:j,startRow:T,endRow:T};if(!Number.isNaN(T)&&!Number.isNaN(j))return i.addShape({range:b,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[i,d,n]),g=S=>{var O,T;return(T=(O=e.getSheetBySheetId(S))==null?void 0:O.getName())!=null?T:""},M=()=>{o.executeCommand(B.id)},V=S=>{l&&l.unitId===S.unitId&&l.subUnitId===S.subUnitId&&l.commentId===S.id||(u.current&&(i.removeShape(u.current),u.current=null),u.current=_(S))},H=()=>{u.current&&(i.removeShape(u.current),u.current=null)},ne=(S,O)=>{O&&r.hidePopup()};return E.useEffect(()=>{!h&&u.current&&i.removeShape(u.current)},[i,h]),me.jsx(P.ThreadCommentPanel,{unitId:n,subUnitId$:s,type:a.UniverInstanceType.UNIVER_SHEET,onAdd:M,getSubUnitName:g,onResolve:ne,sortComments:v,onItemEnter:V,onItemLeave:H,onDeleteComment:()=>(H(),!0)})},Ve=i=>({id:B.id,type:f.MenuItemType.BUTTON,icon:J,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET),disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]})}),$e=i=>({id:P.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:J,tooltip:"sheetThreadComment.menu.commentManagement",disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET)}),Be={id:B.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:I.whenSheetEditorFocused},ke={[f.RibbonStartGroup.OTHERS]:{[P.ToggleSheetCommentPanelOperation.id]:{order:1,menuItemFactory:$e}},[f.ContextMenuPosition.MAIN_AREA]:{[f.ContextMenuGroup.OTHERS]:{[B.id]:{order:0,menuItemFactory:Ve}}}};var He=Object.defineProperty,Le=Object.getOwnPropertyDescriptor,xe=(i,t,r,e)=>{for(var n=e>1?void 0:e?Le(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&He(t,r,n),n},X=(i,t)=>(r,e)=>t(r,e,i);let F=class extends a.Disposable{constructor(i,t,r){super(),this._menuManagerService=i,this._componentManager=t,this._shortcutService=r,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(Be)}_initMenu(){this._menuManagerService.mergeMenu(ke)}_initComponent(){[[ie,Ne],[P.THREAD_COMMENT_PANEL,Ae],[J,ce]].forEach(([i,t])=>{this._componentManager.register(i,t)})}};F=xe([X(0,f.IMenuManagerService),X(1,a.Inject(f.ComponentManager)),X(2,f.IShortcutService)],F);var We=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,Ge=(i,t,r,e)=>{for(var n=e>1?void 0:e?Fe(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&We(t,r,n),n},ee=(i,t)=>(r,e)=>t(r,e,i);const Ze=(i,t,r)=>{const e=$.singleReferenceToGrid(i),n=r.row-t.row,o=r.column-t.column,s={startColumn:e.column+o,startRow:e.row+n,endColumn:e.column+o,endRow:e.row+n};return $.serializeRange(s)};let G=class extends a.Disposable{constructor(t,r,e){super();N(this,"_copyInfo");this._sheetClipboardService=t,this._sheetsThreadCommentModel=r,this._threadCommentDataSourceService=e,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Q,onBeforeCopy:(t,r,e)=>{this._copyInfo={unitId:t,subUnitId:r,range:e}},onPasteCells:(t,r,e,n)=>{const{unitId:o,subUnitId:s,range:d}=r,u={row:d.rows[0],column:d.cols[0]};if(n.copyType===I.COPY_TYPE.CUT&&this._copyInfo){const{range:m,unitId:l,subUnitId:h}=this._copyInfo,v={row:m.startRow,column:m.startColumn};if(!(o===l&&s===h)){const _=[];a.Range.foreach(m,(w,S)=>{const O=this._sheetsThreadCommentModel.getAllByLocation(l,h,w,S);this._threadCommentDataSourceService.syncUpdateMutationToColla?O.forEach(T=>{_.push(T)}):O.forEach(({children:T,...j})=>{j.parentId||_.push(j)})});const g=[],M=[],V=[],H=[],ne=w=>{g.unshift({id:C.DeleteCommentMutation.id,params:{unitId:l,subUnitId:h,commentId:w.id}}),V.push({id:C.AddCommentMutation.id,params:{unitId:o,subUnitId:s,comment:{...w,ref:Ze(w.ref,v,u),unitId:o,subUnitId:s},sync:!0}}),M.push({id:C.AddCommentMutation.id,params:{unitId:l,subUnitId:h,comment:w,sync:!0}}),H.unshift({id:C.DeleteCommentMutation.id,params:{unitId:o,subUnitId:s,commentId:w.id}})};return _.forEach(w=>{ne(w)}),{redos:[...g,...V],undos:[...H,...M]}}}return{redos:[],undos:[]}}}))}};G=Ge([ee(0,a.Inject(I.ISheetClipboardService)),ee(1,a.Inject(A.SheetsThreadCommentModel)),ee(2,C.IThreadCommentDataSourceService)],G);var ze=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,Ke=(i,t,r,e)=>{for(var n=e>1?void 0:e?Ye(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&ze(t,r,n),n},Z=(i,t)=>(r,e)=>t(r,e,i);let z=class extends a.Disposable{constructor(i,t,r,e){super(),this._hoverManagerService=i,this._sheetsThreadCommentPopupService=t,this._sheetsThreadCommentModel=r,this._sheetPermissionInterceptorBaseController=e,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(k.debounceTime(100)).subscribe(i=>{const t=this._sheetsThreadCommentPopupService.activePopup;if(i&&(t&&t.temp||!t)){const{location:r}=i,{unitId:e,subUnitId:n,row:o,col:s}=r,d=this._sheetsThreadCommentModel.getByLocation(e,n,o,s);if(d){if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]},[{startRow:o,startColumn:s,endRow:o,endColumn:s}]))return;const m=this._sheetsThreadCommentModel.getComment(e,n,d);m&&!m.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:n,row:o,col:s,commentId:d,temp:!0})}else t&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};z=Ke([Z(0,a.Inject(I.HoverManagerService)),Z(1,a.Inject(c.SheetsThreadCommentPopupService)),Z(2,a.Inject(A.SheetsThreadCommentModel)),Z(3,a.Inject(I.SheetPermissionInterceptorBaseController))],z);var qe=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Qe=(i,t,r,e)=>{for(var n=e>1?void 0:e?Je(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&qe(t,r,n),n},U=(i,t)=>(r,e)=>t(r,e,i);let Y=class extends a.Disposable{constructor(t,r,e,n,o,s,d,u,m,l){super();N(this,"_isSwitchToCommenting",!1);N(this,"_selectionShapeInfo",null);this._commandService=t,this._sheetsThreadCommentPopupService=r,this._sheetsThreadCommentModel=e,this._threadCommentPanelService=n,this._univerInstanceService=o,this._sheetPermissionInterceptorBaseController=s,this._markSelectionService=d,this._sheetSelectionService=u,this._editorBridgeService=m,this._renderManagerService=l,this._initCommandListener(),this._initPanelListener(),this._initMarkSelection(),this._initSelectionUpdateListener(),this._initEditorBridge()}_handleSelectionChange(t,r,e){var v,_,g;const n=(v=t[0])==null?void 0:v.range,o=this._renderManagerService.getRenderById(r),s=(_=o==null?void 0:o.with(I.SheetSkeletonManagerService).getWorksheetSkeleton(e))==null?void 0:_.skeleton;if(!s||!n)return;const d=s.getCellWithCoordByIndex(n.startRow,n.startColumn);if((((g=n.rangeType)!=null?g:a.RANGE_TYPE.NORMAL)!==a.RANGE_TYPE.NORMAL||n.endColumn-n.startColumn>0||n.endRow-n.startRow>0)&&!((d.isMerged||d.isMergedMainCell)&&a.Rectangle.equals(d.mergeInfo,n))){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const m=d.actualRow,l=d.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(r,e,m,l)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const h=this._sheetsThreadCommentModel.getByLocation(r,e,m,l);h&&this._commandService.executeCommand(P.SetActiveCommentOperation.id,{unitId:r,subUnitId:e,commentId:h})}_initSelectionUpdateListener(){this.disposeWithMe(this._sheetSelectionService.selectionMoveEnd$.subscribe(t=>{if(this._isSwitchToCommenting)return;const r=this._sheetSelectionService.currentSelectionParam;r&&this._handleSelectionChange(t,r.unitId,r.sheetId)}))}_initEditorBridge(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(t=>{t.visible&&this._sheetsThreadCommentPopupService.hidePopup()}))}_initCommandListener(){this._commandService.onCommandExecuted(t=>{if(t.id===C.DeleteCommentMutation.id){const r=t.params,e=this._sheetsThreadCommentPopupService.activePopup;if(!e)return;const{unitId:n,subUnitId:o,commentId:s}=e;r.unitId===n&&r.subUnitId===o&&r.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async t=>{var r;if(t){const{unitId:e,subUnitId:n,commentId:o,trigger:s}=t,d=this._sheetsThreadCommentModel.getComment(e,n,o);if(!d||d.resolved)return;const u=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!u||u.getUnitId()!==e)return;this._isSwitchToCommenting=!0,((r=u.getActiveSheet())==null?void 0:r.getSheetId())!==n&&await this._commandService.executeCommand(p.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:n}),this._isSwitchToCommenting=!1;const h=$.singleReferenceToGrid(d.ref),{row:v,column:_}=h;if(!this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[p.WorkbookCommentPermission],worksheetTypes:[p.WorksheetViewPermission],rangeTypes:[p.RangeProtectionPermissionViewPoint]},[{startRow:v,startColumn:_,endRow:v,endColumn:_}]))return;const M=1;if(await this._commandService.executeCommand(I.ScrollToRangeOperation.id,{range:{startRow:Math.max(h.row-M,0),endRow:h.row+M,startColumn:Math.max(h.column-M,0),endColumn:h.column+M}}),this._editorBridgeService.isVisible().visible)return;this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:n,row:h.row,col:h.column,commentId:d.id,trigger:s})}else this._sheetsThreadCommentPopupService.hidePopup()}))}_initMarkSelection(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.pipe(k.debounceTime(100)).subscribe(t=>{var v,_;if(!t){this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);return}const{unitId:r,subUnitId:e,commentId:n}=t;this._selectionShapeInfo&&(this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId),this._selectionShapeInfo=null);const o=this._sheetsThreadCommentModel.getComment(r,e,n);if(!o)return;const s=$.singleReferenceToGrid(o.ref),{row:d,column:u}=s;if(Number.isNaN(d)||Number.isNaN(u))return null;const m=(v=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:v.getSheetBySheetId(e),l=(_=m==null?void 0:m.getMergedCell(d,u))!=null?_:{startColumn:u,endColumn:u,startRow:d,endRow:d},h=this._markSelectionService.addShape({range:l,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null},[],-1);h&&(this._selectionShapeInfo={...t,shapeId:h})}))}};Y=Qe([U(0,a.ICommandService),U(1,a.Inject(c.SheetsThreadCommentPopupService)),U(2,a.Inject(A.SheetsThreadCommentModel)),U(3,a.Inject(P.ThreadCommentPanelService)),U(4,a.IUniverInstanceService),U(5,a.Inject(I.SheetPermissionInterceptorBaseController)),U(6,I.IMarkSelectionService),U(7,a.Inject(p.SheetsSelectionsService)),U(8,I.IEditorBridgeService),U(9,re.IRenderManagerService)],Y);var Xe=Object.defineProperty,et=Object.getOwnPropertyDescriptor,tt=(i,t,r,e)=>{for(var n=e>1?void 0:e?et(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&Xe(t,r,n),n},K=(i,t)=>(r,e)=>t(r,e,i);let q=class extends a.Disposable{constructor(i,t,r,e){super(),this._sheetInterceptorService=i,this._univerInstanceService=t,this._threadCommentModel=r,this._threadCommentDataSourceService=e,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{var t;if(i.id===p.RemoveSheetCommand.id){const r=i.params,e=r.unitId?this._univerInstanceService.getUnit(r.unitId):this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET);if(!e)return{redos:[],undos:[]};const n=e.getUnitId(),o=r.subUnitId||((t=e.getActiveSheet())==null?void 0:t.getSheetId());if(!o)return{redos:[],undos:[]};const s=this._threadCommentModel.ensureMap(n,o),d=Array.from(s.values()).filter(v=>!v.parentId),u=d.map(v=>v.id),m=this._threadCommentDataSourceService.syncUpdateMutationToColla,l=u.map(v=>({id:C.DeleteCommentMutation.id,params:{unitId:n,subUnitId:o,commentId:v}})),h=d.map(({children:v,..._})=>({id:C.AddCommentMutation.id,params:{unitId:n,subUnitId:o,comment:{..._,children:m?v:void 0},sync:!m}}));return{redos:l,undos:h}}return{redos:[],undos:[]}}}))}};q=tt([K(0,a.Inject(p.SheetInterceptorService)),K(1,a.IUniverInstanceService),K(2,a.Inject(C.ThreadCommentModel)),K(3,C.IThreadCommentDataSourceService)],q);var he=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,rt=(i,t,r)=>t in i?he(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r,it=(i,t,r,e)=>{for(var n=e>1?void 0:e?nt(t,r):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(e?s(t,r,n):s(n))||n);return e&&n&&he(t,r,n),n},te=(i,t)=>(r,e)=>t(r,e,i),le=(i,t,r)=>rt(i,typeof t!="symbol"?t+"":t,r);c.UniverSheetsThreadCommentUIPlugin=class extends a.Plugin{constructor(t=Ce,r,e,n){super(),this._config=t,this._injector=r,this._commandService=e,this._configService=n;const{menu:o,...s}=this._config;o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(fe,s)}onStarting(){[[F],[x],[G],[z],[q],[Y],[c.SheetsThreadCommentPopupService]].forEach(t=>{this._injector.add(t)}),[B].forEach(t=>{this._commandService.registerCommand(t)}),this._injector.get(F)}onReady(){this._injector.get(x),this._injector.get(q)}onRendered(){this._injector.get(G),this._injector.get(z),this._injector.get(Y)}},le(c.UniverSheetsThreadCommentUIPlugin,"pluginName",Q),le(c.UniverSheetsThreadCommentUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),c.UniverSheetsThreadCommentUIPlugin=it([a.DependentOn(P.UniverThreadCommentUIPlugin,A.UniverSheetsThreadCommentPlugin),te(1,a.Inject(a.Injector)),te(2,a.Inject(a.ICommandService)),te(3,a.IConfigService)],c.UniverSheetsThreadCommentUIPlugin),Object.defineProperty(c,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>P.UniverThreadCommentUIPlugin}),Object.defineProperty(c,"AddCommentCommand",{enumerable:!0,get:()=>C.AddCommentCommand}),Object.defineProperty(c,"DeleteCommentCommand",{enumerable:!0,get:()=>C.DeleteCommentCommand}),Object.defineProperty(c,"DeleteCommentTreeCommand",{enumerable:!0,get:()=>C.DeleteCommentTreeCommand}),Object.defineProperty(c,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>C.IThreadCommentDataSourceService}),Object.defineProperty(c,"ResolveCommentCommand",{enumerable:!0,get:()=>C.ResolveCommentCommand}),Object.defineProperty(c,"UpdateCommentCommand",{enumerable:!0,get:()=>C.UpdateCommentCommand}),c.SHEETS_THREAD_COMMENT=Q,c.ShowAddSheetCommentModalOperation=B,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
32
+ */var de;function Le(){if(de)return x;de=1;var i=E,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(c,u,h){var m,l={},p=null,S=null;h!==void 0&&(p=""+h),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(S=u.ref);for(m in u)e.call(u,m)&&!o.hasOwnProperty(m)&&(l[m]=u[m]);if(c&&c.defaultProps)for(m in u=c.defaultProps,u)l[m]===void 0&&(l[m]=u[m]);return{$$typeof:t,type:c,key:p,ref:S,props:l,_owner:r.current}}return x.Fragment=n,x.jsx=s,x.jsxs=s,x}var me;function We(){return me||(me=1,ee.exports=Le()),ee.exports}var he=We();const Fe=()=>{const i=a.useDependency(a.IUniverInstanceService),t=a.useDependency(d.SheetsThreadCommentPopupService),n=f.useObservable(t.activePopup$),e=a.useDependency(A.SheetsThreadCommentModel);if(f.useObservable(e.commentUpdate$),!n)return null;const{row:r,col:o,unitId:s,subUnitId:c,trigger:u}=n,h=e.getByLocation(s,c,r,o),m=`${a.Tools.chatAtABC(o)}${r+1}`,l=()=>{t.hidePopup()},p=S=>{var g,M,V;return(V=(M=(g=i.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET))==null?void 0:g.getSheetBySheetId(S))==null?void 0:M.getName())!=null?V:""};return he.jsx(P.ThreadCommentTree,{onClick:()=>{t.persistPopup()},prefix:"cell",id:h,unitId:s,subUnitId:c,type:a.UniverInstanceType.UNIVER_SHEET,refStr:m,onClose:l,getSubUnitName:p,autoFocus:u==="context-menu"})},Ge=()=>{var w;const i=a.useDependency(I.IMarkSelectionService),t=a.useDependency(a.IUniverInstanceService),n=a.useDependency(d.SheetsThreadCommentPopupService),e=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SHEET),r=e.getUnitId(),o=a.useDependency(a.ICommandService),s=E.useMemo(()=>e.activeSheet$.pipe(k.map(_=>_==null?void 0:_.getSheetId())),[e.activeSheet$]),c=f.useObservable(s,(w=e.getActiveSheet())==null?void 0:w.getSheetId()),u=E.useRef(),h=a.useDependency(P.ThreadCommentPanelService),m=f.useObservable(h.activeCommentId$),l=f.useObservable(h.panelVisible$,h.panelVisible),p=E.useCallback(_=>{const R=e.getSheets(),T={};R.forEach((O,b)=>{T[O.getSheetId()]=b});const j=O=>O.map(b=>{var ve;const D=$.singleReferenceToGrid(b.ref),nt=[(ve=T[b.subUnitId])!=null?ve:0,D.row,D.column];return{...b,p:nt}}).sort((b,D)=>b.p[0]===D.p[0]?b.p[1]===D.p[1]?b.p[2]-D.p[2]:b.p[1]-D.p[1]:b.p[0]-D.p[0]);return[...j(_.filter(O=>!O.resolved)),...j(_.filter(O=>O.resolved))]},[e]),S=E.useCallback(_=>{var R;if(_.unitId===r&&_.subUnitId===c&&!_.resolved){const{row:T,column:j}=$.singleReferenceToGrid(_.ref),O=e.getSheetBySheetId(_.subUnitId),b=(R=O==null?void 0:O.getMergedCell(T,j))!=null?R:{startColumn:j,endColumn:j,startRow:T,endRow:T};if(!Number.isNaN(T)&&!Number.isNaN(j))return i.addShape({range:b,style:{fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[i,c,r]),g=_=>{var R,T;return(T=(R=e.getSheetBySheetId(_))==null?void 0:R.getName())!=null?T:""},M=()=>{o.executeCommand(B.id)},V=_=>{m&&m.unitId===_.unitId&&m.subUnitId===_.subUnitId&&m.commentId===_.id||(u.current&&(i.removeShape(u.current),u.current=null),u.current=S(_))},H=()=>{u.current&&(i.removeShape(u.current),u.current=null)},re=(_,R)=>{R&&n.hidePopup()};return E.useEffect(()=>{!l&&u.current&&i.removeShape(u.current)},[i,l]),he.jsx(P.ThreadCommentPanel,{unitId:r,subUnitId$:s,type:a.UniverInstanceType.UNIVER_SHEET,onAdd:M,getSubUnitName:g,onResolve:re,sortComments:p,onItemEnter:V,onItemLeave:H,onDeleteComment:()=>(H(),!0)})},Ze=i=>({id:B.id,type:f.MenuItemType.BUTTON,icon:K,title:"sheetThreadComment.menu.addComment",hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET),disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]})}),ze=i=>({id:P.ToggleSheetCommentPanelOperation.id,type:f.MenuItemType.BUTTON,icon:K,tooltip:"sheetThreadComment.menu.commentManagement",disabled$:I.getCurrentRangeDisable$(i,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionViewPoint]}),hidden$:f.getMenuHiddenObservable(i,a.UniverInstanceType.UNIVER_SHEET)}),qe={id:B.id,binding:f.KeyCode.M|f.MetaKeys.CTRL_COMMAND|f.MetaKeys.ALT,preconditions:I.whenSheetEditorFocused},Ye={[f.RibbonStartGroup.OTHERS]:{[P.ToggleSheetCommentPanelOperation.id]:{order:1,menuItemFactory:ze}},[f.ContextMenuPosition.MAIN_AREA]:{[f.ContextMenuGroup.OTHERS]:{[B.id]:{order:0,menuItemFactory:Ze}}}};var Je=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,Qe=(i,t,n,e)=>{for(var r=e>1?void 0:e?Ke(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&Je(t,n,r),r},te=(i,t)=>(n,e)=>t(n,e,i);let J=class extends a.Disposable{constructor(i,t,n){super(),this._menuManagerService=i,this._componentManager=t,this._shortcutService=n,this._initMenu(),this._initShortcut(),this._initComponent()}_initShortcut(){this._shortcutService.registerShortcut(qe)}_initMenu(){this._menuManagerService.mergeMenu(Ye)}_initComponent(){[[oe,Fe],[P.THREAD_COMMENT_PANEL,Ge],[K,ue]].forEach(([i,t])=>{this._componentManager.register(i,t)})}};J=Qe([te(0,f.IMenuManagerService),te(1,a.Inject(f.ComponentManager)),te(2,f.IShortcutService)],J);var le=Object.defineProperty,Xe=Object.getOwnPropertyDescriptor,et=(i,t,n)=>t in i?le(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n,tt=(i,t,n,e)=>{for(var r=e>1?void 0:e?Xe(t,n):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(t,n,r):s(r))||r);return e&&r&&le(t,n,r),r},ne=(i,t)=>(n,e)=>t(n,e,i),pe=(i,t,n)=>et(i,typeof t!="symbol"?t+"":t,n);d.UniverSheetsThreadCommentUIPlugin=class extends a.Plugin{constructor(t=Ie,n,e,r){super(),this._config=t,this._injector=n,this._commandService=e,this._configService=r;const{menu:o,...s}=this._config;o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(Ce,s)}onStarting(){[[J],[W],[F],[Z],[Y],[z],[d.SheetsThreadCommentPopupService]].forEach(t=>{this._injector.add(t)}),[B].forEach(t=>{this._commandService.registerCommand(t)}),this._injector.get(J)}onReady(){this._injector.get(W),this._injector.get(Y)}onRendered(){this._injector.get(F),this._injector.get(Z),this._injector.get(z)}},pe(d.UniverSheetsThreadCommentUIPlugin,"pluginName",Q),pe(d.UniverSheetsThreadCommentUIPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),d.UniverSheetsThreadCommentUIPlugin=tt([a.DependentOn(P.UniverThreadCommentUIPlugin,A.UniverSheetsThreadCommentPlugin),ne(1,a.Inject(a.Injector)),ne(2,a.Inject(a.ICommandService)),ne(3,a.IConfigService)],d.UniverSheetsThreadCommentUIPlugin),Object.defineProperty(d,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>P.UniverThreadCommentUIPlugin}),Object.defineProperty(d,"AddCommentCommand",{enumerable:!0,get:()=>C.AddCommentCommand}),Object.defineProperty(d,"DeleteCommentCommand",{enumerable:!0,get:()=>C.DeleteCommentCommand}),Object.defineProperty(d,"DeleteCommentTreeCommand",{enumerable:!0,get:()=>C.DeleteCommentTreeCommand}),Object.defineProperty(d,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>C.IThreadCommentDataSourceService}),Object.defineProperty(d,"ResolveCommentCommand",{enumerable:!0,get:()=>C.ResolveCommentCommand}),Object.defineProperty(d,"UpdateCommentCommand",{enumerable:!0,get:()=>C.UpdateCommentCommand}),d.SHEETS_THREAD_COMMENT=Q,d.ShowAddSheetCommentModalOperation=B,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
33
33
 
34
34
 
35
35
  // @univerjs-pro/thread-comment-datasource/index
36
- function _0x4be6(){const _0x3668e7=['CollaborationSessionService','9316890PKlpdY','UniverNetwork','121307gAiTVT','length','content','_config','_threadCommentDataSourceService','format','HTTPService','parentId','UniverCollaborationClientPlugin','_threadCommentDataSource','84YdTCPx','IConfigService','UniverThreadComment','_initDataSource','Plugin','find','Solved','getCurrentUser','rangeId','post','listComments','dayjs','_threadCommentModel','UserManagerService','requireSession','addUser','unitId','userId','getUser','COMMENT','/delete','Reply','Delete','@univerjs/network','/reply','/solved','_initUserSync','size','/edit','UniverThreadCommentUi','UNIVER_UNKNOWN','code','YYYY/MM/DD\x20HH:mm','userID','forEach','users','Edit','onStarting','/universer-api/user/list','1220ituseD','Injector','parse','@univerjs-pro/collaboration-client','updateComment','getOwnPropertyDescriptor','user','pluginName','@univerjs/thread-comment-ui','2389824VTxolh','UNRECOGNIZED','defineProperty','createTimestamp','rxjs','@univerjs/thread-comment','error','Inject','_userService','34589898temSRC','get','rangeType','40gsnpAn','add','OpenOrReOpen','@univerjs-pro/license','IThreadCommentDataSourceService','resolved','customRanges','_httpService','_sessionService','/list','ref','root','filter','Module','getMemberID','UniverThreadCommentDataSourcePlugin','solved','thread-comment-data-source.config','_configService','UniverProThreadCommentDatasource','slice','stringify','_injector','threadId','CustomRangeType','replies','replyId','_commentService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','1508544ouaLdj','reply','/add','UniverThreadCommentUIPlugin','values','commentUpdate$','getUnit','Add','/universer-api/comment/unit/','UniverInstanceType','Unknown','1108919FgpyyU','subscribe','body','UniverLicensePlugin','_init','dataSource','resolveComment','setConfig','UniverProCollaborationClient','Solve','type','amd','Disposable','comments','deleteComment','payload','disposeWithMe'];_0x4be6=function(){return _0x3668e7;};return _0x4be6();}function _0x7bf8(_0x148829,_0x46b82e){const _0x4be6db=_0x4be6();return _0x7bf8=function(_0x7bf87f,_0x582bd6){_0x7bf87f=_0x7bf87f-0x8c;let _0x4363b3=_0x4be6db[_0x7bf87f];return _0x4363b3;},_0x7bf8(_0x148829,_0x46b82e);}(function(_0x5a4074,_0xdb3a29){const _0x557a2c=_0x7bf8,_0xb849e5=_0x5a4074();while(!![]){try{const _0x3d2fdf=parseInt(_0x557a2c(0x95))/0x1+-parseInt(_0x557a2c(0xf8))/0x2+-parseInt(_0x557a2c(0x9f))/0x3*(-parseInt(_0x557a2c(0xc6))/0x4)+-parseInt(_0x557a2c(0x93))/0x5+parseInt(_0x557a2c(0xcf))/0x6+-parseInt(_0x557a2c(0x103))/0x7*(parseInt(_0x557a2c(0xdb))/0x8)+parseInt(_0x557a2c(0xd8))/0x9;if(_0x3d2fdf===_0xdb3a29)break;else _0xb849e5['push'](_0xb849e5['shift']());}catch(_0x34a3e1){_0xb849e5['push'](_0xb849e5['shift']());}}}(_0x4be6,0xeacca),function(_0x479271,_0x54bdb2){const _0x4164f4=_0x7bf8;typeof exports=='object'&&typeof module<'u'?_0x54bdb2(exports,require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require(_0x4164f4(0xc9)),require(_0x4164f4(0xde)),require(_0x4164f4(0xd4)),require(_0x4164f4(0xd3)),require(_0x4164f4(0xb6))):typeof define=='function'&&define[_0x4164f4(0x8c)]?define(['exports','@univerjs/core',_0x4164f4(0xce),_0x4164f4(0xc9),'@univerjs-pro/license','@univerjs/thread-comment',_0x4164f4(0xd3),_0x4164f4(0xb6)],_0x54bdb2):(_0x479271=typeof globalThis<'u'?globalThis:_0x479271||self,_0x54bdb2(_0x479271[_0x4164f4(0xee)]={},_0x479271['UniverCore'],_0x479271[_0x4164f4(0xbc)],_0x479271[_0x4164f4(0x10b)],_0x479271['UniverProLicense'],_0x479271[_0x4164f4(0xa1)],_0x479271[_0x4164f4(0xd3)],_0x479271[_0x4164f4(0x94)]));}(this,function(_0x3d559e,_0x178aea,_0x11616b,_0x222a5f,_0x39f192,_0x28d5fb,_0x47b451,_0x115935){'use strict';const _0x25554b=_0x7bf8;const _0x55b355=_0x25554b(0xf7);var _0x3fcdaf=(_0xda2fd2=>(_0xda2fd2[_0xda2fd2[_0x25554b(0xdd)]=0x0]=_0x25554b(0xdd),_0xda2fd2[_0xda2fd2[_0x25554b(0xa5)]=0x1]=_0x25554b(0xa5),_0xda2fd2[_0xda2fd2[_0x25554b(0xd0)]=-0x1]='UNRECOGNIZED',_0xda2fd2))(_0x3fcdaf||{}),_0x1a98a7=(_0x436686=>(_0x436686[_0x436686[_0x25554b(0x102)]=0x0]='Unknown',_0x436686[_0x436686['Add']=0x1]=_0x25554b(0xff),_0x436686[_0x436686['Reply']=0x2]=_0x25554b(0xb4),_0x436686[_0x436686[_0x25554b(0xc3)]=0x3]=_0x25554b(0xc3),_0x436686[_0x436686['Delete']=0x4]='Delete',_0x436686[_0x436686[_0x25554b(0x10c)]=0x5]=_0x25554b(0x10c),_0x436686[_0x436686['UNRECOGNIZED']=-0x1]=_0x25554b(0xd0),_0x436686))(_0x1a98a7||{});const _0x2b00ae=_0x1486d6=>_0x178aea['dayjs'](new Date(+_0x1486d6))[_0x25554b(0x9a)](_0x25554b(0xbf)),_0x6e5acb=async(_0x40a71e,_0x134c1c)=>{const _0x303c1f=_0x25554b,_0x1bf27f=_0x40a71e[_0x303c1f(0xd9)](_0x178aea['UserManagerService']),_0x1fc3b2=_0x40a71e[_0x303c1f(0xd9)](_0x115935[_0x303c1f(0x9b)]);_0x134c1c[_0x303c1f(0xc1)](_0x530db2=>{const _0x19fe22=_0x303c1f;_0x1bf27f[_0x19fe22(0xb1)](_0x530db2)&&_0x134c1c['delete'](_0x530db2);}),_0x134c1c[_0x303c1f(0xba)]&&(await _0x1fc3b2[_0x303c1f(0xd9)](_0x303c1f(0xc5),{'params':{'userIDs':[..._0x134c1c]}}))[_0x303c1f(0x105)]['users'][_0x303c1f(0xc1)](_0x24f1d7=>{const _0x1314dc=_0x303c1f;_0x24f1d7&&_0x1bf27f[_0x1314dc(0xae)](_0x24f1d7);});};var _0xbf704a=Object[_0x25554b(0xd1)],_0x5e87c5=Object[_0x25554b(0xcb)],_0x2f2fe5=(_0x333799,_0x304363,_0x11344e,_0x37e764)=>{const _0x41ffeb=_0x25554b;for(var _0xd07ab3=_0x37e764>0x1?void 0x0:_0x37e764?_0x5e87c5(_0x304363,_0x11344e):_0x304363,_0x3f41da=_0x333799[_0x41ffeb(0x96)]-0x1,_0x541c5b;_0x3f41da>=0x0;_0x3f41da--)(_0x541c5b=_0x333799[_0x3f41da])&&(_0xd07ab3=(_0x37e764?_0x541c5b(_0x304363,_0x11344e,_0xd07ab3):_0x541c5b(_0xd07ab3))||_0xd07ab3);return _0x37e764&&_0xd07ab3&&_0xbf704a(_0x304363,_0x11344e,_0xd07ab3),_0xd07ab3;},_0x5a325f=(_0x59bd68,_0x1a28fd)=>(_0x1120fe,_0x1c8f69)=>_0x1a28fd(_0x1120fe,_0x1c8f69,_0x59bd68);let _0x4c6b65=class extends _0x178aea[_0x25554b(0x8d)]{constructor(_0x539c0f,_0x3b6312,_0x4ee931,_0x24774a){const _0x3148c4=_0x25554b;super(),this[_0x3148c4(0xf6)]=_0x539c0f,this[_0x3148c4(0xab)]=_0x3b6312,this[_0x3148c4(0xd7)]=_0x4ee931,this[_0x3148c4(0xf1)]=_0x24774a,this[_0x3148c4(0x107)](),this[_0x3148c4(0xb9)]();}[_0x25554b(0xb9)](){const _0x36d146=_0x25554b;this[_0x36d146(0x91)](this[_0x36d146(0xab)][_0x36d146(0xfd)]['pipe'](_0x47b451['bufferTime'](0x10))[_0x36d146(0x104)](_0x2936cd=>{const _0x3b9f14=_0x36d146,_0x37f491=new Set();_0x2936cd[_0x3b9f14(0xc1)](_0x4f1406=>{const _0x1049e1=_0x3b9f14;switch(_0x4f1406['type']){case'add':{const _0x1a0d5d=_0x4f1406[_0x1049e1(0x90)]['personId'];_0x37f491['add'](_0x1a0d5d);break;}}}),_0x6e5acb(this['_injector'],_0x37f491);}));}[_0x25554b(0x107)](){const _0x415f44=_0x25554b;this['disposeWithMe'](this[_0x415f44(0xf6)]['commentUpdate$'][_0x415f44(0x104)](async _0x4b10e3=>{const _0x5b148e=_0x415f44;var _0x5482dc,_0x2b8564,_0x3a9986,_0x381706;const _0x9a2936=(_0x5482dc=this[_0x5b148e(0xab)]['getUnit'](_0x4b10e3[_0x5b148e(0xaf)])['find'](_0x26e7cf=>_0x26e7cf['threadId']===_0x4b10e3[_0x5b148e(0xf2)]))==null?void 0x0:_0x5482dc['root'];if(!_0x9a2936)return;const {unitId:_0x1be22a,subUnitId:_0x50c15a}=_0x9a2936;switch(_0x4b10e3[_0x5b148e(0xcc)]&&this[_0x5b148e(0xd7)]['addUser'](_0x4b10e3[_0x5b148e(0xcc)]),_0x4b10e3['type']){case _0x1a98a7[_0x5b148e(0xff)]:break;case _0x1a98a7[_0x5b148e(0xb4)]:{this[_0x5b148e(0xab)]['addComment'](_0x1be22a,_0x50c15a,{'unitId':_0x1be22a,'subUnitId':_0x50c15a,'ref':'','id':_0x4b10e3[_0x5b148e(0xf5)],'dT':_0x2b00ae(+_0x4b10e3[_0x5b148e(0xd2)]),'threadId':_0x4b10e3[_0x5b148e(0xf2)],'personId':(_0x3a9986=(_0x2b8564=_0x4b10e3[_0x5b148e(0xcc)])==null?void 0x0:_0x2b8564[_0x5b148e(0xc0)])!=null?_0x3a9986:_0x4b10e3[_0x5b148e(0xb0)],'text':JSON[_0x5b148e(0xc8)](_0x4b10e3[_0x5b148e(0x97)]),'parentId':_0x9a2936['id']});break;}case _0x1a98a7[_0x5b148e(0xb5)]:{const _0x378dfb=this[_0x5b148e(0xab)]['getComment'](_0x1be22a,_0x50c15a,_0x4b10e3['replyId']);_0x378dfb&&_0x378dfb[_0x5b148e(0x9c)]&&this['_threadCommentModel'][_0x5b148e(0x8f)](_0x1be22a,_0x50c15a,_0x4b10e3[_0x5b148e(0xf5)]);break;}case _0x1a98a7[_0x5b148e(0xc3)]:{this[_0x5b148e(0xab)]['updateComment'](_0x1be22a,_0x50c15a,{'commentId':_0x4b10e3['replyId'],'text':JSON[_0x5b148e(0xc8)](_0x4b10e3[_0x5b148e(0x97)])});break;}case _0x1a98a7['Solve']:{const _0x392c2a=(_0x381706=this[_0x5b148e(0xab)][_0x5b148e(0xfe)](_0x4b10e3[_0x5b148e(0xaf)])[_0x5b148e(0xa4)](_0xe422c1=>_0xe422c1['threadId']===_0x4b10e3[_0x5b148e(0xf2)]))==null?void 0x0:_0x381706[_0x5b148e(0xe6)];_0x392c2a&&this['_threadCommentModel']['resolveComment'](_0x1be22a,_0x50c15a,_0x392c2a['id'],_0x4b10e3[_0x5b148e(0xeb)]===_0x3fcdaf[_0x5b148e(0xa5)]);break;}}}));}};_0x4c6b65=_0x2f2fe5([_0x5a325f(0x0,_0x178aea[_0x25554b(0xd6)](_0x222a5f['CommentService'])),_0x5a325f(0x1,_0x178aea[_0x25554b(0xd6)](_0x28d5fb['ThreadCommentModel'])),_0x5a325f(0x2,_0x178aea[_0x25554b(0xd6)](_0x178aea['UserManagerService'])),_0x5a325f(0x3,_0x178aea[_0x25554b(0xd6)](_0x178aea[_0x25554b(0xc7)]))],_0x4c6b65);const _0x16222b=_0x25554b(0xec),_0xb59808={};var _0x510078=Object[_0x25554b(0xd1)],_0x2b4404=Object[_0x25554b(0xcb)],_0x273b83=(_0x401147,_0xf71ea5,_0x40ca14,_0x1233ac)=>{for(var _0x38bf61=_0x1233ac>0x1?void 0x0:_0x1233ac?_0x2b4404(_0xf71ea5,_0x40ca14):_0xf71ea5,_0x2f1323=_0x401147['length']-0x1,_0x4dc708;_0x2f1323>=0x0;_0x2f1323--)(_0x4dc708=_0x401147[_0x2f1323])&&(_0x38bf61=(_0x1233ac?_0x4dc708(_0xf71ea5,_0x40ca14,_0x38bf61):_0x4dc708(_0x38bf61))||_0x38bf61);return _0x1233ac&&_0x38bf61&&_0x510078(_0xf71ea5,_0x40ca14,_0x38bf61),_0x38bf61;},_0x57f9f8=(_0x3fb87c,_0x4d997f)=>(_0x379b65,_0x2616b9)=>_0x4d997f(_0x379b65,_0x2616b9,_0x3fb87c);function _0x1fcb66(_0x2310f9,_0x3ebb1f){const _0x87b44d=_0x25554b,_0x4a4e33=_0x2310f9[_0x87b44d(0xf4)][0x0];return{..._0x3ebb1f,'id':_0x4a4e33['replyId'],'resolved':_0x2310f9['solved']===0x1,'dT':_0x2b00ae(_0x4a4e33['createTimestamp']),'personId':_0x4a4e33[_0x87b44d(0xb0)],'threadId':_0x4a4e33['threadId']};}function _0x1952fb(_0x4db1e3,_0x375968,_0x5df834){const _0x209b1d=_0x25554b;var _0x4dd6bd,_0x5ea7e1;if(((_0x5ea7e1=(_0x4dd6bd=_0x4db1e3==null?void 0x0:_0x4db1e3[_0x209b1d(0xf4)])==null?void 0x0:_0x4dd6bd['length'])!=null?_0x5ea7e1:0x0)>0x0){const _0x5b5b1c=(_0x11bbd5,_0x44f714)=>({'id':_0x11bbd5[_0x209b1d(0xf5)],'threadId':_0x11bbd5[_0x209b1d(0xf2)],'dT':_0x2b00ae(_0x11bbd5['createTimestamp']),'personId':_0x11bbd5[_0x209b1d(0xb0)],'resolved':_0x4db1e3['solved']===_0x3fcdaf['Solved'],'unitId':_0x375968,'subUnitId':_0x5df834,'text':JSON[_0x209b1d(0xc8)](_0x11bbd5[_0x209b1d(0x97)]),'parentId':_0x44f714}),_0x2047db=_0x5b5b1c(_0x4db1e3[_0x209b1d(0xf4)][0x0]);return{..._0x2047db,'children':_0x4db1e3[_0x209b1d(0xf4)][_0x209b1d(0xef)](0x1)['map'](_0x542ed3=>_0x5b5b1c(_0x542ed3,_0x2047db['id']))};}return null;}let _0x3b4535=class{constructor(_0x32e7b2,_0x515302,_0x5f30d4,_0x5c9c40){const _0x1cb3fc=_0x25554b;this[_0x1cb3fc(0xe2)]=_0x32e7b2,this[_0x1cb3fc(0xd7)]=_0x515302,this[_0x1cb3fc(0xe3)]=_0x5f30d4,this[_0x1cb3fc(0xf1)]=_0x5c9c40;}async['addComment'](_0x690679){const _0x2336eb=_0x25554b;var _0x406914,_0x272f2b;const {parentId:_0x5ad1cc,unitId:_0x1c6658,text:_0x548f96,threadId:_0x16a6a0}=_0x690679,_0x34cad0=(_0x272f2b=(_0x406914=_0x548f96[_0x2336eb(0xe1)])==null?void 0x0:_0x406914['filter'](_0x294e92=>_0x294e92['rangeType']===_0x178aea[_0x2336eb(0xf3)]['COMMENT'])['map'](_0x42c0a3=>_0x42c0a3[_0x2336eb(0xa7)]))!=null?_0x272f2b:[],_0x276df2=JSON[_0x2336eb(0xf0)](_0x548f96),_0x39440f=(await this['_sessionService']['requireSession'](_0x1c6658))[_0x2336eb(0xe9)]();if(_0x5ad1cc){const _0x33d464={'memberId':_0x39440f,'unitId':_0x1c6658,'content':_0x276df2,'mention':_0x34cad0,'threadId':_0x16a6a0},_0x4656c8=(await this[_0x2336eb(0xe2)][_0x2336eb(0xa8)]('/universer-api/comment/unit/'+_0x1c6658+_0x2336eb(0xb7),{'body':_0x33d464}))[_0x2336eb(0x105)][_0x2336eb(0xf9)];return{..._0x690679,'id':_0x4656c8[_0x2336eb(0xf5)],'dT':_0x178aea[_0x2336eb(0xaa)](+_0x4656c8[_0x2336eb(0xd2)])['format'](_0x2336eb(0xbf)),'personId':_0x4656c8[_0x2336eb(0xb0)]};}else{const _0x492667={'memberId':_0x39440f,'unitId':_0x1c6658,'content':_0x276df2,'mention':_0x34cad0},_0x9f043=await this[_0x2336eb(0xe2)][_0x2336eb(0xa8)](_0x2336eb(0x100)+_0x1c6658+_0x2336eb(0xfa),{'body':_0x492667});return _0x1fcb66(_0x9f043[_0x2336eb(0x105)]['comment'],_0x690679);}}async[_0x25554b(0xca)](_0x282978){const _0x3c731d=_0x25554b;var _0x40f0ad,_0x2025a1;const {text:_0x4b4e75,unitId:_0x5852fe}=_0x282978,_0x4d3e5b=(_0x2025a1=(_0x40f0ad=_0x4b4e75['customRanges'])==null?void 0x0:_0x40f0ad['filter'](_0x58ddee=>_0x58ddee[_0x3c731d(0xda)]===_0x178aea['CustomRangeType'][_0x3c731d(0xb2)])['map'](_0x5547ac=>_0x5547ac[_0x3c731d(0xa7)]))!=null?_0x2025a1:[],_0x5b20e3=JSON[_0x3c731d(0xf0)](_0x4b4e75),_0x953e4c=_0x282978['threadId'],_0x5d8fe2=_0x282978['id'],_0x4b8236={'memberId':(await this[_0x3c731d(0xe3)]['requireSession'](_0x5852fe))[_0x3c731d(0xe9)](),'unitId':_0x5852fe,'threadId':_0x953e4c,'mention':_0x4d3e5b,'content':_0x5b20e3,'replyId':_0x5d8fe2},_0x5c1093=await this[_0x3c731d(0xe2)]['post'](_0x3c731d(0x100)+_0x5852fe+_0x3c731d(0xbb),{'body':_0x4b8236});return!_0x5c1093[_0x3c731d(0x105)][_0x3c731d(0xd5)]||_0x5c1093[_0x3c731d(0x105)][_0x3c731d(0xd5)][_0x3c731d(0xbe)]===0x1;}async[_0x25554b(0x109)](_0x46fb6f){const _0x594c2c=_0x25554b,{unitId:_0x4ac8ac}=_0x46fb6f,_0x214bce=_0x46fb6f['threadId'],_0x33966d={'memberId':this[_0x594c2c(0xd7)][_0x594c2c(0xa6)]()['userID'],'unitId':_0x4ac8ac,'threadId':_0x214bce,'solved':_0x46fb6f[_0x594c2c(0xe0)]?_0x3fcdaf[_0x594c2c(0xa5)]:_0x3fcdaf['OpenOrReOpen']},_0x37ecc2=await this[_0x594c2c(0xe2)]['post'](_0x594c2c(0x100)+_0x4ac8ac+_0x594c2c(0xb8),{'body':_0x33966d});return!_0x37ecc2['body']['error']||_0x37ecc2[_0x594c2c(0x105)][_0x594c2c(0xd5)][_0x594c2c(0xbe)]===0x1;}async[_0x25554b(0x8f)](_0x5c52a0,_0x4e8926,_0x171a3c,_0x78eb85){const _0x520bb9=_0x25554b,_0x357f={'memberId':(await this['_sessionService'][_0x520bb9(0xad)](_0x5c52a0))[_0x520bb9(0xe9)](),'threadId':_0x171a3c,'replyId':_0x78eb85,'unitId':_0x5c52a0},_0x272edd=await this[_0x520bb9(0xe2)]['post'](_0x520bb9(0x100)+_0x5c52a0+_0x520bb9(0xb3),{'body':_0x357f});return!_0x272edd['body']['error']||_0x272edd[_0x520bb9(0x105)]['error'][_0x520bb9(0xbe)]===0x1;}async[_0x25554b(0xa9)](_0x323016,_0x250480,_0x7d30aa){const _0x259aab=_0x25554b,_0x4828e6={'unitId':_0x323016,'threadId':_0x7d30aa},_0x3f8668=await this[_0x259aab(0xe2)]['post'](_0x259aab(0x100)+_0x323016+_0x259aab(0xe4),{'body':_0x4828e6}),_0x392815=_0x7d30aa['map'](_0x1b2b11=>_0x1952fb(_0x3f8668[_0x259aab(0x105)][_0x259aab(0x8e)][_0x1b2b11],_0x323016,_0x250480))[_0x259aab(0xe7)](Boolean);return Object[_0x259aab(0xfc)](_0x3f8668['body'][_0x259aab(0xc2)])[_0x259aab(0xc1)](_0x3092ea=>{this['_userService']['addUser'](_0x3092ea);}),_0x392815;}['saveCommentToSnapshot'](_0x320df){const _0x3aac12=_0x25554b;return{'id':_0x320df['id'],'threadId':_0x320df[_0x3aac12(0xf2)],'ref':_0x320df[_0x3aac12(0xe5)]};}};_0x3b4535=_0x273b83([_0x57f9f8(0x0,_0x178aea[_0x25554b(0xd6)](_0x115935[_0x25554b(0x9b)])),_0x57f9f8(0x1,_0x178aea['Inject'](_0x178aea[_0x25554b(0xac)])),_0x57f9f8(0x2,_0x178aea[_0x25554b(0xd6)](_0x222a5f[_0x25554b(0x92)])),_0x57f9f8(0x3,_0x178aea[_0x25554b(0xd6)](_0x178aea[_0x25554b(0xc7)]))],_0x3b4535);var _0x2dfce6=Object[_0x25554b(0xd1)],_0x27e7c4=Object[_0x25554b(0xcb)],_0x4934b6=(_0x52ce2a,_0x5cdef5,_0x3e0380,_0x3f0d37)=>{const _0x3af9f3=_0x25554b;for(var _0x17507d=_0x3f0d37>0x1?void 0x0:_0x3f0d37?_0x27e7c4(_0x5cdef5,_0x3e0380):_0x5cdef5,_0x187790=_0x52ce2a[_0x3af9f3(0x96)]-0x1,_0x5d32fe;_0x187790>=0x0;_0x187790--)(_0x5d32fe=_0x52ce2a[_0x187790])&&(_0x17507d=(_0x3f0d37?_0x5d32fe(_0x5cdef5,_0x3e0380,_0x17507d):_0x5d32fe(_0x17507d))||_0x17507d);return _0x3f0d37&&_0x17507d&&_0x2dfce6(_0x5cdef5,_0x3e0380,_0x17507d),_0x17507d;},_0x4e0240=(_0x35c71f,_0x31df7d)=>(_0x15e40c,_0x1cb864)=>_0x31df7d(_0x15e40c,_0x1cb864,_0x35c71f);let _0x2e0ad6=class extends _0x178aea[_0x25554b(0x8d)]{constructor(_0x37f8ae,_0x778a77){const _0x522227=_0x25554b;super(),this[_0x522227(0x99)]=_0x37f8ae,this['_threadCommentDataSource']=_0x778a77,this[_0x522227(0xa2)]();}[_0x25554b(0xa2)](){const _0x32b41c=_0x25554b;this[_0x32b41c(0x99)][_0x32b41c(0x108)]=this[_0x32b41c(0x9e)],this[_0x32b41c(0x99)]['syncUpdateMutationToColla']=!0x1;}};_0x2e0ad6=_0x4934b6([_0x4e0240(0x0,_0x28d5fb[_0x25554b(0xdf)]),_0x4e0240(0x1,_0x178aea[_0x25554b(0xd6)](_0x3b4535))],_0x2e0ad6);var _0x4ebd09=Object[_0x25554b(0xd1)],_0x57946c=Object[_0x25554b(0xcb)],_0x1a3026=(_0x55b135,_0x56ba8d,_0xd1f75e)=>_0x56ba8d in _0x55b135?_0x4ebd09(_0x55b135,_0x56ba8d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xd1f75e}):_0x55b135[_0x56ba8d]=_0xd1f75e,_0x45b68b=(_0x25ec3b,_0xac6fc7,_0x154994,_0x5c9684)=>{const _0x5a4bbd=_0x25554b;for(var _0x2dd402=_0x5c9684>0x1?void 0x0:_0x5c9684?_0x57946c(_0xac6fc7,_0x154994):_0xac6fc7,_0x3a78c6=_0x25ec3b[_0x5a4bbd(0x96)]-0x1,_0x25f324;_0x3a78c6>=0x0;_0x3a78c6--)(_0x25f324=_0x25ec3b[_0x3a78c6])&&(_0x2dd402=(_0x5c9684?_0x25f324(_0xac6fc7,_0x154994,_0x2dd402):_0x25f324(_0x2dd402))||_0x2dd402);return _0x5c9684&&_0x2dd402&&_0x4ebd09(_0xac6fc7,_0x154994,_0x2dd402),_0x2dd402;},_0x1f32ff=(_0x1a938d,_0x319727)=>(_0x44152e,_0x251ca3)=>_0x319727(_0x44152e,_0x251ca3,_0x1a938d),_0x3d97e3=(_0x16cc32,_0x576039,_0x4c6df2)=>_0x1a3026(_0x16cc32,typeof _0x576039!='symbol'?_0x576039+'':_0x576039,_0x4c6df2);_0x3d559e[_0x25554b(0xea)]=class extends _0x178aea[_0x25554b(0xa3)]{constructor(_0x3f8ab2=_0xb59808,_0xe17423,_0x2fabe0){const _0xde4eb7=_0x25554b;super(),this[_0xde4eb7(0x98)]=_0x3f8ab2,this['_injector']=_0xe17423,this[_0xde4eb7(0xed)]=_0x2fabe0;const {..._0x2853a6}=this['_config'];this[_0xde4eb7(0xed)][_0xde4eb7(0x10a)](_0x16222b,_0x2853a6);}[_0x25554b(0xc4)](){const _0x476736=_0x25554b;[[_0x3b4535],[_0x2e0ad6],[_0x4c6b65]][_0x476736(0xc1)](_0x4c498e=>{const _0x288029=_0x476736;this[_0x288029(0xf1)][_0x288029(0xdc)](_0x4c498e);});}['onReady'](){const _0x4d4f07=_0x25554b;this[_0x4d4f07(0xf1)][_0x4d4f07(0xd9)](_0x2e0ad6),this['_injector'][_0x4d4f07(0xd9)](_0x4c6b65);}},_0x3d97e3(_0x3d559e[_0x25554b(0xea)],_0x25554b(0xcd),_0x55b355),_0x3d97e3(_0x3d559e[_0x25554b(0xea)],_0x25554b(0x10d),_0x178aea[_0x25554b(0x101)][_0x25554b(0xbd)]),_0x3d559e[_0x25554b(0xea)]=_0x45b68b([_0x178aea['DependentOn'](_0x11616b[_0x25554b(0xfb)],_0x222a5f[_0x25554b(0x9d)],_0x39f192[_0x25554b(0x106)]),_0x1f32ff(0x1,_0x178aea[_0x25554b(0xd6)](_0x178aea[_0x25554b(0xc7)])),_0x1f32ff(0x2,_0x178aea[_0x25554b(0xa0)])],_0x3d559e['UniverThreadCommentDataSourcePlugin']),Object[_0x25554b(0xd1)](_0x3d559e,Symbol['toStringTag'],{'value':_0x25554b(0xe8)});}));
36
+ (function(_0x5adc2b,_0x4a13c1){const _0x47cbfd=_0x1a92,_0x347189=_0x5adc2b();while(!![]){try{const _0x238598=parseInt(_0x47cbfd(0x237))/0x1*(parseInt(_0x47cbfd(0x21b))/0x2)+-parseInt(_0x47cbfd(0x1f2))/0x3+parseInt(_0x47cbfd(0x1f9))/0x4+-parseInt(_0x47cbfd(0x1d9))/0x5*(-parseInt(_0x47cbfd(0x235))/0x6)+parseInt(_0x47cbfd(0x1e3))/0x7+parseInt(_0x47cbfd(0x219))/0x8+-parseInt(_0x47cbfd(0x240))/0x9;if(_0x238598===_0x4a13c1)break;else _0x347189['push'](_0x347189['shift']());}catch(_0x5b6c59){_0x347189['push'](_0x347189['shift']());}}}(_0x39cf,0xe1d15),function(_0x3e0795,_0x1016f1){const _0x240c5a=_0x1a92;typeof exports==_0x240c5a(0x203)&&typeof module<'u'?_0x1016f1(exports,require(_0x240c5a(0x1f7)),require('@univerjs-pro/license'),require(_0x240c5a(0x223)),require('@univerjs/thread-comment-ui'),require(_0x240c5a(0x22a)),require(_0x240c5a(0x241)),require(_0x240c5a(0x220))):typeof define==_0x240c5a(0x245)&&define[_0x240c5a(0x1dd)]?define([_0x240c5a(0x228),'@univerjs-pro/collaboration-client',_0x240c5a(0x1c7),'@univerjs/core',_0x240c5a(0x1ea),_0x240c5a(0x22a),_0x240c5a(0x241),'@univerjs/network'],_0x1016f1):(_0x3e0795=typeof globalThis<'u'?globalThis:_0x3e0795||self,_0x1016f1(_0x3e0795[_0x240c5a(0x230)]={},_0x3e0795[_0x240c5a(0x1c4)],_0x3e0795[_0x240c5a(0x224)],_0x3e0795['UniverCore'],_0x3e0795[_0x240c5a(0x231)],_0x3e0795[_0x240c5a(0x233)],_0x3e0795[_0x240c5a(0x241)],_0x3e0795[_0x240c5a(0x23e)]));}(this,function(_0x3fe389,_0x38535f,_0x5dec0e,_0x471e7b,_0x2a825,_0x11c43c,_0x470645,_0x131a66){'use strict';const _0x3f17ea=_0x1a92;const _0x50c45f=_0x3f17ea(0x1c2);var _0x34e685=(_0x500887=>(_0x500887[_0x500887[_0x3f17ea(0x1e4)]=0x0]=_0x3f17ea(0x1e4),_0x500887[_0x500887[_0x3f17ea(0x20b)]=0x1]=_0x3f17ea(0x20b),_0x500887[_0x500887['UNRECOGNIZED']=-0x1]=_0x3f17ea(0x21a),_0x500887))(_0x34e685||{}),_0x2389c5=(_0xf516c5=>(_0xf516c5[_0xf516c5['Unknown']=0x0]=_0x3f17ea(0x23d),_0xf516c5[_0xf516c5['Add']=0x1]=_0x3f17ea(0x206),_0xf516c5[_0xf516c5[_0x3f17ea(0x205)]=0x2]=_0x3f17ea(0x205),_0xf516c5[_0xf516c5[_0x3f17ea(0x1dc)]=0x3]='Edit',_0xf516c5[_0xf516c5[_0x3f17ea(0x1c1)]=0x4]=_0x3f17ea(0x1c1),_0xf516c5[_0xf516c5[_0x3f17ea(0x21c)]=0x5]=_0x3f17ea(0x21c),_0xf516c5[_0xf516c5[_0x3f17ea(0x21a)]=-0x1]=_0x3f17ea(0x21a),_0xf516c5))(_0x2389c5||{});const _0x429cd=_0x504a37=>_0x471e7b[_0x3f17ea(0x1e1)](new Date(+_0x504a37))[_0x3f17ea(0x1cd)](_0x3f17ea(0x1d0)),_0x479de3=async(_0xd2ff4e,_0x358d6e)=>{const _0x125214=_0x3f17ea,_0xffdcb5=_0xd2ff4e[_0x125214(0x1f1)](_0x471e7b[_0x125214(0x21d)]),_0x54c467=_0xd2ff4e['get'](_0x131a66[_0x125214(0x1d7)]);_0x358d6e[_0x125214(0x239)](_0xca914=>{const _0x201dc9=_0x125214;_0xffdcb5[_0x201dc9(0x1cf)](_0xca914)&&_0x358d6e['delete'](_0xca914);}),_0x358d6e['size']&&(await _0x54c467[_0x125214(0x1f1)](_0x125214(0x1da),{'params':{'userIDs':[..._0x358d6e]}}))[_0x125214(0x1fc)][_0x125214(0x244)][_0x125214(0x239)](_0x2dd200=>{const _0x204bc9=_0x125214;_0x2dd200&&_0xffdcb5[_0x204bc9(0x201)](_0x2dd200);});};var _0x174499=Object['defineProperty'],_0x2779a6=Object['getOwnPropertyDescriptor'],_0x4c8dc3=(_0x208f6a,_0xee7912,_0x268e97,_0x45e18a)=>{for(var _0x352896=_0x45e18a>0x1?void 0x0:_0x45e18a?_0x2779a6(_0xee7912,_0x268e97):_0xee7912,_0x5f56d5=_0x208f6a['length']-0x1,_0x27ce27;_0x5f56d5>=0x0;_0x5f56d5--)(_0x27ce27=_0x208f6a[_0x5f56d5])&&(_0x352896=(_0x45e18a?_0x27ce27(_0xee7912,_0x268e97,_0x352896):_0x27ce27(_0x352896))||_0x352896);return _0x45e18a&&_0x352896&&_0x174499(_0xee7912,_0x268e97,_0x352896),_0x352896;},_0x30cd72=(_0x2efe3f,_0x393323)=>(_0x29e7df,_0x309a18)=>_0x393323(_0x29e7df,_0x309a18,_0x2efe3f);let _0xceb039=class extends _0x471e7b['Disposable']{constructor(_0x16dc83,_0x3f2723,_0x285018,_0x1326d2){const _0x1c342a=_0x3f17ea;super(),this[_0x1c342a(0x1d5)]=_0x16dc83,this['_threadCommentModel']=_0x3f2723,this[_0x1c342a(0x214)]=_0x285018,this[_0x1c342a(0x232)]=_0x1326d2,this['_init'](),this[_0x1c342a(0x204)]();}[_0x3f17ea(0x204)](){const _0x5eb2dc=_0x3f17ea;this[_0x5eb2dc(0x218)](this[_0x5eb2dc(0x22d)][_0x5eb2dc(0x1fb)][_0x5eb2dc(0x1e7)](_0x470645['bufferTime'](0x10))[_0x5eb2dc(0x1df)](_0x407dfd=>{const _0x41c052=_0x5eb2dc,_0x557203=new Set();_0x407dfd[_0x41c052(0x239)](_0x34ed7d=>{const _0x2c3ef0=_0x41c052;switch(_0x34ed7d[_0x2c3ef0(0x216)]){case _0x2c3ef0(0x1ed):{const _0x47de37=_0x34ed7d[_0x2c3ef0(0x229)][_0x2c3ef0(0x208)];_0x557203['add'](_0x47de37);break;}}}),_0x479de3(this['_injector'],_0x557203);}));}['_init'](){const _0x7a448e=_0x3f17ea;this[_0x7a448e(0x218)](this[_0x7a448e(0x1d5)][_0x7a448e(0x1fb)][_0x7a448e(0x1df)](async _0x5f286f=>{const _0x1abc0a=_0x7a448e;var _0x1faff8,_0x19eaad,_0x594cc4,_0x3de8bc;const _0x38d8e4=(_0x1faff8=this['_threadCommentModel'][_0x1abc0a(0x22e)](_0x5f286f['unitId'])[_0x1abc0a(0x1f5)](_0x30656e=>_0x30656e[_0x1abc0a(0x1d4)]===_0x5f286f[_0x1abc0a(0x1d4)]))==null?void 0x0:_0x1faff8['root'];if(!_0x38d8e4)return;const {unitId:_0x47f705,subUnitId:_0x251350}=_0x38d8e4;switch(_0x5f286f['user']&&this[_0x1abc0a(0x214)]['addUser'](_0x5f286f[_0x1abc0a(0x210)]),_0x5f286f[_0x1abc0a(0x216)]){case _0x2389c5[_0x1abc0a(0x206)]:break;case _0x2389c5['Reply']:{this[_0x1abc0a(0x22d)][_0x1abc0a(0x238)](_0x47f705,_0x251350,{'unitId':_0x47f705,'subUnitId':_0x251350,'ref':'','id':_0x5f286f[_0x1abc0a(0x226)],'dT':_0x429cd(+_0x5f286f[_0x1abc0a(0x1ff)]),'threadId':_0x5f286f['threadId'],'personId':(_0x594cc4=(_0x19eaad=_0x5f286f[_0x1abc0a(0x210)])==null?void 0x0:_0x19eaad[_0x1abc0a(0x209)])!=null?_0x594cc4:_0x5f286f[_0x1abc0a(0x1e0)],'text':JSON['parse'](_0x5f286f[_0x1abc0a(0x221)]),'parentId':_0x38d8e4['id']});break;}case _0x2389c5[_0x1abc0a(0x1c1)]:{const _0x4d32a7=this[_0x1abc0a(0x22d)][_0x1abc0a(0x1c6)](_0x47f705,_0x251350,_0x5f286f['replyId']);_0x4d32a7&&_0x4d32a7[_0x1abc0a(0x1ee)]&&this[_0x1abc0a(0x22d)][_0x1abc0a(0x1e6)](_0x47f705,_0x251350,_0x5f286f[_0x1abc0a(0x226)]);break;}case _0x2389c5[_0x1abc0a(0x1dc)]:{this[_0x1abc0a(0x22d)][_0x1abc0a(0x23f)](_0x47f705,_0x251350,{'commentId':_0x5f286f['replyId'],'text':JSON[_0x1abc0a(0x222)](_0x5f286f[_0x1abc0a(0x221)])});break;}case _0x2389c5['Solve']:{const _0x50ab12=(_0x3de8bc=this['_threadCommentModel']['getUnit'](_0x5f286f[_0x1abc0a(0x242)])['find'](_0x2ddec5=>_0x2ddec5[_0x1abc0a(0x1d4)]===_0x5f286f[_0x1abc0a(0x1d4)]))==null?void 0x0:_0x3de8bc['root'];_0x50ab12&&this[_0x1abc0a(0x22d)][_0x1abc0a(0x1f6)](_0x47f705,_0x251350,_0x50ab12['id'],_0x5f286f[_0x1abc0a(0x1ec)]===_0x34e685[_0x1abc0a(0x20b)]);break;}}}));}};_0xceb039=_0x4c8dc3([_0x30cd72(0x0,_0x471e7b[_0x3f17ea(0x1c3)](_0x38535f[_0x3f17ea(0x215)])),_0x30cd72(0x1,_0x471e7b[_0x3f17ea(0x1c3)](_0x11c43c['ThreadCommentModel'])),_0x30cd72(0x2,_0x471e7b[_0x3f17ea(0x1c3)](_0x471e7b[_0x3f17ea(0x21d)])),_0x30cd72(0x3,_0x471e7b[_0x3f17ea(0x1c3)](_0x471e7b[_0x3f17ea(0x22f)]))],_0xceb039);const _0x4936b6='thread-comment-data-source.config',_0x57351b={};var _0x55342f=Object[_0x3f17ea(0x1ef)],_0x2dc9f6=Object[_0x3f17ea(0x243)],_0x1c5ce6=(_0x562653,_0x26a18f,_0x52b383,_0x50c2d3)=>{const _0x14ae44=_0x3f17ea;for(var _0x6b405e=_0x50c2d3>0x1?void 0x0:_0x50c2d3?_0x2dc9f6(_0x26a18f,_0x52b383):_0x26a18f,_0xe03323=_0x562653[_0x14ae44(0x1c8)]-0x1,_0x4c8a8a;_0xe03323>=0x0;_0xe03323--)(_0x4c8a8a=_0x562653[_0xe03323])&&(_0x6b405e=(_0x50c2d3?_0x4c8a8a(_0x26a18f,_0x52b383,_0x6b405e):_0x4c8a8a(_0x6b405e))||_0x6b405e);return _0x50c2d3&&_0x6b405e&&_0x55342f(_0x26a18f,_0x52b383,_0x6b405e),_0x6b405e;},_0x4e5365=(_0x28e1dd,_0x55b330)=>(_0x2bc45f,_0x1f7447)=>_0x55b330(_0x2bc45f,_0x1f7447,_0x28e1dd);function _0x5b82b1(_0x10e2c2,_0x4b6f2a){const _0x85ddea=_0x3f17ea,_0x27acf9=_0x10e2c2['replies'][0x0];return{..._0x4b6f2a,'id':_0x27acf9['replyId'],'resolved':_0x10e2c2[_0x85ddea(0x1ec)]===0x1,'dT':_0x429cd(_0x27acf9['createTimestamp']),'personId':_0x27acf9[_0x85ddea(0x1e0)],'threadId':_0x27acf9[_0x85ddea(0x1d4)]};}function _0x17f5a9(_0x75444f,_0x39a57f,_0x5debed){const _0x23b577=_0x3f17ea;var _0x1da268,_0x5d2ba6;if(((_0x5d2ba6=(_0x1da268=_0x75444f==null?void 0x0:_0x75444f[_0x23b577(0x246)])==null?void 0x0:_0x1da268['length'])!=null?_0x5d2ba6:0x0)>0x0){const _0x5143c3=(_0x28f140,_0x27238c)=>({'id':_0x28f140[_0x23b577(0x226)],'threadId':_0x28f140[_0x23b577(0x1d4)],'dT':_0x429cd(_0x28f140[_0x23b577(0x1ff)]),'personId':_0x28f140['userId'],'resolved':_0x75444f['solved']===_0x34e685['Solved'],'unitId':_0x39a57f,'subUnitId':_0x5debed,'text':JSON[_0x23b577(0x222)](_0x28f140[_0x23b577(0x221)]),'parentId':_0x27238c}),_0x247522=_0x5143c3(_0x75444f[_0x23b577(0x246)][0x0]);return{..._0x247522,'children':_0x75444f['replies']['slice'](0x1)[_0x23b577(0x1e5)](_0xe30fbf=>_0x5143c3(_0xe30fbf,_0x247522['id']))};}return null;}let _0x16c945=class{constructor(_0x396f46,_0x1559e1,_0x5e81b6,_0x42473f){const _0x6680e9=_0x3f17ea;this[_0x6680e9(0x1f8)]=_0x396f46,this[_0x6680e9(0x214)]=_0x1559e1,this[_0x6680e9(0x20e)]=_0x5e81b6,this['_injector']=_0x42473f;}async['addComment'](_0x141156){const _0x522bcc=_0x3f17ea;var _0xd5820a,_0x15faab;const {parentId:_0x5760d0,unitId:_0x329842,text:_0x532a49,threadId:_0x5ae548}=_0x141156,_0x5b5e5b=(_0x15faab=(_0xd5820a=_0x532a49[_0x522bcc(0x1ca)])==null?void 0x0:_0xd5820a[_0x522bcc(0x23a)](_0x261b48=>_0x261b48[_0x522bcc(0x225)]===_0x471e7b[_0x522bcc(0x236)][_0x522bcc(0x20d)])[_0x522bcc(0x1e5)](_0x3962cb=>_0x3962cb[_0x522bcc(0x1f3)]))!=null?_0x15faab:[],_0x4a052e=JSON[_0x522bcc(0x1d2)](_0x532a49),_0x339c85=(await this[_0x522bcc(0x20e)][_0x522bcc(0x1e9)](_0x329842))[_0x522bcc(0x234)]();if(_0x5760d0){const _0x2bffdc={'memberId':_0x339c85,'unitId':_0x329842,'content':_0x4a052e,'mention':_0x5b5e5b,'threadId':_0x5ae548},_0x18c814=(await this['_httpService']['post'](_0x522bcc(0x200)+_0x329842+_0x522bcc(0x1de),{'body':_0x2bffdc}))['body'][_0x522bcc(0x202)];return{..._0x141156,'id':_0x18c814[_0x522bcc(0x226)],'dT':_0x471e7b[_0x522bcc(0x1e1)](+_0x18c814['createTimestamp'])['format'](_0x522bcc(0x1d0)),'personId':_0x18c814[_0x522bcc(0x1e0)]};}else{const _0x24d82f={'memberId':_0x339c85,'unitId':_0x329842,'content':_0x4a052e,'mention':_0x5b5e5b},_0x3204e3=await this[_0x522bcc(0x1f8)]['post']('/universer-api/comment/unit/'+_0x329842+_0x522bcc(0x1ce),{'body':_0x24d82f});return _0x5b82b1(_0x3204e3[_0x522bcc(0x1fc)]['comment'],_0x141156);}}async[_0x3f17ea(0x23f)](_0x570b9f){const _0x4b5797=_0x3f17ea;var _0xdf5aed,_0xf5dc2a;const {text:_0x6f884b,unitId:_0x244f9d}=_0x570b9f,_0x1c705b=(_0xf5dc2a=(_0xdf5aed=_0x6f884b[_0x4b5797(0x1ca)])==null?void 0x0:_0xdf5aed[_0x4b5797(0x23a)](_0x305454=>_0x305454[_0x4b5797(0x225)]===_0x471e7b[_0x4b5797(0x236)][_0x4b5797(0x20d)])['map'](_0x4ddc07=>_0x4ddc07['rangeId']))!=null?_0xf5dc2a:[],_0x3034ea=JSON[_0x4b5797(0x1d2)](_0x6f884b),_0x108135=_0x570b9f['threadId'],_0x4c5408=_0x570b9f['id'],_0x59de8e={'memberId':(await this[_0x4b5797(0x20e)]['requireSession'](_0x244f9d))[_0x4b5797(0x234)](),'unitId':_0x244f9d,'threadId':_0x108135,'mention':_0x1c705b,'content':_0x3034ea,'replyId':_0x4c5408},_0x5821a5=await this[_0x4b5797(0x1f8)][_0x4b5797(0x1d1)](_0x4b5797(0x200)+_0x244f9d+_0x4b5797(0x23b),{'body':_0x59de8e});return!_0x5821a5[_0x4b5797(0x1fc)][_0x4b5797(0x23c)]||_0x5821a5[_0x4b5797(0x1fc)]['error'][_0x4b5797(0x1cc)]===0x1;}async[_0x3f17ea(0x1f6)](_0x26d079){const _0x5e7c7e=_0x3f17ea,{unitId:_0x42d137}=_0x26d079,_0x5938b3=_0x26d079['threadId'],_0x557604={'memberId':this['_userService'][_0x5e7c7e(0x22b)]()[_0x5e7c7e(0x209)],'unitId':_0x42d137,'threadId':_0x5938b3,'solved':_0x26d079[_0x5e7c7e(0x1d3)]?_0x34e685[_0x5e7c7e(0x20b)]:_0x34e685[_0x5e7c7e(0x1e4)]},_0x535f08=await this[_0x5e7c7e(0x1f8)]['post'](_0x5e7c7e(0x200)+_0x42d137+'/solved',{'body':_0x557604});return!_0x535f08[_0x5e7c7e(0x1fc)][_0x5e7c7e(0x23c)]||_0x535f08[_0x5e7c7e(0x1fc)][_0x5e7c7e(0x23c)][_0x5e7c7e(0x1cc)]===0x1;}async[_0x3f17ea(0x1e6)](_0x1d3318,_0x3444e0,_0x4f5664,_0x1274b2){const _0x42c08e=_0x3f17ea,_0x1a81c6={'memberId':(await this[_0x42c08e(0x20e)]['requireSession'](_0x1d3318))[_0x42c08e(0x234)](),'threadId':_0x4f5664,'replyId':_0x1274b2,'unitId':_0x1d3318},_0x274eb3=await this[_0x42c08e(0x1f8)]['post'](_0x42c08e(0x200)+_0x1d3318+_0x42c08e(0x1d6),{'body':_0x1a81c6});return!_0x274eb3[_0x42c08e(0x1fc)][_0x42c08e(0x23c)]||_0x274eb3[_0x42c08e(0x1fc)]['error']['code']===0x1;}async[_0x3f17ea(0x1e8)](_0x3d62b6,_0x41008a,_0x1ea785){const _0x5200a=_0x3f17ea,_0x14e03e={'unitId':_0x3d62b6,'threadId':_0x1ea785},_0x5a4754=await this[_0x5200a(0x1f8)][_0x5200a(0x1d1)](_0x5200a(0x200)+_0x3d62b6+_0x5200a(0x1fe),{'body':_0x14e03e}),_0xb4fd1b=_0x1ea785['map'](_0x4a8b30=>_0x17f5a9(_0x5a4754[_0x5200a(0x1fc)]['comments'][_0x4a8b30],_0x3d62b6,_0x41008a))[_0x5200a(0x23a)](Boolean);return Object[_0x5200a(0x211)](_0x5a4754['body'][_0x5200a(0x244)])[_0x5200a(0x239)](_0x54c4d9=>{const _0x46994a=_0x5200a;this[_0x46994a(0x214)][_0x46994a(0x201)](_0x54c4d9);}),_0xb4fd1b;}[_0x3f17ea(0x227)](_0x578127){const _0x3ace52=_0x3f17ea;return{'id':_0x578127['id'],'threadId':_0x578127[_0x3ace52(0x1d4)],'ref':_0x578127['ref']};}};_0x16c945=_0x1c5ce6([_0x4e5365(0x0,_0x471e7b[_0x3f17ea(0x1c3)](_0x131a66[_0x3f17ea(0x1d7)])),_0x4e5365(0x1,_0x471e7b[_0x3f17ea(0x1c3)](_0x471e7b[_0x3f17ea(0x21d)])),_0x4e5365(0x2,_0x471e7b[_0x3f17ea(0x1c3)](_0x38535f[_0x3f17ea(0x1e2)])),_0x4e5365(0x3,_0x471e7b['Inject'](_0x471e7b['Injector']))],_0x16c945);var _0x5034bf=Object['defineProperty'],_0x1f7476=Object['getOwnPropertyDescriptor'],_0x407fac=(_0x3ce2e4,_0x1d7122,_0x3bcb0d,_0xa6260a)=>{for(var _0x350559=_0xa6260a>0x1?void 0x0:_0xa6260a?_0x1f7476(_0x1d7122,_0x3bcb0d):_0x1d7122,_0x21e92f=_0x3ce2e4['length']-0x1,_0x38c192;_0x21e92f>=0x0;_0x21e92f--)(_0x38c192=_0x3ce2e4[_0x21e92f])&&(_0x350559=(_0xa6260a?_0x38c192(_0x1d7122,_0x3bcb0d,_0x350559):_0x38c192(_0x350559))||_0x350559);return _0xa6260a&&_0x350559&&_0x5034bf(_0x1d7122,_0x3bcb0d,_0x350559),_0x350559;},_0x119877=(_0x10d8d7,_0x5c6764)=>(_0x2d14bb,_0x285127)=>_0x5c6764(_0x2d14bb,_0x285127,_0x10d8d7);let _0x3eb69d=class extends _0x471e7b[_0x3f17ea(0x1f4)]{constructor(_0x8bd012,_0x36a678){const _0x29ac0e=_0x3f17ea;super(),this['_threadCommentDataSourceService']=_0x8bd012,this[_0x29ac0e(0x1db)]=_0x36a678,this[_0x29ac0e(0x1cb)]();}[_0x3f17ea(0x1cb)](){const _0x212774=_0x3f17ea;this['_threadCommentDataSourceService'][_0x212774(0x217)]=this[_0x212774(0x1db)],this[_0x212774(0x1d8)][_0x212774(0x207)]=!0x1;}};_0x3eb69d=_0x407fac([_0x119877(0x0,_0x11c43c[_0x3f17ea(0x21e)]),_0x119877(0x1,_0x471e7b[_0x3f17ea(0x1c3)](_0x16c945))],_0x3eb69d);var _0x2b5a13=Object['defineProperty'],_0x309923=Object[_0x3f17ea(0x243)],_0x10fa16=(_0x2c1e6e,_0x54a170,_0x18789c)=>_0x54a170 in _0x2c1e6e?_0x2b5a13(_0x2c1e6e,_0x54a170,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x18789c}):_0x2c1e6e[_0x54a170]=_0x18789c,_0x92608c=(_0x51d587,_0x2027b1,_0x13630d,_0x570f45)=>{const _0x3b1fb5=_0x3f17ea;for(var _0x22911e=_0x570f45>0x1?void 0x0:_0x570f45?_0x309923(_0x2027b1,_0x13630d):_0x2027b1,_0x5eb2b4=_0x51d587[_0x3b1fb5(0x1c8)]-0x1,_0x362844;_0x5eb2b4>=0x0;_0x5eb2b4--)(_0x362844=_0x51d587[_0x5eb2b4])&&(_0x22911e=(_0x570f45?_0x362844(_0x2027b1,_0x13630d,_0x22911e):_0x362844(_0x22911e))||_0x22911e);return _0x570f45&&_0x22911e&&_0x2b5a13(_0x2027b1,_0x13630d,_0x22911e),_0x22911e;},_0x839a03=(_0x5a9f1b,_0x513f80)=>(_0x2a71d7,_0x35892b)=>_0x513f80(_0x2a71d7,_0x35892b,_0x5a9f1b),_0x11d8cc=(_0x2397eb,_0x387b4a,_0x5f47cd)=>_0x10fa16(_0x2397eb,typeof _0x387b4a!='symbol'?_0x387b4a+'':_0x387b4a,_0x5f47cd);_0x3fe389[_0x3f17ea(0x21f)]=class extends _0x471e7b[_0x3f17ea(0x22c)]{constructor(_0x728d6b=_0x57351b,_0x5ead82,_0x26a729){const _0x462769=_0x3f17ea;super(),this[_0x462769(0x1eb)]=_0x728d6b,this[_0x462769(0x232)]=_0x5ead82,this[_0x462769(0x1fa)]=_0x26a729;const {..._0x3aacdd}=this['_config'];this[_0x462769(0x1fa)]['setConfig'](_0x4936b6,_0x3aacdd);}[_0x3f17ea(0x212)](){[[_0x16c945],[_0x3eb69d],[_0xceb039]]['forEach'](_0x2cedc6=>{const _0x3c86b7=_0x1a92;this[_0x3c86b7(0x232)][_0x3c86b7(0x1ed)](_0x2cedc6);});}['onReady'](){const _0x31edad=_0x3f17ea;this['_injector']['get'](_0x3eb69d),this[_0x31edad(0x232)][_0x31edad(0x1f1)](_0xceb039);}},_0x11d8cc(_0x3fe389[_0x3f17ea(0x21f)],_0x3f17ea(0x20a),_0x50c45f),_0x11d8cc(_0x3fe389[_0x3f17ea(0x21f)],_0x3f17ea(0x216),_0x471e7b[_0x3f17ea(0x1f0)][_0x3f17ea(0x213)]),_0x3fe389[_0x3f17ea(0x21f)]=_0x92608c([_0x471e7b[_0x3f17ea(0x20c)](_0x2a825[_0x3f17ea(0x1c9)],_0x38535f['UniverCollaborationClientPlugin'],_0x5dec0e[_0x3f17ea(0x1c0)]),_0x839a03(0x1,_0x471e7b[_0x3f17ea(0x1c3)](_0x471e7b[_0x3f17ea(0x22f)])),_0x839a03(0x2,_0x471e7b[_0x3f17ea(0x1fd)])],_0x3fe389[_0x3f17ea(0x21f)]),Object[_0x3f17ea(0x1ef)](_0x3fe389,Symbol[_0x3f17ea(0x20f)],{'value':_0x3f17ea(0x1c5)});}));function _0x1a92(_0x3f9644,_0x13d53c){const _0x39cf6f=_0x39cf();return _0x1a92=function(_0x1a92e5,_0x47dc1f){_0x1a92e5=_0x1a92e5-0x1c0;let _0x1cee50=_0x39cf6f[_0x1a92e5];return _0x1cee50;},_0x1a92(_0x3f9644,_0x13d53c);}function _0x39cf(){const _0x3b3ab1=['getUnit','Injector','UniverProThreadCommentDatasource','UniverThreadCommentUi','_injector','UniverThreadComment','getMemberID','3324rYuypq','CustomRangeType','1ZfGNcP','addComment','forEach','filter','/edit','error','Unknown','UniverNetwork','updateComment','11576790mtlIWb','rxjs','unitId','getOwnPropertyDescriptor','users','function','replies','UniverLicensePlugin','Delete','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Inject','UniverProCollaborationClient','Module','getComment','@univerjs-pro/license','length','UniverThreadCommentUIPlugin','customRanges','_initDataSource','code','format','/add','getUser','YYYY/MM/DD\x20HH:mm','post','stringify','resolved','threadId','_commentService','/delete','HTTPService','_threadCommentDataSourceService','3370oKXoyG','/universer-api/user/list','_threadCommentDataSource','Edit','amd','/reply','subscribe','userId','dayjs','CollaborationSessionService','1943893dQjkFL','OpenOrReOpen','map','deleteComment','pipe','listComments','requireSession','@univerjs/thread-comment-ui','_config','solved','add','parentId','defineProperty','UniverInstanceType','get','4294662LqizUG','rangeId','Disposable','find','resolveComment','@univerjs-pro/collaboration-client','_httpService','6044440aEZWHs','_configService','commentUpdate$','body','IConfigService','/list','createTimestamp','/universer-api/comment/unit/','addUser','reply','object','_initUserSync','Reply','Add','syncUpdateMutationToColla','personId','userID','pluginName','Solved','DependentOn','COMMENT','_sessionService','toStringTag','user','values','onStarting','UNIVER_UNKNOWN','_userService','CommentService','type','dataSource','disposeWithMe','3829520kSXIIq','UNRECOGNIZED','2003836dJcMds','Solve','UserManagerService','IThreadCommentDataSourceService','UniverThreadCommentDataSourcePlugin','@univerjs/network','content','parse','@univerjs/core','UniverProLicense','rangeType','replyId','saveCommentToSnapshot','exports','payload','@univerjs/thread-comment','getCurrentUser','Plugin','_threadCommentModel'];_0x39cf=function(){return _0x3b3ab1;};return _0x39cf();}
37
37
 
38
38
  // index
39
- (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@univerjs/sheets-thread-comment"),require("@univerjs/sheets-thread-comment-ui"),require("@univerjs/thread-comment-ui"),require("@univerjs-pro/thread-comment-datasource"),require("@univerjs/sheets-thread-comment/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-thread-comment","@univerjs/sheets-thread-comment-ui","@univerjs/thread-comment-ui","@univerjs-pro/thread-comment-datasource","@univerjs/sheets-thread-comment/facade"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.UniverPresetSheetsThreadComment={},e.UniverSheetsThreadComment,e.UniverSheetsThreadCommentUi,e.UniverThreadCommentUi,e.UniverProThreadCommentDatasource))})(this,function(e,t,n,i,s){"use strict";function m(o={}){const{collaboration:u}=o,r=[i.UniverThreadCommentUIPlugin,t.UniverSheetsThreadCommentPlugin,n.UniverSheetsThreadCommentUIPlugin];return u&&r.push(s.UniverThreadCommentDataSourcePlugin),{plugins:r}}e.UniverSheetsThreadCommentPreset=m,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
39
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@univerjs-pro/thread-comment-datasource"),require("@univerjs/sheets-thread-comment"),require("@univerjs/sheets-thread-comment-ui"),require("@univerjs/thread-comment-ui"),require("@univerjs/sheets-thread-comment/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs-pro/thread-comment-datasource","@univerjs/sheets-thread-comment","@univerjs/sheets-thread-comment-ui","@univerjs/thread-comment-ui","@univerjs/sheets-thread-comment/facade"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.UniverPresetSheetsThreadComment={},e.UniverProThreadCommentDatasource,e.UniverSheetsThreadComment,e.UniverSheetsThreadCommentUi,e.UniverThreadCommentUi))})(this,function(e,t,n,i,s){"use strict";function m(o={}){const{collaboration:u}=o,r=[s.UniverThreadCommentUIPlugin,n.UniverSheetsThreadCommentPlugin,i.UniverSheetsThreadCommentUIPlugin];return u&&r.push(t.UniverThreadCommentDataSourcePlugin),{plugins:r}}e.UniverSheetsThreadCommentPreset=m,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,10 @@
1
+ // @univerjs/thread-comment-ui/locale/fr-FR
2
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverThreadCommentUiFrFR=t())})(this,function(){"use strict";return{threadCommentUI:{panel:{title:"Gestion des commentaires",empty:"Pas encore de commentaires",filterEmpty:"Aucun résultat correspondant",reset:"Réinitialiser le filtre",addComment:"Ajouter un commentaire"},editor:{placeholder:"Répondre ou ajouter d'autres avec @",reply:"Commenter",cancel:"Annuler",save:"Enregistrer"},item:{edit:"Modifier",delete:"Supprimer ce commentaire"},filter:{sheet:{all:"Toutes les feuilles",current:"Feuille actuelle"},status:{all:"Tous les commentaires",resolved:"Résolu",unsolved:"Non résolu",concernMe:"Me concerne"}}}}});
3
+
4
+
5
+ // @univerjs/sheets-thread-comment-ui/locale/fr-FR
6
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsThreadCommentUiFrFR=n())})(this,function(){"use strict";return{sheetThreadComment:{menu:{addComment:"Ajouter un commentaire",commentManagement:"Gestion des commentaires"}}}});
7
+
8
+
9
+ // locale/fr-FR
10
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("@univerjs/core"),require("@univerjs/sheets-thread-comment-ui/locale/fr-FR"),require("@univerjs/thread-comment-ui/locale/fr-FR")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-thread-comment-ui/locale/fr-FR","@univerjs/thread-comment-ui/locale/fr-FR"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverPresetSheetsThreadCommentFrFR=r(e.UniverCore,e.UniverSheetsThreadCommentUiFrFR,e.UniverThreadCommentUiFrFR))})(this,function(e,r,n){"use strict";return e.Tools.deepMerge({},r,n)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-sheets-thread-comment",
3
- "version": "0.5.0-nightly.202411230627",
3
+ "version": "0.5.1-nightly.202412041606",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -20,6 +20,9 @@
20
20
  "keywords": [
21
21
  "univer"
22
22
  ],
23
+ "sideEffects": [
24
+ "*.css"
25
+ ],
23
26
  "exports": {
24
27
  ".": {
25
28
  "import": "./lib/es/index.js",
@@ -54,18 +57,18 @@
54
57
  "rxjs": ">=7.0.0"
55
58
  },
56
59
  "dependencies": {
57
- "@univerjs-pro/thread-comment-datasource": "0.5.0-nightly.202411230627",
58
- "@univerjs/sheets-thread-comment": "0.5.0-nightly.202411230627",
59
- "@univerjs/sheets-thread-comment-ui": "0.5.0-nightly.202411230627",
60
- "@univerjs/thread-comment-ui": "0.5.0-nightly.202411230627"
60
+ "@univerjs-pro/thread-comment-datasource": "0.5.1-nightly.202412041606",
61
+ "@univerjs/sheets-thread-comment": "0.5.1-nightly.202412041606",
62
+ "@univerjs/sheets-thread-comment-ui": "0.5.1-nightly.202412041606",
63
+ "@univerjs/thread-comment-ui": "0.5.1-nightly.202412041606"
61
64
  },
62
65
  "devDependencies": {
63
- "@univerjs/core": "0.5.0-nightly.202411230627",
64
- "typescript": "^5.6.3",
65
- "@univerjs-infra/shared": "0.5.0-nightly.202411230627"
66
+ "@univerjs/core": "0.5.1-nightly.202412041606",
67
+ "typescript": "^5.7.2",
68
+ "@univerjs-infra/shared": "0.5.1-nightly.202412041606"
66
69
  },
67
70
  "scripts": {
68
- "prebuild": "tsx prepare.ts",
71
+ "prebuild:preset": "tsx prepare.ts",
69
72
  "build:preset": "tsx build.ts"
70
73
  },
71
74
  "module": "./lib/es/index.js"