@univerjs-pro/thread-comment-datasource 0.6.10-alpha.0 → 0.6.10-experimental.20250410-f79ffef
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 _0x2c8270=_0x25f8;(function(_0x31aecb,_0x5df052){const _0x389b71=_0x25f8,_0x363393=_0x31aecb();while(!![]){try{const _0x185ddd=parseInt(_0x389b71(0x216))/0x1*(-parseInt(_0x389b71(0x203))/0x2)+parseInt(_0x389b71(0x1e1))/0x3*(-parseInt(_0x389b71(0x1da))/0x4)+-parseInt(_0x389b71(0x1d9))/0x5*(-parseInt(_0x389b71(0x1c8))/0x6)+-parseInt(_0x389b71(0x1cf))/0x7+parseInt(_0x389b71(0x1f7))/0x8+-parseInt(_0x389b71(0x1bb))/0x9*(parseInt(_0x389b71(0x1d7))/0xa)+-parseInt(_0x389b71(0x201))/0xb*(-parseInt(_0x389b71(0x205))/0xc);if(_0x185ddd===_0x5df052)break;else _0x363393['push'](_0x363393['shift']());}catch(_0x2be829){_0x363393['push'](_0x363393['shift']());}}}(_0x3437,0x8011f));Object[_0x2c8270(0x1fe)](exports,Symbol[_0x2c8270(0x1f2)],{'value':'Module'});const b=require(_0x2c8270(0x209)),T=require(_0x2c8270(0x1df)),c=require(_0x2c8270(0x211)),j=require(_0x2c8270(0x1c3)),M=require(_0x2c8270(0x214)),w=require('rxjs'),P=require(_0x2c8270(0x22d)),U=_0x2c8270(0x1d8);var I=(_0x1b2028=>(_0x1b2028[_0x1b2028['OpenOrReOpen']=0x0]=_0x2c8270(0x215),_0x1b2028[_0x1b2028[_0x2c8270(0x1de)]=0x1]=_0x2c8270(0x1de),_0x1b2028[_0x1b2028['UNRECOGNIZED']=-0x1]=_0x2c8270(0x224),_0x1b2028))(I||{}),v=(_0x480111=>(_0x480111[_0x480111['Unknown']=0x0]=_0x2c8270(0x1e2),_0x480111[_0x480111[_0x2c8270(0x1bf)]=0x1]='Add',_0x480111[_0x480111['Reply']=0x2]=_0x2c8270(0x1e7),_0x480111[_0x480111[_0x2c8270(0x218)]=0x3]=_0x2c8270(0x218),_0x480111[_0x480111[_0x2c8270(0x1e4)]=0x4]='Delete',_0x480111[_0x480111['Solve']=0x5]=_0x2c8270(0x213),_0x480111[_0x480111[_0x2c8270(0x224)]=-0x1]=_0x2c8270(0x224),_0x480111))(v||{});const f=_0x2d5bb7=>c[_0x2c8270(0x229)](new Date(+_0x2d5bb7))[_0x2c8270(0x21f)](_0x2c8270(0x227)),R=async(_0x594855,_0x12214a)=>{const _0x3b11fb=_0x2c8270,_0x1350aa=_0x594855[_0x3b11fb(0x1ed)](c['UserManagerService']),_0x26e21d=_0x594855['get'](P[_0x3b11fb(0x1ee)]);_0x12214a[_0x3b11fb(0x225)](_0x1c0ef1=>{const _0x151c2b=_0x3b11fb;_0x1350aa[_0x151c2b(0x223)](_0x1c0ef1)&&_0x12214a[_0x151c2b(0x226)](_0x1c0ef1);}),_0x12214a[_0x3b11fb(0x1ff)]&&(await _0x26e21d[_0x3b11fb(0x1ed)]('/universer-api/user/list',{'params':{'userIDs':[..._0x12214a]}}))['body'][_0x3b11fb(0x200)][_0x3b11fb(0x225)](_0x437dd2=>{const _0x2a8080=_0x3b11fb;_0x437dd2&&_0x1350aa[_0x2a8080(0x20d)](_0x437dd2);});};var $=Object[_0x2c8270(0x1b2)],E=(_0x2269c2,_0x477ae1,_0x298d74,_0x326dcb)=>{const _0x3e1b65=_0x2c8270;for(var _0xdab29c=_0x326dcb>0x1?void 0x0:_0x326dcb?$(_0x477ae1,_0x298d74):_0x477ae1,_0x560bf7=_0x2269c2[_0x3e1b65(0x1b9)]-0x1,_0x3c5dbd;_0x560bf7>=0x0;_0x560bf7--)(_0x3c5dbd=_0x2269c2[_0x560bf7])&&(_0xdab29c=_0x3c5dbd(_0xdab29c)||_0xdab29c);return _0xdab29c;},S=(_0x597199,_0x4cebcb)=>(_0x5e1603,_0x3c8fde)=>_0x4cebcb(_0x5e1603,_0x3c8fde,_0x597199);let p=class extends c[_0x2c8270(0x1db)]{constructor(_0x42c749,_0x1dd7f5,_0x4fdf13,_0x2f1401){const _0x2d8a49=_0x2c8270;super(),this[_0x2d8a49(0x217)]=_0x42c749,this[_0x2d8a49(0x1d3)]=_0x1dd7f5,this[_0x2d8a49(0x220)]=_0x4fdf13,this['_injector']=_0x2f1401,this[_0x2d8a49(0x1dd)](),this['_initUserSync']();}[_0x2c8270(0x1cd)](){const _0x31728a=_0x2c8270;this[_0x31728a(0x1eb)](this[_0x31728a(0x1d3)]['commentUpdate$'][_0x31728a(0x1c7)](w[_0x31728a(0x1e6)](0x10))[_0x31728a(0x1b1)](_0x2b49ae=>{const _0x53345b=_0x31728a,_0xb4006f=new Set();_0x2b49ae[_0x53345b(0x225)](_0x55d451=>{const _0x5eed8c=_0x53345b;switch(_0x55d451[_0x5eed8c(0x208)]){case'add':{const _0x38b34b=_0x55d451[_0x5eed8c(0x1b5)][_0x5eed8c(0x1cb)];_0xb4006f[_0x5eed8c(0x1f1)](_0x38b34b);break;}}}),R(this['_injector'],_0xb4006f);}));}[_0x2c8270(0x1dd)](){const _0x3879ed=_0x2c8270;this['disposeWithMe'](this[_0x3879ed(0x217)]['commentUpdate$']['subscribe'](async _0x596551=>{const _0x59bb07=_0x3879ed;var _0x200cfd,_0x176d1a,_0x590891,_0x1e1c98;const _0x59f296=(_0x200cfd=this[_0x59bb07(0x1d3)][_0x59bb07(0x21e)](_0x596551[_0x59bb07(0x202)])['find'](_0x3c0054=>_0x3c0054['threadId']===_0x596551[_0x59bb07(0x1f3)]))==null?void 0x0:_0x200cfd[_0x59bb07(0x1b8)];if(!_0x59f296)return;const {unitId:_0x391b13,subUnitId:_0x804a7d}=_0x59f296;switch(_0x596551[_0x59bb07(0x1dc)]&&this[_0x59bb07(0x220)][_0x59bb07(0x20d)](_0x596551[_0x59bb07(0x1dc)]),_0x596551[_0x59bb07(0x208)]){case v[_0x59bb07(0x1bf)]:break;case v['Reply']:{this['_threadCommentModel'][_0x59bb07(0x1c0)](_0x391b13,_0x804a7d,{'unitId':_0x391b13,'subUnitId':_0x804a7d,'ref':'','id':_0x596551[_0x59bb07(0x1f8)],'dT':f(+_0x596551[_0x59bb07(0x22e)]),'threadId':_0x596551['threadId'],'personId':(_0x590891=(_0x176d1a=_0x596551[_0x59bb07(0x1dc)])==null?void 0x0:_0x176d1a[_0x59bb07(0x1d1)])!=null?_0x590891:_0x596551[_0x59bb07(0x20b)],'text':JSON[_0x59bb07(0x219)](_0x596551[_0x59bb07(0x1fb)]),'parentId':_0x59f296['id']});break;}case v[_0x59bb07(0x1e4)]:{const _0x2b01f1=this[_0x59bb07(0x1d3)]['getComment'](_0x391b13,_0x804a7d,_0x596551[_0x59bb07(0x1f8)]);_0x2b01f1&&_0x2b01f1[_0x59bb07(0x1e8)]&&this['_threadCommentModel']['deleteComment'](_0x391b13,_0x804a7d,_0x596551[_0x59bb07(0x1f8)]);break;}case v['Edit']:{this[_0x59bb07(0x1d3)][_0x59bb07(0x1be)](_0x391b13,_0x804a7d,{'commentId':_0x596551['replyId'],'text':JSON[_0x59bb07(0x219)](_0x596551[_0x59bb07(0x1fb)])});break;}case v[_0x59bb07(0x213)]:{const _0x5f222d=(_0x1e1c98=this['_threadCommentModel'][_0x59bb07(0x21e)](_0x596551[_0x59bb07(0x202)])[_0x59bb07(0x1f0)](_0x181467=>_0x181467['threadId']===_0x596551[_0x59bb07(0x1f3)]))==null?void 0x0:_0x1e1c98[_0x59bb07(0x1b8)];_0x5f222d&&this[_0x59bb07(0x1d3)][_0x59bb07(0x1f5)](_0x391b13,_0x804a7d,_0x5f222d['id'],_0x596551[_0x59bb07(0x20a)]===I[_0x59bb07(0x1de)]);break;}}}));}};function _0x25f8(_0x26471c,_0x4507a0){const _0x3437e6=_0x3437();return _0x25f8=function(_0x25f85c,_0x1385b1){_0x25f85c=_0x25f85c-0x1b0;let _0x1d9aba=_0x3437e6[_0x25f85c];return _0x1d9aba;},_0x25f8(_0x26471c,_0x4507a0);}p=E([S(0x0,c['Inject'](b['CommentService'])),S(0x1,c[_0x2c8270(0x20c)](M[_0x2c8270(0x21b)])),S(0x2,c['Inject'](c[_0x2c8270(0x1c4)])),S(0x3,c[_0x2c8270(0x20c)](c['Injector']))],p);const q=_0x2c8270(0x1fc),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x4d8ba2,_0x42d9d5,_0x7748bf,_0x2aaeca)=>{const _0x169471=_0x2c8270;for(var _0x59f568=_0x2aaeca>0x1?void 0x0:_0x2aaeca?A(_0x42d9d5,_0x7748bf):_0x42d9d5,_0x33e88a=_0x4d8ba2[_0x169471(0x1b9)]-0x1,_0x3d4708;_0x33e88a>=0x0;_0x33e88a--)(_0x3d4708=_0x4d8ba2[_0x33e88a])&&(_0x59f568=_0x3d4708(_0x59f568)||_0x59f568);return _0x59f568;},_=(_0x11885c,_0x3fa214)=>(_0x22e18b,_0x25bf48)=>_0x3fa214(_0x22e18b,_0x25bf48,_0x11885c);function Y(_0x13c9f7,_0x50ce81){const _0x1dacc3=_0x2c8270,_0x44a1c3=_0x13c9f7[_0x1dacc3(0x1e5)][0x0];return{..._0x50ce81,'id':_0x44a1c3[_0x1dacc3(0x1f8)],'resolved':_0x13c9f7[_0x1dacc3(0x20a)]===0x1,'dT':f(_0x44a1c3[_0x1dacc3(0x22e)]),'personId':_0x44a1c3['userId'],'threadId':_0x44a1c3[_0x1dacc3(0x1f3)]};}function G(_0x17c02f,_0x9898ae,_0x4e2e5d){const _0x23d7bb=_0x2c8270;var _0x915e74,_0x4b651d;if(((_0x4b651d=(_0x915e74=_0x17c02f==null?void 0x0:_0x17c02f['replies'])==null?void 0x0:_0x915e74[_0x23d7bb(0x1b9)])!=null?_0x4b651d:0x0)>0x0){const _0x2f8694=(_0x45b3ab,_0x10b6ce)=>({'id':_0x45b3ab['replyId'],'threadId':_0x45b3ab[_0x23d7bb(0x1f3)],'dT':f(_0x45b3ab[_0x23d7bb(0x22e)]),'personId':_0x45b3ab[_0x23d7bb(0x20b)],'resolved':_0x17c02f[_0x23d7bb(0x20a)]===I['Solved'],'unitId':_0x9898ae,'subUnitId':_0x4e2e5d,'text':JSON[_0x23d7bb(0x219)](_0x45b3ab[_0x23d7bb(0x1fb)]),'parentId':_0x10b6ce}),_0x1f0aad=_0x2f8694(_0x17c02f['replies'][0x0]);return{..._0x1f0aad,'children':_0x17c02f[_0x23d7bb(0x1e5)][_0x23d7bb(0x1cc)](0x1)[_0x23d7bb(0x228)](_0x4cb3da=>_0x2f8694(_0x4cb3da,_0x1f0aad['id']))};}return null;}function _0x3437(){const _0x38107b=['Delete','replies','bufferTime','Reply','parentId','COMMENT','UniverLicensePlugin','disposeWithMe','_sessionService','get','HTTPService','getCurrentUser','find','add','toStringTag','threadId','onStarting','resolveComment','/edit','2331224qULARv','replyId','resolved','pluginName','content','thread-comment-data-source.config','CustomRangeType','defineProperty','size','users','4095245bFUyvq','unitId','381704HASMOO','body','36EOMSau','rangeType','CollaborationSessionService','type','@univerjs-pro/collaboration-client','solved','userId','Inject','addUser','_threadCommentDataSource','_config','_httpService','@univerjs/core','Plugin','Solve','@univerjs/thread-comment','OpenOrReOpen','1NCZCvD','_commentService','Edit','parse','/reply','ThreadCommentModel','rangeId','post','getUnit','format','_userService','comment','ref','getUser','UNRECOGNIZED','forEach','delete','YYYY/MM/DD\x20HH:mm','map','dayjs','code','deleteComment','values','@univerjs/network','createTimestamp','UNIVER_UNKNOWN','subscribe','getOwnPropertyDescriptor','_injector','getMemberID','payload','UniverThreadCommentUIPlugin','Injector','root','length','UniverCollaborationClientPlugin','126TOLbVt','/add','_initDataSource','updateComment','Add','addComment','onReady','/delete','@univerjs/thread-comment-ui','UserManagerService','reply','/universer-api/comment/unit/','pipe','60DFoiKu','DependentOn','merge','personId','slice','_initUserSync','UniverThreadCommentDataSourcePlugin','3183257BKfnmR','error','userID','filter','_threadCommentModel','/list','customRanges','stringify','518270hJVoKG','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','336485SntqBT','123668vasTXJ','Disposable','user','_init','Solved','@univerjs-pro/license','requireSession','18KtBJFw','Unknown','_threadCommentDataSourceService'];_0x3437=function(){return _0x38107b;};return _0x3437();}let g=class{constructor(_0x1dbf79,_0x34f1da,_0xe4ffd4,_0x3ab3ab){const _0x17c342=_0x2c8270;this[_0x17c342(0x210)]=_0x1dbf79,this[_0x17c342(0x220)]=_0x34f1da,this[_0x17c342(0x1ec)]=_0xe4ffd4,this[_0x17c342(0x1b3)]=_0x3ab3ab;}async[_0x2c8270(0x1c0)](_0x1b576a){const _0x2ce34b=_0x2c8270;var _0x3cb8d7,_0x103278;const {parentId:_0x1ac7ea,unitId:_0x26dd25,text:_0x45d5f1,threadId:_0xf5885a}=_0x1b576a,_0x1b5b29=(_0x103278=(_0x3cb8d7=_0x45d5f1[_0x2ce34b(0x1d5)])==null?void 0x0:_0x3cb8d7['filter'](_0x1b6b0a=>_0x1b6b0a['rangeType']===c['CustomRangeType'][_0x2ce34b(0x1e9)])[_0x2ce34b(0x228)](_0x1413e4=>_0x1413e4['rangeId']))!=null?_0x103278:[],_0xf7d7bc=JSON[_0x2ce34b(0x1d6)](_0x45d5f1),_0x510351=(await this[_0x2ce34b(0x1ec)][_0x2ce34b(0x1e0)](_0x26dd25))[_0x2ce34b(0x1b4)]();if(_0x1ac7ea){const _0x36775d={'memberId':_0x510351,'unitId':_0x26dd25,'content':_0xf7d7bc,'mention':_0x1b5b29,'threadId':_0xf5885a},_0x46948b=(await this[_0x2ce34b(0x210)]['post'](_0x2ce34b(0x1c6)+_0x26dd25+_0x2ce34b(0x21a),{'body':_0x36775d}))['body'][_0x2ce34b(0x1c5)];return{..._0x1b576a,'id':_0x46948b['replyId'],'dT':c['dayjs'](+_0x46948b[_0x2ce34b(0x22e)])[_0x2ce34b(0x21f)](_0x2ce34b(0x227)),'personId':_0x46948b[_0x2ce34b(0x20b)]};}else{const _0x4739fe={'memberId':_0x510351,'unitId':_0x26dd25,'content':_0xf7d7bc,'mention':_0x1b5b29},_0x5443e1=await this[_0x2ce34b(0x210)]['post'](_0x2ce34b(0x1c6)+_0x26dd25+_0x2ce34b(0x1bc),{'body':_0x4739fe});return Y(_0x5443e1[_0x2ce34b(0x204)][_0x2ce34b(0x221)],_0x1b576a);}}async[_0x2c8270(0x1be)](_0x3f1ba5){const _0x3b5df5=_0x2c8270;var _0xcc0291,_0x389985;const {text:_0xa455df,unitId:_0x2bb6f3}=_0x3f1ba5,_0x2b70e8=(_0x389985=(_0xcc0291=_0xa455df[_0x3b5df5(0x1d5)])==null?void 0x0:_0xcc0291[_0x3b5df5(0x1d2)](_0x52a15e=>_0x52a15e[_0x3b5df5(0x206)]===c[_0x3b5df5(0x1fd)]['COMMENT'])[_0x3b5df5(0x228)](_0x4d8387=>_0x4d8387[_0x3b5df5(0x21c)]))!=null?_0x389985:[],_0x151d31=JSON[_0x3b5df5(0x1d6)](_0xa455df),_0x31c457=_0x3f1ba5[_0x3b5df5(0x1f3)],_0x47e2c1=_0x3f1ba5['id'],_0x2c20bf={'memberId':(await this[_0x3b5df5(0x1ec)][_0x3b5df5(0x1e0)](_0x2bb6f3))['getMemberID'](),'unitId':_0x2bb6f3,'threadId':_0x31c457,'mention':_0x2b70e8,'content':_0x151d31,'replyId':_0x47e2c1},_0x2054cd=await this[_0x3b5df5(0x210)]['post'](_0x3b5df5(0x1c6)+_0x2bb6f3+_0x3b5df5(0x1f6),{'body':_0x2c20bf});return!_0x2054cd[_0x3b5df5(0x204)][_0x3b5df5(0x1d0)]||_0x2054cd[_0x3b5df5(0x204)]['error'][_0x3b5df5(0x22a)]===0x1;}async[_0x2c8270(0x1f5)](_0x1c534f){const _0x196225=_0x2c8270,{unitId:_0x30d8d6}=_0x1c534f,_0x4ee4d1=_0x1c534f['threadId'],_0x531b74={'memberId':this[_0x196225(0x220)][_0x196225(0x1ef)]()[_0x196225(0x1d1)],'unitId':_0x30d8d6,'threadId':_0x4ee4d1,'solved':_0x1c534f[_0x196225(0x1f9)]?I[_0x196225(0x1de)]:I[_0x196225(0x215)]},_0x571e79=await this[_0x196225(0x210)][_0x196225(0x21d)](_0x196225(0x1c6)+_0x30d8d6+'/solved',{'body':_0x531b74});return!_0x571e79['body']['error']||_0x571e79['body']['error'][_0x196225(0x22a)]===0x1;}async[_0x2c8270(0x22b)](_0x1df84d,_0x11cfcf,_0x479bc9,_0x1e156c){const _0x16e779=_0x2c8270,_0x43f335={'memberId':(await this['_sessionService']['requireSession'](_0x1df84d))['getMemberID'](),'threadId':_0x479bc9,'replyId':_0x1e156c,'unitId':_0x1df84d},_0xd6ff58=await this[_0x16e779(0x210)][_0x16e779(0x21d)]('/universer-api/comment/unit/'+_0x1df84d+_0x16e779(0x1c2),{'body':_0x43f335});return!_0xd6ff58[_0x16e779(0x204)][_0x16e779(0x1d0)]||_0xd6ff58[_0x16e779(0x204)][_0x16e779(0x1d0)]['code']===0x1;}async['listComments'](_0x309ec7,_0x2a6d74,_0xbee809){const _0xb8992e=_0x2c8270,_0xd59d0={'unitId':_0x309ec7,'threadId':_0xbee809},_0x556cc4=await this['_httpService']['post'](_0xb8992e(0x1c6)+_0x309ec7+_0xb8992e(0x1d4),{'body':_0xd59d0}),_0x24bb23=_0xbee809[_0xb8992e(0x228)](_0x388e92=>G(_0x556cc4['body']['comments'][_0x388e92],_0x309ec7,_0x2a6d74))[_0xb8992e(0x1d2)](Boolean);return Object[_0xb8992e(0x22c)](_0x556cc4[_0xb8992e(0x204)][_0xb8992e(0x200)])[_0xb8992e(0x225)](_0x2523ac=>{const _0x3ad14f=_0xb8992e;this['_userService'][_0x3ad14f(0x20d)](_0x2523ac);}),_0x24bb23;}['saveCommentToSnapshot'](_0x23b9c7){const _0x5da570=_0x2c8270;return{'id':_0x23b9c7['id'],'threadId':_0x23b9c7[_0x5da570(0x1f3)],'ref':_0x23b9c7[_0x5da570(0x222)]};}};g=x([_(0x0,c[_0x2c8270(0x20c)](P[_0x2c8270(0x1ee)])),_(0x1,c[_0x2c8270(0x20c)](c[_0x2c8270(0x1c4)])),_(0x2,c[_0x2c8270(0x20c)](b[_0x2c8270(0x207)])),_(0x3,c['Inject'](c[_0x2c8270(0x1b7)]))],g);var H=Object[_0x2c8270(0x1b2)],J=(_0x5e60bf,_0x48f300,_0x4e3fa0,_0x3e522f)=>{const _0x2f16a5=_0x2c8270;for(var _0x4727bd=_0x3e522f>0x1?void 0x0:_0x3e522f?H(_0x48f300,_0x4e3fa0):_0x48f300,_0x5134f1=_0x5e60bf[_0x2f16a5(0x1b9)]-0x1,_0x2aa726;_0x5134f1>=0x0;_0x5134f1--)(_0x2aa726=_0x5e60bf[_0x5134f1])&&(_0x4727bd=_0x2aa726(_0x4727bd)||_0x4727bd);return _0x4727bd;},y=(_0x31805c,_0x1ffa5f)=>(_0x2af3f0,_0x586d7c)=>_0x1ffa5f(_0x2af3f0,_0x586d7c,_0x31805c);let C=class extends c['Disposable']{constructor(_0x4e2d30,_0x5d3ece){const _0x2db353=_0x2c8270;super(),this['_threadCommentDataSourceService']=_0x4e2d30,this[_0x2db353(0x20e)]=_0x5d3ece,this[_0x2db353(0x1bd)]();}[_0x2c8270(0x1bd)](){const _0x32ff99=_0x2c8270;this[_0x32ff99(0x1e3)]['dataSource']=this[_0x32ff99(0x20e)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c['Inject'](g))],C);var F=Object[_0x2c8270(0x1fe)],L=Object['getOwnPropertyDescriptor'],Z=(_0x2bc437,_0x58f40f,_0x11140d)=>_0x58f40f in _0x2bc437?F(_0x2bc437,_0x58f40f,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x11140d}):_0x2bc437[_0x58f40f]=_0x11140d,W=(_0x412185,_0x16591d,_0x2ca9dc,_0x4faf95)=>{const _0x23cb0b=_0x2c8270;for(var _0x2ac1e4=_0x4faf95>0x1?void 0x0:_0x4faf95?L(_0x16591d,_0x2ca9dc):_0x16591d,_0x1ddd8e=_0x412185[_0x23cb0b(0x1b9)]-0x1,_0x2e1ea0;_0x1ddd8e>=0x0;_0x1ddd8e--)(_0x2e1ea0=_0x412185[_0x1ddd8e])&&(_0x2ac1e4=_0x2e1ea0(_0x2ac1e4)||_0x2ac1e4);return _0x2ac1e4;},O=(_0x151174,_0xcb9186)=>(_0x3bef74,_0x22e250)=>_0xcb9186(_0x3bef74,_0x22e250,_0x151174),N=(_0x54be47,_0x47b9db,_0x1a6bf8)=>Z(_0x54be47,typeof _0x47b9db!='symbol'?_0x47b9db+'':_0x47b9db,_0x1a6bf8);exports[_0x2c8270(0x1ce)]=class extends c[_0x2c8270(0x212)]{constructor(_0xe80307=D,_0x1387b1,_0x486353){const _0x26ab11=_0x2c8270;super(),this[_0x26ab11(0x20f)]=_0xe80307,this[_0x26ab11(0x1b3)]=_0x1387b1,this['_configService']=_0x486353;const {..._0xc6173}=c[_0x26ab11(0x1ca)]({},D,this[_0x26ab11(0x20f)]);this['_configService']['setConfig'](q,_0xc6173);}[_0x2c8270(0x1f4)](){const _0x51cb87=_0x2c8270;[[g],[C],[p]][_0x51cb87(0x225)](_0x58c002=>{const _0x4cd4e6=_0x51cb87;this[_0x4cd4e6(0x1b3)][_0x4cd4e6(0x1f1)](_0x58c002);});}[_0x2c8270(0x1c1)](){const _0x5850b3=_0x2c8270;this[_0x5850b3(0x1b3)][_0x5850b3(0x1ed)](C),this[_0x5850b3(0x1b3)]['get'](p);}},N(exports['UniverThreadCommentDataSourcePlugin'],_0x2c8270(0x1fa),U),N(exports['UniverThreadCommentDataSourcePlugin'],'type',c['UniverInstanceType'][_0x2c8270(0x1b0)]),exports[_0x2c8270(0x1ce)]=W([c[_0x2c8270(0x1c9)](j[_0x2c8270(0x1b6)],b[_0x2c8270(0x1ba)],T[_0x2c8270(0x1ea)]),O(0x1,c[_0x2c8270(0x20c)](c['Injector'])),O(0x2,c['IConfigService'])],exports[_0x2c8270(0x1ce)]);
|
|
1
|
+
'use strict';const _0x3d0c1a=_0x4bea;(function(_0x3ed824,_0x5a80cf){const _0x519c7b=_0x4bea,_0x11079c=_0x3ed824();while(!![]){try{const _0x568259=-parseInt(_0x519c7b(0x7c))/0x1*(parseInt(_0x519c7b(0xb6))/0x2)+parseInt(_0x519c7b(0x91))/0x3*(-parseInt(_0x519c7b(0x9c))/0x4)+-parseInt(_0x519c7b(0x9f))/0x5+-parseInt(_0x519c7b(0x7b))/0x6*(-parseInt(_0x519c7b(0xa6))/0x7)+-parseInt(_0x519c7b(0xe1))/0x8*(parseInt(_0x519c7b(0xb1))/0x9)+parseInt(_0x519c7b(0xd8))/0xa*(-parseInt(_0x519c7b(0xda))/0xb)+-parseInt(_0x519c7b(0xb7))/0xc*(-parseInt(_0x519c7b(0xd1))/0xd);if(_0x568259===_0x5a80cf)break;else _0x11079c['push'](_0x11079c['shift']());}catch(_0x519a40){_0x11079c['push'](_0x11079c['shift']());}}}(_0x4559,0xa3ec7));Object[_0x3d0c1a(0x90)](exports,Symbol[_0x3d0c1a(0xb8)],{'value':_0x3d0c1a(0x92)});function _0x4bea(_0x39c9d1,_0x334aa4){const _0x4559d9=_0x4559();return _0x4bea=function(_0x4bea1a,_0x15713e){_0x4bea1a=_0x4bea1a-0x69;let _0x1163f6=_0x4559d9[_0x4bea1a];return _0x1163f6;},_0x4bea(_0x39c9d1,_0x334aa4);}const b=require(_0x3d0c1a(0xe9)),T=require(_0x3d0c1a(0x95)),c=require(_0x3d0c1a(0xe0)),j=require('@univerjs/thread-comment-ui'),M=require(_0x3d0c1a(0xc4)),w=require('rxjs'),P=require(_0x3d0c1a(0x81)),U=_0x3d0c1a(0xb9);var I=(_0x169807=>(_0x169807[_0x169807[_0x3d0c1a(0xc1)]=0x0]=_0x3d0c1a(0xc1),_0x169807[_0x169807[_0x3d0c1a(0x76)]=0x1]=_0x3d0c1a(0x76),_0x169807[_0x169807[_0x3d0c1a(0x8f)]=-0x1]='UNRECOGNIZED',_0x169807))(I||{}),v=(_0x2d2e25=>(_0x2d2e25[_0x2d2e25[_0x3d0c1a(0xb3)]=0x0]=_0x3d0c1a(0xb3),_0x2d2e25[_0x2d2e25[_0x3d0c1a(0x97)]=0x1]='Add',_0x2d2e25[_0x2d2e25[_0x3d0c1a(0x8b)]=0x2]='Reply',_0x2d2e25[_0x2d2e25[_0x3d0c1a(0xbe)]=0x3]=_0x3d0c1a(0xbe),_0x2d2e25[_0x2d2e25[_0x3d0c1a(0x85)]=0x4]=_0x3d0c1a(0x85),_0x2d2e25[_0x2d2e25[_0x3d0c1a(0x7f)]=0x5]=_0x3d0c1a(0x7f),_0x2d2e25[_0x2d2e25[_0x3d0c1a(0x8f)]=-0x1]=_0x3d0c1a(0x8f),_0x2d2e25))(v||{});const f=_0x28c379=>c['dayjs'](new Date(+_0x28c379))[_0x3d0c1a(0xc9)]('YYYY/MM/DD\x20HH:mm'),R=async(_0x5119a3,_0x3b991f)=>{const _0x3e669a=_0x3d0c1a,_0x127f5f=_0x5119a3[_0x3e669a(0xbc)](c[_0x3e669a(0x93)]),_0x4c0416=_0x5119a3['get'](P['HTTPService']);_0x3b991f[_0x3e669a(0xb5)](_0x1f496d=>{const _0x5c90a3=_0x3e669a;_0x127f5f[_0x5c90a3(0x89)](_0x1f496d)&&_0x3b991f[_0x5c90a3(0xa4)](_0x1f496d);}),_0x3b991f[_0x3e669a(0x6a)]&&(await _0x4c0416[_0x3e669a(0xbc)](_0x3e669a(0xaf),{'params':{'userIDs':[..._0x3b991f]}}))['body']['users'][_0x3e669a(0xb5)](_0x3f33da=>{const _0x46b3ab=_0x3e669a;_0x3f33da&&_0x127f5f[_0x46b3ab(0xe6)](_0x3f33da);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x96f8aa,_0x29a9ca,_0x46f514,_0x14bcb0)=>{const _0x50df60=_0x3d0c1a;for(var _0x363376=_0x14bcb0>0x1?void 0x0:_0x14bcb0?$(_0x29a9ca,_0x46f514):_0x29a9ca,_0x4fa1f1=_0x96f8aa[_0x50df60(0xca)]-0x1,_0x4cfd9f;_0x4fa1f1>=0x0;_0x4fa1f1--)(_0x4cfd9f=_0x96f8aa[_0x4fa1f1])&&(_0x363376=_0x4cfd9f(_0x363376)||_0x363376);return _0x363376;},S=(_0x3463a1,_0x3d4acc)=>(_0x5baf00,_0x54715c)=>_0x3d4acc(_0x5baf00,_0x54715c,_0x3463a1);let p=class extends c[_0x3d0c1a(0xc6)]{constructor(_0x576b09,_0xbe3a8e,_0x54807,_0x38aba4){const _0x363067=_0x3d0c1a;super(),this['_commentService']=_0x576b09,this[_0x363067(0x71)]=_0xbe3a8e,this['_userService']=_0x54807,this['_injector']=_0x38aba4,this['_init'](),this[_0x363067(0x74)]();}['_initUserSync'](){const _0x18bcbc=_0x3d0c1a;this['disposeWithMe'](this[_0x18bcbc(0x71)][_0x18bcbc(0xd0)][_0x18bcbc(0x84)](w[_0x18bcbc(0x9e)](0x10))[_0x18bcbc(0x98)](_0x3ae7ad=>{const _0x17a4fc=_0x18bcbc,_0x5e9f53=new Set();_0x3ae7ad[_0x17a4fc(0xb5)](_0x405549=>{const _0x4a5643=_0x17a4fc;switch(_0x405549[_0x4a5643(0x7e)]){case _0x4a5643(0xa5):{const _0x10f0b3=_0x405549[_0x4a5643(0xbb)]['personId'];_0x5e9f53[_0x4a5643(0xa5)](_0x10f0b3);break;}}}),R(this[_0x17a4fc(0xa8)],_0x5e9f53);}));}[_0x3d0c1a(0xc2)](){const _0x4751b0=_0x3d0c1a;this[_0x4751b0(0xcb)](this[_0x4751b0(0x77)]['commentUpdate$'][_0x4751b0(0x98)](async _0x522bdb=>{const _0x362b1a=_0x4751b0;var _0x3dcfb1,_0xcb9b28,_0x51042b,_0x984fa3;const _0x5e071f=(_0x3dcfb1=this[_0x362b1a(0x71)][_0x362b1a(0xa7)](_0x522bdb['unitId'])[_0x362b1a(0xad)](_0x488573=>_0x488573[_0x362b1a(0x6c)]===_0x522bdb[_0x362b1a(0x6c)]))==null?void 0x0:_0x3dcfb1[_0x362b1a(0x88)];if(!_0x5e071f)return;const {unitId:_0x49abb1,subUnitId:_0x1deb77}=_0x5e071f;switch(_0x522bdb[_0x362b1a(0x7a)]&&this[_0x362b1a(0xd2)]['addUser'](_0x522bdb[_0x362b1a(0x7a)]),_0x522bdb['type']){case v[_0x362b1a(0x97)]:break;case v[_0x362b1a(0x8b)]:{this[_0x362b1a(0x71)][_0x362b1a(0xb0)](_0x49abb1,_0x1deb77,{'unitId':_0x49abb1,'subUnitId':_0x1deb77,'ref':'','id':_0x522bdb[_0x362b1a(0x6e)],'dT':f(+_0x522bdb['createTimestamp']),'threadId':_0x522bdb['threadId'],'personId':(_0x51042b=(_0xcb9b28=_0x522bdb[_0x362b1a(0x7a)])==null?void 0x0:_0xcb9b28[_0x362b1a(0x70)])!=null?_0x51042b:_0x522bdb['userId'],'text':JSON['parse'](_0x522bdb[_0x362b1a(0x7d)]),'parentId':_0x5e071f['id']});break;}case v[_0x362b1a(0x85)]:{const _0x136462=this[_0x362b1a(0x71)][_0x362b1a(0x9b)](_0x49abb1,_0x1deb77,_0x522bdb[_0x362b1a(0x6e)]);_0x136462&&_0x136462[_0x362b1a(0xce)]&&this[_0x362b1a(0x71)][_0x362b1a(0xd6)](_0x49abb1,_0x1deb77,_0x522bdb[_0x362b1a(0x6e)]);break;}case v['Edit']:{this[_0x362b1a(0x71)]['updateComment'](_0x49abb1,_0x1deb77,{'commentId':_0x522bdb[_0x362b1a(0x6e)],'text':JSON[_0x362b1a(0xae)](_0x522bdb['content'])});break;}case v[_0x362b1a(0x7f)]:{const _0x218ee3=(_0x984fa3=this[_0x362b1a(0x71)][_0x362b1a(0xa7)](_0x522bdb['unitId'])[_0x362b1a(0xad)](_0x1a9619=>_0x1a9619[_0x362b1a(0x6c)]===_0x522bdb[_0x362b1a(0x6c)]))==null?void 0x0:_0x984fa3[_0x362b1a(0x88)];_0x218ee3&&this[_0x362b1a(0x71)]['resolveComment'](_0x49abb1,_0x1deb77,_0x218ee3['id'],_0x522bdb[_0x362b1a(0xc5)]===I[_0x362b1a(0x76)]);break;}}}));}};function _0x4559(){const _0x3b81f5=['/universer-api/user/list','addComment','29466pNtcRa','code','Unknown','CollaborationSessionService','forEach','1849658FjfSJH','33468pZeQlf','toStringTag','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','UniverLicensePlugin','payload','get','_initDataSource','Edit','syncUpdateMutationToColla','users','OpenOrReOpen','_init','IThreadCommentDataSourceService','@univerjs/thread-comment','solved','Disposable','UniverThreadCommentDataSourcePlugin','map','format','length','disposeWithMe','ref','getCurrentUser','parentId','ThreadCommentModel','commentUpdate$','12311kaVlNs','_userService','getMemberID','/list','filter','deleteComment','_config','1250BdTofv','userId','18260TfVEWG','thread-comment-data-source.config','CustomRangeType','/solved','post','Plugin','@univerjs/core','2432WBxhlg','saveCommentToSnapshot','/universer-api/comment/unit/','symbol','dayjs','addUser','_configService','comments','@univerjs-pro/collaboration-client','reply','size','customRanges','threadId','body','replyId','YYYY/MM/DD\x20HH:mm','userID','_threadCommentModel','rangeId','onStarting','_initUserSync','COMMENT','Solved','_commentService','values','dataSource','user','2491326VLEZwd','1nGMHZt','content','type','Solve','/edit','@univerjs/network','_threadCommentDataSource','_sessionService','pipe','Delete','stringify','Inject','root','getUser','_threadCommentDataSourceService','Reply','comment','/reply','resolved','UNRECOGNIZED','defineProperty','170337YwRRIn','Module','UserManagerService','requireSession','@univerjs-pro/license','onReady','Add','subscribe','IConfigService','_httpService','getComment','32GQwpwJ','createTimestamp','bufferTime','1091685gOKLsk','error','pluginName','Injector','replies','delete','add','14ctYpNg','getUnit','_injector','getOwnPropertyDescriptor','listComments','updateComment','UniverCollaborationClientPlugin','find','parse'];_0x4559=function(){return _0x3b81f5;};return _0x4559();}p=E([S(0x0,c[_0x3d0c1a(0x87)](b['CommentService'])),S(0x1,c[_0x3d0c1a(0x87)](M[_0x3d0c1a(0xcf)])),S(0x2,c['Inject'](c[_0x3d0c1a(0x93)])),S(0x3,c['Inject'](c[_0x3d0c1a(0xa2)]))],p);const q=_0x3d0c1a(0xdb),D={};var A=Object[_0x3d0c1a(0xa9)],x=(_0x1fdc98,_0x36ff60,_0x5b7ecd,_0x4d43a8)=>{const _0x1bf6b9=_0x3d0c1a;for(var _0x251a5d=_0x4d43a8>0x1?void 0x0:_0x4d43a8?A(_0x36ff60,_0x5b7ecd):_0x36ff60,_0x1441cc=_0x1fdc98[_0x1bf6b9(0xca)]-0x1,_0x5463b2;_0x1441cc>=0x0;_0x1441cc--)(_0x5463b2=_0x1fdc98[_0x1441cc])&&(_0x251a5d=_0x5463b2(_0x251a5d)||_0x251a5d);return _0x251a5d;},_=(_0x315617,_0x7bc0b0)=>(_0x282bc6,_0x4b481c)=>_0x7bc0b0(_0x282bc6,_0x4b481c,_0x315617);function Y(_0x21d9e0,_0x4ce1b2){const _0x1a42a7=_0x3d0c1a,_0x531502=_0x21d9e0['replies'][0x0];return{..._0x4ce1b2,'id':_0x531502[_0x1a42a7(0x6e)],'resolved':_0x21d9e0[_0x1a42a7(0xc5)]===0x1,'dT':f(_0x531502['createTimestamp']),'personId':_0x531502[_0x1a42a7(0xd9)],'threadId':_0x531502[_0x1a42a7(0x6c)]};}function G(_0x210f98,_0x3ef0ca,_0x4af8fd){const _0x197592=_0x3d0c1a;var _0x182681,_0x3fd021;if(((_0x3fd021=(_0x182681=_0x210f98==null?void 0x0:_0x210f98['replies'])==null?void 0x0:_0x182681[_0x197592(0xca)])!=null?_0x3fd021:0x0)>0x0){const _0x341d04=(_0x5ddadf,_0x5ce97d)=>({'id':_0x5ddadf[_0x197592(0x6e)],'threadId':_0x5ddadf[_0x197592(0x6c)],'dT':f(_0x5ddadf['createTimestamp']),'personId':_0x5ddadf[_0x197592(0xd9)],'resolved':_0x210f98[_0x197592(0xc5)]===I['Solved'],'unitId':_0x3ef0ca,'subUnitId':_0x4af8fd,'text':JSON[_0x197592(0xae)](_0x5ddadf['content']),'parentId':_0x5ce97d}),_0x1b1063=_0x341d04(_0x210f98[_0x197592(0xa3)][0x0]);return{..._0x1b1063,'children':_0x210f98[_0x197592(0xa3)]['slice'](0x1)[_0x197592(0xc8)](_0x5b8be7=>_0x341d04(_0x5b8be7,_0x1b1063['id']))};}return null;}let g=class{constructor(_0x5f4b74,_0x37682c,_0xd32b27,_0x40bdd9){const _0x49ddfa=_0x3d0c1a;this[_0x49ddfa(0x9a)]=_0x5f4b74,this['_userService']=_0x37682c,this[_0x49ddfa(0x83)]=_0xd32b27,this[_0x49ddfa(0xa8)]=_0x40bdd9;}async['addComment'](_0x20ef0d){const _0x55db83=_0x3d0c1a;var _0x66b934,_0xed575e;const {parentId:_0x3cd42a,unitId:_0x45337f,text:_0x1beeac,threadId:_0x3fa2dd}=_0x20ef0d,_0x452b2c=(_0xed575e=(_0x66b934=_0x1beeac[_0x55db83(0x6b)])==null?void 0x0:_0x66b934[_0x55db83(0xd5)](_0xd00864=>_0xd00864['rangeType']===c[_0x55db83(0xdc)][_0x55db83(0x75)])['map'](_0x53fa1a=>_0x53fa1a['rangeId']))!=null?_0xed575e:[],_0x4840ce=JSON['stringify'](_0x1beeac),_0x4dafa7=(await this[_0x55db83(0x83)][_0x55db83(0x94)](_0x45337f))['getMemberID']();if(_0x3cd42a){const _0x155474={'memberId':_0x4dafa7,'unitId':_0x45337f,'content':_0x4840ce,'mention':_0x452b2c,'threadId':_0x3fa2dd},_0x22d473=(await this['_httpService']['post']('/universer-api/comment/unit/'+_0x45337f+_0x55db83(0x8d),{'body':_0x155474}))[_0x55db83(0x6d)][_0x55db83(0x69)];return{..._0x20ef0d,'id':_0x22d473[_0x55db83(0x6e)],'dT':c[_0x55db83(0xe5)](+_0x22d473[_0x55db83(0x9d)])['format'](_0x55db83(0x6f)),'personId':_0x22d473['userId']};}else{const _0x270f19={'memberId':_0x4dafa7,'unitId':_0x45337f,'content':_0x4840ce,'mention':_0x452b2c},_0x396a89=await this[_0x55db83(0x9a)]['post']('/universer-api/comment/unit/'+_0x45337f+'/add',{'body':_0x270f19});return Y(_0x396a89[_0x55db83(0x6d)][_0x55db83(0x8c)],_0x20ef0d);}}async[_0x3d0c1a(0xab)](_0x35764f){const _0x1937b5=_0x3d0c1a;var _0x5210af,_0x2dd192;const {text:_0x382fbe,unitId:_0x5d9fbe}=_0x35764f,_0x4b54b1=(_0x2dd192=(_0x5210af=_0x382fbe[_0x1937b5(0x6b)])==null?void 0x0:_0x5210af[_0x1937b5(0xd5)](_0x24689c=>_0x24689c['rangeType']===c[_0x1937b5(0xdc)][_0x1937b5(0x75)])['map'](_0x2bf6b9=>_0x2bf6b9[_0x1937b5(0x72)]))!=null?_0x2dd192:[],_0x3ddb3b=JSON[_0x1937b5(0x86)](_0x382fbe),_0x17636c=_0x35764f[_0x1937b5(0x6c)],_0x9f72ff=_0x35764f['id'],_0x55e4bc={'memberId':(await this['_sessionService']['requireSession'](_0x5d9fbe))['getMemberID'](),'unitId':_0x5d9fbe,'threadId':_0x17636c,'mention':_0x4b54b1,'content':_0x3ddb3b,'replyId':_0x9f72ff},_0x417a4d=await this['_httpService'][_0x1937b5(0xde)](_0x1937b5(0xe3)+_0x5d9fbe+_0x1937b5(0x80),{'body':_0x55e4bc});return!_0x417a4d[_0x1937b5(0x6d)][_0x1937b5(0xa0)]||_0x417a4d[_0x1937b5(0x6d)][_0x1937b5(0xa0)]['code']===0x1;}async['resolveComment'](_0x4593b6){const _0x36c25c=_0x3d0c1a,{unitId:_0x3267b1}=_0x4593b6,_0x5d8e62=_0x4593b6[_0x36c25c(0x6c)],_0xcc4b2c={'memberId':this['_userService'][_0x36c25c(0xcd)]()[_0x36c25c(0x70)],'unitId':_0x3267b1,'threadId':_0x5d8e62,'solved':_0x4593b6[_0x36c25c(0x8e)]?I[_0x36c25c(0x76)]:I[_0x36c25c(0xc1)]},_0x3cff15=await this['_httpService'][_0x36c25c(0xde)](_0x36c25c(0xe3)+_0x3267b1+_0x36c25c(0xdd),{'body':_0xcc4b2c});return!_0x3cff15['body'][_0x36c25c(0xa0)]||_0x3cff15[_0x36c25c(0x6d)]['error']['code']===0x1;}async[_0x3d0c1a(0xd6)](_0x2f6b5e,_0x46498c,_0x35910e,_0x15f7a3){const _0x2b12cb=_0x3d0c1a,_0x200a80={'memberId':(await this[_0x2b12cb(0x83)]['requireSession'](_0x2f6b5e))[_0x2b12cb(0xd3)](),'threadId':_0x35910e,'replyId':_0x15f7a3,'unitId':_0x2f6b5e},_0x180ef2=await this[_0x2b12cb(0x9a)][_0x2b12cb(0xde)](_0x2b12cb(0xe3)+_0x2f6b5e+'/delete',{'body':_0x200a80});return!_0x180ef2[_0x2b12cb(0x6d)]['error']||_0x180ef2[_0x2b12cb(0x6d)]['error'][_0x2b12cb(0xb2)]===0x1;}async[_0x3d0c1a(0xaa)](_0x37f2a3,_0x77374,_0x48b2cb){const _0x2aaa55=_0x3d0c1a,_0x2e7164={'unitId':_0x37f2a3,'threadId':_0x48b2cb},_0x4554af=await this['_httpService'][_0x2aaa55(0xde)](_0x2aaa55(0xe3)+_0x37f2a3+_0x2aaa55(0xd4),{'body':_0x2e7164}),_0x454ec0=_0x48b2cb[_0x2aaa55(0xc8)](_0x4c75b7=>G(_0x4554af[_0x2aaa55(0x6d)][_0x2aaa55(0xe8)][_0x4c75b7],_0x37f2a3,_0x77374))[_0x2aaa55(0xd5)](Boolean);return Object[_0x2aaa55(0x78)](_0x4554af[_0x2aaa55(0x6d)][_0x2aaa55(0xc0)])[_0x2aaa55(0xb5)](_0x14ccf0=>{const _0x536545=_0x2aaa55;this[_0x536545(0xd2)]['addUser'](_0x14ccf0);}),_0x454ec0;}[_0x3d0c1a(0xe2)](_0x3ac89c){const _0x599a4e=_0x3d0c1a;return{'id':_0x3ac89c['id'],'threadId':_0x3ac89c[_0x599a4e(0x6c)],'ref':_0x3ac89c[_0x599a4e(0xcc)]};}};g=x([_(0x0,c[_0x3d0c1a(0x87)](P['HTTPService'])),_(0x1,c[_0x3d0c1a(0x87)](c[_0x3d0c1a(0x93)])),_(0x2,c[_0x3d0c1a(0x87)](b[_0x3d0c1a(0xb4)])),_(0x3,c[_0x3d0c1a(0x87)](c[_0x3d0c1a(0xa2)]))],g);var H=Object[_0x3d0c1a(0xa9)],J=(_0xade469,_0xf1bafe,_0x525bdc,_0x38bd6a)=>{const _0x2b377c=_0x3d0c1a;for(var _0x7a30eb=_0x38bd6a>0x1?void 0x0:_0x38bd6a?H(_0xf1bafe,_0x525bdc):_0xf1bafe,_0x367d5a=_0xade469[_0x2b377c(0xca)]-0x1,_0xfd5870;_0x367d5a>=0x0;_0x367d5a--)(_0xfd5870=_0xade469[_0x367d5a])&&(_0x7a30eb=_0xfd5870(_0x7a30eb)||_0x7a30eb);return _0x7a30eb;},y=(_0x65a432,_0x548697)=>(_0x58a14d,_0x217e54)=>_0x548697(_0x58a14d,_0x217e54,_0x65a432);let C=class extends c[_0x3d0c1a(0xc6)]{constructor(_0x57143e,_0x5e0345){const _0x10cd98=_0x3d0c1a;super(),this[_0x10cd98(0x8a)]=_0x57143e,this[_0x10cd98(0x82)]=_0x5e0345,this[_0x10cd98(0xbd)]();}['_initDataSource'](){const _0x2e6648=_0x3d0c1a;this['_threadCommentDataSourceService'][_0x2e6648(0x79)]=this[_0x2e6648(0x82)],this[_0x2e6648(0x8a)][_0x2e6648(0xbf)]=!0x1;}};C=J([y(0x0,M[_0x3d0c1a(0xc3)]),y(0x1,c[_0x3d0c1a(0x87)](g))],C);var F=Object[_0x3d0c1a(0x90)],L=Object[_0x3d0c1a(0xa9)],Z=(_0x117156,_0x25d973,_0x15ce9f)=>_0x25d973 in _0x117156?F(_0x117156,_0x25d973,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x15ce9f}):_0x117156[_0x25d973]=_0x15ce9f,W=(_0xb0d699,_0x57e9a9,_0xdc65bd,_0x57cf0e)=>{const _0x477002=_0x3d0c1a;for(var _0x15e92f=_0x57cf0e>0x1?void 0x0:_0x57cf0e?L(_0x57e9a9,_0xdc65bd):_0x57e9a9,_0x5c0eb0=_0xb0d699[_0x477002(0xca)]-0x1,_0x3db8e8;_0x5c0eb0>=0x0;_0x5c0eb0--)(_0x3db8e8=_0xb0d699[_0x5c0eb0])&&(_0x15e92f=_0x3db8e8(_0x15e92f)||_0x15e92f);return _0x15e92f;},O=(_0x8b8ac2,_0x1e2631)=>(_0x1c2566,_0x502b8b)=>_0x1e2631(_0x1c2566,_0x502b8b,_0x8b8ac2),N=(_0x5547d8,_0x9f0b,_0x184710)=>Z(_0x5547d8,typeof _0x9f0b!=_0x3d0c1a(0xe4)?_0x9f0b+'':_0x9f0b,_0x184710);exports[_0x3d0c1a(0xc7)]=class extends c[_0x3d0c1a(0xdf)]{constructor(_0xc7fa7a=D,_0x17fcae,_0x2b8e89){const _0x3670b1=_0x3d0c1a;super(),this[_0x3670b1(0xd7)]=_0xc7fa7a,this['_injector']=_0x17fcae,this[_0x3670b1(0xe7)]=_0x2b8e89;const {..._0x2c17af}=c['merge']({},D,this[_0x3670b1(0xd7)]);this[_0x3670b1(0xe7)]['setConfig'](q,_0x2c17af);}[_0x3d0c1a(0x73)](){const _0xa82ea9=_0x3d0c1a;[[g],[C],[p]][_0xa82ea9(0xb5)](_0x1cc6c2=>{this['_injector']['add'](_0x1cc6c2);});}[_0x3d0c1a(0x96)](){const _0x195e4c=_0x3d0c1a;this[_0x195e4c(0xa8)][_0x195e4c(0xbc)](C),this[_0x195e4c(0xa8)][_0x195e4c(0xbc)](p);}},N(exports[_0x3d0c1a(0xc7)],_0x3d0c1a(0xa1),U),N(exports['UniverThreadCommentDataSourcePlugin'],'type',c['UniverInstanceType']['UNIVER_UNKNOWN']),exports[_0x3d0c1a(0xc7)]=W([c['DependentOn'](j['UniverThreadCommentUIPlugin'],b[_0x3d0c1a(0xac)],T[_0x3d0c1a(0xba)]),O(0x1,c[_0x3d0c1a(0x87)](c['Injector'])),O(0x2,c[_0x3d0c1a(0x99)])],exports[_0x3d0c1a(0xc7)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x118477=_0xe34e;(function(_0x356792,_0x421ed7){const _0x2d36a1=_0xe34e,_0x9bf74=_0x356792();while(!![]){try{const _0x171318=-parseInt(_0x2d36a1(0xf2))/0x1+parseInt(_0x2d36a1(0x123))/0x2*(-parseInt(_0x2d36a1(0x134))/0x3)+parseInt(_0x2d36a1(0x13d))/0x4*(parseInt(_0x2d36a1(0x12f))/0x5)+parseInt(_0x2d36a1(0x10d))/0x6+parseInt(_0x2d36a1(0x14b))/0x7+-parseInt(_0x2d36a1(0x12d))/0x8*(parseInt(_0x2d36a1(0x130))/0x9)+parseInt(_0x2d36a1(0x102))/0xa;if(_0x171318===_0x421ed7)break;else _0x9bf74['push'](_0x9bf74['shift']());}catch(_0x4edaba){_0x9bf74['push'](_0x9bf74['shift']());}}}(_0x36d7,0xd0d28));import{CommentService as _0x1448e6,CollaborationSessionService as _0x2a8abb,UniverCollaborationClientPlugin as _0x243904}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4f60b2}from'@univerjs-pro/license';import{dayjs as _0x296005,UserManagerService as _0xca3c4f,Inject as _0x1ab595,Injector as _0x3a9059,Disposable as _0x4abb9d,CustomRangeType as _0x10593c,UniverInstanceType as _0x7eb5b0,DependentOn as _0x652ecb,IConfigService as _0x49fb74,Plugin as _0x5214e1,merge as _0x5d8e9c}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x255d00}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x1fe52e,IThreadCommentDataSourceService as _0x37829d}from'@univerjs/thread-comment';import{bufferTime as _0x1403eb}from'rxjs';import{HTTPService as _0x1b49ae}from'@univerjs/network';const W=_0x118477(0x10c);var I=(_0x13c7fe=>(_0x13c7fe[_0x13c7fe['OpenOrReOpen']=0x0]=_0x118477(0x13c),_0x13c7fe[_0x13c7fe[_0x118477(0x10b)]=0x1]=_0x118477(0x10b),_0x13c7fe[_0x13c7fe[_0x118477(0xf8)]=-0x1]=_0x118477(0xf8),_0x13c7fe))(I||{}),v=(_0x5f4174=>(_0x5f4174[_0x5f4174[_0x118477(0x101)]=0x0]=_0x118477(0x101),_0x5f4174[_0x5f4174[_0x118477(0xef)]=0x1]=_0x118477(0xef),_0x5f4174[_0x5f4174[_0x118477(0x138)]=0x2]=_0x118477(0x138),_0x5f4174[_0x5f4174[_0x118477(0xfa)]=0x3]='Edit',_0x5f4174[_0x5f4174['Delete']=0x4]=_0x118477(0x127),_0x5f4174[_0x5f4174[_0x118477(0x122)]=0x5]='Solve',_0x5f4174[_0x5f4174[_0x118477(0xf8)]=-0x1]=_0x118477(0xf8),_0x5f4174))(v||{});const D=_0x1dc453=>_0x296005(new Date(+_0x1dc453))[_0x118477(0x108)](_0x118477(0x13b)),B=async(_0xc92a9f,_0x376fea)=>{const _0x4e178a=_0x118477,_0x322ed4=_0xc92a9f[_0x4e178a(0x126)](_0xca3c4f),_0x398372=_0xc92a9f[_0x4e178a(0x126)](_0x1b49ae);_0x376fea[_0x4e178a(0x14e)](_0x42be50=>{_0x322ed4['getUser'](_0x42be50)&&_0x376fea['delete'](_0x42be50);}),_0x376fea[_0x4e178a(0xfb)]&&(await _0x398372[_0x4e178a(0x126)](_0x4e178a(0x124),{'params':{'userIDs':[..._0x376fea]}}))['body'][_0x4e178a(0x13a)][_0x4e178a(0x14e)](_0x6f3e97=>{const _0x2fe8b9=_0x4e178a;_0x6f3e97&&_0x322ed4[_0x2fe8b9(0xfe)](_0x6f3e97);});};var K=Object[_0x118477(0x11b)],V=(_0x3d39c3,_0x5f4370,_0x1ed8f7,_0x48dc82)=>{const _0x4e890e=_0x118477;for(var _0x58e24f=_0x48dc82>0x1?void 0x0:_0x48dc82?K(_0x5f4370,_0x1ed8f7):_0x5f4370,_0x29d8a7=_0x3d39c3[_0x4e890e(0x141)]-0x1,_0x468cbe;_0x29d8a7>=0x0;_0x29d8a7--)(_0x468cbe=_0x3d39c3[_0x29d8a7])&&(_0x58e24f=_0x468cbe(_0x58e24f)||_0x58e24f);return _0x58e24f;},p=(_0x5dd42c,_0x580dc0)=>(_0x4dec05,_0x2409d8)=>_0x580dc0(_0x4dec05,_0x2409d8,_0x5dd42c);function _0x36d7(){const _0x294c58=['onStarting','onReady','Solved','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','2180784XrkWAa','content','replies','user','resolved','threadId','updateComment','subscribe','_init','_config','/reply','disposeWithMe','_commentService','add','getOwnPropertyDescriptor','symbol','_threadCommentDataSource','body','_threadCommentModel','reply','saveCommentToSnapshot','Solve','58UmgRaM','/universer-api/user/list','createTimestamp','get','Delete','userID','_httpService','find','map','customRanges','16XjotCw','parentId','28990nQXqNv','6921549SSRdRC','post','getMemberID','_initDataSource','154731ZzSdml','replyId','rangeId','setConfig','Reply','type','users','YYYY/MM/DD\x20HH:mm','OpenOrReOpen','92BDjrTF','requireSession','solved','pluginName','length','rangeType','COMMENT','deleteComment','userId','UNIVER_UNKNOWN','_configService','unitId','code','thread-comment-data-source.config','2792944shbMQL','_injector','getCurrentUser','forEach','stringify','Add','getUnit','addComment','1183907CTygxX','slice','commentUpdate$','payload','_initUserSync','_sessionService','UNRECOGNIZED','/universer-api/comment/unit/','Edit','size','error','filter','addUser','_threadCommentDataSourceService','root','Unknown','41772880dDYuKy','ref','resolveComment','values','/delete','_userService','format'];_0x36d7=function(){return _0x294c58;};return _0x36d7();}let S=class extends _0x4abb9d{constructor(_0x32cc53,_0x2eedc6,_0x32ddad,_0x2e2d90){const _0x37de2a=_0x118477;super(),this[_0x37de2a(0x119)]=_0x32cc53,this[_0x37de2a(0x11f)]=_0x2eedc6,this['_userService']=_0x32ddad,this[_0x37de2a(0x14c)]=_0x2e2d90,this[_0x37de2a(0x115)](),this[_0x37de2a(0xf6)]();}[_0x118477(0xf6)](){const _0xd3df71=_0x118477;this[_0xd3df71(0x118)](this[_0xd3df71(0x11f)][_0xd3df71(0xf4)]['pipe'](_0x1403eb(0x10))[_0xd3df71(0x114)](_0x1becab=>{const _0x54b6a2=_0xd3df71,_0x1b030b=new Set();_0x1becab[_0x54b6a2(0x14e)](_0x355b96=>{const _0x381ec4=_0x54b6a2;switch(_0x355b96['type']){case _0x381ec4(0x11a):{const _0x5838f2=_0x355b96[_0x381ec4(0xf5)]['personId'];_0x1b030b[_0x381ec4(0x11a)](_0x5838f2);break;}}}),B(this[_0x54b6a2(0x14c)],_0x1b030b);}));}['_init'](){const _0x3b8eac=_0x118477;this[_0x3b8eac(0x118)](this[_0x3b8eac(0x119)][_0x3b8eac(0xf4)]['subscribe'](async _0x5deda8=>{const _0x1f6b8b=_0x3b8eac;var _0x3852ed,_0x21f3d0,_0x534d04,_0x4d992c;const _0x4f73e3=(_0x3852ed=this[_0x1f6b8b(0x11f)][_0x1f6b8b(0xf0)](_0x5deda8[_0x1f6b8b(0x148)])[_0x1f6b8b(0x12a)](_0x16eb4c=>_0x16eb4c[_0x1f6b8b(0x112)]===_0x5deda8[_0x1f6b8b(0x112)]))==null?void 0x0:_0x3852ed[_0x1f6b8b(0x100)];if(!_0x4f73e3)return;const {unitId:_0x3717ab,subUnitId:_0x4ca158}=_0x4f73e3;switch(_0x5deda8[_0x1f6b8b(0x110)]&&this[_0x1f6b8b(0x107)][_0x1f6b8b(0xfe)](_0x5deda8[_0x1f6b8b(0x110)]),_0x5deda8[_0x1f6b8b(0x139)]){case v['Add']:break;case v[_0x1f6b8b(0x138)]:{this[_0x1f6b8b(0x11f)][_0x1f6b8b(0xf1)](_0x3717ab,_0x4ca158,{'unitId':_0x3717ab,'subUnitId':_0x4ca158,'ref':'','id':_0x5deda8[_0x1f6b8b(0x135)],'dT':D(+_0x5deda8[_0x1f6b8b(0x125)]),'threadId':_0x5deda8['threadId'],'personId':(_0x534d04=(_0x21f3d0=_0x5deda8['user'])==null?void 0x0:_0x21f3d0[_0x1f6b8b(0x128)])!=null?_0x534d04:_0x5deda8['userId'],'text':JSON['parse'](_0x5deda8[_0x1f6b8b(0x10e)]),'parentId':_0x4f73e3['id']});break;}case v[_0x1f6b8b(0x127)]:{const _0x325985=this[_0x1f6b8b(0x11f)]['getComment'](_0x3717ab,_0x4ca158,_0x5deda8[_0x1f6b8b(0x135)]);_0x325985&&_0x325985[_0x1f6b8b(0x12e)]&&this[_0x1f6b8b(0x11f)][_0x1f6b8b(0x144)](_0x3717ab,_0x4ca158,_0x5deda8[_0x1f6b8b(0x135)]);break;}case v[_0x1f6b8b(0xfa)]:{this[_0x1f6b8b(0x11f)][_0x1f6b8b(0x113)](_0x3717ab,_0x4ca158,{'commentId':_0x5deda8['replyId'],'text':JSON['parse'](_0x5deda8[_0x1f6b8b(0x10e)])});break;}case v[_0x1f6b8b(0x122)]:{const _0x4ce40f=(_0x4d992c=this[_0x1f6b8b(0x11f)][_0x1f6b8b(0xf0)](_0x5deda8['unitId'])[_0x1f6b8b(0x12a)](_0xffd30a=>_0xffd30a[_0x1f6b8b(0x112)]===_0x5deda8[_0x1f6b8b(0x112)]))==null?void 0x0:_0x4d992c[_0x1f6b8b(0x100)];_0x4ce40f&&this[_0x1f6b8b(0x11f)][_0x1f6b8b(0x104)](_0x3717ab,_0x4ca158,_0x4ce40f['id'],_0x5deda8[_0x1f6b8b(0x13f)]===I[_0x1f6b8b(0x10b)]);break;}}}));}};S=V([p(0x0,_0x1ab595(_0x1448e6)),p(0x1,_0x1ab595(_0x1fe52e)),p(0x2,_0x1ab595(_0xca3c4f)),p(0x3,_0x1ab595(_0x3a9059))],S);const z=_0x118477(0x14a),M={};var k=Object[_0x118477(0x11b)],Q=(_0x1e4742,_0x4d3e9a,_0x273d1d,_0x4f2df3)=>{const _0x27aca1=_0x118477;for(var _0x3be03b=_0x4f2df3>0x1?void 0x0:_0x4f2df3?k(_0x4d3e9a,_0x273d1d):_0x4d3e9a,_0xbf39fa=_0x1e4742[_0x27aca1(0x141)]-0x1,_0x300423;_0xbf39fa>=0x0;_0xbf39fa--)(_0x300423=_0x1e4742[_0xbf39fa])&&(_0x3be03b=_0x300423(_0x3be03b)||_0x3be03b);return _0x3be03b;},_=(_0x45c4c3,_0x447a68)=>(_0x5e19d6,_0x29c6d5)=>_0x447a68(_0x5e19d6,_0x29c6d5,_0x45c4c3);function X(_0x54f60b,_0xbb5053){const _0x56a932=_0x118477,_0x25e1bc=_0x54f60b[_0x56a932(0x10f)][0x0];return{..._0xbb5053,'id':_0x25e1bc['replyId'],'resolved':_0x54f60b['solved']===0x1,'dT':D(_0x25e1bc['createTimestamp']),'personId':_0x25e1bc['userId'],'threadId':_0x25e1bc[_0x56a932(0x112)]};}function ee(_0x8ad35d,_0x1fa37d,_0x2f5dca){const _0x123d9f=_0x118477;var _0x20fce6,_0x378fcc;if(((_0x378fcc=(_0x20fce6=_0x8ad35d==null?void 0x0:_0x8ad35d[_0x123d9f(0x10f)])==null?void 0x0:_0x20fce6[_0x123d9f(0x141)])!=null?_0x378fcc:0x0)>0x0){const _0x424112=(_0x34cc90,_0x201ad9)=>({'id':_0x34cc90[_0x123d9f(0x135)],'threadId':_0x34cc90[_0x123d9f(0x112)],'dT':D(_0x34cc90[_0x123d9f(0x125)]),'personId':_0x34cc90[_0x123d9f(0x145)],'resolved':_0x8ad35d['solved']===I['Solved'],'unitId':_0x1fa37d,'subUnitId':_0x2f5dca,'text':JSON['parse'](_0x34cc90[_0x123d9f(0x10e)]),'parentId':_0x201ad9}),_0x5a2f81=_0x424112(_0x8ad35d[_0x123d9f(0x10f)][0x0]);return{..._0x5a2f81,'children':_0x8ad35d[_0x123d9f(0x10f)][_0x123d9f(0xf3)](0x1)[_0x123d9f(0x12b)](_0x3af4cb=>_0x424112(_0x3af4cb,_0x5a2f81['id']))};}return null;}let f=class{constructor(_0x2e4232,_0x571946,_0x2b2350,_0x5aa143){const _0x555bb2=_0x118477;this[_0x555bb2(0x129)]=_0x2e4232,this[_0x555bb2(0x107)]=_0x571946,this['_sessionService']=_0x2b2350,this[_0x555bb2(0x14c)]=_0x5aa143;}async[_0x118477(0xf1)](_0x3278bc){const _0x3288cb=_0x118477;var _0x9670c2,_0x8a2778;const {parentId:_0x84bda0,unitId:_0x1c265d,text:_0x1a4439,threadId:_0x957720}=_0x3278bc,_0xf022dd=(_0x8a2778=(_0x9670c2=_0x1a4439[_0x3288cb(0x12c)])==null?void 0x0:_0x9670c2[_0x3288cb(0xfd)](_0x3e8fe1=>_0x3e8fe1[_0x3288cb(0x142)]===_0x10593c['COMMENT'])[_0x3288cb(0x12b)](_0x117e9c=>_0x117e9c[_0x3288cb(0x136)]))!=null?_0x8a2778:[],_0x4b994c=JSON[_0x3288cb(0x14f)](_0x1a4439),_0x329119=(await this[_0x3288cb(0xf7)]['requireSession'](_0x1c265d))['getMemberID']();if(_0x84bda0){const _0x2dc62a={'memberId':_0x329119,'unitId':_0x1c265d,'content':_0x4b994c,'mention':_0xf022dd,'threadId':_0x957720},_0x1c52c3=(await this['_httpService'][_0x3288cb(0x131)]('/universer-api/comment/unit/'+_0x1c265d+_0x3288cb(0x117),{'body':_0x2dc62a}))[_0x3288cb(0x11e)][_0x3288cb(0x120)];return{..._0x3278bc,'id':_0x1c52c3[_0x3288cb(0x135)],'dT':_0x296005(+_0x1c52c3[_0x3288cb(0x125)])['format'](_0x3288cb(0x13b)),'personId':_0x1c52c3[_0x3288cb(0x145)]};}else{const _0x2b64c6={'memberId':_0x329119,'unitId':_0x1c265d,'content':_0x4b994c,'mention':_0xf022dd},_0x24c3c7=await this['_httpService'][_0x3288cb(0x131)](_0x3288cb(0xf9)+_0x1c265d+'/add',{'body':_0x2b64c6});return X(_0x24c3c7[_0x3288cb(0x11e)]['comment'],_0x3278bc);}}async[_0x118477(0x113)](_0xe00c8f){const _0x57a494=_0x118477;var _0x47ef0b,_0x53da94;const {text:_0x86bad4,unitId:_0x212f2f}=_0xe00c8f,_0x50b099=(_0x53da94=(_0x47ef0b=_0x86bad4[_0x57a494(0x12c)])==null?void 0x0:_0x47ef0b[_0x57a494(0xfd)](_0x1be0d1=>_0x1be0d1['rangeType']===_0x10593c[_0x57a494(0x143)])['map'](_0x3e5b82=>_0x3e5b82[_0x57a494(0x136)]))!=null?_0x53da94:[],_0x2af862=JSON[_0x57a494(0x14f)](_0x86bad4),_0x3ccbb9=_0xe00c8f['threadId'],_0x3d1289=_0xe00c8f['id'],_0x2bedaf={'memberId':(await this[_0x57a494(0xf7)][_0x57a494(0x13e)](_0x212f2f))['getMemberID'](),'unitId':_0x212f2f,'threadId':_0x3ccbb9,'mention':_0x50b099,'content':_0x2af862,'replyId':_0x3d1289},_0x14cadf=await this[_0x57a494(0x129)][_0x57a494(0x131)]('/universer-api/comment/unit/'+_0x212f2f+'/edit',{'body':_0x2bedaf});return!_0x14cadf[_0x57a494(0x11e)]['error']||_0x14cadf[_0x57a494(0x11e)]['error']['code']===0x1;}async[_0x118477(0x104)](_0x4f3a82){const _0x2ccdf9=_0x118477,{unitId:_0xcabc6a}=_0x4f3a82,_0x53252e=_0x4f3a82['threadId'],_0x176400={'memberId':this[_0x2ccdf9(0x107)][_0x2ccdf9(0x14d)]()[_0x2ccdf9(0x128)],'unitId':_0xcabc6a,'threadId':_0x53252e,'solved':_0x4f3a82[_0x2ccdf9(0x111)]?I['Solved']:I[_0x2ccdf9(0x13c)]},_0x1ad112=await this[_0x2ccdf9(0x129)][_0x2ccdf9(0x131)](_0x2ccdf9(0xf9)+_0xcabc6a+'/solved',{'body':_0x176400});return!_0x1ad112[_0x2ccdf9(0x11e)][_0x2ccdf9(0xfc)]||_0x1ad112[_0x2ccdf9(0x11e)][_0x2ccdf9(0xfc)][_0x2ccdf9(0x149)]===0x1;}async[_0x118477(0x144)](_0x2e6380,_0xe4d9ce,_0x3542f0,_0x442b72){const _0x4ad93c=_0x118477,_0x64f8d0={'memberId':(await this[_0x4ad93c(0xf7)][_0x4ad93c(0x13e)](_0x2e6380))[_0x4ad93c(0x132)](),'threadId':_0x3542f0,'replyId':_0x442b72,'unitId':_0x2e6380},_0x412f4d=await this['_httpService']['post'](_0x4ad93c(0xf9)+_0x2e6380+_0x4ad93c(0x106),{'body':_0x64f8d0});return!_0x412f4d['body'][_0x4ad93c(0xfc)]||_0x412f4d[_0x4ad93c(0x11e)]['error'][_0x4ad93c(0x149)]===0x1;}async['listComments'](_0x5183f0,_0x50a108,_0x379701){const _0x4d7f97=_0x118477,_0x12cd3d={'unitId':_0x5183f0,'threadId':_0x379701},_0x545f1e=await this['_httpService'][_0x4d7f97(0x131)](_0x4d7f97(0xf9)+_0x5183f0+'/list',{'body':_0x12cd3d}),_0x51b7d4=_0x379701[_0x4d7f97(0x12b)](_0x1aeba1=>ee(_0x545f1e['body']['comments'][_0x1aeba1],_0x5183f0,_0x50a108))[_0x4d7f97(0xfd)](Boolean);return Object[_0x4d7f97(0x105)](_0x545f1e[_0x4d7f97(0x11e)][_0x4d7f97(0x13a)])[_0x4d7f97(0x14e)](_0x568663=>{const _0x333980=_0x4d7f97;this[_0x333980(0x107)]['addUser'](_0x568663);}),_0x51b7d4;}[_0x118477(0x121)](_0x3ca7a7){const _0x49e717=_0x118477;return{'id':_0x3ca7a7['id'],'threadId':_0x3ca7a7[_0x49e717(0x112)],'ref':_0x3ca7a7[_0x49e717(0x103)]};}};f=Q([_(0x0,_0x1ab595(_0x1b49ae)),_(0x1,_0x1ab595(_0xca3c4f)),_(0x2,_0x1ab595(_0x2a8abb)),_(0x3,_0x1ab595(_0x3a9059))],f);var re=Object[_0x118477(0x11b)],te=(_0xfc5abf,_0x28b52f,_0x5dc7aa,_0x1a91d6)=>{const _0x484aba=_0x118477;for(var _0x225b02=_0x1a91d6>0x1?void 0x0:_0x1a91d6?re(_0x28b52f,_0x5dc7aa):_0x28b52f,_0x36eee3=_0xfc5abf[_0x484aba(0x141)]-0x1,_0x286e57;_0x36eee3>=0x0;_0x36eee3--)(_0x286e57=_0xfc5abf[_0x36eee3])&&(_0x225b02=_0x286e57(_0x225b02)||_0x225b02);return _0x225b02;},N=(_0x424c8f,_0xe6aaae)=>(_0x1c2d12,_0x4153e2)=>_0xe6aaae(_0x1c2d12,_0x4153e2,_0x424c8f);let g=class extends _0x4abb9d{constructor(_0x478d19,_0x417653){const _0x429921=_0x118477;super(),this['_threadCommentDataSourceService']=_0x478d19,this[_0x429921(0x11d)]=_0x417653,this[_0x429921(0x133)]();}[_0x118477(0x133)](){const _0x2adad2=_0x118477;this[_0x2adad2(0xff)]['dataSource']=this['_threadCommentDataSource'],this[_0x2adad2(0xff)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x37829d),N(0x1,_0x1ab595(f))],g);function _0xe34e(_0xd14904,_0x4ca8cc){const _0x36d711=_0x36d7();return _0xe34e=function(_0xe34e5e,_0x6fb233){_0xe34e5e=_0xe34e5e-0xef;let _0x470e37=_0x36d711[_0xe34e5e];return _0x470e37;},_0xe34e(_0xd14904,_0x4ca8cc);}var se=Object['defineProperty'],oe=Object[_0x118477(0x11b)],ne=(_0x41765d,_0x4be810,_0x3d8bb5)=>_0x4be810 in _0x41765d?se(_0x41765d,_0x4be810,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3d8bb5}):_0x41765d[_0x4be810]=_0x3d8bb5,ie=(_0x4f0d42,_0x3a1394,_0x5f2734,_0x337f79)=>{const _0x1ce97a=_0x118477;for(var _0x464754=_0x337f79>0x1?void 0x0:_0x337f79?oe(_0x3a1394,_0x5f2734):_0x3a1394,_0xbb9e3f=_0x4f0d42[_0x1ce97a(0x141)]-0x1,_0x251a7e;_0xbb9e3f>=0x0;_0xbb9e3f--)(_0x251a7e=_0x4f0d42[_0xbb9e3f])&&(_0x464754=_0x251a7e(_0x464754)||_0x464754);return _0x464754;},w=(_0x35d8af,_0x4e94d9)=>(_0x1600c3,_0x4a321b)=>_0x4e94d9(_0x1600c3,_0x4a321b,_0x35d8af),$=(_0x2b6dc6,_0x2ac1cc,_0x5cacfc)=>ne(_0x2b6dc6,typeof _0x2ac1cc!=_0x118477(0x11c)?_0x2ac1cc+'':_0x2ac1cc,_0x5cacfc);let b=class extends _0x5214e1{constructor(_0x5b3517=M,_0x38e68f,_0x29e4d4){const _0x3353e9=_0x118477;super(),this[_0x3353e9(0x116)]=_0x5b3517,this[_0x3353e9(0x14c)]=_0x38e68f,this[_0x3353e9(0x147)]=_0x29e4d4;const {..._0x39ea6a}=_0x5d8e9c({},M,this['_config']);this[_0x3353e9(0x147)][_0x3353e9(0x137)](z,_0x39ea6a);}[_0x118477(0x109)](){const _0x542123=_0x118477;[[f],[g],[S]][_0x542123(0x14e)](_0xdd5c79=>{const _0x3fe582=_0x542123;this[_0x3fe582(0x14c)][_0x3fe582(0x11a)](_0xdd5c79);});}[_0x118477(0x10a)](){const _0x3fe665=_0x118477;this[_0x3fe665(0x14c)][_0x3fe665(0x126)](g),this['_injector'][_0x3fe665(0x126)](S);}};$(b,_0x118477(0x140),W),$(b,'type',_0x7eb5b0[_0x118477(0x146)]),b=ie([_0x652ecb(_0x255d00,_0x243904,_0x4f60b2),w(0x1,_0x1ab595(_0x3a9059)),w(0x2,_0x49fb74)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x10e254=_0x5207;(function(_0xf79569,_0x1815e6){const _0x1c7807=_0x5207,_0x154049=_0xf79569();while(!![]){try{const _0x2fedd0=-parseInt(_0x1c7807(0x231))/0x1+parseInt(_0x1c7807(0x21d))/0x2*(-parseInt(_0x1c7807(0x214))/0x3)+parseInt(_0x1c7807(0x234))/0x4*(parseInt(_0x1c7807(0x22b))/0x5)+parseInt(_0x1c7807(0x206))/0x6+parseInt(_0x1c7807(0x1f9))/0x7*(-parseInt(_0x1c7807(0x228))/0x8)+-parseInt(_0x1c7807(0x240))/0x9*(parseInt(_0x1c7807(0x20d))/0xa)+parseInt(_0x1c7807(0x208))/0xb*(parseInt(_0x1c7807(0x218))/0xc);if(_0x2fedd0===_0x1815e6)break;else _0x154049['push'](_0x154049['shift']());}catch(_0x30361f){_0x154049['push'](_0x154049['shift']());}}}(_0x38f8,0x7e7d1));import{CommentService as _0x1c97aa,CollaborationSessionService as _0x2e01b2,UniverCollaborationClientPlugin as _0x1afa9f}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5f1af7}from'@univerjs-pro/license';import{dayjs as _0x475bbd,UserManagerService as _0x17e060,Inject as _0x6d6d7f,Injector as _0x5832fe,Disposable as _0x398fe1,CustomRangeType as _0x134f38,UniverInstanceType as _0x4565c4,DependentOn as _0x173423,IConfigService as _0x56350f,Plugin as _0x571f03,merge as _0x270269}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b05fa}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x5d314a,IThreadCommentDataSourceService as _0x38b225}from'@univerjs/thread-comment';import{bufferTime as _0x1c4cd0}from'rxjs';import{HTTPService as _0x3f6b99}from'@univerjs/network';const W=_0x10e254(0x1dc);var I=(_0x39b649=>(_0x39b649[_0x39b649[_0x10e254(0x235)]=0x0]=_0x10e254(0x235),_0x39b649[_0x39b649[_0x10e254(0x1dd)]=0x1]=_0x10e254(0x1dd),_0x39b649[_0x39b649['UNRECOGNIZED']=-0x1]=_0x10e254(0x23f),_0x39b649))(I||{}),v=(_0x5e2dcd=>(_0x5e2dcd[_0x5e2dcd[_0x10e254(0x207)]=0x0]=_0x10e254(0x207),_0x5e2dcd[_0x5e2dcd[_0x10e254(0x1fe)]=0x1]=_0x10e254(0x1fe),_0x5e2dcd[_0x5e2dcd[_0x10e254(0x217)]=0x2]=_0x10e254(0x217),_0x5e2dcd[_0x5e2dcd['Edit']=0x3]=_0x10e254(0x20b),_0x5e2dcd[_0x5e2dcd[_0x10e254(0x1eb)]=0x4]='Delete',_0x5e2dcd[_0x5e2dcd[_0x10e254(0x237)]=0x5]='Solve',_0x5e2dcd[_0x5e2dcd[_0x10e254(0x23f)]=-0x1]=_0x10e254(0x23f),_0x5e2dcd))(v||{});const D=_0x5a48d1=>_0x475bbd(new Date(+_0x5a48d1))['format'](_0x10e254(0x1ff)),B=async(_0x6aae5b,_0x241094)=>{const _0x314b50=_0x10e254,_0x24921d=_0x6aae5b[_0x314b50(0x21a)](_0x17e060),_0x783dc1=_0x6aae5b[_0x314b50(0x21a)](_0x3f6b99);_0x241094[_0x314b50(0x1fd)](_0x3af666=>{const _0x4aa85a=_0x314b50;_0x24921d[_0x4aa85a(0x1ed)](_0x3af666)&&_0x241094[_0x4aa85a(0x1de)](_0x3af666);}),_0x241094['size']&&(await _0x783dc1[_0x314b50(0x21a)]('/universer-api/user/list',{'params':{'userIDs':[..._0x241094]}}))[_0x314b50(0x1e9)][_0x314b50(0x223)][_0x314b50(0x1fd)](_0xed94bb=>{const _0x4ed79e=_0x314b50;_0xed94bb&&_0x24921d[_0x4ed79e(0x225)](_0xed94bb);});};var K=Object[_0x10e254(0x1e4)],V=(_0x3407a6,_0x4a1595,_0x2dbc10,_0x1cb66d)=>{const _0x1b2ac8=_0x10e254;for(var _0x3cde95=_0x1cb66d>0x1?void 0x0:_0x1cb66d?K(_0x4a1595,_0x2dbc10):_0x4a1595,_0x1339ac=_0x3407a6[_0x1b2ac8(0x205)]-0x1,_0x304df9;_0x1339ac>=0x0;_0x1339ac--)(_0x304df9=_0x3407a6[_0x1339ac])&&(_0x3cde95=_0x304df9(_0x3cde95)||_0x3cde95);return _0x3cde95;},p=(_0x25c9a3,_0x22c8b7)=>(_0x2f8cf9,_0x2283ae)=>_0x22c8b7(_0x2f8cf9,_0x2283ae,_0x25c9a3);let S=class extends _0x398fe1{constructor(_0x534990,_0x46c721,_0x1cc581,_0x2fa418){const _0x1e6839=_0x10e254;super(),this[_0x1e6839(0x229)]=_0x534990,this['_threadCommentModel']=_0x46c721,this['_userService']=_0x1cc581,this[_0x1e6839(0x20f)]=_0x2fa418,this[_0x1e6839(0x22f)](),this[_0x1e6839(0x21e)]();}[_0x10e254(0x21e)](){const _0x2f8fbc=_0x10e254;this[_0x2f8fbc(0x1e7)](this[_0x2f8fbc(0x21b)][_0x2f8fbc(0x20e)][_0x2f8fbc(0x1fa)](_0x1c4cd0(0x10))[_0x2f8fbc(0x1e8)](_0x513880=>{const _0x261fc6=_0x2f8fbc,_0x169595=new Set();_0x513880[_0x261fc6(0x1fd)](_0x5423cb=>{const _0x258597=_0x261fc6;switch(_0x5423cb[_0x258597(0x239)]){case _0x258597(0x222):{const _0x45d6a5=_0x5423cb[_0x258597(0x21c)][_0x258597(0x201)];_0x169595[_0x258597(0x222)](_0x45d6a5);break;}}}),B(this['_injector'],_0x169595);}));}[_0x10e254(0x22f)](){const _0x87412f=_0x10e254;this[_0x87412f(0x1e7)](this[_0x87412f(0x229)][_0x87412f(0x20e)][_0x87412f(0x1e8)](async _0x8080ff=>{const _0x5061f6=_0x87412f;var _0x4c478e,_0x10296e,_0x457ab1,_0x1b4ae4;const _0x342836=(_0x4c478e=this[_0x5061f6(0x21b)][_0x5061f6(0x23a)](_0x8080ff['unitId'])[_0x5061f6(0x232)](_0x50a19f=>_0x50a19f[_0x5061f6(0x21f)]===_0x8080ff[_0x5061f6(0x21f)]))==null?void 0x0:_0x4c478e[_0x5061f6(0x23c)];if(!_0x342836)return;const {unitId:_0x18b738,subUnitId:_0x4b0a84}=_0x342836;switch(_0x8080ff[_0x5061f6(0x1f1)]&&this[_0x5061f6(0x1e0)]['addUser'](_0x8080ff['user']),_0x8080ff['type']){case v['Add']:break;case v[_0x5061f6(0x217)]:{this[_0x5061f6(0x21b)][_0x5061f6(0x220)](_0x18b738,_0x4b0a84,{'unitId':_0x18b738,'subUnitId':_0x4b0a84,'ref':'','id':_0x8080ff[_0x5061f6(0x1df)],'dT':D(+_0x8080ff[_0x5061f6(0x215)]),'threadId':_0x8080ff[_0x5061f6(0x21f)],'personId':(_0x457ab1=(_0x10296e=_0x8080ff[_0x5061f6(0x1f1)])==null?void 0x0:_0x10296e[_0x5061f6(0x1e2)])!=null?_0x457ab1:_0x8080ff['userId'],'text':JSON[_0x5061f6(0x1e5)](_0x8080ff[_0x5061f6(0x1fb)]),'parentId':_0x342836['id']});break;}case v[_0x5061f6(0x1eb)]:{const _0x381e28=this[_0x5061f6(0x21b)][_0x5061f6(0x204)](_0x18b738,_0x4b0a84,_0x8080ff['replyId']);_0x381e28&&_0x381e28[_0x5061f6(0x238)]&&this[_0x5061f6(0x21b)][_0x5061f6(0x236)](_0x18b738,_0x4b0a84,_0x8080ff['replyId']);break;}case v[_0x5061f6(0x20b)]:{this['_threadCommentModel'][_0x5061f6(0x22e)](_0x18b738,_0x4b0a84,{'commentId':_0x8080ff[_0x5061f6(0x1df)],'text':JSON[_0x5061f6(0x1e5)](_0x8080ff[_0x5061f6(0x1fb)])});break;}case v[_0x5061f6(0x237)]:{const _0x1a57cd=(_0x1b4ae4=this[_0x5061f6(0x21b)][_0x5061f6(0x23a)](_0x8080ff[_0x5061f6(0x227)])['find'](_0xb4493e=>_0xb4493e[_0x5061f6(0x21f)]===_0x8080ff[_0x5061f6(0x21f)]))==null?void 0x0:_0x1b4ae4['root'];_0x1a57cd&&this[_0x5061f6(0x21b)]['resolveComment'](_0x18b738,_0x4b0a84,_0x1a57cd['id'],_0x8080ff[_0x5061f6(0x22d)]===I[_0x5061f6(0x1dd)]);break;}}}));}};function _0x38f8(){const _0x47a298=['pipe','content','defineProperty','forEach','Add','YYYY/MM/DD\x20HH:mm','/delete','personId','COMMENT','error','getComment','length','5156640Diumdp','Unknown','4570687jrHdsO','_config','replies','Edit','rangeType','893020qcETST','commentUpdate$','_injector','getCurrentUser','/list','userId','onReady','20604fFeSOA','createTimestamp','_threadCommentDataSource','Reply','24MIMPje','resolved','get','_threadCommentModel','payload','206eLKzng','_initUserSync','threadId','addComment','requireSession','add','users','symbol','addUser','_sessionService','unitId','376fZKSTG','_commentService','thread-comment-data-source.config','4385EpCcfN','ref','solved','updateComment','_init','map','205961mzsTRs','find','rangeId','3252NTsahU','OpenOrReOpen','deleteComment','Solve','parentId','type','getUnit','code','root','_threadCommentDataSourceService','/solved','UNRECOGNIZED','27UvhQbZ','post','filter','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Solved','delete','replyId','_userService','setConfig','userID','_httpService','getOwnPropertyDescriptor','parse','pluginName','disposeWithMe','subscribe','body','customRanges','Delete','comment','getUser','reply','comments','stringify','user','/universer-api/comment/unit/','/add','onStarting','getMemberID','_initDataSource','slice','_configService','104867LPOHXK'];_0x38f8=function(){return _0x47a298;};return _0x38f8();}S=V([p(0x0,_0x6d6d7f(_0x1c97aa)),p(0x1,_0x6d6d7f(_0x5d314a)),p(0x2,_0x6d6d7f(_0x17e060)),p(0x3,_0x6d6d7f(_0x5832fe))],S);const z=_0x10e254(0x22a),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5fcc15,_0x45e138,_0x204bec,_0x2c43bf)=>{const _0xb25aca=_0x10e254;for(var _0x434433=_0x2c43bf>0x1?void 0x0:_0x2c43bf?k(_0x45e138,_0x204bec):_0x45e138,_0x5037eb=_0x5fcc15[_0xb25aca(0x205)]-0x1,_0x3a41be;_0x5037eb>=0x0;_0x5037eb--)(_0x3a41be=_0x5fcc15[_0x5037eb])&&(_0x434433=_0x3a41be(_0x434433)||_0x434433);return _0x434433;},_=(_0x56949f,_0x3ab8da)=>(_0x54dcc1,_0x1174c6)=>_0x3ab8da(_0x54dcc1,_0x1174c6,_0x56949f);function _0x5207(_0x3cd395,_0xefde19){const _0x38f800=_0x38f8();return _0x5207=function(_0x52078e,_0x269096){_0x52078e=_0x52078e-0x1da;let _0x1b3a6e=_0x38f800[_0x52078e];return _0x1b3a6e;},_0x5207(_0x3cd395,_0xefde19);}function X(_0x42f45c,_0x5f50d8){const _0x131dfc=_0x10e254,_0x2222ab=_0x42f45c[_0x131dfc(0x20a)][0x0];return{..._0x5f50d8,'id':_0x2222ab[_0x131dfc(0x1df)],'resolved':_0x42f45c['solved']===0x1,'dT':D(_0x2222ab[_0x131dfc(0x215)]),'personId':_0x2222ab[_0x131dfc(0x212)],'threadId':_0x2222ab['threadId']};}function ee(_0x2bdaf9,_0x17699e,_0x533569){const _0x4feb96=_0x10e254;var _0x57fe86,_0x2098f5;if(((_0x2098f5=(_0x57fe86=_0x2bdaf9==null?void 0x0:_0x2bdaf9[_0x4feb96(0x20a)])==null?void 0x0:_0x57fe86[_0x4feb96(0x205)])!=null?_0x2098f5:0x0)>0x0){const _0x2101f6=(_0x2601e8,_0x3d7656)=>({'id':_0x2601e8[_0x4feb96(0x1df)],'threadId':_0x2601e8[_0x4feb96(0x21f)],'dT':D(_0x2601e8[_0x4feb96(0x215)]),'personId':_0x2601e8[_0x4feb96(0x212)],'resolved':_0x2bdaf9[_0x4feb96(0x22d)]===I[_0x4feb96(0x1dd)],'unitId':_0x17699e,'subUnitId':_0x533569,'text':JSON['parse'](_0x2601e8[_0x4feb96(0x1fb)]),'parentId':_0x3d7656}),_0x185f9b=_0x2101f6(_0x2bdaf9['replies'][0x0]);return{..._0x185f9b,'children':_0x2bdaf9[_0x4feb96(0x20a)][_0x4feb96(0x1f7)](0x1)[_0x4feb96(0x230)](_0x9019f4=>_0x2101f6(_0x9019f4,_0x185f9b['id']))};}return null;}let f=class{constructor(_0x34dd0c,_0x39d58e,_0x2ec76b,_0x391450){const _0x5dee1b=_0x10e254;this[_0x5dee1b(0x1e3)]=_0x34dd0c,this['_userService']=_0x39d58e,this[_0x5dee1b(0x226)]=_0x2ec76b,this[_0x5dee1b(0x20f)]=_0x391450;}async['addComment'](_0x4658b5){const _0x3441d9=_0x10e254;var _0x1d5625,_0x6b1e11;const {parentId:_0x5c90c7,unitId:_0x504ab2,text:_0x107425,threadId:_0x3948b1}=_0x4658b5,_0x538e51=(_0x6b1e11=(_0x1d5625=_0x107425[_0x3441d9(0x1ea)])==null?void 0x0:_0x1d5625[_0x3441d9(0x1db)](_0x446c96=>_0x446c96['rangeType']===_0x134f38['COMMENT'])[_0x3441d9(0x230)](_0x31594c=>_0x31594c[_0x3441d9(0x233)]))!=null?_0x6b1e11:[],_0xbc0239=JSON[_0x3441d9(0x1f0)](_0x107425),_0x39e94d=(await this[_0x3441d9(0x226)][_0x3441d9(0x221)](_0x504ab2))[_0x3441d9(0x1f5)]();if(_0x5c90c7){const _0x2ac7f8={'memberId':_0x39e94d,'unitId':_0x504ab2,'content':_0xbc0239,'mention':_0x538e51,'threadId':_0x3948b1},_0x47223c=(await this[_0x3441d9(0x1e3)][_0x3441d9(0x1da)]('/universer-api/comment/unit/'+_0x504ab2+'/reply',{'body':_0x2ac7f8}))[_0x3441d9(0x1e9)][_0x3441d9(0x1ee)];return{..._0x4658b5,'id':_0x47223c[_0x3441d9(0x1df)],'dT':_0x475bbd(+_0x47223c['createTimestamp'])['format'](_0x3441d9(0x1ff)),'personId':_0x47223c['userId']};}else{const _0x8bc6f6={'memberId':_0x39e94d,'unitId':_0x504ab2,'content':_0xbc0239,'mention':_0x538e51},_0x56e546=await this[_0x3441d9(0x1e3)][_0x3441d9(0x1da)](_0x3441d9(0x1f2)+_0x504ab2+_0x3441d9(0x1f3),{'body':_0x8bc6f6});return X(_0x56e546['body'][_0x3441d9(0x1ec)],_0x4658b5);}}async[_0x10e254(0x22e)](_0x52a8e5){const _0x4453a2=_0x10e254;var _0x4b9994,_0x1d07b2;const {text:_0x1d6719,unitId:_0x58c8ca}=_0x52a8e5,_0x4b0dbd=(_0x1d07b2=(_0x4b9994=_0x1d6719[_0x4453a2(0x1ea)])==null?void 0x0:_0x4b9994[_0x4453a2(0x1db)](_0x58f883=>_0x58f883[_0x4453a2(0x20c)]===_0x134f38[_0x4453a2(0x202)])['map'](_0x66ae4a=>_0x66ae4a[_0x4453a2(0x233)]))!=null?_0x1d07b2:[],_0x1f0435=JSON[_0x4453a2(0x1f0)](_0x1d6719),_0x1dd085=_0x52a8e5[_0x4453a2(0x21f)],_0x5b286c=_0x52a8e5['id'],_0x227f77={'memberId':(await this[_0x4453a2(0x226)][_0x4453a2(0x221)](_0x58c8ca))[_0x4453a2(0x1f5)](),'unitId':_0x58c8ca,'threadId':_0x1dd085,'mention':_0x4b0dbd,'content':_0x1f0435,'replyId':_0x5b286c},_0x39bb65=await this[_0x4453a2(0x1e3)][_0x4453a2(0x1da)](_0x4453a2(0x1f2)+_0x58c8ca+'/edit',{'body':_0x227f77});return!_0x39bb65['body']['error']||_0x39bb65['body']['error'][_0x4453a2(0x23b)]===0x1;}async['resolveComment'](_0x277dba){const _0x10be14=_0x10e254,{unitId:_0x3bc346}=_0x277dba,_0x44079e=_0x277dba['threadId'],_0x4bc544={'memberId':this[_0x10be14(0x1e0)][_0x10be14(0x210)]()[_0x10be14(0x1e2)],'unitId':_0x3bc346,'threadId':_0x44079e,'solved':_0x277dba[_0x10be14(0x219)]?I['Solved']:I[_0x10be14(0x235)]},_0x11abe1=await this[_0x10be14(0x1e3)][_0x10be14(0x1da)](_0x10be14(0x1f2)+_0x3bc346+_0x10be14(0x23e),{'body':_0x4bc544});return!_0x11abe1[_0x10be14(0x1e9)]['error']||_0x11abe1[_0x10be14(0x1e9)]['error'][_0x10be14(0x23b)]===0x1;}async['deleteComment'](_0x118bf5,_0x1cfe92,_0x48985f,_0x2aea97){const _0x9bdce0=_0x10e254,_0xa850ed={'memberId':(await this[_0x9bdce0(0x226)][_0x9bdce0(0x221)](_0x118bf5))['getMemberID'](),'threadId':_0x48985f,'replyId':_0x2aea97,'unitId':_0x118bf5},_0x297eef=await this[_0x9bdce0(0x1e3)][_0x9bdce0(0x1da)]('/universer-api/comment/unit/'+_0x118bf5+_0x9bdce0(0x200),{'body':_0xa850ed});return!_0x297eef['body'][_0x9bdce0(0x203)]||_0x297eef[_0x9bdce0(0x1e9)]['error'][_0x9bdce0(0x23b)]===0x1;}async['listComments'](_0x4f2326,_0x1fd3b8,_0x4bdf44){const _0x45f00e=_0x10e254,_0xabcdc1={'unitId':_0x4f2326,'threadId':_0x4bdf44},_0x5b1220=await this[_0x45f00e(0x1e3)][_0x45f00e(0x1da)](_0x45f00e(0x1f2)+_0x4f2326+_0x45f00e(0x211),{'body':_0xabcdc1}),_0x539bdf=_0x4bdf44[_0x45f00e(0x230)](_0x597ae8=>ee(_0x5b1220[_0x45f00e(0x1e9)][_0x45f00e(0x1ef)][_0x597ae8],_0x4f2326,_0x1fd3b8))['filter'](Boolean);return Object['values'](_0x5b1220[_0x45f00e(0x1e9)][_0x45f00e(0x223)])[_0x45f00e(0x1fd)](_0x317743=>{const _0x11013f=_0x45f00e;this[_0x11013f(0x1e0)][_0x11013f(0x225)](_0x317743);}),_0x539bdf;}['saveCommentToSnapshot'](_0x37ce3f){const _0x1d6f90=_0x10e254;return{'id':_0x37ce3f['id'],'threadId':_0x37ce3f['threadId'],'ref':_0x37ce3f[_0x1d6f90(0x22c)]};}};f=Q([_(0x0,_0x6d6d7f(_0x3f6b99)),_(0x1,_0x6d6d7f(_0x17e060)),_(0x2,_0x6d6d7f(_0x2e01b2)),_(0x3,_0x6d6d7f(_0x5832fe))],f);var re=Object[_0x10e254(0x1e4)],te=(_0x351bb0,_0x49c073,_0x3ee29d,_0x1b85ca)=>{const _0x4ce194=_0x10e254;for(var _0x115849=_0x1b85ca>0x1?void 0x0:_0x1b85ca?re(_0x49c073,_0x3ee29d):_0x49c073,_0x3a7364=_0x351bb0[_0x4ce194(0x205)]-0x1,_0x21992e;_0x3a7364>=0x0;_0x3a7364--)(_0x21992e=_0x351bb0[_0x3a7364])&&(_0x115849=_0x21992e(_0x115849)||_0x115849);return _0x115849;},N=(_0x5298f4,_0x294eaf)=>(_0x4f3441,_0x343955)=>_0x294eaf(_0x4f3441,_0x343955,_0x5298f4);let g=class extends _0x398fe1{constructor(_0x44e84a,_0x11f27f){const _0x44ca07=_0x10e254;super(),this[_0x44ca07(0x23d)]=_0x44e84a,this[_0x44ca07(0x216)]=_0x11f27f,this[_0x44ca07(0x1f6)]();}[_0x10e254(0x1f6)](){const _0xb85e65=_0x10e254;this[_0xb85e65(0x23d)]['dataSource']=this[_0xb85e65(0x216)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x38b225),N(0x1,_0x6d6d7f(f))],g);var se=Object[_0x10e254(0x1fc)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x39654c,_0x588826,_0x212a1e)=>_0x588826 in _0x39654c?se(_0x39654c,_0x588826,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x212a1e}):_0x39654c[_0x588826]=_0x212a1e,ie=(_0x3f64b8,_0xbb38d5,_0x21cfed,_0xece1cb)=>{const _0x420d95=_0x10e254;for(var _0x2ae5e5=_0xece1cb>0x1?void 0x0:_0xece1cb?oe(_0xbb38d5,_0x21cfed):_0xbb38d5,_0x31e6ed=_0x3f64b8[_0x420d95(0x205)]-0x1,_0x208571;_0x31e6ed>=0x0;_0x31e6ed--)(_0x208571=_0x3f64b8[_0x31e6ed])&&(_0x2ae5e5=_0x208571(_0x2ae5e5)||_0x2ae5e5);return _0x2ae5e5;},w=(_0x11f2f7,_0x39e8db)=>(_0x92a6b,_0x357654)=>_0x39e8db(_0x92a6b,_0x357654,_0x11f2f7),$=(_0x4875f2,_0x29b281,_0x2d46e1)=>ne(_0x4875f2,typeof _0x29b281!=_0x10e254(0x224)?_0x29b281+'':_0x29b281,_0x2d46e1);let b=class extends _0x571f03{constructor(_0x27b54e=M,_0x5dfb6c,_0x17dec0){const _0x51e9ce=_0x10e254;super(),this[_0x51e9ce(0x209)]=_0x27b54e,this[_0x51e9ce(0x20f)]=_0x5dfb6c,this[_0x51e9ce(0x1f8)]=_0x17dec0;const {..._0x3c6baa}=_0x270269({},M,this[_0x51e9ce(0x209)]);this['_configService'][_0x51e9ce(0x1e1)](z,_0x3c6baa);}[_0x10e254(0x1f4)](){const _0x263b69=_0x10e254;[[f],[g],[S]][_0x263b69(0x1fd)](_0x5be7d7=>{const _0x441ba1=_0x263b69;this[_0x441ba1(0x20f)]['add'](_0x5be7d7);});}[_0x10e254(0x213)](){const _0x3320ef=_0x10e254;this[_0x3320ef(0x20f)]['get'](g),this[_0x3320ef(0x20f)][_0x3320ef(0x21a)](S);}};$(b,_0x10e254(0x1e6),W),$(b,_0x10e254(0x239),_0x4565c4['UNIVER_UNKNOWN']),b=ie([_0x173423(_0x4b05fa,_0x1afa9f,_0x5f1af7),w(0x1,_0x6d6d7f(_0x5832fe)),w(0x2,_0x56350f)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x118477=_0xe34e;(function(_0x356792,_0x421ed7){const _0x2d36a1=_0xe34e,_0x9bf74=_0x356792();while(!![]){try{const _0x171318=-parseInt(_0x2d36a1(0xf2))/0x1+parseInt(_0x2d36a1(0x123))/0x2*(-parseInt(_0x2d36a1(0x134))/0x3)+parseInt(_0x2d36a1(0x13d))/0x4*(parseInt(_0x2d36a1(0x12f))/0x5)+parseInt(_0x2d36a1(0x10d))/0x6+parseInt(_0x2d36a1(0x14b))/0x7+-parseInt(_0x2d36a1(0x12d))/0x8*(parseInt(_0x2d36a1(0x130))/0x9)+parseInt(_0x2d36a1(0x102))/0xa;if(_0x171318===_0x421ed7)break;else _0x9bf74['push'](_0x9bf74['shift']());}catch(_0x4edaba){_0x9bf74['push'](_0x9bf74['shift']());}}}(_0x36d7,0xd0d28));import{CommentService as _0x1448e6,CollaborationSessionService as _0x2a8abb,UniverCollaborationClientPlugin as _0x243904}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4f60b2}from'@univerjs-pro/license';import{dayjs as _0x296005,UserManagerService as _0xca3c4f,Inject as _0x1ab595,Injector as _0x3a9059,Disposable as _0x4abb9d,CustomRangeType as _0x10593c,UniverInstanceType as _0x7eb5b0,DependentOn as _0x652ecb,IConfigService as _0x49fb74,Plugin as _0x5214e1,merge as _0x5d8e9c}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x255d00}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x1fe52e,IThreadCommentDataSourceService as _0x37829d}from'@univerjs/thread-comment';import{bufferTime as _0x1403eb}from'rxjs';import{HTTPService as _0x1b49ae}from'@univerjs/network';const W=_0x118477(0x10c);var I=(_0x13c7fe=>(_0x13c7fe[_0x13c7fe['OpenOrReOpen']=0x0]=_0x118477(0x13c),_0x13c7fe[_0x13c7fe[_0x118477(0x10b)]=0x1]=_0x118477(0x10b),_0x13c7fe[_0x13c7fe[_0x118477(0xf8)]=-0x1]=_0x118477(0xf8),_0x13c7fe))(I||{}),v=(_0x5f4174=>(_0x5f4174[_0x5f4174[_0x118477(0x101)]=0x0]=_0x118477(0x101),_0x5f4174[_0x5f4174[_0x118477(0xef)]=0x1]=_0x118477(0xef),_0x5f4174[_0x5f4174[_0x118477(0x138)]=0x2]=_0x118477(0x138),_0x5f4174[_0x5f4174[_0x118477(0xfa)]=0x3]='Edit',_0x5f4174[_0x5f4174['Delete']=0x4]=_0x118477(0x127),_0x5f4174[_0x5f4174[_0x118477(0x122)]=0x5]='Solve',_0x5f4174[_0x5f4174[_0x118477(0xf8)]=-0x1]=_0x118477(0xf8),_0x5f4174))(v||{});const D=_0x1dc453=>_0x296005(new Date(+_0x1dc453))[_0x118477(0x108)](_0x118477(0x13b)),B=async(_0xc92a9f,_0x376fea)=>{const _0x4e178a=_0x118477,_0x322ed4=_0xc92a9f[_0x4e178a(0x126)](_0xca3c4f),_0x398372=_0xc92a9f[_0x4e178a(0x126)](_0x1b49ae);_0x376fea[_0x4e178a(0x14e)](_0x42be50=>{_0x322ed4['getUser'](_0x42be50)&&_0x376fea['delete'](_0x42be50);}),_0x376fea[_0x4e178a(0xfb)]&&(await _0x398372[_0x4e178a(0x126)](_0x4e178a(0x124),{'params':{'userIDs':[..._0x376fea]}}))['body'][_0x4e178a(0x13a)][_0x4e178a(0x14e)](_0x6f3e97=>{const _0x2fe8b9=_0x4e178a;_0x6f3e97&&_0x322ed4[_0x2fe8b9(0xfe)](_0x6f3e97);});};var K=Object[_0x118477(0x11b)],V=(_0x3d39c3,_0x5f4370,_0x1ed8f7,_0x48dc82)=>{const _0x4e890e=_0x118477;for(var _0x58e24f=_0x48dc82>0x1?void 0x0:_0x48dc82?K(_0x5f4370,_0x1ed8f7):_0x5f4370,_0x29d8a7=_0x3d39c3[_0x4e890e(0x141)]-0x1,_0x468cbe;_0x29d8a7>=0x0;_0x29d8a7--)(_0x468cbe=_0x3d39c3[_0x29d8a7])&&(_0x58e24f=_0x468cbe(_0x58e24f)||_0x58e24f);return _0x58e24f;},p=(_0x5dd42c,_0x580dc0)=>(_0x4dec05,_0x2409d8)=>_0x580dc0(_0x4dec05,_0x2409d8,_0x5dd42c);function _0x36d7(){const _0x294c58=['onStarting','onReady','Solved','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','2180784XrkWAa','content','replies','user','resolved','threadId','updateComment','subscribe','_init','_config','/reply','disposeWithMe','_commentService','add','getOwnPropertyDescriptor','symbol','_threadCommentDataSource','body','_threadCommentModel','reply','saveCommentToSnapshot','Solve','58UmgRaM','/universer-api/user/list','createTimestamp','get','Delete','userID','_httpService','find','map','customRanges','16XjotCw','parentId','28990nQXqNv','6921549SSRdRC','post','getMemberID','_initDataSource','154731ZzSdml','replyId','rangeId','setConfig','Reply','type','users','YYYY/MM/DD\x20HH:mm','OpenOrReOpen','92BDjrTF','requireSession','solved','pluginName','length','rangeType','COMMENT','deleteComment','userId','UNIVER_UNKNOWN','_configService','unitId','code','thread-comment-data-source.config','2792944shbMQL','_injector','getCurrentUser','forEach','stringify','Add','getUnit','addComment','1183907CTygxX','slice','commentUpdate$','payload','_initUserSync','_sessionService','UNRECOGNIZED','/universer-api/comment/unit/','Edit','size','error','filter','addUser','_threadCommentDataSourceService','root','Unknown','41772880dDYuKy','ref','resolveComment','values','/delete','_userService','format'];_0x36d7=function(){return _0x294c58;};return _0x36d7();}let S=class extends _0x4abb9d{constructor(_0x32cc53,_0x2eedc6,_0x32ddad,_0x2e2d90){const _0x37de2a=_0x118477;super(),this[_0x37de2a(0x119)]=_0x32cc53,this[_0x37de2a(0x11f)]=_0x2eedc6,this['_userService']=_0x32ddad,this[_0x37de2a(0x14c)]=_0x2e2d90,this[_0x37de2a(0x115)](),this[_0x37de2a(0xf6)]();}[_0x118477(0xf6)](){const _0xd3df71=_0x118477;this[_0xd3df71(0x118)](this[_0xd3df71(0x11f)][_0xd3df71(0xf4)]['pipe'](_0x1403eb(0x10))[_0xd3df71(0x114)](_0x1becab=>{const _0x54b6a2=_0xd3df71,_0x1b030b=new Set();_0x1becab[_0x54b6a2(0x14e)](_0x355b96=>{const _0x381ec4=_0x54b6a2;switch(_0x355b96['type']){case _0x381ec4(0x11a):{const _0x5838f2=_0x355b96[_0x381ec4(0xf5)]['personId'];_0x1b030b[_0x381ec4(0x11a)](_0x5838f2);break;}}}),B(this[_0x54b6a2(0x14c)],_0x1b030b);}));}['_init'](){const _0x3b8eac=_0x118477;this[_0x3b8eac(0x118)](this[_0x3b8eac(0x119)][_0x3b8eac(0xf4)]['subscribe'](async _0x5deda8=>{const _0x1f6b8b=_0x3b8eac;var _0x3852ed,_0x21f3d0,_0x534d04,_0x4d992c;const _0x4f73e3=(_0x3852ed=this[_0x1f6b8b(0x11f)][_0x1f6b8b(0xf0)](_0x5deda8[_0x1f6b8b(0x148)])[_0x1f6b8b(0x12a)](_0x16eb4c=>_0x16eb4c[_0x1f6b8b(0x112)]===_0x5deda8[_0x1f6b8b(0x112)]))==null?void 0x0:_0x3852ed[_0x1f6b8b(0x100)];if(!_0x4f73e3)return;const {unitId:_0x3717ab,subUnitId:_0x4ca158}=_0x4f73e3;switch(_0x5deda8[_0x1f6b8b(0x110)]&&this[_0x1f6b8b(0x107)][_0x1f6b8b(0xfe)](_0x5deda8[_0x1f6b8b(0x110)]),_0x5deda8[_0x1f6b8b(0x139)]){case v['Add']:break;case v[_0x1f6b8b(0x138)]:{this[_0x1f6b8b(0x11f)][_0x1f6b8b(0xf1)](_0x3717ab,_0x4ca158,{'unitId':_0x3717ab,'subUnitId':_0x4ca158,'ref':'','id':_0x5deda8[_0x1f6b8b(0x135)],'dT':D(+_0x5deda8[_0x1f6b8b(0x125)]),'threadId':_0x5deda8['threadId'],'personId':(_0x534d04=(_0x21f3d0=_0x5deda8['user'])==null?void 0x0:_0x21f3d0[_0x1f6b8b(0x128)])!=null?_0x534d04:_0x5deda8['userId'],'text':JSON['parse'](_0x5deda8[_0x1f6b8b(0x10e)]),'parentId':_0x4f73e3['id']});break;}case v[_0x1f6b8b(0x127)]:{const _0x325985=this[_0x1f6b8b(0x11f)]['getComment'](_0x3717ab,_0x4ca158,_0x5deda8[_0x1f6b8b(0x135)]);_0x325985&&_0x325985[_0x1f6b8b(0x12e)]&&this[_0x1f6b8b(0x11f)][_0x1f6b8b(0x144)](_0x3717ab,_0x4ca158,_0x5deda8[_0x1f6b8b(0x135)]);break;}case v[_0x1f6b8b(0xfa)]:{this[_0x1f6b8b(0x11f)][_0x1f6b8b(0x113)](_0x3717ab,_0x4ca158,{'commentId':_0x5deda8['replyId'],'text':JSON['parse'](_0x5deda8[_0x1f6b8b(0x10e)])});break;}case v[_0x1f6b8b(0x122)]:{const _0x4ce40f=(_0x4d992c=this[_0x1f6b8b(0x11f)][_0x1f6b8b(0xf0)](_0x5deda8['unitId'])[_0x1f6b8b(0x12a)](_0xffd30a=>_0xffd30a[_0x1f6b8b(0x112)]===_0x5deda8[_0x1f6b8b(0x112)]))==null?void 0x0:_0x4d992c[_0x1f6b8b(0x100)];_0x4ce40f&&this[_0x1f6b8b(0x11f)][_0x1f6b8b(0x104)](_0x3717ab,_0x4ca158,_0x4ce40f['id'],_0x5deda8[_0x1f6b8b(0x13f)]===I[_0x1f6b8b(0x10b)]);break;}}}));}};S=V([p(0x0,_0x1ab595(_0x1448e6)),p(0x1,_0x1ab595(_0x1fe52e)),p(0x2,_0x1ab595(_0xca3c4f)),p(0x3,_0x1ab595(_0x3a9059))],S);const z=_0x118477(0x14a),M={};var k=Object[_0x118477(0x11b)],Q=(_0x1e4742,_0x4d3e9a,_0x273d1d,_0x4f2df3)=>{const _0x27aca1=_0x118477;for(var _0x3be03b=_0x4f2df3>0x1?void 0x0:_0x4f2df3?k(_0x4d3e9a,_0x273d1d):_0x4d3e9a,_0xbf39fa=_0x1e4742[_0x27aca1(0x141)]-0x1,_0x300423;_0xbf39fa>=0x0;_0xbf39fa--)(_0x300423=_0x1e4742[_0xbf39fa])&&(_0x3be03b=_0x300423(_0x3be03b)||_0x3be03b);return _0x3be03b;},_=(_0x45c4c3,_0x447a68)=>(_0x5e19d6,_0x29c6d5)=>_0x447a68(_0x5e19d6,_0x29c6d5,_0x45c4c3);function X(_0x54f60b,_0xbb5053){const _0x56a932=_0x118477,_0x25e1bc=_0x54f60b[_0x56a932(0x10f)][0x0];return{..._0xbb5053,'id':_0x25e1bc['replyId'],'resolved':_0x54f60b['solved']===0x1,'dT':D(_0x25e1bc['createTimestamp']),'personId':_0x25e1bc['userId'],'threadId':_0x25e1bc[_0x56a932(0x112)]};}function ee(_0x8ad35d,_0x1fa37d,_0x2f5dca){const _0x123d9f=_0x118477;var _0x20fce6,_0x378fcc;if(((_0x378fcc=(_0x20fce6=_0x8ad35d==null?void 0x0:_0x8ad35d[_0x123d9f(0x10f)])==null?void 0x0:_0x20fce6[_0x123d9f(0x141)])!=null?_0x378fcc:0x0)>0x0){const _0x424112=(_0x34cc90,_0x201ad9)=>({'id':_0x34cc90[_0x123d9f(0x135)],'threadId':_0x34cc90[_0x123d9f(0x112)],'dT':D(_0x34cc90[_0x123d9f(0x125)]),'personId':_0x34cc90[_0x123d9f(0x145)],'resolved':_0x8ad35d['solved']===I['Solved'],'unitId':_0x1fa37d,'subUnitId':_0x2f5dca,'text':JSON['parse'](_0x34cc90[_0x123d9f(0x10e)]),'parentId':_0x201ad9}),_0x5a2f81=_0x424112(_0x8ad35d[_0x123d9f(0x10f)][0x0]);return{..._0x5a2f81,'children':_0x8ad35d[_0x123d9f(0x10f)][_0x123d9f(0xf3)](0x1)[_0x123d9f(0x12b)](_0x3af4cb=>_0x424112(_0x3af4cb,_0x5a2f81['id']))};}return null;}let f=class{constructor(_0x2e4232,_0x571946,_0x2b2350,_0x5aa143){const _0x555bb2=_0x118477;this[_0x555bb2(0x129)]=_0x2e4232,this[_0x555bb2(0x107)]=_0x571946,this['_sessionService']=_0x2b2350,this[_0x555bb2(0x14c)]=_0x5aa143;}async[_0x118477(0xf1)](_0x3278bc){const _0x3288cb=_0x118477;var _0x9670c2,_0x8a2778;const {parentId:_0x84bda0,unitId:_0x1c265d,text:_0x1a4439,threadId:_0x957720}=_0x3278bc,_0xf022dd=(_0x8a2778=(_0x9670c2=_0x1a4439[_0x3288cb(0x12c)])==null?void 0x0:_0x9670c2[_0x3288cb(0xfd)](_0x3e8fe1=>_0x3e8fe1[_0x3288cb(0x142)]===_0x10593c['COMMENT'])[_0x3288cb(0x12b)](_0x117e9c=>_0x117e9c[_0x3288cb(0x136)]))!=null?_0x8a2778:[],_0x4b994c=JSON[_0x3288cb(0x14f)](_0x1a4439),_0x329119=(await this[_0x3288cb(0xf7)]['requireSession'](_0x1c265d))['getMemberID']();if(_0x84bda0){const _0x2dc62a={'memberId':_0x329119,'unitId':_0x1c265d,'content':_0x4b994c,'mention':_0xf022dd,'threadId':_0x957720},_0x1c52c3=(await this['_httpService'][_0x3288cb(0x131)]('/universer-api/comment/unit/'+_0x1c265d+_0x3288cb(0x117),{'body':_0x2dc62a}))[_0x3288cb(0x11e)][_0x3288cb(0x120)];return{..._0x3278bc,'id':_0x1c52c3[_0x3288cb(0x135)],'dT':_0x296005(+_0x1c52c3[_0x3288cb(0x125)])['format'](_0x3288cb(0x13b)),'personId':_0x1c52c3[_0x3288cb(0x145)]};}else{const _0x2b64c6={'memberId':_0x329119,'unitId':_0x1c265d,'content':_0x4b994c,'mention':_0xf022dd},_0x24c3c7=await this['_httpService'][_0x3288cb(0x131)](_0x3288cb(0xf9)+_0x1c265d+'/add',{'body':_0x2b64c6});return X(_0x24c3c7[_0x3288cb(0x11e)]['comment'],_0x3278bc);}}async[_0x118477(0x113)](_0xe00c8f){const _0x57a494=_0x118477;var _0x47ef0b,_0x53da94;const {text:_0x86bad4,unitId:_0x212f2f}=_0xe00c8f,_0x50b099=(_0x53da94=(_0x47ef0b=_0x86bad4[_0x57a494(0x12c)])==null?void 0x0:_0x47ef0b[_0x57a494(0xfd)](_0x1be0d1=>_0x1be0d1['rangeType']===_0x10593c[_0x57a494(0x143)])['map'](_0x3e5b82=>_0x3e5b82[_0x57a494(0x136)]))!=null?_0x53da94:[],_0x2af862=JSON[_0x57a494(0x14f)](_0x86bad4),_0x3ccbb9=_0xe00c8f['threadId'],_0x3d1289=_0xe00c8f['id'],_0x2bedaf={'memberId':(await this[_0x57a494(0xf7)][_0x57a494(0x13e)](_0x212f2f))['getMemberID'](),'unitId':_0x212f2f,'threadId':_0x3ccbb9,'mention':_0x50b099,'content':_0x2af862,'replyId':_0x3d1289},_0x14cadf=await this[_0x57a494(0x129)][_0x57a494(0x131)]('/universer-api/comment/unit/'+_0x212f2f+'/edit',{'body':_0x2bedaf});return!_0x14cadf[_0x57a494(0x11e)]['error']||_0x14cadf[_0x57a494(0x11e)]['error']['code']===0x1;}async[_0x118477(0x104)](_0x4f3a82){const _0x2ccdf9=_0x118477,{unitId:_0xcabc6a}=_0x4f3a82,_0x53252e=_0x4f3a82['threadId'],_0x176400={'memberId':this[_0x2ccdf9(0x107)][_0x2ccdf9(0x14d)]()[_0x2ccdf9(0x128)],'unitId':_0xcabc6a,'threadId':_0x53252e,'solved':_0x4f3a82[_0x2ccdf9(0x111)]?I['Solved']:I[_0x2ccdf9(0x13c)]},_0x1ad112=await this[_0x2ccdf9(0x129)][_0x2ccdf9(0x131)](_0x2ccdf9(0xf9)+_0xcabc6a+'/solved',{'body':_0x176400});return!_0x1ad112[_0x2ccdf9(0x11e)][_0x2ccdf9(0xfc)]||_0x1ad112[_0x2ccdf9(0x11e)][_0x2ccdf9(0xfc)][_0x2ccdf9(0x149)]===0x1;}async[_0x118477(0x144)](_0x2e6380,_0xe4d9ce,_0x3542f0,_0x442b72){const _0x4ad93c=_0x118477,_0x64f8d0={'memberId':(await this[_0x4ad93c(0xf7)][_0x4ad93c(0x13e)](_0x2e6380))[_0x4ad93c(0x132)](),'threadId':_0x3542f0,'replyId':_0x442b72,'unitId':_0x2e6380},_0x412f4d=await this['_httpService']['post'](_0x4ad93c(0xf9)+_0x2e6380+_0x4ad93c(0x106),{'body':_0x64f8d0});return!_0x412f4d['body'][_0x4ad93c(0xfc)]||_0x412f4d[_0x4ad93c(0x11e)]['error'][_0x4ad93c(0x149)]===0x1;}async['listComments'](_0x5183f0,_0x50a108,_0x379701){const _0x4d7f97=_0x118477,_0x12cd3d={'unitId':_0x5183f0,'threadId':_0x379701},_0x545f1e=await this['_httpService'][_0x4d7f97(0x131)](_0x4d7f97(0xf9)+_0x5183f0+'/list',{'body':_0x12cd3d}),_0x51b7d4=_0x379701[_0x4d7f97(0x12b)](_0x1aeba1=>ee(_0x545f1e['body']['comments'][_0x1aeba1],_0x5183f0,_0x50a108))[_0x4d7f97(0xfd)](Boolean);return Object[_0x4d7f97(0x105)](_0x545f1e[_0x4d7f97(0x11e)][_0x4d7f97(0x13a)])[_0x4d7f97(0x14e)](_0x568663=>{const _0x333980=_0x4d7f97;this[_0x333980(0x107)]['addUser'](_0x568663);}),_0x51b7d4;}[_0x118477(0x121)](_0x3ca7a7){const _0x49e717=_0x118477;return{'id':_0x3ca7a7['id'],'threadId':_0x3ca7a7[_0x49e717(0x112)],'ref':_0x3ca7a7[_0x49e717(0x103)]};}};f=Q([_(0x0,_0x1ab595(_0x1b49ae)),_(0x1,_0x1ab595(_0xca3c4f)),_(0x2,_0x1ab595(_0x2a8abb)),_(0x3,_0x1ab595(_0x3a9059))],f);var re=Object[_0x118477(0x11b)],te=(_0xfc5abf,_0x28b52f,_0x5dc7aa,_0x1a91d6)=>{const _0x484aba=_0x118477;for(var _0x225b02=_0x1a91d6>0x1?void 0x0:_0x1a91d6?re(_0x28b52f,_0x5dc7aa):_0x28b52f,_0x36eee3=_0xfc5abf[_0x484aba(0x141)]-0x1,_0x286e57;_0x36eee3>=0x0;_0x36eee3--)(_0x286e57=_0xfc5abf[_0x36eee3])&&(_0x225b02=_0x286e57(_0x225b02)||_0x225b02);return _0x225b02;},N=(_0x424c8f,_0xe6aaae)=>(_0x1c2d12,_0x4153e2)=>_0xe6aaae(_0x1c2d12,_0x4153e2,_0x424c8f);let g=class extends _0x4abb9d{constructor(_0x478d19,_0x417653){const _0x429921=_0x118477;super(),this['_threadCommentDataSourceService']=_0x478d19,this[_0x429921(0x11d)]=_0x417653,this[_0x429921(0x133)]();}[_0x118477(0x133)](){const _0x2adad2=_0x118477;this[_0x2adad2(0xff)]['dataSource']=this['_threadCommentDataSource'],this[_0x2adad2(0xff)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x37829d),N(0x1,_0x1ab595(f))],g);function _0xe34e(_0xd14904,_0x4ca8cc){const _0x36d711=_0x36d7();return _0xe34e=function(_0xe34e5e,_0x6fb233){_0xe34e5e=_0xe34e5e-0xef;let _0x470e37=_0x36d711[_0xe34e5e];return _0x470e37;},_0xe34e(_0xd14904,_0x4ca8cc);}var se=Object['defineProperty'],oe=Object[_0x118477(0x11b)],ne=(_0x41765d,_0x4be810,_0x3d8bb5)=>_0x4be810 in _0x41765d?se(_0x41765d,_0x4be810,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3d8bb5}):_0x41765d[_0x4be810]=_0x3d8bb5,ie=(_0x4f0d42,_0x3a1394,_0x5f2734,_0x337f79)=>{const _0x1ce97a=_0x118477;for(var _0x464754=_0x337f79>0x1?void 0x0:_0x337f79?oe(_0x3a1394,_0x5f2734):_0x3a1394,_0xbb9e3f=_0x4f0d42[_0x1ce97a(0x141)]-0x1,_0x251a7e;_0xbb9e3f>=0x0;_0xbb9e3f--)(_0x251a7e=_0x4f0d42[_0xbb9e3f])&&(_0x464754=_0x251a7e(_0x464754)||_0x464754);return _0x464754;},w=(_0x35d8af,_0x4e94d9)=>(_0x1600c3,_0x4a321b)=>_0x4e94d9(_0x1600c3,_0x4a321b,_0x35d8af),$=(_0x2b6dc6,_0x2ac1cc,_0x5cacfc)=>ne(_0x2b6dc6,typeof _0x2ac1cc!=_0x118477(0x11c)?_0x2ac1cc+'':_0x2ac1cc,_0x5cacfc);let b=class extends _0x5214e1{constructor(_0x5b3517=M,_0x38e68f,_0x29e4d4){const _0x3353e9=_0x118477;super(),this[_0x3353e9(0x116)]=_0x5b3517,this[_0x3353e9(0x14c)]=_0x38e68f,this[_0x3353e9(0x147)]=_0x29e4d4;const {..._0x39ea6a}=_0x5d8e9c({},M,this['_config']);this[_0x3353e9(0x147)][_0x3353e9(0x137)](z,_0x39ea6a);}[_0x118477(0x109)](){const _0x542123=_0x118477;[[f],[g],[S]][_0x542123(0x14e)](_0xdd5c79=>{const _0x3fe582=_0x542123;this[_0x3fe582(0x14c)][_0x3fe582(0x11a)](_0xdd5c79);});}[_0x118477(0x10a)](){const _0x3fe665=_0x118477;this[_0x3fe665(0x14c)][_0x3fe665(0x126)](g),this['_injector'][_0x3fe665(0x126)](S);}};$(b,_0x118477(0x140),W),$(b,'type',_0x7eb5b0[_0x118477(0x146)]),b=ie([_0x652ecb(_0x255d00,_0x243904,_0x4f60b2),w(0x1,_0x1ab595(_0x3a9059)),w(0x2,_0x49fb74)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x10e254=_0x5207;(function(_0xf79569,_0x1815e6){const _0x1c7807=_0x5207,_0x154049=_0xf79569();while(!![]){try{const _0x2fedd0=-parseInt(_0x1c7807(0x231))/0x1+parseInt(_0x1c7807(0x21d))/0x2*(-parseInt(_0x1c7807(0x214))/0x3)+parseInt(_0x1c7807(0x234))/0x4*(parseInt(_0x1c7807(0x22b))/0x5)+parseInt(_0x1c7807(0x206))/0x6+parseInt(_0x1c7807(0x1f9))/0x7*(-parseInt(_0x1c7807(0x228))/0x8)+-parseInt(_0x1c7807(0x240))/0x9*(parseInt(_0x1c7807(0x20d))/0xa)+parseInt(_0x1c7807(0x208))/0xb*(parseInt(_0x1c7807(0x218))/0xc);if(_0x2fedd0===_0x1815e6)break;else _0x154049['push'](_0x154049['shift']());}catch(_0x30361f){_0x154049['push'](_0x154049['shift']());}}}(_0x38f8,0x7e7d1));import{CommentService as _0x1c97aa,CollaborationSessionService as _0x2e01b2,UniverCollaborationClientPlugin as _0x1afa9f}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5f1af7}from'@univerjs-pro/license';import{dayjs as _0x475bbd,UserManagerService as _0x17e060,Inject as _0x6d6d7f,Injector as _0x5832fe,Disposable as _0x398fe1,CustomRangeType as _0x134f38,UniverInstanceType as _0x4565c4,DependentOn as _0x173423,IConfigService as _0x56350f,Plugin as _0x571f03,merge as _0x270269}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b05fa}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x5d314a,IThreadCommentDataSourceService as _0x38b225}from'@univerjs/thread-comment';import{bufferTime as _0x1c4cd0}from'rxjs';import{HTTPService as _0x3f6b99}from'@univerjs/network';const W=_0x10e254(0x1dc);var I=(_0x39b649=>(_0x39b649[_0x39b649[_0x10e254(0x235)]=0x0]=_0x10e254(0x235),_0x39b649[_0x39b649[_0x10e254(0x1dd)]=0x1]=_0x10e254(0x1dd),_0x39b649[_0x39b649['UNRECOGNIZED']=-0x1]=_0x10e254(0x23f),_0x39b649))(I||{}),v=(_0x5e2dcd=>(_0x5e2dcd[_0x5e2dcd[_0x10e254(0x207)]=0x0]=_0x10e254(0x207),_0x5e2dcd[_0x5e2dcd[_0x10e254(0x1fe)]=0x1]=_0x10e254(0x1fe),_0x5e2dcd[_0x5e2dcd[_0x10e254(0x217)]=0x2]=_0x10e254(0x217),_0x5e2dcd[_0x5e2dcd['Edit']=0x3]=_0x10e254(0x20b),_0x5e2dcd[_0x5e2dcd[_0x10e254(0x1eb)]=0x4]='Delete',_0x5e2dcd[_0x5e2dcd[_0x10e254(0x237)]=0x5]='Solve',_0x5e2dcd[_0x5e2dcd[_0x10e254(0x23f)]=-0x1]=_0x10e254(0x23f),_0x5e2dcd))(v||{});const D=_0x5a48d1=>_0x475bbd(new Date(+_0x5a48d1))['format'](_0x10e254(0x1ff)),B=async(_0x6aae5b,_0x241094)=>{const _0x314b50=_0x10e254,_0x24921d=_0x6aae5b[_0x314b50(0x21a)](_0x17e060),_0x783dc1=_0x6aae5b[_0x314b50(0x21a)](_0x3f6b99);_0x241094[_0x314b50(0x1fd)](_0x3af666=>{const _0x4aa85a=_0x314b50;_0x24921d[_0x4aa85a(0x1ed)](_0x3af666)&&_0x241094[_0x4aa85a(0x1de)](_0x3af666);}),_0x241094['size']&&(await _0x783dc1[_0x314b50(0x21a)]('/universer-api/user/list',{'params':{'userIDs':[..._0x241094]}}))[_0x314b50(0x1e9)][_0x314b50(0x223)][_0x314b50(0x1fd)](_0xed94bb=>{const _0x4ed79e=_0x314b50;_0xed94bb&&_0x24921d[_0x4ed79e(0x225)](_0xed94bb);});};var K=Object[_0x10e254(0x1e4)],V=(_0x3407a6,_0x4a1595,_0x2dbc10,_0x1cb66d)=>{const _0x1b2ac8=_0x10e254;for(var _0x3cde95=_0x1cb66d>0x1?void 0x0:_0x1cb66d?K(_0x4a1595,_0x2dbc10):_0x4a1595,_0x1339ac=_0x3407a6[_0x1b2ac8(0x205)]-0x1,_0x304df9;_0x1339ac>=0x0;_0x1339ac--)(_0x304df9=_0x3407a6[_0x1339ac])&&(_0x3cde95=_0x304df9(_0x3cde95)||_0x3cde95);return _0x3cde95;},p=(_0x25c9a3,_0x22c8b7)=>(_0x2f8cf9,_0x2283ae)=>_0x22c8b7(_0x2f8cf9,_0x2283ae,_0x25c9a3);let S=class extends _0x398fe1{constructor(_0x534990,_0x46c721,_0x1cc581,_0x2fa418){const _0x1e6839=_0x10e254;super(),this[_0x1e6839(0x229)]=_0x534990,this['_threadCommentModel']=_0x46c721,this['_userService']=_0x1cc581,this[_0x1e6839(0x20f)]=_0x2fa418,this[_0x1e6839(0x22f)](),this[_0x1e6839(0x21e)]();}[_0x10e254(0x21e)](){const _0x2f8fbc=_0x10e254;this[_0x2f8fbc(0x1e7)](this[_0x2f8fbc(0x21b)][_0x2f8fbc(0x20e)][_0x2f8fbc(0x1fa)](_0x1c4cd0(0x10))[_0x2f8fbc(0x1e8)](_0x513880=>{const _0x261fc6=_0x2f8fbc,_0x169595=new Set();_0x513880[_0x261fc6(0x1fd)](_0x5423cb=>{const _0x258597=_0x261fc6;switch(_0x5423cb[_0x258597(0x239)]){case _0x258597(0x222):{const _0x45d6a5=_0x5423cb[_0x258597(0x21c)][_0x258597(0x201)];_0x169595[_0x258597(0x222)](_0x45d6a5);break;}}}),B(this['_injector'],_0x169595);}));}[_0x10e254(0x22f)](){const _0x87412f=_0x10e254;this[_0x87412f(0x1e7)](this[_0x87412f(0x229)][_0x87412f(0x20e)][_0x87412f(0x1e8)](async _0x8080ff=>{const _0x5061f6=_0x87412f;var _0x4c478e,_0x10296e,_0x457ab1,_0x1b4ae4;const _0x342836=(_0x4c478e=this[_0x5061f6(0x21b)][_0x5061f6(0x23a)](_0x8080ff['unitId'])[_0x5061f6(0x232)](_0x50a19f=>_0x50a19f[_0x5061f6(0x21f)]===_0x8080ff[_0x5061f6(0x21f)]))==null?void 0x0:_0x4c478e[_0x5061f6(0x23c)];if(!_0x342836)return;const {unitId:_0x18b738,subUnitId:_0x4b0a84}=_0x342836;switch(_0x8080ff[_0x5061f6(0x1f1)]&&this[_0x5061f6(0x1e0)]['addUser'](_0x8080ff['user']),_0x8080ff['type']){case v['Add']:break;case v[_0x5061f6(0x217)]:{this[_0x5061f6(0x21b)][_0x5061f6(0x220)](_0x18b738,_0x4b0a84,{'unitId':_0x18b738,'subUnitId':_0x4b0a84,'ref':'','id':_0x8080ff[_0x5061f6(0x1df)],'dT':D(+_0x8080ff[_0x5061f6(0x215)]),'threadId':_0x8080ff[_0x5061f6(0x21f)],'personId':(_0x457ab1=(_0x10296e=_0x8080ff[_0x5061f6(0x1f1)])==null?void 0x0:_0x10296e[_0x5061f6(0x1e2)])!=null?_0x457ab1:_0x8080ff['userId'],'text':JSON[_0x5061f6(0x1e5)](_0x8080ff[_0x5061f6(0x1fb)]),'parentId':_0x342836['id']});break;}case v[_0x5061f6(0x1eb)]:{const _0x381e28=this[_0x5061f6(0x21b)][_0x5061f6(0x204)](_0x18b738,_0x4b0a84,_0x8080ff['replyId']);_0x381e28&&_0x381e28[_0x5061f6(0x238)]&&this[_0x5061f6(0x21b)][_0x5061f6(0x236)](_0x18b738,_0x4b0a84,_0x8080ff['replyId']);break;}case v[_0x5061f6(0x20b)]:{this['_threadCommentModel'][_0x5061f6(0x22e)](_0x18b738,_0x4b0a84,{'commentId':_0x8080ff[_0x5061f6(0x1df)],'text':JSON[_0x5061f6(0x1e5)](_0x8080ff[_0x5061f6(0x1fb)])});break;}case v[_0x5061f6(0x237)]:{const _0x1a57cd=(_0x1b4ae4=this[_0x5061f6(0x21b)][_0x5061f6(0x23a)](_0x8080ff[_0x5061f6(0x227)])['find'](_0xb4493e=>_0xb4493e[_0x5061f6(0x21f)]===_0x8080ff[_0x5061f6(0x21f)]))==null?void 0x0:_0x1b4ae4['root'];_0x1a57cd&&this[_0x5061f6(0x21b)]['resolveComment'](_0x18b738,_0x4b0a84,_0x1a57cd['id'],_0x8080ff[_0x5061f6(0x22d)]===I[_0x5061f6(0x1dd)]);break;}}}));}};function _0x38f8(){const _0x47a298=['pipe','content','defineProperty','forEach','Add','YYYY/MM/DD\x20HH:mm','/delete','personId','COMMENT','error','getComment','length','5156640Diumdp','Unknown','4570687jrHdsO','_config','replies','Edit','rangeType','893020qcETST','commentUpdate$','_injector','getCurrentUser','/list','userId','onReady','20604fFeSOA','createTimestamp','_threadCommentDataSource','Reply','24MIMPje','resolved','get','_threadCommentModel','payload','206eLKzng','_initUserSync','threadId','addComment','requireSession','add','users','symbol','addUser','_sessionService','unitId','376fZKSTG','_commentService','thread-comment-data-source.config','4385EpCcfN','ref','solved','updateComment','_init','map','205961mzsTRs','find','rangeId','3252NTsahU','OpenOrReOpen','deleteComment','Solve','parentId','type','getUnit','code','root','_threadCommentDataSourceService','/solved','UNRECOGNIZED','27UvhQbZ','post','filter','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Solved','delete','replyId','_userService','setConfig','userID','_httpService','getOwnPropertyDescriptor','parse','pluginName','disposeWithMe','subscribe','body','customRanges','Delete','comment','getUser','reply','comments','stringify','user','/universer-api/comment/unit/','/add','onStarting','getMemberID','_initDataSource','slice','_configService','104867LPOHXK'];_0x38f8=function(){return _0x47a298;};return _0x38f8();}S=V([p(0x0,_0x6d6d7f(_0x1c97aa)),p(0x1,_0x6d6d7f(_0x5d314a)),p(0x2,_0x6d6d7f(_0x17e060)),p(0x3,_0x6d6d7f(_0x5832fe))],S);const z=_0x10e254(0x22a),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5fcc15,_0x45e138,_0x204bec,_0x2c43bf)=>{const _0xb25aca=_0x10e254;for(var _0x434433=_0x2c43bf>0x1?void 0x0:_0x2c43bf?k(_0x45e138,_0x204bec):_0x45e138,_0x5037eb=_0x5fcc15[_0xb25aca(0x205)]-0x1,_0x3a41be;_0x5037eb>=0x0;_0x5037eb--)(_0x3a41be=_0x5fcc15[_0x5037eb])&&(_0x434433=_0x3a41be(_0x434433)||_0x434433);return _0x434433;},_=(_0x56949f,_0x3ab8da)=>(_0x54dcc1,_0x1174c6)=>_0x3ab8da(_0x54dcc1,_0x1174c6,_0x56949f);function _0x5207(_0x3cd395,_0xefde19){const _0x38f800=_0x38f8();return _0x5207=function(_0x52078e,_0x269096){_0x52078e=_0x52078e-0x1da;let _0x1b3a6e=_0x38f800[_0x52078e];return _0x1b3a6e;},_0x5207(_0x3cd395,_0xefde19);}function X(_0x42f45c,_0x5f50d8){const _0x131dfc=_0x10e254,_0x2222ab=_0x42f45c[_0x131dfc(0x20a)][0x0];return{..._0x5f50d8,'id':_0x2222ab[_0x131dfc(0x1df)],'resolved':_0x42f45c['solved']===0x1,'dT':D(_0x2222ab[_0x131dfc(0x215)]),'personId':_0x2222ab[_0x131dfc(0x212)],'threadId':_0x2222ab['threadId']};}function ee(_0x2bdaf9,_0x17699e,_0x533569){const _0x4feb96=_0x10e254;var _0x57fe86,_0x2098f5;if(((_0x2098f5=(_0x57fe86=_0x2bdaf9==null?void 0x0:_0x2bdaf9[_0x4feb96(0x20a)])==null?void 0x0:_0x57fe86[_0x4feb96(0x205)])!=null?_0x2098f5:0x0)>0x0){const _0x2101f6=(_0x2601e8,_0x3d7656)=>({'id':_0x2601e8[_0x4feb96(0x1df)],'threadId':_0x2601e8[_0x4feb96(0x21f)],'dT':D(_0x2601e8[_0x4feb96(0x215)]),'personId':_0x2601e8[_0x4feb96(0x212)],'resolved':_0x2bdaf9[_0x4feb96(0x22d)]===I[_0x4feb96(0x1dd)],'unitId':_0x17699e,'subUnitId':_0x533569,'text':JSON['parse'](_0x2601e8[_0x4feb96(0x1fb)]),'parentId':_0x3d7656}),_0x185f9b=_0x2101f6(_0x2bdaf9['replies'][0x0]);return{..._0x185f9b,'children':_0x2bdaf9[_0x4feb96(0x20a)][_0x4feb96(0x1f7)](0x1)[_0x4feb96(0x230)](_0x9019f4=>_0x2101f6(_0x9019f4,_0x185f9b['id']))};}return null;}let f=class{constructor(_0x34dd0c,_0x39d58e,_0x2ec76b,_0x391450){const _0x5dee1b=_0x10e254;this[_0x5dee1b(0x1e3)]=_0x34dd0c,this['_userService']=_0x39d58e,this[_0x5dee1b(0x226)]=_0x2ec76b,this[_0x5dee1b(0x20f)]=_0x391450;}async['addComment'](_0x4658b5){const _0x3441d9=_0x10e254;var _0x1d5625,_0x6b1e11;const {parentId:_0x5c90c7,unitId:_0x504ab2,text:_0x107425,threadId:_0x3948b1}=_0x4658b5,_0x538e51=(_0x6b1e11=(_0x1d5625=_0x107425[_0x3441d9(0x1ea)])==null?void 0x0:_0x1d5625[_0x3441d9(0x1db)](_0x446c96=>_0x446c96['rangeType']===_0x134f38['COMMENT'])[_0x3441d9(0x230)](_0x31594c=>_0x31594c[_0x3441d9(0x233)]))!=null?_0x6b1e11:[],_0xbc0239=JSON[_0x3441d9(0x1f0)](_0x107425),_0x39e94d=(await this[_0x3441d9(0x226)][_0x3441d9(0x221)](_0x504ab2))[_0x3441d9(0x1f5)]();if(_0x5c90c7){const _0x2ac7f8={'memberId':_0x39e94d,'unitId':_0x504ab2,'content':_0xbc0239,'mention':_0x538e51,'threadId':_0x3948b1},_0x47223c=(await this[_0x3441d9(0x1e3)][_0x3441d9(0x1da)]('/universer-api/comment/unit/'+_0x504ab2+'/reply',{'body':_0x2ac7f8}))[_0x3441d9(0x1e9)][_0x3441d9(0x1ee)];return{..._0x4658b5,'id':_0x47223c[_0x3441d9(0x1df)],'dT':_0x475bbd(+_0x47223c['createTimestamp'])['format'](_0x3441d9(0x1ff)),'personId':_0x47223c['userId']};}else{const _0x8bc6f6={'memberId':_0x39e94d,'unitId':_0x504ab2,'content':_0xbc0239,'mention':_0x538e51},_0x56e546=await this[_0x3441d9(0x1e3)][_0x3441d9(0x1da)](_0x3441d9(0x1f2)+_0x504ab2+_0x3441d9(0x1f3),{'body':_0x8bc6f6});return X(_0x56e546['body'][_0x3441d9(0x1ec)],_0x4658b5);}}async[_0x10e254(0x22e)](_0x52a8e5){const _0x4453a2=_0x10e254;var _0x4b9994,_0x1d07b2;const {text:_0x1d6719,unitId:_0x58c8ca}=_0x52a8e5,_0x4b0dbd=(_0x1d07b2=(_0x4b9994=_0x1d6719[_0x4453a2(0x1ea)])==null?void 0x0:_0x4b9994[_0x4453a2(0x1db)](_0x58f883=>_0x58f883[_0x4453a2(0x20c)]===_0x134f38[_0x4453a2(0x202)])['map'](_0x66ae4a=>_0x66ae4a[_0x4453a2(0x233)]))!=null?_0x1d07b2:[],_0x1f0435=JSON[_0x4453a2(0x1f0)](_0x1d6719),_0x1dd085=_0x52a8e5[_0x4453a2(0x21f)],_0x5b286c=_0x52a8e5['id'],_0x227f77={'memberId':(await this[_0x4453a2(0x226)][_0x4453a2(0x221)](_0x58c8ca))[_0x4453a2(0x1f5)](),'unitId':_0x58c8ca,'threadId':_0x1dd085,'mention':_0x4b0dbd,'content':_0x1f0435,'replyId':_0x5b286c},_0x39bb65=await this[_0x4453a2(0x1e3)][_0x4453a2(0x1da)](_0x4453a2(0x1f2)+_0x58c8ca+'/edit',{'body':_0x227f77});return!_0x39bb65['body']['error']||_0x39bb65['body']['error'][_0x4453a2(0x23b)]===0x1;}async['resolveComment'](_0x277dba){const _0x10be14=_0x10e254,{unitId:_0x3bc346}=_0x277dba,_0x44079e=_0x277dba['threadId'],_0x4bc544={'memberId':this[_0x10be14(0x1e0)][_0x10be14(0x210)]()[_0x10be14(0x1e2)],'unitId':_0x3bc346,'threadId':_0x44079e,'solved':_0x277dba[_0x10be14(0x219)]?I['Solved']:I[_0x10be14(0x235)]},_0x11abe1=await this[_0x10be14(0x1e3)][_0x10be14(0x1da)](_0x10be14(0x1f2)+_0x3bc346+_0x10be14(0x23e),{'body':_0x4bc544});return!_0x11abe1[_0x10be14(0x1e9)]['error']||_0x11abe1[_0x10be14(0x1e9)]['error'][_0x10be14(0x23b)]===0x1;}async['deleteComment'](_0x118bf5,_0x1cfe92,_0x48985f,_0x2aea97){const _0x9bdce0=_0x10e254,_0xa850ed={'memberId':(await this[_0x9bdce0(0x226)][_0x9bdce0(0x221)](_0x118bf5))['getMemberID'](),'threadId':_0x48985f,'replyId':_0x2aea97,'unitId':_0x118bf5},_0x297eef=await this[_0x9bdce0(0x1e3)][_0x9bdce0(0x1da)]('/universer-api/comment/unit/'+_0x118bf5+_0x9bdce0(0x200),{'body':_0xa850ed});return!_0x297eef['body'][_0x9bdce0(0x203)]||_0x297eef[_0x9bdce0(0x1e9)]['error'][_0x9bdce0(0x23b)]===0x1;}async['listComments'](_0x4f2326,_0x1fd3b8,_0x4bdf44){const _0x45f00e=_0x10e254,_0xabcdc1={'unitId':_0x4f2326,'threadId':_0x4bdf44},_0x5b1220=await this[_0x45f00e(0x1e3)][_0x45f00e(0x1da)](_0x45f00e(0x1f2)+_0x4f2326+_0x45f00e(0x211),{'body':_0xabcdc1}),_0x539bdf=_0x4bdf44[_0x45f00e(0x230)](_0x597ae8=>ee(_0x5b1220[_0x45f00e(0x1e9)][_0x45f00e(0x1ef)][_0x597ae8],_0x4f2326,_0x1fd3b8))['filter'](Boolean);return Object['values'](_0x5b1220[_0x45f00e(0x1e9)][_0x45f00e(0x223)])[_0x45f00e(0x1fd)](_0x317743=>{const _0x11013f=_0x45f00e;this[_0x11013f(0x1e0)][_0x11013f(0x225)](_0x317743);}),_0x539bdf;}['saveCommentToSnapshot'](_0x37ce3f){const _0x1d6f90=_0x10e254;return{'id':_0x37ce3f['id'],'threadId':_0x37ce3f['threadId'],'ref':_0x37ce3f[_0x1d6f90(0x22c)]};}};f=Q([_(0x0,_0x6d6d7f(_0x3f6b99)),_(0x1,_0x6d6d7f(_0x17e060)),_(0x2,_0x6d6d7f(_0x2e01b2)),_(0x3,_0x6d6d7f(_0x5832fe))],f);var re=Object[_0x10e254(0x1e4)],te=(_0x351bb0,_0x49c073,_0x3ee29d,_0x1b85ca)=>{const _0x4ce194=_0x10e254;for(var _0x115849=_0x1b85ca>0x1?void 0x0:_0x1b85ca?re(_0x49c073,_0x3ee29d):_0x49c073,_0x3a7364=_0x351bb0[_0x4ce194(0x205)]-0x1,_0x21992e;_0x3a7364>=0x0;_0x3a7364--)(_0x21992e=_0x351bb0[_0x3a7364])&&(_0x115849=_0x21992e(_0x115849)||_0x115849);return _0x115849;},N=(_0x5298f4,_0x294eaf)=>(_0x4f3441,_0x343955)=>_0x294eaf(_0x4f3441,_0x343955,_0x5298f4);let g=class extends _0x398fe1{constructor(_0x44e84a,_0x11f27f){const _0x44ca07=_0x10e254;super(),this[_0x44ca07(0x23d)]=_0x44e84a,this[_0x44ca07(0x216)]=_0x11f27f,this[_0x44ca07(0x1f6)]();}[_0x10e254(0x1f6)](){const _0xb85e65=_0x10e254;this[_0xb85e65(0x23d)]['dataSource']=this[_0xb85e65(0x216)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x38b225),N(0x1,_0x6d6d7f(f))],g);var se=Object[_0x10e254(0x1fc)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x39654c,_0x588826,_0x212a1e)=>_0x588826 in _0x39654c?se(_0x39654c,_0x588826,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x212a1e}):_0x39654c[_0x588826]=_0x212a1e,ie=(_0x3f64b8,_0xbb38d5,_0x21cfed,_0xece1cb)=>{const _0x420d95=_0x10e254;for(var _0x2ae5e5=_0xece1cb>0x1?void 0x0:_0xece1cb?oe(_0xbb38d5,_0x21cfed):_0xbb38d5,_0x31e6ed=_0x3f64b8[_0x420d95(0x205)]-0x1,_0x208571;_0x31e6ed>=0x0;_0x31e6ed--)(_0x208571=_0x3f64b8[_0x31e6ed])&&(_0x2ae5e5=_0x208571(_0x2ae5e5)||_0x2ae5e5);return _0x2ae5e5;},w=(_0x11f2f7,_0x39e8db)=>(_0x92a6b,_0x357654)=>_0x39e8db(_0x92a6b,_0x357654,_0x11f2f7),$=(_0x4875f2,_0x29b281,_0x2d46e1)=>ne(_0x4875f2,typeof _0x29b281!=_0x10e254(0x224)?_0x29b281+'':_0x29b281,_0x2d46e1);let b=class extends _0x571f03{constructor(_0x27b54e=M,_0x5dfb6c,_0x17dec0){const _0x51e9ce=_0x10e254;super(),this[_0x51e9ce(0x209)]=_0x27b54e,this[_0x51e9ce(0x20f)]=_0x5dfb6c,this[_0x51e9ce(0x1f8)]=_0x17dec0;const {..._0x3c6baa}=_0x270269({},M,this[_0x51e9ce(0x209)]);this['_configService'][_0x51e9ce(0x1e1)](z,_0x3c6baa);}[_0x10e254(0x1f4)](){const _0x263b69=_0x10e254;[[f],[g],[S]][_0x263b69(0x1fd)](_0x5be7d7=>{const _0x441ba1=_0x263b69;this[_0x441ba1(0x20f)]['add'](_0x5be7d7);});}[_0x10e254(0x213)](){const _0x3320ef=_0x10e254;this[_0x3320ef(0x20f)]['get'](g),this[_0x3320ef(0x20f)][_0x3320ef(0x21a)](S);}};$(b,_0x10e254(0x1e6),W),$(b,_0x10e254(0x239),_0x4565c4['UNIVER_UNKNOWN']),b=ie([_0x173423(_0x4b05fa,_0x1afa9f,_0x5f1af7),w(0x1,_0x6d6d7f(_0x5832fe)),w(0x2,_0x56350f)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x57fc(){const _0x4fa579=['saveCommentToSnapshot','solved','Inject','UniverInstanceType','dataSource','_initUserSync','format','dayjs','_threadCommentModel','_sessionService','get','/universer-api/comment/unit/','@univerjs/core','personId','ThreadCommentModel','UniverProCollaborationClient','toStringTag','setConfig','body','CollaborationSessionService','requireSession','/reply','stringify','defineProperty','userId','/list','CustomRangeType','onReady','_injector','replyId','userID','getUnit','@univerjs/thread-comment','rangeId','addUser','getUser','@univerjs/thread-comment-ui','add','_threadCommentDataSourceService','addComment','getOwnPropertyDescriptor','_httpService','UserManagerService','_init','filter','YYYY/MM/DD\x20HH:mm','exports','_initDataSource','resolved','deleteComment','Edit','CommentService','onStarting','error','/delete','UniverThreadComment','resolveComment','UniverCore','size','Solved','UNRECOGNIZED','replies','UniverLicensePlugin','unitId','_commentService','getMemberID','COMMENT','bufferTime','updateComment','user','rxjs','UNIVER_UNKNOWN','10915968fLZzOu','subscribe','getComment','merge','Delete','customRanges','commentUpdate$','thread-comment-data-source.config','@univerjs-pro/license','OpenOrReOpen','forEach','ref','@univerjs-pro/collaboration-client','users','createTimestamp','Injector','type','DependentOn','_userService','UniverProThreadCommentDatasource','parentId','object','rangeType','Solve','245845LxVpjX','post','getCurrentUser','code','Disposable','parse','length','UniverCollaborationClientPlugin','1071376otJoUi','reply','_configService','root','1702269JmdxPZ','_config','/edit','syncUpdateMutationToColla','threadId','HTTPService','/universer-api/user/list','comments','151645UJHRtU','disposeWithMe','_threadCommentDataSource','Add','UniverThreadCommentDataSourcePlugin','Reply','comment','content','find','5745901PBztIG','delete','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','map','@univerjs/network','slice','40FSTGOa','4739046FRkobQ'];_0x57fc=function(){return _0x4fa579;};return _0x57fc();}function _0x4724(_0x13665b,_0x4caee6){const _0x57fc86=_0x57fc();return _0x4724=function(_0x47241b,_0x3b38a9){_0x47241b=_0x47241b-0x11e;let _0xbfaa9b=_0x57fc86[_0x47241b];return _0xbfaa9b;},_0x4724(_0x13665b,_0x4caee6);}(function(_0xc6cfa9,_0x4769b4){const _0x535a2b=_0x4724,_0x5bd43a=_0xc6cfa9();while(!![]){try{const _0x3111ad=parseInt(_0x535a2b(0x17b))/0x1+parseInt(_0x535a2b(0x183))/0x2+-parseInt(_0x535a2b(0x187))/0x3+parseInt(_0x535a2b(0x19e))/0x4*(parseInt(_0x535a2b(0x18f))/0x5)+parseInt(_0x535a2b(0x19f))/0x6+parseInt(_0x535a2b(0x198))/0x7+-parseInt(_0x535a2b(0x163))/0x8;if(_0x3111ad===_0x4769b4)break;else _0x5bd43a['push'](_0x5bd43a['shift']());}catch(_0x212ea7){_0x5bd43a['push'](_0x5bd43a['shift']());}}}(_0x57fc,0xba6c4),function(_0x43ab63,_0x587279){const _0x1782e6=_0x4724;typeof exports==_0x1782e6(0x178)&&typeof module<'u'?_0x587279(exports,require(_0x1782e6(0x16f)),require(_0x1782e6(0x16b)),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require(_0x1782e6(0x13b)),require(_0x1782e6(0x161)),require(_0x1782e6(0x19c))):typeof define=='function'&&define['amd']?define([_0x1782e6(0x149),_0x1782e6(0x16f),'@univerjs-pro/license',_0x1782e6(0x127),_0x1782e6(0x13f),_0x1782e6(0x13b),_0x1782e6(0x161),_0x1782e6(0x19c)],_0x587279):(_0x43ab63=typeof globalThis<'u'?globalThis:_0x43ab63||self,_0x587279(_0x43ab63[_0x1782e6(0x176)]={},_0x43ab63[_0x1782e6(0x12a)],_0x43ab63['UniverProLicense'],_0x43ab63[_0x1782e6(0x154)],_0x43ab63['UniverThreadCommentUi'],_0x43ab63[_0x1782e6(0x152)],_0x43ab63[_0x1782e6(0x161)],_0x43ab63['UniverNetwork']));}(this,function(_0x2fd12b,_0x5f4e77,_0x33036e,_0x14da9b,_0x4dbacd,_0x565617,_0x176efb,_0x321d5e){'use strict';const _0x47c346=_0x4724;const _0x34747b=_0x47c346(0x19a);var _0x314a6f=(_0x13cbee=>(_0x13cbee[_0x13cbee[_0x47c346(0x16c)]=0x0]=_0x47c346(0x16c),_0x13cbee[_0x13cbee[_0x47c346(0x156)]=0x1]=_0x47c346(0x156),_0x13cbee[_0x13cbee[_0x47c346(0x157)]=-0x1]=_0x47c346(0x157),_0x13cbee))(_0x314a6f||{}),_0x250803=(_0x191b92=>(_0x191b92[_0x191b92['Unknown']=0x0]='Unknown',_0x191b92[_0x191b92['Add']=0x1]=_0x47c346(0x192),_0x191b92[_0x191b92[_0x47c346(0x194)]=0x2]='Reply',_0x191b92[_0x191b92['Edit']=0x3]=_0x47c346(0x14d),_0x191b92[_0x191b92['Delete']=0x4]=_0x47c346(0x167),_0x191b92[_0x191b92[_0x47c346(0x17a)]=0x5]='Solve',_0x191b92[_0x191b92[_0x47c346(0x157)]=-0x1]='UNRECOGNIZED',_0x191b92))(_0x250803||{});const _0x480270=_0x4c9d6d=>_0x14da9b[_0x47c346(0x122)](new Date(+_0x4c9d6d))[_0x47c346(0x121)](_0x47c346(0x148)),_0x487bce=async(_0x39ed40,_0x3e5ed5)=>{const _0x4475ca=_0x47c346,_0x2f9652=_0x39ed40[_0x4475ca(0x125)](_0x14da9b[_0x4475ca(0x145)]),_0x2a4d1a=_0x39ed40['get'](_0x321d5e[_0x4475ca(0x18c)]);_0x3e5ed5[_0x4475ca(0x16d)](_0x3e8352=>{const _0x47647b=_0x4475ca;_0x2f9652[_0x47647b(0x13e)](_0x3e8352)&&_0x3e5ed5[_0x47647b(0x199)](_0x3e8352);}),_0x3e5ed5[_0x4475ca(0x155)]&&(await _0x2a4d1a['get'](_0x4475ca(0x18d),{'params':{'userIDs':[..._0x3e5ed5]}}))[_0x4475ca(0x12d)][_0x4475ca(0x170)]['forEach'](_0x23f48c=>{const _0x1622af=_0x4475ca;_0x23f48c&&_0x2f9652[_0x1622af(0x13d)](_0x23f48c);});};var _0x28c777=Object['getOwnPropertyDescriptor'],_0x5c2ad0=(_0x32fb2b,_0x4afd8f,_0x3efe72,_0x2e4422)=>{for(var _0x20ed43=_0x2e4422>0x1?void 0x0:_0x2e4422?_0x28c777(_0x4afd8f,_0x3efe72):_0x4afd8f,_0x513c40=_0x32fb2b['length']-0x1,_0x30b958;_0x513c40>=0x0;_0x513c40--)(_0x30b958=_0x32fb2b[_0x513c40])&&(_0x20ed43=_0x30b958(_0x20ed43)||_0x20ed43);return _0x20ed43;},_0x3ac03e=(_0xdc7b27,_0x3a550f)=>(_0x5c9f90,_0x15b7eb)=>_0x3a550f(_0x5c9f90,_0x15b7eb,_0xdc7b27);let _0x1311dc=class extends _0x14da9b[_0x47c346(0x17f)]{constructor(_0x49621c,_0x2edd77,_0x27de5b,_0x46ca2c){const _0x4ac366=_0x47c346;super(),this['_commentService']=_0x49621c,this['_threadCommentModel']=_0x2edd77,this['_userService']=_0x27de5b,this[_0x4ac366(0x137)]=_0x46ca2c,this[_0x4ac366(0x146)](),this[_0x4ac366(0x120)]();}[_0x47c346(0x120)](){const _0x3f1396=_0x47c346;this[_0x3f1396(0x190)](this[_0x3f1396(0x123)][_0x3f1396(0x169)]['pipe'](_0x176efb[_0x3f1396(0x15e)](0x10))[_0x3f1396(0x164)](_0x31f174=>{const _0x2e4a06=_0x3f1396,_0x5244d0=new Set();_0x31f174[_0x2e4a06(0x16d)](_0x1806eb=>{const _0x5696e6=_0x2e4a06;switch(_0x1806eb[_0x5696e6(0x173)]){case _0x5696e6(0x140):{const _0x493b32=_0x1806eb['payload'][_0x5696e6(0x128)];_0x5244d0[_0x5696e6(0x140)](_0x493b32);break;}}}),_0x487bce(this['_injector'],_0x5244d0);}));}['_init'](){const _0x2a3110=_0x47c346;this[_0x2a3110(0x190)](this[_0x2a3110(0x15b)][_0x2a3110(0x169)]['subscribe'](async _0x2aad0c=>{const _0x53afd5=_0x2a3110;var _0x28ffbb,_0x13a530,_0xd4018,_0x2e0b0a;const _0x3fb413=(_0x28ffbb=this[_0x53afd5(0x123)][_0x53afd5(0x13a)](_0x2aad0c[_0x53afd5(0x15a)])[_0x53afd5(0x197)](_0x7ea0f=>_0x7ea0f['threadId']===_0x2aad0c[_0x53afd5(0x18b)]))==null?void 0x0:_0x28ffbb['root'];if(!_0x3fb413)return;const {unitId:_0x318920,subUnitId:_0x253323}=_0x3fb413;switch(_0x2aad0c[_0x53afd5(0x160)]&&this[_0x53afd5(0x175)][_0x53afd5(0x13d)](_0x2aad0c['user']),_0x2aad0c[_0x53afd5(0x173)]){case _0x250803[_0x53afd5(0x192)]:break;case _0x250803['Reply']:{this[_0x53afd5(0x123)][_0x53afd5(0x142)](_0x318920,_0x253323,{'unitId':_0x318920,'subUnitId':_0x253323,'ref':'','id':_0x2aad0c['replyId'],'dT':_0x480270(+_0x2aad0c[_0x53afd5(0x171)]),'threadId':_0x2aad0c[_0x53afd5(0x18b)],'personId':(_0xd4018=(_0x13a530=_0x2aad0c[_0x53afd5(0x160)])==null?void 0x0:_0x13a530[_0x53afd5(0x139)])!=null?_0xd4018:_0x2aad0c[_0x53afd5(0x133)],'text':JSON[_0x53afd5(0x180)](_0x2aad0c[_0x53afd5(0x196)]),'parentId':_0x3fb413['id']});break;}case _0x250803[_0x53afd5(0x167)]:{const _0x1fb606=this['_threadCommentModel'][_0x53afd5(0x165)](_0x318920,_0x253323,_0x2aad0c[_0x53afd5(0x138)]);_0x1fb606&&_0x1fb606[_0x53afd5(0x177)]&&this[_0x53afd5(0x123)][_0x53afd5(0x14c)](_0x318920,_0x253323,_0x2aad0c[_0x53afd5(0x138)]);break;}case _0x250803['Edit']:{this[_0x53afd5(0x123)][_0x53afd5(0x15f)](_0x318920,_0x253323,{'commentId':_0x2aad0c['replyId'],'text':JSON[_0x53afd5(0x180)](_0x2aad0c[_0x53afd5(0x196)])});break;}case _0x250803[_0x53afd5(0x17a)]:{const _0x1847a4=(_0x2e0b0a=this['_threadCommentModel'][_0x53afd5(0x13a)](_0x2aad0c[_0x53afd5(0x15a)])['find'](_0x2b6f40=>_0x2b6f40['threadId']===_0x2aad0c['threadId']))==null?void 0x0:_0x2e0b0a[_0x53afd5(0x186)];_0x1847a4&&this[_0x53afd5(0x123)][_0x53afd5(0x153)](_0x318920,_0x253323,_0x1847a4['id'],_0x2aad0c[_0x53afd5(0x1a1)]===_0x314a6f[_0x53afd5(0x156)]);break;}}}));}};_0x1311dc=_0x5c2ad0([_0x3ac03e(0x0,_0x14da9b[_0x47c346(0x1a2)](_0x5f4e77[_0x47c346(0x14e)])),_0x3ac03e(0x1,_0x14da9b[_0x47c346(0x1a2)](_0x565617[_0x47c346(0x129)])),_0x3ac03e(0x2,_0x14da9b['Inject'](_0x14da9b[_0x47c346(0x145)])),_0x3ac03e(0x3,_0x14da9b[_0x47c346(0x1a2)](_0x14da9b[_0x47c346(0x172)]))],_0x1311dc);const _0x17f210=_0x47c346(0x16a),_0x157de8={};var _0xdcd3a7=Object['getOwnPropertyDescriptor'],_0x34c7b4=(_0x225f17,_0x247b40,_0x1bfea3,_0x1564ed)=>{const _0x3e636c=_0x47c346;for(var _0x101ca8=_0x1564ed>0x1?void 0x0:_0x1564ed?_0xdcd3a7(_0x247b40,_0x1bfea3):_0x247b40,_0x15749b=_0x225f17[_0x3e636c(0x181)]-0x1,_0x275f87;_0x15749b>=0x0;_0x15749b--)(_0x275f87=_0x225f17[_0x15749b])&&(_0x101ca8=_0x275f87(_0x101ca8)||_0x101ca8);return _0x101ca8;},_0x487847=(_0x27af3c,_0x28c9b6)=>(_0x178612,_0x420fbd)=>_0x28c9b6(_0x178612,_0x420fbd,_0x27af3c);function _0x3ae681(_0x29b014,_0x37a62e){const _0x12be14=_0x47c346,_0x2ef74a=_0x29b014['replies'][0x0];return{..._0x37a62e,'id':_0x2ef74a[_0x12be14(0x138)],'resolved':_0x29b014[_0x12be14(0x1a1)]===0x1,'dT':_0x480270(_0x2ef74a[_0x12be14(0x171)]),'personId':_0x2ef74a[_0x12be14(0x133)],'threadId':_0x2ef74a[_0x12be14(0x18b)]};}function _0x1ad3d4(_0x3ac632,_0x418031,_0x5ca85b){const _0x5b9f8b=_0x47c346;var _0x15035c,_0x3451d4;if(((_0x3451d4=(_0x15035c=_0x3ac632==null?void 0x0:_0x3ac632[_0x5b9f8b(0x158)])==null?void 0x0:_0x15035c['length'])!=null?_0x3451d4:0x0)>0x0){const _0xd271e8=(_0x404330,_0x575bcd)=>({'id':_0x404330[_0x5b9f8b(0x138)],'threadId':_0x404330[_0x5b9f8b(0x18b)],'dT':_0x480270(_0x404330[_0x5b9f8b(0x171)]),'personId':_0x404330[_0x5b9f8b(0x133)],'resolved':_0x3ac632[_0x5b9f8b(0x1a1)]===_0x314a6f[_0x5b9f8b(0x156)],'unitId':_0x418031,'subUnitId':_0x5ca85b,'text':JSON['parse'](_0x404330[_0x5b9f8b(0x196)]),'parentId':_0x575bcd}),_0x27dfb9=_0xd271e8(_0x3ac632[_0x5b9f8b(0x158)][0x0]);return{..._0x27dfb9,'children':_0x3ac632['replies'][_0x5b9f8b(0x19d)](0x1)[_0x5b9f8b(0x19b)](_0x2ce00d=>_0xd271e8(_0x2ce00d,_0x27dfb9['id']))};}return null;}let _0x40eb98=class{constructor(_0x421d49,_0x597853,_0x247e02,_0x571955){const _0x100781=_0x47c346;this[_0x100781(0x144)]=_0x421d49,this[_0x100781(0x175)]=_0x597853,this[_0x100781(0x124)]=_0x247e02,this['_injector']=_0x571955;}async['addComment'](_0xb721){const _0x31a520=_0x47c346;var _0x186682,_0x2e8e3f;const {parentId:_0x328996,unitId:_0xbf8718,text:_0x4d307d,threadId:_0x2efb2c}=_0xb721,_0x4c240b=(_0x2e8e3f=(_0x186682=_0x4d307d[_0x31a520(0x168)])==null?void 0x0:_0x186682[_0x31a520(0x147)](_0x38adf0=>_0x38adf0[_0x31a520(0x179)]===_0x14da9b[_0x31a520(0x135)]['COMMENT'])[_0x31a520(0x19b)](_0x10961c=>_0x10961c[_0x31a520(0x13c)]))!=null?_0x2e8e3f:[],_0x207f6d=JSON[_0x31a520(0x131)](_0x4d307d),_0x26f6ef=(await this[_0x31a520(0x124)]['requireSession'](_0xbf8718))[_0x31a520(0x15c)]();if(_0x328996){const _0x57869a={'memberId':_0x26f6ef,'unitId':_0xbf8718,'content':_0x207f6d,'mention':_0x4c240b,'threadId':_0x2efb2c},_0x2332ca=(await this[_0x31a520(0x144)][_0x31a520(0x17c)]('/universer-api/comment/unit/'+_0xbf8718+_0x31a520(0x130),{'body':_0x57869a}))[_0x31a520(0x12d)][_0x31a520(0x184)];return{..._0xb721,'id':_0x2332ca[_0x31a520(0x138)],'dT':_0x14da9b[_0x31a520(0x122)](+_0x2332ca[_0x31a520(0x171)])[_0x31a520(0x121)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2332ca[_0x31a520(0x133)]};}else{const _0x60d63c={'memberId':_0x26f6ef,'unitId':_0xbf8718,'content':_0x207f6d,'mention':_0x4c240b},_0x36cd60=await this[_0x31a520(0x144)][_0x31a520(0x17c)](_0x31a520(0x126)+_0xbf8718+'/add',{'body':_0x60d63c});return _0x3ae681(_0x36cd60[_0x31a520(0x12d)][_0x31a520(0x195)],_0xb721);}}async['updateComment'](_0x1ceff5){const _0x479557=_0x47c346;var _0x4fd7bd,_0x4af6a7;const {text:_0x2c8ad4,unitId:_0x58793d}=_0x1ceff5,_0x5cefb7=(_0x4af6a7=(_0x4fd7bd=_0x2c8ad4[_0x479557(0x168)])==null?void 0x0:_0x4fd7bd[_0x479557(0x147)](_0x54f38d=>_0x54f38d['rangeType']===_0x14da9b[_0x479557(0x135)][_0x479557(0x15d)])[_0x479557(0x19b)](_0x4b9c13=>_0x4b9c13[_0x479557(0x13c)]))!=null?_0x4af6a7:[],_0x63d4b0=JSON['stringify'](_0x2c8ad4),_0x16032b=_0x1ceff5[_0x479557(0x18b)],_0x33e476=_0x1ceff5['id'],_0x536c8a={'memberId':(await this[_0x479557(0x124)][_0x479557(0x12f)](_0x58793d))[_0x479557(0x15c)](),'unitId':_0x58793d,'threadId':_0x16032b,'mention':_0x5cefb7,'content':_0x63d4b0,'replyId':_0x33e476},_0x4522ed=await this['_httpService']['post'](_0x479557(0x126)+_0x58793d+_0x479557(0x189),{'body':_0x536c8a});return!_0x4522ed[_0x479557(0x12d)][_0x479557(0x150)]||_0x4522ed[_0x479557(0x12d)][_0x479557(0x150)]['code']===0x1;}async[_0x47c346(0x153)](_0x2a20d3){const _0x4d0537=_0x47c346,{unitId:_0x47471e}=_0x2a20d3,_0x24785c=_0x2a20d3['threadId'],_0xbfc099={'memberId':this[_0x4d0537(0x175)][_0x4d0537(0x17d)]()[_0x4d0537(0x139)],'unitId':_0x47471e,'threadId':_0x24785c,'solved':_0x2a20d3[_0x4d0537(0x14b)]?_0x314a6f[_0x4d0537(0x156)]:_0x314a6f[_0x4d0537(0x16c)]},_0x281d1d=await this[_0x4d0537(0x144)]['post']('/universer-api/comment/unit/'+_0x47471e+'/solved',{'body':_0xbfc099});return!_0x281d1d[_0x4d0537(0x12d)]['error']||_0x281d1d[_0x4d0537(0x12d)]['error']['code']===0x1;}async[_0x47c346(0x14c)](_0x3b01c2,_0x3010ea,_0x245fc0,_0x25747a){const _0x16b619=_0x47c346,_0x2b85c7={'memberId':(await this[_0x16b619(0x124)]['requireSession'](_0x3b01c2))[_0x16b619(0x15c)](),'threadId':_0x245fc0,'replyId':_0x25747a,'unitId':_0x3b01c2},_0xe405bf=await this['_httpService'][_0x16b619(0x17c)]('/universer-api/comment/unit/'+_0x3b01c2+_0x16b619(0x151),{'body':_0x2b85c7});return!_0xe405bf[_0x16b619(0x12d)][_0x16b619(0x150)]||_0xe405bf[_0x16b619(0x12d)]['error'][_0x16b619(0x17e)]===0x1;}async['listComments'](_0x151354,_0x4f32bb,_0x5e24c6){const _0xab8cce=_0x47c346,_0x5489f9={'unitId':_0x151354,'threadId':_0x5e24c6},_0x333dcd=await this[_0xab8cce(0x144)][_0xab8cce(0x17c)](_0xab8cce(0x126)+_0x151354+_0xab8cce(0x134),{'body':_0x5489f9}),_0x4ada1e=_0x5e24c6[_0xab8cce(0x19b)](_0x55486b=>_0x1ad3d4(_0x333dcd[_0xab8cce(0x12d)][_0xab8cce(0x18e)][_0x55486b],_0x151354,_0x4f32bb))['filter'](Boolean);return Object['values'](_0x333dcd[_0xab8cce(0x12d)][_0xab8cce(0x170)])[_0xab8cce(0x16d)](_0x3ef8e5=>{const _0x2b9076=_0xab8cce;this[_0x2b9076(0x175)]['addUser'](_0x3ef8e5);}),_0x4ada1e;}[_0x47c346(0x1a0)](_0x2ee603){const _0x5a4445=_0x47c346;return{'id':_0x2ee603['id'],'threadId':_0x2ee603[_0x5a4445(0x18b)],'ref':_0x2ee603[_0x5a4445(0x16e)]};}};_0x40eb98=_0x34c7b4([_0x487847(0x0,_0x14da9b[_0x47c346(0x1a2)](_0x321d5e['HTTPService'])),_0x487847(0x1,_0x14da9b[_0x47c346(0x1a2)](_0x14da9b[_0x47c346(0x145)])),_0x487847(0x2,_0x14da9b[_0x47c346(0x1a2)](_0x5f4e77[_0x47c346(0x12e)])),_0x487847(0x3,_0x14da9b[_0x47c346(0x1a2)](_0x14da9b['Injector']))],_0x40eb98);var _0x2a40d7=Object[_0x47c346(0x143)],_0x3699e7=(_0x5c3dc5,_0x2d17c8,_0x5b1a6e,_0x3daedf)=>{const _0x5eac97=_0x47c346;for(var _0x142dda=_0x3daedf>0x1?void 0x0:_0x3daedf?_0x2a40d7(_0x2d17c8,_0x5b1a6e):_0x2d17c8,_0x5d21=_0x5c3dc5[_0x5eac97(0x181)]-0x1,_0x37e26d;_0x5d21>=0x0;_0x5d21--)(_0x37e26d=_0x5c3dc5[_0x5d21])&&(_0x142dda=_0x37e26d(_0x142dda)||_0x142dda);return _0x142dda;},_0x473284=(_0x562417,_0x54811c)=>(_0xcfdbb1,_0x4efb2c)=>_0x54811c(_0xcfdbb1,_0x4efb2c,_0x562417);let _0x3860c6=class extends _0x14da9b[_0x47c346(0x17f)]{constructor(_0x49f74a,_0xcc9f1c){const _0x263ea1=_0x47c346;super(),this[_0x263ea1(0x141)]=_0x49f74a,this['_threadCommentDataSource']=_0xcc9f1c,this[_0x263ea1(0x14a)]();}[_0x47c346(0x14a)](){const _0x29f08f=_0x47c346;this[_0x29f08f(0x141)][_0x29f08f(0x11f)]=this[_0x29f08f(0x191)],this['_threadCommentDataSourceService'][_0x29f08f(0x18a)]=!0x1;}};_0x3860c6=_0x3699e7([_0x473284(0x0,_0x565617['IThreadCommentDataSourceService']),_0x473284(0x1,_0x14da9b['Inject'](_0x40eb98))],_0x3860c6);var _0x416996=Object[_0x47c346(0x132)],_0x260ead=Object[_0x47c346(0x143)],_0x5308f8=(_0x2997d0,_0x4833bf,_0x213226)=>_0x4833bf in _0x2997d0?_0x416996(_0x2997d0,_0x4833bf,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x213226}):_0x2997d0[_0x4833bf]=_0x213226,_0x5ceca4=(_0x4207bf,_0x2aa405,_0x2b9207,_0x478b46)=>{for(var _0x19f5e4=_0x478b46>0x1?void 0x0:_0x478b46?_0x260ead(_0x2aa405,_0x2b9207):_0x2aa405,_0x40931a=_0x4207bf['length']-0x1,_0x4caa70;_0x40931a>=0x0;_0x40931a--)(_0x4caa70=_0x4207bf[_0x40931a])&&(_0x19f5e4=_0x4caa70(_0x19f5e4)||_0x19f5e4);return _0x19f5e4;},_0x52b6a7=(_0x54baa6,_0x8a967f)=>(_0x22fca5,_0x57a211)=>_0x8a967f(_0x22fca5,_0x57a211,_0x54baa6),_0x13e52a=(_0x4a360e,_0xf27441,_0x2ea689)=>_0x5308f8(_0x4a360e,typeof _0xf27441!='symbol'?_0xf27441+'':_0xf27441,_0x2ea689);_0x2fd12b[_0x47c346(0x193)]=class extends _0x14da9b['Plugin']{constructor(_0x56f9a1=_0x157de8,_0xad8a78,_0x11015b){const _0x322217=_0x47c346;super(),this[_0x322217(0x188)]=_0x56f9a1,this[_0x322217(0x137)]=_0xad8a78,this[_0x322217(0x185)]=_0x11015b;const {..._0x1708a1}=_0x14da9b[_0x322217(0x166)]({},_0x157de8,this[_0x322217(0x188)]);this['_configService'][_0x322217(0x12c)](_0x17f210,_0x1708a1);}[_0x47c346(0x14f)](){const _0x5920fe=_0x47c346;[[_0x40eb98],[_0x3860c6],[_0x1311dc]][_0x5920fe(0x16d)](_0x55fe7c=>{const _0x4ac28c=_0x5920fe;this[_0x4ac28c(0x137)][_0x4ac28c(0x140)](_0x55fe7c);});}[_0x47c346(0x136)](){const _0x5ca0a0=_0x47c346;this['_injector'][_0x5ca0a0(0x125)](_0x3860c6),this[_0x5ca0a0(0x137)]['get'](_0x1311dc);}},_0x13e52a(_0x2fd12b[_0x47c346(0x193)],'pluginName',_0x34747b),_0x13e52a(_0x2fd12b[_0x47c346(0x193)],'type',_0x14da9b[_0x47c346(0x11e)][_0x47c346(0x162)]),_0x2fd12b[_0x47c346(0x193)]=_0x5ceca4([_0x14da9b[_0x47c346(0x174)](_0x4dbacd['UniverThreadCommentUIPlugin'],_0x5f4e77[_0x47c346(0x182)],_0x33036e[_0x47c346(0x159)]),_0x52b6a7(0x1,_0x14da9b[_0x47c346(0x1a2)](_0x14da9b[_0x47c346(0x172)])),_0x52b6a7(0x2,_0x14da9b['IConfigService'])],_0x2fd12b[_0x47c346(0x193)]),Object[_0x47c346(0x132)](_0x2fd12b,Symbol[_0x47c346(0x12b)],{'value':'Module'});}));
|
|
1
|
+
function _0x5485(){const _0x4595c6=['@univerjs/core','rxjs','_sessionService','_userService','thread-comment-data-source.config','Add','_threadCommentDataSourceService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_httpService','slice','1757280ItoUOj','solved','/universer-api/comment/unit/','UniverProThreadCommentDatasource','post','getMemberID','@univerjs/thread-comment-ui','addUser','DependentOn','UniverThreadCommentUi','rangeType','Disposable','userID','Unknown','/list','UniverNetwork','UNRECOGNIZED','comment','IThreadCommentDataSourceService','UniverProLicense','242620aIxFrr','1566OgifbH','_init','delete','Reply','UniverThreadCommentDataSourcePlugin','threadId','dataSource','935238GJlPRq','toStringTag','add','14shlWCs','onStarting','YYYY/MM/DD\x20HH:mm','10HFfECh','OpenOrReOpen','_configService','code','replyId','UniverCollaborationClientPlugin','3624VmdaYd','_injector','Edit','length','@univerjs/network','subscribe','UniverThreadComment','ref','deleteComment','map','Plugin','find','customRanges','_initDataSource','Inject','UniverLicensePlugin','body','_threadCommentModel','replies','error','Injector','commentUpdate$','getCurrentUser','userId','4412632lJrzxq','COMMENT','users','root','type','defineProperty','UniverInstanceType','_commentService','disposeWithMe','UserManagerService','exports','_initUserSync','get','bufferTime','symbol','unitId','1197822lybgqY','content','/reply','_config','merge','createTimestamp','dayjs','CustomRangeType','Solved','addComment','CollaborationSessionService','updateComment','pluginName','getUnit','@univerjs/thread-comment','UniverThreadCommentUIPlugin','_threadCommentDataSource','@univerjs-pro/collaboration-client','values','format','parse','Delete','user','CommentService','HTTPService','requireSession','/delete','size','reply','4269807ebEtfe','filter','@univerjs-pro/license','UniverCore','Module','UniverProCollaborationClient','getOwnPropertyDescriptor','resolveComment','IConfigService','rangeId','/universer-api/user/list','forEach'];_0x5485=function(){return _0x4595c6;};return _0x5485();}function _0x2e5a(_0x58d2e8,_0x24cb58){const _0x5485fa=_0x5485();return _0x2e5a=function(_0x2e5a13,_0x46b429){_0x2e5a13=_0x2e5a13-0x142;let _0x4e9131=_0x5485fa[_0x2e5a13];return _0x4e9131;},_0x2e5a(_0x58d2e8,_0x24cb58);}(function(_0x20dc26,_0x14167f){const _0x2484ed=_0x2e5a,_0x335a84=_0x20dc26();while(!![]){try{const _0x3136d3=parseInt(_0x2484ed(0x1b4))/0x1+-parseInt(_0x2484ed(0x1bc))/0x2+parseInt(_0x2484ed(0x1b5))/0x3*(-parseInt(_0x2484ed(0x145))/0x4)+parseInt(_0x2484ed(0x1a0))/0x5+parseInt(_0x2484ed(0x16d))/0x6*(-parseInt(_0x2484ed(0x1bf))/0x7)+parseInt(_0x2484ed(0x15d))/0x8+-parseInt(_0x2484ed(0x18a))/0x9*(-parseInt(_0x2484ed(0x1c2))/0xa);if(_0x3136d3===_0x14167f)break;else _0x335a84['push'](_0x335a84['shift']());}catch(_0x48518e){_0x335a84['push'](_0x335a84['shift']());}}}(_0x5485,0x446bd),function(_0x48e470,_0x3a447c){const _0x4eb411=_0x2e5a;typeof exports=='object'&&typeof module<'u'?_0x3a447c(exports,require(_0x4eb411(0x17e)),require(_0x4eb411(0x18c)),require(_0x4eb411(0x196)),require(_0x4eb411(0x1a6)),require('@univerjs/thread-comment'),require(_0x4eb411(0x197)),require(_0x4eb411(0x149))):typeof define=='function'&&define['amd']?define([_0x4eb411(0x167),_0x4eb411(0x17e),_0x4eb411(0x18c),'@univerjs/core','@univerjs/thread-comment-ui',_0x4eb411(0x17b),'rxjs',_0x4eb411(0x149)],_0x3a447c):(_0x48e470=typeof globalThis<'u'?globalThis:_0x48e470||self,_0x3a447c(_0x48e470[_0x4eb411(0x1a3)]={},_0x48e470[_0x4eb411(0x18f)],_0x48e470[_0x4eb411(0x1b3)],_0x48e470[_0x4eb411(0x18d)],_0x48e470[_0x4eb411(0x1a9)],_0x48e470[_0x4eb411(0x14b)],_0x48e470[_0x4eb411(0x197)],_0x48e470[_0x4eb411(0x1af)]));}(this,function(_0x35a643,_0x2a835d,_0x5db0b9,_0x4e7bbd,_0x2ae55d,_0x525930,_0x25beb2,_0x47aaad){'use strict';const _0x2c40ff=_0x2e5a;const _0x42713b=_0x2c40ff(0x19d);var _0x2d0b25=(_0x285e77=>(_0x285e77[_0x285e77['OpenOrReOpen']=0x0]=_0x2c40ff(0x1c3),_0x285e77[_0x285e77[_0x2c40ff(0x175)]=0x1]=_0x2c40ff(0x175),_0x285e77[_0x285e77[_0x2c40ff(0x1b0)]=-0x1]=_0x2c40ff(0x1b0),_0x285e77))(_0x2d0b25||{}),_0x16d9c5=(_0x1ee13=>(_0x1ee13[_0x1ee13[_0x2c40ff(0x1ad)]=0x0]=_0x2c40ff(0x1ad),_0x1ee13[_0x1ee13[_0x2c40ff(0x19b)]=0x1]=_0x2c40ff(0x19b),_0x1ee13[_0x1ee13[_0x2c40ff(0x1b8)]=0x2]=_0x2c40ff(0x1b8),_0x1ee13[_0x1ee13[_0x2c40ff(0x147)]=0x3]='Edit',_0x1ee13[_0x1ee13['Delete']=0x4]='Delete',_0x1ee13[_0x1ee13['Solve']=0x5]='Solve',_0x1ee13[_0x1ee13[_0x2c40ff(0x1b0)]=-0x1]=_0x2c40ff(0x1b0),_0x1ee13))(_0x16d9c5||{});const _0x1d79cb=_0x4608b7=>_0x4e7bbd[_0x2c40ff(0x173)](new Date(+_0x4608b7))[_0x2c40ff(0x180)](_0x2c40ff(0x1c1)),_0x3f7873=async(_0xc5016e,_0x11d986)=>{const _0x24ac0b=_0x2c40ff,_0x3535a4=_0xc5016e['get'](_0x4e7bbd['UserManagerService']),_0x597a58=_0xc5016e[_0x24ac0b(0x169)](_0x47aaad[_0x24ac0b(0x185)]);_0x11d986[_0x24ac0b(0x195)](_0x19835a=>{const _0x34bca7=_0x24ac0b;_0x3535a4['getUser'](_0x19835a)&&_0x11d986[_0x34bca7(0x1b7)](_0x19835a);}),_0x11d986[_0x24ac0b(0x188)]&&(await _0x597a58[_0x24ac0b(0x169)](_0x24ac0b(0x194),{'params':{'userIDs':[..._0x11d986]}}))[_0x24ac0b(0x155)][_0x24ac0b(0x15f)][_0x24ac0b(0x195)](_0xcea7d4=>{const _0x447b3d=_0x24ac0b;_0xcea7d4&&_0x3535a4[_0x447b3d(0x1a7)](_0xcea7d4);});};var _0x30a12d=Object[_0x2c40ff(0x190)],_0x38724c=(_0xb27ddc,_0x73163d,_0x58fe46,_0x566983)=>{const _0x51d464=_0x2c40ff;for(var _0x5bf06f=_0x566983>0x1?void 0x0:_0x566983?_0x30a12d(_0x73163d,_0x58fe46):_0x73163d,_0x9e8e11=_0xb27ddc[_0x51d464(0x148)]-0x1,_0x169749;_0x9e8e11>=0x0;_0x9e8e11--)(_0x169749=_0xb27ddc[_0x9e8e11])&&(_0x5bf06f=_0x169749(_0x5bf06f)||_0x5bf06f);return _0x5bf06f;},_0x1edf6f=(_0x2d63a6,_0x561b1c)=>(_0x3e2989,_0x1d792e)=>_0x561b1c(_0x3e2989,_0x1d792e,_0x2d63a6);let _0x31fca3=class extends _0x4e7bbd['Disposable']{constructor(_0x37b3c3,_0x34ee76,_0x155012,_0x2e8cf4){const _0x2fd27b=_0x2c40ff;super(),this[_0x2fd27b(0x164)]=_0x37b3c3,this[_0x2fd27b(0x156)]=_0x34ee76,this[_0x2fd27b(0x199)]=_0x155012,this[_0x2fd27b(0x146)]=_0x2e8cf4,this['_init'](),this[_0x2fd27b(0x168)]();}[_0x2c40ff(0x168)](){const _0x23e045=_0x2c40ff;this[_0x23e045(0x165)](this['_threadCommentModel'][_0x23e045(0x15a)]['pipe'](_0x25beb2[_0x23e045(0x16a)](0x10))[_0x23e045(0x14a)](_0x8d31f2=>{const _0x56cfd5=_0x23e045,_0x43766d=new Set();_0x8d31f2[_0x56cfd5(0x195)](_0x17ef86=>{const _0x582e7b=_0x56cfd5;switch(_0x17ef86['type']){case _0x582e7b(0x1be):{const _0x1e150e=_0x17ef86['payload']['personId'];_0x43766d[_0x582e7b(0x1be)](_0x1e150e);break;}}}),_0x3f7873(this[_0x56cfd5(0x146)],_0x43766d);}));}[_0x2c40ff(0x1b6)](){const _0x3395da=_0x2c40ff;this[_0x3395da(0x165)](this[_0x3395da(0x164)][_0x3395da(0x15a)][_0x3395da(0x14a)](async _0x13a53f=>{const _0x9151eb=_0x3395da;var _0x2a8e76,_0x45e15b,_0x14496d,_0x5cc27a;const _0x439343=(_0x2a8e76=this[_0x9151eb(0x156)]['getUnit'](_0x13a53f[_0x9151eb(0x16c)])[_0x9151eb(0x150)](_0x22afad=>_0x22afad[_0x9151eb(0x1ba)]===_0x13a53f[_0x9151eb(0x1ba)]))==null?void 0x0:_0x2a8e76[_0x9151eb(0x160)];if(!_0x439343)return;const {unitId:_0xbbaf9,subUnitId:_0xee3cdd}=_0x439343;switch(_0x13a53f[_0x9151eb(0x183)]&&this['_userService'][_0x9151eb(0x1a7)](_0x13a53f[_0x9151eb(0x183)]),_0x13a53f['type']){case _0x16d9c5[_0x9151eb(0x19b)]:break;case _0x16d9c5[_0x9151eb(0x1b8)]:{this[_0x9151eb(0x156)][_0x9151eb(0x176)](_0xbbaf9,_0xee3cdd,{'unitId':_0xbbaf9,'subUnitId':_0xee3cdd,'ref':'','id':_0x13a53f[_0x9151eb(0x143)],'dT':_0x1d79cb(+_0x13a53f[_0x9151eb(0x172)]),'threadId':_0x13a53f[_0x9151eb(0x1ba)],'personId':(_0x14496d=(_0x45e15b=_0x13a53f['user'])==null?void 0x0:_0x45e15b[_0x9151eb(0x1ac)])!=null?_0x14496d:_0x13a53f['userId'],'text':JSON[_0x9151eb(0x181)](_0x13a53f[_0x9151eb(0x16e)]),'parentId':_0x439343['id']});break;}case _0x16d9c5[_0x9151eb(0x182)]:{const _0x2eb0d2=this[_0x9151eb(0x156)]['getComment'](_0xbbaf9,_0xee3cdd,_0x13a53f[_0x9151eb(0x143)]);_0x2eb0d2&&_0x2eb0d2['parentId']&&this[_0x9151eb(0x156)][_0x9151eb(0x14d)](_0xbbaf9,_0xee3cdd,_0x13a53f[_0x9151eb(0x143)]);break;}case _0x16d9c5['Edit']:{this[_0x9151eb(0x156)][_0x9151eb(0x178)](_0xbbaf9,_0xee3cdd,{'commentId':_0x13a53f[_0x9151eb(0x143)],'text':JSON[_0x9151eb(0x181)](_0x13a53f[_0x9151eb(0x16e)])});break;}case _0x16d9c5['Solve']:{const _0x111ee2=(_0x5cc27a=this[_0x9151eb(0x156)][_0x9151eb(0x17a)](_0x13a53f[_0x9151eb(0x16c)])[_0x9151eb(0x150)](_0x9d9f09=>_0x9d9f09['threadId']===_0x13a53f[_0x9151eb(0x1ba)]))==null?void 0x0:_0x5cc27a[_0x9151eb(0x160)];_0x111ee2&&this['_threadCommentModel'][_0x9151eb(0x191)](_0xbbaf9,_0xee3cdd,_0x111ee2['id'],_0x13a53f[_0x9151eb(0x1a1)]===_0x2d0b25[_0x9151eb(0x175)]);break;}}}));}};_0x31fca3=_0x38724c([_0x1edf6f(0x0,_0x4e7bbd[_0x2c40ff(0x153)](_0x2a835d[_0x2c40ff(0x184)])),_0x1edf6f(0x1,_0x4e7bbd[_0x2c40ff(0x153)](_0x525930['ThreadCommentModel'])),_0x1edf6f(0x2,_0x4e7bbd[_0x2c40ff(0x153)](_0x4e7bbd[_0x2c40ff(0x166)])),_0x1edf6f(0x3,_0x4e7bbd[_0x2c40ff(0x153)](_0x4e7bbd[_0x2c40ff(0x159)]))],_0x31fca3);const _0xf1719f=_0x2c40ff(0x19a),_0xd17df2={};var _0x3144cf=Object['getOwnPropertyDescriptor'],_0x2878e7=(_0x1a4c3a,_0x118cb7,_0x485f72,_0x3602e7)=>{const _0x49d9a4=_0x2c40ff;for(var _0x16419a=_0x3602e7>0x1?void 0x0:_0x3602e7?_0x3144cf(_0x118cb7,_0x485f72):_0x118cb7,_0x5bbd9f=_0x1a4c3a[_0x49d9a4(0x148)]-0x1,_0x317aee;_0x5bbd9f>=0x0;_0x5bbd9f--)(_0x317aee=_0x1a4c3a[_0x5bbd9f])&&(_0x16419a=_0x317aee(_0x16419a)||_0x16419a);return _0x16419a;},_0x4b8028=(_0x5a7cc1,_0xd6333b)=>(_0x3b6847,_0x4b6110)=>_0xd6333b(_0x3b6847,_0x4b6110,_0x5a7cc1);function _0x226981(_0x5d7674,_0x2629d7){const _0x3a15ba=_0x2c40ff,_0x5d5c9a=_0x5d7674[_0x3a15ba(0x157)][0x0];return{..._0x2629d7,'id':_0x5d5c9a[_0x3a15ba(0x143)],'resolved':_0x5d7674[_0x3a15ba(0x1a1)]===0x1,'dT':_0x1d79cb(_0x5d5c9a['createTimestamp']),'personId':_0x5d5c9a[_0x3a15ba(0x15c)],'threadId':_0x5d5c9a[_0x3a15ba(0x1ba)]};}function _0x42760d(_0x5d6f9d,_0x4820b9,_0x2318bd){const _0xa52c9f=_0x2c40ff;var _0x46790d,_0x1a8563;if(((_0x1a8563=(_0x46790d=_0x5d6f9d==null?void 0x0:_0x5d6f9d[_0xa52c9f(0x157)])==null?void 0x0:_0x46790d[_0xa52c9f(0x148)])!=null?_0x1a8563:0x0)>0x0){const _0x55a52d=(_0x39194e,_0x9bdfd4)=>({'id':_0x39194e['replyId'],'threadId':_0x39194e[_0xa52c9f(0x1ba)],'dT':_0x1d79cb(_0x39194e[_0xa52c9f(0x172)]),'personId':_0x39194e[_0xa52c9f(0x15c)],'resolved':_0x5d6f9d[_0xa52c9f(0x1a1)]===_0x2d0b25['Solved'],'unitId':_0x4820b9,'subUnitId':_0x2318bd,'text':JSON['parse'](_0x39194e[_0xa52c9f(0x16e)]),'parentId':_0x9bdfd4}),_0x454b1d=_0x55a52d(_0x5d6f9d[_0xa52c9f(0x157)][0x0]);return{..._0x454b1d,'children':_0x5d6f9d[_0xa52c9f(0x157)][_0xa52c9f(0x19f)](0x1)['map'](_0x4d8640=>_0x55a52d(_0x4d8640,_0x454b1d['id']))};}return null;}let _0x134af2=class{constructor(_0x476642,_0x399627,_0x47547c,_0x1b1232){const _0xbd3dfb=_0x2c40ff;this[_0xbd3dfb(0x19e)]=_0x476642,this['_userService']=_0x399627,this['_sessionService']=_0x47547c,this[_0xbd3dfb(0x146)]=_0x1b1232;}async[_0x2c40ff(0x176)](_0x321fe6){const _0x4753c1=_0x2c40ff;var _0x213470,_0x50f704;const {parentId:_0x5764df,unitId:_0x2e5177,text:_0x3280ff,threadId:_0x45ab41}=_0x321fe6,_0x30b331=(_0x50f704=(_0x213470=_0x3280ff['customRanges'])==null?void 0x0:_0x213470[_0x4753c1(0x18b)](_0x5a92f2=>_0x5a92f2['rangeType']===_0x4e7bbd[_0x4753c1(0x174)][_0x4753c1(0x15e)])[_0x4753c1(0x14e)](_0x19d467=>_0x19d467['rangeId']))!=null?_0x50f704:[],_0x521d49=JSON['stringify'](_0x3280ff),_0x513ffc=(await this[_0x4753c1(0x198)]['requireSession'](_0x2e5177))['getMemberID']();if(_0x5764df){const _0x422bd3={'memberId':_0x513ffc,'unitId':_0x2e5177,'content':_0x521d49,'mention':_0x30b331,'threadId':_0x45ab41},_0x3bffda=(await this[_0x4753c1(0x19e)][_0x4753c1(0x1a4)]('/universer-api/comment/unit/'+_0x2e5177+_0x4753c1(0x16f),{'body':_0x422bd3}))[_0x4753c1(0x155)][_0x4753c1(0x189)];return{..._0x321fe6,'id':_0x3bffda[_0x4753c1(0x143)],'dT':_0x4e7bbd[_0x4753c1(0x173)](+_0x3bffda['createTimestamp'])[_0x4753c1(0x180)](_0x4753c1(0x1c1)),'personId':_0x3bffda[_0x4753c1(0x15c)]};}else{const _0x57c4d8={'memberId':_0x513ffc,'unitId':_0x2e5177,'content':_0x521d49,'mention':_0x30b331},_0x4628a6=await this[_0x4753c1(0x19e)][_0x4753c1(0x1a4)](_0x4753c1(0x1a2)+_0x2e5177+'/add',{'body':_0x57c4d8});return _0x226981(_0x4628a6[_0x4753c1(0x155)][_0x4753c1(0x1b1)],_0x321fe6);}}async['updateComment'](_0x44d69c){const _0x386483=_0x2c40ff;var _0x5c55bc,_0x5ee89f;const {text:_0x382190,unitId:_0x478873}=_0x44d69c,_0x45e5fe=(_0x5ee89f=(_0x5c55bc=_0x382190[_0x386483(0x151)])==null?void 0x0:_0x5c55bc['filter'](_0x44150b=>_0x44150b[_0x386483(0x1aa)]===_0x4e7bbd['CustomRangeType'][_0x386483(0x15e)])[_0x386483(0x14e)](_0x5009d5=>_0x5009d5[_0x386483(0x193)]))!=null?_0x5ee89f:[],_0x2c8b59=JSON['stringify'](_0x382190),_0x386ce3=_0x44d69c['threadId'],_0x5bcdb6=_0x44d69c['id'],_0x535c1b={'memberId':(await this[_0x386483(0x198)][_0x386483(0x186)](_0x478873))[_0x386483(0x1a5)](),'unitId':_0x478873,'threadId':_0x386ce3,'mention':_0x45e5fe,'content':_0x2c8b59,'replyId':_0x5bcdb6},_0x1dbca0=await this['_httpService'][_0x386483(0x1a4)](_0x386483(0x1a2)+_0x478873+'/edit',{'body':_0x535c1b});return!_0x1dbca0['body'][_0x386483(0x158)]||_0x1dbca0['body'][_0x386483(0x158)][_0x386483(0x142)]===0x1;}async[_0x2c40ff(0x191)](_0x4ba145){const _0x502586=_0x2c40ff,{unitId:_0x3a9b88}=_0x4ba145,_0x59e7bb=_0x4ba145[_0x502586(0x1ba)],_0x129250={'memberId':this[_0x502586(0x199)][_0x502586(0x15b)]()[_0x502586(0x1ac)],'unitId':_0x3a9b88,'threadId':_0x59e7bb,'solved':_0x4ba145['resolved']?_0x2d0b25[_0x502586(0x175)]:_0x2d0b25[_0x502586(0x1c3)]},_0x9ad54d=await this['_httpService'][_0x502586(0x1a4)]('/universer-api/comment/unit/'+_0x3a9b88+'/solved',{'body':_0x129250});return!_0x9ad54d[_0x502586(0x155)][_0x502586(0x158)]||_0x9ad54d['body']['error'][_0x502586(0x142)]===0x1;}async[_0x2c40ff(0x14d)](_0x504446,_0x1f5599,_0x49871a,_0x4351b3){const _0x2bc695=_0x2c40ff,_0x46fdb8={'memberId':(await this[_0x2bc695(0x198)]['requireSession'](_0x504446))['getMemberID'](),'threadId':_0x49871a,'replyId':_0x4351b3,'unitId':_0x504446},_0x53ba49=await this[_0x2bc695(0x19e)]['post']('/universer-api/comment/unit/'+_0x504446+_0x2bc695(0x187),{'body':_0x46fdb8});return!_0x53ba49[_0x2bc695(0x155)]['error']||_0x53ba49[_0x2bc695(0x155)][_0x2bc695(0x158)]['code']===0x1;}async['listComments'](_0x1a255a,_0x4a4d3d,_0xefdc26){const _0x2aa0c4=_0x2c40ff,_0x1ff45d={'unitId':_0x1a255a,'threadId':_0xefdc26},_0x507301=await this[_0x2aa0c4(0x19e)][_0x2aa0c4(0x1a4)]('/universer-api/comment/unit/'+_0x1a255a+_0x2aa0c4(0x1ae),{'body':_0x1ff45d}),_0x34e877=_0xefdc26[_0x2aa0c4(0x14e)](_0x20c7e5=>_0x42760d(_0x507301['body']['comments'][_0x20c7e5],_0x1a255a,_0x4a4d3d))['filter'](Boolean);return Object[_0x2aa0c4(0x17f)](_0x507301['body'][_0x2aa0c4(0x15f)])[_0x2aa0c4(0x195)](_0x8846b1=>{const _0x12c432=_0x2aa0c4;this[_0x12c432(0x199)][_0x12c432(0x1a7)](_0x8846b1);}),_0x34e877;}['saveCommentToSnapshot'](_0x3d43c0){const _0x33cf9e=_0x2c40ff;return{'id':_0x3d43c0['id'],'threadId':_0x3d43c0['threadId'],'ref':_0x3d43c0[_0x33cf9e(0x14c)]};}};_0x134af2=_0x2878e7([_0x4b8028(0x0,_0x4e7bbd['Inject'](_0x47aaad[_0x2c40ff(0x185)])),_0x4b8028(0x1,_0x4e7bbd[_0x2c40ff(0x153)](_0x4e7bbd[_0x2c40ff(0x166)])),_0x4b8028(0x2,_0x4e7bbd[_0x2c40ff(0x153)](_0x2a835d[_0x2c40ff(0x177)])),_0x4b8028(0x3,_0x4e7bbd[_0x2c40ff(0x153)](_0x4e7bbd[_0x2c40ff(0x159)]))],_0x134af2);var _0x4a8789=Object[_0x2c40ff(0x190)],_0x1ab829=(_0x3fde54,_0x3a1a96,_0x564929,_0x2a56e1)=>{const _0x1e727f=_0x2c40ff;for(var _0x471a62=_0x2a56e1>0x1?void 0x0:_0x2a56e1?_0x4a8789(_0x3a1a96,_0x564929):_0x3a1a96,_0xc6f5bc=_0x3fde54[_0x1e727f(0x148)]-0x1,_0x5387d3;_0xc6f5bc>=0x0;_0xc6f5bc--)(_0x5387d3=_0x3fde54[_0xc6f5bc])&&(_0x471a62=_0x5387d3(_0x471a62)||_0x471a62);return _0x471a62;},_0x4c2184=(_0x183e0b,_0x772958)=>(_0x5029b5,_0x3bfe64)=>_0x772958(_0x5029b5,_0x3bfe64,_0x183e0b);let _0x20909c=class extends _0x4e7bbd[_0x2c40ff(0x1ab)]{constructor(_0x3154a6,_0x318d99){const _0x47880c=_0x2c40ff;super(),this['_threadCommentDataSourceService']=_0x3154a6,this[_0x47880c(0x17d)]=_0x318d99,this[_0x47880c(0x152)]();}['_initDataSource'](){const _0x4b9665=_0x2c40ff;this[_0x4b9665(0x19c)][_0x4b9665(0x1bb)]=this[_0x4b9665(0x17d)],this[_0x4b9665(0x19c)]['syncUpdateMutationToColla']=!0x1;}};_0x20909c=_0x1ab829([_0x4c2184(0x0,_0x525930[_0x2c40ff(0x1b2)]),_0x4c2184(0x1,_0x4e7bbd[_0x2c40ff(0x153)](_0x134af2))],_0x20909c);var _0x31db4b=Object['defineProperty'],_0x8fc42d=Object[_0x2c40ff(0x190)],_0x1d3871=(_0x52bf33,_0x506fb6,_0x2ae994)=>_0x506fb6 in _0x52bf33?_0x31db4b(_0x52bf33,_0x506fb6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2ae994}):_0x52bf33[_0x506fb6]=_0x2ae994,_0x156c7d=(_0x2f2fe1,_0x3d1337,_0x154ce9,_0x2971af)=>{const _0x1e6ad8=_0x2c40ff;for(var _0x42f317=_0x2971af>0x1?void 0x0:_0x2971af?_0x8fc42d(_0x3d1337,_0x154ce9):_0x3d1337,_0x3344df=_0x2f2fe1[_0x1e6ad8(0x148)]-0x1,_0x5cf27d;_0x3344df>=0x0;_0x3344df--)(_0x5cf27d=_0x2f2fe1[_0x3344df])&&(_0x42f317=_0x5cf27d(_0x42f317)||_0x42f317);return _0x42f317;},_0x303c46=(_0x18d5a2,_0x463f0a)=>(_0x123746,_0x279987)=>_0x463f0a(_0x123746,_0x279987,_0x18d5a2),_0x37ff39=(_0x4db279,_0x36ed02,_0x11ded6)=>_0x1d3871(_0x4db279,typeof _0x36ed02!=_0x2c40ff(0x16b)?_0x36ed02+'':_0x36ed02,_0x11ded6);_0x35a643['UniverThreadCommentDataSourcePlugin']=class extends _0x4e7bbd[_0x2c40ff(0x14f)]{constructor(_0x1b30d0=_0xd17df2,_0x528b6d,_0x341b81){const _0x16778e=_0x2c40ff;super(),this[_0x16778e(0x170)]=_0x1b30d0,this[_0x16778e(0x146)]=_0x528b6d,this[_0x16778e(0x1c4)]=_0x341b81;const {..._0x443106}=_0x4e7bbd[_0x16778e(0x171)]({},_0xd17df2,this[_0x16778e(0x170)]);this[_0x16778e(0x1c4)]['setConfig'](_0xf1719f,_0x443106);}[_0x2c40ff(0x1c0)](){const _0x2cc045=_0x2c40ff;[[_0x134af2],[_0x20909c],[_0x31fca3]][_0x2cc045(0x195)](_0x4635ea=>{const _0x1c1c06=_0x2cc045;this[_0x1c1c06(0x146)][_0x1c1c06(0x1be)](_0x4635ea);});}['onReady'](){const _0x5c0162=_0x2c40ff;this[_0x5c0162(0x146)]['get'](_0x20909c),this[_0x5c0162(0x146)]['get'](_0x31fca3);}},_0x37ff39(_0x35a643[_0x2c40ff(0x1b9)],_0x2c40ff(0x179),_0x42713b),_0x37ff39(_0x35a643[_0x2c40ff(0x1b9)],_0x2c40ff(0x161),_0x4e7bbd[_0x2c40ff(0x163)]['UNIVER_UNKNOWN']),_0x35a643[_0x2c40ff(0x1b9)]=_0x156c7d([_0x4e7bbd[_0x2c40ff(0x1a8)](_0x2ae55d[_0x2c40ff(0x17c)],_0x2a835d[_0x2c40ff(0x144)],_0x5db0b9[_0x2c40ff(0x154)]),_0x303c46(0x1,_0x4e7bbd['Inject'](_0x4e7bbd[_0x2c40ff(0x159)])),_0x303c46(0x2,_0x4e7bbd[_0x2c40ff(0x192)])],_0x35a643[_0x2c40ff(0x1b9)]),Object[_0x2c40ff(0x162)](_0x35a643,Symbol[_0x2c40ff(0x1bd)],{'value':_0x2c40ff(0x18e)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.6.10-
|
|
3
|
+
"version": "0.6.10-experimental.20250410-f79ffef",
|
|
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-
|
|
49
|
-
"@univerjs-pro/license": "0.6.10-
|
|
50
|
-
"@univerjs/
|
|
51
|
-
"@univerjs/network": "0.6.10-
|
|
52
|
-
"@univerjs/thread-comment
|
|
53
|
-
"@univerjs/thread-comment": "0.6.10-
|
|
54
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.6.10-experimental.20250410-f79ffef",
|
|
49
|
+
"@univerjs-pro/license": "0.6.10-experimental.20250410-f79ffef",
|
|
50
|
+
"@univerjs/protocol": "0.1.46-alpha.3",
|
|
51
|
+
"@univerjs/network": "0.6.10-experimental.20250410-f79ffef",
|
|
52
|
+
"@univerjs/thread-comment": "0.6.10-experimental.20250410-f79ffef",
|
|
53
|
+
"@univerjs/thread-comment-ui": "0.6.10-experimental.20250410-f79ffef",
|
|
54
|
+
"@univerjs/core": "0.6.10-experimental.20250410-f79ffef"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "^7.8.1",
|