@univerjs-pro/thread-comment-datasource 0.6.10-experimental.20250419-1304630 → 0.6.10-experimental.20250421-e4eb9bc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x34a53b=_0x22a2;(function(_0x508da9,_0x138440){const _0x2c177b=_0x22a2,_0x4172f9=_0x508da9();while(!![]){try{const _0x4ca5eb=-parseInt(_0x2c177b(0x17b))/0x1+-parseInt(_0x2c177b(0x173))/0x2*(parseInt(_0x2c177b(0x171))/0x3)+parseInt(_0x2c177b(0x16a))/0x4+-parseInt(_0x2c177b(0x1df))/0x5*(-parseInt(_0x2c177b(0x1de))/0x6)+parseInt(_0x2c177b(0x194))/0x7*(parseInt(_0x2c177b(0x1ae))/0x8)+parseInt(_0x2c177b(0x172))/0x9+-parseInt(_0x2c177b(0x1a5))/0xa*(parseInt(_0x2c177b(0x16d))/0xb);if(_0x4ca5eb===_0x138440)break;else _0x4172f9['push'](_0x4172f9['shift']());}catch(_0x5b695e){_0x4172f9['push'](_0x4172f9['shift']());}}}(_0x1c3f,0xefc5a));Object[_0x34a53b(0x1d5)](exports,Symbol[_0x34a53b(0x17f)],{'value':_0x34a53b(0x186)});function _0x1c3f(){const _0x18ce20=['CollaborationSessionService','syncUpdateMutationToColla','791eQmYvQ','pipe','subscribe','onStarting','Add','users','rangeType','dayjs','length','getUser','UNIVER_UNKNOWN','Solve','Injector','rangeId','getCurrentUser','merge','getComment','118530acrssu','body','@univerjs/thread-comment-ui','stringify','symbol','code','requireSession','replies','get','104464zCDNGA','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_sessionService','error','find','addComment','disposeWithMe','resolved','Edit','parse','deleteComment','_init','size','_threadCommentDataSourceService','addUser','filter','comments','HTTPService','_initDataSource','unitId','add','_httpService','_userService','Reply','getUnit','IThreadCommentDataSourceService','updateComment','listComments','getMemberID','_commentService','userID','DependentOn','_config','user','/universer-api/user/list','UNRECOGNIZED','delete','UserManagerService','replyId','defineProperty','format','_initUserSync','parentId','dataSource','onReady','post','YYYY/MM/DD\x20HH:mm','saveCommentToSnapshot','4479846ojBEiI','10GVUBJV','comment','/edit','_threadCommentDataSource','@univerjs-pro/license','Delete','/delete','threadId','getOwnPropertyDescriptor','userId','payload','OpenOrReOpen','775448fLwlju','_threadCommentModel','Inject','88vbSVgW','Unknown','@univerjs/core','resolveComment','6WOmquO','10631619nQUMLj','1626398CQcKyR','_injector','CustomRangeType','values','Disposable','UniverThreadCommentUIPlugin','forEach','Plugin','1640661KMSjLX','solved','personId','createTimestamp','toStringTag','UniverCollaborationClientPlugin','reply','commentUpdate$','CommentService','type','@univerjs/thread-comment','Module','_configService','customRanges','UniverThreadCommentDataSourcePlugin','Solved','rxjs','map','/universer-api/comment/unit/','COMMENT','content','root','/list'];_0x1c3f=function(){return _0x18ce20;};return _0x1c3f();}const b=require('@univerjs-pro/collaboration-client'),T=require(_0x34a53b(0x1e3)),c=require(_0x34a53b(0x16f)),j=require(_0x34a53b(0x1a7)),M=require(_0x34a53b(0x185)),w=require(_0x34a53b(0x18b)),P=require('@univerjs/network'),U=_0x34a53b(0x1af);function _0x22a2(_0x38a30b,_0x4a9ba2){const _0x1c3f2d=_0x1c3f();return _0x22a2=function(_0x22a2a9,_0x26adf4){_0x22a2a9=_0x22a2a9-0x163;let _0x417e09=_0x1c3f2d[_0x22a2a9];return _0x417e09;},_0x22a2(_0x38a30b,_0x4a9ba2);}var I=(_0x31d162=>(_0x31d162[_0x31d162[_0x34a53b(0x169)]=0x0]=_0x34a53b(0x169),_0x31d162[_0x31d162[_0x34a53b(0x18a)]=0x1]=_0x34a53b(0x18a),_0x31d162[_0x31d162[_0x34a53b(0x1d1)]=-0x1]=_0x34a53b(0x1d1),_0x31d162))(I||{}),v=(_0x5c9543=>(_0x5c9543[_0x5c9543['Unknown']=0x0]=_0x34a53b(0x16e),_0x5c9543[_0x5c9543['Add']=0x1]='Add',_0x5c9543[_0x5c9543[_0x34a53b(0x1c5)]=0x2]=_0x34a53b(0x1c5),_0x5c9543[_0x5c9543[_0x34a53b(0x1b6)]=0x3]=_0x34a53b(0x1b6),_0x5c9543[_0x5c9543[_0x34a53b(0x163)]=0x4]=_0x34a53b(0x163),_0x5c9543[_0x5c9543[_0x34a53b(0x19f)]=0x5]=_0x34a53b(0x19f),_0x5c9543[_0x5c9543['UNRECOGNIZED']=-0x1]=_0x34a53b(0x1d1),_0x5c9543))(v||{});const f=_0x1ec426=>c[_0x34a53b(0x19b)](new Date(+_0x1ec426))[_0x34a53b(0x1d6)](_0x34a53b(0x1dc)),R=async(_0x1e393f,_0x5e1e8a)=>{const _0x404f13=_0x34a53b,_0xd65b31=_0x1e393f['get'](c[_0x404f13(0x1d3)]),_0x26727c=_0x1e393f[_0x404f13(0x1ad)](P[_0x404f13(0x1bf)]);_0x5e1e8a[_0x404f13(0x179)](_0x391575=>{const _0x351ee2=_0x404f13;_0xd65b31[_0x351ee2(0x19d)](_0x391575)&&_0x5e1e8a[_0x351ee2(0x1d2)](_0x391575);}),_0x5e1e8a[_0x404f13(0x1ba)]&&(await _0x26727c['get'](_0x404f13(0x1d0),{'params':{'userIDs':[..._0x5e1e8a]}}))[_0x404f13(0x1a6)][_0x404f13(0x199)][_0x404f13(0x179)](_0x351bc8=>{const _0x39485f=_0x404f13;_0x351bc8&&_0xd65b31[_0x39485f(0x1bc)](_0x351bc8);});};var $=Object[_0x34a53b(0x166)],E=(_0xba76b4,_0x45c3a9,_0x237a64,_0x290552)=>{const _0x4eff37=_0x34a53b;for(var _0x12c65c=_0x290552>0x1?void 0x0:_0x290552?$(_0x45c3a9,_0x237a64):_0x45c3a9,_0x5457f4=_0xba76b4[_0x4eff37(0x19c)]-0x1,_0x1cba0c;_0x5457f4>=0x0;_0x5457f4--)(_0x1cba0c=_0xba76b4[_0x5457f4])&&(_0x12c65c=_0x1cba0c(_0x12c65c)||_0x12c65c);return _0x12c65c;},S=(_0x269cf9,_0x5183dd)=>(_0x42cb8d,_0x337a7d)=>_0x5183dd(_0x42cb8d,_0x337a7d,_0x269cf9);let p=class extends c['Disposable']{constructor(_0x38cb56,_0x1825d6,_0x448f3c,_0xa74a06){const _0x8f36c5=_0x34a53b;super(),this[_0x8f36c5(0x1cb)]=_0x38cb56,this[_0x8f36c5(0x16b)]=_0x1825d6,this[_0x8f36c5(0x1c4)]=_0x448f3c,this[_0x8f36c5(0x174)]=_0xa74a06,this[_0x8f36c5(0x1b9)](),this[_0x8f36c5(0x1d7)]();}[_0x34a53b(0x1d7)](){const _0x836cc1=_0x34a53b;this[_0x836cc1(0x1b4)](this[_0x836cc1(0x16b)][_0x836cc1(0x182)][_0x836cc1(0x195)](w['bufferTime'](0x10))['subscribe'](_0x37a039=>{const _0x102a4b=new Set();_0x37a039['forEach'](_0x504900=>{const _0x17492f=_0x22a2;switch(_0x504900['type']){case'add':{const _0x52cf49=_0x504900[_0x17492f(0x168)][_0x17492f(0x17d)];_0x102a4b[_0x17492f(0x1c2)](_0x52cf49);break;}}}),R(this['_injector'],_0x102a4b);}));}['_init'](){const _0x17437e=_0x34a53b;this[_0x17437e(0x1b4)](this['_commentService'][_0x17437e(0x182)][_0x17437e(0x196)](async _0x2bb1d3=>{const _0x36d9bd=_0x17437e;var _0x332b6d,_0x18cdca,_0x42073b,_0x1f9617;const _0x1c649e=(_0x332b6d=this[_0x36d9bd(0x16b)][_0x36d9bd(0x1c6)](_0x2bb1d3[_0x36d9bd(0x1c1)])[_0x36d9bd(0x1b2)](_0x519e6f=>_0x519e6f[_0x36d9bd(0x165)]===_0x2bb1d3[_0x36d9bd(0x165)]))==null?void 0x0:_0x332b6d['root'];if(!_0x1c649e)return;const {unitId:_0x99afab,subUnitId:_0x192a90}=_0x1c649e;switch(_0x2bb1d3[_0x36d9bd(0x1cf)]&&this[_0x36d9bd(0x1c4)][_0x36d9bd(0x1bc)](_0x2bb1d3[_0x36d9bd(0x1cf)]),_0x2bb1d3['type']){case v[_0x36d9bd(0x198)]:break;case v[_0x36d9bd(0x1c5)]:{this[_0x36d9bd(0x16b)]['addComment'](_0x99afab,_0x192a90,{'unitId':_0x99afab,'subUnitId':_0x192a90,'ref':'','id':_0x2bb1d3['replyId'],'dT':f(+_0x2bb1d3[_0x36d9bd(0x17e)]),'threadId':_0x2bb1d3[_0x36d9bd(0x165)],'personId':(_0x42073b=(_0x18cdca=_0x2bb1d3[_0x36d9bd(0x1cf)])==null?void 0x0:_0x18cdca['userID'])!=null?_0x42073b:_0x2bb1d3[_0x36d9bd(0x167)],'text':JSON['parse'](_0x2bb1d3[_0x36d9bd(0x18f)]),'parentId':_0x1c649e['id']});break;}case v[_0x36d9bd(0x163)]:{const _0x345eee=this['_threadCommentModel'][_0x36d9bd(0x1a4)](_0x99afab,_0x192a90,_0x2bb1d3[_0x36d9bd(0x1d4)]);_0x345eee&&_0x345eee[_0x36d9bd(0x1d8)]&&this[_0x36d9bd(0x16b)][_0x36d9bd(0x1b8)](_0x99afab,_0x192a90,_0x2bb1d3[_0x36d9bd(0x1d4)]);break;}case v[_0x36d9bd(0x1b6)]:{this['_threadCommentModel'][_0x36d9bd(0x1c8)](_0x99afab,_0x192a90,{'commentId':_0x2bb1d3[_0x36d9bd(0x1d4)],'text':JSON[_0x36d9bd(0x1b7)](_0x2bb1d3['content'])});break;}case v[_0x36d9bd(0x19f)]:{const _0x287280=(_0x1f9617=this['_threadCommentModel']['getUnit'](_0x2bb1d3[_0x36d9bd(0x1c1)])[_0x36d9bd(0x1b2)](_0x5d1ed0=>_0x5d1ed0['threadId']===_0x2bb1d3[_0x36d9bd(0x165)]))==null?void 0x0:_0x1f9617[_0x36d9bd(0x190)];_0x287280&&this[_0x36d9bd(0x16b)][_0x36d9bd(0x170)](_0x99afab,_0x192a90,_0x287280['id'],_0x2bb1d3['solved']===I['Solved']);break;}}}));}};p=E([S(0x0,c['Inject'](b[_0x34a53b(0x183)])),S(0x1,c[_0x34a53b(0x16c)](M['ThreadCommentModel'])),S(0x2,c['Inject'](c[_0x34a53b(0x1d3)])),S(0x3,c[_0x34a53b(0x16c)](c[_0x34a53b(0x1a0)]))],p);const q='thread-comment-data-source.config',D={};var A=Object[_0x34a53b(0x166)],x=(_0x3861e9,_0x14fdd3,_0x48328f,_0x782540)=>{const _0x4ad129=_0x34a53b;for(var _0x10d716=_0x782540>0x1?void 0x0:_0x782540?A(_0x14fdd3,_0x48328f):_0x14fdd3,_0x3dc176=_0x3861e9[_0x4ad129(0x19c)]-0x1,_0x365794;_0x3dc176>=0x0;_0x3dc176--)(_0x365794=_0x3861e9[_0x3dc176])&&(_0x10d716=_0x365794(_0x10d716)||_0x10d716);return _0x10d716;},_=(_0x397097,_0x2509ad)=>(_0x25a697,_0x42fef8)=>_0x2509ad(_0x25a697,_0x42fef8,_0x397097);function Y(_0x39ab67,_0x2397db){const _0xf0192c=_0x34a53b,_0x3fe88b=_0x39ab67[_0xf0192c(0x1ac)][0x0];return{..._0x2397db,'id':_0x3fe88b['replyId'],'resolved':_0x39ab67[_0xf0192c(0x17c)]===0x1,'dT':f(_0x3fe88b[_0xf0192c(0x17e)]),'personId':_0x3fe88b['userId'],'threadId':_0x3fe88b[_0xf0192c(0x165)]};}function G(_0x1bf186,_0x1b0abc,_0x15f371){const _0x52d0da=_0x34a53b;var _0xc88f27,_0x100ea7;if(((_0x100ea7=(_0xc88f27=_0x1bf186==null?void 0x0:_0x1bf186[_0x52d0da(0x1ac)])==null?void 0x0:_0xc88f27['length'])!=null?_0x100ea7:0x0)>0x0){const _0xaac768=(_0x479f0f,_0x5f4847)=>({'id':_0x479f0f[_0x52d0da(0x1d4)],'threadId':_0x479f0f[_0x52d0da(0x165)],'dT':f(_0x479f0f['createTimestamp']),'personId':_0x479f0f[_0x52d0da(0x167)],'resolved':_0x1bf186['solved']===I[_0x52d0da(0x18a)],'unitId':_0x1b0abc,'subUnitId':_0x15f371,'text':JSON[_0x52d0da(0x1b7)](_0x479f0f['content']),'parentId':_0x5f4847}),_0x47c82c=_0xaac768(_0x1bf186[_0x52d0da(0x1ac)][0x0]);return{..._0x47c82c,'children':_0x1bf186['replies']['slice'](0x1)[_0x52d0da(0x18c)](_0x45ba40=>_0xaac768(_0x45ba40,_0x47c82c['id']))};}return null;}let g=class{constructor(_0x34e34b,_0x3bd344,_0x113c68,_0x42fdba){const _0x4f520d=_0x34a53b;this['_httpService']=_0x34e34b,this['_userService']=_0x3bd344,this[_0x4f520d(0x1b0)]=_0x113c68,this[_0x4f520d(0x174)]=_0x42fdba;}async[_0x34a53b(0x1b3)](_0x4c92de){const _0x5b7093=_0x34a53b;var _0x22810b,_0x121767;const {parentId:_0x276c29,unitId:_0x56ed18,text:_0x50b391,threadId:_0x40024b}=_0x4c92de,_0x3921c5=(_0x121767=(_0x22810b=_0x50b391[_0x5b7093(0x188)])==null?void 0x0:_0x22810b[_0x5b7093(0x1bd)](_0x2936bb=>_0x2936bb[_0x5b7093(0x19a)]===c[_0x5b7093(0x175)][_0x5b7093(0x18e)])['map'](_0x3f2221=>_0x3f2221['rangeId']))!=null?_0x121767:[],_0x3141fe=JSON['stringify'](_0x50b391),_0x4fbbb9=(await this['_sessionService'][_0x5b7093(0x1ab)](_0x56ed18))[_0x5b7093(0x1ca)]();if(_0x276c29){const _0x24c260={'memberId':_0x4fbbb9,'unitId':_0x56ed18,'content':_0x3141fe,'mention':_0x3921c5,'threadId':_0x40024b},_0x3381ee=(await this['_httpService']['post'](_0x5b7093(0x18d)+_0x56ed18+'/reply',{'body':_0x24c260}))['body'][_0x5b7093(0x181)];return{..._0x4c92de,'id':_0x3381ee[_0x5b7093(0x1d4)],'dT':c['dayjs'](+_0x3381ee[_0x5b7093(0x17e)])[_0x5b7093(0x1d6)](_0x5b7093(0x1dc)),'personId':_0x3381ee['userId']};}else{const _0x594af7={'memberId':_0x4fbbb9,'unitId':_0x56ed18,'content':_0x3141fe,'mention':_0x3921c5},_0x1881f3=await this['_httpService'][_0x5b7093(0x1db)](_0x5b7093(0x18d)+_0x56ed18+'/add',{'body':_0x594af7});return Y(_0x1881f3['body'][_0x5b7093(0x1e0)],_0x4c92de);}}async[_0x34a53b(0x1c8)](_0x5be803){const _0xe4d43d=_0x34a53b;var _0xbeb391,_0x33bdfb;const {text:_0x5863d4,unitId:_0x485fe3}=_0x5be803,_0x282226=(_0x33bdfb=(_0xbeb391=_0x5863d4[_0xe4d43d(0x188)])==null?void 0x0:_0xbeb391[_0xe4d43d(0x1bd)](_0x1b03d7=>_0x1b03d7['rangeType']===c['CustomRangeType']['COMMENT'])['map'](_0x2e2c92=>_0x2e2c92[_0xe4d43d(0x1a1)]))!=null?_0x33bdfb:[],_0x1b8a3b=JSON[_0xe4d43d(0x1a8)](_0x5863d4),_0x2161e5=_0x5be803[_0xe4d43d(0x165)],_0x4bbb42=_0x5be803['id'],_0x4cfc7d={'memberId':(await this[_0xe4d43d(0x1b0)][_0xe4d43d(0x1ab)](_0x485fe3))[_0xe4d43d(0x1ca)](),'unitId':_0x485fe3,'threadId':_0x2161e5,'mention':_0x282226,'content':_0x1b8a3b,'replyId':_0x4bbb42},_0x5f5635=await this[_0xe4d43d(0x1c3)]['post'](_0xe4d43d(0x18d)+_0x485fe3+_0xe4d43d(0x1e1),{'body':_0x4cfc7d});return!_0x5f5635[_0xe4d43d(0x1a6)][_0xe4d43d(0x1b1)]||_0x5f5635[_0xe4d43d(0x1a6)][_0xe4d43d(0x1b1)][_0xe4d43d(0x1aa)]===0x1;}async['resolveComment'](_0x9b93e6){const _0x24c7ac=_0x34a53b,{unitId:_0x2920ca}=_0x9b93e6,_0x8f3052=_0x9b93e6[_0x24c7ac(0x165)],_0x51fc26={'memberId':this['_userService'][_0x24c7ac(0x1a2)]()[_0x24c7ac(0x1cc)],'unitId':_0x2920ca,'threadId':_0x8f3052,'solved':_0x9b93e6[_0x24c7ac(0x1b5)]?I['Solved']:I[_0x24c7ac(0x169)]},_0x45a187=await this[_0x24c7ac(0x1c3)][_0x24c7ac(0x1db)](_0x24c7ac(0x18d)+_0x2920ca+'/solved',{'body':_0x51fc26});return!_0x45a187['body'][_0x24c7ac(0x1b1)]||_0x45a187[_0x24c7ac(0x1a6)][_0x24c7ac(0x1b1)][_0x24c7ac(0x1aa)]===0x1;}async[_0x34a53b(0x1b8)](_0x3b232e,_0x22f9d9,_0x14e3ec,_0x5335c9){const _0x3f594b=_0x34a53b,_0x274e11={'memberId':(await this[_0x3f594b(0x1b0)][_0x3f594b(0x1ab)](_0x3b232e))['getMemberID'](),'threadId':_0x14e3ec,'replyId':_0x5335c9,'unitId':_0x3b232e},_0x11c1ed=await this[_0x3f594b(0x1c3)][_0x3f594b(0x1db)](_0x3f594b(0x18d)+_0x3b232e+_0x3f594b(0x164),{'body':_0x274e11});return!_0x11c1ed[_0x3f594b(0x1a6)]['error']||_0x11c1ed[_0x3f594b(0x1a6)]['error'][_0x3f594b(0x1aa)]===0x1;}async[_0x34a53b(0x1c9)](_0x2f2574,_0x511e99,_0x25872d){const _0x20ebf6=_0x34a53b,_0x3d60e6={'unitId':_0x2f2574,'threadId':_0x25872d},_0x140079=await this['_httpService'][_0x20ebf6(0x1db)](_0x20ebf6(0x18d)+_0x2f2574+_0x20ebf6(0x191),{'body':_0x3d60e6}),_0x557c75=_0x25872d[_0x20ebf6(0x18c)](_0x56f977=>G(_0x140079[_0x20ebf6(0x1a6)][_0x20ebf6(0x1be)][_0x56f977],_0x2f2574,_0x511e99))['filter'](Boolean);return Object[_0x20ebf6(0x176)](_0x140079[_0x20ebf6(0x1a6)][_0x20ebf6(0x199)])[_0x20ebf6(0x179)](_0x162af5=>{const _0x4024de=_0x20ebf6;this[_0x4024de(0x1c4)]['addUser'](_0x162af5);}),_0x557c75;}[_0x34a53b(0x1dd)](_0x204a98){const _0x4ece67=_0x34a53b;return{'id':_0x204a98['id'],'threadId':_0x204a98[_0x4ece67(0x165)],'ref':_0x204a98['ref']};}};g=x([_(0x0,c[_0x34a53b(0x16c)](P[_0x34a53b(0x1bf)])),_(0x1,c[_0x34a53b(0x16c)](c[_0x34a53b(0x1d3)])),_(0x2,c[_0x34a53b(0x16c)](b[_0x34a53b(0x192)])),_(0x3,c[_0x34a53b(0x16c)](c[_0x34a53b(0x1a0)]))],g);var H=Object[_0x34a53b(0x166)],J=(_0x412812,_0x495f7b,_0x2a3e65,_0x3f406c)=>{for(var _0x56d0a3=_0x3f406c>0x1?void 0x0:_0x3f406c?H(_0x495f7b,_0x2a3e65):_0x495f7b,_0xa4e2a5=_0x412812['length']-0x1,_0x4470ff;_0xa4e2a5>=0x0;_0xa4e2a5--)(_0x4470ff=_0x412812[_0xa4e2a5])&&(_0x56d0a3=_0x4470ff(_0x56d0a3)||_0x56d0a3);return _0x56d0a3;},y=(_0x386da9,_0x3c9e16)=>(_0x2b3e8a,_0x2c2fbb)=>_0x3c9e16(_0x2b3e8a,_0x2c2fbb,_0x386da9);let C=class extends c[_0x34a53b(0x177)]{constructor(_0x460397,_0x41d24f){const _0xbde7d7=_0x34a53b;super(),this['_threadCommentDataSourceService']=_0x460397,this['_threadCommentDataSource']=_0x41d24f,this[_0xbde7d7(0x1c0)]();}[_0x34a53b(0x1c0)](){const _0xf86d4e=_0x34a53b;this['_threadCommentDataSourceService'][_0xf86d4e(0x1d9)]=this[_0xf86d4e(0x1e2)],this[_0xf86d4e(0x1bb)][_0xf86d4e(0x193)]=!0x1;}};C=J([y(0x0,M[_0x34a53b(0x1c7)]),y(0x1,c['Inject'](g))],C);var F=Object[_0x34a53b(0x1d5)],L=Object[_0x34a53b(0x166)],Z=(_0x5e02e7,_0x38738e,_0x4e0e8a)=>_0x38738e in _0x5e02e7?F(_0x5e02e7,_0x38738e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4e0e8a}):_0x5e02e7[_0x38738e]=_0x4e0e8a,W=(_0x21e427,_0x4178ef,_0x561611,_0x4035a7)=>{const _0x3ab063=_0x34a53b;for(var _0x3e6f74=_0x4035a7>0x1?void 0x0:_0x4035a7?L(_0x4178ef,_0x561611):_0x4178ef,_0x5e3d28=_0x21e427[_0x3ab063(0x19c)]-0x1,_0x885d0d;_0x5e3d28>=0x0;_0x5e3d28--)(_0x885d0d=_0x21e427[_0x5e3d28])&&(_0x3e6f74=_0x885d0d(_0x3e6f74)||_0x3e6f74);return _0x3e6f74;},O=(_0x174acc,_0x570165)=>(_0x3d001f,_0x5077bd)=>_0x570165(_0x3d001f,_0x5077bd,_0x174acc),N=(_0x25203c,_0x28e261,_0x2a75e5)=>Z(_0x25203c,typeof _0x28e261!=_0x34a53b(0x1a9)?_0x28e261+'':_0x28e261,_0x2a75e5);exports[_0x34a53b(0x189)]=class extends c[_0x34a53b(0x17a)]{constructor(_0x2ea07d=D,_0x49b1ad,_0x5fb6d7){const _0x4913df=_0x34a53b;super(),this[_0x4913df(0x1ce)]=_0x2ea07d,this['_injector']=_0x49b1ad,this[_0x4913df(0x187)]=_0x5fb6d7;const {..._0x1eac5b}=c[_0x4913df(0x1a3)]({},D,this[_0x4913df(0x1ce)]);this[_0x4913df(0x187)]['setConfig'](q,_0x1eac5b);}[_0x34a53b(0x197)](){const _0x1a515e=_0x34a53b;[[g],[C],[p]][_0x1a515e(0x179)](_0x319360=>{const _0x3437be=_0x1a515e;this[_0x3437be(0x174)][_0x3437be(0x1c2)](_0x319360);});}[_0x34a53b(0x1da)](){const _0x9bcc71=_0x34a53b;this['_injector']['get'](C),this['_injector'][_0x9bcc71(0x1ad)](p);}},N(exports['UniverThreadCommentDataSourcePlugin'],'pluginName',U),N(exports[_0x34a53b(0x189)],_0x34a53b(0x184),c['UniverInstanceType'][_0x34a53b(0x19e)]),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x34a53b(0x1cd)](j[_0x34a53b(0x178)],b[_0x34a53b(0x180)],T['UniverLicensePlugin']),O(0x1,c[_0x34a53b(0x16c)](c[_0x34a53b(0x1a0)])),O(0x2,c['IConfigService'])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0x588ebe=_0x4453;(function(_0x1b26e3,_0x282bcf){const _0x5a62c5=_0x4453,_0x4ea96e=_0x1b26e3();while(!![]){try{const _0x5819dc=-parseInt(_0x5a62c5(0xc7))/0x1+parseInt(_0x5a62c5(0xd2))/0x2+parseInt(_0x5a62c5(0xe7))/0x3+parseInt(_0x5a62c5(0xc9))/0x4+parseInt(_0x5a62c5(0x95))/0x5+parseInt(_0x5a62c5(0x74))/0x6*(-parseInt(_0x5a62c5(0xa5))/0x7)+parseInt(_0x5a62c5(0xb0))/0x8*(-parseInt(_0x5a62c5(0xbb))/0x9);if(_0x5819dc===_0x282bcf)break;else _0x4ea96e['push'](_0x4ea96e['shift']());}catch(_0x546a4d){_0x4ea96e['push'](_0x4ea96e['shift']());}}}(_0x38b1,0xa32cf));Object[_0x588ebe(0xcd)](exports,Symbol['toStringTag'],{'value':_0x588ebe(0xd6)});const b=require(_0x588ebe(0xa8)),T=require(_0x588ebe(0x7b)),c=require(_0x588ebe(0x76)),j=require(_0x588ebe(0xbe)),M=require(_0x588ebe(0xe5)),w=require(_0x588ebe(0xa7)),P=require(_0x588ebe(0xcc)),U=_0x588ebe(0x77);function _0x4453(_0x5c3ccf,_0x7e319f){const _0x38b17b=_0x38b1();return _0x4453=function(_0x44536,_0xac7f3b){_0x44536=_0x44536-0x66;let _0x52845c=_0x38b17b[_0x44536];return _0x52845c;},_0x4453(_0x5c3ccf,_0x7e319f);}var I=(_0x4e2ba8=>(_0x4e2ba8[_0x4e2ba8[_0x588ebe(0x97)]=0x0]=_0x588ebe(0x97),_0x4e2ba8[_0x4e2ba8[_0x588ebe(0x84)]=0x1]=_0x588ebe(0x84),_0x4e2ba8[_0x4e2ba8['UNRECOGNIZED']=-0x1]=_0x588ebe(0x70),_0x4e2ba8))(I||{}),v=(_0x26f3d6=>(_0x26f3d6[_0x26f3d6[_0x588ebe(0x69)]=0x0]=_0x588ebe(0x69),_0x26f3d6[_0x26f3d6['Add']=0x1]=_0x588ebe(0xdc),_0x26f3d6[_0x26f3d6['Reply']=0x2]='Reply',_0x26f3d6[_0x26f3d6[_0x588ebe(0xc2)]=0x3]=_0x588ebe(0xc2),_0x26f3d6[_0x26f3d6[_0x588ebe(0xb1)]=0x4]='Delete',_0x26f3d6[_0x26f3d6[_0x588ebe(0x86)]=0x5]='Solve',_0x26f3d6[_0x26f3d6[_0x588ebe(0x70)]=-0x1]=_0x588ebe(0x70),_0x26f3d6))(v||{});const f=_0x415986=>c[_0x588ebe(0xba)](new Date(+_0x415986))['format'](_0x588ebe(0xdb)),R=async(_0x165d8e,_0x3a9554)=>{const _0x296b1f=_0x588ebe,_0x37acbb=_0x165d8e['get'](c[_0x296b1f(0x9b)]),_0x34c100=_0x165d8e[_0x296b1f(0xca)](P[_0x296b1f(0xc1)]);_0x3a9554[_0x296b1f(0x6f)](_0x4ba3d4=>{const _0x423f7c=_0x296b1f;_0x37acbb['getUser'](_0x4ba3d4)&&_0x3a9554[_0x423f7c(0xa3)](_0x4ba3d4);}),_0x3a9554[_0x296b1f(0xd0)]&&(await _0x34c100[_0x296b1f(0xca)]('/universer-api/user/list',{'params':{'userIDs':[..._0x3a9554]}}))[_0x296b1f(0xce)][_0x296b1f(0xb5)][_0x296b1f(0x6f)](_0x209b07=>{const _0x9cb877=_0x296b1f;_0x209b07&&_0x37acbb[_0x9cb877(0x96)](_0x209b07);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x4b75cf,_0x14cdf9,_0x18924a,_0x2a5351)=>{for(var _0x400ee4=_0x2a5351>0x1?void 0x0:_0x2a5351?$(_0x14cdf9,_0x18924a):_0x14cdf9,_0x3acf77=_0x4b75cf['length']-0x1,_0x488b88;_0x3acf77>=0x0;_0x3acf77--)(_0x488b88=_0x4b75cf[_0x3acf77])&&(_0x400ee4=_0x488b88(_0x400ee4)||_0x400ee4);return _0x400ee4;},S=(_0x535a50,_0x1263bc)=>(_0x22b249,_0x4e416e)=>_0x1263bc(_0x22b249,_0x4e416e,_0x535a50);let p=class extends c[_0x588ebe(0xc8)]{constructor(_0x87bdaa,_0x416a42,_0xd8c281,_0x2bfa25){const _0x318912=_0x588ebe;super(),this['_commentService']=_0x87bdaa,this[_0x318912(0xa1)]=_0x416a42,this[_0x318912(0xd9)]=_0xd8c281,this[_0x318912(0x9d)]=_0x2bfa25,this[_0x318912(0xc6)](),this['_initUserSync']();}[_0x588ebe(0x7e)](){const _0x1132b1=_0x588ebe;this[_0x1132b1(0xd5)](this[_0x1132b1(0xa1)]['commentUpdate$'][_0x1132b1(0x9f)](w[_0x1132b1(0x88)](0x10))['subscribe'](_0x53b44d=>{const _0x4a163c=_0x1132b1,_0x34d77d=new Set();_0x53b44d[_0x4a163c(0x6f)](_0x17fdc2=>{const _0x53f26b=_0x4a163c;switch(_0x17fdc2[_0x53f26b(0x90)]){case'add':{const _0x2c64e7=_0x17fdc2[_0x53f26b(0x8e)][_0x53f26b(0xa2)];_0x34d77d[_0x53f26b(0x83)](_0x2c64e7);break;}}}),R(this['_injector'],_0x34d77d);}));}[_0x588ebe(0xc6)](){const _0x1dc675=_0x588ebe;this[_0x1dc675(0xd5)](this[_0x1dc675(0x6b)][_0x1dc675(0x8b)][_0x1dc675(0x9c)](async _0x36faea=>{const _0x5e3fbf=_0x1dc675;var _0x5b7388,_0x22626d,_0x5bc60e,_0x540c08;const _0x47469e=(_0x5b7388=this[_0x5e3fbf(0xa1)][_0x5e3fbf(0x85)](_0x36faea[_0x5e3fbf(0xac)])[_0x5e3fbf(0xc4)](_0x4e0b9d=>_0x4e0b9d[_0x5e3fbf(0x9e)]===_0x36faea['threadId']))==null?void 0x0:_0x5b7388[_0x5e3fbf(0xb6)];if(!_0x47469e)return;const {unitId:_0x70bea8,subUnitId:_0x40f93a}=_0x47469e;switch(_0x36faea[_0x5e3fbf(0xaf)]&&this[_0x5e3fbf(0xd9)][_0x5e3fbf(0x96)](_0x36faea[_0x5e3fbf(0xaf)]),_0x36faea[_0x5e3fbf(0x90)]){case v['Add']:break;case v[_0x5e3fbf(0xd8)]:{this[_0x5e3fbf(0xa1)][_0x5e3fbf(0xd1)](_0x70bea8,_0x40f93a,{'unitId':_0x70bea8,'subUnitId':_0x40f93a,'ref':'','id':_0x36faea[_0x5e3fbf(0x94)],'dT':f(+_0x36faea[_0x5e3fbf(0xd4)]),'threadId':_0x36faea[_0x5e3fbf(0x9e)],'personId':(_0x5bc60e=(_0x22626d=_0x36faea[_0x5e3fbf(0xaf)])==null?void 0x0:_0x22626d[_0x5e3fbf(0xbf)])!=null?_0x5bc60e:_0x36faea[_0x5e3fbf(0xdd)],'text':JSON['parse'](_0x36faea[_0x5e3fbf(0xbd)]),'parentId':_0x47469e['id']});break;}case v[_0x5e3fbf(0xb1)]:{const _0x48163b=this[_0x5e3fbf(0xa1)][_0x5e3fbf(0xcf)](_0x70bea8,_0x40f93a,_0x36faea['replyId']);_0x48163b&&_0x48163b[_0x5e3fbf(0x87)]&&this[_0x5e3fbf(0xa1)][_0x5e3fbf(0xe1)](_0x70bea8,_0x40f93a,_0x36faea[_0x5e3fbf(0x94)]);break;}case v[_0x5e3fbf(0xc2)]:{this[_0x5e3fbf(0xa1)]['updateComment'](_0x70bea8,_0x40f93a,{'commentId':_0x36faea[_0x5e3fbf(0x94)],'text':JSON[_0x5e3fbf(0x92)](_0x36faea[_0x5e3fbf(0xbd)])});break;}case v[_0x5e3fbf(0x86)]:{const _0x1fdcb6=(_0x540c08=this[_0x5e3fbf(0xa1)]['getUnit'](_0x36faea['unitId'])[_0x5e3fbf(0xc4)](_0x1dd8ff=>_0x1dd8ff[_0x5e3fbf(0x9e)]===_0x36faea[_0x5e3fbf(0x9e)]))==null?void 0x0:_0x540c08[_0x5e3fbf(0xb6)];_0x1fdcb6&&this['_threadCommentModel'][_0x5e3fbf(0x73)](_0x70bea8,_0x40f93a,_0x1fdcb6['id'],_0x36faea['solved']===I['Solved']);break;}}}));}};p=E([S(0x0,c['Inject'](b[_0x588ebe(0x79)])),S(0x1,c[_0x588ebe(0xb8)](M[_0x588ebe(0xbc)])),S(0x2,c['Inject'](c['UserManagerService'])),S(0x3,c[_0x588ebe(0xb8)](c[_0x588ebe(0xa4)]))],p);const q=_0x588ebe(0x99),D={};function _0x38b1(){const _0x3aaf74=['unitId','_httpService','ref','user','460632wjyioD','Delete','map','reply','length','users','root','saveCommentToSnapshot','Inject','_threadCommentDataSourceService','dayjs','126RbdQHh','ThreadCommentModel','content','@univerjs/thread-comment-ui','userID','syncUpdateMutationToColla','HTTPService','Edit','stringify','find','/solved','_init','861183jQynnH','Disposable','2879476WaxIAd','get','getOwnPropertyDescriptor','@univerjs/network','defineProperty','body','getComment','size','addComment','1346760DjbxQU','setConfig','createTimestamp','disposeWithMe','Module','code','Reply','_userService','UniverLicensePlugin','YYYY/MM/DD\x20HH:mm','Add','userId','filter','error','customRanges','deleteComment','UniverThreadCommentUIPlugin','resolved','slice','@univerjs/thread-comment','_sessionService','283113cgRkoV','UNIVER_UNKNOWN','updateComment','merge','onReady','Unknown','/list','_commentService','getMemberID','replies','UniverThreadCommentDataSourcePlugin','forEach','UNRECOGNIZED','CustomRangeType','dataSource','resolveComment','390YpBZkJ','solved','@univerjs/core','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','getCurrentUser','CommentService','_config','@univerjs-pro/license','_threadCommentDataSource','onStarting','_initUserSync','/universer-api/comment/unit/','_initDataSource','UniverInstanceType','Plugin','add','Solved','getUnit','Solve','parentId','bufferTime','DependentOn','rangeType','commentUpdate$','IConfigService','comments','payload','_configService','type','IThreadCommentDataSourceService','parse','/reply','replyId','5027005HpwUCi','addUser','OpenOrReOpen','comment','thread-comment-data-source.config','COMMENT','UserManagerService','subscribe','_injector','threadId','pipe','pluginName','_threadCommentModel','personId','delete','Injector','16947dohZQk','UniverCollaborationClientPlugin','rxjs','@univerjs-pro/collaboration-client','format','/add','post'];_0x38b1=function(){return _0x3aaf74;};return _0x38b1();}var A=Object[_0x588ebe(0xcb)],x=(_0x3add89,_0x28e5df,_0x3a29c6,_0x3529ed)=>{for(var _0x569efb=_0x3529ed>0x1?void 0x0:_0x3529ed?A(_0x28e5df,_0x3a29c6):_0x28e5df,_0x3feb76=_0x3add89['length']-0x1,_0x588548;_0x3feb76>=0x0;_0x3feb76--)(_0x588548=_0x3add89[_0x3feb76])&&(_0x569efb=_0x588548(_0x569efb)||_0x569efb);return _0x569efb;},_=(_0x496b09,_0xc9157b)=>(_0x43f90f,_0x4bf5c0)=>_0xc9157b(_0x43f90f,_0x4bf5c0,_0x496b09);function Y(_0x5c1752,_0x262721){const _0x309f2d=_0x588ebe,_0x20dd18=_0x5c1752['replies'][0x0];return{..._0x262721,'id':_0x20dd18[_0x309f2d(0x94)],'resolved':_0x5c1752[_0x309f2d(0x75)]===0x1,'dT':f(_0x20dd18[_0x309f2d(0xd4)]),'personId':_0x20dd18[_0x309f2d(0xdd)],'threadId':_0x20dd18['threadId']};}function G(_0x26aa7b,_0x594217,_0x49e656){const _0xb292e0=_0x588ebe;var _0x2a9b78,_0x935e43;if(((_0x935e43=(_0x2a9b78=_0x26aa7b==null?void 0x0:_0x26aa7b[_0xb292e0(0x6d)])==null?void 0x0:_0x2a9b78[_0xb292e0(0xb4)])!=null?_0x935e43:0x0)>0x0){const _0x4fc694=(_0x10aa47,_0x49c4e5)=>({'id':_0x10aa47[_0xb292e0(0x94)],'threadId':_0x10aa47[_0xb292e0(0x9e)],'dT':f(_0x10aa47[_0xb292e0(0xd4)]),'personId':_0x10aa47[_0xb292e0(0xdd)],'resolved':_0x26aa7b['solved']===I['Solved'],'unitId':_0x594217,'subUnitId':_0x49e656,'text':JSON[_0xb292e0(0x92)](_0x10aa47['content']),'parentId':_0x49c4e5}),_0x4ae3d0=_0x4fc694(_0x26aa7b[_0xb292e0(0x6d)][0x0]);return{..._0x4ae3d0,'children':_0x26aa7b[_0xb292e0(0x6d)][_0xb292e0(0xe4)](0x1)[_0xb292e0(0xb2)](_0x252c5e=>_0x4fc694(_0x252c5e,_0x4ae3d0['id']))};}return null;}let g=class{constructor(_0x532c7f,_0x4c5e2a,_0x3a069f,_0x5e0f6e){const _0x3faaa1=_0x588ebe;this[_0x3faaa1(0xad)]=_0x532c7f,this[_0x3faaa1(0xd9)]=_0x4c5e2a,this[_0x3faaa1(0xe6)]=_0x3a069f,this[_0x3faaa1(0x9d)]=_0x5e0f6e;}async[_0x588ebe(0xd1)](_0x105458){const _0x20578f=_0x588ebe;var _0x26062f,_0x1b67d0;const {parentId:_0x3f21d3,unitId:_0x18bdf2,text:_0x230829,threadId:_0x4936fc}=_0x105458,_0x359f1c=(_0x1b67d0=(_0x26062f=_0x230829['customRanges'])==null?void 0x0:_0x26062f[_0x20578f(0xde)](_0xee861b=>_0xee861b[_0x20578f(0x8a)]===c['CustomRangeType'][_0x20578f(0x9a)])[_0x20578f(0xb2)](_0x1daa85=>_0x1daa85['rangeId']))!=null?_0x1b67d0:[],_0x3ec544=JSON[_0x20578f(0xc3)](_0x230829),_0x494ce2=(await this['_sessionService']['requireSession'](_0x18bdf2))[_0x20578f(0x6c)]();if(_0x3f21d3){const _0x37a387={'memberId':_0x494ce2,'unitId':_0x18bdf2,'content':_0x3ec544,'mention':_0x359f1c,'threadId':_0x4936fc},_0x52e5bc=(await this['_httpService']['post'](_0x20578f(0x7f)+_0x18bdf2+_0x20578f(0x93),{'body':_0x37a387}))[_0x20578f(0xce)][_0x20578f(0xb3)];return{..._0x105458,'id':_0x52e5bc['replyId'],'dT':c[_0x20578f(0xba)](+_0x52e5bc[_0x20578f(0xd4)])[_0x20578f(0xa9)](_0x20578f(0xdb)),'personId':_0x52e5bc['userId']};}else{const _0x3f29c2={'memberId':_0x494ce2,'unitId':_0x18bdf2,'content':_0x3ec544,'mention':_0x359f1c},_0x25b6f0=await this[_0x20578f(0xad)][_0x20578f(0xab)](_0x20578f(0x7f)+_0x18bdf2+_0x20578f(0xaa),{'body':_0x3f29c2});return Y(_0x25b6f0[_0x20578f(0xce)][_0x20578f(0x98)],_0x105458);}}async[_0x588ebe(0x66)](_0x16c6e1){const _0x38bf09=_0x588ebe;var _0x485c7a,_0x2c29f6;const {text:_0x1fcac6,unitId:_0x30c0c8}=_0x16c6e1,_0x52bfeb=(_0x2c29f6=(_0x485c7a=_0x1fcac6[_0x38bf09(0xe0)])==null?void 0x0:_0x485c7a['filter'](_0x2d1998=>_0x2d1998[_0x38bf09(0x8a)]===c[_0x38bf09(0x71)][_0x38bf09(0x9a)])[_0x38bf09(0xb2)](_0x2f8744=>_0x2f8744['rangeId']))!=null?_0x2c29f6:[],_0x9cba72=JSON['stringify'](_0x1fcac6),_0x144b21=_0x16c6e1[_0x38bf09(0x9e)],_0x440eb8=_0x16c6e1['id'],_0x4791d1={'memberId':(await this[_0x38bf09(0xe6)]['requireSession'](_0x30c0c8))[_0x38bf09(0x6c)](),'unitId':_0x30c0c8,'threadId':_0x144b21,'mention':_0x52bfeb,'content':_0x9cba72,'replyId':_0x440eb8},_0x3a7c11=await this['_httpService'][_0x38bf09(0xab)](_0x38bf09(0x7f)+_0x30c0c8+'/edit',{'body':_0x4791d1});return!_0x3a7c11[_0x38bf09(0xce)][_0x38bf09(0xdf)]||_0x3a7c11['body'][_0x38bf09(0xdf)][_0x38bf09(0xd7)]===0x1;}async[_0x588ebe(0x73)](_0x431c33){const _0x9a293c=_0x588ebe,{unitId:_0x462d41}=_0x431c33,_0x59cf0a=_0x431c33[_0x9a293c(0x9e)],_0x4e2c8d={'memberId':this[_0x9a293c(0xd9)][_0x9a293c(0x78)]()['userID'],'unitId':_0x462d41,'threadId':_0x59cf0a,'solved':_0x431c33[_0x9a293c(0xe3)]?I['Solved']:I[_0x9a293c(0x97)]},_0x5857bd=await this[_0x9a293c(0xad)][_0x9a293c(0xab)](_0x9a293c(0x7f)+_0x462d41+_0x9a293c(0xc5),{'body':_0x4e2c8d});return!_0x5857bd[_0x9a293c(0xce)][_0x9a293c(0xdf)]||_0x5857bd[_0x9a293c(0xce)]['error'][_0x9a293c(0xd7)]===0x1;}async[_0x588ebe(0xe1)](_0x1f3267,_0x384497,_0x555856,_0x2693c9){const _0x413ca2=_0x588ebe,_0x4e2cea={'memberId':(await this[_0x413ca2(0xe6)]['requireSession'](_0x1f3267))[_0x413ca2(0x6c)](),'threadId':_0x555856,'replyId':_0x2693c9,'unitId':_0x1f3267},_0x26a223=await this[_0x413ca2(0xad)][_0x413ca2(0xab)]('/universer-api/comment/unit/'+_0x1f3267+'/delete',{'body':_0x4e2cea});return!_0x26a223[_0x413ca2(0xce)][_0x413ca2(0xdf)]||_0x26a223[_0x413ca2(0xce)][_0x413ca2(0xdf)][_0x413ca2(0xd7)]===0x1;}async['listComments'](_0x1ff5dd,_0xa70cf8,_0x48bb25){const _0xbe0e05=_0x588ebe,_0x481894={'unitId':_0x1ff5dd,'threadId':_0x48bb25},_0x10aa69=await this[_0xbe0e05(0xad)][_0xbe0e05(0xab)](_0xbe0e05(0x7f)+_0x1ff5dd+_0xbe0e05(0x6a),{'body':_0x481894}),_0x4691ad=_0x48bb25['map'](_0x37d9d0=>G(_0x10aa69[_0xbe0e05(0xce)][_0xbe0e05(0x8d)][_0x37d9d0],_0x1ff5dd,_0xa70cf8))['filter'](Boolean);return Object['values'](_0x10aa69['body'][_0xbe0e05(0xb5)])[_0xbe0e05(0x6f)](_0x197c04=>{const _0x5e1978=_0xbe0e05;this[_0x5e1978(0xd9)][_0x5e1978(0x96)](_0x197c04);}),_0x4691ad;}[_0x588ebe(0xb7)](_0x3f225f){const _0x31d037=_0x588ebe;return{'id':_0x3f225f['id'],'threadId':_0x3f225f[_0x31d037(0x9e)],'ref':_0x3f225f[_0x31d037(0xae)]};}};g=x([_(0x0,c[_0x588ebe(0xb8)](P['HTTPService'])),_(0x1,c[_0x588ebe(0xb8)](c[_0x588ebe(0x9b)])),_(0x2,c[_0x588ebe(0xb8)](b['CollaborationSessionService'])),_(0x3,c['Inject'](c['Injector']))],g);var H=Object[_0x588ebe(0xcb)],J=(_0xa9998e,_0x5ad9ff,_0x316dd1,_0x5b71b2)=>{const _0xb31b5=_0x588ebe;for(var _0x300de9=_0x5b71b2>0x1?void 0x0:_0x5b71b2?H(_0x5ad9ff,_0x316dd1):_0x5ad9ff,_0x58dfd3=_0xa9998e[_0xb31b5(0xb4)]-0x1,_0xd978a8;_0x58dfd3>=0x0;_0x58dfd3--)(_0xd978a8=_0xa9998e[_0x58dfd3])&&(_0x300de9=_0xd978a8(_0x300de9)||_0x300de9);return _0x300de9;},y=(_0x19d6ab,_0x3a5426)=>(_0x404c4e,_0x201ba4)=>_0x3a5426(_0x404c4e,_0x201ba4,_0x19d6ab);let C=class extends c['Disposable']{constructor(_0x1b7e14,_0x10de43){const _0x2e0736=_0x588ebe;super(),this['_threadCommentDataSourceService']=_0x1b7e14,this[_0x2e0736(0x7c)]=_0x10de43,this[_0x2e0736(0x80)]();}[_0x588ebe(0x80)](){const _0xe4d7b6=_0x588ebe;this[_0xe4d7b6(0xb9)][_0xe4d7b6(0x72)]=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0xe4d7b6(0xc0)]=!0x1;}};C=J([y(0x0,M[_0x588ebe(0x91)]),y(0x1,c['Inject'](g))],C);var F=Object['defineProperty'],L=Object[_0x588ebe(0xcb)],Z=(_0x343ad8,_0x354d76,_0x46ad6a)=>_0x354d76 in _0x343ad8?F(_0x343ad8,_0x354d76,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x46ad6a}):_0x343ad8[_0x354d76]=_0x46ad6a,W=(_0x16cc39,_0x501cc8,_0x340f30,_0x28bc83)=>{for(var _0x67d02=_0x28bc83>0x1?void 0x0:_0x28bc83?L(_0x501cc8,_0x340f30):_0x501cc8,_0x304ade=_0x16cc39['length']-0x1,_0x535761;_0x304ade>=0x0;_0x304ade--)(_0x535761=_0x16cc39[_0x304ade])&&(_0x67d02=_0x535761(_0x67d02)||_0x67d02);return _0x67d02;},O=(_0x83089c,_0x2835ed)=>(_0x39a071,_0x3c4ab3)=>_0x2835ed(_0x39a071,_0x3c4ab3,_0x83089c),N=(_0x4c224b,_0xcae11,_0x49fbe2)=>Z(_0x4c224b,typeof _0xcae11!='symbol'?_0xcae11+'':_0xcae11,_0x49fbe2);exports[_0x588ebe(0x6e)]=class extends c[_0x588ebe(0x82)]{constructor(_0x9ec111=D,_0x2fc8f4,_0x256fe7){const _0x5986e4=_0x588ebe;super(),this[_0x5986e4(0x7a)]=_0x9ec111,this[_0x5986e4(0x9d)]=_0x2fc8f4,this['_configService']=_0x256fe7;const {..._0x475427}=c[_0x5986e4(0x67)]({},D,this[_0x5986e4(0x7a)]);this[_0x5986e4(0x8f)][_0x5986e4(0xd3)](q,_0x475427);}[_0x588ebe(0x7d)](){const _0x12d6ab=_0x588ebe;[[g],[C],[p]][_0x12d6ab(0x6f)](_0x1997a5=>{const _0x214cd8=_0x12d6ab;this[_0x214cd8(0x9d)][_0x214cd8(0x83)](_0x1997a5);});}[_0x588ebe(0x68)](){const _0x27c84f=_0x588ebe;this[_0x27c84f(0x9d)][_0x27c84f(0xca)](C),this[_0x27c84f(0x9d)]['get'](p);}},N(exports[_0x588ebe(0x6e)],_0x588ebe(0xa0),U),N(exports[_0x588ebe(0x6e)],_0x588ebe(0x90),c[_0x588ebe(0x81)][_0x588ebe(0xe8)]),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x588ebe(0x89)](j[_0x588ebe(0xe2)],b[_0x588ebe(0xa6)],T[_0x588ebe(0xda)]),O(0x1,c[_0x588ebe(0xb8)](c[_0x588ebe(0xa4)])),O(0x2,c[_0x588ebe(0x8c)])],exports['UniverThreadCommentDataSourcePlugin']);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3f65dc=_0x1b87;(function(_0x2eebca,_0x4d8f1a){const _0x501c6e=_0x1b87,_0x376dd0=_0x2eebca();while(!![]){try{const _0x3b715d=-parseInt(_0x501c6e(0xb7))/0x1*(parseInt(_0x501c6e(0xb3))/0x2)+-parseInt(_0x501c6e(0x8d))/0x3*(parseInt(_0x501c6e(0x91))/0x4)+parseInt(_0x501c6e(0xa8))/0x5*(parseInt(_0x501c6e(0xbd))/0x6)+parseInt(_0x501c6e(0xae))/0x7+-parseInt(_0x501c6e(0xb2))/0x8+parseInt(_0x501c6e(0x9b))/0x9*(parseInt(_0x501c6e(0x87))/0xa)+parseInt(_0x501c6e(0xd0))/0xb;if(_0x3b715d===_0x4d8f1a)break;else _0x376dd0['push'](_0x376dd0['shift']());}catch(_0x3fe6e8){_0x376dd0['push'](_0x376dd0['shift']());}}}(_0x933f,0xd712f));import{CommentService as _0x4e8277,CollaborationSessionService as _0x297513,UniverCollaborationClientPlugin as _0x1d1044}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x2b808a}from'@univerjs-pro/license';import{dayjs as _0x4dba82,UserManagerService as _0x4a347c,Inject as _0x5a3cc0,Injector as _0x586636,Disposable as _0x15abc7,CustomRangeType as _0x75605a,UniverInstanceType as _0x540bcc,DependentOn as _0x198243,IConfigService as _0x9c33e2,Plugin as _0x35636d,merge as _0x28edfe}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0xa83693}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x16d3aa,IThreadCommentDataSourceService as _0x583b3b}from'@univerjs/thread-comment';import{bufferTime as _0x34729a}from'rxjs';import{HTTPService as _0x56daef}from'@univerjs/network';const W=_0x3f65dc(0xb6);var I=(_0x45ca4e=>(_0x45ca4e[_0x45ca4e[_0x3f65dc(0x96)]=0x0]=_0x3f65dc(0x96),_0x45ca4e[_0x45ca4e['Solved']=0x1]='Solved',_0x45ca4e[_0x45ca4e['UNRECOGNIZED']=-0x1]=_0x3f65dc(0xc4),_0x45ca4e))(I||{}),v=(_0x3d9b7a=>(_0x3d9b7a[_0x3d9b7a['Unknown']=0x0]=_0x3f65dc(0xad),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xc6)]=0x1]=_0x3f65dc(0xc6),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xaa)]=0x2]='Reply',_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xa4)]=0x3]='Edit',_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0x80)]=0x4]=_0x3f65dc(0x80),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0x9a)]=0x5]=_0x3f65dc(0x9a),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xc4)]=-0x1]='UNRECOGNIZED',_0x3d9b7a))(v||{});const D=_0x368464=>_0x4dba82(new Date(+_0x368464))['format']('YYYY/MM/DD\x20HH:mm'),B=async(_0x514b8a,_0x51a389)=>{const _0x5891a1=_0x3f65dc,_0x44b0e9=_0x514b8a[_0x5891a1(0x89)](_0x4a347c),_0x292657=_0x514b8a[_0x5891a1(0x89)](_0x56daef);_0x51a389[_0x5891a1(0xca)](_0x36fdba=>{const _0x3591b6=_0x5891a1;_0x44b0e9['getUser'](_0x36fdba)&&_0x51a389[_0x3591b6(0xb4)](_0x36fdba);}),_0x51a389['size']&&(await _0x292657['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x51a389]}}))[_0x5891a1(0xac)][_0x5891a1(0xc9)]['forEach'](_0x3f2d6a=>{const _0x1f1a36=_0x5891a1;_0x3f2d6a&&_0x44b0e9[_0x1f1a36(0x84)](_0x3f2d6a);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x4a3263,_0x289f5f,_0x383df6,_0x268a3e)=>{const _0x5c740c=_0x3f65dc;for(var _0x28bc95=_0x268a3e>0x1?void 0x0:_0x268a3e?K(_0x289f5f,_0x383df6):_0x289f5f,_0x46a932=_0x4a3263[_0x5c740c(0xa2)]-0x1,_0xd35ac5;_0x46a932>=0x0;_0x46a932--)(_0xd35ac5=_0x4a3263[_0x46a932])&&(_0x28bc95=_0xd35ac5(_0x28bc95)||_0x28bc95);return _0x28bc95;},p=(_0x4e6043,_0xffda6c)=>(_0xebf80e,_0x3f44da)=>_0xffda6c(_0xebf80e,_0x3f44da,_0x4e6043);let S=class extends _0x15abc7{constructor(_0x59df53,_0x20f120,_0x3a606e,_0xd33cf2){const _0x35572f=_0x3f65dc;super(),this[_0x35572f(0x98)]=_0x59df53,this[_0x35572f(0x81)]=_0x20f120,this[_0x35572f(0x93)]=_0x3a606e,this[_0x35572f(0xbe)]=_0xd33cf2,this[_0x35572f(0x92)](),this[_0x35572f(0xd5)]();}[_0x3f65dc(0xd5)](){const _0x11a043=_0x3f65dc;this['disposeWithMe'](this[_0x11a043(0x81)][_0x11a043(0x7f)]['pipe'](_0x34729a(0x10))[_0x11a043(0x8e)](_0xd2e8e3=>{const _0x2fb9ab=_0x11a043,_0x3c1666=new Set();_0xd2e8e3[_0x2fb9ab(0xca)](_0x4bd0ff=>{const _0x443b34=_0x2fb9ab;switch(_0x4bd0ff[_0x443b34(0x7d)]){case _0x443b34(0x9d):{const _0x492d14=_0x4bd0ff[_0x443b34(0xd8)]['personId'];_0x3c1666['add'](_0x492d14);break;}}}),B(this[_0x2fb9ab(0xbe)],_0x3c1666);}));}[_0x3f65dc(0x92)](){const _0x4120a3=_0x3f65dc;this['disposeWithMe'](this[_0x4120a3(0x98)][_0x4120a3(0x7f)]['subscribe'](async _0x1be419=>{const _0x3c3dcf=_0x4120a3;var _0x3158c3,_0x5ae47c,_0x1c4e13,_0x48f645;const _0x69fa01=(_0x3158c3=this[_0x3c3dcf(0x81)]['getUnit'](_0x1be419[_0x3c3dcf(0xcb)])[_0x3c3dcf(0x9e)](_0x27ac39=>_0x27ac39[_0x3c3dcf(0xaf)]===_0x1be419[_0x3c3dcf(0xaf)]))==null?void 0x0:_0x3158c3[_0x3c3dcf(0xbf)];if(!_0x69fa01)return;const {unitId:_0x20b2c2,subUnitId:_0x306813}=_0x69fa01;switch(_0x1be419[_0x3c3dcf(0xdc)]&&this[_0x3c3dcf(0x93)][_0x3c3dcf(0x84)](_0x1be419[_0x3c3dcf(0xdc)]),_0x1be419[_0x3c3dcf(0x7d)]){case v[_0x3c3dcf(0xc6)]:break;case v[_0x3c3dcf(0xaa)]:{this[_0x3c3dcf(0x81)][_0x3c3dcf(0xba)](_0x20b2c2,_0x306813,{'unitId':_0x20b2c2,'subUnitId':_0x306813,'ref':'','id':_0x1be419[_0x3c3dcf(0x7e)],'dT':D(+_0x1be419['createTimestamp']),'threadId':_0x1be419[_0x3c3dcf(0xaf)],'personId':(_0x1c4e13=(_0x5ae47c=_0x1be419[_0x3c3dcf(0xdc)])==null?void 0x0:_0x5ae47c[_0x3c3dcf(0xc1)])!=null?_0x1c4e13:_0x1be419[_0x3c3dcf(0x9c)],'text':JSON[_0x3c3dcf(0xa6)](_0x1be419[_0x3c3dcf(0xb1)]),'parentId':_0x69fa01['id']});break;}case v['Delete']:{const _0x4f91f6=this[_0x3c3dcf(0x81)][_0x3c3dcf(0x99)](_0x20b2c2,_0x306813,_0x1be419[_0x3c3dcf(0x7e)]);_0x4f91f6&&_0x4f91f6[_0x3c3dcf(0x8f)]&&this['_threadCommentModel'][_0x3c3dcf(0xd9)](_0x20b2c2,_0x306813,_0x1be419[_0x3c3dcf(0x7e)]);break;}case v[_0x3c3dcf(0xa4)]:{this[_0x3c3dcf(0x81)][_0x3c3dcf(0xce)](_0x20b2c2,_0x306813,{'commentId':_0x1be419[_0x3c3dcf(0x7e)],'text':JSON[_0x3c3dcf(0xa6)](_0x1be419['content'])});break;}case v['Solve']:{const _0x575465=(_0x48f645=this[_0x3c3dcf(0x81)][_0x3c3dcf(0xc0)](_0x1be419['unitId'])['find'](_0x5bd2f6=>_0x5bd2f6[_0x3c3dcf(0xaf)]===_0x1be419[_0x3c3dcf(0xaf)]))==null?void 0x0:_0x48f645[_0x3c3dcf(0xbf)];_0x575465&&this[_0x3c3dcf(0x81)][_0x3c3dcf(0xb5)](_0x20b2c2,_0x306813,_0x575465['id'],_0x1be419['solved']===I[_0x3c3dcf(0x97)]);break;}}}));}};S=V([p(0x0,_0x5a3cc0(_0x4e8277)),p(0x1,_0x5a3cc0(_0x16d3aa)),p(0x2,_0x5a3cc0(_0x4a347c)),p(0x3,_0x5a3cc0(_0x586636))],S);function _0x1b87(_0x555f8d,_0x432197){const _0x933f27=_0x933f();return _0x1b87=function(_0x1b877c,_0x288ef3){_0x1b877c=_0x1b877c-0x7c;let _0x5c1046=_0x933f27[_0x1b877c];return _0x5c1046;},_0x1b87(_0x555f8d,_0x432197);}const z='thread-comment-data-source.config',M={};var k=Object[_0x3f65dc(0xc7)],Q=(_0x21732a,_0x2e29a7,_0x33273d,_0x55e9b6)=>{const _0x1fccd6=_0x3f65dc;for(var _0x5d9f05=_0x55e9b6>0x1?void 0x0:_0x55e9b6?k(_0x2e29a7,_0x33273d):_0x2e29a7,_0x3a757a=_0x21732a[_0x1fccd6(0xa2)]-0x1,_0x4a0006;_0x3a757a>=0x0;_0x3a757a--)(_0x4a0006=_0x21732a[_0x3a757a])&&(_0x5d9f05=_0x4a0006(_0x5d9f05)||_0x5d9f05);return _0x5d9f05;},_=(_0x2b2822,_0x531f27)=>(_0x33ac76,_0x5cd9e9)=>_0x531f27(_0x33ac76,_0x5cd9e9,_0x2b2822);function X(_0xebd592,_0xf03185){const _0x44a2fd=_0x3f65dc,_0x2b1f06=_0xebd592[_0x44a2fd(0x90)][0x0];return{..._0xf03185,'id':_0x2b1f06['replyId'],'resolved':_0xebd592[_0x44a2fd(0xbc)]===0x1,'dT':D(_0x2b1f06[_0x44a2fd(0xdb)]),'personId':_0x2b1f06[_0x44a2fd(0x9c)],'threadId':_0x2b1f06['threadId']};}function ee(_0x4bbe2d,_0xfd903f,_0x581471){const _0x5abdb4=_0x3f65dc;var _0x438c0f,_0x2caa14;if(((_0x2caa14=(_0x438c0f=_0x4bbe2d==null?void 0x0:_0x4bbe2d['replies'])==null?void 0x0:_0x438c0f[_0x5abdb4(0xa2)])!=null?_0x2caa14:0x0)>0x0){const _0x29b1b5=(_0x13574b,_0x57ea26)=>({'id':_0x13574b['replyId'],'threadId':_0x13574b[_0x5abdb4(0xaf)],'dT':D(_0x13574b[_0x5abdb4(0xdb)]),'personId':_0x13574b['userId'],'resolved':_0x4bbe2d[_0x5abdb4(0xbc)]===I[_0x5abdb4(0x97)],'unitId':_0xfd903f,'subUnitId':_0x581471,'text':JSON['parse'](_0x13574b[_0x5abdb4(0xb1)]),'parentId':_0x57ea26}),_0x5ce5e2=_0x29b1b5(_0x4bbe2d[_0x5abdb4(0x90)][0x0]);return{..._0x5ce5e2,'children':_0x4bbe2d[_0x5abdb4(0x90)][_0x5abdb4(0xb9)](0x1)[_0x5abdb4(0xd7)](_0x303bd2=>_0x29b1b5(_0x303bd2,_0x5ce5e2['id']))};}return null;}let f=class{constructor(_0x1b8051,_0x2e1f9b,_0x301101,_0x10dc58){const _0x53c74a=_0x3f65dc;this[_0x53c74a(0xa1)]=_0x1b8051,this[_0x53c74a(0x93)]=_0x2e1f9b,this[_0x53c74a(0xa0)]=_0x301101,this[_0x53c74a(0xbe)]=_0x10dc58;}async['addComment'](_0x16ff55){const _0x8cb064=_0x3f65dc;var _0x376c11,_0x5bcb4c;const {parentId:_0x13f15b,unitId:_0x331063,text:_0x1d8724,threadId:_0x23c76e}=_0x16ff55,_0x2b5c07=(_0x5bcb4c=(_0x376c11=_0x1d8724[_0x8cb064(0xc5)])==null?void 0x0:_0x376c11[_0x8cb064(0xa3)](_0x4d5b88=>_0x4d5b88[_0x8cb064(0xd6)]===_0x75605a[_0x8cb064(0x86)])['map'](_0x16d79e=>_0x16d79e[_0x8cb064(0xc8)]))!=null?_0x5bcb4c:[],_0x2395a4=JSON[_0x8cb064(0x8c)](_0x1d8724),_0x1a2a5a=(await this[_0x8cb064(0xa0)][_0x8cb064(0xab)](_0x331063))[_0x8cb064(0xcf)]();if(_0x13f15b){const _0x1fd983={'memberId':_0x1a2a5a,'unitId':_0x331063,'content':_0x2395a4,'mention':_0x2b5c07,'threadId':_0x23c76e},_0x337800=(await this[_0x8cb064(0xa1)][_0x8cb064(0x9f)](_0x8cb064(0xc2)+_0x331063+_0x8cb064(0x88),{'body':_0x1fd983}))[_0x8cb064(0xac)]['reply'];return{..._0x16ff55,'id':_0x337800['replyId'],'dT':_0x4dba82(+_0x337800[_0x8cb064(0xdb)])[_0x8cb064(0xda)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x337800[_0x8cb064(0x9c)]};}else{const _0x59c53f={'memberId':_0x1a2a5a,'unitId':_0x331063,'content':_0x2395a4,'mention':_0x2b5c07},_0xe9740b=await this[_0x8cb064(0xa1)][_0x8cb064(0x9f)](_0x8cb064(0xc2)+_0x331063+_0x8cb064(0x8b),{'body':_0x59c53f});return X(_0xe9740b[_0x8cb064(0xac)][_0x8cb064(0x7c)],_0x16ff55);}}async[_0x3f65dc(0xce)](_0x505ec6){const _0x956209=_0x3f65dc;var _0x11c17d,_0x28acde;const {text:_0x569088,unitId:_0x8c456f}=_0x505ec6,_0xd7bf38=(_0x28acde=(_0x11c17d=_0x569088[_0x956209(0xc5)])==null?void 0x0:_0x11c17d['filter'](_0x3d24bb=>_0x3d24bb[_0x956209(0xd6)]===_0x75605a[_0x956209(0x86)])['map'](_0x496253=>_0x496253[_0x956209(0xc8)]))!=null?_0x28acde:[],_0x4d4ca7=JSON[_0x956209(0x8c)](_0x569088),_0x4a7713=_0x505ec6[_0x956209(0xaf)],_0x2fe1af=_0x505ec6['id'],_0x4db005={'memberId':(await this[_0x956209(0xa0)][_0x956209(0xab)](_0x8c456f))[_0x956209(0xcf)](),'unitId':_0x8c456f,'threadId':_0x4a7713,'mention':_0xd7bf38,'content':_0x4d4ca7,'replyId':_0x2fe1af},_0x256380=await this['_httpService'][_0x956209(0x9f)](_0x956209(0xc2)+_0x8c456f+_0x956209(0x82),{'body':_0x4db005});return!_0x256380[_0x956209(0xac)][_0x956209(0xcc)]||_0x256380[_0x956209(0xac)][_0x956209(0xcc)][_0x956209(0xa7)]===0x1;}async['resolveComment'](_0x2d46b0){const _0x23b1db=_0x3f65dc,{unitId:_0x1bfc92}=_0x2d46b0,_0x1b76c6=_0x2d46b0['threadId'],_0x5b9c67={'memberId':this[_0x23b1db(0x93)][_0x23b1db(0x85)]()[_0x23b1db(0xc1)],'unitId':_0x1bfc92,'threadId':_0x1b76c6,'solved':_0x2d46b0['resolved']?I[_0x23b1db(0x97)]:I[_0x23b1db(0x96)]},_0x4751c8=await this[_0x23b1db(0xa1)][_0x23b1db(0x9f)](_0x23b1db(0xc2)+_0x1bfc92+_0x23b1db(0xcd),{'body':_0x5b9c67});return!_0x4751c8[_0x23b1db(0xac)][_0x23b1db(0xcc)]||_0x4751c8[_0x23b1db(0xac)]['error'][_0x23b1db(0xa7)]===0x1;}async[_0x3f65dc(0xd9)](_0x18664e,_0x59d31c,_0x49a4c7,_0x28bb3f){const _0x298c89=_0x3f65dc,_0x458720={'memberId':(await this[_0x298c89(0xa0)][_0x298c89(0xab)](_0x18664e))[_0x298c89(0xcf)](),'threadId':_0x49a4c7,'replyId':_0x28bb3f,'unitId':_0x18664e},_0x5c862a=await this[_0x298c89(0xa1)][_0x298c89(0x9f)](_0x298c89(0xc2)+_0x18664e+'/delete',{'body':_0x458720});return!_0x5c862a['body'][_0x298c89(0xcc)]||_0x5c862a[_0x298c89(0xac)][_0x298c89(0xcc)]['code']===0x1;}async[_0x3f65dc(0xa5)](_0x142a43,_0x4f9d87,_0x3b63fa){const _0x1da215=_0x3f65dc,_0x415e96={'unitId':_0x142a43,'threadId':_0x3b63fa},_0x19cab2=await this[_0x1da215(0xa1)]['post'](_0x1da215(0xc2)+_0x142a43+'/list',{'body':_0x415e96}),_0x1709a3=_0x3b63fa['map'](_0x3d65f0=>ee(_0x19cab2[_0x1da215(0xac)]['comments'][_0x3d65f0],_0x142a43,_0x4f9d87))[_0x1da215(0xa3)](Boolean);return Object[_0x1da215(0xbb)](_0x19cab2[_0x1da215(0xac)][_0x1da215(0xc9)])[_0x1da215(0xca)](_0x3e93c7=>{const _0x4518b2=_0x1da215;this[_0x4518b2(0x93)]['addUser'](_0x3e93c7);}),_0x1709a3;}['saveCommentToSnapshot'](_0x33f4ac){const _0x2787f0=_0x3f65dc;return{'id':_0x33f4ac['id'],'threadId':_0x33f4ac[_0x2787f0(0xaf)],'ref':_0x33f4ac[_0x2787f0(0xb8)]};}};f=Q([_(0x0,_0x5a3cc0(_0x56daef)),_(0x1,_0x5a3cc0(_0x4a347c)),_(0x2,_0x5a3cc0(_0x297513)),_(0x3,_0x5a3cc0(_0x586636))],f);var re=Object[_0x3f65dc(0xc7)],te=(_0x1f02a6,_0x31523b,_0x573dc6,_0x2e3337)=>{for(var _0xd3b881=_0x2e3337>0x1?void 0x0:_0x2e3337?re(_0x31523b,_0x573dc6):_0x31523b,_0x4cfef5=_0x1f02a6['length']-0x1,_0x1bd58f;_0x4cfef5>=0x0;_0x4cfef5--)(_0x1bd58f=_0x1f02a6[_0x4cfef5])&&(_0xd3b881=_0x1bd58f(_0xd3b881)||_0xd3b881);return _0xd3b881;},N=(_0x278038,_0x513f23)=>(_0x9f1e38,_0x5a6f9c)=>_0x513f23(_0x9f1e38,_0x5a6f9c,_0x278038);let g=class extends _0x15abc7{constructor(_0x22cb04,_0x2a6def){const _0x2f8160=_0x3f65dc;super(),this[_0x2f8160(0xb0)]=_0x22cb04,this[_0x2f8160(0xd2)]=_0x2a6def,this['_initDataSource']();}[_0x3f65dc(0xd4)](){const _0x185908=_0x3f65dc;this['_threadCommentDataSourceService']['dataSource']=this[_0x185908(0xd2)],this[_0x185908(0xb0)][_0x185908(0x8a)]=!0x1;}};g=te([N(0x0,_0x583b3b),N(0x1,_0x5a3cc0(f))],g);function _0x933f(){const _0x5f2001=['pluginName','_config','OpenOrReOpen','Solved','_commentService','getComment','Solve','1432152DbPUtU','userId','add','find','post','_sessionService','_httpService','length','filter','Edit','listComments','parse','code','37685JCVUIh','_configService','Reply','requireSession','body','Unknown','1390193iBkbEl','threadId','_threadCommentDataSourceService','content','10220800JxmvWq','4686abFnZw','delete','resolveComment','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','356VPZWdL','ref','slice','addComment','values','solved','408VxTYcB','_injector','root','getUnit','userID','/universer-api/comment/unit/','onStarting','UNRECOGNIZED','customRanges','Add','getOwnPropertyDescriptor','rangeId','users','forEach','unitId','error','/solved','updateComment','getMemberID','22565059BHwSBN','defineProperty','_threadCommentDataSource','symbol','_initDataSource','_initUserSync','rangeType','map','payload','deleteComment','format','createTimestamp','user','comment','type','replyId','commentUpdate$','Delete','_threadCommentModel','/edit','onReady','addUser','getCurrentUser','COMMENT','20BqOyXg','/reply','get','syncUpdateMutationToColla','/add','stringify','264267KQOyiW','subscribe','parentId','replies','4OuqGGw','_init','_userService'];_0x933f=function(){return _0x5f2001;};return _0x933f();}var se=Object[_0x3f65dc(0xd1)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x48bc4f,_0x2ce6cb,_0x6b5b9e)=>_0x2ce6cb in _0x48bc4f?se(_0x48bc4f,_0x2ce6cb,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x6b5b9e}):_0x48bc4f[_0x2ce6cb]=_0x6b5b9e,ie=(_0x3dab41,_0x4244d6,_0x41c226,_0x36f7f3)=>{const _0x5f055d=_0x3f65dc;for(var _0x3283a8=_0x36f7f3>0x1?void 0x0:_0x36f7f3?oe(_0x4244d6,_0x41c226):_0x4244d6,_0x307a81=_0x3dab41[_0x5f055d(0xa2)]-0x1,_0x1d8401;_0x307a81>=0x0;_0x307a81--)(_0x1d8401=_0x3dab41[_0x307a81])&&(_0x3283a8=_0x1d8401(_0x3283a8)||_0x3283a8);return _0x3283a8;},w=(_0x5d80f2,_0x297e65)=>(_0x5864ec,_0x263ffb)=>_0x297e65(_0x5864ec,_0x263ffb,_0x5d80f2),$=(_0x3a54f7,_0x33dd14,_0x283cdd)=>ne(_0x3a54f7,typeof _0x33dd14!=_0x3f65dc(0xd3)?_0x33dd14+'':_0x33dd14,_0x283cdd);let b=class extends _0x35636d{constructor(_0xb8f067=M,_0x5cda24,_0x16cbeb){const _0x52e439=_0x3f65dc;super(),this['_config']=_0xb8f067,this['_injector']=_0x5cda24,this['_configService']=_0x16cbeb;const {..._0x4dcc0e}=_0x28edfe({},M,this[_0x52e439(0x95)]);this[_0x52e439(0xa9)]['setConfig'](z,_0x4dcc0e);}[_0x3f65dc(0xc3)](){const _0x573a55=_0x3f65dc;[[f],[g],[S]][_0x573a55(0xca)](_0x3089ce=>{this['_injector']['add'](_0x3089ce);});}[_0x3f65dc(0x83)](){const _0x2e3266=_0x3f65dc;this['_injector'][_0x2e3266(0x89)](g),this[_0x2e3266(0xbe)][_0x2e3266(0x89)](S);}};$(b,_0x3f65dc(0x94),W),$(b,_0x3f65dc(0x7d),_0x540bcc['UNIVER_UNKNOWN']),b=ie([_0x198243(_0xa83693,_0x1d1044,_0x2b808a),w(0x1,_0x5a3cc0(_0x586636)),w(0x2,_0x9c33e2)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x166c12=_0x10f6;(function(_0x1a6a5e,_0x24319e){const _0x2e1f0c=_0x10f6,_0xdc54c=_0x1a6a5e();while(!![]){try{const _0x30adae=-parseInt(_0x2e1f0c(0x196))/0x1+parseInt(_0x2e1f0c(0x1f3))/0x2*(parseInt(_0x2e1f0c(0x19a))/0x3)+-parseInt(_0x2e1f0c(0x1ce))/0x4+-parseInt(_0x2e1f0c(0x1a6))/0x5+parseInt(_0x2e1f0c(0x1aa))/0x6+-parseInt(_0x2e1f0c(0x19b))/0x7*(-parseInt(_0x2e1f0c(0x1e7))/0x8)+parseInt(_0x2e1f0c(0x1de))/0x9;if(_0x30adae===_0x24319e)break;else _0xdc54c['push'](_0xdc54c['shift']());}catch(_0x5e5e95){_0xdc54c['push'](_0xdc54c['shift']());}}}(_0x3b23,0xacab1));import{CommentService as _0x25df25,CollaborationSessionService as _0x1cbde6,UniverCollaborationClientPlugin as _0x4b2720}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x1bfdd1}from'@univerjs-pro/license';import{dayjs as _0x3cecb5,UserManagerService as _0xc83dbe,Inject as _0x8fdc81,Injector as _0x37caba,Disposable as _0x18908b,CustomRangeType as _0xf7bfe6,UniverInstanceType as _0x4acfe4,DependentOn as _0x648336,IConfigService as _0x4f6915,Plugin as _0x2b8ea1,merge as _0x984593}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x3a2862}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2fa9d4,IThreadCommentDataSourceService as _0x360ed4}from'@univerjs/thread-comment';function _0x3b23(){const _0x11dc9c=['onReady','user','/universer-api/comment/unit/','addComment','254682RxgyPF','getOwnPropertyDescriptor','Unknown','Solved','18boxwqC','105oewPtB','deleteComment','saveCommentToSnapshot','/solved','comments','error','Edit','slice','customRanges','filter','_sessionService','4760075PzwSIl','_userService','setConfig','find','251904PJVoka','replies','reply','length','addUser','Solve','syncUpdateMutationToColla','Reply','defineProperty','COMMENT','resolved','_threadCommentDataSource','pluginName','_configService','userID','thread-comment-data-source.config','parse','replyId','forEach','_httpService','pipe','subscribe','users','_init','dataSource','unitId','symbol','_threadCommentModel','Delete','_initUserSync','content','/list','get','parentId','Add','threadId','4843388LFUyRx','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','getComment','values','root','body','requireSession','rangeId','solved','_injector','type','code','_threadCommentDataSourceService','getUser','format','OpenOrReOpen','11679363tWsTKq','getUnit','stringify','listComments','_config','_commentService','delete','updateComment','/reply','488416kMvqye','onStarting','post','userId','/universer-api/user/list','personId','map','resolveComment','ref','getMemberID','commentUpdate$','getCurrentUser','289774kogfea','createTimestamp','disposeWithMe','size','rangeType','UNRECOGNIZED','YYYY/MM/DD\x20HH:mm','_initDataSource'];_0x3b23=function(){return _0x11dc9c;};return _0x3b23();}import{bufferTime as _0x51f2cb}from'rxjs';import{HTTPService as _0x57fadc}from'@univerjs/network';const W=_0x166c12(0x1cf);var I=(_0x3b6987=>(_0x3b6987[_0x3b6987[_0x166c12(0x1dd)]=0x0]=_0x166c12(0x1dd),_0x3b6987[_0x3b6987['Solved']=0x1]=_0x166c12(0x199),_0x3b6987[_0x3b6987[_0x166c12(0x1f8)]=-0x1]=_0x166c12(0x1f8),_0x3b6987))(I||{}),v=(_0x5855b0=>(_0x5855b0[_0x5855b0[_0x166c12(0x198)]=0x0]=_0x166c12(0x198),_0x5855b0[_0x5855b0['Add']=0x1]=_0x166c12(0x1cc),_0x5855b0[_0x5855b0[_0x166c12(0x1b1)]=0x2]=_0x166c12(0x1b1),_0x5855b0[_0x5855b0[_0x166c12(0x1a1)]=0x3]='Edit',_0x5855b0[_0x5855b0[_0x166c12(0x1c6)]=0x4]=_0x166c12(0x1c6),_0x5855b0[_0x5855b0['Solve']=0x5]=_0x166c12(0x1af),_0x5855b0[_0x5855b0[_0x166c12(0x1f8)]=-0x1]=_0x166c12(0x1f8),_0x5855b0))(v||{});const D=_0x3cd454=>_0x3cecb5(new Date(+_0x3cd454))[_0x166c12(0x1dc)](_0x166c12(0x1f9)),B=async(_0x36e145,_0xb19bb2)=>{const _0x43792d=_0x166c12,_0x4553f7=_0x36e145[_0x43792d(0x1ca)](_0xc83dbe),_0x5a2ed8=_0x36e145[_0x43792d(0x1ca)](_0x57fadc);_0xb19bb2[_0x43792d(0x1bc)](_0x9aba20=>{const _0x2c17f0=_0x43792d;_0x4553f7[_0x2c17f0(0x1db)](_0x9aba20)&&_0xb19bb2[_0x2c17f0(0x1e4)](_0x9aba20);}),_0xb19bb2[_0x43792d(0x1f6)]&&(await _0x5a2ed8[_0x43792d(0x1ca)](_0x43792d(0x1eb),{'params':{'userIDs':[..._0xb19bb2]}}))['body'][_0x43792d(0x1c0)][_0x43792d(0x1bc)](_0x1fa17e=>{const _0x2c68b1=_0x43792d;_0x1fa17e&&_0x4553f7[_0x2c68b1(0x1ae)](_0x1fa17e);});};var K=Object[_0x166c12(0x197)],V=(_0x4d23cd,_0xa427dc,_0x48082a,_0x1c2e22)=>{const _0x2d02d5=_0x166c12;for(var _0x21a7ca=_0x1c2e22>0x1?void 0x0:_0x1c2e22?K(_0xa427dc,_0x48082a):_0xa427dc,_0x10936c=_0x4d23cd[_0x2d02d5(0x1ad)]-0x1,_0x453bbb;_0x10936c>=0x0;_0x10936c--)(_0x453bbb=_0x4d23cd[_0x10936c])&&(_0x21a7ca=_0x453bbb(_0x21a7ca)||_0x21a7ca);return _0x21a7ca;},p=(_0x55630d,_0x37a088)=>(_0x155671,_0x396802)=>_0x37a088(_0x155671,_0x396802,_0x55630d);let S=class extends _0x18908b{constructor(_0x29a138,_0x2106e2,_0x4fcc7e,_0x251864){const _0x3e0b62=_0x166c12;super(),this[_0x3e0b62(0x1e3)]=_0x29a138,this[_0x3e0b62(0x1c5)]=_0x2106e2,this[_0x3e0b62(0x1a7)]=_0x4fcc7e,this[_0x3e0b62(0x1d7)]=_0x251864,this[_0x3e0b62(0x1c1)](),this[_0x3e0b62(0x1c7)]();}[_0x166c12(0x1c7)](){const _0x2c8663=_0x166c12;this['disposeWithMe'](this['_threadCommentModel']['commentUpdate$'][_0x2c8663(0x1be)](_0x51f2cb(0x10))[_0x2c8663(0x1bf)](_0x50bb92=>{const _0x38242d=_0x2c8663,_0x3b47f0=new Set();_0x50bb92[_0x38242d(0x1bc)](_0x7709b4=>{const _0x43aef5=_0x38242d;switch(_0x7709b4[_0x43aef5(0x1d8)]){case'add':{const _0x3f9fa3=_0x7709b4['payload'][_0x43aef5(0x1ec)];_0x3b47f0['add'](_0x3f9fa3);break;}}}),B(this[_0x38242d(0x1d7)],_0x3b47f0);}));}[_0x166c12(0x1c1)](){const _0x24e48e=_0x166c12;this[_0x24e48e(0x1f5)](this[_0x24e48e(0x1e3)][_0x24e48e(0x1f1)][_0x24e48e(0x1bf)](async _0x4f670f=>{const _0x2b94df=_0x24e48e;var _0x46d6ed,_0x5cd8a7,_0x3e5c43,_0x63985b;const _0x887d46=(_0x46d6ed=this[_0x2b94df(0x1c5)][_0x2b94df(0x1df)](_0x4f670f[_0x2b94df(0x1c3)])[_0x2b94df(0x1a9)](_0x47934d=>_0x47934d[_0x2b94df(0x1cd)]===_0x4f670f[_0x2b94df(0x1cd)]))==null?void 0x0:_0x46d6ed[_0x2b94df(0x1d2)];if(!_0x887d46)return;const {unitId:_0x30791d,subUnitId:_0x11c418}=_0x887d46;switch(_0x4f670f['user']&&this['_userService'][_0x2b94df(0x1ae)](_0x4f670f['user']),_0x4f670f['type']){case v[_0x2b94df(0x1cc)]:break;case v['Reply']:{this[_0x2b94df(0x1c5)]['addComment'](_0x30791d,_0x11c418,{'unitId':_0x30791d,'subUnitId':_0x11c418,'ref':'','id':_0x4f670f[_0x2b94df(0x1bb)],'dT':D(+_0x4f670f[_0x2b94df(0x1f4)]),'threadId':_0x4f670f[_0x2b94df(0x1cd)],'personId':(_0x3e5c43=(_0x5cd8a7=_0x4f670f[_0x2b94df(0x193)])==null?void 0x0:_0x5cd8a7[_0x2b94df(0x1b8)])!=null?_0x3e5c43:_0x4f670f['userId'],'text':JSON[_0x2b94df(0x1ba)](_0x4f670f[_0x2b94df(0x1c8)]),'parentId':_0x887d46['id']});break;}case v['Delete']:{const _0x352c5b=this[_0x2b94df(0x1c5)][_0x2b94df(0x1d0)](_0x30791d,_0x11c418,_0x4f670f[_0x2b94df(0x1bb)]);_0x352c5b&&_0x352c5b[_0x2b94df(0x1cb)]&&this[_0x2b94df(0x1c5)][_0x2b94df(0x19c)](_0x30791d,_0x11c418,_0x4f670f[_0x2b94df(0x1bb)]);break;}case v[_0x2b94df(0x1a1)]:{this['_threadCommentModel'][_0x2b94df(0x1e5)](_0x30791d,_0x11c418,{'commentId':_0x4f670f[_0x2b94df(0x1bb)],'text':JSON[_0x2b94df(0x1ba)](_0x4f670f['content'])});break;}case v['Solve']:{const _0x349091=(_0x63985b=this[_0x2b94df(0x1c5)]['getUnit'](_0x4f670f[_0x2b94df(0x1c3)])[_0x2b94df(0x1a9)](_0x2e22bd=>_0x2e22bd[_0x2b94df(0x1cd)]===_0x4f670f['threadId']))==null?void 0x0:_0x63985b[_0x2b94df(0x1d2)];_0x349091&&this['_threadCommentModel']['resolveComment'](_0x30791d,_0x11c418,_0x349091['id'],_0x4f670f[_0x2b94df(0x1d6)]===I['Solved']);break;}}}));}};S=V([p(0x0,_0x8fdc81(_0x25df25)),p(0x1,_0x8fdc81(_0x2fa9d4)),p(0x2,_0x8fdc81(_0xc83dbe)),p(0x3,_0x8fdc81(_0x37caba))],S);const z=_0x166c12(0x1b9),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x236902,_0x351f7f,_0x1e3934,_0x4045e9)=>{const _0x5c55fa=_0x166c12;for(var _0x25ab4e=_0x4045e9>0x1?void 0x0:_0x4045e9?k(_0x351f7f,_0x1e3934):_0x351f7f,_0x2683be=_0x236902[_0x5c55fa(0x1ad)]-0x1,_0x31e114;_0x2683be>=0x0;_0x2683be--)(_0x31e114=_0x236902[_0x2683be])&&(_0x25ab4e=_0x31e114(_0x25ab4e)||_0x25ab4e);return _0x25ab4e;},_=(_0x125859,_0x5f2eb7)=>(_0x2f76a9,_0x281263)=>_0x5f2eb7(_0x2f76a9,_0x281263,_0x125859);function X(_0x3b08f7,_0x13f5a3){const _0x3183d8=_0x166c12,_0x37241b=_0x3b08f7['replies'][0x0];return{..._0x13f5a3,'id':_0x37241b[_0x3183d8(0x1bb)],'resolved':_0x3b08f7[_0x3183d8(0x1d6)]===0x1,'dT':D(_0x37241b['createTimestamp']),'personId':_0x37241b['userId'],'threadId':_0x37241b[_0x3183d8(0x1cd)]};}function ee(_0x39875d,_0x446a43,_0x730daf){const _0x196f1b=_0x166c12;var _0x4b5366,_0x5b39d7;if(((_0x5b39d7=(_0x4b5366=_0x39875d==null?void 0x0:_0x39875d[_0x196f1b(0x1ab)])==null?void 0x0:_0x4b5366[_0x196f1b(0x1ad)])!=null?_0x5b39d7:0x0)>0x0){const _0x3aaf1a=(_0x3fdef4,_0x1f6668)=>({'id':_0x3fdef4[_0x196f1b(0x1bb)],'threadId':_0x3fdef4[_0x196f1b(0x1cd)],'dT':D(_0x3fdef4[_0x196f1b(0x1f4)]),'personId':_0x3fdef4[_0x196f1b(0x1ea)],'resolved':_0x39875d[_0x196f1b(0x1d6)]===I[_0x196f1b(0x199)],'unitId':_0x446a43,'subUnitId':_0x730daf,'text':JSON[_0x196f1b(0x1ba)](_0x3fdef4[_0x196f1b(0x1c8)]),'parentId':_0x1f6668}),_0x4de25=_0x3aaf1a(_0x39875d[_0x196f1b(0x1ab)][0x0]);return{..._0x4de25,'children':_0x39875d[_0x196f1b(0x1ab)][_0x196f1b(0x1a2)](0x1)[_0x196f1b(0x1ed)](_0x2bda2d=>_0x3aaf1a(_0x2bda2d,_0x4de25['id']))};}return null;}let f=class{constructor(_0x7acca5,_0x3cc23d,_0x252b3e,_0x3160aa){this['_httpService']=_0x7acca5,this['_userService']=_0x3cc23d,this['_sessionService']=_0x252b3e,this['_injector']=_0x3160aa;}async[_0x166c12(0x195)](_0x13047e){const _0x3e8564=_0x166c12;var _0x295c93,_0x223f4f;const {parentId:_0x593255,unitId:_0x404c6d,text:_0x4134fe,threadId:_0xf7c514}=_0x13047e,_0x2f09a9=(_0x223f4f=(_0x295c93=_0x4134fe['customRanges'])==null?void 0x0:_0x295c93[_0x3e8564(0x1a4)](_0x1462bd=>_0x1462bd[_0x3e8564(0x1f7)]===_0xf7bfe6[_0x3e8564(0x1b3)])['map'](_0x4e0a3c=>_0x4e0a3c[_0x3e8564(0x1d5)]))!=null?_0x223f4f:[],_0x2338d5=JSON['stringify'](_0x4134fe),_0x42ad00=(await this[_0x3e8564(0x1a5)][_0x3e8564(0x1d4)](_0x404c6d))[_0x3e8564(0x1f0)]();if(_0x593255){const _0x88937f={'memberId':_0x42ad00,'unitId':_0x404c6d,'content':_0x2338d5,'mention':_0x2f09a9,'threadId':_0xf7c514},_0x46636e=(await this[_0x3e8564(0x1bd)]['post'](_0x3e8564(0x194)+_0x404c6d+_0x3e8564(0x1e6),{'body':_0x88937f}))[_0x3e8564(0x1d3)][_0x3e8564(0x1ac)];return{..._0x13047e,'id':_0x46636e[_0x3e8564(0x1bb)],'dT':_0x3cecb5(+_0x46636e[_0x3e8564(0x1f4)])[_0x3e8564(0x1dc)](_0x3e8564(0x1f9)),'personId':_0x46636e['userId']};}else{const _0x3484fa={'memberId':_0x42ad00,'unitId':_0x404c6d,'content':_0x2338d5,'mention':_0x2f09a9},_0x359bdb=await this[_0x3e8564(0x1bd)][_0x3e8564(0x1e9)](_0x3e8564(0x194)+_0x404c6d+'/add',{'body':_0x3484fa});return X(_0x359bdb[_0x3e8564(0x1d3)]['comment'],_0x13047e);}}async[_0x166c12(0x1e5)](_0xb7e253){const _0x1d18a8=_0x166c12;var _0x2a10f0,_0x41f84c;const {text:_0x261ae8,unitId:_0x2c0912}=_0xb7e253,_0x4e98b7=(_0x41f84c=(_0x2a10f0=_0x261ae8[_0x1d18a8(0x1a3)])==null?void 0x0:_0x2a10f0[_0x1d18a8(0x1a4)](_0x4b9621=>_0x4b9621[_0x1d18a8(0x1f7)]===_0xf7bfe6[_0x1d18a8(0x1b3)])[_0x1d18a8(0x1ed)](_0x51d2ef=>_0x51d2ef[_0x1d18a8(0x1d5)]))!=null?_0x41f84c:[],_0x1a323f=JSON[_0x1d18a8(0x1e0)](_0x261ae8),_0x2f4aa7=_0xb7e253[_0x1d18a8(0x1cd)],_0xf016b6=_0xb7e253['id'],_0xaab2ff={'memberId':(await this[_0x1d18a8(0x1a5)][_0x1d18a8(0x1d4)](_0x2c0912))['getMemberID'](),'unitId':_0x2c0912,'threadId':_0x2f4aa7,'mention':_0x4e98b7,'content':_0x1a323f,'replyId':_0xf016b6},_0x451c78=await this[_0x1d18a8(0x1bd)]['post'](_0x1d18a8(0x194)+_0x2c0912+'/edit',{'body':_0xaab2ff});return!_0x451c78[_0x1d18a8(0x1d3)][_0x1d18a8(0x1a0)]||_0x451c78[_0x1d18a8(0x1d3)]['error']['code']===0x1;}async[_0x166c12(0x1ee)](_0x2406e4){const _0x20bb96=_0x166c12,{unitId:_0x35fd9b}=_0x2406e4,_0x20540d=_0x2406e4[_0x20bb96(0x1cd)],_0x402c96={'memberId':this[_0x20bb96(0x1a7)][_0x20bb96(0x1f2)]()['userID'],'unitId':_0x35fd9b,'threadId':_0x20540d,'solved':_0x2406e4[_0x20bb96(0x1b4)]?I[_0x20bb96(0x199)]:I[_0x20bb96(0x1dd)]},_0x4cb16d=await this['_httpService'][_0x20bb96(0x1e9)]('/universer-api/comment/unit/'+_0x35fd9b+_0x20bb96(0x19e),{'body':_0x402c96});return!_0x4cb16d[_0x20bb96(0x1d3)][_0x20bb96(0x1a0)]||_0x4cb16d[_0x20bb96(0x1d3)][_0x20bb96(0x1a0)]['code']===0x1;}async[_0x166c12(0x19c)](_0x4124e3,_0x28a65b,_0xe062f3,_0x5548bd){const _0x57a811=_0x166c12,_0x47a5a0={'memberId':(await this[_0x57a811(0x1a5)][_0x57a811(0x1d4)](_0x4124e3))[_0x57a811(0x1f0)](),'threadId':_0xe062f3,'replyId':_0x5548bd,'unitId':_0x4124e3},_0x16c1c5=await this[_0x57a811(0x1bd)][_0x57a811(0x1e9)](_0x57a811(0x194)+_0x4124e3+'/delete',{'body':_0x47a5a0});return!_0x16c1c5[_0x57a811(0x1d3)]['error']||_0x16c1c5[_0x57a811(0x1d3)][_0x57a811(0x1a0)][_0x57a811(0x1d9)]===0x1;}async[_0x166c12(0x1e1)](_0x3ade55,_0x2746f5,_0x40018a){const _0x35bb43=_0x166c12,_0x18ff18={'unitId':_0x3ade55,'threadId':_0x40018a},_0x599aef=await this[_0x35bb43(0x1bd)][_0x35bb43(0x1e9)](_0x35bb43(0x194)+_0x3ade55+_0x35bb43(0x1c9),{'body':_0x18ff18}),_0x5485d8=_0x40018a['map'](_0x5a5e72=>ee(_0x599aef[_0x35bb43(0x1d3)][_0x35bb43(0x19f)][_0x5a5e72],_0x3ade55,_0x2746f5))[_0x35bb43(0x1a4)](Boolean);return Object[_0x35bb43(0x1d1)](_0x599aef['body'][_0x35bb43(0x1c0)])[_0x35bb43(0x1bc)](_0x649fec=>{const _0x1748d4=_0x35bb43;this[_0x1748d4(0x1a7)]['addUser'](_0x649fec);}),_0x5485d8;}[_0x166c12(0x19d)](_0x26b0fb){const _0xc11efc=_0x166c12;return{'id':_0x26b0fb['id'],'threadId':_0x26b0fb['threadId'],'ref':_0x26b0fb[_0xc11efc(0x1ef)]};}};f=Q([_(0x0,_0x8fdc81(_0x57fadc)),_(0x1,_0x8fdc81(_0xc83dbe)),_(0x2,_0x8fdc81(_0x1cbde6)),_(0x3,_0x8fdc81(_0x37caba))],f);function _0x10f6(_0x2bd15d,_0x137b0f){const _0x3b23c0=_0x3b23();return _0x10f6=function(_0x10f67c,_0xbc0d10){_0x10f67c=_0x10f67c-0x191;let _0x50d7b3=_0x3b23c0[_0x10f67c];return _0x50d7b3;},_0x10f6(_0x2bd15d,_0x137b0f);}var re=Object[_0x166c12(0x197)],te=(_0x291ffd,_0x10ef46,_0x2a468e,_0x1bbc9a)=>{const _0x5b87ed=_0x166c12;for(var _0xd0ef29=_0x1bbc9a>0x1?void 0x0:_0x1bbc9a?re(_0x10ef46,_0x2a468e):_0x10ef46,_0x14e5f6=_0x291ffd[_0x5b87ed(0x1ad)]-0x1,_0x33050f;_0x14e5f6>=0x0;_0x14e5f6--)(_0x33050f=_0x291ffd[_0x14e5f6])&&(_0xd0ef29=_0x33050f(_0xd0ef29)||_0xd0ef29);return _0xd0ef29;},N=(_0x4d2f7b,_0x19b1f8)=>(_0x12a140,_0x38bb8e)=>_0x19b1f8(_0x12a140,_0x38bb8e,_0x4d2f7b);let g=class extends _0x18908b{constructor(_0x3028cd,_0xb3add5){const _0x35c5df=_0x166c12;super(),this['_threadCommentDataSourceService']=_0x3028cd,this['_threadCommentDataSource']=_0xb3add5,this[_0x35c5df(0x191)]();}[_0x166c12(0x191)](){const _0x54824e=_0x166c12;this[_0x54824e(0x1da)][_0x54824e(0x1c2)]=this[_0x54824e(0x1b5)],this[_0x54824e(0x1da)][_0x54824e(0x1b0)]=!0x1;}};g=te([N(0x0,_0x360ed4),N(0x1,_0x8fdc81(f))],g);var se=Object[_0x166c12(0x1b2)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x382198,_0x385d53,_0x504c66)=>_0x385d53 in _0x382198?se(_0x382198,_0x385d53,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x504c66}):_0x382198[_0x385d53]=_0x504c66,ie=(_0x5618b5,_0x4abda7,_0x3b5b9a,_0x4315cf)=>{const _0x4ec47e=_0x166c12;for(var _0x534d0f=_0x4315cf>0x1?void 0x0:_0x4315cf?oe(_0x4abda7,_0x3b5b9a):_0x4abda7,_0x45acdc=_0x5618b5[_0x4ec47e(0x1ad)]-0x1,_0xd5032d;_0x45acdc>=0x0;_0x45acdc--)(_0xd5032d=_0x5618b5[_0x45acdc])&&(_0x534d0f=_0xd5032d(_0x534d0f)||_0x534d0f);return _0x534d0f;},w=(_0x36e1f1,_0x1a0080)=>(_0x14349a,_0xa97861)=>_0x1a0080(_0x14349a,_0xa97861,_0x36e1f1),$=(_0x561fa8,_0x4efdc5,_0x1e05d7)=>ne(_0x561fa8,typeof _0x4efdc5!=_0x166c12(0x1c4)?_0x4efdc5+'':_0x4efdc5,_0x1e05d7);let b=class extends _0x2b8ea1{constructor(_0x114f27=M,_0x560757,_0x133b78){const _0x538311=_0x166c12;super(),this[_0x538311(0x1e2)]=_0x114f27,this[_0x538311(0x1d7)]=_0x560757,this[_0x538311(0x1b7)]=_0x133b78;const {..._0x339ec6}=_0x984593({},M,this[_0x538311(0x1e2)]);this[_0x538311(0x1b7)][_0x538311(0x1a8)](z,_0x339ec6);}[_0x166c12(0x1e8)](){const _0x265e7d=_0x166c12;[[f],[g],[S]][_0x265e7d(0x1bc)](_0x4d52c6=>{const _0x31f9a9=_0x265e7d;this[_0x31f9a9(0x1d7)]['add'](_0x4d52c6);});}[_0x166c12(0x192)](){const _0x45d4c6=_0x166c12;this[_0x45d4c6(0x1d7)][_0x45d4c6(0x1ca)](g),this[_0x45d4c6(0x1d7)]['get'](S);}};$(b,_0x166c12(0x1b6),W),$(b,_0x166c12(0x1d8),_0x4acfe4['UNIVER_UNKNOWN']),b=ie([_0x648336(_0x3a2862,_0x4b2720,_0x1bfdd1),w(0x1,_0x8fdc81(_0x37caba)),w(0x2,_0x4f6915)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3f65dc=_0x1b87;(function(_0x2eebca,_0x4d8f1a){const _0x501c6e=_0x1b87,_0x376dd0=_0x2eebca();while(!![]){try{const _0x3b715d=-parseInt(_0x501c6e(0xb7))/0x1*(parseInt(_0x501c6e(0xb3))/0x2)+-parseInt(_0x501c6e(0x8d))/0x3*(parseInt(_0x501c6e(0x91))/0x4)+parseInt(_0x501c6e(0xa8))/0x5*(parseInt(_0x501c6e(0xbd))/0x6)+parseInt(_0x501c6e(0xae))/0x7+-parseInt(_0x501c6e(0xb2))/0x8+parseInt(_0x501c6e(0x9b))/0x9*(parseInt(_0x501c6e(0x87))/0xa)+parseInt(_0x501c6e(0xd0))/0xb;if(_0x3b715d===_0x4d8f1a)break;else _0x376dd0['push'](_0x376dd0['shift']());}catch(_0x3fe6e8){_0x376dd0['push'](_0x376dd0['shift']());}}}(_0x933f,0xd712f));import{CommentService as _0x4e8277,CollaborationSessionService as _0x297513,UniverCollaborationClientPlugin as _0x1d1044}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x2b808a}from'@univerjs-pro/license';import{dayjs as _0x4dba82,UserManagerService as _0x4a347c,Inject as _0x5a3cc0,Injector as _0x586636,Disposable as _0x15abc7,CustomRangeType as _0x75605a,UniverInstanceType as _0x540bcc,DependentOn as _0x198243,IConfigService as _0x9c33e2,Plugin as _0x35636d,merge as _0x28edfe}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0xa83693}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x16d3aa,IThreadCommentDataSourceService as _0x583b3b}from'@univerjs/thread-comment';import{bufferTime as _0x34729a}from'rxjs';import{HTTPService as _0x56daef}from'@univerjs/network';const W=_0x3f65dc(0xb6);var I=(_0x45ca4e=>(_0x45ca4e[_0x45ca4e[_0x3f65dc(0x96)]=0x0]=_0x3f65dc(0x96),_0x45ca4e[_0x45ca4e['Solved']=0x1]='Solved',_0x45ca4e[_0x45ca4e['UNRECOGNIZED']=-0x1]=_0x3f65dc(0xc4),_0x45ca4e))(I||{}),v=(_0x3d9b7a=>(_0x3d9b7a[_0x3d9b7a['Unknown']=0x0]=_0x3f65dc(0xad),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xc6)]=0x1]=_0x3f65dc(0xc6),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xaa)]=0x2]='Reply',_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xa4)]=0x3]='Edit',_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0x80)]=0x4]=_0x3f65dc(0x80),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0x9a)]=0x5]=_0x3f65dc(0x9a),_0x3d9b7a[_0x3d9b7a[_0x3f65dc(0xc4)]=-0x1]='UNRECOGNIZED',_0x3d9b7a))(v||{});const D=_0x368464=>_0x4dba82(new Date(+_0x368464))['format']('YYYY/MM/DD\x20HH:mm'),B=async(_0x514b8a,_0x51a389)=>{const _0x5891a1=_0x3f65dc,_0x44b0e9=_0x514b8a[_0x5891a1(0x89)](_0x4a347c),_0x292657=_0x514b8a[_0x5891a1(0x89)](_0x56daef);_0x51a389[_0x5891a1(0xca)](_0x36fdba=>{const _0x3591b6=_0x5891a1;_0x44b0e9['getUser'](_0x36fdba)&&_0x51a389[_0x3591b6(0xb4)](_0x36fdba);}),_0x51a389['size']&&(await _0x292657['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x51a389]}}))[_0x5891a1(0xac)][_0x5891a1(0xc9)]['forEach'](_0x3f2d6a=>{const _0x1f1a36=_0x5891a1;_0x3f2d6a&&_0x44b0e9[_0x1f1a36(0x84)](_0x3f2d6a);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x4a3263,_0x289f5f,_0x383df6,_0x268a3e)=>{const _0x5c740c=_0x3f65dc;for(var _0x28bc95=_0x268a3e>0x1?void 0x0:_0x268a3e?K(_0x289f5f,_0x383df6):_0x289f5f,_0x46a932=_0x4a3263[_0x5c740c(0xa2)]-0x1,_0xd35ac5;_0x46a932>=0x0;_0x46a932--)(_0xd35ac5=_0x4a3263[_0x46a932])&&(_0x28bc95=_0xd35ac5(_0x28bc95)||_0x28bc95);return _0x28bc95;},p=(_0x4e6043,_0xffda6c)=>(_0xebf80e,_0x3f44da)=>_0xffda6c(_0xebf80e,_0x3f44da,_0x4e6043);let S=class extends _0x15abc7{constructor(_0x59df53,_0x20f120,_0x3a606e,_0xd33cf2){const _0x35572f=_0x3f65dc;super(),this[_0x35572f(0x98)]=_0x59df53,this[_0x35572f(0x81)]=_0x20f120,this[_0x35572f(0x93)]=_0x3a606e,this[_0x35572f(0xbe)]=_0xd33cf2,this[_0x35572f(0x92)](),this[_0x35572f(0xd5)]();}[_0x3f65dc(0xd5)](){const _0x11a043=_0x3f65dc;this['disposeWithMe'](this[_0x11a043(0x81)][_0x11a043(0x7f)]['pipe'](_0x34729a(0x10))[_0x11a043(0x8e)](_0xd2e8e3=>{const _0x2fb9ab=_0x11a043,_0x3c1666=new Set();_0xd2e8e3[_0x2fb9ab(0xca)](_0x4bd0ff=>{const _0x443b34=_0x2fb9ab;switch(_0x4bd0ff[_0x443b34(0x7d)]){case _0x443b34(0x9d):{const _0x492d14=_0x4bd0ff[_0x443b34(0xd8)]['personId'];_0x3c1666['add'](_0x492d14);break;}}}),B(this[_0x2fb9ab(0xbe)],_0x3c1666);}));}[_0x3f65dc(0x92)](){const _0x4120a3=_0x3f65dc;this['disposeWithMe'](this[_0x4120a3(0x98)][_0x4120a3(0x7f)]['subscribe'](async _0x1be419=>{const _0x3c3dcf=_0x4120a3;var _0x3158c3,_0x5ae47c,_0x1c4e13,_0x48f645;const _0x69fa01=(_0x3158c3=this[_0x3c3dcf(0x81)]['getUnit'](_0x1be419[_0x3c3dcf(0xcb)])[_0x3c3dcf(0x9e)](_0x27ac39=>_0x27ac39[_0x3c3dcf(0xaf)]===_0x1be419[_0x3c3dcf(0xaf)]))==null?void 0x0:_0x3158c3[_0x3c3dcf(0xbf)];if(!_0x69fa01)return;const {unitId:_0x20b2c2,subUnitId:_0x306813}=_0x69fa01;switch(_0x1be419[_0x3c3dcf(0xdc)]&&this[_0x3c3dcf(0x93)][_0x3c3dcf(0x84)](_0x1be419[_0x3c3dcf(0xdc)]),_0x1be419[_0x3c3dcf(0x7d)]){case v[_0x3c3dcf(0xc6)]:break;case v[_0x3c3dcf(0xaa)]:{this[_0x3c3dcf(0x81)][_0x3c3dcf(0xba)](_0x20b2c2,_0x306813,{'unitId':_0x20b2c2,'subUnitId':_0x306813,'ref':'','id':_0x1be419[_0x3c3dcf(0x7e)],'dT':D(+_0x1be419['createTimestamp']),'threadId':_0x1be419[_0x3c3dcf(0xaf)],'personId':(_0x1c4e13=(_0x5ae47c=_0x1be419[_0x3c3dcf(0xdc)])==null?void 0x0:_0x5ae47c[_0x3c3dcf(0xc1)])!=null?_0x1c4e13:_0x1be419[_0x3c3dcf(0x9c)],'text':JSON[_0x3c3dcf(0xa6)](_0x1be419[_0x3c3dcf(0xb1)]),'parentId':_0x69fa01['id']});break;}case v['Delete']:{const _0x4f91f6=this[_0x3c3dcf(0x81)][_0x3c3dcf(0x99)](_0x20b2c2,_0x306813,_0x1be419[_0x3c3dcf(0x7e)]);_0x4f91f6&&_0x4f91f6[_0x3c3dcf(0x8f)]&&this['_threadCommentModel'][_0x3c3dcf(0xd9)](_0x20b2c2,_0x306813,_0x1be419[_0x3c3dcf(0x7e)]);break;}case v[_0x3c3dcf(0xa4)]:{this[_0x3c3dcf(0x81)][_0x3c3dcf(0xce)](_0x20b2c2,_0x306813,{'commentId':_0x1be419[_0x3c3dcf(0x7e)],'text':JSON[_0x3c3dcf(0xa6)](_0x1be419['content'])});break;}case v['Solve']:{const _0x575465=(_0x48f645=this[_0x3c3dcf(0x81)][_0x3c3dcf(0xc0)](_0x1be419['unitId'])['find'](_0x5bd2f6=>_0x5bd2f6[_0x3c3dcf(0xaf)]===_0x1be419[_0x3c3dcf(0xaf)]))==null?void 0x0:_0x48f645[_0x3c3dcf(0xbf)];_0x575465&&this[_0x3c3dcf(0x81)][_0x3c3dcf(0xb5)](_0x20b2c2,_0x306813,_0x575465['id'],_0x1be419['solved']===I[_0x3c3dcf(0x97)]);break;}}}));}};S=V([p(0x0,_0x5a3cc0(_0x4e8277)),p(0x1,_0x5a3cc0(_0x16d3aa)),p(0x2,_0x5a3cc0(_0x4a347c)),p(0x3,_0x5a3cc0(_0x586636))],S);function _0x1b87(_0x555f8d,_0x432197){const _0x933f27=_0x933f();return _0x1b87=function(_0x1b877c,_0x288ef3){_0x1b877c=_0x1b877c-0x7c;let _0x5c1046=_0x933f27[_0x1b877c];return _0x5c1046;},_0x1b87(_0x555f8d,_0x432197);}const z='thread-comment-data-source.config',M={};var k=Object[_0x3f65dc(0xc7)],Q=(_0x21732a,_0x2e29a7,_0x33273d,_0x55e9b6)=>{const _0x1fccd6=_0x3f65dc;for(var _0x5d9f05=_0x55e9b6>0x1?void 0x0:_0x55e9b6?k(_0x2e29a7,_0x33273d):_0x2e29a7,_0x3a757a=_0x21732a[_0x1fccd6(0xa2)]-0x1,_0x4a0006;_0x3a757a>=0x0;_0x3a757a--)(_0x4a0006=_0x21732a[_0x3a757a])&&(_0x5d9f05=_0x4a0006(_0x5d9f05)||_0x5d9f05);return _0x5d9f05;},_=(_0x2b2822,_0x531f27)=>(_0x33ac76,_0x5cd9e9)=>_0x531f27(_0x33ac76,_0x5cd9e9,_0x2b2822);function X(_0xebd592,_0xf03185){const _0x44a2fd=_0x3f65dc,_0x2b1f06=_0xebd592[_0x44a2fd(0x90)][0x0];return{..._0xf03185,'id':_0x2b1f06['replyId'],'resolved':_0xebd592[_0x44a2fd(0xbc)]===0x1,'dT':D(_0x2b1f06[_0x44a2fd(0xdb)]),'personId':_0x2b1f06[_0x44a2fd(0x9c)],'threadId':_0x2b1f06['threadId']};}function ee(_0x4bbe2d,_0xfd903f,_0x581471){const _0x5abdb4=_0x3f65dc;var _0x438c0f,_0x2caa14;if(((_0x2caa14=(_0x438c0f=_0x4bbe2d==null?void 0x0:_0x4bbe2d['replies'])==null?void 0x0:_0x438c0f[_0x5abdb4(0xa2)])!=null?_0x2caa14:0x0)>0x0){const _0x29b1b5=(_0x13574b,_0x57ea26)=>({'id':_0x13574b['replyId'],'threadId':_0x13574b[_0x5abdb4(0xaf)],'dT':D(_0x13574b[_0x5abdb4(0xdb)]),'personId':_0x13574b['userId'],'resolved':_0x4bbe2d[_0x5abdb4(0xbc)]===I[_0x5abdb4(0x97)],'unitId':_0xfd903f,'subUnitId':_0x581471,'text':JSON['parse'](_0x13574b[_0x5abdb4(0xb1)]),'parentId':_0x57ea26}),_0x5ce5e2=_0x29b1b5(_0x4bbe2d[_0x5abdb4(0x90)][0x0]);return{..._0x5ce5e2,'children':_0x4bbe2d[_0x5abdb4(0x90)][_0x5abdb4(0xb9)](0x1)[_0x5abdb4(0xd7)](_0x303bd2=>_0x29b1b5(_0x303bd2,_0x5ce5e2['id']))};}return null;}let f=class{constructor(_0x1b8051,_0x2e1f9b,_0x301101,_0x10dc58){const _0x53c74a=_0x3f65dc;this[_0x53c74a(0xa1)]=_0x1b8051,this[_0x53c74a(0x93)]=_0x2e1f9b,this[_0x53c74a(0xa0)]=_0x301101,this[_0x53c74a(0xbe)]=_0x10dc58;}async['addComment'](_0x16ff55){const _0x8cb064=_0x3f65dc;var _0x376c11,_0x5bcb4c;const {parentId:_0x13f15b,unitId:_0x331063,text:_0x1d8724,threadId:_0x23c76e}=_0x16ff55,_0x2b5c07=(_0x5bcb4c=(_0x376c11=_0x1d8724[_0x8cb064(0xc5)])==null?void 0x0:_0x376c11[_0x8cb064(0xa3)](_0x4d5b88=>_0x4d5b88[_0x8cb064(0xd6)]===_0x75605a[_0x8cb064(0x86)])['map'](_0x16d79e=>_0x16d79e[_0x8cb064(0xc8)]))!=null?_0x5bcb4c:[],_0x2395a4=JSON[_0x8cb064(0x8c)](_0x1d8724),_0x1a2a5a=(await this[_0x8cb064(0xa0)][_0x8cb064(0xab)](_0x331063))[_0x8cb064(0xcf)]();if(_0x13f15b){const _0x1fd983={'memberId':_0x1a2a5a,'unitId':_0x331063,'content':_0x2395a4,'mention':_0x2b5c07,'threadId':_0x23c76e},_0x337800=(await this[_0x8cb064(0xa1)][_0x8cb064(0x9f)](_0x8cb064(0xc2)+_0x331063+_0x8cb064(0x88),{'body':_0x1fd983}))[_0x8cb064(0xac)]['reply'];return{..._0x16ff55,'id':_0x337800['replyId'],'dT':_0x4dba82(+_0x337800[_0x8cb064(0xdb)])[_0x8cb064(0xda)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x337800[_0x8cb064(0x9c)]};}else{const _0x59c53f={'memberId':_0x1a2a5a,'unitId':_0x331063,'content':_0x2395a4,'mention':_0x2b5c07},_0xe9740b=await this[_0x8cb064(0xa1)][_0x8cb064(0x9f)](_0x8cb064(0xc2)+_0x331063+_0x8cb064(0x8b),{'body':_0x59c53f});return X(_0xe9740b[_0x8cb064(0xac)][_0x8cb064(0x7c)],_0x16ff55);}}async[_0x3f65dc(0xce)](_0x505ec6){const _0x956209=_0x3f65dc;var _0x11c17d,_0x28acde;const {text:_0x569088,unitId:_0x8c456f}=_0x505ec6,_0xd7bf38=(_0x28acde=(_0x11c17d=_0x569088[_0x956209(0xc5)])==null?void 0x0:_0x11c17d['filter'](_0x3d24bb=>_0x3d24bb[_0x956209(0xd6)]===_0x75605a[_0x956209(0x86)])['map'](_0x496253=>_0x496253[_0x956209(0xc8)]))!=null?_0x28acde:[],_0x4d4ca7=JSON[_0x956209(0x8c)](_0x569088),_0x4a7713=_0x505ec6[_0x956209(0xaf)],_0x2fe1af=_0x505ec6['id'],_0x4db005={'memberId':(await this[_0x956209(0xa0)][_0x956209(0xab)](_0x8c456f))[_0x956209(0xcf)](),'unitId':_0x8c456f,'threadId':_0x4a7713,'mention':_0xd7bf38,'content':_0x4d4ca7,'replyId':_0x2fe1af},_0x256380=await this['_httpService'][_0x956209(0x9f)](_0x956209(0xc2)+_0x8c456f+_0x956209(0x82),{'body':_0x4db005});return!_0x256380[_0x956209(0xac)][_0x956209(0xcc)]||_0x256380[_0x956209(0xac)][_0x956209(0xcc)][_0x956209(0xa7)]===0x1;}async['resolveComment'](_0x2d46b0){const _0x23b1db=_0x3f65dc,{unitId:_0x1bfc92}=_0x2d46b0,_0x1b76c6=_0x2d46b0['threadId'],_0x5b9c67={'memberId':this[_0x23b1db(0x93)][_0x23b1db(0x85)]()[_0x23b1db(0xc1)],'unitId':_0x1bfc92,'threadId':_0x1b76c6,'solved':_0x2d46b0['resolved']?I[_0x23b1db(0x97)]:I[_0x23b1db(0x96)]},_0x4751c8=await this[_0x23b1db(0xa1)][_0x23b1db(0x9f)](_0x23b1db(0xc2)+_0x1bfc92+_0x23b1db(0xcd),{'body':_0x5b9c67});return!_0x4751c8[_0x23b1db(0xac)][_0x23b1db(0xcc)]||_0x4751c8[_0x23b1db(0xac)]['error'][_0x23b1db(0xa7)]===0x1;}async[_0x3f65dc(0xd9)](_0x18664e,_0x59d31c,_0x49a4c7,_0x28bb3f){const _0x298c89=_0x3f65dc,_0x458720={'memberId':(await this[_0x298c89(0xa0)][_0x298c89(0xab)](_0x18664e))[_0x298c89(0xcf)](),'threadId':_0x49a4c7,'replyId':_0x28bb3f,'unitId':_0x18664e},_0x5c862a=await this[_0x298c89(0xa1)][_0x298c89(0x9f)](_0x298c89(0xc2)+_0x18664e+'/delete',{'body':_0x458720});return!_0x5c862a['body'][_0x298c89(0xcc)]||_0x5c862a[_0x298c89(0xac)][_0x298c89(0xcc)]['code']===0x1;}async[_0x3f65dc(0xa5)](_0x142a43,_0x4f9d87,_0x3b63fa){const _0x1da215=_0x3f65dc,_0x415e96={'unitId':_0x142a43,'threadId':_0x3b63fa},_0x19cab2=await this[_0x1da215(0xa1)]['post'](_0x1da215(0xc2)+_0x142a43+'/list',{'body':_0x415e96}),_0x1709a3=_0x3b63fa['map'](_0x3d65f0=>ee(_0x19cab2[_0x1da215(0xac)]['comments'][_0x3d65f0],_0x142a43,_0x4f9d87))[_0x1da215(0xa3)](Boolean);return Object[_0x1da215(0xbb)](_0x19cab2[_0x1da215(0xac)][_0x1da215(0xc9)])[_0x1da215(0xca)](_0x3e93c7=>{const _0x4518b2=_0x1da215;this[_0x4518b2(0x93)]['addUser'](_0x3e93c7);}),_0x1709a3;}['saveCommentToSnapshot'](_0x33f4ac){const _0x2787f0=_0x3f65dc;return{'id':_0x33f4ac['id'],'threadId':_0x33f4ac[_0x2787f0(0xaf)],'ref':_0x33f4ac[_0x2787f0(0xb8)]};}};f=Q([_(0x0,_0x5a3cc0(_0x56daef)),_(0x1,_0x5a3cc0(_0x4a347c)),_(0x2,_0x5a3cc0(_0x297513)),_(0x3,_0x5a3cc0(_0x586636))],f);var re=Object[_0x3f65dc(0xc7)],te=(_0x1f02a6,_0x31523b,_0x573dc6,_0x2e3337)=>{for(var _0xd3b881=_0x2e3337>0x1?void 0x0:_0x2e3337?re(_0x31523b,_0x573dc6):_0x31523b,_0x4cfef5=_0x1f02a6['length']-0x1,_0x1bd58f;_0x4cfef5>=0x0;_0x4cfef5--)(_0x1bd58f=_0x1f02a6[_0x4cfef5])&&(_0xd3b881=_0x1bd58f(_0xd3b881)||_0xd3b881);return _0xd3b881;},N=(_0x278038,_0x513f23)=>(_0x9f1e38,_0x5a6f9c)=>_0x513f23(_0x9f1e38,_0x5a6f9c,_0x278038);let g=class extends _0x15abc7{constructor(_0x22cb04,_0x2a6def){const _0x2f8160=_0x3f65dc;super(),this[_0x2f8160(0xb0)]=_0x22cb04,this[_0x2f8160(0xd2)]=_0x2a6def,this['_initDataSource']();}[_0x3f65dc(0xd4)](){const _0x185908=_0x3f65dc;this['_threadCommentDataSourceService']['dataSource']=this[_0x185908(0xd2)],this[_0x185908(0xb0)][_0x185908(0x8a)]=!0x1;}};g=te([N(0x0,_0x583b3b),N(0x1,_0x5a3cc0(f))],g);function _0x933f(){const _0x5f2001=['pluginName','_config','OpenOrReOpen','Solved','_commentService','getComment','Solve','1432152DbPUtU','userId','add','find','post','_sessionService','_httpService','length','filter','Edit','listComments','parse','code','37685JCVUIh','_configService','Reply','requireSession','body','Unknown','1390193iBkbEl','threadId','_threadCommentDataSourceService','content','10220800JxmvWq','4686abFnZw','delete','resolveComment','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','356VPZWdL','ref','slice','addComment','values','solved','408VxTYcB','_injector','root','getUnit','userID','/universer-api/comment/unit/','onStarting','UNRECOGNIZED','customRanges','Add','getOwnPropertyDescriptor','rangeId','users','forEach','unitId','error','/solved','updateComment','getMemberID','22565059BHwSBN','defineProperty','_threadCommentDataSource','symbol','_initDataSource','_initUserSync','rangeType','map','payload','deleteComment','format','createTimestamp','user','comment','type','replyId','commentUpdate$','Delete','_threadCommentModel','/edit','onReady','addUser','getCurrentUser','COMMENT','20BqOyXg','/reply','get','syncUpdateMutationToColla','/add','stringify','264267KQOyiW','subscribe','parentId','replies','4OuqGGw','_init','_userService'];_0x933f=function(){return _0x5f2001;};return _0x933f();}var se=Object[_0x3f65dc(0xd1)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x48bc4f,_0x2ce6cb,_0x6b5b9e)=>_0x2ce6cb in _0x48bc4f?se(_0x48bc4f,_0x2ce6cb,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x6b5b9e}):_0x48bc4f[_0x2ce6cb]=_0x6b5b9e,ie=(_0x3dab41,_0x4244d6,_0x41c226,_0x36f7f3)=>{const _0x5f055d=_0x3f65dc;for(var _0x3283a8=_0x36f7f3>0x1?void 0x0:_0x36f7f3?oe(_0x4244d6,_0x41c226):_0x4244d6,_0x307a81=_0x3dab41[_0x5f055d(0xa2)]-0x1,_0x1d8401;_0x307a81>=0x0;_0x307a81--)(_0x1d8401=_0x3dab41[_0x307a81])&&(_0x3283a8=_0x1d8401(_0x3283a8)||_0x3283a8);return _0x3283a8;},w=(_0x5d80f2,_0x297e65)=>(_0x5864ec,_0x263ffb)=>_0x297e65(_0x5864ec,_0x263ffb,_0x5d80f2),$=(_0x3a54f7,_0x33dd14,_0x283cdd)=>ne(_0x3a54f7,typeof _0x33dd14!=_0x3f65dc(0xd3)?_0x33dd14+'':_0x33dd14,_0x283cdd);let b=class extends _0x35636d{constructor(_0xb8f067=M,_0x5cda24,_0x16cbeb){const _0x52e439=_0x3f65dc;super(),this['_config']=_0xb8f067,this['_injector']=_0x5cda24,this['_configService']=_0x16cbeb;const {..._0x4dcc0e}=_0x28edfe({},M,this[_0x52e439(0x95)]);this[_0x52e439(0xa9)]['setConfig'](z,_0x4dcc0e);}[_0x3f65dc(0xc3)](){const _0x573a55=_0x3f65dc;[[f],[g],[S]][_0x573a55(0xca)](_0x3089ce=>{this['_injector']['add'](_0x3089ce);});}[_0x3f65dc(0x83)](){const _0x2e3266=_0x3f65dc;this['_injector'][_0x2e3266(0x89)](g),this[_0x2e3266(0xbe)][_0x2e3266(0x89)](S);}};$(b,_0x3f65dc(0x94),W),$(b,_0x3f65dc(0x7d),_0x540bcc['UNIVER_UNKNOWN']),b=ie([_0x198243(_0xa83693,_0x1d1044,_0x2b808a),w(0x1,_0x5a3cc0(_0x586636)),w(0x2,_0x9c33e2)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x166c12=_0x10f6;(function(_0x1a6a5e,_0x24319e){const _0x2e1f0c=_0x10f6,_0xdc54c=_0x1a6a5e();while(!![]){try{const _0x30adae=-parseInt(_0x2e1f0c(0x196))/0x1+parseInt(_0x2e1f0c(0x1f3))/0x2*(parseInt(_0x2e1f0c(0x19a))/0x3)+-parseInt(_0x2e1f0c(0x1ce))/0x4+-parseInt(_0x2e1f0c(0x1a6))/0x5+parseInt(_0x2e1f0c(0x1aa))/0x6+-parseInt(_0x2e1f0c(0x19b))/0x7*(-parseInt(_0x2e1f0c(0x1e7))/0x8)+parseInt(_0x2e1f0c(0x1de))/0x9;if(_0x30adae===_0x24319e)break;else _0xdc54c['push'](_0xdc54c['shift']());}catch(_0x5e5e95){_0xdc54c['push'](_0xdc54c['shift']());}}}(_0x3b23,0xacab1));import{CommentService as _0x25df25,CollaborationSessionService as _0x1cbde6,UniverCollaborationClientPlugin as _0x4b2720}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x1bfdd1}from'@univerjs-pro/license';import{dayjs as _0x3cecb5,UserManagerService as _0xc83dbe,Inject as _0x8fdc81,Injector as _0x37caba,Disposable as _0x18908b,CustomRangeType as _0xf7bfe6,UniverInstanceType as _0x4acfe4,DependentOn as _0x648336,IConfigService as _0x4f6915,Plugin as _0x2b8ea1,merge as _0x984593}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x3a2862}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2fa9d4,IThreadCommentDataSourceService as _0x360ed4}from'@univerjs/thread-comment';function _0x3b23(){const _0x11dc9c=['onReady','user','/universer-api/comment/unit/','addComment','254682RxgyPF','getOwnPropertyDescriptor','Unknown','Solved','18boxwqC','105oewPtB','deleteComment','saveCommentToSnapshot','/solved','comments','error','Edit','slice','customRanges','filter','_sessionService','4760075PzwSIl','_userService','setConfig','find','251904PJVoka','replies','reply','length','addUser','Solve','syncUpdateMutationToColla','Reply','defineProperty','COMMENT','resolved','_threadCommentDataSource','pluginName','_configService','userID','thread-comment-data-source.config','parse','replyId','forEach','_httpService','pipe','subscribe','users','_init','dataSource','unitId','symbol','_threadCommentModel','Delete','_initUserSync','content','/list','get','parentId','Add','threadId','4843388LFUyRx','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','getComment','values','root','body','requireSession','rangeId','solved','_injector','type','code','_threadCommentDataSourceService','getUser','format','OpenOrReOpen','11679363tWsTKq','getUnit','stringify','listComments','_config','_commentService','delete','updateComment','/reply','488416kMvqye','onStarting','post','userId','/universer-api/user/list','personId','map','resolveComment','ref','getMemberID','commentUpdate$','getCurrentUser','289774kogfea','createTimestamp','disposeWithMe','size','rangeType','UNRECOGNIZED','YYYY/MM/DD\x20HH:mm','_initDataSource'];_0x3b23=function(){return _0x11dc9c;};return _0x3b23();}import{bufferTime as _0x51f2cb}from'rxjs';import{HTTPService as _0x57fadc}from'@univerjs/network';const W=_0x166c12(0x1cf);var I=(_0x3b6987=>(_0x3b6987[_0x3b6987[_0x166c12(0x1dd)]=0x0]=_0x166c12(0x1dd),_0x3b6987[_0x3b6987['Solved']=0x1]=_0x166c12(0x199),_0x3b6987[_0x3b6987[_0x166c12(0x1f8)]=-0x1]=_0x166c12(0x1f8),_0x3b6987))(I||{}),v=(_0x5855b0=>(_0x5855b0[_0x5855b0[_0x166c12(0x198)]=0x0]=_0x166c12(0x198),_0x5855b0[_0x5855b0['Add']=0x1]=_0x166c12(0x1cc),_0x5855b0[_0x5855b0[_0x166c12(0x1b1)]=0x2]=_0x166c12(0x1b1),_0x5855b0[_0x5855b0[_0x166c12(0x1a1)]=0x3]='Edit',_0x5855b0[_0x5855b0[_0x166c12(0x1c6)]=0x4]=_0x166c12(0x1c6),_0x5855b0[_0x5855b0['Solve']=0x5]=_0x166c12(0x1af),_0x5855b0[_0x5855b0[_0x166c12(0x1f8)]=-0x1]=_0x166c12(0x1f8),_0x5855b0))(v||{});const D=_0x3cd454=>_0x3cecb5(new Date(+_0x3cd454))[_0x166c12(0x1dc)](_0x166c12(0x1f9)),B=async(_0x36e145,_0xb19bb2)=>{const _0x43792d=_0x166c12,_0x4553f7=_0x36e145[_0x43792d(0x1ca)](_0xc83dbe),_0x5a2ed8=_0x36e145[_0x43792d(0x1ca)](_0x57fadc);_0xb19bb2[_0x43792d(0x1bc)](_0x9aba20=>{const _0x2c17f0=_0x43792d;_0x4553f7[_0x2c17f0(0x1db)](_0x9aba20)&&_0xb19bb2[_0x2c17f0(0x1e4)](_0x9aba20);}),_0xb19bb2[_0x43792d(0x1f6)]&&(await _0x5a2ed8[_0x43792d(0x1ca)](_0x43792d(0x1eb),{'params':{'userIDs':[..._0xb19bb2]}}))['body'][_0x43792d(0x1c0)][_0x43792d(0x1bc)](_0x1fa17e=>{const _0x2c68b1=_0x43792d;_0x1fa17e&&_0x4553f7[_0x2c68b1(0x1ae)](_0x1fa17e);});};var K=Object[_0x166c12(0x197)],V=(_0x4d23cd,_0xa427dc,_0x48082a,_0x1c2e22)=>{const _0x2d02d5=_0x166c12;for(var _0x21a7ca=_0x1c2e22>0x1?void 0x0:_0x1c2e22?K(_0xa427dc,_0x48082a):_0xa427dc,_0x10936c=_0x4d23cd[_0x2d02d5(0x1ad)]-0x1,_0x453bbb;_0x10936c>=0x0;_0x10936c--)(_0x453bbb=_0x4d23cd[_0x10936c])&&(_0x21a7ca=_0x453bbb(_0x21a7ca)||_0x21a7ca);return _0x21a7ca;},p=(_0x55630d,_0x37a088)=>(_0x155671,_0x396802)=>_0x37a088(_0x155671,_0x396802,_0x55630d);let S=class extends _0x18908b{constructor(_0x29a138,_0x2106e2,_0x4fcc7e,_0x251864){const _0x3e0b62=_0x166c12;super(),this[_0x3e0b62(0x1e3)]=_0x29a138,this[_0x3e0b62(0x1c5)]=_0x2106e2,this[_0x3e0b62(0x1a7)]=_0x4fcc7e,this[_0x3e0b62(0x1d7)]=_0x251864,this[_0x3e0b62(0x1c1)](),this[_0x3e0b62(0x1c7)]();}[_0x166c12(0x1c7)](){const _0x2c8663=_0x166c12;this['disposeWithMe'](this['_threadCommentModel']['commentUpdate$'][_0x2c8663(0x1be)](_0x51f2cb(0x10))[_0x2c8663(0x1bf)](_0x50bb92=>{const _0x38242d=_0x2c8663,_0x3b47f0=new Set();_0x50bb92[_0x38242d(0x1bc)](_0x7709b4=>{const _0x43aef5=_0x38242d;switch(_0x7709b4[_0x43aef5(0x1d8)]){case'add':{const _0x3f9fa3=_0x7709b4['payload'][_0x43aef5(0x1ec)];_0x3b47f0['add'](_0x3f9fa3);break;}}}),B(this[_0x38242d(0x1d7)],_0x3b47f0);}));}[_0x166c12(0x1c1)](){const _0x24e48e=_0x166c12;this[_0x24e48e(0x1f5)](this[_0x24e48e(0x1e3)][_0x24e48e(0x1f1)][_0x24e48e(0x1bf)](async _0x4f670f=>{const _0x2b94df=_0x24e48e;var _0x46d6ed,_0x5cd8a7,_0x3e5c43,_0x63985b;const _0x887d46=(_0x46d6ed=this[_0x2b94df(0x1c5)][_0x2b94df(0x1df)](_0x4f670f[_0x2b94df(0x1c3)])[_0x2b94df(0x1a9)](_0x47934d=>_0x47934d[_0x2b94df(0x1cd)]===_0x4f670f[_0x2b94df(0x1cd)]))==null?void 0x0:_0x46d6ed[_0x2b94df(0x1d2)];if(!_0x887d46)return;const {unitId:_0x30791d,subUnitId:_0x11c418}=_0x887d46;switch(_0x4f670f['user']&&this['_userService'][_0x2b94df(0x1ae)](_0x4f670f['user']),_0x4f670f['type']){case v[_0x2b94df(0x1cc)]:break;case v['Reply']:{this[_0x2b94df(0x1c5)]['addComment'](_0x30791d,_0x11c418,{'unitId':_0x30791d,'subUnitId':_0x11c418,'ref':'','id':_0x4f670f[_0x2b94df(0x1bb)],'dT':D(+_0x4f670f[_0x2b94df(0x1f4)]),'threadId':_0x4f670f[_0x2b94df(0x1cd)],'personId':(_0x3e5c43=(_0x5cd8a7=_0x4f670f[_0x2b94df(0x193)])==null?void 0x0:_0x5cd8a7[_0x2b94df(0x1b8)])!=null?_0x3e5c43:_0x4f670f['userId'],'text':JSON[_0x2b94df(0x1ba)](_0x4f670f[_0x2b94df(0x1c8)]),'parentId':_0x887d46['id']});break;}case v['Delete']:{const _0x352c5b=this[_0x2b94df(0x1c5)][_0x2b94df(0x1d0)](_0x30791d,_0x11c418,_0x4f670f[_0x2b94df(0x1bb)]);_0x352c5b&&_0x352c5b[_0x2b94df(0x1cb)]&&this[_0x2b94df(0x1c5)][_0x2b94df(0x19c)](_0x30791d,_0x11c418,_0x4f670f[_0x2b94df(0x1bb)]);break;}case v[_0x2b94df(0x1a1)]:{this['_threadCommentModel'][_0x2b94df(0x1e5)](_0x30791d,_0x11c418,{'commentId':_0x4f670f[_0x2b94df(0x1bb)],'text':JSON[_0x2b94df(0x1ba)](_0x4f670f['content'])});break;}case v['Solve']:{const _0x349091=(_0x63985b=this[_0x2b94df(0x1c5)]['getUnit'](_0x4f670f[_0x2b94df(0x1c3)])[_0x2b94df(0x1a9)](_0x2e22bd=>_0x2e22bd[_0x2b94df(0x1cd)]===_0x4f670f['threadId']))==null?void 0x0:_0x63985b[_0x2b94df(0x1d2)];_0x349091&&this['_threadCommentModel']['resolveComment'](_0x30791d,_0x11c418,_0x349091['id'],_0x4f670f[_0x2b94df(0x1d6)]===I['Solved']);break;}}}));}};S=V([p(0x0,_0x8fdc81(_0x25df25)),p(0x1,_0x8fdc81(_0x2fa9d4)),p(0x2,_0x8fdc81(_0xc83dbe)),p(0x3,_0x8fdc81(_0x37caba))],S);const z=_0x166c12(0x1b9),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x236902,_0x351f7f,_0x1e3934,_0x4045e9)=>{const _0x5c55fa=_0x166c12;for(var _0x25ab4e=_0x4045e9>0x1?void 0x0:_0x4045e9?k(_0x351f7f,_0x1e3934):_0x351f7f,_0x2683be=_0x236902[_0x5c55fa(0x1ad)]-0x1,_0x31e114;_0x2683be>=0x0;_0x2683be--)(_0x31e114=_0x236902[_0x2683be])&&(_0x25ab4e=_0x31e114(_0x25ab4e)||_0x25ab4e);return _0x25ab4e;},_=(_0x125859,_0x5f2eb7)=>(_0x2f76a9,_0x281263)=>_0x5f2eb7(_0x2f76a9,_0x281263,_0x125859);function X(_0x3b08f7,_0x13f5a3){const _0x3183d8=_0x166c12,_0x37241b=_0x3b08f7['replies'][0x0];return{..._0x13f5a3,'id':_0x37241b[_0x3183d8(0x1bb)],'resolved':_0x3b08f7[_0x3183d8(0x1d6)]===0x1,'dT':D(_0x37241b['createTimestamp']),'personId':_0x37241b['userId'],'threadId':_0x37241b[_0x3183d8(0x1cd)]};}function ee(_0x39875d,_0x446a43,_0x730daf){const _0x196f1b=_0x166c12;var _0x4b5366,_0x5b39d7;if(((_0x5b39d7=(_0x4b5366=_0x39875d==null?void 0x0:_0x39875d[_0x196f1b(0x1ab)])==null?void 0x0:_0x4b5366[_0x196f1b(0x1ad)])!=null?_0x5b39d7:0x0)>0x0){const _0x3aaf1a=(_0x3fdef4,_0x1f6668)=>({'id':_0x3fdef4[_0x196f1b(0x1bb)],'threadId':_0x3fdef4[_0x196f1b(0x1cd)],'dT':D(_0x3fdef4[_0x196f1b(0x1f4)]),'personId':_0x3fdef4[_0x196f1b(0x1ea)],'resolved':_0x39875d[_0x196f1b(0x1d6)]===I[_0x196f1b(0x199)],'unitId':_0x446a43,'subUnitId':_0x730daf,'text':JSON[_0x196f1b(0x1ba)](_0x3fdef4[_0x196f1b(0x1c8)]),'parentId':_0x1f6668}),_0x4de25=_0x3aaf1a(_0x39875d[_0x196f1b(0x1ab)][0x0]);return{..._0x4de25,'children':_0x39875d[_0x196f1b(0x1ab)][_0x196f1b(0x1a2)](0x1)[_0x196f1b(0x1ed)](_0x2bda2d=>_0x3aaf1a(_0x2bda2d,_0x4de25['id']))};}return null;}let f=class{constructor(_0x7acca5,_0x3cc23d,_0x252b3e,_0x3160aa){this['_httpService']=_0x7acca5,this['_userService']=_0x3cc23d,this['_sessionService']=_0x252b3e,this['_injector']=_0x3160aa;}async[_0x166c12(0x195)](_0x13047e){const _0x3e8564=_0x166c12;var _0x295c93,_0x223f4f;const {parentId:_0x593255,unitId:_0x404c6d,text:_0x4134fe,threadId:_0xf7c514}=_0x13047e,_0x2f09a9=(_0x223f4f=(_0x295c93=_0x4134fe['customRanges'])==null?void 0x0:_0x295c93[_0x3e8564(0x1a4)](_0x1462bd=>_0x1462bd[_0x3e8564(0x1f7)]===_0xf7bfe6[_0x3e8564(0x1b3)])['map'](_0x4e0a3c=>_0x4e0a3c[_0x3e8564(0x1d5)]))!=null?_0x223f4f:[],_0x2338d5=JSON['stringify'](_0x4134fe),_0x42ad00=(await this[_0x3e8564(0x1a5)][_0x3e8564(0x1d4)](_0x404c6d))[_0x3e8564(0x1f0)]();if(_0x593255){const _0x88937f={'memberId':_0x42ad00,'unitId':_0x404c6d,'content':_0x2338d5,'mention':_0x2f09a9,'threadId':_0xf7c514},_0x46636e=(await this[_0x3e8564(0x1bd)]['post'](_0x3e8564(0x194)+_0x404c6d+_0x3e8564(0x1e6),{'body':_0x88937f}))[_0x3e8564(0x1d3)][_0x3e8564(0x1ac)];return{..._0x13047e,'id':_0x46636e[_0x3e8564(0x1bb)],'dT':_0x3cecb5(+_0x46636e[_0x3e8564(0x1f4)])[_0x3e8564(0x1dc)](_0x3e8564(0x1f9)),'personId':_0x46636e['userId']};}else{const _0x3484fa={'memberId':_0x42ad00,'unitId':_0x404c6d,'content':_0x2338d5,'mention':_0x2f09a9},_0x359bdb=await this[_0x3e8564(0x1bd)][_0x3e8564(0x1e9)](_0x3e8564(0x194)+_0x404c6d+'/add',{'body':_0x3484fa});return X(_0x359bdb[_0x3e8564(0x1d3)]['comment'],_0x13047e);}}async[_0x166c12(0x1e5)](_0xb7e253){const _0x1d18a8=_0x166c12;var _0x2a10f0,_0x41f84c;const {text:_0x261ae8,unitId:_0x2c0912}=_0xb7e253,_0x4e98b7=(_0x41f84c=(_0x2a10f0=_0x261ae8[_0x1d18a8(0x1a3)])==null?void 0x0:_0x2a10f0[_0x1d18a8(0x1a4)](_0x4b9621=>_0x4b9621[_0x1d18a8(0x1f7)]===_0xf7bfe6[_0x1d18a8(0x1b3)])[_0x1d18a8(0x1ed)](_0x51d2ef=>_0x51d2ef[_0x1d18a8(0x1d5)]))!=null?_0x41f84c:[],_0x1a323f=JSON[_0x1d18a8(0x1e0)](_0x261ae8),_0x2f4aa7=_0xb7e253[_0x1d18a8(0x1cd)],_0xf016b6=_0xb7e253['id'],_0xaab2ff={'memberId':(await this[_0x1d18a8(0x1a5)][_0x1d18a8(0x1d4)](_0x2c0912))['getMemberID'](),'unitId':_0x2c0912,'threadId':_0x2f4aa7,'mention':_0x4e98b7,'content':_0x1a323f,'replyId':_0xf016b6},_0x451c78=await this[_0x1d18a8(0x1bd)]['post'](_0x1d18a8(0x194)+_0x2c0912+'/edit',{'body':_0xaab2ff});return!_0x451c78[_0x1d18a8(0x1d3)][_0x1d18a8(0x1a0)]||_0x451c78[_0x1d18a8(0x1d3)]['error']['code']===0x1;}async[_0x166c12(0x1ee)](_0x2406e4){const _0x20bb96=_0x166c12,{unitId:_0x35fd9b}=_0x2406e4,_0x20540d=_0x2406e4[_0x20bb96(0x1cd)],_0x402c96={'memberId':this[_0x20bb96(0x1a7)][_0x20bb96(0x1f2)]()['userID'],'unitId':_0x35fd9b,'threadId':_0x20540d,'solved':_0x2406e4[_0x20bb96(0x1b4)]?I[_0x20bb96(0x199)]:I[_0x20bb96(0x1dd)]},_0x4cb16d=await this['_httpService'][_0x20bb96(0x1e9)]('/universer-api/comment/unit/'+_0x35fd9b+_0x20bb96(0x19e),{'body':_0x402c96});return!_0x4cb16d[_0x20bb96(0x1d3)][_0x20bb96(0x1a0)]||_0x4cb16d[_0x20bb96(0x1d3)][_0x20bb96(0x1a0)]['code']===0x1;}async[_0x166c12(0x19c)](_0x4124e3,_0x28a65b,_0xe062f3,_0x5548bd){const _0x57a811=_0x166c12,_0x47a5a0={'memberId':(await this[_0x57a811(0x1a5)][_0x57a811(0x1d4)](_0x4124e3))[_0x57a811(0x1f0)](),'threadId':_0xe062f3,'replyId':_0x5548bd,'unitId':_0x4124e3},_0x16c1c5=await this[_0x57a811(0x1bd)][_0x57a811(0x1e9)](_0x57a811(0x194)+_0x4124e3+'/delete',{'body':_0x47a5a0});return!_0x16c1c5[_0x57a811(0x1d3)]['error']||_0x16c1c5[_0x57a811(0x1d3)][_0x57a811(0x1a0)][_0x57a811(0x1d9)]===0x1;}async[_0x166c12(0x1e1)](_0x3ade55,_0x2746f5,_0x40018a){const _0x35bb43=_0x166c12,_0x18ff18={'unitId':_0x3ade55,'threadId':_0x40018a},_0x599aef=await this[_0x35bb43(0x1bd)][_0x35bb43(0x1e9)](_0x35bb43(0x194)+_0x3ade55+_0x35bb43(0x1c9),{'body':_0x18ff18}),_0x5485d8=_0x40018a['map'](_0x5a5e72=>ee(_0x599aef[_0x35bb43(0x1d3)][_0x35bb43(0x19f)][_0x5a5e72],_0x3ade55,_0x2746f5))[_0x35bb43(0x1a4)](Boolean);return Object[_0x35bb43(0x1d1)](_0x599aef['body'][_0x35bb43(0x1c0)])[_0x35bb43(0x1bc)](_0x649fec=>{const _0x1748d4=_0x35bb43;this[_0x1748d4(0x1a7)]['addUser'](_0x649fec);}),_0x5485d8;}[_0x166c12(0x19d)](_0x26b0fb){const _0xc11efc=_0x166c12;return{'id':_0x26b0fb['id'],'threadId':_0x26b0fb['threadId'],'ref':_0x26b0fb[_0xc11efc(0x1ef)]};}};f=Q([_(0x0,_0x8fdc81(_0x57fadc)),_(0x1,_0x8fdc81(_0xc83dbe)),_(0x2,_0x8fdc81(_0x1cbde6)),_(0x3,_0x8fdc81(_0x37caba))],f);function _0x10f6(_0x2bd15d,_0x137b0f){const _0x3b23c0=_0x3b23();return _0x10f6=function(_0x10f67c,_0xbc0d10){_0x10f67c=_0x10f67c-0x191;let _0x50d7b3=_0x3b23c0[_0x10f67c];return _0x50d7b3;},_0x10f6(_0x2bd15d,_0x137b0f);}var re=Object[_0x166c12(0x197)],te=(_0x291ffd,_0x10ef46,_0x2a468e,_0x1bbc9a)=>{const _0x5b87ed=_0x166c12;for(var _0xd0ef29=_0x1bbc9a>0x1?void 0x0:_0x1bbc9a?re(_0x10ef46,_0x2a468e):_0x10ef46,_0x14e5f6=_0x291ffd[_0x5b87ed(0x1ad)]-0x1,_0x33050f;_0x14e5f6>=0x0;_0x14e5f6--)(_0x33050f=_0x291ffd[_0x14e5f6])&&(_0xd0ef29=_0x33050f(_0xd0ef29)||_0xd0ef29);return _0xd0ef29;},N=(_0x4d2f7b,_0x19b1f8)=>(_0x12a140,_0x38bb8e)=>_0x19b1f8(_0x12a140,_0x38bb8e,_0x4d2f7b);let g=class extends _0x18908b{constructor(_0x3028cd,_0xb3add5){const _0x35c5df=_0x166c12;super(),this['_threadCommentDataSourceService']=_0x3028cd,this['_threadCommentDataSource']=_0xb3add5,this[_0x35c5df(0x191)]();}[_0x166c12(0x191)](){const _0x54824e=_0x166c12;this[_0x54824e(0x1da)][_0x54824e(0x1c2)]=this[_0x54824e(0x1b5)],this[_0x54824e(0x1da)][_0x54824e(0x1b0)]=!0x1;}};g=te([N(0x0,_0x360ed4),N(0x1,_0x8fdc81(f))],g);var se=Object[_0x166c12(0x1b2)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x382198,_0x385d53,_0x504c66)=>_0x385d53 in _0x382198?se(_0x382198,_0x385d53,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x504c66}):_0x382198[_0x385d53]=_0x504c66,ie=(_0x5618b5,_0x4abda7,_0x3b5b9a,_0x4315cf)=>{const _0x4ec47e=_0x166c12;for(var _0x534d0f=_0x4315cf>0x1?void 0x0:_0x4315cf?oe(_0x4abda7,_0x3b5b9a):_0x4abda7,_0x45acdc=_0x5618b5[_0x4ec47e(0x1ad)]-0x1,_0xd5032d;_0x45acdc>=0x0;_0x45acdc--)(_0xd5032d=_0x5618b5[_0x45acdc])&&(_0x534d0f=_0xd5032d(_0x534d0f)||_0x534d0f);return _0x534d0f;},w=(_0x36e1f1,_0x1a0080)=>(_0x14349a,_0xa97861)=>_0x1a0080(_0x14349a,_0xa97861,_0x36e1f1),$=(_0x561fa8,_0x4efdc5,_0x1e05d7)=>ne(_0x561fa8,typeof _0x4efdc5!=_0x166c12(0x1c4)?_0x4efdc5+'':_0x4efdc5,_0x1e05d7);let b=class extends _0x2b8ea1{constructor(_0x114f27=M,_0x560757,_0x133b78){const _0x538311=_0x166c12;super(),this[_0x538311(0x1e2)]=_0x114f27,this[_0x538311(0x1d7)]=_0x560757,this[_0x538311(0x1b7)]=_0x133b78;const {..._0x339ec6}=_0x984593({},M,this[_0x538311(0x1e2)]);this[_0x538311(0x1b7)][_0x538311(0x1a8)](z,_0x339ec6);}[_0x166c12(0x1e8)](){const _0x265e7d=_0x166c12;[[f],[g],[S]][_0x265e7d(0x1bc)](_0x4d52c6=>{const _0x31f9a9=_0x265e7d;this[_0x31f9a9(0x1d7)]['add'](_0x4d52c6);});}[_0x166c12(0x192)](){const _0x45d4c6=_0x166c12;this[_0x45d4c6(0x1d7)][_0x45d4c6(0x1ca)](g),this[_0x45d4c6(0x1d7)]['get'](S);}};$(b,_0x166c12(0x1b6),W),$(b,_0x166c12(0x1d8),_0x4acfe4['UNIVER_UNKNOWN']),b=ie([_0x648336(_0x3a2862,_0x4b2720,_0x1bfdd1),w(0x1,_0x8fdc81(_0x37caba)),w(0x2,_0x4f6915)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x31d5(_0x49f5a8,_0x33dee4){const _0x566794=_0x5667();return _0x31d5=function(_0x31d561,_0x147ebc){_0x31d561=_0x31d561-0x16b;let _0x53e3c4=_0x566794[_0x31d561];return _0x53e3c4;},_0x31d5(_0x49f5a8,_0x33dee4);}function _0x5667(){const _0x953342=['_initUserSync','body','_userService','UniverThreadCommentUIPlugin','@univerjs/network','personId','Plugin','@univerjs-pro/license','commentUpdate$','updateComment','comments','UniverCore','dayjs','UniverProCollaborationClient','88584BRBPtm','IThreadCommentDataSourceService','unitId','defineProperty','Injector','170805dwctzH','OpenOrReOpen','_injector','UserManagerService','merge','@univerjs/core','disposeWithMe','user','threadId','117UkyfYA','subscribe','getMemberID','Delete','rxjs','UniverThreadComment','listComments','getCurrentUser','1422336amimli','addComment','8SVAroy','_httpService','type','get','parentId','rangeId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','2152xIFetZ','CustomRangeType','userId','getOwnPropertyDescriptor','getUnit','thread-comment-data-source.config','UniverInstanceType','replies','/reply','bufferTime','_sessionService','Inject','ThreadCommentModel','filter','Add','Edit','_configService','getComment','COMMENT','/edit','DependentOn','_commentService','_threadCommentDataSource','reply','map','UNRECOGNIZED','requireSession','syncUpdateMutationToColla','_threadCommentDataSourceService','parse','object','_initDataSource','@univerjs-pro/collaboration-client','onStarting','5717380vMGCOp','size','createTimestamp','UniverProLicense','content','IConfigService','comment','HTTPService','UniverThreadCommentDataSourcePlugin','@univerjs/thread-comment-ui','dataSource','amd','UniverThreadCommentUi','44wBmOjk','UniverProThreadCommentDatasource','175ocfUFN','find','root','Solved','/universer-api/comment/unit/','format','getUser','138906wBBroN','function','code','userID','resolved','Disposable','_threadCommentModel','_init','resolveComment','YYYY/MM/DD\x20HH:mm','stringify','pipe','Solve','Reply','length','684231EcXPeH','forEach','@univerjs/thread-comment','UniverNetwork','customRanges','_config','CommentService','add','values','replyId','/solved','post','solved','users','symbol','deleteComment','/universer-api/user/list','rangeType','addUser','setConfig','saveCommentToSnapshot','error'];_0x5667=function(){return _0x953342;};return _0x5667();}(function(_0x2ae40f,_0x269ab2){const _0x120b35=_0x31d5,_0x92f77d=_0x2ae40f();while(!![]){try{const _0x383083=-parseInt(_0x120b35(0x1e1))/0x1+-parseInt(_0x120b35(0x191))/0x2+parseInt(_0x120b35(0x189))/0x3*(-parseInt(_0x120b35(0x19a))/0x4)+-parseInt(_0x120b35(0x180))/0x5+-parseInt(_0x120b35(0x17b))/0x6*(parseInt(_0x120b35(0x1cb))/0x7)+parseInt(_0x120b35(0x193))/0x8*(-parseInt(_0x120b35(0x1d2))/0x9)+parseInt(_0x120b35(0x1bc))/0xa*(parseInt(_0x120b35(0x1c9))/0xb);if(_0x383083===_0x269ab2)break;else _0x92f77d['push'](_0x92f77d['shift']());}catch(_0x27f9da){_0x92f77d['push'](_0x92f77d['shift']());}}}(_0x5667,0x6e524),function(_0x4a70ca,_0x4c9156){const _0x1ead58=_0x31d5;typeof exports==_0x1ead58(0x1b8)&&typeof module<'u'?_0x4c9156(exports,require(_0x1ead58(0x1ba)),require(_0x1ead58(0x174)),require(_0x1ead58(0x185)),require(_0x1ead58(0x1c5)),require(_0x1ead58(0x1e3)),require(_0x1ead58(0x18d)),require(_0x1ead58(0x171))):typeof define==_0x1ead58(0x1d3)&&define[_0x1ead58(0x1c7)]?define(['exports','@univerjs-pro/collaboration-client','@univerjs-pro/license',_0x1ead58(0x185),_0x1ead58(0x1c5),_0x1ead58(0x1e3),_0x1ead58(0x18d),_0x1ead58(0x171)],_0x4c9156):(_0x4a70ca=typeof globalThis<'u'?globalThis:_0x4a70ca||self,_0x4c9156(_0x4a70ca[_0x1ead58(0x1ca)]={},_0x4a70ca[_0x1ead58(0x17a)],_0x4a70ca[_0x1ead58(0x1bf)],_0x4a70ca[_0x1ead58(0x178)],_0x4a70ca[_0x1ead58(0x1c8)],_0x4a70ca[_0x1ead58(0x18e)],_0x4a70ca['rxjs'],_0x4a70ca[_0x1ead58(0x1e4)]));}(this,function(_0x2554b4,_0x4f3a5e,_0x16d3cc,_0x5d7b55,_0xeab3c7,_0x4a4c1c,_0x19f8fe,_0x58c84a){'use strict';const _0x4ee7ae=_0x31d5;const _0x44ede7=_0x4ee7ae(0x199);var _0x56c0d7=(_0x1038f7=>(_0x1038f7[_0x1038f7[_0x4ee7ae(0x181)]=0x0]=_0x4ee7ae(0x181),_0x1038f7[_0x1038f7[_0x4ee7ae(0x1ce)]=0x1]=_0x4ee7ae(0x1ce),_0x1038f7[_0x1038f7[_0x4ee7ae(0x1b3)]=-0x1]='UNRECOGNIZED',_0x1038f7))(_0x56c0d7||{}),_0x12cc8a=(_0x2a684a=>(_0x2a684a[_0x2a684a['Unknown']=0x0]='Unknown',_0x2a684a[_0x2a684a[_0x4ee7ae(0x1a8)]=0x1]=_0x4ee7ae(0x1a8),_0x2a684a[_0x2a684a[_0x4ee7ae(0x1df)]=0x2]=_0x4ee7ae(0x1df),_0x2a684a[_0x2a684a[_0x4ee7ae(0x1a9)]=0x3]=_0x4ee7ae(0x1a9),_0x2a684a[_0x2a684a['Delete']=0x4]=_0x4ee7ae(0x18c),_0x2a684a[_0x2a684a[_0x4ee7ae(0x1de)]=0x5]=_0x4ee7ae(0x1de),_0x2a684a[_0x2a684a[_0x4ee7ae(0x1b3)]=-0x1]='UNRECOGNIZED',_0x2a684a))(_0x12cc8a||{});const _0x2748e5=_0x479d35=>_0x5d7b55[_0x4ee7ae(0x179)](new Date(+_0x479d35))[_0x4ee7ae(0x1d0)](_0x4ee7ae(0x1db)),_0x4166d2=async(_0xe74789,_0x5767d6)=>{const _0x21e352=_0x4ee7ae,_0x1e539e=_0xe74789[_0x21e352(0x196)](_0x5d7b55[_0x21e352(0x183)]),_0x399e75=_0xe74789[_0x21e352(0x196)](_0x58c84a[_0x21e352(0x1c3)]);_0x5767d6[_0x21e352(0x1e2)](_0x31decd=>{const _0x23f451=_0x21e352;_0x1e539e[_0x23f451(0x1d1)](_0x31decd)&&_0x5767d6['delete'](_0x31decd);}),_0x5767d6[_0x21e352(0x1bd)]&&(await _0x399e75[_0x21e352(0x196)](_0x21e352(0x1f1),{'params':{'userIDs':[..._0x5767d6]}}))[_0x21e352(0x16e)][_0x21e352(0x1ee)][_0x21e352(0x1e2)](_0xcfab1b=>{_0xcfab1b&&_0x1e539e['addUser'](_0xcfab1b);});};var _0x5d4ce0=Object[_0x4ee7ae(0x19d)],_0x5109ad=(_0x38e9cc,_0x4c3c3b,_0x1b4748,_0x1db712)=>{for(var _0x58f82d=_0x1db712>0x1?void 0x0:_0x1db712?_0x5d4ce0(_0x4c3c3b,_0x1b4748):_0x4c3c3b,_0x248ab4=_0x38e9cc['length']-0x1,_0x2dcdd2;_0x248ab4>=0x0;_0x248ab4--)(_0x2dcdd2=_0x38e9cc[_0x248ab4])&&(_0x58f82d=_0x2dcdd2(_0x58f82d)||_0x58f82d);return _0x58f82d;},_0x22470d=(_0x5cbc2a,_0x41c516)=>(_0x10989e,_0x70f420)=>_0x41c516(_0x10989e,_0x70f420,_0x5cbc2a);let _0xfe1272=class extends _0x5d7b55['Disposable']{constructor(_0x114b59,_0x6442a4,_0x2f6b9d,_0x3a4159){const _0x57aeb6=_0x4ee7ae;super(),this[_0x57aeb6(0x1af)]=_0x114b59,this[_0x57aeb6(0x1d8)]=_0x6442a4,this[_0x57aeb6(0x16f)]=_0x2f6b9d,this['_injector']=_0x3a4159,this[_0x57aeb6(0x1d9)](),this[_0x57aeb6(0x16d)]();}[_0x4ee7ae(0x16d)](){const _0xf6a579=_0x4ee7ae;this['disposeWithMe'](this[_0xf6a579(0x1d8)]['commentUpdate$'][_0xf6a579(0x1dd)](_0x19f8fe[_0xf6a579(0x1a3)](0x10))['subscribe'](_0x357228=>{const _0x2b4b95=_0xf6a579,_0x150c7c=new Set();_0x357228[_0x2b4b95(0x1e2)](_0x24eb87=>{const _0x5b5c94=_0x2b4b95;switch(_0x24eb87[_0x5b5c94(0x195)]){case _0x5b5c94(0x1e8):{const _0x2ee0ef=_0x24eb87['payload'][_0x5b5c94(0x172)];_0x150c7c[_0x5b5c94(0x1e8)](_0x2ee0ef);break;}}}),_0x4166d2(this[_0x2b4b95(0x182)],_0x150c7c);}));}[_0x4ee7ae(0x1d9)](){const _0x31334d=_0x4ee7ae;this[_0x31334d(0x186)](this[_0x31334d(0x1af)][_0x31334d(0x175)][_0x31334d(0x18a)](async _0x40b9cd=>{const _0x90d507=_0x31334d;var _0x23d5f2,_0x3c501d,_0x102171,_0xf5edb1;const _0x644cd2=(_0x23d5f2=this[_0x90d507(0x1d8)][_0x90d507(0x19e)](_0x40b9cd[_0x90d507(0x17d)])[_0x90d507(0x1cc)](_0x444f86=>_0x444f86[_0x90d507(0x188)]===_0x40b9cd[_0x90d507(0x188)]))==null?void 0x0:_0x23d5f2[_0x90d507(0x1cd)];if(!_0x644cd2)return;const {unitId:_0xff2c8c,subUnitId:_0x5837e7}=_0x644cd2;switch(_0x40b9cd[_0x90d507(0x187)]&&this[_0x90d507(0x16f)][_0x90d507(0x1f3)](_0x40b9cd[_0x90d507(0x187)]),_0x40b9cd['type']){case _0x12cc8a['Add']:break;case _0x12cc8a[_0x90d507(0x1df)]:{this[_0x90d507(0x1d8)]['addComment'](_0xff2c8c,_0x5837e7,{'unitId':_0xff2c8c,'subUnitId':_0x5837e7,'ref':'','id':_0x40b9cd[_0x90d507(0x1ea)],'dT':_0x2748e5(+_0x40b9cd['createTimestamp']),'threadId':_0x40b9cd[_0x90d507(0x188)],'personId':(_0x102171=(_0x3c501d=_0x40b9cd[_0x90d507(0x187)])==null?void 0x0:_0x3c501d[_0x90d507(0x1d5)])!=null?_0x102171:_0x40b9cd['userId'],'text':JSON[_0x90d507(0x1b7)](_0x40b9cd[_0x90d507(0x1c0)]),'parentId':_0x644cd2['id']});break;}case _0x12cc8a[_0x90d507(0x18c)]:{const _0x1518f4=this[_0x90d507(0x1d8)][_0x90d507(0x1ab)](_0xff2c8c,_0x5837e7,_0x40b9cd[_0x90d507(0x1ea)]);_0x1518f4&&_0x1518f4[_0x90d507(0x197)]&&this[_0x90d507(0x1d8)][_0x90d507(0x1f0)](_0xff2c8c,_0x5837e7,_0x40b9cd[_0x90d507(0x1ea)]);break;}case _0x12cc8a['Edit']:{this[_0x90d507(0x1d8)][_0x90d507(0x176)](_0xff2c8c,_0x5837e7,{'commentId':_0x40b9cd[_0x90d507(0x1ea)],'text':JSON['parse'](_0x40b9cd['content'])});break;}case _0x12cc8a['Solve']:{const _0x22e655=(_0xf5edb1=this[_0x90d507(0x1d8)]['getUnit'](_0x40b9cd[_0x90d507(0x17d)])[_0x90d507(0x1cc)](_0x5a2022=>_0x5a2022[_0x90d507(0x188)]===_0x40b9cd[_0x90d507(0x188)]))==null?void 0x0:_0xf5edb1[_0x90d507(0x1cd)];_0x22e655&&this['_threadCommentModel']['resolveComment'](_0xff2c8c,_0x5837e7,_0x22e655['id'],_0x40b9cd[_0x90d507(0x1ed)]===_0x56c0d7[_0x90d507(0x1ce)]);break;}}}));}};_0xfe1272=_0x5109ad([_0x22470d(0x0,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x4f3a5e[_0x4ee7ae(0x1e7)])),_0x22470d(0x1,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x4a4c1c[_0x4ee7ae(0x1a6)])),_0x22470d(0x2,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x5d7b55[_0x4ee7ae(0x183)])),_0x22470d(0x3,_0x5d7b55['Inject'](_0x5d7b55[_0x4ee7ae(0x17f)]))],_0xfe1272);const _0x459237=_0x4ee7ae(0x19f),_0x40d206={};var _0x93202e=Object[_0x4ee7ae(0x19d)],_0x85d0dd=(_0x2721a1,_0x18ca58,_0x5e606b,_0x356a40)=>{const _0x4ff7e1=_0x4ee7ae;for(var _0x15711e=_0x356a40>0x1?void 0x0:_0x356a40?_0x93202e(_0x18ca58,_0x5e606b):_0x18ca58,_0x1ac273=_0x2721a1[_0x4ff7e1(0x1e0)]-0x1,_0x554350;_0x1ac273>=0x0;_0x1ac273--)(_0x554350=_0x2721a1[_0x1ac273])&&(_0x15711e=_0x554350(_0x15711e)||_0x15711e);return _0x15711e;},_0x15e964=(_0x4fa943,_0x5564ea)=>(_0x442a0b,_0x588bd9)=>_0x5564ea(_0x442a0b,_0x588bd9,_0x4fa943);function _0x5a29e5(_0x553478,_0x200e3a){const _0xe00cd1=_0x4ee7ae,_0x1e7c22=_0x553478[_0xe00cd1(0x1a1)][0x0];return{..._0x200e3a,'id':_0x1e7c22['replyId'],'resolved':_0x553478['solved']===0x1,'dT':_0x2748e5(_0x1e7c22[_0xe00cd1(0x1be)]),'personId':_0x1e7c22[_0xe00cd1(0x19c)],'threadId':_0x1e7c22[_0xe00cd1(0x188)]};}function _0x24e670(_0x59a422,_0x5b0d6f,_0x77c8c5){const _0x2a3c1b=_0x4ee7ae;var _0x5ce125,_0x286d40;if(((_0x286d40=(_0x5ce125=_0x59a422==null?void 0x0:_0x59a422[_0x2a3c1b(0x1a1)])==null?void 0x0:_0x5ce125[_0x2a3c1b(0x1e0)])!=null?_0x286d40:0x0)>0x0){const _0x19eae3=(_0x8b3ea1,_0x54409f)=>({'id':_0x8b3ea1[_0x2a3c1b(0x1ea)],'threadId':_0x8b3ea1['threadId'],'dT':_0x2748e5(_0x8b3ea1[_0x2a3c1b(0x1be)]),'personId':_0x8b3ea1['userId'],'resolved':_0x59a422[_0x2a3c1b(0x1ed)]===_0x56c0d7[_0x2a3c1b(0x1ce)],'unitId':_0x5b0d6f,'subUnitId':_0x77c8c5,'text':JSON[_0x2a3c1b(0x1b7)](_0x8b3ea1[_0x2a3c1b(0x1c0)]),'parentId':_0x54409f}),_0x31f3bc=_0x19eae3(_0x59a422[_0x2a3c1b(0x1a1)][0x0]);return{..._0x31f3bc,'children':_0x59a422[_0x2a3c1b(0x1a1)]['slice'](0x1)[_0x2a3c1b(0x1b2)](_0x380c79=>_0x19eae3(_0x380c79,_0x31f3bc['id']))};}return null;}let _0x3816e8=class{constructor(_0x4c8cc9,_0x2cad46,_0x3c8894,_0x26da1f){const _0x50f093=_0x4ee7ae;this['_httpService']=_0x4c8cc9,this['_userService']=_0x2cad46,this[_0x50f093(0x1a4)]=_0x3c8894,this['_injector']=_0x26da1f;}async[_0x4ee7ae(0x192)](_0xc460d7){const _0x11ad2e=_0x4ee7ae;var _0x177eea,_0x50038b;const {parentId:_0x167ded,unitId:_0x1f0c75,text:_0x366324,threadId:_0x244f40}=_0xc460d7,_0x25fd68=(_0x50038b=(_0x177eea=_0x366324[_0x11ad2e(0x1e5)])==null?void 0x0:_0x177eea[_0x11ad2e(0x1a7)](_0x27e83e=>_0x27e83e[_0x11ad2e(0x1f2)]===_0x5d7b55[_0x11ad2e(0x19b)][_0x11ad2e(0x1ac)])[_0x11ad2e(0x1b2)](_0x54bd0a=>_0x54bd0a[_0x11ad2e(0x198)]))!=null?_0x50038b:[],_0xaf2f4a=JSON[_0x11ad2e(0x1dc)](_0x366324),_0x1b82d1=(await this[_0x11ad2e(0x1a4)][_0x11ad2e(0x1b4)](_0x1f0c75))['getMemberID']();if(_0x167ded){const _0x2e0b61={'memberId':_0x1b82d1,'unitId':_0x1f0c75,'content':_0xaf2f4a,'mention':_0x25fd68,'threadId':_0x244f40},_0x3ced8a=(await this[_0x11ad2e(0x194)][_0x11ad2e(0x1ec)](_0x11ad2e(0x1cf)+_0x1f0c75+_0x11ad2e(0x1a2),{'body':_0x2e0b61}))[_0x11ad2e(0x16e)][_0x11ad2e(0x1b1)];return{..._0xc460d7,'id':_0x3ced8a[_0x11ad2e(0x1ea)],'dT':_0x5d7b55[_0x11ad2e(0x179)](+_0x3ced8a[_0x11ad2e(0x1be)])['format']('YYYY/MM/DD\x20HH:mm'),'personId':_0x3ced8a['userId']};}else{const _0x2fdbd0={'memberId':_0x1b82d1,'unitId':_0x1f0c75,'content':_0xaf2f4a,'mention':_0x25fd68},_0x5d51e3=await this[_0x11ad2e(0x194)][_0x11ad2e(0x1ec)]('/universer-api/comment/unit/'+_0x1f0c75+'/add',{'body':_0x2fdbd0});return _0x5a29e5(_0x5d51e3['body'][_0x11ad2e(0x1c2)],_0xc460d7);}}async[_0x4ee7ae(0x176)](_0xe5fb20){const _0x25433d=_0x4ee7ae;var _0x17a0b2,_0x36e0fe;const {text:_0x3e3bb0,unitId:_0x3f1c79}=_0xe5fb20,_0x3b8faa=(_0x36e0fe=(_0x17a0b2=_0x3e3bb0[_0x25433d(0x1e5)])==null?void 0x0:_0x17a0b2[_0x25433d(0x1a7)](_0x339579=>_0x339579[_0x25433d(0x1f2)]===_0x5d7b55[_0x25433d(0x19b)]['COMMENT'])[_0x25433d(0x1b2)](_0x5aad6f=>_0x5aad6f[_0x25433d(0x198)]))!=null?_0x36e0fe:[],_0x658372=JSON[_0x25433d(0x1dc)](_0x3e3bb0),_0x496049=_0xe5fb20[_0x25433d(0x188)],_0x108977=_0xe5fb20['id'],_0x1826cb={'memberId':(await this[_0x25433d(0x1a4)]['requireSession'](_0x3f1c79))[_0x25433d(0x18b)](),'unitId':_0x3f1c79,'threadId':_0x496049,'mention':_0x3b8faa,'content':_0x658372,'replyId':_0x108977},_0x4810bc=await this['_httpService'][_0x25433d(0x1ec)](_0x25433d(0x1cf)+_0x3f1c79+_0x25433d(0x1ad),{'body':_0x1826cb});return!_0x4810bc[_0x25433d(0x16e)][_0x25433d(0x16c)]||_0x4810bc[_0x25433d(0x16e)][_0x25433d(0x16c)]['code']===0x1;}async[_0x4ee7ae(0x1da)](_0x257a4a){const _0x2b995b=_0x4ee7ae,{unitId:_0x404de0}=_0x257a4a,_0x38d6e8=_0x257a4a[_0x2b995b(0x188)],_0x4f91db={'memberId':this[_0x2b995b(0x16f)][_0x2b995b(0x190)]()[_0x2b995b(0x1d5)],'unitId':_0x404de0,'threadId':_0x38d6e8,'solved':_0x257a4a[_0x2b995b(0x1d6)]?_0x56c0d7[_0x2b995b(0x1ce)]:_0x56c0d7[_0x2b995b(0x181)]},_0x5fb053=await this[_0x2b995b(0x194)][_0x2b995b(0x1ec)]('/universer-api/comment/unit/'+_0x404de0+_0x2b995b(0x1eb),{'body':_0x4f91db});return!_0x5fb053[_0x2b995b(0x16e)][_0x2b995b(0x16c)]||_0x5fb053[_0x2b995b(0x16e)][_0x2b995b(0x16c)][_0x2b995b(0x1d4)]===0x1;}async[_0x4ee7ae(0x1f0)](_0x1f1d17,_0x3463b1,_0x3e3946,_0x1c74ff){const _0x45450b=_0x4ee7ae,_0x55e7d0={'memberId':(await this[_0x45450b(0x1a4)][_0x45450b(0x1b4)](_0x1f1d17))[_0x45450b(0x18b)](),'threadId':_0x3e3946,'replyId':_0x1c74ff,'unitId':_0x1f1d17},_0x49d253=await this['_httpService'][_0x45450b(0x1ec)](_0x45450b(0x1cf)+_0x1f1d17+'/delete',{'body':_0x55e7d0});return!_0x49d253[_0x45450b(0x16e)][_0x45450b(0x16c)]||_0x49d253[_0x45450b(0x16e)][_0x45450b(0x16c)][_0x45450b(0x1d4)]===0x1;}async[_0x4ee7ae(0x18f)](_0x5c3313,_0x4693d6,_0x501cf2){const _0x4b85e2=_0x4ee7ae,_0x1a4250={'unitId':_0x5c3313,'threadId':_0x501cf2},_0x21f6ea=await this[_0x4b85e2(0x194)]['post']('/universer-api/comment/unit/'+_0x5c3313+'/list',{'body':_0x1a4250}),_0x38cc80=_0x501cf2[_0x4b85e2(0x1b2)](_0x1b90f3=>_0x24e670(_0x21f6ea['body'][_0x4b85e2(0x177)][_0x1b90f3],_0x5c3313,_0x4693d6))[_0x4b85e2(0x1a7)](Boolean);return Object[_0x4b85e2(0x1e9)](_0x21f6ea[_0x4b85e2(0x16e)][_0x4b85e2(0x1ee)])[_0x4b85e2(0x1e2)](_0x4ec0fc=>{const _0x38e915=_0x4b85e2;this[_0x38e915(0x16f)][_0x38e915(0x1f3)](_0x4ec0fc);}),_0x38cc80;}[_0x4ee7ae(0x16b)](_0x11f200){const _0x3fb2f4=_0x4ee7ae;return{'id':_0x11f200['id'],'threadId':_0x11f200[_0x3fb2f4(0x188)],'ref':_0x11f200['ref']};}};_0x3816e8=_0x85d0dd([_0x15e964(0x0,_0x5d7b55['Inject'](_0x58c84a[_0x4ee7ae(0x1c3)])),_0x15e964(0x1,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x5d7b55['UserManagerService'])),_0x15e964(0x2,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x4f3a5e['CollaborationSessionService'])),_0x15e964(0x3,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x5d7b55['Injector']))],_0x3816e8);var _0x49fcdc=Object[_0x4ee7ae(0x19d)],_0x18428d=(_0x459682,_0x34df90,_0x592ede,_0x1c39e6)=>{for(var _0x2f4680=_0x1c39e6>0x1?void 0x0:_0x1c39e6?_0x49fcdc(_0x34df90,_0x592ede):_0x34df90,_0x563cec=_0x459682['length']-0x1,_0x3593d6;_0x563cec>=0x0;_0x563cec--)(_0x3593d6=_0x459682[_0x563cec])&&(_0x2f4680=_0x3593d6(_0x2f4680)||_0x2f4680);return _0x2f4680;},_0x96e8ec=(_0x3569ea,_0x10d912)=>(_0x2a089e,_0x31b4ef)=>_0x10d912(_0x2a089e,_0x31b4ef,_0x3569ea);let _0x4f1f69=class extends _0x5d7b55[_0x4ee7ae(0x1d7)]{constructor(_0x5bca98,_0x4c8c2e){const _0x56e710=_0x4ee7ae;super(),this['_threadCommentDataSourceService']=_0x5bca98,this[_0x56e710(0x1b0)]=_0x4c8c2e,this[_0x56e710(0x1b9)]();}['_initDataSource'](){const _0x26c7f1=_0x4ee7ae;this[_0x26c7f1(0x1b6)][_0x26c7f1(0x1c6)]=this['_threadCommentDataSource'],this[_0x26c7f1(0x1b6)][_0x26c7f1(0x1b5)]=!0x1;}};_0x4f1f69=_0x18428d([_0x96e8ec(0x0,_0x4a4c1c[_0x4ee7ae(0x17c)]),_0x96e8ec(0x1,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x3816e8))],_0x4f1f69);var _0x3095ea=Object[_0x4ee7ae(0x17e)],_0x5d0b36=Object[_0x4ee7ae(0x19d)],_0x583465=(_0x32beb0,_0x3aa066,_0x4c9a5a)=>_0x3aa066 in _0x32beb0?_0x3095ea(_0x32beb0,_0x3aa066,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4c9a5a}):_0x32beb0[_0x3aa066]=_0x4c9a5a,_0x4919af=(_0x4888dd,_0x320cc6,_0x1b7992,_0x10a078)=>{const _0x423b45=_0x4ee7ae;for(var _0x47f949=_0x10a078>0x1?void 0x0:_0x10a078?_0x5d0b36(_0x320cc6,_0x1b7992):_0x320cc6,_0x241c0b=_0x4888dd[_0x423b45(0x1e0)]-0x1,_0x56d4af;_0x241c0b>=0x0;_0x241c0b--)(_0x56d4af=_0x4888dd[_0x241c0b])&&(_0x47f949=_0x56d4af(_0x47f949)||_0x47f949);return _0x47f949;},_0x4814c0=(_0x428ee3,_0x14d615)=>(_0x5822f1,_0x37cc24)=>_0x14d615(_0x5822f1,_0x37cc24,_0x428ee3),_0x72896d=(_0x4addcb,_0x538dcf,_0x2acce0)=>_0x583465(_0x4addcb,typeof _0x538dcf!=_0x4ee7ae(0x1ef)?_0x538dcf+'':_0x538dcf,_0x2acce0);_0x2554b4[_0x4ee7ae(0x1c4)]=class extends _0x5d7b55[_0x4ee7ae(0x173)]{constructor(_0x2a308c=_0x40d206,_0x1f0104,_0x1ec9ac){const _0x573ed5=_0x4ee7ae;super(),this['_config']=_0x2a308c,this['_injector']=_0x1f0104,this[_0x573ed5(0x1aa)]=_0x1ec9ac;const {..._0x1e86cf}=_0x5d7b55[_0x573ed5(0x184)]({},_0x40d206,this[_0x573ed5(0x1e6)]);this[_0x573ed5(0x1aa)][_0x573ed5(0x1f4)](_0x459237,_0x1e86cf);}[_0x4ee7ae(0x1bb)](){const _0x351ae6=_0x4ee7ae;[[_0x3816e8],[_0x4f1f69],[_0xfe1272]][_0x351ae6(0x1e2)](_0x54ac9f=>{const _0x561c5a=_0x351ae6;this[_0x561c5a(0x182)][_0x561c5a(0x1e8)](_0x54ac9f);});}['onReady'](){const _0x28a241=_0x4ee7ae;this['_injector']['get'](_0x4f1f69),this[_0x28a241(0x182)][_0x28a241(0x196)](_0xfe1272);}},_0x72896d(_0x2554b4[_0x4ee7ae(0x1c4)],'pluginName',_0x44ede7),_0x72896d(_0x2554b4[_0x4ee7ae(0x1c4)],'type',_0x5d7b55[_0x4ee7ae(0x1a0)]['UNIVER_UNKNOWN']),_0x2554b4[_0x4ee7ae(0x1c4)]=_0x4919af([_0x5d7b55[_0x4ee7ae(0x1ae)](_0xeab3c7[_0x4ee7ae(0x170)],_0x4f3a5e['UniverCollaborationClientPlugin'],_0x16d3cc['UniverLicensePlugin']),_0x4814c0(0x1,_0x5d7b55[_0x4ee7ae(0x1a5)](_0x5d7b55[_0x4ee7ae(0x17f)])),_0x4814c0(0x2,_0x5d7b55[_0x4ee7ae(0x1c1)])],_0x2554b4[_0x4ee7ae(0x1c4)]),Object[_0x4ee7ae(0x17e)](_0x2554b4,Symbol['toStringTag'],{'value':'Module'});}));
|
|
1
|
+
function _0x372f(){const _0x590e33=['Solved','commentUpdate$','disposeWithMe','UniverThreadCommentUIPlugin','_threadCommentModel','getComment','object','dataSource','5042828quSwyU','COMMENT','forEach','find','rxjs','UNRECOGNIZED','userID','_sessionService','/solved','UniverNetwork','92287wmeItZ','_httpService','2680948QdMEQU','_threadCommentDataSource','UserManagerService','@univerjs-pro/collaboration-client','rangeType','OpenOrReOpen','UniverProCollaborationClient','add','thread-comment-data-source.config','resolveComment','subscribe','5351255SuSdJK','length','@univerjs/thread-comment-ui','Inject','onStarting','root','getUser','syncUpdateMutationToColla','getCurrentUser','/universer-api/comment/unit/','map','toStringTag','Injector','addComment','addUser','comments','Module','rangeId','@univerjs/network','error','createTimestamp','Plugin','updateComment','Solve','Edit','ThreadCommentModel','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','solved','UniverInstanceType','personId','_injector','exports','content','27959712jqOiYs','get','IThreadCommentDataSourceService','body','3008460FzIMrj','Unknown','_init','CollaborationSessionService','saveCommentToSnapshot','Delete','UniverCollaborationClientPlugin','resolved','format','UniverProThreadCommentDatasource','user','UniverCore','Reply','getOwnPropertyDescriptor','_userService','filter','replies','getUnit','requireSession','HTTPService','394854XQylbt','parse','users','replyId','/reply','reply','code','dayjs','_commentService','post','_configService','UniverThreadCommentDataSourcePlugin','CustomRangeType','pluginName','/delete','_threadCommentDataSourceService','@univerjs/thread-comment','defineProperty','userId','getMemberID','_config','@univerjs-pro/license','_initDataSource','/universer-api/user/list','bufferTime','parentId','onReady','size','@univerjs/core','CommentService','Add','/edit','listComments','/list','customRanges','function','UniverProLicense','stringify','6WgahoO','threadId','deleteComment','type','pipe','YYYY/MM/DD\x20HH:mm'];_0x372f=function(){return _0x590e33;};return _0x372f();}function _0x2a14(_0x33dc94,_0x2b2f88){const _0x372fcc=_0x372f();return _0x2a14=function(_0x2a14f5,_0x557e30){_0x2a14f5=_0x2a14f5-0x9a;let _0x55e630=_0x372fcc[_0x2a14f5];return _0x55e630;},_0x2a14(_0x33dc94,_0x2b2f88);}(function(_0x1b3363,_0x560d02){const _0x55eb81=_0x2a14,_0x8d180=_0x1b3363();while(!![]){try{const _0x1ae9b0=parseInt(_0x55eb81(0x10c))/0x1*(parseInt(_0x55eb81(0xf4))/0x2)+-parseInt(_0x55eb81(0xce))/0x3+-parseInt(_0x55eb81(0x10e))/0x4+-parseInt(_0x55eb81(0x119))/0x5+-parseInt(_0x55eb81(0xba))/0x6+-parseInt(_0x55eb81(0x102))/0x7+parseInt(_0x55eb81(0xb6))/0x8;if(_0x1ae9b0===_0x560d02)break;else _0x8d180['push'](_0x8d180['shift']());}catch(_0x49633a){_0x8d180['push'](_0x8d180['shift']());}}}(_0x372f,0xa5811),function(_0x2496d8,_0x3384ba){const _0x346e50=_0x2a14;typeof exports==_0x346e50(0x100)&&typeof module<'u'?_0x3384ba(exports,require(_0x346e50(0x111)),require('@univerjs-pro/license'),require(_0x346e50(0xea)),require(_0x346e50(0x11b)),require(_0x346e50(0xde)),require(_0x346e50(0x106)),require(_0x346e50(0xa7))):typeof define==_0x346e50(0xf1)&&define['amd']?define([_0x346e50(0xb4),_0x346e50(0x111),_0x346e50(0xe3),_0x346e50(0xea),'@univerjs/thread-comment-ui',_0x346e50(0xde),_0x346e50(0x106),_0x346e50(0xa7)],_0x3384ba):(_0x2496d8=typeof globalThis<'u'?globalThis:_0x2496d8||self,_0x3384ba(_0x2496d8[_0x346e50(0xc3)]={},_0x2496d8[_0x346e50(0x114)],_0x2496d8[_0x346e50(0xf2)],_0x2496d8[_0x346e50(0xc5)],_0x2496d8['UniverThreadCommentUi'],_0x2496d8['UniverThreadComment'],_0x2496d8['rxjs'],_0x2496d8[_0x346e50(0x10b)]));}(this,function(_0x2b4972,_0x153186,_0x1b4088,_0xf0a7f9,_0x56cf0c,_0x37eabe,_0x7a0ece,_0x5e599c){'use strict';const _0x3d86cd=_0x2a14;const _0x3399c7=_0x3d86cd(0xaf);var _0x5b6eb6=(_0x3aa485=>(_0x3aa485[_0x3aa485[_0x3d86cd(0x113)]=0x0]=_0x3d86cd(0x113),_0x3aa485[_0x3aa485[_0x3d86cd(0xfa)]=0x1]=_0x3d86cd(0xfa),_0x3aa485[_0x3aa485[_0x3d86cd(0x107)]=-0x1]=_0x3d86cd(0x107),_0x3aa485))(_0x5b6eb6||{}),_0x33bd75=(_0x3921ad=>(_0x3921ad[_0x3921ad['Unknown']=0x0]=_0x3d86cd(0xbb),_0x3921ad[_0x3921ad['Add']=0x1]=_0x3d86cd(0xec),_0x3921ad[_0x3921ad[_0x3d86cd(0xc6)]=0x2]='Reply',_0x3921ad[_0x3921ad[_0x3d86cd(0xad)]=0x3]=_0x3d86cd(0xad),_0x3921ad[_0x3921ad['Delete']=0x4]=_0x3d86cd(0xbf),_0x3921ad[_0x3921ad[_0x3d86cd(0xac)]=0x5]=_0x3d86cd(0xac),_0x3921ad[_0x3921ad[_0x3d86cd(0x107)]=-0x1]=_0x3d86cd(0x107),_0x3921ad))(_0x33bd75||{});const _0x20ca0e=_0x25d397=>_0xf0a7f9['dayjs'](new Date(+_0x25d397))[_0x3d86cd(0xc2)](_0x3d86cd(0xf9)),_0x4c1372=async(_0x509cf1,_0x42709a)=>{const _0x455a3c=_0x3d86cd,_0x11499d=_0x509cf1[_0x455a3c(0xb7)](_0xf0a7f9['UserManagerService']),_0x19eba2=_0x509cf1[_0x455a3c(0xb7)](_0x5e599c[_0x455a3c(0xcd)]);_0x42709a[_0x455a3c(0x104)](_0x380394=>{const _0x40b87f=_0x455a3c;_0x11499d[_0x40b87f(0x9b)](_0x380394)&&_0x42709a['delete'](_0x380394);}),_0x42709a[_0x455a3c(0xe9)]&&(await _0x19eba2['get'](_0x455a3c(0xe5),{'params':{'userIDs':[..._0x42709a]}}))[_0x455a3c(0xb9)][_0x455a3c(0xd0)]['forEach'](_0x426edb=>{_0x426edb&&_0x11499d['addUser'](_0x426edb);});};var _0x14eec8=Object[_0x3d86cd(0xc7)],_0x29e126=(_0x34d875,_0x28c33c,_0x55e814,_0x55e996)=>{const _0x18a99e=_0x3d86cd;for(var _0x4acb32=_0x55e996>0x1?void 0x0:_0x55e996?_0x14eec8(_0x28c33c,_0x55e814):_0x28c33c,_0x1604db=_0x34d875[_0x18a99e(0x11a)]-0x1,_0x37b7ed;_0x1604db>=0x0;_0x1604db--)(_0x37b7ed=_0x34d875[_0x1604db])&&(_0x4acb32=_0x37b7ed(_0x4acb32)||_0x4acb32);return _0x4acb32;},_0x35aace=(_0x158e64,_0x33f52f)=>(_0x1aac22,_0xf24474)=>_0x33f52f(_0x1aac22,_0xf24474,_0x158e64);let _0x1e2814=class extends _0xf0a7f9['Disposable']{constructor(_0x2d07fa,_0x10a8cb,_0x32728a,_0x505b9c){const _0x2b420f=_0x3d86cd;super(),this['_commentService']=_0x2d07fa,this[_0x2b420f(0xfe)]=_0x10a8cb,this[_0x2b420f(0xc8)]=_0x32728a,this['_injector']=_0x505b9c,this[_0x2b420f(0xbc)](),this['_initUserSync']();}['_initUserSync'](){const _0x3f9b27=_0x3d86cd;this['disposeWithMe'](this['_threadCommentModel'][_0x3f9b27(0xfb)][_0x3f9b27(0xf8)](_0x7a0ece[_0x3f9b27(0xe6)](0x10))[_0x3f9b27(0x118)](_0x516c42=>{const _0x375199=_0x3f9b27,_0x55f854=new Set();_0x516c42[_0x375199(0x104)](_0x502f40=>{const _0x27e027=_0x375199;switch(_0x502f40[_0x27e027(0xf7)]){case _0x27e027(0x115):{const _0x246af=_0x502f40['payload'][_0x27e027(0xb2)];_0x55f854[_0x27e027(0x115)](_0x246af);break;}}}),_0x4c1372(this[_0x375199(0xb3)],_0x55f854);}));}[_0x3d86cd(0xbc)](){const _0x1a96a9=_0x3d86cd;this[_0x1a96a9(0xfc)](this[_0x1a96a9(0xd6)][_0x1a96a9(0xfb)][_0x1a96a9(0x118)](async _0x438949=>{const _0x5d7087=_0x1a96a9;var _0x503679,_0x6b4dc6,_0x7dd254,_0xc98db2;const _0x16520a=(_0x503679=this[_0x5d7087(0xfe)][_0x5d7087(0xcb)](_0x438949['unitId'])['find'](_0x549b8b=>_0x549b8b['threadId']===_0x438949[_0x5d7087(0xf5)]))==null?void 0x0:_0x503679[_0x5d7087(0x9a)];if(!_0x16520a)return;const {unitId:_0x4fe338,subUnitId:_0x36b010}=_0x16520a;switch(_0x438949[_0x5d7087(0xc4)]&&this[_0x5d7087(0xc8)]['addUser'](_0x438949[_0x5d7087(0xc4)]),_0x438949['type']){case _0x33bd75['Add']:break;case _0x33bd75[_0x5d7087(0xc6)]:{this[_0x5d7087(0xfe)][_0x5d7087(0xa2)](_0x4fe338,_0x36b010,{'unitId':_0x4fe338,'subUnitId':_0x36b010,'ref':'','id':_0x438949[_0x5d7087(0xd1)],'dT':_0x20ca0e(+_0x438949['createTimestamp']),'threadId':_0x438949[_0x5d7087(0xf5)],'personId':(_0x7dd254=(_0x6b4dc6=_0x438949[_0x5d7087(0xc4)])==null?void 0x0:_0x6b4dc6[_0x5d7087(0x108)])!=null?_0x7dd254:_0x438949[_0x5d7087(0xe0)],'text':JSON['parse'](_0x438949[_0x5d7087(0xb5)]),'parentId':_0x16520a['id']});break;}case _0x33bd75[_0x5d7087(0xbf)]:{const _0x117af7=this[_0x5d7087(0xfe)][_0x5d7087(0xff)](_0x4fe338,_0x36b010,_0x438949['replyId']);_0x117af7&&_0x117af7[_0x5d7087(0xe7)]&&this[_0x5d7087(0xfe)][_0x5d7087(0xf6)](_0x4fe338,_0x36b010,_0x438949[_0x5d7087(0xd1)]);break;}case _0x33bd75[_0x5d7087(0xad)]:{this[_0x5d7087(0xfe)][_0x5d7087(0xab)](_0x4fe338,_0x36b010,{'commentId':_0x438949['replyId'],'text':JSON[_0x5d7087(0xcf)](_0x438949[_0x5d7087(0xb5)])});break;}case _0x33bd75[_0x5d7087(0xac)]:{const _0x492a5f=(_0xc98db2=this[_0x5d7087(0xfe)][_0x5d7087(0xcb)](_0x438949['unitId'])[_0x5d7087(0x105)](_0xcd27fc=>_0xcd27fc[_0x5d7087(0xf5)]===_0x438949[_0x5d7087(0xf5)]))==null?void 0x0:_0xc98db2['root'];_0x492a5f&&this[_0x5d7087(0xfe)][_0x5d7087(0x117)](_0x4fe338,_0x36b010,_0x492a5f['id'],_0x438949[_0x5d7087(0xb0)]===_0x5b6eb6[_0x5d7087(0xfa)]);break;}}}));}};_0x1e2814=_0x29e126([_0x35aace(0x0,_0xf0a7f9[_0x3d86cd(0x11c)](_0x153186[_0x3d86cd(0xeb)])),_0x35aace(0x1,_0xf0a7f9[_0x3d86cd(0x11c)](_0x37eabe[_0x3d86cd(0xae)])),_0x35aace(0x2,_0xf0a7f9[_0x3d86cd(0x11c)](_0xf0a7f9[_0x3d86cd(0x110)])),_0x35aace(0x3,_0xf0a7f9['Inject'](_0xf0a7f9['Injector']))],_0x1e2814);const _0x3bf006=_0x3d86cd(0x116),_0x402ac2={};var _0x4667ab=Object[_0x3d86cd(0xc7)],_0x4ea974=(_0x5b5222,_0x4b2e6c,_0x2ee8ca,_0x358616)=>{const _0x550c56=_0x3d86cd;for(var _0x11a6a7=_0x358616>0x1?void 0x0:_0x358616?_0x4667ab(_0x4b2e6c,_0x2ee8ca):_0x4b2e6c,_0x19932d=_0x5b5222[_0x550c56(0x11a)]-0x1,_0x51fe66;_0x19932d>=0x0;_0x19932d--)(_0x51fe66=_0x5b5222[_0x19932d])&&(_0x11a6a7=_0x51fe66(_0x11a6a7)||_0x11a6a7);return _0x11a6a7;},_0x146181=(_0x50793d,_0x4d0d64)=>(_0x5499df,_0x30573c)=>_0x4d0d64(_0x5499df,_0x30573c,_0x50793d);function _0x5b3df(_0x25fd8a,_0x4c01e5){const _0x449767=_0x3d86cd,_0x35f691=_0x25fd8a[_0x449767(0xca)][0x0];return{..._0x4c01e5,'id':_0x35f691['replyId'],'resolved':_0x25fd8a[_0x449767(0xb0)]===0x1,'dT':_0x20ca0e(_0x35f691['createTimestamp']),'personId':_0x35f691[_0x449767(0xe0)],'threadId':_0x35f691[_0x449767(0xf5)]};}function _0x1b50fd(_0x5cab63,_0x4233de,_0x3d4381){const _0x459306=_0x3d86cd;var _0x2b7e1b,_0x271e9d;if(((_0x271e9d=(_0x2b7e1b=_0x5cab63==null?void 0x0:_0x5cab63[_0x459306(0xca)])==null?void 0x0:_0x2b7e1b[_0x459306(0x11a)])!=null?_0x271e9d:0x0)>0x0){const _0x26659a=(_0x30018a,_0x1e736f)=>({'id':_0x30018a['replyId'],'threadId':_0x30018a[_0x459306(0xf5)],'dT':_0x20ca0e(_0x30018a['createTimestamp']),'personId':_0x30018a[_0x459306(0xe0)],'resolved':_0x5cab63['solved']===_0x5b6eb6[_0x459306(0xfa)],'unitId':_0x4233de,'subUnitId':_0x3d4381,'text':JSON['parse'](_0x30018a[_0x459306(0xb5)]),'parentId':_0x1e736f}),_0x4adcf4=_0x26659a(_0x5cab63[_0x459306(0xca)][0x0]);return{..._0x4adcf4,'children':_0x5cab63[_0x459306(0xca)]['slice'](0x1)[_0x459306(0x9f)](_0x18e4a4=>_0x26659a(_0x18e4a4,_0x4adcf4['id']))};}return null;}let _0x3f497e=class{constructor(_0xc9e66a,_0xe5ca1a,_0x573e5,_0x38c9c0){const _0x419c04=_0x3d86cd;this['_httpService']=_0xc9e66a,this[_0x419c04(0xc8)]=_0xe5ca1a,this[_0x419c04(0x109)]=_0x573e5,this['_injector']=_0x38c9c0;}async[_0x3d86cd(0xa2)](_0x5d8c69){const _0x4b338e=_0x3d86cd;var _0x54dc35,_0xa9dcf4;const {parentId:_0x2c27b7,unitId:_0x142643,text:_0x3c53d6,threadId:_0x493157}=_0x5d8c69,_0x5fd3b1=(_0xa9dcf4=(_0x54dc35=_0x3c53d6['customRanges'])==null?void 0x0:_0x54dc35[_0x4b338e(0xc9)](_0x2bc785=>_0x2bc785[_0x4b338e(0x112)]===_0xf0a7f9['CustomRangeType'][_0x4b338e(0x103)])['map'](_0x46475f=>_0x46475f[_0x4b338e(0xa6)]))!=null?_0xa9dcf4:[],_0x573a7c=JSON[_0x4b338e(0xf3)](_0x3c53d6),_0x19d95d=(await this['_sessionService']['requireSession'](_0x142643))['getMemberID']();if(_0x2c27b7){const _0xfed5ea={'memberId':_0x19d95d,'unitId':_0x142643,'content':_0x573a7c,'mention':_0x5fd3b1,'threadId':_0x493157},_0xfc6870=(await this[_0x4b338e(0x10d)][_0x4b338e(0xd7)](_0x4b338e(0x9e)+_0x142643+_0x4b338e(0xd2),{'body':_0xfed5ea}))[_0x4b338e(0xb9)][_0x4b338e(0xd3)];return{..._0x5d8c69,'id':_0xfc6870[_0x4b338e(0xd1)],'dT':_0xf0a7f9[_0x4b338e(0xd5)](+_0xfc6870[_0x4b338e(0xa9)])[_0x4b338e(0xc2)]('YYYY/MM/DD\x20HH:mm'),'personId':_0xfc6870[_0x4b338e(0xe0)]};}else{const _0x3cf0d3={'memberId':_0x19d95d,'unitId':_0x142643,'content':_0x573a7c,'mention':_0x5fd3b1},_0x589b86=await this['_httpService'][_0x4b338e(0xd7)](_0x4b338e(0x9e)+_0x142643+'/add',{'body':_0x3cf0d3});return _0x5b3df(_0x589b86['body']['comment'],_0x5d8c69);}}async[_0x3d86cd(0xab)](_0x1ca750){const _0x4ecc68=_0x3d86cd;var _0x468908,_0x36528a;const {text:_0x1fe948,unitId:_0x26ae73}=_0x1ca750,_0x4276a4=(_0x36528a=(_0x468908=_0x1fe948[_0x4ecc68(0xf0)])==null?void 0x0:_0x468908[_0x4ecc68(0xc9)](_0x3c99cd=>_0x3c99cd[_0x4ecc68(0x112)]===_0xf0a7f9[_0x4ecc68(0xda)][_0x4ecc68(0x103)])[_0x4ecc68(0x9f)](_0x37cb3a=>_0x37cb3a[_0x4ecc68(0xa6)]))!=null?_0x36528a:[],_0x362617=JSON[_0x4ecc68(0xf3)](_0x1fe948),_0x2fe78a=_0x1ca750[_0x4ecc68(0xf5)],_0x48197b=_0x1ca750['id'],_0x3056a7={'memberId':(await this['_sessionService'][_0x4ecc68(0xcc)](_0x26ae73))[_0x4ecc68(0xe1)](),'unitId':_0x26ae73,'threadId':_0x2fe78a,'mention':_0x4276a4,'content':_0x362617,'replyId':_0x48197b},_0x102b76=await this[_0x4ecc68(0x10d)][_0x4ecc68(0xd7)](_0x4ecc68(0x9e)+_0x26ae73+_0x4ecc68(0xed),{'body':_0x3056a7});return!_0x102b76[_0x4ecc68(0xb9)][_0x4ecc68(0xa8)]||_0x102b76[_0x4ecc68(0xb9)][_0x4ecc68(0xa8)][_0x4ecc68(0xd4)]===0x1;}async[_0x3d86cd(0x117)](_0x2b4462){const _0x622d38=_0x3d86cd,{unitId:_0x23d565}=_0x2b4462,_0x1dd722=_0x2b4462['threadId'],_0x31429={'memberId':this[_0x622d38(0xc8)][_0x622d38(0x9d)]()[_0x622d38(0x108)],'unitId':_0x23d565,'threadId':_0x1dd722,'solved':_0x2b4462[_0x622d38(0xc1)]?_0x5b6eb6[_0x622d38(0xfa)]:_0x5b6eb6[_0x622d38(0x113)]},_0x544c18=await this[_0x622d38(0x10d)][_0x622d38(0xd7)](_0x622d38(0x9e)+_0x23d565+_0x622d38(0x10a),{'body':_0x31429});return!_0x544c18[_0x622d38(0xb9)][_0x622d38(0xa8)]||_0x544c18[_0x622d38(0xb9)][_0x622d38(0xa8)][_0x622d38(0xd4)]===0x1;}async['deleteComment'](_0x35c070,_0x2bf17f,_0x244851,_0x34b591){const _0x38ba82=_0x3d86cd,_0x53b487={'memberId':(await this[_0x38ba82(0x109)]['requireSession'](_0x35c070))[_0x38ba82(0xe1)](),'threadId':_0x244851,'replyId':_0x34b591,'unitId':_0x35c070},_0x458674=await this[_0x38ba82(0x10d)][_0x38ba82(0xd7)](_0x38ba82(0x9e)+_0x35c070+_0x38ba82(0xdc),{'body':_0x53b487});return!_0x458674[_0x38ba82(0xb9)][_0x38ba82(0xa8)]||_0x458674[_0x38ba82(0xb9)][_0x38ba82(0xa8)][_0x38ba82(0xd4)]===0x1;}async[_0x3d86cd(0xee)](_0x121a30,_0xabb2e3,_0x25f6aa){const _0x1fb4c4=_0x3d86cd,_0x2f6026={'unitId':_0x121a30,'threadId':_0x25f6aa},_0x4e2f21=await this[_0x1fb4c4(0x10d)][_0x1fb4c4(0xd7)](_0x1fb4c4(0x9e)+_0x121a30+_0x1fb4c4(0xef),{'body':_0x2f6026}),_0x5dc5a9=_0x25f6aa[_0x1fb4c4(0x9f)](_0x4b8982=>_0x1b50fd(_0x4e2f21['body'][_0x1fb4c4(0xa4)][_0x4b8982],_0x121a30,_0xabb2e3))[_0x1fb4c4(0xc9)](Boolean);return Object['values'](_0x4e2f21[_0x1fb4c4(0xb9)]['users'])[_0x1fb4c4(0x104)](_0x29ab4d=>{const _0x16b03e=_0x1fb4c4;this[_0x16b03e(0xc8)][_0x16b03e(0xa3)](_0x29ab4d);}),_0x5dc5a9;}[_0x3d86cd(0xbe)](_0x26ed38){const _0x3c514e=_0x3d86cd;return{'id':_0x26ed38['id'],'threadId':_0x26ed38[_0x3c514e(0xf5)],'ref':_0x26ed38['ref']};}};_0x3f497e=_0x4ea974([_0x146181(0x0,_0xf0a7f9['Inject'](_0x5e599c['HTTPService'])),_0x146181(0x1,_0xf0a7f9['Inject'](_0xf0a7f9[_0x3d86cd(0x110)])),_0x146181(0x2,_0xf0a7f9['Inject'](_0x153186[_0x3d86cd(0xbd)])),_0x146181(0x3,_0xf0a7f9[_0x3d86cd(0x11c)](_0xf0a7f9[_0x3d86cd(0xa1)]))],_0x3f497e);var _0x1e29e8=Object[_0x3d86cd(0xc7)],_0x3b5ad9=(_0x1e2374,_0x3f9146,_0x4b49f5,_0x3fec1c)=>{const _0x62f8c9=_0x3d86cd;for(var _0x62be45=_0x3fec1c>0x1?void 0x0:_0x3fec1c?_0x1e29e8(_0x3f9146,_0x4b49f5):_0x3f9146,_0x185969=_0x1e2374[_0x62f8c9(0x11a)]-0x1,_0x433971;_0x185969>=0x0;_0x185969--)(_0x433971=_0x1e2374[_0x185969])&&(_0x62be45=_0x433971(_0x62be45)||_0x62be45);return _0x62be45;},_0x495dbf=(_0x2deb35,_0x51dc29)=>(_0x18e373,_0x1a6a96)=>_0x51dc29(_0x18e373,_0x1a6a96,_0x2deb35);let _0x32f0ff=class extends _0xf0a7f9['Disposable']{constructor(_0x21fc35,_0x38e540){const _0x2a2a67=_0x3d86cd;super(),this['_threadCommentDataSourceService']=_0x21fc35,this[_0x2a2a67(0x10f)]=_0x38e540,this[_0x2a2a67(0xe4)]();}[_0x3d86cd(0xe4)](){const _0x51503a=_0x3d86cd;this[_0x51503a(0xdd)][_0x51503a(0x101)]=this[_0x51503a(0x10f)],this[_0x51503a(0xdd)][_0x51503a(0x9c)]=!0x1;}};_0x32f0ff=_0x3b5ad9([_0x495dbf(0x0,_0x37eabe[_0x3d86cd(0xb8)]),_0x495dbf(0x1,_0xf0a7f9[_0x3d86cd(0x11c)](_0x3f497e))],_0x32f0ff);var _0x2d7605=Object[_0x3d86cd(0xdf)],_0x547fa0=Object[_0x3d86cd(0xc7)],_0x24a756=(_0x4d58e1,_0x27856a,_0x52ec5f)=>_0x27856a in _0x4d58e1?_0x2d7605(_0x4d58e1,_0x27856a,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x52ec5f}):_0x4d58e1[_0x27856a]=_0x52ec5f,_0x3e8b14=(_0x3c40cc,_0x5627fe,_0x41db16,_0x2371d4)=>{const _0x50dcfb=_0x3d86cd;for(var _0x2a1fdf=_0x2371d4>0x1?void 0x0:_0x2371d4?_0x547fa0(_0x5627fe,_0x41db16):_0x5627fe,_0x3c8c53=_0x3c40cc[_0x50dcfb(0x11a)]-0x1,_0x2c3f12;_0x3c8c53>=0x0;_0x3c8c53--)(_0x2c3f12=_0x3c40cc[_0x3c8c53])&&(_0x2a1fdf=_0x2c3f12(_0x2a1fdf)||_0x2a1fdf);return _0x2a1fdf;},_0x5c866c=(_0x44c042,_0x14eeba)=>(_0x1c0148,_0x55c8e6)=>_0x14eeba(_0x1c0148,_0x55c8e6,_0x44c042),_0x533b80=(_0x2bce90,_0x4ceeab,_0x3e1ffc)=>_0x24a756(_0x2bce90,typeof _0x4ceeab!='symbol'?_0x4ceeab+'':_0x4ceeab,_0x3e1ffc);_0x2b4972['UniverThreadCommentDataSourcePlugin']=class extends _0xf0a7f9[_0x3d86cd(0xaa)]{constructor(_0x54dcd6=_0x402ac2,_0x4f4fab,_0x16d95e){const _0x2bb48b=_0x3d86cd;super(),this[_0x2bb48b(0xe2)]=_0x54dcd6,this[_0x2bb48b(0xb3)]=_0x4f4fab,this[_0x2bb48b(0xd8)]=_0x16d95e;const {..._0x32238f}=_0xf0a7f9['merge']({},_0x402ac2,this[_0x2bb48b(0xe2)]);this[_0x2bb48b(0xd8)]['setConfig'](_0x3bf006,_0x32238f);}[_0x3d86cd(0x11d)](){const _0x94bd36=_0x3d86cd;[[_0x3f497e],[_0x32f0ff],[_0x1e2814]][_0x94bd36(0x104)](_0x19b09c=>{this['_injector']['add'](_0x19b09c);});}[_0x3d86cd(0xe8)](){const _0x56fb42=_0x3d86cd;this[_0x56fb42(0xb3)][_0x56fb42(0xb7)](_0x32f0ff),this[_0x56fb42(0xb3)]['get'](_0x1e2814);}},_0x533b80(_0x2b4972['UniverThreadCommentDataSourcePlugin'],_0x3d86cd(0xdb),_0x3399c7),_0x533b80(_0x2b4972[_0x3d86cd(0xd9)],_0x3d86cd(0xf7),_0xf0a7f9[_0x3d86cd(0xb1)]['UNIVER_UNKNOWN']),_0x2b4972['UniverThreadCommentDataSourcePlugin']=_0x3e8b14([_0xf0a7f9['DependentOn'](_0x56cf0c[_0x3d86cd(0xfd)],_0x153186[_0x3d86cd(0xc0)],_0x1b4088['UniverLicensePlugin']),_0x5c866c(0x1,_0xf0a7f9[_0x3d86cd(0x11c)](_0xf0a7f9[_0x3d86cd(0xa1)])),_0x5c866c(0x2,_0xf0a7f9['IConfigService'])],_0x2b4972[_0x3d86cd(0xd9)]),Object['defineProperty'](_0x2b4972,Symbol[_0x3d86cd(0xa0)],{'value':_0x3d86cd(0xa5)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.6.10-experimental.
|
|
3
|
+
"version": "0.6.10-experimental.20250421-e4eb9bc",
|
|
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.6.10-experimental.
|
|
49
|
-
"@univerjs/
|
|
50
|
-
"@univerjs
|
|
51
|
-
"@univerjs/
|
|
52
|
-
"@univerjs/thread-comment": "0.6.10-experimental.20250419-1304630",
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.6.10-experimental.20250421-e4eb9bc",
|
|
49
|
+
"@univerjs-pro/license": "0.6.10-experimental.20250421-e4eb9bc",
|
|
50
|
+
"@univerjs/network": "0.6.10-experimental.20250421-e4eb9bc",
|
|
51
|
+
"@univerjs/core": "0.6.10-experimental.20250421-e4eb9bc",
|
|
53
52
|
"@univerjs/protocol": "0.1.46-alpha.3",
|
|
54
|
-
"@univerjs/thread-comment
|
|
53
|
+
"@univerjs/thread-comment": "0.6.10-experimental.20250421-e4eb9bc",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.6.10-experimental.20250421-e4eb9bc"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "^7.8.1",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^6.3.0",
|
|
60
60
|
"vitest": "^3.1.1",
|
|
61
|
-
"@univerjs-infra/shared": "0.6.10
|
|
61
|
+
"@univerjs-infra/shared": "0.6.10"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|