@univerjs-pro/thread-comment-datasource 0.6.0-nightly.202502141606 → 0.6.0
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/umd/index.js +1 -1
- package/package.json +7 -7
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x5b8be0=_0x53eb;(function(_0x38c9d5,_0x447869){const _0x461a91=_0x53eb,_0x1410b9=_0x38c9d5();while(!![]){try{const _0x1bd275=parseInt(_0x461a91(0x163))/0x1*(parseInt(_0x461a91(0x196))/0x2)+-parseInt(_0x461a91(0x1c3))/0x3+-parseInt(_0x461a91(0x1ac))/0x4+-parseInt(_0x461a91(0x182))/0x5+-parseInt(_0x461a91(0x17e))/0x6*(-parseInt(_0x461a91(0x15b))/0x7)+parseInt(_0x461a91(0x16c))/0x8+parseInt(_0x461a91(0x18c))/0x9;if(_0x1bd275===_0x447869)break;else _0x1410b9['push'](_0x1410b9['shift']());}catch(_0x37433f){_0x1410b9['push'](_0x1410b9['shift']());}}}(_0x2f47,0xd6cf3));Object['defineProperty'](exports,Symbol[_0x5b8be0(0x154)],{'value':_0x5b8be0(0x167)});const b=require(_0x5b8be0(0x158)),T=require(_0x5b8be0(0x14d)),c=require('@univerjs/core'),j=require(_0x5b8be0(0x1b0)),M=require('@univerjs/thread-comment'),w=require(_0x5b8be0(0x1b2)),P=require(_0x5b8be0(0x1a3)),U=_0x5b8be0(0x184);function _0x53eb(_0x8f267c,_0x387635){const _0x2f4769=_0x2f47();return _0x53eb=function(_0x53eb05,_0xc6914a){_0x53eb05=_0x53eb05-0x14d;let _0x199827=_0x2f4769[_0x53eb05];return _0x199827;},_0x53eb(_0x8f267c,_0x387635);}var I=(_0x5afe74=>(_0x5afe74[_0x5afe74[_0x5b8be0(0x180)]=0x0]='OpenOrReOpen',_0x5afe74[_0x5afe74[_0x5b8be0(0x177)]=0x1]=_0x5b8be0(0x177),_0x5afe74[_0x5afe74[_0x5b8be0(0x17b)]=-0x1]='UNRECOGNIZED',_0x5afe74))(I||{}),v=(_0x321178=>(_0x321178[_0x321178[_0x5b8be0(0x156)]=0x0]=_0x5b8be0(0x156),_0x321178[_0x321178[_0x5b8be0(0x153)]=0x1]='Add',_0x321178[_0x321178['Reply']=0x2]=_0x5b8be0(0x169),_0x321178[_0x321178[_0x5b8be0(0x189)]=0x3]='Edit',_0x321178[_0x321178[_0x5b8be0(0x14f)]=0x4]=_0x5b8be0(0x14f),_0x321178[_0x321178[_0x5b8be0(0x17c)]=0x5]=_0x5b8be0(0x17c),_0x321178[_0x321178[_0x5b8be0(0x17b)]=-0x1]=_0x5b8be0(0x17b),_0x321178))(v||{});const f=_0x3c6a95=>c[_0x5b8be0(0x193)](new Date(+_0x3c6a95))[_0x5b8be0(0x18e)](_0x5b8be0(0x1bc)),R=async(_0x365d53,_0x1deb52)=>{const _0x44337c=_0x5b8be0,_0x1fc5c0=_0x365d53[_0x44337c(0x197)](c[_0x44337c(0x176)]),_0x24c695=_0x365d53[_0x44337c(0x197)](P[_0x44337c(0x16e)]);_0x1deb52[_0x44337c(0x15c)](_0x686ef5=>{const _0x1d3cf0=_0x44337c;_0x1fc5c0[_0x1d3cf0(0x194)](_0x686ef5)&&_0x1deb52[_0x1d3cf0(0x1ba)](_0x686ef5);}),_0x1deb52['size']&&(await _0x24c695[_0x44337c(0x197)](_0x44337c(0x173),{'params':{'userIDs':[..._0x1deb52]}}))['body'][_0x44337c(0x170)]['forEach'](_0xb92779=>{_0xb92779&&_0x1fc5c0['addUser'](_0xb92779);});};var $=Object[_0x5b8be0(0x178)],E=(_0x30082d,_0x538d42,_0x3a619b,_0x37a061)=>{for(var _0x2d4a5d=_0x37a061>0x1?void 0x0:_0x37a061?$(_0x538d42,_0x3a619b):_0x538d42,_0x5cc28a=_0x30082d['length']-0x1,_0x2dfebe;_0x5cc28a>=0x0;_0x5cc28a--)(_0x2dfebe=_0x30082d[_0x5cc28a])&&(_0x2d4a5d=_0x2dfebe(_0x2d4a5d)||_0x2d4a5d);return _0x2d4a5d;},S=(_0x515df8,_0x471a6b)=>(_0x1de3ee,_0x1b5360)=>_0x471a6b(_0x1de3ee,_0x1b5360,_0x515df8);let p=class extends c['Disposable']{constructor(_0x366cd4,_0x41985b,_0x77555b,_0x2c9b32){const _0xce9f1c=_0x5b8be0;super(),this[_0xce9f1c(0x1bf)]=_0x366cd4,this[_0xce9f1c(0x18b)]=_0x41985b,this[_0xce9f1c(0x1a6)]=_0x77555b,this[_0xce9f1c(0x1b6)]=_0x2c9b32,this['_init'](),this[_0xce9f1c(0x188)]();}['_initUserSync'](){const _0x2fbafc=_0x5b8be0;this[_0x2fbafc(0x15f)](this[_0x2fbafc(0x18b)][_0x2fbafc(0x1a4)]['pipe'](w[_0x2fbafc(0x16f)](0x10))['subscribe'](_0x544aa1=>{const _0x3e28a0=_0x2fbafc,_0x1aaa98=new Set();_0x544aa1[_0x3e28a0(0x15c)](_0x133a87=>{const _0x38f88c=_0x3e28a0;switch(_0x133a87[_0x38f88c(0x1a5)]){case'add':{const _0x18de35=_0x133a87['payload']['personId'];_0x1aaa98[_0x38f88c(0x191)](_0x18de35);break;}}}),R(this[_0x3e28a0(0x1b6)],_0x1aaa98);}));}[_0x5b8be0(0x1b3)](){const _0x3f7b07=_0x5b8be0;this['disposeWithMe'](this[_0x3f7b07(0x1bf)][_0x3f7b07(0x1a4)][_0x3f7b07(0x18f)](async _0x2d5ada=>{const _0x299877=_0x3f7b07;var _0x4af67d,_0x3e27d0,_0x43faf5,_0x469f83;const _0x318ec7=(_0x4af67d=this[_0x299877(0x18b)][_0x299877(0x161)](_0x2d5ada['unitId'])[_0x299877(0x181)](_0x2d1c20=>_0x2d1c20[_0x299877(0x1b8)]===_0x2d5ada[_0x299877(0x1b8)]))==null?void 0x0:_0x4af67d[_0x299877(0x151)];if(!_0x318ec7)return;const {unitId:_0x5ca101,subUnitId:_0x5728b9}=_0x318ec7;switch(_0x2d5ada[_0x299877(0x1af)]&&this[_0x299877(0x1a6)][_0x299877(0x15e)](_0x2d5ada[_0x299877(0x1af)]),_0x2d5ada['type']){case v[_0x299877(0x153)]:break;case v['Reply']:{this[_0x299877(0x18b)]['addComment'](_0x5ca101,_0x5728b9,{'unitId':_0x5ca101,'subUnitId':_0x5728b9,'ref':'','id':_0x2d5ada['replyId'],'dT':f(+_0x2d5ada['createTimestamp']),'threadId':_0x2d5ada[_0x299877(0x1b8)],'personId':(_0x43faf5=(_0x3e27d0=_0x2d5ada[_0x299877(0x1af)])==null?void 0x0:_0x3e27d0[_0x299877(0x183)])!=null?_0x43faf5:_0x2d5ada[_0x299877(0x1ab)],'text':JSON['parse'](_0x2d5ada['content']),'parentId':_0x318ec7['id']});break;}case v['Delete']:{const _0x20c8c7=this['_threadCommentModel']['getComment'](_0x5ca101,_0x5728b9,_0x2d5ada[_0x299877(0x19d)]);_0x20c8c7&&_0x20c8c7[_0x299877(0x15a)]&&this[_0x299877(0x18b)][_0x299877(0x16b)](_0x5ca101,_0x5728b9,_0x2d5ada[_0x299877(0x19d)]);break;}case v[_0x299877(0x189)]:{this['_threadCommentModel']['updateComment'](_0x5ca101,_0x5728b9,{'commentId':_0x2d5ada[_0x299877(0x19d)],'text':JSON[_0x299877(0x1a2)](_0x2d5ada[_0x299877(0x198)])});break;}case v[_0x299877(0x17c)]:{const _0x2c242c=(_0x469f83=this[_0x299877(0x18b)]['getUnit'](_0x2d5ada[_0x299877(0x1a9)])[_0x299877(0x181)](_0x4e3a99=>_0x4e3a99[_0x299877(0x1b8)]===_0x2d5ada[_0x299877(0x1b8)]))==null?void 0x0:_0x469f83[_0x299877(0x151)];_0x2c242c&&this['_threadCommentModel'][_0x299877(0x19f)](_0x5ca101,_0x5728b9,_0x2c242c['id'],_0x2d5ada[_0x299877(0x16a)]===I['Solved']);break;}}}));}};p=E([S(0x0,c[_0x5b8be0(0x190)](b['CommentService'])),S(0x1,c[_0x5b8be0(0x190)](M['ThreadCommentModel'])),S(0x2,c[_0x5b8be0(0x190)](c[_0x5b8be0(0x176)])),S(0x3,c[_0x5b8be0(0x190)](c[_0x5b8be0(0x166)]))],p);const q='thread-comment-data-source.config',D={};var A=Object[_0x5b8be0(0x178)],x=(_0x24bbab,_0x35a94b,_0x6cf67b,_0x48f90d)=>{const _0xd76bcb=_0x5b8be0;for(var _0x29f454=_0x48f90d>0x1?void 0x0:_0x48f90d?A(_0x35a94b,_0x6cf67b):_0x35a94b,_0xfad035=_0x24bbab[_0xd76bcb(0x192)]-0x1,_0x220208;_0xfad035>=0x0;_0xfad035--)(_0x220208=_0x24bbab[_0xfad035])&&(_0x29f454=_0x220208(_0x29f454)||_0x29f454);return _0x29f454;},_=(_0x1785a3,_0x2223ac)=>(_0x412165,_0x5b18a2)=>_0x2223ac(_0x412165,_0x5b18a2,_0x1785a3);function Y(_0x54d2e8,_0x534b28){const _0x336a85=_0x5b8be0,_0x363578=_0x54d2e8['replies'][0x0];return{..._0x534b28,'id':_0x363578[_0x336a85(0x19d)],'resolved':_0x54d2e8[_0x336a85(0x16a)]===0x1,'dT':f(_0x363578[_0x336a85(0x1c0)]),'personId':_0x363578[_0x336a85(0x1ab)],'threadId':_0x363578[_0x336a85(0x1b8)]};}function G(_0x5aac7b,_0x4f76ff,_0x3dbcfe){const _0x937156=_0x5b8be0;var _0x511183,_0x301571;if(((_0x301571=(_0x511183=_0x5aac7b==null?void 0x0:_0x5aac7b[_0x937156(0x14e)])==null?void 0x0:_0x511183[_0x937156(0x192)])!=null?_0x301571:0x0)>0x0){const _0xc81e8e=(_0x4fddfd,_0x495e39)=>({'id':_0x4fddfd[_0x937156(0x19d)],'threadId':_0x4fddfd[_0x937156(0x1b8)],'dT':f(_0x4fddfd['createTimestamp']),'personId':_0x4fddfd['userId'],'resolved':_0x5aac7b[_0x937156(0x16a)]===I[_0x937156(0x177)],'unitId':_0x4f76ff,'subUnitId':_0x3dbcfe,'text':JSON['parse'](_0x4fddfd[_0x937156(0x198)]),'parentId':_0x495e39}),_0x1da020=_0xc81e8e(_0x5aac7b['replies'][0x0]);return{..._0x1da020,'children':_0x5aac7b[_0x937156(0x14e)][_0x937156(0x174)](0x1)[_0x937156(0x168)](_0x44e13b=>_0xc81e8e(_0x44e13b,_0x1da020['id']))};}return null;}let g=class{constructor(_0x52bce8,_0x232c24,_0x490ece,_0x114256){const _0x47c8a5=_0x5b8be0;this[_0x47c8a5(0x1c2)]=_0x52bce8,this[_0x47c8a5(0x1a6)]=_0x232c24,this[_0x47c8a5(0x1b7)]=_0x490ece,this['_injector']=_0x114256;}async['addComment'](_0xfdfb4c){const _0x54c072=_0x5b8be0;var _0x1ca46d,_0x39b672;const {parentId:_0x262ff4,unitId:_0x3d4dd1,text:_0x4041dd,threadId:_0x3c1f8b}=_0xfdfb4c,_0x3e71fd=(_0x39b672=(_0x1ca46d=_0x4041dd['customRanges'])==null?void 0x0:_0x1ca46d[_0x54c072(0x162)](_0x238a43=>_0x238a43[_0x54c072(0x19e)]===c[_0x54c072(0x1b5)][_0x54c072(0x1be)])['map'](_0xa16ca8=>_0xa16ca8[_0x54c072(0x1a0)]))!=null?_0x39b672:[],_0x339fc9=JSON[_0x54c072(0x19a)](_0x4041dd),_0x5f2377=(await this[_0x54c072(0x1b7)][_0x54c072(0x18d)](_0x3d4dd1))[_0x54c072(0x1ae)]();if(_0x262ff4){const _0x4b4862={'memberId':_0x5f2377,'unitId':_0x3d4dd1,'content':_0x339fc9,'mention':_0x3e71fd,'threadId':_0x3c1f8b},_0x661909=(await this[_0x54c072(0x1c2)][_0x54c072(0x175)](_0x54c072(0x155)+_0x3d4dd1+'/reply',{'body':_0x4b4862}))['body'][_0x54c072(0x165)];return{..._0xfdfb4c,'id':_0x661909['replyId'],'dT':c['dayjs'](+_0x661909['createTimestamp'])[_0x54c072(0x18e)](_0x54c072(0x1bc)),'personId':_0x661909[_0x54c072(0x1ab)]};}else{const _0x1384b2={'memberId':_0x5f2377,'unitId':_0x3d4dd1,'content':_0x339fc9,'mention':_0x3e71fd},_0x3b83d3=await this['_httpService'][_0x54c072(0x175)]('/universer-api/comment/unit/'+_0x3d4dd1+_0x54c072(0x1a7),{'body':_0x1384b2});return Y(_0x3b83d3[_0x54c072(0x150)][_0x54c072(0x164)],_0xfdfb4c);}}async['updateComment'](_0x3e4fb7){const _0xed126b=_0x5b8be0;var _0x14b3be,_0x31bc47;const {text:_0x420f4f,unitId:_0x43d294}=_0x3e4fb7,_0x24251d=(_0x31bc47=(_0x14b3be=_0x420f4f[_0xed126b(0x157)])==null?void 0x0:_0x14b3be['filter'](_0x5d2e59=>_0x5d2e59[_0xed126b(0x19e)]===c[_0xed126b(0x1b5)][_0xed126b(0x1be)])[_0xed126b(0x168)](_0x110936=>_0x110936[_0xed126b(0x1a0)]))!=null?_0x31bc47:[],_0x22a5a0=JSON[_0xed126b(0x19a)](_0x420f4f),_0x5e5af3=_0x3e4fb7[_0xed126b(0x1b8)],_0x2ffa53=_0x3e4fb7['id'],_0x36f857={'memberId':(await this[_0xed126b(0x1b7)][_0xed126b(0x18d)](_0x43d294))['getMemberID'](),'unitId':_0x43d294,'threadId':_0x5e5af3,'mention':_0x24251d,'content':_0x22a5a0,'replyId':_0x2ffa53},_0x55d5e4=await this[_0xed126b(0x1c2)][_0xed126b(0x175)]('/universer-api/comment/unit/'+_0x43d294+_0xed126b(0x1bb),{'body':_0x36f857});return!_0x55d5e4[_0xed126b(0x150)][_0xed126b(0x160)]||_0x55d5e4['body'][_0xed126b(0x160)][_0xed126b(0x1b9)]===0x1;}async[_0x5b8be0(0x19f)](_0x1f6ff6){const _0x2ee335=_0x5b8be0,{unitId:_0x1051d0}=_0x1f6ff6,_0x5592d8=_0x1f6ff6[_0x2ee335(0x1b8)],_0xfda8e7={'memberId':this[_0x2ee335(0x1a6)][_0x2ee335(0x1ad)]()[_0x2ee335(0x183)],'unitId':_0x1051d0,'threadId':_0x5592d8,'solved':_0x1f6ff6[_0x2ee335(0x19b)]?I['Solved']:I[_0x2ee335(0x180)]},_0x279941=await this['_httpService'][_0x2ee335(0x175)]('/universer-api/comment/unit/'+_0x1051d0+'/solved',{'body':_0xfda8e7});return!_0x279941[_0x2ee335(0x150)][_0x2ee335(0x160)]||_0x279941[_0x2ee335(0x150)][_0x2ee335(0x160)]['code']===0x1;}async['deleteComment'](_0x4c5169,_0x3ae765,_0x52e5bc,_0x18316a){const _0x1bb079=_0x5b8be0,_0x3097dd={'memberId':(await this[_0x1bb079(0x1b7)][_0x1bb079(0x18d)](_0x4c5169))[_0x1bb079(0x1ae)](),'threadId':_0x52e5bc,'replyId':_0x18316a,'unitId':_0x4c5169},_0x57865e=await this['_httpService'][_0x1bb079(0x175)]('/universer-api/comment/unit/'+_0x4c5169+_0x1bb079(0x19c),{'body':_0x3097dd});return!_0x57865e[_0x1bb079(0x150)][_0x1bb079(0x160)]||_0x57865e[_0x1bb079(0x150)][_0x1bb079(0x160)][_0x1bb079(0x1b9)]===0x1;}async[_0x5b8be0(0x1b4)](_0x1e543f,_0x285b7f,_0x4c414d){const _0x2eb562=_0x5b8be0,_0x4dfd62={'unitId':_0x1e543f,'threadId':_0x4c414d},_0x371cd4=await this[_0x2eb562(0x1c2)][_0x2eb562(0x175)](_0x2eb562(0x155)+_0x1e543f+_0x2eb562(0x159),{'body':_0x4dfd62}),_0x17d952=_0x4c414d[_0x2eb562(0x168)](_0x3a8bf4=>G(_0x371cd4['body'][_0x2eb562(0x1a1)][_0x3a8bf4],_0x1e543f,_0x285b7f))['filter'](Boolean);return Object[_0x2eb562(0x172)](_0x371cd4[_0x2eb562(0x150)][_0x2eb562(0x170)])[_0x2eb562(0x15c)](_0x4cfb7d=>{const _0x36a1bb=_0x2eb562;this[_0x36a1bb(0x1a6)][_0x36a1bb(0x15e)](_0x4cfb7d);}),_0x17d952;}[_0x5b8be0(0x17a)](_0x321974){const _0x2a92e0=_0x5b8be0;return{'id':_0x321974['id'],'threadId':_0x321974[_0x2a92e0(0x1b8)],'ref':_0x321974[_0x2a92e0(0x17d)]};}};g=x([_(0x0,c[_0x5b8be0(0x190)](P[_0x5b8be0(0x16e)])),_(0x1,c[_0x5b8be0(0x190)](c[_0x5b8be0(0x176)])),_(0x2,c[_0x5b8be0(0x190)](b[_0x5b8be0(0x185)])),_(0x3,c['Inject'](c[_0x5b8be0(0x166)]))],g);var H=Object[_0x5b8be0(0x178)],J=(_0x88d4ab,_0x588930,_0x10cdd0,_0x4913ea)=>{for(var _0x491aea=_0x4913ea>0x1?void 0x0:_0x4913ea?H(_0x588930,_0x10cdd0):_0x588930,_0xdbcac7=_0x88d4ab['length']-0x1,_0x4b44c3;_0xdbcac7>=0x0;_0xdbcac7--)(_0x4b44c3=_0x88d4ab[_0xdbcac7])&&(_0x491aea=_0x4b44c3(_0x491aea)||_0x491aea);return _0x491aea;},y=(_0x24ce12,_0xd8d7aa)=>(_0x3fa65a,_0x2e679e)=>_0xd8d7aa(_0x3fa65a,_0x2e679e,_0x24ce12);let C=class extends c[_0x5b8be0(0x17f)]{constructor(_0x8ead4,_0x1f35cd){const _0x435cad=_0x5b8be0;super(),this[_0x435cad(0x1a8)]=_0x8ead4,this[_0x435cad(0x152)]=_0x1f35cd,this[_0x435cad(0x15d)]();}[_0x5b8be0(0x15d)](){const _0x2f9b3e=_0x5b8be0;this[_0x2f9b3e(0x1a8)]['dataSource']=this[_0x2f9b3e(0x152)],this[_0x2f9b3e(0x1a8)]['syncUpdateMutationToColla']=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c[_0x5b8be0(0x190)](g))],C);var F=Object['defineProperty'],L=Object[_0x5b8be0(0x178)],Z=(_0x1d1f73,_0x13fcb7,_0x2a620a)=>_0x13fcb7 in _0x1d1f73?F(_0x1d1f73,_0x13fcb7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2a620a}):_0x1d1f73[_0x13fcb7]=_0x2a620a,W=(_0x56deae,_0x469978,_0x313ac0,_0x1c07fe)=>{for(var _0x1eeb24=_0x1c07fe>0x1?void 0x0:_0x1c07fe?L(_0x469978,_0x313ac0):_0x469978,_0x4ffb9b=_0x56deae['length']-0x1,_0x1005e3;_0x4ffb9b>=0x0;_0x4ffb9b--)(_0x1005e3=_0x56deae[_0x4ffb9b])&&(_0x1eeb24=_0x1005e3(_0x1eeb24)||_0x1eeb24);return _0x1eeb24;},O=(_0x5eea0c,_0xe412ee)=>(_0x2e5338,_0x437b8d)=>_0xe412ee(_0x2e5338,_0x437b8d,_0x5eea0c),N=(_0x3e020f,_0x491dd6,_0x83fb0)=>Z(_0x3e020f,typeof _0x491dd6!=_0x5b8be0(0x16d)?_0x491dd6+'':_0x491dd6,_0x83fb0);function _0x2f47(){const _0x4843ff=['_threadCommentDataSource','Add','toStringTag','/universer-api/comment/unit/','Unknown','customRanges','@univerjs-pro/collaboration-client','/list','parentId','35UKHDSs','forEach','_initDataSource','addUser','disposeWithMe','error','getUnit','filter','348189mLLCDS','comment','reply','Injector','Module','map','Reply','solved','deleteComment','6243344lTThTD','symbol','HTTPService','bufferTime','users','UniverLicensePlugin','values','/universer-api/user/list','slice','post','UserManagerService','Solved','getOwnPropertyDescriptor','pluginName','saveCommentToSnapshot','UNRECOGNIZED','Solve','ref','366318WHknJL','Disposable','OpenOrReOpen','find','7752140pidawf','userID','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','CollaborationSessionService','onReady','_config','_initUserSync','Edit','merge','_threadCommentModel','30499308bVnKBr','requireSession','format','subscribe','Inject','add','length','dayjs','getUser','UNIVER_UNKNOWN','6xaWOMC','get','content','onStarting','stringify','resolved','/delete','replyId','rangeType','resolveComment','rangeId','comments','parse','@univerjs/network','commentUpdate$','type','_userService','/add','_threadCommentDataSourceService','unitId','UniverThreadCommentUIPlugin','userId','6656192dMjAxR','getCurrentUser','getMemberID','user','@univerjs/thread-comment-ui','_configService','rxjs','_init','listComments','CustomRangeType','_injector','_sessionService','threadId','code','delete','/edit','YYYY/MM/DD\x20HH:mm','UniverThreadCommentDataSourcePlugin','COMMENT','_commentService','createTimestamp','DependentOn','_httpService','4274181UpYkKq','@univerjs-pro/license','replies','Delete','body','root'];_0x2f47=function(){return _0x4843ff;};return _0x2f47();}exports[_0x5b8be0(0x1bd)]=class extends c['Plugin']{constructor(_0x3963ce=D,_0x4d53f9,_0x41047f){const _0x5eefd8=_0x5b8be0;super(),this[_0x5eefd8(0x187)]=_0x3963ce,this['_injector']=_0x4d53f9,this[_0x5eefd8(0x1b1)]=_0x41047f;const {..._0x2c99b0}=c[_0x5eefd8(0x18a)]({},D,this['_config']);this[_0x5eefd8(0x1b1)]['setConfig'](q,_0x2c99b0);}[_0x5b8be0(0x199)](){[[g],[C],[p]]['forEach'](_0x4b72b9=>{const _0x2737d0=_0x53eb;this[_0x2737d0(0x1b6)][_0x2737d0(0x191)](_0x4b72b9);});}[_0x5b8be0(0x186)](){const _0x3944e4=_0x5b8be0;this[_0x3944e4(0x1b6)][_0x3944e4(0x197)](C),this['_injector'][_0x3944e4(0x197)](p);}},N(exports['UniverThreadCommentDataSourcePlugin'],_0x5b8be0(0x179),U),N(exports['UniverThreadCommentDataSourcePlugin'],'type',c['UniverInstanceType'][_0x5b8be0(0x195)]),exports[_0x5b8be0(0x1bd)]=W([c[_0x5b8be0(0x1c1)](j[_0x5b8be0(0x1aa)],b['UniverCollaborationClientPlugin'],T[_0x5b8be0(0x171)]),O(0x1,c[_0x5b8be0(0x190)](c['Injector'])),O(0x2,c['IConfigService'])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0x199a68=_0x162f;(function(_0x4deadf,_0x411b60){const _0x56c706=_0x162f,_0x2c862b=_0x4deadf();while(!![]){try{const _0x13bdc8=parseInt(_0x56c706(0x1dd))/0x1+parseInt(_0x56c706(0x223))/0x2*(-parseInt(_0x56c706(0x22b))/0x3)+-parseInt(_0x56c706(0x24d))/0x4*(parseInt(_0x56c706(0x1eb))/0x5)+-parseInt(_0x56c706(0x1e5))/0x6*(parseInt(_0x56c706(0x22c))/0x7)+parseInt(_0x56c706(0x235))/0x8+-parseInt(_0x56c706(0x1ec))/0x9*(parseInt(_0x56c706(0x230))/0xa)+-parseInt(_0x56c706(0x1f6))/0xb*(-parseInt(_0x56c706(0x207))/0xc);if(_0x13bdc8===_0x411b60)break;else _0x2c862b['push'](_0x2c862b['shift']());}catch(_0x1d4671){_0x2c862b['push'](_0x2c862b['shift']());}}}(_0x3037,0x862ce));Object[_0x199a68(0x237)](exports,Symbol[_0x199a68(0x249)],{'value':_0x199a68(0x205)});const b=require('@univerjs-pro/collaboration-client'),T=require(_0x199a68(0x21d)),c=require('@univerjs/core'),j=require(_0x199a68(0x218)),M=require(_0x199a68(0x1fe)),w=require(_0x199a68(0x1ed)),P=require('@univerjs/network'),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x38114a=>(_0x38114a[_0x38114a[_0x199a68(0x1f3)]=0x0]='OpenOrReOpen',_0x38114a[_0x38114a[_0x199a68(0x1df)]=0x1]='Solved',_0x38114a[_0x38114a[_0x199a68(0x1f5)]=-0x1]=_0x199a68(0x1f5),_0x38114a))(I||{}),v=(_0x4dabf0=>(_0x4dabf0[_0x4dabf0['Unknown']=0x0]=_0x199a68(0x24f),_0x4dabf0[_0x4dabf0[_0x199a68(0x214)]=0x1]=_0x199a68(0x214),_0x4dabf0[_0x4dabf0[_0x199a68(0x23a)]=0x2]='Reply',_0x4dabf0[_0x4dabf0[_0x199a68(0x204)]=0x3]=_0x199a68(0x204),_0x4dabf0[_0x4dabf0['Delete']=0x4]='Delete',_0x4dabf0[_0x4dabf0[_0x199a68(0x206)]=0x5]=_0x199a68(0x206),_0x4dabf0[_0x4dabf0['UNRECOGNIZED']=-0x1]=_0x199a68(0x1f5),_0x4dabf0))(v||{});const f=_0x9688c0=>c['dayjs'](new Date(+_0x9688c0))[_0x199a68(0x215)](_0x199a68(0x239)),R=async(_0x317340,_0x2ec7fb)=>{const _0x293118=_0x199a68,_0x2f1342=_0x317340[_0x293118(0x23e)](c[_0x293118(0x242)]),_0x29c11=_0x317340[_0x293118(0x23e)](P['HTTPService']);_0x2ec7fb['forEach'](_0x1ccee4=>{const _0xb8c34f=_0x293118;_0x2f1342['getUser'](_0x1ccee4)&&_0x2ec7fb[_0xb8c34f(0x212)](_0x1ccee4);}),_0x2ec7fb[_0x293118(0x21e)]&&(await _0x29c11[_0x293118(0x23e)](_0x293118(0x24a),{'params':{'userIDs':[..._0x2ec7fb]}}))[_0x293118(0x202)][_0x293118(0x1d7)][_0x293118(0x228)](_0x453bfa=>{const _0x1c31e5=_0x293118;_0x453bfa&&_0x2f1342[_0x1c31e5(0x1db)](_0x453bfa);});};var $=Object[_0x199a68(0x20f)],E=(_0x385992,_0x16f738,_0x35db3a,_0x232d8a)=>{for(var _0x271c27=_0x232d8a>0x1?void 0x0:_0x232d8a?$(_0x16f738,_0x35db3a):_0x16f738,_0x230db9=_0x385992['length']-0x1,_0x2482d5;_0x230db9>=0x0;_0x230db9--)(_0x2482d5=_0x385992[_0x230db9])&&(_0x271c27=_0x2482d5(_0x271c27)||_0x271c27);return _0x271c27;},S=(_0x3a621e,_0xc31fd7)=>(_0x2a3232,_0x1bd4a2)=>_0xc31fd7(_0x2a3232,_0x1bd4a2,_0x3a621e);let p=class extends c[_0x199a68(0x244)]{constructor(_0x57ae5a,_0x574758,_0x45a4f7,_0x6ee4a8){const _0x576c56=_0x199a68;super(),this['_commentService']=_0x57ae5a,this['_threadCommentModel']=_0x574758,this[_0x576c56(0x220)]=_0x45a4f7,this['_injector']=_0x6ee4a8,this[_0x576c56(0x225)](),this['_initUserSync']();}[_0x199a68(0x211)](){const _0x4a13e1=_0x199a68;this[_0x4a13e1(0x1e9)](this['_threadCommentModel']['commentUpdate$'][_0x4a13e1(0x210)](w[_0x4a13e1(0x1ef)](0x10))['subscribe'](_0x5d3cb2=>{const _0x57dd0f=_0x4a13e1,_0x417dc5=new Set();_0x5d3cb2[_0x57dd0f(0x228)](_0x2a9257=>{const _0x2433fc=_0x57dd0f;switch(_0x2a9257[_0x2433fc(0x1de)]){case _0x2433fc(0x1f8):{const _0x4598c8=_0x2a9257[_0x2433fc(0x1e4)][_0x2433fc(0x1dc)];_0x417dc5[_0x2433fc(0x1f8)](_0x4598c8);break;}}}),R(this[_0x57dd0f(0x22d)],_0x417dc5);}));}[_0x199a68(0x225)](){const _0x3762b0=_0x199a68;this['disposeWithMe'](this[_0x3762b0(0x221)]['commentUpdate$']['subscribe'](async _0xb192b4=>{const _0xbd7ddd=_0x3762b0;var _0x400397,_0x53f904,_0x2d6460,_0xff31a3;const _0x1fe9ac=(_0x400397=this[_0xbd7ddd(0x20b)][_0xbd7ddd(0x201)](_0xb192b4[_0xbd7ddd(0x24b)])[_0xbd7ddd(0x234)](_0x33f655=>_0x33f655['threadId']===_0xb192b4[_0xbd7ddd(0x1fa)]))==null?void 0x0:_0x400397['root'];if(!_0x1fe9ac)return;const {unitId:_0x2803d8,subUnitId:_0x2ad1a8}=_0x1fe9ac;switch(_0xb192b4[_0xbd7ddd(0x1da)]&&this[_0xbd7ddd(0x220)][_0xbd7ddd(0x1db)](_0xb192b4[_0xbd7ddd(0x1da)]),_0xb192b4[_0xbd7ddd(0x1de)]){case v[_0xbd7ddd(0x214)]:break;case v[_0xbd7ddd(0x23a)]:{this[_0xbd7ddd(0x20b)][_0xbd7ddd(0x1d9)](_0x2803d8,_0x2ad1a8,{'unitId':_0x2803d8,'subUnitId':_0x2ad1a8,'ref':'','id':_0xb192b4['replyId'],'dT':f(+_0xb192b4[_0xbd7ddd(0x247)]),'threadId':_0xb192b4[_0xbd7ddd(0x1fa)],'personId':(_0x2d6460=(_0x53f904=_0xb192b4[_0xbd7ddd(0x1da)])==null?void 0x0:_0x53f904['userID'])!=null?_0x2d6460:_0xb192b4[_0xbd7ddd(0x1f0)],'text':JSON[_0xbd7ddd(0x22f)](_0xb192b4[_0xbd7ddd(0x1e8)]),'parentId':_0x1fe9ac['id']});break;}case v[_0xbd7ddd(0x1ff)]:{const _0x15b90a=this[_0xbd7ddd(0x20b)][_0xbd7ddd(0x219)](_0x2803d8,_0x2ad1a8,_0xb192b4[_0xbd7ddd(0x1e3)]);_0x15b90a&&_0x15b90a[_0xbd7ddd(0x241)]&&this[_0xbd7ddd(0x20b)][_0xbd7ddd(0x21c)](_0x2803d8,_0x2ad1a8,_0xb192b4[_0xbd7ddd(0x1e3)]);break;}case v[_0xbd7ddd(0x204)]:{this['_threadCommentModel']['updateComment'](_0x2803d8,_0x2ad1a8,{'commentId':_0xb192b4[_0xbd7ddd(0x1e3)],'text':JSON[_0xbd7ddd(0x22f)](_0xb192b4[_0xbd7ddd(0x1e8)])});break;}case v[_0xbd7ddd(0x206)]:{const _0x23a306=(_0xff31a3=this[_0xbd7ddd(0x20b)][_0xbd7ddd(0x201)](_0xb192b4[_0xbd7ddd(0x24b)])['find'](_0x91b28d=>_0x91b28d[_0xbd7ddd(0x1fa)]===_0xb192b4[_0xbd7ddd(0x1fa)]))==null?void 0x0:_0xff31a3[_0xbd7ddd(0x20d)];_0x23a306&&this[_0xbd7ddd(0x20b)]['resolveComment'](_0x2803d8,_0x2ad1a8,_0x23a306['id'],_0xb192b4[_0xbd7ddd(0x216)]===I[_0xbd7ddd(0x1df)]);break;}}}));}};function _0x162f(_0x45271f,_0x38b8e8){const _0x30378e=_0x3037();return _0x162f=function(_0x162f0d,_0x1e2450){_0x162f0d=_0x162f0d-0x1d5;let _0x3b831d=_0x30378e[_0x162f0d];return _0x3b831d;},_0x162f(_0x45271f,_0x38b8e8);}p=E([S(0x0,c[_0x199a68(0x20c)](b['CommentService'])),S(0x1,c[_0x199a68(0x20c)](M[_0x199a68(0x231)])),S(0x2,c[_0x199a68(0x20c)](c[_0x199a68(0x242)])),S(0x3,c['Inject'](c['Injector']))],p);const q=_0x199a68(0x1e7),D={};var A=Object[_0x199a68(0x20f)],x=(_0xfc4044,_0x353194,_0x3ea2a7,_0x186996)=>{const _0x365c22=_0x199a68;for(var _0x66a31=_0x186996>0x1?void 0x0:_0x186996?A(_0x353194,_0x3ea2a7):_0x353194,_0x2747b1=_0xfc4044[_0x365c22(0x243)]-0x1,_0x2b4f54;_0x2747b1>=0x0;_0x2747b1--)(_0x2b4f54=_0xfc4044[_0x2747b1])&&(_0x66a31=_0x2b4f54(_0x66a31)||_0x66a31);return _0x66a31;},_=(_0x40c201,_0x431078)=>(_0x1ac641,_0x345d2b)=>_0x431078(_0x1ac641,_0x345d2b,_0x40c201);function Y(_0x141b1c,_0x5f4c4e){const _0x17bb06=_0x199a68,_0x52962d=_0x141b1c[_0x17bb06(0x24c)][0x0];return{..._0x5f4c4e,'id':_0x52962d[_0x17bb06(0x1e3)],'resolved':_0x141b1c[_0x17bb06(0x216)]===0x1,'dT':f(_0x52962d[_0x17bb06(0x247)]),'personId':_0x52962d[_0x17bb06(0x1f0)],'threadId':_0x52962d[_0x17bb06(0x1fa)]};}function G(_0x5de724,_0x53ed62,_0x4714c4){const _0x286c49=_0x199a68;var _0x193be4,_0x253530;if(((_0x253530=(_0x193be4=_0x5de724==null?void 0x0:_0x5de724[_0x286c49(0x24c)])==null?void 0x0:_0x193be4[_0x286c49(0x243)])!=null?_0x253530:0x0)>0x0){const _0x42b015=(_0xc127b6,_0x383f82)=>({'id':_0xc127b6[_0x286c49(0x1e3)],'threadId':_0xc127b6['threadId'],'dT':f(_0xc127b6[_0x286c49(0x247)]),'personId':_0xc127b6['userId'],'resolved':_0x5de724[_0x286c49(0x216)]===I[_0x286c49(0x1df)],'unitId':_0x53ed62,'subUnitId':_0x4714c4,'text':JSON[_0x286c49(0x22f)](_0xc127b6[_0x286c49(0x1e8)]),'parentId':_0x383f82}),_0x28f1cb=_0x42b015(_0x5de724['replies'][0x0]);return{..._0x28f1cb,'children':_0x5de724[_0x286c49(0x24c)][_0x286c49(0x21b)](0x1)['map'](_0x57bd9f=>_0x42b015(_0x57bd9f,_0x28f1cb['id']))};}return null;}let g=class{constructor(_0x369e6c,_0x2b56f4,_0x17f50b,_0x43e09c){const _0x490d41=_0x199a68;this[_0x490d41(0x1d5)]=_0x369e6c,this[_0x490d41(0x220)]=_0x2b56f4,this[_0x490d41(0x1f1)]=_0x17f50b,this[_0x490d41(0x22d)]=_0x43e09c;}async[_0x199a68(0x1d9)](_0x2a1aa7){const _0x55111e=_0x199a68;var _0x43092b,_0xa29dd6;const {parentId:_0x36a49d,unitId:_0x357f02,text:_0x59beb0,threadId:_0x531d5b}=_0x2a1aa7,_0xabdd05=(_0xa29dd6=(_0x43092b=_0x59beb0[_0x55111e(0x23f)])==null?void 0x0:_0x43092b[_0x55111e(0x22a)](_0x42f1ef=>_0x42f1ef['rangeType']===c[_0x55111e(0x23b)][_0x55111e(0x203)])[_0x55111e(0x217)](_0x324c68=>_0x324c68['rangeId']))!=null?_0xa29dd6:[],_0x15a199=JSON['stringify'](_0x59beb0),_0x230cf8=(await this[_0x55111e(0x1f1)][_0x55111e(0x1fb)](_0x357f02))['getMemberID']();if(_0x36a49d){const _0x33e860={'memberId':_0x230cf8,'unitId':_0x357f02,'content':_0x15a199,'mention':_0xabdd05,'threadId':_0x531d5b},_0x15b901=(await this[_0x55111e(0x1d5)][_0x55111e(0x208)]('/universer-api/comment/unit/'+_0x357f02+'/reply',{'body':_0x33e860}))[_0x55111e(0x202)]['reply'];return{..._0x2a1aa7,'id':_0x15b901[_0x55111e(0x1e3)],'dT':c['dayjs'](+_0x15b901[_0x55111e(0x247)])[_0x55111e(0x215)](_0x55111e(0x239)),'personId':_0x15b901[_0x55111e(0x1f0)]};}else{const _0x2b340c={'memberId':_0x230cf8,'unitId':_0x357f02,'content':_0x15a199,'mention':_0xabdd05},_0x49d1a7=await this['_httpService'][_0x55111e(0x208)](_0x55111e(0x23d)+_0x357f02+_0x55111e(0x21f),{'body':_0x2b340c});return Y(_0x49d1a7['body'][_0x55111e(0x238)],_0x2a1aa7);}}async[_0x199a68(0x1f7)](_0x4446b6){const _0x485ea6=_0x199a68;var _0x412044,_0x399877;const {text:_0x27cfa2,unitId:_0x5b3f56}=_0x4446b6,_0x26ce39=(_0x399877=(_0x412044=_0x27cfa2[_0x485ea6(0x23f)])==null?void 0x0:_0x412044['filter'](_0x225a7e=>_0x225a7e[_0x485ea6(0x21a)]===c[_0x485ea6(0x23b)][_0x485ea6(0x203)])[_0x485ea6(0x217)](_0x4dd8ab=>_0x4dd8ab[_0x485ea6(0x248)]))!=null?_0x399877:[],_0xf62382=JSON['stringify'](_0x27cfa2),_0x2d5019=_0x4446b6['threadId'],_0x1d433b=_0x4446b6['id'],_0x6a64c1={'memberId':(await this[_0x485ea6(0x1f1)]['requireSession'](_0x5b3f56))[_0x485ea6(0x1d6)](),'unitId':_0x5b3f56,'threadId':_0x2d5019,'mention':_0x26ce39,'content':_0xf62382,'replyId':_0x1d433b},_0x295b6b=await this['_httpService'][_0x485ea6(0x208)](_0x485ea6(0x23d)+_0x5b3f56+_0x485ea6(0x229),{'body':_0x6a64c1});return!_0x295b6b[_0x485ea6(0x202)][_0x485ea6(0x200)]||_0x295b6b[_0x485ea6(0x202)][_0x485ea6(0x200)][_0x485ea6(0x1ea)]===0x1;}async[_0x199a68(0x224)](_0x4db5f8){const _0x195958=_0x199a68,{unitId:_0x20093a}=_0x4db5f8,_0x240038=_0x4db5f8[_0x195958(0x1fa)],_0x362d05={'memberId':this[_0x195958(0x220)][_0x195958(0x232)]()['userID'],'unitId':_0x20093a,'threadId':_0x240038,'solved':_0x4db5f8[_0x195958(0x233)]?I[_0x195958(0x1df)]:I[_0x195958(0x1f3)]},_0x29cac0=await this[_0x195958(0x1d5)][_0x195958(0x208)](_0x195958(0x23d)+_0x20093a+_0x195958(0x20e),{'body':_0x362d05});return!_0x29cac0[_0x195958(0x202)][_0x195958(0x200)]||_0x29cac0[_0x195958(0x202)][_0x195958(0x200)]['code']===0x1;}async[_0x199a68(0x21c)](_0x1823ab,_0x26d5b9,_0x2f1c5f,_0x172fdd){const _0x149c93=_0x199a68,_0x8482c3={'memberId':(await this['_sessionService'][_0x149c93(0x1fb)](_0x1823ab))[_0x149c93(0x1d6)](),'threadId':_0x2f1c5f,'replyId':_0x172fdd,'unitId':_0x1823ab},_0x54a4cf=await this[_0x149c93(0x1d5)][_0x149c93(0x208)]('/universer-api/comment/unit/'+_0x1823ab+_0x149c93(0x1fd),{'body':_0x8482c3});return!_0x54a4cf[_0x149c93(0x202)][_0x149c93(0x200)]||_0x54a4cf[_0x149c93(0x202)][_0x149c93(0x200)][_0x149c93(0x1ea)]===0x1;}async[_0x199a68(0x1e6)](_0x19eb17,_0x56137b,_0x2022ef){const _0x38753a=_0x199a68,_0xaef30={'unitId':_0x19eb17,'threadId':_0x2022ef},_0x1f3eca=await this[_0x38753a(0x1d5)][_0x38753a(0x208)](_0x38753a(0x23d)+_0x19eb17+'/list',{'body':_0xaef30}),_0x1666ee=_0x2022ef['map'](_0x23b4f3=>G(_0x1f3eca[_0x38753a(0x202)][_0x38753a(0x226)][_0x23b4f3],_0x19eb17,_0x56137b))['filter'](Boolean);return Object[_0x38753a(0x1f9)](_0x1f3eca[_0x38753a(0x202)][_0x38753a(0x1d7)])[_0x38753a(0x228)](_0x4bc4b4=>{const _0xd9ad2c=_0x38753a;this[_0xd9ad2c(0x220)][_0xd9ad2c(0x1db)](_0x4bc4b4);}),_0x1666ee;}[_0x199a68(0x222)](_0x1b149f){const _0xb8a5f0=_0x199a68;return{'id':_0x1b149f['id'],'threadId':_0x1b149f['threadId'],'ref':_0x1b149f[_0xb8a5f0(0x213)]};}};g=x([_(0x0,c['Inject'](P[_0x199a68(0x246)])),_(0x1,c[_0x199a68(0x20c)](c[_0x199a68(0x242)])),_(0x2,c[_0x199a68(0x20c)](b['CollaborationSessionService'])),_(0x3,c[_0x199a68(0x20c)](c['Injector']))],g);var H=Object['getOwnPropertyDescriptor'],J=(_0x492512,_0x40d0a2,_0x4afc10,_0x5518f4)=>{const _0x327e00=_0x199a68;for(var _0x7b0044=_0x5518f4>0x1?void 0x0:_0x5518f4?H(_0x40d0a2,_0x4afc10):_0x40d0a2,_0x3740aa=_0x492512[_0x327e00(0x243)]-0x1,_0x556ab8;_0x3740aa>=0x0;_0x3740aa--)(_0x556ab8=_0x492512[_0x3740aa])&&(_0x7b0044=_0x556ab8(_0x7b0044)||_0x7b0044);return _0x7b0044;},y=(_0x484312,_0x474330)=>(_0x5d2f5d,_0x3df9e3)=>_0x474330(_0x5d2f5d,_0x3df9e3,_0x484312);let C=class extends c[_0x199a68(0x244)]{constructor(_0x388a6d,_0x5bdcf4){const _0x366666=_0x199a68;super(),this[_0x366666(0x1f4)]=_0x388a6d,this[_0x366666(0x1e0)]=_0x5bdcf4,this[_0x366666(0x1e2)]();}['_initDataSource'](){const _0x745df9=_0x199a68;this[_0x745df9(0x1f4)][_0x745df9(0x209)]=this[_0x745df9(0x1e0)],this[_0x745df9(0x1f4)][_0x745df9(0x1ee)]=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c[_0x199a68(0x20c)](g))],C);var F=Object[_0x199a68(0x237)],L=Object[_0x199a68(0x20f)],Z=(_0x560dc6,_0x22e096,_0x2f2a19)=>_0x22e096 in _0x560dc6?F(_0x560dc6,_0x22e096,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2f2a19}):_0x560dc6[_0x22e096]=_0x2f2a19,W=(_0x50cbd1,_0x12de9e,_0x54290b,_0x15ae4a)=>{const _0x186b58=_0x199a68;for(var _0x330e50=_0x15ae4a>0x1?void 0x0:_0x15ae4a?L(_0x12de9e,_0x54290b):_0x12de9e,_0x5aa541=_0x50cbd1[_0x186b58(0x243)]-0x1,_0x3b7c30;_0x5aa541>=0x0;_0x5aa541--)(_0x3b7c30=_0x50cbd1[_0x5aa541])&&(_0x330e50=_0x3b7c30(_0x330e50)||_0x330e50);return _0x330e50;},O=(_0x9e0d2a,_0x43e5d3)=>(_0x5ed6ba,_0x2c9964)=>_0x43e5d3(_0x5ed6ba,_0x2c9964,_0x9e0d2a),N=(_0x3d9fb4,_0x532835,_0x4b9022)=>Z(_0x3d9fb4,typeof _0x532835!=_0x199a68(0x1fc)?_0x532835+'':_0x532835,_0x4b9022);function _0x3037(){const _0x2e707d=['UNIVER_UNKNOWN','HTTPService','createTimestamp','rangeId','toStringTag','/universer-api/user/list','unitId','replies','4EIvqEZ','_configService','Unknown','_httpService','getMemberID','users','UniverInstanceType','addComment','user','addUser','personId','827389FRxNEc','type','Solved','_threadCommentDataSource','_config','_initDataSource','replyId','payload','175614dFfZBY','listComments','thread-comment-data-source.config','content','disposeWithMe','code','591235tXiAPY','3717NxKlIX','rxjs','syncUpdateMutationToColla','bufferTime','userId','_sessionService','pluginName','OpenOrReOpen','_threadCommentDataSourceService','UNRECOGNIZED','22aHlVbD','updateComment','add','values','threadId','requireSession','symbol','/delete','@univerjs/thread-comment','Delete','error','getUnit','body','COMMENT','Edit','Module','Solve','1125924OcMqPZ','post','dataSource','UniverThreadCommentDataSourcePlugin','_threadCommentModel','Inject','root','/solved','getOwnPropertyDescriptor','pipe','_initUserSync','delete','ref','Add','format','solved','map','@univerjs/thread-comment-ui','getComment','rangeType','slice','deleteComment','@univerjs-pro/license','size','/add','_userService','_commentService','saveCommentToSnapshot','343692fOGWuk','resolveComment','_init','comments','Injector','forEach','/edit','filter','6OHBkEN','224kqvyIG','_injector','UniverLicensePlugin','parse','70asDXVR','ThreadCommentModel','getCurrentUser','resolved','find','7487816iqfExW','onStarting','defineProperty','comment','YYYY/MM/DD\x20HH:mm','Reply','CustomRangeType','UniverCollaborationClientPlugin','/universer-api/comment/unit/','get','customRanges','UniverThreadCommentUIPlugin','parentId','UserManagerService','length','Disposable'];_0x3037=function(){return _0x2e707d;};return _0x3037();}exports[_0x199a68(0x20a)]=class extends c['Plugin']{constructor(_0x828df0=D,_0xe7708b,_0x3fc30e){const _0x279c17=_0x199a68;super(),this[_0x279c17(0x1e1)]=_0x828df0,this[_0x279c17(0x22d)]=_0xe7708b,this[_0x279c17(0x24e)]=_0x3fc30e;const {..._0xbf41e6}=c['merge']({},D,this[_0x279c17(0x1e1)]);this[_0x279c17(0x24e)]['setConfig'](q,_0xbf41e6);}[_0x199a68(0x236)](){const _0x262e2e=_0x199a68;[[g],[C],[p]][_0x262e2e(0x228)](_0x117fe7=>{const _0x3d8d18=_0x262e2e;this[_0x3d8d18(0x22d)][_0x3d8d18(0x1f8)](_0x117fe7);});}['onReady'](){const _0x4d4c0e=_0x199a68;this[_0x4d4c0e(0x22d)]['get'](C),this[_0x4d4c0e(0x22d)][_0x4d4c0e(0x23e)](p);}},N(exports[_0x199a68(0x20a)],_0x199a68(0x1f2),U),N(exports[_0x199a68(0x20a)],'type',c[_0x199a68(0x1d8)][_0x199a68(0x245)]),exports[_0x199a68(0x20a)]=W([c['DependentOn'](j[_0x199a68(0x240)],b[_0x199a68(0x23c)],T[_0x199a68(0x22e)]),O(0x1,c['Inject'](c[_0x199a68(0x227)])),O(0x2,c['IConfigService'])],exports[_0x199a68(0x20a)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x34e488=_0x3aa5;(function(_0x33fecd,_0x2e45b5){const _0x303841=_0x3aa5,_0x52e784=_0x33fecd();while(!![]){try{const _0x829f21=parseInt(_0x303841(0x130))/0x1+parseInt(_0x303841(0x12f))/0x2+parseInt(_0x303841(0x144))/0x3+parseInt(_0x303841(0x181))/0x4+parseInt(_0x303841(0x18c))/0x5*(-parseInt(_0x303841(0x17a))/0x6)+parseInt(_0x303841(0x18e))/0x7+-parseInt(_0x303841(0x191))/0x8;if(_0x829f21===_0x2e45b5)break;else _0x52e784['push'](_0x52e784['shift']());}catch(_0x3ca254){_0x52e784['push'](_0x52e784['shift']());}}}(_0x2925,0x70bd3));import{CommentService as _0x59ab64,CollaborationSessionService as _0x37f0f4,UniverCollaborationClientPlugin as _0x277765}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x2da112}from'@univerjs-pro/license';import{dayjs as _0x367bed,UserManagerService as _0x664345,Inject as _0xd5f9d0,Injector as _0x2d4464,Disposable as _0x3dd461,CustomRangeType as _0x470008,UniverInstanceType as _0x4696f1,DependentOn as _0x5a2a51,IConfigService as _0x1f95aa,Plugin as _0x1f00a0,merge as _0x56c2c4}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x356c5c}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x4185b1,IThreadCommentDataSourceService as _0xb77fdc}from'@univerjs/thread-comment';import{bufferTime as _0x333df3}from'rxjs';import{HTTPService as _0x49b0ea}from'@univerjs/network';const W=_0x34e488(0x132);var I=(_0x16e43d=>(_0x16e43d[_0x16e43d[_0x34e488(0x135)]=0x0]=_0x34e488(0x135),_0x16e43d[_0x16e43d['Solved']=0x1]=_0x34e488(0x14a),_0x16e43d[_0x16e43d['UNRECOGNIZED']=-0x1]=_0x34e488(0x142),_0x16e43d))(I||{}),v=(_0x21d717=>(_0x21d717[_0x21d717[_0x34e488(0x17c)]=0x0]=_0x34e488(0x17c),_0x21d717[_0x21d717[_0x34e488(0x165)]=0x1]='Add',_0x21d717[_0x21d717[_0x34e488(0x134)]=0x2]=_0x34e488(0x134),_0x21d717[_0x21d717[_0x34e488(0x16f)]=0x3]=_0x34e488(0x16f),_0x21d717[_0x21d717[_0x34e488(0x173)]=0x4]=_0x34e488(0x173),_0x21d717[_0x21d717[_0x34e488(0x148)]=0x5]=_0x34e488(0x148),_0x21d717[_0x21d717[_0x34e488(0x142)]=-0x1]=_0x34e488(0x142),_0x21d717))(v||{});const D=_0xc34e48=>_0x367bed(new Date(+_0xc34e48))[_0x34e488(0x17d)](_0x34e488(0x154)),B=async(_0x50b459,_0xfcb132)=>{const _0x148b59=_0x34e488,_0x1f0c0c=_0x50b459[_0x148b59(0x159)](_0x664345),_0x1f0e0d=_0x50b459[_0x148b59(0x159)](_0x49b0ea);_0xfcb132[_0x148b59(0x15e)](_0x2cfd9b=>{const _0x3f46cd=_0x148b59;_0x1f0c0c[_0x3f46cd(0x161)](_0x2cfd9b)&&_0xfcb132[_0x3f46cd(0x13f)](_0x2cfd9b);}),_0xfcb132[_0x148b59(0x16b)]&&(await _0x1f0e0d['get'](_0x148b59(0x16c),{'params':{'userIDs':[..._0xfcb132]}}))[_0x148b59(0x15a)][_0x148b59(0x177)][_0x148b59(0x15e)](_0x1bf00c=>{const _0x310636=_0x148b59;_0x1bf00c&&_0x1f0c0c[_0x310636(0x168)](_0x1bf00c);});};function _0x3aa5(_0x5f24ed,_0x3a167c){const _0x292595=_0x2925();return _0x3aa5=function(_0x3aa523,_0x467808){_0x3aa523=_0x3aa523-0x12e;let _0x57a9ed=_0x292595[_0x3aa523];return _0x57a9ed;},_0x3aa5(_0x5f24ed,_0x3a167c);}var K=Object[_0x34e488(0x145)],V=(_0x31f251,_0x33f052,_0xce0cfc,_0x289412)=>{for(var _0x38b403=_0x289412>0x1?void 0x0:_0x289412?K(_0x33f052,_0xce0cfc):_0x33f052,_0x4e3eb1=_0x31f251['length']-0x1,_0x40550f;_0x4e3eb1>=0x0;_0x4e3eb1--)(_0x40550f=_0x31f251[_0x4e3eb1])&&(_0x38b403=_0x40550f(_0x38b403)||_0x38b403);return _0x38b403;},p=(_0x3fa4f9,_0x3daad8)=>(_0x1f04ad,_0x3f27d5)=>_0x3daad8(_0x1f04ad,_0x3f27d5,_0x3fa4f9);let S=class extends _0x3dd461{constructor(_0x259d7e,_0x151298,_0x5742a3,_0x44d398){const _0x27e5f0=_0x34e488;super(),this[_0x27e5f0(0x153)]=_0x259d7e,this[_0x27e5f0(0x18a)]=_0x151298,this[_0x27e5f0(0x12e)]=_0x5742a3,this[_0x27e5f0(0x17e)]=_0x44d398,this['_init'](),this[_0x27e5f0(0x13c)]();}[_0x34e488(0x13c)](){const _0x213c40=_0x34e488;this[_0x213c40(0x14d)](this[_0x213c40(0x18a)]['commentUpdate$'][_0x213c40(0x169)](_0x333df3(0x10))[_0x213c40(0x163)](_0x4d338a=>{const _0x504189=new Set();_0x4d338a['forEach'](_0x158a90=>{const _0x33918f=_0x3aa5;switch(_0x158a90[_0x33918f(0x18b)]){case _0x33918f(0x188):{const _0x2bb9fb=_0x158a90[_0x33918f(0x17b)][_0x33918f(0x155)];_0x504189[_0x33918f(0x188)](_0x2bb9fb);break;}}}),B(this['_injector'],_0x504189);}));}[_0x34e488(0x131)](){const _0xa23e37=_0x34e488;this[_0xa23e37(0x14d)](this[_0xa23e37(0x153)]['commentUpdate$'][_0xa23e37(0x163)](async _0x387b20=>{const _0x18098d=_0xa23e37;var _0x4a5972,_0x2449ff,_0x43ad64,_0x34b9ef;const _0x251c7b=(_0x4a5972=this['_threadCommentModel']['getUnit'](_0x387b20[_0x18098d(0x185)])[_0x18098d(0x171)](_0x896926=>_0x896926[_0x18098d(0x16d)]===_0x387b20[_0x18098d(0x16d)]))==null?void 0x0:_0x4a5972['root'];if(!_0x251c7b)return;const {unitId:_0x1521c6,subUnitId:_0xe273bc}=_0x251c7b;switch(_0x387b20[_0x18098d(0x138)]&&this[_0x18098d(0x12e)][_0x18098d(0x168)](_0x387b20[_0x18098d(0x138)]),_0x387b20[_0x18098d(0x18b)]){case v['Add']:break;case v[_0x18098d(0x134)]:{this[_0x18098d(0x18a)][_0x18098d(0x17f)](_0x1521c6,_0xe273bc,{'unitId':_0x1521c6,'subUnitId':_0xe273bc,'ref':'','id':_0x387b20[_0x18098d(0x184)],'dT':D(+_0x387b20[_0x18098d(0x166)]),'threadId':_0x387b20[_0x18098d(0x16d)],'personId':(_0x43ad64=(_0x2449ff=_0x387b20[_0x18098d(0x138)])==null?void 0x0:_0x2449ff[_0x18098d(0x172)])!=null?_0x43ad64:_0x387b20[_0x18098d(0x149)],'text':JSON['parse'](_0x387b20[_0x18098d(0x182)]),'parentId':_0x251c7b['id']});break;}case v['Delete']:{const _0x382a88=this[_0x18098d(0x18a)]['getComment'](_0x1521c6,_0xe273bc,_0x387b20[_0x18098d(0x184)]);_0x382a88&&_0x382a88[_0x18098d(0x178)]&&this[_0x18098d(0x18a)][_0x18098d(0x15d)](_0x1521c6,_0xe273bc,_0x387b20[_0x18098d(0x184)]);break;}case v['Edit']:{this[_0x18098d(0x18a)][_0x18098d(0x141)](_0x1521c6,_0xe273bc,{'commentId':_0x387b20[_0x18098d(0x184)],'text':JSON['parse'](_0x387b20[_0x18098d(0x182)])});break;}case v['Solve']:{const _0x1cd6d5=(_0x34b9ef=this['_threadCommentModel'][_0x18098d(0x174)](_0x387b20['unitId'])['find'](_0x4771e6=>_0x4771e6['threadId']===_0x387b20[_0x18098d(0x16d)]))==null?void 0x0:_0x34b9ef[_0x18098d(0x13d)];_0x1cd6d5&&this['_threadCommentModel'][_0x18098d(0x151)](_0x1521c6,_0xe273bc,_0x1cd6d5['id'],_0x387b20[_0x18098d(0x16a)]===I[_0x18098d(0x14a)]);break;}}}));}};S=V([p(0x0,_0xd5f9d0(_0x59ab64)),p(0x1,_0xd5f9d0(_0x4185b1)),p(0x2,_0xd5f9d0(_0x664345)),p(0x3,_0xd5f9d0(_0x2d4464))],S);const z='thread-comment-data-source.config',M={};var k=Object[_0x34e488(0x145)],Q=(_0x2595c2,_0x1ff1c1,_0x1f071e,_0x3871a6)=>{for(var _0x3a7899=_0x3871a6>0x1?void 0x0:_0x3871a6?k(_0x1ff1c1,_0x1f071e):_0x1ff1c1,_0x1a9ff6=_0x2595c2['length']-0x1,_0x5306c2;_0x1a9ff6>=0x0;_0x1a9ff6--)(_0x5306c2=_0x2595c2[_0x1a9ff6])&&(_0x3a7899=_0x5306c2(_0x3a7899)||_0x3a7899);return _0x3a7899;},_=(_0x544a61,_0x24731e)=>(_0x57ccee,_0x1d2f9d)=>_0x24731e(_0x57ccee,_0x1d2f9d,_0x544a61);function X(_0x907268,_0x27c071){const _0x220c53=_0x34e488,_0x5059c5=_0x907268[_0x220c53(0x13e)][0x0];return{..._0x27c071,'id':_0x5059c5[_0x220c53(0x184)],'resolved':_0x907268['solved']===0x1,'dT':D(_0x5059c5['createTimestamp']),'personId':_0x5059c5[_0x220c53(0x149)],'threadId':_0x5059c5['threadId']};}function ee(_0x5a079f,_0x2530aa,_0x2678cc){const _0x49b08a=_0x34e488;var _0x1e7a91,_0x28d4fb;if(((_0x28d4fb=(_0x1e7a91=_0x5a079f==null?void 0x0:_0x5a079f['replies'])==null?void 0x0:_0x1e7a91[_0x49b08a(0x158)])!=null?_0x28d4fb:0x0)>0x0){const _0x40a549=(_0x739913,_0x47c418)=>({'id':_0x739913[_0x49b08a(0x184)],'threadId':_0x739913[_0x49b08a(0x16d)],'dT':D(_0x739913[_0x49b08a(0x166)]),'personId':_0x739913[_0x49b08a(0x149)],'resolved':_0x5a079f[_0x49b08a(0x16a)]===I[_0x49b08a(0x14a)],'unitId':_0x2530aa,'subUnitId':_0x2678cc,'text':JSON['parse'](_0x739913[_0x49b08a(0x182)]),'parentId':_0x47c418}),_0x1c1f05=_0x40a549(_0x5a079f['replies'][0x0]);return{..._0x1c1f05,'children':_0x5a079f[_0x49b08a(0x13e)][_0x49b08a(0x146)](0x1)[_0x49b08a(0x15f)](_0x1137a3=>_0x40a549(_0x1137a3,_0x1c1f05['id']))};}return null;}function _0x2925(){const _0x5b7e00=['/universer-api/comment/unit/','add','values','_threadCommentModel','type','1660sENJRx','pluginName','4908330rfLXNs','COMMENT','customRanges','9117504dCFXYe','_userService','159422XGJmqg','264697dpbWfd','_init','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','rangeId','Reply','OpenOrReOpen','requireSession','error','user','getMemberID','/reply','_config','_initUserSync','root','replies','delete','comment','updateComment','UNRECOGNIZED','_threadCommentDataSourceService','1266903lASbSr','getOwnPropertyDescriptor','slice','syncUpdateMutationToColla','Solve','userId','Solved','_threadCommentDataSource','/list','disposeWithMe','onStarting','_sessionService','post','resolveComment','symbol','_commentService','YYYY/MM/DD\x20HH:mm','personId','comments','_configService','length','get','body','filter','UNIVER_UNKNOWN','deleteComment','forEach','map','rangeType','getUser','reply','subscribe','setConfig','Add','createTimestamp','ref','addUser','pipe','solved','size','/universer-api/user/list','threadId','onReady','Edit','_initDataSource','find','userID','Delete','getUnit','saveCommentToSnapshot','/add','users','parentId','defineProperty','2202HRwRdW','payload','Unknown','format','_injector','addComment','code','1021648ZKlZue','content','_httpService','replyId','unitId','stringify'];_0x2925=function(){return _0x5b7e00;};return _0x2925();}let f=class{constructor(_0x743ff,_0xfa02c6,_0x45f08b,_0x4ef589){const _0x5dba35=_0x34e488;this[_0x5dba35(0x183)]=_0x743ff,this[_0x5dba35(0x12e)]=_0xfa02c6,this[_0x5dba35(0x14f)]=_0x45f08b,this[_0x5dba35(0x17e)]=_0x4ef589;}async[_0x34e488(0x17f)](_0x9b45de){const _0x18279e=_0x34e488;var _0x47664e,_0x5bc565;const {parentId:_0xd6ec3b,unitId:_0xe2e8f6,text:_0x481b48,threadId:_0x1bc262}=_0x9b45de,_0xfe0541=(_0x5bc565=(_0x47664e=_0x481b48[_0x18279e(0x190)])==null?void 0x0:_0x47664e[_0x18279e(0x15b)](_0x54bedf=>_0x54bedf[_0x18279e(0x160)]===_0x470008[_0x18279e(0x18f)])[_0x18279e(0x15f)](_0x40bc74=>_0x40bc74[_0x18279e(0x133)]))!=null?_0x5bc565:[],_0x146057=JSON[_0x18279e(0x186)](_0x481b48),_0x3216b5=(await this[_0x18279e(0x14f)][_0x18279e(0x136)](_0xe2e8f6))[_0x18279e(0x139)]();if(_0xd6ec3b){const _0x2b5666={'memberId':_0x3216b5,'unitId':_0xe2e8f6,'content':_0x146057,'mention':_0xfe0541,'threadId':_0x1bc262},_0x25130b=(await this[_0x18279e(0x183)]['post']('/universer-api/comment/unit/'+_0xe2e8f6+_0x18279e(0x13a),{'body':_0x2b5666}))[_0x18279e(0x15a)][_0x18279e(0x162)];return{..._0x9b45de,'id':_0x25130b[_0x18279e(0x184)],'dT':_0x367bed(+_0x25130b[_0x18279e(0x166)])[_0x18279e(0x17d)](_0x18279e(0x154)),'personId':_0x25130b['userId']};}else{const _0x17c87a={'memberId':_0x3216b5,'unitId':_0xe2e8f6,'content':_0x146057,'mention':_0xfe0541},_0x10d82f=await this[_0x18279e(0x183)]['post'](_0x18279e(0x187)+_0xe2e8f6+_0x18279e(0x176),{'body':_0x17c87a});return X(_0x10d82f[_0x18279e(0x15a)][_0x18279e(0x140)],_0x9b45de);}}async[_0x34e488(0x141)](_0x5bcbf0){const _0x388a25=_0x34e488;var _0x52691a,_0x16b855;const {text:_0x59d559,unitId:_0x3223e0}=_0x5bcbf0,_0x183f10=(_0x16b855=(_0x52691a=_0x59d559[_0x388a25(0x190)])==null?void 0x0:_0x52691a['filter'](_0x441cd8=>_0x441cd8[_0x388a25(0x160)]===_0x470008[_0x388a25(0x18f)])[_0x388a25(0x15f)](_0x50c1d6=>_0x50c1d6[_0x388a25(0x133)]))!=null?_0x16b855:[],_0x35812d=JSON[_0x388a25(0x186)](_0x59d559),_0x2572d0=_0x5bcbf0[_0x388a25(0x16d)],_0x57ed19=_0x5bcbf0['id'],_0x16b646={'memberId':(await this[_0x388a25(0x14f)][_0x388a25(0x136)](_0x3223e0))['getMemberID'](),'unitId':_0x3223e0,'threadId':_0x2572d0,'mention':_0x183f10,'content':_0x35812d,'replyId':_0x57ed19},_0x11a720=await this['_httpService']['post'](_0x388a25(0x187)+_0x3223e0+'/edit',{'body':_0x16b646});return!_0x11a720[_0x388a25(0x15a)][_0x388a25(0x137)]||_0x11a720[_0x388a25(0x15a)][_0x388a25(0x137)][_0x388a25(0x180)]===0x1;}async['resolveComment'](_0x205a58){const _0x2e432c=_0x34e488,{unitId:_0x359741}=_0x205a58,_0x5024c7=_0x205a58[_0x2e432c(0x16d)],_0x1916f9={'memberId':this['_userService']['getCurrentUser']()[_0x2e432c(0x172)],'unitId':_0x359741,'threadId':_0x5024c7,'solved':_0x205a58['resolved']?I[_0x2e432c(0x14a)]:I[_0x2e432c(0x135)]},_0x575fcf=await this[_0x2e432c(0x183)][_0x2e432c(0x150)]('/universer-api/comment/unit/'+_0x359741+'/solved',{'body':_0x1916f9});return!_0x575fcf[_0x2e432c(0x15a)][_0x2e432c(0x137)]||_0x575fcf[_0x2e432c(0x15a)][_0x2e432c(0x137)][_0x2e432c(0x180)]===0x1;}async[_0x34e488(0x15d)](_0x3c82f0,_0x3d22a1,_0x3769c6,_0x3a9d8d){const _0x1fcc07=_0x34e488,_0x1f22c8={'memberId':(await this[_0x1fcc07(0x14f)][_0x1fcc07(0x136)](_0x3c82f0))['getMemberID'](),'threadId':_0x3769c6,'replyId':_0x3a9d8d,'unitId':_0x3c82f0},_0x5f8ab6=await this[_0x1fcc07(0x183)][_0x1fcc07(0x150)](_0x1fcc07(0x187)+_0x3c82f0+'/delete',{'body':_0x1f22c8});return!_0x5f8ab6[_0x1fcc07(0x15a)][_0x1fcc07(0x137)]||_0x5f8ab6['body'][_0x1fcc07(0x137)][_0x1fcc07(0x180)]===0x1;}async['listComments'](_0x3e4c8b,_0x66ed76,_0x5518ad){const _0x3a33ed=_0x34e488,_0x3a8e30={'unitId':_0x3e4c8b,'threadId':_0x5518ad},_0x317837=await this[_0x3a33ed(0x183)]['post'](_0x3a33ed(0x187)+_0x3e4c8b+_0x3a33ed(0x14c),{'body':_0x3a8e30}),_0x3b3225=_0x5518ad['map'](_0x4477cc=>ee(_0x317837[_0x3a33ed(0x15a)][_0x3a33ed(0x156)][_0x4477cc],_0x3e4c8b,_0x66ed76))[_0x3a33ed(0x15b)](Boolean);return Object[_0x3a33ed(0x189)](_0x317837[_0x3a33ed(0x15a)][_0x3a33ed(0x177)])[_0x3a33ed(0x15e)](_0x5dde65=>{const _0x4d6e9f=_0x3a33ed;this['_userService'][_0x4d6e9f(0x168)](_0x5dde65);}),_0x3b3225;}[_0x34e488(0x175)](_0x30d061){const _0x30e3b7=_0x34e488;return{'id':_0x30d061['id'],'threadId':_0x30d061['threadId'],'ref':_0x30d061[_0x30e3b7(0x167)]};}};f=Q([_(0x0,_0xd5f9d0(_0x49b0ea)),_(0x1,_0xd5f9d0(_0x664345)),_(0x2,_0xd5f9d0(_0x37f0f4)),_(0x3,_0xd5f9d0(_0x2d4464))],f);var re=Object[_0x34e488(0x145)],te=(_0x19994f,_0x5d31fb,_0x419a32,_0x37c609)=>{const _0x28d3c5=_0x34e488;for(var _0x4cd1ec=_0x37c609>0x1?void 0x0:_0x37c609?re(_0x5d31fb,_0x419a32):_0x5d31fb,_0x301990=_0x19994f[_0x28d3c5(0x158)]-0x1,_0x2c36f4;_0x301990>=0x0;_0x301990--)(_0x2c36f4=_0x19994f[_0x301990])&&(_0x4cd1ec=_0x2c36f4(_0x4cd1ec)||_0x4cd1ec);return _0x4cd1ec;},N=(_0x2e61d0,_0x120cd7)=>(_0x130ddb,_0x44e31d)=>_0x120cd7(_0x130ddb,_0x44e31d,_0x2e61d0);let g=class extends _0x3dd461{constructor(_0x891967,_0x25c90c){const _0x10fcf7=_0x34e488;super(),this[_0x10fcf7(0x143)]=_0x891967,this[_0x10fcf7(0x14b)]=_0x25c90c,this[_0x10fcf7(0x170)]();}[_0x34e488(0x170)](){const _0x103591=_0x34e488;this[_0x103591(0x143)]['dataSource']=this[_0x103591(0x14b)],this[_0x103591(0x143)][_0x103591(0x147)]=!0x1;}};g=te([N(0x0,_0xb77fdc),N(0x1,_0xd5f9d0(f))],g);var se=Object[_0x34e488(0x179)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x5aa43f,_0x337e54,_0xfb0735)=>_0x337e54 in _0x5aa43f?se(_0x5aa43f,_0x337e54,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xfb0735}):_0x5aa43f[_0x337e54]=_0xfb0735,ie=(_0x25a159,_0x482b99,_0x2de102,_0x394b70)=>{const _0x1db801=_0x34e488;for(var _0x1b3d70=_0x394b70>0x1?void 0x0:_0x394b70?oe(_0x482b99,_0x2de102):_0x482b99,_0x5f3e90=_0x25a159[_0x1db801(0x158)]-0x1,_0x151ab2;_0x5f3e90>=0x0;_0x5f3e90--)(_0x151ab2=_0x25a159[_0x5f3e90])&&(_0x1b3d70=_0x151ab2(_0x1b3d70)||_0x1b3d70);return _0x1b3d70;},w=(_0x2151fd,_0x430dc5)=>(_0x19d201,_0x271c20)=>_0x430dc5(_0x19d201,_0x271c20,_0x2151fd),$=(_0x1d4e1,_0xb24d82,_0x4654ca)=>ne(_0x1d4e1,typeof _0xb24d82!=_0x34e488(0x152)?_0xb24d82+'':_0xb24d82,_0x4654ca);let b=class extends _0x1f00a0{constructor(_0x245136=M,_0x445dda,_0x5d66ba){const _0x4b065b=_0x34e488;super(),this[_0x4b065b(0x13b)]=_0x245136,this[_0x4b065b(0x17e)]=_0x445dda,this[_0x4b065b(0x157)]=_0x5d66ba;const {..._0x97e53a}=_0x56c2c4({},M,this['_config']);this[_0x4b065b(0x157)][_0x4b065b(0x164)](z,_0x97e53a);}[_0x34e488(0x14e)](){const _0x261449=_0x34e488;[[f],[g],[S]][_0x261449(0x15e)](_0x1d5705=>{const _0x460546=_0x261449;this[_0x460546(0x17e)][_0x460546(0x188)](_0x1d5705);});}[_0x34e488(0x16e)](){const _0x45634d=_0x34e488;this[_0x45634d(0x17e)][_0x45634d(0x159)](g),this[_0x45634d(0x17e)][_0x45634d(0x159)](S);}};$(b,_0x34e488(0x18d),W),$(b,_0x34e488(0x18b),_0x4696f1[_0x34e488(0x15c)]),b=ie([_0x5a2a51(_0x356c5c,_0x277765,_0x2da112),w(0x1,_0xd5f9d0(_0x2d4464)),w(0x2,_0x1f95aa)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x4e06ef=_0x3080;(function(_0x38c186,_0x3d8d72){const _0x30d6f2=_0x3080,_0x187865=_0x38c186();while(!![]){try{const _0x14b94e=parseInt(_0x30d6f2(0x195))/0x1*(parseInt(_0x30d6f2(0x178))/0x2)+parseInt(_0x30d6f2(0x173))/0x3+-parseInt(_0x30d6f2(0x158))/0x4*(parseInt(_0x30d6f2(0x166))/0x5)+-parseInt(_0x30d6f2(0x199))/0x6+parseInt(_0x30d6f2(0x16e))/0x7+-parseInt(_0x30d6f2(0x16a))/0x8+-parseInt(_0x30d6f2(0x15a))/0x9*(-parseInt(_0x30d6f2(0x137))/0xa);if(_0x14b94e===_0x3d8d72)break;else _0x187865['push'](_0x187865['shift']());}catch(_0x225bef){_0x187865['push'](_0x187865['shift']());}}}(_0x5993,0x45107));import{CommentService as _0x31cd0a,CollaborationSessionService as _0x4c4e6e,UniverCollaborationClientPlugin as _0x571e91}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4d5765}from'@univerjs-pro/license';import{dayjs as _0x456f15,UserManagerService as _0x34b56b,Inject as _0x542cd4,Injector as _0x2e2c1d,Disposable as _0x252bc6,CustomRangeType as _0x390935,UniverInstanceType as _0x10dc0a,DependentOn as _0x3a69bd,IConfigService as _0x29ffb3,Plugin as _0xc29b4f,merge as _0x1882a1}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x492f5e}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x4d7437,IThreadCommentDataSourceService as _0x207718}from'@univerjs/thread-comment';import{bufferTime as _0x5bfb61}from'rxjs';import{HTTPService as _0x54f72f}from'@univerjs/network';const W=_0x4e06ef(0x198);var I=(_0x2604c1=>(_0x2604c1[_0x2604c1['OpenOrReOpen']=0x0]=_0x4e06ef(0x184),_0x2604c1[_0x2604c1[_0x4e06ef(0x15d)]=0x1]=_0x4e06ef(0x15d),_0x2604c1[_0x2604c1[_0x4e06ef(0x159)]=-0x1]=_0x4e06ef(0x159),_0x2604c1))(I||{}),v=(_0x52f08c=>(_0x52f08c[_0x52f08c['Unknown']=0x0]=_0x4e06ef(0x194),_0x52f08c[_0x52f08c['Add']=0x1]=_0x4e06ef(0x18f),_0x52f08c[_0x52f08c['Reply']=0x2]='Reply',_0x52f08c[_0x52f08c['Edit']=0x3]=_0x4e06ef(0x197),_0x52f08c[_0x52f08c[_0x4e06ef(0x181)]=0x4]='Delete',_0x52f08c[_0x52f08c['Solve']=0x5]=_0x4e06ef(0x177),_0x52f08c[_0x52f08c[_0x4e06ef(0x159)]=-0x1]=_0x4e06ef(0x159),_0x52f08c))(v||{});const D=_0x24124d=>_0x456f15(new Date(+_0x24124d))[_0x4e06ef(0x172)](_0x4e06ef(0x154)),B=async(_0x58e51e,_0x377f08)=>{const _0x5eebaa=_0x4e06ef,_0x23abfb=_0x58e51e[_0x5eebaa(0x189)](_0x34b56b),_0xca5f99=_0x58e51e[_0x5eebaa(0x189)](_0x54f72f);_0x377f08[_0x5eebaa(0x176)](_0x5edb8f=>{const _0x21c574=_0x5eebaa;_0x23abfb[_0x21c574(0x141)](_0x5edb8f)&&_0x377f08[_0x21c574(0x163)](_0x5edb8f);}),_0x377f08[_0x5eebaa(0x188)]&&(await _0xca5f99[_0x5eebaa(0x189)](_0x5eebaa(0x167),{'params':{'userIDs':[..._0x377f08]}}))[_0x5eebaa(0x14f)][_0x5eebaa(0x146)][_0x5eebaa(0x176)](_0x284d42=>{const _0x4d9ba7=_0x5eebaa;_0x284d42&&_0x23abfb[_0x4d9ba7(0x14e)](_0x284d42);});};var K=Object[_0x4e06ef(0x180)],V=(_0x593c82,_0x5ed532,_0x221dbd,_0x14d6a5)=>{for(var _0x104e18=_0x14d6a5>0x1?void 0x0:_0x14d6a5?K(_0x5ed532,_0x221dbd):_0x5ed532,_0x22a379=_0x593c82['length']-0x1,_0x1d6b82;_0x22a379>=0x0;_0x22a379--)(_0x1d6b82=_0x593c82[_0x22a379])&&(_0x104e18=_0x1d6b82(_0x104e18)||_0x104e18);return _0x104e18;},p=(_0x516ece,_0xc82d23)=>(_0x2499bf,_0x35e1be)=>_0xc82d23(_0x2499bf,_0x35e1be,_0x516ece);let S=class extends _0x252bc6{constructor(_0x574e30,_0x2b8db0,_0x38e2fa,_0x142d00){const _0x250219=_0x4e06ef;super(),this[_0x250219(0x151)]=_0x574e30,this[_0x250219(0x183)]=_0x2b8db0,this['_userService']=_0x38e2fa,this[_0x250219(0x160)]=_0x142d00,this[_0x250219(0x15b)](),this['_initUserSync']();}['_initUserSync'](){const _0x1d0fa2=_0x4e06ef;this[_0x1d0fa2(0x17e)](this[_0x1d0fa2(0x183)][_0x1d0fa2(0x16c)][_0x1d0fa2(0x174)](_0x5bfb61(0x10))['subscribe'](_0x17bbd6=>{const _0x2e4acb=_0x1d0fa2,_0x331ce6=new Set();_0x17bbd6[_0x2e4acb(0x176)](_0x1911a8=>{const _0x348a1f=_0x2e4acb;switch(_0x1911a8['type']){case _0x348a1f(0x139):{const _0x59ddff=_0x1911a8['payload']['personId'];_0x331ce6[_0x348a1f(0x139)](_0x59ddff);break;}}}),B(this[_0x2e4acb(0x160)],_0x331ce6);}));}[_0x4e06ef(0x15b)](){const _0xc3a05b=_0x4e06ef;this[_0xc3a05b(0x17e)](this[_0xc3a05b(0x151)][_0xc3a05b(0x16c)][_0xc3a05b(0x18d)](async _0x5d8cba=>{const _0x26f47a=_0xc3a05b;var _0x49d98e,_0x75f1d8,_0x462858,_0x4b33bc;const _0x19300f=(_0x49d98e=this['_threadCommentModel'][_0x26f47a(0x16b)](_0x5d8cba[_0x26f47a(0x16d)])['find'](_0x3baa28=>_0x3baa28[_0x26f47a(0x152)]===_0x5d8cba[_0x26f47a(0x152)]))==null?void 0x0:_0x49d98e[_0x26f47a(0x185)];if(!_0x19300f)return;const {unitId:_0xbefc51,subUnitId:_0x3c9237}=_0x19300f;switch(_0x5d8cba['user']&&this[_0x26f47a(0x136)][_0x26f47a(0x14e)](_0x5d8cba[_0x26f47a(0x175)]),_0x5d8cba['type']){case v[_0x26f47a(0x18f)]:break;case v[_0x26f47a(0x140)]:{this['_threadCommentModel'][_0x26f47a(0x13f)](_0xbefc51,_0x3c9237,{'unitId':_0xbefc51,'subUnitId':_0x3c9237,'ref':'','id':_0x5d8cba[_0x26f47a(0x161)],'dT':D(+_0x5d8cba[_0x26f47a(0x17b)]),'threadId':_0x5d8cba['threadId'],'personId':(_0x462858=(_0x75f1d8=_0x5d8cba[_0x26f47a(0x175)])==null?void 0x0:_0x75f1d8['userID'])!=null?_0x462858:_0x5d8cba[_0x26f47a(0x147)],'text':JSON[_0x26f47a(0x157)](_0x5d8cba['content']),'parentId':_0x19300f['id']});break;}case v[_0x26f47a(0x181)]:{const _0x3c5fc6=this[_0x26f47a(0x183)][_0x26f47a(0x13a)](_0xbefc51,_0x3c9237,_0x5d8cba['replyId']);_0x3c5fc6&&_0x3c5fc6['parentId']&&this[_0x26f47a(0x183)][_0x26f47a(0x192)](_0xbefc51,_0x3c9237,_0x5d8cba[_0x26f47a(0x161)]);break;}case v[_0x26f47a(0x197)]:{this[_0x26f47a(0x183)][_0x26f47a(0x13d)](_0xbefc51,_0x3c9237,{'commentId':_0x5d8cba[_0x26f47a(0x161)],'text':JSON[_0x26f47a(0x157)](_0x5d8cba[_0x26f47a(0x171)])});break;}case v[_0x26f47a(0x177)]:{const _0x2d2504=(_0x4b33bc=this[_0x26f47a(0x183)][_0x26f47a(0x16b)](_0x5d8cba[_0x26f47a(0x16d)])['find'](_0x42b609=>_0x42b609[_0x26f47a(0x152)]===_0x5d8cba[_0x26f47a(0x152)]))==null?void 0x0:_0x4b33bc[_0x26f47a(0x185)];_0x2d2504&&this[_0x26f47a(0x183)][_0x26f47a(0x162)](_0xbefc51,_0x3c9237,_0x2d2504['id'],_0x5d8cba['solved']===I['Solved']);break;}}}));}};S=V([p(0x0,_0x542cd4(_0x31cd0a)),p(0x1,_0x542cd4(_0x4d7437)),p(0x2,_0x542cd4(_0x34b56b)),p(0x3,_0x542cd4(_0x2e2c1d))],S);const z='thread-comment-data-source.config',M={};var k=Object[_0x4e06ef(0x180)],Q=(_0x48d3c6,_0x50f2c6,_0x506657,_0x38f068)=>{const _0x40b2f2=_0x4e06ef;for(var _0x43b3fe=_0x38f068>0x1?void 0x0:_0x38f068?k(_0x50f2c6,_0x506657):_0x50f2c6,_0x4716a6=_0x48d3c6[_0x40b2f2(0x18a)]-0x1,_0xb5bcd3;_0x4716a6>=0x0;_0x4716a6--)(_0xb5bcd3=_0x48d3c6[_0x4716a6])&&(_0x43b3fe=_0xb5bcd3(_0x43b3fe)||_0x43b3fe);return _0x43b3fe;},_=(_0x5269a4,_0x33061b)=>(_0x5ef270,_0x2842a0)=>_0x33061b(_0x5ef270,_0x2842a0,_0x5269a4);function X(_0x2b2449,_0x468ed0){const _0x56463a=_0x4e06ef,_0x104cc3=_0x2b2449[_0x56463a(0x187)][0x0];return{..._0x468ed0,'id':_0x104cc3[_0x56463a(0x161)],'resolved':_0x2b2449['solved']===0x1,'dT':D(_0x104cc3[_0x56463a(0x17b)]),'personId':_0x104cc3[_0x56463a(0x147)],'threadId':_0x104cc3['threadId']};}function ee(_0xe4d8cb,_0x31115c,_0x4a9a5c){const _0x346ab3=_0x4e06ef;var _0x5429a7,_0x15c925;if(((_0x15c925=(_0x5429a7=_0xe4d8cb==null?void 0x0:_0xe4d8cb['replies'])==null?void 0x0:_0x5429a7[_0x346ab3(0x18a)])!=null?_0x15c925:0x0)>0x0){const _0x2666f4=(_0x43007e,_0x4a87c1)=>({'id':_0x43007e['replyId'],'threadId':_0x43007e[_0x346ab3(0x152)],'dT':D(_0x43007e[_0x346ab3(0x17b)]),'personId':_0x43007e[_0x346ab3(0x147)],'resolved':_0xe4d8cb[_0x346ab3(0x186)]===I['Solved'],'unitId':_0x31115c,'subUnitId':_0x4a9a5c,'text':JSON[_0x346ab3(0x157)](_0x43007e[_0x346ab3(0x171)]),'parentId':_0x4a87c1}),_0x2dd370=_0x2666f4(_0xe4d8cb[_0x346ab3(0x187)][0x0]);return{..._0x2dd370,'children':_0xe4d8cb[_0x346ab3(0x187)][_0x346ab3(0x17a)](0x1)[_0x346ab3(0x143)](_0x56b2eb=>_0x2666f4(_0x56b2eb,_0x2dd370['id']))};}return null;}let f=class{constructor(_0x11edcd,_0x2caa32,_0x16728a,_0x186f6c){const _0x216f42=_0x4e06ef;this[_0x216f42(0x18c)]=_0x11edcd,this[_0x216f42(0x136)]=_0x2caa32,this[_0x216f42(0x193)]=_0x16728a,this[_0x216f42(0x160)]=_0x186f6c;}async[_0x4e06ef(0x13f)](_0x4dfb4b){const _0x5dcd0c=_0x4e06ef;var _0x4036d3,_0xa697b9;const {parentId:_0x2e493f,unitId:_0x5b5d97,text:_0x58908b,threadId:_0x4f7e76}=_0x4dfb4b,_0xd3e3cf=(_0xa697b9=(_0x4036d3=_0x58908b[_0x5dcd0c(0x18b)])==null?void 0x0:_0x4036d3[_0x5dcd0c(0x179)](_0x59e3f5=>_0x59e3f5[_0x5dcd0c(0x153)]===_0x390935[_0x5dcd0c(0x170)])[_0x5dcd0c(0x143)](_0x115ee0=>_0x115ee0['rangeId']))!=null?_0xa697b9:[],_0x2ac442=JSON['stringify'](_0x58908b),_0x597e32=(await this[_0x5dcd0c(0x193)][_0x5dcd0c(0x148)](_0x5b5d97))[_0x5dcd0c(0x145)]();if(_0x2e493f){const _0x5431a8={'memberId':_0x597e32,'unitId':_0x5b5d97,'content':_0x2ac442,'mention':_0xd3e3cf,'threadId':_0x4f7e76},_0x26a7da=(await this[_0x5dcd0c(0x18c)][_0x5dcd0c(0x15c)]('/universer-api/comment/unit/'+_0x5b5d97+'/reply',{'body':_0x5431a8}))[_0x5dcd0c(0x14f)][_0x5dcd0c(0x14b)];return{..._0x4dfb4b,'id':_0x26a7da[_0x5dcd0c(0x161)],'dT':_0x456f15(+_0x26a7da[_0x5dcd0c(0x17b)])['format'](_0x5dcd0c(0x154)),'personId':_0x26a7da[_0x5dcd0c(0x147)]};}else{const _0x37e1ac={'memberId':_0x597e32,'unitId':_0x5b5d97,'content':_0x2ac442,'mention':_0xd3e3cf},_0x5dac03=await this[_0x5dcd0c(0x18c)][_0x5dcd0c(0x15c)](_0x5dcd0c(0x17d)+_0x5b5d97+_0x5dcd0c(0x13e),{'body':_0x37e1ac});return X(_0x5dac03['body']['comment'],_0x4dfb4b);}}async['updateComment'](_0x40df76){const _0x3384dd=_0x4e06ef;var _0x1c40d6,_0x2ebbfa;const {text:_0x4e0b68,unitId:_0x3650b3}=_0x40df76,_0x24f922=(_0x2ebbfa=(_0x1c40d6=_0x4e0b68[_0x3384dd(0x18b)])==null?void 0x0:_0x1c40d6['filter'](_0x3dc1c9=>_0x3dc1c9[_0x3384dd(0x153)]===_0x390935['COMMENT'])[_0x3384dd(0x143)](_0x270c4b=>_0x270c4b[_0x3384dd(0x17c)]))!=null?_0x2ebbfa:[],_0x7eb67f=JSON[_0x3384dd(0x13b)](_0x4e0b68),_0x4725ec=_0x40df76[_0x3384dd(0x152)],_0x19265a=_0x40df76['id'],_0x4ace34={'memberId':(await this[_0x3384dd(0x193)][_0x3384dd(0x148)](_0x3650b3))[_0x3384dd(0x145)](),'unitId':_0x3650b3,'threadId':_0x4725ec,'mention':_0x24f922,'content':_0x7eb67f,'replyId':_0x19265a},_0x146f8e=await this[_0x3384dd(0x18c)][_0x3384dd(0x15c)](_0x3384dd(0x17d)+_0x3650b3+_0x3384dd(0x144),{'body':_0x4ace34});return!_0x146f8e[_0x3384dd(0x14f)]['error']||_0x146f8e[_0x3384dd(0x14f)][_0x3384dd(0x155)][_0x3384dd(0x15e)]===0x1;}async[_0x4e06ef(0x162)](_0x415bb8){const _0x126233=_0x4e06ef,{unitId:_0x628bb1}=_0x415bb8,_0x5caff8=_0x415bb8[_0x126233(0x152)],_0x2836e7={'memberId':this[_0x126233(0x136)][_0x126233(0x168)]()[_0x126233(0x196)],'unitId':_0x628bb1,'threadId':_0x5caff8,'solved':_0x415bb8[_0x126233(0x17f)]?I[_0x126233(0x15d)]:I[_0x126233(0x184)]},_0x74857d=await this['_httpService'][_0x126233(0x15c)](_0x126233(0x17d)+_0x628bb1+_0x126233(0x182),{'body':_0x2836e7});return!_0x74857d[_0x126233(0x14f)]['error']||_0x74857d[_0x126233(0x14f)][_0x126233(0x155)][_0x126233(0x15e)]===0x1;}async[_0x4e06ef(0x192)](_0x467a2a,_0x570cb3,_0x322a66,_0x267f73){const _0x22a226=_0x4e06ef,_0x5dbdec={'memberId':(await this[_0x22a226(0x193)][_0x22a226(0x148)](_0x467a2a))['getMemberID'](),'threadId':_0x322a66,'replyId':_0x267f73,'unitId':_0x467a2a},_0x55bf8b=await this[_0x22a226(0x18c)][_0x22a226(0x15c)](_0x22a226(0x17d)+_0x467a2a+_0x22a226(0x14c),{'body':_0x5dbdec});return!_0x55bf8b['body'][_0x22a226(0x155)]||_0x55bf8b['body'][_0x22a226(0x155)]['code']===0x1;}async[_0x4e06ef(0x138)](_0x1e5329,_0x43b76e,_0x232072){const _0x2b5378=_0x4e06ef,_0x47f7b6={'unitId':_0x1e5329,'threadId':_0x232072},_0x508e8b=await this[_0x2b5378(0x18c)]['post'](_0x2b5378(0x17d)+_0x1e5329+'/list',{'body':_0x47f7b6}),_0x434ae9=_0x232072[_0x2b5378(0x143)](_0x5057b5=>ee(_0x508e8b[_0x2b5378(0x14f)][_0x2b5378(0x191)][_0x5057b5],_0x1e5329,_0x43b76e))['filter'](Boolean);return Object[_0x2b5378(0x142)](_0x508e8b[_0x2b5378(0x14f)]['users'])[_0x2b5378(0x176)](_0x55951a=>{const _0x4f03df=_0x2b5378;this['_userService'][_0x4f03df(0x14e)](_0x55951a);}),_0x434ae9;}[_0x4e06ef(0x150)](_0x4bc862){const _0x26ea4f=_0x4e06ef;return{'id':_0x4bc862['id'],'threadId':_0x4bc862[_0x26ea4f(0x152)],'ref':_0x4bc862[_0x26ea4f(0x165)]};}};function _0x5993(){const _0x1e1a5e=['onReady','comments','deleteComment','_sessionService','Unknown','88106iVctpm','userID','Edit','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','693816IwmNRk','_userService','90680Jwztwd','listComments','add','getComment','stringify','defineProperty','updateComment','/add','addComment','Reply','getUser','values','map','/edit','getMemberID','users','userId','requireSession','symbol','_initDataSource','reply','/delete','_threadCommentDataSource','addUser','body','saveCommentToSnapshot','_commentService','threadId','rangeType','YYYY/MM/DD\x20HH:mm','error','dataSource','parse','4TIKfaB','UNRECOGNIZED','162glzIXj','_init','post','Solved','code','_threadCommentDataSourceService','_injector','replyId','resolveComment','delete','_config','ref','1448170XAzpEz','/universer-api/user/list','getCurrentUser','UNIVER_UNKNOWN','463760MYLhxK','getUnit','commentUpdate$','unitId','2066134hMUIew','_configService','COMMENT','content','format','334587NfBPdd','pipe','user','forEach','Solve','4XQcaOW','filter','slice','createTimestamp','rangeId','/universer-api/comment/unit/','disposeWithMe','resolved','getOwnPropertyDescriptor','Delete','/solved','_threadCommentModel','OpenOrReOpen','root','solved','replies','size','get','length','customRanges','_httpService','subscribe','setConfig','Add'];_0x5993=function(){return _0x1e1a5e;};return _0x5993();}f=Q([_(0x0,_0x542cd4(_0x54f72f)),_(0x1,_0x542cd4(_0x34b56b)),_(0x2,_0x542cd4(_0x4c4e6e)),_(0x3,_0x542cd4(_0x2e2c1d))],f);var re=Object[_0x4e06ef(0x180)],te=(_0x3a7e28,_0xcfd556,_0x462bb2,_0x501513)=>{for(var _0x3b0da8=_0x501513>0x1?void 0x0:_0x501513?re(_0xcfd556,_0x462bb2):_0xcfd556,_0x4342d5=_0x3a7e28['length']-0x1,_0x30df20;_0x4342d5>=0x0;_0x4342d5--)(_0x30df20=_0x3a7e28[_0x4342d5])&&(_0x3b0da8=_0x30df20(_0x3b0da8)||_0x3b0da8);return _0x3b0da8;},N=(_0x5b05fd,_0x4aca87)=>(_0xd6bb5,_0x3751a0)=>_0x4aca87(_0xd6bb5,_0x3751a0,_0x5b05fd);let g=class extends _0x252bc6{constructor(_0x1923aa,_0x5a563d){const _0x1c7321=_0x4e06ef;super(),this['_threadCommentDataSourceService']=_0x1923aa,this[_0x1c7321(0x14d)]=_0x5a563d,this['_initDataSource']();}[_0x4e06ef(0x14a)](){const _0x56304b=_0x4e06ef;this[_0x56304b(0x15f)][_0x56304b(0x156)]=this[_0x56304b(0x14d)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x207718),N(0x1,_0x542cd4(f))],g);var se=Object[_0x4e06ef(0x13c)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x4d17a9,_0x4e6bfa,_0x5e4b57)=>_0x4e6bfa in _0x4d17a9?se(_0x4d17a9,_0x4e6bfa,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5e4b57}):_0x4d17a9[_0x4e6bfa]=_0x5e4b57,ie=(_0x1cfa35,_0x31ce85,_0x10b909,_0x20b8c6)=>{const _0x5d8e16=_0x4e06ef;for(var _0xfa93f2=_0x20b8c6>0x1?void 0x0:_0x20b8c6?oe(_0x31ce85,_0x10b909):_0x31ce85,_0x4e3e0c=_0x1cfa35[_0x5d8e16(0x18a)]-0x1,_0x42d89e;_0x4e3e0c>=0x0;_0x4e3e0c--)(_0x42d89e=_0x1cfa35[_0x4e3e0c])&&(_0xfa93f2=_0x42d89e(_0xfa93f2)||_0xfa93f2);return _0xfa93f2;},w=(_0x309a91,_0x56a48d)=>(_0x30c142,_0x483b79)=>_0x56a48d(_0x30c142,_0x483b79,_0x309a91),$=(_0x1e5eb3,_0x752b63,_0x466d34)=>ne(_0x1e5eb3,typeof _0x752b63!=_0x4e06ef(0x149)?_0x752b63+'':_0x752b63,_0x466d34);let b=class extends _0xc29b4f{constructor(_0x423dbd=M,_0x416525,_0x5a50ae){const _0x59797e=_0x4e06ef;super(),this[_0x59797e(0x164)]=_0x423dbd,this[_0x59797e(0x160)]=_0x416525,this[_0x59797e(0x16f)]=_0x5a50ae;const {..._0x4c380d}=_0x1882a1({},M,this[_0x59797e(0x164)]);this[_0x59797e(0x16f)][_0x59797e(0x18e)](z,_0x4c380d);}['onStarting'](){[[f],[g],[S]]['forEach'](_0x340c23=>{const _0x39d369=_0x3080;this[_0x39d369(0x160)]['add'](_0x340c23);});}[_0x4e06ef(0x190)](){const _0x16de0c=_0x4e06ef;this[_0x16de0c(0x160)]['get'](g),this['_injector'][_0x16de0c(0x189)](S);}};$(b,'pluginName',W),$(b,'type',_0x10dc0a[_0x4e06ef(0x169)]),b=ie([_0x3a69bd(_0x492f5e,_0x571e91,_0x4d5765),w(0x1,_0x542cd4(_0x2e2c1d)),w(0x2,_0x29ffb3)],b);function _0x3080(_0x3050e0,_0x2c1261){const _0x5993f7=_0x5993();return _0x3080=function(_0x30808d,_0x179306){_0x30808d=_0x30808d-0x136;let _0x1f1ffb=_0x5993f7[_0x30808d];return _0x1f1ffb;},_0x3080(_0x3050e0,_0x2c1261);}export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4a2a80,_0xe76237){const _0x5e5e4a=_0xbda5,_0x37073b=_0x4a2a80();while(!![]){try{const _0x15bff7=parseInt(_0x5e5e4a(0x162))/0x1*(-parseInt(_0x5e5e4a(0x117))/0x2)+parseInt(_0x5e5e4a(0x150))/0x3+parseInt(_0x5e5e4a(0x125))/0x4+parseInt(_0x5e5e4a(0x12c))/0x5*(parseInt(_0x5e5e4a(0x114))/0x6)+parseInt(_0x5e5e4a(0xea))/0x7*(-parseInt(_0x5e5e4a(0x145))/0x8)+parseInt(_0x5e5e4a(0xf4))/0x9+-parseInt(_0x5e5e4a(0x14d))/0xa;if(_0x15bff7===_0xe76237)break;else _0x37073b['push'](_0x37073b['shift']());}catch(_0x33849e){_0x37073b['push'](_0x37073b['shift']());}}}(_0x5ce5,0x65fe6),function(_0x23d01b,_0x4b53c0){const _0x1b34ac=_0xbda5;typeof exports==_0x1b34ac(0xe6)&&typeof module<'u'?_0x4b53c0(exports,require(_0x1b34ac(0xf9)),require(_0x1b34ac(0x128)),require(_0x1b34ac(0x130)),require(_0x1b34ac(0xee)),require('@univerjs/thread-comment'),require(_0x1b34ac(0x15d)),require(_0x1b34ac(0x157))):typeof define==_0x1b34ac(0x132)&&define['amd']?define(['exports',_0x1b34ac(0xf9),_0x1b34ac(0x128),_0x1b34ac(0x130),_0x1b34ac(0xee),_0x1b34ac(0x133),_0x1b34ac(0x15d),_0x1b34ac(0x157)],_0x4b53c0):(_0x23d01b=typeof globalThis<'u'?globalThis:_0x23d01b||self,_0x4b53c0(_0x23d01b[_0x1b34ac(0x169)]={},_0x23d01b['UniverProCollaborationClient'],_0x23d01b[_0x1b34ac(0x105)],_0x23d01b[_0x1b34ac(0x13a)],_0x23d01b[_0x1b34ac(0x135)],_0x23d01b['UniverThreadComment'],_0x23d01b[_0x1b34ac(0x15d)],_0x23d01b[_0x1b34ac(0x14e)]));}(this,function(_0x1287a6,_0x3c2d2c,_0x17604f,_0x174178,_0x223cc3,_0xe590ae,_0x578571,_0x5c6219){'use strict';const _0x4fd33a=_0xbda5;const _0x1dc3b2=_0x4fd33a(0xf7);var _0x2f1308=(_0x11396b=>(_0x11396b[_0x11396b[_0x4fd33a(0x11a)]=0x0]='OpenOrReOpen',_0x11396b[_0x11396b['Solved']=0x1]='Solved',_0x11396b[_0x11396b[_0x4fd33a(0x11f)]=-0x1]=_0x4fd33a(0x11f),_0x11396b))(_0x2f1308||{}),_0x477ced=(_0x20abe2=>(_0x20abe2[_0x20abe2[_0x4fd33a(0x104)]=0x0]=_0x4fd33a(0x104),_0x20abe2[_0x20abe2[_0x4fd33a(0x12d)]=0x1]='Add',_0x20abe2[_0x20abe2['Reply']=0x2]='Reply',_0x20abe2[_0x20abe2['Edit']=0x3]='Edit',_0x20abe2[_0x20abe2['Delete']=0x4]=_0x4fd33a(0x161),_0x20abe2[_0x20abe2[_0x4fd33a(0x100)]=0x5]=_0x4fd33a(0x100),_0x20abe2[_0x20abe2['UNRECOGNIZED']=-0x1]=_0x4fd33a(0x11f),_0x20abe2))(_0x477ced||{});const _0x4316f4=_0x1bc996=>_0x174178['dayjs'](new Date(+_0x1bc996))[_0x4fd33a(0xe8)]('YYYY/MM/DD\x20HH:mm'),_0x360c4d=async(_0x7d0981,_0x4ccae3)=>{const _0x502dca=_0x4fd33a,_0xaf9042=_0x7d0981[_0x502dca(0x167)](_0x174178[_0x502dca(0x113)]),_0x3556b3=_0x7d0981[_0x502dca(0x167)](_0x5c6219[_0x502dca(0x14f)]);_0x4ccae3[_0x502dca(0x118)](_0x29824a=>{const _0x3f998e=_0x502dca;_0xaf9042[_0x3f998e(0x151)](_0x29824a)&&_0x4ccae3[_0x3f998e(0x142)](_0x29824a);}),_0x4ccae3['size']&&(await _0x3556b3[_0x502dca(0x167)]('/universer-api/user/list',{'params':{'userIDs':[..._0x4ccae3]}}))[_0x502dca(0x10b)][_0x502dca(0x143)]['forEach'](_0x5c431b=>{_0x5c431b&&_0xaf9042['addUser'](_0x5c431b);});};var _0x4f9b00=Object[_0x4fd33a(0x168)],_0x178453=(_0x59931b,_0x11fa2d,_0x341623,_0x26ca2b)=>{const _0x5a6bda=_0x4fd33a;for(var _0x3d3e4e=_0x26ca2b>0x1?void 0x0:_0x26ca2b?_0x4f9b00(_0x11fa2d,_0x341623):_0x11fa2d,_0xa9d7ea=_0x59931b[_0x5a6bda(0x131)]-0x1,_0x24ad46;_0xa9d7ea>=0x0;_0xa9d7ea--)(_0x24ad46=_0x59931b[_0xa9d7ea])&&(_0x3d3e4e=_0x24ad46(_0x3d3e4e)||_0x3d3e4e);return _0x3d3e4e;},_0x551b56=(_0x45197c,_0x4300b3)=>(_0x537c71,_0x449134)=>_0x4300b3(_0x537c71,_0x449134,_0x45197c);let _0x548fca=class extends _0x174178[_0x4fd33a(0x153)]{constructor(_0x4f9014,_0x4d2ed0,_0x28f15c,_0x41d277){const _0x4d2276=_0x4fd33a;super(),this[_0x4d2276(0x110)]=_0x4f9014,this['_threadCommentModel']=_0x4d2ed0,this['_userService']=_0x28f15c,this[_0x4d2276(0x13d)]=_0x41d277,this[_0x4d2276(0x137)](),this[_0x4d2276(0x15f)]();}['_initUserSync'](){const _0x4d0a2c=_0x4fd33a;this['disposeWithMe'](this[_0x4d0a2c(0x13e)][_0x4d0a2c(0xf1)][_0x4d0a2c(0xf8)](_0x578571[_0x4d0a2c(0x160)](0x10))[_0x4d0a2c(0xfa)](_0x1ce558=>{const _0x431c54=_0x4d0a2c,_0x6c8c2f=new Set();_0x1ce558[_0x431c54(0x118)](_0x3e27cf=>{const _0x56226a=_0x431c54;switch(_0x3e27cf[_0x56226a(0x12f)]){case'add':{const _0x3089bb=_0x3e27cf['payload'][_0x56226a(0xf6)];_0x6c8c2f[_0x56226a(0x10f)](_0x3089bb);break;}}}),_0x360c4d(this['_injector'],_0x6c8c2f);}));}['_init'](){const _0x33387d=_0x4fd33a;this[_0x33387d(0x141)](this['_commentService']['commentUpdate$'][_0x33387d(0xfa)](async _0x3776ee=>{const _0x45c5b6=_0x33387d;var _0x44c20a,_0x1d1175,_0x5df45d,_0x225167;const _0x526b5b=(_0x44c20a=this[_0x45c5b6(0x13e)][_0x45c5b6(0x112)](_0x3776ee[_0x45c5b6(0x13f)])[_0x45c5b6(0x158)](_0x3b95bb=>_0x3b95bb['threadId']===_0x3776ee['threadId']))==null?void 0x0:_0x44c20a['root'];if(!_0x526b5b)return;const {unitId:_0x8ac441,subUnitId:_0x218533}=_0x526b5b;switch(_0x3776ee[_0x45c5b6(0xe7)]&&this['_userService']['addUser'](_0x3776ee['user']),_0x3776ee['type']){case _0x477ced[_0x45c5b6(0x12d)]:break;case _0x477ced[_0x45c5b6(0x123)]:{this[_0x45c5b6(0x13e)][_0x45c5b6(0x126)](_0x8ac441,_0x218533,{'unitId':_0x8ac441,'subUnitId':_0x218533,'ref':'','id':_0x3776ee['replyId'],'dT':_0x4316f4(+_0x3776ee[_0x45c5b6(0xfb)]),'threadId':_0x3776ee['threadId'],'personId':(_0x5df45d=(_0x1d1175=_0x3776ee['user'])==null?void 0x0:_0x1d1175[_0x45c5b6(0x148)])!=null?_0x5df45d:_0x3776ee[_0x45c5b6(0x163)],'text':JSON[_0x45c5b6(0x11d)](_0x3776ee[_0x45c5b6(0x111)]),'parentId':_0x526b5b['id']});break;}case _0x477ced[_0x45c5b6(0x161)]:{const _0x3d0780=this[_0x45c5b6(0x13e)][_0x45c5b6(0xe9)](_0x8ac441,_0x218533,_0x3776ee[_0x45c5b6(0x11b)]);_0x3d0780&&_0x3d0780['parentId']&&this[_0x45c5b6(0x13e)]['deleteComment'](_0x8ac441,_0x218533,_0x3776ee[_0x45c5b6(0x11b)]);break;}case _0x477ced['Edit']:{this[_0x45c5b6(0x13e)][_0x45c5b6(0xfc)](_0x8ac441,_0x218533,{'commentId':_0x3776ee[_0x45c5b6(0x11b)],'text':JSON['parse'](_0x3776ee[_0x45c5b6(0x111)])});break;}case _0x477ced[_0x45c5b6(0x100)]:{const _0x4b6fa4=(_0x225167=this['_threadCommentModel']['getUnit'](_0x3776ee[_0x45c5b6(0x13f)])['find'](_0x214dad=>_0x214dad[_0x45c5b6(0x14b)]===_0x3776ee['threadId']))==null?void 0x0:_0x225167['root'];_0x4b6fa4&&this[_0x45c5b6(0x13e)][_0x45c5b6(0x15e)](_0x8ac441,_0x218533,_0x4b6fa4['id'],_0x3776ee[_0x45c5b6(0x11e)]===_0x2f1308[_0x45c5b6(0x166)]);break;}}}));}};_0x548fca=_0x178453([_0x551b56(0x0,_0x174178[_0x4fd33a(0x165)](_0x3c2d2c[_0x4fd33a(0x139)])),_0x551b56(0x1,_0x174178[_0x4fd33a(0x165)](_0xe590ae[_0x4fd33a(0xf2)])),_0x551b56(0x2,_0x174178[_0x4fd33a(0x165)](_0x174178[_0x4fd33a(0x113)])),_0x551b56(0x3,_0x174178[_0x4fd33a(0x165)](_0x174178[_0x4fd33a(0x115)]))],_0x548fca);const _0x510603='thread-comment-data-source.config',_0x3f2b12={};var _0x3ed5e7=Object[_0x4fd33a(0x168)],_0x537eac=(_0x204545,_0x10e8a9,_0x3e2674,_0xc0d3e8)=>{const _0x416645=_0x4fd33a;for(var _0x2bd7c6=_0xc0d3e8>0x1?void 0x0:_0xc0d3e8?_0x3ed5e7(_0x10e8a9,_0x3e2674):_0x10e8a9,_0x2d4a1e=_0x204545[_0x416645(0x131)]-0x1,_0x5e871d;_0x2d4a1e>=0x0;_0x2d4a1e--)(_0x5e871d=_0x204545[_0x2d4a1e])&&(_0x2bd7c6=_0x5e871d(_0x2bd7c6)||_0x2bd7c6);return _0x2bd7c6;},_0x3982a0=(_0x520bab,_0x9949b5)=>(_0x43b80b,_0x1f2d1f)=>_0x9949b5(_0x43b80b,_0x1f2d1f,_0x520bab);function _0x350778(_0x1019ea,_0x585c27){const _0x10ac3a=_0x4fd33a,_0x1db61f=_0x1019ea[_0x10ac3a(0x149)][0x0];return{..._0x585c27,'id':_0x1db61f[_0x10ac3a(0x11b)],'resolved':_0x1019ea[_0x10ac3a(0x11e)]===0x1,'dT':_0x4316f4(_0x1db61f[_0x10ac3a(0xfb)]),'personId':_0x1db61f[_0x10ac3a(0x163)],'threadId':_0x1db61f[_0x10ac3a(0x14b)]};}function _0x5c7910(_0x59267d,_0x5d9e36,_0x42f282){const _0x1537e5=_0x4fd33a;var _0x1d9c8d,_0xb7839d;if(((_0xb7839d=(_0x1d9c8d=_0x59267d==null?void 0x0:_0x59267d[_0x1537e5(0x149)])==null?void 0x0:_0x1d9c8d[_0x1537e5(0x131)])!=null?_0xb7839d:0x0)>0x0){const _0x29acf7=(_0x348114,_0x595a86)=>({'id':_0x348114[_0x1537e5(0x11b)],'threadId':_0x348114[_0x1537e5(0x14b)],'dT':_0x4316f4(_0x348114['createTimestamp']),'personId':_0x348114[_0x1537e5(0x163)],'resolved':_0x59267d[_0x1537e5(0x11e)]===_0x2f1308[_0x1537e5(0x166)],'unitId':_0x5d9e36,'subUnitId':_0x42f282,'text':JSON[_0x1537e5(0x11d)](_0x348114[_0x1537e5(0x111)]),'parentId':_0x595a86}),_0x2ee221=_0x29acf7(_0x59267d[_0x1537e5(0x149)][0x0]);return{..._0x2ee221,'children':_0x59267d[_0x1537e5(0x149)][_0x1537e5(0x122)](0x1)[_0x1537e5(0x12e)](_0x5e71d3=>_0x29acf7(_0x5e71d3,_0x2ee221['id']))};}return null;}let _0x2b6b2e=class{constructor(_0x29057b,_0x59a0fa,_0x4f056b,_0x2939f9){const _0x285098=_0x4fd33a;this[_0x285098(0x14a)]=_0x29057b,this[_0x285098(0x15c)]=_0x59a0fa,this[_0x285098(0x13b)]=_0x4f056b,this['_injector']=_0x2939f9;}async[_0x4fd33a(0x126)](_0x24e4b2){const _0xcfc0f0=_0x4fd33a;var _0x3c607c,_0x469fe9;const {parentId:_0x542f26,unitId:_0x352570,text:_0x12d79e,threadId:_0x245950}=_0x24e4b2,_0x16196b=(_0x469fe9=(_0x3c607c=_0x12d79e['customRanges'])==null?void 0x0:_0x3c607c[_0xcfc0f0(0x152)](_0x37c1aa=>_0x37c1aa[_0xcfc0f0(0x119)]===_0x174178[_0xcfc0f0(0x10e)]['COMMENT'])[_0xcfc0f0(0x12e)](_0x416dec=>_0x416dec[_0xcfc0f0(0x14c)]))!=null?_0x469fe9:[],_0x5d7ad7=JSON[_0xcfc0f0(0x164)](_0x12d79e),_0x26beb0=(await this[_0xcfc0f0(0x13b)]['requireSession'](_0x352570))['getMemberID']();if(_0x542f26){const _0x5cf982={'memberId':_0x26beb0,'unitId':_0x352570,'content':_0x5d7ad7,'mention':_0x16196b,'threadId':_0x245950},_0x251a9a=(await this['_httpService'][_0xcfc0f0(0xed)](_0xcfc0f0(0x10c)+_0x352570+_0xcfc0f0(0xeb),{'body':_0x5cf982}))['body'][_0xcfc0f0(0xef)];return{..._0x24e4b2,'id':_0x251a9a[_0xcfc0f0(0x11b)],'dT':_0x174178['dayjs'](+_0x251a9a['createTimestamp'])[_0xcfc0f0(0xe8)](_0xcfc0f0(0x101)),'personId':_0x251a9a[_0xcfc0f0(0x163)]};}else{const _0x53f841={'memberId':_0x26beb0,'unitId':_0x352570,'content':_0x5d7ad7,'mention':_0x16196b},_0x465858=await this[_0xcfc0f0(0x14a)][_0xcfc0f0(0xed)](_0xcfc0f0(0x10c)+_0x352570+_0xcfc0f0(0x159),{'body':_0x53f841});return _0x350778(_0x465858[_0xcfc0f0(0x10b)][_0xcfc0f0(0x102)],_0x24e4b2);}}async[_0x4fd33a(0xfc)](_0xa2ef57){const _0x3be828=_0x4fd33a;var _0x3786cf,_0x1b9a5a;const {text:_0x2ad5e6,unitId:_0x5e098d}=_0xa2ef57,_0x3cda3e=(_0x1b9a5a=(_0x3786cf=_0x2ad5e6[_0x3be828(0x147)])==null?void 0x0:_0x3786cf['filter'](_0x1b8286=>_0x1b8286[_0x3be828(0x119)]===_0x174178['CustomRangeType']['COMMENT'])[_0x3be828(0x12e)](_0x3cfbcc=>_0x3cfbcc[_0x3be828(0x14c)]))!=null?_0x1b9a5a:[],_0x504316=JSON[_0x3be828(0x164)](_0x2ad5e6),_0x3637c8=_0xa2ef57[_0x3be828(0x14b)],_0x24f286=_0xa2ef57['id'],_0x136d82={'memberId':(await this[_0x3be828(0x13b)]['requireSession'](_0x5e098d))['getMemberID'](),'unitId':_0x5e098d,'threadId':_0x3637c8,'mention':_0x3cda3e,'content':_0x504316,'replyId':_0x24f286},_0x5b74ed=await this[_0x3be828(0x14a)]['post']('/universer-api/comment/unit/'+_0x5e098d+_0x3be828(0xec),{'body':_0x136d82});return!_0x5b74ed[_0x3be828(0x10b)][_0x3be828(0x11c)]||_0x5b74ed[_0x3be828(0x10b)][_0x3be828(0x11c)][_0x3be828(0x10a)]===0x1;}async[_0x4fd33a(0x15e)](_0x14ac38){const _0x432a05=_0x4fd33a,{unitId:_0xaf7d20}=_0x14ac38,_0x564a95=_0x14ac38[_0x432a05(0x14b)],_0x4b2a69={'memberId':this[_0x432a05(0x15c)][_0x432a05(0x103)]()[_0x432a05(0x148)],'unitId':_0xaf7d20,'threadId':_0x564a95,'solved':_0x14ac38[_0x432a05(0x12b)]?_0x2f1308[_0x432a05(0x166)]:_0x2f1308[_0x432a05(0x11a)]},_0x5c5410=await this[_0x432a05(0x14a)][_0x432a05(0xed)](_0x432a05(0x10c)+_0xaf7d20+_0x432a05(0x129),{'body':_0x4b2a69});return!_0x5c5410['body'][_0x432a05(0x11c)]||_0x5c5410['body'][_0x432a05(0x11c)][_0x432a05(0x10a)]===0x1;}async[_0x4fd33a(0x134)](_0x512c25,_0x5c3b05,_0x5369f9,_0x2de81a){const _0xdfb6a4=_0x4fd33a,_0x2c38ad={'memberId':(await this[_0xdfb6a4(0x13b)]['requireSession'](_0x512c25))[_0xdfb6a4(0x107)](),'threadId':_0x5369f9,'replyId':_0x2de81a,'unitId':_0x512c25},_0x48ad71=await this[_0xdfb6a4(0x14a)][_0xdfb6a4(0xed)]('/universer-api/comment/unit/'+_0x512c25+_0xdfb6a4(0x120),{'body':_0x2c38ad});return!_0x48ad71[_0xdfb6a4(0x10b)][_0xdfb6a4(0x11c)]||_0x48ad71[_0xdfb6a4(0x10b)][_0xdfb6a4(0x11c)][_0xdfb6a4(0x10a)]===0x1;}async['listComments'](_0x1237a0,_0x37c061,_0x54331f){const _0x17e077=_0x4fd33a,_0x5830aa={'unitId':_0x1237a0,'threadId':_0x54331f},_0x2ccc3f=await this[_0x17e077(0x14a)][_0x17e077(0xed)](_0x17e077(0x10c)+_0x1237a0+_0x17e077(0x108),{'body':_0x5830aa}),_0xc384e7=_0x54331f[_0x17e077(0x12e)](_0x5460cc=>_0x5c7910(_0x2ccc3f[_0x17e077(0x10b)][_0x17e077(0x146)][_0x5460cc],_0x1237a0,_0x37c061))[_0x17e077(0x152)](Boolean);return Object[_0x17e077(0x15a)](_0x2ccc3f['body'][_0x17e077(0x143)])[_0x17e077(0x118)](_0x2cdc09=>{const _0x11efc6=_0x17e077;this['_userService'][_0x11efc6(0x121)](_0x2cdc09);}),_0xc384e7;}['saveCommentToSnapshot'](_0x2cf73b){const _0xcc253e=_0x4fd33a;return{'id':_0x2cf73b['id'],'threadId':_0x2cf73b[_0xcc253e(0x14b)],'ref':_0x2cf73b[_0xcc253e(0x116)]};}};_0x2b6b2e=_0x537eac([_0x3982a0(0x0,_0x174178[_0x4fd33a(0x165)](_0x5c6219['HTTPService'])),_0x3982a0(0x1,_0x174178['Inject'](_0x174178['UserManagerService'])),_0x3982a0(0x2,_0x174178[_0x4fd33a(0x165)](_0x3c2d2c[_0x4fd33a(0x154)])),_0x3982a0(0x3,_0x174178['Inject'](_0x174178[_0x4fd33a(0x115)]))],_0x2b6b2e);var _0xc61945=Object[_0x4fd33a(0x168)],_0x16a1f5=(_0x5f48f7,_0x39ee2c,_0xd501a8,_0x2a6093)=>{for(var _0x1309e5=_0x2a6093>0x1?void 0x0:_0x2a6093?_0xc61945(_0x39ee2c,_0xd501a8):_0x39ee2c,_0x4018f4=_0x5f48f7['length']-0x1,_0x385ca9;_0x4018f4>=0x0;_0x4018f4--)(_0x385ca9=_0x5f48f7[_0x4018f4])&&(_0x1309e5=_0x385ca9(_0x1309e5)||_0x1309e5);return _0x1309e5;},_0x1326a6=(_0x5d3bda,_0x201be9)=>(_0x57b4da,_0x2a3a0f)=>_0x201be9(_0x57b4da,_0x2a3a0f,_0x5d3bda);let _0x37f6ae=class extends _0x174178['Disposable']{constructor(_0x3e4f32,_0x37b3a3){const _0x5bb10b=_0x4fd33a;super(),this[_0x5bb10b(0xf5)]=_0x3e4f32,this[_0x5bb10b(0x12a)]=_0x37b3a3,this[_0x5bb10b(0x136)]();}[_0x4fd33a(0x136)](){const _0x3da6d1=_0x4fd33a;this[_0x3da6d1(0xf5)]['dataSource']=this[_0x3da6d1(0x12a)],this[_0x3da6d1(0xf5)]['syncUpdateMutationToColla']=!0x1;}};_0x37f6ae=_0x16a1f5([_0x1326a6(0x0,_0xe590ae[_0x4fd33a(0x156)]),_0x1326a6(0x1,_0x174178[_0x4fd33a(0x165)](_0x2b6b2e))],_0x37f6ae);var _0x57cdc6=Object[_0x4fd33a(0xfe)],_0x43ce82=Object[_0x4fd33a(0x168)],_0x2acd31=(_0x356cb6,_0xfb00f,_0x15b6d4)=>_0xfb00f in _0x356cb6?_0x57cdc6(_0x356cb6,_0xfb00f,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x15b6d4}):_0x356cb6[_0xfb00f]=_0x15b6d4,_0x2d50e6=(_0xb7961e,_0x19b640,_0x5404f1,_0x3ff23d)=>{for(var _0x2de114=_0x3ff23d>0x1?void 0x0:_0x3ff23d?_0x43ce82(_0x19b640,_0x5404f1):_0x19b640,_0x12e939=_0xb7961e['length']-0x1,_0x11ccfe;_0x12e939>=0x0;_0x12e939--)(_0x11ccfe=_0xb7961e[_0x12e939])&&(_0x2de114=_0x11ccfe(_0x2de114)||_0x2de114);return _0x2de114;},_0x3cc8ba=(_0x2f4ade,_0x4ba63f)=>(_0x3cc5d5,_0x52e6e4)=>_0x4ba63f(_0x3cc5d5,_0x52e6e4,_0x2f4ade),_0x238297=(_0x113df4,_0xf7711b,_0x1ae2ed)=>_0x2acd31(_0x113df4,typeof _0xf7711b!=_0x4fd33a(0x10d)?_0xf7711b+'':_0xf7711b,_0x1ae2ed);_0x1287a6[_0x4fd33a(0x140)]=class extends _0x174178[_0x4fd33a(0x109)]{constructor(_0x48c5c4=_0x3f2b12,_0x9fc264,_0x13c660){const _0x382714=_0x4fd33a;super(),this[_0x382714(0xf3)]=_0x48c5c4,this[_0x382714(0x13d)]=_0x9fc264,this['_configService']=_0x13c660;const {..._0x347221}=_0x174178['merge']({},_0x3f2b12,this[_0x382714(0xf3)]);this[_0x382714(0xf0)][_0x382714(0x13c)](_0x510603,_0x347221);}['onStarting'](){const _0x2751c1=_0x4fd33a;[[_0x2b6b2e],[_0x37f6ae],[_0x548fca]][_0x2751c1(0x118)](_0x136a58=>{const _0x4bb435=_0x2751c1;this[_0x4bb435(0x13d)][_0x4bb435(0x10f)](_0x136a58);});}[_0x4fd33a(0x155)](){const _0x537981=_0x4fd33a;this[_0x537981(0x13d)][_0x537981(0x167)](_0x37f6ae),this[_0x537981(0x13d)]['get'](_0x548fca);}},_0x238297(_0x1287a6[_0x4fd33a(0x140)],_0x4fd33a(0x15b),_0x1dc3b2),_0x238297(_0x1287a6[_0x4fd33a(0x140)],'type',_0x174178[_0x4fd33a(0x127)][_0x4fd33a(0x106)]),_0x1287a6[_0x4fd33a(0x140)]=_0x2d50e6([_0x174178[_0x4fd33a(0x138)](_0x223cc3[_0x4fd33a(0x144)],_0x3c2d2c[_0x4fd33a(0xfd)],_0x17604f['UniverLicensePlugin']),_0x3cc8ba(0x1,_0x174178[_0x4fd33a(0x165)](_0x174178[_0x4fd33a(0x115)])),_0x3cc8ba(0x2,_0x174178[_0x4fd33a(0xff)])],_0x1287a6['UniverThreadCommentDataSourcePlugin']),Object[_0x4fd33a(0xfe)](_0x1287a6,Symbol[_0x4fd33a(0x124)],{'value':'Module'});}));function _0xbda5(_0x2b897e,_0x3249e6){const _0x5ce534=_0x5ce5();return _0xbda5=function(_0xbda51e,_0x489ba1){_0xbda51e=_0xbda51e-0xe6;let _0x234e00=_0x5ce534[_0xbda51e];return _0x234e00;},_0xbda5(_0x2b897e,_0x3249e6);}function _0x5ce5(){const _0x3bc6a9=['ThreadCommentModel','_config','3522222GFmLww','_threadCommentDataSourceService','personId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','pipe','@univerjs-pro/collaboration-client','subscribe','createTimestamp','updateComment','UniverCollaborationClientPlugin','defineProperty','IConfigService','Solve','YYYY/MM/DD\x20HH:mm','comment','getCurrentUser','Unknown','UniverProLicense','UNIVER_UNKNOWN','getMemberID','/list','Plugin','code','body','/universer-api/comment/unit/','symbol','CustomRangeType','add','_commentService','content','getUnit','UserManagerService','4169712IiQgLo','Injector','ref','2UQQREN','forEach','rangeType','OpenOrReOpen','replyId','error','parse','solved','UNRECOGNIZED','/delete','addUser','slice','Reply','toStringTag','112992oUAnJS','addComment','UniverInstanceType','@univerjs-pro/license','/solved','_threadCommentDataSource','resolved','5XpGMlx','Add','map','type','@univerjs/core','length','function','@univerjs/thread-comment','deleteComment','UniverThreadCommentUi','_initDataSource','_init','DependentOn','CommentService','UniverCore','_sessionService','setConfig','_injector','_threadCommentModel','unitId','UniverThreadCommentDataSourcePlugin','disposeWithMe','delete','users','UniverThreadCommentUIPlugin','272FQqncl','comments','customRanges','userID','replies','_httpService','threadId','rangeId','3986240JOKUJZ','UniverNetwork','HTTPService','1056087oVwRFh','getUser','filter','Disposable','CollaborationSessionService','onReady','IThreadCommentDataSourceService','@univerjs/network','find','/add','values','pluginName','_userService','rxjs','resolveComment','_initUserSync','bufferTime','Delete','256171pRvgQB','userId','stringify','Inject','Solved','get','getOwnPropertyDescriptor','UniverProThreadCommentDatasource','object','user','format','getComment','81123ShmwOS','/reply','/edit','post','@univerjs/thread-comment-ui','reply','_configService','commentUpdate$'];_0x5ce5=function(){return _0x3bc6a9;};return _0x5ce5();}
|
|
1
|
+
function _0x27ff(_0x4dfe48,_0x31d53d){const _0x2e9f78=_0x2e9f();return _0x27ff=function(_0x27ff56,_0x58a3b4){_0x27ff56=_0x27ff56-0x109;let _0xd5b26f=_0x2e9f78[_0x27ff56];return _0xd5b26f;},_0x27ff(_0x4dfe48,_0x31d53d);}function _0x2e9f(){const _0x513c76=['filter','exports','pipe','find','getUser','UNIVER_UNKNOWN','root','/list','UniverProCollaborationClient','UniverInstanceType','639736KzZkli','2449426gIjNPa','UserManagerService','2114380JecsXX','_initUserSync','CustomRangeType','OpenOrReOpen','UniverCollaborationClientPlugin','merge','YYYY/MM/DD\x20HH:mm','commentUpdate$','post','Injector','solved','subscribe','forEach','Unknown','_httpService','4728618ZmDgDM','3309345LutOOR','get','disposeWithMe','COMMENT','_injector','pluginName','symbol','Reply','getOwnPropertyDescriptor','error','UniverProThreadCommentDatasource','@univerjs/network','threadId','_config','replyId','24IKUCZr','listComments','onStarting','slice','body','Delete','thread-comment-data-source.config','1287IIBqAi','IThreadCommentDataSourceService','_threadCommentDataSource','CollaborationSessionService','addUser','/add','format','_userService','resolved','payload','rxjs','replies','Solved','_commentService','/universer-api/comment/unit/','HTTPService','Edit','UniverThreadComment','stringify','comments','length','6BJqasE','getCurrentUser','_configService','user','_threadCommentDataSourceService','/solved','customRanges','dataSource','resolveComment','UniverCore','updateComment','add','saveCommentToSnapshot','type','CommentService','unitId','parse','content','object','Plugin','userId','@univerjs-pro/collaboration-client','UniverThreadCommentDataSourcePlugin','Solve','UNRECOGNIZED','size','getUnit','_sessionService','@univerjs/core','createTimestamp','@univerjs/thread-comment-ui','/edit','Add','deleteComment','reply','Inject','UniverThreadCommentUIPlugin','setConfig','DependentOn','parentId','defineProperty','bufferTime','UniverLicensePlugin','_threadCommentModel','@univerjs/thread-comment','4268460ZMQgpt','1uwMCgq','_init','rangeId','UniverProLicense','dayjs','_initDataSource','UniverThreadCommentUi','map','172170FuuzVr','users','@univerjs-pro/license','IConfigService','requireSession','personId','rangeType','code'];_0x2e9f=function(){return _0x513c76;};return _0x2e9f();}(function(_0x20baaa,_0x5679f6){const _0x508fee=_0x27ff,_0x4b3d17=_0x20baaa();while(!![]){try{const _0x2a7bf1=-parseInt(_0x508fee(0x13c))/0x1*(-parseInt(_0x508fee(0x159))/0x2)+-parseInt(_0x508fee(0x13b))/0x3+parseInt(_0x508fee(0x156))/0x4+-parseInt(_0x508fee(0x169))/0x5*(-parseInt(_0x508fee(0x10e))/0x6)+-parseInt(_0x508fee(0x157))/0x7*(parseInt(_0x508fee(0x178))/0x8)+-parseInt(_0x508fee(0x168))/0x9+parseInt(_0x508fee(0x144))/0xa*(parseInt(_0x508fee(0x17f))/0xb);if(_0x2a7bf1===_0x5679f6)break;else _0x4b3d17['push'](_0x4b3d17['shift']());}catch(_0x48fccc){_0x4b3d17['push'](_0x4b3d17['shift']());}}}(_0x2e9f,0xda9ae),function(_0x192ba9,_0x423917){const _0x433cfa=_0x27ff;typeof exports==_0x433cfa(0x120)&&typeof module<'u'?_0x423917(exports,require('@univerjs-pro/collaboration-client'),require(_0x433cfa(0x146)),require(_0x433cfa(0x12a)),require(_0x433cfa(0x12c)),require(_0x433cfa(0x13a)),require(_0x433cfa(0x189)),require(_0x433cfa(0x174))):typeof define=='function'&&define['amd']?define([_0x433cfa(0x14d),_0x433cfa(0x123),_0x433cfa(0x146),_0x433cfa(0x12a),_0x433cfa(0x12c),_0x433cfa(0x13a),_0x433cfa(0x189),_0x433cfa(0x174)],_0x423917):(_0x192ba9=typeof globalThis<'u'?globalThis:_0x192ba9||self,_0x423917(_0x192ba9[_0x433cfa(0x173)]={},_0x192ba9[_0x433cfa(0x154)],_0x192ba9[_0x433cfa(0x13f)],_0x192ba9[_0x433cfa(0x117)],_0x192ba9[_0x433cfa(0x142)],_0x192ba9[_0x433cfa(0x10a)],_0x192ba9[_0x433cfa(0x189)],_0x192ba9['UniverNetwork']));}(this,function(_0x208d67,_0x512cec,_0x116b22,_0x4c72af,_0x768b18,_0x1da53d,_0x171811,_0x1534ea){'use strict';const _0x1847fc=_0x27ff;const _0x525e6e='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x442e7b=(_0x309b36=>(_0x309b36[_0x309b36['OpenOrReOpen']=0x0]=_0x1847fc(0x15c),_0x309b36[_0x309b36[_0x1847fc(0x18b)]=0x1]=_0x1847fc(0x18b),_0x309b36[_0x309b36[_0x1847fc(0x126)]=-0x1]=_0x1847fc(0x126),_0x309b36))(_0x442e7b||{}),_0x8d4419=(_0x19a131=>(_0x19a131[_0x19a131['Unknown']=0x0]=_0x1847fc(0x166),_0x19a131[_0x19a131[_0x1847fc(0x12e)]=0x1]=_0x1847fc(0x12e),_0x19a131[_0x19a131['Reply']=0x2]=_0x1847fc(0x170),_0x19a131[_0x19a131[_0x1847fc(0x109)]=0x3]=_0x1847fc(0x109),_0x19a131[_0x19a131[_0x1847fc(0x17d)]=0x4]=_0x1847fc(0x17d),_0x19a131[_0x19a131[_0x1847fc(0x125)]=0x5]='Solve',_0x19a131[_0x19a131['UNRECOGNIZED']=-0x1]=_0x1847fc(0x126),_0x19a131))(_0x8d4419||{});const _0x3fe7c4=_0x5a6b86=>_0x4c72af[_0x1847fc(0x140)](new Date(+_0x5a6b86))[_0x1847fc(0x185)](_0x1847fc(0x15f)),_0x5012ad=async(_0x519b0c,_0x2b7a90)=>{const _0x280702=_0x1847fc,_0x20e807=_0x519b0c[_0x280702(0x16a)](_0x4c72af[_0x280702(0x158)]),_0x1c1e35=_0x519b0c[_0x280702(0x16a)](_0x1534ea[_0x280702(0x18e)]);_0x2b7a90[_0x280702(0x165)](_0x2e83bb=>{const _0x5e1001=_0x280702;_0x20e807[_0x5e1001(0x150)](_0x2e83bb)&&_0x2b7a90['delete'](_0x2e83bb);}),_0x2b7a90[_0x280702(0x127)]&&(await _0x1c1e35['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x2b7a90]}}))[_0x280702(0x17c)]['users'][_0x280702(0x165)](_0x5e0642=>{const _0x4eb072=_0x280702;_0x5e0642&&_0x20e807[_0x4eb072(0x183)](_0x5e0642);});};var _0x3b6f91=Object[_0x1847fc(0x171)],_0x485b33=(_0x2832a3,_0x7d805d,_0x2bbc86,_0x4a2bcc)=>{const _0xcc8695=_0x1847fc;for(var _0x2a7e37=_0x4a2bcc>0x1?void 0x0:_0x4a2bcc?_0x3b6f91(_0x7d805d,_0x2bbc86):_0x7d805d,_0x189b23=_0x2832a3[_0xcc8695(0x10d)]-0x1,_0x647ee6;_0x189b23>=0x0;_0x189b23--)(_0x647ee6=_0x2832a3[_0x189b23])&&(_0x2a7e37=_0x647ee6(_0x2a7e37)||_0x2a7e37);return _0x2a7e37;},_0x40db28=(_0x241529,_0x5b79a4)=>(_0x1ad0bd,_0x5598a2)=>_0x5b79a4(_0x1ad0bd,_0x5598a2,_0x241529);let _0x150d3a=class extends _0x4c72af['Disposable']{constructor(_0x4bc159,_0x580ee1,_0x18e4db,_0xd109ec){const _0x2cd573=_0x1847fc;super(),this[_0x2cd573(0x18c)]=_0x4bc159,this[_0x2cd573(0x139)]=_0x580ee1,this[_0x2cd573(0x186)]=_0x18e4db,this[_0x2cd573(0x16d)]=_0xd109ec,this['_init'](),this['_initUserSync']();}[_0x1847fc(0x15a)](){const _0x6fb474=_0x1847fc;this['disposeWithMe'](this[_0x6fb474(0x139)][_0x6fb474(0x160)][_0x6fb474(0x14e)](_0x171811[_0x6fb474(0x137)](0x10))[_0x6fb474(0x164)](_0x16cd8a=>{const _0x1119f=new Set();_0x16cd8a['forEach'](_0x8fbfa0=>{const _0x257f4a=_0x27ff;switch(_0x8fbfa0[_0x257f4a(0x11b)]){case _0x257f4a(0x119):{const _0x3fd3e2=_0x8fbfa0[_0x257f4a(0x188)][_0x257f4a(0x149)];_0x1119f[_0x257f4a(0x119)](_0x3fd3e2);break;}}}),_0x5012ad(this['_injector'],_0x1119f);}));}[_0x1847fc(0x13d)](){const _0x5981a5=_0x1847fc;this[_0x5981a5(0x16b)](this[_0x5981a5(0x18c)]['commentUpdate$'][_0x5981a5(0x164)](async _0x52e5eb=>{const _0x153d6d=_0x5981a5;var _0x1e361b,_0x18b5a9,_0xd478b3,_0x52d0df;const _0x1e343c=(_0x1e361b=this['_threadCommentModel'][_0x153d6d(0x128)](_0x52e5eb[_0x153d6d(0x11d)])[_0x153d6d(0x14f)](_0x4669ae=>_0x4669ae[_0x153d6d(0x175)]===_0x52e5eb[_0x153d6d(0x175)]))==null?void 0x0:_0x1e361b[_0x153d6d(0x152)];if(!_0x1e343c)return;const {unitId:_0xfefdb2,subUnitId:_0xb4c6c4}=_0x1e343c;switch(_0x52e5eb[_0x153d6d(0x111)]&&this[_0x153d6d(0x186)][_0x153d6d(0x183)](_0x52e5eb[_0x153d6d(0x111)]),_0x52e5eb[_0x153d6d(0x11b)]){case _0x8d4419[_0x153d6d(0x12e)]:break;case _0x8d4419['Reply']:{this['_threadCommentModel']['addComment'](_0xfefdb2,_0xb4c6c4,{'unitId':_0xfefdb2,'subUnitId':_0xb4c6c4,'ref':'','id':_0x52e5eb['replyId'],'dT':_0x3fe7c4(+_0x52e5eb['createTimestamp']),'threadId':_0x52e5eb[_0x153d6d(0x175)],'personId':(_0xd478b3=(_0x18b5a9=_0x52e5eb[_0x153d6d(0x111)])==null?void 0x0:_0x18b5a9['userID'])!=null?_0xd478b3:_0x52e5eb['userId'],'text':JSON[_0x153d6d(0x11e)](_0x52e5eb['content']),'parentId':_0x1e343c['id']});break;}case _0x8d4419[_0x153d6d(0x17d)]:{const _0x58e3f6=this[_0x153d6d(0x139)]['getComment'](_0xfefdb2,_0xb4c6c4,_0x52e5eb[_0x153d6d(0x177)]);_0x58e3f6&&_0x58e3f6[_0x153d6d(0x135)]&&this[_0x153d6d(0x139)][_0x153d6d(0x12f)](_0xfefdb2,_0xb4c6c4,_0x52e5eb['replyId']);break;}case _0x8d4419[_0x153d6d(0x109)]:{this[_0x153d6d(0x139)][_0x153d6d(0x118)](_0xfefdb2,_0xb4c6c4,{'commentId':_0x52e5eb['replyId'],'text':JSON['parse'](_0x52e5eb['content'])});break;}case _0x8d4419[_0x153d6d(0x125)]:{const _0x10046c=(_0x52d0df=this[_0x153d6d(0x139)][_0x153d6d(0x128)](_0x52e5eb[_0x153d6d(0x11d)])[_0x153d6d(0x14f)](_0x5f3e51=>_0x5f3e51[_0x153d6d(0x175)]===_0x52e5eb[_0x153d6d(0x175)]))==null?void 0x0:_0x52d0df[_0x153d6d(0x152)];_0x10046c&&this[_0x153d6d(0x139)][_0x153d6d(0x116)](_0xfefdb2,_0xb4c6c4,_0x10046c['id'],_0x52e5eb[_0x153d6d(0x163)]===_0x442e7b[_0x153d6d(0x18b)]);break;}}}));}};_0x150d3a=_0x485b33([_0x40db28(0x0,_0x4c72af[_0x1847fc(0x131)](_0x512cec[_0x1847fc(0x11c)])),_0x40db28(0x1,_0x4c72af['Inject'](_0x1da53d['ThreadCommentModel'])),_0x40db28(0x2,_0x4c72af[_0x1847fc(0x131)](_0x4c72af['UserManagerService'])),_0x40db28(0x3,_0x4c72af['Inject'](_0x4c72af['Injector']))],_0x150d3a);const _0xeb771a=_0x1847fc(0x17e),_0x4ee598={};var _0x1598f5=Object[_0x1847fc(0x171)],_0x34b079=(_0x4e172c,_0x4579e8,_0x955d68,_0x3c7aa3)=>{for(var _0x50bab4=_0x3c7aa3>0x1?void 0x0:_0x3c7aa3?_0x1598f5(_0x4579e8,_0x955d68):_0x4579e8,_0x2e2e05=_0x4e172c['length']-0x1,_0x48a193;_0x2e2e05>=0x0;_0x2e2e05--)(_0x48a193=_0x4e172c[_0x2e2e05])&&(_0x50bab4=_0x48a193(_0x50bab4)||_0x50bab4);return _0x50bab4;},_0x14c14a=(_0x448ed0,_0x5b65a3)=>(_0x5e8eba,_0x41c721)=>_0x5b65a3(_0x5e8eba,_0x41c721,_0x448ed0);function _0x1aedfb(_0x25cd98,_0x4e7acc){const _0x4aff2c=_0x1847fc,_0x4061a8=_0x25cd98[_0x4aff2c(0x18a)][0x0];return{..._0x4e7acc,'id':_0x4061a8['replyId'],'resolved':_0x25cd98[_0x4aff2c(0x163)]===0x1,'dT':_0x3fe7c4(_0x4061a8[_0x4aff2c(0x12b)]),'personId':_0x4061a8['userId'],'threadId':_0x4061a8[_0x4aff2c(0x175)]};}function _0x51f13b(_0x55d49b,_0x1194cd,_0xac9dc2){const _0x491143=_0x1847fc;var _0x43d7b7,_0x5b470d;if(((_0x5b470d=(_0x43d7b7=_0x55d49b==null?void 0x0:_0x55d49b['replies'])==null?void 0x0:_0x43d7b7[_0x491143(0x10d)])!=null?_0x5b470d:0x0)>0x0){const _0xde3788=(_0x52395d,_0x13f96c)=>({'id':_0x52395d[_0x491143(0x177)],'threadId':_0x52395d[_0x491143(0x175)],'dT':_0x3fe7c4(_0x52395d[_0x491143(0x12b)]),'personId':_0x52395d[_0x491143(0x122)],'resolved':_0x55d49b[_0x491143(0x163)]===_0x442e7b['Solved'],'unitId':_0x1194cd,'subUnitId':_0xac9dc2,'text':JSON[_0x491143(0x11e)](_0x52395d[_0x491143(0x11f)]),'parentId':_0x13f96c}),_0x54480a=_0xde3788(_0x55d49b['replies'][0x0]);return{..._0x54480a,'children':_0x55d49b[_0x491143(0x18a)][_0x491143(0x17b)](0x1)[_0x491143(0x143)](_0x3086f7=>_0xde3788(_0x3086f7,_0x54480a['id']))};}return null;}let _0x5e6757=class{constructor(_0x4734a5,_0x162c80,_0x6927c8,_0x4de540){const _0x54296f=_0x1847fc;this[_0x54296f(0x167)]=_0x4734a5,this['_userService']=_0x162c80,this[_0x54296f(0x129)]=_0x6927c8,this[_0x54296f(0x16d)]=_0x4de540;}async['addComment'](_0x48e582){const _0x24e0b7=_0x1847fc;var _0x2140ee,_0x4a0ad8;const {parentId:_0x588d02,unitId:_0x36ac04,text:_0x4d5a89,threadId:_0x468e85}=_0x48e582,_0x2b9b64=(_0x4a0ad8=(_0x2140ee=_0x4d5a89[_0x24e0b7(0x114)])==null?void 0x0:_0x2140ee[_0x24e0b7(0x14c)](_0x4146a7=>_0x4146a7[_0x24e0b7(0x14a)]===_0x4c72af[_0x24e0b7(0x15b)][_0x24e0b7(0x16c)])[_0x24e0b7(0x143)](_0x531b89=>_0x531b89['rangeId']))!=null?_0x4a0ad8:[],_0x286861=JSON[_0x24e0b7(0x10b)](_0x4d5a89),_0x50906d=(await this['_sessionService'][_0x24e0b7(0x148)](_0x36ac04))['getMemberID']();if(_0x588d02){const _0x215eeb={'memberId':_0x50906d,'unitId':_0x36ac04,'content':_0x286861,'mention':_0x2b9b64,'threadId':_0x468e85},_0x5f022d=(await this[_0x24e0b7(0x167)]['post'](_0x24e0b7(0x18d)+_0x36ac04+'/reply',{'body':_0x215eeb}))[_0x24e0b7(0x17c)][_0x24e0b7(0x130)];return{..._0x48e582,'id':_0x5f022d[_0x24e0b7(0x177)],'dT':_0x4c72af[_0x24e0b7(0x140)](+_0x5f022d[_0x24e0b7(0x12b)])[_0x24e0b7(0x185)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x5f022d[_0x24e0b7(0x122)]};}else{const _0xd2162b={'memberId':_0x50906d,'unitId':_0x36ac04,'content':_0x286861,'mention':_0x2b9b64},_0xe338d7=await this[_0x24e0b7(0x167)]['post'](_0x24e0b7(0x18d)+_0x36ac04+_0x24e0b7(0x184),{'body':_0xd2162b});return _0x1aedfb(_0xe338d7['body']['comment'],_0x48e582);}}async[_0x1847fc(0x118)](_0xb17a4b){const _0x5d79ee=_0x1847fc;var _0xb16066,_0x246569;const {text:_0x58c22b,unitId:_0x246060}=_0xb17a4b,_0x58f202=(_0x246569=(_0xb16066=_0x58c22b[_0x5d79ee(0x114)])==null?void 0x0:_0xb16066[_0x5d79ee(0x14c)](_0x3fcd8c=>_0x3fcd8c[_0x5d79ee(0x14a)]===_0x4c72af[_0x5d79ee(0x15b)][_0x5d79ee(0x16c)])[_0x5d79ee(0x143)](_0x31b472=>_0x31b472[_0x5d79ee(0x13e)]))!=null?_0x246569:[],_0x86f1f6=JSON[_0x5d79ee(0x10b)](_0x58c22b),_0x5db0e8=_0xb17a4b[_0x5d79ee(0x175)],_0x453faa=_0xb17a4b['id'],_0x505abd={'memberId':(await this[_0x5d79ee(0x129)][_0x5d79ee(0x148)](_0x246060))['getMemberID'](),'unitId':_0x246060,'threadId':_0x5db0e8,'mention':_0x58f202,'content':_0x86f1f6,'replyId':_0x453faa},_0x2e3f16=await this[_0x5d79ee(0x167)][_0x5d79ee(0x161)](_0x5d79ee(0x18d)+_0x246060+_0x5d79ee(0x12d),{'body':_0x505abd});return!_0x2e3f16[_0x5d79ee(0x17c)][_0x5d79ee(0x172)]||_0x2e3f16['body'][_0x5d79ee(0x172)][_0x5d79ee(0x14b)]===0x1;}async['resolveComment'](_0x1ace60){const _0x121e64=_0x1847fc,{unitId:_0x96c17d}=_0x1ace60,_0xbf2954=_0x1ace60[_0x121e64(0x175)],_0x588132={'memberId':this[_0x121e64(0x186)][_0x121e64(0x10f)]()['userID'],'unitId':_0x96c17d,'threadId':_0xbf2954,'solved':_0x1ace60[_0x121e64(0x187)]?_0x442e7b[_0x121e64(0x18b)]:_0x442e7b[_0x121e64(0x15c)]},_0x51535e=await this[_0x121e64(0x167)]['post'](_0x121e64(0x18d)+_0x96c17d+_0x121e64(0x113),{'body':_0x588132});return!_0x51535e['body'][_0x121e64(0x172)]||_0x51535e[_0x121e64(0x17c)]['error'][_0x121e64(0x14b)]===0x1;}async[_0x1847fc(0x12f)](_0x531563,_0x55c173,_0x4a20bc,_0x47d909){const _0x148889=_0x1847fc,_0x290f45={'memberId':(await this[_0x148889(0x129)][_0x148889(0x148)](_0x531563))['getMemberID'](),'threadId':_0x4a20bc,'replyId':_0x47d909,'unitId':_0x531563},_0x2c0457=await this[_0x148889(0x167)][_0x148889(0x161)](_0x148889(0x18d)+_0x531563+'/delete',{'body':_0x290f45});return!_0x2c0457[_0x148889(0x17c)][_0x148889(0x172)]||_0x2c0457[_0x148889(0x17c)]['error'][_0x148889(0x14b)]===0x1;}async[_0x1847fc(0x179)](_0x392ae5,_0x5b95cb,_0x4ee0e9){const _0x5e9868=_0x1847fc,_0x156c04={'unitId':_0x392ae5,'threadId':_0x4ee0e9},_0xbcef20=await this[_0x5e9868(0x167)][_0x5e9868(0x161)](_0x5e9868(0x18d)+_0x392ae5+_0x5e9868(0x153),{'body':_0x156c04}),_0x3be057=_0x4ee0e9[_0x5e9868(0x143)](_0x3eb41a=>_0x51f13b(_0xbcef20[_0x5e9868(0x17c)][_0x5e9868(0x10c)][_0x3eb41a],_0x392ae5,_0x5b95cb))[_0x5e9868(0x14c)](Boolean);return Object['values'](_0xbcef20['body'][_0x5e9868(0x145)])[_0x5e9868(0x165)](_0x2e36c1=>{const _0x2ce171=_0x5e9868;this[_0x2ce171(0x186)]['addUser'](_0x2e36c1);}),_0x3be057;}[_0x1847fc(0x11a)](_0x429c56){const _0x8f0400=_0x1847fc;return{'id':_0x429c56['id'],'threadId':_0x429c56[_0x8f0400(0x175)],'ref':_0x429c56['ref']};}};_0x5e6757=_0x34b079([_0x14c14a(0x0,_0x4c72af[_0x1847fc(0x131)](_0x1534ea[_0x1847fc(0x18e)])),_0x14c14a(0x1,_0x4c72af['Inject'](_0x4c72af['UserManagerService'])),_0x14c14a(0x2,_0x4c72af[_0x1847fc(0x131)](_0x512cec[_0x1847fc(0x182)])),_0x14c14a(0x3,_0x4c72af[_0x1847fc(0x131)](_0x4c72af[_0x1847fc(0x162)]))],_0x5e6757);var _0x30e7a7=Object[_0x1847fc(0x171)],_0x36aed0=(_0x3175c5,_0x376bb3,_0x396726,_0x5e173c)=>{const _0x2588d8=_0x1847fc;for(var _0x8e0f73=_0x5e173c>0x1?void 0x0:_0x5e173c?_0x30e7a7(_0x376bb3,_0x396726):_0x376bb3,_0x3bf99b=_0x3175c5[_0x2588d8(0x10d)]-0x1,_0x1d7301;_0x3bf99b>=0x0;_0x3bf99b--)(_0x1d7301=_0x3175c5[_0x3bf99b])&&(_0x8e0f73=_0x1d7301(_0x8e0f73)||_0x8e0f73);return _0x8e0f73;},_0x51356c=(_0x497ee7,_0x1ec94b)=>(_0x4eb1ba,_0x143a98)=>_0x1ec94b(_0x4eb1ba,_0x143a98,_0x497ee7);let _0x52b74f=class extends _0x4c72af['Disposable']{constructor(_0x41a224,_0x23f86f){const _0x4c7efd=_0x1847fc;super(),this[_0x4c7efd(0x112)]=_0x41a224,this['_threadCommentDataSource']=_0x23f86f,this[_0x4c7efd(0x141)]();}['_initDataSource'](){const _0x4f5ea4=_0x1847fc;this[_0x4f5ea4(0x112)][_0x4f5ea4(0x115)]=this[_0x4f5ea4(0x181)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};_0x52b74f=_0x36aed0([_0x51356c(0x0,_0x1da53d[_0x1847fc(0x180)]),_0x51356c(0x1,_0x4c72af[_0x1847fc(0x131)](_0x5e6757))],_0x52b74f);var _0x4ffa55=Object[_0x1847fc(0x136)],_0x51772b=Object[_0x1847fc(0x171)],_0x55355c=(_0x406e9c,_0x14ff2d,_0x413086)=>_0x14ff2d in _0x406e9c?_0x4ffa55(_0x406e9c,_0x14ff2d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x413086}):_0x406e9c[_0x14ff2d]=_0x413086,_0x55e57c=(_0x5a83fe,_0x466c18,_0x4a5ffc,_0x324fd3)=>{const _0x37d09c=_0x1847fc;for(var _0x39a988=_0x324fd3>0x1?void 0x0:_0x324fd3?_0x51772b(_0x466c18,_0x4a5ffc):_0x466c18,_0x103492=_0x5a83fe[_0x37d09c(0x10d)]-0x1,_0x139fa8;_0x103492>=0x0;_0x103492--)(_0x139fa8=_0x5a83fe[_0x103492])&&(_0x39a988=_0x139fa8(_0x39a988)||_0x39a988);return _0x39a988;},_0x327c18=(_0x27f42d,_0x5d3d83)=>(_0x4c4f8a,_0x37f684)=>_0x5d3d83(_0x4c4f8a,_0x37f684,_0x27f42d),_0xb69d95=(_0x2e8198,_0x5ee923,_0x24e38b)=>_0x55355c(_0x2e8198,typeof _0x5ee923!=_0x1847fc(0x16f)?_0x5ee923+'':_0x5ee923,_0x24e38b);_0x208d67['UniverThreadCommentDataSourcePlugin']=class extends _0x4c72af[_0x1847fc(0x121)]{constructor(_0x1b7c58=_0x4ee598,_0xac8e65,_0x1714bc){const _0x26c048=_0x1847fc;super(),this[_0x26c048(0x176)]=_0x1b7c58,this[_0x26c048(0x16d)]=_0xac8e65,this[_0x26c048(0x110)]=_0x1714bc;const {..._0x2f1e7a}=_0x4c72af[_0x26c048(0x15e)]({},_0x4ee598,this[_0x26c048(0x176)]);this['_configService'][_0x26c048(0x133)](_0xeb771a,_0x2f1e7a);}[_0x1847fc(0x17a)](){const _0xf2d03=_0x1847fc;[[_0x5e6757],[_0x52b74f],[_0x150d3a]][_0xf2d03(0x165)](_0x1f30b7=>{this['_injector']['add'](_0x1f30b7);});}['onReady'](){const _0x339513=_0x1847fc;this[_0x339513(0x16d)]['get'](_0x52b74f),this['_injector']['get'](_0x150d3a);}},_0xb69d95(_0x208d67[_0x1847fc(0x124)],_0x1847fc(0x16e),_0x525e6e),_0xb69d95(_0x208d67[_0x1847fc(0x124)],'type',_0x4c72af[_0x1847fc(0x155)][_0x1847fc(0x151)]),_0x208d67['UniverThreadCommentDataSourcePlugin']=_0x55e57c([_0x4c72af[_0x1847fc(0x134)](_0x768b18[_0x1847fc(0x132)],_0x512cec[_0x1847fc(0x15d)],_0x116b22[_0x1847fc(0x138)]),_0x327c18(0x1,_0x4c72af[_0x1847fc(0x131)](_0x4c72af[_0x1847fc(0x162)])),_0x327c18(0x2,_0x4c72af[_0x1847fc(0x147)])],_0x208d67[_0x1847fc(0x124)]),Object[_0x1847fc(0x136)](_0x208d67,Symbol['toStringTag'],{'value':'Module'});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.6.0
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.6.0
|
|
49
|
-
"@univerjs
|
|
50
|
-
"@univerjs/
|
|
51
|
-
"@univerjs/network": "0.6.0
|
|
52
|
-
"@univerjs/thread-comment": "0.6.0-nightly.202502141606",
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.6.0",
|
|
49
|
+
"@univerjs/core": "0.6.0",
|
|
50
|
+
"@univerjs-pro/license": "0.6.0",
|
|
51
|
+
"@univerjs/network": "0.6.0",
|
|
53
52
|
"@univerjs/protocol": "0.1.44-alpha.2",
|
|
54
|
-
"@univerjs/thread-comment
|
|
53
|
+
"@univerjs/thread-comment": "0.6.0",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.6.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "^7.8.1",
|