@univerjs-pro/thread-comment-datasource 0.6.10-nightly.202504221607 → 0.6.10-nightly.202504241607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x4aaf49=_0x7313;(function(_0x465a2f,_0x593403){const _0x1b9c04=_0x7313,_0x1a69d4=_0x465a2f();while(!![]){try{const _0x531f6c=-parseInt(_0x1b9c04(0x16b))/0x1+parseInt(_0x1b9c04(0x178))/0x2+-parseInt(_0x1b9c04(0x188))/0x3*(parseInt(_0x1b9c04(0x19a))/0x4)+parseInt(_0x1b9c04(0x19f))/0x5*(parseInt(_0x1b9c04(0x14f))/0x6)+-parseInt(_0x1b9c04(0x154))/0x7*(parseInt(_0x1b9c04(0x196))/0x8)+parseInt(_0x1b9c04(0x17c))/0x9*(parseInt(_0x1b9c04(0x1a4))/0xa)+parseInt(_0x1b9c04(0x168))/0xb*(-parseInt(_0x1b9c04(0x1b8))/0xc);if(_0x531f6c===_0x593403)break;else _0x1a69d4['push'](_0x1a69d4['shift']());}catch(_0x3ada18){_0x1a69d4['push'](_0x1a69d4['shift']());}}}(_0x1627,0x68854));function _0x1627(){const _0x3b1f8f=['Reply','unitId','type','1306870rYQdDA','symbol','/universer-api/user/list','Solve','135MjqHep','_threadCommentDataSource','comment','getUnit','requireSession','find','forEach','getComment','commentUpdate$','users','delete','user','14937sqCYXv','rangeType','Unknown','parentId','setConfig','CommentService','@univerjs/thread-comment','body','Edit','@univerjs/core','_initUserSync','OpenOrReOpen','_threadCommentDataSourceService','createTimestamp','19408YcuBzX','syncUpdateMutationToColla','defineProperty','dayjs','28IywScB','root','userId','_sessionService','add','3916295oACkrU','saveCommentToSnapshot','onReady','replies','resolved','443810dEAnlj','/list','_httpService','Solved','_threadCommentModel','DependentOn','solved','UniverThreadCommentDataSourcePlugin','@univerjs/thread-comment-ui','updateComment','getCurrentUser','resolveComment','UserManagerService','addUser','getUser','addComment','values','disposeWithMe','code','getMemberID','5751588BuaRcM','slice','Delete','stringify','payload','/universer-api/comment/unit/','UNRECOGNIZED','filter','content','format','replyId','Module','map','Inject','6iOuOWV','UniverInstanceType','deleteComment','customRanges','/add','469KAGyHY','post','subscribe','length','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','IConfigService','/delete','pipe','thread-comment-data-source.config','CustomRangeType','Disposable','_commentService','_configService','Plugin','_initDataSource','YYYY/MM/DD\x20HH:mm','UniverThreadCommentUIPlugin','error','_userService','IThreadCommentDataSourceService','22JTSleX','threadId','getOwnPropertyDescriptor','518300uwhVOf','get','listComments','userID','personId','_injector','onStarting','Injector','parse','Add'];_0x1627=function(){return _0x3b1f8f;};return _0x1627();}Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0x4aaf49(0x14c)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require(_0x4aaf49(0x191)),j=require(_0x4aaf49(0x1ac)),M=require(_0x4aaf49(0x18e)),w=require('rxjs'),P=require('@univerjs/network'),U=_0x4aaf49(0x158);var I=(_0xfb8ad9=>(_0xfb8ad9[_0xfb8ad9[_0x4aaf49(0x193)]=0x0]=_0x4aaf49(0x193),_0xfb8ad9[_0xfb8ad9['Solved']=0x1]='Solved',_0xfb8ad9[_0xfb8ad9[_0x4aaf49(0x147)]=-0x1]=_0x4aaf49(0x147),_0xfb8ad9))(I||{}),v=(_0x101db6=>(_0x101db6[_0x101db6[_0x4aaf49(0x18a)]=0x0]=_0x4aaf49(0x18a),_0x101db6[_0x101db6['Add']=0x1]=_0x4aaf49(0x174),_0x101db6[_0x101db6['Reply']=0x2]=_0x4aaf49(0x175),_0x101db6[_0x101db6['Edit']=0x3]=_0x4aaf49(0x190),_0x101db6[_0x101db6[_0x4aaf49(0x143)]=0x4]=_0x4aaf49(0x143),_0x101db6[_0x101db6['Solve']=0x5]=_0x4aaf49(0x17b),_0x101db6[_0x101db6[_0x4aaf49(0x147)]=-0x1]='UNRECOGNIZED',_0x101db6))(v||{});const f=_0x55519d=>c[_0x4aaf49(0x199)](new Date(+_0x55519d))[_0x4aaf49(0x14a)](_0x4aaf49(0x163)),R=async(_0x41a465,_0x3f11e8)=>{const _0x27b689=_0x4aaf49,_0x509685=_0x41a465[_0x27b689(0x16c)](c[_0x27b689(0x1b0)]),_0x2d4504=_0x41a465[_0x27b689(0x16c)](P['HTTPService']);_0x3f11e8['forEach'](_0x69248e=>{const _0x265862=_0x27b689;_0x509685[_0x265862(0x1b2)](_0x69248e)&&_0x3f11e8[_0x265862(0x186)](_0x69248e);}),_0x3f11e8['size']&&(await _0x2d4504[_0x27b689(0x16c)](_0x27b689(0x17a),{'params':{'userIDs':[..._0x3f11e8]}}))[_0x27b689(0x18f)]['users'][_0x27b689(0x182)](_0x313ffc=>{_0x313ffc&&_0x509685['addUser'](_0x313ffc);});};var $=Object[_0x4aaf49(0x16a)],E=(_0x43de55,_0x315613,_0x11ead0,_0x2ab31d)=>{const _0x3d99bd=_0x4aaf49;for(var _0x2cb316=_0x2ab31d>0x1?void 0x0:_0x2ab31d?$(_0x315613,_0x11ead0):_0x315613,_0x25ae03=_0x43de55[_0x3d99bd(0x157)]-0x1,_0x5e0974;_0x25ae03>=0x0;_0x25ae03--)(_0x5e0974=_0x43de55[_0x25ae03])&&(_0x2cb316=_0x5e0974(_0x2cb316)||_0x2cb316);return _0x2cb316;},S=(_0x265056,_0x36f846)=>(_0x53f4e0,_0x44597c)=>_0x36f846(_0x53f4e0,_0x44597c,_0x265056);let p=class extends c[_0x4aaf49(0x15e)]{constructor(_0x127dc1,_0x3f329c,_0x48a914,_0x1d3ec0){const _0x2fc7a8=_0x4aaf49;super(),this[_0x2fc7a8(0x15f)]=_0x127dc1,this[_0x2fc7a8(0x1a8)]=_0x3f329c,this[_0x2fc7a8(0x166)]=_0x48a914,this['_injector']=_0x1d3ec0,this['_init'](),this['_initUserSync']();}[_0x4aaf49(0x192)](){const _0x249584=_0x4aaf49;this[_0x249584(0x1b5)](this['_threadCommentModel'][_0x249584(0x184)][_0x249584(0x15b)](w['bufferTime'](0x10))['subscribe'](_0x30671c=>{const _0x132ccf=_0x249584,_0x3b5dec=new Set();_0x30671c[_0x132ccf(0x182)](_0x4a7542=>{const _0xdae1e9=_0x132ccf;switch(_0x4a7542[_0xdae1e9(0x177)]){case _0xdae1e9(0x19e):{const _0x4e57e0=_0x4a7542[_0xdae1e9(0x145)][_0xdae1e9(0x16f)];_0x3b5dec['add'](_0x4e57e0);break;}}}),R(this[_0x132ccf(0x170)],_0x3b5dec);}));}['_init'](){const _0x24b1f4=_0x4aaf49;this[_0x24b1f4(0x1b5)](this['_commentService'][_0x24b1f4(0x184)][_0x24b1f4(0x156)](async _0xd57348=>{const _0x14551e=_0x24b1f4;var _0xad1cce,_0x4636ed,_0x3f2688,_0x407f29;const _0x1b4f86=(_0xad1cce=this[_0x14551e(0x1a8)]['getUnit'](_0xd57348[_0x14551e(0x176)])[_0x14551e(0x181)](_0x4e1492=>_0x4e1492[_0x14551e(0x169)]===_0xd57348[_0x14551e(0x169)]))==null?void 0x0:_0xad1cce[_0x14551e(0x19b)];if(!_0x1b4f86)return;const {unitId:_0x2bacf9,subUnitId:_0x3d876b}=_0x1b4f86;switch(_0xd57348[_0x14551e(0x187)]&&this[_0x14551e(0x166)][_0x14551e(0x1b1)](_0xd57348[_0x14551e(0x187)]),_0xd57348[_0x14551e(0x177)]){case v['Add']:break;case v[_0x14551e(0x175)]:{this[_0x14551e(0x1a8)][_0x14551e(0x1b3)](_0x2bacf9,_0x3d876b,{'unitId':_0x2bacf9,'subUnitId':_0x3d876b,'ref':'','id':_0xd57348[_0x14551e(0x14b)],'dT':f(+_0xd57348[_0x14551e(0x195)]),'threadId':_0xd57348[_0x14551e(0x169)],'personId':(_0x3f2688=(_0x4636ed=_0xd57348[_0x14551e(0x187)])==null?void 0x0:_0x4636ed[_0x14551e(0x16e)])!=null?_0x3f2688:_0xd57348['userId'],'text':JSON['parse'](_0xd57348[_0x14551e(0x149)]),'parentId':_0x1b4f86['id']});break;}case v['Delete']:{const _0x354d48=this[_0x14551e(0x1a8)][_0x14551e(0x183)](_0x2bacf9,_0x3d876b,_0xd57348[_0x14551e(0x14b)]);_0x354d48&&_0x354d48[_0x14551e(0x18b)]&&this[_0x14551e(0x1a8)][_0x14551e(0x151)](_0x2bacf9,_0x3d876b,_0xd57348['replyId']);break;}case v[_0x14551e(0x190)]:{this['_threadCommentModel'][_0x14551e(0x1ad)](_0x2bacf9,_0x3d876b,{'commentId':_0xd57348['replyId'],'text':JSON['parse'](_0xd57348['content'])});break;}case v[_0x14551e(0x17b)]:{const _0x417450=(_0x407f29=this[_0x14551e(0x1a8)][_0x14551e(0x17f)](_0xd57348[_0x14551e(0x176)])[_0x14551e(0x181)](_0x32d19d=>_0x32d19d[_0x14551e(0x169)]===_0xd57348[_0x14551e(0x169)]))==null?void 0x0:_0x407f29[_0x14551e(0x19b)];_0x417450&&this[_0x14551e(0x1a8)][_0x14551e(0x1af)](_0x2bacf9,_0x3d876b,_0x417450['id'],_0xd57348['solved']===I['Solved']);break;}}}));}};p=E([S(0x0,c[_0x4aaf49(0x14e)](b[_0x4aaf49(0x18d)])),S(0x1,c[_0x4aaf49(0x14e)](M['ThreadCommentModel'])),S(0x2,c[_0x4aaf49(0x14e)](c[_0x4aaf49(0x1b0)])),S(0x3,c[_0x4aaf49(0x14e)](c[_0x4aaf49(0x172)]))],p);const q=_0x4aaf49(0x15c),D={};var A=Object[_0x4aaf49(0x16a)],x=(_0x3dff3b,_0x1f84b2,_0xa4680f,_0x4620fd)=>{const _0x36c6ad=_0x4aaf49;for(var _0x4525e3=_0x4620fd>0x1?void 0x0:_0x4620fd?A(_0x1f84b2,_0xa4680f):_0x1f84b2,_0x1256b3=_0x3dff3b[_0x36c6ad(0x157)]-0x1,_0x240049;_0x1256b3>=0x0;_0x1256b3--)(_0x240049=_0x3dff3b[_0x1256b3])&&(_0x4525e3=_0x240049(_0x4525e3)||_0x4525e3);return _0x4525e3;},_=(_0x549d3e,_0x1c9750)=>(_0x58cfda,_0x2cec3d)=>_0x1c9750(_0x58cfda,_0x2cec3d,_0x549d3e);function _0x7313(_0x53b298,_0x3e9c23){const _0x162715=_0x1627();return _0x7313=function(_0x731348,_0x2af567){_0x731348=_0x731348-0x143;let _0x279292=_0x162715[_0x731348];return _0x279292;},_0x7313(_0x53b298,_0x3e9c23);}function Y(_0x377ca1,_0x443587){const _0x1faa73=_0x4aaf49,_0x32be8a=_0x377ca1[_0x1faa73(0x1a2)][0x0];return{..._0x443587,'id':_0x32be8a[_0x1faa73(0x14b)],'resolved':_0x377ca1[_0x1faa73(0x1aa)]===0x1,'dT':f(_0x32be8a['createTimestamp']),'personId':_0x32be8a[_0x1faa73(0x19c)],'threadId':_0x32be8a[_0x1faa73(0x169)]};}function G(_0x5e3ab4,_0x520c07,_0x1ee5db){const _0x9cfdc0=_0x4aaf49;var _0x2941e7,_0xcfb729;if(((_0xcfb729=(_0x2941e7=_0x5e3ab4==null?void 0x0:_0x5e3ab4[_0x9cfdc0(0x1a2)])==null?void 0x0:_0x2941e7[_0x9cfdc0(0x157)])!=null?_0xcfb729:0x0)>0x0){const _0x3d6589=(_0x286e96,_0xcd72c6)=>({'id':_0x286e96[_0x9cfdc0(0x14b)],'threadId':_0x286e96[_0x9cfdc0(0x169)],'dT':f(_0x286e96['createTimestamp']),'personId':_0x286e96['userId'],'resolved':_0x5e3ab4[_0x9cfdc0(0x1aa)]===I[_0x9cfdc0(0x1a7)],'unitId':_0x520c07,'subUnitId':_0x1ee5db,'text':JSON[_0x9cfdc0(0x173)](_0x286e96[_0x9cfdc0(0x149)]),'parentId':_0xcd72c6}),_0x3eaa29=_0x3d6589(_0x5e3ab4[_0x9cfdc0(0x1a2)][0x0]);return{..._0x3eaa29,'children':_0x5e3ab4[_0x9cfdc0(0x1a2)][_0x9cfdc0(0x1b9)](0x1)['map'](_0x1a0395=>_0x3d6589(_0x1a0395,_0x3eaa29['id']))};}return null;}let g=class{constructor(_0x4bc39c,_0x39e095,_0x6dfa73,_0x2f59ba){const _0x2e35bd=_0x4aaf49;this[_0x2e35bd(0x1a6)]=_0x4bc39c,this[_0x2e35bd(0x166)]=_0x39e095,this['_sessionService']=_0x6dfa73,this[_0x2e35bd(0x170)]=_0x2f59ba;}async[_0x4aaf49(0x1b3)](_0x314ccf){const _0x3c3a1d=_0x4aaf49;var _0xf11389,_0x5e2db2;const {parentId:_0x1b2780,unitId:_0x5a5266,text:_0x4a3e9d,threadId:_0x3d84bf}=_0x314ccf,_0x38c0ce=(_0x5e2db2=(_0xf11389=_0x4a3e9d[_0x3c3a1d(0x152)])==null?void 0x0:_0xf11389[_0x3c3a1d(0x148)](_0x4e0a46=>_0x4e0a46[_0x3c3a1d(0x189)]===c[_0x3c3a1d(0x15d)]['COMMENT'])[_0x3c3a1d(0x14d)](_0x47e95a=>_0x47e95a['rangeId']))!=null?_0x5e2db2:[],_0x151e1b=JSON['stringify'](_0x4a3e9d),_0x409fd4=(await this[_0x3c3a1d(0x19d)][_0x3c3a1d(0x180)](_0x5a5266))[_0x3c3a1d(0x1b7)]();if(_0x1b2780){const _0x58e7b6={'memberId':_0x409fd4,'unitId':_0x5a5266,'content':_0x151e1b,'mention':_0x38c0ce,'threadId':_0x3d84bf},_0x3a2c37=(await this[_0x3c3a1d(0x1a6)]['post']('/universer-api/comment/unit/'+_0x5a5266+'/reply',{'body':_0x58e7b6}))[_0x3c3a1d(0x18f)]['reply'];return{..._0x314ccf,'id':_0x3a2c37[_0x3c3a1d(0x14b)],'dT':c[_0x3c3a1d(0x199)](+_0x3a2c37[_0x3c3a1d(0x195)])[_0x3c3a1d(0x14a)](_0x3c3a1d(0x163)),'personId':_0x3a2c37['userId']};}else{const _0x11b83c={'memberId':_0x409fd4,'unitId':_0x5a5266,'content':_0x151e1b,'mention':_0x38c0ce},_0x539eb7=await this[_0x3c3a1d(0x1a6)][_0x3c3a1d(0x155)](_0x3c3a1d(0x146)+_0x5a5266+_0x3c3a1d(0x153),{'body':_0x11b83c});return Y(_0x539eb7[_0x3c3a1d(0x18f)][_0x3c3a1d(0x17e)],_0x314ccf);}}async[_0x4aaf49(0x1ad)](_0x4d733f){const _0x73b842=_0x4aaf49;var _0x2aaf2a,_0x31b46e;const {text:_0x2fd27f,unitId:_0x5b868c}=_0x4d733f,_0x90d82f=(_0x31b46e=(_0x2aaf2a=_0x2fd27f[_0x73b842(0x152)])==null?void 0x0:_0x2aaf2a[_0x73b842(0x148)](_0x761f8c=>_0x761f8c['rangeType']===c[_0x73b842(0x15d)]['COMMENT'])[_0x73b842(0x14d)](_0x5b9981=>_0x5b9981['rangeId']))!=null?_0x31b46e:[],_0x4212ee=JSON[_0x73b842(0x144)](_0x2fd27f),_0x3a716e=_0x4d733f[_0x73b842(0x169)],_0x3635c6=_0x4d733f['id'],_0x62bf4b={'memberId':(await this[_0x73b842(0x19d)][_0x73b842(0x180)](_0x5b868c))['getMemberID'](),'unitId':_0x5b868c,'threadId':_0x3a716e,'mention':_0x90d82f,'content':_0x4212ee,'replyId':_0x3635c6},_0x29c077=await this[_0x73b842(0x1a6)]['post'](_0x73b842(0x146)+_0x5b868c+'/edit',{'body':_0x62bf4b});return!_0x29c077['body'][_0x73b842(0x165)]||_0x29c077[_0x73b842(0x18f)][_0x73b842(0x165)][_0x73b842(0x1b6)]===0x1;}async[_0x4aaf49(0x1af)](_0x15a384){const _0x1c9eb4=_0x4aaf49,{unitId:_0x51fb6d}=_0x15a384,_0xf27ae3=_0x15a384['threadId'],_0x1acfe7={'memberId':this[_0x1c9eb4(0x166)][_0x1c9eb4(0x1ae)]()[_0x1c9eb4(0x16e)],'unitId':_0x51fb6d,'threadId':_0xf27ae3,'solved':_0x15a384[_0x1c9eb4(0x1a3)]?I[_0x1c9eb4(0x1a7)]:I['OpenOrReOpen']},_0x521c1d=await this['_httpService']['post'](_0x1c9eb4(0x146)+_0x51fb6d+'/solved',{'body':_0x1acfe7});return!_0x521c1d[_0x1c9eb4(0x18f)][_0x1c9eb4(0x165)]||_0x521c1d[_0x1c9eb4(0x18f)]['error'][_0x1c9eb4(0x1b6)]===0x1;}async[_0x4aaf49(0x151)](_0xddb5a7,_0x4926a2,_0x41e394,_0x4fab06){const _0x2196f3=_0x4aaf49,_0xb8339b={'memberId':(await this[_0x2196f3(0x19d)][_0x2196f3(0x180)](_0xddb5a7))[_0x2196f3(0x1b7)](),'threadId':_0x41e394,'replyId':_0x4fab06,'unitId':_0xddb5a7},_0x4873bc=await this['_httpService']['post']('/universer-api/comment/unit/'+_0xddb5a7+_0x2196f3(0x15a),{'body':_0xb8339b});return!_0x4873bc[_0x2196f3(0x18f)][_0x2196f3(0x165)]||_0x4873bc[_0x2196f3(0x18f)][_0x2196f3(0x165)][_0x2196f3(0x1b6)]===0x1;}async[_0x4aaf49(0x16d)](_0x10fced,_0x57cbda,_0x5ae93c){const _0x31e415=_0x4aaf49,_0x54a13b={'unitId':_0x10fced,'threadId':_0x5ae93c},_0x4dc7f8=await this[_0x31e415(0x1a6)][_0x31e415(0x155)](_0x31e415(0x146)+_0x10fced+_0x31e415(0x1a5),{'body':_0x54a13b}),_0x153acd=_0x5ae93c[_0x31e415(0x14d)](_0x8b9b81=>G(_0x4dc7f8['body']['comments'][_0x8b9b81],_0x10fced,_0x57cbda))[_0x31e415(0x148)](Boolean);return Object[_0x31e415(0x1b4)](_0x4dc7f8['body'][_0x31e415(0x185)])[_0x31e415(0x182)](_0xe8885a=>{const _0x27dcd1=_0x31e415;this[_0x27dcd1(0x166)][_0x27dcd1(0x1b1)](_0xe8885a);}),_0x153acd;}[_0x4aaf49(0x1a0)](_0x1e6951){const _0x25803f=_0x4aaf49;return{'id':_0x1e6951['id'],'threadId':_0x1e6951[_0x25803f(0x169)],'ref':_0x1e6951['ref']};}};g=x([_(0x0,c['Inject'](P['HTTPService'])),_(0x1,c[_0x4aaf49(0x14e)](c['UserManagerService'])),_(0x2,c[_0x4aaf49(0x14e)](b['CollaborationSessionService'])),_(0x3,c['Inject'](c[_0x4aaf49(0x172)]))],g);var H=Object['getOwnPropertyDescriptor'],J=(_0x23cce7,_0x1961ef,_0x14c4ab,_0x14ca93)=>{for(var _0x39e39e=_0x14ca93>0x1?void 0x0:_0x14ca93?H(_0x1961ef,_0x14c4ab):_0x1961ef,_0x30353b=_0x23cce7['length']-0x1,_0x32b9c5;_0x30353b>=0x0;_0x30353b--)(_0x32b9c5=_0x23cce7[_0x30353b])&&(_0x39e39e=_0x32b9c5(_0x39e39e)||_0x39e39e);return _0x39e39e;},y=(_0x55076f,_0x42124d)=>(_0x5190db,_0x4a0af7)=>_0x42124d(_0x5190db,_0x4a0af7,_0x55076f);let C=class extends c[_0x4aaf49(0x15e)]{constructor(_0x2a7df1,_0xf026dc){const _0x448b7b=_0x4aaf49;super(),this[_0x448b7b(0x194)]=_0x2a7df1,this[_0x448b7b(0x17d)]=_0xf026dc,this[_0x448b7b(0x162)]();}['_initDataSource'](){const _0x2b9e37=_0x4aaf49;this[_0x2b9e37(0x194)]['dataSource']=this[_0x2b9e37(0x17d)],this['_threadCommentDataSourceService'][_0x2b9e37(0x197)]=!0x1;}};C=J([y(0x0,M[_0x4aaf49(0x167)]),y(0x1,c[_0x4aaf49(0x14e)](g))],C);var F=Object[_0x4aaf49(0x198)],L=Object['getOwnPropertyDescriptor'],Z=(_0x51c903,_0x2d77da,_0x31ed97)=>_0x2d77da in _0x51c903?F(_0x51c903,_0x2d77da,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x31ed97}):_0x51c903[_0x2d77da]=_0x31ed97,W=(_0x2fd3b4,_0x29998e,_0x3521df,_0x3597fb)=>{const _0x19be2e=_0x4aaf49;for(var _0x500fdb=_0x3597fb>0x1?void 0x0:_0x3597fb?L(_0x29998e,_0x3521df):_0x29998e,_0x4d112b=_0x2fd3b4[_0x19be2e(0x157)]-0x1,_0x1637a3;_0x4d112b>=0x0;_0x4d112b--)(_0x1637a3=_0x2fd3b4[_0x4d112b])&&(_0x500fdb=_0x1637a3(_0x500fdb)||_0x500fdb);return _0x500fdb;},O=(_0x674ea8,_0x30329e)=>(_0x3c24f8,_0x3fd889)=>_0x30329e(_0x3c24f8,_0x3fd889,_0x674ea8),N=(_0x56ccd9,_0xf1f4d0,_0x22c14e)=>Z(_0x56ccd9,typeof _0xf1f4d0!=_0x4aaf49(0x179)?_0xf1f4d0+'':_0xf1f4d0,_0x22c14e);exports[_0x4aaf49(0x1ab)]=class extends c[_0x4aaf49(0x161)]{constructor(_0x390953=D,_0x3d7390,_0x24c621){const _0x35b9b9=_0x4aaf49;super(),this['_config']=_0x390953,this[_0x35b9b9(0x170)]=_0x3d7390,this[_0x35b9b9(0x160)]=_0x24c621;const {..._0x4723f6}=c['merge']({},D,this['_config']);this[_0x35b9b9(0x160)][_0x35b9b9(0x18c)](q,_0x4723f6);}[_0x4aaf49(0x171)](){const _0x47d8e4=_0x4aaf49;[[g],[C],[p]][_0x47d8e4(0x182)](_0x2f0c5d=>{const _0x1ade0c=_0x47d8e4;this[_0x1ade0c(0x170)][_0x1ade0c(0x19e)](_0x2f0c5d);});}[_0x4aaf49(0x1a1)](){const _0x4497d2=_0x4aaf49;this['_injector'][_0x4497d2(0x16c)](C),this['_injector'][_0x4497d2(0x16c)](p);}},N(exports[_0x4aaf49(0x1ab)],'pluginName',U),N(exports[_0x4aaf49(0x1ab)],'type',c[_0x4aaf49(0x150)]['UNIVER_UNKNOWN']),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x4aaf49(0x1a9)](j[_0x4aaf49(0x164)],b['UniverCollaborationClientPlugin'],T['UniverLicensePlugin']),O(0x1,c['Inject'](c[_0x4aaf49(0x172)])),O(0x2,c[_0x4aaf49(0x159)])],exports[_0x4aaf49(0x1ab)]);
|
|
1
|
+
'use strict';const _0x392f24=_0x4a1c;(function(_0x58b51f,_0x2d43fb){const _0x41000f=_0x4a1c,_0x10a378=_0x58b51f();while(!![]){try{const _0x2d3933=-parseInt(_0x41000f(0x1bc))/0x1*(-parseInt(_0x41000f(0x1f2))/0x2)+parseInt(_0x41000f(0x19d))/0x3+-parseInt(_0x41000f(0x1b1))/0x4*(parseInt(_0x41000f(0x1af))/0x5)+parseInt(_0x41000f(0x1ab))/0x6*(-parseInt(_0x41000f(0x1c1))/0x7)+-parseInt(_0x41000f(0x1c0))/0x8+parseInt(_0x41000f(0x1c9))/0x9+parseInt(_0x41000f(0x1aa))/0xa*(parseInt(_0x41000f(0x1d1))/0xb);if(_0x2d3933===_0x2d43fb)break;else _0x10a378['push'](_0x10a378['shift']());}catch(_0x5a34f8){_0x10a378['push'](_0x10a378['shift']());}}}(_0xddbd,0xd39d3));function _0xddbd(){const _0x3d6a04=['users','userId','getUnit','ref','unitId','UniverThreadCommentDataSourcePlugin','root','requireSession','1sYnNfe','Module','code','merge','1492896QdqyrA','200011yyUNgH','onReady','replies','@univerjs/network','UNRECOGNIZED','/universer-api/user/list','UNIVER_UNKNOWN','UniverCollaborationClientPlugin','1668033phLXFx','add','/delete','rangeId','getUser','pluginName','error','createTimestamp','41294umPatZ','Disposable','IThreadCommentDataSourceService','content','/solved','OpenOrReOpen','_httpService','type','threadId','/list','_commentService','map','defineProperty','format','Solved','@univerjs-pro/license','_injector','Solve','post','getOwnPropertyDescriptor','onStarting','payload','thread-comment-data-source.config','syncUpdateMutationToColla','/reply','_threadCommentModel','Injector','UniverInstanceType','saveCommentToSnapshot','UniverLicensePlugin','ThreadCommentModel','setConfig','filter','120384fEuFap','getComment','rangeType','_threadCommentDataSourceService','getCurrentUser','_initDataSource','_config','find','_init','user','comment','pipe','userID','Add','getMemberID','COMMENT','UserManagerService','length','customRanges','/universer-api/comment/unit/','replyId','reply','updateComment','disposeWithMe','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','CommentService','listComments','body','resolved','addUser','Delete','toStringTag','solved','_sessionService','_userService','Plugin','forEach','resolveComment','subscribe','_threadCommentDataSource','UniverThreadCommentUIPlugin','460956elHbzo','stringify','commentUpdate$','deleteComment','Edit','parse','Unknown','@univerjs/thread-comment-ui','Inject','YYYY/MM/DD\x20HH:mm','/edit','_initUserSync','dayjs','4710DuwdrO','102feomjl','symbol','get','@univerjs-pro/collaboration-client','15Zefapg','personId','837588aPqhWF','addComment','Reply'];_0xddbd=function(){return _0x3d6a04;};return _0xddbd();}Object[_0x392f24(0x1dd)](exports,Symbol[_0x392f24(0x193)],{'value':_0x392f24(0x1bd)});const b=require(_0x392f24(0x1ae)),T=require(_0x392f24(0x1e0)),c=require('@univerjs/core'),j=require(_0x392f24(0x1a4)),M=require('@univerjs/thread-comment'),w=require('rxjs'),P=require(_0x392f24(0x1c4)),U=_0x392f24(0x18c);var I=(_0x2da485=>(_0x2da485[_0x2da485[_0x392f24(0x1d6)]=0x0]='OpenOrReOpen',_0x2da485[_0x2da485[_0x392f24(0x1df)]=0x1]=_0x392f24(0x1df),_0x2da485[_0x2da485['UNRECOGNIZED']=-0x1]=_0x392f24(0x1c5),_0x2da485))(I||{}),v=(_0x146282=>(_0x146282[_0x146282['Unknown']=0x0]=_0x392f24(0x1a3),_0x146282[_0x146282[_0x392f24(0x181)]=0x1]=_0x392f24(0x181),_0x146282[_0x146282[_0x392f24(0x1b3)]=0x2]=_0x392f24(0x1b3),_0x146282[_0x146282[_0x392f24(0x1a1)]=0x3]='Edit',_0x146282[_0x146282[_0x392f24(0x192)]=0x4]=_0x392f24(0x192),_0x146282[_0x146282['Solve']=0x5]=_0x392f24(0x1e2),_0x146282[_0x146282['UNRECOGNIZED']=-0x1]=_0x392f24(0x1c5),_0x146282))(v||{});const f=_0x4e12cc=>c[_0x392f24(0x1a9)](new Date(+_0x4e12cc))[_0x392f24(0x1de)]('YYYY/MM/DD\x20HH:mm'),R=async(_0x5183d7,_0x3cd64b)=>{const _0x4835a6=_0x392f24,_0xe6f981=_0x5183d7['get'](c[_0x4835a6(0x184)]),_0x346fbb=_0x5183d7[_0x4835a6(0x1ad)](P['HTTPService']);_0x3cd64b[_0x4835a6(0x198)](_0xcf71a7=>{const _0xa69307=_0x4835a6;_0xe6f981[_0xa69307(0x1cd)](_0xcf71a7)&&_0x3cd64b['delete'](_0xcf71a7);}),_0x3cd64b['size']&&(await _0x346fbb[_0x4835a6(0x1ad)](_0x4835a6(0x1c6),{'params':{'userIDs':[..._0x3cd64b]}}))['body'][_0x4835a6(0x1b4)][_0x4835a6(0x198)](_0x290596=>{const _0x302b24=_0x4835a6;_0x290596&&_0xe6f981[_0x302b24(0x191)](_0x290596);});};var $=Object[_0x392f24(0x1e4)],E=(_0x2c64b3,_0x3479b9,_0x47a0ff,_0x1b65b7)=>{const _0x580d52=_0x392f24;for(var _0x1e59a7=_0x1b65b7>0x1?void 0x0:_0x1b65b7?$(_0x3479b9,_0x47a0ff):_0x3479b9,_0x3be1be=_0x2c64b3[_0x580d52(0x185)]-0x1,_0x450f84;_0x3be1be>=0x0;_0x3be1be--)(_0x450f84=_0x2c64b3[_0x3be1be])&&(_0x1e59a7=_0x450f84(_0x1e59a7)||_0x1e59a7);return _0x1e59a7;},S=(_0x5db431,_0x1ee519)=>(_0x4d34fe,_0x1d3803)=>_0x1ee519(_0x4d34fe,_0x1d3803,_0x5db431);let p=class extends c['Disposable']{constructor(_0x373dc2,_0x750d10,_0x55ff25,_0x1ad3cc){const _0x26a86f=_0x392f24;super(),this[_0x26a86f(0x1db)]=_0x373dc2,this['_threadCommentModel']=_0x750d10,this['_userService']=_0x55ff25,this[_0x26a86f(0x1e1)]=_0x1ad3cc,this[_0x26a86f(0x1fa)](),this[_0x26a86f(0x1a8)]();}[_0x392f24(0x1a8)](){const _0x1777a2=_0x392f24;this[_0x1777a2(0x18b)](this[_0x1777a2(0x1ea)][_0x1777a2(0x19f)][_0x1777a2(0x17f)](w['bufferTime'](0x10))[_0x1777a2(0x19a)](_0x18b1b5=>{const _0xc0bb88=_0x1777a2,_0x5d097a=new Set();_0x18b1b5['forEach'](_0x15fc55=>{const _0x24a0ee=_0x4a1c;switch(_0x15fc55[_0x24a0ee(0x1d8)]){case _0x24a0ee(0x1ca):{const _0x2dafb7=_0x15fc55[_0x24a0ee(0x1e6)][_0x24a0ee(0x1b0)];_0x5d097a['add'](_0x2dafb7);break;}}}),R(this[_0xc0bb88(0x1e1)],_0x5d097a);}));}[_0x392f24(0x1fa)](){const _0x46fc50=_0x392f24;this[_0x46fc50(0x18b)](this[_0x46fc50(0x1db)][_0x46fc50(0x19f)][_0x46fc50(0x19a)](async _0x595a8d=>{const _0x3e0779=_0x46fc50;var _0x3ab29e,_0x402321,_0x802c41,_0x39d81b;const _0xf615e4=(_0x3ab29e=this['_threadCommentModel']['getUnit'](_0x595a8d[_0x3e0779(0x1b8)])['find'](_0x5036a2=>_0x5036a2['threadId']===_0x595a8d[_0x3e0779(0x1d9)]))==null?void 0x0:_0x3ab29e[_0x3e0779(0x1ba)];if(!_0xf615e4)return;const {unitId:_0x5019ea,subUnitId:_0x5c2896}=_0xf615e4;switch(_0x595a8d['user']&&this[_0x3e0779(0x196)][_0x3e0779(0x191)](_0x595a8d[_0x3e0779(0x1fb)]),_0x595a8d[_0x3e0779(0x1d8)]){case v[_0x3e0779(0x181)]:break;case v[_0x3e0779(0x1b3)]:{this[_0x3e0779(0x1ea)][_0x3e0779(0x1b2)](_0x5019ea,_0x5c2896,{'unitId':_0x5019ea,'subUnitId':_0x5c2896,'ref':'','id':_0x595a8d[_0x3e0779(0x188)],'dT':f(+_0x595a8d[_0x3e0779(0x1d0)]),'threadId':_0x595a8d[_0x3e0779(0x1d9)],'personId':(_0x802c41=(_0x402321=_0x595a8d['user'])==null?void 0x0:_0x402321[_0x3e0779(0x180)])!=null?_0x802c41:_0x595a8d[_0x3e0779(0x1b5)],'text':JSON[_0x3e0779(0x1a2)](_0x595a8d['content']),'parentId':_0xf615e4['id']});break;}case v['Delete']:{const _0x160257=this[_0x3e0779(0x1ea)][_0x3e0779(0x1f3)](_0x5019ea,_0x5c2896,_0x595a8d['replyId']);_0x160257&&_0x160257['parentId']&&this[_0x3e0779(0x1ea)]['deleteComment'](_0x5019ea,_0x5c2896,_0x595a8d[_0x3e0779(0x188)]);break;}case v['Edit']:{this[_0x3e0779(0x1ea)][_0x3e0779(0x18a)](_0x5019ea,_0x5c2896,{'commentId':_0x595a8d[_0x3e0779(0x188)],'text':JSON[_0x3e0779(0x1a2)](_0x595a8d[_0x3e0779(0x1d4)])});break;}case v[_0x3e0779(0x1e2)]:{const _0x1576af=(_0x39d81b=this['_threadCommentModel'][_0x3e0779(0x1b6)](_0x595a8d[_0x3e0779(0x1b8)])[_0x3e0779(0x1f9)](_0x53dfcc=>_0x53dfcc['threadId']===_0x595a8d[_0x3e0779(0x1d9)]))==null?void 0x0:_0x39d81b[_0x3e0779(0x1ba)];_0x1576af&&this[_0x3e0779(0x1ea)]['resolveComment'](_0x5019ea,_0x5c2896,_0x1576af['id'],_0x595a8d['solved']===I[_0x3e0779(0x1df)]);break;}}}));}};function _0x4a1c(_0x5054ca,_0xcc1deb){const _0xddbd70=_0xddbd();return _0x4a1c=function(_0x4a1c58,_0x4f9200){_0x4a1c58=_0x4a1c58-0x17f;let _0x55863b=_0xddbd70[_0x4a1c58];return _0x55863b;},_0x4a1c(_0x5054ca,_0xcc1deb);}p=E([S(0x0,c[_0x392f24(0x1a5)](b[_0x392f24(0x18d)])),S(0x1,c[_0x392f24(0x1a5)](M[_0x392f24(0x1ef)])),S(0x2,c['Inject'](c[_0x392f24(0x184)])),S(0x3,c[_0x392f24(0x1a5)](c[_0x392f24(0x1eb)]))],p);const q=_0x392f24(0x1e7),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x4df98a,_0x17c693,_0x5c5045,_0x526305)=>{const _0x3c92a1=_0x392f24;for(var _0x1856c3=_0x526305>0x1?void 0x0:_0x526305?A(_0x17c693,_0x5c5045):_0x17c693,_0x5ee4da=_0x4df98a[_0x3c92a1(0x185)]-0x1,_0x42f0ad;_0x5ee4da>=0x0;_0x5ee4da--)(_0x42f0ad=_0x4df98a[_0x5ee4da])&&(_0x1856c3=_0x42f0ad(_0x1856c3)||_0x1856c3);return _0x1856c3;},_=(_0x3541df,_0x4f4cf6)=>(_0x1cd631,_0x889ca7)=>_0x4f4cf6(_0x1cd631,_0x889ca7,_0x3541df);function Y(_0x2c9145,_0x145fa6){const _0x27b23b=_0x392f24,_0x2279d8=_0x2c9145[_0x27b23b(0x1c3)][0x0];return{..._0x145fa6,'id':_0x2279d8['replyId'],'resolved':_0x2c9145[_0x27b23b(0x194)]===0x1,'dT':f(_0x2279d8['createTimestamp']),'personId':_0x2279d8['userId'],'threadId':_0x2279d8[_0x27b23b(0x1d9)]};}function G(_0x3f4b68,_0x1c5b6c,_0x479354){const _0x51a556=_0x392f24;var _0x49cbe7,_0x26a449;if(((_0x26a449=(_0x49cbe7=_0x3f4b68==null?void 0x0:_0x3f4b68['replies'])==null?void 0x0:_0x49cbe7[_0x51a556(0x185)])!=null?_0x26a449:0x0)>0x0){const _0x404a72=(_0x3a78f9,_0x33f89a)=>({'id':_0x3a78f9[_0x51a556(0x188)],'threadId':_0x3a78f9[_0x51a556(0x1d9)],'dT':f(_0x3a78f9[_0x51a556(0x1d0)]),'personId':_0x3a78f9[_0x51a556(0x1b5)],'resolved':_0x3f4b68[_0x51a556(0x194)]===I[_0x51a556(0x1df)],'unitId':_0x1c5b6c,'subUnitId':_0x479354,'text':JSON[_0x51a556(0x1a2)](_0x3a78f9[_0x51a556(0x1d4)]),'parentId':_0x33f89a}),_0x3c96d1=_0x404a72(_0x3f4b68[_0x51a556(0x1c3)][0x0]);return{..._0x3c96d1,'children':_0x3f4b68[_0x51a556(0x1c3)]['slice'](0x1)[_0x51a556(0x1dc)](_0x3d899e=>_0x404a72(_0x3d899e,_0x3c96d1['id']))};}return null;}let g=class{constructor(_0x2fab19,_0x3e0143,_0x563bd4,_0x132222){const _0x1b3961=_0x392f24;this[_0x1b3961(0x1d7)]=_0x2fab19,this[_0x1b3961(0x196)]=_0x3e0143,this[_0x1b3961(0x195)]=_0x563bd4,this[_0x1b3961(0x1e1)]=_0x132222;}async[_0x392f24(0x1b2)](_0x11513e){const _0x4536d8=_0x392f24;var _0x2ebb0c,_0x3376df;const {parentId:_0x5cd647,unitId:_0x497fc0,text:_0x29cb5c,threadId:_0x4d532a}=_0x11513e,_0x20adb1=(_0x3376df=(_0x2ebb0c=_0x29cb5c['customRanges'])==null?void 0x0:_0x2ebb0c[_0x4536d8(0x1f1)](_0x56e749=>_0x56e749['rangeType']===c['CustomRangeType'][_0x4536d8(0x183)])[_0x4536d8(0x1dc)](_0x1b9e65=>_0x1b9e65[_0x4536d8(0x1cc)]))!=null?_0x3376df:[],_0x5bc1dc=JSON[_0x4536d8(0x19e)](_0x29cb5c),_0x405b8d=(await this[_0x4536d8(0x195)]['requireSession'](_0x497fc0))[_0x4536d8(0x182)]();if(_0x5cd647){const _0x92f785={'memberId':_0x405b8d,'unitId':_0x497fc0,'content':_0x5bc1dc,'mention':_0x20adb1,'threadId':_0x4d532a},_0x254646=(await this['_httpService'][_0x4536d8(0x1e3)](_0x4536d8(0x187)+_0x497fc0+_0x4536d8(0x1e9),{'body':_0x92f785}))[_0x4536d8(0x18f)][_0x4536d8(0x189)];return{..._0x11513e,'id':_0x254646['replyId'],'dT':c[_0x4536d8(0x1a9)](+_0x254646[_0x4536d8(0x1d0)])['format'](_0x4536d8(0x1a6)),'personId':_0x254646[_0x4536d8(0x1b5)]};}else{const _0x50b17a={'memberId':_0x405b8d,'unitId':_0x497fc0,'content':_0x5bc1dc,'mention':_0x20adb1},_0x1337da=await this['_httpService'][_0x4536d8(0x1e3)](_0x4536d8(0x187)+_0x497fc0+'/add',{'body':_0x50b17a});return Y(_0x1337da[_0x4536d8(0x18f)][_0x4536d8(0x1fc)],_0x11513e);}}async[_0x392f24(0x18a)](_0x58cb08){const _0x467d21=_0x392f24;var _0x12f2c1,_0xb2caca;const {text:_0x1a63d7,unitId:_0x3af5d9}=_0x58cb08,_0x4d8b83=(_0xb2caca=(_0x12f2c1=_0x1a63d7[_0x467d21(0x186)])==null?void 0x0:_0x12f2c1[_0x467d21(0x1f1)](_0x1320c6=>_0x1320c6[_0x467d21(0x1f4)]===c['CustomRangeType'][_0x467d21(0x183)])[_0x467d21(0x1dc)](_0x2bfdbf=>_0x2bfdbf['rangeId']))!=null?_0xb2caca:[],_0x3dcdce=JSON['stringify'](_0x1a63d7),_0x3ee114=_0x58cb08[_0x467d21(0x1d9)],_0xf3686d=_0x58cb08['id'],_0x46787c={'memberId':(await this[_0x467d21(0x195)]['requireSession'](_0x3af5d9))[_0x467d21(0x182)](),'unitId':_0x3af5d9,'threadId':_0x3ee114,'mention':_0x4d8b83,'content':_0x3dcdce,'replyId':_0xf3686d},_0xf05379=await this[_0x467d21(0x1d7)][_0x467d21(0x1e3)](_0x467d21(0x187)+_0x3af5d9+_0x467d21(0x1a7),{'body':_0x46787c});return!_0xf05379[_0x467d21(0x18f)][_0x467d21(0x1cf)]||_0xf05379['body'][_0x467d21(0x1cf)]['code']===0x1;}async[_0x392f24(0x199)](_0x5d7ecf){const _0x35297c=_0x392f24,{unitId:_0x1ba7de}=_0x5d7ecf,_0x3cb8a6=_0x5d7ecf[_0x35297c(0x1d9)],_0x2464ed={'memberId':this['_userService'][_0x35297c(0x1f6)]()[_0x35297c(0x180)],'unitId':_0x1ba7de,'threadId':_0x3cb8a6,'solved':_0x5d7ecf[_0x35297c(0x190)]?I['Solved']:I[_0x35297c(0x1d6)]},_0x365b02=await this[_0x35297c(0x1d7)][_0x35297c(0x1e3)](_0x35297c(0x187)+_0x1ba7de+_0x35297c(0x1d5),{'body':_0x2464ed});return!_0x365b02[_0x35297c(0x18f)][_0x35297c(0x1cf)]||_0x365b02[_0x35297c(0x18f)][_0x35297c(0x1cf)][_0x35297c(0x1be)]===0x1;}async[_0x392f24(0x1a0)](_0x76df1e,_0x4ac0ec,_0x561530,_0x196194){const _0x5ce17b=_0x392f24,_0x44ce87={'memberId':(await this[_0x5ce17b(0x195)][_0x5ce17b(0x1bb)](_0x76df1e))[_0x5ce17b(0x182)](),'threadId':_0x561530,'replyId':_0x196194,'unitId':_0x76df1e},_0x1cc899=await this[_0x5ce17b(0x1d7)][_0x5ce17b(0x1e3)](_0x5ce17b(0x187)+_0x76df1e+_0x5ce17b(0x1cb),{'body':_0x44ce87});return!_0x1cc899[_0x5ce17b(0x18f)][_0x5ce17b(0x1cf)]||_0x1cc899[_0x5ce17b(0x18f)][_0x5ce17b(0x1cf)][_0x5ce17b(0x1be)]===0x1;}async[_0x392f24(0x18e)](_0x351731,_0x5bd5d3,_0x2f5f05){const _0x164a50=_0x392f24,_0x3a417c={'unitId':_0x351731,'threadId':_0x2f5f05},_0x5d898c=await this[_0x164a50(0x1d7)][_0x164a50(0x1e3)](_0x164a50(0x187)+_0x351731+_0x164a50(0x1da),{'body':_0x3a417c}),_0x3300d4=_0x2f5f05[_0x164a50(0x1dc)](_0x58d03a=>G(_0x5d898c[_0x164a50(0x18f)]['comments'][_0x58d03a],_0x351731,_0x5bd5d3))[_0x164a50(0x1f1)](Boolean);return Object['values'](_0x5d898c[_0x164a50(0x18f)][_0x164a50(0x1b4)])[_0x164a50(0x198)](_0x411802=>{const _0x23bb0b=_0x164a50;this[_0x23bb0b(0x196)][_0x23bb0b(0x191)](_0x411802);}),_0x3300d4;}[_0x392f24(0x1ed)](_0x24a38d){const _0x57b4b0=_0x392f24;return{'id':_0x24a38d['id'],'threadId':_0x24a38d[_0x57b4b0(0x1d9)],'ref':_0x24a38d[_0x57b4b0(0x1b7)]};}};g=x([_(0x0,c['Inject'](P['HTTPService'])),_(0x1,c[_0x392f24(0x1a5)](c['UserManagerService'])),_(0x2,c[_0x392f24(0x1a5)](b['CollaborationSessionService'])),_(0x3,c[_0x392f24(0x1a5)](c['Injector']))],g);var H=Object['getOwnPropertyDescriptor'],J=(_0x30018f,_0x3249b6,_0x583fe2,_0x31473a)=>{const _0x4d15ba=_0x392f24;for(var _0x3eb0f9=_0x31473a>0x1?void 0x0:_0x31473a?H(_0x3249b6,_0x583fe2):_0x3249b6,_0x468aaf=_0x30018f[_0x4d15ba(0x185)]-0x1,_0x28b93d;_0x468aaf>=0x0;_0x468aaf--)(_0x28b93d=_0x30018f[_0x468aaf])&&(_0x3eb0f9=_0x28b93d(_0x3eb0f9)||_0x3eb0f9);return _0x3eb0f9;},y=(_0xa08322,_0x4d8cb7)=>(_0x1accc0,_0x11f284)=>_0x4d8cb7(_0x1accc0,_0x11f284,_0xa08322);let C=class extends c[_0x392f24(0x1d2)]{constructor(_0x1258ce,_0x2da5b8){const _0x45936c=_0x392f24;super(),this[_0x45936c(0x1f5)]=_0x1258ce,this['_threadCommentDataSource']=_0x2da5b8,this[_0x45936c(0x1f7)]();}[_0x392f24(0x1f7)](){const _0x1012b9=_0x392f24;this[_0x1012b9(0x1f5)]['dataSource']=this[_0x1012b9(0x19b)],this[_0x1012b9(0x1f5)][_0x1012b9(0x1e8)]=!0x1;}};C=J([y(0x0,M[_0x392f24(0x1d3)]),y(0x1,c[_0x392f24(0x1a5)](g))],C);var F=Object['defineProperty'],L=Object[_0x392f24(0x1e4)],Z=(_0x487dc2,_0x3da979,_0x172e84)=>_0x3da979 in _0x487dc2?F(_0x487dc2,_0x3da979,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x172e84}):_0x487dc2[_0x3da979]=_0x172e84,W=(_0x1644db,_0x2da080,_0x293e45,_0x3d52cc)=>{for(var _0x1ae039=_0x3d52cc>0x1?void 0x0:_0x3d52cc?L(_0x2da080,_0x293e45):_0x2da080,_0x1ef531=_0x1644db['length']-0x1,_0x22d3ab;_0x1ef531>=0x0;_0x1ef531--)(_0x22d3ab=_0x1644db[_0x1ef531])&&(_0x1ae039=_0x22d3ab(_0x1ae039)||_0x1ae039);return _0x1ae039;},O=(_0x2752a7,_0x5ded3f)=>(_0x1221d5,_0x198e78)=>_0x5ded3f(_0x1221d5,_0x198e78,_0x2752a7),N=(_0x36a289,_0x3f7352,_0x2eb427)=>Z(_0x36a289,typeof _0x3f7352!=_0x392f24(0x1ac)?_0x3f7352+'':_0x3f7352,_0x2eb427);exports[_0x392f24(0x1b9)]=class extends c[_0x392f24(0x197)]{constructor(_0x1931e9=D,_0x276ed1,_0x1ccd51){const _0x27b7b4=_0x392f24;super(),this[_0x27b7b4(0x1f8)]=_0x1931e9,this[_0x27b7b4(0x1e1)]=_0x276ed1,this['_configService']=_0x1ccd51;const {..._0x5f17b5}=c[_0x27b7b4(0x1bf)]({},D,this['_config']);this['_configService'][_0x27b7b4(0x1f0)](q,_0x5f17b5);}[_0x392f24(0x1e5)](){[[g],[C],[p]]['forEach'](_0x429814=>{const _0x3ae465=_0x4a1c;this[_0x3ae465(0x1e1)]['add'](_0x429814);});}[_0x392f24(0x1c2)](){const _0x2d9c89=_0x392f24;this[_0x2d9c89(0x1e1)][_0x2d9c89(0x1ad)](C),this[_0x2d9c89(0x1e1)][_0x2d9c89(0x1ad)](p);}},N(exports[_0x392f24(0x1b9)],_0x392f24(0x1ce),U),N(exports[_0x392f24(0x1b9)],_0x392f24(0x1d8),c[_0x392f24(0x1ec)][_0x392f24(0x1c7)]),exports[_0x392f24(0x1b9)]=W([c['DependentOn'](j[_0x392f24(0x19c)],b[_0x392f24(0x1c8)],T[_0x392f24(0x1ee)]),O(0x1,c['Inject'](c[_0x392f24(0x1eb)])),O(0x2,c['IConfigService'])],exports[_0x392f24(0x1b9)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x10dd51=_0x11cb;(function(_0x5593fd,_0x39ba53){const _0x38ce01=_0x11cb,_0x6c3ab1=_0x5593fd();while(!![]){try{const _0x25e2d0=-parseInt(_0x38ce01(0x1b2))/0x1+-parseInt(_0x38ce01(0x1d5))/0x2+-parseInt(_0x38ce01(0x1e2))/0x3+-parseInt(_0x38ce01(0x1d7))/0x4*(parseInt(_0x38ce01(0x1ce))/0x5)+parseInt(_0x38ce01(0x1cd))/0x6*(-parseInt(_0x38ce01(0x1c0))/0x7)+-parseInt(_0x38ce01(0x1dd))/0x8+-parseInt(_0x38ce01(0x1d9))/0x9*(-parseInt(_0x38ce01(0x1b7))/0xa);if(_0x25e2d0===_0x39ba53)break;else _0x6c3ab1['push'](_0x6c3ab1['shift']());}catch(_0x549fea){_0x6c3ab1['push'](_0x6c3ab1['shift']());}}}(_0x19f0,0x6e085));import{CommentService as _0x480a02,CollaborationSessionService as _0xa13fb7,UniverCollaborationClientPlugin as _0x349d8d}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x46f06c}from'@univerjs-pro/license';import{dayjs as _0x13b06d,UserManagerService as _0x4945be,Inject as _0x2f4fe1,Injector as _0x36f8f1,Disposable as _0x42963d,CustomRangeType as _0x5b13ae,UniverInstanceType as _0x472341,DependentOn as _0x1c23a3,IConfigService as _0x18ac02,Plugin as _0x424e35,merge as _0x3c064f}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x589ee4}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x33888f,IThreadCommentDataSourceService as _0x2d29f0}from'@univerjs/thread-comment';import{bufferTime as _0x2e1f0d}from'rxjs';import{HTTPService as _0x181eb7}from'@univerjs/network';function _0x11cb(_0x2f1284,_0x4f4a0f){const _0x19f012=_0x19f0();return _0x11cb=function(_0x11cba1,_0x188804){_0x11cba1=_0x11cba1-0x1a0;let _0xa95549=_0x19f012[_0x11cba1];return _0xa95549;},_0x11cb(_0x2f1284,_0x4f4a0f);}const W=_0x10dd51(0x1b3);var I=(_0x26f9dd=>(_0x26f9dd[_0x26f9dd[_0x10dd51(0x1a6)]=0x0]=_0x10dd51(0x1a6),_0x26f9dd[_0x26f9dd[_0x10dd51(0x1ac)]=0x1]=_0x10dd51(0x1ac),_0x26f9dd[_0x26f9dd['UNRECOGNIZED']=-0x1]=_0x10dd51(0x1bb),_0x26f9dd))(I||{}),v=(_0x47478a=>(_0x47478a[_0x47478a['Unknown']=0x0]='Unknown',_0x47478a[_0x47478a[_0x10dd51(0x1ae)]=0x1]='Add',_0x47478a[_0x47478a['Reply']=0x2]='Reply',_0x47478a[_0x47478a['Edit']=0x3]=_0x10dd51(0x1c4),_0x47478a[_0x47478a[_0x10dd51(0x1cc)]=0x4]='Delete',_0x47478a[_0x47478a[_0x10dd51(0x1e4)]=0x5]=_0x10dd51(0x1e4),_0x47478a[_0x47478a[_0x10dd51(0x1bb)]=-0x1]=_0x10dd51(0x1bb),_0x47478a))(v||{});const D=_0x47a61f=>_0x13b06d(new Date(+_0x47a61f))[_0x10dd51(0x1ec)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x2c7438,_0x476874)=>{const _0x39beeb=_0x10dd51,_0x2ec2d8=_0x2c7438[_0x39beeb(0x1dc)](_0x4945be),_0x5e8f3c=_0x2c7438[_0x39beeb(0x1dc)](_0x181eb7);_0x476874['forEach'](_0x33f877=>{const _0xac41ea=_0x39beeb;_0x2ec2d8[_0xac41ea(0x1f3)](_0x33f877)&&_0x476874[_0xac41ea(0x1f2)](_0x33f877);}),_0x476874[_0x39beeb(0x1db)]&&(await _0x5e8f3c[_0x39beeb(0x1dc)](_0x39beeb(0x1b4),{'params':{'userIDs':[..._0x476874]}}))[_0x39beeb(0x1f0)][_0x39beeb(0x1cf)][_0x39beeb(0x1ab)](_0x2988d6=>{const _0x1690dd=_0x39beeb;_0x2988d6&&_0x2ec2d8[_0x1690dd(0x1bd)](_0x2988d6);});};var K=Object[_0x10dd51(0x1a0)],V=(_0x3b975c,_0x3bcd25,_0x293c56,_0x37d013)=>{for(var _0x3ed374=_0x37d013>0x1?void 0x0:_0x37d013?K(_0x3bcd25,_0x293c56):_0x3bcd25,_0x56e7e0=_0x3b975c['length']-0x1,_0x3dbc0f;_0x56e7e0>=0x0;_0x56e7e0--)(_0x3dbc0f=_0x3b975c[_0x56e7e0])&&(_0x3ed374=_0x3dbc0f(_0x3ed374)||_0x3ed374);return _0x3ed374;},p=(_0x416c56,_0x5e3432)=>(_0x1c0c8c,_0x363ac3)=>_0x5e3432(_0x1c0c8c,_0x363ac3,_0x416c56);let S=class extends _0x42963d{constructor(_0x4ce056,_0x18c6c9,_0x1f818b,_0x541540){const _0x195020=_0x10dd51;super(),this['_commentService']=_0x4ce056,this[_0x195020(0x1a2)]=_0x18c6c9,this[_0x195020(0x1ee)]=_0x1f818b,this[_0x195020(0x1cb)]=_0x541540,this[_0x195020(0x1a7)](),this[_0x195020(0x1f7)]();}[_0x10dd51(0x1f7)](){const _0x292770=_0x10dd51;this[_0x292770(0x1de)](this[_0x292770(0x1a2)]['commentUpdate$']['pipe'](_0x2e1f0d(0x10))[_0x292770(0x1e6)](_0x3dbe55=>{const _0x462a7c=_0x292770,_0x2c45a0=new Set();_0x3dbe55['forEach'](_0x16ea0b=>{const _0x557a96=_0x11cb;switch(_0x16ea0b[_0x557a96(0x1f9)]){case _0x557a96(0x1e0):{const _0x3473a8=_0x16ea0b['payload']['personId'];_0x2c45a0[_0x557a96(0x1e0)](_0x3473a8);break;}}}),B(this[_0x462a7c(0x1cb)],_0x2c45a0);}));}[_0x10dd51(0x1a7)](){const _0x1c5778=_0x10dd51;this['disposeWithMe'](this[_0x1c5778(0x1eb)][_0x1c5778(0x1b5)][_0x1c5778(0x1e6)](async _0x32de80=>{const _0x222337=_0x1c5778;var _0x351913,_0x5e3a57,_0x5046df,_0x447723;const _0xca006d=(_0x351913=this[_0x222337(0x1a2)][_0x222337(0x1f5)](_0x32de80[_0x222337(0x1a8)])[_0x222337(0x1d1)](_0x48932e=>_0x48932e[_0x222337(0x1fa)]===_0x32de80[_0x222337(0x1fa)]))==null?void 0x0:_0x351913['root'];if(!_0xca006d)return;const {unitId:_0x2e0029,subUnitId:_0x42d124}=_0xca006d;switch(_0x32de80[_0x222337(0x1c9)]&&this['_userService'][_0x222337(0x1bd)](_0x32de80[_0x222337(0x1c9)]),_0x32de80[_0x222337(0x1f9)]){case v[_0x222337(0x1ae)]:break;case v[_0x222337(0x1d4)]:{this[_0x222337(0x1a2)][_0x222337(0x1be)](_0x2e0029,_0x42d124,{'unitId':_0x2e0029,'subUnitId':_0x42d124,'ref':'','id':_0x32de80[_0x222337(0x1a5)],'dT':D(+_0x32de80[_0x222337(0x1b1)]),'threadId':_0x32de80[_0x222337(0x1fa)],'personId':(_0x5046df=(_0x5e3a57=_0x32de80[_0x222337(0x1c9)])==null?void 0x0:_0x5e3a57['userID'])!=null?_0x5046df:_0x32de80[_0x222337(0x1ea)],'text':JSON[_0x222337(0x1ff)](_0x32de80['content']),'parentId':_0xca006d['id']});break;}case v[_0x222337(0x1cc)]:{const _0x4bed65=this[_0x222337(0x1a2)][_0x222337(0x1ad)](_0x2e0029,_0x42d124,_0x32de80[_0x222337(0x1a5)]);_0x4bed65&&_0x4bed65[_0x222337(0x1f8)]&&this[_0x222337(0x1a2)][_0x222337(0x1fd)](_0x2e0029,_0x42d124,_0x32de80['replyId']);break;}case v[_0x222337(0x1c4)]:{this[_0x222337(0x1a2)][_0x222337(0x1df)](_0x2e0029,_0x42d124,{'commentId':_0x32de80[_0x222337(0x1a5)],'text':JSON[_0x222337(0x1ff)](_0x32de80[_0x222337(0x1a3)])});break;}case v[_0x222337(0x1e4)]:{const _0x3bf972=(_0x447723=this[_0x222337(0x1a2)][_0x222337(0x1f5)](_0x32de80['unitId'])[_0x222337(0x1d1)](_0xc63f0d=>_0xc63f0d[_0x222337(0x1fa)]===_0x32de80['threadId']))==null?void 0x0:_0x447723[_0x222337(0x1fb)];_0x3bf972&&this[_0x222337(0x1a2)][_0x222337(0x1c1)](_0x2e0029,_0x42d124,_0x3bf972['id'],_0x32de80['solved']===I[_0x222337(0x1ac)]);break;}}}));}};S=V([p(0x0,_0x2f4fe1(_0x480a02)),p(0x1,_0x2f4fe1(_0x33888f)),p(0x2,_0x2f4fe1(_0x4945be)),p(0x3,_0x2f4fe1(_0x36f8f1))],S);const z=_0x10dd51(0x1c8),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5107cd,_0x4540ab,_0x3dc2d2,_0x34b0d2)=>{const _0x104726=_0x10dd51;for(var _0x576fe5=_0x34b0d2>0x1?void 0x0:_0x34b0d2?k(_0x4540ab,_0x3dc2d2):_0x4540ab,_0x950792=_0x5107cd[_0x104726(0x1ba)]-0x1,_0x673bac;_0x950792>=0x0;_0x950792--)(_0x673bac=_0x5107cd[_0x950792])&&(_0x576fe5=_0x673bac(_0x576fe5)||_0x576fe5);return _0x576fe5;},_=(_0x2be1fb,_0x2c3fcc)=>(_0x29ae54,_0xef4bc)=>_0x2c3fcc(_0x29ae54,_0xef4bc,_0x2be1fb);function X(_0x5a3b0f,_0x19c30e){const _0x2cfd35=_0x10dd51,_0x39bafd=_0x5a3b0f[_0x2cfd35(0x1bc)][0x0];return{..._0x19c30e,'id':_0x39bafd[_0x2cfd35(0x1a5)],'resolved':_0x5a3b0f[_0x2cfd35(0x1a9)]===0x1,'dT':D(_0x39bafd['createTimestamp']),'personId':_0x39bafd['userId'],'threadId':_0x39bafd[_0x2cfd35(0x1fa)]};}function _0x19f0(){const _0xfb680b=['_userService','filter','body','symbol','delete','getUser','reply','getUnit','_configService','_initUserSync','parentId','type','threadId','root','ref','deleteComment','comment','parse','getOwnPropertyDescriptor','_threadCommentDataSourceService','_threadCommentModel','content','post','replyId','OpenOrReOpen','_init','unitId','solved','rangeType','forEach','Solved','getComment','Add','pluginName','_httpService','createTimestamp','38524TSZSNL','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/universer-api/user/list','commentUpdate$','COMMENT','10xvRKow','saveCommentToSnapshot','requireSession','length','UNRECOGNIZED','replies','addUser','addComment','getMemberID','7cIeESQ','resolveComment','values','getCurrentUser','Edit','onStarting','comments','setConfig','thread-comment-data-source.config','user','/add','_injector','Delete','1119918FkAfKu','3585ENSGRb','users','customRanges','find','map','/delete','Reply','1264864IWwLUa','/reply','4196LvXbnw','_config','27951543SnPJcQ','rangeId','size','get','3171544HcFjPy','disposeWithMe','updateComment','add','error','1946547RGVrHi','_threadCommentDataSource','Solve','_initDataSource','subscribe','_sessionService','defineProperty','/universer-api/comment/unit/','userId','_commentService','format','code'];_0x19f0=function(){return _0xfb680b;};return _0x19f0();}function ee(_0x21dbfb,_0x3f0b9e,_0x102120){const _0x2bc455=_0x10dd51;var _0x4b7ba9,_0x4431b5;if(((_0x4431b5=(_0x4b7ba9=_0x21dbfb==null?void 0x0:_0x21dbfb[_0x2bc455(0x1bc)])==null?void 0x0:_0x4b7ba9[_0x2bc455(0x1ba)])!=null?_0x4431b5:0x0)>0x0){const _0x4a8e0c=(_0x1c5b0a,_0x34b27d)=>({'id':_0x1c5b0a[_0x2bc455(0x1a5)],'threadId':_0x1c5b0a[_0x2bc455(0x1fa)],'dT':D(_0x1c5b0a[_0x2bc455(0x1b1)]),'personId':_0x1c5b0a[_0x2bc455(0x1ea)],'resolved':_0x21dbfb[_0x2bc455(0x1a9)]===I['Solved'],'unitId':_0x3f0b9e,'subUnitId':_0x102120,'text':JSON[_0x2bc455(0x1ff)](_0x1c5b0a[_0x2bc455(0x1a3)]),'parentId':_0x34b27d}),_0x465812=_0x4a8e0c(_0x21dbfb[_0x2bc455(0x1bc)][0x0]);return{..._0x465812,'children':_0x21dbfb[_0x2bc455(0x1bc)]['slice'](0x1)['map'](_0x40a8d5=>_0x4a8e0c(_0x40a8d5,_0x465812['id']))};}return null;}let f=class{constructor(_0x34854e,_0x4f12e8,_0x212f20,_0x307da2){const _0x3f16fd=_0x10dd51;this[_0x3f16fd(0x1b0)]=_0x34854e,this[_0x3f16fd(0x1ee)]=_0x4f12e8,this[_0x3f16fd(0x1e7)]=_0x212f20,this[_0x3f16fd(0x1cb)]=_0x307da2;}async[_0x10dd51(0x1be)](_0x1b730b){const _0x5ac165=_0x10dd51;var _0x1ad724,_0x474259;const {parentId:_0xd17921,unitId:_0x4e0ab2,text:_0x430c78,threadId:_0x879d1f}=_0x1b730b,_0x237901=(_0x474259=(_0x1ad724=_0x430c78['customRanges'])==null?void 0x0:_0x1ad724[_0x5ac165(0x1ef)](_0x188c49=>_0x188c49[_0x5ac165(0x1aa)]===_0x5b13ae['COMMENT'])[_0x5ac165(0x1d2)](_0x48dd16=>_0x48dd16[_0x5ac165(0x1da)]))!=null?_0x474259:[],_0x10521c=JSON['stringify'](_0x430c78),_0x59c8c1=(await this[_0x5ac165(0x1e7)][_0x5ac165(0x1b9)](_0x4e0ab2))[_0x5ac165(0x1bf)]();if(_0xd17921){const _0x36f6fd={'memberId':_0x59c8c1,'unitId':_0x4e0ab2,'content':_0x10521c,'mention':_0x237901,'threadId':_0x879d1f},_0x194a8b=(await this[_0x5ac165(0x1b0)][_0x5ac165(0x1a4)](_0x5ac165(0x1e9)+_0x4e0ab2+_0x5ac165(0x1d6),{'body':_0x36f6fd}))[_0x5ac165(0x1f0)][_0x5ac165(0x1f4)];return{..._0x1b730b,'id':_0x194a8b[_0x5ac165(0x1a5)],'dT':_0x13b06d(+_0x194a8b[_0x5ac165(0x1b1)])[_0x5ac165(0x1ec)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x194a8b[_0x5ac165(0x1ea)]};}else{const _0x100bd8={'memberId':_0x59c8c1,'unitId':_0x4e0ab2,'content':_0x10521c,'mention':_0x237901},_0x3a3d93=await this[_0x5ac165(0x1b0)][_0x5ac165(0x1a4)]('/universer-api/comment/unit/'+_0x4e0ab2+_0x5ac165(0x1ca),{'body':_0x100bd8});return X(_0x3a3d93[_0x5ac165(0x1f0)][_0x5ac165(0x1fe)],_0x1b730b);}}async[_0x10dd51(0x1df)](_0x5d22ad){const _0x5925fa=_0x10dd51;var _0x5dcf4a,_0x42696d;const {text:_0x36b18c,unitId:_0xa798c5}=_0x5d22ad,_0xe68161=(_0x42696d=(_0x5dcf4a=_0x36b18c[_0x5925fa(0x1d0)])==null?void 0x0:_0x5dcf4a[_0x5925fa(0x1ef)](_0x12bbf8=>_0x12bbf8[_0x5925fa(0x1aa)]===_0x5b13ae[_0x5925fa(0x1b6)])['map'](_0x56f75f=>_0x56f75f['rangeId']))!=null?_0x42696d:[],_0x3a0ec8=JSON['stringify'](_0x36b18c),_0x277e88=_0x5d22ad[_0x5925fa(0x1fa)],_0x5b7b17=_0x5d22ad['id'],_0x28f7df={'memberId':(await this[_0x5925fa(0x1e7)][_0x5925fa(0x1b9)](_0xa798c5))['getMemberID'](),'unitId':_0xa798c5,'threadId':_0x277e88,'mention':_0xe68161,'content':_0x3a0ec8,'replyId':_0x5b7b17},_0x1b15af=await this[_0x5925fa(0x1b0)][_0x5925fa(0x1a4)](_0x5925fa(0x1e9)+_0xa798c5+'/edit',{'body':_0x28f7df});return!_0x1b15af['body'][_0x5925fa(0x1e1)]||_0x1b15af[_0x5925fa(0x1f0)][_0x5925fa(0x1e1)][_0x5925fa(0x1ed)]===0x1;}async['resolveComment'](_0x553a18){const _0x5b20be=_0x10dd51,{unitId:_0x4a9933}=_0x553a18,_0x169aed=_0x553a18['threadId'],_0x5cf1f5={'memberId':this[_0x5b20be(0x1ee)][_0x5b20be(0x1c3)]()['userID'],'unitId':_0x4a9933,'threadId':_0x169aed,'solved':_0x553a18['resolved']?I[_0x5b20be(0x1ac)]:I['OpenOrReOpen']},_0xe6ad43=await this[_0x5b20be(0x1b0)][_0x5b20be(0x1a4)]('/universer-api/comment/unit/'+_0x4a9933+'/solved',{'body':_0x5cf1f5});return!_0xe6ad43[_0x5b20be(0x1f0)]['error']||_0xe6ad43[_0x5b20be(0x1f0)]['error'][_0x5b20be(0x1ed)]===0x1;}async[_0x10dd51(0x1fd)](_0x31f4ea,_0x2b351f,_0x423d3d,_0x5647ce){const _0x4fc712=_0x10dd51,_0x59f71b={'memberId':(await this[_0x4fc712(0x1e7)][_0x4fc712(0x1b9)](_0x31f4ea))['getMemberID'](),'threadId':_0x423d3d,'replyId':_0x5647ce,'unitId':_0x31f4ea},_0x3089c0=await this[_0x4fc712(0x1b0)]['post'](_0x4fc712(0x1e9)+_0x31f4ea+_0x4fc712(0x1d3),{'body':_0x59f71b});return!_0x3089c0['body']['error']||_0x3089c0['body'][_0x4fc712(0x1e1)][_0x4fc712(0x1ed)]===0x1;}async['listComments'](_0x16e185,_0x25a2ff,_0x26c951){const _0x56ef58=_0x10dd51,_0x1415d6={'unitId':_0x16e185,'threadId':_0x26c951},_0xdb5897=await this[_0x56ef58(0x1b0)][_0x56ef58(0x1a4)](_0x56ef58(0x1e9)+_0x16e185+'/list',{'body':_0x1415d6}),_0x14f46d=_0x26c951[_0x56ef58(0x1d2)](_0x11f78b=>ee(_0xdb5897[_0x56ef58(0x1f0)][_0x56ef58(0x1c6)][_0x11f78b],_0x16e185,_0x25a2ff))[_0x56ef58(0x1ef)](Boolean);return Object[_0x56ef58(0x1c2)](_0xdb5897['body']['users'])[_0x56ef58(0x1ab)](_0x39532c=>{const _0x347fc1=_0x56ef58;this[_0x347fc1(0x1ee)]['addUser'](_0x39532c);}),_0x14f46d;}[_0x10dd51(0x1b8)](_0x3c7911){const _0x180999=_0x10dd51;return{'id':_0x3c7911['id'],'threadId':_0x3c7911['threadId'],'ref':_0x3c7911[_0x180999(0x1fc)]};}};f=Q([_(0x0,_0x2f4fe1(_0x181eb7)),_(0x1,_0x2f4fe1(_0x4945be)),_(0x2,_0x2f4fe1(_0xa13fb7)),_(0x3,_0x2f4fe1(_0x36f8f1))],f);var re=Object[_0x10dd51(0x1a0)],te=(_0x2e3938,_0x520446,_0x12145a,_0x4cface)=>{const _0x5dd3fc=_0x10dd51;for(var _0x27befd=_0x4cface>0x1?void 0x0:_0x4cface?re(_0x520446,_0x12145a):_0x520446,_0x226c48=_0x2e3938[_0x5dd3fc(0x1ba)]-0x1,_0x482e6a;_0x226c48>=0x0;_0x226c48--)(_0x482e6a=_0x2e3938[_0x226c48])&&(_0x27befd=_0x482e6a(_0x27befd)||_0x27befd);return _0x27befd;},N=(_0x17c323,_0x443b7d)=>(_0x10196c,_0x20f974)=>_0x443b7d(_0x10196c,_0x20f974,_0x17c323);let g=class extends _0x42963d{constructor(_0x331994,_0x1196dd){const _0x144bdd=_0x10dd51;super(),this['_threadCommentDataSourceService']=_0x331994,this['_threadCommentDataSource']=_0x1196dd,this[_0x144bdd(0x1e5)]();}['_initDataSource'](){const _0x4e0553=_0x10dd51;this[_0x4e0553(0x1a1)]['dataSource']=this[_0x4e0553(0x1e3)],this[_0x4e0553(0x1a1)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x2d29f0),N(0x1,_0x2f4fe1(f))],g);var se=Object[_0x10dd51(0x1e8)],oe=Object[_0x10dd51(0x1a0)],ne=(_0x543418,_0x21c9ac,_0x25fac4)=>_0x21c9ac in _0x543418?se(_0x543418,_0x21c9ac,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x25fac4}):_0x543418[_0x21c9ac]=_0x25fac4,ie=(_0x5f0bb1,_0x24b37f,_0x561555,_0xaba4b1)=>{const _0x2eb2a8=_0x10dd51;for(var _0x5d1f8a=_0xaba4b1>0x1?void 0x0:_0xaba4b1?oe(_0x24b37f,_0x561555):_0x24b37f,_0x1261f3=_0x5f0bb1[_0x2eb2a8(0x1ba)]-0x1,_0x550eaf;_0x1261f3>=0x0;_0x1261f3--)(_0x550eaf=_0x5f0bb1[_0x1261f3])&&(_0x5d1f8a=_0x550eaf(_0x5d1f8a)||_0x5d1f8a);return _0x5d1f8a;},w=(_0x118886,_0x4fd5f0)=>(_0x1518c9,_0x4e069a)=>_0x4fd5f0(_0x1518c9,_0x4e069a,_0x118886),$=(_0x5571b2,_0x275438,_0x113773)=>ne(_0x5571b2,typeof _0x275438!=_0x10dd51(0x1f1)?_0x275438+'':_0x275438,_0x113773);let b=class extends _0x424e35{constructor(_0x3ea8dd=M,_0x56b00e,_0x3fb8a7){const _0x1ced53=_0x10dd51;super(),this[_0x1ced53(0x1d8)]=_0x3ea8dd,this[_0x1ced53(0x1cb)]=_0x56b00e,this[_0x1ced53(0x1f6)]=_0x3fb8a7;const {..._0x4a2325}=_0x3c064f({},M,this[_0x1ced53(0x1d8)]);this[_0x1ced53(0x1f6)][_0x1ced53(0x1c7)](z,_0x4a2325);}[_0x10dd51(0x1c5)](){[[f],[g],[S]]['forEach'](_0x58b7fa=>{const _0x422f4e=_0x11cb;this[_0x422f4e(0x1cb)][_0x422f4e(0x1e0)](_0x58b7fa);});}['onReady'](){const _0x127c24=_0x10dd51;this[_0x127c24(0x1cb)][_0x127c24(0x1dc)](g),this[_0x127c24(0x1cb)]['get'](S);}};$(b,_0x10dd51(0x1af),W),$(b,_0x10dd51(0x1f9),_0x472341['UNIVER_UNKNOWN']),b=ie([_0x1c23a3(_0x589ee4,_0x349d8d,_0x46f06c),w(0x1,_0x2f4fe1(_0x36f8f1)),w(0x2,_0x18ac02)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x3f46f4=_0x43ef;(function(_0x257461,_0x23c47c){const _0x3621c8=_0x43ef,_0x42c4fd=_0x257461();while(!![]){try{const _0x29961c=-parseInt(_0x3621c8(0xc2))/0x1*(parseInt(_0x3621c8(0xf8))/0x2)+parseInt(_0x3621c8(0xb3))/0x3+-parseInt(_0x3621c8(0xb5))/0x4*(-parseInt(_0x3621c8(0xae))/0x5)+parseInt(_0x3621c8(0xd4))/0x6*(-parseInt(_0x3621c8(0xe3))/0x7)+parseInt(_0x3621c8(0xbf))/0x8+-parseInt(_0x3621c8(0xc7))/0x9+parseInt(_0x3621c8(0xe7))/0xa*(parseInt(_0x3621c8(0xb0))/0xb);if(_0x29961c===_0x23c47c)break;else _0x42c4fd['push'](_0x42c4fd['shift']());}catch(_0x433d00){_0x42c4fd['push'](_0x42c4fd['shift']());}}}(_0xf5b1,0x87ded));import{CommentService as _0x11e170,CollaborationSessionService as _0x4cd38e,UniverCollaborationClientPlugin as _0xf421b9}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x22ada7}from'@univerjs-pro/license';import{dayjs as _0x545eb3,UserManagerService as _0x5dff7a,Inject as _0x1e3f8f,Injector as _0x2f3235,Disposable as _0x161b8f,CustomRangeType as _0x396d46,UniverInstanceType as _0xe0e43a,DependentOn as _0x21b12e,IConfigService as _0x293df4,Plugin as _0x3fdb49,merge as _0xff6135}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x196607}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x32b180,IThreadCommentDataSourceService as _0x26e588}from'@univerjs/thread-comment';import{bufferTime as _0x517f82}from'rxjs';import{HTTPService as _0x267ec3}from'@univerjs/network';const W=_0x3f46f4(0xde);var I=(_0x50494d=>(_0x50494d[_0x50494d[_0x3f46f4(0xd0)]=0x0]='OpenOrReOpen',_0x50494d[_0x50494d[_0x3f46f4(0xd5)]=0x1]=_0x3f46f4(0xd5),_0x50494d[_0x50494d[_0x3f46f4(0x9e)]=-0x1]=_0x3f46f4(0x9e),_0x50494d))(I||{}),v=(_0x47cbf9=>(_0x47cbf9[_0x47cbf9[_0x3f46f4(0xbc)]=0x0]=_0x3f46f4(0xbc),_0x47cbf9[_0x47cbf9[_0x3f46f4(0xdd)]=0x1]=_0x3f46f4(0xdd),_0x47cbf9[_0x47cbf9['Reply']=0x2]=_0x3f46f4(0xf3),_0x47cbf9[_0x47cbf9[_0x3f46f4(0xc8)]=0x3]='Edit',_0x47cbf9[_0x47cbf9[_0x3f46f4(0xf6)]=0x4]=_0x3f46f4(0xf6),_0x47cbf9[_0x47cbf9['Solve']=0x5]=_0x3f46f4(0xc5),_0x47cbf9[_0x47cbf9['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x47cbf9))(v||{});const D=_0x443cbb=>_0x545eb3(new Date(+_0x443cbb))[_0x3f46f4(0x9c)](_0x3f46f4(0xf2)),B=async(_0x33143a,_0x2124cd)=>{const _0x1bc886=_0x3f46f4,_0x91bcc4=_0x33143a[_0x1bc886(0xb6)](_0x5dff7a),_0x18a19e=_0x33143a[_0x1bc886(0xb6)](_0x267ec3);_0x2124cd[_0x1bc886(0xfa)](_0x271c29=>{const _0x338be5=_0x1bc886;_0x91bcc4[_0x338be5(0xe8)](_0x271c29)&&_0x2124cd['delete'](_0x271c29);}),_0x2124cd[_0x1bc886(0xbb)]&&(await _0x18a19e[_0x1bc886(0xb6)](_0x1bc886(0xf4),{'params':{'userIDs':[..._0x2124cd]}}))['body']['users'][_0x1bc886(0xfa)](_0x40dcb5=>{const _0x4f48e0=_0x1bc886;_0x40dcb5&&_0x91bcc4[_0x4f48e0(0xef)](_0x40dcb5);});};var K=Object[_0x3f46f4(0xfc)],V=(_0x4e7606,_0x2e769e,_0x1b9f38,_0x54e2bc)=>{const _0x3240ad=_0x3f46f4;for(var _0x1edb70=_0x54e2bc>0x1?void 0x0:_0x54e2bc?K(_0x2e769e,_0x1b9f38):_0x2e769e,_0x54247d=_0x4e7606[_0x3240ad(0xdc)]-0x1,_0x3507ef;_0x54247d>=0x0;_0x54247d--)(_0x3507ef=_0x4e7606[_0x54247d])&&(_0x1edb70=_0x3507ef(_0x1edb70)||_0x1edb70);return _0x1edb70;},p=(_0xcbfd65,_0x1cafac)=>(_0x1f0a38,_0x27a032)=>_0x1cafac(_0x1f0a38,_0x27a032,_0xcbfd65);function _0x43ef(_0x5446a7,_0x20a84d){const _0xf5b1d1=_0xf5b1();return _0x43ef=function(_0x43ef8b,_0x2230f8){_0x43ef8b=_0x43ef8b-0x9b;let _0x30d8f7=_0xf5b1d1[_0x43ef8b];return _0x30d8f7;},_0x43ef(_0x5446a7,_0x20a84d);}let S=class extends _0x161b8f{constructor(_0x1a409b,_0x35c7b1,_0xac4fb,_0x163dd9){const _0x50a314=_0x3f46f4;super(),this['_commentService']=_0x1a409b,this[_0x50a314(0xfb)]=_0x35c7b1,this['_userService']=_0xac4fb,this[_0x50a314(0xf1)]=_0x163dd9,this[_0x50a314(0xac)](),this[_0x50a314(0xba)]();}[_0x3f46f4(0xba)](){const _0x2f56ca=_0x3f46f4;this[_0x2f56ca(0xaa)](this['_threadCommentModel'][_0x2f56ca(0xa7)][_0x2f56ca(0xaf)](_0x517f82(0x10))[_0x2f56ca(0xa4)](_0x6a4799=>{const _0x42a5c6=_0x2f56ca,_0x2dbccd=new Set();_0x6a4799[_0x42a5c6(0xfa)](_0x137d50=>{const _0x24ac14=_0x42a5c6;switch(_0x137d50[_0x24ac14(0xbd)]){case _0x24ac14(0xad):{const _0x50461a=_0x137d50[_0x24ac14(0xed)][_0x24ac14(0xc0)];_0x2dbccd[_0x24ac14(0xad)](_0x50461a);break;}}}),B(this[_0x42a5c6(0xf1)],_0x2dbccd);}));}[_0x3f46f4(0xac)](){const _0x1a28dc=_0x3f46f4;this[_0x1a28dc(0xaa)](this['_commentService'][_0x1a28dc(0xa7)]['subscribe'](async _0x181b23=>{const _0x1fabec=_0x1a28dc;var _0x322bcb,_0x11624f,_0x3daffe,_0x28bc77;const _0x42a56b=(_0x322bcb=this[_0x1fabec(0xfb)]['getUnit'](_0x181b23[_0x1fabec(0xea)])['find'](_0x1c1967=>_0x1c1967[_0x1fabec(0xb8)]===_0x181b23['threadId']))==null?void 0x0:_0x322bcb[_0x1fabec(0xc1)];if(!_0x42a56b)return;const {unitId:_0x38d1a8,subUnitId:_0x3e7f2e}=_0x42a56b;switch(_0x181b23[_0x1fabec(0xfe)]&&this[_0x1fabec(0xc6)][_0x1fabec(0xef)](_0x181b23[_0x1fabec(0xfe)]),_0x181b23[_0x1fabec(0xbd)]){case v[_0x1fabec(0xdd)]:break;case v[_0x1fabec(0xf3)]:{this[_0x1fabec(0xfb)][_0x1fabec(0xdb)](_0x38d1a8,_0x3e7f2e,{'unitId':_0x38d1a8,'subUnitId':_0x3e7f2e,'ref':'','id':_0x181b23[_0x1fabec(0xc4)],'dT':D(+_0x181b23['createTimestamp']),'threadId':_0x181b23[_0x1fabec(0xb8)],'personId':(_0x3daffe=(_0x11624f=_0x181b23[_0x1fabec(0xfe)])==null?void 0x0:_0x11624f[_0x1fabec(0xdf)])!=null?_0x3daffe:_0x181b23[_0x1fabec(0xcf)],'text':JSON[_0x1fabec(0xce)](_0x181b23[_0x1fabec(0xd3)]),'parentId':_0x42a56b['id']});break;}case v[_0x1fabec(0xf6)]:{const _0x4d2c00=this[_0x1fabec(0xfb)]['getComment'](_0x38d1a8,_0x3e7f2e,_0x181b23[_0x1fabec(0xc4)]);_0x4d2c00&&_0x4d2c00[_0x1fabec(0xc3)]&&this['_threadCommentModel']['deleteComment'](_0x38d1a8,_0x3e7f2e,_0x181b23[_0x1fabec(0xc4)]);break;}case v[_0x1fabec(0xc8)]:{this[_0x1fabec(0xfb)]['updateComment'](_0x38d1a8,_0x3e7f2e,{'commentId':_0x181b23[_0x1fabec(0xc4)],'text':JSON[_0x1fabec(0xce)](_0x181b23[_0x1fabec(0xd3)])});break;}case v['Solve']:{const _0x58b5a9=(_0x28bc77=this[_0x1fabec(0xfb)][_0x1fabec(0xb7)](_0x181b23[_0x1fabec(0xea)])['find'](_0x14cf37=>_0x14cf37[_0x1fabec(0xb8)]===_0x181b23[_0x1fabec(0xb8)]))==null?void 0x0:_0x28bc77['root'];_0x58b5a9&&this['_threadCommentModel']['resolveComment'](_0x38d1a8,_0x3e7f2e,_0x58b5a9['id'],_0x181b23[_0x1fabec(0x9d)]===I[_0x1fabec(0xd5)]);break;}}}));}};S=V([p(0x0,_0x1e3f8f(_0x11e170)),p(0x1,_0x1e3f8f(_0x32b180)),p(0x2,_0x1e3f8f(_0x5dff7a)),p(0x3,_0x1e3f8f(_0x2f3235))],S);const z=_0x3f46f4(0xb9),M={};var k=Object[_0x3f46f4(0xfc)],Q=(_0x3e1f0e,_0x5d99ce,_0x38890e,_0x242978)=>{const _0x20216b=_0x3f46f4;for(var _0x156b53=_0x242978>0x1?void 0x0:_0x242978?k(_0x5d99ce,_0x38890e):_0x5d99ce,_0x2ffe4a=_0x3e1f0e[_0x20216b(0xdc)]-0x1,_0x8b8a3b;_0x2ffe4a>=0x0;_0x2ffe4a--)(_0x8b8a3b=_0x3e1f0e[_0x2ffe4a])&&(_0x156b53=_0x8b8a3b(_0x156b53)||_0x156b53);return _0x156b53;},_=(_0x5c8104,_0xd928ed)=>(_0xe4a2a4,_0x20ce7b)=>_0xd928ed(_0xe4a2a4,_0x20ce7b,_0x5c8104);function X(_0x1918c,_0x4b8e1b){const _0x14979a=_0x3f46f4,_0x322908=_0x1918c['replies'][0x0];return{..._0x4b8e1b,'id':_0x322908[_0x14979a(0xc4)],'resolved':_0x1918c['solved']===0x1,'dT':D(_0x322908[_0x14979a(0xf9)]),'personId':_0x322908[_0x14979a(0xcf)],'threadId':_0x322908[_0x14979a(0xb8)]};}function ee(_0x29e162,_0x58d0e4,_0x58a3d4){const _0x259496=_0x3f46f4;var _0x4261aa,_0x313eb0;if(((_0x313eb0=(_0x4261aa=_0x29e162==null?void 0x0:_0x29e162['replies'])==null?void 0x0:_0x4261aa[_0x259496(0xdc)])!=null?_0x313eb0:0x0)>0x0){const _0x4c1165=(_0x45dc74,_0x343170)=>({'id':_0x45dc74[_0x259496(0xc4)],'threadId':_0x45dc74['threadId'],'dT':D(_0x45dc74['createTimestamp']),'personId':_0x45dc74['userId'],'resolved':_0x29e162[_0x259496(0x9d)]===I[_0x259496(0xd5)],'unitId':_0x58d0e4,'subUnitId':_0x58a3d4,'text':JSON[_0x259496(0xce)](_0x45dc74[_0x259496(0xd3)]),'parentId':_0x343170}),_0x31a9a7=_0x4c1165(_0x29e162[_0x259496(0xec)][0x0]);return{..._0x31a9a7,'children':_0x29e162['replies'][_0x259496(0xa8)](0x1)[_0x259496(0xeb)](_0x572877=>_0x4c1165(_0x572877,_0x31a9a7['id']))};}return null;}function _0xf5b1(){const _0x2d3517=['/edit','unitId','map','replies','payload','_threadCommentDataSource','addUser','/reply','_injector','YYYY/MM/DD\x20HH:mm','Reply','/universer-api/user/list','_configService','Delete','resolveComment','199022MlYQZz','createTimestamp','forEach','_threadCommentModel','getOwnPropertyDescriptor','users','user','code','format','solved','UNRECOGNIZED','/add','comments','COMMENT','/universer-api/comment/unit/','/solved','subscribe','syncUpdateMutationToColla','setConfig','commentUpdate$','slice','_threadCommentDataSourceService','disposeWithMe','getMemberID','_init','add','604085GBTZEi','pipe','16346RtQwHT','updateComment','resolved','474552ClnPOZ','symbol','4DojKee','get','getUnit','threadId','thread-comment-data-source.config','_initUserSync','size','Unknown','type','_initDataSource','6475536VQAIbW','personId','root','1yNvFPc','parentId','replyId','Solve','_userService','1587708rcJdvb','Edit','_sessionService','requireSession','/delete','reply','_config','parse','userId','OpenOrReOpen','pluginName','rangeId','content','430218jdWDoJ','Solved','stringify','filter','values','error','defineProperty','addComment','length','Add','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','userID','body','post','comment','63njSkDS','dataSource','_httpService','rangeType','2620slUuJq','getUser'];_0xf5b1=function(){return _0x2d3517;};return _0xf5b1();}let f=class{constructor(_0x1cddcf,_0x5ac749,_0x3c58d2,_0x444356){const _0x1a6c70=_0x3f46f4;this['_httpService']=_0x1cddcf,this[_0x1a6c70(0xc6)]=_0x5ac749,this[_0x1a6c70(0xc9)]=_0x3c58d2,this[_0x1a6c70(0xf1)]=_0x444356;}async['addComment'](_0x4eda24){const _0x366a83=_0x3f46f4;var _0x400dc7,_0x2608f1;const {parentId:_0x548c31,unitId:_0x37733d,text:_0x266740,threadId:_0x10d27e}=_0x4eda24,_0x4f2370=(_0x2608f1=(_0x400dc7=_0x266740['customRanges'])==null?void 0x0:_0x400dc7[_0x366a83(0xd7)](_0x4aee06=>_0x4aee06[_0x366a83(0xe6)]===_0x396d46['COMMENT'])[_0x366a83(0xeb)](_0x269f59=>_0x269f59[_0x366a83(0xd2)]))!=null?_0x2608f1:[],_0x194f37=JSON['stringify'](_0x266740),_0x5b4e7c=(await this[_0x366a83(0xc9)][_0x366a83(0xca)](_0x37733d))[_0x366a83(0xab)]();if(_0x548c31){const _0x35bd37={'memberId':_0x5b4e7c,'unitId':_0x37733d,'content':_0x194f37,'mention':_0x4f2370,'threadId':_0x10d27e},_0x539197=(await this[_0x366a83(0xe5)]['post']('/universer-api/comment/unit/'+_0x37733d+_0x366a83(0xf0),{'body':_0x35bd37}))['body'][_0x366a83(0xcc)];return{..._0x4eda24,'id':_0x539197[_0x366a83(0xc4)],'dT':_0x545eb3(+_0x539197[_0x366a83(0xf9)])[_0x366a83(0x9c)](_0x366a83(0xf2)),'personId':_0x539197[_0x366a83(0xcf)]};}else{const _0x44e77a={'memberId':_0x5b4e7c,'unitId':_0x37733d,'content':_0x194f37,'mention':_0x4f2370},_0x49d4ae=await this[_0x366a83(0xe5)][_0x366a83(0xe1)](_0x366a83(0xa2)+_0x37733d+_0x366a83(0x9f),{'body':_0x44e77a});return X(_0x49d4ae[_0x366a83(0xe0)][_0x366a83(0xe2)],_0x4eda24);}}async[_0x3f46f4(0xb1)](_0x4aaa17){const _0x991ab9=_0x3f46f4;var _0x467278,_0x10c58d;const {text:_0x291750,unitId:_0x4ae034}=_0x4aaa17,_0x2b3a74=(_0x10c58d=(_0x467278=_0x291750['customRanges'])==null?void 0x0:_0x467278[_0x991ab9(0xd7)](_0x4f0c91=>_0x4f0c91['rangeType']===_0x396d46[_0x991ab9(0xa1)])['map'](_0x362cfa=>_0x362cfa['rangeId']))!=null?_0x10c58d:[],_0x397aa1=JSON[_0x991ab9(0xd6)](_0x291750),_0x27b4e4=_0x4aaa17[_0x991ab9(0xb8)],_0x5b8fd5=_0x4aaa17['id'],_0x205ef0={'memberId':(await this[_0x991ab9(0xc9)][_0x991ab9(0xca)](_0x4ae034))[_0x991ab9(0xab)](),'unitId':_0x4ae034,'threadId':_0x27b4e4,'mention':_0x2b3a74,'content':_0x397aa1,'replyId':_0x5b8fd5},_0x2a6977=await this[_0x991ab9(0xe5)]['post'](_0x991ab9(0xa2)+_0x4ae034+_0x991ab9(0xe9),{'body':_0x205ef0});return!_0x2a6977[_0x991ab9(0xe0)][_0x991ab9(0xd9)]||_0x2a6977[_0x991ab9(0xe0)][_0x991ab9(0xd9)][_0x991ab9(0x9b)]===0x1;}async[_0x3f46f4(0xf7)](_0x37b948){const _0x4f5a6b=_0x3f46f4,{unitId:_0x1aabbe}=_0x37b948,_0x15205a=_0x37b948[_0x4f5a6b(0xb8)],_0x3d569a={'memberId':this[_0x4f5a6b(0xc6)]['getCurrentUser']()[_0x4f5a6b(0xdf)],'unitId':_0x1aabbe,'threadId':_0x15205a,'solved':_0x37b948[_0x4f5a6b(0xb2)]?I[_0x4f5a6b(0xd5)]:I[_0x4f5a6b(0xd0)]},_0x20c6bc=await this['_httpService'][_0x4f5a6b(0xe1)](_0x4f5a6b(0xa2)+_0x1aabbe+_0x4f5a6b(0xa3),{'body':_0x3d569a});return!_0x20c6bc[_0x4f5a6b(0xe0)][_0x4f5a6b(0xd9)]||_0x20c6bc[_0x4f5a6b(0xe0)][_0x4f5a6b(0xd9)][_0x4f5a6b(0x9b)]===0x1;}async['deleteComment'](_0x4f5ad4,_0x5062bc,_0x310e1d,_0x4b3ab2){const _0x4a19f0=_0x3f46f4,_0x3f91a8={'memberId':(await this[_0x4a19f0(0xc9)][_0x4a19f0(0xca)](_0x4f5ad4))[_0x4a19f0(0xab)](),'threadId':_0x310e1d,'replyId':_0x4b3ab2,'unitId':_0x4f5ad4},_0x44e7e0=await this['_httpService']['post'](_0x4a19f0(0xa2)+_0x4f5ad4+_0x4a19f0(0xcb),{'body':_0x3f91a8});return!_0x44e7e0['body']['error']||_0x44e7e0[_0x4a19f0(0xe0)][_0x4a19f0(0xd9)]['code']===0x1;}async['listComments'](_0x2a9555,_0x7f1c78,_0x551c74){const _0x48f84f=_0x3f46f4,_0x326454={'unitId':_0x2a9555,'threadId':_0x551c74},_0x7ee0dc=await this[_0x48f84f(0xe5)]['post']('/universer-api/comment/unit/'+_0x2a9555+'/list',{'body':_0x326454}),_0x497d27=_0x551c74[_0x48f84f(0xeb)](_0x4f52fe=>ee(_0x7ee0dc['body'][_0x48f84f(0xa0)][_0x4f52fe],_0x2a9555,_0x7f1c78))[_0x48f84f(0xd7)](Boolean);return Object[_0x48f84f(0xd8)](_0x7ee0dc['body'][_0x48f84f(0xfd)])[_0x48f84f(0xfa)](_0xd5c1ec=>{const _0x4eb5c9=_0x48f84f;this[_0x4eb5c9(0xc6)]['addUser'](_0xd5c1ec);}),_0x497d27;}['saveCommentToSnapshot'](_0x25b46d){const _0x5660e0=_0x3f46f4;return{'id':_0x25b46d['id'],'threadId':_0x25b46d[_0x5660e0(0xb8)],'ref':_0x25b46d['ref']};}};f=Q([_(0x0,_0x1e3f8f(_0x267ec3)),_(0x1,_0x1e3f8f(_0x5dff7a)),_(0x2,_0x1e3f8f(_0x4cd38e)),_(0x3,_0x1e3f8f(_0x2f3235))],f);var re=Object[_0x3f46f4(0xfc)],te=(_0x422a50,_0x204a4c,_0x3eb1f,_0x4f5c24)=>{const _0x241e3f=_0x3f46f4;for(var _0x20ea41=_0x4f5c24>0x1?void 0x0:_0x4f5c24?re(_0x204a4c,_0x3eb1f):_0x204a4c,_0x52868e=_0x422a50[_0x241e3f(0xdc)]-0x1,_0x309664;_0x52868e>=0x0;_0x52868e--)(_0x309664=_0x422a50[_0x52868e])&&(_0x20ea41=_0x309664(_0x20ea41)||_0x20ea41);return _0x20ea41;},N=(_0x21da7b,_0x43e304)=>(_0x52d743,_0xbdc6bb)=>_0x43e304(_0x52d743,_0xbdc6bb,_0x21da7b);let g=class extends _0x161b8f{constructor(_0x10504f,_0x30017c){const _0x2ae5be=_0x3f46f4;super(),this['_threadCommentDataSourceService']=_0x10504f,this[_0x2ae5be(0xee)]=_0x30017c,this[_0x2ae5be(0xbe)]();}['_initDataSource'](){const _0x10899a=_0x3f46f4;this['_threadCommentDataSourceService'][_0x10899a(0xe4)]=this[_0x10899a(0xee)],this[_0x10899a(0xa9)][_0x10899a(0xa5)]=!0x1;}};g=te([N(0x0,_0x26e588),N(0x1,_0x1e3f8f(f))],g);var se=Object[_0x3f46f4(0xda)],oe=Object[_0x3f46f4(0xfc)],ne=(_0x239c9c,_0x4483d7,_0x3efb5a)=>_0x4483d7 in _0x239c9c?se(_0x239c9c,_0x4483d7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3efb5a}):_0x239c9c[_0x4483d7]=_0x3efb5a,ie=(_0x5cf66c,_0x26b4d5,_0x11bccb,_0x538de6)=>{const _0xb7f3b0=_0x3f46f4;for(var _0x3038e3=_0x538de6>0x1?void 0x0:_0x538de6?oe(_0x26b4d5,_0x11bccb):_0x26b4d5,_0x41732e=_0x5cf66c[_0xb7f3b0(0xdc)]-0x1,_0x371806;_0x41732e>=0x0;_0x41732e--)(_0x371806=_0x5cf66c[_0x41732e])&&(_0x3038e3=_0x371806(_0x3038e3)||_0x3038e3);return _0x3038e3;},w=(_0x22ed5d,_0x5a5f7f)=>(_0x42bf15,_0x54a908)=>_0x5a5f7f(_0x42bf15,_0x54a908,_0x22ed5d),$=(_0xc71f46,_0x5183e8,_0x353f70)=>ne(_0xc71f46,typeof _0x5183e8!=_0x3f46f4(0xb4)?_0x5183e8+'':_0x5183e8,_0x353f70);let b=class extends _0x3fdb49{constructor(_0x5b1110=M,_0x27fd76,_0x4b0c38){const _0x1889cc=_0x3f46f4;super(),this['_config']=_0x5b1110,this[_0x1889cc(0xf1)]=_0x27fd76,this[_0x1889cc(0xf5)]=_0x4b0c38;const {..._0x388edc}=_0xff6135({},M,this[_0x1889cc(0xcd)]);this[_0x1889cc(0xf5)][_0x1889cc(0xa6)](z,_0x388edc);}['onStarting'](){const _0x427cc9=_0x3f46f4;[[f],[g],[S]][_0x427cc9(0xfa)](_0x1df5b2=>{const _0x351be2=_0x427cc9;this[_0x351be2(0xf1)][_0x351be2(0xad)](_0x1df5b2);});}['onReady'](){const _0x528871=_0x3f46f4;this[_0x528871(0xf1)]['get'](g),this['_injector']['get'](S);}};$(b,_0x3f46f4(0xd1),W),$(b,'type',_0xe0e43a['UNIVER_UNKNOWN']),b=ie([_0x21b12e(_0x196607,_0xf421b9,_0x22ada7),w(0x1,_0x1e3f8f(_0x2f3235)),w(0x2,_0x293df4)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x10dd51=_0x11cb;(function(_0x5593fd,_0x39ba53){const _0x38ce01=_0x11cb,_0x6c3ab1=_0x5593fd();while(!![]){try{const _0x25e2d0=-parseInt(_0x38ce01(0x1b2))/0x1+-parseInt(_0x38ce01(0x1d5))/0x2+-parseInt(_0x38ce01(0x1e2))/0x3+-parseInt(_0x38ce01(0x1d7))/0x4*(parseInt(_0x38ce01(0x1ce))/0x5)+parseInt(_0x38ce01(0x1cd))/0x6*(-parseInt(_0x38ce01(0x1c0))/0x7)+-parseInt(_0x38ce01(0x1dd))/0x8+-parseInt(_0x38ce01(0x1d9))/0x9*(-parseInt(_0x38ce01(0x1b7))/0xa);if(_0x25e2d0===_0x39ba53)break;else _0x6c3ab1['push'](_0x6c3ab1['shift']());}catch(_0x549fea){_0x6c3ab1['push'](_0x6c3ab1['shift']());}}}(_0x19f0,0x6e085));import{CommentService as _0x480a02,CollaborationSessionService as _0xa13fb7,UniverCollaborationClientPlugin as _0x349d8d}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x46f06c}from'@univerjs-pro/license';import{dayjs as _0x13b06d,UserManagerService as _0x4945be,Inject as _0x2f4fe1,Injector as _0x36f8f1,Disposable as _0x42963d,CustomRangeType as _0x5b13ae,UniverInstanceType as _0x472341,DependentOn as _0x1c23a3,IConfigService as _0x18ac02,Plugin as _0x424e35,merge as _0x3c064f}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x589ee4}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x33888f,IThreadCommentDataSourceService as _0x2d29f0}from'@univerjs/thread-comment';import{bufferTime as _0x2e1f0d}from'rxjs';import{HTTPService as _0x181eb7}from'@univerjs/network';function _0x11cb(_0x2f1284,_0x4f4a0f){const _0x19f012=_0x19f0();return _0x11cb=function(_0x11cba1,_0x188804){_0x11cba1=_0x11cba1-0x1a0;let _0xa95549=_0x19f012[_0x11cba1];return _0xa95549;},_0x11cb(_0x2f1284,_0x4f4a0f);}const W=_0x10dd51(0x1b3);var I=(_0x26f9dd=>(_0x26f9dd[_0x26f9dd[_0x10dd51(0x1a6)]=0x0]=_0x10dd51(0x1a6),_0x26f9dd[_0x26f9dd[_0x10dd51(0x1ac)]=0x1]=_0x10dd51(0x1ac),_0x26f9dd[_0x26f9dd['UNRECOGNIZED']=-0x1]=_0x10dd51(0x1bb),_0x26f9dd))(I||{}),v=(_0x47478a=>(_0x47478a[_0x47478a['Unknown']=0x0]='Unknown',_0x47478a[_0x47478a[_0x10dd51(0x1ae)]=0x1]='Add',_0x47478a[_0x47478a['Reply']=0x2]='Reply',_0x47478a[_0x47478a['Edit']=0x3]=_0x10dd51(0x1c4),_0x47478a[_0x47478a[_0x10dd51(0x1cc)]=0x4]='Delete',_0x47478a[_0x47478a[_0x10dd51(0x1e4)]=0x5]=_0x10dd51(0x1e4),_0x47478a[_0x47478a[_0x10dd51(0x1bb)]=-0x1]=_0x10dd51(0x1bb),_0x47478a))(v||{});const D=_0x47a61f=>_0x13b06d(new Date(+_0x47a61f))[_0x10dd51(0x1ec)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x2c7438,_0x476874)=>{const _0x39beeb=_0x10dd51,_0x2ec2d8=_0x2c7438[_0x39beeb(0x1dc)](_0x4945be),_0x5e8f3c=_0x2c7438[_0x39beeb(0x1dc)](_0x181eb7);_0x476874['forEach'](_0x33f877=>{const _0xac41ea=_0x39beeb;_0x2ec2d8[_0xac41ea(0x1f3)](_0x33f877)&&_0x476874[_0xac41ea(0x1f2)](_0x33f877);}),_0x476874[_0x39beeb(0x1db)]&&(await _0x5e8f3c[_0x39beeb(0x1dc)](_0x39beeb(0x1b4),{'params':{'userIDs':[..._0x476874]}}))[_0x39beeb(0x1f0)][_0x39beeb(0x1cf)][_0x39beeb(0x1ab)](_0x2988d6=>{const _0x1690dd=_0x39beeb;_0x2988d6&&_0x2ec2d8[_0x1690dd(0x1bd)](_0x2988d6);});};var K=Object[_0x10dd51(0x1a0)],V=(_0x3b975c,_0x3bcd25,_0x293c56,_0x37d013)=>{for(var _0x3ed374=_0x37d013>0x1?void 0x0:_0x37d013?K(_0x3bcd25,_0x293c56):_0x3bcd25,_0x56e7e0=_0x3b975c['length']-0x1,_0x3dbc0f;_0x56e7e0>=0x0;_0x56e7e0--)(_0x3dbc0f=_0x3b975c[_0x56e7e0])&&(_0x3ed374=_0x3dbc0f(_0x3ed374)||_0x3ed374);return _0x3ed374;},p=(_0x416c56,_0x5e3432)=>(_0x1c0c8c,_0x363ac3)=>_0x5e3432(_0x1c0c8c,_0x363ac3,_0x416c56);let S=class extends _0x42963d{constructor(_0x4ce056,_0x18c6c9,_0x1f818b,_0x541540){const _0x195020=_0x10dd51;super(),this['_commentService']=_0x4ce056,this[_0x195020(0x1a2)]=_0x18c6c9,this[_0x195020(0x1ee)]=_0x1f818b,this[_0x195020(0x1cb)]=_0x541540,this[_0x195020(0x1a7)](),this[_0x195020(0x1f7)]();}[_0x10dd51(0x1f7)](){const _0x292770=_0x10dd51;this[_0x292770(0x1de)](this[_0x292770(0x1a2)]['commentUpdate$']['pipe'](_0x2e1f0d(0x10))[_0x292770(0x1e6)](_0x3dbe55=>{const _0x462a7c=_0x292770,_0x2c45a0=new Set();_0x3dbe55['forEach'](_0x16ea0b=>{const _0x557a96=_0x11cb;switch(_0x16ea0b[_0x557a96(0x1f9)]){case _0x557a96(0x1e0):{const _0x3473a8=_0x16ea0b['payload']['personId'];_0x2c45a0[_0x557a96(0x1e0)](_0x3473a8);break;}}}),B(this[_0x462a7c(0x1cb)],_0x2c45a0);}));}[_0x10dd51(0x1a7)](){const _0x1c5778=_0x10dd51;this['disposeWithMe'](this[_0x1c5778(0x1eb)][_0x1c5778(0x1b5)][_0x1c5778(0x1e6)](async _0x32de80=>{const _0x222337=_0x1c5778;var _0x351913,_0x5e3a57,_0x5046df,_0x447723;const _0xca006d=(_0x351913=this[_0x222337(0x1a2)][_0x222337(0x1f5)](_0x32de80[_0x222337(0x1a8)])[_0x222337(0x1d1)](_0x48932e=>_0x48932e[_0x222337(0x1fa)]===_0x32de80[_0x222337(0x1fa)]))==null?void 0x0:_0x351913['root'];if(!_0xca006d)return;const {unitId:_0x2e0029,subUnitId:_0x42d124}=_0xca006d;switch(_0x32de80[_0x222337(0x1c9)]&&this['_userService'][_0x222337(0x1bd)](_0x32de80[_0x222337(0x1c9)]),_0x32de80[_0x222337(0x1f9)]){case v[_0x222337(0x1ae)]:break;case v[_0x222337(0x1d4)]:{this[_0x222337(0x1a2)][_0x222337(0x1be)](_0x2e0029,_0x42d124,{'unitId':_0x2e0029,'subUnitId':_0x42d124,'ref':'','id':_0x32de80[_0x222337(0x1a5)],'dT':D(+_0x32de80[_0x222337(0x1b1)]),'threadId':_0x32de80[_0x222337(0x1fa)],'personId':(_0x5046df=(_0x5e3a57=_0x32de80[_0x222337(0x1c9)])==null?void 0x0:_0x5e3a57['userID'])!=null?_0x5046df:_0x32de80[_0x222337(0x1ea)],'text':JSON[_0x222337(0x1ff)](_0x32de80['content']),'parentId':_0xca006d['id']});break;}case v[_0x222337(0x1cc)]:{const _0x4bed65=this[_0x222337(0x1a2)][_0x222337(0x1ad)](_0x2e0029,_0x42d124,_0x32de80[_0x222337(0x1a5)]);_0x4bed65&&_0x4bed65[_0x222337(0x1f8)]&&this[_0x222337(0x1a2)][_0x222337(0x1fd)](_0x2e0029,_0x42d124,_0x32de80['replyId']);break;}case v[_0x222337(0x1c4)]:{this[_0x222337(0x1a2)][_0x222337(0x1df)](_0x2e0029,_0x42d124,{'commentId':_0x32de80[_0x222337(0x1a5)],'text':JSON[_0x222337(0x1ff)](_0x32de80[_0x222337(0x1a3)])});break;}case v[_0x222337(0x1e4)]:{const _0x3bf972=(_0x447723=this[_0x222337(0x1a2)][_0x222337(0x1f5)](_0x32de80['unitId'])[_0x222337(0x1d1)](_0xc63f0d=>_0xc63f0d[_0x222337(0x1fa)]===_0x32de80['threadId']))==null?void 0x0:_0x447723[_0x222337(0x1fb)];_0x3bf972&&this[_0x222337(0x1a2)][_0x222337(0x1c1)](_0x2e0029,_0x42d124,_0x3bf972['id'],_0x32de80['solved']===I[_0x222337(0x1ac)]);break;}}}));}};S=V([p(0x0,_0x2f4fe1(_0x480a02)),p(0x1,_0x2f4fe1(_0x33888f)),p(0x2,_0x2f4fe1(_0x4945be)),p(0x3,_0x2f4fe1(_0x36f8f1))],S);const z=_0x10dd51(0x1c8),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5107cd,_0x4540ab,_0x3dc2d2,_0x34b0d2)=>{const _0x104726=_0x10dd51;for(var _0x576fe5=_0x34b0d2>0x1?void 0x0:_0x34b0d2?k(_0x4540ab,_0x3dc2d2):_0x4540ab,_0x950792=_0x5107cd[_0x104726(0x1ba)]-0x1,_0x673bac;_0x950792>=0x0;_0x950792--)(_0x673bac=_0x5107cd[_0x950792])&&(_0x576fe5=_0x673bac(_0x576fe5)||_0x576fe5);return _0x576fe5;},_=(_0x2be1fb,_0x2c3fcc)=>(_0x29ae54,_0xef4bc)=>_0x2c3fcc(_0x29ae54,_0xef4bc,_0x2be1fb);function X(_0x5a3b0f,_0x19c30e){const _0x2cfd35=_0x10dd51,_0x39bafd=_0x5a3b0f[_0x2cfd35(0x1bc)][0x0];return{..._0x19c30e,'id':_0x39bafd[_0x2cfd35(0x1a5)],'resolved':_0x5a3b0f[_0x2cfd35(0x1a9)]===0x1,'dT':D(_0x39bafd['createTimestamp']),'personId':_0x39bafd['userId'],'threadId':_0x39bafd[_0x2cfd35(0x1fa)]};}function _0x19f0(){const _0xfb680b=['_userService','filter','body','symbol','delete','getUser','reply','getUnit','_configService','_initUserSync','parentId','type','threadId','root','ref','deleteComment','comment','parse','getOwnPropertyDescriptor','_threadCommentDataSourceService','_threadCommentModel','content','post','replyId','OpenOrReOpen','_init','unitId','solved','rangeType','forEach','Solved','getComment','Add','pluginName','_httpService','createTimestamp','38524TSZSNL','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/universer-api/user/list','commentUpdate$','COMMENT','10xvRKow','saveCommentToSnapshot','requireSession','length','UNRECOGNIZED','replies','addUser','addComment','getMemberID','7cIeESQ','resolveComment','values','getCurrentUser','Edit','onStarting','comments','setConfig','thread-comment-data-source.config','user','/add','_injector','Delete','1119918FkAfKu','3585ENSGRb','users','customRanges','find','map','/delete','Reply','1264864IWwLUa','/reply','4196LvXbnw','_config','27951543SnPJcQ','rangeId','size','get','3171544HcFjPy','disposeWithMe','updateComment','add','error','1946547RGVrHi','_threadCommentDataSource','Solve','_initDataSource','subscribe','_sessionService','defineProperty','/universer-api/comment/unit/','userId','_commentService','format','code'];_0x19f0=function(){return _0xfb680b;};return _0x19f0();}function ee(_0x21dbfb,_0x3f0b9e,_0x102120){const _0x2bc455=_0x10dd51;var _0x4b7ba9,_0x4431b5;if(((_0x4431b5=(_0x4b7ba9=_0x21dbfb==null?void 0x0:_0x21dbfb[_0x2bc455(0x1bc)])==null?void 0x0:_0x4b7ba9[_0x2bc455(0x1ba)])!=null?_0x4431b5:0x0)>0x0){const _0x4a8e0c=(_0x1c5b0a,_0x34b27d)=>({'id':_0x1c5b0a[_0x2bc455(0x1a5)],'threadId':_0x1c5b0a[_0x2bc455(0x1fa)],'dT':D(_0x1c5b0a[_0x2bc455(0x1b1)]),'personId':_0x1c5b0a[_0x2bc455(0x1ea)],'resolved':_0x21dbfb[_0x2bc455(0x1a9)]===I['Solved'],'unitId':_0x3f0b9e,'subUnitId':_0x102120,'text':JSON[_0x2bc455(0x1ff)](_0x1c5b0a[_0x2bc455(0x1a3)]),'parentId':_0x34b27d}),_0x465812=_0x4a8e0c(_0x21dbfb[_0x2bc455(0x1bc)][0x0]);return{..._0x465812,'children':_0x21dbfb[_0x2bc455(0x1bc)]['slice'](0x1)['map'](_0x40a8d5=>_0x4a8e0c(_0x40a8d5,_0x465812['id']))};}return null;}let f=class{constructor(_0x34854e,_0x4f12e8,_0x212f20,_0x307da2){const _0x3f16fd=_0x10dd51;this[_0x3f16fd(0x1b0)]=_0x34854e,this[_0x3f16fd(0x1ee)]=_0x4f12e8,this[_0x3f16fd(0x1e7)]=_0x212f20,this[_0x3f16fd(0x1cb)]=_0x307da2;}async[_0x10dd51(0x1be)](_0x1b730b){const _0x5ac165=_0x10dd51;var _0x1ad724,_0x474259;const {parentId:_0xd17921,unitId:_0x4e0ab2,text:_0x430c78,threadId:_0x879d1f}=_0x1b730b,_0x237901=(_0x474259=(_0x1ad724=_0x430c78['customRanges'])==null?void 0x0:_0x1ad724[_0x5ac165(0x1ef)](_0x188c49=>_0x188c49[_0x5ac165(0x1aa)]===_0x5b13ae['COMMENT'])[_0x5ac165(0x1d2)](_0x48dd16=>_0x48dd16[_0x5ac165(0x1da)]))!=null?_0x474259:[],_0x10521c=JSON['stringify'](_0x430c78),_0x59c8c1=(await this[_0x5ac165(0x1e7)][_0x5ac165(0x1b9)](_0x4e0ab2))[_0x5ac165(0x1bf)]();if(_0xd17921){const _0x36f6fd={'memberId':_0x59c8c1,'unitId':_0x4e0ab2,'content':_0x10521c,'mention':_0x237901,'threadId':_0x879d1f},_0x194a8b=(await this[_0x5ac165(0x1b0)][_0x5ac165(0x1a4)](_0x5ac165(0x1e9)+_0x4e0ab2+_0x5ac165(0x1d6),{'body':_0x36f6fd}))[_0x5ac165(0x1f0)][_0x5ac165(0x1f4)];return{..._0x1b730b,'id':_0x194a8b[_0x5ac165(0x1a5)],'dT':_0x13b06d(+_0x194a8b[_0x5ac165(0x1b1)])[_0x5ac165(0x1ec)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x194a8b[_0x5ac165(0x1ea)]};}else{const _0x100bd8={'memberId':_0x59c8c1,'unitId':_0x4e0ab2,'content':_0x10521c,'mention':_0x237901},_0x3a3d93=await this[_0x5ac165(0x1b0)][_0x5ac165(0x1a4)]('/universer-api/comment/unit/'+_0x4e0ab2+_0x5ac165(0x1ca),{'body':_0x100bd8});return X(_0x3a3d93[_0x5ac165(0x1f0)][_0x5ac165(0x1fe)],_0x1b730b);}}async[_0x10dd51(0x1df)](_0x5d22ad){const _0x5925fa=_0x10dd51;var _0x5dcf4a,_0x42696d;const {text:_0x36b18c,unitId:_0xa798c5}=_0x5d22ad,_0xe68161=(_0x42696d=(_0x5dcf4a=_0x36b18c[_0x5925fa(0x1d0)])==null?void 0x0:_0x5dcf4a[_0x5925fa(0x1ef)](_0x12bbf8=>_0x12bbf8[_0x5925fa(0x1aa)]===_0x5b13ae[_0x5925fa(0x1b6)])['map'](_0x56f75f=>_0x56f75f['rangeId']))!=null?_0x42696d:[],_0x3a0ec8=JSON['stringify'](_0x36b18c),_0x277e88=_0x5d22ad[_0x5925fa(0x1fa)],_0x5b7b17=_0x5d22ad['id'],_0x28f7df={'memberId':(await this[_0x5925fa(0x1e7)][_0x5925fa(0x1b9)](_0xa798c5))['getMemberID'](),'unitId':_0xa798c5,'threadId':_0x277e88,'mention':_0xe68161,'content':_0x3a0ec8,'replyId':_0x5b7b17},_0x1b15af=await this[_0x5925fa(0x1b0)][_0x5925fa(0x1a4)](_0x5925fa(0x1e9)+_0xa798c5+'/edit',{'body':_0x28f7df});return!_0x1b15af['body'][_0x5925fa(0x1e1)]||_0x1b15af[_0x5925fa(0x1f0)][_0x5925fa(0x1e1)][_0x5925fa(0x1ed)]===0x1;}async['resolveComment'](_0x553a18){const _0x5b20be=_0x10dd51,{unitId:_0x4a9933}=_0x553a18,_0x169aed=_0x553a18['threadId'],_0x5cf1f5={'memberId':this[_0x5b20be(0x1ee)][_0x5b20be(0x1c3)]()['userID'],'unitId':_0x4a9933,'threadId':_0x169aed,'solved':_0x553a18['resolved']?I[_0x5b20be(0x1ac)]:I['OpenOrReOpen']},_0xe6ad43=await this[_0x5b20be(0x1b0)][_0x5b20be(0x1a4)]('/universer-api/comment/unit/'+_0x4a9933+'/solved',{'body':_0x5cf1f5});return!_0xe6ad43[_0x5b20be(0x1f0)]['error']||_0xe6ad43[_0x5b20be(0x1f0)]['error'][_0x5b20be(0x1ed)]===0x1;}async[_0x10dd51(0x1fd)](_0x31f4ea,_0x2b351f,_0x423d3d,_0x5647ce){const _0x4fc712=_0x10dd51,_0x59f71b={'memberId':(await this[_0x4fc712(0x1e7)][_0x4fc712(0x1b9)](_0x31f4ea))['getMemberID'](),'threadId':_0x423d3d,'replyId':_0x5647ce,'unitId':_0x31f4ea},_0x3089c0=await this[_0x4fc712(0x1b0)]['post'](_0x4fc712(0x1e9)+_0x31f4ea+_0x4fc712(0x1d3),{'body':_0x59f71b});return!_0x3089c0['body']['error']||_0x3089c0['body'][_0x4fc712(0x1e1)][_0x4fc712(0x1ed)]===0x1;}async['listComments'](_0x16e185,_0x25a2ff,_0x26c951){const _0x56ef58=_0x10dd51,_0x1415d6={'unitId':_0x16e185,'threadId':_0x26c951},_0xdb5897=await this[_0x56ef58(0x1b0)][_0x56ef58(0x1a4)](_0x56ef58(0x1e9)+_0x16e185+'/list',{'body':_0x1415d6}),_0x14f46d=_0x26c951[_0x56ef58(0x1d2)](_0x11f78b=>ee(_0xdb5897[_0x56ef58(0x1f0)][_0x56ef58(0x1c6)][_0x11f78b],_0x16e185,_0x25a2ff))[_0x56ef58(0x1ef)](Boolean);return Object[_0x56ef58(0x1c2)](_0xdb5897['body']['users'])[_0x56ef58(0x1ab)](_0x39532c=>{const _0x347fc1=_0x56ef58;this[_0x347fc1(0x1ee)]['addUser'](_0x39532c);}),_0x14f46d;}[_0x10dd51(0x1b8)](_0x3c7911){const _0x180999=_0x10dd51;return{'id':_0x3c7911['id'],'threadId':_0x3c7911['threadId'],'ref':_0x3c7911[_0x180999(0x1fc)]};}};f=Q([_(0x0,_0x2f4fe1(_0x181eb7)),_(0x1,_0x2f4fe1(_0x4945be)),_(0x2,_0x2f4fe1(_0xa13fb7)),_(0x3,_0x2f4fe1(_0x36f8f1))],f);var re=Object[_0x10dd51(0x1a0)],te=(_0x2e3938,_0x520446,_0x12145a,_0x4cface)=>{const _0x5dd3fc=_0x10dd51;for(var _0x27befd=_0x4cface>0x1?void 0x0:_0x4cface?re(_0x520446,_0x12145a):_0x520446,_0x226c48=_0x2e3938[_0x5dd3fc(0x1ba)]-0x1,_0x482e6a;_0x226c48>=0x0;_0x226c48--)(_0x482e6a=_0x2e3938[_0x226c48])&&(_0x27befd=_0x482e6a(_0x27befd)||_0x27befd);return _0x27befd;},N=(_0x17c323,_0x443b7d)=>(_0x10196c,_0x20f974)=>_0x443b7d(_0x10196c,_0x20f974,_0x17c323);let g=class extends _0x42963d{constructor(_0x331994,_0x1196dd){const _0x144bdd=_0x10dd51;super(),this['_threadCommentDataSourceService']=_0x331994,this['_threadCommentDataSource']=_0x1196dd,this[_0x144bdd(0x1e5)]();}['_initDataSource'](){const _0x4e0553=_0x10dd51;this[_0x4e0553(0x1a1)]['dataSource']=this[_0x4e0553(0x1e3)],this[_0x4e0553(0x1a1)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x2d29f0),N(0x1,_0x2f4fe1(f))],g);var se=Object[_0x10dd51(0x1e8)],oe=Object[_0x10dd51(0x1a0)],ne=(_0x543418,_0x21c9ac,_0x25fac4)=>_0x21c9ac in _0x543418?se(_0x543418,_0x21c9ac,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x25fac4}):_0x543418[_0x21c9ac]=_0x25fac4,ie=(_0x5f0bb1,_0x24b37f,_0x561555,_0xaba4b1)=>{const _0x2eb2a8=_0x10dd51;for(var _0x5d1f8a=_0xaba4b1>0x1?void 0x0:_0xaba4b1?oe(_0x24b37f,_0x561555):_0x24b37f,_0x1261f3=_0x5f0bb1[_0x2eb2a8(0x1ba)]-0x1,_0x550eaf;_0x1261f3>=0x0;_0x1261f3--)(_0x550eaf=_0x5f0bb1[_0x1261f3])&&(_0x5d1f8a=_0x550eaf(_0x5d1f8a)||_0x5d1f8a);return _0x5d1f8a;},w=(_0x118886,_0x4fd5f0)=>(_0x1518c9,_0x4e069a)=>_0x4fd5f0(_0x1518c9,_0x4e069a,_0x118886),$=(_0x5571b2,_0x275438,_0x113773)=>ne(_0x5571b2,typeof _0x275438!=_0x10dd51(0x1f1)?_0x275438+'':_0x275438,_0x113773);let b=class extends _0x424e35{constructor(_0x3ea8dd=M,_0x56b00e,_0x3fb8a7){const _0x1ced53=_0x10dd51;super(),this[_0x1ced53(0x1d8)]=_0x3ea8dd,this[_0x1ced53(0x1cb)]=_0x56b00e,this[_0x1ced53(0x1f6)]=_0x3fb8a7;const {..._0x4a2325}=_0x3c064f({},M,this[_0x1ced53(0x1d8)]);this[_0x1ced53(0x1f6)][_0x1ced53(0x1c7)](z,_0x4a2325);}[_0x10dd51(0x1c5)](){[[f],[g],[S]]['forEach'](_0x58b7fa=>{const _0x422f4e=_0x11cb;this[_0x422f4e(0x1cb)][_0x422f4e(0x1e0)](_0x58b7fa);});}['onReady'](){const _0x127c24=_0x10dd51;this[_0x127c24(0x1cb)][_0x127c24(0x1dc)](g),this[_0x127c24(0x1cb)]['get'](S);}};$(b,_0x10dd51(0x1af),W),$(b,_0x10dd51(0x1f9),_0x472341['UNIVER_UNKNOWN']),b=ie([_0x1c23a3(_0x589ee4,_0x349d8d,_0x46f06c),w(0x1,_0x2f4fe1(_0x36f8f1)),w(0x2,_0x18ac02)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x3f46f4=_0x43ef;(function(_0x257461,_0x23c47c){const _0x3621c8=_0x43ef,_0x42c4fd=_0x257461();while(!![]){try{const _0x29961c=-parseInt(_0x3621c8(0xc2))/0x1*(parseInt(_0x3621c8(0xf8))/0x2)+parseInt(_0x3621c8(0xb3))/0x3+-parseInt(_0x3621c8(0xb5))/0x4*(-parseInt(_0x3621c8(0xae))/0x5)+parseInt(_0x3621c8(0xd4))/0x6*(-parseInt(_0x3621c8(0xe3))/0x7)+parseInt(_0x3621c8(0xbf))/0x8+-parseInt(_0x3621c8(0xc7))/0x9+parseInt(_0x3621c8(0xe7))/0xa*(parseInt(_0x3621c8(0xb0))/0xb);if(_0x29961c===_0x23c47c)break;else _0x42c4fd['push'](_0x42c4fd['shift']());}catch(_0x433d00){_0x42c4fd['push'](_0x42c4fd['shift']());}}}(_0xf5b1,0x87ded));import{CommentService as _0x11e170,CollaborationSessionService as _0x4cd38e,UniverCollaborationClientPlugin as _0xf421b9}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x22ada7}from'@univerjs-pro/license';import{dayjs as _0x545eb3,UserManagerService as _0x5dff7a,Inject as _0x1e3f8f,Injector as _0x2f3235,Disposable as _0x161b8f,CustomRangeType as _0x396d46,UniverInstanceType as _0xe0e43a,DependentOn as _0x21b12e,IConfigService as _0x293df4,Plugin as _0x3fdb49,merge as _0xff6135}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x196607}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x32b180,IThreadCommentDataSourceService as _0x26e588}from'@univerjs/thread-comment';import{bufferTime as _0x517f82}from'rxjs';import{HTTPService as _0x267ec3}from'@univerjs/network';const W=_0x3f46f4(0xde);var I=(_0x50494d=>(_0x50494d[_0x50494d[_0x3f46f4(0xd0)]=0x0]='OpenOrReOpen',_0x50494d[_0x50494d[_0x3f46f4(0xd5)]=0x1]=_0x3f46f4(0xd5),_0x50494d[_0x50494d[_0x3f46f4(0x9e)]=-0x1]=_0x3f46f4(0x9e),_0x50494d))(I||{}),v=(_0x47cbf9=>(_0x47cbf9[_0x47cbf9[_0x3f46f4(0xbc)]=0x0]=_0x3f46f4(0xbc),_0x47cbf9[_0x47cbf9[_0x3f46f4(0xdd)]=0x1]=_0x3f46f4(0xdd),_0x47cbf9[_0x47cbf9['Reply']=0x2]=_0x3f46f4(0xf3),_0x47cbf9[_0x47cbf9[_0x3f46f4(0xc8)]=0x3]='Edit',_0x47cbf9[_0x47cbf9[_0x3f46f4(0xf6)]=0x4]=_0x3f46f4(0xf6),_0x47cbf9[_0x47cbf9['Solve']=0x5]=_0x3f46f4(0xc5),_0x47cbf9[_0x47cbf9['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x47cbf9))(v||{});const D=_0x443cbb=>_0x545eb3(new Date(+_0x443cbb))[_0x3f46f4(0x9c)](_0x3f46f4(0xf2)),B=async(_0x33143a,_0x2124cd)=>{const _0x1bc886=_0x3f46f4,_0x91bcc4=_0x33143a[_0x1bc886(0xb6)](_0x5dff7a),_0x18a19e=_0x33143a[_0x1bc886(0xb6)](_0x267ec3);_0x2124cd[_0x1bc886(0xfa)](_0x271c29=>{const _0x338be5=_0x1bc886;_0x91bcc4[_0x338be5(0xe8)](_0x271c29)&&_0x2124cd['delete'](_0x271c29);}),_0x2124cd[_0x1bc886(0xbb)]&&(await _0x18a19e[_0x1bc886(0xb6)](_0x1bc886(0xf4),{'params':{'userIDs':[..._0x2124cd]}}))['body']['users'][_0x1bc886(0xfa)](_0x40dcb5=>{const _0x4f48e0=_0x1bc886;_0x40dcb5&&_0x91bcc4[_0x4f48e0(0xef)](_0x40dcb5);});};var K=Object[_0x3f46f4(0xfc)],V=(_0x4e7606,_0x2e769e,_0x1b9f38,_0x54e2bc)=>{const _0x3240ad=_0x3f46f4;for(var _0x1edb70=_0x54e2bc>0x1?void 0x0:_0x54e2bc?K(_0x2e769e,_0x1b9f38):_0x2e769e,_0x54247d=_0x4e7606[_0x3240ad(0xdc)]-0x1,_0x3507ef;_0x54247d>=0x0;_0x54247d--)(_0x3507ef=_0x4e7606[_0x54247d])&&(_0x1edb70=_0x3507ef(_0x1edb70)||_0x1edb70);return _0x1edb70;},p=(_0xcbfd65,_0x1cafac)=>(_0x1f0a38,_0x27a032)=>_0x1cafac(_0x1f0a38,_0x27a032,_0xcbfd65);function _0x43ef(_0x5446a7,_0x20a84d){const _0xf5b1d1=_0xf5b1();return _0x43ef=function(_0x43ef8b,_0x2230f8){_0x43ef8b=_0x43ef8b-0x9b;let _0x30d8f7=_0xf5b1d1[_0x43ef8b];return _0x30d8f7;},_0x43ef(_0x5446a7,_0x20a84d);}let S=class extends _0x161b8f{constructor(_0x1a409b,_0x35c7b1,_0xac4fb,_0x163dd9){const _0x50a314=_0x3f46f4;super(),this['_commentService']=_0x1a409b,this[_0x50a314(0xfb)]=_0x35c7b1,this['_userService']=_0xac4fb,this[_0x50a314(0xf1)]=_0x163dd9,this[_0x50a314(0xac)](),this[_0x50a314(0xba)]();}[_0x3f46f4(0xba)](){const _0x2f56ca=_0x3f46f4;this[_0x2f56ca(0xaa)](this['_threadCommentModel'][_0x2f56ca(0xa7)][_0x2f56ca(0xaf)](_0x517f82(0x10))[_0x2f56ca(0xa4)](_0x6a4799=>{const _0x42a5c6=_0x2f56ca,_0x2dbccd=new Set();_0x6a4799[_0x42a5c6(0xfa)](_0x137d50=>{const _0x24ac14=_0x42a5c6;switch(_0x137d50[_0x24ac14(0xbd)]){case _0x24ac14(0xad):{const _0x50461a=_0x137d50[_0x24ac14(0xed)][_0x24ac14(0xc0)];_0x2dbccd[_0x24ac14(0xad)](_0x50461a);break;}}}),B(this[_0x42a5c6(0xf1)],_0x2dbccd);}));}[_0x3f46f4(0xac)](){const _0x1a28dc=_0x3f46f4;this[_0x1a28dc(0xaa)](this['_commentService'][_0x1a28dc(0xa7)]['subscribe'](async _0x181b23=>{const _0x1fabec=_0x1a28dc;var _0x322bcb,_0x11624f,_0x3daffe,_0x28bc77;const _0x42a56b=(_0x322bcb=this[_0x1fabec(0xfb)]['getUnit'](_0x181b23[_0x1fabec(0xea)])['find'](_0x1c1967=>_0x1c1967[_0x1fabec(0xb8)]===_0x181b23['threadId']))==null?void 0x0:_0x322bcb[_0x1fabec(0xc1)];if(!_0x42a56b)return;const {unitId:_0x38d1a8,subUnitId:_0x3e7f2e}=_0x42a56b;switch(_0x181b23[_0x1fabec(0xfe)]&&this[_0x1fabec(0xc6)][_0x1fabec(0xef)](_0x181b23[_0x1fabec(0xfe)]),_0x181b23[_0x1fabec(0xbd)]){case v[_0x1fabec(0xdd)]:break;case v[_0x1fabec(0xf3)]:{this[_0x1fabec(0xfb)][_0x1fabec(0xdb)](_0x38d1a8,_0x3e7f2e,{'unitId':_0x38d1a8,'subUnitId':_0x3e7f2e,'ref':'','id':_0x181b23[_0x1fabec(0xc4)],'dT':D(+_0x181b23['createTimestamp']),'threadId':_0x181b23[_0x1fabec(0xb8)],'personId':(_0x3daffe=(_0x11624f=_0x181b23[_0x1fabec(0xfe)])==null?void 0x0:_0x11624f[_0x1fabec(0xdf)])!=null?_0x3daffe:_0x181b23[_0x1fabec(0xcf)],'text':JSON[_0x1fabec(0xce)](_0x181b23[_0x1fabec(0xd3)]),'parentId':_0x42a56b['id']});break;}case v[_0x1fabec(0xf6)]:{const _0x4d2c00=this[_0x1fabec(0xfb)]['getComment'](_0x38d1a8,_0x3e7f2e,_0x181b23[_0x1fabec(0xc4)]);_0x4d2c00&&_0x4d2c00[_0x1fabec(0xc3)]&&this['_threadCommentModel']['deleteComment'](_0x38d1a8,_0x3e7f2e,_0x181b23[_0x1fabec(0xc4)]);break;}case v[_0x1fabec(0xc8)]:{this[_0x1fabec(0xfb)]['updateComment'](_0x38d1a8,_0x3e7f2e,{'commentId':_0x181b23[_0x1fabec(0xc4)],'text':JSON[_0x1fabec(0xce)](_0x181b23[_0x1fabec(0xd3)])});break;}case v['Solve']:{const _0x58b5a9=(_0x28bc77=this[_0x1fabec(0xfb)][_0x1fabec(0xb7)](_0x181b23[_0x1fabec(0xea)])['find'](_0x14cf37=>_0x14cf37[_0x1fabec(0xb8)]===_0x181b23[_0x1fabec(0xb8)]))==null?void 0x0:_0x28bc77['root'];_0x58b5a9&&this['_threadCommentModel']['resolveComment'](_0x38d1a8,_0x3e7f2e,_0x58b5a9['id'],_0x181b23[_0x1fabec(0x9d)]===I[_0x1fabec(0xd5)]);break;}}}));}};S=V([p(0x0,_0x1e3f8f(_0x11e170)),p(0x1,_0x1e3f8f(_0x32b180)),p(0x2,_0x1e3f8f(_0x5dff7a)),p(0x3,_0x1e3f8f(_0x2f3235))],S);const z=_0x3f46f4(0xb9),M={};var k=Object[_0x3f46f4(0xfc)],Q=(_0x3e1f0e,_0x5d99ce,_0x38890e,_0x242978)=>{const _0x20216b=_0x3f46f4;for(var _0x156b53=_0x242978>0x1?void 0x0:_0x242978?k(_0x5d99ce,_0x38890e):_0x5d99ce,_0x2ffe4a=_0x3e1f0e[_0x20216b(0xdc)]-0x1,_0x8b8a3b;_0x2ffe4a>=0x0;_0x2ffe4a--)(_0x8b8a3b=_0x3e1f0e[_0x2ffe4a])&&(_0x156b53=_0x8b8a3b(_0x156b53)||_0x156b53);return _0x156b53;},_=(_0x5c8104,_0xd928ed)=>(_0xe4a2a4,_0x20ce7b)=>_0xd928ed(_0xe4a2a4,_0x20ce7b,_0x5c8104);function X(_0x1918c,_0x4b8e1b){const _0x14979a=_0x3f46f4,_0x322908=_0x1918c['replies'][0x0];return{..._0x4b8e1b,'id':_0x322908[_0x14979a(0xc4)],'resolved':_0x1918c['solved']===0x1,'dT':D(_0x322908[_0x14979a(0xf9)]),'personId':_0x322908[_0x14979a(0xcf)],'threadId':_0x322908[_0x14979a(0xb8)]};}function ee(_0x29e162,_0x58d0e4,_0x58a3d4){const _0x259496=_0x3f46f4;var _0x4261aa,_0x313eb0;if(((_0x313eb0=(_0x4261aa=_0x29e162==null?void 0x0:_0x29e162['replies'])==null?void 0x0:_0x4261aa[_0x259496(0xdc)])!=null?_0x313eb0:0x0)>0x0){const _0x4c1165=(_0x45dc74,_0x343170)=>({'id':_0x45dc74[_0x259496(0xc4)],'threadId':_0x45dc74['threadId'],'dT':D(_0x45dc74['createTimestamp']),'personId':_0x45dc74['userId'],'resolved':_0x29e162[_0x259496(0x9d)]===I[_0x259496(0xd5)],'unitId':_0x58d0e4,'subUnitId':_0x58a3d4,'text':JSON[_0x259496(0xce)](_0x45dc74[_0x259496(0xd3)]),'parentId':_0x343170}),_0x31a9a7=_0x4c1165(_0x29e162[_0x259496(0xec)][0x0]);return{..._0x31a9a7,'children':_0x29e162['replies'][_0x259496(0xa8)](0x1)[_0x259496(0xeb)](_0x572877=>_0x4c1165(_0x572877,_0x31a9a7['id']))};}return null;}function _0xf5b1(){const _0x2d3517=['/edit','unitId','map','replies','payload','_threadCommentDataSource','addUser','/reply','_injector','YYYY/MM/DD\x20HH:mm','Reply','/universer-api/user/list','_configService','Delete','resolveComment','199022MlYQZz','createTimestamp','forEach','_threadCommentModel','getOwnPropertyDescriptor','users','user','code','format','solved','UNRECOGNIZED','/add','comments','COMMENT','/universer-api/comment/unit/','/solved','subscribe','syncUpdateMutationToColla','setConfig','commentUpdate$','slice','_threadCommentDataSourceService','disposeWithMe','getMemberID','_init','add','604085GBTZEi','pipe','16346RtQwHT','updateComment','resolved','474552ClnPOZ','symbol','4DojKee','get','getUnit','threadId','thread-comment-data-source.config','_initUserSync','size','Unknown','type','_initDataSource','6475536VQAIbW','personId','root','1yNvFPc','parentId','replyId','Solve','_userService','1587708rcJdvb','Edit','_sessionService','requireSession','/delete','reply','_config','parse','userId','OpenOrReOpen','pluginName','rangeId','content','430218jdWDoJ','Solved','stringify','filter','values','error','defineProperty','addComment','length','Add','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','userID','body','post','comment','63njSkDS','dataSource','_httpService','rangeType','2620slUuJq','getUser'];_0xf5b1=function(){return _0x2d3517;};return _0xf5b1();}let f=class{constructor(_0x1cddcf,_0x5ac749,_0x3c58d2,_0x444356){const _0x1a6c70=_0x3f46f4;this['_httpService']=_0x1cddcf,this[_0x1a6c70(0xc6)]=_0x5ac749,this[_0x1a6c70(0xc9)]=_0x3c58d2,this[_0x1a6c70(0xf1)]=_0x444356;}async['addComment'](_0x4eda24){const _0x366a83=_0x3f46f4;var _0x400dc7,_0x2608f1;const {parentId:_0x548c31,unitId:_0x37733d,text:_0x266740,threadId:_0x10d27e}=_0x4eda24,_0x4f2370=(_0x2608f1=(_0x400dc7=_0x266740['customRanges'])==null?void 0x0:_0x400dc7[_0x366a83(0xd7)](_0x4aee06=>_0x4aee06[_0x366a83(0xe6)]===_0x396d46['COMMENT'])[_0x366a83(0xeb)](_0x269f59=>_0x269f59[_0x366a83(0xd2)]))!=null?_0x2608f1:[],_0x194f37=JSON['stringify'](_0x266740),_0x5b4e7c=(await this[_0x366a83(0xc9)][_0x366a83(0xca)](_0x37733d))[_0x366a83(0xab)]();if(_0x548c31){const _0x35bd37={'memberId':_0x5b4e7c,'unitId':_0x37733d,'content':_0x194f37,'mention':_0x4f2370,'threadId':_0x10d27e},_0x539197=(await this[_0x366a83(0xe5)]['post']('/universer-api/comment/unit/'+_0x37733d+_0x366a83(0xf0),{'body':_0x35bd37}))['body'][_0x366a83(0xcc)];return{..._0x4eda24,'id':_0x539197[_0x366a83(0xc4)],'dT':_0x545eb3(+_0x539197[_0x366a83(0xf9)])[_0x366a83(0x9c)](_0x366a83(0xf2)),'personId':_0x539197[_0x366a83(0xcf)]};}else{const _0x44e77a={'memberId':_0x5b4e7c,'unitId':_0x37733d,'content':_0x194f37,'mention':_0x4f2370},_0x49d4ae=await this[_0x366a83(0xe5)][_0x366a83(0xe1)](_0x366a83(0xa2)+_0x37733d+_0x366a83(0x9f),{'body':_0x44e77a});return X(_0x49d4ae[_0x366a83(0xe0)][_0x366a83(0xe2)],_0x4eda24);}}async[_0x3f46f4(0xb1)](_0x4aaa17){const _0x991ab9=_0x3f46f4;var _0x467278,_0x10c58d;const {text:_0x291750,unitId:_0x4ae034}=_0x4aaa17,_0x2b3a74=(_0x10c58d=(_0x467278=_0x291750['customRanges'])==null?void 0x0:_0x467278[_0x991ab9(0xd7)](_0x4f0c91=>_0x4f0c91['rangeType']===_0x396d46[_0x991ab9(0xa1)])['map'](_0x362cfa=>_0x362cfa['rangeId']))!=null?_0x10c58d:[],_0x397aa1=JSON[_0x991ab9(0xd6)](_0x291750),_0x27b4e4=_0x4aaa17[_0x991ab9(0xb8)],_0x5b8fd5=_0x4aaa17['id'],_0x205ef0={'memberId':(await this[_0x991ab9(0xc9)][_0x991ab9(0xca)](_0x4ae034))[_0x991ab9(0xab)](),'unitId':_0x4ae034,'threadId':_0x27b4e4,'mention':_0x2b3a74,'content':_0x397aa1,'replyId':_0x5b8fd5},_0x2a6977=await this[_0x991ab9(0xe5)]['post'](_0x991ab9(0xa2)+_0x4ae034+_0x991ab9(0xe9),{'body':_0x205ef0});return!_0x2a6977[_0x991ab9(0xe0)][_0x991ab9(0xd9)]||_0x2a6977[_0x991ab9(0xe0)][_0x991ab9(0xd9)][_0x991ab9(0x9b)]===0x1;}async[_0x3f46f4(0xf7)](_0x37b948){const _0x4f5a6b=_0x3f46f4,{unitId:_0x1aabbe}=_0x37b948,_0x15205a=_0x37b948[_0x4f5a6b(0xb8)],_0x3d569a={'memberId':this[_0x4f5a6b(0xc6)]['getCurrentUser']()[_0x4f5a6b(0xdf)],'unitId':_0x1aabbe,'threadId':_0x15205a,'solved':_0x37b948[_0x4f5a6b(0xb2)]?I[_0x4f5a6b(0xd5)]:I[_0x4f5a6b(0xd0)]},_0x20c6bc=await this['_httpService'][_0x4f5a6b(0xe1)](_0x4f5a6b(0xa2)+_0x1aabbe+_0x4f5a6b(0xa3),{'body':_0x3d569a});return!_0x20c6bc[_0x4f5a6b(0xe0)][_0x4f5a6b(0xd9)]||_0x20c6bc[_0x4f5a6b(0xe0)][_0x4f5a6b(0xd9)][_0x4f5a6b(0x9b)]===0x1;}async['deleteComment'](_0x4f5ad4,_0x5062bc,_0x310e1d,_0x4b3ab2){const _0x4a19f0=_0x3f46f4,_0x3f91a8={'memberId':(await this[_0x4a19f0(0xc9)][_0x4a19f0(0xca)](_0x4f5ad4))[_0x4a19f0(0xab)](),'threadId':_0x310e1d,'replyId':_0x4b3ab2,'unitId':_0x4f5ad4},_0x44e7e0=await this['_httpService']['post'](_0x4a19f0(0xa2)+_0x4f5ad4+_0x4a19f0(0xcb),{'body':_0x3f91a8});return!_0x44e7e0['body']['error']||_0x44e7e0[_0x4a19f0(0xe0)][_0x4a19f0(0xd9)]['code']===0x1;}async['listComments'](_0x2a9555,_0x7f1c78,_0x551c74){const _0x48f84f=_0x3f46f4,_0x326454={'unitId':_0x2a9555,'threadId':_0x551c74},_0x7ee0dc=await this[_0x48f84f(0xe5)]['post']('/universer-api/comment/unit/'+_0x2a9555+'/list',{'body':_0x326454}),_0x497d27=_0x551c74[_0x48f84f(0xeb)](_0x4f52fe=>ee(_0x7ee0dc['body'][_0x48f84f(0xa0)][_0x4f52fe],_0x2a9555,_0x7f1c78))[_0x48f84f(0xd7)](Boolean);return Object[_0x48f84f(0xd8)](_0x7ee0dc['body'][_0x48f84f(0xfd)])[_0x48f84f(0xfa)](_0xd5c1ec=>{const _0x4eb5c9=_0x48f84f;this[_0x4eb5c9(0xc6)]['addUser'](_0xd5c1ec);}),_0x497d27;}['saveCommentToSnapshot'](_0x25b46d){const _0x5660e0=_0x3f46f4;return{'id':_0x25b46d['id'],'threadId':_0x25b46d[_0x5660e0(0xb8)],'ref':_0x25b46d['ref']};}};f=Q([_(0x0,_0x1e3f8f(_0x267ec3)),_(0x1,_0x1e3f8f(_0x5dff7a)),_(0x2,_0x1e3f8f(_0x4cd38e)),_(0x3,_0x1e3f8f(_0x2f3235))],f);var re=Object[_0x3f46f4(0xfc)],te=(_0x422a50,_0x204a4c,_0x3eb1f,_0x4f5c24)=>{const _0x241e3f=_0x3f46f4;for(var _0x20ea41=_0x4f5c24>0x1?void 0x0:_0x4f5c24?re(_0x204a4c,_0x3eb1f):_0x204a4c,_0x52868e=_0x422a50[_0x241e3f(0xdc)]-0x1,_0x309664;_0x52868e>=0x0;_0x52868e--)(_0x309664=_0x422a50[_0x52868e])&&(_0x20ea41=_0x309664(_0x20ea41)||_0x20ea41);return _0x20ea41;},N=(_0x21da7b,_0x43e304)=>(_0x52d743,_0xbdc6bb)=>_0x43e304(_0x52d743,_0xbdc6bb,_0x21da7b);let g=class extends _0x161b8f{constructor(_0x10504f,_0x30017c){const _0x2ae5be=_0x3f46f4;super(),this['_threadCommentDataSourceService']=_0x10504f,this[_0x2ae5be(0xee)]=_0x30017c,this[_0x2ae5be(0xbe)]();}['_initDataSource'](){const _0x10899a=_0x3f46f4;this['_threadCommentDataSourceService'][_0x10899a(0xe4)]=this[_0x10899a(0xee)],this[_0x10899a(0xa9)][_0x10899a(0xa5)]=!0x1;}};g=te([N(0x0,_0x26e588),N(0x1,_0x1e3f8f(f))],g);var se=Object[_0x3f46f4(0xda)],oe=Object[_0x3f46f4(0xfc)],ne=(_0x239c9c,_0x4483d7,_0x3efb5a)=>_0x4483d7 in _0x239c9c?se(_0x239c9c,_0x4483d7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3efb5a}):_0x239c9c[_0x4483d7]=_0x3efb5a,ie=(_0x5cf66c,_0x26b4d5,_0x11bccb,_0x538de6)=>{const _0xb7f3b0=_0x3f46f4;for(var _0x3038e3=_0x538de6>0x1?void 0x0:_0x538de6?oe(_0x26b4d5,_0x11bccb):_0x26b4d5,_0x41732e=_0x5cf66c[_0xb7f3b0(0xdc)]-0x1,_0x371806;_0x41732e>=0x0;_0x41732e--)(_0x371806=_0x5cf66c[_0x41732e])&&(_0x3038e3=_0x371806(_0x3038e3)||_0x3038e3);return _0x3038e3;},w=(_0x22ed5d,_0x5a5f7f)=>(_0x42bf15,_0x54a908)=>_0x5a5f7f(_0x42bf15,_0x54a908,_0x22ed5d),$=(_0xc71f46,_0x5183e8,_0x353f70)=>ne(_0xc71f46,typeof _0x5183e8!=_0x3f46f4(0xb4)?_0x5183e8+'':_0x5183e8,_0x353f70);let b=class extends _0x3fdb49{constructor(_0x5b1110=M,_0x27fd76,_0x4b0c38){const _0x1889cc=_0x3f46f4;super(),this['_config']=_0x5b1110,this[_0x1889cc(0xf1)]=_0x27fd76,this[_0x1889cc(0xf5)]=_0x4b0c38;const {..._0x388edc}=_0xff6135({},M,this[_0x1889cc(0xcd)]);this[_0x1889cc(0xf5)][_0x1889cc(0xa6)](z,_0x388edc);}['onStarting'](){const _0x427cc9=_0x3f46f4;[[f],[g],[S]][_0x427cc9(0xfa)](_0x1df5b2=>{const _0x351be2=_0x427cc9;this[_0x351be2(0xf1)][_0x351be2(0xad)](_0x1df5b2);});}['onReady'](){const _0x528871=_0x3f46f4;this[_0x528871(0xf1)]['get'](g),this['_injector']['get'](S);}};$(b,_0x3f46f4(0xd1),W),$(b,'type',_0xe0e43a['UNIVER_UNKNOWN']),b=ie([_0x21b12e(_0x196607,_0xf421b9,_0x22ada7),w(0x1,_0x1e3f8f(_0x2f3235)),w(0x2,_0x293df4)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x5c75(_0x219229,_0x2b1b81){const _0x10a129=_0x10a1();return _0x5c75=function(_0x5c75ef,_0x2cc3b0){_0x5c75ef=_0x5c75ef-0x19f;let _0x3cc356=_0x10a129[_0x5c75ef];return _0x3cc356;},_0x5c75(_0x219229,_0x2b1b81);}function _0x10a1(){const _0x16a63f=['getMemberID','OpenOrReOpen','commentUpdate$','_threadCommentDataSource','merge','solved','ref','length','object','Plugin','@univerjs/network','417MWejeF','function','type','UniverThreadCommentDataSourcePlugin','8gVlLaF','Disposable','getCurrentUser','payload','find','dayjs','forEach','/universer-api/user/list','UniverThreadCommentUi','_initUserSync','pluginName','defineProperty','/add','getUnit','Reply','/edit','Inject','UniverThreadComment','UniverProCollaborationClient','6pakJzQ','IThreadCommentDataSourceService','syncUpdateMutationToColla','Unknown','605547wtCYUS','UniverCollaborationClientPlugin','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','userID','2756411ZVkioK','Solve','_userService','replyId','rxjs','map','user','@univerjs/thread-comment','Injector','rangeType','IConfigService','COMMENT','_injector','personId','toStringTag','threadId','_config','/list','pipe','2079004ZrVjvO','dataSource','461884dKUVuD','YYYY/MM/DD\x20HH:mm','_threadCommentDataSourceService','replies','_configService','parse','code','delete','@univerjs/core','rangeId','error','2341695EAhgDy','_sessionService','symbol','3493260LUVDht','slice','UserManagerService','Add','@univerjs-pro/license','UniverCore','CustomRangeType','@univerjs/thread-comment-ui','parentId','createTimestamp','disposeWithMe','stringify','/delete','addUser','exports','/universer-api/comment/unit/','root','UNRECOGNIZED','_commentService','Module','add','post','reply','updateComment','deleteComment','customRanges','UniverInstanceType','CollaborationSessionService','UniverThreadCommentUIPlugin','body','unitId','users','amd','filter','resolveComment','userId','7838xSsPPV','ThreadCommentModel','_init','UniverProLicense','HTTPService','Solved','_initDataSource','_httpService','format','resolved','CommentService','get','Edit','requireSession','bufferTime','_threadCommentModel','content','@univerjs-pro/collaboration-client','subscribe','getOwnPropertyDescriptor'];_0x10a1=function(){return _0x16a63f;};return _0x10a1();}(function(_0x47c7c7,_0xebcf1e){const _0x3d6ef3=_0x5c75,_0x3e9716=_0x47c7c7();while(!![]){try{const _0x4929f3=parseInt(_0x3d6ef3(0x1fe))/0x1+parseInt(_0x3d6ef3(0x1ab))/0x2*(parseInt(_0x3d6ef3(0x1ca))/0x3)+-parseInt(_0x3d6ef3(0x1fc))/0x4+parseInt(_0x3d6ef3(0x209))/0x5+-parseInt(_0x3d6ef3(0x1e1))/0x6*(parseInt(_0x3d6ef3(0x1e9))/0x7)+parseInt(_0x3d6ef3(0x1ce))/0x8*(parseInt(_0x3d6ef3(0x1e5))/0x9)+-parseInt(_0x3d6ef3(0x20c))/0xa;if(_0x4929f3===_0xebcf1e)break;else _0x3e9716['push'](_0x3e9716['shift']());}catch(_0x14d74a){_0x3e9716['push'](_0x3e9716['shift']());}}}(_0x10a1,0x44365),function(_0x3ef09c,_0xe4a7b6){const _0x15fc46=_0x5c75;typeof exports==_0x15fc46(0x1c7)&&typeof module<'u'?_0xe4a7b6(exports,require(_0x15fc46(0x1bc)),require(_0x15fc46(0x210)),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require(_0x15fc46(0x1f0)),require(_0x15fc46(0x1ed)),require(_0x15fc46(0x1c9))):typeof define==_0x15fc46(0x1cb)&&define[_0x15fc46(0x1a7)]?define([_0x15fc46(0x21a),_0x15fc46(0x1bc),_0x15fc46(0x210),_0x15fc46(0x206),_0x15fc46(0x213),'@univerjs/thread-comment',_0x15fc46(0x1ed),_0x15fc46(0x1c9)],_0xe4a7b6):(_0x3ef09c=typeof globalThis<'u'?globalThis:_0x3ef09c||self,_0xe4a7b6(_0x3ef09c['UniverProThreadCommentDatasource']={},_0x3ef09c[_0x15fc46(0x1e0)],_0x3ef09c[_0x15fc46(0x1ae)],_0x3ef09c[_0x15fc46(0x211)],_0x3ef09c[_0x15fc46(0x1d6)],_0x3ef09c[_0x15fc46(0x1df)],_0x3ef09c['rxjs'],_0x3ef09c['UniverNetwork']));}(this,function(_0x449b61,_0x2ae46c,_0x34d216,_0x233f6d,_0x245617,_0x5c253f,_0x261f9e,_0x76628e){'use strict';const _0x3bdc4b=_0x5c75;const _0x1ec23e=_0x3bdc4b(0x1e7);var _0x48e63d=(_0x422c71=>(_0x422c71[_0x422c71[_0x3bdc4b(0x1c0)]=0x0]=_0x3bdc4b(0x1c0),_0x422c71[_0x422c71[_0x3bdc4b(0x1b0)]=0x1]=_0x3bdc4b(0x1b0),_0x422c71[_0x422c71['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x422c71))(_0x48e63d||{}),_0x5f30a4=(_0xb280d6=>(_0xb280d6[_0xb280d6['Unknown']=0x0]=_0x3bdc4b(0x1e4),_0xb280d6[_0xb280d6[_0x3bdc4b(0x20f)]=0x1]=_0x3bdc4b(0x20f),_0xb280d6[_0xb280d6['Reply']=0x2]=_0x3bdc4b(0x1dc),_0xb280d6[_0xb280d6[_0x3bdc4b(0x1b7)]=0x3]=_0x3bdc4b(0x1b7),_0xb280d6[_0xb280d6['Delete']=0x4]='Delete',_0xb280d6[_0xb280d6[_0x3bdc4b(0x1ea)]=0x5]='Solve',_0xb280d6[_0xb280d6['UNRECOGNIZED']=-0x1]=_0x3bdc4b(0x21d),_0xb280d6))(_0x5f30a4||{});const _0x39ca27=_0x2645df=>_0x233f6d[_0x3bdc4b(0x1d3)](new Date(+_0x2645df))['format']('YYYY/MM/DD\x20HH:mm'),_0x1cb772=async(_0x5c6b23,_0x493d98)=>{const _0x189540=_0x3bdc4b,_0x56fc79=_0x5c6b23['get'](_0x233f6d['UserManagerService']),_0x140944=_0x5c6b23[_0x189540(0x1b6)](_0x76628e[_0x189540(0x1af)]);_0x493d98['forEach'](_0x51ddbc=>{const _0x1fc219=_0x189540;_0x56fc79['getUser'](_0x51ddbc)&&_0x493d98[_0x1fc219(0x205)](_0x51ddbc);}),_0x493d98['size']&&(await _0x140944[_0x189540(0x1b6)](_0x189540(0x1d5),{'params':{'userIDs':[..._0x493d98]}}))['body']['users'][_0x189540(0x1d4)](_0x4503a1=>{const _0x404eb9=_0x189540;_0x4503a1&&_0x56fc79[_0x404eb9(0x219)](_0x4503a1);});};var _0x2c781c=Object['getOwnPropertyDescriptor'],_0x844576=(_0x41bce1,_0x37f796,_0x2a166e,_0x462299)=>{const _0x5256b5=_0x3bdc4b;for(var _0x15651a=_0x462299>0x1?void 0x0:_0x462299?_0x2c781c(_0x37f796,_0x2a166e):_0x37f796,_0x2ab43d=_0x41bce1[_0x5256b5(0x1c6)]-0x1,_0x1c6730;_0x2ab43d>=0x0;_0x2ab43d--)(_0x1c6730=_0x41bce1[_0x2ab43d])&&(_0x15651a=_0x1c6730(_0x15651a)||_0x15651a);return _0x15651a;},_0x59b3e7=(_0x2c9c8b,_0x2ed191)=>(_0x3f4d1a,_0x3cb388)=>_0x2ed191(_0x3f4d1a,_0x3cb388,_0x2c9c8b);let _0x52dfe1=class extends _0x233f6d[_0x3bdc4b(0x1cf)]{constructor(_0xddeaec,_0x5d2ce2,_0xbbb86e,_0x2332c9){const _0x28b4c7=_0x3bdc4b;super(),this[_0x28b4c7(0x21e)]=_0xddeaec,this[_0x28b4c7(0x1ba)]=_0x5d2ce2,this[_0x28b4c7(0x1eb)]=_0xbbb86e,this[_0x28b4c7(0x1f5)]=_0x2332c9,this[_0x28b4c7(0x1ad)](),this[_0x28b4c7(0x1d7)]();}[_0x3bdc4b(0x1d7)](){const _0x330f5b=_0x3bdc4b;this['disposeWithMe'](this['_threadCommentModel'][_0x330f5b(0x1c1)][_0x330f5b(0x1fb)](_0x261f9e[_0x330f5b(0x1b9)](0x10))['subscribe'](_0x31ebc8=>{const _0x394299=_0x330f5b,_0xd03763=new Set();_0x31ebc8['forEach'](_0x5e5bbf=>{const _0x34831e=_0x5c75;switch(_0x5e5bbf[_0x34831e(0x1cc)]){case _0x34831e(0x220):{const _0x21cada=_0x5e5bbf[_0x34831e(0x1d1)][_0x34831e(0x1f6)];_0xd03763[_0x34831e(0x220)](_0x21cada);break;}}}),_0x1cb772(this[_0x394299(0x1f5)],_0xd03763);}));}[_0x3bdc4b(0x1ad)](){const _0x19b3bb=_0x3bdc4b;this[_0x19b3bb(0x216)](this[_0x19b3bb(0x21e)][_0x19b3bb(0x1c1)][_0x19b3bb(0x1bd)](async _0x1b1e11=>{const _0x16857=_0x19b3bb;var _0x52fafe,_0xa3a642,_0x24fbc8,_0x3087a2;const _0x45490a=(_0x52fafe=this[_0x16857(0x1ba)][_0x16857(0x1db)](_0x1b1e11[_0x16857(0x1a5)])[_0x16857(0x1d2)](_0x55bfe3=>_0x55bfe3[_0x16857(0x1f8)]===_0x1b1e11['threadId']))==null?void 0x0:_0x52fafe['root'];if(!_0x45490a)return;const {unitId:_0x4f04c2,subUnitId:_0xa709df}=_0x45490a;switch(_0x1b1e11['user']&&this['_userService']['addUser'](_0x1b1e11[_0x16857(0x1ef)]),_0x1b1e11['type']){case _0x5f30a4['Add']:break;case _0x5f30a4[_0x16857(0x1dc)]:{this[_0x16857(0x1ba)]['addComment'](_0x4f04c2,_0xa709df,{'unitId':_0x4f04c2,'subUnitId':_0xa709df,'ref':'','id':_0x1b1e11[_0x16857(0x1ec)],'dT':_0x39ca27(+_0x1b1e11[_0x16857(0x215)]),'threadId':_0x1b1e11[_0x16857(0x1f8)],'personId':(_0x24fbc8=(_0xa3a642=_0x1b1e11[_0x16857(0x1ef)])==null?void 0x0:_0xa3a642[_0x16857(0x1e8)])!=null?_0x24fbc8:_0x1b1e11[_0x16857(0x1aa)],'text':JSON[_0x16857(0x203)](_0x1b1e11['content']),'parentId':_0x45490a['id']});break;}case _0x5f30a4['Delete']:{const _0x2e0f2f=this['_threadCommentModel']['getComment'](_0x4f04c2,_0xa709df,_0x1b1e11['replyId']);_0x2e0f2f&&_0x2e0f2f[_0x16857(0x214)]&&this['_threadCommentModel']['deleteComment'](_0x4f04c2,_0xa709df,_0x1b1e11[_0x16857(0x1ec)]);break;}case _0x5f30a4['Edit']:{this[_0x16857(0x1ba)]['updateComment'](_0x4f04c2,_0xa709df,{'commentId':_0x1b1e11[_0x16857(0x1ec)],'text':JSON[_0x16857(0x203)](_0x1b1e11['content'])});break;}case _0x5f30a4['Solve']:{const _0x3a28f8=(_0x3087a2=this[_0x16857(0x1ba)]['getUnit'](_0x1b1e11[_0x16857(0x1a5)])[_0x16857(0x1d2)](_0x10c729=>_0x10c729[_0x16857(0x1f8)]===_0x1b1e11[_0x16857(0x1f8)]))==null?void 0x0:_0x3087a2[_0x16857(0x21c)];_0x3a28f8&&this[_0x16857(0x1ba)][_0x16857(0x1a9)](_0x4f04c2,_0xa709df,_0x3a28f8['id'],_0x1b1e11[_0x16857(0x1c4)]===_0x48e63d[_0x16857(0x1b0)]);break;}}}));}};_0x52dfe1=_0x844576([_0x59b3e7(0x0,_0x233f6d[_0x3bdc4b(0x1de)](_0x2ae46c[_0x3bdc4b(0x1b5)])),_0x59b3e7(0x1,_0x233f6d[_0x3bdc4b(0x1de)](_0x5c253f[_0x3bdc4b(0x1ac)])),_0x59b3e7(0x2,_0x233f6d[_0x3bdc4b(0x1de)](_0x233f6d['UserManagerService'])),_0x59b3e7(0x3,_0x233f6d[_0x3bdc4b(0x1de)](_0x233f6d[_0x3bdc4b(0x1f1)]))],_0x52dfe1);const _0x582ece='thread-comment-data-source.config',_0x4532a2={};var _0x5516ec=Object[_0x3bdc4b(0x1be)],_0x438f33=(_0x3a28c6,_0x46a3a1,_0x299df7,_0x393473)=>{const _0x322794=_0x3bdc4b;for(var _0x4840ba=_0x393473>0x1?void 0x0:_0x393473?_0x5516ec(_0x46a3a1,_0x299df7):_0x46a3a1,_0x2b70d3=_0x3a28c6[_0x322794(0x1c6)]-0x1,_0x249f57;_0x2b70d3>=0x0;_0x2b70d3--)(_0x249f57=_0x3a28c6[_0x2b70d3])&&(_0x4840ba=_0x249f57(_0x4840ba)||_0x4840ba);return _0x4840ba;},_0x3427ac=(_0x7139e9,_0xb2d530)=>(_0x567280,_0x232be6)=>_0xb2d530(_0x567280,_0x232be6,_0x7139e9);function _0x1e92e5(_0x3110fb,_0xd0b475){const _0x29f6ea=_0x3bdc4b,_0x25a780=_0x3110fb[_0x29f6ea(0x201)][0x0];return{..._0xd0b475,'id':_0x25a780[_0x29f6ea(0x1ec)],'resolved':_0x3110fb[_0x29f6ea(0x1c4)]===0x1,'dT':_0x39ca27(_0x25a780[_0x29f6ea(0x215)]),'personId':_0x25a780[_0x29f6ea(0x1aa)],'threadId':_0x25a780['threadId']};}function _0x27ca2e(_0x5879f0,_0xffb3dc,_0x3f20df){const _0x2653d8=_0x3bdc4b;var _0x386201,_0x2ff588;if(((_0x2ff588=(_0x386201=_0x5879f0==null?void 0x0:_0x5879f0[_0x2653d8(0x201)])==null?void 0x0:_0x386201[_0x2653d8(0x1c6)])!=null?_0x2ff588:0x0)>0x0){const _0x3bb48b=(_0x8ed368,_0x434bd7)=>({'id':_0x8ed368[_0x2653d8(0x1ec)],'threadId':_0x8ed368[_0x2653d8(0x1f8)],'dT':_0x39ca27(_0x8ed368['createTimestamp']),'personId':_0x8ed368[_0x2653d8(0x1aa)],'resolved':_0x5879f0[_0x2653d8(0x1c4)]===_0x48e63d[_0x2653d8(0x1b0)],'unitId':_0xffb3dc,'subUnitId':_0x3f20df,'text':JSON['parse'](_0x8ed368[_0x2653d8(0x1bb)]),'parentId':_0x434bd7}),_0x5e00fe=_0x3bb48b(_0x5879f0['replies'][0x0]);return{..._0x5e00fe,'children':_0x5879f0[_0x2653d8(0x201)][_0x2653d8(0x20d)](0x1)['map'](_0x390b9d=>_0x3bb48b(_0x390b9d,_0x5e00fe['id']))};}return null;}let _0x164e30=class{constructor(_0x266935,_0x5c7749,_0x29e277,_0x405ec){const _0x26e6be=_0x3bdc4b;this[_0x26e6be(0x1b2)]=_0x266935,this[_0x26e6be(0x1eb)]=_0x5c7749,this['_sessionService']=_0x29e277,this[_0x26e6be(0x1f5)]=_0x405ec;}async['addComment'](_0x20f571){const _0xe39d7d=_0x3bdc4b;var _0x37305d,_0x1f01dc;const {parentId:_0x545b28,unitId:_0x195ae2,text:_0x48bed1,threadId:_0xa49575}=_0x20f571,_0x4abb16=(_0x1f01dc=(_0x37305d=_0x48bed1[_0xe39d7d(0x1a0)])==null?void 0x0:_0x37305d[_0xe39d7d(0x1a8)](_0x463412=>_0x463412['rangeType']===_0x233f6d[_0xe39d7d(0x212)][_0xe39d7d(0x1f4)])[_0xe39d7d(0x1ee)](_0x29d015=>_0x29d015['rangeId']))!=null?_0x1f01dc:[],_0xe37acb=JSON[_0xe39d7d(0x217)](_0x48bed1),_0x3111e3=(await this['_sessionService']['requireSession'](_0x195ae2))[_0xe39d7d(0x1bf)]();if(_0x545b28){const _0x62f844={'memberId':_0x3111e3,'unitId':_0x195ae2,'content':_0xe37acb,'mention':_0x4abb16,'threadId':_0xa49575},_0x1dbfdb=(await this['_httpService'][_0xe39d7d(0x221)](_0xe39d7d(0x21b)+_0x195ae2+'/reply',{'body':_0x62f844}))[_0xe39d7d(0x1a4)][_0xe39d7d(0x222)];return{..._0x20f571,'id':_0x1dbfdb[_0xe39d7d(0x1ec)],'dT':_0x233f6d[_0xe39d7d(0x1d3)](+_0x1dbfdb[_0xe39d7d(0x215)])[_0xe39d7d(0x1b3)](_0xe39d7d(0x1ff)),'personId':_0x1dbfdb[_0xe39d7d(0x1aa)]};}else{const _0x391b7c={'memberId':_0x3111e3,'unitId':_0x195ae2,'content':_0xe37acb,'mention':_0x4abb16},_0x33a058=await this['_httpService'][_0xe39d7d(0x221)](_0xe39d7d(0x21b)+_0x195ae2+_0xe39d7d(0x1da),{'body':_0x391b7c});return _0x1e92e5(_0x33a058[_0xe39d7d(0x1a4)]['comment'],_0x20f571);}}async[_0x3bdc4b(0x223)](_0x7b6af8){const _0x595c7f=_0x3bdc4b;var _0x473614,_0x5f0ea7;const {text:_0x2a86c1,unitId:_0x268798}=_0x7b6af8,_0x56f439=(_0x5f0ea7=(_0x473614=_0x2a86c1[_0x595c7f(0x1a0)])==null?void 0x0:_0x473614['filter'](_0x721ef8=>_0x721ef8[_0x595c7f(0x1f2)]===_0x233f6d[_0x595c7f(0x212)][_0x595c7f(0x1f4)])[_0x595c7f(0x1ee)](_0x276850=>_0x276850[_0x595c7f(0x207)]))!=null?_0x5f0ea7:[],_0x100332=JSON[_0x595c7f(0x217)](_0x2a86c1),_0x2328ba=_0x7b6af8[_0x595c7f(0x1f8)],_0x12b861=_0x7b6af8['id'],_0x2199c7={'memberId':(await this[_0x595c7f(0x20a)][_0x595c7f(0x1b8)](_0x268798))[_0x595c7f(0x1bf)](),'unitId':_0x268798,'threadId':_0x2328ba,'mention':_0x56f439,'content':_0x100332,'replyId':_0x12b861},_0x143602=await this[_0x595c7f(0x1b2)][_0x595c7f(0x221)](_0x595c7f(0x21b)+_0x268798+_0x595c7f(0x1dd),{'body':_0x2199c7});return!_0x143602[_0x595c7f(0x1a4)][_0x595c7f(0x208)]||_0x143602[_0x595c7f(0x1a4)][_0x595c7f(0x208)][_0x595c7f(0x204)]===0x1;}async[_0x3bdc4b(0x1a9)](_0x2f0e52){const _0x3e3232=_0x3bdc4b,{unitId:_0x30caa5}=_0x2f0e52,_0x3b77e1=_0x2f0e52[_0x3e3232(0x1f8)],_0xb35993={'memberId':this[_0x3e3232(0x1eb)][_0x3e3232(0x1d0)]()[_0x3e3232(0x1e8)],'unitId':_0x30caa5,'threadId':_0x3b77e1,'solved':_0x2f0e52[_0x3e3232(0x1b4)]?_0x48e63d[_0x3e3232(0x1b0)]:_0x48e63d[_0x3e3232(0x1c0)]},_0x874aed=await this['_httpService'][_0x3e3232(0x221)](_0x3e3232(0x21b)+_0x30caa5+'/solved',{'body':_0xb35993});return!_0x874aed[_0x3e3232(0x1a4)]['error']||_0x874aed[_0x3e3232(0x1a4)][_0x3e3232(0x208)][_0x3e3232(0x204)]===0x1;}async[_0x3bdc4b(0x19f)](_0xe40e49,_0x2621a3,_0x5d6b1b,_0xb7a700){const _0x3d14d3=_0x3bdc4b,_0x3c54c7={'memberId':(await this[_0x3d14d3(0x20a)][_0x3d14d3(0x1b8)](_0xe40e49))[_0x3d14d3(0x1bf)](),'threadId':_0x5d6b1b,'replyId':_0xb7a700,'unitId':_0xe40e49},_0x2bcce8=await this[_0x3d14d3(0x1b2)][_0x3d14d3(0x221)](_0x3d14d3(0x21b)+_0xe40e49+_0x3d14d3(0x218),{'body':_0x3c54c7});return!_0x2bcce8['body'][_0x3d14d3(0x208)]||_0x2bcce8[_0x3d14d3(0x1a4)][_0x3d14d3(0x208)][_0x3d14d3(0x204)]===0x1;}async['listComments'](_0x6c3c36,_0x56f1e8,_0x8df4ab){const _0x1d3aba=_0x3bdc4b,_0x31bba5={'unitId':_0x6c3c36,'threadId':_0x8df4ab},_0x58a41b=await this['_httpService'][_0x1d3aba(0x221)]('/universer-api/comment/unit/'+_0x6c3c36+_0x1d3aba(0x1fa),{'body':_0x31bba5}),_0x24634d=_0x8df4ab[_0x1d3aba(0x1ee)](_0x517b20=>_0x27ca2e(_0x58a41b[_0x1d3aba(0x1a4)]['comments'][_0x517b20],_0x6c3c36,_0x56f1e8))[_0x1d3aba(0x1a8)](Boolean);return Object['values'](_0x58a41b[_0x1d3aba(0x1a4)][_0x1d3aba(0x1a6)])[_0x1d3aba(0x1d4)](_0x3740f0=>{const _0x5582df=_0x1d3aba;this[_0x5582df(0x1eb)][_0x5582df(0x219)](_0x3740f0);}),_0x24634d;}['saveCommentToSnapshot'](_0x2fb6a2){const _0x3280ac=_0x3bdc4b;return{'id':_0x2fb6a2['id'],'threadId':_0x2fb6a2[_0x3280ac(0x1f8)],'ref':_0x2fb6a2[_0x3280ac(0x1c5)]};}};_0x164e30=_0x438f33([_0x3427ac(0x0,_0x233f6d['Inject'](_0x76628e[_0x3bdc4b(0x1af)])),_0x3427ac(0x1,_0x233f6d['Inject'](_0x233f6d[_0x3bdc4b(0x20e)])),_0x3427ac(0x2,_0x233f6d[_0x3bdc4b(0x1de)](_0x2ae46c[_0x3bdc4b(0x1a2)])),_0x3427ac(0x3,_0x233f6d[_0x3bdc4b(0x1de)](_0x233f6d[_0x3bdc4b(0x1f1)]))],_0x164e30);var _0x4bc854=Object[_0x3bdc4b(0x1be)],_0x29c0c3=(_0x5cfbdd,_0x2d0f70,_0x3909a6,_0x6d1d5c)=>{const _0x4c549a=_0x3bdc4b;for(var _0x178236=_0x6d1d5c>0x1?void 0x0:_0x6d1d5c?_0x4bc854(_0x2d0f70,_0x3909a6):_0x2d0f70,_0x4ad0df=_0x5cfbdd[_0x4c549a(0x1c6)]-0x1,_0x1bd30c;_0x4ad0df>=0x0;_0x4ad0df--)(_0x1bd30c=_0x5cfbdd[_0x4ad0df])&&(_0x178236=_0x1bd30c(_0x178236)||_0x178236);return _0x178236;},_0x5d9f6c=(_0x5a2dbb,_0x48dce5)=>(_0x100ad9,_0x58be7d)=>_0x48dce5(_0x100ad9,_0x58be7d,_0x5a2dbb);let _0x4226b0=class extends _0x233f6d[_0x3bdc4b(0x1cf)]{constructor(_0x1a528f,_0x599d21){const _0x6a932c=_0x3bdc4b;super(),this['_threadCommentDataSourceService']=_0x1a528f,this[_0x6a932c(0x1c2)]=_0x599d21,this[_0x6a932c(0x1b1)]();}[_0x3bdc4b(0x1b1)](){const _0x4d68d4=_0x3bdc4b;this[_0x4d68d4(0x200)][_0x4d68d4(0x1fd)]=this['_threadCommentDataSource'],this[_0x4d68d4(0x200)][_0x4d68d4(0x1e3)]=!0x1;}};_0x4226b0=_0x29c0c3([_0x5d9f6c(0x0,_0x5c253f[_0x3bdc4b(0x1e2)]),_0x5d9f6c(0x1,_0x233f6d['Inject'](_0x164e30))],_0x4226b0);var _0x466ee=Object[_0x3bdc4b(0x1d9)],_0x11f6a1=Object[_0x3bdc4b(0x1be)],_0x5788b7=(_0x4aeea2,_0x31841c,_0xa704d3)=>_0x31841c in _0x4aeea2?_0x466ee(_0x4aeea2,_0x31841c,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xa704d3}):_0x4aeea2[_0x31841c]=_0xa704d3,_0x18ad6d=(_0x3fba82,_0x4eb6a3,_0x5c4963,_0x4bed87)=>{const _0x49b84c=_0x3bdc4b;for(var _0x225cd8=_0x4bed87>0x1?void 0x0:_0x4bed87?_0x11f6a1(_0x4eb6a3,_0x5c4963):_0x4eb6a3,_0x3fc3ec=_0x3fba82[_0x49b84c(0x1c6)]-0x1,_0x29b3b3;_0x3fc3ec>=0x0;_0x3fc3ec--)(_0x29b3b3=_0x3fba82[_0x3fc3ec])&&(_0x225cd8=_0x29b3b3(_0x225cd8)||_0x225cd8);return _0x225cd8;},_0x544505=(_0x9c57fa,_0x3d0d2c)=>(_0xbcfc2c,_0x3f78f0)=>_0x3d0d2c(_0xbcfc2c,_0x3f78f0,_0x9c57fa),_0x2db0bd=(_0x4f0c4a,_0x8453b3,_0x513b28)=>_0x5788b7(_0x4f0c4a,typeof _0x8453b3!=_0x3bdc4b(0x20b)?_0x8453b3+'':_0x8453b3,_0x513b28);_0x449b61[_0x3bdc4b(0x1cd)]=class extends _0x233f6d[_0x3bdc4b(0x1c8)]{constructor(_0x2172aa=_0x4532a2,_0x1658c1,_0x26cfa1){const _0x540e2a=_0x3bdc4b;super(),this['_config']=_0x2172aa,this['_injector']=_0x1658c1,this[_0x540e2a(0x202)]=_0x26cfa1;const {..._0x4a6101}=_0x233f6d[_0x540e2a(0x1c3)]({},_0x4532a2,this[_0x540e2a(0x1f9)]);this[_0x540e2a(0x202)]['setConfig'](_0x582ece,_0x4a6101);}['onStarting'](){[[_0x164e30],[_0x4226b0],[_0x52dfe1]]['forEach'](_0x41564f=>{const _0x2b5025=_0x5c75;this[_0x2b5025(0x1f5)]['add'](_0x41564f);});}['onReady'](){const _0x227459=_0x3bdc4b;this[_0x227459(0x1f5)][_0x227459(0x1b6)](_0x4226b0),this[_0x227459(0x1f5)][_0x227459(0x1b6)](_0x52dfe1);}},_0x2db0bd(_0x449b61[_0x3bdc4b(0x1cd)],_0x3bdc4b(0x1d8),_0x1ec23e),_0x2db0bd(_0x449b61[_0x3bdc4b(0x1cd)],_0x3bdc4b(0x1cc),_0x233f6d[_0x3bdc4b(0x1a1)]['UNIVER_UNKNOWN']),_0x449b61[_0x3bdc4b(0x1cd)]=_0x18ad6d([_0x233f6d['DependentOn'](_0x245617[_0x3bdc4b(0x1a3)],_0x2ae46c[_0x3bdc4b(0x1e6)],_0x34d216['UniverLicensePlugin']),_0x544505(0x1,_0x233f6d[_0x3bdc4b(0x1de)](_0x233f6d['Injector'])),_0x544505(0x2,_0x233f6d[_0x3bdc4b(0x1f3)])],_0x449b61[_0x3bdc4b(0x1cd)]),Object[_0x3bdc4b(0x1d9)](_0x449b61,Symbol[_0x3bdc4b(0x1f7)],{'value':_0x3bdc4b(0x21f)});}));
|
|
1
|
+
function _0x3b7f(){const _0x4162ad=['slice','get','@univerjs-pro/collaboration-client','3685346JUvJhD','UniverProThreadCommentDatasource','ThreadCommentModel','_sessionService','@univerjs/core','subscribe','_configService','YYYY/MM/DD\x20HH:mm','UniverThreadCommentUi','add','body','IConfigService','filter','forEach','bufferTime','_threadCommentModel','Module','defineProperty','addComment','resolveComment','pluginName','UNRECOGNIZED','replyId','/universer-api/comment/unit/','payload','replies','merge','getUnit','_commentService','UserManagerService','toStringTag','_init','3732495QHkUiR','_injector','getCurrentUser','rangeId','_httpService','/list','onReady','Edit','error','dataSource','rxjs','requireSession','user','CommentService','@univerjs/thread-comment','_threadCommentDataSource','unitId','content','root','IThreadCommentDataSourceService','addUser','6502728WhZrpk','UniverThreadCommentUIPlugin','Disposable','threadId','parentId','getOwnPropertyDescriptor','exports','UNIVER_UNKNOWN','map','Reply','reply','getUser','Delete','_config','thread-comment-data-source.config','305172KQlqlO','post','_userService','updateComment','1545270flMLGc','symbol','@univerjs/network','OpenOrReOpen','@univerjs/thread-comment-ui','17299476MGQtxs','UniverNetwork','UniverThreadComment','Plugin','getMemberID','users','userID','find','resolved','/reply','object','dayjs','Injector','saveCommentToSnapshot','solved','size','values','/add','Inject','deleteComment','onStarting','CollaborationSessionService','_threadCommentDataSourceService','personId','101992wzdQFB','customRanges','getComment','_initDataSource','2wSVWFR','CustomRangeType','type','UniverThreadCommentDataSourcePlugin','delete','HTTPService','ref','8rnewXu','Unknown','createTimestamp','commentUpdate$','Solved','@univerjs-pro/license','userId','pipe','amd','Add','parse','comments','_initUserSync','rangeType','code','format','syncUpdateMutationToColla','/solved','Solve','length'];_0x3b7f=function(){return _0x4162ad;};return _0x3b7f();}function _0x22fc(_0x5a689a,_0x1fe581){const _0x3b7fb8=_0x3b7f();return _0x22fc=function(_0x22fc1f,_0x347221){_0x22fc1f=_0x22fc1f-0xdb;let _0x418d8c=_0x3b7fb8[_0x22fc1f];return _0x418d8c;},_0x22fc(_0x5a689a,_0x1fe581);}(function(_0x28ae13,_0x5e1faf){const _0xeaa0cd=_0x22fc,_0x8b311=_0x28ae13();while(!![]){try{const _0x73c25d=parseInt(_0xeaa0cd(0x153))/0x1+parseInt(_0xeaa0cd(0x157))/0x2*(-parseInt(_0xeaa0cd(0x136))/0x3)+-parseInt(_0xeaa0cd(0x132))/0x4+parseInt(_0xeaa0cd(0x10e))/0x5+-parseInt(_0xeaa0cd(0x123))/0x6+-parseInt(_0xeaa0cd(0xee))/0x7+-parseInt(_0xeaa0cd(0x15e))/0x8*(-parseInt(_0xeaa0cd(0x13b))/0x9);if(_0x73c25d===_0x5e1faf)break;else _0x8b311['push'](_0x8b311['shift']());}catch(_0x50f91c){_0x8b311['push'](_0x8b311['shift']());}}}(_0x3b7f,0x8aeae),function(_0x1557f7,_0x1b7ed9){const _0x3aa7b8=_0x22fc;typeof exports==_0x3aa7b8(0x145)&&typeof module<'u'?_0x1b7ed9(exports,require(_0x3aa7b8(0xed)),require('@univerjs-pro/license'),require(_0x3aa7b8(0xf2)),require(_0x3aa7b8(0x13a)),require(_0x3aa7b8(0x11c)),require('rxjs'),require(_0x3aa7b8(0x138))):typeof define=='function'&&define[_0x3aa7b8(0xdf)]?define([_0x3aa7b8(0x129),_0x3aa7b8(0xed),_0x3aa7b8(0xdc),'@univerjs/core',_0x3aa7b8(0x13a),_0x3aa7b8(0x11c),_0x3aa7b8(0x118),_0x3aa7b8(0x138)],_0x1b7ed9):(_0x1557f7=typeof globalThis<'u'?globalThis:_0x1557f7||self,_0x1b7ed9(_0x1557f7[_0x3aa7b8(0xef)]={},_0x1557f7['UniverProCollaborationClient'],_0x1557f7['UniverProLicense'],_0x1557f7['UniverCore'],_0x1557f7[_0x3aa7b8(0xf6)],_0x1557f7[_0x3aa7b8(0x13d)],_0x1557f7['rxjs'],_0x1557f7[_0x3aa7b8(0x13c)]));}(this,function(_0x3024ba,_0x54e75,_0x19c446,_0x46f0ca,_0x3ad3db,_0xf0eb6c,_0x1679ec,_0x2a6a49){'use strict';const _0x103ccf=_0x22fc;const _0x1c10bb='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x504a42=(_0x4f88a6=>(_0x4f88a6[_0x4f88a6[_0x103ccf(0x139)]=0x0]=_0x103ccf(0x139),_0x4f88a6[_0x4f88a6[_0x103ccf(0xdb)]=0x1]=_0x103ccf(0xdb),_0x4f88a6[_0x4f88a6[_0x103ccf(0x103)]=-0x1]=_0x103ccf(0x103),_0x4f88a6))(_0x504a42||{}),_0x563ab6=(_0x15d220=>(_0x15d220[_0x15d220[_0x103ccf(0x15f)]=0x0]=_0x103ccf(0x15f),_0x15d220[_0x15d220[_0x103ccf(0xe0)]=0x1]='Add',_0x15d220[_0x15d220[_0x103ccf(0x12c)]=0x2]=_0x103ccf(0x12c),_0x15d220[_0x15d220['Edit']=0x3]=_0x103ccf(0x115),_0x15d220[_0x15d220[_0x103ccf(0x12f)]=0x4]='Delete',_0x15d220[_0x15d220[_0x103ccf(0xe9)]=0x5]='Solve',_0x15d220[_0x15d220[_0x103ccf(0x103)]=-0x1]='UNRECOGNIZED',_0x15d220))(_0x563ab6||{});const _0x5062a2=_0x3611e9=>_0x46f0ca[_0x103ccf(0x146)](new Date(+_0x3611e9))[_0x103ccf(0xe6)](_0x103ccf(0xf5)),_0x3319d4=async(_0x17d4a4,_0x5b4c58)=>{const _0x20c21a=_0x103ccf,_0x994c26=_0x17d4a4[_0x20c21a(0xec)](_0x46f0ca[_0x20c21a(0x10b)]),_0x349077=_0x17d4a4[_0x20c21a(0xec)](_0x2a6a49[_0x20c21a(0x15c)]);_0x5b4c58[_0x20c21a(0xfb)](_0x671737=>{const _0x1faadf=_0x20c21a;_0x994c26[_0x1faadf(0x12e)](_0x671737)&&_0x5b4c58[_0x1faadf(0x15b)](_0x671737);}),_0x5b4c58[_0x20c21a(0x14a)]&&(await _0x349077[_0x20c21a(0xec)]('/universer-api/user/list',{'params':{'userIDs':[..._0x5b4c58]}}))[_0x20c21a(0xf8)]['users']['forEach'](_0x23fd4f=>{const _0x3be789=_0x20c21a;_0x23fd4f&&_0x994c26[_0x3be789(0x122)](_0x23fd4f);});};var _0x1a0097=Object[_0x103ccf(0x128)],_0x2bd9eb=(_0x1bc67f,_0x4d08fa,_0x599cbd,_0x5bbc6e)=>{const _0x22e4f5=_0x103ccf;for(var _0x414691=_0x5bbc6e>0x1?void 0x0:_0x5bbc6e?_0x1a0097(_0x4d08fa,_0x599cbd):_0x4d08fa,_0x43bca9=_0x1bc67f[_0x22e4f5(0xea)]-0x1,_0x3bf5a0;_0x43bca9>=0x0;_0x43bca9--)(_0x3bf5a0=_0x1bc67f[_0x43bca9])&&(_0x414691=_0x3bf5a0(_0x414691)||_0x414691);return _0x414691;},_0x5da8af=(_0x1efda8,_0x4925cf)=>(_0xebbc34,_0x3d8623)=>_0x4925cf(_0xebbc34,_0x3d8623,_0x1efda8);let _0x484d31=class extends _0x46f0ca['Disposable']{constructor(_0x541c38,_0x78b5b6,_0x4b3271,_0x54bf72){const _0x9cae75=_0x103ccf;super(),this[_0x9cae75(0x10a)]=_0x541c38,this[_0x9cae75(0xfd)]=_0x78b5b6,this['_userService']=_0x4b3271,this['_injector']=_0x54bf72,this[_0x9cae75(0x10d)](),this[_0x9cae75(0xe3)]();}['_initUserSync'](){const _0x5c3987=_0x103ccf;this['disposeWithMe'](this[_0x5c3987(0xfd)]['commentUpdate$'][_0x5c3987(0xde)](_0x1679ec[_0x5c3987(0xfc)](0x10))[_0x5c3987(0xf3)](_0x41b260=>{const _0x38a9c3=_0x5c3987,_0x599888=new Set();_0x41b260['forEach'](_0x4e7550=>{const _0xb01d79=_0x22fc;switch(_0x4e7550[_0xb01d79(0x159)]){case'add':{const _0x3e5943=_0x4e7550[_0xb01d79(0x106)][_0xb01d79(0x152)];_0x599888[_0xb01d79(0xf7)](_0x3e5943);break;}}}),_0x3319d4(this[_0x38a9c3(0x10f)],_0x599888);}));}[_0x103ccf(0x10d)](){const _0x537eaa=_0x103ccf;this['disposeWithMe'](this[_0x537eaa(0x10a)][_0x537eaa(0x161)][_0x537eaa(0xf3)](async _0x5e3370=>{const _0x59c3e4=_0x537eaa;var _0x4620b9,_0x18d9f0,_0x45e945,_0x4a08a0;const _0x35c057=(_0x4620b9=this[_0x59c3e4(0xfd)][_0x59c3e4(0x109)](_0x5e3370[_0x59c3e4(0x11e)])[_0x59c3e4(0x142)](_0x160eb2=>_0x160eb2[_0x59c3e4(0x126)]===_0x5e3370[_0x59c3e4(0x126)]))==null?void 0x0:_0x4620b9[_0x59c3e4(0x120)];if(!_0x35c057)return;const {unitId:_0x32eb08,subUnitId:_0xd6c8f5}=_0x35c057;switch(_0x5e3370[_0x59c3e4(0x11a)]&&this[_0x59c3e4(0x134)]['addUser'](_0x5e3370['user']),_0x5e3370[_0x59c3e4(0x159)]){case _0x563ab6[_0x59c3e4(0xe0)]:break;case _0x563ab6['Reply']:{this[_0x59c3e4(0xfd)][_0x59c3e4(0x100)](_0x32eb08,_0xd6c8f5,{'unitId':_0x32eb08,'subUnitId':_0xd6c8f5,'ref':'','id':_0x5e3370[_0x59c3e4(0x104)],'dT':_0x5062a2(+_0x5e3370[_0x59c3e4(0x160)]),'threadId':_0x5e3370['threadId'],'personId':(_0x45e945=(_0x18d9f0=_0x5e3370[_0x59c3e4(0x11a)])==null?void 0x0:_0x18d9f0[_0x59c3e4(0x141)])!=null?_0x45e945:_0x5e3370['userId'],'text':JSON[_0x59c3e4(0xe1)](_0x5e3370[_0x59c3e4(0x11f)]),'parentId':_0x35c057['id']});break;}case _0x563ab6[_0x59c3e4(0x12f)]:{const _0x1b187c=this['_threadCommentModel'][_0x59c3e4(0x155)](_0x32eb08,_0xd6c8f5,_0x5e3370['replyId']);_0x1b187c&&_0x1b187c[_0x59c3e4(0x127)]&&this['_threadCommentModel'][_0x59c3e4(0x14e)](_0x32eb08,_0xd6c8f5,_0x5e3370[_0x59c3e4(0x104)]);break;}case _0x563ab6['Edit']:{this[_0x59c3e4(0xfd)][_0x59c3e4(0x135)](_0x32eb08,_0xd6c8f5,{'commentId':_0x5e3370['replyId'],'text':JSON[_0x59c3e4(0xe1)](_0x5e3370[_0x59c3e4(0x11f)])});break;}case _0x563ab6[_0x59c3e4(0xe9)]:{const _0x223028=(_0x4a08a0=this[_0x59c3e4(0xfd)]['getUnit'](_0x5e3370['unitId'])[_0x59c3e4(0x142)](_0x117fa8=>_0x117fa8[_0x59c3e4(0x126)]===_0x5e3370['threadId']))==null?void 0x0:_0x4a08a0[_0x59c3e4(0x120)];_0x223028&&this[_0x59c3e4(0xfd)][_0x59c3e4(0x101)](_0x32eb08,_0xd6c8f5,_0x223028['id'],_0x5e3370[_0x59c3e4(0x149)]===_0x504a42[_0x59c3e4(0xdb)]);break;}}}));}};_0x484d31=_0x2bd9eb([_0x5da8af(0x0,_0x46f0ca[_0x103ccf(0x14d)](_0x54e75[_0x103ccf(0x11b)])),_0x5da8af(0x1,_0x46f0ca['Inject'](_0xf0eb6c[_0x103ccf(0xf0)])),_0x5da8af(0x2,_0x46f0ca[_0x103ccf(0x14d)](_0x46f0ca[_0x103ccf(0x10b)])),_0x5da8af(0x3,_0x46f0ca[_0x103ccf(0x14d)](_0x46f0ca[_0x103ccf(0x147)]))],_0x484d31);const _0x12747a=_0x103ccf(0x131),_0x1b91e7={};var _0x4e039=Object[_0x103ccf(0x128)],_0x4a24f7=(_0x51792a,_0x24ce7d,_0x6abbb1,_0x47de16)=>{const _0x52bbce=_0x103ccf;for(var _0x38e635=_0x47de16>0x1?void 0x0:_0x47de16?_0x4e039(_0x24ce7d,_0x6abbb1):_0x24ce7d,_0x40ce87=_0x51792a[_0x52bbce(0xea)]-0x1,_0x2e395d;_0x40ce87>=0x0;_0x40ce87--)(_0x2e395d=_0x51792a[_0x40ce87])&&(_0x38e635=_0x2e395d(_0x38e635)||_0x38e635);return _0x38e635;},_0x111b51=(_0x39027c,_0x3a94b0)=>(_0x69ca17,_0x54e3c6)=>_0x3a94b0(_0x69ca17,_0x54e3c6,_0x39027c);function _0x44bcee(_0x28eb43,_0x73b48a){const _0x1b15a1=_0x103ccf,_0x4dbba=_0x28eb43[_0x1b15a1(0x107)][0x0];return{..._0x73b48a,'id':_0x4dbba[_0x1b15a1(0x104)],'resolved':_0x28eb43['solved']===0x1,'dT':_0x5062a2(_0x4dbba[_0x1b15a1(0x160)]),'personId':_0x4dbba['userId'],'threadId':_0x4dbba[_0x1b15a1(0x126)]};}function _0x1838b1(_0x18924e,_0x287190,_0x10106b){const _0x4437f1=_0x103ccf;var _0x42cb65,_0x50becc;if(((_0x50becc=(_0x42cb65=_0x18924e==null?void 0x0:_0x18924e['replies'])==null?void 0x0:_0x42cb65[_0x4437f1(0xea)])!=null?_0x50becc:0x0)>0x0){const _0x328e53=(_0x4cf97c,_0x5bd260)=>({'id':_0x4cf97c[_0x4437f1(0x104)],'threadId':_0x4cf97c[_0x4437f1(0x126)],'dT':_0x5062a2(_0x4cf97c[_0x4437f1(0x160)]),'personId':_0x4cf97c[_0x4437f1(0xdd)],'resolved':_0x18924e[_0x4437f1(0x149)]===_0x504a42[_0x4437f1(0xdb)],'unitId':_0x287190,'subUnitId':_0x10106b,'text':JSON[_0x4437f1(0xe1)](_0x4cf97c[_0x4437f1(0x11f)]),'parentId':_0x5bd260}),_0x4da6a5=_0x328e53(_0x18924e[_0x4437f1(0x107)][0x0]);return{..._0x4da6a5,'children':_0x18924e[_0x4437f1(0x107)][_0x4437f1(0xeb)](0x1)[_0x4437f1(0x12b)](_0x15a480=>_0x328e53(_0x15a480,_0x4da6a5['id']))};}return null;}let _0x3c3717=class{constructor(_0x2a43ec,_0x4c02c6,_0x4c0d1d,_0x37a2da){const _0x28e5c7=_0x103ccf;this[_0x28e5c7(0x112)]=_0x2a43ec,this[_0x28e5c7(0x134)]=_0x4c02c6,this['_sessionService']=_0x4c0d1d,this[_0x28e5c7(0x10f)]=_0x37a2da;}async['addComment'](_0xf33ba3){const _0x48c3c8=_0x103ccf;var _0x595898,_0x2e2005;const {parentId:_0x4994ac,unitId:_0x59af4c,text:_0x4dbdfa,threadId:_0x435c8a}=_0xf33ba3,_0x92bba0=(_0x2e2005=(_0x595898=_0x4dbdfa[_0x48c3c8(0x154)])==null?void 0x0:_0x595898[_0x48c3c8(0xfa)](_0x5996b2=>_0x5996b2[_0x48c3c8(0xe4)]===_0x46f0ca[_0x48c3c8(0x158)]['COMMENT'])[_0x48c3c8(0x12b)](_0x1a8e7e=>_0x1a8e7e[_0x48c3c8(0x111)]))!=null?_0x2e2005:[],_0x288807=JSON['stringify'](_0x4dbdfa),_0x588ac3=(await this[_0x48c3c8(0xf1)][_0x48c3c8(0x119)](_0x59af4c))[_0x48c3c8(0x13f)]();if(_0x4994ac){const _0x2358cb={'memberId':_0x588ac3,'unitId':_0x59af4c,'content':_0x288807,'mention':_0x92bba0,'threadId':_0x435c8a},_0x155d9f=(await this[_0x48c3c8(0x112)][_0x48c3c8(0x133)](_0x48c3c8(0x105)+_0x59af4c+_0x48c3c8(0x144),{'body':_0x2358cb}))[_0x48c3c8(0xf8)][_0x48c3c8(0x12d)];return{..._0xf33ba3,'id':_0x155d9f[_0x48c3c8(0x104)],'dT':_0x46f0ca[_0x48c3c8(0x146)](+_0x155d9f[_0x48c3c8(0x160)])[_0x48c3c8(0xe6)](_0x48c3c8(0xf5)),'personId':_0x155d9f['userId']};}else{const _0x41b3b1={'memberId':_0x588ac3,'unitId':_0x59af4c,'content':_0x288807,'mention':_0x92bba0},_0x27ba86=await this[_0x48c3c8(0x112)][_0x48c3c8(0x133)]('/universer-api/comment/unit/'+_0x59af4c+_0x48c3c8(0x14c),{'body':_0x41b3b1});return _0x44bcee(_0x27ba86[_0x48c3c8(0xf8)]['comment'],_0xf33ba3);}}async[_0x103ccf(0x135)](_0x27aa38){const _0x34f3e8=_0x103ccf;var _0x3430d5,_0x5c5127;const {text:_0x3134d6,unitId:_0x209b8e}=_0x27aa38,_0x3da449=(_0x5c5127=(_0x3430d5=_0x3134d6[_0x34f3e8(0x154)])==null?void 0x0:_0x3430d5['filter'](_0x4343b2=>_0x4343b2[_0x34f3e8(0xe4)]===_0x46f0ca['CustomRangeType']['COMMENT'])[_0x34f3e8(0x12b)](_0x47b68f=>_0x47b68f[_0x34f3e8(0x111)]))!=null?_0x5c5127:[],_0x1103ca=JSON['stringify'](_0x3134d6),_0x38517c=_0x27aa38[_0x34f3e8(0x126)],_0x158119=_0x27aa38['id'],_0x4a9c3f={'memberId':(await this['_sessionService']['requireSession'](_0x209b8e))['getMemberID'](),'unitId':_0x209b8e,'threadId':_0x38517c,'mention':_0x3da449,'content':_0x1103ca,'replyId':_0x158119},_0x1ec1d1=await this[_0x34f3e8(0x112)][_0x34f3e8(0x133)](_0x34f3e8(0x105)+_0x209b8e+'/edit',{'body':_0x4a9c3f});return!_0x1ec1d1[_0x34f3e8(0xf8)][_0x34f3e8(0x116)]||_0x1ec1d1['body']['error']['code']===0x1;}async[_0x103ccf(0x101)](_0x56f30d){const _0x158c35=_0x103ccf,{unitId:_0x4feafc}=_0x56f30d,_0x527b4e=_0x56f30d['threadId'],_0xbb32c7={'memberId':this[_0x158c35(0x134)][_0x158c35(0x110)]()[_0x158c35(0x141)],'unitId':_0x4feafc,'threadId':_0x527b4e,'solved':_0x56f30d[_0x158c35(0x143)]?_0x504a42['Solved']:_0x504a42['OpenOrReOpen']},_0x3ded9a=await this[_0x158c35(0x112)]['post'](_0x158c35(0x105)+_0x4feafc+_0x158c35(0xe8),{'body':_0xbb32c7});return!_0x3ded9a[_0x158c35(0xf8)][_0x158c35(0x116)]||_0x3ded9a['body'][_0x158c35(0x116)]['code']===0x1;}async['deleteComment'](_0x15d589,_0x524f5e,_0x1e83da,_0x15a128){const _0xe6a9a5=_0x103ccf,_0x539a1d={'memberId':(await this[_0xe6a9a5(0xf1)][_0xe6a9a5(0x119)](_0x15d589))[_0xe6a9a5(0x13f)](),'threadId':_0x1e83da,'replyId':_0x15a128,'unitId':_0x15d589},_0x45d773=await this[_0xe6a9a5(0x112)][_0xe6a9a5(0x133)](_0xe6a9a5(0x105)+_0x15d589+'/delete',{'body':_0x539a1d});return!_0x45d773[_0xe6a9a5(0xf8)][_0xe6a9a5(0x116)]||_0x45d773[_0xe6a9a5(0xf8)][_0xe6a9a5(0x116)][_0xe6a9a5(0xe5)]===0x1;}async['listComments'](_0x5e74eb,_0x11359b,_0x46b99d){const _0x13f7b1=_0x103ccf,_0x5d2f7c={'unitId':_0x5e74eb,'threadId':_0x46b99d},_0x508125=await this[_0x13f7b1(0x112)]['post'](_0x13f7b1(0x105)+_0x5e74eb+_0x13f7b1(0x113),{'body':_0x5d2f7c}),_0x5d350d=_0x46b99d[_0x13f7b1(0x12b)](_0x44f38e=>_0x1838b1(_0x508125[_0x13f7b1(0xf8)][_0x13f7b1(0xe2)][_0x44f38e],_0x5e74eb,_0x11359b))[_0x13f7b1(0xfa)](Boolean);return Object[_0x13f7b1(0x14b)](_0x508125['body'][_0x13f7b1(0x140)])[_0x13f7b1(0xfb)](_0x484642=>{const _0x35bf24=_0x13f7b1;this[_0x35bf24(0x134)][_0x35bf24(0x122)](_0x484642);}),_0x5d350d;}[_0x103ccf(0x148)](_0x252152){const _0x5c7926=_0x103ccf;return{'id':_0x252152['id'],'threadId':_0x252152['threadId'],'ref':_0x252152[_0x5c7926(0x15d)]};}};_0x3c3717=_0x4a24f7([_0x111b51(0x0,_0x46f0ca[_0x103ccf(0x14d)](_0x2a6a49['HTTPService'])),_0x111b51(0x1,_0x46f0ca['Inject'](_0x46f0ca[_0x103ccf(0x10b)])),_0x111b51(0x2,_0x46f0ca[_0x103ccf(0x14d)](_0x54e75[_0x103ccf(0x150)])),_0x111b51(0x3,_0x46f0ca[_0x103ccf(0x14d)](_0x46f0ca[_0x103ccf(0x147)]))],_0x3c3717);var _0x2aaac7=Object['getOwnPropertyDescriptor'],_0x23f59f=(_0x3c1f4e,_0x16cea1,_0x4d4761,_0x1f2050)=>{const _0x4c49a6=_0x103ccf;for(var _0x1415d7=_0x1f2050>0x1?void 0x0:_0x1f2050?_0x2aaac7(_0x16cea1,_0x4d4761):_0x16cea1,_0x3ae364=_0x3c1f4e[_0x4c49a6(0xea)]-0x1,_0x5d8969;_0x3ae364>=0x0;_0x3ae364--)(_0x5d8969=_0x3c1f4e[_0x3ae364])&&(_0x1415d7=_0x5d8969(_0x1415d7)||_0x1415d7);return _0x1415d7;},_0x49c3b0=(_0x172f34,_0x5c6943)=>(_0x81df2b,_0x3216f0)=>_0x5c6943(_0x81df2b,_0x3216f0,_0x172f34);let _0x90e452=class extends _0x46f0ca[_0x103ccf(0x125)]{constructor(_0x4ce1d7,_0x7af094){const _0x3445bd=_0x103ccf;super(),this[_0x3445bd(0x151)]=_0x4ce1d7,this['_threadCommentDataSource']=_0x7af094,this[_0x3445bd(0x156)]();}[_0x103ccf(0x156)](){const _0x386116=_0x103ccf;this[_0x386116(0x151)][_0x386116(0x117)]=this[_0x386116(0x11d)],this[_0x386116(0x151)][_0x386116(0xe7)]=!0x1;}};_0x90e452=_0x23f59f([_0x49c3b0(0x0,_0xf0eb6c[_0x103ccf(0x121)]),_0x49c3b0(0x1,_0x46f0ca['Inject'](_0x3c3717))],_0x90e452);var _0x5906cf=Object[_0x103ccf(0xff)],_0x39b356=Object[_0x103ccf(0x128)],_0x5307d1=(_0x1205ff,_0x10849f,_0x13341d)=>_0x10849f in _0x1205ff?_0x5906cf(_0x1205ff,_0x10849f,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x13341d}):_0x1205ff[_0x10849f]=_0x13341d,_0x4554f3=(_0x5bb76d,_0x2c6aa6,_0x222d7,_0x1b4748)=>{const _0x1e75cd=_0x103ccf;for(var _0x29b0b5=_0x1b4748>0x1?void 0x0:_0x1b4748?_0x39b356(_0x2c6aa6,_0x222d7):_0x2c6aa6,_0x159a60=_0x5bb76d[_0x1e75cd(0xea)]-0x1,_0x4a7ffe;_0x159a60>=0x0;_0x159a60--)(_0x4a7ffe=_0x5bb76d[_0x159a60])&&(_0x29b0b5=_0x4a7ffe(_0x29b0b5)||_0x29b0b5);return _0x29b0b5;},_0x258440=(_0xd4382b,_0x4a0efc)=>(_0x4b50d8,_0xb85207)=>_0x4a0efc(_0x4b50d8,_0xb85207,_0xd4382b),_0x14155e=(_0xd9a57c,_0x34d2b1,_0x51e112)=>_0x5307d1(_0xd9a57c,typeof _0x34d2b1!=_0x103ccf(0x137)?_0x34d2b1+'':_0x34d2b1,_0x51e112);_0x3024ba[_0x103ccf(0x15a)]=class extends _0x46f0ca[_0x103ccf(0x13e)]{constructor(_0xdec7b5=_0x1b91e7,_0x15746f,_0x19e2e6){const _0x874001=_0x103ccf;super(),this[_0x874001(0x130)]=_0xdec7b5,this[_0x874001(0x10f)]=_0x15746f,this[_0x874001(0xf4)]=_0x19e2e6;const {..._0x2ac372}=_0x46f0ca[_0x874001(0x108)]({},_0x1b91e7,this[_0x874001(0x130)]);this[_0x874001(0xf4)]['setConfig'](_0x12747a,_0x2ac372);}[_0x103ccf(0x14f)](){[[_0x3c3717],[_0x90e452],[_0x484d31]]['forEach'](_0x1a7073=>{const _0x10d284=_0x22fc;this[_0x10d284(0x10f)][_0x10d284(0xf7)](_0x1a7073);});}[_0x103ccf(0x114)](){const _0x107573=_0x103ccf;this[_0x107573(0x10f)]['get'](_0x90e452),this['_injector'][_0x107573(0xec)](_0x484d31);}},_0x14155e(_0x3024ba[_0x103ccf(0x15a)],_0x103ccf(0x102),_0x1c10bb),_0x14155e(_0x3024ba[_0x103ccf(0x15a)],'type',_0x46f0ca['UniverInstanceType'][_0x103ccf(0x12a)]),_0x3024ba[_0x103ccf(0x15a)]=_0x4554f3([_0x46f0ca['DependentOn'](_0x3ad3db[_0x103ccf(0x124)],_0x54e75['UniverCollaborationClientPlugin'],_0x19c446['UniverLicensePlugin']),_0x258440(0x1,_0x46f0ca['Inject'](_0x46f0ca[_0x103ccf(0x147)])),_0x258440(0x2,_0x46f0ca[_0x103ccf(0xf9)])],_0x3024ba[_0x103ccf(0x15a)]),Object[_0x103ccf(0xff)](_0x3024ba,Symbol[_0x103ccf(0x10c)],{'value':_0x103ccf(0xfe)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.6.10-nightly.
|
|
3
|
+
"version": "0.6.10-nightly.202504241607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.6.10-nightly.
|
|
49
|
-
"@univerjs-pro/license": "0.6.10-nightly.
|
|
50
|
-
"@univerjs/core": "0.6.10-nightly.
|
|
51
|
-
"@univerjs/
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/
|
|
54
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.6.10-nightly.202504241607",
|
|
49
|
+
"@univerjs-pro/license": "0.6.10-nightly.202504241607",
|
|
50
|
+
"@univerjs/core": "0.6.10-nightly.202504241607",
|
|
51
|
+
"@univerjs/network": "0.6.10-nightly.202504241607",
|
|
52
|
+
"@univerjs/thread-comment": "0.6.10-nightly.202504241607",
|
|
53
|
+
"@univerjs/protocol": "0.1.46-alpha.3",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.6.10-nightly.202504241607"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "^7.8.1",
|