@univerjs-pro/thread-comment-datasource 0.13.0 → 0.14.0-insiders.20251222-4efcfbb
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 _0x7bec1e=_0x272e;(function(_0x21dc3e,_0x5acea1){const _0x3a6ae=_0x272e,_0x176ee1=_0x21dc3e();while(!![]){try{const _0x22bdd6=-parseInt(_0x3a6ae(0xb2))/0x1*(parseInt(_0x3a6ae(0xec))/0x2)+parseInt(_0x3a6ae(0xaa))/0x3+parseInt(_0x3a6ae(0xc8))/0x4+-parseInt(_0x3a6ae(0xe8))/0x5*(parseInt(_0x3a6ae(0xbe))/0x6)+-parseInt(_0x3a6ae(0xdd))/0x7+parseInt(_0x3a6ae(0xf3))/0x8+parseInt(_0x3a6ae(0xfd))/0x9*(parseInt(_0x3a6ae(0xd7))/0xa);if(_0x22bdd6===_0x5acea1)break;else _0x176ee1['push'](_0x176ee1['shift']());}catch(_0x43f514){_0x176ee1['push'](_0x176ee1['shift']());}}}(_0x6aee,0x47b47));function _0x6aee(){const _0x18a716=['root','customRanges','_configService','102594ChmHos','body','getMemberID','HTTPService','/edit','_initDataSource','Unknown','length','onStarting','format','79992mEHWUA','commentUpdate$','Injector','subscribe','YYYY/MM/DD\x20HH:mm','createTimestamp','_injector','_userService','content','stringify','filter','deleteComment','_initUserSync','addComment','CustomRangeType','620HMWqOf','Solved','Reply','map','UserManagerService','personId','1489509xfeAHH','_init','dataSource','COMMENT','find','getCurrentUser','UniverLicensePlugin','Add','thread-comment-data-source.config','rangeId','IConfigService','20uHeaez','_threadCommentDataSource','replies','OpenOrReOpen','14542NxphhR','comment','resolveComment','UNRECOGNIZED','add','parse','_httpService','1426088DLGGWC','ThreadCommentModel','_threadCommentDataSourceService','getUser','CommentService','code','replyId','solved','userID','threadId','85518HyATbU','Edit','Inject','onReady','CollaborationSessionService','saveCommentToSnapshot','unitId','/add','_threadCommentModel','/universer-api/comment/unit/','setConfig','_config','/delete','size','updateComment','dayjs','defineProperty','UniverCollaborationClientPlugin','forEach','listComments','merge','bufferTime','Module','Solve','type','get','_commentService','_sessionService','values','error','Disposable','slice','disposeWithMe','453159BrmFbe','symbol','Delete','addUser','users','rangeType','user','syncUpdateMutationToColla','50drWlpm','post','IThreadCommentDataSourceService','UniverThreadCommentDataSourcePlugin','getOwnPropertyDescriptor','requireSession','DependentOn','userId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN'];_0x6aee=function(){return _0x18a716;};return _0x6aee();}Object[_0x7bec1e(0x99)](exports,Symbol['toStringTag'],{'value':_0x7bec1e(0x9f)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),w=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),j=require('rxjs'),P=require('@univerjs/network'),U=_0x7bec1e(0xba);var I=(_0x52ad51=>(_0x52ad51[_0x52ad51[_0x7bec1e(0xeb)]=0x0]=_0x7bec1e(0xeb),_0x52ad51[_0x52ad51[_0x7bec1e(0xd8)]=0x1]=_0x7bec1e(0xd8),_0x52ad51[_0x52ad51['UNRECOGNIZED']=-0x1]=_0x7bec1e(0xef),_0x52ad51))(I||{}),v=(_0x2a5428=>(_0x2a5428[_0x2a5428[_0x7bec1e(0xc4)]=0x0]=_0x7bec1e(0xc4),_0x2a5428[_0x2a5428[_0x7bec1e(0xe4)]=0x1]=_0x7bec1e(0xe4),_0x2a5428[_0x2a5428[_0x7bec1e(0xd9)]=0x2]='Reply',_0x2a5428[_0x2a5428[_0x7bec1e(0xfe)]=0x3]=_0x7bec1e(0xfe),_0x2a5428[_0x2a5428[_0x7bec1e(0xac)]=0x4]=_0x7bec1e(0xac),_0x2a5428[_0x2a5428[_0x7bec1e(0xa0)]=0x5]='Solve',_0x2a5428[_0x2a5428[_0x7bec1e(0xef)]=-0x1]=_0x7bec1e(0xef),_0x2a5428))(v||{});const f=_0xfa1796=>c[_0x7bec1e(0x98)](new Date(+_0xfa1796))['format'](_0x7bec1e(0xcc)),R=async(_0x4e0526,_0x342d5a)=>{const _0x427f24=_0x7bec1e,_0x1079c0=_0x4e0526[_0x427f24(0xa2)](c['UserManagerService']),_0x438a90=_0x4e0526[_0x427f24(0xa2)](P['HTTPService']);_0x342d5a['forEach'](_0x44c515=>{const _0x4be342=_0x427f24;_0x1079c0[_0x4be342(0xf6)](_0x44c515)&&_0x342d5a['delete'](_0x44c515);}),_0x342d5a[_0x427f24(0x96)]&&(await _0x438a90[_0x427f24(0xa2)]('/universer-api/user/list',{'params':{'userIDs':[..._0x342d5a]}}))[_0x427f24(0xbf)]['users'][_0x427f24(0x9b)](_0x267e3f=>{_0x267e3f&&_0x1079c0['addUser'](_0x267e3f);});};var $=Object[_0x7bec1e(0xb6)],E=(_0x2aa9ba,_0x2ad740,_0x726af1,_0x346b0b)=>{for(var _0x4bff96=_0x346b0b>0x1?void 0x0:_0x346b0b?$(_0x2ad740,_0x726af1):_0x2ad740,_0x416884=_0x2aa9ba['length']-0x1,_0x59ddb8;_0x416884>=0x0;_0x416884--)(_0x59ddb8=_0x2aa9ba[_0x416884])&&(_0x4bff96=_0x59ddb8(_0x4bff96)||_0x4bff96);return _0x4bff96;},S=(_0x3750fb,_0x5859e8)=>(_0x4b77d9,_0x7971af)=>_0x5859e8(_0x4b77d9,_0x7971af,_0x3750fb);let _=class extends c[_0x7bec1e(0xa7)]{constructor(_0x39ef2a,_0x291013,_0x504e28,_0x2f26b2){const _0x21536f=_0x7bec1e;super(),this[_0x21536f(0xa3)]=_0x39ef2a,this[_0x21536f(0x91)]=_0x291013,this[_0x21536f(0xcf)]=_0x504e28,this[_0x21536f(0xce)]=_0x2f26b2,this[_0x21536f(0xde)](),this[_0x21536f(0xd4)]();}[_0x7bec1e(0xd4)](){const _0x15194f=_0x7bec1e;this[_0x15194f(0xa9)](this[_0x15194f(0x91)][_0x15194f(0xc9)]['pipe'](j[_0x15194f(0x9e)](0x10))[_0x15194f(0xcb)](_0x2e12fd=>{const _0x43e5f9=_0x15194f,_0x1b4d0f=new Set();_0x2e12fd[_0x43e5f9(0x9b)](_0x17847f=>{const _0x33ac7c=_0x43e5f9;switch(_0x17847f['type']){case _0x33ac7c(0xf0):{const _0x2495bc=_0x17847f['payload'][_0x33ac7c(0xdc)];_0x1b4d0f[_0x33ac7c(0xf0)](_0x2495bc);break;}}}),R(this[_0x43e5f9(0xce)],_0x1b4d0f);}));}[_0x7bec1e(0xde)](){const _0x27d8e4=_0x7bec1e;this[_0x27d8e4(0xa9)](this['_commentService'][_0x27d8e4(0xc9)]['subscribe'](async _0x355483=>{const _0x5e3dda=_0x27d8e4;var _0x5ee4a4,_0x3ed14a,_0x37a4f8,_0x14c153;const _0x4bc227=(_0x5ee4a4=this['_threadCommentModel']['getUnit'](_0x355483[_0x5e3dda(0x8f)])['find'](_0x1a3458=>_0x1a3458[_0x5e3dda(0xfc)]===_0x355483[_0x5e3dda(0xfc)]))==null?void 0x0:_0x5ee4a4[_0x5e3dda(0xbb)];if(!_0x4bc227)return;const {unitId:_0x943426,subUnitId:_0x3ade67}=_0x4bc227;switch(_0x355483[_0x5e3dda(0xb0)]&&this['_userService']['addUser'](_0x355483[_0x5e3dda(0xb0)]),_0x355483[_0x5e3dda(0xa1)]){case v['Add']:break;case v[_0x5e3dda(0xd9)]:{this[_0x5e3dda(0x91)][_0x5e3dda(0xd5)](_0x943426,_0x3ade67,{'unitId':_0x943426,'subUnitId':_0x3ade67,'ref':'','id':_0x355483[_0x5e3dda(0xf9)],'dT':f(+_0x355483[_0x5e3dda(0xcd)]),'threadId':_0x355483[_0x5e3dda(0xfc)],'personId':(_0x37a4f8=(_0x3ed14a=_0x355483[_0x5e3dda(0xb0)])==null?void 0x0:_0x3ed14a[_0x5e3dda(0xfb)])!=null?_0x37a4f8:_0x355483[_0x5e3dda(0xb9)],'text':JSON[_0x5e3dda(0xf1)](_0x355483[_0x5e3dda(0xd0)]),'parentId':_0x4bc227['id']});break;}case v['Delete']:{const _0xba6cfc=this[_0x5e3dda(0x91)]['getComment'](_0x943426,_0x3ade67,_0x355483[_0x5e3dda(0xf9)]);_0xba6cfc&&_0xba6cfc['parentId']&&this[_0x5e3dda(0x91)]['deleteComment'](_0x943426,_0x3ade67,_0x355483[_0x5e3dda(0xf9)]);break;}case v[_0x5e3dda(0xfe)]:{this[_0x5e3dda(0x91)][_0x5e3dda(0x97)](_0x943426,_0x3ade67,{'commentId':_0x355483['replyId'],'text':JSON[_0x5e3dda(0xf1)](_0x355483[_0x5e3dda(0xd0)])});break;}case v['Solve']:{const _0x61ffee=(_0x14c153=this[_0x5e3dda(0x91)]['getUnit'](_0x355483[_0x5e3dda(0x8f)])[_0x5e3dda(0xe1)](_0x2a42e4=>_0x2a42e4[_0x5e3dda(0xfc)]===_0x355483[_0x5e3dda(0xfc)]))==null?void 0x0:_0x14c153[_0x5e3dda(0xbb)];_0x61ffee&&this[_0x5e3dda(0x91)][_0x5e3dda(0xee)](_0x943426,_0x3ade67,_0x61ffee['id'],_0x355483[_0x5e3dda(0xfa)]===I[_0x5e3dda(0xd8)]);break;}}}));}};function _0x272e(_0x18f2fa,_0x139de9){_0x18f2fa=_0x18f2fa-0x8b;const _0x6aee2d=_0x6aee();let _0x272e46=_0x6aee2d[_0x18f2fa];return _0x272e46;}_=E([S(0x0,c[_0x7bec1e(0x8b)](b[_0x7bec1e(0xf7)])),S(0x1,c[_0x7bec1e(0x8b)](M[_0x7bec1e(0xf4)])),S(0x2,c['Inject'](c[_0x7bec1e(0xdb)])),S(0x3,c[_0x7bec1e(0x8b)](c[_0x7bec1e(0xca)]))],_);const q=_0x7bec1e(0xe5),D={};var A=Object[_0x7bec1e(0xb6)],x=(_0x5835fe,_0x3a49a0,_0x384267,_0x2319df)=>{const _0x3d85d5=_0x7bec1e;for(var _0x46b917=_0x2319df>0x1?void 0x0:_0x2319df?A(_0x3a49a0,_0x384267):_0x3a49a0,_0x4b57ec=_0x5835fe[_0x3d85d5(0xc5)]-0x1,_0x3762b3;_0x4b57ec>=0x0;_0x4b57ec--)(_0x3762b3=_0x5835fe[_0x4b57ec])&&(_0x46b917=_0x3762b3(_0x46b917)||_0x46b917);return _0x46b917;},C=(_0x4f72ec,_0x37dd6d)=>(_0x5b5483,_0x478530)=>_0x37dd6d(_0x5b5483,_0x478530,_0x4f72ec);function Y(_0x3bea5c,_0x3aee60){const _0x389dfb=_0x7bec1e,_0x283e48=_0x3bea5c['replies'][0x0];return{..._0x3aee60,'id':_0x283e48[_0x389dfb(0xf9)],'resolved':_0x3bea5c[_0x389dfb(0xfa)]===0x1,'dT':f(_0x283e48[_0x389dfb(0xcd)]),'personId':_0x283e48[_0x389dfb(0xb9)],'threadId':_0x283e48[_0x389dfb(0xfc)]};}function G(_0x30b80f,_0x23001f,_0x323984){const _0x46baee=_0x7bec1e;var _0x28abbc,_0x57eb17;if(((_0x57eb17=(_0x28abbc=_0x30b80f==null?void 0x0:_0x30b80f[_0x46baee(0xea)])==null?void 0x0:_0x28abbc[_0x46baee(0xc5)])!=null?_0x57eb17:0x0)>0x0){const _0x418916=(_0xfcc8e0,_0x213060)=>({'id':_0xfcc8e0['replyId'],'threadId':_0xfcc8e0[_0x46baee(0xfc)],'dT':f(_0xfcc8e0[_0x46baee(0xcd)]),'personId':_0xfcc8e0['userId'],'resolved':_0x30b80f['solved']===I[_0x46baee(0xd8)],'unitId':_0x23001f,'subUnitId':_0x323984,'text':JSON[_0x46baee(0xf1)](_0xfcc8e0[_0x46baee(0xd0)]),'parentId':_0x213060}),_0x1cea45=_0x418916(_0x30b80f[_0x46baee(0xea)][0x0]);return{..._0x1cea45,'children':_0x30b80f[_0x46baee(0xea)][_0x46baee(0xa8)](0x1)[_0x46baee(0xda)](_0x42bee7=>_0x418916(_0x42bee7,_0x1cea45['id']))};}return null;}let p=class{constructor(_0x49c647,_0x441e71,_0x1c37a9){const _0x2e3d61=_0x7bec1e;this[_0x2e3d61(0xf2)]=_0x49c647,this[_0x2e3d61(0xcf)]=_0x441e71,this[_0x2e3d61(0xa4)]=_0x1c37a9;}async[_0x7bec1e(0xd5)](_0xe447ec){const _0x288c6e=_0x7bec1e;var _0x411176,_0x1155b1;const {parentId:_0x237eb1,unitId:_0x223aa5,text:_0x16a255,threadId:_0x10431b}=_0xe447ec,_0x93b022=(_0x1155b1=(_0x411176=_0x16a255[_0x288c6e(0xbc)])==null?void 0x0:_0x411176[_0x288c6e(0xd2)](_0x85c108=>_0x85c108[_0x288c6e(0xaf)]===c[_0x288c6e(0xd6)]['COMMENT'])['map'](_0x2eadde=>_0x2eadde[_0x288c6e(0xe6)]))!=null?_0x1155b1:[],_0x3818e3=JSON[_0x288c6e(0xd1)](_0x16a255),_0x22700b=(await this[_0x288c6e(0xa4)][_0x288c6e(0xb7)](_0x223aa5))[_0x288c6e(0xc0)]();if(_0x237eb1){const _0x2c7d81={'memberId':_0x22700b,'unitId':_0x223aa5,'content':_0x3818e3,'mention':_0x93b022,'threadId':_0x10431b},_0xffeda4=(await this['_httpService'][_0x288c6e(0xb3)](_0x288c6e(0x92)+_0x223aa5+'/reply',{'body':_0x2c7d81}))['body']['reply'];return{..._0xe447ec,'id':_0xffeda4[_0x288c6e(0xf9)],'dT':c[_0x288c6e(0x98)](+_0xffeda4[_0x288c6e(0xcd)])[_0x288c6e(0xc7)]('YYYY/MM/DD\x20HH:mm'),'personId':_0xffeda4[_0x288c6e(0xb9)]};}else{const _0x1bd12e={'memberId':_0x22700b,'unitId':_0x223aa5,'content':_0x3818e3,'mention':_0x93b022},_0x3c1abf=await this[_0x288c6e(0xf2)]['post']('/universer-api/comment/unit/'+_0x223aa5+_0x288c6e(0x90),{'body':_0x1bd12e});return Y(_0x3c1abf[_0x288c6e(0xbf)][_0x288c6e(0xed)],_0xe447ec);}}async['updateComment'](_0x4e97d3){const _0x1330de=_0x7bec1e;var _0x14f9dd,_0x159173;const {text:_0x182d01,unitId:_0x2d52fe}=_0x4e97d3,_0x3a612d=(_0x159173=(_0x14f9dd=_0x182d01[_0x1330de(0xbc)])==null?void 0x0:_0x14f9dd[_0x1330de(0xd2)](_0x4ba4ae=>_0x4ba4ae['rangeType']===c[_0x1330de(0xd6)][_0x1330de(0xe0)])[_0x1330de(0xda)](_0x570421=>_0x570421[_0x1330de(0xe6)]))!=null?_0x159173:[],_0x402bd6=JSON[_0x1330de(0xd1)](_0x182d01),_0x5ef40e=_0x4e97d3['threadId'],_0x2f2516=_0x4e97d3['id'],_0x547892={'memberId':(await this['_sessionService'][_0x1330de(0xb7)](_0x2d52fe))[_0x1330de(0xc0)](),'unitId':_0x2d52fe,'threadId':_0x5ef40e,'mention':_0x3a612d,'content':_0x402bd6,'replyId':_0x2f2516},_0x434d2b=await this[_0x1330de(0xf2)]['post'](_0x1330de(0x92)+_0x2d52fe+_0x1330de(0xc2),{'body':_0x547892});return!_0x434d2b[_0x1330de(0xbf)]['error']||_0x434d2b[_0x1330de(0xbf)]['error'][_0x1330de(0xf8)]===0x1;}async[_0x7bec1e(0xee)](_0x48dc08){const _0x4348ef=_0x7bec1e,{unitId:_0x14805f}=_0x48dc08,_0x4a7185=_0x48dc08[_0x4348ef(0xfc)],_0x16599a={'memberId':this['_userService'][_0x4348ef(0xe2)]()[_0x4348ef(0xfb)],'unitId':_0x14805f,'threadId':_0x4a7185,'solved':_0x48dc08['resolved']?I[_0x4348ef(0xd8)]:I['OpenOrReOpen']},_0x3633da=await this['_httpService'][_0x4348ef(0xb3)]('/universer-api/comment/unit/'+_0x14805f+'/solved',{'body':_0x16599a});return!_0x3633da[_0x4348ef(0xbf)][_0x4348ef(0xa6)]||_0x3633da[_0x4348ef(0xbf)][_0x4348ef(0xa6)][_0x4348ef(0xf8)]===0x1;}async[_0x7bec1e(0xd3)](_0x27b333,_0x3b225b,_0x18e068,_0x3eb13){const _0x3cd213=_0x7bec1e,_0x492e4e={'memberId':(await this['_sessionService']['requireSession'](_0x27b333))['getMemberID'](),'threadId':_0x18e068,'replyId':_0x3eb13,'unitId':_0x27b333},_0x20cdcc=await this[_0x3cd213(0xf2)][_0x3cd213(0xb3)](_0x3cd213(0x92)+_0x27b333+_0x3cd213(0x95),{'body':_0x492e4e});return!_0x20cdcc[_0x3cd213(0xbf)]['error']||_0x20cdcc[_0x3cd213(0xbf)][_0x3cd213(0xa6)][_0x3cd213(0xf8)]===0x1;}async[_0x7bec1e(0x9c)](_0x480e49,_0x29a746,_0x44c7bf){const _0x46de06=_0x7bec1e,_0x2429c9={'unitId':_0x480e49,'threadId':_0x44c7bf},_0x3c4f20=await this[_0x46de06(0xf2)][_0x46de06(0xb3)](_0x46de06(0x92)+_0x480e49+'/list',{'body':_0x2429c9}),_0x48ca3a=_0x44c7bf['map'](_0x15ee71=>G(_0x3c4f20[_0x46de06(0xbf)]['comments'][_0x15ee71],_0x480e49,_0x29a746))[_0x46de06(0xd2)](Boolean);return Object[_0x46de06(0xa5)](_0x3c4f20[_0x46de06(0xbf)][_0x46de06(0xae)])['forEach'](_0x5a8967=>{const _0x215ade=_0x46de06;this[_0x215ade(0xcf)][_0x215ade(0xad)](_0x5a8967);}),_0x48ca3a;}[_0x7bec1e(0x8e)](_0x32e4a0){const _0x23acb8=_0x7bec1e;return{'id':_0x32e4a0['id'],'threadId':_0x32e4a0[_0x23acb8(0xfc)],'ref':_0x32e4a0['ref']};}};p=x([C(0x0,c[_0x7bec1e(0x8b)](P[_0x7bec1e(0xc1)])),C(0x1,c[_0x7bec1e(0x8b)](c[_0x7bec1e(0xdb)])),C(0x2,c[_0x7bec1e(0x8b)](b[_0x7bec1e(0x8d)]))],p);var H=Object[_0x7bec1e(0xb6)],J=(_0x57971a,_0x1c3ce2,_0x2e41b2,_0x1420b2)=>{for(var _0x8ad958=_0x1420b2>0x1?void 0x0:_0x1420b2?H(_0x1c3ce2,_0x2e41b2):_0x1c3ce2,_0x314aef=_0x57971a['length']-0x1,_0xe16af1;_0x314aef>=0x0;_0x314aef--)(_0xe16af1=_0x57971a[_0x314aef])&&(_0x8ad958=_0xe16af1(_0x8ad958)||_0x8ad958);return _0x8ad958;},y=(_0x5530af,_0x486635)=>(_0x115daa,_0x54a1a0)=>_0x486635(_0x115daa,_0x54a1a0,_0x5530af);let g=class extends c['Disposable']{constructor(_0x2185c4,_0xbfbf80){const _0x5d7a92=_0x7bec1e;super(),this[_0x5d7a92(0xf5)]=_0x2185c4,this[_0x5d7a92(0xe9)]=_0xbfbf80,this[_0x5d7a92(0xc3)]();}[_0x7bec1e(0xc3)](){const _0x3d1c79=_0x7bec1e;this[_0x3d1c79(0xf5)][_0x3d1c79(0xdf)]=this[_0x3d1c79(0xe9)],this[_0x3d1c79(0xf5)][_0x3d1c79(0xb1)]=!0x1;}};g=J([y(0x0,M[_0x7bec1e(0xb4)]),y(0x1,c[_0x7bec1e(0x8b)](p))],g);var F=Object[_0x7bec1e(0x99)],L=Object['getOwnPropertyDescriptor'],Z=(_0x3f18c8,_0x1e5d23,_0x486380)=>_0x1e5d23 in _0x3f18c8?F(_0x3f18c8,_0x1e5d23,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x486380}):_0x3f18c8[_0x1e5d23]=_0x486380,W=(_0x3636f3,_0x59a530,_0x25f26e,_0x36c2ef)=>{const _0xae6da8=_0x7bec1e;for(var _0x5db238=_0x36c2ef>0x1?void 0x0:_0x36c2ef?L(_0x59a530,_0x25f26e):_0x59a530,_0x5b9dc7=_0x3636f3[_0xae6da8(0xc5)]-0x1,_0x4fe4de;_0x5b9dc7>=0x0;_0x5b9dc7--)(_0x4fe4de=_0x3636f3[_0x5b9dc7])&&(_0x5db238=_0x4fe4de(_0x5db238)||_0x5db238);return _0x5db238;},O=(_0x1f4736,_0x51a816)=>(_0x30aeaf,_0x28fb5b)=>_0x51a816(_0x30aeaf,_0x28fb5b,_0x1f4736),N=(_0x2f45e5,_0x389855,_0x43d209)=>Z(_0x2f45e5,typeof _0x389855!=_0x7bec1e(0xab)?_0x389855+'':_0x389855,_0x43d209);exports[_0x7bec1e(0xb5)]=class extends c['Plugin']{constructor(_0x52b592=D,_0x2f730d,_0x3dc872){const _0x3d1802=_0x7bec1e;super(),this[_0x3d1802(0x94)]=_0x52b592,this[_0x3d1802(0xce)]=_0x2f730d,this[_0x3d1802(0xbd)]=_0x3dc872;const {..._0x3e2e42}=c[_0x3d1802(0x9d)]({},D,this[_0x3d1802(0x94)]);this[_0x3d1802(0xbd)][_0x3d1802(0x93)](q,_0x3e2e42);}[_0x7bec1e(0xc6)](){const _0x4db63f=_0x7bec1e;[[p],[g],[_]][_0x4db63f(0x9b)](_0x1df4aa=>{const _0x29b8f3=_0x4db63f;this[_0x29b8f3(0xce)][_0x29b8f3(0xf0)](_0x1df4aa);});}[_0x7bec1e(0x8c)](){const _0x1e636d=_0x7bec1e;this[_0x1e636d(0xce)][_0x1e636d(0xa2)](g),this[_0x1e636d(0xce)][_0x1e636d(0xa2)](_);}},N(exports[_0x7bec1e(0xb5)],'pluginName',U),N(exports[_0x7bec1e(0xb5)],'type',c['UniverInstanceType']['UNIVER_UNKNOWN']),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x7bec1e(0xb8)](w['UniverThreadCommentUIPlugin'],b[_0x7bec1e(0x9a)],T[_0x7bec1e(0xe3)]),O(0x1,c[_0x7bec1e(0x8b)](c[_0x7bec1e(0xca)])),O(0x2,c[_0x7bec1e(0xe7)])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0x403535=_0x5332;(function(_0x990f4a,_0x3fdac5){const _0x375017=_0x5332,_0x308d3d=_0x990f4a();while(!![]){try{const _0x43d210=-parseInt(_0x375017(0x150))/0x1+-parseInt(_0x375017(0x146))/0x2+-parseInt(_0x375017(0x134))/0x3*(parseInt(_0x375017(0x172))/0x4)+parseInt(_0x375017(0x167))/0x5+-parseInt(_0x375017(0x155))/0x6*(parseInt(_0x375017(0x16a))/0x7)+parseInt(_0x375017(0x14b))/0x8+parseInt(_0x375017(0x149))/0x9;if(_0x43d210===_0x3fdac5)break;else _0x308d3d['push'](_0x308d3d['shift']());}catch(_0x50f55f){_0x308d3d['push'](_0x308d3d['shift']());}}}(_0x4ca8,0x2e71f));function _0x4ca8(){const _0x25f631=['IThreadCommentDataSourceService','post','deleteComment','userId','getUser','Solve','listComments','unitId','Injector','length','stringify','Solved','comment','YYYY/MM/DD\x20HH:mm','_init','replyId','customRanges','updateComment','_threadCommentDataSource','getMemberID','find','_threadCommentModel','_userService','requireSession','_commentService','addUser','content','/list','_initDataSource','code','parse','resolveComment','defineProperty','UniverLicensePlugin','UNIVER_UNKNOWN','_sessionService','map','onReady','pipe','/add','HTTPService','DependentOn','error','getCurrentUser','_injector','saveCommentToSnapshot','3OSYcBh','userID','format','merge','add','IConfigService','UniverInstanceType','CommentService','COMMENT','Module','replies','UserManagerService','UniverCollaborationClientPlugin','getUnit','createTimestamp','users','rangeType','Edit','492348RfZweX','CustomRangeType','Add','4876857zKeRpA','dataSource','199376YfxXNt','Disposable','commentUpdate$','/delete','UNRECOGNIZED','157153CcoixZ','UniverThreadCommentUIPlugin','Delete','solved','/universer-api/comment/unit/','1866fAsodE','addComment','_httpService','UniverThreadCommentDataSourcePlugin','_threadCommentDataSourceService','/universer-api/user/list','filter','get','payload','getOwnPropertyDescriptor','body','CollaborationSessionService','personId','user','Reply','values','dayjs','rangeId','1835840WlzoFG','type','/edit','6734XjvpCl','threadId','setConfig','OpenOrReOpen','Unknown','ThreadCommentModel','_initUserSync','_config','164860EMUwpI','reply','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','comments','_configService','subscribe','delete','resolved','forEach','Inject','root','symbol'];_0x4ca8=function(){return _0x25f631;};return _0x4ca8();}Object[_0x403535(0x126)](exports,Symbol['toStringTag'],{'value':_0x403535(0x13d)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),w=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),j=require('rxjs'),P=require('@univerjs/network'),U=_0x403535(0x174);var I=(_0xf6991f=>(_0xf6991f[_0xf6991f[_0x403535(0x16d)]=0x0]=_0x403535(0x16d),_0xf6991f[_0xf6991f[_0x403535(0x111)]=0x1]=_0x403535(0x111),_0xf6991f[_0xf6991f[_0x403535(0x14f)]=-0x1]='UNRECOGNIZED',_0xf6991f))(I||{}),v=(_0x2311e0=>(_0x2311e0[_0x2311e0['Unknown']=0x0]=_0x403535(0x16e),_0x2311e0[_0x2311e0[_0x403535(0x148)]=0x1]=_0x403535(0x148),_0x2311e0[_0x2311e0['Reply']=0x2]=_0x403535(0x163),_0x2311e0[_0x2311e0['Edit']=0x3]=_0x403535(0x145),_0x2311e0[_0x2311e0[_0x403535(0x152)]=0x4]=_0x403535(0x152),_0x2311e0[_0x2311e0[_0x403535(0x183)]=0x5]='Solve',_0x2311e0[_0x2311e0[_0x403535(0x14f)]=-0x1]='UNRECOGNIZED',_0x2311e0))(v||{});const f=_0xe73cc=>c['dayjs'](new Date(+_0xe73cc))['format']('YYYY/MM/DD\x20HH:mm'),R=async(_0x5847c9,_0x1475f9)=>{const _0x2144fe=_0x403535,_0x11e521=_0x5847c9[_0x2144fe(0x15c)](c[_0x2144fe(0x13f)]),_0x10741b=_0x5847c9[_0x2144fe(0x15c)](P[_0x2144fe(0x12e)]);_0x1475f9['forEach'](_0x2ae380=>{const _0x32c387=_0x2144fe;_0x11e521[_0x32c387(0x182)](_0x2ae380)&&_0x1475f9[_0x32c387(0x178)](_0x2ae380);}),_0x1475f9['size']&&(await _0x10741b[_0x2144fe(0x15c)](_0x2144fe(0x15a),{'params':{'userIDs':[..._0x1475f9]}}))[_0x2144fe(0x15f)][_0x2144fe(0x143)][_0x2144fe(0x17a)](_0x2401cf=>{const _0x54107b=_0x2144fe;_0x2401cf&&_0x11e521[_0x54107b(0x11f)](_0x2401cf);});};var $=Object[_0x403535(0x15e)],E=(_0x1fffc5,_0x125595,_0x168ba7,_0x276501)=>{const _0x49420f=_0x403535;for(var _0x4977d6=_0x276501>0x1?void 0x0:_0x276501?$(_0x125595,_0x168ba7):_0x125595,_0x1dc64c=_0x1fffc5[_0x49420f(0x187)]-0x1,_0x5a1144;_0x1dc64c>=0x0;_0x1dc64c--)(_0x5a1144=_0x1fffc5[_0x1dc64c])&&(_0x4977d6=_0x5a1144(_0x4977d6)||_0x4977d6);return _0x4977d6;},S=(_0x34c7e1,_0x58a81a)=>(_0x56adb2,_0x1846ef)=>_0x58a81a(_0x56adb2,_0x1846ef,_0x34c7e1);function _0x5332(_0x36bc2d,_0x58c07e){_0x36bc2d=_0x36bc2d-0x110;const _0x4ca8b8=_0x4ca8();let _0x5332ac=_0x4ca8b8[_0x36bc2d];return _0x5332ac;}let _=class extends c[_0x403535(0x14c)]{constructor(_0xa80c65,_0x166074,_0x5c760e,_0x172b82){const _0x2e3ca3=_0x403535;super(),this['_commentService']=_0xa80c65,this['_threadCommentModel']=_0x166074,this[_0x2e3ca3(0x11c)]=_0x5c760e,this[_0x2e3ca3(0x132)]=_0x172b82,this['_init'](),this[_0x2e3ca3(0x170)]();}[_0x403535(0x170)](){const _0x3a7d67=_0x403535;this['disposeWithMe'](this['_threadCommentModel'][_0x3a7d67(0x14d)][_0x3a7d67(0x12c)](j['bufferTime'](0x10))[_0x3a7d67(0x177)](_0x460f77=>{const _0x183c46=_0x3a7d67,_0x33d999=new Set();_0x460f77[_0x183c46(0x17a)](_0x4c4788=>{const _0x417d15=_0x183c46;switch(_0x4c4788[_0x417d15(0x168)]){case _0x417d15(0x138):{const _0x177aa9=_0x4c4788[_0x417d15(0x15d)][_0x417d15(0x161)];_0x33d999['add'](_0x177aa9);break;}}}),R(this['_injector'],_0x33d999);}));}[_0x403535(0x114)](){const _0x40faf4=_0x403535;this['disposeWithMe'](this[_0x40faf4(0x11e)][_0x40faf4(0x14d)][_0x40faf4(0x177)](async _0x1114f7=>{const _0x1b6daf=_0x40faf4;var _0x434f54,_0x43fe18,_0x48fe8f,_0xe2b854;const _0x483459=(_0x434f54=this['_threadCommentModel'][_0x1b6daf(0x141)](_0x1114f7[_0x1b6daf(0x185)])[_0x1b6daf(0x11a)](_0x59f6df=>_0x59f6df[_0x1b6daf(0x16b)]===_0x1114f7[_0x1b6daf(0x16b)]))==null?void 0x0:_0x434f54[_0x1b6daf(0x17c)];if(!_0x483459)return;const {unitId:_0x162ee2,subUnitId:_0x5e25eb}=_0x483459;switch(_0x1114f7[_0x1b6daf(0x162)]&&this[_0x1b6daf(0x11c)]['addUser'](_0x1114f7['user']),_0x1114f7[_0x1b6daf(0x168)]){case v[_0x1b6daf(0x148)]:break;case v[_0x1b6daf(0x163)]:{this[_0x1b6daf(0x11b)][_0x1b6daf(0x156)](_0x162ee2,_0x5e25eb,{'unitId':_0x162ee2,'subUnitId':_0x5e25eb,'ref':'','id':_0x1114f7[_0x1b6daf(0x115)],'dT':f(+_0x1114f7['createTimestamp']),'threadId':_0x1114f7[_0x1b6daf(0x16b)],'personId':(_0x48fe8f=(_0x43fe18=_0x1114f7[_0x1b6daf(0x162)])==null?void 0x0:_0x43fe18[_0x1b6daf(0x135)])!=null?_0x48fe8f:_0x1114f7[_0x1b6daf(0x181)],'text':JSON[_0x1b6daf(0x124)](_0x1114f7[_0x1b6daf(0x120)]),'parentId':_0x483459['id']});break;}case v['Delete']:{const _0x487741=this[_0x1b6daf(0x11b)]['getComment'](_0x162ee2,_0x5e25eb,_0x1114f7[_0x1b6daf(0x115)]);_0x487741&&_0x487741['parentId']&&this['_threadCommentModel'][_0x1b6daf(0x180)](_0x162ee2,_0x5e25eb,_0x1114f7[_0x1b6daf(0x115)]);break;}case v['Edit']:{this[_0x1b6daf(0x11b)][_0x1b6daf(0x117)](_0x162ee2,_0x5e25eb,{'commentId':_0x1114f7[_0x1b6daf(0x115)],'text':JSON[_0x1b6daf(0x124)](_0x1114f7[_0x1b6daf(0x120)])});break;}case v[_0x1b6daf(0x183)]:{const _0x127ca9=(_0xe2b854=this[_0x1b6daf(0x11b)][_0x1b6daf(0x141)](_0x1114f7[_0x1b6daf(0x185)])[_0x1b6daf(0x11a)](_0x5271b5=>_0x5271b5[_0x1b6daf(0x16b)]===_0x1114f7[_0x1b6daf(0x16b)]))==null?void 0x0:_0xe2b854[_0x1b6daf(0x17c)];_0x127ca9&&this[_0x1b6daf(0x11b)][_0x1b6daf(0x125)](_0x162ee2,_0x5e25eb,_0x127ca9['id'],_0x1114f7[_0x1b6daf(0x153)]===I[_0x1b6daf(0x111)]);break;}}}));}};_=E([S(0x0,c[_0x403535(0x17b)](b[_0x403535(0x13b)])),S(0x1,c[_0x403535(0x17b)](M[_0x403535(0x16f)])),S(0x2,c['Inject'](c[_0x403535(0x13f)])),S(0x3,c[_0x403535(0x17b)](c[_0x403535(0x186)]))],_);const q='thread-comment-data-source.config',D={};var A=Object[_0x403535(0x15e)],x=(_0x25e960,_0x5269e5,_0x55f75f,_0x136c07)=>{const _0x11c781=_0x403535;for(var _0x4233a4=_0x136c07>0x1?void 0x0:_0x136c07?A(_0x5269e5,_0x55f75f):_0x5269e5,_0x537633=_0x25e960[_0x11c781(0x187)]-0x1,_0x97c40c;_0x537633>=0x0;_0x537633--)(_0x97c40c=_0x25e960[_0x537633])&&(_0x4233a4=_0x97c40c(_0x4233a4)||_0x4233a4);return _0x4233a4;},C=(_0x1111b1,_0xb473ec)=>(_0x2143d8,_0x5b366f)=>_0xb473ec(_0x2143d8,_0x5b366f,_0x1111b1);function Y(_0x4141ab,_0x5c5578){const _0x5975ff=_0x403535,_0x4f157b=_0x4141ab[_0x5975ff(0x13e)][0x0];return{..._0x5c5578,'id':_0x4f157b[_0x5975ff(0x115)],'resolved':_0x4141ab[_0x5975ff(0x153)]===0x1,'dT':f(_0x4f157b['createTimestamp']),'personId':_0x4f157b['userId'],'threadId':_0x4f157b[_0x5975ff(0x16b)]};}function G(_0xd05cff,_0x5e6a27,_0x27fefb){const _0x4a168a=_0x403535;var _0x13988a,_0x2953e3;if(((_0x2953e3=(_0x13988a=_0xd05cff==null?void 0x0:_0xd05cff[_0x4a168a(0x13e)])==null?void 0x0:_0x13988a[_0x4a168a(0x187)])!=null?_0x2953e3:0x0)>0x0){const _0x178987=(_0x9e613b,_0x1b3077)=>({'id':_0x9e613b[_0x4a168a(0x115)],'threadId':_0x9e613b[_0x4a168a(0x16b)],'dT':f(_0x9e613b['createTimestamp']),'personId':_0x9e613b[_0x4a168a(0x181)],'resolved':_0xd05cff[_0x4a168a(0x153)]===I[_0x4a168a(0x111)],'unitId':_0x5e6a27,'subUnitId':_0x27fefb,'text':JSON[_0x4a168a(0x124)](_0x9e613b[_0x4a168a(0x120)]),'parentId':_0x1b3077}),_0xa57d7f=_0x178987(_0xd05cff[_0x4a168a(0x13e)][0x0]);return{..._0xa57d7f,'children':_0xd05cff['replies']['slice'](0x1)[_0x4a168a(0x12a)](_0x42d106=>_0x178987(_0x42d106,_0xa57d7f['id']))};}return null;}let p=class{constructor(_0x4605fa,_0x23be94,_0x136b59){const _0x50fdf6=_0x403535;this[_0x50fdf6(0x157)]=_0x4605fa,this['_userService']=_0x23be94,this['_sessionService']=_0x136b59;}async[_0x403535(0x156)](_0x43039c){const _0xc81522=_0x403535;var _0x16563d,_0x3dde88;const {parentId:_0x25803d,unitId:_0x48b154,text:_0x1a9370,threadId:_0x53d78d}=_0x43039c,_0x1f1684=(_0x3dde88=(_0x16563d=_0x1a9370['customRanges'])==null?void 0x0:_0x16563d[_0xc81522(0x15b)](_0x245a6c=>_0x245a6c[_0xc81522(0x144)]===c[_0xc81522(0x147)][_0xc81522(0x13c)])[_0xc81522(0x12a)](_0x43ee=>_0x43ee[_0xc81522(0x166)]))!=null?_0x3dde88:[],_0x4f3450=JSON['stringify'](_0x1a9370),_0x76151=(await this[_0xc81522(0x129)][_0xc81522(0x11d)](_0x48b154))[_0xc81522(0x119)]();if(_0x25803d){const _0x55655c={'memberId':_0x76151,'unitId':_0x48b154,'content':_0x4f3450,'mention':_0x1f1684,'threadId':_0x53d78d},_0x601178=(await this[_0xc81522(0x157)][_0xc81522(0x17f)](_0xc81522(0x154)+_0x48b154+'/reply',{'body':_0x55655c}))['body'][_0xc81522(0x173)];return{..._0x43039c,'id':_0x601178[_0xc81522(0x115)],'dT':c[_0xc81522(0x165)](+_0x601178[_0xc81522(0x142)])[_0xc81522(0x136)](_0xc81522(0x113)),'personId':_0x601178[_0xc81522(0x181)]};}else{const _0x355d7a={'memberId':_0x76151,'unitId':_0x48b154,'content':_0x4f3450,'mention':_0x1f1684},_0x3376f2=await this[_0xc81522(0x157)]['post'](_0xc81522(0x154)+_0x48b154+_0xc81522(0x12d),{'body':_0x355d7a});return Y(_0x3376f2[_0xc81522(0x15f)][_0xc81522(0x112)],_0x43039c);}}async[_0x403535(0x117)](_0x1b6a4e){const _0x22703e=_0x403535;var _0x396b2a,_0x184b8c;const {text:_0xb8f7ec,unitId:_0x46ea45}=_0x1b6a4e,_0x39c718=(_0x184b8c=(_0x396b2a=_0xb8f7ec[_0x22703e(0x116)])==null?void 0x0:_0x396b2a[_0x22703e(0x15b)](_0x4e058b=>_0x4e058b[_0x22703e(0x144)]===c[_0x22703e(0x147)][_0x22703e(0x13c)])[_0x22703e(0x12a)](_0x249209=>_0x249209[_0x22703e(0x166)]))!=null?_0x184b8c:[],_0xfa7be5=JSON[_0x22703e(0x110)](_0xb8f7ec),_0x304ece=_0x1b6a4e[_0x22703e(0x16b)],_0x3469b2=_0x1b6a4e['id'],_0x64c318={'memberId':(await this[_0x22703e(0x129)]['requireSession'](_0x46ea45))[_0x22703e(0x119)](),'unitId':_0x46ea45,'threadId':_0x304ece,'mention':_0x39c718,'content':_0xfa7be5,'replyId':_0x3469b2},_0x129e6=await this['_httpService']['post'](_0x22703e(0x154)+_0x46ea45+_0x22703e(0x169),{'body':_0x64c318});return!_0x129e6[_0x22703e(0x15f)]['error']||_0x129e6[_0x22703e(0x15f)][_0x22703e(0x130)][_0x22703e(0x123)]===0x1;}async['resolveComment'](_0x4448fd){const _0x384880=_0x403535,{unitId:_0x56a63f}=_0x4448fd,_0x825319=_0x4448fd['threadId'],_0x24535c={'memberId':this[_0x384880(0x11c)][_0x384880(0x131)]()['userID'],'unitId':_0x56a63f,'threadId':_0x825319,'solved':_0x4448fd[_0x384880(0x179)]?I['Solved']:I[_0x384880(0x16d)]},_0x361012=await this['_httpService'][_0x384880(0x17f)](_0x384880(0x154)+_0x56a63f+'/solved',{'body':_0x24535c});return!_0x361012[_0x384880(0x15f)][_0x384880(0x130)]||_0x361012[_0x384880(0x15f)][_0x384880(0x130)][_0x384880(0x123)]===0x1;}async[_0x403535(0x180)](_0x4df98b,_0x336506,_0x41658e,_0x39bac3){const _0x68287=_0x403535,_0x4dc819={'memberId':(await this['_sessionService'][_0x68287(0x11d)](_0x4df98b))['getMemberID'](),'threadId':_0x41658e,'replyId':_0x39bac3,'unitId':_0x4df98b},_0xfe1463=await this['_httpService'][_0x68287(0x17f)](_0x68287(0x154)+_0x4df98b+_0x68287(0x14e),{'body':_0x4dc819});return!_0xfe1463[_0x68287(0x15f)][_0x68287(0x130)]||_0xfe1463[_0x68287(0x15f)]['error'][_0x68287(0x123)]===0x1;}async[_0x403535(0x184)](_0x57f344,_0x3cf31b,_0xedafc2){const _0x22fad9=_0x403535,_0x1ed200={'unitId':_0x57f344,'threadId':_0xedafc2},_0x5e797f=await this[_0x22fad9(0x157)][_0x22fad9(0x17f)]('/universer-api/comment/unit/'+_0x57f344+_0x22fad9(0x121),{'body':_0x1ed200}),_0x495e7e=_0xedafc2['map'](_0x5be1be=>G(_0x5e797f[_0x22fad9(0x15f)][_0x22fad9(0x175)][_0x5be1be],_0x57f344,_0x3cf31b))['filter'](Boolean);return Object[_0x22fad9(0x164)](_0x5e797f[_0x22fad9(0x15f)][_0x22fad9(0x143)])[_0x22fad9(0x17a)](_0x1b7f35=>{const _0x4eef60=_0x22fad9;this[_0x4eef60(0x11c)][_0x4eef60(0x11f)](_0x1b7f35);}),_0x495e7e;}[_0x403535(0x133)](_0x10de0f){const _0x2f1dc4=_0x403535;return{'id':_0x10de0f['id'],'threadId':_0x10de0f[_0x2f1dc4(0x16b)],'ref':_0x10de0f['ref']};}};p=x([C(0x0,c[_0x403535(0x17b)](P['HTTPService'])),C(0x1,c[_0x403535(0x17b)](c[_0x403535(0x13f)])),C(0x2,c['Inject'](b[_0x403535(0x160)]))],p);var H=Object[_0x403535(0x15e)],J=(_0x42c022,_0xe15ed3,_0xad5346,_0x417de1)=>{for(var _0x3811be=_0x417de1>0x1?void 0x0:_0x417de1?H(_0xe15ed3,_0xad5346):_0xe15ed3,_0x282d7a=_0x42c022['length']-0x1,_0x1a3ff0;_0x282d7a>=0x0;_0x282d7a--)(_0x1a3ff0=_0x42c022[_0x282d7a])&&(_0x3811be=_0x1a3ff0(_0x3811be)||_0x3811be);return _0x3811be;},y=(_0x4c893e,_0x5a0469)=>(_0x1df316,_0x3b9171)=>_0x5a0469(_0x1df316,_0x3b9171,_0x4c893e);let g=class extends c[_0x403535(0x14c)]{constructor(_0x4ab240,_0x5bef83){const _0x57b0be=_0x403535;super(),this[_0x57b0be(0x159)]=_0x4ab240,this[_0x57b0be(0x118)]=_0x5bef83,this[_0x57b0be(0x122)]();}['_initDataSource'](){const _0x3c636f=_0x403535;this[_0x3c636f(0x159)][_0x3c636f(0x14a)]=this['_threadCommentDataSource'],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};g=J([y(0x0,M[_0x403535(0x17e)]),y(0x1,c[_0x403535(0x17b)](p))],g);var F=Object[_0x403535(0x126)],L=Object[_0x403535(0x15e)],Z=(_0xb6f3e7,_0x48fd49,_0x5745a4)=>_0x48fd49 in _0xb6f3e7?F(_0xb6f3e7,_0x48fd49,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5745a4}):_0xb6f3e7[_0x48fd49]=_0x5745a4,W=(_0x2c7ec7,_0x3abdd2,_0x52b61b,_0x3966ab)=>{const _0x287452=_0x403535;for(var _0x3aedb6=_0x3966ab>0x1?void 0x0:_0x3966ab?L(_0x3abdd2,_0x52b61b):_0x3abdd2,_0x136b8b=_0x2c7ec7[_0x287452(0x187)]-0x1,_0x2016bf;_0x136b8b>=0x0;_0x136b8b--)(_0x2016bf=_0x2c7ec7[_0x136b8b])&&(_0x3aedb6=_0x2016bf(_0x3aedb6)||_0x3aedb6);return _0x3aedb6;},O=(_0x3b6df4,_0x4ae35e)=>(_0x237ec8,_0x581e20)=>_0x4ae35e(_0x237ec8,_0x581e20,_0x3b6df4),N=(_0x12e604,_0x483f30,_0x2ba495)=>Z(_0x12e604,typeof _0x483f30!=_0x403535(0x17d)?_0x483f30+'':_0x483f30,_0x2ba495);exports[_0x403535(0x158)]=class extends c['Plugin']{constructor(_0x4a9a0b=D,_0x5067ce,_0xe370d6){const _0x53417e=_0x403535;super(),this[_0x53417e(0x171)]=_0x4a9a0b,this[_0x53417e(0x132)]=_0x5067ce,this[_0x53417e(0x176)]=_0xe370d6;const {..._0x712c50}=c[_0x53417e(0x137)]({},D,this[_0x53417e(0x171)]);this[_0x53417e(0x176)][_0x53417e(0x16c)](q,_0x712c50);}['onStarting'](){const _0x5bcd99=_0x403535;[[p],[g],[_]][_0x5bcd99(0x17a)](_0xcbb101=>{const _0x5becab=_0x5bcd99;this[_0x5becab(0x132)][_0x5becab(0x138)](_0xcbb101);});}[_0x403535(0x12b)](){const _0x181e0d=_0x403535;this[_0x181e0d(0x132)][_0x181e0d(0x15c)](g),this['_injector'][_0x181e0d(0x15c)](_);}},N(exports[_0x403535(0x158)],'pluginName',U),N(exports[_0x403535(0x158)],_0x403535(0x168),c[_0x403535(0x13a)][_0x403535(0x128)]),exports[_0x403535(0x158)]=W([c[_0x403535(0x12f)](w[_0x403535(0x151)],b[_0x403535(0x140)],T[_0x403535(0x127)]),O(0x1,c[_0x403535(0x17b)](c['Injector'])),O(0x2,c[_0x403535(0x139)])],exports[_0x403535(0x158)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x346c01=_0x20bd;(function(_0x5dc717,_0x5c4d83){const _0x5da85f=_0x20bd,_0x420ef4=_0x5dc717();while(!![]){try{const _0x3bfba5=-parseInt(_0x5da85f(0x8f))/0x1*(-parseInt(_0x5da85f(0xc9))/0x2)+-parseInt(_0x5da85f(0xa2))/0x3*(parseInt(_0x5da85f(0xbe))/0x4)+parseInt(_0x5da85f(0xb0))/0x5+parseInt(_0x5da85f(0xc1))/0x6*(parseInt(_0x5da85f(0x9f))/0x7)+parseInt(_0x5da85f(0x78))/0x8+parseInt(_0x5da85f(0x72))/0x9+-parseInt(_0x5da85f(0xaf))/0xa;if(_0x3bfba5===_0x5c4d83)break;else _0x420ef4['push'](_0x420ef4['shift']());}catch(_0x18f05c){_0x420ef4['push'](_0x420ef4['shift']());}}}(_0x2baf,0x7fe3f));import{CommentService as _0x2e07b6,CollaborationSessionService as _0x1a17a2,UniverCollaborationClientPlugin as _0xf6d2e9}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x42d43b}from'@univerjs-pro/license';function _0x2baf(){const _0x1a7801=['1718074lvTLBQ','body','userID','onReady','content','reply','delete','_initUserSync','type','replyId','updateComment','post','5532759enDFKt','ref','setConfig','_userService','users','_threadCommentModel','3322904nXkQHW','deleteComment','getCurrentUser','get','Solve','commentUpdate$','getComment','YYYY/MM/DD\x20HH:mm','getOwnPropertyDescriptor','Unknown','/universer-api/user/list','createTimestamp','_init','stringify','_sessionService','_injector','root','unitId','saveCommentToSnapshot','customRanges','_initDataSource','subscribe','UNRECOGNIZED','1bUqMje','userId','/reply','getMemberID','/add','OpenOrReOpen','parse','pluginName','comment','Add','threadId','_threadCommentDataSourceService','_commentService','rangeType','add','error','16639VxrFQy','UNIVER_UNKNOWN','user','3yWUwUj','filter','values','find','/edit','payload','getUnit','requireSession','comments','length','Reply','Edit','disposeWithMe','11291220fAIXPl','1268465xcFOJD','rangeId','replies','_configService','forEach','_threadCommentDataSource','code','Delete','map','addUser','resolveComment','/universer-api/comment/unit/','slice','defineProperty','2092644lsBGaE','thread-comment-data-source.config','solved','84AcMiEJ','pipe','Solved','/solved','_httpService','COMMENT','format','onStarting'];_0x2baf=function(){return _0x1a7801;};return _0x2baf();}import{dayjs as _0x40a0bb,UserManagerService as _0x98ac35,Inject as _0x11b788,Injector as _0x48aa04,Disposable as _0x3e2a71,CustomRangeType as _0x3950fb,UniverInstanceType as _0x39fdf4,DependentOn as _0x2c6c28,IConfigService as _0x39fab1,Plugin as _0x2f68f0,merge as _0x4f8531}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x289211}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2d80a6,IThreadCommentDataSourceService as _0x172d22}from'@univerjs/thread-comment';import{bufferTime as _0x8b8400}from'rxjs';import{HTTPService as _0x4aa355}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x374a11=>(_0x374a11[_0x374a11[_0x346c01(0x94)]=0x0]=_0x346c01(0x94),_0x374a11[_0x374a11[_0x346c01(0xc3)]=0x1]=_0x346c01(0xc3),_0x374a11[_0x374a11[_0x346c01(0x8e)]=-0x1]=_0x346c01(0x8e),_0x374a11))(I||{}),v=(_0xb47590=>(_0xb47590[_0xb47590[_0x346c01(0x81)]=0x0]=_0x346c01(0x81),_0xb47590[_0xb47590['Add']=0x1]=_0x346c01(0x98),_0xb47590[_0xb47590[_0x346c01(0xac)]=0x2]='Reply',_0xb47590[_0xb47590['Edit']=0x3]=_0x346c01(0xad),_0xb47590[_0xb47590[_0x346c01(0xb7)]=0x4]=_0x346c01(0xb7),_0xb47590[_0xb47590[_0x346c01(0x7c)]=0x5]=_0x346c01(0x7c),_0xb47590[_0xb47590[_0x346c01(0x8e)]=-0x1]=_0x346c01(0x8e),_0xb47590))(v||{});const y=_0x337506=>_0x40a0bb(new Date(+_0x337506))[_0x346c01(0xc7)](_0x346c01(0x7f)),B=async(_0x18e88d,_0x2e2497)=>{const _0x2c68a9=_0x346c01,_0x5309f8=_0x18e88d[_0x2c68a9(0x7b)](_0x98ac35),_0x37d775=_0x18e88d[_0x2c68a9(0x7b)](_0x4aa355);_0x2e2497[_0x2c68a9(0xb4)](_0x3ac00e=>{const _0x456b97=_0x2c68a9;_0x5309f8['getUser'](_0x3ac00e)&&_0x2e2497[_0x456b97(0xcf)](_0x3ac00e);}),_0x2e2497['size']&&(await _0x37d775[_0x2c68a9(0x7b)](_0x2c68a9(0x82),{'params':{'userIDs':[..._0x2e2497]}}))[_0x2c68a9(0xca)]['users'][_0x2c68a9(0xb4)](_0x4295ae=>{const _0x329d85=_0x2c68a9;_0x4295ae&&_0x5309f8[_0x329d85(0xb9)](_0x4295ae);});};var K=Object[_0x346c01(0x80)],V=(_0x2f5395,_0x30d6b4,_0x1b22d5,_0x2fd57f)=>{for(var _0x4e9a43=_0x2fd57f>0x1?void 0x0:_0x2fd57f?K(_0x30d6b4,_0x1b22d5):_0x30d6b4,_0x782629=_0x2f5395['length']-0x1,_0x58477d;_0x782629>=0x0;_0x782629--)(_0x58477d=_0x2f5395[_0x782629])&&(_0x4e9a43=_0x58477d(_0x4e9a43)||_0x4e9a43);return _0x4e9a43;},p=(_0x194e23,_0x187248)=>(_0x3f2326,_0x4a0ed9)=>_0x187248(_0x3f2326,_0x4a0ed9,_0x194e23);let _=class extends _0x3e2a71{constructor(_0x5f57ed,_0x320383,_0x47bd0b,_0x26330c){const _0x383d88=_0x346c01;super(),this[_0x383d88(0x9b)]=_0x5f57ed,this['_threadCommentModel']=_0x320383,this['_userService']=_0x47bd0b,this[_0x383d88(0x87)]=_0x26330c,this['_init'](),this[_0x383d88(0xd0)]();}[_0x346c01(0xd0)](){const _0x266681=_0x346c01;this[_0x266681(0xae)](this[_0x266681(0x77)][_0x266681(0x7d)][_0x266681(0xc2)](_0x8b8400(0x10))[_0x266681(0x8d)](_0x3414a7=>{const _0x3c12bd=_0x266681,_0x4eeb2b=new Set();_0x3414a7[_0x3c12bd(0xb4)](_0x5e2a35=>{const _0x5bc542=_0x3c12bd;switch(_0x5e2a35[_0x5bc542(0xd1)]){case _0x5bc542(0x9d):{const _0xd52e42=_0x5e2a35[_0x5bc542(0xa7)]['personId'];_0x4eeb2b[_0x5bc542(0x9d)](_0xd52e42);break;}}}),B(this[_0x3c12bd(0x87)],_0x4eeb2b);}));}[_0x346c01(0x84)](){const _0x252611=_0x346c01;this[_0x252611(0xae)](this[_0x252611(0x9b)][_0x252611(0x7d)][_0x252611(0x8d)](async _0x490f74=>{const _0x4d9ea8=_0x252611;var _0x1e3c51,_0x31b780,_0x25a9b9,_0x24d614;const _0x235870=(_0x1e3c51=this['_threadCommentModel']['getUnit'](_0x490f74['unitId'])[_0x4d9ea8(0xa5)](_0x2430b3=>_0x2430b3['threadId']===_0x490f74[_0x4d9ea8(0x99)]))==null?void 0x0:_0x1e3c51['root'];if(!_0x235870)return;const {unitId:_0x384050,subUnitId:_0x52e0b0}=_0x235870;switch(_0x490f74[_0x4d9ea8(0xa1)]&&this[_0x4d9ea8(0x75)][_0x4d9ea8(0xb9)](_0x490f74[_0x4d9ea8(0xa1)]),_0x490f74['type']){case v[_0x4d9ea8(0x98)]:break;case v[_0x4d9ea8(0xac)]:{this[_0x4d9ea8(0x77)]['addComment'](_0x384050,_0x52e0b0,{'unitId':_0x384050,'subUnitId':_0x52e0b0,'ref':'','id':_0x490f74['replyId'],'dT':y(+_0x490f74[_0x4d9ea8(0x83)]),'threadId':_0x490f74['threadId'],'personId':(_0x25a9b9=(_0x31b780=_0x490f74['user'])==null?void 0x0:_0x31b780[_0x4d9ea8(0xcb)])!=null?_0x25a9b9:_0x490f74[_0x4d9ea8(0x90)],'text':JSON[_0x4d9ea8(0x95)](_0x490f74['content']),'parentId':_0x235870['id']});break;}case v['Delete']:{const _0x70f05a=this[_0x4d9ea8(0x77)][_0x4d9ea8(0x7e)](_0x384050,_0x52e0b0,_0x490f74[_0x4d9ea8(0xd2)]);_0x70f05a&&_0x70f05a['parentId']&&this['_threadCommentModel'][_0x4d9ea8(0x79)](_0x384050,_0x52e0b0,_0x490f74[_0x4d9ea8(0xd2)]);break;}case v['Edit']:{this[_0x4d9ea8(0x77)][_0x4d9ea8(0xd3)](_0x384050,_0x52e0b0,{'commentId':_0x490f74[_0x4d9ea8(0xd2)],'text':JSON['parse'](_0x490f74[_0x4d9ea8(0xcd)])});break;}case v['Solve']:{const _0x303013=(_0x24d614=this['_threadCommentModel'][_0x4d9ea8(0xa8)](_0x490f74[_0x4d9ea8(0x89)])[_0x4d9ea8(0xa5)](_0x49c758=>_0x49c758[_0x4d9ea8(0x99)]===_0x490f74['threadId']))==null?void 0x0:_0x24d614[_0x4d9ea8(0x88)];_0x303013&&this[_0x4d9ea8(0x77)]['resolveComment'](_0x384050,_0x52e0b0,_0x303013['id'],_0x490f74[_0x4d9ea8(0xc0)]===I[_0x4d9ea8(0xc3)]);break;}}}));}};function _0x20bd(_0x5a3802,_0x4edb0b){_0x5a3802=_0x5a3802-0x71;const _0x2baff6=_0x2baf();let _0x20bd65=_0x2baff6[_0x5a3802];return _0x20bd65;}_=V([p(0x0,_0x11b788(_0x2e07b6)),p(0x1,_0x11b788(_0x2d80a6)),p(0x2,_0x11b788(_0x98ac35)),p(0x3,_0x11b788(_0x48aa04))],_);const z=_0x346c01(0xbf),O={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5bbbac,_0x7febd7,_0x3ef3b2,_0x59447a)=>{const _0x4939da=_0x346c01;for(var _0x6d3d95=_0x59447a>0x1?void 0x0:_0x59447a?k(_0x7febd7,_0x3ef3b2):_0x7febd7,_0x3f9e19=_0x5bbbac[_0x4939da(0xab)]-0x1,_0x2fe5d0;_0x3f9e19>=0x0;_0x3f9e19--)(_0x2fe5d0=_0x5bbbac[_0x3f9e19])&&(_0x6d3d95=_0x2fe5d0(_0x6d3d95)||_0x6d3d95);return _0x6d3d95;},b=(_0x4d9e10,_0x3a2c3f)=>(_0x240b1c,_0x4d0792)=>_0x3a2c3f(_0x240b1c,_0x4d0792,_0x4d9e10);function X(_0x47ea2c,_0x48bbc9){const _0x2ff5d4=_0x346c01,_0x435354=_0x47ea2c[_0x2ff5d4(0xb2)][0x0];return{..._0x48bbc9,'id':_0x435354['replyId'],'resolved':_0x47ea2c[_0x2ff5d4(0xc0)]===0x1,'dT':y(_0x435354['createTimestamp']),'personId':_0x435354[_0x2ff5d4(0x90)],'threadId':_0x435354[_0x2ff5d4(0x99)]};}function ee(_0x2c2e50,_0x550a55,_0x551cdd){const _0x1d7290=_0x346c01;var _0x268b87,_0x25c576;if(((_0x25c576=(_0x268b87=_0x2c2e50==null?void 0x0:_0x2c2e50['replies'])==null?void 0x0:_0x268b87[_0x1d7290(0xab)])!=null?_0x25c576:0x0)>0x0){const _0x470e1b=(_0x5b6c62,_0x47b96f)=>({'id':_0x5b6c62[_0x1d7290(0xd2)],'threadId':_0x5b6c62[_0x1d7290(0x99)],'dT':y(_0x5b6c62['createTimestamp']),'personId':_0x5b6c62[_0x1d7290(0x90)],'resolved':_0x2c2e50[_0x1d7290(0xc0)]===I[_0x1d7290(0xc3)],'unitId':_0x550a55,'subUnitId':_0x551cdd,'text':JSON[_0x1d7290(0x95)](_0x5b6c62['content']),'parentId':_0x47b96f}),_0x23e531=_0x470e1b(_0x2c2e50[_0x1d7290(0xb2)][0x0]);return{..._0x23e531,'children':_0x2c2e50[_0x1d7290(0xb2)][_0x1d7290(0xbc)](0x1)[_0x1d7290(0xb8)](_0x1ecfd=>_0x470e1b(_0x1ecfd,_0x23e531['id']))};}return null;}let S=class{constructor(_0x361dd6,_0x5e1ce7,_0x3e0a67){const _0x1d4f69=_0x346c01;this[_0x1d4f69(0xc5)]=_0x361dd6,this[_0x1d4f69(0x75)]=_0x5e1ce7,this['_sessionService']=_0x3e0a67;}async['addComment'](_0x5328fd){const _0x36201f=_0x346c01;var _0xe1e5b8,_0xe288b;const {parentId:_0x4ebf2d,unitId:_0x25f1bc,text:_0x34563f,threadId:_0x1e4a86}=_0x5328fd,_0x18f2af=(_0xe288b=(_0xe1e5b8=_0x34563f[_0x36201f(0x8b)])==null?void 0x0:_0xe1e5b8[_0x36201f(0xa3)](_0x44046c=>_0x44046c[_0x36201f(0x9c)]===_0x3950fb['COMMENT'])[_0x36201f(0xb8)](_0x1105b8=>_0x1105b8[_0x36201f(0xb1)]))!=null?_0xe288b:[],_0x257409=JSON[_0x36201f(0x85)](_0x34563f),_0x50be42=(await this[_0x36201f(0x86)][_0x36201f(0xa9)](_0x25f1bc))[_0x36201f(0x92)]();if(_0x4ebf2d){const _0x66eb79={'memberId':_0x50be42,'unitId':_0x25f1bc,'content':_0x257409,'mention':_0x18f2af,'threadId':_0x1e4a86},_0x2aeeec=(await this[_0x36201f(0xc5)][_0x36201f(0x71)](_0x36201f(0xbb)+_0x25f1bc+_0x36201f(0x91),{'body':_0x66eb79}))[_0x36201f(0xca)][_0x36201f(0xce)];return{..._0x5328fd,'id':_0x2aeeec['replyId'],'dT':_0x40a0bb(+_0x2aeeec[_0x36201f(0x83)])[_0x36201f(0xc7)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2aeeec[_0x36201f(0x90)]};}else{const _0x416d0a={'memberId':_0x50be42,'unitId':_0x25f1bc,'content':_0x257409,'mention':_0x18f2af},_0x543479=await this[_0x36201f(0xc5)][_0x36201f(0x71)](_0x36201f(0xbb)+_0x25f1bc+_0x36201f(0x93),{'body':_0x416d0a});return X(_0x543479[_0x36201f(0xca)][_0x36201f(0x97)],_0x5328fd);}}async[_0x346c01(0xd3)](_0x33fa54){const _0x1c6eb3=_0x346c01;var _0x2e712d,_0x368d98;const {text:_0xe54e6b,unitId:_0x16354b}=_0x33fa54,_0x5edfa1=(_0x368d98=(_0x2e712d=_0xe54e6b[_0x1c6eb3(0x8b)])==null?void 0x0:_0x2e712d[_0x1c6eb3(0xa3)](_0x595b7e=>_0x595b7e['rangeType']===_0x3950fb[_0x1c6eb3(0xc6)])['map'](_0x5a7c7a=>_0x5a7c7a[_0x1c6eb3(0xb1)]))!=null?_0x368d98:[],_0x530eff=JSON[_0x1c6eb3(0x85)](_0xe54e6b),_0x4558be=_0x33fa54['threadId'],_0x23ebb9=_0x33fa54['id'],_0x1236bd={'memberId':(await this[_0x1c6eb3(0x86)]['requireSession'](_0x16354b))['getMemberID'](),'unitId':_0x16354b,'threadId':_0x4558be,'mention':_0x5edfa1,'content':_0x530eff,'replyId':_0x23ebb9},_0x586242=await this[_0x1c6eb3(0xc5)][_0x1c6eb3(0x71)](_0x1c6eb3(0xbb)+_0x16354b+_0x1c6eb3(0xa6),{'body':_0x1236bd});return!_0x586242[_0x1c6eb3(0xca)][_0x1c6eb3(0x9e)]||_0x586242[_0x1c6eb3(0xca)]['error'][_0x1c6eb3(0xb6)]===0x1;}async[_0x346c01(0xba)](_0x42d17a){const _0x21fa54=_0x346c01,{unitId:_0x40f4ef}=_0x42d17a,_0x17cd03=_0x42d17a[_0x21fa54(0x99)],_0x5d00c5={'memberId':this[_0x21fa54(0x75)][_0x21fa54(0x7a)]()[_0x21fa54(0xcb)],'unitId':_0x40f4ef,'threadId':_0x17cd03,'solved':_0x42d17a['resolved']?I['Solved']:I[_0x21fa54(0x94)]},_0x526a65=await this[_0x21fa54(0xc5)][_0x21fa54(0x71)](_0x21fa54(0xbb)+_0x40f4ef+_0x21fa54(0xc4),{'body':_0x5d00c5});return!_0x526a65[_0x21fa54(0xca)][_0x21fa54(0x9e)]||_0x526a65[_0x21fa54(0xca)][_0x21fa54(0x9e)][_0x21fa54(0xb6)]===0x1;}async['deleteComment'](_0x155fcd,_0x36d3c4,_0xfe86bc,_0x541000){const _0x364317=_0x346c01,_0x997a13={'memberId':(await this['_sessionService'][_0x364317(0xa9)](_0x155fcd))['getMemberID'](),'threadId':_0xfe86bc,'replyId':_0x541000,'unitId':_0x155fcd},_0x133ba9=await this['_httpService'][_0x364317(0x71)](_0x364317(0xbb)+_0x155fcd+'/delete',{'body':_0x997a13});return!_0x133ba9[_0x364317(0xca)][_0x364317(0x9e)]||_0x133ba9[_0x364317(0xca)]['error'][_0x364317(0xb6)]===0x1;}async['listComments'](_0x30e676,_0x53256c,_0x5eed7a){const _0x4ea13f=_0x346c01,_0x1c3059={'unitId':_0x30e676,'threadId':_0x5eed7a},_0x28d9ee=await this[_0x4ea13f(0xc5)][_0x4ea13f(0x71)](_0x4ea13f(0xbb)+_0x30e676+'/list',{'body':_0x1c3059}),_0x38196a=_0x5eed7a[_0x4ea13f(0xb8)](_0x1ec921=>ee(_0x28d9ee[_0x4ea13f(0xca)][_0x4ea13f(0xaa)][_0x1ec921],_0x30e676,_0x53256c))['filter'](Boolean);return Object[_0x4ea13f(0xa4)](_0x28d9ee['body'][_0x4ea13f(0x76)])[_0x4ea13f(0xb4)](_0x24bea4=>{const _0x4c8678=_0x4ea13f;this[_0x4c8678(0x75)][_0x4c8678(0xb9)](_0x24bea4);}),_0x38196a;}[_0x346c01(0x8a)](_0x4a6d54){const _0xad4055=_0x346c01;return{'id':_0x4a6d54['id'],'threadId':_0x4a6d54[_0xad4055(0x99)],'ref':_0x4a6d54[_0xad4055(0x73)]};}};S=Q([b(0x0,_0x11b788(_0x4aa355)),b(0x1,_0x11b788(_0x98ac35)),b(0x2,_0x11b788(_0x1a17a2))],S);var re=Object[_0x346c01(0x80)],te=(_0x52d795,_0x32ea0d,_0x31b957,_0x254cb3)=>{const _0x1295dc=_0x346c01;for(var _0x5eac4a=_0x254cb3>0x1?void 0x0:_0x254cb3?re(_0x32ea0d,_0x31b957):_0x32ea0d,_0x224a0f=_0x52d795[_0x1295dc(0xab)]-0x1,_0x3d983d;_0x224a0f>=0x0;_0x224a0f--)(_0x3d983d=_0x52d795[_0x224a0f])&&(_0x5eac4a=_0x3d983d(_0x5eac4a)||_0x5eac4a);return _0x5eac4a;},M=(_0x77704a,_0x51b57f)=>(_0x4f3cbb,_0xb3440c)=>_0x51b57f(_0x4f3cbb,_0xb3440c,_0x77704a);let f=class extends _0x3e2a71{constructor(_0x1f0973,_0x2b8468){const _0x2fb279=_0x346c01;super(),this[_0x2fb279(0x9a)]=_0x1f0973,this[_0x2fb279(0xb5)]=_0x2b8468,this['_initDataSource']();}[_0x346c01(0x8c)](){const _0x57fbac=_0x346c01;this[_0x57fbac(0x9a)]['dataSource']=this[_0x57fbac(0xb5)],this[_0x57fbac(0x9a)]['syncUpdateMutationToColla']=!0x1;}};f=te([M(0x0,_0x172d22),M(0x1,_0x11b788(S))],f);var se=Object[_0x346c01(0xbd)],oe=Object[_0x346c01(0x80)],ne=(_0x39e76f,_0x1d61dc,_0x454d31)=>_0x1d61dc in _0x39e76f?se(_0x39e76f,_0x1d61dc,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x454d31}):_0x39e76f[_0x1d61dc]=_0x454d31,ie=(_0x12744d,_0x25a524,_0x311cb6,_0x5b0b45)=>{const _0x28507f=_0x346c01;for(var _0x3534f3=_0x5b0b45>0x1?void 0x0:_0x5b0b45?oe(_0x25a524,_0x311cb6):_0x25a524,_0x1d0e64=_0x12744d[_0x28507f(0xab)]-0x1,_0x2f034e;_0x1d0e64>=0x0;_0x1d0e64--)(_0x2f034e=_0x12744d[_0x1d0e64])&&(_0x3534f3=_0x2f034e(_0x3534f3)||_0x3534f3);return _0x3534f3;},N=(_0xc6180a,_0x48d421)=>(_0x2c4418,_0x35689c)=>_0x48d421(_0x2c4418,_0x35689c,_0xc6180a),$=(_0x4162fb,_0x1231c3,_0x402efb)=>ne(_0x4162fb,typeof _0x1231c3!='symbol'?_0x1231c3+'':_0x1231c3,_0x402efb);let g=class extends _0x2f68f0{constructor(_0x1fc071=O,_0x17f145,_0x1fc28a){const _0x4be81e=_0x346c01;super(),this['_config']=_0x1fc071,this[_0x4be81e(0x87)]=_0x17f145,this[_0x4be81e(0xb3)]=_0x1fc28a;const {..._0x419664}=_0x4f8531({},O,this['_config']);this['_configService'][_0x4be81e(0x74)](z,_0x419664);}[_0x346c01(0xc8)](){[[S],[f],[_]]['forEach'](_0x3626b1=>{const _0x2bff57=_0x20bd;this['_injector'][_0x2bff57(0x9d)](_0x3626b1);});}[_0x346c01(0xcc)](){const _0x2d0632=_0x346c01;this[_0x2d0632(0x87)][_0x2d0632(0x7b)](f),this[_0x2d0632(0x87)][_0x2d0632(0x7b)](_);}};$(g,_0x346c01(0x96),W),$(g,_0x346c01(0xd1),_0x39fdf4[_0x346c01(0xa0)]),g=ie([_0x2c6c28(_0x289211,_0xf6d2e9,_0x42d43b),N(0x1,_0x11b788(_0x48aa04)),N(0x2,_0x39fab1)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x71f2d7=_0x57eb;(function(_0x21d274,_0x5b5f29){const _0x210c0f=_0x57eb,_0x4c60a5=_0x21d274();while(!![]){try{const _0x41e4b2=-parseInt(_0x210c0f(0x13a))/0x1+-parseInt(_0x210c0f(0x17e))/0x2*(-parseInt(_0x210c0f(0x183))/0x3)+-parseInt(_0x210c0f(0x16e))/0x4+parseInt(_0x210c0f(0x18d))/0x5+-parseInt(_0x210c0f(0x172))/0x6+parseInt(_0x210c0f(0x17b))/0x7+-parseInt(_0x210c0f(0x15f))/0x8*(-parseInt(_0x210c0f(0x191))/0x9);if(_0x41e4b2===_0x5b5f29)break;else _0x4c60a5['push'](_0x4c60a5['shift']());}catch(_0x38ab9d){_0x4c60a5['push'](_0x4c60a5['shift']());}}}(_0x2680,0x5a759));import{CommentService as _0x23ec2c,CollaborationSessionService as _0x4ead13,UniverCollaborationClientPlugin as _0x33917a}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x44e499}from'@univerjs-pro/license';import{dayjs as _0x56b0b9,UserManagerService as _0x49c7ce,Inject as _0x4b8dfe,Injector as _0x1eebbd,Disposable as _0x29e1ca,CustomRangeType as _0x33e38f,UniverInstanceType as _0x48d0a5,DependentOn as _0x296157,IConfigService as _0x128401,Plugin as _0x39767c,merge as _0xf97ff9}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x228392}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2dcc4e,IThreadCommentDataSourceService as _0x3f700d}from'@univerjs/thread-comment';function _0x2680(){const _0x5cfac5=['/universer-api/comment/unit/','content','3339189KczdwP','UNRECOGNIZED','_httpService','_threadCommentModel','ref','forEach','post','defineProperty','thread-comment-data-source.config','_configService','/reply','threadId','code','165751IbCFzR','replyId','Solve','stringify','_initUserSync','_initDataSource','resolveComment','users','rangeId','createTimestamp','_injector','symbol','YYYY/MM/DD\x20HH:mm','error','/delete','format','addUser','_commentService','body','disposeWithMe','personId','_init','_config','find','_threadCommentDataSource','COMMENT','addComment','customRanges','getComment','_userService','UNIVER_UNKNOWN','Unknown','Reply','filter','updateComment','_sessionService','userID','8HWPjIc','replies','requireSession','length','parentId','delete','slice','Add','Delete','comment','_threadCommentDataSourceService','/list','Edit','listComments','commentUpdate$','1633040Iufwuz','dataSource','userId','user','3930714jnCjRk','/universer-api/user/list','getUnit','rangeType','onReady','getOwnPropertyDescriptor','payload','get','/solved','2344671phmOhH','solved','resolved','2ojgqBx','subscribe','getCurrentUser','getMemberID','parse','1013406tPGfzb','syncUpdateMutationToColla','OpenOrReOpen','root','map','Solved','setConfig','add','type','deleteComment','2779375YZfdKo','values'];_0x2680=function(){return _0x5cfac5;};return _0x2680();}import{bufferTime as _0x3508e9}from'rxjs';import{HTTPService as _0x15440e}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x56fc1d=>(_0x56fc1d[_0x56fc1d['OpenOrReOpen']=0x0]='OpenOrReOpen',_0x56fc1d[_0x56fc1d[_0x71f2d7(0x188)]=0x1]=_0x71f2d7(0x188),_0x56fc1d[_0x56fc1d[_0x71f2d7(0x192)]=-0x1]=_0x71f2d7(0x192),_0x56fc1d))(I||{}),v=(_0x26871d=>(_0x26871d[_0x26871d[_0x71f2d7(0x159)]=0x0]=_0x71f2d7(0x159),_0x26871d[_0x26871d[_0x71f2d7(0x166)]=0x1]=_0x71f2d7(0x166),_0x26871d[_0x26871d[_0x71f2d7(0x15a)]=0x2]=_0x71f2d7(0x15a),_0x26871d[_0x26871d[_0x71f2d7(0x16b)]=0x3]=_0x71f2d7(0x16b),_0x26871d[_0x26871d[_0x71f2d7(0x167)]=0x4]=_0x71f2d7(0x167),_0x26871d[_0x26871d['Solve']=0x5]=_0x71f2d7(0x13c),_0x26871d[_0x26871d[_0x71f2d7(0x192)]=-0x1]=_0x71f2d7(0x192),_0x26871d))(v||{});const y=_0x4296bd=>_0x56b0b9(new Date(+_0x4296bd))[_0x71f2d7(0x149)](_0x71f2d7(0x146)),B=async(_0x1ac44e,_0x4198a7)=>{const _0x5c3ae5=_0x71f2d7,_0x3ac77b=_0x1ac44e[_0x5c3ae5(0x179)](_0x49c7ce),_0x2b1578=_0x1ac44e[_0x5c3ae5(0x179)](_0x15440e);_0x4198a7['forEach'](_0x1286b8=>{const _0x26abe=_0x5c3ae5;_0x3ac77b['getUser'](_0x1286b8)&&_0x4198a7[_0x26abe(0x164)](_0x1286b8);}),_0x4198a7['size']&&(await _0x2b1578[_0x5c3ae5(0x179)](_0x5c3ae5(0x173),{'params':{'userIDs':[..._0x4198a7]}}))['body'][_0x5c3ae5(0x141)]['forEach'](_0xe61910=>{const _0x136b5b=_0x5c3ae5;_0xe61910&&_0x3ac77b[_0x136b5b(0x14a)](_0xe61910);});};var K=Object[_0x71f2d7(0x177)],V=(_0x1d4c36,_0x52bff5,_0x2de957,_0xfd6f4c)=>{const _0x5bd90d=_0x71f2d7;for(var _0x4ac7ea=_0xfd6f4c>0x1?void 0x0:_0xfd6f4c?K(_0x52bff5,_0x2de957):_0x52bff5,_0x1f51ba=_0x1d4c36[_0x5bd90d(0x162)]-0x1,_0x2707df;_0x1f51ba>=0x0;_0x1f51ba--)(_0x2707df=_0x1d4c36[_0x1f51ba])&&(_0x4ac7ea=_0x2707df(_0x4ac7ea)||_0x4ac7ea);return _0x4ac7ea;},p=(_0x5bfa55,_0x5a8f58)=>(_0x23f223,_0x3f5dda)=>_0x5a8f58(_0x23f223,_0x3f5dda,_0x5bfa55);function _0x57eb(_0x1136d5,_0xda6e82){_0x1136d5=_0x1136d5-0x135;const _0x26806f=_0x2680();let _0x57ebbc=_0x26806f[_0x1136d5];return _0x57ebbc;}let _=class extends _0x29e1ca{constructor(_0xe091b8,_0x26fd23,_0x3baac5,_0x33652c){const _0x3fdb7f=_0x71f2d7;super(),this['_commentService']=_0xe091b8,this[_0x3fdb7f(0x194)]=_0x26fd23,this['_userService']=_0x3baac5,this[_0x3fdb7f(0x144)]=_0x33652c,this[_0x3fdb7f(0x14f)](),this[_0x3fdb7f(0x13e)]();}[_0x71f2d7(0x13e)](){const _0x416183=_0x71f2d7;this[_0x416183(0x14d)](this[_0x416183(0x194)][_0x416183(0x16d)]['pipe'](_0x3508e9(0x10))[_0x416183(0x17f)](_0x1ee22a=>{const _0x561f50=_0x416183,_0x264331=new Set();_0x1ee22a[_0x561f50(0x196)](_0x1ba53c=>{const _0x3d3925=_0x561f50;switch(_0x1ba53c['type']){case _0x3d3925(0x18a):{const _0x1ca1e8=_0x1ba53c[_0x3d3925(0x178)][_0x3d3925(0x14e)];_0x264331[_0x3d3925(0x18a)](_0x1ca1e8);break;}}}),B(this['_injector'],_0x264331);}));}[_0x71f2d7(0x14f)](){const _0xb9b1b1=_0x71f2d7;this[_0xb9b1b1(0x14d)](this[_0xb9b1b1(0x14b)]['commentUpdate$'][_0xb9b1b1(0x17f)](async _0x1c8959=>{const _0x1c3d0c=_0xb9b1b1;var _0x1083d4,_0x13f867,_0x4e51cb,_0x4a91a2;const _0x45b154=(_0x1083d4=this[_0x1c3d0c(0x194)]['getUnit'](_0x1c8959['unitId'])['find'](_0x48a8be=>_0x48a8be[_0x1c3d0c(0x138)]===_0x1c8959[_0x1c3d0c(0x138)]))==null?void 0x0:_0x1083d4[_0x1c3d0c(0x186)];if(!_0x45b154)return;const {unitId:_0xaf9cca,subUnitId:_0x3413ef}=_0x45b154;switch(_0x1c8959['user']&&this[_0x1c3d0c(0x157)]['addUser'](_0x1c8959[_0x1c3d0c(0x171)]),_0x1c8959[_0x1c3d0c(0x18b)]){case v['Add']:break;case v[_0x1c3d0c(0x15a)]:{this['_threadCommentModel'][_0x1c3d0c(0x154)](_0xaf9cca,_0x3413ef,{'unitId':_0xaf9cca,'subUnitId':_0x3413ef,'ref':'','id':_0x1c8959[_0x1c3d0c(0x13b)],'dT':y(+_0x1c8959[_0x1c3d0c(0x143)]),'threadId':_0x1c8959[_0x1c3d0c(0x138)],'personId':(_0x4e51cb=(_0x13f867=_0x1c8959[_0x1c3d0c(0x171)])==null?void 0x0:_0x13f867[_0x1c3d0c(0x15e)])!=null?_0x4e51cb:_0x1c8959[_0x1c3d0c(0x170)],'text':JSON['parse'](_0x1c8959[_0x1c3d0c(0x190)]),'parentId':_0x45b154['id']});break;}case v[_0x1c3d0c(0x167)]:{const _0x4db363=this[_0x1c3d0c(0x194)][_0x1c3d0c(0x156)](_0xaf9cca,_0x3413ef,_0x1c8959['replyId']);_0x4db363&&_0x4db363[_0x1c3d0c(0x163)]&&this[_0x1c3d0c(0x194)]['deleteComment'](_0xaf9cca,_0x3413ef,_0x1c8959[_0x1c3d0c(0x13b)]);break;}case v[_0x1c3d0c(0x16b)]:{this[_0x1c3d0c(0x194)][_0x1c3d0c(0x15c)](_0xaf9cca,_0x3413ef,{'commentId':_0x1c8959['replyId'],'text':JSON['parse'](_0x1c8959[_0x1c3d0c(0x190)])});break;}case v[_0x1c3d0c(0x13c)]:{const _0x5549a1=(_0x4a91a2=this[_0x1c3d0c(0x194)][_0x1c3d0c(0x174)](_0x1c8959['unitId'])[_0x1c3d0c(0x151)](_0x93216c=>_0x93216c[_0x1c3d0c(0x138)]===_0x1c8959[_0x1c3d0c(0x138)]))==null?void 0x0:_0x4a91a2[_0x1c3d0c(0x186)];_0x5549a1&&this[_0x1c3d0c(0x194)][_0x1c3d0c(0x140)](_0xaf9cca,_0x3413ef,_0x5549a1['id'],_0x1c8959['solved']===I[_0x1c3d0c(0x188)]);break;}}}));}};_=V([p(0x0,_0x4b8dfe(_0x23ec2c)),p(0x1,_0x4b8dfe(_0x2dcc4e)),p(0x2,_0x4b8dfe(_0x49c7ce)),p(0x3,_0x4b8dfe(_0x1eebbd))],_);const z=_0x71f2d7(0x135),O={};var k=Object[_0x71f2d7(0x177)],Q=(_0x3d60bc,_0x493938,_0x136973,_0x1d93f6)=>{const _0x3369e1=_0x71f2d7;for(var _0x517063=_0x1d93f6>0x1?void 0x0:_0x1d93f6?k(_0x493938,_0x136973):_0x493938,_0x188461=_0x3d60bc[_0x3369e1(0x162)]-0x1,_0x40d2e8;_0x188461>=0x0;_0x188461--)(_0x40d2e8=_0x3d60bc[_0x188461])&&(_0x517063=_0x40d2e8(_0x517063)||_0x517063);return _0x517063;},b=(_0x35691c,_0x67caae)=>(_0x2ee21b,_0x17d4a1)=>_0x67caae(_0x2ee21b,_0x17d4a1,_0x35691c);function X(_0x59ab06,_0x4cc334){const _0x4457af=_0x71f2d7,_0x5e5dc6=_0x59ab06[_0x4457af(0x160)][0x0];return{..._0x4cc334,'id':_0x5e5dc6[_0x4457af(0x13b)],'resolved':_0x59ab06[_0x4457af(0x17c)]===0x1,'dT':y(_0x5e5dc6[_0x4457af(0x143)]),'personId':_0x5e5dc6['userId'],'threadId':_0x5e5dc6[_0x4457af(0x138)]};}function ee(_0x2267d7,_0x4f4b41,_0x39b43d){const _0x3b5123=_0x71f2d7;var _0x30f74c,_0x206827;if(((_0x206827=(_0x30f74c=_0x2267d7==null?void 0x0:_0x2267d7[_0x3b5123(0x160)])==null?void 0x0:_0x30f74c[_0x3b5123(0x162)])!=null?_0x206827:0x0)>0x0){const _0x13066a=(_0x15f570,_0x301025)=>({'id':_0x15f570[_0x3b5123(0x13b)],'threadId':_0x15f570['threadId'],'dT':y(_0x15f570[_0x3b5123(0x143)]),'personId':_0x15f570[_0x3b5123(0x170)],'resolved':_0x2267d7[_0x3b5123(0x17c)]===I['Solved'],'unitId':_0x4f4b41,'subUnitId':_0x39b43d,'text':JSON[_0x3b5123(0x182)](_0x15f570['content']),'parentId':_0x301025}),_0x15e419=_0x13066a(_0x2267d7[_0x3b5123(0x160)][0x0]);return{..._0x15e419,'children':_0x2267d7[_0x3b5123(0x160)][_0x3b5123(0x165)](0x1)[_0x3b5123(0x187)](_0x35e611=>_0x13066a(_0x35e611,_0x15e419['id']))};}return null;}let S=class{constructor(_0x25f792,_0x849e6d,_0x39f288){const _0x8e49be=_0x71f2d7;this[_0x8e49be(0x193)]=_0x25f792,this[_0x8e49be(0x157)]=_0x849e6d,this[_0x8e49be(0x15d)]=_0x39f288;}async[_0x71f2d7(0x154)](_0x242c98){const _0xa5f463=_0x71f2d7;var _0x38accf,_0x353f16;const {parentId:_0x2a7630,unitId:_0x497fec,text:_0xf6a2ce,threadId:_0x195cc2}=_0x242c98,_0x295059=(_0x353f16=(_0x38accf=_0xf6a2ce[_0xa5f463(0x155)])==null?void 0x0:_0x38accf['filter'](_0xcf57df=>_0xcf57df['rangeType']===_0x33e38f[_0xa5f463(0x153)])[_0xa5f463(0x187)](_0x5a3db7=>_0x5a3db7[_0xa5f463(0x142)]))!=null?_0x353f16:[],_0x426211=JSON['stringify'](_0xf6a2ce),_0x29028c=(await this[_0xa5f463(0x15d)][_0xa5f463(0x161)](_0x497fec))[_0xa5f463(0x181)]();if(_0x2a7630){const _0x1e955a={'memberId':_0x29028c,'unitId':_0x497fec,'content':_0x426211,'mention':_0x295059,'threadId':_0x195cc2},_0x1cbd27=(await this['_httpService'][_0xa5f463(0x197)]('/universer-api/comment/unit/'+_0x497fec+_0xa5f463(0x137),{'body':_0x1e955a}))[_0xa5f463(0x14c)]['reply'];return{..._0x242c98,'id':_0x1cbd27[_0xa5f463(0x13b)],'dT':_0x56b0b9(+_0x1cbd27[_0xa5f463(0x143)])[_0xa5f463(0x149)](_0xa5f463(0x146)),'personId':_0x1cbd27['userId']};}else{const _0x416382={'memberId':_0x29028c,'unitId':_0x497fec,'content':_0x426211,'mention':_0x295059},_0x64dbf6=await this['_httpService'][_0xa5f463(0x197)](_0xa5f463(0x18f)+_0x497fec+'/add',{'body':_0x416382});return X(_0x64dbf6[_0xa5f463(0x14c)][_0xa5f463(0x168)],_0x242c98);}}async[_0x71f2d7(0x15c)](_0x5b8b9a){const _0x405343=_0x71f2d7;var _0x34842a,_0x430f73;const {text:_0x9d1f6d,unitId:_0x2cf297}=_0x5b8b9a,_0x4e7979=(_0x430f73=(_0x34842a=_0x9d1f6d[_0x405343(0x155)])==null?void 0x0:_0x34842a[_0x405343(0x15b)](_0x3ad844=>_0x3ad844[_0x405343(0x175)]===_0x33e38f[_0x405343(0x153)])['map'](_0xce2b6b=>_0xce2b6b[_0x405343(0x142)]))!=null?_0x430f73:[],_0x1b0ac6=JSON[_0x405343(0x13d)](_0x9d1f6d),_0x5616c4=_0x5b8b9a[_0x405343(0x138)],_0x35d6b2=_0x5b8b9a['id'],_0x52df02={'memberId':(await this[_0x405343(0x15d)]['requireSession'](_0x2cf297))[_0x405343(0x181)](),'unitId':_0x2cf297,'threadId':_0x5616c4,'mention':_0x4e7979,'content':_0x1b0ac6,'replyId':_0x35d6b2},_0x4baeac=await this['_httpService']['post']('/universer-api/comment/unit/'+_0x2cf297+'/edit',{'body':_0x52df02});return!_0x4baeac[_0x405343(0x14c)][_0x405343(0x147)]||_0x4baeac[_0x405343(0x14c)][_0x405343(0x147)]['code']===0x1;}async['resolveComment'](_0x33443c){const _0x1bf878=_0x71f2d7,{unitId:_0x1eafff}=_0x33443c,_0x28978b=_0x33443c[_0x1bf878(0x138)],_0x24b380={'memberId':this[_0x1bf878(0x157)][_0x1bf878(0x180)]()[_0x1bf878(0x15e)],'unitId':_0x1eafff,'threadId':_0x28978b,'solved':_0x33443c[_0x1bf878(0x17d)]?I[_0x1bf878(0x188)]:I[_0x1bf878(0x185)]},_0x55081b=await this[_0x1bf878(0x193)][_0x1bf878(0x197)](_0x1bf878(0x18f)+_0x1eafff+_0x1bf878(0x17a),{'body':_0x24b380});return!_0x55081b[_0x1bf878(0x14c)][_0x1bf878(0x147)]||_0x55081b['body'][_0x1bf878(0x147)][_0x1bf878(0x139)]===0x1;}async[_0x71f2d7(0x18c)](_0x4737d2,_0x1f6e83,_0x10f08c,_0x492560){const _0x54d510=_0x71f2d7,_0x1ccf04={'memberId':(await this[_0x54d510(0x15d)][_0x54d510(0x161)](_0x4737d2))[_0x54d510(0x181)](),'threadId':_0x10f08c,'replyId':_0x492560,'unitId':_0x4737d2},_0x2829ca=await this['_httpService'][_0x54d510(0x197)](_0x54d510(0x18f)+_0x4737d2+_0x54d510(0x148),{'body':_0x1ccf04});return!_0x2829ca[_0x54d510(0x14c)]['error']||_0x2829ca[_0x54d510(0x14c)]['error']['code']===0x1;}async[_0x71f2d7(0x16c)](_0x1bf58e,_0x43c086,_0x11e529){const _0x3b4f67=_0x71f2d7,_0x3d576b={'unitId':_0x1bf58e,'threadId':_0x11e529},_0x4f57fa=await this[_0x3b4f67(0x193)][_0x3b4f67(0x197)]('/universer-api/comment/unit/'+_0x1bf58e+_0x3b4f67(0x16a),{'body':_0x3d576b}),_0x12307e=_0x11e529[_0x3b4f67(0x187)](_0x31626e=>ee(_0x4f57fa[_0x3b4f67(0x14c)]['comments'][_0x31626e],_0x1bf58e,_0x43c086))[_0x3b4f67(0x15b)](Boolean);return Object[_0x3b4f67(0x18e)](_0x4f57fa[_0x3b4f67(0x14c)][_0x3b4f67(0x141)])['forEach'](_0x4a9a31=>{const _0x3df9de=_0x3b4f67;this[_0x3df9de(0x157)][_0x3df9de(0x14a)](_0x4a9a31);}),_0x12307e;}['saveCommentToSnapshot'](_0x2422c6){const _0x27c2cc=_0x71f2d7;return{'id':_0x2422c6['id'],'threadId':_0x2422c6[_0x27c2cc(0x138)],'ref':_0x2422c6[_0x27c2cc(0x195)]};}};S=Q([b(0x0,_0x4b8dfe(_0x15440e)),b(0x1,_0x4b8dfe(_0x49c7ce)),b(0x2,_0x4b8dfe(_0x4ead13))],S);var re=Object[_0x71f2d7(0x177)],te=(_0x50bf10,_0x3fdbfc,_0x36687f,_0x289651)=>{const _0x173baa=_0x71f2d7;for(var _0x39cbfb=_0x289651>0x1?void 0x0:_0x289651?re(_0x3fdbfc,_0x36687f):_0x3fdbfc,_0x5a9f7d=_0x50bf10[_0x173baa(0x162)]-0x1,_0x59fe3c;_0x5a9f7d>=0x0;_0x5a9f7d--)(_0x59fe3c=_0x50bf10[_0x5a9f7d])&&(_0x39cbfb=_0x59fe3c(_0x39cbfb)||_0x39cbfb);return _0x39cbfb;},M=(_0x5b7d28,_0x24860d)=>(_0x4551b0,_0x870ee8)=>_0x24860d(_0x4551b0,_0x870ee8,_0x5b7d28);let f=class extends _0x29e1ca{constructor(_0xf65984,_0x4262cc){const _0x412f95=_0x71f2d7;super(),this[_0x412f95(0x169)]=_0xf65984,this[_0x412f95(0x152)]=_0x4262cc,this['_initDataSource']();}[_0x71f2d7(0x13f)](){const _0x4e4d0b=_0x71f2d7;this[_0x4e4d0b(0x169)][_0x4e4d0b(0x16f)]=this['_threadCommentDataSource'],this[_0x4e4d0b(0x169)][_0x4e4d0b(0x184)]=!0x1;}};f=te([M(0x0,_0x3f700d),M(0x1,_0x4b8dfe(S))],f);var se=Object[_0x71f2d7(0x198)],oe=Object[_0x71f2d7(0x177)],ne=(_0x5a2935,_0x1a5f49,_0x2380d7)=>_0x1a5f49 in _0x5a2935?se(_0x5a2935,_0x1a5f49,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2380d7}):_0x5a2935[_0x1a5f49]=_0x2380d7,ie=(_0x42624b,_0x16437a,_0x5817be,_0x2f9234)=>{const _0x257769=_0x71f2d7;for(var _0x20b0cc=_0x2f9234>0x1?void 0x0:_0x2f9234?oe(_0x16437a,_0x5817be):_0x16437a,_0x465cc7=_0x42624b[_0x257769(0x162)]-0x1,_0x51cc57;_0x465cc7>=0x0;_0x465cc7--)(_0x51cc57=_0x42624b[_0x465cc7])&&(_0x20b0cc=_0x51cc57(_0x20b0cc)||_0x20b0cc);return _0x20b0cc;},N=(_0x5ebd8c,_0xf91dba)=>(_0x45e77c,_0x410d4e)=>_0xf91dba(_0x45e77c,_0x410d4e,_0x5ebd8c),$=(_0x3476e5,_0x1d61ca,_0x2345bc)=>ne(_0x3476e5,typeof _0x1d61ca!=_0x71f2d7(0x145)?_0x1d61ca+'':_0x1d61ca,_0x2345bc);let g=class extends _0x39767c{constructor(_0x30c6c8=O,_0x1b0758,_0x4b4e72){const _0x1510e7=_0x71f2d7;super(),this[_0x1510e7(0x150)]=_0x30c6c8,this[_0x1510e7(0x144)]=_0x1b0758,this[_0x1510e7(0x136)]=_0x4b4e72;const {..._0x185bf6}=_0xf97ff9({},O,this[_0x1510e7(0x150)]);this['_configService'][_0x1510e7(0x189)](z,_0x185bf6);}['onStarting'](){const _0x9bf7fb=_0x71f2d7;[[S],[f],[_]][_0x9bf7fb(0x196)](_0x31e914=>{const _0x587ac2=_0x9bf7fb;this[_0x587ac2(0x144)][_0x587ac2(0x18a)](_0x31e914);});}[_0x71f2d7(0x176)](){const _0x2c4b82=_0x71f2d7;this[_0x2c4b82(0x144)][_0x2c4b82(0x179)](f),this[_0x2c4b82(0x144)][_0x2c4b82(0x179)](_);}};$(g,'pluginName',W),$(g,'type',_0x48d0a5[_0x71f2d7(0x158)]),g=ie([_0x296157(_0x228392,_0x33917a,_0x44e499),N(0x1,_0x4b8dfe(_0x1eebbd)),N(0x2,_0x128401)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x346c01=_0x20bd;(function(_0x5dc717,_0x5c4d83){const _0x5da85f=_0x20bd,_0x420ef4=_0x5dc717();while(!![]){try{const _0x3bfba5=-parseInt(_0x5da85f(0x8f))/0x1*(-parseInt(_0x5da85f(0xc9))/0x2)+-parseInt(_0x5da85f(0xa2))/0x3*(parseInt(_0x5da85f(0xbe))/0x4)+parseInt(_0x5da85f(0xb0))/0x5+parseInt(_0x5da85f(0xc1))/0x6*(parseInt(_0x5da85f(0x9f))/0x7)+parseInt(_0x5da85f(0x78))/0x8+parseInt(_0x5da85f(0x72))/0x9+-parseInt(_0x5da85f(0xaf))/0xa;if(_0x3bfba5===_0x5c4d83)break;else _0x420ef4['push'](_0x420ef4['shift']());}catch(_0x18f05c){_0x420ef4['push'](_0x420ef4['shift']());}}}(_0x2baf,0x7fe3f));import{CommentService as _0x2e07b6,CollaborationSessionService as _0x1a17a2,UniverCollaborationClientPlugin as _0xf6d2e9}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x42d43b}from'@univerjs-pro/license';function _0x2baf(){const _0x1a7801=['1718074lvTLBQ','body','userID','onReady','content','reply','delete','_initUserSync','type','replyId','updateComment','post','5532759enDFKt','ref','setConfig','_userService','users','_threadCommentModel','3322904nXkQHW','deleteComment','getCurrentUser','get','Solve','commentUpdate$','getComment','YYYY/MM/DD\x20HH:mm','getOwnPropertyDescriptor','Unknown','/universer-api/user/list','createTimestamp','_init','stringify','_sessionService','_injector','root','unitId','saveCommentToSnapshot','customRanges','_initDataSource','subscribe','UNRECOGNIZED','1bUqMje','userId','/reply','getMemberID','/add','OpenOrReOpen','parse','pluginName','comment','Add','threadId','_threadCommentDataSourceService','_commentService','rangeType','add','error','16639VxrFQy','UNIVER_UNKNOWN','user','3yWUwUj','filter','values','find','/edit','payload','getUnit','requireSession','comments','length','Reply','Edit','disposeWithMe','11291220fAIXPl','1268465xcFOJD','rangeId','replies','_configService','forEach','_threadCommentDataSource','code','Delete','map','addUser','resolveComment','/universer-api/comment/unit/','slice','defineProperty','2092644lsBGaE','thread-comment-data-source.config','solved','84AcMiEJ','pipe','Solved','/solved','_httpService','COMMENT','format','onStarting'];_0x2baf=function(){return _0x1a7801;};return _0x2baf();}import{dayjs as _0x40a0bb,UserManagerService as _0x98ac35,Inject as _0x11b788,Injector as _0x48aa04,Disposable as _0x3e2a71,CustomRangeType as _0x3950fb,UniverInstanceType as _0x39fdf4,DependentOn as _0x2c6c28,IConfigService as _0x39fab1,Plugin as _0x2f68f0,merge as _0x4f8531}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x289211}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2d80a6,IThreadCommentDataSourceService as _0x172d22}from'@univerjs/thread-comment';import{bufferTime as _0x8b8400}from'rxjs';import{HTTPService as _0x4aa355}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x374a11=>(_0x374a11[_0x374a11[_0x346c01(0x94)]=0x0]=_0x346c01(0x94),_0x374a11[_0x374a11[_0x346c01(0xc3)]=0x1]=_0x346c01(0xc3),_0x374a11[_0x374a11[_0x346c01(0x8e)]=-0x1]=_0x346c01(0x8e),_0x374a11))(I||{}),v=(_0xb47590=>(_0xb47590[_0xb47590[_0x346c01(0x81)]=0x0]=_0x346c01(0x81),_0xb47590[_0xb47590['Add']=0x1]=_0x346c01(0x98),_0xb47590[_0xb47590[_0x346c01(0xac)]=0x2]='Reply',_0xb47590[_0xb47590['Edit']=0x3]=_0x346c01(0xad),_0xb47590[_0xb47590[_0x346c01(0xb7)]=0x4]=_0x346c01(0xb7),_0xb47590[_0xb47590[_0x346c01(0x7c)]=0x5]=_0x346c01(0x7c),_0xb47590[_0xb47590[_0x346c01(0x8e)]=-0x1]=_0x346c01(0x8e),_0xb47590))(v||{});const y=_0x337506=>_0x40a0bb(new Date(+_0x337506))[_0x346c01(0xc7)](_0x346c01(0x7f)),B=async(_0x18e88d,_0x2e2497)=>{const _0x2c68a9=_0x346c01,_0x5309f8=_0x18e88d[_0x2c68a9(0x7b)](_0x98ac35),_0x37d775=_0x18e88d[_0x2c68a9(0x7b)](_0x4aa355);_0x2e2497[_0x2c68a9(0xb4)](_0x3ac00e=>{const _0x456b97=_0x2c68a9;_0x5309f8['getUser'](_0x3ac00e)&&_0x2e2497[_0x456b97(0xcf)](_0x3ac00e);}),_0x2e2497['size']&&(await _0x37d775[_0x2c68a9(0x7b)](_0x2c68a9(0x82),{'params':{'userIDs':[..._0x2e2497]}}))[_0x2c68a9(0xca)]['users'][_0x2c68a9(0xb4)](_0x4295ae=>{const _0x329d85=_0x2c68a9;_0x4295ae&&_0x5309f8[_0x329d85(0xb9)](_0x4295ae);});};var K=Object[_0x346c01(0x80)],V=(_0x2f5395,_0x30d6b4,_0x1b22d5,_0x2fd57f)=>{for(var _0x4e9a43=_0x2fd57f>0x1?void 0x0:_0x2fd57f?K(_0x30d6b4,_0x1b22d5):_0x30d6b4,_0x782629=_0x2f5395['length']-0x1,_0x58477d;_0x782629>=0x0;_0x782629--)(_0x58477d=_0x2f5395[_0x782629])&&(_0x4e9a43=_0x58477d(_0x4e9a43)||_0x4e9a43);return _0x4e9a43;},p=(_0x194e23,_0x187248)=>(_0x3f2326,_0x4a0ed9)=>_0x187248(_0x3f2326,_0x4a0ed9,_0x194e23);let _=class extends _0x3e2a71{constructor(_0x5f57ed,_0x320383,_0x47bd0b,_0x26330c){const _0x383d88=_0x346c01;super(),this[_0x383d88(0x9b)]=_0x5f57ed,this['_threadCommentModel']=_0x320383,this['_userService']=_0x47bd0b,this[_0x383d88(0x87)]=_0x26330c,this['_init'](),this[_0x383d88(0xd0)]();}[_0x346c01(0xd0)](){const _0x266681=_0x346c01;this[_0x266681(0xae)](this[_0x266681(0x77)][_0x266681(0x7d)][_0x266681(0xc2)](_0x8b8400(0x10))[_0x266681(0x8d)](_0x3414a7=>{const _0x3c12bd=_0x266681,_0x4eeb2b=new Set();_0x3414a7[_0x3c12bd(0xb4)](_0x5e2a35=>{const _0x5bc542=_0x3c12bd;switch(_0x5e2a35[_0x5bc542(0xd1)]){case _0x5bc542(0x9d):{const _0xd52e42=_0x5e2a35[_0x5bc542(0xa7)]['personId'];_0x4eeb2b[_0x5bc542(0x9d)](_0xd52e42);break;}}}),B(this[_0x3c12bd(0x87)],_0x4eeb2b);}));}[_0x346c01(0x84)](){const _0x252611=_0x346c01;this[_0x252611(0xae)](this[_0x252611(0x9b)][_0x252611(0x7d)][_0x252611(0x8d)](async _0x490f74=>{const _0x4d9ea8=_0x252611;var _0x1e3c51,_0x31b780,_0x25a9b9,_0x24d614;const _0x235870=(_0x1e3c51=this['_threadCommentModel']['getUnit'](_0x490f74['unitId'])[_0x4d9ea8(0xa5)](_0x2430b3=>_0x2430b3['threadId']===_0x490f74[_0x4d9ea8(0x99)]))==null?void 0x0:_0x1e3c51['root'];if(!_0x235870)return;const {unitId:_0x384050,subUnitId:_0x52e0b0}=_0x235870;switch(_0x490f74[_0x4d9ea8(0xa1)]&&this[_0x4d9ea8(0x75)][_0x4d9ea8(0xb9)](_0x490f74[_0x4d9ea8(0xa1)]),_0x490f74['type']){case v[_0x4d9ea8(0x98)]:break;case v[_0x4d9ea8(0xac)]:{this[_0x4d9ea8(0x77)]['addComment'](_0x384050,_0x52e0b0,{'unitId':_0x384050,'subUnitId':_0x52e0b0,'ref':'','id':_0x490f74['replyId'],'dT':y(+_0x490f74[_0x4d9ea8(0x83)]),'threadId':_0x490f74['threadId'],'personId':(_0x25a9b9=(_0x31b780=_0x490f74['user'])==null?void 0x0:_0x31b780[_0x4d9ea8(0xcb)])!=null?_0x25a9b9:_0x490f74[_0x4d9ea8(0x90)],'text':JSON[_0x4d9ea8(0x95)](_0x490f74['content']),'parentId':_0x235870['id']});break;}case v['Delete']:{const _0x70f05a=this[_0x4d9ea8(0x77)][_0x4d9ea8(0x7e)](_0x384050,_0x52e0b0,_0x490f74[_0x4d9ea8(0xd2)]);_0x70f05a&&_0x70f05a['parentId']&&this['_threadCommentModel'][_0x4d9ea8(0x79)](_0x384050,_0x52e0b0,_0x490f74[_0x4d9ea8(0xd2)]);break;}case v['Edit']:{this[_0x4d9ea8(0x77)][_0x4d9ea8(0xd3)](_0x384050,_0x52e0b0,{'commentId':_0x490f74[_0x4d9ea8(0xd2)],'text':JSON['parse'](_0x490f74[_0x4d9ea8(0xcd)])});break;}case v['Solve']:{const _0x303013=(_0x24d614=this['_threadCommentModel'][_0x4d9ea8(0xa8)](_0x490f74[_0x4d9ea8(0x89)])[_0x4d9ea8(0xa5)](_0x49c758=>_0x49c758[_0x4d9ea8(0x99)]===_0x490f74['threadId']))==null?void 0x0:_0x24d614[_0x4d9ea8(0x88)];_0x303013&&this[_0x4d9ea8(0x77)]['resolveComment'](_0x384050,_0x52e0b0,_0x303013['id'],_0x490f74[_0x4d9ea8(0xc0)]===I[_0x4d9ea8(0xc3)]);break;}}}));}};function _0x20bd(_0x5a3802,_0x4edb0b){_0x5a3802=_0x5a3802-0x71;const _0x2baff6=_0x2baf();let _0x20bd65=_0x2baff6[_0x5a3802];return _0x20bd65;}_=V([p(0x0,_0x11b788(_0x2e07b6)),p(0x1,_0x11b788(_0x2d80a6)),p(0x2,_0x11b788(_0x98ac35)),p(0x3,_0x11b788(_0x48aa04))],_);const z=_0x346c01(0xbf),O={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5bbbac,_0x7febd7,_0x3ef3b2,_0x59447a)=>{const _0x4939da=_0x346c01;for(var _0x6d3d95=_0x59447a>0x1?void 0x0:_0x59447a?k(_0x7febd7,_0x3ef3b2):_0x7febd7,_0x3f9e19=_0x5bbbac[_0x4939da(0xab)]-0x1,_0x2fe5d0;_0x3f9e19>=0x0;_0x3f9e19--)(_0x2fe5d0=_0x5bbbac[_0x3f9e19])&&(_0x6d3d95=_0x2fe5d0(_0x6d3d95)||_0x6d3d95);return _0x6d3d95;},b=(_0x4d9e10,_0x3a2c3f)=>(_0x240b1c,_0x4d0792)=>_0x3a2c3f(_0x240b1c,_0x4d0792,_0x4d9e10);function X(_0x47ea2c,_0x48bbc9){const _0x2ff5d4=_0x346c01,_0x435354=_0x47ea2c[_0x2ff5d4(0xb2)][0x0];return{..._0x48bbc9,'id':_0x435354['replyId'],'resolved':_0x47ea2c[_0x2ff5d4(0xc0)]===0x1,'dT':y(_0x435354['createTimestamp']),'personId':_0x435354[_0x2ff5d4(0x90)],'threadId':_0x435354[_0x2ff5d4(0x99)]};}function ee(_0x2c2e50,_0x550a55,_0x551cdd){const _0x1d7290=_0x346c01;var _0x268b87,_0x25c576;if(((_0x25c576=(_0x268b87=_0x2c2e50==null?void 0x0:_0x2c2e50['replies'])==null?void 0x0:_0x268b87[_0x1d7290(0xab)])!=null?_0x25c576:0x0)>0x0){const _0x470e1b=(_0x5b6c62,_0x47b96f)=>({'id':_0x5b6c62[_0x1d7290(0xd2)],'threadId':_0x5b6c62[_0x1d7290(0x99)],'dT':y(_0x5b6c62['createTimestamp']),'personId':_0x5b6c62[_0x1d7290(0x90)],'resolved':_0x2c2e50[_0x1d7290(0xc0)]===I[_0x1d7290(0xc3)],'unitId':_0x550a55,'subUnitId':_0x551cdd,'text':JSON[_0x1d7290(0x95)](_0x5b6c62['content']),'parentId':_0x47b96f}),_0x23e531=_0x470e1b(_0x2c2e50[_0x1d7290(0xb2)][0x0]);return{..._0x23e531,'children':_0x2c2e50[_0x1d7290(0xb2)][_0x1d7290(0xbc)](0x1)[_0x1d7290(0xb8)](_0x1ecfd=>_0x470e1b(_0x1ecfd,_0x23e531['id']))};}return null;}let S=class{constructor(_0x361dd6,_0x5e1ce7,_0x3e0a67){const _0x1d4f69=_0x346c01;this[_0x1d4f69(0xc5)]=_0x361dd6,this[_0x1d4f69(0x75)]=_0x5e1ce7,this['_sessionService']=_0x3e0a67;}async['addComment'](_0x5328fd){const _0x36201f=_0x346c01;var _0xe1e5b8,_0xe288b;const {parentId:_0x4ebf2d,unitId:_0x25f1bc,text:_0x34563f,threadId:_0x1e4a86}=_0x5328fd,_0x18f2af=(_0xe288b=(_0xe1e5b8=_0x34563f[_0x36201f(0x8b)])==null?void 0x0:_0xe1e5b8[_0x36201f(0xa3)](_0x44046c=>_0x44046c[_0x36201f(0x9c)]===_0x3950fb['COMMENT'])[_0x36201f(0xb8)](_0x1105b8=>_0x1105b8[_0x36201f(0xb1)]))!=null?_0xe288b:[],_0x257409=JSON[_0x36201f(0x85)](_0x34563f),_0x50be42=(await this[_0x36201f(0x86)][_0x36201f(0xa9)](_0x25f1bc))[_0x36201f(0x92)]();if(_0x4ebf2d){const _0x66eb79={'memberId':_0x50be42,'unitId':_0x25f1bc,'content':_0x257409,'mention':_0x18f2af,'threadId':_0x1e4a86},_0x2aeeec=(await this[_0x36201f(0xc5)][_0x36201f(0x71)](_0x36201f(0xbb)+_0x25f1bc+_0x36201f(0x91),{'body':_0x66eb79}))[_0x36201f(0xca)][_0x36201f(0xce)];return{..._0x5328fd,'id':_0x2aeeec['replyId'],'dT':_0x40a0bb(+_0x2aeeec[_0x36201f(0x83)])[_0x36201f(0xc7)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2aeeec[_0x36201f(0x90)]};}else{const _0x416d0a={'memberId':_0x50be42,'unitId':_0x25f1bc,'content':_0x257409,'mention':_0x18f2af},_0x543479=await this[_0x36201f(0xc5)][_0x36201f(0x71)](_0x36201f(0xbb)+_0x25f1bc+_0x36201f(0x93),{'body':_0x416d0a});return X(_0x543479[_0x36201f(0xca)][_0x36201f(0x97)],_0x5328fd);}}async[_0x346c01(0xd3)](_0x33fa54){const _0x1c6eb3=_0x346c01;var _0x2e712d,_0x368d98;const {text:_0xe54e6b,unitId:_0x16354b}=_0x33fa54,_0x5edfa1=(_0x368d98=(_0x2e712d=_0xe54e6b[_0x1c6eb3(0x8b)])==null?void 0x0:_0x2e712d[_0x1c6eb3(0xa3)](_0x595b7e=>_0x595b7e['rangeType']===_0x3950fb[_0x1c6eb3(0xc6)])['map'](_0x5a7c7a=>_0x5a7c7a[_0x1c6eb3(0xb1)]))!=null?_0x368d98:[],_0x530eff=JSON[_0x1c6eb3(0x85)](_0xe54e6b),_0x4558be=_0x33fa54['threadId'],_0x23ebb9=_0x33fa54['id'],_0x1236bd={'memberId':(await this[_0x1c6eb3(0x86)]['requireSession'](_0x16354b))['getMemberID'](),'unitId':_0x16354b,'threadId':_0x4558be,'mention':_0x5edfa1,'content':_0x530eff,'replyId':_0x23ebb9},_0x586242=await this[_0x1c6eb3(0xc5)][_0x1c6eb3(0x71)](_0x1c6eb3(0xbb)+_0x16354b+_0x1c6eb3(0xa6),{'body':_0x1236bd});return!_0x586242[_0x1c6eb3(0xca)][_0x1c6eb3(0x9e)]||_0x586242[_0x1c6eb3(0xca)]['error'][_0x1c6eb3(0xb6)]===0x1;}async[_0x346c01(0xba)](_0x42d17a){const _0x21fa54=_0x346c01,{unitId:_0x40f4ef}=_0x42d17a,_0x17cd03=_0x42d17a[_0x21fa54(0x99)],_0x5d00c5={'memberId':this[_0x21fa54(0x75)][_0x21fa54(0x7a)]()[_0x21fa54(0xcb)],'unitId':_0x40f4ef,'threadId':_0x17cd03,'solved':_0x42d17a['resolved']?I['Solved']:I[_0x21fa54(0x94)]},_0x526a65=await this[_0x21fa54(0xc5)][_0x21fa54(0x71)](_0x21fa54(0xbb)+_0x40f4ef+_0x21fa54(0xc4),{'body':_0x5d00c5});return!_0x526a65[_0x21fa54(0xca)][_0x21fa54(0x9e)]||_0x526a65[_0x21fa54(0xca)][_0x21fa54(0x9e)][_0x21fa54(0xb6)]===0x1;}async['deleteComment'](_0x155fcd,_0x36d3c4,_0xfe86bc,_0x541000){const _0x364317=_0x346c01,_0x997a13={'memberId':(await this['_sessionService'][_0x364317(0xa9)](_0x155fcd))['getMemberID'](),'threadId':_0xfe86bc,'replyId':_0x541000,'unitId':_0x155fcd},_0x133ba9=await this['_httpService'][_0x364317(0x71)](_0x364317(0xbb)+_0x155fcd+'/delete',{'body':_0x997a13});return!_0x133ba9[_0x364317(0xca)][_0x364317(0x9e)]||_0x133ba9[_0x364317(0xca)]['error'][_0x364317(0xb6)]===0x1;}async['listComments'](_0x30e676,_0x53256c,_0x5eed7a){const _0x4ea13f=_0x346c01,_0x1c3059={'unitId':_0x30e676,'threadId':_0x5eed7a},_0x28d9ee=await this[_0x4ea13f(0xc5)][_0x4ea13f(0x71)](_0x4ea13f(0xbb)+_0x30e676+'/list',{'body':_0x1c3059}),_0x38196a=_0x5eed7a[_0x4ea13f(0xb8)](_0x1ec921=>ee(_0x28d9ee[_0x4ea13f(0xca)][_0x4ea13f(0xaa)][_0x1ec921],_0x30e676,_0x53256c))['filter'](Boolean);return Object[_0x4ea13f(0xa4)](_0x28d9ee['body'][_0x4ea13f(0x76)])[_0x4ea13f(0xb4)](_0x24bea4=>{const _0x4c8678=_0x4ea13f;this[_0x4c8678(0x75)][_0x4c8678(0xb9)](_0x24bea4);}),_0x38196a;}[_0x346c01(0x8a)](_0x4a6d54){const _0xad4055=_0x346c01;return{'id':_0x4a6d54['id'],'threadId':_0x4a6d54[_0xad4055(0x99)],'ref':_0x4a6d54[_0xad4055(0x73)]};}};S=Q([b(0x0,_0x11b788(_0x4aa355)),b(0x1,_0x11b788(_0x98ac35)),b(0x2,_0x11b788(_0x1a17a2))],S);var re=Object[_0x346c01(0x80)],te=(_0x52d795,_0x32ea0d,_0x31b957,_0x254cb3)=>{const _0x1295dc=_0x346c01;for(var _0x5eac4a=_0x254cb3>0x1?void 0x0:_0x254cb3?re(_0x32ea0d,_0x31b957):_0x32ea0d,_0x224a0f=_0x52d795[_0x1295dc(0xab)]-0x1,_0x3d983d;_0x224a0f>=0x0;_0x224a0f--)(_0x3d983d=_0x52d795[_0x224a0f])&&(_0x5eac4a=_0x3d983d(_0x5eac4a)||_0x5eac4a);return _0x5eac4a;},M=(_0x77704a,_0x51b57f)=>(_0x4f3cbb,_0xb3440c)=>_0x51b57f(_0x4f3cbb,_0xb3440c,_0x77704a);let f=class extends _0x3e2a71{constructor(_0x1f0973,_0x2b8468){const _0x2fb279=_0x346c01;super(),this[_0x2fb279(0x9a)]=_0x1f0973,this[_0x2fb279(0xb5)]=_0x2b8468,this['_initDataSource']();}[_0x346c01(0x8c)](){const _0x57fbac=_0x346c01;this[_0x57fbac(0x9a)]['dataSource']=this[_0x57fbac(0xb5)],this[_0x57fbac(0x9a)]['syncUpdateMutationToColla']=!0x1;}};f=te([M(0x0,_0x172d22),M(0x1,_0x11b788(S))],f);var se=Object[_0x346c01(0xbd)],oe=Object[_0x346c01(0x80)],ne=(_0x39e76f,_0x1d61dc,_0x454d31)=>_0x1d61dc in _0x39e76f?se(_0x39e76f,_0x1d61dc,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x454d31}):_0x39e76f[_0x1d61dc]=_0x454d31,ie=(_0x12744d,_0x25a524,_0x311cb6,_0x5b0b45)=>{const _0x28507f=_0x346c01;for(var _0x3534f3=_0x5b0b45>0x1?void 0x0:_0x5b0b45?oe(_0x25a524,_0x311cb6):_0x25a524,_0x1d0e64=_0x12744d[_0x28507f(0xab)]-0x1,_0x2f034e;_0x1d0e64>=0x0;_0x1d0e64--)(_0x2f034e=_0x12744d[_0x1d0e64])&&(_0x3534f3=_0x2f034e(_0x3534f3)||_0x3534f3);return _0x3534f3;},N=(_0xc6180a,_0x48d421)=>(_0x2c4418,_0x35689c)=>_0x48d421(_0x2c4418,_0x35689c,_0xc6180a),$=(_0x4162fb,_0x1231c3,_0x402efb)=>ne(_0x4162fb,typeof _0x1231c3!='symbol'?_0x1231c3+'':_0x1231c3,_0x402efb);let g=class extends _0x2f68f0{constructor(_0x1fc071=O,_0x17f145,_0x1fc28a){const _0x4be81e=_0x346c01;super(),this['_config']=_0x1fc071,this[_0x4be81e(0x87)]=_0x17f145,this[_0x4be81e(0xb3)]=_0x1fc28a;const {..._0x419664}=_0x4f8531({},O,this['_config']);this['_configService'][_0x4be81e(0x74)](z,_0x419664);}[_0x346c01(0xc8)](){[[S],[f],[_]]['forEach'](_0x3626b1=>{const _0x2bff57=_0x20bd;this['_injector'][_0x2bff57(0x9d)](_0x3626b1);});}[_0x346c01(0xcc)](){const _0x2d0632=_0x346c01;this[_0x2d0632(0x87)][_0x2d0632(0x7b)](f),this[_0x2d0632(0x87)][_0x2d0632(0x7b)](_);}};$(g,_0x346c01(0x96),W),$(g,_0x346c01(0xd1),_0x39fdf4[_0x346c01(0xa0)]),g=ie([_0x2c6c28(_0x289211,_0xf6d2e9,_0x42d43b),N(0x1,_0x11b788(_0x48aa04)),N(0x2,_0x39fab1)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x71f2d7=_0x57eb;(function(_0x21d274,_0x5b5f29){const _0x210c0f=_0x57eb,_0x4c60a5=_0x21d274();while(!![]){try{const _0x41e4b2=-parseInt(_0x210c0f(0x13a))/0x1+-parseInt(_0x210c0f(0x17e))/0x2*(-parseInt(_0x210c0f(0x183))/0x3)+-parseInt(_0x210c0f(0x16e))/0x4+parseInt(_0x210c0f(0x18d))/0x5+-parseInt(_0x210c0f(0x172))/0x6+parseInt(_0x210c0f(0x17b))/0x7+-parseInt(_0x210c0f(0x15f))/0x8*(-parseInt(_0x210c0f(0x191))/0x9);if(_0x41e4b2===_0x5b5f29)break;else _0x4c60a5['push'](_0x4c60a5['shift']());}catch(_0x38ab9d){_0x4c60a5['push'](_0x4c60a5['shift']());}}}(_0x2680,0x5a759));import{CommentService as _0x23ec2c,CollaborationSessionService as _0x4ead13,UniverCollaborationClientPlugin as _0x33917a}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x44e499}from'@univerjs-pro/license';import{dayjs as _0x56b0b9,UserManagerService as _0x49c7ce,Inject as _0x4b8dfe,Injector as _0x1eebbd,Disposable as _0x29e1ca,CustomRangeType as _0x33e38f,UniverInstanceType as _0x48d0a5,DependentOn as _0x296157,IConfigService as _0x128401,Plugin as _0x39767c,merge as _0xf97ff9}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x228392}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2dcc4e,IThreadCommentDataSourceService as _0x3f700d}from'@univerjs/thread-comment';function _0x2680(){const _0x5cfac5=['/universer-api/comment/unit/','content','3339189KczdwP','UNRECOGNIZED','_httpService','_threadCommentModel','ref','forEach','post','defineProperty','thread-comment-data-source.config','_configService','/reply','threadId','code','165751IbCFzR','replyId','Solve','stringify','_initUserSync','_initDataSource','resolveComment','users','rangeId','createTimestamp','_injector','symbol','YYYY/MM/DD\x20HH:mm','error','/delete','format','addUser','_commentService','body','disposeWithMe','personId','_init','_config','find','_threadCommentDataSource','COMMENT','addComment','customRanges','getComment','_userService','UNIVER_UNKNOWN','Unknown','Reply','filter','updateComment','_sessionService','userID','8HWPjIc','replies','requireSession','length','parentId','delete','slice','Add','Delete','comment','_threadCommentDataSourceService','/list','Edit','listComments','commentUpdate$','1633040Iufwuz','dataSource','userId','user','3930714jnCjRk','/universer-api/user/list','getUnit','rangeType','onReady','getOwnPropertyDescriptor','payload','get','/solved','2344671phmOhH','solved','resolved','2ojgqBx','subscribe','getCurrentUser','getMemberID','parse','1013406tPGfzb','syncUpdateMutationToColla','OpenOrReOpen','root','map','Solved','setConfig','add','type','deleteComment','2779375YZfdKo','values'];_0x2680=function(){return _0x5cfac5;};return _0x2680();}import{bufferTime as _0x3508e9}from'rxjs';import{HTTPService as _0x15440e}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x56fc1d=>(_0x56fc1d[_0x56fc1d['OpenOrReOpen']=0x0]='OpenOrReOpen',_0x56fc1d[_0x56fc1d[_0x71f2d7(0x188)]=0x1]=_0x71f2d7(0x188),_0x56fc1d[_0x56fc1d[_0x71f2d7(0x192)]=-0x1]=_0x71f2d7(0x192),_0x56fc1d))(I||{}),v=(_0x26871d=>(_0x26871d[_0x26871d[_0x71f2d7(0x159)]=0x0]=_0x71f2d7(0x159),_0x26871d[_0x26871d[_0x71f2d7(0x166)]=0x1]=_0x71f2d7(0x166),_0x26871d[_0x26871d[_0x71f2d7(0x15a)]=0x2]=_0x71f2d7(0x15a),_0x26871d[_0x26871d[_0x71f2d7(0x16b)]=0x3]=_0x71f2d7(0x16b),_0x26871d[_0x26871d[_0x71f2d7(0x167)]=0x4]=_0x71f2d7(0x167),_0x26871d[_0x26871d['Solve']=0x5]=_0x71f2d7(0x13c),_0x26871d[_0x26871d[_0x71f2d7(0x192)]=-0x1]=_0x71f2d7(0x192),_0x26871d))(v||{});const y=_0x4296bd=>_0x56b0b9(new Date(+_0x4296bd))[_0x71f2d7(0x149)](_0x71f2d7(0x146)),B=async(_0x1ac44e,_0x4198a7)=>{const _0x5c3ae5=_0x71f2d7,_0x3ac77b=_0x1ac44e[_0x5c3ae5(0x179)](_0x49c7ce),_0x2b1578=_0x1ac44e[_0x5c3ae5(0x179)](_0x15440e);_0x4198a7['forEach'](_0x1286b8=>{const _0x26abe=_0x5c3ae5;_0x3ac77b['getUser'](_0x1286b8)&&_0x4198a7[_0x26abe(0x164)](_0x1286b8);}),_0x4198a7['size']&&(await _0x2b1578[_0x5c3ae5(0x179)](_0x5c3ae5(0x173),{'params':{'userIDs':[..._0x4198a7]}}))['body'][_0x5c3ae5(0x141)]['forEach'](_0xe61910=>{const _0x136b5b=_0x5c3ae5;_0xe61910&&_0x3ac77b[_0x136b5b(0x14a)](_0xe61910);});};var K=Object[_0x71f2d7(0x177)],V=(_0x1d4c36,_0x52bff5,_0x2de957,_0xfd6f4c)=>{const _0x5bd90d=_0x71f2d7;for(var _0x4ac7ea=_0xfd6f4c>0x1?void 0x0:_0xfd6f4c?K(_0x52bff5,_0x2de957):_0x52bff5,_0x1f51ba=_0x1d4c36[_0x5bd90d(0x162)]-0x1,_0x2707df;_0x1f51ba>=0x0;_0x1f51ba--)(_0x2707df=_0x1d4c36[_0x1f51ba])&&(_0x4ac7ea=_0x2707df(_0x4ac7ea)||_0x4ac7ea);return _0x4ac7ea;},p=(_0x5bfa55,_0x5a8f58)=>(_0x23f223,_0x3f5dda)=>_0x5a8f58(_0x23f223,_0x3f5dda,_0x5bfa55);function _0x57eb(_0x1136d5,_0xda6e82){_0x1136d5=_0x1136d5-0x135;const _0x26806f=_0x2680();let _0x57ebbc=_0x26806f[_0x1136d5];return _0x57ebbc;}let _=class extends _0x29e1ca{constructor(_0xe091b8,_0x26fd23,_0x3baac5,_0x33652c){const _0x3fdb7f=_0x71f2d7;super(),this['_commentService']=_0xe091b8,this[_0x3fdb7f(0x194)]=_0x26fd23,this['_userService']=_0x3baac5,this[_0x3fdb7f(0x144)]=_0x33652c,this[_0x3fdb7f(0x14f)](),this[_0x3fdb7f(0x13e)]();}[_0x71f2d7(0x13e)](){const _0x416183=_0x71f2d7;this[_0x416183(0x14d)](this[_0x416183(0x194)][_0x416183(0x16d)]['pipe'](_0x3508e9(0x10))[_0x416183(0x17f)](_0x1ee22a=>{const _0x561f50=_0x416183,_0x264331=new Set();_0x1ee22a[_0x561f50(0x196)](_0x1ba53c=>{const _0x3d3925=_0x561f50;switch(_0x1ba53c['type']){case _0x3d3925(0x18a):{const _0x1ca1e8=_0x1ba53c[_0x3d3925(0x178)][_0x3d3925(0x14e)];_0x264331[_0x3d3925(0x18a)](_0x1ca1e8);break;}}}),B(this['_injector'],_0x264331);}));}[_0x71f2d7(0x14f)](){const _0xb9b1b1=_0x71f2d7;this[_0xb9b1b1(0x14d)](this[_0xb9b1b1(0x14b)]['commentUpdate$'][_0xb9b1b1(0x17f)](async _0x1c8959=>{const _0x1c3d0c=_0xb9b1b1;var _0x1083d4,_0x13f867,_0x4e51cb,_0x4a91a2;const _0x45b154=(_0x1083d4=this[_0x1c3d0c(0x194)]['getUnit'](_0x1c8959['unitId'])['find'](_0x48a8be=>_0x48a8be[_0x1c3d0c(0x138)]===_0x1c8959[_0x1c3d0c(0x138)]))==null?void 0x0:_0x1083d4[_0x1c3d0c(0x186)];if(!_0x45b154)return;const {unitId:_0xaf9cca,subUnitId:_0x3413ef}=_0x45b154;switch(_0x1c8959['user']&&this[_0x1c3d0c(0x157)]['addUser'](_0x1c8959[_0x1c3d0c(0x171)]),_0x1c8959[_0x1c3d0c(0x18b)]){case v['Add']:break;case v[_0x1c3d0c(0x15a)]:{this['_threadCommentModel'][_0x1c3d0c(0x154)](_0xaf9cca,_0x3413ef,{'unitId':_0xaf9cca,'subUnitId':_0x3413ef,'ref':'','id':_0x1c8959[_0x1c3d0c(0x13b)],'dT':y(+_0x1c8959[_0x1c3d0c(0x143)]),'threadId':_0x1c8959[_0x1c3d0c(0x138)],'personId':(_0x4e51cb=(_0x13f867=_0x1c8959[_0x1c3d0c(0x171)])==null?void 0x0:_0x13f867[_0x1c3d0c(0x15e)])!=null?_0x4e51cb:_0x1c8959[_0x1c3d0c(0x170)],'text':JSON['parse'](_0x1c8959[_0x1c3d0c(0x190)]),'parentId':_0x45b154['id']});break;}case v[_0x1c3d0c(0x167)]:{const _0x4db363=this[_0x1c3d0c(0x194)][_0x1c3d0c(0x156)](_0xaf9cca,_0x3413ef,_0x1c8959['replyId']);_0x4db363&&_0x4db363[_0x1c3d0c(0x163)]&&this[_0x1c3d0c(0x194)]['deleteComment'](_0xaf9cca,_0x3413ef,_0x1c8959[_0x1c3d0c(0x13b)]);break;}case v[_0x1c3d0c(0x16b)]:{this[_0x1c3d0c(0x194)][_0x1c3d0c(0x15c)](_0xaf9cca,_0x3413ef,{'commentId':_0x1c8959['replyId'],'text':JSON['parse'](_0x1c8959[_0x1c3d0c(0x190)])});break;}case v[_0x1c3d0c(0x13c)]:{const _0x5549a1=(_0x4a91a2=this[_0x1c3d0c(0x194)][_0x1c3d0c(0x174)](_0x1c8959['unitId'])[_0x1c3d0c(0x151)](_0x93216c=>_0x93216c[_0x1c3d0c(0x138)]===_0x1c8959[_0x1c3d0c(0x138)]))==null?void 0x0:_0x4a91a2[_0x1c3d0c(0x186)];_0x5549a1&&this[_0x1c3d0c(0x194)][_0x1c3d0c(0x140)](_0xaf9cca,_0x3413ef,_0x5549a1['id'],_0x1c8959['solved']===I[_0x1c3d0c(0x188)]);break;}}}));}};_=V([p(0x0,_0x4b8dfe(_0x23ec2c)),p(0x1,_0x4b8dfe(_0x2dcc4e)),p(0x2,_0x4b8dfe(_0x49c7ce)),p(0x3,_0x4b8dfe(_0x1eebbd))],_);const z=_0x71f2d7(0x135),O={};var k=Object[_0x71f2d7(0x177)],Q=(_0x3d60bc,_0x493938,_0x136973,_0x1d93f6)=>{const _0x3369e1=_0x71f2d7;for(var _0x517063=_0x1d93f6>0x1?void 0x0:_0x1d93f6?k(_0x493938,_0x136973):_0x493938,_0x188461=_0x3d60bc[_0x3369e1(0x162)]-0x1,_0x40d2e8;_0x188461>=0x0;_0x188461--)(_0x40d2e8=_0x3d60bc[_0x188461])&&(_0x517063=_0x40d2e8(_0x517063)||_0x517063);return _0x517063;},b=(_0x35691c,_0x67caae)=>(_0x2ee21b,_0x17d4a1)=>_0x67caae(_0x2ee21b,_0x17d4a1,_0x35691c);function X(_0x59ab06,_0x4cc334){const _0x4457af=_0x71f2d7,_0x5e5dc6=_0x59ab06[_0x4457af(0x160)][0x0];return{..._0x4cc334,'id':_0x5e5dc6[_0x4457af(0x13b)],'resolved':_0x59ab06[_0x4457af(0x17c)]===0x1,'dT':y(_0x5e5dc6[_0x4457af(0x143)]),'personId':_0x5e5dc6['userId'],'threadId':_0x5e5dc6[_0x4457af(0x138)]};}function ee(_0x2267d7,_0x4f4b41,_0x39b43d){const _0x3b5123=_0x71f2d7;var _0x30f74c,_0x206827;if(((_0x206827=(_0x30f74c=_0x2267d7==null?void 0x0:_0x2267d7[_0x3b5123(0x160)])==null?void 0x0:_0x30f74c[_0x3b5123(0x162)])!=null?_0x206827:0x0)>0x0){const _0x13066a=(_0x15f570,_0x301025)=>({'id':_0x15f570[_0x3b5123(0x13b)],'threadId':_0x15f570['threadId'],'dT':y(_0x15f570[_0x3b5123(0x143)]),'personId':_0x15f570[_0x3b5123(0x170)],'resolved':_0x2267d7[_0x3b5123(0x17c)]===I['Solved'],'unitId':_0x4f4b41,'subUnitId':_0x39b43d,'text':JSON[_0x3b5123(0x182)](_0x15f570['content']),'parentId':_0x301025}),_0x15e419=_0x13066a(_0x2267d7[_0x3b5123(0x160)][0x0]);return{..._0x15e419,'children':_0x2267d7[_0x3b5123(0x160)][_0x3b5123(0x165)](0x1)[_0x3b5123(0x187)](_0x35e611=>_0x13066a(_0x35e611,_0x15e419['id']))};}return null;}let S=class{constructor(_0x25f792,_0x849e6d,_0x39f288){const _0x8e49be=_0x71f2d7;this[_0x8e49be(0x193)]=_0x25f792,this[_0x8e49be(0x157)]=_0x849e6d,this[_0x8e49be(0x15d)]=_0x39f288;}async[_0x71f2d7(0x154)](_0x242c98){const _0xa5f463=_0x71f2d7;var _0x38accf,_0x353f16;const {parentId:_0x2a7630,unitId:_0x497fec,text:_0xf6a2ce,threadId:_0x195cc2}=_0x242c98,_0x295059=(_0x353f16=(_0x38accf=_0xf6a2ce[_0xa5f463(0x155)])==null?void 0x0:_0x38accf['filter'](_0xcf57df=>_0xcf57df['rangeType']===_0x33e38f[_0xa5f463(0x153)])[_0xa5f463(0x187)](_0x5a3db7=>_0x5a3db7[_0xa5f463(0x142)]))!=null?_0x353f16:[],_0x426211=JSON['stringify'](_0xf6a2ce),_0x29028c=(await this[_0xa5f463(0x15d)][_0xa5f463(0x161)](_0x497fec))[_0xa5f463(0x181)]();if(_0x2a7630){const _0x1e955a={'memberId':_0x29028c,'unitId':_0x497fec,'content':_0x426211,'mention':_0x295059,'threadId':_0x195cc2},_0x1cbd27=(await this['_httpService'][_0xa5f463(0x197)]('/universer-api/comment/unit/'+_0x497fec+_0xa5f463(0x137),{'body':_0x1e955a}))[_0xa5f463(0x14c)]['reply'];return{..._0x242c98,'id':_0x1cbd27[_0xa5f463(0x13b)],'dT':_0x56b0b9(+_0x1cbd27[_0xa5f463(0x143)])[_0xa5f463(0x149)](_0xa5f463(0x146)),'personId':_0x1cbd27['userId']};}else{const _0x416382={'memberId':_0x29028c,'unitId':_0x497fec,'content':_0x426211,'mention':_0x295059},_0x64dbf6=await this['_httpService'][_0xa5f463(0x197)](_0xa5f463(0x18f)+_0x497fec+'/add',{'body':_0x416382});return X(_0x64dbf6[_0xa5f463(0x14c)][_0xa5f463(0x168)],_0x242c98);}}async[_0x71f2d7(0x15c)](_0x5b8b9a){const _0x405343=_0x71f2d7;var _0x34842a,_0x430f73;const {text:_0x9d1f6d,unitId:_0x2cf297}=_0x5b8b9a,_0x4e7979=(_0x430f73=(_0x34842a=_0x9d1f6d[_0x405343(0x155)])==null?void 0x0:_0x34842a[_0x405343(0x15b)](_0x3ad844=>_0x3ad844[_0x405343(0x175)]===_0x33e38f[_0x405343(0x153)])['map'](_0xce2b6b=>_0xce2b6b[_0x405343(0x142)]))!=null?_0x430f73:[],_0x1b0ac6=JSON[_0x405343(0x13d)](_0x9d1f6d),_0x5616c4=_0x5b8b9a[_0x405343(0x138)],_0x35d6b2=_0x5b8b9a['id'],_0x52df02={'memberId':(await this[_0x405343(0x15d)]['requireSession'](_0x2cf297))[_0x405343(0x181)](),'unitId':_0x2cf297,'threadId':_0x5616c4,'mention':_0x4e7979,'content':_0x1b0ac6,'replyId':_0x35d6b2},_0x4baeac=await this['_httpService']['post']('/universer-api/comment/unit/'+_0x2cf297+'/edit',{'body':_0x52df02});return!_0x4baeac[_0x405343(0x14c)][_0x405343(0x147)]||_0x4baeac[_0x405343(0x14c)][_0x405343(0x147)]['code']===0x1;}async['resolveComment'](_0x33443c){const _0x1bf878=_0x71f2d7,{unitId:_0x1eafff}=_0x33443c,_0x28978b=_0x33443c[_0x1bf878(0x138)],_0x24b380={'memberId':this[_0x1bf878(0x157)][_0x1bf878(0x180)]()[_0x1bf878(0x15e)],'unitId':_0x1eafff,'threadId':_0x28978b,'solved':_0x33443c[_0x1bf878(0x17d)]?I[_0x1bf878(0x188)]:I[_0x1bf878(0x185)]},_0x55081b=await this[_0x1bf878(0x193)][_0x1bf878(0x197)](_0x1bf878(0x18f)+_0x1eafff+_0x1bf878(0x17a),{'body':_0x24b380});return!_0x55081b[_0x1bf878(0x14c)][_0x1bf878(0x147)]||_0x55081b['body'][_0x1bf878(0x147)][_0x1bf878(0x139)]===0x1;}async[_0x71f2d7(0x18c)](_0x4737d2,_0x1f6e83,_0x10f08c,_0x492560){const _0x54d510=_0x71f2d7,_0x1ccf04={'memberId':(await this[_0x54d510(0x15d)][_0x54d510(0x161)](_0x4737d2))[_0x54d510(0x181)](),'threadId':_0x10f08c,'replyId':_0x492560,'unitId':_0x4737d2},_0x2829ca=await this['_httpService'][_0x54d510(0x197)](_0x54d510(0x18f)+_0x4737d2+_0x54d510(0x148),{'body':_0x1ccf04});return!_0x2829ca[_0x54d510(0x14c)]['error']||_0x2829ca[_0x54d510(0x14c)]['error']['code']===0x1;}async[_0x71f2d7(0x16c)](_0x1bf58e,_0x43c086,_0x11e529){const _0x3b4f67=_0x71f2d7,_0x3d576b={'unitId':_0x1bf58e,'threadId':_0x11e529},_0x4f57fa=await this[_0x3b4f67(0x193)][_0x3b4f67(0x197)]('/universer-api/comment/unit/'+_0x1bf58e+_0x3b4f67(0x16a),{'body':_0x3d576b}),_0x12307e=_0x11e529[_0x3b4f67(0x187)](_0x31626e=>ee(_0x4f57fa[_0x3b4f67(0x14c)]['comments'][_0x31626e],_0x1bf58e,_0x43c086))[_0x3b4f67(0x15b)](Boolean);return Object[_0x3b4f67(0x18e)](_0x4f57fa[_0x3b4f67(0x14c)][_0x3b4f67(0x141)])['forEach'](_0x4a9a31=>{const _0x3df9de=_0x3b4f67;this[_0x3df9de(0x157)][_0x3df9de(0x14a)](_0x4a9a31);}),_0x12307e;}['saveCommentToSnapshot'](_0x2422c6){const _0x27c2cc=_0x71f2d7;return{'id':_0x2422c6['id'],'threadId':_0x2422c6[_0x27c2cc(0x138)],'ref':_0x2422c6[_0x27c2cc(0x195)]};}};S=Q([b(0x0,_0x4b8dfe(_0x15440e)),b(0x1,_0x4b8dfe(_0x49c7ce)),b(0x2,_0x4b8dfe(_0x4ead13))],S);var re=Object[_0x71f2d7(0x177)],te=(_0x50bf10,_0x3fdbfc,_0x36687f,_0x289651)=>{const _0x173baa=_0x71f2d7;for(var _0x39cbfb=_0x289651>0x1?void 0x0:_0x289651?re(_0x3fdbfc,_0x36687f):_0x3fdbfc,_0x5a9f7d=_0x50bf10[_0x173baa(0x162)]-0x1,_0x59fe3c;_0x5a9f7d>=0x0;_0x5a9f7d--)(_0x59fe3c=_0x50bf10[_0x5a9f7d])&&(_0x39cbfb=_0x59fe3c(_0x39cbfb)||_0x39cbfb);return _0x39cbfb;},M=(_0x5b7d28,_0x24860d)=>(_0x4551b0,_0x870ee8)=>_0x24860d(_0x4551b0,_0x870ee8,_0x5b7d28);let f=class extends _0x29e1ca{constructor(_0xf65984,_0x4262cc){const _0x412f95=_0x71f2d7;super(),this[_0x412f95(0x169)]=_0xf65984,this[_0x412f95(0x152)]=_0x4262cc,this['_initDataSource']();}[_0x71f2d7(0x13f)](){const _0x4e4d0b=_0x71f2d7;this[_0x4e4d0b(0x169)][_0x4e4d0b(0x16f)]=this['_threadCommentDataSource'],this[_0x4e4d0b(0x169)][_0x4e4d0b(0x184)]=!0x1;}};f=te([M(0x0,_0x3f700d),M(0x1,_0x4b8dfe(S))],f);var se=Object[_0x71f2d7(0x198)],oe=Object[_0x71f2d7(0x177)],ne=(_0x5a2935,_0x1a5f49,_0x2380d7)=>_0x1a5f49 in _0x5a2935?se(_0x5a2935,_0x1a5f49,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2380d7}):_0x5a2935[_0x1a5f49]=_0x2380d7,ie=(_0x42624b,_0x16437a,_0x5817be,_0x2f9234)=>{const _0x257769=_0x71f2d7;for(var _0x20b0cc=_0x2f9234>0x1?void 0x0:_0x2f9234?oe(_0x16437a,_0x5817be):_0x16437a,_0x465cc7=_0x42624b[_0x257769(0x162)]-0x1,_0x51cc57;_0x465cc7>=0x0;_0x465cc7--)(_0x51cc57=_0x42624b[_0x465cc7])&&(_0x20b0cc=_0x51cc57(_0x20b0cc)||_0x20b0cc);return _0x20b0cc;},N=(_0x5ebd8c,_0xf91dba)=>(_0x45e77c,_0x410d4e)=>_0xf91dba(_0x45e77c,_0x410d4e,_0x5ebd8c),$=(_0x3476e5,_0x1d61ca,_0x2345bc)=>ne(_0x3476e5,typeof _0x1d61ca!=_0x71f2d7(0x145)?_0x1d61ca+'':_0x1d61ca,_0x2345bc);let g=class extends _0x39767c{constructor(_0x30c6c8=O,_0x1b0758,_0x4b4e72){const _0x1510e7=_0x71f2d7;super(),this[_0x1510e7(0x150)]=_0x30c6c8,this[_0x1510e7(0x144)]=_0x1b0758,this[_0x1510e7(0x136)]=_0x4b4e72;const {..._0x185bf6}=_0xf97ff9({},O,this[_0x1510e7(0x150)]);this['_configService'][_0x1510e7(0x189)](z,_0x185bf6);}['onStarting'](){const _0x9bf7fb=_0x71f2d7;[[S],[f],[_]][_0x9bf7fb(0x196)](_0x31e914=>{const _0x587ac2=_0x9bf7fb;this[_0x587ac2(0x144)][_0x587ac2(0x18a)](_0x31e914);});}[_0x71f2d7(0x176)](){const _0x2c4b82=_0x71f2d7;this[_0x2c4b82(0x144)][_0x2c4b82(0x179)](f),this[_0x2c4b82(0x144)][_0x2c4b82(0x179)](_);}};$(g,'pluginName',W),$(g,'type',_0x48d0a5[_0x71f2d7(0x158)]),g=ie([_0x296157(_0x228392,_0x33917a,_0x44e499),N(0x1,_0x4b8dfe(_0x1eebbd)),N(0x2,_0x128401)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x18b0(_0x1ec00d,_0x3b5982){_0x1ec00d=_0x1ec00d-0x185;const _0x3622e8=_0x3622();let _0x18b049=_0x3622e8[_0x1ec00d];return _0x18b049;}function _0x3622(){const _0x3c3b84=['29613fEgKHx','onStarting','personId','threadId','Unknown','Disposable','getOwnPropertyDescriptor','disposeWithMe','@univerjs/thread-comment','UserManagerService','getUnit','UniverProCollaborationClient','DependentOn','parse','rangeType','commentUpdate$','forEach','amd','_sessionService','UniverLicensePlugin','addUser','type','UniverNetwork','12PGfQKe','customRanges','UniverThreadCommentUIPlugin','rxjs','Inject','userId','831572DWBWNC','thread-comment-data-source.config','ThreadCommentModel','/delete','defineProperty','CollaborationSessionService','Add','Delete','createTimestamp','@univerjs/core','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_threadCommentModel','replyId','@univerjs/network','filter','rangeId','comment','pipe','setConfig','_config','Injector','deleteComment','dayjs','_initDataSource','getCurrentUser','code','replies','payload','UniverCore','requireSession','/universer-api/user/list','solved','UniverThreadCommentDataSourcePlugin','get','updateComment','listComments','map','dataSource','delete','UniverProLicense','parentId','onReady','OpenOrReOpen','_userService','_httpService','UniverCollaborationClientPlugin','length','500255bBQFkB','UniverProThreadCommentDatasource','4185990qpDAAJ','userID','UniverThreadComment','addComment','Solve','content','YYYY/MM/DD\x20HH:mm','exports','HTTPService','120960WyKeVI','resolved','/solved','resolveComment','Module','/edit','CustomRangeType','/list','399468ArMHUu','comments','Plugin','_initUserSync','UNIVER_UNKNOWN','6QHUDgb','_threadCommentDataSourceService','UniverThreadCommentUi','/universer-api/comment/unit/','size','object','IThreadCommentDataSourceService','_injector','subscribe','getMemberID','users','user','toStringTag','Edit','ref','CommentService','stringify','getUser','_threadCommentDataSource','bufferTime','find','post','slice','saveCommentToSnapshot','add','9hnwlhD','/add','@univerjs/thread-comment-ui','_init','body','error','UNRECOGNIZED','Solved','@univerjs-pro/collaboration-client','Reply','merge','230315FCnqoe','symbol','root','UniverInstanceType','format'];_0x3622=function(){return _0x3c3b84;};return _0x3622();}(function(_0x5f5b8f,_0x15cb68){const _0x4e7a7f=_0x18b0,_0x31e5db=_0x5f5b8f();while(!![]){try{const _0x38bb55=-parseInt(_0x4e7a7f(0x1fb))/0x1+parseInt(_0x4e7a7f(0x1d2))/0x2+-parseInt(_0x4e7a7f(0x200))/0x3*(parseInt(_0x4e7a7f(0x18a))/0x4)+parseInt(_0x4e7a7f(0x1bf))/0x5*(-parseInt(_0x4e7a7f(0x1d7))/0x6)+-parseInt(_0x4e7a7f(0x190))/0x7+-parseInt(_0x4e7a7f(0x1ca))/0x8+-parseInt(_0x4e7a7f(0x1f0))/0x9*(-parseInt(_0x4e7a7f(0x1c1))/0xa);if(_0x38bb55===_0x15cb68)break;else _0x31e5db['push'](_0x31e5db['shift']());}catch(_0x2dce46){_0x31e5db['push'](_0x31e5db['shift']());}}}(_0x3622,0x1e616),function(_0x4a2aa7,_0x2aa239){const _0x1c4f84=_0x18b0;typeof exports==_0x1c4f84(0x1dc)&&typeof module<'u'?_0x2aa239(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define=='function'&&define[_0x1c4f84(0x211)]?define([_0x1c4f84(0x1c8),_0x1c4f84(0x1f8),'@univerjs-pro/license',_0x1c4f84(0x199),_0x1c4f84(0x1f2),_0x1c4f84(0x208),_0x1c4f84(0x18d),_0x1c4f84(0x19d)],_0x2aa239):(_0x4a2aa7=typeof globalThis<'u'?globalThis:_0x4a2aa7||self,_0x2aa239(_0x4a2aa7[_0x1c4f84(0x1c0)]={},_0x4a2aa7[_0x1c4f84(0x20b)],_0x4a2aa7[_0x1c4f84(0x1b7)],_0x4a2aa7[_0x1c4f84(0x1ac)],_0x4a2aa7[_0x1c4f84(0x1d9)],_0x4a2aa7[_0x1c4f84(0x1c3)],_0x4a2aa7[_0x1c4f84(0x18d)],_0x4a2aa7[_0x1c4f84(0x189)]));}(this,function(_0xb2817b,_0xaf304a,_0x4c4188,_0x5782bb,_0x40ae93,_0x4a4df5,_0x411842,_0xb23ab1){'use strict';const _0x4017a5=_0x18b0;const _0x26fd59=_0x4017a5(0x19a);var _0x35d217=(_0x574a77=>(_0x574a77[_0x574a77[_0x4017a5(0x1ba)]=0x0]=_0x4017a5(0x1ba),_0x574a77[_0x574a77[_0x4017a5(0x1f7)]=0x1]='Solved',_0x574a77[_0x574a77[_0x4017a5(0x1f6)]=-0x1]=_0x4017a5(0x1f6),_0x574a77))(_0x35d217||{}),_0x4e7287=(_0x2e1ec9=>(_0x2e1ec9[_0x2e1ec9[_0x4017a5(0x204)]=0x0]=_0x4017a5(0x204),_0x2e1ec9[_0x2e1ec9[_0x4017a5(0x196)]=0x1]='Add',_0x2e1ec9[_0x2e1ec9[_0x4017a5(0x1f9)]=0x2]=_0x4017a5(0x1f9),_0x2e1ec9[_0x2e1ec9[_0x4017a5(0x1e4)]=0x3]='Edit',_0x2e1ec9[_0x2e1ec9[_0x4017a5(0x197)]=0x4]='Delete',_0x2e1ec9[_0x2e1ec9['Solve']=0x5]=_0x4017a5(0x1c5),_0x2e1ec9[_0x2e1ec9['UNRECOGNIZED']=-0x1]=_0x4017a5(0x1f6),_0x2e1ec9))(_0x4e7287||{});const _0xb252d2=_0x384d21=>_0x5782bb[_0x4017a5(0x1a6)](new Date(+_0x384d21))['format']('YYYY/MM/DD\x20HH:mm'),_0x427da7=async(_0x24a72f,_0x3ef125)=>{const _0x321261=_0x4017a5,_0x5decae=_0x24a72f[_0x321261(0x1b1)](_0x5782bb['UserManagerService']),_0x2e20bf=_0x24a72f[_0x321261(0x1b1)](_0xb23ab1['HTTPService']);_0x3ef125[_0x321261(0x210)](_0x1764af=>{const _0x4aa549=_0x321261;_0x5decae[_0x4aa549(0x1e8)](_0x1764af)&&_0x3ef125[_0x4aa549(0x1b6)](_0x1764af);}),_0x3ef125[_0x321261(0x1db)]&&(await _0x2e20bf[_0x321261(0x1b1)](_0x321261(0x1ae),{'params':{'userIDs':[..._0x3ef125]}}))[_0x321261(0x1f4)][_0x321261(0x1e1)][_0x321261(0x210)](_0x501385=>{const _0x24df85=_0x321261;_0x501385&&_0x5decae[_0x24df85(0x187)](_0x501385);});};var _0x565ea6=Object[_0x4017a5(0x206)],_0x933df3=(_0x357fe0,_0x25d264,_0x49ad4d,_0x50805e)=>{for(var _0x1a6d51=_0x50805e>0x1?void 0x0:_0x50805e?_0x565ea6(_0x25d264,_0x49ad4d):_0x25d264,_0x1dd498=_0x357fe0['length']-0x1,_0x213334;_0x1dd498>=0x0;_0x1dd498--)(_0x213334=_0x357fe0[_0x1dd498])&&(_0x1a6d51=_0x213334(_0x1a6d51)||_0x1a6d51);return _0x1a6d51;},_0x22e093=(_0x124f19,_0x51fe04)=>(_0x239aa2,_0x23a631)=>_0x51fe04(_0x239aa2,_0x23a631,_0x124f19);let _0x3b27b7=class extends _0x5782bb[_0x4017a5(0x205)]{constructor(_0x5d0d1b,_0x3f5a62,_0x189eaa,_0x28a113){const _0x365845=_0x4017a5;super(),this['_commentService']=_0x5d0d1b,this[_0x365845(0x19b)]=_0x3f5a62,this[_0x365845(0x1bb)]=_0x189eaa,this['_injector']=_0x28a113,this[_0x365845(0x1f3)](),this[_0x365845(0x1d5)]();}['_initUserSync'](){const _0x300c65=_0x4017a5;this[_0x300c65(0x207)](this[_0x300c65(0x19b)][_0x300c65(0x20f)][_0x300c65(0x1a1)](_0x411842[_0x300c65(0x1ea)](0x10))[_0x300c65(0x1df)](_0x501d51=>{const _0xf9c3b1=_0x300c65,_0x4b12f8=new Set();_0x501d51[_0xf9c3b1(0x210)](_0xc2adb9=>{const _0x7f60de=_0xf9c3b1;switch(_0xc2adb9[_0x7f60de(0x188)]){case _0x7f60de(0x1ef):{const _0x30421e=_0xc2adb9[_0x7f60de(0x1ab)][_0x7f60de(0x202)];_0x4b12f8[_0x7f60de(0x1ef)](_0x30421e);break;}}}),_0x427da7(this[_0xf9c3b1(0x1de)],_0x4b12f8);}));}[_0x4017a5(0x1f3)](){const _0x596bc6=_0x4017a5;this[_0x596bc6(0x207)](this['_commentService'][_0x596bc6(0x20f)][_0x596bc6(0x1df)](async _0xb44414=>{const _0x145c60=_0x596bc6;var _0x27754e,_0x1d2158,_0x2a51d4,_0x24df04;const _0x458a97=(_0x27754e=this['_threadCommentModel'][_0x145c60(0x20a)](_0xb44414['unitId'])[_0x145c60(0x1eb)](_0x18de5b=>_0x18de5b[_0x145c60(0x203)]===_0xb44414[_0x145c60(0x203)]))==null?void 0x0:_0x27754e[_0x145c60(0x1fd)];if(!_0x458a97)return;const {unitId:_0x50fb31,subUnitId:_0xc5c080}=_0x458a97;switch(_0xb44414[_0x145c60(0x1e2)]&&this['_userService'][_0x145c60(0x187)](_0xb44414[_0x145c60(0x1e2)]),_0xb44414[_0x145c60(0x188)]){case _0x4e7287['Add']:break;case _0x4e7287['Reply']:{this[_0x145c60(0x19b)][_0x145c60(0x1c4)](_0x50fb31,_0xc5c080,{'unitId':_0x50fb31,'subUnitId':_0xc5c080,'ref':'','id':_0xb44414[_0x145c60(0x19c)],'dT':_0xb252d2(+_0xb44414[_0x145c60(0x198)]),'threadId':_0xb44414[_0x145c60(0x203)],'personId':(_0x2a51d4=(_0x1d2158=_0xb44414[_0x145c60(0x1e2)])==null?void 0x0:_0x1d2158[_0x145c60(0x1c2)])!=null?_0x2a51d4:_0xb44414[_0x145c60(0x18f)],'text':JSON['parse'](_0xb44414['content']),'parentId':_0x458a97['id']});break;}case _0x4e7287[_0x145c60(0x197)]:{const _0x42cf49=this['_threadCommentModel']['getComment'](_0x50fb31,_0xc5c080,_0xb44414[_0x145c60(0x19c)]);_0x42cf49&&_0x42cf49[_0x145c60(0x1b8)]&&this[_0x145c60(0x19b)][_0x145c60(0x1a5)](_0x50fb31,_0xc5c080,_0xb44414[_0x145c60(0x19c)]);break;}case _0x4e7287[_0x145c60(0x1e4)]:{this['_threadCommentModel'][_0x145c60(0x1b2)](_0x50fb31,_0xc5c080,{'commentId':_0xb44414[_0x145c60(0x19c)],'text':JSON['parse'](_0xb44414[_0x145c60(0x1c6)])});break;}case _0x4e7287[_0x145c60(0x1c5)]:{const _0x4bde90=(_0x24df04=this[_0x145c60(0x19b)][_0x145c60(0x20a)](_0xb44414['unitId'])[_0x145c60(0x1eb)](_0x3db378=>_0x3db378[_0x145c60(0x203)]===_0xb44414[_0x145c60(0x203)]))==null?void 0x0:_0x24df04[_0x145c60(0x1fd)];_0x4bde90&&this[_0x145c60(0x19b)][_0x145c60(0x1cd)](_0x50fb31,_0xc5c080,_0x4bde90['id'],_0xb44414[_0x145c60(0x1af)]===_0x35d217[_0x145c60(0x1f7)]);break;}}}));}};_0x3b27b7=_0x933df3([_0x22e093(0x0,_0x5782bb['Inject'](_0xaf304a[_0x4017a5(0x1e6)])),_0x22e093(0x1,_0x5782bb[_0x4017a5(0x18e)](_0x4a4df5[_0x4017a5(0x192)])),_0x22e093(0x2,_0x5782bb['Inject'](_0x5782bb['UserManagerService'])),_0x22e093(0x3,_0x5782bb[_0x4017a5(0x18e)](_0x5782bb[_0x4017a5(0x1a4)]))],_0x3b27b7);const _0x2102fc=_0x4017a5(0x191),_0x52b3a3={};var _0x44d9ef=Object[_0x4017a5(0x206)],_0x263079=(_0x258dda,_0x49c627,_0x460536,_0x4fcfbc)=>{const _0x4d8c30=_0x4017a5;for(var _0x380414=_0x4fcfbc>0x1?void 0x0:_0x4fcfbc?_0x44d9ef(_0x49c627,_0x460536):_0x49c627,_0xd4eb07=_0x258dda[_0x4d8c30(0x1be)]-0x1,_0x51773b;_0xd4eb07>=0x0;_0xd4eb07--)(_0x51773b=_0x258dda[_0xd4eb07])&&(_0x380414=_0x51773b(_0x380414)||_0x380414);return _0x380414;},_0x522ed8=(_0x1ca3b1,_0xb234d1)=>(_0x1aeef9,_0x292541)=>_0xb234d1(_0x1aeef9,_0x292541,_0x1ca3b1);function _0x329ac0(_0x3060a4,_0x5576f4){const _0x395cc7=_0x4017a5,_0x520a9d=_0x3060a4[_0x395cc7(0x1aa)][0x0];return{..._0x5576f4,'id':_0x520a9d[_0x395cc7(0x19c)],'resolved':_0x3060a4[_0x395cc7(0x1af)]===0x1,'dT':_0xb252d2(_0x520a9d[_0x395cc7(0x198)]),'personId':_0x520a9d[_0x395cc7(0x18f)],'threadId':_0x520a9d['threadId']};}function _0x1108cd(_0x552f9e,_0x445d35,_0x347f85){const _0x543702=_0x4017a5;var _0x490535,_0x4e3e5d;if(((_0x4e3e5d=(_0x490535=_0x552f9e==null?void 0x0:_0x552f9e[_0x543702(0x1aa)])==null?void 0x0:_0x490535['length'])!=null?_0x4e3e5d:0x0)>0x0){const _0x515919=(_0x447227,_0x4af93c)=>({'id':_0x447227[_0x543702(0x19c)],'threadId':_0x447227[_0x543702(0x203)],'dT':_0xb252d2(_0x447227[_0x543702(0x198)]),'personId':_0x447227[_0x543702(0x18f)],'resolved':_0x552f9e[_0x543702(0x1af)]===_0x35d217[_0x543702(0x1f7)],'unitId':_0x445d35,'subUnitId':_0x347f85,'text':JSON[_0x543702(0x20d)](_0x447227['content']),'parentId':_0x4af93c}),_0xb4fa02=_0x515919(_0x552f9e[_0x543702(0x1aa)][0x0]);return{..._0xb4fa02,'children':_0x552f9e[_0x543702(0x1aa)][_0x543702(0x1ed)](0x1)['map'](_0x4c1ab5=>_0x515919(_0x4c1ab5,_0xb4fa02['id']))};}return null;}let _0x46ea66=class{constructor(_0x3ceaea,_0x541ec0,_0x59aff1){const _0x242a19=_0x4017a5;this[_0x242a19(0x1bc)]=_0x3ceaea,this['_userService']=_0x541ec0,this[_0x242a19(0x185)]=_0x59aff1;}async['addComment'](_0x4cb6be){const _0x49803b=_0x4017a5;var _0x1407f0,_0x1f95c1;const {parentId:_0x19065d,unitId:_0x55e396,text:_0x37d09a,threadId:_0x20779f}=_0x4cb6be,_0x4caadd=(_0x1f95c1=(_0x1407f0=_0x37d09a[_0x49803b(0x18b)])==null?void 0x0:_0x1407f0['filter'](_0x188b2d=>_0x188b2d[_0x49803b(0x20e)]===_0x5782bb[_0x49803b(0x1d0)]['COMMENT'])[_0x49803b(0x1b4)](_0x56a740=>_0x56a740[_0x49803b(0x19f)]))!=null?_0x1f95c1:[],_0x39d418=JSON[_0x49803b(0x1e7)](_0x37d09a),_0xed6bbb=(await this[_0x49803b(0x185)][_0x49803b(0x1ad)](_0x55e396))['getMemberID']();if(_0x19065d){const _0x1e192a={'memberId':_0xed6bbb,'unitId':_0x55e396,'content':_0x39d418,'mention':_0x4caadd,'threadId':_0x20779f},_0x262721=(await this[_0x49803b(0x1bc)][_0x49803b(0x1ec)](_0x49803b(0x1da)+_0x55e396+'/reply',{'body':_0x1e192a}))[_0x49803b(0x1f4)]['reply'];return{..._0x4cb6be,'id':_0x262721[_0x49803b(0x19c)],'dT':_0x5782bb[_0x49803b(0x1a6)](+_0x262721['createTimestamp'])[_0x49803b(0x1ff)](_0x49803b(0x1c7)),'personId':_0x262721[_0x49803b(0x18f)]};}else{const _0x3e50be={'memberId':_0xed6bbb,'unitId':_0x55e396,'content':_0x39d418,'mention':_0x4caadd},_0x57d599=await this[_0x49803b(0x1bc)][_0x49803b(0x1ec)](_0x49803b(0x1da)+_0x55e396+_0x49803b(0x1f1),{'body':_0x3e50be});return _0x329ac0(_0x57d599[_0x49803b(0x1f4)][_0x49803b(0x1a0)],_0x4cb6be);}}async['updateComment'](_0x141952){const _0x360348=_0x4017a5;var _0x44883e,_0xaacbd3;const {text:_0x1fb287,unitId:_0x8119b8}=_0x141952,_0x1f5c43=(_0xaacbd3=(_0x44883e=_0x1fb287[_0x360348(0x18b)])==null?void 0x0:_0x44883e[_0x360348(0x19e)](_0x52d976=>_0x52d976['rangeType']===_0x5782bb['CustomRangeType']['COMMENT'])[_0x360348(0x1b4)](_0x3c93c7=>_0x3c93c7['rangeId']))!=null?_0xaacbd3:[],_0x43664d=JSON[_0x360348(0x1e7)](_0x1fb287),_0x3f3e83=_0x141952[_0x360348(0x203)],_0x4e3cd7=_0x141952['id'],_0x5b3b76={'memberId':(await this[_0x360348(0x185)][_0x360348(0x1ad)](_0x8119b8))[_0x360348(0x1e0)](),'unitId':_0x8119b8,'threadId':_0x3f3e83,'mention':_0x1f5c43,'content':_0x43664d,'replyId':_0x4e3cd7},_0x7ceeab=await this[_0x360348(0x1bc)]['post'](_0x360348(0x1da)+_0x8119b8+_0x360348(0x1cf),{'body':_0x5b3b76});return!_0x7ceeab[_0x360348(0x1f4)][_0x360348(0x1f5)]||_0x7ceeab[_0x360348(0x1f4)]['error'][_0x360348(0x1a9)]===0x1;}async['resolveComment'](_0x442e6c){const _0x100c74=_0x4017a5,{unitId:_0x180406}=_0x442e6c,_0x346b0d=_0x442e6c[_0x100c74(0x203)],_0x2e83ed={'memberId':this[_0x100c74(0x1bb)][_0x100c74(0x1a8)]()[_0x100c74(0x1c2)],'unitId':_0x180406,'threadId':_0x346b0d,'solved':_0x442e6c[_0x100c74(0x1cb)]?_0x35d217[_0x100c74(0x1f7)]:_0x35d217['OpenOrReOpen']},_0x3d60a9=await this[_0x100c74(0x1bc)][_0x100c74(0x1ec)](_0x100c74(0x1da)+_0x180406+_0x100c74(0x1cc),{'body':_0x2e83ed});return!_0x3d60a9[_0x100c74(0x1f4)][_0x100c74(0x1f5)]||_0x3d60a9[_0x100c74(0x1f4)][_0x100c74(0x1f5)]['code']===0x1;}async['deleteComment'](_0x16b542,_0x65fd1e,_0x53199f,_0x3091c0){const _0x36ed42=_0x4017a5,_0x1fa18f={'memberId':(await this[_0x36ed42(0x185)][_0x36ed42(0x1ad)](_0x16b542))[_0x36ed42(0x1e0)](),'threadId':_0x53199f,'replyId':_0x3091c0,'unitId':_0x16b542},_0xe55428=await this[_0x36ed42(0x1bc)][_0x36ed42(0x1ec)]('/universer-api/comment/unit/'+_0x16b542+_0x36ed42(0x193),{'body':_0x1fa18f});return!_0xe55428['body'][_0x36ed42(0x1f5)]||_0xe55428[_0x36ed42(0x1f4)][_0x36ed42(0x1f5)]['code']===0x1;}async[_0x4017a5(0x1b3)](_0x48a293,_0xd925c7,_0x251810){const _0x1bb8e0=_0x4017a5,_0x13a262={'unitId':_0x48a293,'threadId':_0x251810},_0x29d719=await this[_0x1bb8e0(0x1bc)][_0x1bb8e0(0x1ec)](_0x1bb8e0(0x1da)+_0x48a293+_0x1bb8e0(0x1d1),{'body':_0x13a262}),_0x53810c=_0x251810[_0x1bb8e0(0x1b4)](_0x3c4114=>_0x1108cd(_0x29d719[_0x1bb8e0(0x1f4)][_0x1bb8e0(0x1d3)][_0x3c4114],_0x48a293,_0xd925c7))['filter'](Boolean);return Object['values'](_0x29d719['body'][_0x1bb8e0(0x1e1)])[_0x1bb8e0(0x210)](_0x540032=>{const _0x1a5468=_0x1bb8e0;this['_userService'][_0x1a5468(0x187)](_0x540032);}),_0x53810c;}[_0x4017a5(0x1ee)](_0x2c2dd7){const _0x5c1f5b=_0x4017a5;return{'id':_0x2c2dd7['id'],'threadId':_0x2c2dd7['threadId'],'ref':_0x2c2dd7[_0x5c1f5b(0x1e5)]};}};_0x46ea66=_0x263079([_0x522ed8(0x0,_0x5782bb[_0x4017a5(0x18e)](_0xb23ab1[_0x4017a5(0x1c9)])),_0x522ed8(0x1,_0x5782bb[_0x4017a5(0x18e)](_0x5782bb[_0x4017a5(0x209)])),_0x522ed8(0x2,_0x5782bb['Inject'](_0xaf304a[_0x4017a5(0x195)]))],_0x46ea66);var _0x31695f=Object[_0x4017a5(0x206)],_0x44bea1=(_0x1ad962,_0x11d1e6,_0x205401,_0x4ba5f0)=>{for(var _0x2dd686=_0x4ba5f0>0x1?void 0x0:_0x4ba5f0?_0x31695f(_0x11d1e6,_0x205401):_0x11d1e6,_0x1887e7=_0x1ad962['length']-0x1,_0x3cdf11;_0x1887e7>=0x0;_0x1887e7--)(_0x3cdf11=_0x1ad962[_0x1887e7])&&(_0x2dd686=_0x3cdf11(_0x2dd686)||_0x2dd686);return _0x2dd686;},_0x3f9d81=(_0x12cc11,_0x3dc467)=>(_0x56d6cc,_0x392a37)=>_0x3dc467(_0x56d6cc,_0x392a37,_0x12cc11);let _0x242293=class extends _0x5782bb[_0x4017a5(0x205)]{constructor(_0x31a7eb,_0x25a3bf){const _0x51c6ae=_0x4017a5;super(),this[_0x51c6ae(0x1d8)]=_0x31a7eb,this[_0x51c6ae(0x1e9)]=_0x25a3bf,this[_0x51c6ae(0x1a7)]();}[_0x4017a5(0x1a7)](){const _0xf4dd0f=_0x4017a5;this[_0xf4dd0f(0x1d8)][_0xf4dd0f(0x1b5)]=this[_0xf4dd0f(0x1e9)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};_0x242293=_0x44bea1([_0x3f9d81(0x0,_0x4a4df5[_0x4017a5(0x1dd)]),_0x3f9d81(0x1,_0x5782bb[_0x4017a5(0x18e)](_0x46ea66))],_0x242293);var _0x301ded=Object[_0x4017a5(0x194)],_0x18118a=Object[_0x4017a5(0x206)],_0x3efadd=(_0x238042,_0x237492,_0x29a87b)=>_0x237492 in _0x238042?_0x301ded(_0x238042,_0x237492,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x29a87b}):_0x238042[_0x237492]=_0x29a87b,_0x95330e=(_0xfa2a46,_0x4d9aae,_0x1e59b2,_0x14ddeb)=>{const _0x34bdd5=_0x4017a5;for(var _0x238b15=_0x14ddeb>0x1?void 0x0:_0x14ddeb?_0x18118a(_0x4d9aae,_0x1e59b2):_0x4d9aae,_0x586886=_0xfa2a46[_0x34bdd5(0x1be)]-0x1,_0x238d10;_0x586886>=0x0;_0x586886--)(_0x238d10=_0xfa2a46[_0x586886])&&(_0x238b15=_0x238d10(_0x238b15)||_0x238b15);return _0x238b15;},_0x149a4d=(_0x4f9cac,_0x1e5b41)=>(_0x416a17,_0x14dbde)=>_0x1e5b41(_0x416a17,_0x14dbde,_0x4f9cac),_0x5605c7=(_0x5f5d84,_0x88fe98,_0x413525)=>_0x3efadd(_0x5f5d84,typeof _0x88fe98!=_0x4017a5(0x1fc)?_0x88fe98+'':_0x88fe98,_0x413525);_0xb2817b['UniverThreadCommentDataSourcePlugin']=class extends _0x5782bb[_0x4017a5(0x1d4)]{constructor(_0x1e6ddb=_0x52b3a3,_0x25bde3,_0x413e82){const _0x7d4b46=_0x4017a5;super(),this[_0x7d4b46(0x1a3)]=_0x1e6ddb,this['_injector']=_0x25bde3,this['_configService']=_0x413e82;const {..._0xf267a6}=_0x5782bb[_0x7d4b46(0x1fa)]({},_0x52b3a3,this[_0x7d4b46(0x1a3)]);this['_configService'][_0x7d4b46(0x1a2)](_0x2102fc,_0xf267a6);}[_0x4017a5(0x201)](){const _0x244b34=_0x4017a5;[[_0x46ea66],[_0x242293],[_0x3b27b7]][_0x244b34(0x210)](_0x27394d=>{const _0x5d384b=_0x244b34;this[_0x5d384b(0x1de)][_0x5d384b(0x1ef)](_0x27394d);});}[_0x4017a5(0x1b9)](){const _0x2ea985=_0x4017a5;this[_0x2ea985(0x1de)]['get'](_0x242293),this[_0x2ea985(0x1de)][_0x2ea985(0x1b1)](_0x3b27b7);}},_0x5605c7(_0xb2817b[_0x4017a5(0x1b0)],'pluginName',_0x26fd59),_0x5605c7(_0xb2817b[_0x4017a5(0x1b0)],_0x4017a5(0x188),_0x5782bb[_0x4017a5(0x1fe)][_0x4017a5(0x1d6)]),_0xb2817b[_0x4017a5(0x1b0)]=_0x95330e([_0x5782bb[_0x4017a5(0x20c)](_0x40ae93[_0x4017a5(0x18c)],_0xaf304a[_0x4017a5(0x1bd)],_0x4c4188[_0x4017a5(0x186)]),_0x149a4d(0x1,_0x5782bb['Inject'](_0x5782bb[_0x4017a5(0x1a4)])),_0x149a4d(0x2,_0x5782bb['IConfigService'])],_0xb2817b[_0x4017a5(0x1b0)]),Object['defineProperty'](_0xb2817b,Symbol[_0x4017a5(0x1e3)],{'value':_0x4017a5(0x1ce)});}));
|
|
1
|
+
(function(_0xeb5dd5,_0x2c5eab){const _0x27a719=_0x252d,_0x2514db=_0xeb5dd5();while(!![]){try{const _0x38ef6b=-parseInt(_0x27a719(0x1a8))/0x1*(-parseInt(_0x27a719(0x1ab))/0x2)+parseInt(_0x27a719(0x1db))/0x3+-parseInt(_0x27a719(0x1b6))/0x4+-parseInt(_0x27a719(0x1ed))/0x5+-parseInt(_0x27a719(0x205))/0x6+-parseInt(_0x27a719(0x20e))/0x7*(parseInt(_0x27a719(0x1ff))/0x8)+parseInt(_0x27a719(0x1f5))/0x9;if(_0x38ef6b===_0x2c5eab)break;else _0x2514db['push'](_0x2514db['shift']());}catch(_0x31750b){_0x2514db['push'](_0x2514db['shift']());}}}(_0x35a6,0x4a661),function(_0x14c6ca,_0xa3ad81){const _0x1e1d63=_0x252d;typeof exports==_0x1e1d63(0x1c4)&&typeof module<'u'?_0xa3ad81(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define=='function'&&define[_0x1e1d63(0x1fb)]?define([_0x1e1d63(0x191),_0x1e1d63(0x1f1),'@univerjs-pro/license','@univerjs/core','@univerjs/thread-comment-ui',_0x1e1d63(0x195),_0x1e1d63(0x197),_0x1e1d63(0x1e2)],_0xa3ad81):(_0x14c6ca=typeof globalThis<'u'?globalThis:_0x14c6ca||self,_0xa3ad81(_0x14c6ca[_0x1e1d63(0x198)]={},_0x14c6ca[_0x1e1d63(0x1d8)],_0x14c6ca['UniverProLicense'],_0x14c6ca[_0x1e1d63(0x1b0)],_0x14c6ca[_0x1e1d63(0x19e)],_0x14c6ca['UniverThreadComment'],_0x14c6ca[_0x1e1d63(0x197)],_0x14c6ca[_0x1e1d63(0x1bd)]));}(this,function(_0x4afe61,_0x3f0ee1,_0x3ada5f,_0x92db82,_0x164632,_0x3dde62,_0x3e3a06,_0x206d9f){'use strict';const _0x8e74c2=_0x252d;const _0x2b801f=_0x8e74c2(0x1dc);var _0x551ddc=(_0xf2bb46=>(_0xf2bb46[_0xf2bb46[_0x8e74c2(0x19b)]=0x0]=_0x8e74c2(0x19b),_0xf2bb46[_0xf2bb46[_0x8e74c2(0x1bf)]=0x1]='Solved',_0xf2bb46[_0xf2bb46[_0x8e74c2(0x1cb)]=-0x1]=_0x8e74c2(0x1cb),_0xf2bb46))(_0x551ddc||{}),_0x5d0ba5=(_0x4eeeed=>(_0x4eeeed[_0x4eeeed[_0x8e74c2(0x1f6)]=0x0]='Unknown',_0x4eeeed[_0x4eeeed[_0x8e74c2(0x1a3)]=0x1]=_0x8e74c2(0x1a3),_0x4eeeed[_0x4eeeed['Reply']=0x2]=_0x8e74c2(0x19a),_0x4eeeed[_0x4eeeed['Edit']=0x3]=_0x8e74c2(0x1be),_0x4eeeed[_0x4eeeed['Delete']=0x4]=_0x8e74c2(0x1f7),_0x4eeeed[_0x4eeeed['Solve']=0x5]=_0x8e74c2(0x1a0),_0x4eeeed[_0x4eeeed[_0x8e74c2(0x1cb)]=-0x1]=_0x8e74c2(0x1cb),_0x4eeeed))(_0x5d0ba5||{});const _0x4747c0=_0x487d92=>_0x92db82[_0x8e74c2(0x1ba)](new Date(+_0x487d92))['format']('YYYY/MM/DD\x20HH:mm'),_0x56921a=async(_0x19562d,_0x1f9fe2)=>{const _0x56a905=_0x8e74c2,_0x1e97b7=_0x19562d[_0x56a905(0x1dd)](_0x92db82[_0x56a905(0x1d0)]),_0x1f1574=_0x19562d[_0x56a905(0x1dd)](_0x206d9f[_0x56a905(0x18c)]);_0x1f9fe2[_0x56a905(0x1d9)](_0x454c6c=>{const _0x1d7375=_0x56a905;_0x1e97b7[_0x1d7375(0x196)](_0x454c6c)&&_0x1f9fe2[_0x1d7375(0x1c0)](_0x454c6c);}),_0x1f9fe2[_0x56a905(0x1c8)]&&(await _0x1f1574[_0x56a905(0x1dd)](_0x56a905(0x1af),{'params':{'userIDs':[..._0x1f9fe2]}}))[_0x56a905(0x1e1)]['users'][_0x56a905(0x1d9)](_0x9f0395=>{const _0x2b92ef=_0x56a905;_0x9f0395&&_0x1e97b7[_0x2b92ef(0x1e4)](_0x9f0395);});};var _0x58b32f=Object[_0x8e74c2(0x18f)],_0x5bef24=(_0x1c7541,_0x2b97da,_0x5953a1,_0x469327)=>{const _0x8e6fb7=_0x8e74c2;for(var _0x35a58f=_0x469327>0x1?void 0x0:_0x469327?_0x58b32f(_0x2b97da,_0x5953a1):_0x2b97da,_0xb16469=_0x1c7541[_0x8e6fb7(0x193)]-0x1,_0x259695;_0xb16469>=0x0;_0xb16469--)(_0x259695=_0x1c7541[_0xb16469])&&(_0x35a58f=_0x259695(_0x35a58f)||_0x35a58f);return _0x35a58f;},_0x5f53ff=(_0x43018d,_0x11e81f)=>(_0x2878d7,_0x4d1288)=>_0x11e81f(_0x2878d7,_0x4d1288,_0x43018d);let _0x2b59de=class extends _0x92db82['Disposable']{constructor(_0x1cdffe,_0x5bbef7,_0x513eaa,_0x5db3ed){const _0x1a6316=_0x8e74c2;super(),this['_commentService']=_0x1cdffe,this[_0x1a6316(0x1e8)]=_0x5bbef7,this[_0x1a6316(0x201)]=_0x513eaa,this[_0x1a6316(0x20b)]=_0x5db3ed,this[_0x1a6316(0x1b8)](),this['_initUserSync']();}['_initUserSync'](){const _0x3dacb0=_0x8e74c2;this[_0x3dacb0(0x1ad)](this['_threadCommentModel'][_0x3dacb0(0x1f9)][_0x3dacb0(0x19f)](_0x3e3a06[_0x3dacb0(0x1c3)](0x10))[_0x3dacb0(0x1ca)](_0x3e2b25=>{const _0x1dac19=_0x3dacb0,_0x546cfa=new Set();_0x3e2b25[_0x1dac19(0x1d9)](_0x700b68=>{const _0x310119=_0x1dac19;switch(_0x700b68['type']){case'add':{const _0x1a4bd7=_0x700b68['payload'][_0x310119(0x1ee)];_0x546cfa[_0x310119(0x1cd)](_0x1a4bd7);break;}}}),_0x56921a(this['_injector'],_0x546cfa);}));}[_0x8e74c2(0x1b8)](){const _0x437c7c=_0x8e74c2;this['disposeWithMe'](this[_0x437c7c(0x1f0)][_0x437c7c(0x1f9)][_0x437c7c(0x1ca)](async _0x220669=>{const _0x2121fa=_0x437c7c;var _0x346fff,_0x470513,_0x16ee0d,_0x3a312a;const _0x567a48=(_0x346fff=this[_0x2121fa(0x1e8)][_0x2121fa(0x209)](_0x220669['unitId'])[_0x2121fa(0x1cf)](_0x11782c=>_0x11782c[_0x2121fa(0x1bb)]===_0x220669['threadId']))==null?void 0x0:_0x346fff[_0x2121fa(0x1e9)];if(!_0x567a48)return;const {unitId:_0x12e60a,subUnitId:_0x5333a7}=_0x567a48;switch(_0x220669[_0x2121fa(0x1f3)]&&this[_0x2121fa(0x201)][_0x2121fa(0x1e4)](_0x220669[_0x2121fa(0x1f3)]),_0x220669[_0x2121fa(0x1b5)]){case _0x5d0ba5[_0x2121fa(0x1a3)]:break;case _0x5d0ba5[_0x2121fa(0x19a)]:{this[_0x2121fa(0x1e8)][_0x2121fa(0x1fc)](_0x12e60a,_0x5333a7,{'unitId':_0x12e60a,'subUnitId':_0x5333a7,'ref':'','id':_0x220669[_0x2121fa(0x1a5)],'dT':_0x4747c0(+_0x220669['createTimestamp']),'threadId':_0x220669[_0x2121fa(0x1bb)],'personId':(_0x16ee0d=(_0x470513=_0x220669['user'])==null?void 0x0:_0x470513[_0x2121fa(0x20a)])!=null?_0x16ee0d:_0x220669[_0x2121fa(0x192)],'text':JSON['parse'](_0x220669[_0x2121fa(0x1ec)]),'parentId':_0x567a48['id']});break;}case _0x5d0ba5[_0x2121fa(0x1f7)]:{const _0x13ea52=this[_0x2121fa(0x1e8)][_0x2121fa(0x18b)](_0x12e60a,_0x5333a7,_0x220669[_0x2121fa(0x1a5)]);_0x13ea52&&_0x13ea52[_0x2121fa(0x1f4)]&&this['_threadCommentModel']['deleteComment'](_0x12e60a,_0x5333a7,_0x220669[_0x2121fa(0x1a5)]);break;}case _0x5d0ba5[_0x2121fa(0x1be)]:{this[_0x2121fa(0x1e8)][_0x2121fa(0x1d6)](_0x12e60a,_0x5333a7,{'commentId':_0x220669[_0x2121fa(0x1a5)],'text':JSON[_0x2121fa(0x207)](_0x220669[_0x2121fa(0x1ec)])});break;}case _0x5d0ba5['Solve']:{const _0x54cfa6=(_0x3a312a=this[_0x2121fa(0x1e8)][_0x2121fa(0x209)](_0x220669[_0x2121fa(0x19d)])['find'](_0x1fad21=>_0x1fad21[_0x2121fa(0x1bb)]===_0x220669['threadId']))==null?void 0x0:_0x3a312a[_0x2121fa(0x1e9)];_0x54cfa6&&this[_0x2121fa(0x1e8)]['resolveComment'](_0x12e60a,_0x5333a7,_0x54cfa6['id'],_0x220669[_0x2121fa(0x1fa)]===_0x551ddc[_0x2121fa(0x1bf)]);break;}}}));}};_0x2b59de=_0x5bef24([_0x5f53ff(0x0,_0x92db82[_0x8e74c2(0x1d7)](_0x3f0ee1[_0x8e74c2(0x1e6)])),_0x5f53ff(0x1,_0x92db82['Inject'](_0x3dde62[_0x8e74c2(0x1b9)])),_0x5f53ff(0x2,_0x92db82[_0x8e74c2(0x1d7)](_0x92db82[_0x8e74c2(0x1d0)])),_0x5f53ff(0x3,_0x92db82[_0x8e74c2(0x1d7)](_0x92db82[_0x8e74c2(0x1a6)]))],_0x2b59de);const _0x410026=_0x8e74c2(0x1e7),_0x22114d={};var _0x4d7156=Object['getOwnPropertyDescriptor'],_0x2ed38e=(_0x51218d,_0x5a693d,_0x19db9a,_0x3d3fa6)=>{for(var _0x1646b0=_0x3d3fa6>0x1?void 0x0:_0x3d3fa6?_0x4d7156(_0x5a693d,_0x19db9a):_0x5a693d,_0x40da6f=_0x51218d['length']-0x1,_0xd179e6;_0x40da6f>=0x0;_0x40da6f--)(_0xd179e6=_0x51218d[_0x40da6f])&&(_0x1646b0=_0xd179e6(_0x1646b0)||_0x1646b0);return _0x1646b0;},_0x403db3=(_0x58d44f,_0x5bf2f4)=>(_0x27c06b,_0x1650a3)=>_0x5bf2f4(_0x27c06b,_0x1650a3,_0x58d44f);function _0x489f18(_0x525e13,_0x1645c0){const _0x5066ed=_0x8e74c2,_0x458516=_0x525e13[_0x5066ed(0x1de)][0x0];return{..._0x1645c0,'id':_0x458516[_0x5066ed(0x1a5)],'resolved':_0x525e13[_0x5066ed(0x1fa)]===0x1,'dT':_0x4747c0(_0x458516['createTimestamp']),'personId':_0x458516['userId'],'threadId':_0x458516[_0x5066ed(0x1bb)]};}function _0x53f8c0(_0x45f841,_0x1ffbfa,_0x4ce031){const _0x3ca480=_0x8e74c2;var _0x1ae60e,_0x4ed7df;if(((_0x4ed7df=(_0x1ae60e=_0x45f841==null?void 0x0:_0x45f841[_0x3ca480(0x1de)])==null?void 0x0:_0x1ae60e[_0x3ca480(0x193)])!=null?_0x4ed7df:0x0)>0x0){const _0x584678=(_0x2904ea,_0x48566e)=>({'id':_0x2904ea[_0x3ca480(0x1a5)],'threadId':_0x2904ea[_0x3ca480(0x1bb)],'dT':_0x4747c0(_0x2904ea[_0x3ca480(0x1d2)]),'personId':_0x2904ea[_0x3ca480(0x192)],'resolved':_0x45f841[_0x3ca480(0x1fa)]===_0x551ddc[_0x3ca480(0x1bf)],'unitId':_0x1ffbfa,'subUnitId':_0x4ce031,'text':JSON[_0x3ca480(0x207)](_0x2904ea[_0x3ca480(0x1ec)]),'parentId':_0x48566e}),_0x2b7b7c=_0x584678(_0x45f841['replies'][0x0]);return{..._0x2b7b7c,'children':_0x45f841[_0x3ca480(0x1de)][_0x3ca480(0x1bc)](0x1)[_0x3ca480(0x206)](_0x116613=>_0x584678(_0x116613,_0x2b7b7c['id']))};}return null;}let _0x15d3de=class{constructor(_0x449f25,_0x227d87,_0x1135e0){const _0x380add=_0x8e74c2;this[_0x380add(0x1f2)]=_0x449f25,this[_0x380add(0x201)]=_0x227d87,this[_0x380add(0x1c5)]=_0x1135e0;}async['addComment'](_0x5b3f77){const _0x401911=_0x8e74c2;var _0x1d72d0,_0x418e73;const {parentId:_0x591483,unitId:_0x4be70c,text:_0xf0de95,threadId:_0x4ff4e0}=_0x5b3f77,_0x1e8540=(_0x418e73=(_0x1d72d0=_0xf0de95[_0x401911(0x1df)])==null?void 0x0:_0x1d72d0['filter'](_0x1cdc50=>_0x1cdc50[_0x401911(0x1d5)]===_0x92db82[_0x401911(0x1b1)][_0x401911(0x1b2)])[_0x401911(0x206)](_0x227b0a=>_0x227b0a[_0x401911(0x1a1)]))!=null?_0x418e73:[],_0x175705=JSON[_0x401911(0x1d3)](_0xf0de95),_0x524676=(await this[_0x401911(0x1c5)][_0x401911(0x1d1)](_0x4be70c))['getMemberID']();if(_0x591483){const _0x4dd3ef={'memberId':_0x524676,'unitId':_0x4be70c,'content':_0x175705,'mention':_0x1e8540,'threadId':_0x4ff4e0},_0x41d7fb=(await this[_0x401911(0x1f2)][_0x401911(0x200)](_0x401911(0x1b3)+_0x4be70c+'/reply',{'body':_0x4dd3ef}))['body'][_0x401911(0x1c2)];return{..._0x5b3f77,'id':_0x41d7fb[_0x401911(0x1a5)],'dT':_0x92db82[_0x401911(0x1ba)](+_0x41d7fb[_0x401911(0x1d2)])[_0x401911(0x208)](_0x401911(0x1c1)),'personId':_0x41d7fb['userId']};}else{const _0x140593={'memberId':_0x524676,'unitId':_0x4be70c,'content':_0x175705,'mention':_0x1e8540},_0x4cbdd6=await this['_httpService'][_0x401911(0x200)](_0x401911(0x1b3)+_0x4be70c+_0x401911(0x20c),{'body':_0x140593});return _0x489f18(_0x4cbdd6[_0x401911(0x1e1)][_0x401911(0x1a2)],_0x5b3f77);}}async['updateComment'](_0x1dc6bc){const _0x116c54=_0x8e74c2;var _0x28c61f,_0x2a0314;const {text:_0x5133a9,unitId:_0x148485}=_0x1dc6bc,_0x1b9cdf=(_0x2a0314=(_0x28c61f=_0x5133a9[_0x116c54(0x1df)])==null?void 0x0:_0x28c61f['filter'](_0x148650=>_0x148650['rangeType']===_0x92db82[_0x116c54(0x1b1)]['COMMENT'])[_0x116c54(0x206)](_0x5e0880=>_0x5e0880[_0x116c54(0x1a1)]))!=null?_0x2a0314:[],_0x289772=JSON[_0x116c54(0x1d3)](_0x5133a9),_0x1e5319=_0x1dc6bc[_0x116c54(0x1bb)],_0x1d0d23=_0x1dc6bc['id'],_0xd50343={'memberId':(await this[_0x116c54(0x1c5)][_0x116c54(0x1d1)](_0x148485))[_0x116c54(0x1f8)](),'unitId':_0x148485,'threadId':_0x1e5319,'mention':_0x1b9cdf,'content':_0x289772,'replyId':_0x1d0d23},_0x1a379=await this[_0x116c54(0x1f2)][_0x116c54(0x200)]('/universer-api/comment/unit/'+_0x148485+_0x116c54(0x202),{'body':_0xd50343});return!_0x1a379[_0x116c54(0x1e1)][_0x116c54(0x18a)]||_0x1a379[_0x116c54(0x1e1)]['error']['code']===0x1;}async['resolveComment'](_0x57b868){const _0x2f828a=_0x8e74c2,{unitId:_0x469947}=_0x57b868,_0x40f299=_0x57b868[_0x2f828a(0x1bb)],_0x4b1450={'memberId':this[_0x2f828a(0x201)][_0x2f828a(0x1eb)]()['userID'],'unitId':_0x469947,'threadId':_0x40f299,'solved':_0x57b868[_0x2f828a(0x20d)]?_0x551ddc[_0x2f828a(0x1bf)]:_0x551ddc[_0x2f828a(0x19b)]},_0x28394c=await this[_0x2f828a(0x1f2)][_0x2f828a(0x200)](_0x2f828a(0x1b3)+_0x469947+'/solved',{'body':_0x4b1450});return!_0x28394c[_0x2f828a(0x1e1)][_0x2f828a(0x18a)]||_0x28394c[_0x2f828a(0x1e1)][_0x2f828a(0x18a)][_0x2f828a(0x1b4)]===0x1;}async[_0x8e74c2(0x18e)](_0x1ed241,_0x3c37a0,_0x3ebf5d,_0x5e4492){const _0x1db10b=_0x8e74c2,_0x531762={'memberId':(await this[_0x1db10b(0x1c5)]['requireSession'](_0x1ed241))[_0x1db10b(0x1f8)](),'threadId':_0x3ebf5d,'replyId':_0x5e4492,'unitId':_0x1ed241},_0x4b5597=await this['_httpService'][_0x1db10b(0x200)](_0x1db10b(0x1b3)+_0x1ed241+'/delete',{'body':_0x531762});return!_0x4b5597[_0x1db10b(0x1e1)][_0x1db10b(0x18a)]||_0x4b5597[_0x1db10b(0x1e1)][_0x1db10b(0x18a)][_0x1db10b(0x1b4)]===0x1;}async[_0x8e74c2(0x1b7)](_0x5ea5dc,_0x1188ff,_0x48aa5b){const _0x14f9b3=_0x8e74c2,_0x20109b={'unitId':_0x5ea5dc,'threadId':_0x48aa5b},_0x13db2c=await this[_0x14f9b3(0x1f2)][_0x14f9b3(0x200)](_0x14f9b3(0x1b3)+_0x5ea5dc+_0x14f9b3(0x1fd),{'body':_0x20109b}),_0x16d296=_0x48aa5b[_0x14f9b3(0x206)](_0x4aab23=>_0x53f8c0(_0x13db2c[_0x14f9b3(0x1e1)]['comments'][_0x4aab23],_0x5ea5dc,_0x1188ff))[_0x14f9b3(0x1cc)](Boolean);return Object[_0x14f9b3(0x1e0)](_0x13db2c[_0x14f9b3(0x1e1)]['users'])['forEach'](_0x16d32d=>{const _0x8520c=_0x14f9b3;this['_userService'][_0x8520c(0x1e4)](_0x16d32d);}),_0x16d296;}[_0x8e74c2(0x1e5)](_0x6b0e8c){const _0x40459e=_0x8e74c2;return{'id':_0x6b0e8c['id'],'threadId':_0x6b0e8c[_0x40459e(0x1bb)],'ref':_0x6b0e8c[_0x40459e(0x1c9)]};}};_0x15d3de=_0x2ed38e([_0x403db3(0x0,_0x92db82['Inject'](_0x206d9f[_0x8e74c2(0x18c)])),_0x403db3(0x1,_0x92db82['Inject'](_0x92db82[_0x8e74c2(0x1d0)])),_0x403db3(0x2,_0x92db82[_0x8e74c2(0x1d7)](_0x3f0ee1[_0x8e74c2(0x19c)]))],_0x15d3de);var _0x1b8f85=Object['getOwnPropertyDescriptor'],_0x33864e=(_0x4d0d48,_0x32578d,_0x2912b4,_0x4add0d)=>{for(var _0x3e7161=_0x4add0d>0x1?void 0x0:_0x4add0d?_0x1b8f85(_0x32578d,_0x2912b4):_0x32578d,_0x537b6d=_0x4d0d48['length']-0x1,_0x1f0dc8;_0x537b6d>=0x0;_0x537b6d--)(_0x1f0dc8=_0x4d0d48[_0x537b6d])&&(_0x3e7161=_0x1f0dc8(_0x3e7161)||_0x3e7161);return _0x3e7161;},_0x864310=(_0x312da2,_0x29f58c)=>(_0x2e1df1,_0x2a0301)=>_0x29f58c(_0x2e1df1,_0x2a0301,_0x312da2);let _0x1b82f1=class extends _0x92db82[_0x8e74c2(0x1a7)]{constructor(_0x381e41,_0x5812dc){const _0x49643f=_0x8e74c2;super(),this[_0x49643f(0x18d)]=_0x381e41,this['_threadCommentDataSource']=_0x5812dc,this[_0x49643f(0x1ac)]();}[_0x8e74c2(0x1ac)](){const _0x1a4247=_0x8e74c2;this[_0x1a4247(0x18d)][_0x1a4247(0x1aa)]=this[_0x1a4247(0x1ea)],this[_0x1a4247(0x18d)][_0x1a4247(0x1a9)]=!0x1;}};_0x1b82f1=_0x33864e([_0x864310(0x0,_0x3dde62['IThreadCommentDataSourceService']),_0x864310(0x1,_0x92db82[_0x8e74c2(0x1d7)](_0x15d3de))],_0x1b82f1);var _0x527b89=Object['defineProperty'],_0x185feb=Object['getOwnPropertyDescriptor'],_0x1a4e11=(_0x301d90,_0x2afb90,_0x43ef52)=>_0x2afb90 in _0x301d90?_0x527b89(_0x301d90,_0x2afb90,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x43ef52}):_0x301d90[_0x2afb90]=_0x43ef52,_0x3538c5=(_0x223611,_0x1cd909,_0x25dca3,_0x28d4e5)=>{const _0x4ef8d5=_0x8e74c2;for(var _0x7a5ead=_0x28d4e5>0x1?void 0x0:_0x28d4e5?_0x185feb(_0x1cd909,_0x25dca3):_0x1cd909,_0x3daec4=_0x223611[_0x4ef8d5(0x193)]-0x1,_0x1644f0;_0x3daec4>=0x0;_0x3daec4--)(_0x1644f0=_0x223611[_0x3daec4])&&(_0x7a5ead=_0x1644f0(_0x7a5ead)||_0x7a5ead);return _0x7a5ead;},_0x207ce0=(_0x3b783e,_0x550928)=>(_0x2c4955,_0x348e30)=>_0x550928(_0x2c4955,_0x348e30,_0x3b783e),_0x30e433=(_0x4c7e6f,_0x39628f,_0x114e97)=>_0x1a4e11(_0x4c7e6f,typeof _0x39628f!=_0x8e74c2(0x203)?_0x39628f+'':_0x39628f,_0x114e97);_0x4afe61['UniverThreadCommentDataSourcePlugin']=class extends _0x92db82[_0x8e74c2(0x1ce)]{constructor(_0x16114d=_0x22114d,_0x360940,_0x55096d){const _0x3cbb9e=_0x8e74c2;super(),this['_config']=_0x16114d,this[_0x3cbb9e(0x20b)]=_0x360940,this['_configService']=_0x55096d;const {..._0x3c8fa4}=_0x92db82[_0x3cbb9e(0x1c7)]({},_0x22114d,this[_0x3cbb9e(0x204)]);this['_configService'][_0x3cbb9e(0x1a4)](_0x410026,_0x3c8fa4);}[_0x8e74c2(0x1c6)](){[[_0x15d3de],[_0x1b82f1],[_0x2b59de]]['forEach'](_0x332ff7=>{const _0x52b7a2=_0x252d;this[_0x52b7a2(0x20b)]['add'](_0x332ff7);});}[_0x8e74c2(0x1d4)](){const _0x364541=_0x8e74c2;this['_injector'][_0x364541(0x1dd)](_0x1b82f1),this['_injector'][_0x364541(0x1dd)](_0x2b59de);}},_0x30e433(_0x4afe61[_0x8e74c2(0x190)],_0x8e74c2(0x1e3),_0x2b801f),_0x30e433(_0x4afe61[_0x8e74c2(0x190)],_0x8e74c2(0x1b5),_0x92db82['UniverInstanceType']['UNIVER_UNKNOWN']),_0x4afe61[_0x8e74c2(0x190)]=_0x3538c5([_0x92db82[_0x8e74c2(0x1fe)](_0x164632['UniverThreadCommentUIPlugin'],_0x3f0ee1['UniverCollaborationClientPlugin'],_0x3ada5f[_0x8e74c2(0x1da)]),_0x207ce0(0x1,_0x92db82[_0x8e74c2(0x1d7)](_0x92db82[_0x8e74c2(0x1a6)])),_0x207ce0(0x2,_0x92db82[_0x8e74c2(0x1ae)])],_0x4afe61['UniverThreadCommentDataSourcePlugin']),Object[_0x8e74c2(0x194)](_0x4afe61,Symbol[_0x8e74c2(0x1ef)],{'value':_0x8e74c2(0x199)});}));function _0x252d(_0x1bfa8,_0x298735){_0x1bfa8=_0x1bfa8-0x18a;const _0x35a6d6=_0x35a6();let _0x252da4=_0x35a6d6[_0x1bfa8];return _0x252da4;}function _0x35a6(){const _0x499eb8=['disposeWithMe','IConfigService','/universer-api/user/list','UniverCore','CustomRangeType','COMMENT','/universer-api/comment/unit/','code','type','856580qerIsf','listComments','_init','ThreadCommentModel','dayjs','threadId','slice','UniverNetwork','Edit','Solved','delete','YYYY/MM/DD\x20HH:mm','reply','bufferTime','object','_sessionService','onStarting','merge','size','ref','subscribe','UNRECOGNIZED','filter','add','Plugin','find','UserManagerService','requireSession','createTimestamp','stringify','onReady','rangeType','updateComment','Inject','UniverProCollaborationClient','forEach','UniverLicensePlugin','302100qVGovs','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','get','replies','customRanges','values','body','@univerjs/network','pluginName','addUser','saveCommentToSnapshot','CommentService','thread-comment-data-source.config','_threadCommentModel','root','_threadCommentDataSource','getCurrentUser','content','1718150YyAUEa','personId','toStringTag','_commentService','@univerjs-pro/collaboration-client','_httpService','user','parentId','7425495vsAxOg','Unknown','Delete','getMemberID','commentUpdate$','solved','amd','addComment','/list','DependentOn','109264WNtXao','post','_userService','/edit','symbol','_config','2593434lCkAkI','map','parse','format','getUnit','userID','_injector','/add','resolved','91ukVzKn','error','getComment','HTTPService','_threadCommentDataSourceService','deleteComment','getOwnPropertyDescriptor','UniverThreadCommentDataSourcePlugin','exports','userId','length','defineProperty','@univerjs/thread-comment','getUser','rxjs','UniverProThreadCommentDatasource','Module','Reply','OpenOrReOpen','CollaborationSessionService','unitId','UniverThreadCommentUi','pipe','Solve','rangeId','comment','Add','setConfig','replyId','Injector','Disposable','3215bNELiz','syncUpdateMutationToColla','dataSource','340nwhzpC','_initDataSource'];_0x35a6=function(){return _0x499eb8;};return _0x35a6();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0-insiders.20251222-4efcfbb",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.
|
|
49
|
-
"@univerjs-pro/license": "0.
|
|
50
|
-
"@univerjs/core": "0.
|
|
51
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.14.0-insiders.20251222-4efcfbb",
|
|
49
|
+
"@univerjs-pro/license": "0.14.0-insiders.20251222-4efcfbb",
|
|
50
|
+
"@univerjs/core": "0.14.0-insiders.20251222-4efcfbb",
|
|
51
|
+
"@univerjs/network": "0.14.0-insiders.20251222-4efcfbb",
|
|
52
52
|
"@univerjs/protocol": "0.1.47",
|
|
53
|
-
"@univerjs/thread-comment
|
|
54
|
-
"@univerjs/
|
|
53
|
+
"@univerjs/thread-comment": "0.14.0-insiders.20251222-4efcfbb",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.14.0-insiders.20251222-4efcfbb"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
59
|
"vite": "^7.2.7",
|
|
60
60
|
"vitest": "^4.0.15",
|
|
61
|
-
"@univerjs-infra/shared": "0.
|
|
61
|
+
"@univerjs-infra/shared": "0.14.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|