@univerjs-pro/thread-comment-datasource 0.6.10 → 0.7.0-beta.1
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 +10 -10
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0xde316f=_0x5290;(function(_0xaf6147,_0x166a50){const _0x343a2d=_0x5290,_0x3b0139=_0xaf6147();while(!![]){try{const _0x46e85b=parseInt(_0x343a2d(0x18f))/0x1*(-parseInt(_0x343a2d(0x1e3))/0x2)+-parseInt(_0x343a2d(0x1c7))/0x3+parseInt(_0x343a2d(0x17c))/0x4*(-parseInt(_0x343a2d(0x176))/0x5)+-parseInt(_0x343a2d(0x172))/0x6+parseInt(_0x343a2d(0x1d1))/0x7+parseInt(_0x343a2d(0x1a7))/0x8+-parseInt(_0x343a2d(0x194))/0x9*(-parseInt(_0x343a2d(0x1b8))/0xa);if(_0x46e85b===_0x166a50)break;else _0x3b0139['push'](_0x3b0139['shift']());}catch(_0x32775c){_0x3b0139['push'](_0x3b0139['shift']());}}}(_0x410f,0xdac7a));Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0xde316f(0x1bb)});function _0x5290(_0x2e06ce,_0x4a6633){const _0x410fc7=_0x410f();return _0x5290=function(_0x5290a0,_0x18a6ae){_0x5290a0=_0x5290a0-0x167;let _0x4c4e96=_0x410fc7[_0x5290a0];return _0x4c4e96;},_0x5290(_0x2e06ce,_0x4a6633);}const b=require(_0xde316f(0x1c2)),T=require(_0xde316f(0x1a1)),c=require(_0xde316f(0x1c0)),j=require(_0xde316f(0x17f)),M=require(_0xde316f(0x193)),w=require(_0xde316f(0x17d)),P=require('@univerjs/network'),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2568a4=>(_0x2568a4[_0x2568a4[_0xde316f(0x187)]=0x0]='OpenOrReOpen',_0x2568a4[_0x2568a4[_0xde316f(0x19f)]=0x1]=_0xde316f(0x19f),_0x2568a4[_0x2568a4['UNRECOGNIZED']=-0x1]=_0xde316f(0x1bd),_0x2568a4))(I||{}),v=(_0x355172=>(_0x355172[_0x355172[_0xde316f(0x1aa)]=0x0]=_0xde316f(0x1aa),_0x355172[_0x355172[_0xde316f(0x1ba)]=0x1]=_0xde316f(0x1ba),_0x355172[_0x355172[_0xde316f(0x19a)]=0x2]=_0xde316f(0x19a),_0x355172[_0x355172['Edit']=0x3]=_0xde316f(0x197),_0x355172[_0x355172['Delete']=0x4]=_0xde316f(0x19b),_0x355172[_0x355172[_0xde316f(0x1da)]=0x5]=_0xde316f(0x1da),_0x355172[_0x355172[_0xde316f(0x1bd)]=-0x1]=_0xde316f(0x1bd),_0x355172))(v||{});const f=_0x3f57e8=>c[_0xde316f(0x181)](new Date(+_0x3f57e8))[_0xde316f(0x1ae)](_0xde316f(0x1b3)),R=async(_0x25258e,_0x2fbd4b)=>{const _0x2c04c3=_0xde316f,_0x58097c=_0x25258e['get'](c['UserManagerService']),_0xc6685=_0x25258e['get'](P[_0x2c04c3(0x16f)]);_0x2fbd4b[_0x2c04c3(0x1b5)](_0x134724=>{const _0x1c63a0=_0x2c04c3;_0x58097c[_0x1c63a0(0x1a8)](_0x134724)&&_0x2fbd4b[_0x1c63a0(0x16c)](_0x134724);}),_0x2fbd4b['size']&&(await _0xc6685['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x2fbd4b]}}))[_0x2c04c3(0x1d5)][_0x2c04c3(0x189)][_0x2c04c3(0x1b5)](_0xa10e98=>{const _0x23fc62=_0x2c04c3;_0xa10e98&&_0x58097c[_0x23fc62(0x199)](_0xa10e98);});};var $=Object[_0xde316f(0x1b4)],E=(_0x24d354,_0x455baa,_0x39fa30,_0x51ab3d)=>{const _0x1aa530=_0xde316f;for(var _0x30846e=_0x51ab3d>0x1?void 0x0:_0x51ab3d?$(_0x455baa,_0x39fa30):_0x455baa,_0x12d78d=_0x24d354[_0x1aa530(0x1b2)]-0x1,_0x16451b;_0x12d78d>=0x0;_0x12d78d--)(_0x16451b=_0x24d354[_0x12d78d])&&(_0x30846e=_0x16451b(_0x30846e)||_0x30846e);return _0x30846e;},S=(_0x578e34,_0x5217fe)=>(_0x20d65b,_0x15c1cd)=>_0x5217fe(_0x20d65b,_0x15c1cd,_0x578e34);let p=class extends c[_0xde316f(0x1e2)]{constructor(_0x4169af,_0x4497a4,_0x27ac2c,_0x37bc99){const _0x429c4b=_0xde316f;super(),this[_0x429c4b(0x1cc)]=_0x4169af,this[_0x429c4b(0x1bc)]=_0x4497a4,this[_0x429c4b(0x1ad)]=_0x27ac2c,this[_0x429c4b(0x16b)]=_0x37bc99,this[_0x429c4b(0x186)](),this[_0x429c4b(0x1ab)]();}[_0xde316f(0x1ab)](){const _0x3e8c3d=_0xde316f;this['disposeWithMe'](this[_0x3e8c3d(0x1bc)][_0x3e8c3d(0x1ce)]['pipe'](w[_0x3e8c3d(0x1a6)](0x10))[_0x3e8c3d(0x1de)](_0x53688f=>{const _0x5147ca=_0x3e8c3d,_0x5e25e3=new Set();_0x53688f[_0x5147ca(0x1b5)](_0x162ebd=>{const _0x4dac46=_0x5147ca;switch(_0x162ebd[_0x4dac46(0x1a4)]){case _0x4dac46(0x18b):{const _0x175bd0=_0x162ebd[_0x4dac46(0x1c8)][_0x4dac46(0x1cf)];_0x5e25e3['add'](_0x175bd0);break;}}}),R(this[_0x5147ca(0x16b)],_0x5e25e3);}));}['_init'](){const _0x202675=_0xde316f;this[_0x202675(0x178)](this[_0x202675(0x1cc)][_0x202675(0x1ce)][_0x202675(0x1de)](async _0xd9793a=>{const _0x330c27=_0x202675;var _0x448ac1,_0x557cd8,_0x1111b9,_0x4b77cc;const _0x5d4be0=(_0x448ac1=this['_threadCommentModel'][_0x330c27(0x1d7)](_0xd9793a[_0x330c27(0x188)])[_0x330c27(0x1a0)](_0x52b982=>_0x52b982['threadId']===_0xd9793a[_0x330c27(0x17a)]))==null?void 0x0:_0x448ac1[_0x330c27(0x195)];if(!_0x5d4be0)return;const {unitId:_0x526f4b,subUnitId:_0x22b6f7}=_0x5d4be0;switch(_0xd9793a[_0x330c27(0x19c)]&&this['_userService'][_0x330c27(0x199)](_0xd9793a[_0x330c27(0x19c)]),_0xd9793a[_0x330c27(0x1a4)]){case v[_0x330c27(0x1ba)]:break;case v[_0x330c27(0x19a)]:{this[_0x330c27(0x1bc)][_0x330c27(0x1d8)](_0x526f4b,_0x22b6f7,{'unitId':_0x526f4b,'subUnitId':_0x22b6f7,'ref':'','id':_0xd9793a[_0x330c27(0x17e)],'dT':f(+_0xd9793a['createTimestamp']),'threadId':_0xd9793a['threadId'],'personId':(_0x1111b9=(_0x557cd8=_0xd9793a[_0x330c27(0x19c)])==null?void 0x0:_0x557cd8['userID'])!=null?_0x1111b9:_0xd9793a[_0x330c27(0x190)],'text':JSON[_0x330c27(0x192)](_0xd9793a[_0x330c27(0x177)]),'parentId':_0x5d4be0['id']});break;}case v[_0x330c27(0x19b)]:{const _0x5ded7c=this[_0x330c27(0x1bc)][_0x330c27(0x1df)](_0x526f4b,_0x22b6f7,_0xd9793a[_0x330c27(0x17e)]);_0x5ded7c&&_0x5ded7c[_0x330c27(0x1d9)]&&this[_0x330c27(0x1bc)][_0x330c27(0x1b7)](_0x526f4b,_0x22b6f7,_0xd9793a['replyId']);break;}case v[_0x330c27(0x197)]:{this[_0x330c27(0x1bc)]['updateComment'](_0x526f4b,_0x22b6f7,{'commentId':_0xd9793a[_0x330c27(0x17e)],'text':JSON[_0x330c27(0x192)](_0xd9793a[_0x330c27(0x177)])});break;}case v[_0x330c27(0x1da)]:{const _0x12d47b=(_0x4b77cc=this[_0x330c27(0x1bc)][_0x330c27(0x1d7)](_0xd9793a['unitId'])[_0x330c27(0x1a0)](_0x3f3a71=>_0x3f3a71[_0x330c27(0x17a)]===_0xd9793a[_0x330c27(0x17a)]))==null?void 0x0:_0x4b77cc[_0x330c27(0x195)];_0x12d47b&&this['_threadCommentModel'][_0x330c27(0x16a)](_0x526f4b,_0x22b6f7,_0x12d47b['id'],_0xd9793a[_0x330c27(0x1c1)]===I[_0x330c27(0x19f)]);break;}}}));}};p=E([S(0x0,c[_0xde316f(0x19e)](b[_0xde316f(0x1d2)])),S(0x1,c[_0xde316f(0x19e)](M[_0xde316f(0x18c)])),S(0x2,c[_0xde316f(0x19e)](c[_0xde316f(0x1b6)])),S(0x3,c['Inject'](c[_0xde316f(0x18d)]))],p);const q=_0xde316f(0x1bf),D={};var A=Object[_0xde316f(0x1b4)],x=(_0x391fe3,_0x53f4b6,_0x2a74ab,_0x2bb01e)=>{for(var _0xc4b0f5=_0x2bb01e>0x1?void 0x0:_0x2bb01e?A(_0x53f4b6,_0x2a74ab):_0x53f4b6,_0x4abde7=_0x391fe3['length']-0x1,_0x568c64;_0x4abde7>=0x0;_0x4abde7--)(_0x568c64=_0x391fe3[_0x4abde7])&&(_0xc4b0f5=_0x568c64(_0xc4b0f5)||_0xc4b0f5);return _0xc4b0f5;},_=(_0x65e0e8,_0xb6ef6d)=>(_0x61c3cd,_0xaa7578)=>_0xb6ef6d(_0x61c3cd,_0xaa7578,_0x65e0e8);function Y(_0x3a0252,_0x357dd1){const _0x34f256=_0xde316f,_0x6d7533=_0x3a0252[_0x34f256(0x16d)][0x0];return{..._0x357dd1,'id':_0x6d7533[_0x34f256(0x17e)],'resolved':_0x3a0252[_0x34f256(0x1c1)]===0x1,'dT':f(_0x6d7533[_0x34f256(0x185)]),'personId':_0x6d7533[_0x34f256(0x190)],'threadId':_0x6d7533['threadId']};}function G(_0x4118b0,_0x24c94d,_0xcdf136){const _0x1a6687=_0xde316f;var _0x52f740,_0x4f67fd;if(((_0x4f67fd=(_0x52f740=_0x4118b0==null?void 0x0:_0x4118b0['replies'])==null?void 0x0:_0x52f740[_0x1a6687(0x1b2)])!=null?_0x4f67fd:0x0)>0x0){const _0x1191b9=(_0x4a772f,_0x3326ba)=>({'id':_0x4a772f['replyId'],'threadId':_0x4a772f[_0x1a6687(0x17a)],'dT':f(_0x4a772f[_0x1a6687(0x185)]),'personId':_0x4a772f[_0x1a6687(0x190)],'resolved':_0x4118b0[_0x1a6687(0x1c1)]===I[_0x1a6687(0x19f)],'unitId':_0x24c94d,'subUnitId':_0xcdf136,'text':JSON[_0x1a6687(0x192)](_0x4a772f[_0x1a6687(0x177)]),'parentId':_0x3326ba}),_0x289c15=_0x1191b9(_0x4118b0[_0x1a6687(0x16d)][0x0]);return{..._0x289c15,'children':_0x4118b0[_0x1a6687(0x16d)][_0x1a6687(0x191)](0x1)[_0x1a6687(0x1d3)](_0x2bfc3d=>_0x1191b9(_0x2bfc3d,_0x289c15['id']))};}return null;}let g=class{constructor(_0x4d54eb,_0x3dd988,_0x51e695,_0x5ecfd5){const _0x2de7c6=_0xde316f;this[_0x2de7c6(0x1a9)]=_0x4d54eb,this['_userService']=_0x3dd988,this[_0x2de7c6(0x1dd)]=_0x51e695,this[_0x2de7c6(0x16b)]=_0x5ecfd5;}async[_0xde316f(0x1d8)](_0x3cc9e7){const _0xc20415=_0xde316f;var _0x59a19f,_0x132fe4;const {parentId:_0x96624b,unitId:_0x4bc561,text:_0x3ac050,threadId:_0x20de5b}=_0x3cc9e7,_0x2132ba=(_0x132fe4=(_0x59a19f=_0x3ac050['customRanges'])==null?void 0x0:_0x59a19f[_0xc20415(0x182)](_0x1f7403=>_0x1f7403['rangeType']===c[_0xc20415(0x196)][_0xc20415(0x18e)])[_0xc20415(0x1d3)](_0x5075d1=>_0x5075d1[_0xc20415(0x1e0)]))!=null?_0x132fe4:[],_0x5ccc59=JSON[_0xc20415(0x19d)](_0x3ac050),_0x2a4215=(await this[_0xc20415(0x1dd)][_0xc20415(0x1c6)](_0x4bc561))[_0xc20415(0x1b9)]();if(_0x96624b){const _0xd10539={'memberId':_0x2a4215,'unitId':_0x4bc561,'content':_0x5ccc59,'mention':_0x2132ba,'threadId':_0x20de5b},_0x182146=(await this[_0xc20415(0x1a9)]['post'](_0xc20415(0x1be)+_0x4bc561+_0xc20415(0x170),{'body':_0xd10539}))[_0xc20415(0x1d5)]['reply'];return{..._0x3cc9e7,'id':_0x182146[_0xc20415(0x17e)],'dT':c[_0xc20415(0x181)](+_0x182146[_0xc20415(0x185)])['format'](_0xc20415(0x1b3)),'personId':_0x182146['userId']};}else{const _0x53dad9={'memberId':_0x2a4215,'unitId':_0x4bc561,'content':_0x5ccc59,'mention':_0x2132ba},_0x354ad4=await this[_0xc20415(0x1a9)]['post'](_0xc20415(0x1be)+_0x4bc561+_0xc20415(0x169),{'body':_0x53dad9});return Y(_0x354ad4[_0xc20415(0x1d5)][_0xc20415(0x1ca)],_0x3cc9e7);}}async[_0xde316f(0x1c4)](_0x414551){const _0x11c908=_0xde316f;var _0x5348e2,_0x42441c;const {text:_0x1e8864,unitId:_0x4d37de}=_0x414551,_0x4d949a=(_0x42441c=(_0x5348e2=_0x1e8864[_0x11c908(0x1dc)])==null?void 0x0:_0x5348e2[_0x11c908(0x182)](_0x133779=>_0x133779[_0x11c908(0x1b1)]===c[_0x11c908(0x196)][_0x11c908(0x18e)])[_0x11c908(0x1d3)](_0x59f0be=>_0x59f0be[_0x11c908(0x1e0)]))!=null?_0x42441c:[],_0x26f83a=JSON[_0x11c908(0x19d)](_0x1e8864),_0xa0acbc=_0x414551[_0x11c908(0x17a)],_0x34ac79=_0x414551['id'],_0x174e5e={'memberId':(await this[_0x11c908(0x1dd)][_0x11c908(0x1c6)](_0x4d37de))[_0x11c908(0x1b9)](),'unitId':_0x4d37de,'threadId':_0xa0acbc,'mention':_0x4d949a,'content':_0x26f83a,'replyId':_0x34ac79},_0x4d5245=await this[_0x11c908(0x1a9)][_0x11c908(0x1a2)]('/universer-api/comment/unit/'+_0x4d37de+'/edit',{'body':_0x174e5e});return!_0x4d5245[_0x11c908(0x1d5)][_0x11c908(0x18a)]||_0x4d5245[_0x11c908(0x1d5)][_0x11c908(0x18a)][_0x11c908(0x171)]===0x1;}async[_0xde316f(0x16a)](_0x47c11c){const _0x25d4ed=_0xde316f,{unitId:_0x48de68}=_0x47c11c,_0x9fde56=_0x47c11c['threadId'],_0x1ce075={'memberId':this['_userService'][_0x25d4ed(0x1d6)]()['userID'],'unitId':_0x48de68,'threadId':_0x9fde56,'solved':_0x47c11c['resolved']?I[_0x25d4ed(0x19f)]:I['OpenOrReOpen']},_0x45472c=await this[_0x25d4ed(0x1a9)][_0x25d4ed(0x1a2)](_0x25d4ed(0x1be)+_0x48de68+_0x25d4ed(0x184),{'body':_0x1ce075});return!_0x45472c[_0x25d4ed(0x1d5)][_0x25d4ed(0x18a)]||_0x45472c[_0x25d4ed(0x1d5)][_0x25d4ed(0x18a)][_0x25d4ed(0x171)]===0x1;}async['deleteComment'](_0x3b8353,_0x2d2e72,_0x19fc43,_0x5c6b43){const _0x6f6e4c=_0xde316f,_0x4287a7={'memberId':(await this[_0x6f6e4c(0x1dd)]['requireSession'](_0x3b8353))[_0x6f6e4c(0x1b9)](),'threadId':_0x19fc43,'replyId':_0x5c6b43,'unitId':_0x3b8353},_0x311dc6=await this['_httpService'][_0x6f6e4c(0x1a2)](_0x6f6e4c(0x1be)+_0x3b8353+_0x6f6e4c(0x167),{'body':_0x4287a7});return!_0x311dc6[_0x6f6e4c(0x1d5)][_0x6f6e4c(0x18a)]||_0x311dc6[_0x6f6e4c(0x1d5)][_0x6f6e4c(0x18a)][_0x6f6e4c(0x171)]===0x1;}async[_0xde316f(0x17b)](_0xdd9d06,_0x8b3d6a,_0x15bade){const _0x2e8c18=_0xde316f,_0x5b7aa1={'unitId':_0xdd9d06,'threadId':_0x15bade},_0x5681c9=await this['_httpService'][_0x2e8c18(0x1a2)](_0x2e8c18(0x1be)+_0xdd9d06+'/list',{'body':_0x5b7aa1}),_0x3bafae=_0x15bade[_0x2e8c18(0x1d3)](_0x28ca65=>G(_0x5681c9['body'][_0x2e8c18(0x174)][_0x28ca65],_0xdd9d06,_0x8b3d6a))[_0x2e8c18(0x182)](Boolean);return Object[_0x2e8c18(0x1db)](_0x5681c9[_0x2e8c18(0x1d5)][_0x2e8c18(0x189)])['forEach'](_0x476edd=>{const _0x377347=_0x2e8c18;this[_0x377347(0x1ad)]['addUser'](_0x476edd);}),_0x3bafae;}[_0xde316f(0x1ac)](_0x16f041){const _0x26cd82=_0xde316f;return{'id':_0x16f041['id'],'threadId':_0x16f041[_0x26cd82(0x17a)],'ref':_0x16f041[_0x26cd82(0x1af)]};}};function _0x410f(){const _0x360197=['post','onStarting','type','UniverThreadCommentUIPlugin','bufferTime','12318952oILeJr','getUser','_httpService','Unknown','_initUserSync','saveCommentToSnapshot','_userService','format','ref','_config','rangeType','length','YYYY/MM/DD\x20HH:mm','getOwnPropertyDescriptor','forEach','UserManagerService','deleteComment','70cUBFjh','getMemberID','Add','Module','_threadCommentModel','UNRECOGNIZED','/universer-api/comment/unit/','thread-comment-data-source.config','@univerjs/core','solved','@univerjs-pro/collaboration-client','defineProperty','updateComment','get','requireSession','5016474yxHZGQ','payload','IThreadCommentDataSourceService','comment','_threadCommentDataSource','_commentService','UniverThreadCommentDataSourcePlugin','commentUpdate$','personId','onReady','9919420bUNqkY','CommentService','map','_initDataSource','body','getCurrentUser','getUnit','addComment','parentId','Solve','values','customRanges','_sessionService','subscribe','getComment','rangeId','syncUpdateMutationToColla','Disposable','124qABTVL','/delete','dataSource','/add','resolveComment','_injector','delete','replies','UniverInstanceType','HTTPService','/reply','code','2139666rYSGBS','UniverLicensePlugin','comments','UNIVER_UNKNOWN','20DTfzIs','content','disposeWithMe','DependentOn','threadId','listComments','763264JRZBZL','rxjs','replyId','@univerjs/thread-comment-ui','setConfig','dayjs','filter','symbol','/solved','createTimestamp','_init','OpenOrReOpen','unitId','users','error','add','ThreadCommentModel','Injector','COMMENT','7636AykMvN','userId','slice','parse','@univerjs/thread-comment','1548846viSAnw','root','CustomRangeType','Edit','_configService','addUser','Reply','Delete','user','stringify','Inject','Solved','find','@univerjs-pro/license'];_0x410f=function(){return _0x360197;};return _0x410f();}g=x([_(0x0,c[_0xde316f(0x19e)](P[_0xde316f(0x16f)])),_(0x1,c[_0xde316f(0x19e)](c[_0xde316f(0x1b6)])),_(0x2,c[_0xde316f(0x19e)](b['CollaborationSessionService'])),_(0x3,c['Inject'](c[_0xde316f(0x18d)]))],g);var H=Object[_0xde316f(0x1b4)],J=(_0x1b704b,_0x15fd41,_0x5ef9d0,_0x4e6c8d)=>{const _0x18f829=_0xde316f;for(var _0x92354b=_0x4e6c8d>0x1?void 0x0:_0x4e6c8d?H(_0x15fd41,_0x5ef9d0):_0x15fd41,_0xe48a5d=_0x1b704b[_0x18f829(0x1b2)]-0x1,_0x274e4c;_0xe48a5d>=0x0;_0xe48a5d--)(_0x274e4c=_0x1b704b[_0xe48a5d])&&(_0x92354b=_0x274e4c(_0x92354b)||_0x92354b);return _0x92354b;},y=(_0x21240e,_0x10c486)=>(_0x9a0ec5,_0x41455a)=>_0x10c486(_0x9a0ec5,_0x41455a,_0x21240e);let C=class extends c[_0xde316f(0x1e2)]{constructor(_0x4f3260,_0x52efe0){const _0x13c558=_0xde316f;super(),this['_threadCommentDataSourceService']=_0x4f3260,this[_0x13c558(0x1cb)]=_0x52efe0,this[_0x13c558(0x1d4)]();}[_0xde316f(0x1d4)](){const _0x599c6e=_0xde316f;this['_threadCommentDataSourceService'][_0x599c6e(0x168)]=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x599c6e(0x1e1)]=!0x1;}};C=J([y(0x0,M[_0xde316f(0x1c9)]),y(0x1,c[_0xde316f(0x19e)](g))],C);var F=Object[_0xde316f(0x1c3)],L=Object[_0xde316f(0x1b4)],Z=(_0x45a7c7,_0x1601a5,_0x541237)=>_0x1601a5 in _0x45a7c7?F(_0x45a7c7,_0x1601a5,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x541237}):_0x45a7c7[_0x1601a5]=_0x541237,W=(_0x4125b2,_0x4363d2,_0x54e831,_0xbe72e5)=>{const _0x1e5963=_0xde316f;for(var _0x2ba762=_0xbe72e5>0x1?void 0x0:_0xbe72e5?L(_0x4363d2,_0x54e831):_0x4363d2,_0x1511eb=_0x4125b2[_0x1e5963(0x1b2)]-0x1,_0x2a3291;_0x1511eb>=0x0;_0x1511eb--)(_0x2a3291=_0x4125b2[_0x1511eb])&&(_0x2ba762=_0x2a3291(_0x2ba762)||_0x2ba762);return _0x2ba762;},O=(_0x31bdf3,_0x47473d)=>(_0x5ba526,_0x579a37)=>_0x47473d(_0x5ba526,_0x579a37,_0x31bdf3),N=(_0x51b2cc,_0x9a1bd9,_0x3f9bdf)=>Z(_0x51b2cc,typeof _0x9a1bd9!=_0xde316f(0x183)?_0x9a1bd9+'':_0x9a1bd9,_0x3f9bdf);exports['UniverThreadCommentDataSourcePlugin']=class extends c['Plugin']{constructor(_0x2f4ef1=D,_0x5b16cf,_0x4271d9){const _0x57290d=_0xde316f;super(),this[_0x57290d(0x1b0)]=_0x2f4ef1,this[_0x57290d(0x16b)]=_0x5b16cf,this[_0x57290d(0x198)]=_0x4271d9;const {..._0x85ad8f}=c['merge']({},D,this[_0x57290d(0x1b0)]);this[_0x57290d(0x198)][_0x57290d(0x180)](q,_0x85ad8f);}[_0xde316f(0x1a3)](){[[g],[C],[p]]['forEach'](_0x3d30d8=>{const _0x378af1=_0x5290;this[_0x378af1(0x16b)][_0x378af1(0x18b)](_0x3d30d8);});}[_0xde316f(0x1d0)](){const _0x18688e=_0xde316f;this[_0x18688e(0x16b)][_0x18688e(0x1c5)](C),this['_injector'][_0x18688e(0x1c5)](p);}},N(exports[_0xde316f(0x1cd)],'pluginName',U),N(exports[_0xde316f(0x1cd)],_0xde316f(0x1a4),c[_0xde316f(0x16e)][_0xde316f(0x175)]),exports[_0xde316f(0x1cd)]=W([c[_0xde316f(0x179)](j[_0xde316f(0x1a5)],b['UniverCollaborationClientPlugin'],T[_0xde316f(0x173)]),O(0x1,c[_0xde316f(0x19e)](c[_0xde316f(0x18d)])),O(0x2,c['IConfigService'])],exports[_0xde316f(0x1cd)]);
|
|
1
|
+
'use strict';const _0x56aee4=_0x25ba;(function(_0x5db35d,_0x28bee2){const _0xcfa7da=_0x25ba,_0x1bad1e=_0x5db35d();while(!![]){try{const _0x49599e=parseInt(_0xcfa7da(0x211))/0x1+-parseInt(_0xcfa7da(0x1f3))/0x2*(parseInt(_0xcfa7da(0x1e9))/0x3)+parseInt(_0xcfa7da(0x1e4))/0x4+-parseInt(_0xcfa7da(0x1ed))/0x5+-parseInt(_0xcfa7da(0x1d2))/0x6+-parseInt(_0xcfa7da(0x1e7))/0x7*(-parseInt(_0xcfa7da(0x234))/0x8)+-parseInt(_0xcfa7da(0x1cd))/0x9*(-parseInt(_0xcfa7da(0x214))/0xa);if(_0x49599e===_0x28bee2)break;else _0x1bad1e['push'](_0x1bad1e['shift']());}catch(_0x9662d9){_0x1bad1e['push'](_0x1bad1e['shift']());}}}(_0x1040,0x75c85));Object[_0x56aee4(0x1f1)](exports,Symbol[_0x56aee4(0x219)],{'value':_0x56aee4(0x1e6)});const b=require(_0x56aee4(0x1c0)),T=require(_0x56aee4(0x1d1)),c=require(_0x56aee4(0x1d8)),j=require(_0x56aee4(0x1b9)),M=require(_0x56aee4(0x1ce)),w=require('rxjs'),P=require('@univerjs/network'),U=_0x56aee4(0x1df);var I=(_0x322a73=>(_0x322a73[_0x322a73[_0x56aee4(0x209)]=0x0]=_0x56aee4(0x209),_0x322a73[_0x322a73['Solved']=0x1]='Solved',_0x322a73[_0x322a73[_0x56aee4(0x201)]=-0x1]=_0x56aee4(0x201),_0x322a73))(I||{}),v=(_0x1b9fa0=>(_0x1b9fa0[_0x1b9fa0[_0x56aee4(0x20a)]=0x0]=_0x56aee4(0x20a),_0x1b9fa0[_0x1b9fa0[_0x56aee4(0x1f5)]=0x1]=_0x56aee4(0x1f5),_0x1b9fa0[_0x1b9fa0[_0x56aee4(0x22c)]=0x2]=_0x56aee4(0x22c),_0x1b9fa0[_0x1b9fa0[_0x56aee4(0x21a)]=0x3]=_0x56aee4(0x21a),_0x1b9fa0[_0x1b9fa0['Delete']=0x4]='Delete',_0x1b9fa0[_0x1b9fa0[_0x56aee4(0x1bd)]=0x5]=_0x56aee4(0x1bd),_0x1b9fa0[_0x1b9fa0[_0x56aee4(0x201)]=-0x1]='UNRECOGNIZED',_0x1b9fa0))(v||{});const f=_0x1f3c8b=>c['dayjs'](new Date(+_0x1f3c8b))[_0x56aee4(0x1c5)](_0x56aee4(0x1ff)),R=async(_0x249299,_0xce935f)=>{const _0x4baf13=_0x56aee4,_0x4ca779=_0x249299[_0x4baf13(0x21e)](c[_0x4baf13(0x1ba)]),_0x2666d1=_0x249299[_0x4baf13(0x21e)](P[_0x4baf13(0x1cb)]);_0xce935f[_0x4baf13(0x1f7)](_0x36796c=>{const _0x382818=_0x4baf13;_0x4ca779[_0x382818(0x1c9)](_0x36796c)&&_0xce935f[_0x382818(0x216)](_0x36796c);}),_0xce935f[_0x4baf13(0x1fa)]&&(await _0x2666d1['get'](_0x4baf13(0x229),{'params':{'userIDs':[..._0xce935f]}}))[_0x4baf13(0x212)][_0x4baf13(0x228)][_0x4baf13(0x1f7)](_0x2d86e9=>{const _0x2637f0=_0x4baf13;_0x2d86e9&&_0x4ca779[_0x2637f0(0x222)](_0x2d86e9);});};var $=Object[_0x56aee4(0x1f2)],E=(_0x392291,_0x73ad5f,_0x177780,_0x4df193)=>{for(var _0x465b54=_0x4df193>0x1?void 0x0:_0x4df193?$(_0x73ad5f,_0x177780):_0x73ad5f,_0x5ea585=_0x392291['length']-0x1,_0x1fba34;_0x5ea585>=0x0;_0x5ea585--)(_0x1fba34=_0x392291[_0x5ea585])&&(_0x465b54=_0x1fba34(_0x465b54)||_0x465b54);return _0x465b54;},S=(_0x3c5bf7,_0xf0e727)=>(_0x2a3eca,_0x45ba03)=>_0xf0e727(_0x2a3eca,_0x45ba03,_0x3c5bf7);let p=class extends c[_0x56aee4(0x21f)]{constructor(_0x363613,_0x4bd9b3,_0x162af8,_0x42b1b7){const _0x358bab=_0x56aee4;super(),this[_0x358bab(0x1cf)]=_0x363613,this[_0x358bab(0x207)]=_0x4bd9b3,this[_0x358bab(0x1f6)]=_0x162af8,this[_0x358bab(0x217)]=_0x42b1b7,this[_0x358bab(0x220)](),this[_0x358bab(0x20e)]();}[_0x56aee4(0x20e)](){const _0x207eb0=_0x56aee4;this[_0x207eb0(0x221)](this['_threadCommentModel']['commentUpdate$']['pipe'](w[_0x207eb0(0x1ca)](0x10))[_0x207eb0(0x1c4)](_0xe4c020=>{const _0x52feac=_0x207eb0,_0x7156de=new Set();_0xe4c020[_0x52feac(0x1f7)](_0x1f35d8=>{const _0x181f94=_0x52feac;switch(_0x1f35d8[_0x181f94(0x232)]){case _0x181f94(0x1d3):{const _0x3702ad=_0x1f35d8[_0x181f94(0x1c6)][_0x181f94(0x1fc)];_0x7156de['add'](_0x3702ad);break;}}}),R(this['_injector'],_0x7156de);}));}[_0x56aee4(0x220)](){const _0x2f69ff=_0x56aee4;this[_0x2f69ff(0x221)](this[_0x2f69ff(0x1cf)][_0x2f69ff(0x215)][_0x2f69ff(0x1c4)](async _0x9f559c=>{const _0x10402c=_0x2f69ff;var _0x34ad67,_0x38ee97,_0xc6347b,_0x62fef2;const _0x518bdb=(_0x34ad67=this[_0x10402c(0x207)][_0x10402c(0x1bc)](_0x9f559c[_0x10402c(0x235)])['find'](_0x39ea8f=>_0x39ea8f['threadId']===_0x9f559c[_0x10402c(0x223)]))==null?void 0x0:_0x34ad67[_0x10402c(0x237)];if(!_0x518bdb)return;const {unitId:_0x11c3df,subUnitId:_0xff2591}=_0x518bdb;switch(_0x9f559c[_0x10402c(0x1fd)]&&this[_0x10402c(0x1f6)][_0x10402c(0x222)](_0x9f559c['user']),_0x9f559c[_0x10402c(0x232)]){case v[_0x10402c(0x1f5)]:break;case v[_0x10402c(0x22c)]:{this[_0x10402c(0x207)][_0x10402c(0x1e8)](_0x11c3df,_0xff2591,{'unitId':_0x11c3df,'subUnitId':_0xff2591,'ref':'','id':_0x9f559c[_0x10402c(0x1e0)],'dT':f(+_0x9f559c[_0x10402c(0x206)]),'threadId':_0x9f559c[_0x10402c(0x223)],'personId':(_0xc6347b=(_0x38ee97=_0x9f559c[_0x10402c(0x1fd)])==null?void 0x0:_0x38ee97['userID'])!=null?_0xc6347b:_0x9f559c['userId'],'text':JSON[_0x10402c(0x22a)](_0x9f559c[_0x10402c(0x230)]),'parentId':_0x518bdb['id']});break;}case v[_0x10402c(0x20b)]:{const _0x446417=this[_0x10402c(0x207)][_0x10402c(0x218)](_0x11c3df,_0xff2591,_0x9f559c[_0x10402c(0x1e0)]);_0x446417&&_0x446417[_0x10402c(0x1e5)]&&this['_threadCommentModel']['deleteComment'](_0x11c3df,_0xff2591,_0x9f559c[_0x10402c(0x1e0)]);break;}case v[_0x10402c(0x21a)]:{this[_0x10402c(0x207)][_0x10402c(0x1de)](_0x11c3df,_0xff2591,{'commentId':_0x9f559c[_0x10402c(0x1e0)],'text':JSON[_0x10402c(0x22a)](_0x9f559c[_0x10402c(0x230)])});break;}case v[_0x10402c(0x1bd)]:{const _0xc8e1d7=(_0x62fef2=this[_0x10402c(0x207)][_0x10402c(0x1bc)](_0x9f559c['unitId'])[_0x10402c(0x1e1)](_0x2935a0=>_0x2935a0[_0x10402c(0x223)]===_0x9f559c[_0x10402c(0x223)]))==null?void 0x0:_0x62fef2[_0x10402c(0x237)];_0xc8e1d7&&this[_0x10402c(0x207)]['resolveComment'](_0x11c3df,_0xff2591,_0xc8e1d7['id'],_0x9f559c[_0x10402c(0x202)]===I[_0x10402c(0x1dd)]);break;}}}));}};p=E([S(0x0,c[_0x56aee4(0x1ef)](b[_0x56aee4(0x1eb)])),S(0x1,c[_0x56aee4(0x1ef)](M[_0x56aee4(0x1d9)])),S(0x2,c['Inject'](c[_0x56aee4(0x1ba)])),S(0x3,c['Inject'](c[_0x56aee4(0x1be)]))],p);const q='thread-comment-data-source.config',D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x21135f,_0x41c8d3,_0x6de6e9,_0x559fb8)=>{const _0x305a62=_0x56aee4;for(var _0x67f68=_0x559fb8>0x1?void 0x0:_0x559fb8?A(_0x41c8d3,_0x6de6e9):_0x41c8d3,_0x2eb209=_0x21135f[_0x305a62(0x22e)]-0x1,_0x44f581;_0x2eb209>=0x0;_0x2eb209--)(_0x44f581=_0x21135f[_0x2eb209])&&(_0x67f68=_0x44f581(_0x67f68)||_0x67f68);return _0x67f68;},_=(_0x468545,_0xb1c0b0)=>(_0x445571,_0x2ffbe6)=>_0xb1c0b0(_0x445571,_0x2ffbe6,_0x468545);function _0x1040(){const _0x596942=['UniverThreadCommentDataSourcePlugin','_threadCommentDataSource','_threadCommentDataSourceService','subscribe','format','payload','COMMENT','CollaborationSessionService','getUser','bufferTime','HTTPService','getMemberID','6123186ydVQeB','@univerjs/thread-comment','_commentService','/edit','@univerjs-pro/license','5000898ZJEmXN','add','_initDataSource','UniverInstanceType','userId','dataSource','@univerjs/core','ThreadCommentModel','_configService','IConfigService','stringify','Solved','updateComment','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','replyId','find','DependentOn','error','2007588ADtXzv','parentId','Module','259jtmIKV','addComment','439035AMICgT','UniverThreadCommentUIPlugin','CommentService','pluginName','1237550XNVFdj','slice','Inject','onReady','defineProperty','getOwnPropertyDescriptor','6iijiWo','code','Add','_userService','forEach','comment','ref','size','/solved','personId','user','symbol','YYYY/MM/DD\x20HH:mm','replies','UNRECOGNIZED','solved','_httpService','/add','Plugin','createTimestamp','_threadCommentModel','_sessionService','OpenOrReOpen','Unknown','Delete','resolved','UniverCollaborationClientPlugin','_initUserSync','post','customRanges','324303PCdCzZ','body','/delete','10DOrPve','commentUpdate$','delete','_injector','getComment','toStringTag','Edit','merge','setConfig','reply','get','Disposable','_init','disposeWithMe','addUser','threadId','map','requireSession','filter','getCurrentUser','users','/universer-api/user/list','parse','listComments','Reply','UniverLicensePlugin','length','/universer-api/comment/unit/','content','rangeType','type','userID','107224uZkcYs','unitId','deleteComment','root','rangeId','@univerjs/thread-comment-ui','UserManagerService','_config','getUnit','Solve','Injector','onStarting','@univerjs-pro/collaboration-client'];_0x1040=function(){return _0x596942;};return _0x1040();}function Y(_0x4e0e47,_0x303a21){const _0x4a0ac1=_0x56aee4,_0x5b695f=_0x4e0e47[_0x4a0ac1(0x200)][0x0];return{..._0x303a21,'id':_0x5b695f[_0x4a0ac1(0x1e0)],'resolved':_0x4e0e47[_0x4a0ac1(0x202)]===0x1,'dT':f(_0x5b695f[_0x4a0ac1(0x206)]),'personId':_0x5b695f[_0x4a0ac1(0x1d6)],'threadId':_0x5b695f[_0x4a0ac1(0x223)]};}function G(_0xed5705,_0x2659ab,_0x38059b){const _0x39fbcf=_0x56aee4;var _0x5d5a90,_0xda29d2;if(((_0xda29d2=(_0x5d5a90=_0xed5705==null?void 0x0:_0xed5705[_0x39fbcf(0x200)])==null?void 0x0:_0x5d5a90[_0x39fbcf(0x22e)])!=null?_0xda29d2:0x0)>0x0){const _0x4f91b4=(_0x33930e,_0x4bb76e)=>({'id':_0x33930e['replyId'],'threadId':_0x33930e[_0x39fbcf(0x223)],'dT':f(_0x33930e[_0x39fbcf(0x206)]),'personId':_0x33930e[_0x39fbcf(0x1d6)],'resolved':_0xed5705[_0x39fbcf(0x202)]===I[_0x39fbcf(0x1dd)],'unitId':_0x2659ab,'subUnitId':_0x38059b,'text':JSON[_0x39fbcf(0x22a)](_0x33930e['content']),'parentId':_0x4bb76e}),_0x7a4374=_0x4f91b4(_0xed5705['replies'][0x0]);return{..._0x7a4374,'children':_0xed5705[_0x39fbcf(0x200)][_0x39fbcf(0x1ee)](0x1)['map'](_0x1f9e0e=>_0x4f91b4(_0x1f9e0e,_0x7a4374['id']))};}return null;}let g=class{constructor(_0x127d6b,_0x850cb1,_0x1c726c,_0x4f0d7c){const _0x5c8175=_0x56aee4;this['_httpService']=_0x127d6b,this[_0x5c8175(0x1f6)]=_0x850cb1,this[_0x5c8175(0x208)]=_0x1c726c,this[_0x5c8175(0x217)]=_0x4f0d7c;}async[_0x56aee4(0x1e8)](_0x40a292){const _0x3f0d53=_0x56aee4;var _0x47a17c,_0x458d21;const {parentId:_0x560881,unitId:_0x391143,text:_0x17f3ef,threadId:_0x3ac1f0}=_0x40a292,_0x3c16cb=(_0x458d21=(_0x47a17c=_0x17f3ef[_0x3f0d53(0x210)])==null?void 0x0:_0x47a17c[_0x3f0d53(0x226)](_0x3ff590=>_0x3ff590['rangeType']===c['CustomRangeType'][_0x3f0d53(0x1c7)])[_0x3f0d53(0x224)](_0x21b9e1=>_0x21b9e1[_0x3f0d53(0x238)]))!=null?_0x458d21:[],_0x2830b6=JSON[_0x3f0d53(0x1dc)](_0x17f3ef),_0x28150e=(await this[_0x3f0d53(0x208)][_0x3f0d53(0x225)](_0x391143))[_0x3f0d53(0x1cc)]();if(_0x560881){const _0x145fff={'memberId':_0x28150e,'unitId':_0x391143,'content':_0x2830b6,'mention':_0x3c16cb,'threadId':_0x3ac1f0},_0x331e34=(await this['_httpService'][_0x3f0d53(0x20f)](_0x3f0d53(0x22f)+_0x391143+'/reply',{'body':_0x145fff}))['body'][_0x3f0d53(0x21d)];return{..._0x40a292,'id':_0x331e34['replyId'],'dT':c['dayjs'](+_0x331e34[_0x3f0d53(0x206)])[_0x3f0d53(0x1c5)](_0x3f0d53(0x1ff)),'personId':_0x331e34[_0x3f0d53(0x1d6)]};}else{const _0x145c29={'memberId':_0x28150e,'unitId':_0x391143,'content':_0x2830b6,'mention':_0x3c16cb},_0xb01778=await this[_0x3f0d53(0x203)][_0x3f0d53(0x20f)](_0x3f0d53(0x22f)+_0x391143+_0x3f0d53(0x204),{'body':_0x145c29});return Y(_0xb01778[_0x3f0d53(0x212)][_0x3f0d53(0x1f8)],_0x40a292);}}async['updateComment'](_0x5423e9){const _0x4effb7=_0x56aee4;var _0x19f767,_0x4f8ac6;const {text:_0x335360,unitId:_0x3d4256}=_0x5423e9,_0x1fb32c=(_0x4f8ac6=(_0x19f767=_0x335360['customRanges'])==null?void 0x0:_0x19f767[_0x4effb7(0x226)](_0x4de36a=>_0x4de36a[_0x4effb7(0x231)]===c['CustomRangeType'][_0x4effb7(0x1c7)])[_0x4effb7(0x224)](_0x479daa=>_0x479daa['rangeId']))!=null?_0x4f8ac6:[],_0x45b134=JSON[_0x4effb7(0x1dc)](_0x335360),_0x1f8375=_0x5423e9[_0x4effb7(0x223)],_0x428d48=_0x5423e9['id'],_0x3581ae={'memberId':(await this['_sessionService'][_0x4effb7(0x225)](_0x3d4256))[_0x4effb7(0x1cc)](),'unitId':_0x3d4256,'threadId':_0x1f8375,'mention':_0x1fb32c,'content':_0x45b134,'replyId':_0x428d48},_0x79e18a=await this[_0x4effb7(0x203)][_0x4effb7(0x20f)](_0x4effb7(0x22f)+_0x3d4256+_0x4effb7(0x1d0),{'body':_0x3581ae});return!_0x79e18a[_0x4effb7(0x212)]['error']||_0x79e18a['body']['error'][_0x4effb7(0x1f4)]===0x1;}async['resolveComment'](_0x210121){const _0x5531ec=_0x56aee4,{unitId:_0x37fcc0}=_0x210121,_0xf34bb2=_0x210121[_0x5531ec(0x223)],_0xd8401c={'memberId':this[_0x5531ec(0x1f6)][_0x5531ec(0x227)]()[_0x5531ec(0x233)],'unitId':_0x37fcc0,'threadId':_0xf34bb2,'solved':_0x210121[_0x5531ec(0x20c)]?I[_0x5531ec(0x1dd)]:I[_0x5531ec(0x209)]},_0x755ac5=await this[_0x5531ec(0x203)][_0x5531ec(0x20f)](_0x5531ec(0x22f)+_0x37fcc0+_0x5531ec(0x1fb),{'body':_0xd8401c});return!_0x755ac5[_0x5531ec(0x212)]['error']||_0x755ac5[_0x5531ec(0x212)]['error'][_0x5531ec(0x1f4)]===0x1;}async[_0x56aee4(0x236)](_0x156284,_0x23ffcb,_0x4c7735,_0x22dc6d){const _0x52f9af=_0x56aee4,_0x2639bb={'memberId':(await this['_sessionService'][_0x52f9af(0x225)](_0x156284))[_0x52f9af(0x1cc)](),'threadId':_0x4c7735,'replyId':_0x22dc6d,'unitId':_0x156284},_0x52cf32=await this[_0x52f9af(0x203)]['post'](_0x52f9af(0x22f)+_0x156284+_0x52f9af(0x213),{'body':_0x2639bb});return!_0x52cf32[_0x52f9af(0x212)][_0x52f9af(0x1e3)]||_0x52cf32['body']['error'][_0x52f9af(0x1f4)]===0x1;}async[_0x56aee4(0x22b)](_0x58c5d7,_0x50fecb,_0x5e0045){const _0x252c99=_0x56aee4,_0x13b5bc={'unitId':_0x58c5d7,'threadId':_0x5e0045},_0x1206fe=await this[_0x252c99(0x203)][_0x252c99(0x20f)](_0x252c99(0x22f)+_0x58c5d7+'/list',{'body':_0x13b5bc}),_0x2141fe=_0x5e0045[_0x252c99(0x224)](_0x30173d=>G(_0x1206fe[_0x252c99(0x212)]['comments'][_0x30173d],_0x58c5d7,_0x50fecb))[_0x252c99(0x226)](Boolean);return Object['values'](_0x1206fe['body'][_0x252c99(0x228)])['forEach'](_0x269c71=>{const _0x5b17b5=_0x252c99;this[_0x5b17b5(0x1f6)][_0x5b17b5(0x222)](_0x269c71);}),_0x2141fe;}['saveCommentToSnapshot'](_0x1f36e0){const _0x5c0d9d=_0x56aee4;return{'id':_0x1f36e0['id'],'threadId':_0x1f36e0[_0x5c0d9d(0x223)],'ref':_0x1f36e0[_0x5c0d9d(0x1f9)]};}};g=x([_(0x0,c[_0x56aee4(0x1ef)](P[_0x56aee4(0x1cb)])),_(0x1,c['Inject'](c[_0x56aee4(0x1ba)])),_(0x2,c[_0x56aee4(0x1ef)](b[_0x56aee4(0x1c8)])),_(0x3,c[_0x56aee4(0x1ef)](c[_0x56aee4(0x1be)]))],g);var H=Object['getOwnPropertyDescriptor'],J=(_0xeffcd3,_0x25167e,_0xae48b2,_0x4c9d02)=>{const _0x320d31=_0x56aee4;for(var _0x3a340b=_0x4c9d02>0x1?void 0x0:_0x4c9d02?H(_0x25167e,_0xae48b2):_0x25167e,_0x36b039=_0xeffcd3[_0x320d31(0x22e)]-0x1,_0x1f6018;_0x36b039>=0x0;_0x36b039--)(_0x1f6018=_0xeffcd3[_0x36b039])&&(_0x3a340b=_0x1f6018(_0x3a340b)||_0x3a340b);return _0x3a340b;},y=(_0x865be7,_0x29def5)=>(_0x1fcf34,_0x10fd16)=>_0x29def5(_0x1fcf34,_0x10fd16,_0x865be7);let C=class extends c[_0x56aee4(0x21f)]{constructor(_0x39d185,_0x11c502){const _0x6c41fc=_0x56aee4;super(),this['_threadCommentDataSourceService']=_0x39d185,this[_0x6c41fc(0x1c2)]=_0x11c502,this[_0x6c41fc(0x1d4)]();}[_0x56aee4(0x1d4)](){const _0x295571=_0x56aee4;this[_0x295571(0x1c3)][_0x295571(0x1d7)]=this['_threadCommentDataSource'],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c[_0x56aee4(0x1ef)](g))],C);var F=Object[_0x56aee4(0x1f1)],L=Object[_0x56aee4(0x1f2)],Z=(_0x4d57a6,_0x598d8e,_0x1462b4)=>_0x598d8e in _0x4d57a6?F(_0x4d57a6,_0x598d8e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1462b4}):_0x4d57a6[_0x598d8e]=_0x1462b4,W=(_0x4e44eb,_0x39a039,_0x34951b,_0x209f28)=>{for(var _0x56d739=_0x209f28>0x1?void 0x0:_0x209f28?L(_0x39a039,_0x34951b):_0x39a039,_0x1d328f=_0x4e44eb['length']-0x1,_0x55dabd;_0x1d328f>=0x0;_0x1d328f--)(_0x55dabd=_0x4e44eb[_0x1d328f])&&(_0x56d739=_0x55dabd(_0x56d739)||_0x56d739);return _0x56d739;},O=(_0x3bf077,_0x4ba878)=>(_0x3cc75e,_0x37d774)=>_0x4ba878(_0x3cc75e,_0x37d774,_0x3bf077),N=(_0x25a111,_0x118c59,_0x14f2b3)=>Z(_0x25a111,typeof _0x118c59!=_0x56aee4(0x1fe)?_0x118c59+'':_0x118c59,_0x14f2b3);function _0x25ba(_0x883b76,_0x21a7f3){const _0x1040ce=_0x1040();return _0x25ba=function(_0x25babd,_0x4bacc0){_0x25babd=_0x25babd-0x1b9;let _0x2156a3=_0x1040ce[_0x25babd];return _0x2156a3;},_0x25ba(_0x883b76,_0x21a7f3);}exports[_0x56aee4(0x1c1)]=class extends c[_0x56aee4(0x205)]{constructor(_0x3809d0=D,_0x38952e,_0xbade6b){const _0x4ffb34=_0x56aee4;super(),this['_config']=_0x3809d0,this[_0x4ffb34(0x217)]=_0x38952e,this[_0x4ffb34(0x1da)]=_0xbade6b;const {..._0x1de0ae}=c[_0x4ffb34(0x21b)]({},D,this[_0x4ffb34(0x1bb)]);this[_0x4ffb34(0x1da)][_0x4ffb34(0x21c)](q,_0x1de0ae);}[_0x56aee4(0x1bf)](){const _0x375262=_0x56aee4;[[g],[C],[p]][_0x375262(0x1f7)](_0x565baf=>{const _0x13ccb7=_0x375262;this['_injector'][_0x13ccb7(0x1d3)](_0x565baf);});}[_0x56aee4(0x1f0)](){const _0x517c26=_0x56aee4;this[_0x517c26(0x217)][_0x517c26(0x21e)](C),this[_0x517c26(0x217)][_0x517c26(0x21e)](p);}},N(exports[_0x56aee4(0x1c1)],_0x56aee4(0x1ec),U),N(exports['UniverThreadCommentDataSourcePlugin'],_0x56aee4(0x232),c[_0x56aee4(0x1d5)]['UNIVER_UNKNOWN']),exports[_0x56aee4(0x1c1)]=W([c[_0x56aee4(0x1e2)](j[_0x56aee4(0x1ea)],b[_0x56aee4(0x20d)],T[_0x56aee4(0x22d)]),O(0x1,c[_0x56aee4(0x1ef)](c[_0x56aee4(0x1be)])),O(0x2,c[_0x56aee4(0x1db)])],exports['UniverThreadCommentDataSourcePlugin']);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2db34b=_0xa939;(function(_0x8f2a5,_0x11f41f){const _0x46c229=_0xa939,_0x26a478=_0x8f2a5();while(!![]){try{const _0x4846b8=-parseInt(_0x46c229(0x1db))/0x1*(parseInt(_0x46c229(0x1dd))/0x2)+-parseInt(_0x46c229(0x1a2))/0x3+-parseInt(_0x46c229(0x196))/0x4+-parseInt(_0x46c229(0x1cc))/0x5+-parseInt(_0x46c229(0x1c6))/0x6+parseInt(_0x46c229(0x1ee))/0x7+parseInt(_0x46c229(0x1cb))/0x8;if(_0x4846b8===_0x11f41f)break;else _0x26a478['push'](_0x26a478['shift']());}catch(_0x452914){_0x26a478['push'](_0x26a478['shift']());}}}(_0x1535,0x2f021));import{CommentService as _0x518e23,CollaborationSessionService as _0x25437f,UniverCollaborationClientPlugin as _0x498854}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5bfe90}from'@univerjs-pro/license';import{dayjs as _0x4cfdfe,UserManagerService as _0xd09db,Inject as _0x5c8dc2,Injector as _0x555bce,Disposable as _0x209d22,CustomRangeType as _0x4a9146,UniverInstanceType as _0x4bf91a,DependentOn as _0x5f5485,IConfigService as _0x91542d,Plugin as _0x47c1c6,merge as _0x20b3b4}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x356d5f}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x54939c,IThreadCommentDataSourceService as _0x3546ec}from'@univerjs/thread-comment';import{bufferTime as _0x3db8b5}from'rxjs';import{HTTPService as _0x9577a3}from'@univerjs/network';const W=_0x2db34b(0x1e8);var I=(_0x140958=>(_0x140958[_0x140958[_0x2db34b(0x1ad)]=0x0]=_0x2db34b(0x1ad),_0x140958[_0x140958['Solved']=0x1]='Solved',_0x140958[_0x140958[_0x2db34b(0x1e0)]=-0x1]=_0x2db34b(0x1e0),_0x140958))(I||{}),v=(_0x249edc=>(_0x249edc[_0x249edc[_0x2db34b(0x199)]=0x0]=_0x2db34b(0x199),_0x249edc[_0x249edc[_0x2db34b(0x1b8)]=0x1]='Add',_0x249edc[_0x249edc[_0x2db34b(0x1b4)]=0x2]=_0x2db34b(0x1b4),_0x249edc[_0x249edc[_0x2db34b(0x1e7)]=0x3]=_0x2db34b(0x1e7),_0x249edc[_0x249edc['Delete']=0x4]=_0x2db34b(0x1a7),_0x249edc[_0x249edc[_0x2db34b(0x1cf)]=0x5]='Solve',_0x249edc[_0x249edc['UNRECOGNIZED']=-0x1]=_0x2db34b(0x1e0),_0x249edc))(v||{});const D=_0x2745e3=>_0x4cfdfe(new Date(+_0x2745e3))[_0x2db34b(0x1aa)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x256ec9,_0xb841ce)=>{const _0x267fa5=_0x2db34b,_0x426e2f=_0x256ec9[_0x267fa5(0x1dc)](_0xd09db),_0x325a63=_0x256ec9['get'](_0x9577a3);_0xb841ce['forEach'](_0x5e6cd2=>{const _0x49571b=_0x267fa5;_0x426e2f[_0x49571b(0x1f6)](_0x5e6cd2)&&_0xb841ce[_0x49571b(0x1ef)](_0x5e6cd2);}),_0xb841ce[_0x267fa5(0x1df)]&&(await _0x325a63[_0x267fa5(0x1dc)](_0x267fa5(0x1d9),{'params':{'userIDs':[..._0xb841ce]}}))[_0x267fa5(0x1d2)][_0x267fa5(0x1a9)][_0x267fa5(0x1bb)](_0x463179=>{_0x463179&&_0x426e2f['addUser'](_0x463179);});};var K=Object[_0x2db34b(0x1f2)],V=(_0x1d2dd7,_0x93bb7e,_0x58492d,_0x47e7b3)=>{const _0x3bff70=_0x2db34b;for(var _0x49c219=_0x47e7b3>0x1?void 0x0:_0x47e7b3?K(_0x93bb7e,_0x58492d):_0x93bb7e,_0x2d1296=_0x1d2dd7[_0x3bff70(0x1f7)]-0x1,_0x1f9586;_0x2d1296>=0x0;_0x2d1296--)(_0x1f9586=_0x1d2dd7[_0x2d1296])&&(_0x49c219=_0x1f9586(_0x49c219)||_0x49c219);return _0x49c219;},p=(_0x3531c5,_0x38a4f8)=>(_0x5c6ea6,_0x124d6d)=>_0x38a4f8(_0x5c6ea6,_0x124d6d,_0x3531c5);function _0x1535(){const _0x534a3b=['listComments','7085632GlEhar','1499825TlKWbd','rangeId','_userService','Solve','_injector','defineProperty','body','find','values','createTimestamp','filter','onStarting','comments','/universer-api/user/list','replyId','140915RGdQlX','get','4XIOJHI','_initUserSync','size','UNRECOGNIZED','saveCommentToSnapshot','symbol','post','type','resolveComment','code','Edit','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','syncUpdateMutationToColla','_configService','ref','dataSource','addUser','1929025FlcjKI','delete','YYYY/MM/DD\x20HH:mm','parse','getOwnPropertyDescriptor','user','/edit','solved','getUser','length','updateComment','customRanges','thread-comment-data-source.config','/solved','_threadCommentDataSource','137028PJoWEq','pluginName','stringify','Unknown','COMMENT','disposeWithMe','unitId','replies','_init','Solved','root','/delete','601755PVCpup','personId','_commentService','_threadCommentDataSourceService','_config','Delete','onReady','users','format','addComment','_sessionService','OpenOrReOpen','commentUpdate$','_httpService','/universer-api/comment/unit/','content','getUnit','add','Reply','comment','parentId','userId','Add','threadId','_initDataSource','forEach','setConfig','slice','error','userID','getComment','getMemberID','deleteComment','map','reply','_threadCommentModel','912582qKzGGT','subscribe','getCurrentUser','requireSession'];_0x1535=function(){return _0x534a3b;};return _0x1535();}let S=class extends _0x209d22{constructor(_0x2ccf85,_0x23cdd5,_0x102600,_0xe3c5b3){const _0x16f0a2=_0x2db34b;super(),this[_0x16f0a2(0x1a4)]=_0x2ccf85,this['_threadCommentModel']=_0x23cdd5,this[_0x16f0a2(0x1ce)]=_0x102600,this[_0x16f0a2(0x1d0)]=_0xe3c5b3,this[_0x16f0a2(0x19e)](),this[_0x16f0a2(0x1de)]();}[_0x2db34b(0x1de)](){const _0x1490e2=_0x2db34b;this[_0x1490e2(0x19b)](this['_threadCommentModel'][_0x1490e2(0x1ae)]['pipe'](_0x3db8b5(0x10))[_0x1490e2(0x1c7)](_0x521090=>{const _0x3d2f8a=_0x1490e2,_0x3d5ae9=new Set();_0x521090[_0x3d2f8a(0x1bb)](_0x3b7597=>{const _0x18666a=_0x3d2f8a;switch(_0x3b7597[_0x18666a(0x1e4)]){case _0x18666a(0x1b3):{const _0x2bb14e=_0x3b7597['payload'][_0x18666a(0x1a3)];_0x3d5ae9[_0x18666a(0x1b3)](_0x2bb14e);break;}}}),B(this[_0x3d2f8a(0x1d0)],_0x3d5ae9);}));}['_init'](){const _0x415a45=_0x2db34b;this[_0x415a45(0x19b)](this[_0x415a45(0x1a4)][_0x415a45(0x1ae)][_0x415a45(0x1c7)](async _0x155b3f=>{const _0x16e2c5=_0x415a45;var _0x298ef1,_0x3ecb30,_0x11765a,_0x5bba12;const _0x5bb1d0=(_0x298ef1=this[_0x16e2c5(0x1c5)][_0x16e2c5(0x1b2)](_0x155b3f[_0x16e2c5(0x19c)])[_0x16e2c5(0x1d3)](_0x42b700=>_0x42b700['threadId']===_0x155b3f[_0x16e2c5(0x1b9)]))==null?void 0x0:_0x298ef1[_0x16e2c5(0x1a0)];if(!_0x5bb1d0)return;const {unitId:_0x1afcf1,subUnitId:_0x2c758b}=_0x5bb1d0;switch(_0x155b3f['user']&&this[_0x16e2c5(0x1ce)][_0x16e2c5(0x1ed)](_0x155b3f[_0x16e2c5(0x1f3)]),_0x155b3f['type']){case v[_0x16e2c5(0x1b8)]:break;case v['Reply']:{this['_threadCommentModel']['addComment'](_0x1afcf1,_0x2c758b,{'unitId':_0x1afcf1,'subUnitId':_0x2c758b,'ref':'','id':_0x155b3f[_0x16e2c5(0x1da)],'dT':D(+_0x155b3f[_0x16e2c5(0x1d5)]),'threadId':_0x155b3f['threadId'],'personId':(_0x11765a=(_0x3ecb30=_0x155b3f[_0x16e2c5(0x1f3)])==null?void 0x0:_0x3ecb30['userID'])!=null?_0x11765a:_0x155b3f[_0x16e2c5(0x1b7)],'text':JSON[_0x16e2c5(0x1f1)](_0x155b3f['content']),'parentId':_0x5bb1d0['id']});break;}case v[_0x16e2c5(0x1a7)]:{const _0x4381de=this['_threadCommentModel'][_0x16e2c5(0x1c0)](_0x1afcf1,_0x2c758b,_0x155b3f[_0x16e2c5(0x1da)]);_0x4381de&&_0x4381de[_0x16e2c5(0x1b6)]&&this[_0x16e2c5(0x1c5)][_0x16e2c5(0x1c2)](_0x1afcf1,_0x2c758b,_0x155b3f[_0x16e2c5(0x1da)]);break;}case v[_0x16e2c5(0x1e7)]:{this[_0x16e2c5(0x1c5)][_0x16e2c5(0x191)](_0x1afcf1,_0x2c758b,{'commentId':_0x155b3f[_0x16e2c5(0x1da)],'text':JSON[_0x16e2c5(0x1f1)](_0x155b3f[_0x16e2c5(0x1b1)])});break;}case v[_0x16e2c5(0x1cf)]:{const _0x194f9c=(_0x5bba12=this[_0x16e2c5(0x1c5)][_0x16e2c5(0x1b2)](_0x155b3f[_0x16e2c5(0x19c)])['find'](_0x73b62e=>_0x73b62e[_0x16e2c5(0x1b9)]===_0x155b3f['threadId']))==null?void 0x0:_0x5bba12[_0x16e2c5(0x1a0)];_0x194f9c&&this[_0x16e2c5(0x1c5)]['resolveComment'](_0x1afcf1,_0x2c758b,_0x194f9c['id'],_0x155b3f['solved']===I[_0x16e2c5(0x19f)]);break;}}}));}};S=V([p(0x0,_0x5c8dc2(_0x518e23)),p(0x1,_0x5c8dc2(_0x54939c)),p(0x2,_0x5c8dc2(_0xd09db)),p(0x3,_0x5c8dc2(_0x555bce))],S);const z=_0x2db34b(0x193),M={};var k=Object[_0x2db34b(0x1f2)],Q=(_0x12d8ba,_0x2e720f,_0x5ecb35,_0x12556a)=>{const _0x34d821=_0x2db34b;for(var _0x28d042=_0x12556a>0x1?void 0x0:_0x12556a?k(_0x2e720f,_0x5ecb35):_0x2e720f,_0xc5696e=_0x12d8ba[_0x34d821(0x1f7)]-0x1,_0x13e84f;_0xc5696e>=0x0;_0xc5696e--)(_0x13e84f=_0x12d8ba[_0xc5696e])&&(_0x28d042=_0x13e84f(_0x28d042)||_0x28d042);return _0x28d042;},_=(_0x396d9f,_0x584c3b)=>(_0x219826,_0x3ed782)=>_0x584c3b(_0x219826,_0x3ed782,_0x396d9f);function X(_0x1010f0,_0x50c67c){const _0x440225=_0x2db34b,_0x1e4ea7=_0x1010f0['replies'][0x0];return{..._0x50c67c,'id':_0x1e4ea7[_0x440225(0x1da)],'resolved':_0x1010f0[_0x440225(0x1f5)]===0x1,'dT':D(_0x1e4ea7[_0x440225(0x1d5)]),'personId':_0x1e4ea7[_0x440225(0x1b7)],'threadId':_0x1e4ea7[_0x440225(0x1b9)]};}function ee(_0x4b4504,_0xdc293e,_0x1c736a){const _0x368ce1=_0x2db34b;var _0x3b788c,_0x1aaf27;if(((_0x1aaf27=(_0x3b788c=_0x4b4504==null?void 0x0:_0x4b4504['replies'])==null?void 0x0:_0x3b788c[_0x368ce1(0x1f7)])!=null?_0x1aaf27:0x0)>0x0){const _0xc2fef0=(_0x190e50,_0x5b9b75)=>({'id':_0x190e50['replyId'],'threadId':_0x190e50[_0x368ce1(0x1b9)],'dT':D(_0x190e50[_0x368ce1(0x1d5)]),'personId':_0x190e50[_0x368ce1(0x1b7)],'resolved':_0x4b4504['solved']===I[_0x368ce1(0x19f)],'unitId':_0xdc293e,'subUnitId':_0x1c736a,'text':JSON[_0x368ce1(0x1f1)](_0x190e50[_0x368ce1(0x1b1)]),'parentId':_0x5b9b75}),_0x32a2da=_0xc2fef0(_0x4b4504[_0x368ce1(0x19d)][0x0]);return{..._0x32a2da,'children':_0x4b4504[_0x368ce1(0x19d)][_0x368ce1(0x1bd)](0x1)['map'](_0x530621=>_0xc2fef0(_0x530621,_0x32a2da['id']))};}return null;}let f=class{constructor(_0x308845,_0x16a615,_0x5c14b3,_0x31dc07){const _0x3ee019=_0x2db34b;this[_0x3ee019(0x1af)]=_0x308845,this[_0x3ee019(0x1ce)]=_0x16a615,this['_sessionService']=_0x5c14b3,this[_0x3ee019(0x1d0)]=_0x31dc07;}async[_0x2db34b(0x1ab)](_0x1f1b33){const _0x22c5d0=_0x2db34b;var _0x5c3ce7,_0x29e54e;const {parentId:_0x2f1bed,unitId:_0x2daf1d,text:_0x4d7839,threadId:_0x3e755d}=_0x1f1b33,_0x57d218=(_0x29e54e=(_0x5c3ce7=_0x4d7839[_0x22c5d0(0x192)])==null?void 0x0:_0x5c3ce7[_0x22c5d0(0x1d6)](_0x554aa9=>_0x554aa9['rangeType']===_0x4a9146['COMMENT'])[_0x22c5d0(0x1c3)](_0x78198f=>_0x78198f['rangeId']))!=null?_0x29e54e:[],_0x209db1=JSON['stringify'](_0x4d7839),_0x1ef5b9=(await this[_0x22c5d0(0x1ac)]['requireSession'](_0x2daf1d))['getMemberID']();if(_0x2f1bed){const _0x7aa876={'memberId':_0x1ef5b9,'unitId':_0x2daf1d,'content':_0x209db1,'mention':_0x57d218,'threadId':_0x3e755d},_0x3189a3=(await this[_0x22c5d0(0x1af)][_0x22c5d0(0x1e3)]('/universer-api/comment/unit/'+_0x2daf1d+'/reply',{'body':_0x7aa876}))[_0x22c5d0(0x1d2)][_0x22c5d0(0x1c4)];return{..._0x1f1b33,'id':_0x3189a3[_0x22c5d0(0x1da)],'dT':_0x4cfdfe(+_0x3189a3['createTimestamp'])[_0x22c5d0(0x1aa)](_0x22c5d0(0x1f0)),'personId':_0x3189a3[_0x22c5d0(0x1b7)]};}else{const _0xd6169d={'memberId':_0x1ef5b9,'unitId':_0x2daf1d,'content':_0x209db1,'mention':_0x57d218},_0x41f278=await this[_0x22c5d0(0x1af)][_0x22c5d0(0x1e3)](_0x22c5d0(0x1b0)+_0x2daf1d+'/add',{'body':_0xd6169d});return X(_0x41f278['body'][_0x22c5d0(0x1b5)],_0x1f1b33);}}async[_0x2db34b(0x191)](_0x4d165b){const _0x20c4bc=_0x2db34b;var _0x30480c,_0x45ad51;const {text:_0x46f97a,unitId:_0x5def01}=_0x4d165b,_0x55c4a8=(_0x45ad51=(_0x30480c=_0x46f97a[_0x20c4bc(0x192)])==null?void 0x0:_0x30480c[_0x20c4bc(0x1d6)](_0x1ebdcc=>_0x1ebdcc['rangeType']===_0x4a9146[_0x20c4bc(0x19a)])[_0x20c4bc(0x1c3)](_0x358abf=>_0x358abf[_0x20c4bc(0x1cd)]))!=null?_0x45ad51:[],_0x21698a=JSON[_0x20c4bc(0x198)](_0x46f97a),_0x5ef6cc=_0x4d165b[_0x20c4bc(0x1b9)],_0x2f9976=_0x4d165b['id'],_0x5c1d27={'memberId':(await this['_sessionService'][_0x20c4bc(0x1c9)](_0x5def01))['getMemberID'](),'unitId':_0x5def01,'threadId':_0x5ef6cc,'mention':_0x55c4a8,'content':_0x21698a,'replyId':_0x2f9976},_0xd0704b=await this[_0x20c4bc(0x1af)][_0x20c4bc(0x1e3)](_0x20c4bc(0x1b0)+_0x5def01+_0x20c4bc(0x1f4),{'body':_0x5c1d27});return!_0xd0704b[_0x20c4bc(0x1d2)]['error']||_0xd0704b[_0x20c4bc(0x1d2)][_0x20c4bc(0x1be)][_0x20c4bc(0x1e6)]===0x1;}async[_0x2db34b(0x1e5)](_0x1f4049){const _0x1dcf6e=_0x2db34b,{unitId:_0x273f64}=_0x1f4049,_0x4c1bf6=_0x1f4049[_0x1dcf6e(0x1b9)],_0x5773c6={'memberId':this['_userService'][_0x1dcf6e(0x1c8)]()[_0x1dcf6e(0x1bf)],'unitId':_0x273f64,'threadId':_0x4c1bf6,'solved':_0x1f4049['resolved']?I['Solved']:I[_0x1dcf6e(0x1ad)]},_0x1207a9=await this['_httpService'][_0x1dcf6e(0x1e3)](_0x1dcf6e(0x1b0)+_0x273f64+_0x1dcf6e(0x194),{'body':_0x5773c6});return!_0x1207a9[_0x1dcf6e(0x1d2)][_0x1dcf6e(0x1be)]||_0x1207a9[_0x1dcf6e(0x1d2)]['error'][_0x1dcf6e(0x1e6)]===0x1;}async[_0x2db34b(0x1c2)](_0x5dfcee,_0x1ecc59,_0x4f05f7,_0x20f444){const _0x50dded=_0x2db34b,_0x2639ef={'memberId':(await this[_0x50dded(0x1ac)][_0x50dded(0x1c9)](_0x5dfcee))[_0x50dded(0x1c1)](),'threadId':_0x4f05f7,'replyId':_0x20f444,'unitId':_0x5dfcee},_0x5bae07=await this[_0x50dded(0x1af)][_0x50dded(0x1e3)]('/universer-api/comment/unit/'+_0x5dfcee+_0x50dded(0x1a1),{'body':_0x2639ef});return!_0x5bae07[_0x50dded(0x1d2)][_0x50dded(0x1be)]||_0x5bae07['body'][_0x50dded(0x1be)]['code']===0x1;}async[_0x2db34b(0x1ca)](_0x4edcde,_0x403e6f,_0x33ca43){const _0x25d186=_0x2db34b,_0x3caafa={'unitId':_0x4edcde,'threadId':_0x33ca43},_0x444905=await this[_0x25d186(0x1af)]['post'](_0x25d186(0x1b0)+_0x4edcde+'/list',{'body':_0x3caafa}),_0x288e6b=_0x33ca43[_0x25d186(0x1c3)](_0x1a1bd4=>ee(_0x444905[_0x25d186(0x1d2)][_0x25d186(0x1d8)][_0x1a1bd4],_0x4edcde,_0x403e6f))[_0x25d186(0x1d6)](Boolean);return Object[_0x25d186(0x1d4)](_0x444905[_0x25d186(0x1d2)][_0x25d186(0x1a9)])[_0x25d186(0x1bb)](_0x5bb984=>{const _0x1ae605=_0x25d186;this[_0x1ae605(0x1ce)][_0x1ae605(0x1ed)](_0x5bb984);}),_0x288e6b;}[_0x2db34b(0x1e1)](_0x4b094f){const _0x1622eb=_0x2db34b;return{'id':_0x4b094f['id'],'threadId':_0x4b094f[_0x1622eb(0x1b9)],'ref':_0x4b094f[_0x1622eb(0x1eb)]};}};f=Q([_(0x0,_0x5c8dc2(_0x9577a3)),_(0x1,_0x5c8dc2(_0xd09db)),_(0x2,_0x5c8dc2(_0x25437f)),_(0x3,_0x5c8dc2(_0x555bce))],f);function _0xa939(_0x20a41b,_0x1881e9){const _0x153525=_0x1535();return _0xa939=function(_0xa93947,_0x20a87f){_0xa93947=_0xa93947-0x191;let _0x366989=_0x153525[_0xa93947];return _0x366989;},_0xa939(_0x20a41b,_0x1881e9);}var re=Object[_0x2db34b(0x1f2)],te=(_0xb45255,_0x11fa76,_0x56d3b3,_0x32fb3b)=>{for(var _0x5e3a2d=_0x32fb3b>0x1?void 0x0:_0x32fb3b?re(_0x11fa76,_0x56d3b3):_0x11fa76,_0x5ce67f=_0xb45255['length']-0x1,_0x3aa32c;_0x5ce67f>=0x0;_0x5ce67f--)(_0x3aa32c=_0xb45255[_0x5ce67f])&&(_0x5e3a2d=_0x3aa32c(_0x5e3a2d)||_0x5e3a2d);return _0x5e3a2d;},N=(_0x189a2c,_0x3d3767)=>(_0x517933,_0x5e34a6)=>_0x3d3767(_0x517933,_0x5e34a6,_0x189a2c);let g=class extends _0x209d22{constructor(_0x443e30,_0x540623){const _0x8ebfd=_0x2db34b;super(),this[_0x8ebfd(0x1a5)]=_0x443e30,this[_0x8ebfd(0x195)]=_0x540623,this[_0x8ebfd(0x1ba)]();}['_initDataSource'](){const _0x5e646a=_0x2db34b;this['_threadCommentDataSourceService'][_0x5e646a(0x1ec)]=this[_0x5e646a(0x195)],this[_0x5e646a(0x1a5)][_0x5e646a(0x1e9)]=!0x1;}};g=te([N(0x0,_0x3546ec),N(0x1,_0x5c8dc2(f))],g);var se=Object[_0x2db34b(0x1d1)],oe=Object[_0x2db34b(0x1f2)],ne=(_0x48b37f,_0x4d73af,_0x1fd5fd)=>_0x4d73af in _0x48b37f?se(_0x48b37f,_0x4d73af,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1fd5fd}):_0x48b37f[_0x4d73af]=_0x1fd5fd,ie=(_0x5ec4c9,_0x1ba78c,_0x4276dc,_0x520656)=>{const _0x4a0035=_0x2db34b;for(var _0x334e4d=_0x520656>0x1?void 0x0:_0x520656?oe(_0x1ba78c,_0x4276dc):_0x1ba78c,_0xf6ed8d=_0x5ec4c9[_0x4a0035(0x1f7)]-0x1,_0x526744;_0xf6ed8d>=0x0;_0xf6ed8d--)(_0x526744=_0x5ec4c9[_0xf6ed8d])&&(_0x334e4d=_0x526744(_0x334e4d)||_0x334e4d);return _0x334e4d;},w=(_0x573c95,_0x23b4c4)=>(_0x1ebfa8,_0x5e70ad)=>_0x23b4c4(_0x1ebfa8,_0x5e70ad,_0x573c95),$=(_0x5eddcf,_0x7e9cb3,_0x30b943)=>ne(_0x5eddcf,typeof _0x7e9cb3!=_0x2db34b(0x1e2)?_0x7e9cb3+'':_0x7e9cb3,_0x30b943);let b=class extends _0x47c1c6{constructor(_0x582bcf=M,_0x2b67b0,_0x3be51f){const _0x29ee52=_0x2db34b;super(),this['_config']=_0x582bcf,this[_0x29ee52(0x1d0)]=_0x2b67b0,this[_0x29ee52(0x1ea)]=_0x3be51f;const {..._0x249bb6}=_0x20b3b4({},M,this[_0x29ee52(0x1a6)]);this[_0x29ee52(0x1ea)][_0x29ee52(0x1bc)](z,_0x249bb6);}[_0x2db34b(0x1d7)](){const _0x3730a9=_0x2db34b;[[f],[g],[S]][_0x3730a9(0x1bb)](_0x49e43e=>{const _0x4e7c78=_0x3730a9;this['_injector'][_0x4e7c78(0x1b3)](_0x49e43e);});}[_0x2db34b(0x1a8)](){const _0x53d72d=_0x2db34b;this[_0x53d72d(0x1d0)][_0x53d72d(0x1dc)](g),this[_0x53d72d(0x1d0)][_0x53d72d(0x1dc)](S);}};$(b,_0x2db34b(0x197),W),$(b,'type',_0x4bf91a['UNIVER_UNKNOWN']),b=ie([_0x5f5485(_0x356d5f,_0x498854,_0x5bfe90),w(0x1,_0x5c8dc2(_0x555bce)),w(0x2,_0x91542d)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x1261b5=_0x5f22;(function(_0x167c3f,_0x591584){const _0x8ef28c=_0x5f22,_0x2654e9=_0x167c3f();while(!![]){try{const _0x9005c6=-parseInt(_0x8ef28c(0x17a))/0x1*(-parseInt(_0x8ef28c(0x127))/0x2)+-parseInt(_0x8ef28c(0x130))/0x3*(-parseInt(_0x8ef28c(0x13b))/0x4)+parseInt(_0x8ef28c(0x175))/0x5*(-parseInt(_0x8ef28c(0x164))/0x6)+parseInt(_0x8ef28c(0x15f))/0x7*(parseInt(_0x8ef28c(0x14b))/0x8)+-parseInt(_0x8ef28c(0x14d))/0x9+parseInt(_0x8ef28c(0x14f))/0xa*(-parseInt(_0x8ef28c(0x182))/0xb)+parseInt(_0x8ef28c(0x163))/0xc*(parseInt(_0x8ef28c(0x188))/0xd);if(_0x9005c6===_0x591584)break;else _0x2654e9['push'](_0x2654e9['shift']());}catch(_0x2ff2be){_0x2654e9['push'](_0x2654e9['shift']());}}}(_0x46ff,0x4b59f));import{CommentService as _0x571809,CollaborationSessionService as _0x3689ac,UniverCollaborationClientPlugin as _0x39d5ed}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x35da23}from'@univerjs-pro/license';import{dayjs as _0x471d81,UserManagerService as _0x2d60df,Inject as _0x56a30c,Injector as _0x558a08,Disposable as _0x25b91f,CustomRangeType as _0x3be17b,UniverInstanceType as _0x2e4646,DependentOn as _0x47c8df,IConfigService as _0x357739,Plugin as _0x15a356,merge as _0x3bd5c7}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x3b6b13}from'@univerjs/thread-comment-ui';function _0x5f22(_0x13c2ef,_0x11ee64){const _0x46fff5=_0x46ff();return _0x5f22=function(_0x5f2214,_0x52d2a5){_0x5f2214=_0x5f2214-0x126;let _0x374bac=_0x46fff5[_0x5f2214];return _0x374bac;},_0x5f22(_0x13c2ef,_0x11ee64);}import{ThreadCommentModel as _0x19fbf1,IThreadCommentDataSourceService as _0x2ebbc5}from'@univerjs/thread-comment';import{bufferTime as _0x36e044}from'rxjs';import{HTTPService as _0x3fd671}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x4f86ad=>(_0x4f86ad[_0x4f86ad['OpenOrReOpen']=0x0]='OpenOrReOpen',_0x4f86ad[_0x4f86ad[_0x1261b5(0x129)]=0x1]='Solved',_0x4f86ad[_0x4f86ad['UNRECOGNIZED']=-0x1]=_0x1261b5(0x158),_0x4f86ad))(I||{}),v=(_0x1056ae=>(_0x1056ae[_0x1056ae[_0x1261b5(0x189)]=0x0]='Unknown',_0x1056ae[_0x1056ae[_0x1261b5(0x16b)]=0x1]=_0x1261b5(0x16b),_0x1056ae[_0x1056ae[_0x1261b5(0x13c)]=0x2]=_0x1261b5(0x13c),_0x1056ae[_0x1056ae[_0x1261b5(0x184)]=0x3]=_0x1261b5(0x184),_0x1056ae[_0x1056ae['Delete']=0x4]=_0x1261b5(0x171),_0x1056ae[_0x1056ae['Solve']=0x5]='Solve',_0x1056ae[_0x1056ae['UNRECOGNIZED']=-0x1]=_0x1261b5(0x158),_0x1056ae))(v||{});const D=_0x3546e3=>_0x471d81(new Date(+_0x3546e3))[_0x1261b5(0x16f)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x1ba598,_0x195d49)=>{const _0x1fd558=_0x1261b5,_0x186ab8=_0x1ba598['get'](_0x2d60df),_0x417187=_0x1ba598[_0x1fd558(0x159)](_0x3fd671);_0x195d49[_0x1fd558(0x140)](_0x26cbd3=>{const _0x44cfc0=_0x1fd558;_0x186ab8[_0x44cfc0(0x128)](_0x26cbd3)&&_0x195d49[_0x44cfc0(0x14a)](_0x26cbd3);}),_0x195d49['size']&&(await _0x417187[_0x1fd558(0x159)](_0x1fd558(0x149),{'params':{'userIDs':[..._0x195d49]}}))['body'][_0x1fd558(0x148)]['forEach'](_0x37e9fb=>{const _0x139eb4=_0x1fd558;_0x37e9fb&&_0x186ab8[_0x139eb4(0x12d)](_0x37e9fb);});};var K=Object[_0x1261b5(0x160)],V=(_0x20868a,_0x2e0b48,_0x20bfbb,_0x5afdef)=>{const _0x22b7b7=_0x1261b5;for(var _0x265898=_0x5afdef>0x1?void 0x0:_0x5afdef?K(_0x2e0b48,_0x20bfbb):_0x2e0b48,_0x46949c=_0x20868a[_0x22b7b7(0x139)]-0x1,_0x1fd063;_0x46949c>=0x0;_0x46949c--)(_0x1fd063=_0x20868a[_0x46949c])&&(_0x265898=_0x1fd063(_0x265898)||_0x265898);return _0x265898;},p=(_0xe695fd,_0x177108)=>(_0x4b45ef,_0x210944)=>_0x177108(_0x4b45ef,_0x210944,_0xe695fd);let S=class extends _0x25b91f{constructor(_0x3ad14e,_0x222c57,_0x4a0789,_0x26916c){const _0x577802=_0x1261b5;super(),this[_0x577802(0x177)]=_0x3ad14e,this['_threadCommentModel']=_0x222c57,this[_0x577802(0x13e)]=_0x4a0789,this[_0x577802(0x174)]=_0x26916c,this['_init'](),this[_0x577802(0x146)]();}[_0x1261b5(0x146)](){const _0x207070=_0x1261b5;this['disposeWithMe'](this[_0x207070(0x150)][_0x207070(0x166)][_0x207070(0x152)](_0x36e044(0x10))['subscribe'](_0x15806a=>{const _0x32aa0d=_0x207070,_0x5a4ca6=new Set();_0x15806a['forEach'](_0x2a52e4=>{const _0x1a24de=_0x5f22;switch(_0x2a52e4['type']){case'add':{const _0x4e517c=_0x2a52e4['payload'][_0x1a24de(0x12c)];_0x5a4ca6[_0x1a24de(0x180)](_0x4e517c);break;}}}),B(this[_0x32aa0d(0x174)],_0x5a4ca6);}));}['_init'](){const _0x24ab85=_0x1261b5;this[_0x24ab85(0x176)](this[_0x24ab85(0x177)][_0x24ab85(0x166)][_0x24ab85(0x16a)](async _0x19462d=>{const _0x5163be=_0x24ab85;var _0x25fe15,_0x27a91c,_0xbafc76,_0x395185;const _0x423892=(_0x25fe15=this[_0x5163be(0x150)][_0x5163be(0x165)](_0x19462d[_0x5163be(0x12b)])[_0x5163be(0x12f)](_0x5bec4d=>_0x5bec4d[_0x5163be(0x162)]===_0x19462d[_0x5163be(0x162)]))==null?void 0x0:_0x25fe15['root'];if(!_0x423892)return;const {unitId:_0x2eca5a,subUnitId:_0x1bd4bd}=_0x423892;switch(_0x19462d['user']&&this[_0x5163be(0x13e)]['addUser'](_0x19462d['user']),_0x19462d[_0x5163be(0x183)]){case v[_0x5163be(0x16b)]:break;case v[_0x5163be(0x13c)]:{this['_threadCommentModel'][_0x5163be(0x157)](_0x2eca5a,_0x1bd4bd,{'unitId':_0x2eca5a,'subUnitId':_0x1bd4bd,'ref':'','id':_0x19462d[_0x5163be(0x17b)],'dT':D(+_0x19462d[_0x5163be(0x134)]),'threadId':_0x19462d[_0x5163be(0x162)],'personId':(_0xbafc76=(_0x27a91c=_0x19462d[_0x5163be(0x156)])==null?void 0x0:_0x27a91c[_0x5163be(0x132)])!=null?_0xbafc76:_0x19462d['userId'],'text':JSON['parse'](_0x19462d[_0x5163be(0x173)]),'parentId':_0x423892['id']});break;}case v[_0x5163be(0x171)]:{const _0x2fbb88=this[_0x5163be(0x150)]['getComment'](_0x2eca5a,_0x1bd4bd,_0x19462d[_0x5163be(0x17b)]);_0x2fbb88&&_0x2fbb88[_0x5163be(0x161)]&&this[_0x5163be(0x150)][_0x5163be(0x16c)](_0x2eca5a,_0x1bd4bd,_0x19462d[_0x5163be(0x17b)]);break;}case v[_0x5163be(0x184)]:{this[_0x5163be(0x150)][_0x5163be(0x136)](_0x2eca5a,_0x1bd4bd,{'commentId':_0x19462d[_0x5163be(0x17b)],'text':JSON['parse'](_0x19462d[_0x5163be(0x173)])});break;}case v[_0x5163be(0x15a)]:{const _0x124f9e=(_0x395185=this[_0x5163be(0x150)]['getUnit'](_0x19462d[_0x5163be(0x12b)])[_0x5163be(0x12f)](_0x15dd35=>_0x15dd35['threadId']===_0x19462d[_0x5163be(0x162)]))==null?void 0x0:_0x395185['root'];_0x124f9e&&this[_0x5163be(0x150)][_0x5163be(0x14c)](_0x2eca5a,_0x1bd4bd,_0x124f9e['id'],_0x19462d[_0x5163be(0x131)]===I['Solved']);break;}}}));}};S=V([p(0x0,_0x56a30c(_0x571809)),p(0x1,_0x56a30c(_0x19fbf1)),p(0x2,_0x56a30c(_0x2d60df)),p(0x3,_0x56a30c(_0x558a08))],S);const z=_0x1261b5(0x13f),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x2e8e38,_0x1e0f60,_0x8b0716,_0x3469b8)=>{const _0x3cc89e=_0x1261b5;for(var _0x27def8=_0x3469b8>0x1?void 0x0:_0x3469b8?k(_0x1e0f60,_0x8b0716):_0x1e0f60,_0x3487e3=_0x2e8e38[_0x3cc89e(0x139)]-0x1,_0x517104;_0x3487e3>=0x0;_0x3487e3--)(_0x517104=_0x2e8e38[_0x3487e3])&&(_0x27def8=_0x517104(_0x27def8)||_0x27def8);return _0x27def8;},_=(_0x1b3624,_0x1b598d)=>(_0x4d9e9f,_0xdf228b)=>_0x1b598d(_0x4d9e9f,_0xdf228b,_0x1b3624);function X(_0x1df497,_0x202e15){const _0x3a260f=_0x1261b5,_0x29f4b1=_0x1df497[_0x3a260f(0x144)][0x0];return{..._0x202e15,'id':_0x29f4b1[_0x3a260f(0x17b)],'resolved':_0x1df497[_0x3a260f(0x131)]===0x1,'dT':D(_0x29f4b1['createTimestamp']),'personId':_0x29f4b1[_0x3a260f(0x14e)],'threadId':_0x29f4b1[_0x3a260f(0x162)]};}function ee(_0x2d3700,_0x129dd6,_0x1da156){const _0x1f7b37=_0x1261b5;var _0x55b081,_0x59d107;if(((_0x59d107=(_0x55b081=_0x2d3700==null?void 0x0:_0x2d3700[_0x1f7b37(0x144)])==null?void 0x0:_0x55b081[_0x1f7b37(0x139)])!=null?_0x59d107:0x0)>0x0){const _0x292292=(_0x265c68,_0x5fa71c)=>({'id':_0x265c68[_0x1f7b37(0x17b)],'threadId':_0x265c68[_0x1f7b37(0x162)],'dT':D(_0x265c68[_0x1f7b37(0x134)]),'personId':_0x265c68[_0x1f7b37(0x14e)],'resolved':_0x2d3700[_0x1f7b37(0x131)]===I[_0x1f7b37(0x129)],'unitId':_0x129dd6,'subUnitId':_0x1da156,'text':JSON[_0x1f7b37(0x168)](_0x265c68['content']),'parentId':_0x5fa71c}),_0x644a55=_0x292292(_0x2d3700[_0x1f7b37(0x144)][0x0]);return{..._0x644a55,'children':_0x2d3700['replies']['slice'](0x1)[_0x1f7b37(0x15c)](_0x5089da=>_0x292292(_0x5089da,_0x644a55['id']))};}return null;}let f=class{constructor(_0x298a15,_0x5e6b59,_0x4655b5,_0xc9079d){const _0x395940=_0x1261b5;this[_0x395940(0x143)]=_0x298a15,this['_userService']=_0x5e6b59,this[_0x395940(0x15e)]=_0x4655b5,this['_injector']=_0xc9079d;}async['addComment'](_0x25b2a1){const _0x17a2f9=_0x1261b5;var _0x53775a,_0x1effd3;const {parentId:_0x2e62da,unitId:_0x3133a5,text:_0xdbd54a,threadId:_0x24fd02}=_0x25b2a1,_0x30d83b=(_0x1effd3=(_0x53775a=_0xdbd54a[_0x17a2f9(0x17c)])==null?void 0x0:_0x53775a['filter'](_0x229299=>_0x229299[_0x17a2f9(0x167)]===_0x3be17b[_0x17a2f9(0x17d)])[_0x17a2f9(0x15c)](_0x5161da=>_0x5161da['rangeId']))!=null?_0x1effd3:[],_0x2d772e=JSON[_0x17a2f9(0x12e)](_0xdbd54a),_0x19e604=(await this[_0x17a2f9(0x15e)][_0x17a2f9(0x147)](_0x3133a5))['getMemberID']();if(_0x2e62da){const _0x329a65={'memberId':_0x19e604,'unitId':_0x3133a5,'content':_0x2d772e,'mention':_0x30d83b,'threadId':_0x24fd02},_0x55bbf1=(await this[_0x17a2f9(0x143)]['post'](_0x17a2f9(0x185)+_0x3133a5+_0x17a2f9(0x151),{'body':_0x329a65}))['body']['reply'];return{..._0x25b2a1,'id':_0x55bbf1['replyId'],'dT':_0x471d81(+_0x55bbf1['createTimestamp'])['format'](_0x17a2f9(0x15d)),'personId':_0x55bbf1[_0x17a2f9(0x14e)]};}else{const _0x452ae7={'memberId':_0x19e604,'unitId':_0x3133a5,'content':_0x2d772e,'mention':_0x30d83b},_0xc9c96b=await this[_0x17a2f9(0x143)]['post']('/universer-api/comment/unit/'+_0x3133a5+_0x17a2f9(0x16e),{'body':_0x452ae7});return X(_0xc9c96b[_0x17a2f9(0x17e)][_0x17a2f9(0x170)],_0x25b2a1);}}async['updateComment'](_0x3edf8a){const _0x461abe=_0x1261b5;var _0x57a6ab,_0x108483;const {text:_0x132c4f,unitId:_0x1c1e00}=_0x3edf8a,_0x40d62a=(_0x108483=(_0x57a6ab=_0x132c4f[_0x461abe(0x17c)])==null?void 0x0:_0x57a6ab['filter'](_0x13cba7=>_0x13cba7[_0x461abe(0x167)]===_0x3be17b[_0x461abe(0x17d)])['map'](_0x2ea36c=>_0x2ea36c[_0x461abe(0x16d)]))!=null?_0x108483:[],_0x3bf4b7=JSON['stringify'](_0x132c4f),_0x127a3e=_0x3edf8a[_0x461abe(0x162)],_0x4da41f=_0x3edf8a['id'],_0x48dcea={'memberId':(await this[_0x461abe(0x15e)][_0x461abe(0x147)](_0x1c1e00))[_0x461abe(0x155)](),'unitId':_0x1c1e00,'threadId':_0x127a3e,'mention':_0x40d62a,'content':_0x3bf4b7,'replyId':_0x4da41f},_0x5d6515=await this[_0x461abe(0x143)][_0x461abe(0x145)](_0x461abe(0x185)+_0x1c1e00+_0x461abe(0x135),{'body':_0x48dcea});return!_0x5d6515[_0x461abe(0x17e)][_0x461abe(0x15b)]||_0x5d6515['body']['error'][_0x461abe(0x186)]===0x1;}async[_0x1261b5(0x14c)](_0x3745b6){const _0x421680=_0x1261b5,{unitId:_0x389dfa}=_0x3745b6,_0x2f93a9=_0x3745b6[_0x421680(0x162)],_0x3fdd25={'memberId':this[_0x421680(0x13e)][_0x421680(0x172)]()[_0x421680(0x132)],'unitId':_0x389dfa,'threadId':_0x2f93a9,'solved':_0x3745b6[_0x421680(0x17f)]?I[_0x421680(0x129)]:I[_0x421680(0x12a)]},_0x2c8710=await this['_httpService'][_0x421680(0x145)]('/universer-api/comment/unit/'+_0x389dfa+_0x421680(0x18a),{'body':_0x3fdd25});return!_0x2c8710['body'][_0x421680(0x15b)]||_0x2c8710[_0x421680(0x17e)][_0x421680(0x15b)]['code']===0x1;}async['deleteComment'](_0x1d29e0,_0x2eac5e,_0x2e9bc1,_0x3831a2){const _0x2bb864=_0x1261b5,_0x2108ba={'memberId':(await this[_0x2bb864(0x15e)][_0x2bb864(0x147)](_0x1d29e0))[_0x2bb864(0x155)](),'threadId':_0x2e9bc1,'replyId':_0x3831a2,'unitId':_0x1d29e0},_0x147b79=await this[_0x2bb864(0x143)][_0x2bb864(0x145)]('/universer-api/comment/unit/'+_0x1d29e0+_0x2bb864(0x126),{'body':_0x2108ba});return!_0x147b79[_0x2bb864(0x17e)]['error']||_0x147b79['body'][_0x2bb864(0x15b)]['code']===0x1;}async['listComments'](_0x265641,_0xcd55ae,_0x2beca5){const _0x47f287=_0x1261b5,_0x3a275b={'unitId':_0x265641,'threadId':_0x2beca5},_0xf51a7b=await this[_0x47f287(0x143)]['post']('/universer-api/comment/unit/'+_0x265641+_0x47f287(0x141),{'body':_0x3a275b}),_0x13a28c=_0x2beca5['map'](_0x44b247=>ee(_0xf51a7b[_0x47f287(0x17e)]['comments'][_0x44b247],_0x265641,_0xcd55ae))[_0x47f287(0x154)](Boolean);return Object['values'](_0xf51a7b['body'][_0x47f287(0x148)])[_0x47f287(0x140)](_0x2b8b74=>{const _0x41419c=_0x47f287;this[_0x41419c(0x13e)]['addUser'](_0x2b8b74);}),_0x13a28c;}['saveCommentToSnapshot'](_0x59232c){return{'id':_0x59232c['id'],'threadId':_0x59232c['threadId'],'ref':_0x59232c['ref']};}};f=Q([_(0x0,_0x56a30c(_0x3fd671)),_(0x1,_0x56a30c(_0x2d60df)),_(0x2,_0x56a30c(_0x3689ac)),_(0x3,_0x56a30c(_0x558a08))],f);var re=Object[_0x1261b5(0x160)],te=(_0x13b039,_0x438c49,_0x17b112,_0x5f460a)=>{const _0x52e1f6=_0x1261b5;for(var _0x403cd3=_0x5f460a>0x1?void 0x0:_0x5f460a?re(_0x438c49,_0x17b112):_0x438c49,_0x5b432c=_0x13b039[_0x52e1f6(0x139)]-0x1,_0x28b6d0;_0x5b432c>=0x0;_0x5b432c--)(_0x28b6d0=_0x13b039[_0x5b432c])&&(_0x403cd3=_0x28b6d0(_0x403cd3)||_0x403cd3);return _0x403cd3;},N=(_0x25d297,_0x4db2a1)=>(_0x21ba5c,_0x313359)=>_0x4db2a1(_0x21ba5c,_0x313359,_0x25d297);function _0x46ff(){const _0x452aec=['_config','subscribe','Add','deleteComment','rangeId','/add','format','comment','Delete','getCurrentUser','content','_injector','697765RhovLF','disposeWithMe','_commentService','_threadCommentDataSourceService','symbol','21423QGlVIz','replyId','customRanges','COMMENT','body','resolved','add','_initDataSource','11OWsjxj','type','Edit','/universer-api/comment/unit/','code','onReady','929435kmEyEo','Unknown','/solved','UNIVER_UNKNOWN','/delete','18ieotrD','getUser','Solved','OpenOrReOpen','unitId','personId','addUser','stringify','find','24WGiDNn','solved','userID','pluginName','createTimestamp','/edit','updateComment','defineProperty','syncUpdateMutationToColla','length','setConfig','231644wukPKj','Reply','_threadCommentDataSource','_userService','thread-comment-data-source.config','forEach','/list','dataSource','_httpService','replies','post','_initUserSync','requireSession','users','/universer-api/user/list','delete','2879944SWScLe','resolveComment','4397850dsYjOK','userId','3006050ivUZNC','_threadCommentModel','/reply','pipe','_configService','filter','getMemberID','user','addComment','UNRECOGNIZED','get','Solve','error','map','YYYY/MM/DD\x20HH:mm','_sessionService','7Xdqrjp','getOwnPropertyDescriptor','parentId','threadId','84tkOCpD','18ljrqkg','getUnit','commentUpdate$','rangeType','parse'];_0x46ff=function(){return _0x452aec;};return _0x46ff();}let g=class extends _0x25b91f{constructor(_0xbdefe,_0x2d6b81){const _0x374115=_0x1261b5;super(),this[_0x374115(0x178)]=_0xbdefe,this['_threadCommentDataSource']=_0x2d6b81,this[_0x374115(0x181)]();}[_0x1261b5(0x181)](){const _0x250363=_0x1261b5;this[_0x250363(0x178)][_0x250363(0x142)]=this[_0x250363(0x13d)],this[_0x250363(0x178)][_0x250363(0x138)]=!0x1;}};g=te([N(0x0,_0x2ebbc5),N(0x1,_0x56a30c(f))],g);var se=Object[_0x1261b5(0x137)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x27f9cd,_0x2e7786,_0x30257b)=>_0x2e7786 in _0x27f9cd?se(_0x27f9cd,_0x2e7786,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x30257b}):_0x27f9cd[_0x2e7786]=_0x30257b,ie=(_0x5c0794,_0x462243,_0x255d7a,_0x590f6d)=>{const _0x2076f1=_0x1261b5;for(var _0x54bbbd=_0x590f6d>0x1?void 0x0:_0x590f6d?oe(_0x462243,_0x255d7a):_0x462243,_0x58a87b=_0x5c0794[_0x2076f1(0x139)]-0x1,_0x5df3fc;_0x58a87b>=0x0;_0x58a87b--)(_0x5df3fc=_0x5c0794[_0x58a87b])&&(_0x54bbbd=_0x5df3fc(_0x54bbbd)||_0x54bbbd);return _0x54bbbd;},w=(_0x266338,_0x4fa66e)=>(_0xd7ea2f,_0xb20144)=>_0x4fa66e(_0xd7ea2f,_0xb20144,_0x266338),$=(_0x4ddfd2,_0x25b9f0,_0x27470e)=>ne(_0x4ddfd2,typeof _0x25b9f0!=_0x1261b5(0x179)?_0x25b9f0+'':_0x25b9f0,_0x27470e);let b=class extends _0x15a356{constructor(_0x20cf4b=M,_0x3df2f8,_0x213fa9){const _0x3b7c37=_0x1261b5;super(),this[_0x3b7c37(0x169)]=_0x20cf4b,this[_0x3b7c37(0x174)]=_0x3df2f8,this[_0x3b7c37(0x153)]=_0x213fa9;const {..._0x13c68e}=_0x3bd5c7({},M,this[_0x3b7c37(0x169)]);this[_0x3b7c37(0x153)][_0x3b7c37(0x13a)](z,_0x13c68e);}['onStarting'](){const _0x571ee8=_0x1261b5;[[f],[g],[S]][_0x571ee8(0x140)](_0x536623=>{const _0x16647c=_0x571ee8;this[_0x16647c(0x174)][_0x16647c(0x180)](_0x536623);});}[_0x1261b5(0x187)](){const _0x4f4ceb=_0x1261b5;this[_0x4f4ceb(0x174)][_0x4f4ceb(0x159)](g),this[_0x4f4ceb(0x174)]['get'](S);}};$(b,_0x1261b5(0x133),W),$(b,_0x1261b5(0x183),_0x2e4646[_0x1261b5(0x18b)]),b=ie([_0x47c8df(_0x3b6b13,_0x39d5ed,_0x35da23),w(0x1,_0x56a30c(_0x558a08)),w(0x2,_0x357739)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2db34b=_0xa939;(function(_0x8f2a5,_0x11f41f){const _0x46c229=_0xa939,_0x26a478=_0x8f2a5();while(!![]){try{const _0x4846b8=-parseInt(_0x46c229(0x1db))/0x1*(parseInt(_0x46c229(0x1dd))/0x2)+-parseInt(_0x46c229(0x1a2))/0x3+-parseInt(_0x46c229(0x196))/0x4+-parseInt(_0x46c229(0x1cc))/0x5+-parseInt(_0x46c229(0x1c6))/0x6+parseInt(_0x46c229(0x1ee))/0x7+parseInt(_0x46c229(0x1cb))/0x8;if(_0x4846b8===_0x11f41f)break;else _0x26a478['push'](_0x26a478['shift']());}catch(_0x452914){_0x26a478['push'](_0x26a478['shift']());}}}(_0x1535,0x2f021));import{CommentService as _0x518e23,CollaborationSessionService as _0x25437f,UniverCollaborationClientPlugin as _0x498854}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5bfe90}from'@univerjs-pro/license';import{dayjs as _0x4cfdfe,UserManagerService as _0xd09db,Inject as _0x5c8dc2,Injector as _0x555bce,Disposable as _0x209d22,CustomRangeType as _0x4a9146,UniverInstanceType as _0x4bf91a,DependentOn as _0x5f5485,IConfigService as _0x91542d,Plugin as _0x47c1c6,merge as _0x20b3b4}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x356d5f}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x54939c,IThreadCommentDataSourceService as _0x3546ec}from'@univerjs/thread-comment';import{bufferTime as _0x3db8b5}from'rxjs';import{HTTPService as _0x9577a3}from'@univerjs/network';const W=_0x2db34b(0x1e8);var I=(_0x140958=>(_0x140958[_0x140958[_0x2db34b(0x1ad)]=0x0]=_0x2db34b(0x1ad),_0x140958[_0x140958['Solved']=0x1]='Solved',_0x140958[_0x140958[_0x2db34b(0x1e0)]=-0x1]=_0x2db34b(0x1e0),_0x140958))(I||{}),v=(_0x249edc=>(_0x249edc[_0x249edc[_0x2db34b(0x199)]=0x0]=_0x2db34b(0x199),_0x249edc[_0x249edc[_0x2db34b(0x1b8)]=0x1]='Add',_0x249edc[_0x249edc[_0x2db34b(0x1b4)]=0x2]=_0x2db34b(0x1b4),_0x249edc[_0x249edc[_0x2db34b(0x1e7)]=0x3]=_0x2db34b(0x1e7),_0x249edc[_0x249edc['Delete']=0x4]=_0x2db34b(0x1a7),_0x249edc[_0x249edc[_0x2db34b(0x1cf)]=0x5]='Solve',_0x249edc[_0x249edc['UNRECOGNIZED']=-0x1]=_0x2db34b(0x1e0),_0x249edc))(v||{});const D=_0x2745e3=>_0x4cfdfe(new Date(+_0x2745e3))[_0x2db34b(0x1aa)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x256ec9,_0xb841ce)=>{const _0x267fa5=_0x2db34b,_0x426e2f=_0x256ec9[_0x267fa5(0x1dc)](_0xd09db),_0x325a63=_0x256ec9['get'](_0x9577a3);_0xb841ce['forEach'](_0x5e6cd2=>{const _0x49571b=_0x267fa5;_0x426e2f[_0x49571b(0x1f6)](_0x5e6cd2)&&_0xb841ce[_0x49571b(0x1ef)](_0x5e6cd2);}),_0xb841ce[_0x267fa5(0x1df)]&&(await _0x325a63[_0x267fa5(0x1dc)](_0x267fa5(0x1d9),{'params':{'userIDs':[..._0xb841ce]}}))[_0x267fa5(0x1d2)][_0x267fa5(0x1a9)][_0x267fa5(0x1bb)](_0x463179=>{_0x463179&&_0x426e2f['addUser'](_0x463179);});};var K=Object[_0x2db34b(0x1f2)],V=(_0x1d2dd7,_0x93bb7e,_0x58492d,_0x47e7b3)=>{const _0x3bff70=_0x2db34b;for(var _0x49c219=_0x47e7b3>0x1?void 0x0:_0x47e7b3?K(_0x93bb7e,_0x58492d):_0x93bb7e,_0x2d1296=_0x1d2dd7[_0x3bff70(0x1f7)]-0x1,_0x1f9586;_0x2d1296>=0x0;_0x2d1296--)(_0x1f9586=_0x1d2dd7[_0x2d1296])&&(_0x49c219=_0x1f9586(_0x49c219)||_0x49c219);return _0x49c219;},p=(_0x3531c5,_0x38a4f8)=>(_0x5c6ea6,_0x124d6d)=>_0x38a4f8(_0x5c6ea6,_0x124d6d,_0x3531c5);function _0x1535(){const _0x534a3b=['listComments','7085632GlEhar','1499825TlKWbd','rangeId','_userService','Solve','_injector','defineProperty','body','find','values','createTimestamp','filter','onStarting','comments','/universer-api/user/list','replyId','140915RGdQlX','get','4XIOJHI','_initUserSync','size','UNRECOGNIZED','saveCommentToSnapshot','symbol','post','type','resolveComment','code','Edit','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','syncUpdateMutationToColla','_configService','ref','dataSource','addUser','1929025FlcjKI','delete','YYYY/MM/DD\x20HH:mm','parse','getOwnPropertyDescriptor','user','/edit','solved','getUser','length','updateComment','customRanges','thread-comment-data-source.config','/solved','_threadCommentDataSource','137028PJoWEq','pluginName','stringify','Unknown','COMMENT','disposeWithMe','unitId','replies','_init','Solved','root','/delete','601755PVCpup','personId','_commentService','_threadCommentDataSourceService','_config','Delete','onReady','users','format','addComment','_sessionService','OpenOrReOpen','commentUpdate$','_httpService','/universer-api/comment/unit/','content','getUnit','add','Reply','comment','parentId','userId','Add','threadId','_initDataSource','forEach','setConfig','slice','error','userID','getComment','getMemberID','deleteComment','map','reply','_threadCommentModel','912582qKzGGT','subscribe','getCurrentUser','requireSession'];_0x1535=function(){return _0x534a3b;};return _0x1535();}let S=class extends _0x209d22{constructor(_0x2ccf85,_0x23cdd5,_0x102600,_0xe3c5b3){const _0x16f0a2=_0x2db34b;super(),this[_0x16f0a2(0x1a4)]=_0x2ccf85,this['_threadCommentModel']=_0x23cdd5,this[_0x16f0a2(0x1ce)]=_0x102600,this[_0x16f0a2(0x1d0)]=_0xe3c5b3,this[_0x16f0a2(0x19e)](),this[_0x16f0a2(0x1de)]();}[_0x2db34b(0x1de)](){const _0x1490e2=_0x2db34b;this[_0x1490e2(0x19b)](this['_threadCommentModel'][_0x1490e2(0x1ae)]['pipe'](_0x3db8b5(0x10))[_0x1490e2(0x1c7)](_0x521090=>{const _0x3d2f8a=_0x1490e2,_0x3d5ae9=new Set();_0x521090[_0x3d2f8a(0x1bb)](_0x3b7597=>{const _0x18666a=_0x3d2f8a;switch(_0x3b7597[_0x18666a(0x1e4)]){case _0x18666a(0x1b3):{const _0x2bb14e=_0x3b7597['payload'][_0x18666a(0x1a3)];_0x3d5ae9[_0x18666a(0x1b3)](_0x2bb14e);break;}}}),B(this[_0x3d2f8a(0x1d0)],_0x3d5ae9);}));}['_init'](){const _0x415a45=_0x2db34b;this[_0x415a45(0x19b)](this[_0x415a45(0x1a4)][_0x415a45(0x1ae)][_0x415a45(0x1c7)](async _0x155b3f=>{const _0x16e2c5=_0x415a45;var _0x298ef1,_0x3ecb30,_0x11765a,_0x5bba12;const _0x5bb1d0=(_0x298ef1=this[_0x16e2c5(0x1c5)][_0x16e2c5(0x1b2)](_0x155b3f[_0x16e2c5(0x19c)])[_0x16e2c5(0x1d3)](_0x42b700=>_0x42b700['threadId']===_0x155b3f[_0x16e2c5(0x1b9)]))==null?void 0x0:_0x298ef1[_0x16e2c5(0x1a0)];if(!_0x5bb1d0)return;const {unitId:_0x1afcf1,subUnitId:_0x2c758b}=_0x5bb1d0;switch(_0x155b3f['user']&&this[_0x16e2c5(0x1ce)][_0x16e2c5(0x1ed)](_0x155b3f[_0x16e2c5(0x1f3)]),_0x155b3f['type']){case v[_0x16e2c5(0x1b8)]:break;case v['Reply']:{this['_threadCommentModel']['addComment'](_0x1afcf1,_0x2c758b,{'unitId':_0x1afcf1,'subUnitId':_0x2c758b,'ref':'','id':_0x155b3f[_0x16e2c5(0x1da)],'dT':D(+_0x155b3f[_0x16e2c5(0x1d5)]),'threadId':_0x155b3f['threadId'],'personId':(_0x11765a=(_0x3ecb30=_0x155b3f[_0x16e2c5(0x1f3)])==null?void 0x0:_0x3ecb30['userID'])!=null?_0x11765a:_0x155b3f[_0x16e2c5(0x1b7)],'text':JSON[_0x16e2c5(0x1f1)](_0x155b3f['content']),'parentId':_0x5bb1d0['id']});break;}case v[_0x16e2c5(0x1a7)]:{const _0x4381de=this['_threadCommentModel'][_0x16e2c5(0x1c0)](_0x1afcf1,_0x2c758b,_0x155b3f[_0x16e2c5(0x1da)]);_0x4381de&&_0x4381de[_0x16e2c5(0x1b6)]&&this[_0x16e2c5(0x1c5)][_0x16e2c5(0x1c2)](_0x1afcf1,_0x2c758b,_0x155b3f[_0x16e2c5(0x1da)]);break;}case v[_0x16e2c5(0x1e7)]:{this[_0x16e2c5(0x1c5)][_0x16e2c5(0x191)](_0x1afcf1,_0x2c758b,{'commentId':_0x155b3f[_0x16e2c5(0x1da)],'text':JSON[_0x16e2c5(0x1f1)](_0x155b3f[_0x16e2c5(0x1b1)])});break;}case v[_0x16e2c5(0x1cf)]:{const _0x194f9c=(_0x5bba12=this[_0x16e2c5(0x1c5)][_0x16e2c5(0x1b2)](_0x155b3f[_0x16e2c5(0x19c)])['find'](_0x73b62e=>_0x73b62e[_0x16e2c5(0x1b9)]===_0x155b3f['threadId']))==null?void 0x0:_0x5bba12[_0x16e2c5(0x1a0)];_0x194f9c&&this[_0x16e2c5(0x1c5)]['resolveComment'](_0x1afcf1,_0x2c758b,_0x194f9c['id'],_0x155b3f['solved']===I[_0x16e2c5(0x19f)]);break;}}}));}};S=V([p(0x0,_0x5c8dc2(_0x518e23)),p(0x1,_0x5c8dc2(_0x54939c)),p(0x2,_0x5c8dc2(_0xd09db)),p(0x3,_0x5c8dc2(_0x555bce))],S);const z=_0x2db34b(0x193),M={};var k=Object[_0x2db34b(0x1f2)],Q=(_0x12d8ba,_0x2e720f,_0x5ecb35,_0x12556a)=>{const _0x34d821=_0x2db34b;for(var _0x28d042=_0x12556a>0x1?void 0x0:_0x12556a?k(_0x2e720f,_0x5ecb35):_0x2e720f,_0xc5696e=_0x12d8ba[_0x34d821(0x1f7)]-0x1,_0x13e84f;_0xc5696e>=0x0;_0xc5696e--)(_0x13e84f=_0x12d8ba[_0xc5696e])&&(_0x28d042=_0x13e84f(_0x28d042)||_0x28d042);return _0x28d042;},_=(_0x396d9f,_0x584c3b)=>(_0x219826,_0x3ed782)=>_0x584c3b(_0x219826,_0x3ed782,_0x396d9f);function X(_0x1010f0,_0x50c67c){const _0x440225=_0x2db34b,_0x1e4ea7=_0x1010f0['replies'][0x0];return{..._0x50c67c,'id':_0x1e4ea7[_0x440225(0x1da)],'resolved':_0x1010f0[_0x440225(0x1f5)]===0x1,'dT':D(_0x1e4ea7[_0x440225(0x1d5)]),'personId':_0x1e4ea7[_0x440225(0x1b7)],'threadId':_0x1e4ea7[_0x440225(0x1b9)]};}function ee(_0x4b4504,_0xdc293e,_0x1c736a){const _0x368ce1=_0x2db34b;var _0x3b788c,_0x1aaf27;if(((_0x1aaf27=(_0x3b788c=_0x4b4504==null?void 0x0:_0x4b4504['replies'])==null?void 0x0:_0x3b788c[_0x368ce1(0x1f7)])!=null?_0x1aaf27:0x0)>0x0){const _0xc2fef0=(_0x190e50,_0x5b9b75)=>({'id':_0x190e50['replyId'],'threadId':_0x190e50[_0x368ce1(0x1b9)],'dT':D(_0x190e50[_0x368ce1(0x1d5)]),'personId':_0x190e50[_0x368ce1(0x1b7)],'resolved':_0x4b4504['solved']===I[_0x368ce1(0x19f)],'unitId':_0xdc293e,'subUnitId':_0x1c736a,'text':JSON[_0x368ce1(0x1f1)](_0x190e50[_0x368ce1(0x1b1)]),'parentId':_0x5b9b75}),_0x32a2da=_0xc2fef0(_0x4b4504[_0x368ce1(0x19d)][0x0]);return{..._0x32a2da,'children':_0x4b4504[_0x368ce1(0x19d)][_0x368ce1(0x1bd)](0x1)['map'](_0x530621=>_0xc2fef0(_0x530621,_0x32a2da['id']))};}return null;}let f=class{constructor(_0x308845,_0x16a615,_0x5c14b3,_0x31dc07){const _0x3ee019=_0x2db34b;this[_0x3ee019(0x1af)]=_0x308845,this[_0x3ee019(0x1ce)]=_0x16a615,this['_sessionService']=_0x5c14b3,this[_0x3ee019(0x1d0)]=_0x31dc07;}async[_0x2db34b(0x1ab)](_0x1f1b33){const _0x22c5d0=_0x2db34b;var _0x5c3ce7,_0x29e54e;const {parentId:_0x2f1bed,unitId:_0x2daf1d,text:_0x4d7839,threadId:_0x3e755d}=_0x1f1b33,_0x57d218=(_0x29e54e=(_0x5c3ce7=_0x4d7839[_0x22c5d0(0x192)])==null?void 0x0:_0x5c3ce7[_0x22c5d0(0x1d6)](_0x554aa9=>_0x554aa9['rangeType']===_0x4a9146['COMMENT'])[_0x22c5d0(0x1c3)](_0x78198f=>_0x78198f['rangeId']))!=null?_0x29e54e:[],_0x209db1=JSON['stringify'](_0x4d7839),_0x1ef5b9=(await this[_0x22c5d0(0x1ac)]['requireSession'](_0x2daf1d))['getMemberID']();if(_0x2f1bed){const _0x7aa876={'memberId':_0x1ef5b9,'unitId':_0x2daf1d,'content':_0x209db1,'mention':_0x57d218,'threadId':_0x3e755d},_0x3189a3=(await this[_0x22c5d0(0x1af)][_0x22c5d0(0x1e3)]('/universer-api/comment/unit/'+_0x2daf1d+'/reply',{'body':_0x7aa876}))[_0x22c5d0(0x1d2)][_0x22c5d0(0x1c4)];return{..._0x1f1b33,'id':_0x3189a3[_0x22c5d0(0x1da)],'dT':_0x4cfdfe(+_0x3189a3['createTimestamp'])[_0x22c5d0(0x1aa)](_0x22c5d0(0x1f0)),'personId':_0x3189a3[_0x22c5d0(0x1b7)]};}else{const _0xd6169d={'memberId':_0x1ef5b9,'unitId':_0x2daf1d,'content':_0x209db1,'mention':_0x57d218},_0x41f278=await this[_0x22c5d0(0x1af)][_0x22c5d0(0x1e3)](_0x22c5d0(0x1b0)+_0x2daf1d+'/add',{'body':_0xd6169d});return X(_0x41f278['body'][_0x22c5d0(0x1b5)],_0x1f1b33);}}async[_0x2db34b(0x191)](_0x4d165b){const _0x20c4bc=_0x2db34b;var _0x30480c,_0x45ad51;const {text:_0x46f97a,unitId:_0x5def01}=_0x4d165b,_0x55c4a8=(_0x45ad51=(_0x30480c=_0x46f97a[_0x20c4bc(0x192)])==null?void 0x0:_0x30480c[_0x20c4bc(0x1d6)](_0x1ebdcc=>_0x1ebdcc['rangeType']===_0x4a9146[_0x20c4bc(0x19a)])[_0x20c4bc(0x1c3)](_0x358abf=>_0x358abf[_0x20c4bc(0x1cd)]))!=null?_0x45ad51:[],_0x21698a=JSON[_0x20c4bc(0x198)](_0x46f97a),_0x5ef6cc=_0x4d165b[_0x20c4bc(0x1b9)],_0x2f9976=_0x4d165b['id'],_0x5c1d27={'memberId':(await this['_sessionService'][_0x20c4bc(0x1c9)](_0x5def01))['getMemberID'](),'unitId':_0x5def01,'threadId':_0x5ef6cc,'mention':_0x55c4a8,'content':_0x21698a,'replyId':_0x2f9976},_0xd0704b=await this[_0x20c4bc(0x1af)][_0x20c4bc(0x1e3)](_0x20c4bc(0x1b0)+_0x5def01+_0x20c4bc(0x1f4),{'body':_0x5c1d27});return!_0xd0704b[_0x20c4bc(0x1d2)]['error']||_0xd0704b[_0x20c4bc(0x1d2)][_0x20c4bc(0x1be)][_0x20c4bc(0x1e6)]===0x1;}async[_0x2db34b(0x1e5)](_0x1f4049){const _0x1dcf6e=_0x2db34b,{unitId:_0x273f64}=_0x1f4049,_0x4c1bf6=_0x1f4049[_0x1dcf6e(0x1b9)],_0x5773c6={'memberId':this['_userService'][_0x1dcf6e(0x1c8)]()[_0x1dcf6e(0x1bf)],'unitId':_0x273f64,'threadId':_0x4c1bf6,'solved':_0x1f4049['resolved']?I['Solved']:I[_0x1dcf6e(0x1ad)]},_0x1207a9=await this['_httpService'][_0x1dcf6e(0x1e3)](_0x1dcf6e(0x1b0)+_0x273f64+_0x1dcf6e(0x194),{'body':_0x5773c6});return!_0x1207a9[_0x1dcf6e(0x1d2)][_0x1dcf6e(0x1be)]||_0x1207a9[_0x1dcf6e(0x1d2)]['error'][_0x1dcf6e(0x1e6)]===0x1;}async[_0x2db34b(0x1c2)](_0x5dfcee,_0x1ecc59,_0x4f05f7,_0x20f444){const _0x50dded=_0x2db34b,_0x2639ef={'memberId':(await this[_0x50dded(0x1ac)][_0x50dded(0x1c9)](_0x5dfcee))[_0x50dded(0x1c1)](),'threadId':_0x4f05f7,'replyId':_0x20f444,'unitId':_0x5dfcee},_0x5bae07=await this[_0x50dded(0x1af)][_0x50dded(0x1e3)]('/universer-api/comment/unit/'+_0x5dfcee+_0x50dded(0x1a1),{'body':_0x2639ef});return!_0x5bae07[_0x50dded(0x1d2)][_0x50dded(0x1be)]||_0x5bae07['body'][_0x50dded(0x1be)]['code']===0x1;}async[_0x2db34b(0x1ca)](_0x4edcde,_0x403e6f,_0x33ca43){const _0x25d186=_0x2db34b,_0x3caafa={'unitId':_0x4edcde,'threadId':_0x33ca43},_0x444905=await this[_0x25d186(0x1af)]['post'](_0x25d186(0x1b0)+_0x4edcde+'/list',{'body':_0x3caafa}),_0x288e6b=_0x33ca43[_0x25d186(0x1c3)](_0x1a1bd4=>ee(_0x444905[_0x25d186(0x1d2)][_0x25d186(0x1d8)][_0x1a1bd4],_0x4edcde,_0x403e6f))[_0x25d186(0x1d6)](Boolean);return Object[_0x25d186(0x1d4)](_0x444905[_0x25d186(0x1d2)][_0x25d186(0x1a9)])[_0x25d186(0x1bb)](_0x5bb984=>{const _0x1ae605=_0x25d186;this[_0x1ae605(0x1ce)][_0x1ae605(0x1ed)](_0x5bb984);}),_0x288e6b;}[_0x2db34b(0x1e1)](_0x4b094f){const _0x1622eb=_0x2db34b;return{'id':_0x4b094f['id'],'threadId':_0x4b094f[_0x1622eb(0x1b9)],'ref':_0x4b094f[_0x1622eb(0x1eb)]};}};f=Q([_(0x0,_0x5c8dc2(_0x9577a3)),_(0x1,_0x5c8dc2(_0xd09db)),_(0x2,_0x5c8dc2(_0x25437f)),_(0x3,_0x5c8dc2(_0x555bce))],f);function _0xa939(_0x20a41b,_0x1881e9){const _0x153525=_0x1535();return _0xa939=function(_0xa93947,_0x20a87f){_0xa93947=_0xa93947-0x191;let _0x366989=_0x153525[_0xa93947];return _0x366989;},_0xa939(_0x20a41b,_0x1881e9);}var re=Object[_0x2db34b(0x1f2)],te=(_0xb45255,_0x11fa76,_0x56d3b3,_0x32fb3b)=>{for(var _0x5e3a2d=_0x32fb3b>0x1?void 0x0:_0x32fb3b?re(_0x11fa76,_0x56d3b3):_0x11fa76,_0x5ce67f=_0xb45255['length']-0x1,_0x3aa32c;_0x5ce67f>=0x0;_0x5ce67f--)(_0x3aa32c=_0xb45255[_0x5ce67f])&&(_0x5e3a2d=_0x3aa32c(_0x5e3a2d)||_0x5e3a2d);return _0x5e3a2d;},N=(_0x189a2c,_0x3d3767)=>(_0x517933,_0x5e34a6)=>_0x3d3767(_0x517933,_0x5e34a6,_0x189a2c);let g=class extends _0x209d22{constructor(_0x443e30,_0x540623){const _0x8ebfd=_0x2db34b;super(),this[_0x8ebfd(0x1a5)]=_0x443e30,this[_0x8ebfd(0x195)]=_0x540623,this[_0x8ebfd(0x1ba)]();}['_initDataSource'](){const _0x5e646a=_0x2db34b;this['_threadCommentDataSourceService'][_0x5e646a(0x1ec)]=this[_0x5e646a(0x195)],this[_0x5e646a(0x1a5)][_0x5e646a(0x1e9)]=!0x1;}};g=te([N(0x0,_0x3546ec),N(0x1,_0x5c8dc2(f))],g);var se=Object[_0x2db34b(0x1d1)],oe=Object[_0x2db34b(0x1f2)],ne=(_0x48b37f,_0x4d73af,_0x1fd5fd)=>_0x4d73af in _0x48b37f?se(_0x48b37f,_0x4d73af,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1fd5fd}):_0x48b37f[_0x4d73af]=_0x1fd5fd,ie=(_0x5ec4c9,_0x1ba78c,_0x4276dc,_0x520656)=>{const _0x4a0035=_0x2db34b;for(var _0x334e4d=_0x520656>0x1?void 0x0:_0x520656?oe(_0x1ba78c,_0x4276dc):_0x1ba78c,_0xf6ed8d=_0x5ec4c9[_0x4a0035(0x1f7)]-0x1,_0x526744;_0xf6ed8d>=0x0;_0xf6ed8d--)(_0x526744=_0x5ec4c9[_0xf6ed8d])&&(_0x334e4d=_0x526744(_0x334e4d)||_0x334e4d);return _0x334e4d;},w=(_0x573c95,_0x23b4c4)=>(_0x1ebfa8,_0x5e70ad)=>_0x23b4c4(_0x1ebfa8,_0x5e70ad,_0x573c95),$=(_0x5eddcf,_0x7e9cb3,_0x30b943)=>ne(_0x5eddcf,typeof _0x7e9cb3!=_0x2db34b(0x1e2)?_0x7e9cb3+'':_0x7e9cb3,_0x30b943);let b=class extends _0x47c1c6{constructor(_0x582bcf=M,_0x2b67b0,_0x3be51f){const _0x29ee52=_0x2db34b;super(),this['_config']=_0x582bcf,this[_0x29ee52(0x1d0)]=_0x2b67b0,this[_0x29ee52(0x1ea)]=_0x3be51f;const {..._0x249bb6}=_0x20b3b4({},M,this[_0x29ee52(0x1a6)]);this[_0x29ee52(0x1ea)][_0x29ee52(0x1bc)](z,_0x249bb6);}[_0x2db34b(0x1d7)](){const _0x3730a9=_0x2db34b;[[f],[g],[S]][_0x3730a9(0x1bb)](_0x49e43e=>{const _0x4e7c78=_0x3730a9;this['_injector'][_0x4e7c78(0x1b3)](_0x49e43e);});}[_0x2db34b(0x1a8)](){const _0x53d72d=_0x2db34b;this[_0x53d72d(0x1d0)][_0x53d72d(0x1dc)](g),this[_0x53d72d(0x1d0)][_0x53d72d(0x1dc)](S);}};$(b,_0x2db34b(0x197),W),$(b,'type',_0x4bf91a['UNIVER_UNKNOWN']),b=ie([_0x5f5485(_0x356d5f,_0x498854,_0x5bfe90),w(0x1,_0x5c8dc2(_0x555bce)),w(0x2,_0x91542d)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x1261b5=_0x5f22;(function(_0x167c3f,_0x591584){const _0x8ef28c=_0x5f22,_0x2654e9=_0x167c3f();while(!![]){try{const _0x9005c6=-parseInt(_0x8ef28c(0x17a))/0x1*(-parseInt(_0x8ef28c(0x127))/0x2)+-parseInt(_0x8ef28c(0x130))/0x3*(-parseInt(_0x8ef28c(0x13b))/0x4)+parseInt(_0x8ef28c(0x175))/0x5*(-parseInt(_0x8ef28c(0x164))/0x6)+parseInt(_0x8ef28c(0x15f))/0x7*(parseInt(_0x8ef28c(0x14b))/0x8)+-parseInt(_0x8ef28c(0x14d))/0x9+parseInt(_0x8ef28c(0x14f))/0xa*(-parseInt(_0x8ef28c(0x182))/0xb)+parseInt(_0x8ef28c(0x163))/0xc*(parseInt(_0x8ef28c(0x188))/0xd);if(_0x9005c6===_0x591584)break;else _0x2654e9['push'](_0x2654e9['shift']());}catch(_0x2ff2be){_0x2654e9['push'](_0x2654e9['shift']());}}}(_0x46ff,0x4b59f));import{CommentService as _0x571809,CollaborationSessionService as _0x3689ac,UniverCollaborationClientPlugin as _0x39d5ed}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x35da23}from'@univerjs-pro/license';import{dayjs as _0x471d81,UserManagerService as _0x2d60df,Inject as _0x56a30c,Injector as _0x558a08,Disposable as _0x25b91f,CustomRangeType as _0x3be17b,UniverInstanceType as _0x2e4646,DependentOn as _0x47c8df,IConfigService as _0x357739,Plugin as _0x15a356,merge as _0x3bd5c7}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x3b6b13}from'@univerjs/thread-comment-ui';function _0x5f22(_0x13c2ef,_0x11ee64){const _0x46fff5=_0x46ff();return _0x5f22=function(_0x5f2214,_0x52d2a5){_0x5f2214=_0x5f2214-0x126;let _0x374bac=_0x46fff5[_0x5f2214];return _0x374bac;},_0x5f22(_0x13c2ef,_0x11ee64);}import{ThreadCommentModel as _0x19fbf1,IThreadCommentDataSourceService as _0x2ebbc5}from'@univerjs/thread-comment';import{bufferTime as _0x36e044}from'rxjs';import{HTTPService as _0x3fd671}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x4f86ad=>(_0x4f86ad[_0x4f86ad['OpenOrReOpen']=0x0]='OpenOrReOpen',_0x4f86ad[_0x4f86ad[_0x1261b5(0x129)]=0x1]='Solved',_0x4f86ad[_0x4f86ad['UNRECOGNIZED']=-0x1]=_0x1261b5(0x158),_0x4f86ad))(I||{}),v=(_0x1056ae=>(_0x1056ae[_0x1056ae[_0x1261b5(0x189)]=0x0]='Unknown',_0x1056ae[_0x1056ae[_0x1261b5(0x16b)]=0x1]=_0x1261b5(0x16b),_0x1056ae[_0x1056ae[_0x1261b5(0x13c)]=0x2]=_0x1261b5(0x13c),_0x1056ae[_0x1056ae[_0x1261b5(0x184)]=0x3]=_0x1261b5(0x184),_0x1056ae[_0x1056ae['Delete']=0x4]=_0x1261b5(0x171),_0x1056ae[_0x1056ae['Solve']=0x5]='Solve',_0x1056ae[_0x1056ae['UNRECOGNIZED']=-0x1]=_0x1261b5(0x158),_0x1056ae))(v||{});const D=_0x3546e3=>_0x471d81(new Date(+_0x3546e3))[_0x1261b5(0x16f)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x1ba598,_0x195d49)=>{const _0x1fd558=_0x1261b5,_0x186ab8=_0x1ba598['get'](_0x2d60df),_0x417187=_0x1ba598[_0x1fd558(0x159)](_0x3fd671);_0x195d49[_0x1fd558(0x140)](_0x26cbd3=>{const _0x44cfc0=_0x1fd558;_0x186ab8[_0x44cfc0(0x128)](_0x26cbd3)&&_0x195d49[_0x44cfc0(0x14a)](_0x26cbd3);}),_0x195d49['size']&&(await _0x417187[_0x1fd558(0x159)](_0x1fd558(0x149),{'params':{'userIDs':[..._0x195d49]}}))['body'][_0x1fd558(0x148)]['forEach'](_0x37e9fb=>{const _0x139eb4=_0x1fd558;_0x37e9fb&&_0x186ab8[_0x139eb4(0x12d)](_0x37e9fb);});};var K=Object[_0x1261b5(0x160)],V=(_0x20868a,_0x2e0b48,_0x20bfbb,_0x5afdef)=>{const _0x22b7b7=_0x1261b5;for(var _0x265898=_0x5afdef>0x1?void 0x0:_0x5afdef?K(_0x2e0b48,_0x20bfbb):_0x2e0b48,_0x46949c=_0x20868a[_0x22b7b7(0x139)]-0x1,_0x1fd063;_0x46949c>=0x0;_0x46949c--)(_0x1fd063=_0x20868a[_0x46949c])&&(_0x265898=_0x1fd063(_0x265898)||_0x265898);return _0x265898;},p=(_0xe695fd,_0x177108)=>(_0x4b45ef,_0x210944)=>_0x177108(_0x4b45ef,_0x210944,_0xe695fd);let S=class extends _0x25b91f{constructor(_0x3ad14e,_0x222c57,_0x4a0789,_0x26916c){const _0x577802=_0x1261b5;super(),this[_0x577802(0x177)]=_0x3ad14e,this['_threadCommentModel']=_0x222c57,this[_0x577802(0x13e)]=_0x4a0789,this[_0x577802(0x174)]=_0x26916c,this['_init'](),this[_0x577802(0x146)]();}[_0x1261b5(0x146)](){const _0x207070=_0x1261b5;this['disposeWithMe'](this[_0x207070(0x150)][_0x207070(0x166)][_0x207070(0x152)](_0x36e044(0x10))['subscribe'](_0x15806a=>{const _0x32aa0d=_0x207070,_0x5a4ca6=new Set();_0x15806a['forEach'](_0x2a52e4=>{const _0x1a24de=_0x5f22;switch(_0x2a52e4['type']){case'add':{const _0x4e517c=_0x2a52e4['payload'][_0x1a24de(0x12c)];_0x5a4ca6[_0x1a24de(0x180)](_0x4e517c);break;}}}),B(this[_0x32aa0d(0x174)],_0x5a4ca6);}));}['_init'](){const _0x24ab85=_0x1261b5;this[_0x24ab85(0x176)](this[_0x24ab85(0x177)][_0x24ab85(0x166)][_0x24ab85(0x16a)](async _0x19462d=>{const _0x5163be=_0x24ab85;var _0x25fe15,_0x27a91c,_0xbafc76,_0x395185;const _0x423892=(_0x25fe15=this[_0x5163be(0x150)][_0x5163be(0x165)](_0x19462d[_0x5163be(0x12b)])[_0x5163be(0x12f)](_0x5bec4d=>_0x5bec4d[_0x5163be(0x162)]===_0x19462d[_0x5163be(0x162)]))==null?void 0x0:_0x25fe15['root'];if(!_0x423892)return;const {unitId:_0x2eca5a,subUnitId:_0x1bd4bd}=_0x423892;switch(_0x19462d['user']&&this[_0x5163be(0x13e)]['addUser'](_0x19462d['user']),_0x19462d[_0x5163be(0x183)]){case v[_0x5163be(0x16b)]:break;case v[_0x5163be(0x13c)]:{this['_threadCommentModel'][_0x5163be(0x157)](_0x2eca5a,_0x1bd4bd,{'unitId':_0x2eca5a,'subUnitId':_0x1bd4bd,'ref':'','id':_0x19462d[_0x5163be(0x17b)],'dT':D(+_0x19462d[_0x5163be(0x134)]),'threadId':_0x19462d[_0x5163be(0x162)],'personId':(_0xbafc76=(_0x27a91c=_0x19462d[_0x5163be(0x156)])==null?void 0x0:_0x27a91c[_0x5163be(0x132)])!=null?_0xbafc76:_0x19462d['userId'],'text':JSON['parse'](_0x19462d[_0x5163be(0x173)]),'parentId':_0x423892['id']});break;}case v[_0x5163be(0x171)]:{const _0x2fbb88=this[_0x5163be(0x150)]['getComment'](_0x2eca5a,_0x1bd4bd,_0x19462d[_0x5163be(0x17b)]);_0x2fbb88&&_0x2fbb88[_0x5163be(0x161)]&&this[_0x5163be(0x150)][_0x5163be(0x16c)](_0x2eca5a,_0x1bd4bd,_0x19462d[_0x5163be(0x17b)]);break;}case v[_0x5163be(0x184)]:{this[_0x5163be(0x150)][_0x5163be(0x136)](_0x2eca5a,_0x1bd4bd,{'commentId':_0x19462d[_0x5163be(0x17b)],'text':JSON['parse'](_0x19462d[_0x5163be(0x173)])});break;}case v[_0x5163be(0x15a)]:{const _0x124f9e=(_0x395185=this[_0x5163be(0x150)]['getUnit'](_0x19462d[_0x5163be(0x12b)])[_0x5163be(0x12f)](_0x15dd35=>_0x15dd35['threadId']===_0x19462d[_0x5163be(0x162)]))==null?void 0x0:_0x395185['root'];_0x124f9e&&this[_0x5163be(0x150)][_0x5163be(0x14c)](_0x2eca5a,_0x1bd4bd,_0x124f9e['id'],_0x19462d[_0x5163be(0x131)]===I['Solved']);break;}}}));}};S=V([p(0x0,_0x56a30c(_0x571809)),p(0x1,_0x56a30c(_0x19fbf1)),p(0x2,_0x56a30c(_0x2d60df)),p(0x3,_0x56a30c(_0x558a08))],S);const z=_0x1261b5(0x13f),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x2e8e38,_0x1e0f60,_0x8b0716,_0x3469b8)=>{const _0x3cc89e=_0x1261b5;for(var _0x27def8=_0x3469b8>0x1?void 0x0:_0x3469b8?k(_0x1e0f60,_0x8b0716):_0x1e0f60,_0x3487e3=_0x2e8e38[_0x3cc89e(0x139)]-0x1,_0x517104;_0x3487e3>=0x0;_0x3487e3--)(_0x517104=_0x2e8e38[_0x3487e3])&&(_0x27def8=_0x517104(_0x27def8)||_0x27def8);return _0x27def8;},_=(_0x1b3624,_0x1b598d)=>(_0x4d9e9f,_0xdf228b)=>_0x1b598d(_0x4d9e9f,_0xdf228b,_0x1b3624);function X(_0x1df497,_0x202e15){const _0x3a260f=_0x1261b5,_0x29f4b1=_0x1df497[_0x3a260f(0x144)][0x0];return{..._0x202e15,'id':_0x29f4b1[_0x3a260f(0x17b)],'resolved':_0x1df497[_0x3a260f(0x131)]===0x1,'dT':D(_0x29f4b1['createTimestamp']),'personId':_0x29f4b1[_0x3a260f(0x14e)],'threadId':_0x29f4b1[_0x3a260f(0x162)]};}function ee(_0x2d3700,_0x129dd6,_0x1da156){const _0x1f7b37=_0x1261b5;var _0x55b081,_0x59d107;if(((_0x59d107=(_0x55b081=_0x2d3700==null?void 0x0:_0x2d3700[_0x1f7b37(0x144)])==null?void 0x0:_0x55b081[_0x1f7b37(0x139)])!=null?_0x59d107:0x0)>0x0){const _0x292292=(_0x265c68,_0x5fa71c)=>({'id':_0x265c68[_0x1f7b37(0x17b)],'threadId':_0x265c68[_0x1f7b37(0x162)],'dT':D(_0x265c68[_0x1f7b37(0x134)]),'personId':_0x265c68[_0x1f7b37(0x14e)],'resolved':_0x2d3700[_0x1f7b37(0x131)]===I[_0x1f7b37(0x129)],'unitId':_0x129dd6,'subUnitId':_0x1da156,'text':JSON[_0x1f7b37(0x168)](_0x265c68['content']),'parentId':_0x5fa71c}),_0x644a55=_0x292292(_0x2d3700[_0x1f7b37(0x144)][0x0]);return{..._0x644a55,'children':_0x2d3700['replies']['slice'](0x1)[_0x1f7b37(0x15c)](_0x5089da=>_0x292292(_0x5089da,_0x644a55['id']))};}return null;}let f=class{constructor(_0x298a15,_0x5e6b59,_0x4655b5,_0xc9079d){const _0x395940=_0x1261b5;this[_0x395940(0x143)]=_0x298a15,this['_userService']=_0x5e6b59,this[_0x395940(0x15e)]=_0x4655b5,this['_injector']=_0xc9079d;}async['addComment'](_0x25b2a1){const _0x17a2f9=_0x1261b5;var _0x53775a,_0x1effd3;const {parentId:_0x2e62da,unitId:_0x3133a5,text:_0xdbd54a,threadId:_0x24fd02}=_0x25b2a1,_0x30d83b=(_0x1effd3=(_0x53775a=_0xdbd54a[_0x17a2f9(0x17c)])==null?void 0x0:_0x53775a['filter'](_0x229299=>_0x229299[_0x17a2f9(0x167)]===_0x3be17b[_0x17a2f9(0x17d)])[_0x17a2f9(0x15c)](_0x5161da=>_0x5161da['rangeId']))!=null?_0x1effd3:[],_0x2d772e=JSON[_0x17a2f9(0x12e)](_0xdbd54a),_0x19e604=(await this[_0x17a2f9(0x15e)][_0x17a2f9(0x147)](_0x3133a5))['getMemberID']();if(_0x2e62da){const _0x329a65={'memberId':_0x19e604,'unitId':_0x3133a5,'content':_0x2d772e,'mention':_0x30d83b,'threadId':_0x24fd02},_0x55bbf1=(await this[_0x17a2f9(0x143)]['post'](_0x17a2f9(0x185)+_0x3133a5+_0x17a2f9(0x151),{'body':_0x329a65}))['body']['reply'];return{..._0x25b2a1,'id':_0x55bbf1['replyId'],'dT':_0x471d81(+_0x55bbf1['createTimestamp'])['format'](_0x17a2f9(0x15d)),'personId':_0x55bbf1[_0x17a2f9(0x14e)]};}else{const _0x452ae7={'memberId':_0x19e604,'unitId':_0x3133a5,'content':_0x2d772e,'mention':_0x30d83b},_0xc9c96b=await this[_0x17a2f9(0x143)]['post']('/universer-api/comment/unit/'+_0x3133a5+_0x17a2f9(0x16e),{'body':_0x452ae7});return X(_0xc9c96b[_0x17a2f9(0x17e)][_0x17a2f9(0x170)],_0x25b2a1);}}async['updateComment'](_0x3edf8a){const _0x461abe=_0x1261b5;var _0x57a6ab,_0x108483;const {text:_0x132c4f,unitId:_0x1c1e00}=_0x3edf8a,_0x40d62a=(_0x108483=(_0x57a6ab=_0x132c4f[_0x461abe(0x17c)])==null?void 0x0:_0x57a6ab['filter'](_0x13cba7=>_0x13cba7[_0x461abe(0x167)]===_0x3be17b[_0x461abe(0x17d)])['map'](_0x2ea36c=>_0x2ea36c[_0x461abe(0x16d)]))!=null?_0x108483:[],_0x3bf4b7=JSON['stringify'](_0x132c4f),_0x127a3e=_0x3edf8a[_0x461abe(0x162)],_0x4da41f=_0x3edf8a['id'],_0x48dcea={'memberId':(await this[_0x461abe(0x15e)][_0x461abe(0x147)](_0x1c1e00))[_0x461abe(0x155)](),'unitId':_0x1c1e00,'threadId':_0x127a3e,'mention':_0x40d62a,'content':_0x3bf4b7,'replyId':_0x4da41f},_0x5d6515=await this[_0x461abe(0x143)][_0x461abe(0x145)](_0x461abe(0x185)+_0x1c1e00+_0x461abe(0x135),{'body':_0x48dcea});return!_0x5d6515[_0x461abe(0x17e)][_0x461abe(0x15b)]||_0x5d6515['body']['error'][_0x461abe(0x186)]===0x1;}async[_0x1261b5(0x14c)](_0x3745b6){const _0x421680=_0x1261b5,{unitId:_0x389dfa}=_0x3745b6,_0x2f93a9=_0x3745b6[_0x421680(0x162)],_0x3fdd25={'memberId':this[_0x421680(0x13e)][_0x421680(0x172)]()[_0x421680(0x132)],'unitId':_0x389dfa,'threadId':_0x2f93a9,'solved':_0x3745b6[_0x421680(0x17f)]?I[_0x421680(0x129)]:I[_0x421680(0x12a)]},_0x2c8710=await this['_httpService'][_0x421680(0x145)]('/universer-api/comment/unit/'+_0x389dfa+_0x421680(0x18a),{'body':_0x3fdd25});return!_0x2c8710['body'][_0x421680(0x15b)]||_0x2c8710[_0x421680(0x17e)][_0x421680(0x15b)]['code']===0x1;}async['deleteComment'](_0x1d29e0,_0x2eac5e,_0x2e9bc1,_0x3831a2){const _0x2bb864=_0x1261b5,_0x2108ba={'memberId':(await this[_0x2bb864(0x15e)][_0x2bb864(0x147)](_0x1d29e0))[_0x2bb864(0x155)](),'threadId':_0x2e9bc1,'replyId':_0x3831a2,'unitId':_0x1d29e0},_0x147b79=await this[_0x2bb864(0x143)][_0x2bb864(0x145)]('/universer-api/comment/unit/'+_0x1d29e0+_0x2bb864(0x126),{'body':_0x2108ba});return!_0x147b79[_0x2bb864(0x17e)]['error']||_0x147b79['body'][_0x2bb864(0x15b)]['code']===0x1;}async['listComments'](_0x265641,_0xcd55ae,_0x2beca5){const _0x47f287=_0x1261b5,_0x3a275b={'unitId':_0x265641,'threadId':_0x2beca5},_0xf51a7b=await this[_0x47f287(0x143)]['post']('/universer-api/comment/unit/'+_0x265641+_0x47f287(0x141),{'body':_0x3a275b}),_0x13a28c=_0x2beca5['map'](_0x44b247=>ee(_0xf51a7b[_0x47f287(0x17e)]['comments'][_0x44b247],_0x265641,_0xcd55ae))[_0x47f287(0x154)](Boolean);return Object['values'](_0xf51a7b['body'][_0x47f287(0x148)])[_0x47f287(0x140)](_0x2b8b74=>{const _0x41419c=_0x47f287;this[_0x41419c(0x13e)]['addUser'](_0x2b8b74);}),_0x13a28c;}['saveCommentToSnapshot'](_0x59232c){return{'id':_0x59232c['id'],'threadId':_0x59232c['threadId'],'ref':_0x59232c['ref']};}};f=Q([_(0x0,_0x56a30c(_0x3fd671)),_(0x1,_0x56a30c(_0x2d60df)),_(0x2,_0x56a30c(_0x3689ac)),_(0x3,_0x56a30c(_0x558a08))],f);var re=Object[_0x1261b5(0x160)],te=(_0x13b039,_0x438c49,_0x17b112,_0x5f460a)=>{const _0x52e1f6=_0x1261b5;for(var _0x403cd3=_0x5f460a>0x1?void 0x0:_0x5f460a?re(_0x438c49,_0x17b112):_0x438c49,_0x5b432c=_0x13b039[_0x52e1f6(0x139)]-0x1,_0x28b6d0;_0x5b432c>=0x0;_0x5b432c--)(_0x28b6d0=_0x13b039[_0x5b432c])&&(_0x403cd3=_0x28b6d0(_0x403cd3)||_0x403cd3);return _0x403cd3;},N=(_0x25d297,_0x4db2a1)=>(_0x21ba5c,_0x313359)=>_0x4db2a1(_0x21ba5c,_0x313359,_0x25d297);function _0x46ff(){const _0x452aec=['_config','subscribe','Add','deleteComment','rangeId','/add','format','comment','Delete','getCurrentUser','content','_injector','697765RhovLF','disposeWithMe','_commentService','_threadCommentDataSourceService','symbol','21423QGlVIz','replyId','customRanges','COMMENT','body','resolved','add','_initDataSource','11OWsjxj','type','Edit','/universer-api/comment/unit/','code','onReady','929435kmEyEo','Unknown','/solved','UNIVER_UNKNOWN','/delete','18ieotrD','getUser','Solved','OpenOrReOpen','unitId','personId','addUser','stringify','find','24WGiDNn','solved','userID','pluginName','createTimestamp','/edit','updateComment','defineProperty','syncUpdateMutationToColla','length','setConfig','231644wukPKj','Reply','_threadCommentDataSource','_userService','thread-comment-data-source.config','forEach','/list','dataSource','_httpService','replies','post','_initUserSync','requireSession','users','/universer-api/user/list','delete','2879944SWScLe','resolveComment','4397850dsYjOK','userId','3006050ivUZNC','_threadCommentModel','/reply','pipe','_configService','filter','getMemberID','user','addComment','UNRECOGNIZED','get','Solve','error','map','YYYY/MM/DD\x20HH:mm','_sessionService','7Xdqrjp','getOwnPropertyDescriptor','parentId','threadId','84tkOCpD','18ljrqkg','getUnit','commentUpdate$','rangeType','parse'];_0x46ff=function(){return _0x452aec;};return _0x46ff();}let g=class extends _0x25b91f{constructor(_0xbdefe,_0x2d6b81){const _0x374115=_0x1261b5;super(),this[_0x374115(0x178)]=_0xbdefe,this['_threadCommentDataSource']=_0x2d6b81,this[_0x374115(0x181)]();}[_0x1261b5(0x181)](){const _0x250363=_0x1261b5;this[_0x250363(0x178)][_0x250363(0x142)]=this[_0x250363(0x13d)],this[_0x250363(0x178)][_0x250363(0x138)]=!0x1;}};g=te([N(0x0,_0x2ebbc5),N(0x1,_0x56a30c(f))],g);var se=Object[_0x1261b5(0x137)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x27f9cd,_0x2e7786,_0x30257b)=>_0x2e7786 in _0x27f9cd?se(_0x27f9cd,_0x2e7786,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x30257b}):_0x27f9cd[_0x2e7786]=_0x30257b,ie=(_0x5c0794,_0x462243,_0x255d7a,_0x590f6d)=>{const _0x2076f1=_0x1261b5;for(var _0x54bbbd=_0x590f6d>0x1?void 0x0:_0x590f6d?oe(_0x462243,_0x255d7a):_0x462243,_0x58a87b=_0x5c0794[_0x2076f1(0x139)]-0x1,_0x5df3fc;_0x58a87b>=0x0;_0x58a87b--)(_0x5df3fc=_0x5c0794[_0x58a87b])&&(_0x54bbbd=_0x5df3fc(_0x54bbbd)||_0x54bbbd);return _0x54bbbd;},w=(_0x266338,_0x4fa66e)=>(_0xd7ea2f,_0xb20144)=>_0x4fa66e(_0xd7ea2f,_0xb20144,_0x266338),$=(_0x4ddfd2,_0x25b9f0,_0x27470e)=>ne(_0x4ddfd2,typeof _0x25b9f0!=_0x1261b5(0x179)?_0x25b9f0+'':_0x25b9f0,_0x27470e);let b=class extends _0x15a356{constructor(_0x20cf4b=M,_0x3df2f8,_0x213fa9){const _0x3b7c37=_0x1261b5;super(),this[_0x3b7c37(0x169)]=_0x20cf4b,this[_0x3b7c37(0x174)]=_0x3df2f8,this[_0x3b7c37(0x153)]=_0x213fa9;const {..._0x13c68e}=_0x3bd5c7({},M,this[_0x3b7c37(0x169)]);this[_0x3b7c37(0x153)][_0x3b7c37(0x13a)](z,_0x13c68e);}['onStarting'](){const _0x571ee8=_0x1261b5;[[f],[g],[S]][_0x571ee8(0x140)](_0x536623=>{const _0x16647c=_0x571ee8;this[_0x16647c(0x174)][_0x16647c(0x180)](_0x536623);});}[_0x1261b5(0x187)](){const _0x4f4ceb=_0x1261b5;this[_0x4f4ceb(0x174)][_0x4f4ceb(0x159)](g),this[_0x4f4ceb(0x174)]['get'](S);}};$(b,_0x1261b5(0x133),W),$(b,_0x1261b5(0x183),_0x2e4646[_0x1261b5(0x18b)]),b=ie([_0x47c8df(_0x3b6b13,_0x39d5ed,_0x35da23),w(0x1,_0x56a30c(_0x558a08)),w(0x2,_0x357739)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x3bdf(_0x594c15,_0x3e43ea){const _0x4a430a=_0x4a43();return _0x3bdf=function(_0x3bdf4c,_0x42a2db){_0x3bdf4c=_0x3bdf4c-0x15d;let _0x2e4fef=_0x4a430a[_0x3bdf4c];return _0x2e4fef;},_0x3bdf(_0x594c15,_0x3e43ea);}function _0x4a43(){const _0x2e644f=['symbol','/delete','Inject','addComment','UniverProThreadCommentDatasource','solved','IThreadCommentDataSourceService','_config','UniverThreadCommentDataSourcePlugin','userID','rxjs','delete','@univerjs-pro/collaboration-client','merge','10cQfKVi','_injector','OpenOrReOpen','Injector','CustomRangeType','4FdAsiZ','createTimestamp','parse','userId','_sessionService','object','users','@univerjs/thread-comment-ui','_init','reply','addUser','replyId','getMemberID','getUser','parentId','Solved','5lnEcFB','3569283tBZdsT','_threadCommentModel','UniverThreadCommentUIPlugin','root','UniverNetwork','filter','Delete','customRanges','Unknown','@univerjs-pro/license','toStringTag','post','getUnit','UserManagerService','syncUpdateMutationToColla','_initUserSync','HTTPService','rangeType','UniverCore','Disposable','UNIVER_UNKNOWN','onReady','_initDataSource','content','bufferTime','map','ref','_configService','@univerjs/core','format','Solve','forEach','defineProperty','replies','Reply','2766939MKMYeT','threadId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','UniverCollaborationClientPlugin','exports','subscribe','stringify','DependentOn','payload','onStarting','ThreadCommentModel','error','add','/universer-api/user/list','/universer-api/comment/unit/','478714lnsjTD','@univerjs/thread-comment','code','listComments','_threadCommentDataSource','user','3644272HotAZQ','1150158pXtyBx','_userService','Edit','setConfig','comment','deleteComment','/reply','length','/add','get','UniverThreadComment','@univerjs/network','YYYY/MM/DD\x20HH:mm','commentUpdate$','thread-comment-data-source.config','body','disposeWithMe','Module','requireSession','/list','UniverThreadCommentUi','resolved','2437972ftbnAn','getOwnPropertyDescriptor','IConfigService','updateComment','Add','type','_threadCommentDataSourceService','2107746zHWfSj','comments','_httpService','unitId','pipe','UNRECOGNIZED','find','function'];_0x4a43=function(){return _0x2e644f;};return _0x4a43();}(function(_0x51f62b,_0x58cea8){const _0x409bd0=_0x3bdf,_0x480ce1=_0x51f62b();while(!![]){try{const _0x2cbacd=parseInt(_0x409bd0(0x1c0))/0x1*(parseInt(_0x409bd0(0x17d))/0x2)+-parseInt(_0x409bd0(0x1c7))/0x3+parseInt(_0x409bd0(0x1dd))/0x4+parseInt(_0x409bd0(0x18d))/0x5*(-parseInt(_0x409bd0(0x162))/0x6)+-parseInt(_0x409bd0(0x1b1))/0x7+parseInt(_0x409bd0(0x1c6))/0x8+parseInt(_0x409bd0(0x18e))/0x9*(-parseInt(_0x409bd0(0x178))/0xa);if(_0x2cbacd===_0x58cea8)break;else _0x480ce1['push'](_0x480ce1['shift']());}catch(_0x612bf7){_0x480ce1['push'](_0x480ce1['shift']());}}}(_0x4a43,0x7912a),function(_0x1f6e10,_0x2c0f4c){const _0x32a653=_0x3bdf;typeof exports==_0x32a653(0x182)&&typeof module<'u'?_0x2c0f4c(exports,require('@univerjs-pro/collaboration-client'),require(_0x32a653(0x197)),require(_0x32a653(0x1aa)),require('@univerjs/thread-comment-ui'),require(_0x32a653(0x1c1)),require(_0x32a653(0x174)),require(_0x32a653(0x1d2))):typeof define==_0x32a653(0x169)&&define['amd']?define([_0x32a653(0x1b5),_0x32a653(0x176),_0x32a653(0x197),_0x32a653(0x1aa),_0x32a653(0x184),_0x32a653(0x1c1),_0x32a653(0x174),_0x32a653(0x1d2)],_0x2c0f4c):(_0x1f6e10=typeof globalThis<'u'?globalThis:_0x1f6e10||self,_0x2c0f4c(_0x1f6e10[_0x32a653(0x16e)]={},_0x1f6e10['UniverProCollaborationClient'],_0x1f6e10['UniverProLicense'],_0x1f6e10[_0x32a653(0x1a0)],_0x1f6e10[_0x32a653(0x1db)],_0x1f6e10[_0x32a653(0x1d1)],_0x1f6e10[_0x32a653(0x174)],_0x1f6e10[_0x32a653(0x192)]));}(this,function(_0x10eb17,_0x5d3f6c,_0x3cc515,_0x11729c,_0x16d96,_0x4fdace,_0x407c18,_0x4fddd5){'use strict';const _0x57af29=_0x3bdf;const _0x4a2e77=_0x57af29(0x1b3);var _0x45bb7a=(_0x384bb2=>(_0x384bb2[_0x384bb2[_0x57af29(0x17a)]=0x0]='OpenOrReOpen',_0x384bb2[_0x384bb2[_0x57af29(0x18c)]=0x1]=_0x57af29(0x18c),_0x384bb2[_0x384bb2['UNRECOGNIZED']=-0x1]=_0x57af29(0x167),_0x384bb2))(_0x45bb7a||{}),_0x223295=(_0xaab4a8=>(_0xaab4a8[_0xaab4a8[_0x57af29(0x196)]=0x0]=_0x57af29(0x196),_0xaab4a8[_0xaab4a8['Add']=0x1]=_0x57af29(0x15f),_0xaab4a8[_0xaab4a8['Reply']=0x2]=_0x57af29(0x1b0),_0xaab4a8[_0xaab4a8[_0x57af29(0x1c9)]=0x3]=_0x57af29(0x1c9),_0xaab4a8[_0xaab4a8[_0x57af29(0x194)]=0x4]=_0x57af29(0x194),_0xaab4a8[_0xaab4a8[_0x57af29(0x1ac)]=0x5]=_0x57af29(0x1ac),_0xaab4a8[_0xaab4a8['UNRECOGNIZED']=-0x1]=_0x57af29(0x167),_0xaab4a8))(_0x223295||{});const _0x508756=_0x1cc1ec=>_0x11729c['dayjs'](new Date(+_0x1cc1ec))[_0x57af29(0x1ab)]('YYYY/MM/DD\x20HH:mm'),_0x10900a=async(_0x2c4735,_0x3483f9)=>{const _0x3e0b5e=_0x57af29,_0x30c7e5=_0x2c4735['get'](_0x11729c[_0x3e0b5e(0x19b)]),_0xb0f364=_0x2c4735[_0x3e0b5e(0x1d0)](_0x4fddd5['HTTPService']);_0x3483f9[_0x3e0b5e(0x1ad)](_0x33f323=>{const _0x4eff6b=_0x3e0b5e;_0x30c7e5[_0x4eff6b(0x18a)](_0x33f323)&&_0x3483f9[_0x4eff6b(0x175)](_0x33f323);}),_0x3483f9['size']&&(await _0xb0f364[_0x3e0b5e(0x1d0)](_0x3e0b5e(0x1be),{'params':{'userIDs':[..._0x3483f9]}}))[_0x3e0b5e(0x1d6)][_0x3e0b5e(0x183)][_0x3e0b5e(0x1ad)](_0x3f6279=>{const _0x56fa5a=_0x3e0b5e;_0x3f6279&&_0x30c7e5[_0x56fa5a(0x187)](_0x3f6279);});};var _0x41ed99=Object[_0x57af29(0x1de)],_0x3a5b7d=(_0x3be72f,_0x245728,_0x40dbef,_0x5ecaac)=>{const _0x5e44b6=_0x57af29;for(var _0x2ab15c=_0x5ecaac>0x1?void 0x0:_0x5ecaac?_0x41ed99(_0x245728,_0x40dbef):_0x245728,_0x4cb737=_0x3be72f[_0x5e44b6(0x1ce)]-0x1,_0x1a2e64;_0x4cb737>=0x0;_0x4cb737--)(_0x1a2e64=_0x3be72f[_0x4cb737])&&(_0x2ab15c=_0x1a2e64(_0x2ab15c)||_0x2ab15c);return _0x2ab15c;},_0x4e45e8=(_0x430b18,_0x39013f)=>(_0xc634b2,_0x70a8ed)=>_0x39013f(_0xc634b2,_0x70a8ed,_0x430b18);let _0x5f4b78=class extends _0x11729c[_0x57af29(0x1a1)]{constructor(_0x2616cf,_0x4ebae2,_0x47b5de,_0x423d5b){const _0x1134ae=_0x57af29;super(),this['_commentService']=_0x2616cf,this[_0x1134ae(0x18f)]=_0x4ebae2,this[_0x1134ae(0x1c8)]=_0x47b5de,this['_injector']=_0x423d5b,this['_init'](),this[_0x1134ae(0x19d)]();}[_0x57af29(0x19d)](){const _0x1780d0=_0x57af29;this[_0x1780d0(0x1d7)](this['_threadCommentModel']['commentUpdate$'][_0x1780d0(0x166)](_0x407c18[_0x1780d0(0x1a6)](0x10))[_0x1780d0(0x1b6)](_0xdd6871=>{const _0x371853=_0x1780d0,_0x2e845a=new Set();_0xdd6871[_0x371853(0x1ad)](_0x52e8db=>{const _0x5a564c=_0x371853;switch(_0x52e8db[_0x5a564c(0x160)]){case'add':{const _0x12c1e0=_0x52e8db[_0x5a564c(0x1b9)]['personId'];_0x2e845a[_0x5a564c(0x1bd)](_0x12c1e0);break;}}}),_0x10900a(this[_0x371853(0x179)],_0x2e845a);}));}[_0x57af29(0x185)](){const _0x131747=_0x57af29;this[_0x131747(0x1d7)](this['_commentService'][_0x131747(0x1d4)][_0x131747(0x1b6)](async _0x23bd87=>{const _0x1bdf31=_0x131747;var _0x2194ad,_0xec0573,_0x4d1619,_0x21558b;const _0xd059b9=(_0x2194ad=this[_0x1bdf31(0x18f)][_0x1bdf31(0x19a)](_0x23bd87[_0x1bdf31(0x165)])['find'](_0x4c9df7=>_0x4c9df7[_0x1bdf31(0x1b2)]===_0x23bd87['threadId']))==null?void 0x0:_0x2194ad[_0x1bdf31(0x191)];if(!_0xd059b9)return;const {unitId:_0x332f7c,subUnitId:_0x49bc14}=_0xd059b9;switch(_0x23bd87[_0x1bdf31(0x1c5)]&&this[_0x1bdf31(0x1c8)][_0x1bdf31(0x187)](_0x23bd87[_0x1bdf31(0x1c5)]),_0x23bd87[_0x1bdf31(0x160)]){case _0x223295[_0x1bdf31(0x15f)]:break;case _0x223295[_0x1bdf31(0x1b0)]:{this[_0x1bdf31(0x18f)][_0x1bdf31(0x16d)](_0x332f7c,_0x49bc14,{'unitId':_0x332f7c,'subUnitId':_0x49bc14,'ref':'','id':_0x23bd87[_0x1bdf31(0x188)],'dT':_0x508756(+_0x23bd87[_0x1bdf31(0x17e)]),'threadId':_0x23bd87['threadId'],'personId':(_0x4d1619=(_0xec0573=_0x23bd87[_0x1bdf31(0x1c5)])==null?void 0x0:_0xec0573[_0x1bdf31(0x173)])!=null?_0x4d1619:_0x23bd87[_0x1bdf31(0x180)],'text':JSON['parse'](_0x23bd87[_0x1bdf31(0x1a5)]),'parentId':_0xd059b9['id']});break;}case _0x223295['Delete']:{const _0x1875c0=this[_0x1bdf31(0x18f)]['getComment'](_0x332f7c,_0x49bc14,_0x23bd87['replyId']);_0x1875c0&&_0x1875c0[_0x1bdf31(0x18b)]&&this[_0x1bdf31(0x18f)][_0x1bdf31(0x1cc)](_0x332f7c,_0x49bc14,_0x23bd87[_0x1bdf31(0x188)]);break;}case _0x223295[_0x1bdf31(0x1c9)]:{this[_0x1bdf31(0x18f)][_0x1bdf31(0x15e)](_0x332f7c,_0x49bc14,{'commentId':_0x23bd87[_0x1bdf31(0x188)],'text':JSON[_0x1bdf31(0x17f)](_0x23bd87[_0x1bdf31(0x1a5)])});break;}case _0x223295[_0x1bdf31(0x1ac)]:{const _0x4df4d9=(_0x21558b=this['_threadCommentModel']['getUnit'](_0x23bd87[_0x1bdf31(0x165)])[_0x1bdf31(0x168)](_0xc38e9a=>_0xc38e9a['threadId']===_0x23bd87[_0x1bdf31(0x1b2)]))==null?void 0x0:_0x21558b['root'];_0x4df4d9&&this[_0x1bdf31(0x18f)]['resolveComment'](_0x332f7c,_0x49bc14,_0x4df4d9['id'],_0x23bd87[_0x1bdf31(0x16f)]===_0x45bb7a['Solved']);break;}}}));}};_0x5f4b78=_0x3a5b7d([_0x4e45e8(0x0,_0x11729c[_0x57af29(0x16c)](_0x5d3f6c['CommentService'])),_0x4e45e8(0x1,_0x11729c[_0x57af29(0x16c)](_0x4fdace[_0x57af29(0x1bb)])),_0x4e45e8(0x2,_0x11729c[_0x57af29(0x16c)](_0x11729c[_0x57af29(0x19b)])),_0x4e45e8(0x3,_0x11729c[_0x57af29(0x16c)](_0x11729c[_0x57af29(0x17b)]))],_0x5f4b78);const _0x34c1e5=_0x57af29(0x1d5),_0x29eac8={};var _0x382dd9=Object[_0x57af29(0x1de)],_0x2b33ca=(_0x317e6e,_0x59fd4f,_0x4c4936,_0x2c4df3)=>{for(var _0x5aaa7a=_0x2c4df3>0x1?void 0x0:_0x2c4df3?_0x382dd9(_0x59fd4f,_0x4c4936):_0x59fd4f,_0x77e52e=_0x317e6e['length']-0x1,_0x369bbb;_0x77e52e>=0x0;_0x77e52e--)(_0x369bbb=_0x317e6e[_0x77e52e])&&(_0x5aaa7a=_0x369bbb(_0x5aaa7a)||_0x5aaa7a);return _0x5aaa7a;},_0x115bac=(_0x5f2418,_0x4a26b3)=>(_0x3c6dc5,_0x6df00)=>_0x4a26b3(_0x3c6dc5,_0x6df00,_0x5f2418);function _0x10164e(_0x238e37,_0x496d56){const _0x411b1b=_0x57af29,_0x436eec=_0x238e37[_0x411b1b(0x1af)][0x0];return{..._0x496d56,'id':_0x436eec[_0x411b1b(0x188)],'resolved':_0x238e37[_0x411b1b(0x16f)]===0x1,'dT':_0x508756(_0x436eec[_0x411b1b(0x17e)]),'personId':_0x436eec[_0x411b1b(0x180)],'threadId':_0x436eec[_0x411b1b(0x1b2)]};}function _0x256116(_0x5c0db7,_0x5ec356,_0x272f9e){const _0x461f5c=_0x57af29;var _0xf5767a,_0x56278b;if(((_0x56278b=(_0xf5767a=_0x5c0db7==null?void 0x0:_0x5c0db7[_0x461f5c(0x1af)])==null?void 0x0:_0xf5767a['length'])!=null?_0x56278b:0x0)>0x0){const _0x5bf791=(_0x1bdbba,_0xd85bec)=>({'id':_0x1bdbba[_0x461f5c(0x188)],'threadId':_0x1bdbba[_0x461f5c(0x1b2)],'dT':_0x508756(_0x1bdbba[_0x461f5c(0x17e)]),'personId':_0x1bdbba['userId'],'resolved':_0x5c0db7[_0x461f5c(0x16f)]===_0x45bb7a[_0x461f5c(0x18c)],'unitId':_0x5ec356,'subUnitId':_0x272f9e,'text':JSON['parse'](_0x1bdbba[_0x461f5c(0x1a5)]),'parentId':_0xd85bec}),_0x13a4c1=_0x5bf791(_0x5c0db7[_0x461f5c(0x1af)][0x0]);return{..._0x13a4c1,'children':_0x5c0db7['replies']['slice'](0x1)['map'](_0x1ba40a=>_0x5bf791(_0x1ba40a,_0x13a4c1['id']))};}return null;}let _0x5cb553=class{constructor(_0x4d7229,_0x44f816,_0x2025ef,_0x10f1d1){const _0x17c240=_0x57af29;this[_0x17c240(0x164)]=_0x4d7229,this[_0x17c240(0x1c8)]=_0x44f816,this[_0x17c240(0x181)]=_0x2025ef,this[_0x17c240(0x179)]=_0x10f1d1;}async['addComment'](_0x1ffa84){const _0x1b7972=_0x57af29;var _0x26d4bb,_0x34fc69;const {parentId:_0x4a022a,unitId:_0x5d70ff,text:_0x22b6a4,threadId:_0x1c90ee}=_0x1ffa84,_0x4c7dd9=(_0x34fc69=(_0x26d4bb=_0x22b6a4[_0x1b7972(0x195)])==null?void 0x0:_0x26d4bb[_0x1b7972(0x193)](_0x2dc102=>_0x2dc102[_0x1b7972(0x19f)]===_0x11729c['CustomRangeType']['COMMENT'])[_0x1b7972(0x1a7)](_0x400ef3=>_0x400ef3['rangeId']))!=null?_0x34fc69:[],_0x209545=JSON[_0x1b7972(0x1b7)](_0x22b6a4),_0x1b2ec1=(await this[_0x1b7972(0x181)][_0x1b7972(0x1d9)](_0x5d70ff))[_0x1b7972(0x189)]();if(_0x4a022a){const _0x28fd4b={'memberId':_0x1b2ec1,'unitId':_0x5d70ff,'content':_0x209545,'mention':_0x4c7dd9,'threadId':_0x1c90ee},_0x5d41c1=(await this['_httpService'][_0x1b7972(0x199)]('/universer-api/comment/unit/'+_0x5d70ff+_0x1b7972(0x1cd),{'body':_0x28fd4b}))['body'][_0x1b7972(0x186)];return{..._0x1ffa84,'id':_0x5d41c1[_0x1b7972(0x188)],'dT':_0x11729c['dayjs'](+_0x5d41c1['createTimestamp'])[_0x1b7972(0x1ab)](_0x1b7972(0x1d3)),'personId':_0x5d41c1['userId']};}else{const _0x467a0d={'memberId':_0x1b2ec1,'unitId':_0x5d70ff,'content':_0x209545,'mention':_0x4c7dd9},_0x29bcce=await this[_0x1b7972(0x164)][_0x1b7972(0x199)](_0x1b7972(0x1bf)+_0x5d70ff+_0x1b7972(0x1cf),{'body':_0x467a0d});return _0x10164e(_0x29bcce[_0x1b7972(0x1d6)][_0x1b7972(0x1cb)],_0x1ffa84);}}async[_0x57af29(0x15e)](_0x590f91){const _0x31fc00=_0x57af29;var _0xb2c33a,_0x4d493e;const {text:_0x23f77a,unitId:_0x3e1f33}=_0x590f91,_0x1c51b6=(_0x4d493e=(_0xb2c33a=_0x23f77a['customRanges'])==null?void 0x0:_0xb2c33a[_0x31fc00(0x193)](_0x91cb21=>_0x91cb21[_0x31fc00(0x19f)]===_0x11729c[_0x31fc00(0x17c)]['COMMENT'])[_0x31fc00(0x1a7)](_0xa532f1=>_0xa532f1['rangeId']))!=null?_0x4d493e:[],_0x40c1d9=JSON[_0x31fc00(0x1b7)](_0x23f77a),_0x4ba3de=_0x590f91[_0x31fc00(0x1b2)],_0x4aa009=_0x590f91['id'],_0x2b3659={'memberId':(await this[_0x31fc00(0x181)][_0x31fc00(0x1d9)](_0x3e1f33))['getMemberID'](),'unitId':_0x3e1f33,'threadId':_0x4ba3de,'mention':_0x1c51b6,'content':_0x40c1d9,'replyId':_0x4aa009},_0x70e981=await this[_0x31fc00(0x164)][_0x31fc00(0x199)](_0x31fc00(0x1bf)+_0x3e1f33+'/edit',{'body':_0x2b3659});return!_0x70e981[_0x31fc00(0x1d6)][_0x31fc00(0x1bc)]||_0x70e981[_0x31fc00(0x1d6)][_0x31fc00(0x1bc)]['code']===0x1;}async['resolveComment'](_0x30b8f5){const _0x398ec4=_0x57af29,{unitId:_0x2b6fb9}=_0x30b8f5,_0x3b7c68=_0x30b8f5[_0x398ec4(0x1b2)],_0x15e43d={'memberId':this['_userService']['getCurrentUser']()[_0x398ec4(0x173)],'unitId':_0x2b6fb9,'threadId':_0x3b7c68,'solved':_0x30b8f5[_0x398ec4(0x1dc)]?_0x45bb7a[_0x398ec4(0x18c)]:_0x45bb7a[_0x398ec4(0x17a)]},_0x5684b3=await this[_0x398ec4(0x164)][_0x398ec4(0x199)](_0x398ec4(0x1bf)+_0x2b6fb9+'/solved',{'body':_0x15e43d});return!_0x5684b3['body'][_0x398ec4(0x1bc)]||_0x5684b3[_0x398ec4(0x1d6)][_0x398ec4(0x1bc)]['code']===0x1;}async['deleteComment'](_0x2b48a8,_0x1cb67a,_0x4790d2,_0x4e945e){const _0x2bed64=_0x57af29,_0x3b5409={'memberId':(await this[_0x2bed64(0x181)][_0x2bed64(0x1d9)](_0x2b48a8))[_0x2bed64(0x189)](),'threadId':_0x4790d2,'replyId':_0x4e945e,'unitId':_0x2b48a8},_0x2aa747=await this[_0x2bed64(0x164)]['post'](_0x2bed64(0x1bf)+_0x2b48a8+_0x2bed64(0x16b),{'body':_0x3b5409});return!_0x2aa747[_0x2bed64(0x1d6)][_0x2bed64(0x1bc)]||_0x2aa747[_0x2bed64(0x1d6)]['error'][_0x2bed64(0x1c2)]===0x1;}async[_0x57af29(0x1c3)](_0x3b0bd5,_0x580f67,_0x19def7){const _0x1c8f8d=_0x57af29,_0x491266={'unitId':_0x3b0bd5,'threadId':_0x19def7},_0x4d3a45=await this[_0x1c8f8d(0x164)][_0x1c8f8d(0x199)]('/universer-api/comment/unit/'+_0x3b0bd5+_0x1c8f8d(0x1da),{'body':_0x491266}),_0x277533=_0x19def7[_0x1c8f8d(0x1a7)](_0x53a641=>_0x256116(_0x4d3a45['body'][_0x1c8f8d(0x163)][_0x53a641],_0x3b0bd5,_0x580f67))['filter'](Boolean);return Object['values'](_0x4d3a45[_0x1c8f8d(0x1d6)]['users'])[_0x1c8f8d(0x1ad)](_0x238230=>{const _0x3d73c4=_0x1c8f8d;this[_0x3d73c4(0x1c8)][_0x3d73c4(0x187)](_0x238230);}),_0x277533;}['saveCommentToSnapshot'](_0x574775){const _0x585d63=_0x57af29;return{'id':_0x574775['id'],'threadId':_0x574775[_0x585d63(0x1b2)],'ref':_0x574775[_0x585d63(0x1a8)]};}};_0x5cb553=_0x2b33ca([_0x115bac(0x0,_0x11729c[_0x57af29(0x16c)](_0x4fddd5[_0x57af29(0x19e)])),_0x115bac(0x1,_0x11729c['Inject'](_0x11729c[_0x57af29(0x19b)])),_0x115bac(0x2,_0x11729c[_0x57af29(0x16c)](_0x5d3f6c['CollaborationSessionService'])),_0x115bac(0x3,_0x11729c['Inject'](_0x11729c[_0x57af29(0x17b)]))],_0x5cb553);var _0x432a36=Object[_0x57af29(0x1de)],_0x2f10b4=(_0x4ce067,_0x45c336,_0x5a63d6,_0x5d9a22)=>{for(var _0x3e35af=_0x5d9a22>0x1?void 0x0:_0x5d9a22?_0x432a36(_0x45c336,_0x5a63d6):_0x45c336,_0x5cb357=_0x4ce067['length']-0x1,_0x47048a;_0x5cb357>=0x0;_0x5cb357--)(_0x47048a=_0x4ce067[_0x5cb357])&&(_0x3e35af=_0x47048a(_0x3e35af)||_0x3e35af);return _0x3e35af;},_0x1c8b78=(_0xcb6983,_0x52030a)=>(_0x52a284,_0x55e1d2)=>_0x52030a(_0x52a284,_0x55e1d2,_0xcb6983);let _0x16bf22=class extends _0x11729c[_0x57af29(0x1a1)]{constructor(_0x230feb,_0x5db848){const _0x195284=_0x57af29;super(),this[_0x195284(0x161)]=_0x230feb,this[_0x195284(0x1c4)]=_0x5db848,this[_0x195284(0x1a4)]();}[_0x57af29(0x1a4)](){const _0x301653=_0x57af29;this[_0x301653(0x161)]['dataSource']=this[_0x301653(0x1c4)],this[_0x301653(0x161)][_0x301653(0x19c)]=!0x1;}};_0x16bf22=_0x2f10b4([_0x1c8b78(0x0,_0x4fdace[_0x57af29(0x170)]),_0x1c8b78(0x1,_0x11729c[_0x57af29(0x16c)](_0x5cb553))],_0x16bf22);var _0x21125f=Object[_0x57af29(0x1ae)],_0x45c412=Object[_0x57af29(0x1de)],_0x4459c9=(_0x45c11b,_0x5a3b4c,_0x5a6267)=>_0x5a3b4c in _0x45c11b?_0x21125f(_0x45c11b,_0x5a3b4c,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5a6267}):_0x45c11b[_0x5a3b4c]=_0x5a6267,_0x442364=(_0x2e0215,_0x519fba,_0x2d9a43,_0x17ca25)=>{const _0x4fc278=_0x57af29;for(var _0x17bd9c=_0x17ca25>0x1?void 0x0:_0x17ca25?_0x45c412(_0x519fba,_0x2d9a43):_0x519fba,_0x14615d=_0x2e0215[_0x4fc278(0x1ce)]-0x1,_0xde4319;_0x14615d>=0x0;_0x14615d--)(_0xde4319=_0x2e0215[_0x14615d])&&(_0x17bd9c=_0xde4319(_0x17bd9c)||_0x17bd9c);return _0x17bd9c;},_0x3f73e9=(_0x2a62a7,_0x833f70)=>(_0x15cb28,_0x17522f)=>_0x833f70(_0x15cb28,_0x17522f,_0x2a62a7),_0x35b413=(_0x1f72e3,_0x10e81c,_0x44c563)=>_0x4459c9(_0x1f72e3,typeof _0x10e81c!=_0x57af29(0x16a)?_0x10e81c+'':_0x10e81c,_0x44c563);_0x10eb17[_0x57af29(0x172)]=class extends _0x11729c['Plugin']{constructor(_0x4ef5bc=_0x29eac8,_0xa4f23e,_0x5230bd){const _0x443854=_0x57af29;super(),this['_config']=_0x4ef5bc,this['_injector']=_0xa4f23e,this['_configService']=_0x5230bd;const {..._0x349203}=_0x11729c[_0x443854(0x177)]({},_0x29eac8,this[_0x443854(0x171)]);this[_0x443854(0x1a9)][_0x443854(0x1ca)](_0x34c1e5,_0x349203);}[_0x57af29(0x1ba)](){[[_0x5cb553],[_0x16bf22],[_0x5f4b78]]['forEach'](_0x58b031=>{const _0xbad9b8=_0x3bdf;this[_0xbad9b8(0x179)][_0xbad9b8(0x1bd)](_0x58b031);});}[_0x57af29(0x1a3)](){const _0x15b6d5=_0x57af29;this[_0x15b6d5(0x179)][_0x15b6d5(0x1d0)](_0x16bf22),this[_0x15b6d5(0x179)]['get'](_0x5f4b78);}},_0x35b413(_0x10eb17['UniverThreadCommentDataSourcePlugin'],'pluginName',_0x4a2e77),_0x35b413(_0x10eb17[_0x57af29(0x172)],_0x57af29(0x160),_0x11729c['UniverInstanceType'][_0x57af29(0x1a2)]),_0x10eb17[_0x57af29(0x172)]=_0x442364([_0x11729c[_0x57af29(0x1b8)](_0x16d96[_0x57af29(0x190)],_0x5d3f6c[_0x57af29(0x1b4)],_0x3cc515['UniverLicensePlugin']),_0x3f73e9(0x1,_0x11729c['Inject'](_0x11729c[_0x57af29(0x17b)])),_0x3f73e9(0x2,_0x11729c[_0x57af29(0x15d)])],_0x10eb17['UniverThreadCommentDataSourcePlugin']),Object[_0x57af29(0x1ae)](_0x10eb17,Symbol[_0x57af29(0x198)],{'value':_0x57af29(0x1d8)});}));
|
|
1
|
+
function _0x1010(_0x511e82,_0x537307){const _0x4b48be=_0x4b48();return _0x1010=function(_0x101001,_0x4861d0){_0x101001=_0x101001-0x109;let _0x119dad=_0x4b48be[_0x101001];return _0x119dad;},_0x1010(_0x511e82,_0x537307);}function _0x4b48(){const _0x1b1187=['forEach','_sessionService','YYYY/MM/DD\x20HH:mm','replyId','COMMENT','_threadCommentModel','HTTPService','UniverProLicense','_userService','IConfigService','defineProperty','/solved','addComment','@univerjs/thread-comment-ui','_configService','dayjs','rangeId','toStringTag','parse','deleteComment','rxjs','Inject','get','_init','customRanges','@univerjs/thread-comment','_threadCommentDataSourceService','376794woAITS','threadId','updateComment','148zLEdXQ','Injector','disposeWithMe','merge','4292754haZdmG','201680lWgAKy','parentId','setConfig','root','_commentService','Plugin','UniverThreadCommentDataSourcePlugin','replies','_httpService','_injector','requireSession','DependentOn','3299420GMmrmc','@univerjs/network','personId','UniverThreadCommentUIPlugin','@univerjs-pro/license','symbol','comments','Reply','@univerjs-pro/collaboration-client','userID','Delete','bufferTime','solved','rangeType','Solve','OpenOrReOpen','IThreadCommentDataSourceService','addUser','amd','createTimestamp','resolved','getUnit','delete','/universer-api/user/list','ref','CustomRangeType','stringify','UniverThreadCommentUi','Add','/delete','type','_config','exports','add','ThreadCommentModel','3229807zieiQG','comment','content','15555232nFLRcc','_threadCommentDataSource','code','_initUserSync','UserManagerService','UniverLicensePlugin','filter','Edit','Unknown','length','UniverInstanceType','format','CollaborationSessionService','/universer-api/comment/unit/','getComment','users','onStarting','syncUpdateMutationToColla','getOwnPropertyDescriptor','userId','Solved','commentUpdate$','map','UniverCollaborationClientPlugin','Module','body','getUser','listComments','error','/list','getMemberID','user','UniverCore','subscribe','find','33918sRQnLT','thread-comment-data-source.config','pluginName','post','object','UNRECOGNIZED','unitId','getCurrentUser','resolveComment'];_0x4b48=function(){return _0x1b1187;};return _0x4b48();}(function(_0x1657be,_0x36b790){const _0x54b9cb=_0x1010,_0x33175d=_0x1657be();while(!![]){try{const _0x1198f5=-parseInt(_0x54b9cb(0x162))/0x1+parseInt(_0x54b9cb(0x165))/0x2*(parseInt(_0x54b9cb(0x13e))/0x3)+parseInt(_0x54b9cb(0x176))/0x4+parseInt(_0x54b9cb(0x16a))/0x5+parseInt(_0x54b9cb(0x169))/0x6+parseInt(_0x54b9cb(0x118))/0x7+-parseInt(_0x54b9cb(0x11b))/0x8;if(_0x1198f5===_0x36b790)break;else _0x33175d['push'](_0x33175d['shift']());}catch(_0x78b790){_0x33175d['push'](_0x33175d['shift']());}}}(_0x4b48,0x881b9),function(_0x345949,_0x4f29fc){const _0x3c2ea2=_0x1010;typeof exports==_0x3c2ea2(0x142)&&typeof module<'u'?_0x4f29fc(exports,require(_0x3c2ea2(0x17e)),require(_0x3c2ea2(0x17a)),require('@univerjs/core'),require(_0x3c2ea2(0x154)),require(_0x3c2ea2(0x160)),require(_0x3c2ea2(0x15b)),require('@univerjs/network')):typeof define=='function'&&define[_0x3c2ea2(0x188)]?define([_0x3c2ea2(0x115),_0x3c2ea2(0x17e),_0x3c2ea2(0x17a),'@univerjs/core',_0x3c2ea2(0x154),'@univerjs/thread-comment',_0x3c2ea2(0x15b),_0x3c2ea2(0x177)],_0x4f29fc):(_0x345949=typeof globalThis<'u'?globalThis:_0x345949||self,_0x4f29fc(_0x345949['UniverProThreadCommentDatasource']={},_0x345949['UniverProCollaborationClient'],_0x345949[_0x3c2ea2(0x14e)],_0x345949[_0x3c2ea2(0x13b)],_0x345949[_0x3c2ea2(0x110)],_0x345949['UniverThreadComment'],_0x345949['rxjs'],_0x345949['UniverNetwork']));}(this,function(_0x5d25e6,_0x2be977,_0x3918c6,_0x128c95,_0x27e76a,_0xc5a289,_0x26ad9e,_0x1799ee){'use strict';const _0x4d97b9=_0x1010;const _0x4744cd='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x2de309=(_0x558a65=>(_0x558a65[_0x558a65[_0x4d97b9(0x185)]=0x0]=_0x4d97b9(0x185),_0x558a65[_0x558a65[_0x4d97b9(0x12f)]=0x1]=_0x4d97b9(0x12f),_0x558a65[_0x558a65[_0x4d97b9(0x143)]=-0x1]=_0x4d97b9(0x143),_0x558a65))(_0x2de309||{}),_0x32f2ff=(_0x3202d3=>(_0x3202d3[_0x3202d3[_0x4d97b9(0x123)]=0x0]=_0x4d97b9(0x123),_0x3202d3[_0x3202d3[_0x4d97b9(0x111)]=0x1]='Add',_0x3202d3[_0x3202d3['Reply']=0x2]=_0x4d97b9(0x17d),_0x3202d3[_0x3202d3['Edit']=0x3]=_0x4d97b9(0x122),_0x3202d3[_0x3202d3['Delete']=0x4]=_0x4d97b9(0x180),_0x3202d3[_0x3202d3[_0x4d97b9(0x184)]=0x5]=_0x4d97b9(0x184),_0x3202d3[_0x3202d3[_0x4d97b9(0x143)]=-0x1]='UNRECOGNIZED',_0x3202d3))(_0x32f2ff||{});const _0xaf264b=_0x31e14a=>_0x128c95[_0x4d97b9(0x156)](new Date(+_0x31e14a))[_0x4d97b9(0x126)](_0x4d97b9(0x149)),_0x3b328f=async(_0x1cb5f2,_0x583e29)=>{const _0x9eaec5=_0x4d97b9,_0x5df169=_0x1cb5f2[_0x9eaec5(0x15d)](_0x128c95[_0x9eaec5(0x11f)]),_0x1fc167=_0x1cb5f2[_0x9eaec5(0x15d)](_0x1799ee['HTTPService']);_0x583e29[_0x9eaec5(0x147)](_0x11f261=>{const _0x4f7a86=_0x9eaec5;_0x5df169[_0x4f7a86(0x135)](_0x11f261)&&_0x583e29[_0x4f7a86(0x10b)](_0x11f261);}),_0x583e29['size']&&(await _0x1fc167['get'](_0x9eaec5(0x10c),{'params':{'userIDs':[..._0x583e29]}}))[_0x9eaec5(0x134)][_0x9eaec5(0x12a)][_0x9eaec5(0x147)](_0x1c79dd=>{const _0x56078d=_0x9eaec5;_0x1c79dd&&_0x5df169[_0x56078d(0x187)](_0x1c79dd);});};var _0x4b3150=Object[_0x4d97b9(0x12d)],_0x25a829=(_0x250229,_0x3141ec,_0x50de02,_0x2a6ff0)=>{for(var _0x58db2b=_0x2a6ff0>0x1?void 0x0:_0x2a6ff0?_0x4b3150(_0x3141ec,_0x50de02):_0x3141ec,_0x44a277=_0x250229['length']-0x1,_0x51d6e1;_0x44a277>=0x0;_0x44a277--)(_0x51d6e1=_0x250229[_0x44a277])&&(_0x58db2b=_0x51d6e1(_0x58db2b)||_0x58db2b);return _0x58db2b;},_0x4c7337=(_0x1c05d9,_0x49f117)=>(_0x1f98ef,_0x580477)=>_0x49f117(_0x1f98ef,_0x580477,_0x1c05d9);let _0x85e4eb=class extends _0x128c95['Disposable']{constructor(_0x5e8a6b,_0x368f91,_0x1dfde9,_0x4df0d1){const _0x5c5037=_0x4d97b9;super(),this[_0x5c5037(0x16e)]=_0x5e8a6b,this[_0x5c5037(0x14c)]=_0x368f91,this[_0x5c5037(0x14f)]=_0x1dfde9,this[_0x5c5037(0x173)]=_0x4df0d1,this['_init'](),this[_0x5c5037(0x11e)]();}[_0x4d97b9(0x11e)](){const _0x41b267=_0x4d97b9;this[_0x41b267(0x167)](this['_threadCommentModel'][_0x41b267(0x130)]['pipe'](_0x26ad9e[_0x41b267(0x181)](0x10))[_0x41b267(0x13c)](_0x5f429e=>{const _0x49d1a9=_0x41b267,_0x1663cf=new Set();_0x5f429e[_0x49d1a9(0x147)](_0x450033=>{const _0x2f77d2=_0x49d1a9;switch(_0x450033[_0x2f77d2(0x113)]){case _0x2f77d2(0x116):{const _0x239213=_0x450033['payload'][_0x2f77d2(0x178)];_0x1663cf[_0x2f77d2(0x116)](_0x239213);break;}}}),_0x3b328f(this['_injector'],_0x1663cf);}));}[_0x4d97b9(0x15e)](){const _0x2ee4ce=_0x4d97b9;this[_0x2ee4ce(0x167)](this['_commentService']['commentUpdate$']['subscribe'](async _0x2f5d1b=>{const _0xf43fb9=_0x2ee4ce;var _0x53d9c1,_0x7831e2,_0xf26ad9,_0x502216;const _0x2e027a=(_0x53d9c1=this[_0xf43fb9(0x14c)][_0xf43fb9(0x10a)](_0x2f5d1b[_0xf43fb9(0x144)])[_0xf43fb9(0x13d)](_0x26e16d=>_0x26e16d[_0xf43fb9(0x163)]===_0x2f5d1b['threadId']))==null?void 0x0:_0x53d9c1[_0xf43fb9(0x16d)];if(!_0x2e027a)return;const {unitId:_0x350bff,subUnitId:_0x88e82c}=_0x2e027a;switch(_0x2f5d1b[_0xf43fb9(0x13a)]&&this[_0xf43fb9(0x14f)]['addUser'](_0x2f5d1b['user']),_0x2f5d1b[_0xf43fb9(0x113)]){case _0x32f2ff[_0xf43fb9(0x111)]:break;case _0x32f2ff[_0xf43fb9(0x17d)]:{this[_0xf43fb9(0x14c)][_0xf43fb9(0x153)](_0x350bff,_0x88e82c,{'unitId':_0x350bff,'subUnitId':_0x88e82c,'ref':'','id':_0x2f5d1b[_0xf43fb9(0x14a)],'dT':_0xaf264b(+_0x2f5d1b[_0xf43fb9(0x189)]),'threadId':_0x2f5d1b['threadId'],'personId':(_0xf26ad9=(_0x7831e2=_0x2f5d1b['user'])==null?void 0x0:_0x7831e2[_0xf43fb9(0x17f)])!=null?_0xf26ad9:_0x2f5d1b['userId'],'text':JSON[_0xf43fb9(0x159)](_0x2f5d1b[_0xf43fb9(0x11a)]),'parentId':_0x2e027a['id']});break;}case _0x32f2ff[_0xf43fb9(0x180)]:{const _0x294a1a=this[_0xf43fb9(0x14c)][_0xf43fb9(0x129)](_0x350bff,_0x88e82c,_0x2f5d1b[_0xf43fb9(0x14a)]);_0x294a1a&&_0x294a1a[_0xf43fb9(0x16b)]&&this[_0xf43fb9(0x14c)]['deleteComment'](_0x350bff,_0x88e82c,_0x2f5d1b[_0xf43fb9(0x14a)]);break;}case _0x32f2ff[_0xf43fb9(0x122)]:{this[_0xf43fb9(0x14c)]['updateComment'](_0x350bff,_0x88e82c,{'commentId':_0x2f5d1b[_0xf43fb9(0x14a)],'text':JSON[_0xf43fb9(0x159)](_0x2f5d1b['content'])});break;}case _0x32f2ff['Solve']:{const _0x3b4978=(_0x502216=this[_0xf43fb9(0x14c)][_0xf43fb9(0x10a)](_0x2f5d1b[_0xf43fb9(0x144)])[_0xf43fb9(0x13d)](_0x14f028=>_0x14f028[_0xf43fb9(0x163)]===_0x2f5d1b['threadId']))==null?void 0x0:_0x502216['root'];_0x3b4978&&this[_0xf43fb9(0x14c)][_0xf43fb9(0x146)](_0x350bff,_0x88e82c,_0x3b4978['id'],_0x2f5d1b[_0xf43fb9(0x182)]===_0x2de309[_0xf43fb9(0x12f)]);break;}}}));}};_0x85e4eb=_0x25a829([_0x4c7337(0x0,_0x128c95['Inject'](_0x2be977['CommentService'])),_0x4c7337(0x1,_0x128c95[_0x4d97b9(0x15c)](_0xc5a289[_0x4d97b9(0x117)])),_0x4c7337(0x2,_0x128c95[_0x4d97b9(0x15c)](_0x128c95[_0x4d97b9(0x11f)])),_0x4c7337(0x3,_0x128c95[_0x4d97b9(0x15c)](_0x128c95['Injector']))],_0x85e4eb);const _0x53ddfa=_0x4d97b9(0x13f),_0x4c7704={};var _0x5e4bfa=Object[_0x4d97b9(0x12d)],_0xb97d0d=(_0x16aca3,_0x1554ad,_0xd71bd,_0x1d199f)=>{const _0x1fa164=_0x4d97b9;for(var _0x5c1aa2=_0x1d199f>0x1?void 0x0:_0x1d199f?_0x5e4bfa(_0x1554ad,_0xd71bd):_0x1554ad,_0x36a25f=_0x16aca3[_0x1fa164(0x124)]-0x1,_0x423d8c;_0x36a25f>=0x0;_0x36a25f--)(_0x423d8c=_0x16aca3[_0x36a25f])&&(_0x5c1aa2=_0x423d8c(_0x5c1aa2)||_0x5c1aa2);return _0x5c1aa2;},_0x437db1=(_0x31c2b2,_0x47a39e)=>(_0x1a2a58,_0xc6a2bf)=>_0x47a39e(_0x1a2a58,_0xc6a2bf,_0x31c2b2);function _0x564836(_0x5adc50,_0x4019c2){const _0x3fdffa=_0x4d97b9,_0x3b9bc6=_0x5adc50[_0x3fdffa(0x171)][0x0];return{..._0x4019c2,'id':_0x3b9bc6[_0x3fdffa(0x14a)],'resolved':_0x5adc50[_0x3fdffa(0x182)]===0x1,'dT':_0xaf264b(_0x3b9bc6[_0x3fdffa(0x189)]),'personId':_0x3b9bc6[_0x3fdffa(0x12e)],'threadId':_0x3b9bc6['threadId']};}function _0x444303(_0x340cad,_0x2a9cdc,_0x2c991a){const _0x4fd74b=_0x4d97b9;var _0x214b77,_0x2c95d3;if(((_0x2c95d3=(_0x214b77=_0x340cad==null?void 0x0:_0x340cad[_0x4fd74b(0x171)])==null?void 0x0:_0x214b77[_0x4fd74b(0x124)])!=null?_0x2c95d3:0x0)>0x0){const _0x5029e6=(_0x298197,_0x223bbc)=>({'id':_0x298197[_0x4fd74b(0x14a)],'threadId':_0x298197['threadId'],'dT':_0xaf264b(_0x298197[_0x4fd74b(0x189)]),'personId':_0x298197[_0x4fd74b(0x12e)],'resolved':_0x340cad[_0x4fd74b(0x182)]===_0x2de309[_0x4fd74b(0x12f)],'unitId':_0x2a9cdc,'subUnitId':_0x2c991a,'text':JSON[_0x4fd74b(0x159)](_0x298197[_0x4fd74b(0x11a)]),'parentId':_0x223bbc}),_0x311c46=_0x5029e6(_0x340cad['replies'][0x0]);return{..._0x311c46,'children':_0x340cad[_0x4fd74b(0x171)]['slice'](0x1)[_0x4fd74b(0x131)](_0x5da355=>_0x5029e6(_0x5da355,_0x311c46['id']))};}return null;}let _0x2b6290=class{constructor(_0x546b34,_0x323943,_0x481053,_0x22b4db){const _0x3fc776=_0x4d97b9;this[_0x3fc776(0x172)]=_0x546b34,this[_0x3fc776(0x14f)]=_0x323943,this[_0x3fc776(0x148)]=_0x481053,this[_0x3fc776(0x173)]=_0x22b4db;}async[_0x4d97b9(0x153)](_0x21ff8b){const _0x356fc0=_0x4d97b9;var _0x5a95e6,_0x4c0233;const {parentId:_0x47186a,unitId:_0x5c9ab6,text:_0xd28432,threadId:_0x42fc16}=_0x21ff8b,_0x1b5086=(_0x4c0233=(_0x5a95e6=_0xd28432[_0x356fc0(0x15f)])==null?void 0x0:_0x5a95e6[_0x356fc0(0x121)](_0x10e8d3=>_0x10e8d3['rangeType']===_0x128c95[_0x356fc0(0x10e)][_0x356fc0(0x14b)])['map'](_0xd2ea7b=>_0xd2ea7b[_0x356fc0(0x157)]))!=null?_0x4c0233:[],_0x1392a4=JSON['stringify'](_0xd28432),_0x59375a=(await this[_0x356fc0(0x148)][_0x356fc0(0x174)](_0x5c9ab6))[_0x356fc0(0x139)]();if(_0x47186a){const _0x4ce462={'memberId':_0x59375a,'unitId':_0x5c9ab6,'content':_0x1392a4,'mention':_0x1b5086,'threadId':_0x42fc16},_0x2cf571=(await this['_httpService'][_0x356fc0(0x141)]('/universer-api/comment/unit/'+_0x5c9ab6+'/reply',{'body':_0x4ce462}))[_0x356fc0(0x134)]['reply'];return{..._0x21ff8b,'id':_0x2cf571['replyId'],'dT':_0x128c95[_0x356fc0(0x156)](+_0x2cf571[_0x356fc0(0x189)])['format'](_0x356fc0(0x149)),'personId':_0x2cf571['userId']};}else{const _0x5e0d0d={'memberId':_0x59375a,'unitId':_0x5c9ab6,'content':_0x1392a4,'mention':_0x1b5086},_0x59c9a1=await this[_0x356fc0(0x172)][_0x356fc0(0x141)](_0x356fc0(0x128)+_0x5c9ab6+'/add',{'body':_0x5e0d0d});return _0x564836(_0x59c9a1[_0x356fc0(0x134)][_0x356fc0(0x119)],_0x21ff8b);}}async[_0x4d97b9(0x164)](_0x4af241){const _0x4ca7c7=_0x4d97b9;var _0x7eae94,_0x90d7b0;const {text:_0x5057b1,unitId:_0x2ebe54}=_0x4af241,_0x393ff3=(_0x90d7b0=(_0x7eae94=_0x5057b1['customRanges'])==null?void 0x0:_0x7eae94[_0x4ca7c7(0x121)](_0x1c9afb=>_0x1c9afb[_0x4ca7c7(0x183)]===_0x128c95[_0x4ca7c7(0x10e)]['COMMENT'])[_0x4ca7c7(0x131)](_0x74dec6=>_0x74dec6['rangeId']))!=null?_0x90d7b0:[],_0x25d221=JSON[_0x4ca7c7(0x10f)](_0x5057b1),_0x3538d5=_0x4af241[_0x4ca7c7(0x163)],_0x34cd59=_0x4af241['id'],_0x20f988={'memberId':(await this['_sessionService'][_0x4ca7c7(0x174)](_0x2ebe54))[_0x4ca7c7(0x139)](),'unitId':_0x2ebe54,'threadId':_0x3538d5,'mention':_0x393ff3,'content':_0x25d221,'replyId':_0x34cd59},_0x56b776=await this[_0x4ca7c7(0x172)][_0x4ca7c7(0x141)](_0x4ca7c7(0x128)+_0x2ebe54+'/edit',{'body':_0x20f988});return!_0x56b776[_0x4ca7c7(0x134)][_0x4ca7c7(0x137)]||_0x56b776[_0x4ca7c7(0x134)]['error'][_0x4ca7c7(0x11d)]===0x1;}async[_0x4d97b9(0x146)](_0x827292){const _0x2f224a=_0x4d97b9,{unitId:_0x2a0dbd}=_0x827292,_0x58a23b=_0x827292[_0x2f224a(0x163)],_0x56aba9={'memberId':this[_0x2f224a(0x14f)][_0x2f224a(0x145)]()[_0x2f224a(0x17f)],'unitId':_0x2a0dbd,'threadId':_0x58a23b,'solved':_0x827292[_0x2f224a(0x109)]?_0x2de309['Solved']:_0x2de309[_0x2f224a(0x185)]},_0x1776d5=await this['_httpService'][_0x2f224a(0x141)](_0x2f224a(0x128)+_0x2a0dbd+_0x2f224a(0x152),{'body':_0x56aba9});return!_0x1776d5[_0x2f224a(0x134)][_0x2f224a(0x137)]||_0x1776d5[_0x2f224a(0x134)]['error'][_0x2f224a(0x11d)]===0x1;}async[_0x4d97b9(0x15a)](_0x13942c,_0x266c3b,_0x28543d,_0x4b38c3){const _0xeb4f55=_0x4d97b9,_0x32f957={'memberId':(await this['_sessionService'][_0xeb4f55(0x174)](_0x13942c))[_0xeb4f55(0x139)](),'threadId':_0x28543d,'replyId':_0x4b38c3,'unitId':_0x13942c},_0x195155=await this['_httpService'][_0xeb4f55(0x141)]('/universer-api/comment/unit/'+_0x13942c+_0xeb4f55(0x112),{'body':_0x32f957});return!_0x195155[_0xeb4f55(0x134)][_0xeb4f55(0x137)]||_0x195155[_0xeb4f55(0x134)][_0xeb4f55(0x137)][_0xeb4f55(0x11d)]===0x1;}async[_0x4d97b9(0x136)](_0x4913f6,_0x259ae9,_0x3cdd73){const _0x27e755=_0x4d97b9,_0x5df29d={'unitId':_0x4913f6,'threadId':_0x3cdd73},_0x177b3c=await this['_httpService'][_0x27e755(0x141)](_0x27e755(0x128)+_0x4913f6+_0x27e755(0x138),{'body':_0x5df29d}),_0x56fe34=_0x3cdd73[_0x27e755(0x131)](_0x36c33a=>_0x444303(_0x177b3c[_0x27e755(0x134)][_0x27e755(0x17c)][_0x36c33a],_0x4913f6,_0x259ae9))[_0x27e755(0x121)](Boolean);return Object['values'](_0x177b3c['body'][_0x27e755(0x12a)])[_0x27e755(0x147)](_0x2f7c2c=>{const _0x29ef65=_0x27e755;this['_userService'][_0x29ef65(0x187)](_0x2f7c2c);}),_0x56fe34;}['saveCommentToSnapshot'](_0xda9038){const _0x3d0e5=_0x4d97b9;return{'id':_0xda9038['id'],'threadId':_0xda9038['threadId'],'ref':_0xda9038[_0x3d0e5(0x10d)]};}};_0x2b6290=_0xb97d0d([_0x437db1(0x0,_0x128c95[_0x4d97b9(0x15c)](_0x1799ee[_0x4d97b9(0x14d)])),_0x437db1(0x1,_0x128c95[_0x4d97b9(0x15c)](_0x128c95[_0x4d97b9(0x11f)])),_0x437db1(0x2,_0x128c95[_0x4d97b9(0x15c)](_0x2be977[_0x4d97b9(0x127)])),_0x437db1(0x3,_0x128c95[_0x4d97b9(0x15c)](_0x128c95[_0x4d97b9(0x166)]))],_0x2b6290);var _0x4bb17b=Object[_0x4d97b9(0x12d)],_0x4afd5d=(_0x1c8b8a,_0x361a38,_0x3f16e0,_0x1f534e)=>{const _0x3fd27c=_0x4d97b9;for(var _0x6fbc6b=_0x1f534e>0x1?void 0x0:_0x1f534e?_0x4bb17b(_0x361a38,_0x3f16e0):_0x361a38,_0x7b4b7a=_0x1c8b8a[_0x3fd27c(0x124)]-0x1,_0x1690d0;_0x7b4b7a>=0x0;_0x7b4b7a--)(_0x1690d0=_0x1c8b8a[_0x7b4b7a])&&(_0x6fbc6b=_0x1690d0(_0x6fbc6b)||_0x6fbc6b);return _0x6fbc6b;},_0x1c6db6=(_0x162e58,_0xcc6150)=>(_0x5c72c7,_0x4e9e3f)=>_0xcc6150(_0x5c72c7,_0x4e9e3f,_0x162e58);let _0x44b0b3=class extends _0x128c95['Disposable']{constructor(_0x4aa73f,_0x3ecca1){const _0x2de654=_0x4d97b9;super(),this['_threadCommentDataSourceService']=_0x4aa73f,this[_0x2de654(0x11c)]=_0x3ecca1,this['_initDataSource']();}['_initDataSource'](){const _0x42dac4=_0x4d97b9;this[_0x42dac4(0x161)]['dataSource']=this[_0x42dac4(0x11c)],this['_threadCommentDataSourceService'][_0x42dac4(0x12c)]=!0x1;}};_0x44b0b3=_0x4afd5d([_0x1c6db6(0x0,_0xc5a289[_0x4d97b9(0x186)]),_0x1c6db6(0x1,_0x128c95[_0x4d97b9(0x15c)](_0x2b6290))],_0x44b0b3);var _0x3af1ff=Object[_0x4d97b9(0x151)],_0x147850=Object[_0x4d97b9(0x12d)],_0x28e315=(_0x41492b,_0x2000cb,_0x5706e2)=>_0x2000cb in _0x41492b?_0x3af1ff(_0x41492b,_0x2000cb,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5706e2}):_0x41492b[_0x2000cb]=_0x5706e2,_0x5aad38=(_0x5228ba,_0x483167,_0x3756f1,_0x3cae1d)=>{const _0x4b5842=_0x4d97b9;for(var _0x3ac501=_0x3cae1d>0x1?void 0x0:_0x3cae1d?_0x147850(_0x483167,_0x3756f1):_0x483167,_0x2e4db3=_0x5228ba[_0x4b5842(0x124)]-0x1,_0x2769b7;_0x2e4db3>=0x0;_0x2e4db3--)(_0x2769b7=_0x5228ba[_0x2e4db3])&&(_0x3ac501=_0x2769b7(_0x3ac501)||_0x3ac501);return _0x3ac501;},_0x4f9a02=(_0x2e9b68,_0x411ad0)=>(_0x38fc2c,_0x313da9)=>_0x411ad0(_0x38fc2c,_0x313da9,_0x2e9b68),_0x15a01d=(_0xbe8c2d,_0xb22827,_0x51eae7)=>_0x28e315(_0xbe8c2d,typeof _0xb22827!=_0x4d97b9(0x17b)?_0xb22827+'':_0xb22827,_0x51eae7);_0x5d25e6['UniverThreadCommentDataSourcePlugin']=class extends _0x128c95[_0x4d97b9(0x16f)]{constructor(_0xf61670=_0x4c7704,_0x4133c2,_0x3789b8){const _0x2823f2=_0x4d97b9;super(),this[_0x2823f2(0x114)]=_0xf61670,this[_0x2823f2(0x173)]=_0x4133c2,this[_0x2823f2(0x155)]=_0x3789b8;const {..._0x27f355}=_0x128c95[_0x2823f2(0x168)]({},_0x4c7704,this['_config']);this[_0x2823f2(0x155)][_0x2823f2(0x16c)](_0x53ddfa,_0x27f355);}[_0x4d97b9(0x12b)](){const _0x5cb484=_0x4d97b9;[[_0x2b6290],[_0x44b0b3],[_0x85e4eb]][_0x5cb484(0x147)](_0x1e8aea=>{const _0xecf05f=_0x5cb484;this[_0xecf05f(0x173)][_0xecf05f(0x116)](_0x1e8aea);});}['onReady'](){const _0x775d0d=_0x4d97b9;this[_0x775d0d(0x173)][_0x775d0d(0x15d)](_0x44b0b3),this[_0x775d0d(0x173)][_0x775d0d(0x15d)](_0x85e4eb);}},_0x15a01d(_0x5d25e6[_0x4d97b9(0x170)],_0x4d97b9(0x140),_0x4744cd),_0x15a01d(_0x5d25e6['UniverThreadCommentDataSourcePlugin'],_0x4d97b9(0x113),_0x128c95[_0x4d97b9(0x125)]['UNIVER_UNKNOWN']),_0x5d25e6[_0x4d97b9(0x170)]=_0x5aad38([_0x128c95[_0x4d97b9(0x175)](_0x27e76a[_0x4d97b9(0x179)],_0x2be977[_0x4d97b9(0x132)],_0x3918c6[_0x4d97b9(0x120)]),_0x4f9a02(0x1,_0x128c95['Inject'](_0x128c95[_0x4d97b9(0x166)])),_0x4f9a02(0x2,_0x128c95[_0x4d97b9(0x150)])],_0x5d25e6[_0x4d97b9(0x170)]),Object['defineProperty'](_0x5d25e6,Symbol[_0x4d97b9(0x158)],{'value':_0x4d97b9(0x133)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.
|
|
49
|
-
"@univerjs
|
|
50
|
-
"@univerjs/
|
|
51
|
-
"@univerjs/network": "0.
|
|
52
|
-
"@univerjs/thread-comment": "0.6.10",
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.7.0-beta.1",
|
|
49
|
+
"@univerjs/core": "0.7.0-beta.1",
|
|
50
|
+
"@univerjs-pro/license": "0.7.0-beta.1",
|
|
51
|
+
"@univerjs/network": "0.7.0-beta.1",
|
|
53
52
|
"@univerjs/protocol": "0.1.46-alpha.3",
|
|
54
|
-
"@univerjs/thread-comment
|
|
53
|
+
"@univerjs/thread-comment": "0.7.0-beta.1",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.7.0-beta.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "^7.8.1",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
|
-
"vite": "^6.3.
|
|
60
|
-
"vitest": "^3.1.
|
|
61
|
-
"@univerjs-infra/shared": "0.
|
|
59
|
+
"vite": "^6.3.5",
|
|
60
|
+
"vitest": "^3.1.3",
|
|
61
|
+
"@univerjs-infra/shared": "0.7.0-beta.1"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|